python-on-a-chip online compiler
obj.c File Reference
Object Type. More...
Go to the source code of this file.
Functions | |
PmReturn_t | obj_loadFromImg (PmMemSpace_t memspace, uint8_t const **paddr, pPmObj_t *r_pobj) |
Loads an object from an image in memory. | |
PmReturn_t | obj_loadFromImgObj (pPmObj_t pimg, pPmObj_t *r_pobj) |
Loads a code object from a code image object. | |
int8_t | obj_isFalse (pPmObj_t pobj) |
Finds the boolean value of the given object. | |
PmReturn_t | obj_isIn (pPmObj_t pobj, pPmObj_t pitem) |
Returns the boolean true if the item is in the object. | |
int8_t | obj_compare (pPmObj_t pobj1, pPmObj_t pobj2) |
Compares two objects for equality. | |
PmReturn_t | obj_print (pPmObj_t pobj, uint8_t is_expr_repr, uint8_t is_nested) |
Print an object, thereby using objects helpers. | |
PmReturn_t | obj_repr (pPmObj_t pobj, pPmObj_t *r_pstr) |
Returns by reference a string object that is the human-readable representation of the object. |
Detailed Description
Object Type.
Object type operations.
Definition in file obj.c.
Function Documentation
int8_t obj_isFalse | ( | pPmObj_t | pobj ) |
PmReturn_t obj_isIn | ( | pPmObj_t | pobj, |
pPmObj_t | pitem | ||
) |
PmReturn_t obj_loadFromImg | ( | PmMemSpace_t | memspace, |
uint8_t const ** | paddr, | ||
pPmObj_t * | r_pobj | ||
) |
Loads an object from an image in memory.
Return pointer to object. Leave add pointing one byte past end of obj.
The following lists the simple object types and their image structures: -None: -type: int8_t - OBJ_TYPE_NON
-Int: -type: int8_t - OBJ_TYPE_INT -value: int32_t - signed integer value
-Float: -type: int8_t - OBJ_TYPE_FLOAT -value: float32_t - 32-bit floating point value
-Slice (is this allowed in img?): -type: int8_t - OBJ_TYPE_SLICE -index1: int16_t - first index. -index2: int16_t - second index.
- Parameters:
-
memspace memory space/type paddr ptr to ptr to obj return by reference: paddr pts to first byte after obj r_pobj Return arg, the loaded object.
- Returns:
- Return status
PmReturn_t obj_loadFromImgObj | ( | pPmObj_t | pimg, |
pPmObj_t * | r_pobj | ||
) |
PmReturn_t obj_print | ( | pPmObj_t | pobj, |
uint8_t | is_expr_repr, | ||
uint8_t | is_nested | ||
) |
Print an object, thereby using objects helpers.
- Parameters:
-
pobj Ptr to object for printing. is_expr_repr Influences the way None and strings are printed. If 0, None is printed, strings are printed. If 1, None is not printed and strings are printed surrounded with single quotes and unprintable characters are escaped. is_nested Influences the way None and strings are printed. If 1, None will be printed and strings will be surrounded with single quotes and escaped. This argument overrides the is_expr_repr argument.
- Returns:
- Return status
PmReturn_t obj_repr | ( | pPmObj_t | pobj, |
pPmObj_t * | r_pstr | ||
) |
Generated on Tue Jul 12 2022 23:13:47 by 1.7.2