diff main.c @ 443:96cb82ebb93b

Rename a structure member.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 25 May 2012 22:01:55 +0300
parents ecbd9773c74b
children 29a341fa80a1
line wrap: on
line diff
--- a/main.c	Fri May 25 21:43:21 2012 +0300
+++ b/main.c	Fri May 25 22:01:55 2012 +0300
@@ -842,7 +842,7 @@
 
 typedef struct
 {
-    char *cmd;
+    char *name;
     size_t len;
     int (*handler)(nn_conn_t *);
 } nn_protocolcmd_t;
@@ -869,14 +869,14 @@
     if (!protoCmdsInit)
     {
         for (i = 0; i < nprotoCmds; i++)
-            protoCmds[i].len = strlen(protoCmds[i].cmd);
+            protoCmds[i].len = strlen(protoCmds[i].name);
 
         protoCmdsInit = TRUE;
     }
 
     for (i = 0; i < nprotoCmds; i++)
     {
-        if (!nn_conn_buf_strncmp(conn, protoCmds[i].cmd, protoCmds[i].len))
+        if (!nn_conn_buf_strncmp(conn, protoCmds[i].name, protoCmds[i].len))
             return protoCmds[i].handler(conn);
     }
 
@@ -1149,7 +1149,7 @@
 
 typedef struct
 {
-    char *cmd;
+    char *name;
     int flags;
     size_t len;
     int (*handler)(nn_conn_t *, char *buf);
@@ -1191,7 +1191,7 @@
     if (!userCmdsInit)
     {
         for (i = 0; i < nuserCmds; i++)
-            userCmds[i].len = strlen(userCmds[i].cmd);
+            userCmds[i].len = strlen(userCmds[i].name);
 
         userCmdsInit = TRUE;
     }
@@ -1200,7 +1200,7 @@
     for (i = 0; i < nuserCmds; i++)
     {
         nn_usercmd_t *cmd = &userCmds[i];
-        if (!th_strncasecmp(buf + 1, cmd->cmd, cmd->len))
+        if (!th_strncasecmp(buf + 1, cmd->name, cmd->len))
         {
             char *nbuf = str_trim_left(buf + 1 + cmd->len);
 
@@ -1210,7 +1210,7 @@
                 case CMDARG_STRING:
                     if (!nbuf[0])
                     {
-                        printMsgQ(currWin, "Command: /%s requires an argument.\n", cmd->cmd);
+                        printMsgQ(currWin, "Command: /%s requires an argument.\n", cmd->name);
                         return 1;
                     }
                     break;
@@ -1218,7 +1218,7 @@
                 case CMDARG_NONE:
                     if (nbuf[0])
                     {
-                        printMsgQ(currWin, "Command: /%s does not take arguments.\n", cmd->cmd);
+                        printMsgQ(currWin, "Command: /%s does not take arguments.\n", cmd->name);
                         return 1;
                     }
                     break;