• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(2328)  |  Call(2290)  |  Derive(0)  |  Import(38)
CFUNCTYPE(restype, *argtypes,
             use_errno=False, use_last_error=False) -> function prototype.

restype: the result type
argtypes: a sequence specifying the argument types

The function prototype can be called in different ways to create a
callable object:

prototype(integer address) -> foreign function
prototype(callable) -> create and return a C callable function from callable
prototype(integer index, method name[, paramflags]) -> foreign function calling a COM method
prototype((ordinal number, dll object)[, paramflags]) -> foreign function exported by ordinal
prototype((function name, dll object)[, paramflags]) -> foreign function exported by name

        def CFUNCTYPE(restype, *argtypes, **kw):
    """CFUNCTYPE(restype, *argtypes,
                 use_errno=False, use_last_error=False) -> function prototype.

    restype: the result type
    argtypes: a sequence specifying the argument types

    The function prototype can be called in different ways to create a
    callable object:

    prototype(integer address) -> foreign function
    prototype(callable) -> create and return a C callable function from callable
    prototype(integer index, method name[, paramflags]) -> foreign function calling a COM method
    prototype((ordinal number, dll object)[, paramflags]) -> foreign function exported by ordinal
    prototype((function name, dll object)[, paramflags]) -> foreign function exported by name
    """
    flags = _FUNCFLAG_CDECL
    if kw.pop("use_errno", False):
        flags |= _FUNCFLAG_USE_ERRNO
    if kw.pop("use_last_error", False):
        flags |= _FUNCFLAG_USE_LASTERROR
    if kw:
        raise ValueError("unexpected keyword argument(s) %s" % kw.keys())
    try:
        return _c_functype_cache[(restype, argtypes, flags)]
    except KeyError:
        class CFunctionType(_CFuncPtr):
            _argtypes_ = argtypes
            _restype_ = restype
            _flags_ = flags
        _c_functype_cache[(restype, argtypes, flags)] = CFunctionType
        return CFunctionType
        


src/p/y/py_examples-HEAD/opencv/CVtypes.py   py_examples(Download)
# --- Importe ----------------------------------------------------------------
 
import ctypes, os
from ctypes import Structure, Union, POINTER, SetPointerType, CFUNCTYPE, cdll, byref
from ctypes import c_char_p, c_double, c_float, c_byte, c_ubyte, c_int, c_void_p, c_ulong
from ctypes import c_uint32, c_short, c_char, c_longlong
 
)
 
# a < b ? -1 : a > b ? 1 : 0
CvCmpFunc = CFUNCTYPE(c_int, # int
    c_void_p, # const void* a
    c_void_p, # const void* b
    c_void_p) # void* userdata
)
 
# Sets a new error handler
CvErrorCallback = CFUNCTYPE(c_int, # int
    c_int, # int status
    c_char_p, # const char* func_name
    c_char_p, # const char* err_msg
)
 
# Computes "minimal work" distance between two weighted point configurations
CvDistanceFunction = CFUNCTYPE(c_float, # float
    c_void_p, # const float* f1
    c_void_p, # const float* f2
    c_void_p) # void* userdata
)
 
# Creates the trackbar and attaches it to the specified window
CvTrackbarCallback = CFUNCTYPE(None, # void
    c_int) # int pos
 
cvCreateTrackbar = cfunc('cvCreateTrackbar', _hgDLL, c_int,
CV_EVENT_FLAG_SHIFTKEY = 16
CV_EVENT_FLAG_ALTKEY = 32
 
CvMouseCallback = CFUNCTYPE(None, # void
    c_int, # int event
    c_int, # int x
    c_int, # int y

src/t/r/translate-toolkit-1.8.0/translate/storage/cpo.py   Translate Toolkit(Download)
from translate.storage import pypo
from translate.storage.pocommon import encodingToUse
from translate.lang import data
from ctypes import c_size_t, c_int, c_uint, c_char_p, c_long, CFUNCTYPE, POINTER
from ctypes import Structure, cdll
import ctypes.util
import os
    _fields_ = []
 
# Function prototypes
xerror_prototype = CFUNCTYPE(None, c_int, POINTER(po_message), STRING, c_uint, c_uint, c_int, STRING)
xerror2_prototype = CFUNCTYPE(None, c_int, POINTER(po_message), STRING, c_uint, c_uint, c_int, STRING, POINTER(po_message), STRING, c_uint, c_uint, c_int, STRING)
 
 
class po_error_handler(Structure):
    _fields_ = [
    ('error', CFUNCTYPE(None, c_int, c_int, STRING)),
    ('error_at_line', CFUNCTYPE(None, c_int, c_int, STRING, c_uint, STRING)),
    ('multiline_warning', CFUNCTYPE(None, STRING, STRING)),
    ('multiline_error', CFUNCTYPE(None, STRING, STRING)),
]

src/t/r/translate-HEAD/src/trunk/translate/storage/cpo.py   translate(Download)
package for the public API of the library.
"""
 
from ctypes import c_size_t, c_int, c_uint, c_char_p, c_long, CFUNCTYPE, POINTER
from ctypes import Structure, cdll
import ctypes.util
import os
    _fields_ = []
 
# Function prototypes
xerror_prototype = CFUNCTYPE(None, c_int, POINTER(po_message), STRING, c_uint, c_uint, c_int, STRING)
xerror2_prototype = CFUNCTYPE(None, c_int, POINTER(po_message), STRING, c_uint, c_uint, c_int, STRING, POINTER(po_message), STRING, c_uint, c_uint, c_int, STRING)
 
 
class po_error_handler(Structure):
    _fields_ = [
    ('error', CFUNCTYPE(None, c_int, c_int, STRING)),
    ('error_at_line', CFUNCTYPE(None, c_int, c_int, STRING, c_uint, STRING)),
    ('multiline_warning', CFUNCTYPE(None, STRING, STRING)),
    ('multiline_error', CFUNCTYPE(None, STRING, STRING)),
]

src/m/a/magickwand-0.2/magickwand/api/types.py   magickwand(Download)
from ctypes import ( c_int,
                     c_uint,
                     c_ubyte,
                     c_ushort,
                     c_double,
                     c_long,
                     c_longlong,
    ( 'path', STRING ),
    ( 'tag', STRING ),
    ( 'handle', c_void_p ),
    ( 'unregister_module', CFUNCTYPE( None ) ),
    ( 'register_module', CFUNCTYPE( c_ulong ) ),
    ( 'load_time', time_t ),
    ( 'stealth', MagickBooleanType ),
]
ChromaticityInfo = _ChromaticityInfo
#------------------------------------------------------------------------------
MagickProgressMonitor = CFUNCTYPE( MagickBooleanType, STRING, MagickOffsetType, MagickSizeType, c_void_p )
#------------------------------------------------------------------------------ 
class _Image( Structure ): pass
Image = _Image
    ( 'artifacts', c_void_p ),
]
#------------------------------------------------------------------------------ 
StreamHandler = CFUNCTYPE( size_t, POINTER( Image ), c_void_p, size_t )
#------------------------------------------------------------------------------ 
class _ImageInfo( Structure ): pass
ImageInfo = _ImageInfo
]
#------------------------------------------------------------------------------ 
DrawContext = POINTER( _DrawingWand )
MonitorHandler = CFUNCTYPE( MagickBooleanType, STRING, MagickOffsetType, MagickSizeType, POINTER( ExceptionInfo ) )
ErrorHandler = CFUNCTYPE( None, ExceptionType, STRING, STRING )
FatalErrorHandler = CFUNCTYPE( None, ExceptionType, STRING, STRING )
WarningHandler = CFUNCTYPE( None, ExceptionType, STRING, STRING )
DecodeImageHandler = CFUNCTYPE( POINTER( Image ), POINTER( ImageInfo ), POINTER( ExceptionInfo ) )
EncodeImageHandler = CFUNCTYPE( MagickBooleanType, POINTER( ImageInfo ), POINTER( Image ) )
IsImageFormatHandler = CFUNCTYPE( MagickBooleanType, POINTER( c_ubyte ), size_t )
ImageFilterHandler = CFUNCTYPE( c_ulong, POINTER( POINTER( Image ) ), c_int, POINTER( STRING ), POINTER( ExceptionInfo ) )

src/i/j/ijson-HEAD/ijson/parse.py   ijson(Download)
from ctypes import Structure, c_uint, c_ubyte, c_int, c_long, c_double, \
                   c_void_p, c_char_p, CFUNCTYPE, POINTER, byref, string_at
from decimal import Decimal
 
from ijson.lib import yajl
 
C_EMPTY = CFUNCTYPE(c_int, c_void_p)
C_INT = CFUNCTYPE(c_int, c_void_p, c_int)
C_LONG = CFUNCTYPE(c_int, c_void_p, c_long)
C_DOUBLE = CFUNCTYPE(c_int, c_void_p, c_double)
C_STR = CFUNCTYPE(c_int, c_void_p, POINTER(c_ubyte), c_uint)

src/i/j/ijson-0.5.0/ijson/parse.py   ijson(Download)
from ctypes import Structure, c_uint, c_ubyte, c_int, c_long, c_double, \
                   c_void_p, c_char_p, CFUNCTYPE, POINTER, byref, string_at
from decimal import Decimal
 
from ijson.lib import yajl
 
C_EMPTY = CFUNCTYPE(c_int, c_void_p)
C_INT = CFUNCTYPE(c_int, c_void_p, c_int)
C_LONG = CFUNCTYPE(c_int, c_void_p, c_long)
C_DOUBLE = CFUNCTYPE(c_int, c_void_p, c_double)
C_STR = CFUNCTYPE(c_int, c_void_p, POINTER(c_ubyte), c_uint)

src/p/y/py-tcdb-0.3/tcdb/tc.py   py-tcdb(Download)
# -*- coding: utf-8 -*-
# Tokyo Cabinet Python ctypes binding.
 
from ctypes import CDLL, CFUNCTYPE, POINTER
from ctypes import c_int, c_int8, c_int32, c_int64
from ctypes import c_uint, c_uint8, c_uint32, c_uint64
from ctypes import c_bool, c_size_t
 
# basic utilities (for experts)
 
TCCMP = CFUNCTYPE(c_int, c_char_p, c_int, c_char_p, c_int, c_void_p)
TCCMP.__doc__ =\
"""Type of the pointer to a comparison function.
 
 
TCCMP_P = POINTER(TCCMP)
 
TCCODEC = CFUNCTYPE(c_void_p, c_void_p, c_int, c_int_p, c_void_p)
TCCODEC.__doc__ =\
"""Type of the pointer to a encoding or decoding function.
 
 
TCCODEC_P = POINTER(TCCODEC)
 
TCPDPROC = CFUNCTYPE(c_void_p, c_void_p, c_int, c_int_p, c_void_p)
TCPDPROC.__doc__ =\
"""Type of the pointer to a callback function to process record
duplication.
 
TCPDPROC_P = POINTER(TCPDPROC)
 
TCITER = CFUNCTYPE(c_bool, c_void_p, c_int, c_void_p, c_int, c_void_p)
TCITER.__doc__ =\
"""Type of the pointer to a iterator function.
 
# Functions from tctdb.h
#
 
TDBQRYPROC = CFUNCTYPE(c_int, c_void_p, c_int, TCMAP_P, c_void_p)
TDBQRYPROC.__doc__ =\
"""Type of the pointer to a iterator function for each table record.
 

src/p/y/pypy-HEAD/pypy/lib/sqlite3/dbapi2.py   pypy(Download)
# 3. This notice may not be removed or altered from any source distribution.
 
from ctypes import c_void_p, c_int, c_double, c_int64, c_char_p, cdll
from ctypes import POINTER, byref, string_at, CFUNCTYPE, cast
import datetime
import sys
import time
        _convert_result(context, val)
    return 0
 
FUNC = CFUNCTYPE(c_int, c_void_p, c_int, POINTER(c_void_p))
STEP = CFUNCTYPE(c_int, c_void_p, c_int, POINTER(c_void_p))
FINAL = CFUNCTYPE(c_int, c_void_p)
sqlite.sqlite3_create_function.argtypes = [c_void_p, c_char_p, c_int, c_int, c_void_p, FUNC, STEP, FINAL]

src/p/y/python-libusb1-HEAD/libusb1.py   python-libusb1(Download)
# libusb-1.0 python wrapper
from ctypes import Structure, \
                   CFUNCTYPE, POINTER, sizeof, cast, \
                   c_short, c_int, c_uint, c_size_t, c_long, \
                   c_uint8, c_uint16, \
                   c_void_p, c_char_p, py_object, string_at
from ctypes.util import find_library
    pass
libusb_transfer_p = POINTER(libusb_transfer)
 
libusb_transfer_cb_fn_p = CFUNCTYPE(None, libusb_transfer_p)
 
libusb_transfer._fields_ = [('dev_handle', libusb_device_handle_p),
                            ('flags', c_uint8),
libusb_pollfd_p = POINTER(libusb_pollfd)
libusb_pollfd_p_p = POINTER(libusb_pollfd_p)
 
libusb_pollfd_added_cb_p = CFUNCTYPE(None, c_int, c_short, py_object)
libusb_pollfd_removed_cb_p = CFUNCTYPE(None, c_int, py_object)
 
#const struct libusb_pollfd **libusb_get_pollfds(libusb_context *ctx);

src/p/a/pam-0.1.4/pam.py   pam(Download)
"""
__all__ = ['authenticate']
 
from ctypes import CDLL, POINTER, Structure, CFUNCTYPE, cast, pointer, sizeof
from ctypes import c_void_p, c_uint, c_char_p, c_char, c_int
from ctypes.util import find_library
 
    def __repr__(self):
        return "<PamResponse %i '%s'>" % (self.resp_retcode, self.resp)
 
CONV_FUNC = CFUNCTYPE(c_int,
        c_int, POINTER(POINTER(PamMessage)),
               POINTER(POINTER(PamResponse)), c_void_p)
 

  1 | 2 | 3 | 4  Next