added structure for future fun-commands
[NeonServV5.git] / src / modcmd.h
index 940ab32a6d021e4aac83c8fc07405e6c2e5adae0..4ba89a96a4090ed2df73fc3f135673c589242bf6 100644 (file)
@@ -1,7 +1,25 @@
+/* modcmd.h - NeonServ v5.2
+ * Copyright (C) 2011  Philipp Kreil (pk910)
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License 
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. 
+ */
 #ifndef _modcmd_h
 #define _modcmd_h
 #include "main.h"
 
+#define MAXPARAMETERS 50
+
 #define CMDFLAG_REQUIRE_CHAN            0x0001
 #define CMDFLAG_REQUIRE_AUTH            0x0002
 #define CMDFLAG_REQUIRE_GOD             0x0004
 #define CMDFLAG_CHAN_PARAM              0x0080
 #define CMDFLAG_LOG                     0x0100
 #define CMDFLAG_OPLOG                   0x0200
+#define CMDFLAG_EMPTY_ARGS              0x0400
+#define CMDFLAG_REQUIRED                0x0800
+#define CMDFLAG_TEMPONARY_BIND          0x1000
+#define CMDFLAG_FUNCMD                  0x2000
 
 struct ClientSocket;
 struct UserNode;
@@ -39,7 +61,8 @@ struct cmd_binding {
     int botid;
     struct cmd_function *func;
     unsigned int flags;
-    char *parameters;
+    char *parameters[MAXPARAMETERS];
+    int paramcount;
     int global_access;
     char *channel_access;
     
@@ -68,5 +91,9 @@ void bind_set_parameters(int botid, char *cmd, char *parameters);
 void bind_set_global_access(int botid, char *cmd, int gaccess);
 void bind_set_channel_access(int botid, char *cmd, char *chanaccess);
 struct cmd_binding *find_cmd_binding(int botid, char *cmd);
+void bind_unbound_required_functions(int botid);
+
+void register_command_alias(int botid, char *alias);
+struct cmd_binding *getAllBinds(struct cmd_binding *last);
 
 #endif
\ No newline at end of file