From 0ad513f42c10266bf4ab61089eb212efd05366f6 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 13 Jul 1999 19:54:40 +0000 Subject: renamed getfilepwent() and endfilepwent() to getfileent() and endfileent() as they are generic "file line-by-line" reading routines. lines with "#" at the front are ignored (as comments). this code started out as the password file reading code. (This used to be commit ef6df590fdf65a6d94b343998bac3a4d48ae07e0) --- source3/lib/util_file.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'source3/lib/util_file.c') diff --git a/source3/lib/util_file.c b/source3/lib/util_file.c index faceed1dbd..37489086d8 100644 --- a/source3/lib/util_file.c +++ b/source3/lib/util_file.c @@ -113,22 +113,22 @@ BOOL file_unlock(int fd, int *plock_depth) update to be set = True if modification is required. ****************************************************************/ -void *startfilepwent(char *pfile, char *s_readbuf, int bufsize, +void *startfileent(char *pfile, char *s_readbuf, int bufsize, int *file_lock_depth, BOOL update) { FILE *fp = NULL; if (!*pfile) { - DEBUG(0, ("startfilepwent: No file set\n")); + DEBUG(0, ("startfileent: No file set\n")); return (NULL); } - DEBUG(10, ("startfilepwent: opening file %s\n", pfile)); + DEBUG(10, ("startfileent: opening file %s\n", pfile)); fp = sys_fopen(pfile, update ? "r+b" : "rb"); if (fp == NULL) { - DEBUG(0, ("startfilepwent: unable to open file %s\n", pfile)); + DEBUG(0, ("startfileent: unable to open file %s\n", pfile)); return NULL; } @@ -137,7 +137,7 @@ void *startfilepwent(char *pfile, char *s_readbuf, int bufsize, if (!file_lock(fileno(fp), (update ? F_WRLCK : F_RDLCK), 5, file_lock_depth)) { - DEBUG(0, ("startfilepwent: unable to lock file %s\n", pfile)); + DEBUG(0, ("startfileent: unable to lock file %s\n", pfile)); fclose(fp); return NULL; } @@ -152,13 +152,13 @@ void *startfilepwent(char *pfile, char *s_readbuf, int bufsize, /*************************************************************** End enumeration of the file. ****************************************************************/ -void endfilepwent(void *vp, int *file_lock_depth) +void endfileent(void *vp, int *file_lock_depth) { FILE *fp = (FILE *)vp; file_unlock(fileno(fp), file_lock_depth); fclose(fp); - DEBUG(7, ("endfilepwent: closed file.\n")); + DEBUG(7, ("endfileent: closed file.\n")); } /************************************************************************* @@ -181,7 +181,6 @@ BOOL setfilepwpos(void *vp, SMB_BIG_UINT tok) /************************************************************************* gets a line out of a file. - line is of format "xxxx:xxxxxx:xxxxx:". lines with "#" at the front are ignored. *************************************************************************/ int getfileline(void *vp, char *linebuf, int linebuf_size) -- cgit