mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 22:22:17 +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);
|
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() {
|
void code_test() {
|
||||||
prog_section_def d1 = { TYPE_VOID, 28, 1 };
|
prog_section_def d1 = { TYPE_VOID, 28, 1 };
|
||||||
prog_section_def d2 = { TYPE_FUNCTION, 29, 8 };
|
prog_section_def d2 = { TYPE_FUNCTION, 29, 8 };
|
||||||
|
|
5
gmqcc.h
5
gmqcc.h
|
@ -533,8 +533,9 @@ VECTOR_PROT(char, code_chars );
|
||||||
* code_write -- writes out the compiled file
|
* code_write -- writes out the compiled file
|
||||||
* code_init -- prepares the code file
|
* code_init -- prepares the code file
|
||||||
*/
|
*/
|
||||||
bool code_write (const char *filename);
|
bool code_write (const char *filename);
|
||||||
void code_init ();
|
void code_init ();
|
||||||
|
uint32_t code_genstring (const char *string);
|
||||||
|
|
||||||
/*===================================================================*/
|
/*===================================================================*/
|
||||||
/*========================= assembler.c =============================*/
|
/*========================= assembler.c =============================*/
|
||||||
|
|
Loading…
Reference in a new issue