Jelajahi Sumber

Added IsEmptyArray() Function.

woollybah 6 tahun lalu
induk
melakukan
a7a4125c58
3 mengubah file dengan 12 tambahan dan 0 penghapusan
  1. 6 0
      blitz.mod/blitz.bmx
  2. 4 0
      blitz.mod/blitz_array.c
  3. 2 0
      blitz.mod/blitz_array.h

+ 6 - 0
blitz.mod/blitz.bmx

@@ -546,6 +546,12 @@ bbdoc: Copies an array from the specified @src array, starting at the position @
 End Rem
 Function ArrayCopy(src:Object, srcPos:Int, dst:Object, dstPos:Int, length:Int)="void bbArrayCopy(BBARRAY, int, BBARRAY, int, int)!"
 
+Rem
+bbdoc: Determines whether the #Object @obj is an empty array.
+returns: #True if @obj is an empty array, or #False otherwise.
+End Rem
+Function IsEmptyArray:Int(obj:Object)="int bbObjectIsEmptyArray(BBOBJECT)!"
+
 End Extern
 
 Rem

+ 4 - 0
blitz.mod/blitz_array.c

@@ -522,3 +522,7 @@ void bbArraySort( BBArray *arr,int ascending ){
 		}
 	}
 }
+
+int bbObjectIsEmptyArray(BBObject * o) {
+	return o == &bbEmptyArray;
+}

+ 2 - 0
blitz.mod/blitz_array.h

@@ -54,6 +54,8 @@ BBArray*	bbArrayFromDataStruct( const char *type,int length,void *data, unsigned
 
 void bbArrayCopy(BBArray * srcArr, int srcPos, BBArray * dstArr, int dstPos, int length);
 
+int bbObjectIsEmptyArray(BBObject * o);
+
 #ifdef __cplusplus
 }
 #endif