IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 21, 2023, 4:41:05 PM (3 years ago)
Author:
eugene
Message:

add queuesave function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/lib.data/queues.c

    r16437 r42456  
    398398}
    399399
     400int SaveQueue (Queue *queue, char *filename) {
     401
     402  if (queue[0].Nlines == 0) return (TRUE);
     403
     404  FILE *f = fopen (filename, "a");
     405  if (!f) {
     406    gprint (GP_ERR, "unable to open output file %s\n", filename);
     407    return FALSE;
     408  }
     409
     410  for (int i = 0; i < queue[0].Nlines; i++) {
     411    fprintf (f, "%s\n", queue[0].lines[i]);
     412  }
     413  fclose (f);
     414  return (TRUE);
     415}
     416
Note: See TracChangeset for help on using the changeset viewer.