#include "chdecl.h"
void CH_makestringpipe(current, sched, cop)
#define ARGUMENTS 4
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb1;
    case 2: goto c2;
    case 3: goto c9;  }
c0:
/* block , 0 */
  if((ch_returncode = che_block(QUAL(0),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 1;
cb1:
/* receive 3 0 */
  if ((ch_returncode = che_receive(DEF(3),DEF(0),sched)) != Normal)
     goto ch_raise_exception;
  return;
c2:
/* new_inport 4 */
  if ((ch_val.inport = make_inport()) == nil) goto ch_depletion;
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  REF(4).value = ch_val; REF(4).tsdr = & dr_inport;
/* connect 5 4 */
  if (REF(4).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(4).value.inport->refcount++;
  REF(5).value.outport = REF(4).value.inport;
  REF(5).tsdr = & dr_outport;
/* wrap 3.1 4 , 1 */
  if ((ch_returncode = che_wrap(DEF(3)DOT(1),DEF(4),QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
/* wrap 3.0 5 , 2 */
  if ((ch_returncode = che_wrap(DEF(3)DOT(0),DEF(5),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
/* return 3 */
  if (ch_caller = do_return(REF(3).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(3).value);
  REF(3).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
c9:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
