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 __DICT_H__ 00017 #define __DICT_H__ 00018 00019 00035 typedef struct PmDict_s 00036 { 00038 PmObjDesc_t od; 00040 int16_t length; 00042 pSeglist_t d_keys; 00044 pSeglist_t d_vals; 00045 } PmDict_t, 00046 *pPmDict_t; 00047 00048 00057 PmReturn_t dict_clear(pPmObj_t pdict); 00058 00067 PmReturn_t dict_getItem(pPmObj_t pdict, pPmObj_t pkey, pPmObj_t *r_pobj); 00068 00069 #ifdef HAVE_DEL 00070 00079 PmReturn_t dict_delItem(pPmObj_t pdict, pPmObj_t pkey); 00080 #endif /* HAVE_DEL */ 00081 00089 PmReturn_t dict_new(pPmObj_t *r_pdict); 00090 00104 PmReturn_t dict_setItem(pPmObj_t pdict, pPmObj_t pkey, pPmObj_t pval); 00105 00106 #ifdef HAVE_PRINT 00107 00113 PmReturn_t dict_print(pPmObj_t pdict); 00114 #endif /* HAVE_PRINT */ 00115 00123 PmReturn_t dict_update(pPmObj_t pdestdict, pPmObj_t psourcedict); 00124 00125 #endif /* __DICT_H__ */