obj.c File Reference

Object Type. More...

#include "pm.h"

Defines

#define __FILE_ID__   0x0F

Functions

PmReturn_t obj_loadFromImg (PmMemSpace_t memspace, uint8_t const **paddr, pPmObj_t *r_pobj)
PmReturn_t obj_loadFromImgObj (pPmObj_t pimg, pPmObj_t *r_pobj)
int8_t obj_isFalse (pPmObj_t pobj)
PmReturn_t obj_isIn (pPmObj_t pobj, pPmObj_t pitem)
int8_t obj_compare (pPmObj_t pobj1, pPmObj_t pobj2)


Detailed Description

Object Type.

Object type operations.


Function Documentation

int8_t obj_compare ( pPmObj_t  pobj1,
pPmObj_t  pobj2 
)

Compares two objects for equality.

Parameters:
pobj1 Ptr to first object.
pobj2 Ptr to second object.
Returns:
C_SAME if the items are equivalent, C_DIFFER otherwise.

int8_t obj_isFalse ( pPmObj_t  pobj  ) 

Finds the boolean value of the given object.

Parameters:
pobj Ptr to object to test.
Returns:
Nonzero value if object is False.

PmReturn_t obj_isIn ( pPmObj_t  pobj,
pPmObj_t  pitem 
)

Returns the boolean true if the item is in the object

Parameters:
pobj Ptr to container object
pitem Ptr to item

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 
)

Loads a code object from a code image object

Parameters:
pimg Ptr to a code image object
r_pobj Return arg, the loaded object
Returns:
Returns status


Generated on Wed Feb 24 13:37:02 2010 for Python-on-a-chip by  doxygen 1.5.9