Exemple #1
0
int s_wdfe64_mp (cilist64 *a, unit **fu) {

#else

int
s_wdfe_mp (cilist *a, unit **fu) {
#endif
   int             n;
   unit		*ftnunit;

   if (!f77init)
      f_init ();
   if (n = c_dfe (a, fu)) {
      if (*fu) (*fu)->lock_unit = 0;
      return (n);
   }
   ftnunit = *fu;
   if (ftnunit->uwrt != WR_READY && f77nowwriting (ftnunit))
      errret(a->cierr, 160, "startwrt");
   ftnunit->f77putn = y_putc;
   ftnunit->f77ungetn = y_ungetc;
   ftnunit->f77doed = w_ed;
   ftnunit->f77doned = w_ned;
   ftnunit->f77donewrec = y_wSL;
   ftnunit->f77dorevert = y_rev;
   ftnunit->f77doend = y_end;
   ftnunit->uirec = a->cirec;
   if (ftnunit->umaxrec && (a->cirec > ftnunit->umaxrec))
      errret(a->cierr, 159, "startwrt");
   if (pars_f (ftnunit, ftnunit->f77fmtbuf) < 0)
      errret(a->cierr, 100, "startwrt");
   fmt_bg (ftnunit);
   return (0);
}
Exemple #2
0
int
wsue (cilist64 *a, unit **fu)
{
    int             n;
    unit *ftnunit;

    if (!f77init)
        f_init ();
    if (n = c_sue (a, fu))
        return n;
    ftnunit = *fu;
    (void) f77nowwriting( ftnunit );
    ftnunit->f77reclen = 0;
    /*
    if (ftnunit->f77fio_buf == NULL)
       ftnunit->f77fio_buf = malloc (ftnunit->f77fio_size = FIO_ALLOC);
    */
    return (0);
}
Exemple #3
0
static int32 s_wsfe_com (cilist64 *a, unit **fu)
{
   unit           *ftnunit;
   int             n = wsfe(a, fu, 0);

   ftnunit = *fu;
   if (n)
      return n;
   if (ftnunit->uacc != KEYED) {
      if (f77nowwriting (ftnunit))
	 errret(a->cierr, 160, "startwrt");
   }

#ifdef I90
   ftnunit->f90sw = 0;
   ftnunit->f90nadv = 0;
   ftnunit->f77recpos = 0;
   ftnunit->f77recend = 0;
#endif
   ftnunit->dowrite = x_wEND;
   return (0);
}
Exemple #4
0
static int
s_wsue_com (cilist64 *a, unit **fu)
{
    unit		  *ftnunit;
    int             n;

    n = wsue(a, fu);
    ftnunit = *fu;
    if (n) {
        errret(a->cierr, n, "s_wsue");
    }
    if (ftnunit->uacc == KEYED) {
        ftnunit->f77idxlist.cimatch = a->cimatch;
        ftnunit->f77idxlist.cikeytype = a->cikeytype;
        ftnunit->f77idxlist.cikeyval.cicharval = a->cikeyval.cicharval;
        ftnunit->f77idxlist.cikeyid = a->cikeyid;
        ftnunit->f77idxlist.cinml = a->cinml;
        ftnunit->f77idxlist.cikeyvallen = a->cikeyvallen;
        ftnunit->f77do_unf = do_ui;
    }
    else {
        if (ftnunit->uacc == DIRECT) {
            ftnunit->f77recpos = 0;
            ftnunit->f77do_unf = do_ud;
            _fio_seq_pos( ftnunit->ufd, ftnunit );
        } else {
            if (ftnunit->uwrt != WR_READY && f77nowwriting (ftnunit))
                errret(a->cierr, 160, "startwrt");
            est_reclen = ftnunit->f77reclen = 0;
            ftnunit->overflowed = 0;
            ftnunit->f77recpos = 4;
            ftnunit->f77do_unf = do_us;
            if (ftnunit->uerror)
                unf_position (ftnunit->ufd, ftnunit);
        }
    }
    return 0;
}