Generated by Cython 0.24

Yellow lines hint at Python interaction.
Click on a line that starts with a "`+`" to see the C code that Cython generated for it.

Raw output: devinfo.c

     001: # cython: c_string_type=unicode, c_string_encoding=ascii

     002: #

     003: # Copyright (c) 2015 iXsystems, Inc.

     004: # All rights reserved.

     005: #

     006: # Redistribution and use in source and binary forms, with or without

     007: # modification, are permitted provided that the following conditions

     008: # are met:

     009: # 1. Redistributions of source code must retain the above copyright

     010: #    notice, this list of conditions and the following disclaimer.

     011: # 2. Redistributions in binary form must reproduce the above copyright

     012: #    notice, this list of conditions and the following disclaimer in the

     013: #    documentation and/or other materials provided with the distribution.

     014: #

     015: # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND

     016: # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE

     017: # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE

     018: # ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE

     019: # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL

     020: # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS

     021: # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)

     022: # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT

     023: # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY

     024: # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF

     025: # SUCH DAMAGE.

     026: #

     027:

    +028: import enum

      __pyx_t_1 = __Pyx_Import(__pyx_n_s_enum, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_enum, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     029: import cython

     030: cimport defs

     031:

     032:

    +033: class ResourceManagers(dict):

      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(((PyObject *)(&PyDict_Type)));
      __Pyx_GIVEREF(((PyObject *)(&PyDict_Type)));
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyDict_Type)));
      __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ResourceManagers, __pyx_n_s_ResourceManagers, (PyObject *) NULL, __pyx_n_s_bsd_devinfo, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    /* … */
      __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ResourceManagers, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_ResourceManagers, __pyx_t_4) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     034:

    +035:     def append(self, rman):

    /* Python wrapper */
    static PyObject *__pyx_pw_3bsd_7devinfo_16ResourceManagers_1append(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_mdef_3bsd_7devinfo_16ResourceManagers_1append = {"append", (PyCFunction)__pyx_pw_3bsd_7devinfo_16ResourceManagers_1append, METH_VARARGS|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_3bsd_7devinfo_16ResourceManagers_1append(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_self = 0;
      PyObject *__pyx_v_rman = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("append (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_rman,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rman)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("append", 1, 2, 2, 1); __PYX_ERR(0, 35, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "append") < 0)) __PYX_ERR(0, 35, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_self = values[0];
        __pyx_v_rman = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("append", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 35, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("bsd.devinfo.ResourceManagers.append", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_3bsd_7devinfo_16ResourceManagers_append(__pyx_self, __pyx_v_self, __pyx_v_rman);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_3bsd_7devinfo_16ResourceManagers_append(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_rman) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("append", 0);
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("bsd.devinfo.ResourceManagers.append", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_rman); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 35, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__3);
      __Pyx_GIVEREF(__pyx_tuple__3);
    /* … */
      __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3bsd_7devinfo_16ResourceManagers_1append, 0, __pyx_n_s_ResourceManagers_append, NULL, __pyx_n_s_bsd_devinfo, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_append, __pyx_t_4) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +036:         self[rman.desc] = rman

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rman, __pyx_n_s_desc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(PyObject_SetItem(__pyx_v_self, __pyx_t_1, __pyx_v_rman) < 0)) __PYX_ERR(0, 36, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     037:

     038:

    +039: RESOURCE_MANAGERS = ResourceManagers()

      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ResourceManagers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_RESOURCE_MANAGERS, __pyx_t_1) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     040:

     041:

    +042: cdef class ResourceManager(dict):

    struct __pyx_obj_3bsd_7devinfo_ResourceManager {
      PyDictObject __pyx_base;
      PyObject *desc;
      PyObject *start;
      PyObject *size;
    };

    +043:     cdef readonly object desc

    /* Python wrapper */
    static PyObject *__pyx_pw_3bsd_7devinfo_15ResourceManager_4desc_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_3bsd_7devinfo_15ResourceManager_4desc_1__get__(PyObject *__pyx_v_self) {
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_r = __pyx_pf_3bsd_7devinfo_15ResourceManager_4desc___get__(((struct __pyx_obj_3bsd_7devinfo_ResourceManager *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_3bsd_7devinfo_15ResourceManager_4desc___get__(struct __pyx_obj_3bsd_7devinfo_ResourceManager *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__", 0);
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->desc);
      __pyx_r = __pyx_v_self->desc;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +044:     cdef readonly object start

    /* Python wrapper */
    static PyObject *__pyx_pw_3bsd_7devinfo_15ResourceManager_5start_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_3bsd_7devinfo_15ResourceManager_5start_1__get__(PyObject *__pyx_v_self) {
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_r = __pyx_pf_3bsd_7devinfo_15ResourceManager_5start___get__(((struct __pyx_obj_3bsd_7devinfo_ResourceManager *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_3bsd_7devinfo_15ResourceManager_5start___get__(struct __pyx_obj_3bsd_7devinfo_ResourceManager *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__", 0);
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->start);
      __pyx_r = __pyx_v_self->start;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +045:     cdef readonly object size

    /* Python wrapper */
    static PyObject *__pyx_pw_3bsd_7devinfo_15ResourceManager_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_3bsd_7devinfo_15ResourceManager_4size_1__get__(PyObject *__pyx_v_self) {
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_r = __pyx_pf_3bsd_7devinfo_15ResourceManager_4size___get__(((struct __pyx_obj_3bsd_7devinfo_ResourceManager *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_3bsd_7devinfo_15ResourceManager_4size___get__(struct __pyx_obj_3bsd_7devinfo_ResourceManager *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__", 0);
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->size);
      __pyx_r = __pyx_v_self->size;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     046:

    +047:     def __init__(self):

    /* Python wrapper */
    static int __pyx_pw_3bsd_7devinfo_15ResourceManager_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static int __pyx_pw_3bsd_7devinfo_15ResourceManager_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
      if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
      if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
      __pyx_r = __pyx_pf_3bsd_7devinfo_15ResourceManager___init__(((struct __pyx_obj_3bsd_7devinfo_ResourceManager *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_3bsd_7devinfo_15ResourceManager___init__(CYTHON_UNUSED struct __pyx_obj_3bsd_7devinfo_ResourceManager *__pyx_v_self) {
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("bsd.devinfo.ResourceManager.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = -1;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +048:         raise RuntimeError('ResourceManager cannot be instantiated by the user')

      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 48, __pyx_L1_error)
    /* … */
      __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_ResourceManager_cannot_be_instan); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 48, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple_);
      __Pyx_GIVEREF(__pyx_tuple_);

     049:

    +050:     def __repr__(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_3bsd_7devinfo_15ResourceManager_3__repr__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_3bsd_7devinfo_15ResourceManager_3__repr__(PyObject *__pyx_v_self) {
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
      __pyx_r = __pyx_pf_3bsd_7devinfo_15ResourceManager_2__repr__(((struct __pyx_obj_3bsd_7devinfo_ResourceManager *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_3bsd_7devinfo_15ResourceManager_2__repr__(struct __pyx_obj_3bsd_7devinfo_ResourceManager *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__repr__", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("bsd.devinfo.ResourceManager.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +051:         return '<ResourceManager: {0}>'.format(self.desc)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_ResourceManager_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->desc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_self->desc);
        __Pyx_GIVEREF(__pyx_v_self->desc);
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self->desc);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     052:

    +053:     def append(self, dev):

    /* Python wrapper */
    static PyObject *__pyx_pw_3bsd_7devinfo_15ResourceManager_5append(PyObject *__pyx_v_self, PyObject *__pyx_v_dev); /*proto*/
    static PyObject *__pyx_pw_3bsd_7devinfo_15ResourceManager_5append(PyObject *__pyx_v_self, PyObject *__pyx_v_dev) {
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("append (wrapper)", 0);
      __pyx_r = __pyx_pf_3bsd_7devinfo_15ResourceManager_4append(((struct __pyx_obj_3bsd_7devinfo_ResourceManager *)__pyx_v_self), ((PyObject *)__pyx_v_dev));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_3bsd_7devinfo_15ResourceManager_4append(struct __pyx_obj_3bsd_7devinfo_ResourceManager *__pyx_v_self, PyObject *__pyx_v_dev) {
      PyObject *__pyx_v_entry = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("append", 0);
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_AddTraceback("bsd.devinfo.ResourceManager.append", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_entry);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +054:         entry = self.get(dev.name)

      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dev, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_entry = __pyx_t_1;
      __pyx_t_1 = 0;

    +055:         if entry is None:

      __pyx_t_6 = (__pyx_v_entry == Py_None);
      __pyx_t_7 = (__pyx_t_6 != 0);
      if (__pyx_t_7) {
    /* … */
        goto __pyx_L3;
      }

    +056:             self[dev.name] = [dev]

        __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_dev);
        __Pyx_GIVEREF(__pyx_v_dev);
        PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_dev);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dev, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_t_2, __pyx_t_1) < 0)) __PYX_ERR(0, 56, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +057:         elif isinstance(entry, list):

      __pyx_t_7 = PyList_Check(__pyx_v_entry);
      __pyx_t_6 = (__pyx_t_7 != 0);
      if (__pyx_t_6) {
    /* … */
        goto __pyx_L3;
      }

    +058:             entry.append(dev)

        __pyx_t_8 = __Pyx_PyObject_Append(__pyx_v_entry, __pyx_v_dev); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 58, __pyx_L1_error)

     059:         else:

    +060:             self[dev.name] = [entry, dev]

      /*else*/ {
        __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_entry);
        __Pyx_GIVEREF(__pyx_v_entry);
        PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_entry);
        __Pyx_INCREF(__pyx_v_dev);
        __Pyx_GIVEREF(__pyx_v_dev);
        PyList_SET_ITEM(__pyx_t_1, 1, __pyx_v_dev);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dev, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_t_2, __pyx_t_1) < 0)) __PYX_ERR(0, 60, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L3:;

     061:

     062:

    +063: cdef class Device(object):

    struct __pyx_obj_3bsd_7devinfo_Device {
      PyObject_HEAD
      PyObject *name;
      PyObject *desc;
      PyObject *drivername;
      PyObject *location;
      PyObject *start;
      PyObject *size;
    };

    +064:     cdef readonly object name

    /* Python wrapper */
    static PyObject *__pyx_pw_3bsd_7devinfo_6Device_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_3bsd_7devinfo_6Device_4name_1__get__(PyObject *__pyx_v_self) {
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_r = __pyx_pf_3bsd_7devinfo_6Device_4name___get__(((struct __pyx_obj_3bsd_7devinfo_Device *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_3bsd_7devinfo_6Device_4name___get__(struct __pyx_obj_3bsd_7devinfo_Device *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__", 0);
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->name);
      __pyx_r = __pyx_v_self->name;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +065:     cdef readonly object desc

    /* Python wrapper */
    static PyObject *__pyx_pw_3bsd_7devinfo_6Device_4desc_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_3bsd_7devinfo_6Device_4desc_1__get__(PyObject *__pyx_v_self) {
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_r = __pyx_pf_3bsd_7devinfo_6Device_4desc___get__(((struct __pyx_obj_3bsd_7devinfo_Device *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_3bsd_7devinfo_6Device_4desc___get__(struct __pyx_obj_3bsd_7devinfo_Device *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__", 0);
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->desc);
      __pyx_r = __pyx_v_self->desc;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +066:     cdef readonly object drivername

    /* Python wrapper */
    static PyObject *__pyx_pw_3bsd_7devinfo_6Device_10drivername_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_3bsd_7devinfo_6Device_10drivername_1__get__(PyObject *__pyx_v_self) {
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_r = __pyx_pf_3bsd_7devinfo_6Device_10drivername___get__(((struct __pyx_obj_3bsd_7devinfo_Device *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_3bsd_7devinfo_6Device_10drivername___get__(struct __pyx_obj_3bsd_7devinfo_Device *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__", 0);
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->drivername);
      __pyx_r = __pyx_v_self->drivername;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +067:     cdef readonly object location

    /* Python wrapper */
    static PyObject *__pyx_pw_3bsd_7devinfo_6Device_8location_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_3bsd_7devinfo_6Device_8location_1__get__(PyObject *__pyx_v_self) {
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_r = __pyx_pf_3bsd_7devinfo_6Device_8location___get__(((struct __pyx_obj_3bsd_7devinfo_Device *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_3bsd_7devinfo_6Device_8location___get__(struct __pyx_obj_3bsd_7devinfo_Device *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__", 0);
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->location);
      __pyx_r = __pyx_v_self->location;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +068:     cdef readonly object start

    /* Python wrapper */
    static PyObject *__pyx_pw_3bsd_7devinfo_6Device_5start_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_3bsd_7devinfo_6Device_5start_1__get__(PyObject *__pyx_v_self) {
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_r = __pyx_pf_3bsd_7devinfo_6Device_5start___get__(((struct __pyx_obj_3bsd_7devinfo_Device *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_3bsd_7devinfo_6Device_5start___get__(struct __pyx_obj_3bsd_7devinfo_Device *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__", 0);
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->start);
      __pyx_r = __pyx_v_self->start;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +069:     cdef readonly object size

    /* Python wrapper */
    static PyObject *__pyx_pw_3bsd_7devinfo_6Device_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_3bsd_7devinfo_6Device_4size_1__get__(PyObject *__pyx_v_self) {
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_r = __pyx_pf_3bsd_7devinfo_6Device_4size___get__(((struct __pyx_obj_3bsd_7devinfo_Device *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_3bsd_7devinfo_6Device_4size___get__(struct __pyx_obj_3bsd_7devinfo_Device *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__", 0);
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->size);
      __pyx_r = __pyx_v_self->size;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     070:

    +071:     def __init__(self):

    /* Python wrapper */
    static int __pyx_pw_3bsd_7devinfo_6Device_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static int __pyx_pw_3bsd_7devinfo_6Device_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
      if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
      if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
      __pyx_r = __pyx_pf_3bsd_7devinfo_6Device___init__(((struct __pyx_obj_3bsd_7devinfo_Device *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_3bsd_7devinfo_6Device___init__(CYTHON_UNUSED struct __pyx_obj_3bsd_7devinfo_Device *__pyx_v_self) {
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("bsd.devinfo.Device.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = -1;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +072:         raise RuntimeError('Device cannot be instantiated by the user')

      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 72, __pyx_L1_error)
    /* … */
      __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Device_cannot_be_instantiated_by); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 72, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__2);
      __Pyx_GIVEREF(__pyx_tuple__2);

     073:

    +074:     def __repr__(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_3bsd_7devinfo_6Device_3__repr__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_3bsd_7devinfo_6Device_3__repr__(PyObject *__pyx_v_self) {
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
      __pyx_r = __pyx_pf_3bsd_7devinfo_6Device_2__repr__(((struct __pyx_obj_3bsd_7devinfo_Device *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_3bsd_7devinfo_6Device_2__repr__(struct __pyx_obj_3bsd_7devinfo_Device *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__repr__", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("bsd.devinfo.Device.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +075:         return '<Device: {0}>'.format(self.name)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Device_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_self->name);
        __Pyx_GIVEREF(__pyx_v_self->name);
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self->name);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     076:

     077:

     078: cdef class DevInfo(object):

     079:

    +080:     def __cinit__(self):

    /* Python wrapper */
    static int __pyx_pw_3bsd_7devinfo_7DevInfo_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static int __pyx_pw_3bsd_7devinfo_7DevInfo_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
      if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
        __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
      if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
      __pyx_r = __pyx_pf_3bsd_7devinfo_7DevInfo___cinit__(((struct __pyx_obj_3bsd_7devinfo_DevInfo *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_3bsd_7devinfo_7DevInfo___cinit__(CYTHON_UNUSED struct __pyx_obj_3bsd_7devinfo_DevInfo *__pyx_v_self) {
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__cinit__", 0);
    /* … */
      /* function exit code */
      __pyx_r = 0;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +081:         defs.devinfo_init()

      devinfo_init();

     082:

    +083:     def __dealloc__(self):

    /* Python wrapper */
    static void __pyx_pw_3bsd_7devinfo_7DevInfo_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
    static void __pyx_pw_3bsd_7devinfo_7DevInfo_3__dealloc__(PyObject *__pyx_v_self) {
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
      __pyx_pf_3bsd_7devinfo_7DevInfo_2__dealloc__(((struct __pyx_obj_3bsd_7devinfo_DevInfo *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
    }

    static void __pyx_pf_3bsd_7devinfo_7DevInfo_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_3bsd_7devinfo_DevInfo *__pyx_v_self) {
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__dealloc__", 0);
    /* … */
      /* function exit code */
      __Pyx_RefNannyFinishContext();
    }

    +084:         defs.devinfo_free()

      devinfo_free();

     085:

     086:     property resource_managers:

    +087:         def __get__(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_3bsd_7devinfo_7DevInfo_17resource_managers_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_3bsd_7devinfo_7DevInfo_17resource_managers_1__get__(PyObject *__pyx_v_self) {
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_r = __pyx_pf_3bsd_7devinfo_7DevInfo_17resource_managers___get__(((struct __pyx_obj_3bsd_7devinfo_DevInfo *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_3bsd_7devinfo_7DevInfo_17resource_managers___get__(CYTHON_UNUSED struct __pyx_obj_3bsd_7devinfo_DevInfo *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("bsd.devinfo.DevInfo.resource_managers.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     088:             global RESOURCE_MANAGERS

    +089:             RESOURCE_MANAGERS.clear()

      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_RESOURCE_MANAGERS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_2) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +090:             defs.devinfo_foreach_rman(&resource_manager, <void *>None)

      devinfo_foreach_rman((&__pyx_f_3bsd_7devinfo_resource_manager), ((void *)Py_None));

    +091:             return RESOURCE_MANAGERS

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_RESOURCE_MANAGERS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     092:

     093:

    +094: cdef int rman_resource(defs.devinfo_res *res, void *unused):

    static int __pyx_f_3bsd_7devinfo_rman_resource(struct devinfo_res *__pyx_v_res, CYTHON_UNUSED void *__pyx_v_unused) {
      struct devinfo_dev *__pyx_v_dev;
      struct devinfo_rman *__pyx_v_rman;
      struct __pyx_obj_3bsd_7devinfo_Device *__pyx_v_device = 0;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("rman_resource", 0);
    /* … */
      /* function exit code */
      __pyx_r = 0;
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_WriteUnraisable("bsd.devinfo.rman_resource", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF((PyObject *)__pyx_v_device);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     095:     cdef defs.devinfo_dev* dev

     096:     cdef defs.devinfo_rman* rman

     097:     cdef Device device

     098:     global RESOURCE_MANAGERS

     099:

    +100:     rman = defs.devinfo_handle_to_rman(res.dr_rman)

      __pyx_v_rman = devinfo_handle_to_rman(__pyx_v_res->dr_rman);

    +101:     if rman == NULL:

      __pyx_t_1 = ((__pyx_v_rman == NULL) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +102:         return 0

        __pyx_r = 0;
        goto __pyx_L0;

     103:

    +104:     dev = defs.devinfo_handle_to_device(res.dr_device)

      __pyx_v_dev = devinfo_handle_to_device(__pyx_v_res->dr_device);

    +105:     if dev == NULL or len(dev.dd_name) == 0:

      __pyx_t_2 = ((__pyx_v_dev == NULL) != 0);
      if (!__pyx_t_2) {
      } else {
        __pyx_t_1 = __pyx_t_2;
        goto __pyx_L5_bool_binop_done;
      }
      __pyx_t_3 = strlen(__pyx_v_dev->dd_name);
      __pyx_t_2 = ((__pyx_t_3 == 0) != 0);
      __pyx_t_1 = __pyx_t_2;
      __pyx_L5_bool_binop_done:;
      if (__pyx_t_1) {
    /* … */
      }

    +106:         return 0

        __pyx_r = 0;
        goto __pyx_L0;

     107:

    +108:     device = Device.__new__(Device)

      __pyx_t_4 = __pyx_tp_new_3bsd_7devinfo_Device(((PyTypeObject *)__pyx_ptype_3bsd_7devinfo_Device), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3bsd_7devinfo_Device)))) __PYX_ERR(0, 108, __pyx_L1_error)
      __pyx_v_device = ((struct __pyx_obj_3bsd_7devinfo_Device *)__pyx_t_4);
      __pyx_t_4 = 0;

    +109:     device.name = dev.dd_name

      __pyx_t_4 = __Pyx_PyUnicode_FromString(__pyx_v_dev->dd_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_v_device->name);
      __Pyx_DECREF(__pyx_v_device->name);
      __pyx_v_device->name = __pyx_t_4;
      __pyx_t_4 = 0;

    +110:     device.desc = dev.dd_desc

      __pyx_t_4 = __Pyx_PyUnicode_FromString(__pyx_v_dev->dd_desc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_v_device->desc);
      __Pyx_DECREF(__pyx_v_device->desc);
      __pyx_v_device->desc = __pyx_t_4;
      __pyx_t_4 = 0;

    +111:     device.drivername = dev.dd_drivername

      __pyx_t_4 = __Pyx_PyUnicode_FromString(__pyx_v_dev->dd_drivername); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_v_device->drivername);
      __Pyx_DECREF(__pyx_v_device->drivername);
      __pyx_v_device->drivername = __pyx_t_4;
      __pyx_t_4 = 0;

    +112:     device.location = dev.dd_location

      __pyx_t_4 = __Pyx_PyUnicode_FromString(__pyx_v_dev->dd_location); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_v_device->location);
      __Pyx_DECREF(__pyx_v_device->location);
      __pyx_v_device->location = __pyx_t_4;
      __pyx_t_4 = 0;

    +113:     device.start = res.dr_start

      __pyx_t_4 = __Pyx_PyInt_From_unsigned_long(__pyx_v_res->dr_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_v_device->start);
      __Pyx_DECREF(__pyx_v_device->start);
      __pyx_v_device->start = __pyx_t_4;
      __pyx_t_4 = 0;

    +114:     device.size = res.dr_size

      __pyx_t_4 = __Pyx_PyInt_From_unsigned_long(__pyx_v_res->dr_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_v_device->size);
      __Pyx_DECREF(__pyx_v_device->size);
      __pyx_v_device->size = __pyx_t_4;
      __pyx_t_4 = 0;

    +115:     RESOURCE_MANAGERS[rman.dm_desc].append(device)

      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_RESOURCE_MANAGERS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyUnicode_FromString(__pyx_v_rman->dm_desc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 115, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_Append(__pyx_t_6, ((PyObject *)__pyx_v_device)); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 115, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     116:

     117:

    +118: cdef int resource_manager(defs.devinfo_rman *rman, void *unused):

    static int __pyx_f_3bsd_7devinfo_resource_manager(struct devinfo_rman *__pyx_v_rman, CYTHON_UNUSED void *__pyx_v_unused) {
      struct __pyx_obj_3bsd_7devinfo_ResourceManager *__pyx_v_resourcemanager = 0;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("resource_manager", 0);
    /* … */
      /* function exit code */
      __pyx_r = 0;
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_WriteUnraisable("bsd.devinfo.resource_manager", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF((PyObject *)__pyx_v_resourcemanager);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     119:     global RESOURCE_MANAGERS

     120:     cdef ResourceManager resourcemanager

     121:

    +122:     resourcemanager = ResourceManager.__new__(ResourceManager)

      __pyx_t_1 = __pyx_tp_new_3bsd_7devinfo_ResourceManager(((PyTypeObject *)__pyx_ptype_3bsd_7devinfo_ResourceManager), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3bsd_7devinfo_ResourceManager)))) __PYX_ERR(0, 122, __pyx_L1_error)
      __pyx_v_resourcemanager = ((struct __pyx_obj_3bsd_7devinfo_ResourceManager *)__pyx_t_1);
      __pyx_t_1 = 0;

    +123:     resourcemanager.desc = rman.dm_desc

      __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_rman->dm_desc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_resourcemanager->desc);
      __Pyx_DECREF(__pyx_v_resourcemanager->desc);
      __pyx_v_resourcemanager->desc = __pyx_t_1;
      __pyx_t_1 = 0;

    +124:     resourcemanager.start = rman.dm_start

      __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rman->dm_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_resourcemanager->start);
      __Pyx_DECREF(__pyx_v_resourcemanager->start);
      __pyx_v_resourcemanager->start = __pyx_t_1;
      __pyx_t_1 = 0;

    +125:     resourcemanager.size = rman.dm_size

      __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rman->dm_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_resourcemanager->size);
      __Pyx_DECREF(__pyx_v_resourcemanager->size);
      __pyx_v_resourcemanager->size = __pyx_t_1;
      __pyx_t_1 = 0;

    +126:     RESOURCE_MANAGERS.append(resourcemanager)

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_RESOURCE_MANAGERS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_Append(__pyx_t_1, ((PyObject *)__pyx_v_resourcemanager)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 126, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +127:     defs.devinfo_foreach_rman_resource(rman, &rman_resource, <void *>None)

      devinfo_foreach_rman_resource(__pyx_v_rman, (&__pyx_f_3bsd_7devinfo_rman_resource), ((void *)Py_None));