home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 125.img / PRO-C4.ZIP / BENCH1.ZIP / GENSUP / SCAN.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-28  |  832 b   |  37 lines

  1. # include <stdio.h>
  2. # include <bench.h>
  3. # include <proc.io>
  4. # include "field.h"
  5. # include "sup.h"
  6. # include "screen.h"
  7. # include "iodef.h"
  8.  
  9. /*
  10.  * Scan the specified list, from the head, until end of list
  11.  * or index value reached.  Return current list pointer.
  12.  * Used within computes to locate particular index value fields
  13. */
  14. struct a_line *scan_table(tab, head, lptr, index)
  15. struct _table *tab;
  16. struct a_line **head;
  17. struct a_line **lptr;
  18. int index;
  19. {
  20.     int i;
  21.     static struct a_line *tmp;
  22.  
  23.     for (i = 0, tmp = *head;  i < index && tmp != ANULL;  i++, tmp = tmp->next)
  24.         ;
  25.  
  26.     /*
  27.      * Get current record contents, in case we are in Add mode
  28.      * In Change mode we are just going to copy again
  29.     */
  30.     if (*lptr != ANULL && tmp == *lptr)
  31.         bytecpy((*lptr)->rec, tab->rec, tab->size);
  32.  
  33.     return (tmp);
  34. }
  35.  
  36.  
  37.