list.h

Go to the documentation of this file.
00001 /*
00002 # This file is Copyright 2003, 2006, 2007, 2009 Dean Hall.
00003 #
00004 # This file is part of the PyMite VM.
00005 # The PyMite VM is free software: you can redistribute it and/or modify
00006 # it under the terms of the GNU GENERAL PUBLIC LICENSE Version 2.
00007 #
00008 # The PyMite VM is distributed in the hope that it will be useful,
00009 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00011 # A copy of the GNU GENERAL PUBLIC LICENSE Version 2
00012 # is seen in the file COPYING in this directory.
00013 */
00014 
00015 
00016 #ifndef __LIST_H__
00017 #define __LIST_H__
00018 
00031 typedef struct PmList_s
00032 {
00034     PmObjDesc_t od;
00035 
00037     int16_t length;
00038 
00040     pSeglist_t val;
00041 } PmList_t,
00042  *pPmList_t;
00043 
00044 
00057 PmReturn_t list_new(pPmObj_t *r_pobj);
00058 
00067 PmReturn_t list_getItem(pPmObj_t plist, int16_t index, pPmObj_t *r_pobj);
00068 
00077 PmReturn_t list_setItem(pPmObj_t plist, int16_t index, pPmObj_t pobj);
00078 
00089 PmReturn_t list_copy(pPmObj_t pobj, pPmObj_t *r_pobj);
00090 
00101 PmReturn_t list_append(pPmObj_t plist, pPmObj_t pobj);
00102 
00114 PmReturn_t list_replicate(pPmObj_t psrclist, int16_t n, pPmObj_t *r_pnewlist);
00115 
00124 PmReturn_t list_insert(pPmObj_t plist, int16_t index, pPmObj_t pobj);
00125 
00133 PmReturn_t list_remove(pPmObj_t plist, pPmObj_t item);
00134 
00144 PmReturn_t list_index(pPmObj_t plist, pPmObj_t pitem, uint16_t *r_index);
00145 
00155 PmReturn_t list_delItem(pPmObj_t plist, int16_t index);
00156 
00157 #ifdef HAVE_PRINT
00158 
00164 PmReturn_t list_print(pPmObj_t pobj);
00165 #endif /* HAVE_PRINT */
00166 
00173 PmReturn_t list_clear(pPmObj_t plist);
00174 
00175 #endif /* __LIST_H__ */

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