17 |
|
|
18 |
#include "pop3d.h" |
#include "pop3d.h" |
19 |
|
|
20 |
|
static FILE *ifile; |
21 |
|
static FILE *ofile; |
22 |
|
|
23 |
/* Takes a string as input and returns either the remainder of the string |
/* Takes a string as input and returns either the remainder of the string |
24 |
after the first space, or a zero length string if no space */ |
after the first space, or a zero length string if no space */ |
25 |
|
|
133 |
} |
} |
134 |
|
|
135 |
void |
void |
136 |
|
pop3d_setio (FILE *in, FILE *out) |
137 |
|
{ |
138 |
|
if (!in || !out) |
139 |
|
pop3d_abquit (ERR_NO_OFILE); |
140 |
|
|
141 |
|
ifile = in; |
142 |
|
ofile = out; |
143 |
|
} |
144 |
|
|
145 |
|
void |
146 |
|
pop3d_flush_output () |
147 |
|
{ |
148 |
|
fflush (ofile); |
149 |
|
} |
150 |
|
|
151 |
|
int |
152 |
|
pop3d_is_master () |
153 |
|
{ |
154 |
|
return ofile == NULL; |
155 |
|
} |
156 |
|
|
157 |
|
void |
158 |
pop3d_outf (const char *fmt, ...) |
pop3d_outf (const char *fmt, ...) |
159 |
{ |
{ |
160 |
va_list ap; |
va_list ap; |
176 |
|
|
177 |
/* Gets a line of input from the client, caller should free() */ |
/* Gets a line of input from the client, caller should free() */ |
178 |
char * |
char * |
179 |
pop3d_readline (char *buffer, int size) |
pop3d_readline (char *buffer, size_t size) |
180 |
{ |
{ |
181 |
char *ptr; |
char *ptr; |
182 |
|
|