2
0
Эх сурвалжийг харах

Added GetLastError() function.

Brucey 5 жил өмнө
parent
commit
ae80f430df

+ 1 - 1
blitz.mod/blitz_object.h

@@ -34,7 +34,7 @@ struct BBClass{
 	unsigned int instance_count;
 	unsigned int fields_offset;
 
-	void*	vfns[32];
+	void*	vfns[40];
 };
 
 struct BBObject{

+ 1 - 1
io.mod/common.bmx

@@ -28,7 +28,7 @@ Extern
 
 	Function bmx_PHYSFS_init:Int()
 	Function PHYSFS_deinit:Int()
-	Function bmx_PHYSHS_getLastError:String()
+	Function bmx_PHYSFS_getLastError:String()
 	Function bmx_PHYSFS_mount:Int(newDir:String, mountPoint:String, appendToPath:Int)
 	Function bmx_PHYSFS_getBaseDir:String()
 	Function bmx_PHYSFS_getPrefDir:String(org:String, app:String)

+ 2 - 2
io.mod/glue.c

@@ -29,12 +29,12 @@ int bmx_PHYSFS_init() {
 	return PHYSFS_init(bbArgv0);
 }
 
-BBString * bmx_PHYSHS_getLastError() {
+BBString * bmx_PHYSFS_getLastError() {
 	int code = PHYSFS_getLastErrorCode();
 	if (code == PHYSFS_ERR_OK) {
 		return &bbEmptyString;
 	}
-	return bbStringToUTF8String(PHYSFS_getErrorByCode(code));
+	return bbStringFromUTF8String(PHYSFS_getErrorByCode(code));
 }
 
 int bmx_PHYSFS_mount(BBString * newDir, BBString * mountPoint, int appendToPath) {

+ 9 - 1
io.mod/io.bmx

@@ -47,7 +47,7 @@ Type MaxIO
 	Function Init()
 		If Not ioInitialized Then
 			If Not bmx_PHYSFS_init() Then
-				Throw bmx_PHYSHS_getLastError()
+				Throw bmx_PHYSFS_getLastError()
 			End If
 		End If
 		ioInitialized = True
@@ -72,6 +72,7 @@ Type MaxIO
 
 	Rem
 	bbdoc: Adds an archive or directory to the search path.
+	returns: Nonzero if added to path, zero on failure (bogus archive, dir missing, etc). 
 	about: If this is a duplicate, the entry is not added again, even though the function succeeds.
 	You may not add the same archive to two different mountpoints: duplicate checking is done against the archive and not the mountpoint.
 	
@@ -214,5 +215,12 @@ Type MaxIO
 	Function MkDir:Int(dirName:String)
 		Return bmx_PHYSFS_mkdir(dirName)
 	End Function
+
+	Rem
+	bbdoc: Return the last error message.
+	End Rem
+	Function GetLastError:String()
+		Return bmx_PHYSFS_getLastError()
+	End Function
 	
 End Type