mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-30 15:41:12 +00:00
Convenience function to store a predefined string in the qc string area
This commit is contained in:
parent
8bfbe4d619
commit
edcb976053
2 changed files with 13 additions and 2 deletions
10
code.c
10
code.c
|
@ -103,6 +103,16 @@ void code_init() {
|
|||
code_statements_add(empty_statement);
|
||||
}
|
||||
|
||||
uint32_t code_genstring(const char *str)
|
||||
{
|
||||
uint32_t off = code_chars_elements;
|
||||
while (*str) {
|
||||
code_chars_add(*str);
|
||||
++str;
|
||||
}
|
||||
return off;
|
||||
}
|
||||
|
||||
void code_test() {
|
||||
prog_section_def d1 = { TYPE_VOID, 28, 1 };
|
||||
prog_section_def d2 = { TYPE_FUNCTION, 29, 8 };
|
||||
|
|
1
gmqcc.h
1
gmqcc.h
|
@ -535,6 +535,7 @@ VECTOR_PROT(char, code_chars );
|
|||
*/
|
||||
bool code_write (const char *filename);
|
||||
void code_init ();
|
||||
uint32_t code_genstring (const char *string);
|
||||
|
||||
/*===================================================================*/
|
||||
/*========================= assembler.c =============================*/
|
||||
|
|
Loading…
Reference in a new issue