Python ctypes 模块,c_longlong() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用ctypes.c_longlong()

项目:download-manager    作者:thispc    | 项目源码 | 文件源码
def fsbsize(path):
    """
    Get optimal file system buffer size (in bytes) for I/O calls
    """
    path = encode(path)

    if os.name == "nt":
        import ctypes

        drive = "%s\\" % os.path.splitdrive(path)[0]
        cluster_sectors, sector_size = ctypes.c_longlong(0)

        ctypes.windll.kernel32.GetDiskFreeSpaceW(ctypes.c_wchar_p(drive),
                                                 ctypes.pointer(
                                                     cluster_sectors),
                                                 ctypes.pointer(sector_size),
                                                 None,
                                                 None)
        return cluster_sectors * sector_size

    else:
        return os.statvfs(path).f_frsize
项目:pyload-plugins    作者:pyload    | 项目源码 | 文件源码
def fsbsize(path):
    """
    Get optimal file system buffer size (in bytes) for I/O calls
    """
    path = encode(path)

    if os.name == "nt":
        import ctypes

        drive = "%s\\" % os.path.splitdrive(path)[0]
        cluster_sectors, sector_size = ctypes.c_longlong(0)

        ctypes.windll.kernel32.GetDiskFreeSpaceW(ctypes.c_wchar_p(drive),
                                                 ctypes.pointer(
                                                     cluster_sectors),
                                                 ctypes.pointer(sector_size),
                                                 None,
                                                 None)
        return cluster_sectors * sector_size

    else:
        return os.statvfs(path).f_frsize
项目:ucasAutoLog    作者:CheerL    | 项目源码 | 文件源码
def kill_thread(thread=None, name=None, tid=0, exctype=SystemExit):
    """raises the exception, performs cleanup if needed"""
    if name:
        thread = search_thread(name=name, part=True)
    if thread and isinstance(thread, threading.Thread):
        if not thread.is_alive():
            return '??????'
        tid = thread.ident
    if not tid:
        return '?????'
    if not isinstance(tid, ctypes.c_longlong):
        tid = ctypes.c_longlong(tid)
    if not inspect.isclass(exctype):
        raise TypeError("Only types can be raised (not instances)")
    res = ctypes.pythonapi.PyThreadState_SetAsyncExc(
        tid, ctypes.py_object(exctype))
    if res == 0:
        raise ValueError("invalid thread id")
    elif res != 1:
        # """if it returns a number greater than one, you're in trouble,
        # and you should call it again with exc=NULL to revert the effect"""
        ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, 0)
        raise SystemError("PyThreadState_SetAsyncExc failed")
项目:Packages    作者:Keypirinha    | 项目源码 | 文件源码
def list_alttab_windows(cls):
        """
        Return the list of the windows handles that are currently guessed to be
        eligible to the Alt+Tab panel.
        Raises a OSError exception on error.
        """
        # LPARAM is defined as LONG_PTR (signed type)
        if ctypes.sizeof(ctypes.c_long) == ctypes.sizeof(ctypes.c_void_p):
            LPARAM = ctypes.c_long
        elif ctypes.sizeof(ctypes.c_longlong) == ctypes.sizeof(ctypes.c_void_p):
            LPARAM = ctypes.c_longlong
        EnumWindowsProc = ctypes.WINFUNCTYPE(
                                ctypes.c_bool, ctypes.c_void_p, LPARAM)

        def _enum_proc(hwnd, lparam):
            try:
                if cls.is_alttab_window(hwnd):
                    handles.append(hwnd)
            except OSError:
                pass
            return True

        handles = []
        ctypes.windll.user32.EnumWindows(EnumWindowsProc(_enum_proc), 0)
        return handles
项目:code    作者:ActiveState    | 项目源码 | 文件源码
def _copyData(self, archiveR, archiveW):
    ''' '''
    r    = ctypes.c_int()
    buff = ctypes.c_void_p()
    size = ctypes.c_int()
    offs = ctypes.c_longlong()

    while True:
      # Read in a block
      r = self._readDataBlock(
        archiveR,           # Archive (reading)
        ctypes.byref(buff), # Buffer pointer
        ctypes.byref(size), # Size pointer
        ctypes.byref(offs)) # Offset pointer

      # Check ourselves
      if r == self.ARCH_EOF:
        return self.ARCH_OK
      if r != self.ARCH_OK:
        return r

      # Write out a block
      r = self._writeDataBlock(
        archiveW, # Archive (writing)
        buff,     # Buffer data
        size,     # Size data
        offs)     # Offset data

      # And check ourselves again
      if r != self.ARCH_OK:
        print(self._errorString(archiveB))
        return r
项目:AlexaOPi    作者:dony71    | 项目源码 | 文件源码
def libvlc_media_get_duration(p_md):
    '''Get duration (in ms) of media descriptor object item.
    @param p_md: media descriptor object.
    @return: duration of media item or -1 on error.
    '''
    f = _Cfunctions.get('libvlc_media_get_duration', None) or \
        _Cfunction('libvlc_media_get_duration', ((1,),), None,
                    ctypes.c_longlong, Media)
    return f(p_md)
项目:AlexaOPi    作者:dony71    | 项目源码 | 文件源码
def libvlc_media_player_get_length(p_mi):
    '''Get the current movie length (in ms).
    @param p_mi: the Media Player.
    @return: the movie length (in ms), or -1 if there is no media.
    '''
    f = _Cfunctions.get('libvlc_media_player_get_length', None) or \
        _Cfunction('libvlc_media_player_get_length', ((1,),), None,
                    ctypes.c_longlong, MediaPlayer)
    return f(p_mi)
项目:AlexaOPi    作者:dony71    | 项目源码 | 文件源码
def libvlc_media_player_get_time(p_mi):
    '''Get the current movie time (in ms).
    @param p_mi: the Media Player.
    @return: the movie time (in ms), or -1 if there is no media.
    '''
    f = _Cfunctions.get('libvlc_media_player_get_time', None) or \
        _Cfunction('libvlc_media_player_get_time', ((1,),), None,
                    ctypes.c_longlong, MediaPlayer)
    return f(p_mi)
项目:AlexaOPi    作者:dony71    | 项目源码 | 文件源码
def libvlc_media_player_set_time(p_mi, i_time):
    '''Set the movie time (in ms). This has no effect if no media is being played.
    Not all formats and protocols support this.
    @param p_mi: the Media Player.
    @param i_time: the movie time (in ms).
    '''
    f = _Cfunctions.get('libvlc_media_player_set_time', None) or \
        _Cfunction('libvlc_media_player_set_time', ((1,), (1,),), None,
                    None, MediaPlayer, ctypes.c_longlong)
    return f(p_mi, i_time)
项目:radar    作者:amoose136    | 项目源码 | 文件源码
def _getintp_ctype():
    val = _getintp_ctype.cache
    if val is not None:
        return val
    char = dtype('p').char
    if (char == 'i'):
        val = ctypes.c_int
    elif char == 'l':
        val = ctypes.c_long
    elif char == 'q':
        val = ctypes.c_longlong
    else:
        val = ctypes.c_long
    _getintp_ctype.cache = val
    return val
项目:ringbuffer    作者:bslatkin    | 项目源码 | 文件源码
def __init__(self, slot_count, *, start=None):
        default = start if start is not None else 0
        self.counter = multiprocessing.RawValue(ctypes.c_longlong, default)
        self.position = Position(slot_count)
项目:sublime-Mp3Player    作者:RachitKansal    | 项目源码 | 文件源码
def libvlc_media_get_duration(p_md):
    '''Get duration (in ms) of media descriptor object item.
    @param p_md: media descriptor object.
    @return: duration of media item or -1 on error.
    '''
    f = _Cfunctions.get('libvlc_media_get_duration', None) or \
        _Cfunction('libvlc_media_get_duration', ((1,),), None,
                    ctypes.c_longlong, Media)
    return f(p_md)
项目:sublime-Mp3Player    作者:RachitKansal    | 项目源码 | 文件源码
def libvlc_media_player_get_length(p_mi):
    '''Get the current movie length (in ms).
    @param p_mi: the Media Player.
    @return: the movie length (in ms), or -1 if there is no media.
    '''
    f = _Cfunctions.get('libvlc_media_player_get_length', None) or \
        _Cfunction('libvlc_media_player_get_length', ((1,),), None,
                    ctypes.c_longlong, MediaPlayer)
    return f(p_mi)
项目:sublime-Mp3Player    作者:RachitKansal    | 项目源码 | 文件源码
def libvlc_media_player_get_time(p_mi):
    '''Get the current movie time (in ms).
    @param p_mi: the Media Player.
    @return: the movie time (in ms), or -1 if there is no media.
    '''
    f = _Cfunctions.get('libvlc_media_player_get_time', None) or \
        _Cfunction('libvlc_media_player_get_time', ((1,),), None,
                    ctypes.c_longlong, MediaPlayer)
    return f(p_mi)
项目:sublime-Mp3Player    作者:RachitKansal    | 项目源码 | 文件源码
def libvlc_media_player_set_time(p_mi, i_time):
    '''Set the movie time (in ms). This has no effect if no media is being played.
    Not all formats and protocols support this.
    @param p_mi: the Media Player.
    @param i_time: the movie time (in ms).
    '''
    f = _Cfunctions.get('libvlc_media_player_set_time', None) or \
        _Cfunction('libvlc_media_player_set_time', ((1,), (1,),), None,
                    None, MediaPlayer, ctypes.c_longlong)
    return f(p_mi, i_time)
项目:YoutubeMusicBot    作者:Gr3atWh173    | 项目源码 | 文件源码
def libvlc_media_get_duration(p_md):
    '''Get duration (in ms) of media descriptor object item.
    @param p_md: media descriptor object.
    @return: duration of media item or -1 on error.
    '''
    f = _Cfunctions.get('libvlc_media_get_duration', None) or \
        _Cfunction('libvlc_media_get_duration', ((1,),), None,
                    ctypes.c_longlong, Media)
    return f(p_md)
项目:YoutubeMusicBot    作者:Gr3atWh173    | 项目源码 | 文件源码
def libvlc_media_player_get_length(p_mi):
    '''Get the current movie length (in ms).
    @param p_mi: the Media Player.
    @return: the movie length (in ms), or -1 if there is no media.
    '''
    f = _Cfunctions.get('libvlc_media_player_get_length', None) or \
        _Cfunction('libvlc_media_player_get_length', ((1,),), None,
                    ctypes.c_longlong, MediaPlayer)
    return f(p_mi)
项目:YoutubeMusicBot    作者:Gr3atWh173    | 项目源码 | 文件源码
def libvlc_media_player_get_time(p_mi):
    '''Get the current movie time (in ms).
    @param p_mi: the Media Player.
    @return: the movie time (in ms), or -1 if there is no media.
    '''
    f = _Cfunctions.get('libvlc_media_player_get_time', None) or \
        _Cfunction('libvlc_media_player_get_time', ((1,),), None,
                    ctypes.c_longlong, MediaPlayer)
    return f(p_mi)
项目:YoutubeMusicBot    作者:Gr3atWh173    | 项目源码 | 文件源码
def libvlc_media_player_set_time(p_mi, i_time):
    '''Set the movie time (in ms). This has no effect if no media is being played.
    Not all formats and protocols support this.
    @param p_mi: the Media Player.
    @param i_time: the movie time (in ms).
    '''
    f = _Cfunctions.get('libvlc_media_player_set_time', None) or \
        _Cfunction('libvlc_media_player_set_time', ((1,), (1,),), None,
                    None, MediaPlayer, ctypes.c_longlong)
    return f(p_mi, i_time)
项目:OnCue    作者:featherbear    | 项目源码 | 文件源码
def libvlc_media_get_duration(p_md):
    '''Get duration (in ms) of media descriptor object item.
    @param p_md: media descriptor object.
    @return: duration of media item or -1 on error.
    '''
    f = _Cfunctions.get('libvlc_media_get_duration', None) or \
        _Cfunction('libvlc_media_get_duration', ((1,),), None,
                    ctypes.c_longlong, Media)
    return f(p_md)
项目:OnCue    作者:featherbear    | 项目源码 | 文件源码
def libvlc_media_player_get_length(p_mi):
    '''Get the current movie length (in ms).
    @param p_mi: the Media Player.
    @return: the movie length (in ms), or -1 if there is no media.
    '''
    f = _Cfunctions.get('libvlc_media_player_get_length', None) or \
        _Cfunction('libvlc_media_player_get_length', ((1,),), None,
                    ctypes.c_longlong, MediaPlayer)
    return f(p_mi)
项目:OnCue    作者:featherbear    | 项目源码 | 文件源码
def libvlc_media_player_get_time(p_mi):
    '''Get the current movie time (in ms).
    @param p_mi: the Media Player.
    @return: the movie time (in ms), or -1 if there is no media.
    '''
    f = _Cfunctions.get('libvlc_media_player_get_time', None) or \
        _Cfunction('libvlc_media_player_get_time', ((1,),), None,
                    ctypes.c_longlong, MediaPlayer)
    return f(p_mi)
项目:OnCue    作者:featherbear    | 项目源码 | 文件源码
def libvlc_media_player_set_time(p_mi, i_time):
    '''Set the movie time (in ms). This has no effect if no media is being played.
    Not all formats and protocols support this.
    @param p_mi: the Media Player.
    @param i_time: the movie time (in ms).
    '''
    f = _Cfunctions.get('libvlc_media_player_set_time', None) or \
        _Cfunction('libvlc_media_player_set_time', ((1,), (1,),), None,
                    None, MediaPlayer, ctypes.c_longlong)
    return f(p_mi, i_time)
项目:smashMusic    作者:rukai    | 项目源码 | 文件源码
def libvlc_media_get_duration(p_md):
    '''Get duration (in ms) of media descriptor object item.
    @param p_md: media descriptor object.
    @return: duration of media item or -1 on error.
    '''
    f = _Cfunctions.get('libvlc_media_get_duration', None) or \
        _Cfunction('libvlc_media_get_duration', ((1,),), None,
                    ctypes.c_longlong, Media)
    return f(p_md)
项目:smashMusic    作者:rukai    | 项目源码 | 文件源码
def libvlc_media_player_get_length(p_mi):
    '''Get the current movie length (in ms).
    @param p_mi: the Media Player.
    @return: the movie length (in ms), or -1 if there is no media.
    '''
    f = _Cfunctions.get('libvlc_media_player_get_length', None) or \
        _Cfunction('libvlc_media_player_get_length', ((1,),), None,
                    ctypes.c_longlong, MediaPlayer)
    return f(p_mi)
项目:smashMusic    作者:rukai    | 项目源码 | 文件源码
def libvlc_media_player_get_time(p_mi):
    '''Get the current movie time (in ms).
    @param p_mi: the Media Player.
    @return: the movie time (in ms), or -1 if there is no media.
    '''
    f = _Cfunctions.get('libvlc_media_player_get_time', None) or \
        _Cfunction('libvlc_media_player_get_time', ((1,),), None,
                    ctypes.c_longlong, MediaPlayer)
    return f(p_mi)
项目:smashMusic    作者:rukai    | 项目源码 | 文件源码
def libvlc_media_player_set_time(p_mi, i_time):
    '''Set the movie time (in ms). This has no effect if no media is being played.
    Not all formats and protocols support this.
    @param p_mi: the Media Player.
    @param i_time: the movie time (in ms).
    '''
    f = _Cfunctions.get('libvlc_media_player_set_time', None) or \
        _Cfunction('libvlc_media_player_set_time', ((1,), (1,),), None,
                    None, MediaPlayer, ctypes.c_longlong)
    return f(p_mi, i_time)
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaClientGetResponse_GetValueAsIntegerPointer(self, response, path, value):
        self._lib.AwaClientGetResponse_GetValueAsIntegerPointer.restype = c_int
        mem = cast(value, POINTER(POINTER(c_longlong)))
        ret = self._lib.AwaClientGetResponse_GetValueAsIntegerPointer(response, path, byref(mem))
        result = None
        if ret == 0:
            result = pickle.dumps(cast(mem, POINTER(c_longlong)).contents.value)  # serialise as XML-RPC only supports 32 bit integers
        return result, ret
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaClientGetResponse_GetValueAsTimePointer(self, response, path, value):
        self._lib.AwaClientGetResponse_GetValueAsTimePointer.restype = c_int
        mem = cast(value, POINTER(POINTER(c_longlong)))
        ret = self._lib.AwaClientGetResponse_GetValueAsTimePointer(response, path, byref(mem))
        result = None
        if ret == 0:
            result = pickle.dumps(cast(mem, POINTER(c_longlong)).contents.value)  # serialise as XML-RPC only supports 32 bit integers
        return result, ret
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaClientSetOperation_AddValueAsInteger(self, operation, path, value):
        self._lib.AwaClientSetOperation_AddValueAsInteger.restype = c_int
        self._lib.AwaClientSetOperation_AddValueAsInteger.argtypes = [c_void_p, c_char_p, c_longlong]
        return self._lib.AwaClientSetOperation_AddValueAsInteger(operation, path, value)
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaClientSetOperation_AddValueAsTime(self, operation, path, value):
        self._lib.AwaClientSetOperation_AddValueAsTime.restype = c_int
        self._lib.AwaClientSetOperation_AddValueAsTime.argtypes = [c_void_p, c_char_p, c_longlong]
        return self._lib.AwaClientSetOperation_AddValueAsTime(operation, path, value)
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaClientSetOperation_AddArrayValueAsInteger(self, operation, path, resourceInstanceID, value):
        self._lib.AwaClientSetOperation_AddArrayValueAsInteger.restype = c_int
        self._lib.AwaClientSetOperation_AddArrayValueAsInteger.argtypes = [c_void_p, c_char_p, c_int, c_longlong]
        return self._lib.AwaClientSetOperation_AddArrayValueAsInteger(operation, path, resourceInstanceID, value)
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaIntegerArray_SetValue(self, array, index, value):
        self._lib.AwaIntegerArray_SetValue.restype = c_void_p
        self._lib.AwaIntegerArray_SetValue.argtypes = [c_void_p, c_ulong, c_longlong]
        return self._lib.AwaIntegerArray_SetValue(array, index, value)
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaTimeArray_SetValue(self, array, index, value):
        self._lib.AwaTimeArray_SetValue.restype = c_void_p
        self._lib.AwaTimeArray_SetValue.argtypes = [c_void_p, c_ulong, c_longlong]
        return self._lib.AwaTimeArray_SetValue(array, index, value)
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaIntegerArray_GetValue(self, array, index):
        self._lib.AwaIntegerArray_GetValue.restype = c_longlong
        self._lib.AwaIntegerArray_GetValue.argtypes = [c_void_p, c_ulong]
        return self._lib.AwaIntegerArray_GetValue(array, index)
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaTimeArray_GetValue(self, array, index):
        self._lib.AwaTimeArray_GetValue.restype = c_longlong
        self._lib.AwaTimeArray_GetValue.argtypes = [c_void_p, c_ulong]
        return self._lib.AwaTimeArray_GetValue(array, index)
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaIntegerArrayIterator_GetValue(self, iterator):
        self._lib.AwaIntegerArrayIterator_GetValue.restype = c_longlong
        self._lib.AwaIntegerArrayIterator_GetValue.argtypes = [c_void_p]
        return self._lib.AwaIntegerArrayIterator_GetValue(iterator)
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaObjectDefinition_AddResourceDefinitionAsInteger(self, objectDefinition, resourceID, resourceName, isMandatory, operations, defaultValue):
        self._lib.AwaObjectDefinition_AddResourceDefinitionAsInteger.restype = c_int
        self._lib.AwaObjectDefinition_AddResourceDefinitionAsInteger.argtypes = [c_void_p, c_int, c_char_p, c_bool, c_void_p, c_longlong]
        return self._lib.AwaObjectDefinition_AddResourceDefinitionAsInteger(objectDefinition, resourceID, resourceName, isMandatory, operations, defaultValue)
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaObjectDefinition_AddResourceDefinitionAsTime(self, objectDefinition, resourceID, resourceName, isMandatory, operations, defaultValue):
        self._lib.AwaObjectDefinition_AddResourceDefinitionAsTime.restype = c_int
        self._lib.AwaObjectDefinition_AddResourceDefinitionAsTime.argtypes = [c_void_p, c_int, c_char_p, c_bool, c_void_p, c_longlong]
        return self._lib.AwaObjectDefinition_AddResourceDefinitionAsTime(objectDefinition, resourceID, resourceName, isMandatory, operations, defaultValue)
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaChangeSet_GetValueAsIntegerPointer(self, changeSet, path, value):
        self._lib.AwaChangeSet_GetValueAsIntegerPointer.restype = c_int
        mem = cast(value, POINTER(POINTER(c_longlong)))
        ret = self._lib.AwaChangeSet_GetValueAsIntegerPointer(changeSet, path, byref(mem))
        result = None
        if ret == 0:
            result = cast(mem, POINTER(c_longlong)).contents.value

        return result
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaChangeSet_GetValueAsTimePointer(self, changeSet, path, value):
        self._lib.AwaChangeSet_GetValueAsTimePointer.restype = c_int
        mem = cast(value, POINTER(POINTER(c_longlong)))
        ret = self._lib.AwaChangeSet_GetValueAsTimePointer(changeSet, path, byref(mem))
        result = None
        if ret == 0:
            result = cast(mem, POINTER(c_longlong)).contents.value

        return result

# * @}
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaServerReadResponse_GetValueAsIntegerPointer(self, response, path, value):
        self._lib.AwaServerReadResponse_GetValueAsIntegerPointer.restype = c_int
        mem = cast(value, POINTER(POINTER(c_longlong)))
        ret = self._lib.AwaServerReadResponse_GetValueAsIntegerPointer(response, path, byref(mem))  # serialise as XML-RPC only supports 32 bit integers

        result = None
        if ret == 0:
            result = pickle.dumps(cast(mem, POINTER(c_longlong)).contents.value)
        return result, ret
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaServerWriteOperation_New(self, session, defaultMode):
        self._lib.AwaServerWriteOperation_New.restype = c_void_p
        self._lib.AwaServerWriteOperation_New.argtypes = [c_void_p, c_longlong]
        return self._lib.AwaServerWriteOperation_New(session, defaultMode)
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaServerWriteOperation_AddValueAsInteger(self, operation, path, value):
        self._lib.AwaServerWriteOperation_AddValueAsInteger.restype = c_int
        self._lib.AwaServerWriteOperation_AddValueAsInteger.argtypes = [c_void_p, c_char_p, c_longlong]
        return self._lib.AwaServerWriteOperation_AddValueAsInteger(operation, path, value)
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaServerWriteOperation_AddValueAsTime(self, operation, path, value):
        self._lib.AwaServerWriteOperation_AddValueAsTime.restype = c_int
        self._lib.AwaServerWriteOperation_AddValueAsTime.argtypes = [c_void_p, c_char_p, c_longlong]
        return self._lib.AwaServerWriteOperation_AddValueAsTime(operation, path, value)
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaServerWriteOperation_AddArrayValueAsInteger(self, operation, path, resourceInstanceID, value):
        self._lib.AwaServerWriteOperation_AddArrayValueAsInteger.restype = c_int
        self._lib.AwaServerWriteOperation_AddArrayValueAsInteger.argtypes = [c_void_p, c_char_p, c_int, c_longlong]
        return self._lib.AwaServerWriteOperation_AddArrayValueAsInteger(operation, path, resourceInstanceID, value)
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaServerWriteOperation_AddArrayValueAsTime(self, operation, path, resourceInstanceID, value):
        self._lib.AwaServerWriteOperation_AddArrayValueAsTime.restype = c_int
        self._lib.AwaServerWriteOperation_AddArrayValueAsTime.argtypes = [c_void_p, c_char_p, c_int, c_longlong]
        return self._lib.AwaServerWriteOperation_AddArrayValueAsTime(operation, path, resourceInstanceID, value)
项目:creator-system-test-framework    作者:CreatorDev    | 项目源码 | 文件源码
def AwaServerDiscoverResponse_GetAttributeValueAsIntegerPointer(self, response, path, link, value):
        self._lib.AwaServerDiscoverResponse_GetAttributeValueAsIntegerPointer.restype = c_int
        mem = cast(value, POINTER(c_longlong))
        return self._lib.AwaServerDiscoverResponse_GetAttributeValueAsIntegerPointer(byref(mem))
项目:Personal_AI_Assistant    作者:PratylenClub    | 项目源码 | 文件源码
def libvlc_media_get_duration(p_md):
    '''Get duration (in ms) of media descriptor object item.
    @param p_md: media descriptor object.
    @return: duration of media item or -1 on error.
    '''
    f = _Cfunctions.get('libvlc_media_get_duration', None) or \
        _Cfunction('libvlc_media_get_duration', ((1,),), None,
                    ctypes.c_longlong, Media)
    return f(p_md)
项目:Personal_AI_Assistant    作者:PratylenClub    | 项目源码 | 文件源码
def libvlc_media_player_get_length(p_mi):
    '''Get the current movie length (in ms).
    @param p_mi: the Media Player.
    @return: the movie length (in ms), or -1 if there is no media.
    '''
    f = _Cfunctions.get('libvlc_media_player_get_length', None) or \
        _Cfunction('libvlc_media_player_get_length', ((1,),), None,
                    ctypes.c_longlong, MediaPlayer)
    return f(p_mi)