/alps/pcitool

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to pywrap/pcipywrap.c

  • Committer: Suren A. Chilingaryan
  • Date: 2016-03-05 15:16:13 UTC
  • Revision ID: csa@suren.me-20160305151613-y724owo6n62xv4f2
Handle build.h in releases

Show diffs side-by-side

added added

removed removed

Lines of Context:
459
459
 
460
460
PyObject* pcipywrap_get_registers_list(pcipywrap *self, const char *bank)
461
461
{
462
 
   pcilib_register_info_t *list = pcilib_get_register_list(self->ctx, bank, PCILIB_LIST_FLAGS_DEFAULT);
463
 
 
464
 
   if(!list) {
465
 
      set_python_exception("pcilib_get_register_list return NULL");
466
 
      return NULL;
467
 
   }
468
 
 
469
 
   PyObject* pyList = PyList_New(0);
470
 
   for(int i = 0; list[i].name; i++)
471
 
   {
472
 
      //serialize item attributes
473
 
      PyObject* pylistItem = pcilib_convert_register_info_to_pyobject(self->ctx, list[i]);
474
 
      pcilib_pylist_append(pyList, pylistItem);
475
 
   }
476
 
   pcilib_free_register_info(self->ctx, list);
477
 
   return pyList;
 
462
    pcilib_register_info_t *list = pcilib_get_register_list(self->ctx, bank, PCILIB_LIST_FLAGS_DEFAULT);
 
463
 
 
464
    if(!list) {
 
465
        set_python_exception("pcilib_get_register_list return NULL");
 
466
        return NULL;
 
467
    }
 
468
 
 
469
    PyObject* pyList = PyList_New(0);
 
470
    for(int i = 0; list[i].name; i++)
 
471
    {
 
472
        //serialize item attributes
 
473
        PyObject* pylistItem = pcilib_convert_register_info_to_pyobject(self->ctx, list[i]);
 
474
        pcilib_pylist_append(pyList, pylistItem);
 
475
    }
 
476
    pcilib_free_register_info(self->ctx, list);
 
477
    return pyList;
478
478
}
479
479
 
480
480
PyObject* pcipywrap_get_register_info(pcipywrap *self, const char* reg,const char *bank)