Example #1
0
def set_session_u8(ref, prop_id, value):
    ref_ctypes = _ctypedefs.nxSessionRef_t(ref)
    prop_id_ctypes = _ctypedefs.u32(prop_id)
    prop_size_ctypes = _ctypedefs.u32(_ctypedefs.bool8.BYTES)
    value_ctypes = _ctypedefs.u8(value)
    value_ctypes_ptr = ctypes.pointer(value_ctypes)
    result = _cfuncs.lib.nx_set_property(ref_ctypes, prop_id_ctypes,
                                         prop_size_ctypes, value_ctypes_ptr)
    _errors.check_for_error(result.value)
Example #2
0
def set_database_u8(ref, prop_id, value):
    # type: (int, int, int) -> None
    ref_ctypes = _ctypedefs.nxDatabaseRef_t(ref)
    prop_id_ctypes = _ctypedefs.u32(prop_id)
    prop_size_ctypes = _ctypedefs.u32(_ctypedefs.bool8.BYTES)
    value_ctypes = _ctypedefs.u8(value)
    value_ctypes_ptr = ctypes.pointer(value_ctypes)
    result = _cfuncs.lib.nxdb_set_property(ref_ctypes, prop_id_ctypes,
                                           prop_size_ctypes, value_ctypes_ptr)
    _errors.check_for_error(result.value)
Example #3
0
def get_database_u8(ref, prop_id):
    ref_ctypes = _ctypedefs.nxDatabase_t(ref)
    prop_id_ctypes = _ctypedefs.u32(prop_id)
    prop_size_ctypes = _ctypedefs.u32(_ctypedefs.bool8.BYTES)
    value_ctypes = _ctypedefs.u8()
    value_ctypes_ptr = ctypes.pointer(value_ctypes)
    result = _cfuncs.lib.nxdb_get_property(ref_ctypes, prop_id_ctypes,
                                           prop_size_ctypes, value_ctypes_ptr)
    _errors.check_for_error(result.value)
    return value_ctypes.value
Example #4
0
def get_session_u8(ref, prop_id):
    # type: (int, int) -> int
    ref_ctypes = _ctypedefs.nxSessionRef_t(ref)
    prop_id_ctypes = _ctypedefs.u32(prop_id)
    prop_size_ctypes = _ctypedefs.u32(_ctypedefs.bool8.BYTES)
    value_ctypes = _ctypedefs.u8()
    value_ctypes_ptr = ctypes.pointer(value_ctypes)
    result = _cfuncs.lib.nx_get_property(ref_ctypes, prop_id_ctypes,
                                         prop_size_ctypes, value_ctypes_ptr)
    _errors.check_for_error(result.value)
    return value_ctypes.value