sfe.c 828 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* sequential formatted external common routines*/
  2. #include "f2c.h"
  3. #include "fio.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #ifdef KR_headers
  8. extern char *f__fmtbuf;
  9. #else
  10. extern const char *f__fmtbuf;
  11. #endif
  12. integer e_rsfe(Void)
  13. { int n;
  14. n=en_fio();
  15. f__fmtbuf=NULL;
  16. return(n);
  17. }
  18. int
  19. #ifdef KR_headers
  20. c_sfe(a) cilist *a; /* check */
  21. #else
  22. c_sfe(cilist *a) /* check */
  23. #endif
  24. { unit *p;
  25. f__curunit = p = &f__units[a->ciunit];
  26. if(a->ciunit >= MXUNIT || a->ciunit<0)
  27. err(a->cierr,101,"startio");
  28. if(p->ufd==NULL && fk_open(SEQ,FMT,a->ciunit)) err(a->cierr,114,"sfe")
  29. if(!p->ufmt) err(a->cierr,102,"sfe")
  30. return(0);
  31. }
  32. integer e_wsfe(Void)
  33. {
  34. int n = en_fio();
  35. f__fmtbuf = NULL;
  36. #ifdef ALWAYS_FLUSH
  37. if (!n && fflush(f__cf))
  38. err(f__elist->cierr, errno, "write end");
  39. #endif
  40. return n;
  41. }
  42. #ifdef __cplusplus
  43. }
  44. #endif