* comsat/comsat.c (comsat_cfg_param): Reword a help message
for require-tty. * examples/header.c (cmd_readline): New function. New command 'readline'. * po/POTFILES.in: Remove stray reference to muerrno.c
Showing
4 changed files
with
29 additions
and
2 deletions
1 | 2008-02-09 Sergey Poznyakoff <gray@gnu.org.ua> | ||
2 | |||
3 | * comsat/comsat.c (comsat_cfg_param): Reword a help message | ||
4 | for require-tty. | ||
5 | * examples/header.c (cmd_readline): New function. | ||
6 | New command 'readline'. | ||
7 | * po/POTFILES.in: Remove stray reference to muerrno.c | ||
8 | |||
1 | 2008-02-08 Sergey Poznyakoff <gray@gnu.org.ua> | 9 | 2008-02-08 Sergey Poznyakoff <gray@gnu.org.ua> |
2 | 10 | ||
3 | * comsat/action.c (act_getline): Bugfix. Do not return eof | 11 | * comsat/action.c (act_getline): Bugfix. Do not return eof | ... | ... |
... | @@ -122,7 +122,7 @@ struct mu_cfg_param comsat_cfg_param[] = { | ... | @@ -122,7 +122,7 @@ struct mu_cfg_param comsat_cfg_param[] = { |
122 | { "allow-biffrc", mu_cfg_bool, &allow_biffrc, 0, NULL, | 122 | { "allow-biffrc", mu_cfg_bool, &allow_biffrc, 0, NULL, |
123 | N_("Read .biffrc file from the user home directory") }, | 123 | N_("Read .biffrc file from the user home directory") }, |
124 | { "require-tty", mu_cfg_bool, &require_tty, 0, NULL, | 124 | { "require-tty", mu_cfg_bool, &require_tty, 0, NULL, |
125 | N_("Notify only if the user be logged on one of the ttys.") }, | 125 | N_("Notify only if the user is logged on one of the ttys.") }, |
126 | { "max-lines", mu_cfg_int, &maxlines, 0, NULL, | 126 | { "max-lines", mu_cfg_int, &maxlines, 0, NULL, |
127 | N_("Maximum number of message body lines to be output.") }, | 127 | N_("Maximum number of message body lines to be output.") }, |
128 | { "max-requests", mu_cfg_uint, &maxrequests, 0, NULL, | 128 | { "max-requests", mu_cfg_uint, &maxrequests, 0, NULL, | ... | ... |
... | @@ -334,6 +334,25 @@ cmd_iterate (int argc, char **argv) | ... | @@ -334,6 +334,25 @@ cmd_iterate (int argc, char **argv) |
334 | } | 334 | } |
335 | } | 335 | } |
336 | 336 | ||
337 | void | ||
338 | cmd_readline (int argc, char **argv) | ||
339 | { | ||
340 | char *buf; | ||
341 | size_t size; | ||
342 | mu_stream_t stream; | ||
343 | size_t nbytes; | ||
344 | |||
345 | if (check_args (argv[0], argc, 1, 2)) | ||
346 | return; | ||
347 | size = atoi (argv[1]); | ||
348 | buf = malloc (size); | ||
349 | if (!buf) | ||
350 | abort (); | ||
351 | mu_header_get_stream (header, &stream); | ||
352 | mu_stream_readline (stream, buf, size, 0, &nbytes); | ||
353 | printf ("\"%*.*s\"", nbytes, nbytes, buf); | ||
354 | free (buf); | ||
355 | } | ||
337 | 356 | ||
338 | 357 | ||
339 | struct cmdtab | 358 | struct cmdtab |
... | @@ -354,6 +373,7 @@ static struct cmdtab cmdtab[] = { | ... | @@ -354,6 +373,7 @@ static struct cmdtab cmdtab[] = { |
354 | "find and print the Nth (by default, 1st) instance of header named NAME" }, | 373 | "find and print the Nth (by default, 1st) instance of header named NAME" }, |
355 | { "dump", cmd_dump, NULL, "dump all headers on screen" }, | 374 | { "dump", cmd_dump, NULL, "dump all headers on screen" }, |
356 | { "itr", cmd_iterate, "[first|1|next|n]", "iterate over headers" }, | 375 | { "itr", cmd_iterate, "[first|1|next|n]", "iterate over headers" }, |
376 | { "readline", cmd_readline, "[SIZE]", "read line" }, | ||
357 | { "remove", cmd_remove, "NAME [N]", | 377 | { "remove", cmd_remove, "NAME [N]", |
358 | "remove the Nth (by default, 1st) instance of header named NAME" }, | 378 | "remove the Nth (by default, 1st) instance of header named NAME" }, |
359 | { "insert", cmd_insert, "NAME VALUE [REF [NUM] [before|after] [replace]]", | 379 | { "insert", cmd_insert, "NAME VALUE [REF [NUM] [before|after] [replace]]", | ... | ... |
... | @@ -150,7 +150,6 @@ mailbox/ipsrv.c | ... | @@ -150,7 +150,6 @@ mailbox/ipsrv.c |
150 | mailbox/message.c | 150 | mailbox/message.c |
151 | mailbox/msrv.c | 151 | mailbox/msrv.c |
152 | mailbox/mu_auth.c | 152 | mailbox/mu_auth.c |
153 | mailbox/muerrno.c | ||
154 | mailbox/mutil.c | 153 | mailbox/mutil.c |
155 | mailbox/parsedate.y | 154 | mailbox/parsedate.y |
156 | mailbox/registrar.c | 155 | mailbox/registrar.c | ... | ... |
-
Please register or sign in to post a comment