rsh.c 644 141 22 640 4136730640 5022 1 space dsimr rsh.p1.in rsh.p1.out 2 space xsimr rsh.p2.in rsh.p2.out 3 stanman dsimr rsh.p3.in rsh.p3.out 4 stanman xsimr rsh.p4.in rsh.p4.out 5 plas2 dsimr rsh.p5.in rsh.p5.out 6 plas2 xsimr rsh.p6.in rsh.p6.out 7 space dsimr rsh.p7.in rsh.p7.out 8 space xsimr rsh.p8.in rsh.p8.out xe~jwrUtrsUkgs(.plas5:%plas5%h1=%dev%sd3gnrshrd.c 644 141 22 1744 4136730644 5402 #include /* /* rshrd */ static int rm=0; /* read mode for open */ static int ib; /* file descriptor */ rshrd_( file, len, buf, ieod) char *file; /* file name */ int *len; /* number of bytes in buffer */ char *buf; /* data buffer */ int *ieod; { char f[64]; /* local file name */ int i,j; /* temp int */ char *c,ch; /* more temp storage */ int nb1,nb2; /* length of storage */ for ( i=0 ; *file != ' ' ; file++, i++) f[i] = *file; f[i] = '\0'; ib = open( f , rm); if ( ib < 0 ) { *ieod = 1; return; } *ieod = 0; i = read( ib, &nb1, 4); /* read in record length */ if ( i < 4 ) *ieod = -1;/* mark on read error */ i = read ( ib, buf, nb1); /* read in record */ if ( i < 4 ) *ieod += -10; if ( i != nb1) *ieod += -20; i = read ( ib, &nb2, 4);/* read in record length */ if ( i < 4 ) *ieod += -100; if ( nb1 != nb2 ) *ieod += -200; /* do header & trailer agree? */ *len = nb1; /* return number of bytes of data */ close( ib); return; } vecT^|plsplslrshwrt.c 644 141 22 1656 4136731016 5605 #include /* /* rshwrt.c */ #define WM 0644 /* write mode for create */ static int ib; /* file descriptor */ rshwrt_( file, len, buf, ieod) char *file; /* file name */ int *len; /* number of bytes in buffer */ char *buf; /* data buffer */ int *ieod; { char f[129]; /* local file name */ int i,j; /* temp int */ char *c,ch; /* more temp storage */ int nb1,nb2; /* length of storage */ for( i=0; *file != ' ' && i < 128; i++, file++) f[i] = *file; f[i] = '\0'; ib = creat( f , WM ) ; if ( ib < 0 ) { *ieod = 1; return; } *ieod = 0; nb1 = nb2 = *len; /* set length of record */ i = write( ib, &nb1, 4); /* write in record length */ if ( i < 4 ) *ieod = -1;/* mark on write error */ i = write ( ib, buf, nb1); /* write in record */ if ( i < 4 ) *ieod = -1; if ( i != nb1) *ieod = -2; i = write ( ib, &nb2, 4);/* write in record length */ if ( i < 4 ) *ieod = -1; close( ib); return; } turn number of bytes of data */ close( ib); return; } vecT^|plsplslsyscmd_.c 644 141 22 512 4136731041 5661 /* test of system command from fortran */ syscmd_(ch,i,j) char *ch; /* command terminated by ! */ int *i,j; /* error return, ans length of ch */ { int l,k; char f[513]; /* temr command storage */ k = (j < 512) ? j : 512; for ( l=0; l