VM_tokenize_console, // #514 float(string str) tokenize_console = #514; (DP_QC_TOKENIZE_CONSOLE)
VM_argv_start_index, // #515 float(float idx) argv_start_index = #515; (DP_QC_TOKENIZE_CONSOLE)
VM_argv_end_index, // #516 float(float idx) argv_end_index = #516; (DP_QC_TOKENIZE_CONSOLE)
-VM_buf_cvarlist, // #517 void(float buf, string prefix) buf_cvarlist = #517; (DP_QC_STRINGBUFFERS_CVARLIST)
+VM_buf_cvarlist, // #517 void(float buf, string prefix, string antiprefix) buf_cvarlist = #517; (DP_QC_STRINGBUFFERS_CVARLIST)
VM_cvar_description, // #518 float(string name) cvar_description = #518; (DP_QC_CVAR_DESCRIPTION)
NULL, // #519
VM_keynumtostring, // #520 string keynumtostring(float keynum)
VM_tokenize_console, // #514 float(string str) tokenize_console = #514; (DP_QC_TOKENIZE_CONSOLE)
VM_argv_start_index, // #515 float(float idx) argv_start_index = #515; (DP_QC_TOKENIZE_CONSOLE)
VM_argv_end_index, // #516 float(float idx) argv_end_index = #516; (DP_QC_TOKENIZE_CONSOLE)
-VM_buf_cvarlist, // #517 void(float buf, string prefix) buf_cvarlist = #517; (DP_QC_STRINGBUFFERS_CVARLIST)
+VM_buf_cvarlist, // #517 void(float buf, string prefix, string antiprefix) buf_cvarlist = #517; (DP_QC_STRINGBUFFERS_CVARLIST)
VM_cvar_description, // #518 float(string name) cvar_description = #518; (DP_QC_CVAR_DESCRIPTION)
NULL, // #519
NULL, // #520
float CVAR_TYPEFLAG_PRIVATE = 4;
float CVAR_TYPEFLAG_ENGINE = 8;
float CVAR_TYPEFLAG_HASDESCRIPTION = 16;
+float CVAR_TYPEFLAG_READONLY = 32;
=================
*/
void VM_cvar_type (void)
ret |= 8; // CVAR_TYPE_ENGINE
if(cvar->description != cvar_dummy_description)
ret |= 16; // CVAR_TYPE_HASDESCRIPTION
+ if(cvar->flags & CVAR_READONLY)
+ ret |= 32; // CVAR_TYPE_READONLY
PRVM_G_FLOAT(OFS_RETURN) = ret;
}
void VM_buf_cvarlist(void)
{
cvar_t *cvar;
- const char *partial;
- size_t len;
+ const char *partial, *antipartial;
+ size_t len, antilen;
size_t alloclen;
int n;
prvm_stringbuffer_t *stringbuffer;
- VM_SAFEPARMCOUNT(2, VM_bufstr_free);
+ VM_SAFEPARMCOUNTRANGE(2, 3, VM_buf_cvarlist);
stringbuffer = (prvm_stringbuffer_t *)Mem_ExpandableArray_RecordAtIndex(&prog->stringbuffersarray, (int)PRVM_G_FLOAT(OFS_PARM0));
if(!stringbuffer)
len = 0;
else
len = strlen(partial);
+
+ if(prog->argc == 3)
+ antipartial = PRVM_G_STRING(OFS_PARM2);
+ else
+ antipartial = NULL;
+ if(!antipartial)
+ antilen = 0;
+ else
+ antilen = strlen(antipartial);
for (n = 0;n < stringbuffer->num_strings;n++)
if (stringbuffer->strings[n])
n = 0;
for(cvar = cvar_vars; cvar; cvar = cvar->next)
{
- if(partial && strncasecmp(partial, cvar->name, len))
+ if(len && strncasecmp(partial, cvar->name, len))
+ continue;
+
+ if(antilen && !strncasecmp(antipartial, cvar->name, antilen))
continue;
alloclen = strlen(cvar->name) + 1;
VM_tokenize_console, // #514 float(string str) tokenize_console = #514; (DP_QC_TOKENIZE_CONSOLE)
VM_argv_start_index, // #515 float(float idx) argv_start_index = #515; (DP_QC_TOKENIZE_CONSOLE)
VM_argv_end_index, // #516 float(float idx) argv_end_index = #516; (DP_QC_TOKENIZE_CONSOLE)
-VM_buf_cvarlist, // #517 void(float buf, string prefix) buf_cvarlist = #517; (DP_QC_STRINGBUFFERS_CVARLIST)
+VM_buf_cvarlist, // #517 void(float buf, string prefix, string antiprefix) buf_cvarlist = #517; (DP_QC_STRINGBUFFERS_CVARLIST)
VM_cvar_description, // #518 float(string name) cvar_description = #518; (DP_QC_CVAR_DESCRIPTION)
NULL, // #519
};