[NEWBIE] Ascii Pfiles

From: Jared Noble (jnoble@inreach.com)
Date: 03/02/01


I resolved the CXREF issue by hand writting both blocks of files. There were
several spacing problems. The simple thing was to rewrite it.

But of course the Makefile was only the beginning. Silly me, thinking I
could get away from patching in all these extras by using code someone else
already patched. Well, at least without a problem.

Make runs fine until it hits diskio.c wherein it spits out the following
error:

gcc -g -O2 -Wall  -c diskio.c
diskio.c: In function `fbopen_for_read':
diskio.c:144: structure has no member named `_fileno'
diskio.c: In function `fbcat':
diskio.c:324: structure has no member named `_fileno'
*** Error code 1

Here are the important parts of the functions the initial declaration and
such then below the actual portion where error shows (no need to spam the
list with the whole function):

-------------------snip snip-------------------

FBFILE *fbopen_for_read(char *fname)
{
  int err;
  FILE *fl;
  struct stat sb;
  FBFILE *fbfl;


  err = fstat(fl->_fileno, &sb);
  if(err < 0 || sb.st_size <= 0) {
    free(fbfl);
    fclose(fl);
    return NULL;
  }


and then the second function is...

int fbcat(char *fromfilename, FBFILE *tofile)
{
  struct stat sb;
  FILE *fromfile;
  char *in_buf = 0;
  int errnum = 0, length = 0;


  errnum = fstat(fromfile->_fileno, &sb);
  if(errnum < 0 || sb.st_size <= 0)
    return 0;

-------------------snip snip-------------------

I would remove the diskio.c but of course the save.c and db.c are both using
it so I would need to be a semi competant coder to fix it. Which I am not,
obviously, or else I wouldn't be asking for help on the above. :)

Any ideas on what the problem is and how I can fix it?

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/04/01 PST