r2999 - in trunk/data/qcsrc: menu menu-div0test

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Dec 5 16:39:47 EST 2007


Author: div0
Date: 2007-12-05 16:39:45 -0500 (Wed, 05 Dec 2007)
New Revision: 2999

Modified:
   trunk/data/qcsrc/menu-div0test/mbuiltin.qh
   trunk/data/qcsrc/menu/mbuiltin.qc
Log:
merged mbuiltin files


Modified: trunk/data/qcsrc/menu/mbuiltin.qc
===================================================================
--- trunk/data/qcsrc/menu/mbuiltin.qc	2007-12-01 13:01:32 UTC (rev 2998)
+++ trunk/data/qcsrc/menu/mbuiltin.qc	2007-12-05 21:39:45 UTC (rev 2999)
@@ -102,6 +102,12 @@
 string	strcat(string s1, ...)  = #53;
 string	substring(string s, float start, float length)  = #54;
 
+float(string str, string sub, float startpos) strstrofs = #221;
+float(string s1, string s2, float len) strncmp = #228;
+float(string s1, string s2) strcasecmp = #229;
+float(string s1, string s2, float len) strncasecmp = #230;
+
+
 vector	stov(string s)  = #55;
 
 #ifdef PROFILESTRZONE

Modified: trunk/data/qcsrc/menu-div0test/mbuiltin.qh
===================================================================
--- trunk/data/qcsrc/menu-div0test/mbuiltin.qh	2007-12-01 13:01:32 UTC (rev 2998)
+++ trunk/data/qcsrc/menu-div0test/mbuiltin.qh	2007-12-05 21:39:45 UTC (rev 2999)
@@ -4,6 +4,7 @@
 // AK FIXME: Create perhaps a special builtin file for the common cmds
 
 //#define PROFILESTRZONE
+//#define FIXEDFOPEN
 
 void 	checkextension(string ext) = #1;
 
@@ -87,7 +88,11 @@
 float	pow(float a, float b)  = #46;
 void	copyentity(entity src, entity dst)  = #47;
 
+#ifdef FIXEDFOPEN
+float 	_fopen( string filename, float mode ) = #48;
+#else
 float	fopen(string filename, float mode)  = #48;
+#endif
 void	fclose(float fhandle)  = #49;
 string	fgets(float fhandle)  = #50;
 void	fputs(float fhandle, string s)  = #51;
@@ -234,3 +239,23 @@
 float	gethostcacheindexforkey(string key) = #622;
 void	addwantedhostcachekey(string key) = #623;
 string	getextresponse(void) = #624;
+
+#ifdef FIXEDFOPEN
+float 	fopen( string filename, float mode ) =
+{
+	local float handle;
+	if( mode == FILE_READ ) {
+		return _fopen( filename, mode );
+	}
+
+	// check for data/
+	filename = strzone( filename );
+	if( substring( filename, 0, 5 ) != "data/" ) {
+		print( "menu: fopen: all output must go into data/!\n" );
+		return -1;
+	}
+	handle = _fopen( substring( filename, 5, 10000 ), mode );
+	strunzone( filename );
+	return handle;
+};
+#endif




More information about the nexuiz-commits mailing list