summaryrefslogtreecommitdiff
path: root/source3/lib/util_file.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-07-13 19:54:40 +0000
committerLuke Leighton <lkcl@samba.org>1999-07-13 19:54:40 +0000
commit0ad513f42c10266bf4ab61089eb212efd05366f6 (patch)
treef0994c930cbf4ef4ef8c5b90c9096b920c0a28a9 /source3/lib/util_file.c
parentd2b2dff2e854a73a8b80eb4b23f19a540ce3afe1 (diff)
downloadsamba-0ad513f42c10266bf4ab61089eb212efd05366f6.tar.gz
samba-0ad513f42c10266bf4ab61089eb212efd05366f6.tar.bz2
samba-0ad513f42c10266bf4ab61089eb212efd05366f6.zip
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)
Diffstat (limited to 'source3/lib/util_file.c')
-rw-r--r--source3/lib/util_file.c15
1 files changed, 7 insertions, 8 deletions
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)