cmd.h

Go to the documentation of this file.
00001 
00012 /*
00013 Copyright (C) 1997-2001 Id Software, Inc.
00014 
00015 This program is free software; you can redistribute it and/or
00016 modify it under the terms of the GNU General Public License
00017 as published by the Free Software Foundation; either version 2
00018 of the License, or (at your option) any later version.
00019 
00020 This program is distributed in the hope that it will be useful,
00021 but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00023 
00024 See the GNU General Public License for more details.
00025 
00026 You should have received a copy of the GNU General Public License
00027 along with this program; if not, write to the Free Software
00028 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00029 
00030 */
00031 
00035 void Cbuf_Init(void);
00036 
00039 /* the text is added to the end of the command buffer. */
00040 void Cbuf_AddText(const char *text);
00041 
00044 /* inserted at the beginning of the buffer, before any remaining unexecuted */
00045 /* commands. */
00046 void Cbuf_InsertText(const char *text);
00047 
00050 void Cbuf_AddEarlyCommands(qboolean clear);
00051 
00057 qboolean Cbuf_AddLateCommands(void);
00058 
00065 void Cbuf_Execute(void);
00066 
00071 void Cbuf_CopyToDefer(void);
00072 void Cbuf_InsertFromDefer(void);
00073 
00074 #ifdef DEBUG
00075 void Cmd_PrintDebugCommands(void);
00076 #endif
00077 
00078 
00079 /*=========================================================================== */
00080 
00081 
00082 typedef void (*xcommand_t) (void);
00083 
00084 typedef struct cmdList_s {
00085     const char *name;
00086     xcommand_t function;
00087     const char *description;
00088 } cmdList_t;
00089 
00090 void Cmd_Init(void);
00091 void Cmd_Shutdown(void);
00092 
00100 void Cmd_AddCommand(const char *cmd_name, xcommand_t function, const char *desc);
00101 
00102 void Cmd_RemoveCommand(const char *cmd_name);
00103 
00104 #define MAX_COMPLETE 128
00105 extern void Cmd_AddParamCompleteFunction(const char *cmd_name, int (*function)(const char *partial, const char **match));
00106 
00107 void Cmd_AddParamCompleteFunction(const char *cmd_name, int (*function)(const char *partial, const char **match));
00108 
00109 void Cmd_AddUserdata(const char *cmd_name, void* userdata);
00110 void* Cmd_GetUserdata (const char *cmd_name);
00111 
00112 int Cmd_GenericCompleteFunction(size_t len, const char **match, int matches, const char **list);
00113 
00117 qboolean Cmd_Exists(const char *cmd_name);
00118 
00123 int Cmd_CompleteCommandParameters(const char *command, const char *partial, const char **match);
00124 int Cmd_CompleteCommand(const char *partial, const char **match);
00125 
00131 int Cmd_Argc(void);
00132 const char *Cmd_Argv(int arg);
00133 const char *Cmd_Args(void);
00134 void *Cmd_Userdata(void);
00135 
00140 void Cmd_TokenizeString(const char *text, qboolean macroExpand);
00141 
00146 void Cmd_ExecuteString(const char *text);
00147 
00153 void Cmd_ForwardToServer(void);
00154 
00158 const char* Cmd_GetCommandDesc(const char* command);
00159 
00163 void Cmd_BufClear(void);
00164 
00169 void Cmd_WriteAliases(qFILE *f);
00170 
00174 void Cmd_Dummy_f(void);

Generated by  doxygen 1.6.2