Go to the source code of this file.
Classes | |
| struct | PmList_s |
Typedefs | |
| typedef struct PmList_s | PmList_t |
| typedef struct PmList_s * | pPmList_t |
Functions | |
| PmReturn_t | list_new (pPmObj_t *r_pobj) |
| PmReturn_t | list_getItem (pPmObj_t plist, int16_t index, pPmObj_t *r_pobj) |
| PmReturn_t | list_setItem (pPmObj_t plist, int16_t index, pPmObj_t pobj) |
| PmReturn_t | list_copy (pPmObj_t pobj, pPmObj_t *r_pobj) |
| PmReturn_t | list_append (pPmObj_t plist, pPmObj_t pobj) |
| PmReturn_t | list_replicate (pPmObj_t psrclist, int16_t n, pPmObj_t *r_pnewlist) |
| PmReturn_t | list_insert (pPmObj_t plist, int16_t index, pPmObj_t pobj) |
| PmReturn_t | list_remove (pPmObj_t plist, pPmObj_t item) |
| PmReturn_t | list_index (pPmObj_t plist, pPmObj_t pitem, uint16_t *r_index) |
| PmReturn_t | list_delItem (pPmObj_t plist, int16_t index) |
| PmReturn_t | list_clear (pPmObj_t plist) |
List object type header.
List obj
Mutable ordered sequence of objects. Contains ptr to linked list of nodes.
| PmReturn_t list_append | ( | pPmObj_t | plist, | |
| pPmObj_t | pobj | |||
| ) |
| PmReturn_t list_clear | ( | pPmObj_t | plist | ) |
Removes all items from the list and zeroes the length.
| pobj | List to clear |
| PmReturn_t list_copy | ( | pPmObj_t | pobj, | |
| pPmObj_t * | r_pobj | |||
| ) |
| PmReturn_t list_delItem | ( | pPmObj_t | plist, | |
| int16_t | index | |||
| ) |
| PmReturn_t list_getItem | ( | pPmObj_t | plist, | |
| int16_t | index, | |||
| pPmObj_t * | r_pobj | |||
| ) |
| PmReturn_t list_index | ( | pPmObj_t | plist, | |
| pPmObj_t | pitem, | |||
| uint16_t * | r_index | |||
| ) |
Finds the first index of the item that matches pitem. Returns an ValueError Exception if the item is not found.
| plist | Ptr to list obj | |
| item | Ptr to object to be removed | |
| r_index | Addr of the variable for index |
| PmReturn_t list_insert | ( | pPmObj_t | plist, | |
| int16_t | index, | |||
| pPmObj_t | pobj | |||
| ) |
| PmReturn_t list_new | ( | pPmObj_t * | r_pobj | ) |
Allocates a new List object.
If there is not enough memory to allocate the List, the return status will indicate an OutOfMemoryError that must be passed up to the interpreter. Otherwise, a ptr to the list is returned by reference and the return status is OK.
| r_pobj | Return; addr of ptr to obj |
| PmReturn_t list_remove | ( | pPmObj_t | plist, | |
| pPmObj_t | item | |||
| ) |
| PmReturn_t list_replicate | ( | pPmObj_t | psrclist, | |
| int16_t | n, | |||
| pPmObj_t * | r_pnewlist | |||
| ) |
Creates a new list with the contents of psrclist copied pint number of times. This implements the python code "[0,...] * N" where the list can be any list and N is an integer.
| psrclist | The source list to replicate | |
| n | The integer number of times to replicate it | |
| r_pnewlist | Return; new list with its contents set. |
| PmReturn_t list_setItem | ( | pPmObj_t | plist, | |
| int16_t | index, | |||
| pPmObj_t | pobj | |||
| ) |
1.5.9