Schily's LIBRARY FUNCTIONS                           OFINDLINE(3)


     ofindline() - finds a line with a matching field


     int ofindline(f,delim,string,field,array,arraysize)
          FILE *f;
          char delim;
          char *string;
          int field;
          char *array[];
          int arraysize;


     ofindline() retrieves a line from an open file  that  has  a
     matching character string in the given field.

     ofindline() fills in array with  pointers  to  strings  that
     make  up  each  field on the line. The strings are allocated
     new storage.  The field delimiter, delim, is used  to  break
     up  each  line of the file into fields. string is the string
     to match. fieldno is the field number to match.  Fields  are
     numbered  0..n.  array  is  an array of pointers to fill in.
     arraysize is the size of array.


     +1   match.

     -1   no match.

     -2   arg   error.   Returned   only   if    the    condition
          findline_arg_err is handled and the handler returns.

     -4   not  enough  memory  to  allocate  space   for   files.
          Returned only if the condition findline_storage is han-
          dled and the handler returns.



Joerg Schilling    Last change: 15. Juli 1988                   1

Man(1) output converted with man2html

FhG Schily's Home VED powered