tuple.c File Reference

Tuple Object Type. More...

#include "pm.h"

Defines

#define __FILE_ID__   0x13
#define MAX_TUPLE_LEN   253

Functions

PmReturn_t tuple_loadFromImg (PmMemSpace_t memspace, uint8_t const **paddr, pPmObj_t *r_ptuple)
PmReturn_t tuple_new (uint16_t n, pPmObj_t *r_ptuple)
PmReturn_t tuple_replicate (pPmObj_t ptup, int16_t n, pPmObj_t *r_ptuple)
PmReturn_t tuple_getItem (pPmObj_t ptup, int16_t index, pPmObj_t *r_pobj)


Detailed Description

Tuple Object Type.

Tuple object type operations.


Function Documentation

PmReturn_t tuple_getItem ( pPmObj_t  ptup,
int16_t  index,
pPmObj_t r_pobj 
)

Gets the object in the tuple at the index.

Parameters:
pobj Ptr to tuple obj
index Index into tuple
r_pobj Return; ptr to return obj
Returns:
Return status

PmReturn_t tuple_loadFromImg ( PmMemSpace_t  memspace,
uint8_t const **  paddr,
pPmObj_t r_ptuple 
)

Creates a Tuple by loading a tuple image from memory.

Obtain space for tuple from the heap. Load all objs within the tuple img. Leave contents of paddr pointing one byte past end of last obj in tuple.

The tuple image has the following structure: -type: S8 - OBJ_TYPE_TUPLE -length U8 - N number of objects in the tuple. N objects follow in the stream.

Parameters:
memspace memory space.
paddr ptr to ptr to tuple in memspace
Returns:
new tuple with fields and objs filled in. return by reference: paddr points one byte past end of last obj in tuple.

PmReturn_t tuple_new ( uint16_t  n,
pPmObj_t r_ptuple 
)

Allocates space for a new Tuple. Returns a pointer to the tuple.

Parameters:
n the number of elements the tuple will contain
r_ptuple Return by ref, ptr to new tuple
Returns:
Return status

PmReturn_t tuple_replicate ( pPmObj_t  ptup,
int16_t  n,
pPmObj_t r_ptuple 
)

Replicates a tuple, n number of times to create a new tuple

Copies the pointers (not the objects).

Parameters:
ptup Ptr to source tuple.
n Number of times to replicate the tuple.
r_ptuple Return arg; Ptr to new tuple.
Returns:
Return status


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