Commit Graph

19 Commits

Author SHA1 Message Date
Bill Currie 6bd9aceb28 [ruamoko] Correct signatures of strtol and strtoul
I had forgotten the base parameter in the ruamoko definitions (verified
there in the C wrapper).
2023-05-29 15:12:20 +09:00
Bill Currie 582423a019 [ruamoko] Extend the string api
Wrap the strtod, strtof, strtol, strtoul functions, supporting the end
pointer as well (if not nil, the int offset of the end pointer relative
to the string start is returned).

Also, str_unmutable creates a return string from a mutable string
(copying it).
2023-05-27 12:47:33 +09:00
Bill Currie 37b6d11c01 [ruamoko] Add binding for str_upper
I can't believe I didn't do that when I did str_lower.
2021-01-05 18:24:18 +09:00
Bill Currie 54f2e417dc [ruamoko] Fix daft str_str abi
Returning a string was a bad idea as it makes str_str difficult to use
with str_mid. (actually, iirc, it was the only reason I moved all
strings into progs memory... hmm).
2020-04-08 21:54:41 +09:00
Bill Currie b7b8df0801 [ruamoko] Add str_lower builtin
This returns a string with all chars lower-cased.
2020-04-08 21:53:53 +09:00
Bill Currie 6b9d4a747d [ruamoko] Add a builtin to quote strings
All unprintable chars are converted to either standard escape sequences
or \xHH.
2020-04-01 21:28:25 +09:00
Bill Currie 45d23ce521 [libr] Add bindings for new string functions
And correct str_free's return type.
2020-03-26 16:49:09 +09:00
Bill Currie 0ad9f559ea [ruamoko] Move some string functions
sprintf, vsprintf and strlen now in rua_strings, and strlen now returns
int like it should.
2020-03-25 00:04:20 +09:00
Bill Currie 694ad2e840 [ruamoko] Add str_char builtin
This returns the character (as an int) at the index. Equivalent to
string[index], but qc code doesn't have char-level access and not having
it means that strings can internally change to wchar without too much
fuss (maybe).
2020-03-10 18:16:55 +09:00
Bill Currie 1b1249bdb0 [ruamoko] Add vsprintf builtin 2020-03-10 18:16:07 +09:00
Bill Currie cdc1f0c5e7 [libr] Treat ruamoko headers as system headers
Now that qfcc actually supports them properly.
2020-03-03 15:24:41 +09:00
Bill Currie 896791b209 Correct the spelling of "int" and clean up the mess. 2011-03-25 16:53:04 +09:00
Bill Currie 128faf773a give sprintf a real prototype 2010-01-13 06:25:38 +00:00
Bill Currie 6e0c70cac7 reduce the amount of memory needed to read menu.plist 2005-06-15 01:41:10 +00:00
Bill Currie 96e20d891c overload str_mid so it has the same semantics as Python's slice operator
This is an imperfect revision of history.
2004-11-14 00:53:00 +00:00
Bill Currie b3f76e1e48 add some string builtins (only the basics for now, but enough to deal with
temporary strings) and fix the game load/save menus.
2004-01-07 07:36:17 +00:00
Bill Currie 380e397d5b set all of our static builtin extentions to 0x000fxxxx. fixes the invalid
builtin crash in menus
2004-01-07 00:04:07 +00:00
Bill Currie 6f1dd54e99 quick and dirty fix to get menus loading again. libr.a really needs to be
cleaned up: most of the stuff in it should /not/ be in the standard library
2004-01-05 09:06:06 +00:00
Bill Currie 118fc4b3ef create prototypes and linkages for all the server builtins, both nq and qw 2002-08-15 06:56:37 +00:00