DarkPlaces has some interesting FRIK_FILE string manipulation capabilities, Lardarse linked me this:
FRIK_FILE
FRIK_FILE is the name given to the httpUpdated QuakeC File Access Tutorial by FrikaC. It's provides the same functionality as QSG_FILE but with updated and corrected builtin numbers to solve some incompatibilities. Engines that support this extension know the following builtins/constants:
builtin definitions:
float(string s) stof = #81;
float(string filename, float mode) fopen = #110;
void(float handle) fclose = #111;
string(float handle) fgets = #112;
void(float handle, string s) fputs = #113;
float (string s) strlen = #114;
string(string s1, string s2) strcat = #115;
string(string s, float start, float length) substring = #116;
vector(string s) stov = #117;
string(string s) strzone = #118;
void(string s) strunzone = #119;
Tonik: I suggest renaming the strcat function to stradd to avoid confusion with the strcat in C. The strcat in C modifies the first argument; the one in FRIK_FILE does not.
Sajt: You can do that yourself in your defs.qc/dpextensions.qc/whatever you use... also, please delete these messages once you've read this one
Tonik: Sure. But what I ask for is to replace strcat with stradd here in this Wiki and wherever else the extension is published. FrikaC, what will you say?
Sajt: Well, I wouldn't recommend it.. you can't expect QC versions of functions to be functionally identical (otherwise you might have to change fopen because it uses FILE_* constants instead of "wt", "rb", etc strings...) Oh well, my discussion here is done
ZQ_QC_STRINGS is a less supported subset of this extension.
constant definitions:
float ?FILE_READ = 0;
float ?FILE_APPEND = 1;
float ?FILE_WRITE = 2;
This extension adds a new cvar: "?pr_zone_min_strings" (default: 64 (64 kb), min: 64 (64 kb), max 8192 (8 mb)).
NOTE: You may want to set ?pr_zone_min_strings in the worldspawn function if 64 kb is not enough string zone space.
Last edited on May 16, 2006 by FrikaC