mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
[ruamoko] Add some new string builtins
Wrappers for hold, valid and mutable. I have no idea why I didn't think of wrapping string validation years ago.
This commit is contained in:
parent
1586df4dfc
commit
58ebbb147d
1 changed files with 23 additions and 0 deletions
|
@ -104,6 +104,26 @@ bi_str_free (progs_t *pr)
|
|||
PR_FreeString (pr, P_STRING (pr, 0));
|
||||
}
|
||||
|
||||
static void
|
||||
bi_str_hold (progs_t *pr)
|
||||
{
|
||||
string_t str = P_STRING (pr, 0);
|
||||
PR_HoldString (pr, str);
|
||||
R_STRING (pr) = str;
|
||||
}
|
||||
|
||||
static void
|
||||
bi_str_valid (progs_t *pr)
|
||||
{
|
||||
R_INT (pr) = PR_StringValid (pr, P_STRING (pr, 0));
|
||||
}
|
||||
|
||||
static void
|
||||
bi_str_mutable (progs_t *pr)
|
||||
{
|
||||
R_INT (pr) = PR_StringMutable (pr, P_STRING (pr, 0));
|
||||
}
|
||||
|
||||
static void
|
||||
bi_str_copy (progs_t *pr)
|
||||
{
|
||||
|
@ -194,6 +214,9 @@ static builtin_t builtins[] = {
|
|||
{"vsprintf", bi_vsprintf, -1},
|
||||
{"str_new", bi_str_new, -1},
|
||||
{"str_free", bi_str_free, -1},
|
||||
{"str_hold", bi_str_hold, -1},
|
||||
{"str_valid", bi_str_valid, -1},
|
||||
{"str_mutable", bi_str_mutable, -1},
|
||||
{"str_copy", bi_str_copy, -1},
|
||||
{"str_cat", bi_str_cat, -1},
|
||||
{"str_clear", bi_str_clear, -1},
|
||||
|
|
Loading…
Reference in a new issue