#ifndef HTAAFILE_H #define HTAAFILE_H #include <stdio.h> /* FILE */ #include "HTUtils.h" /* BOOL, PARAMS, ARGS */ #include "HTList.h" /* HTList */ #ifdef SHORT_NAMES #define HTAAFnRe HTAAFile_nextRec #define HTAAFrFi HTAAFile_readField #define HTAAFrLi HTAAFile_readList #endif /*SHORT_NAMES*/ /* Used field separators */ #define FIELD_SEPARATOR ':' /* Used to separate fields */ #define LIST_SEPARATOR ',' /* Used to separate items in a list */ /* in group and ALC files. */
HTAAFile_nextRec()
HTAAFile_readField()
HTAAFile_readList()
/* PUBLIC HTAAFile_nextRec() ** GO TO THE BEGINNING OF THE NEXT RECORD ** ON ENTRY: ** fp is the file from which records are read from. ** ** ON EXIT: ** returns nothing. File read pointer is located at the beginning ** of the next record. ** */ PUBLIC void HTAAFile_nextRec PARAMS((FILE * fp)); /* PUBLIC HTAAFile_readField() ** READ A FIELD FROM A PASSWORD, GROUP ** OR ACCESS CONTROL LIST FILE ** i.e. an item terminated by colon, ** end-of-line, or end-of-file. ** ON ENTRY: ** fp is the file to read the characters from ** contents is the character array to put the characters ** max_len is the maximum number of characters that may ** be read (i.e. the size of dest minus one for ** terminating null). ** ON EXIT: ** returns the terminating character ** (i.e. either separator or CR or LF or EOF). ** contents contains a null-terminated string representing ** the read field. ** NOTE 1: ** Ignores leading and trailing blanks and tabs. ** NOTE 2: ** If the field is more than max_len characters ** long, the rest of the characters in that item ** are ignored. However, contents is always ** null-terminated! */ PUBLIC int HTAAFile_readField PARAMS((FILE * fp, char * contents, int max_len)); /* PUBLIC HTAAFile_readList() ** ** READ A LIST OF STRINGS SEPARATED BY COMMAS ** (FROM A GROUP OR ACCESS CONTROL LIST FILE) ** ON ENTRY: ** fp is a pointer to the input file. ** result is the list to which append the read items. ** max_len is the maximum number of characters in each ** list entry (extra characters are ignored). ** ON EXIT: ** returns the number of items read. ** */ PUBLIC int HTAAFile_readList PARAMS((FILE * fp, HTList * result, int max_len));
#endif /* not HTAAFILE_H */End of file HTAAFile.h.