// we only run the +whatever commandline arguments once
-qboolean host_stuffcmdsrun = false;
+qbool host_stuffcmdsrun = false;
//=============================================================================
Returns true if command is complete
============
*/
-static qboolean Cbuf_ParseText(char **start, size_t *size)
+static qbool Cbuf_ParseText(char **start, size_t *size)
{
int i = 0;
- qboolean quotes = false;
- qboolean comment = false; // Does not imply end because we might be starting the line with a comment.
- qboolean escaped = false;
- qboolean end = false; // Reached the end of a valid command
+ qbool quotes = false;
+ qbool comment = false; // Does not imply end because we might be starting the line with a comment.
+ qbool escaped = false;
+ qbool end = false; // Reached the end of a valid command
char *offset = NULL; // Non-NULL if valid command. Used by the caller to know where to start copying.
size_t cmdsize = 0; // Non-zero if valid command. Basically bytes to copy for the caller.
static void Cbuf_LinkCreate(cmd_state_t *cmd, llist_t *head, cmd_input_t *existing, const char *text)
{
char *in = (char *)&text[0];
- qboolean complete;
+ qbool complete;
cbuf_t *cbuf = cmd->cbuf;
size_t totalsize = 0, newsize = 0;
cmd_input_t *current = NULL;
Cbuf_Execute
============
*/
-static qboolean Cmd_PreprocessString(cmd_state_t *cmd, const char *intext, char *outtext, unsigned maxoutlen, cmd_alias_t *alias );
+static qbool Cmd_PreprocessString(cmd_state_t *cmd, const char *intext, char *outtext, unsigned maxoutlen, cmd_alias_t *alias );
void Cbuf_Execute (cbuf_t *cbuf)
{
cmd_input_t *current;
{
char *f;
size_t filenameLen = strlen(filename);
- qboolean isdefaultcfg =
+ qbool isdefaultcfg =
!strcmp(filename, "default.cfg") ||
(filenameLen >= 12 && !strcmp(filename + filenameLen - 12, "/default.cfg"));
=============================================================================
*/
-static const char *Cmd_GetDirectCvarValue(cmd_state_t *cmd, const char *varname, cmd_alias_t *alias, qboolean *is_multiple)
+static const char *Cmd_GetDirectCvarValue(cmd_state_t *cmd, const char *varname, cmd_alias_t *alias, qbool *is_multiple)
{
cvar_t *cvar;
long argno;
return NULL;
}
-qboolean Cmd_QuoteString(char *out, size_t outlen, const char *in, const char *quoteset, qboolean putquotes)
+qbool Cmd_QuoteString(char *out, size_t outlen, const char *in, const char *quoteset, qbool putquotes)
{
- qboolean quote_quot = !!strchr(quoteset, '"');
- qboolean quote_backslash = !!strchr(quoteset, '\\');
- qboolean quote_dollar = !!strchr(quoteset, '$');
+ qbool quote_quot = !!strchr(quoteset, '"');
+ qbool quote_backslash = !!strchr(quoteset, '\\');
+ qbool quote_dollar = !!strchr(quoteset, '$');
if(putquotes)
{
static char varval[MAX_INPUTLINE]; // cmd_mutex
const char *varstr = NULL;
char *varfunc;
- qboolean required = false;
- qboolean optional = false;
+ qbool required = false;
+ qbool optional = false;
static char asis[] = "asis"; // just to suppress const char warnings
if(varlen >= MAX_INPUTLINE)
varstr = Cmd_GetDirectCvarValue(cmd, Cmd_GetDirectCvarValue(cmd, varname + 1, alias, NULL), alias, NULL);
else
{
- qboolean is_multiple = false;
+ qbool is_multiple = false;
// Exception: $* and $n- don't use the quoted form by default
varstr = Cmd_GetDirectCvarValue(cmd, varname, alias, &is_multiple);
if(is_multiple)
Preprocesses strings and replaces $*, $param#, $cvar accordingly. Also strips comments.
*/
-static qboolean Cmd_PreprocessString(cmd_state_t *cmd, const char *intext, char *outtext, unsigned maxoutlen, cmd_alias_t *alias ) {
+static qbool Cmd_PreprocessString(cmd_state_t *cmd, const char *intext, char *outtext, unsigned maxoutlen, cmd_alias_t *alias ) {
const char *in;
size_t eat, varlen;
unsigned outlen;
{
static char buffer[ MAX_INPUTLINE ]; // cmd_mutex
static char buffer2[ MAX_INPUTLINE ]; // cmd_mutex
- qboolean ret = Cmd_PreprocessString( cmd, alias->value, buffer, sizeof(buffer) - 2, alias );
+ qbool ret = Cmd_PreprocessString( cmd, alias->value, buffer, sizeof(buffer) - 2, alias );
if(!ret)
return;
// insert at start of command buffer, so that aliases execute in order
const char *partial;
size_t len;
int count;
- qboolean ispattern;
+ qbool ispattern;
if (Cmd_Argc(cmd) > 1)
{
cmd_alias_t *alias;
const char *partial;
int count;
- qboolean ispattern;
+ qbool ispattern;
char vabuf[1024];
if (Cmd_Argc(cmd) > 1)
cmd_function_t *prev, *current;
cmd_state_t *cmd;
xcommand_t save = NULL;
- qboolean auto_add = false;
+ qbool auto_add = false;
int i;
for (i = 0; i < 3; i++)
}
}
-static int Cmd_Compare(const char *s1, const char *s2, size_t len, qboolean casesensitive)
+static int Cmd_Compare(const char *s1, const char *s2, size_t len, qbool casesensitive)
{
if(len)
return (casesensitive ? strncmp(s1, s2, len) : strncasecmp(s1, s2, len));
return (casesensitive ? strcmp(s1, s2) : strcasecmp(s1, s2));
}
-cmd_function_t *Cmd_GetCommand(cmd_state_t *cmd, const char *partial, size_t len, qboolean casesensitive)
+cmd_function_t *Cmd_GetCommand(cmd_state_t *cmd, const char *partial, size_t len, qbool casesensitive)
{
cmd_function_t *func = NULL;
Cmd_Exists
============
*/
-qboolean Cmd_Exists (cmd_state_t *cmd, const char *cmd_name)
+qbool Cmd_Exists (cmd_state_t *cmd, const char *cmd_name)
{
if(Cmd_GetCommand(cmd, cmd_name, 0, true))
return true;
FIXME: lookupnoadd the token to speed search?
============
*/
-void Cmd_ExecuteString (cmd_state_t *cmd, const char *text, cmd_source_t src, qboolean lockmutex)
+void Cmd_ExecuteString (cmd_state_t *cmd, const char *text, cmd_source_t src, qbool lockmutex)
{
int oldpos;
cmd_function_t *func;