version 1.27, 2005/12/24 21:11:16 |
version 1.28, 2006/08/12 23:49:54 |
Line 65 static struct fstab _fs_fstab; |
|
Line 65 static struct fstab _fs_fstab; |
|
|
|
static int fstabscan __P((void)); |
static int fstabscan __P((void)); |
|
|
static inline char *nextfld __P((char **, const char *)); |
static char *nextfld(char **, const char *); |
|
static int fstabscan(void); |
|
|
|
|
static inline char * |
static char * |
nextfld(str, sep) |
nextfld(char **str, const char *sep) |
char **str; |
|
const char *sep; |
|
{ |
{ |
char *ret; |
char *ret; |
|
|
_DIAGASSERT(str != NULL); |
_DIAGASSERT(str != NULL); |
_DIAGASSERT(sep != NULL); |
_DIAGASSERT(sep != NULL); |
|
|
while ((ret = strsep(str, sep)) != NULL && *ret == '\0') |
while ((ret = stresep(str, sep, '\\')) != NULL && *ret == '\0') |
continue; |
continue; |
return ret; |
return ret; |
} |
} |
|
|
|
|
static int |
static int |
fstabscan() |
fstabscan(void) |
{ |
{ |
char *cp, *lp, *sp; |
char *cp, *lp, *sp; |
#define MAXLINELENGTH 1024 |
#define MAXLINELENGTH 1024 |
|
|
} |
} |
|
|
struct fstab * |
struct fstab * |
getfsent() |
getfsent(void) |
{ |
{ |
if ((!_fs_fp && !setfsent()) || !fstabscan()) |
if ((!_fs_fp && !setfsent()) || !fstabscan()) |
return NULL; |
return NULL; |
|
|
} |
} |
|
|
struct fstab * |
struct fstab * |
getfsspec(name) |
getfsspec(const char *name) |
const char *name; |
|
{ |
{ |
|
|
_DIAGASSERT(name != NULL); |
_DIAGASSERT(name != NULL); |
|
|
} |
} |
|
|
struct fstab * |
struct fstab * |
getfsfile(name) |
getfsfile(const char *name) |
const char *name; |
|
{ |
{ |
|
|
_DIAGASSERT(name != NULL); |
_DIAGASSERT(name != NULL); |
|
|
} |
} |
|
|
int |
int |
setfsent() |
setfsent(void) |
{ |
{ |
_fs_lineno = 0; |
_fs_lineno = 0; |
if (_fs_fp) { |
if (_fs_fp) { |
|
|
} |
} |
|
|
void |
void |
endfsent() |
endfsent(void) |
{ |
{ |
if (_fs_fp) { |
if (_fs_fp) { |
(void)fclose(_fs_fp); |
(void)fclose(_fs_fp); |