version 1.19, 2001/03/03 21:19:41 |
version 1.20, 2001/03/05 15:37:27 |
|
|
void (*errfun) (const char *,...); |
void (*errfun) (const char *,...); |
} Linebuf; |
} Linebuf; |
|
|
static __inline__ Linebuf * |
Linebuf * |
Linebuf_alloc(const char *filename, void (*errfun) (const char *,...)) |
Linebuf_alloc(const char *filename, void (*errfun) (const char *,...)) |
{ |
{ |
Linebuf *lb; |
Linebuf *lb; |
|
|
return (lb); |
return (lb); |
} |
} |
|
|
static __inline__ void |
void |
Linebuf_free(Linebuf * lb) |
Linebuf_free(Linebuf * lb) |
{ |
{ |
fclose(lb->stream); |
fclose(lb->stream); |
|
|
xfree(lb); |
xfree(lb); |
} |
} |
|
|
static __inline__ void |
void |
Linebuf_restart(Linebuf * lb) |
Linebuf_restart(Linebuf * lb) |
{ |
{ |
clearerr(lb->stream); |
clearerr(lb->stream); |
|
|
lb->lineno = 0; |
lb->lineno = 0; |
} |
} |
|
|
static __inline__ int |
int |
Linebuf_lineno(Linebuf * lb) |
Linebuf_lineno(Linebuf * lb) |
{ |
{ |
return (lb->lineno); |
return (lb->lineno); |
} |
} |
|
|
static __inline__ char * |
char * |
Linebuf_getline(Linebuf * lb) |
Linebuf_getline(Linebuf * lb) |
{ |
{ |
int n = 0; |
int n = 0; |
|
|
} |
} |
} |
} |
|
|
static int |
int |
fdlim_get(int hard) |
fdlim_get(int hard) |
{ |
{ |
struct rlimit rlfd; |
struct rlimit rlfd; |
|
|
return hard ? rlfd.rlim_max : rlfd.rlim_cur; |
return hard ? rlfd.rlim_max : rlfd.rlim_cur; |
} |
} |
|
|
static int |
int |
fdlim_set(int lim) |
fdlim_set(int lim) |
{ |
{ |
struct rlimit rlfd; |
struct rlimit rlfd; |
|
|
* separators. This is the same as the 4.4BSD strsep, but different from the |
* separators. This is the same as the 4.4BSD strsep, but different from the |
* one in the GNU libc. |
* one in the GNU libc. |
*/ |
*/ |
static __inline__ char * |
char * |
xstrsep(char **str, const char *delim) |
xstrsep(char **str, const char *delim) |
{ |
{ |
char *s, *e; |
char *s, *e; |
|
|
} |
} |
} |
} |
|
|
static void |
void |
usage(void) |
usage(void) |
{ |
{ |
fatal("usage: %s [-t timeout] { [--] host | -f file } ...", __progname); |
fatal("usage: %s [-t timeout] { [--] host | -f file } ...", __progname); |