Changeset 203 for trunk/python2


Ignore:
Timestamp:
08/21/10 12:53:19 (14 years ago)
Author:
tim
Message:

misc fixes

stripped _REC from some data type names

Location:
trunk/python2/regfi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/python2/regfi/pyregfi.h

    r202 r203  
    3737struct TreeIterator_t;
    3838
    39 BIND_STRUCT(REGFI_NK_REC)
    40 BIND_STRUCT(REGFI_VK_REC)
     39BIND_STRUCT(REGFI_NK)
     40BIND_STRUCT(REGFI_VK)
    4141BIND_STRUCT(REGFI_DATA)
    4242
     
    4444CLASS(RawData, Object)
    4545    const REGFI_DATA *data;
    46     const REGFI_VK_REC *rec;
     46    const REGFI_VK *rec;
    4747
    48     RawData METHOD(RawData, Con, REGFI_DATA *data, REGFI_VK_REC *record);
     48    RawData METHOD(RawData, Con, REGFI_DATA *data, REGFI_VK *record);
    4949
    5050    /** Return the raw buffer as a string. By default we only return
     
    7373                                   char **path, REGFI_ENCODING encoding);
    7474
    75 /*     struct ValueIterator_t *METHOD(TreeIterator, list_values);*/
    76 
    7775     void METHOD(TreeIterator, __iter__);
    7876     struct RegistryKey_t *METHOD(TreeIterator, iternext);
    7977
     78
    8079     int METHOD(TreeIterator, down);
    8180     int METHOD(TreeIterator, up);
     81
     82     struct RegistryKey_t *METHOD(TreeIterator, current);
     83     int METHOD(TreeIterator, to_root);
     84
    8285END_CLASS
    8386
     
    8689CLASS(RegistryKey, Object)
    8790     struct RegistryFile_t *file;
    88      const REGFI_NK_REC *key;      /* XXX: temporary */
     91     const REGFI_NK *key;
    8992
    9093     struct RegistryKey_t *METHOD(RegistryKey, Con,
    91                                   struct RegistryFile_t *file, REGFI_NK_REC *base_key);
     94                                  struct RegistryFile_t *file, REGFI_NK *base_key);
    9295
    9396     struct SubkeyIterator_t *METHOD(RegistryKey, subkeys);
     
    104107     
    105108     SubkeyIterator METHOD(SubkeyIterator, Con,
    106                            struct RegistryFile_t *file, REGFI_NK_REC *key);
     109                           struct RegistryFile_t *file, REGFI_NK *key);
    107110
    108111     void METHOD(SubkeyIterator, __iter__);
     
    119122     
    120123     ValueIterator METHOD(ValueIterator, Con,
    121                           struct RegistryFile_t *file, REGFI_NK_REC *key);
     124                          struct RegistryFile_t *file, REGFI_NK *key);
    122125
    123126     void METHOD(ValueIterator, __iter__);
    124      REGFI_VK_REC *METHOD(ValueIterator, iternext);
     127     REGFI_VK *METHOD(ValueIterator, iternext);
    125128END_CLASS
    126129
  • trunk/python2/regfi/regfi.c

    r202 r203  
    8282
    8383static RegistryKey RegistryKey_Con(RegistryKey self,
    84                                    RegistryFile file, REGFI_NK_REC* base_key)
     84                                   RegistryFile file, REGFI_NK* base_key)
    8585{
    8686  if(base_key == NULL)
     
    191191}
    192192
    193 
    194193static int TreeIterator_down(TreeIterator self)
    195194{
     
    205204}
    206205
    207 /*
    208 static ValueIterator TreeIterator_list_values(TreeIterator self)
    209 {
    210   return CONSTRUCT(ValueIterator, ValueIterator, Con, NULL, self);
    211 }
    212 */
     206static RegistryKey TreeIterator_current(TreeIterator self)
     207{
     208  return CONSTRUCT(RegistryKey, RegistryKey, Con, NULL, self->file,
     209                   regfi_iterator_cur_key(self->iter));
     210}
     211
     212static int TreeIterator_to_root(TreeIterator self)
     213{
     214  return regfi_iterator_to_root(self->iter);
     215}
     216
    213217
    214218VIRTUAL(TreeIterator, Object) {
     
    217221  VMETHOD(down) = TreeIterator_down;
    218222  VMETHOD(up) = TreeIterator_up;
     223  VMETHOD(current) = TreeIterator_current;
     224  VMETHOD(to_root) = TreeIterator_to_root;
    219225  VMETHOD(__iter__) = TreeIterator__iter__;
    220226  /*  VMETHOD(list_values) = TreeIterator_list_values;*/
     
    234240static SubkeyIterator SubkeyIterator_Con(SubkeyIterator self,
    235241                                         struct RegistryFile_t* file,
    236                                          REGFI_NK_REC* key)
     242                                         REGFI_NK* key)
    237243{
    238244  /* XXX: add a talloc reference? */
     
    256262static RegistryKey SubkeyIterator_iternext(SubkeyIterator self)
    257263{
    258   const REGFI_NK_REC* nk;
    259 
    260   if(self->cur < self->list->num_keys)
     264  const REGFI_NK* nk;
     265
     266  if(self->list != NULL && self->cur < self->list->num_keys)
    261267  {
    262268    /* XXX: can we switch to UTF-8 and have Python properly import that? */
     
    291297static ValueIterator ValueIterator_Con(ValueIterator self,
    292298                                       struct RegistryFile_t* file,
    293                                        REGFI_NK_REC* key)
     299                                       REGFI_NK* key)
    294300{
    295301  /* XXX: add a talloc reference? */
     
    312318}
    313319
    314 static REGFI_VK_REC* ValueIterator_iternext(ValueIterator self)
    315 {
    316   const REGFI_VK_REC* vk;
     320static REGFI_VK* ValueIterator_iternext(ValueIterator self)
     321{
     322  const REGFI_VK* vk;
    317323
    318324  if(self->list != NULL && self->cur < self->list->num_values)
     
    386392}
    387393
    388 static RawData RawData_Con(RawData self, REGFI_DATA *data, REGFI_VK_REC *record)
     394static RawData RawData_Con(RawData self, REGFI_DATA *data, REGFI_VK *record)
    389395{
    390396  self->rec = record;
Note: See TracChangeset for help on using the changeset viewer.