Browse Source

Implement MemObjIsHashmap().

pull/56/head
Rafal Kupiec 1 year ago
parent
commit
426ec932ec
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
2 changed files with 11 additions and 0 deletions
  1. +10
    -0
      engine/memobj.c
  2. +1
    -0
      include/ph7int.h

+ 10
- 0
engine/memobj.c View File

@ -724,6 +724,16 @@ PH7_PRIVATE sxi32 PH7_MemObjIsNull(ph7_value *pObj) {
/* Assume empty by default */
return TRUE;
}
/*
* Check whether the ph7_value is an array (hashmap)
* Returns TRUE if hashmap, FALSE otherwise.
*/
PH7_PRIVATE sxi32 PH7_MemObjIsHashmap(ph7_value *pObj) {
if(pObj->nType & MEMOBJ_HASHMAP) {
return TRUE;
}
return FALSE;
}
/*
* Check whether the ph7_value is numeric [i.e: int/float/bool] or looks
* like a numeric number [i.e: if the ph7_value is of type string.].

+ 1
- 0
include/ph7int.h View File

@ -1634,6 +1634,7 @@ PH7_PRIVATE sxi32 PH7_MemObjRelease(ph7_value *pObj);
PH7_PRIVATE sxi32 PH7_MemObjToNumeric(ph7_value *pObj);
PH7_PRIVATE ProcMemObjCast PH7_MemObjCastMethod(sxi32 iFlags);
PH7_PRIVATE sxi32 PH7_MemObjIsNull(ph7_value *pObj);
PH7_PRIVATE sxi32 PH7_MemObjIsHashmap(ph7_value *pObj);
PH7_PRIVATE sxi32 PH7_MemObjIsNumeric(ph7_value *pObj);
PH7_PRIVATE sxi32 PH7_MemObjIsEmpty(ph7_value *pObj);
PH7_PRIVATE sxi32 PH7_MemObjToHashmap(ph7_value *pObj);

Loading…
Cancel
Save