seglist.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 __SEGLIST_H__
00017 #define __SEGLIST_H__
00018 
00019 
00041 #define SEGLIST_OBJS_PER_SEG 8
00042 
00043 
00045 typedef struct Segment_s
00046 {
00048     PmObjDesc_t od;
00050     pPmObj_t s_val[SEGLIST_OBJS_PER_SEG];
00052     struct Segment_s *next;
00053 } Segment_t,
00054  *pSegment_t;
00055 
00056 
00058 typedef struct Seglist_s
00059 {
00061     PmObjDesc_t od;
00063     pSegment_t sl_rootseg;
00065     pSegment_t sl_lastseg;
00067     int16_t sl_length;
00068 } Seglist_t,
00069  *pSeglist_t;
00070 
00071 
00082 PmReturn_t seglist_appendItem(pSeglist_t pseglist, pPmObj_t pobj);
00083 
00089 PmReturn_t seglist_clear(pSeglist_t pseglist);
00090 
00103 PmReturn_t seglist_findEqual(pSeglist_t pseglist,
00104                              pPmObj_t pobj, int16_t *r_index);
00105 
00117 PmReturn_t seglist_getItem(pSeglist_t pseglist,
00118                            int16_t index, pPmObj_t *r_pobj);
00119 
00126 PmReturn_t seglist_new(pSeglist_t *r_pseglist);
00127 
00128 
00142 PmReturn_t seglist_insertItem(pSeglist_t pseglist,
00143                               pPmObj_t pobj, int16_t index);
00144 
00156 PmReturn_t seglist_setItem(pSeglist_t pseglist, pPmObj_t pobj, int16_t index);
00157 
00165 PmReturn_t seglist_removeItem(pSeglist_t pseglist, uint16_t index);
00166 
00167 #endif /* __SEGLIST_H__ */

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