#include <ac/stdlib.h>
#include "rcpt500.h"
-struct command cmds[] = {
+struct command rcpt_cmds[] = {
"help", help_cmd, /* help must be the first command */
"query for", query_cmd, /* must come before "query for" */
"query", query_cmd,
if ( dosyslog ) {
syslog( LOG_INFO, "processing command \"%s %s\" from %s",
( msg.msg_command < 0 ) ? "Unknown" :
- cmds[ msg.msg_command ].cmd_text,
+ rcpt_cmds[ msg.msg_command ].cmd_text,
( msg.msg_arg == NULL ) ? "" : msg.msg_arg, msg.msg_replyto );
}
/*
sprintf( reply, "Your request was interpreted as: %s %s\n\n",
- cmds[ msg.msg_command ].cmd_text, msg.msg_arg );
+ rcpt_cmds[ msg.msg_command ].cmd_text, msg.msg_arg );
*/
- (*cmds[ msg.msg_command ].cmd_handler)( &msg, reply );
+ (*rcpt_cmds[ msg.msg_command ].cmd_handler)( &msg, reply );
if ( send_reply( &msg, reply ) < 0 ) {
if ( dosyslog ) {
}
*s = '\0';
- for ( i = 0; cmds[ i ].cmd_text != NULL; ++i ) {
- if (( s = strstr( argbuf, cmds[ i ].cmd_text )) != NULL
- && isspace( (unsigned char) s[ strlen( cmds[ i ].cmd_text ) ] )) {
- strcpy( argbuf, text + (s - argbuf) + strlen( cmds[ i ].cmd_text ));
+ for ( i = 0; rcpt_cmds[ i ].cmd_text != NULL; ++i ) {
+ if (( s = strstr( argbuf, rcpt_cmds[ i ].cmd_text )) != NULL
+ && isspace( (unsigned char) s[ strlen( rcpt_cmds[ i ].cmd_text ) ] )) {
+ strcpy( argbuf, text + (s - argbuf) + strlen( rcpt_cmds[ i ].cmd_text ));
*argp = argbuf;
while ( isspace( (unsigned char) **argp )) {
++(*argp);