Improve command line and error handling in pop3d.
* pop3d/pop3d.h: Remove unused includes. (ABORT): New state. (pop3d_command_handler_t, struct pop3d_command): New types. (pop3d_find_command): New function. (pop3d_stat,pop3d_top,pop3d_uidl,pop3d_user,pop3d_apop) (pop3d_auth,pop3d_capa,pop3d_dele,pop3d_list,pop3d_noop) (pop3d_quit,pop3d_retr,pop3d_rset): Remove const from the arguments. Functions are free to modify it. (pop3d_parse_command): New function. * pop3d/cmd.c: New file. * pop3d/Makefile.am: Link in cmd.o * pop3d/apop.c: Use pop3d_parse_command to parse commands * pop3d/auth.c: Likewise. * pop3d/extra.c (pop3d_args, pop3d_cmd): Remove. (pop3d_parse_command): New function. (pop3d_abquit): use pop3d_error_string to convert error numbers to messages. * pop3d/pop3d.c (cb_bulletin_db): Protect by #ifdef USE_DBM (pop3d_mainloop): Change loop condition. Use pop3d_parse_command to parse commands, pop3d_find_command to lookup handlers in the command table and pop3d_error_string to convert error numbers to messages. (main): Call enable_stls if necessary. * pop3d/capa.c, pop3d/dele.c, pop3d/list.c, pop3d/noop.c, pop3d/quit.c, pop3d/retr.c, pop3d/rset.c, pop3d/stat.c, pop3d/stls.c, pop3d/top.c, pop3d/uidl.c, pop3d/user.c: Remove const qualifier from the command handler argument.
Showing
19 changed files
with
229 additions
and
287 deletions
pop3d/cmd.c
0 → 100644
-
Please register or sign in to post a comment