/usr/lib64/python2.6/site-packages/cffi
NameSizeModeActions
api.py296720644editdlrm
api.pyc294490644editdlrm
backend_ctypes.py401300644editdlrm
backend_ctypes.pyc458290644editdlrm
cffi_opcode.py53640644editdlrm
cffi_opcode.pyc56610644editdlrm
commontypes.py77250644editdlrm
commontypes.pyc64240644editdlrm
cparser.py287950644editdlrm
cparser.pyc201530644editdlrm
ffiplatform.py37860644editdlrm
ffiplatform.pyc48100644editdlrm
gc_weakref.py6420644editdlrm
gc_weakref.pyc12440644editdlrm
lock.py7470644editdlrm
lock.pyc4470644editdlrm
model.py191160644editdlrm
model.pyc220070644editdlrm
parse_c_type.h54940644editdlrm
recompiler.py507800644editdlrm
recompiler.pyc455770644editdlrm
setuptools_ext.py61580644editdlrm
setuptools_ext.pyc69910644editdlrm
vengine_cpy.py411640644editdlrm
vengine_cpy.pyc377550644editdlrm
vengine_gen.py263350644editdlrm
vengine_gen.pyc246250644editdlrm
verifier.py110580644editdlrm
verifier.pyc114480644editdlrm
_cffi_include.h92610644editdlrm
__init__.py4830644editdlrm
__init__.pyc5360644editdlrm
Edit: /usr/lib64/python2.6/site-packages/cffi/api.pyc (29449B)
KVc @sddkZddkZddklZyeWn,ej o ddklZdZnXyeWnej o e ZnXde fdYZ de fd YZ d e fd YZd Zd ZdZdS(iNi(t allocate_lock(tCallablecCs t|tS((t isinstanceR(tx((s./usr/lib64/python2.6/site-packages/cffi/api.pyt stFFIErrorcBseZRS((t__name__t __module__(((s./usr/lib64/python2.6/site-packages/cffi/api.pyRst CDefErrorcBseZdZRS(cCsXyd|idiif}Wn"tttfj o d}nXd||idfS(Ns line %d: its%s%si(targstcoordtlinetAttributeErrort TypeErrort IndexError(tselfR ((s./usr/lib64/python2.6/site-packages/cffi/api.pyt__str__s  (RRR(((s./usr/lib64/python2.6/site-packages/cffi/api.pyRstFFIcBseZdZd,dZeedZddZdZedZ dZ dZ d Z d Z d,d Zd,d,ed Zd ZddZddZdZd,d,d,dZddZdZdZdd,dZdZdZeeed,dZddZdZdZ dZ!dZ"d Z#d!Z$d"Z%d#Z&d$d%Z'd&ed'Z(d(Z)d)Z*d*d+Z+RS(-s The main top-level class that you instantiate once, or once per module. Example usage: ffi = FFI() ffi.cdef(""" int printf(const char *, ...); """) C = ffi.dlopen(None) # standard library -or- C = ffi.verify() # use a C compiler: verify the decl above is right C.printf("hello, %s!\n", ffi.new("char[]", "world")) c Cs$ddkl}l}|djoGddk}ddkl}|i|jptd|i|fn||_t|_ |i |_ h|_ t idi|_t idi|_g|_g|_g|_g|_d|_t|d o|i|nx>|iD]3}|id ot||t||qqW|i iiz.|i|i|_ |i|i!|_"WdQXt#|t ioHtt$d p4|i%|i d t$_&|i'\t$_(t$_)q n1|i%|i d |_&|i'\|_(|_)dS( s{Create an FFI instance. The 'backend' argument is used to select a non-default backend, mostly for tests. i(tcparsertmodeliN(t __version__sversion mismatch, %s != %st parsed_typest new_typestset_ffitRTLD_tNULLi(*R RRtNonet _cffi_backendRtAssertionErrort_backendRt_locktParsert_parsert_cached_btypesttypest ModuleTypet__dict__t _parsed_typest _new_typest_function_cachest _librariest _cdefsourcest_included_ffist_windows_unicodethasattrRt startswithtsetattrtgetattrt__exit__t __enter__t_get_cached_btypet voidp_typetBVoidPtchar_array_typetBCharARRtcastRt _get_typestCDatatCType(RtbackendRRRtname((s./usr/lib64/python2.6/site-packages/cffi/api.pyt__init__0s@           ! c Cst|tp3t|tptdn|id}n|iiiz|ii |d|d||i i ||o"x|i D]}|i qWn|ii}|o1g|i_x"|D]}|i||qWnWdQXdS(sParse the given C source. This registers all declared functions, types, and global variables. The functions and global variables can then be accessed via either 'ffi.dlopen()' or 'ffi.verify()'. The types can be used in 'ffi.new()' and other functions. If 'packed' is specified as True, all structs declared inside this cdef are packed, i.e. laid out without any field alignment at all. s cdef() argument must be a stringtasciitoverridetpackedN(Rtstrt basestringRtencodeRR1R2R!tparseR*tappendR(tcleart _recompletetfinish_backend_type(RtcsourceR@RAtcachet finishlistttp((s./usr/lib64/python2.6/site-packages/cffi/api.pytcdef^s"   icCs{t|tp|djpt|iiiz<t|||\}}|ii ||i i |WdQX|S(sHLoad and return a dynamic library identified by 'name'. The standard C library can be loaded by passing None. Note that functions and types declared by 'ffi.cdef()' are not linked to a particular library, just like C headers; in the library we only look for the actual (untyped) symbols. N( RRCRRRR1R2t_make_ffi_libraryR(RFR)(RR=tflagstlibtfunction_cache((s./usr/lib64/python2.6/site-packages/cffi/api.pytdlopenvs $cCs|}||ijo |i|St|tp|id}n|ii|}|i}|o|i}n|i|}||f}||i|<|S(NR?( R&RRBRDR!t parse_typetis_raw_functiontas_function_pointerR3(Rtcdecltkeyttypetreally_a_function_typetbtypetresult((s./usr/lib64/python2.6/site-packages/cffi/api.pyt_typeof_lockeds    cCsy|i|}Wn=tj o1|iiiz|i|}WdQXnX|\}}|o| otd|fn|S(Ns>the type %r is a function type, not a pointer-to-function type(R&tKeyErrorRR1R2R]R(RRWtconsider_function_as_funcptrR\R[RZ((s./usr/lib64/python2.6/site-packages/cffi/api.pyt_typeofs cCst|to|i|St||io|ii|St|tio"t|}|dj o|Snt|ti o?t |do/|i i iz|i|iSWdQXntt|dS(sParse the C type given as a string and return the corresponding object. It can also be used on 'cdata' instance to get its C type. t_cffi_base_typeN(RRCR`R:RttypeofR#tBuiltinFunctionTypet_builtin_function_typeRt FunctionTypeR-RR1R2R3RaRRY(RRWtres((s./usr/lib64/python2.6/site-packages/cffi/api.pyRbs   cCsDt|to |i|}|ii|S|ii|SdS(svReturn the size in bytes of the argument. It can be a string naming a C type, or a 'cdata' instance. N(RRCR`Rtsizeof(RRWtBType((s./usr/lib64/python2.6/site-packages/cffi/api.pyRgscCs3t|to|i|}n|ii|S(s\Return the natural alignment size in bytes of the C type given as a string. (RRCR`Rtalignof(RRW((s./usr/lib64/python2.6/site-packages/cffi/api.pyRiscGs7t|to|i|}n|i||dS(s5Return the offset of the named field inside the given structure or array, which must be given as a C type name. You can give several field names in case of nested structures. You can also give numeric values which correspond to array items, in case of an array type. i(RRCR`t _typeoffsetof(RRWtfields_or_indexes((s./usr/lib64/python2.6/site-packages/cffi/api.pytoffsetofscCs6t|to|i|}n|ii||S(sAllocate an instance according to the specified C type and return a pointer to it. The specified C type must be either a pointer or an array: ``new('X *')`` allocates an X and returns a pointer to it, whereas ``new('X[n]')`` allocates an array of n X'es and returns an array referencing it (which works mostly like a pointer, like in C). You can also use ``new('X[]', n)`` to allocate an array of a non-constant length n. The memory is initialized following the rules of declaring a global variable in C: by default it is zero-initialized, but an explicit initializer can be given which can be used to fill all or part of the memory. When the returned object goes out of scope, the memory is freed. In other words the returned object has ownership of the value of type 'cdecl' that it points to. This means that the raw data can be used as long as this object is kept alive, but must not be used for a longer time. Be careful about that when copying the pointer to the memory somewhere else, e.g. into another structure. (RRCR`Rtnewp(RRWtinit((s./usr/lib64/python2.6/site-packages/cffi/api.pytnewscs=ii}|i|||dfd}|S(sReturn a new allocator, i.e. a function that behaves like ffi.new() but uses the provided low-level 'alloc' and 'free' functions. 'alloc' is called with the size as argument. If it returns NULL, a MemoryError is raised. 'free' is called with the result of 'alloc' as argument. Both can be either Python function or directly C functions. If 'free' is None, then no free function is called. If both 'alloc' and 'free' are None, the default is used. If 'should_clear_after_alloc' is set to False, then the memory returned by 'alloc' is assumed to be already cleared (or you are fine with garbage); otherwise CFFI will clear it. cs0t|toi|}n||S(N(RRCR`(RWRn(Rt allocator(s./usr/lib64/python2.6/site-packages/cffi/api.pytallocatesN(RRt new_allocatorR(Rtalloctfreetshould_clear_after_alloct compiled_ffiRq((RRps./usr/lib64/python2.6/site-packages/cffi/api.pyRrs   cCs6t|to|i|}n|ii||S(sSimilar to a C cast: returns an instance of the named C type initialized with the given 'source'. The source is casted between integers or pointers of any type. (RRCR`RR8(RRWtsource((s./usr/lib64/python2.6/site-packages/cffi/api.pyR8sicCs|ii||S(sReturn a Python string (or unicode string) from the 'cdata'. If 'cdata' is a pointer or array of characters or bytes, returns the null-terminated string. The returned string extends until the first null character, or at most 'maxlen' characters. If 'cdata' is an array then 'maxlen' defaults to its length. If 'cdata' is a pointer or array of wchar_t, returns a unicode string following the same rules. If 'cdata' is a single character or byte or a wchar_t, returns it as a string or unicode string. If 'cdata' is an enum, returns the value of the enumerator as a string, or 'NUMBER' if the value is out of range. (Rtstring(Rtcdatatmaxlen((s./usr/lib64/python2.6/site-packages/cffi/api.pyRxscCs|ii||S(sReturn a read-write buffer object that references the raw C data pointed to by the given 'cdata'. The 'cdata' must be a pointer or an array. Can be passed to functions expecting a buffer, or directly manipulated with: buf[:] get a copy of it in a regular string, or buf[idx] as a single character buf[:] = ... buf[idx] = ... change the content (Rtbuffer(RRytsize((s./usr/lib64/python2.6/site-packages/cffi/api.pyR{"s cCs|ii|i|S(sReturn a that points to the data of the given Python object, which must support the buffer interface. Note that this is not meant to be used on the built-in types str, unicode, or bytearray (you can build 'char[]' arrays explicitly) but only on objects containing large quantities of raw data in some other format, like 'array.array' or numpy arrays. (Rt from_bufferR7(Rt python_buffer((s./usr/lib64/python2.6/site-packages/cffi/api.pyR}/scsafd}ttoidtn|djo|S||SdS(sReturn a callback object or a decorator making such a callback object. 'cdecl' must name a C function pointer type. The callback invokes the specified 'python_callable' (which may be provided either directly or via a decorator). Important: the callback object must be manually kept alive for as long as the callback may be invoked from the C level. cs6t|ptdnii|S(Ns.the 'python_callable' argument is not callable(tcallableRRtcallback(tpython_callable(RWtonerrorRterror(s./usr/lib64/python2.6/site-packages/cffi/api.pytcallback_decorator_wrapAs R_N(RRCR`tTrueR(RRWRRRR((RWRRRs./usr/lib64/python2.6/site-packages/cffi/api.pyR9s  R cCst|to|i|}n|i}|ido*d|ii|djod|}n'|o|ddjod|}n|ii||S(s.Return a string giving the C type 'cdecl', which may be itself a string or a object. If 'replace_with' is given, it gives extra text to append (or insert for more complicated C types), like a variable name, or '*' to get actually the C type 'pointer-to-cdecl'. t*s&[t&s(%s)is[(t (RRCR`tstripR.Rtgetcname(RRWt replace_with((s./usr/lib64/python2.6/site-packages/cffi/api.pytgetctypeNs c Csy|ii}Wntj onX|||S|iiizZy |i}Wn6tj o*ddkl}||}|_nX|i ||SWdQXdS(sReturn a new cdata object that points to the same data. Later, when this new cdata object is garbage-collected, 'destructor(old_cdata_object)' will be called. i(t GcWeakrefsN( RtgcpR RR1R2t gc_weakrefst gc_weakrefRtbuild(RRyt destructorRRR((s./usr/lib64/python2.6/site-packages/cffi/api.pytgc^s  cCs|iittjpty|i|}WnLtj o@g}|i||}x#|D]}|i||qaWnX|S(N(RtacquiretFalseRR"R^tget_cached_btypeRI(RRYRhRL((s./usr/lib64/python2.6/site-packages/cffi/api.pyR3rs cKs|ddkl}l}|io|i|n|p|}||||||_|ii}|ii||S(sVerify that the current ffi signatures compile on this machine, and return a dynamic library object. The dynamic library can be used to call functions and access global variables declared in this 'ffi'. The library is compiled by the C compiler: it gives you C-level API compatibility (including calling macros). This is unlike 'ffi.dlopen()', which requires binary compatibility in the signatures. i(tVerifiert_caller_dir_pycache(tverifierRRR,t_apply_windows_unicodet load_libraryR)RF(RRwttmpdirtkwargsRRRQ((s./usr/lib64/python2.6/site-packages/cffi/api.pytverify~s  cCs |iiS(N(Rt get_errno(R((s./usr/lib64/python2.6/site-packages/cffi/api.pyt _get_errnoscCs|ii|dS(N(Rt set_errno(Rterrno((s./usr/lib64/python2.6/site-packages/cffi/api.pyt _set_errnoss(the value of 'errno' from/to the C callscCs|ii|S(N(Rt getwinerror(Rtcode((s./usr/lib64/python2.6/site-packages/cffi/api.pyRscCs?ddkl}|iiiz|i||SWdQXdS(Ni(R(R RRR1R2t pointer_cache(RtctypeR((s./usr/lib64/python2.6/site-packages/cffi/api.pyt _pointer_toscGs|ii|}|o|i||\}}n'|idjotdnd}|i|}|ii|||S(sReturn the address of a . If 'fields_or_indexes' are given, returns the address of that field or array item in the structure or array, recursively in case of nested structures. tpointersaddressof(pointer)i(RRbRjtkindRRt rawaddressof(RRyRkRtoffsettctypeptr((s./usr/lib64/python2.6/site-packages/cffi/api.pyt addressofscGs^|ii||\}}x6|D].}|ii||d\}}||7}q"W||fS(Ni(Rt typeoffsetof(RRtfield_or_indexRkRtfield1toffset1((s./usr/lib64/python2.6/site-packages/cffi/api.pyRjs c Cst|tp tdt|ifn||jotdn|iiizu|iiizZ|i i |i |i i d|i i |i |i i d|ii |WdQXWdQXdS(sIncludes the typedefs, structs, unions and enums defined in another FFI instance. Usage is similar to a #include in C, where a part of the program might include types defined in another part for its own usage. Note that the include() method has no effect on functions, constants and global variables, which must anyway be accessed directly from the lib object returned by the original FFI instance. sGffi.include() expects an argument that is also of type cffi.FFI, not %rsself.include(self)t[t]N(RRRRYRt ValueErrorRR1R2R!tincludeR*RFtextendR+(Rtffi_to_include((s./usr/lib64/python2.6/site-packages/cffi/api.pyRs  cCs|ii|i|S(N(Rt newp_handleR5(RR((s./usr/lib64/python2.6/site-packages/cffi/api.pyt new_handlescCs|ii|S(N(Rt from_handle(RR((s./usr/lib64/python2.6/site-packages/cffi/api.pyRscCs^|idj otdnt|}|o|idn|id||_dS(scWindows: if 'enabled_flag' is True, enable the UNICODE and _UNICODE defines in C, and declare the types like TCHAR and LPTCSTR to be (pointers to) wchar_t. If 'enabled_flag' is False, declare these types to be (pointers to) plain 8-bit characters. This is mostly for backward compatibility; you usually want True. s%set_unicode() can only be called oncestypedef wchar_t TBYTE;typedef wchar_t TCHAR;typedef const wchar_t *LPCTSTR;typedef const wchar_t *PCTSTR;typedef wchar_t *LPTSTR;typedef wchar_t *PTSTR;typedef TBYTE *PTBYTE;typedef TCHAR *PTCHAR;stypedef char TBYTE;typedef char TCHAR;typedef const char *LPCTSTR;typedef const char *PCTSTR;typedef char *LPTSTR;typedef char *PTSTR;typedef TBYTE *PTBYTE;typedef TCHAR *PTCHAR;N(R,RRtboolRN(Rt enabled_flag((s./usr/lib64/python2.6/site-packages/cffi/api.pyt set_unicodes  cCs\|idd}t|ttfptdnt|ddg}||dRRNRSR]R`RbRgRiRlRoRRrR8RxR{R}RRRR3RRRtpropertyRRRRRjRRRRRRRRRR(((s./usr/lib64/python2.6/site-packages/cffi/api.pyRsP .                           cCs|djo+tidjo|id|Sd}nyEd|jo$d|jotd|fn|i||SWnRtj oFddk}|ii|}|djon|i||SXdS(Ntwin32tcRt/slibrary not found: %ri(RRtplatformRtOSErrort ctypes.utiltutilt find_library(R<R=RPtctypestpath((s./usr/lib64/python2.6/site-packages/cffi/api.pyt_load_backend_libJs    c sddk}i}t|||gfdfddtffdY|dj oNy4t|tp|id}nd|_Wqt j oqXni fS(Nic s^d}|iijouii|}i|yi}Wn+tj o}td|fnX|is$  .  Q