4 extern uiolen f__reclen
;
13 f__external
=f__sequential
=1;
15 f__curunit
= &f__units
[a
->ciunit
];
16 if(a
->ciunit
>= MXUNIT
|| a
->ciunit
< 0)
17 err(a
->cierr
,101,"startio");
19 if(f__curunit
->ufd
==NULL
&& fk_open(SEQ
,UNF
,a
->ciunit
))
20 err(a
->cierr
,114,"sue");
21 f__cf
=f__curunit
->ufd
;
22 if(f__curunit
->ufmt
) err(a
->cierr
,103,"sue");
23 if(!f__curunit
->useek
) err(a
->cierr
,103,"sue");
27 integer
s_rsue(a
) cilist
*a
;
29 integer
s_rsue(cilist
*a
)
33 if(f__init
!= 1) f_init();
36 if(n
=c_sue(a
)) return(n
);
38 if(f__curunit
->uwrt
&& f__nowreading(f__curunit
))
39 err(a
->cierr
, errno
, "read start");
40 if(fread((char *)&f__reclen
,sizeof(uiolen
),1,f__cf
)
43 { f__curunit
->uend
= 1;
44 err(a
->ciend
, EOF
, "start");
47 err(a
->cierr
, errno
, "start");
52 integer
s_wsue(a
) cilist
*a
;
54 integer
s_wsue(cilist
*a
)
58 if(f__init
!= 1) f_init();
60 if(n
=c_sue(a
)) return(n
);
63 if(f__curunit
->uwrt
!= 1 && f__nowwriting(f__curunit
))
64 err(a
->cierr
, errno
, "write start");
65 f__recloc
=FTELL(f__cf
);
66 FSEEK(f__cf
,(off_t
)sizeof(uiolen
),SEEK_CUR
);
72 fwrite((char *)&f__reclen
,sizeof(uiolen
),1,f__cf
);
75 err(f__elist
->cierr
, errno
, "write end");
78 FSEEK(f__cf
,f__recloc
,SEEK_SET
);
79 fwrite((char *)&f__reclen
,sizeof(uiolen
),1,f__cf
);
80 FSEEK(f__cf
,loc
,SEEK_SET
);
86 FSEEK(f__cf
,(off_t
)(f__reclen
-f__recpos
+sizeof(uiolen
)),SEEK_CUR
);