# Pastebin bIijb0T4 ionel:xenial ~/osp/cookiecutter-pylibrary/python-nameless master#?> tox -e py27 0.00s => 0 12:54 GLOB sdist-make: /home/ionel/osp/cookiecutter-pylibrary/python-nameless/setup.py py27 inst-nodeps: /home/ionel/osp/cookiecutter-pylibrary/python-nameless/.tox/dist/nameless-0.1.0.zip ERROR: invocation failed (exit code 1), logfile: /home/ionel/osp/cookiecutter-pylibrary/python-nameless/.tox/py27/log/py27-40.log ERROR: actionid: py27 msg: installpkg cmdargs: ['/home/ionel/osp/cookiecutter-pylibrary/python-nameless/.tox/py27/bin/pip', 'install', '-U', '--no-deps', '/home/ionel/osp/cookiecutter-pylibrary/python-nameless/.tox/dist/nameless-0.1.0.zip'] env: {'GOPATH': '/home/ionel/.gocode', 'ALL_PROXY': '', 'LESS': '-R', 'NO_PROXY': '', 'http_proxy': '', '_JAVA_OPTIONS': '-Dawt.useSystemAAFontSettings=on -Dswing.aatext=false', 'LC_CTYPE': 'en_US.UTF-8', 'SSH_CLIENT': '10.0.2.2 61399 22', 'LOGNAME': 'ionel', 'USER': 'ionel', 'HOME': '/home/ionel', 'PATH': '/home/ionel/osp/cookiecutter-pylibrary/python-nameless/.tox/py27/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/ionel/bin:/home/ionel/.local/bin:/home/ionel/.fzf/bin', 'PYTHONUNBUFFERED': 'yes', 'ZSH': '/home/ionel/.antigen/repos/https-COLON--SLASH--SLASH-github.com-SLASH-robbyrussell-SLASH-oh-my-zsh.git', 'DISPLAY': 'xenial:13.0', 'SSH_CONNECTION': '10.0.2.2 61399 10.0.2.15 22', 'LANG': 'en_US.UTF-8', 'TERM': 'putty-256color', 'SHELL': '/usr/bin/zsh', 'LANGUAGE': 'en_US:en', 'SHLVL': '1', 'DEBFULLNAME': 'Ionel Cristian Maries', 'https_proxy': '', 'PYTHONHASHSEED': '538678444', 'EDITOR': 'nano', 'DEBEMAIL': 'contact@ionelmc.ro', 'XDG_RUNTIME_DIR': '/run/user/1000', 'PYTHONPATH': '/home/ionel/osp/cookiecutter-pylibrary/python-nameless/tests', 'SSH_AUTH_SOCK': '/tmp/ssh-WoQyoQEUrY/agent.19811', 'VIRTUAL_ENV': '/home/ionel/osp/cookiecutter-pylibrary/python-nameless/.tox/py27', 'ADOTDIR': '/home/ionel/.antigen', 'ANTIGEN_DEFAULT_REPO_URL': 'https://github.com/robbyrussell/oh-my-zsh.git', 'XDG_SESSION_ID': '868', '_': '/usr/local/bin/tox', 'LSCOLORS': 'Gxfxcxdxbxegedabagacad', 'SSH_TTY': '/dev/pts/3', 'OLDPWD': '/home/ionel', 'PWD': '/home/ionel/osp/cookiecutter-pylibrary/python-nameless', 'PYTHONWARNINGS': 'ignore:A true SSLContext object is not available', 'FZF_DEFAULT_OPTS': '--exact', 'MAIL': '/var/mail/ionel', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:', 'PAGER': 'less', 'DEFAULT_USER': 'ionel'} Processing ./.tox/dist/nameless-0.1.0.zip Building wheels for collected packages: nameless Running setup.py bdist_wheel for nameless: started Running setup.py bdist_wheel for nameless: finished with status 'error' Complete output from command /home/ionel/osp/cookiecutter-pylibrary/python-nameless/.tox/py27/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-lRDo5_-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpUQ5Ma4pip-wheel- --python-tag cp27: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/nameless copying src/nameless/cli.py -> build/lib.linux-x86_64-2.7/nameless copying src/nameless/__init__.py -> build/lib.linux-x86_64-2.7/nameless copying src/nameless/_nameless_build.py -> build/lib.linux-x86_64-2.7/nameless copying src/nameless/__main__.py -> build/lib.linux-x86_64-2.7/nameless running egg_info writing src/nameless.egg-info/PKG-INFO writing dependency_links to src/nameless.egg-info/dependency_links.txt writing requirements to src/nameless.egg-info/requires.txt writing entry points to src/nameless.egg-info/entry_points.txt writing top-level names to src/nameless.egg-info/top_level.txt reading manifest file 'src/nameless.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no directories found matching 'examples' warning: no files found matching '.isort.cfg' warning: no previously-included files matching '*.py[cod]' found anywhere in distribution warning: no previously-included files matching '__pycache__' found anywhere in distribution warning: no previously-included files matching '*.so' found anywhere in distribution warning: no previously-included files matching '*.dylib' found anywhere in distribution writing manifest file 'src/nameless.egg-info/SOURCES.txt' copying src/nameless/_nameless.c -> build/lib.linux-x86_64-2.7/nameless running build_ext generating cffi module 'build/temp.linux-x86_64-2.7/nameless._nameless.c' creating build/temp.linux-x86_64-2.7 building 'nameless._nameless' extension creating build/temp.linux-x86_64-2.7/build creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/src creating build/temp.linux-x86_64-2.7/src/nameless x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/nameless._nameless.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/nameless._nameless.o build/temp.linux-x86_64-2.7/nameless._nameless.c: In function ‘_cffi_d_longest’: build/temp.linux-x86_64-2.7/nameless._nameless.c:497:10: warning: implicit declaration of function ‘longest’ [-Wimplicit-function-declaration] return longest(x0, x1); ^ build/temp.linux-x86_64-2.7/nameless._nameless.c:497:10: warning: return makes pointer from integer without a cast [-Wint-conversion] build/temp.linux-x86_64-2.7/nameless._nameless.c: In function ‘_cffi_f_longest’: build/temp.linux-x86_64-2.7/nameless._nameless.c:530:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion] { result = longest(x0, x1); } ^ x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/nameless/_nameless.c -o build/temp.linux-x86_64-2.7/src/nameless/_nameless.o src/nameless/_nameless.c: In function ‘longest’: src/nameless/_nameless.c:8:19: warning: implicit declaration of function ‘strlen’ [-Wimplicit-function-declaration] len = strlen(argv[i]); ^ src/nameless/_nameless.c:8:19: warning: incompatible implicit declaration of built-in function ‘strlen’ src/nameless/_nameless.c:8:19: note: include ‘’ or provide a declaration of ‘strlen’ src/nameless/_nameless.c:16:16: error: ‘NULL’ undeclared (first use in this function) return NULL; ^ src/nameless/_nameless.c:16:16: note: each undeclared identifier is reported only once for each function it appears in src/nameless/_nameless.c:18:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Failed building wheel for nameless Running setup.py clean for nameless Failed to build nameless Installing collected packages: nameless Found existing installation: nameless 0.1.0 Uninstalling nameless-0.1.0: Successfully uninstalled nameless-0.1.0 Running setup.py install for nameless: started Running setup.py install for nameless: finished with status 'error' Complete output from command /home/ionel/osp/cookiecutter-pylibrary/python-nameless/.tox/py27/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-lRDo5_-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-YDcmlr-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ionel/osp/cookiecutter-pylibrary/python-nameless/.tox/py27/include/site/python2.7/nameless: running install running build running build_py creating build creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/nameless copying src/nameless/cli.py -> build/lib.linux-x86_64-2.7/nameless copying src/nameless/__init__.py -> build/lib.linux-x86_64-2.7/nameless copying src/nameless/_nameless_build.py -> build/lib.linux-x86_64-2.7/nameless copying src/nameless/__main__.py -> build/lib.linux-x86_64-2.7/nameless running egg_info writing src/nameless.egg-info/PKG-INFO writing dependency_links to src/nameless.egg-info/dependency_links.txt writing requirements to src/nameless.egg-info/requires.txt writing entry points to src/nameless.egg-info/entry_points.txt writing top-level names to src/nameless.egg-info/top_level.txt reading manifest file 'src/nameless.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no directories found matching 'examples' warning: no files found matching '.isort.cfg' warning: no previously-included files matching '*.py[cod]' found anywhere in distribution warning: no previously-included files matching '__pycache__' found anywhere in distribution warning: no previously-included files matching '*.so' found anywhere in distribution warning: no previously-included files matching '*.dylib' found anywhere in distribution writing manifest file 'src/nameless.egg-info/SOURCES.txt' copying src/nameless/_nameless.c -> build/lib.linux-x86_64-2.7/nameless running build_ext generating cffi module 'build/temp.linux-x86_64-2.7/nameless._nameless.c' creating build/temp.linux-x86_64-2.7 building 'nameless._nameless' extension creating build/temp.linux-x86_64-2.7/build creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/src creating build/temp.linux-x86_64-2.7/src/nameless x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/nameless._nameless.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/nameless._nameless.o build/temp.linux-x86_64-2.7/nameless._nameless.c: In function ‘_cffi_d_longest’: build/temp.linux-x86_64-2.7/nameless._nameless.c:497:10: warning: implicit declaration of function ‘longest’ [-Wimplicit-function-declaration] return longest(x0, x1); ^ build/temp.linux-x86_64-2.7/nameless._nameless.c:497:10: warning: return makes pointer from integer without a cast [-Wint-conversion] build/temp.linux-x86_64-2.7/nameless._nameless.c: In function ‘_cffi_f_longest’: build/temp.linux-x86_64-2.7/nameless._nameless.c:530:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion] { result = longest(x0, x1); } ^ x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/nameless/_nameless.c -o build/temp.linux-x86_64-2.7/src/nameless/_nameless.o src/nameless/_nameless.c: In function ‘longest’: src/nameless/_nameless.c:8:19: warning: implicit declaration of function ‘strlen’ [-Wimplicit-function-declaration] len = strlen(argv[i]); ^ src/nameless/_nameless.c:8:19: warning: incompatible implicit declaration of built-in function ‘strlen’ src/nameless/_nameless.c:8:19: note: include ‘’ or provide a declaration of ‘strlen’ src/nameless/_nameless.c:16:16: error: ‘NULL’ undeclared (first use in this function) return NULL; ^ src/nameless/_nameless.c:16:16: note: each undeclared identifier is reported only once for each function it appears in src/nameless/_nameless.c:18:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Rolling back uninstall of nameless Command "/home/ionel/osp/cookiecutter-pylibrary/python-nameless/.tox/py27/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-lRDo5_-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-YDcmlr-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ionel/osp/cookiecutter-pylibrary/python-nameless/.tox/py27/include/site/python2.7/nameless" failed with error code 1 in /tmp/pip-lRDo5_-build/ py27 installed: cffi==1.11.2,coverage==4.4.1,nameless==0.1.0,py==1.4.34,pycparser==2.18,pytest==3.2.3,pytest-cov==2.5.1,pytest-travis-fold==1.2.0 _________________________________________________________________________________ summary __________________________________________________________________________________ ERROR: py27: InvocationError: /home/ionel/osp/cookiecutter-pylibrary/python-nameless/.tox/py27/bin/pip install -U --no-deps /home/ionel/osp/cookiecutter-pylibrary/python-nameless/.tox/dist/nameless-0.1.0.zip (see /home/ionel/osp/cookiecutter-pylibrary/python-nameless/.tox/py27/log/py27-40.log) ionel:xenial ~/osp/cookiecutter-pylibrary/python-nameless master#?> cat build/temp.linux-x86_64-2.7/nameless._nameless.c 3.09s => 1 12:54 #define _CFFI_ /* We try to define Py_LIMITED_API before including Python.h. Mess: we can only define it if Py_DEBUG, Py_TRACE_REFS and Py_REF_DEBUG are not defined. This is a best-effort approximation: we can learn about Py_DEBUG from pyconfig.h, but it is unclear if the same works for the other two macros. Py_DEBUG implies them, but not the other way around. */ #if !defined(_CFFI_USE_EMBEDDING) && !defined(Py_LIMITED_API) # include # if !defined(Py_DEBUG) && !defined(Py_TRACE_REFS) && !defined(Py_REF_DEBUG) # define Py_LIMITED_API # endif #endif #include #ifdef __cplusplus extern "C" { #endif #include /* This part is from file 'cffi/parse_c_type.h'. It is copied at the beginning of C sources generated by CFFI's ffi.set_source(). */ typedef void *_cffi_opcode_t; #define _CFFI_OP(opcode, arg) (_cffi_opcode_t)(opcode | (((uintptr_t)(arg)) << 8)) #define _CFFI_GETOP(cffi_opcode) ((unsigned char)(uintptr_t)cffi_opcode) #define _CFFI_GETARG(cffi_opcode) (((intptr_t)cffi_opcode) >> 8) #define _CFFI_OP_PRIMITIVE 1 #define _CFFI_OP_POINTER 3 #define _CFFI_OP_ARRAY 5 #define _CFFI_OP_OPEN_ARRAY 7 #define _CFFI_OP_STRUCT_UNION 9 #define _CFFI_OP_ENUM 11 #define _CFFI_OP_FUNCTION 13 #define _CFFI_OP_FUNCTION_END 15 #define _CFFI_OP_NOOP 17 #define _CFFI_OP_BITFIELD 19 #define _CFFI_OP_TYPENAME 21 #define _CFFI_OP_CPYTHON_BLTN_V 23 // varargs #define _CFFI_OP_CPYTHON_BLTN_N 25 // noargs #define _CFFI_OP_CPYTHON_BLTN_O 27 // O (i.e. a single arg) #define _CFFI_OP_CONSTANT 29 #define _CFFI_OP_CONSTANT_INT 31 #define _CFFI_OP_GLOBAL_VAR 33 #define _CFFI_OP_DLOPEN_FUNC 35 #define _CFFI_OP_DLOPEN_CONST 37 #define _CFFI_OP_GLOBAL_VAR_F 39 #define _CFFI_OP_EXTERN_PYTHON 41 #define _CFFI_PRIM_VOID 0 #define _CFFI_PRIM_BOOL 1 #define _CFFI_PRIM_CHAR 2 #define _CFFI_PRIM_SCHAR 3 #define _CFFI_PRIM_UCHAR 4 #define _CFFI_PRIM_SHORT 5 #define _CFFI_PRIM_USHORT 6 #define _CFFI_PRIM_INT 7 #define _CFFI_PRIM_UINT 8 #define _CFFI_PRIM_LONG 9 #define _CFFI_PRIM_ULONG 10 #define _CFFI_PRIM_LONGLONG 11 #define _CFFI_PRIM_ULONGLONG 12 #define _CFFI_PRIM_FLOAT 13 #define _CFFI_PRIM_DOUBLE 14 #define _CFFI_PRIM_LONGDOUBLE 15 #define _CFFI_PRIM_WCHAR 16 #define _CFFI_PRIM_INT8 17 #define _CFFI_PRIM_UINT8 18 #define _CFFI_PRIM_INT16 19 #define _CFFI_PRIM_UINT16 20 #define _CFFI_PRIM_INT32 21 #define _CFFI_PRIM_UINT32 22 #define _CFFI_PRIM_INT64 23 #define _CFFI_PRIM_UINT64 24 #define _CFFI_PRIM_INTPTR 25 #define _CFFI_PRIM_UINTPTR 26 #define _CFFI_PRIM_PTRDIFF 27 #define _CFFI_PRIM_SIZE 28 #define _CFFI_PRIM_SSIZE 29 #define _CFFI_PRIM_INT_LEAST8 30 #define _CFFI_PRIM_UINT_LEAST8 31 #define _CFFI_PRIM_INT_LEAST16 32 #define _CFFI_PRIM_UINT_LEAST16 33 #define _CFFI_PRIM_INT_LEAST32 34 #define _CFFI_PRIM_UINT_LEAST32 35 #define _CFFI_PRIM_INT_LEAST64 36 #define _CFFI_PRIM_UINT_LEAST64 37 #define _CFFI_PRIM_INT_FAST8 38 #define _CFFI_PRIM_UINT_FAST8 39 #define _CFFI_PRIM_INT_FAST16 40 #define _CFFI_PRIM_UINT_FAST16 41 #define _CFFI_PRIM_INT_FAST32 42 #define _CFFI_PRIM_UINT_FAST32 43 #define _CFFI_PRIM_INT_FAST64 44 #define _CFFI_PRIM_UINT_FAST64 45 #define _CFFI_PRIM_INTMAX 46 #define _CFFI_PRIM_UINTMAX 47 #define _CFFI_PRIM_FLOATCOMPLEX 48 #define _CFFI_PRIM_DOUBLECOMPLEX 49 #define _CFFI_PRIM_CHAR16 50 #define _CFFI_PRIM_CHAR32 51 #define _CFFI__NUM_PRIM 52 #define _CFFI__UNKNOWN_PRIM (-1) #define _CFFI__UNKNOWN_FLOAT_PRIM (-2) #define _CFFI__UNKNOWN_LONG_DOUBLE (-3) #define _CFFI__IO_FILE_STRUCT (-1) struct _cffi_global_s { const char *name; void *address; _cffi_opcode_t type_op; void *size_or_direct_fn; // OP_GLOBAL_VAR: size, or 0 if unknown // OP_CPYTHON_BLTN_*: addr of direct function }; struct _cffi_getconst_s { unsigned long long value; const struct _cffi_type_context_s *ctx; int gindex; }; struct _cffi_struct_union_s { const char *name; int type_index; // -> _cffi_types, on a OP_STRUCT_UNION int flags; // _CFFI_F_* flags below size_t size; int alignment; int first_field_index; // -> _cffi_fields array int num_fields; }; #define _CFFI_F_UNION 0x01 // is a union, not a struct #define _CFFI_F_CHECK_FIELDS 0x02 // complain if fields are not in the // "standard layout" or if some are missing #define _CFFI_F_PACKED 0x04 // for CHECK_FIELDS, assume a packed struct #define _CFFI_F_EXTERNAL 0x08 // in some other ffi.include() #define _CFFI_F_OPAQUE 0x10 // opaque struct _cffi_field_s { const char *name; size_t field_offset; size_t field_size; _cffi_opcode_t field_type_op; }; struct _cffi_enum_s { const char *name; int type_index; // -> _cffi_types, on a OP_ENUM int type_prim; // _CFFI_PRIM_xxx const char *enumerators; // comma-delimited string }; struct _cffi_typename_s { const char *name; int type_index; /* if opaque, points to a possibly artificial OP_STRUCT which is itself opaque */ }; struct _cffi_type_context_s { _cffi_opcode_t *types; const struct _cffi_global_s *globals; const struct _cffi_field_s *fields; const struct _cffi_struct_union_s *struct_unions; const struct _cffi_enum_s *enums; const struct _cffi_typename_s *typenames; int num_globals; int num_struct_unions; int num_enums; int num_typenames; const char *const *includes; int num_types; int flags; /* future extension */ }; struct _cffi_parse_info_s { const struct _cffi_type_context_s *ctx; _cffi_opcode_t *output; unsigned int output_size; size_t error_location; const char *error_message; }; struct _cffi_externpy_s { const char *name; size_t size_of_result; void *reserved1, *reserved2; }; #ifdef _CFFI_INTERNAL static int parse_c_type(struct _cffi_parse_info_s *info, const char *input); static int search_in_globals(const struct _cffi_type_context_s *ctx, const char *search, size_t search_len); static int search_in_struct_unions(const struct _cffi_type_context_s *ctx, const char *search, size_t search_len); #endif /* this block of #ifs should be kept exactly identical between c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py and cffi/_cffi_include.h */ #if defined(_MSC_VER) # include /* for alloca() */ # if _MSC_VER < 1600 /* MSVC < 2010 */ typedef __int8 int8_t; typedef __int16 int16_t; typedef __int32 int32_t; typedef __int64 int64_t; typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; typedef __int8 int_least8_t; typedef __int16 int_least16_t; typedef __int32 int_least32_t; typedef __int64 int_least64_t; typedef unsigned __int8 uint_least8_t; typedef unsigned __int16 uint_least16_t; typedef unsigned __int32 uint_least32_t; typedef unsigned __int64 uint_least64_t; typedef __int8 int_fast8_t; typedef __int16 int_fast16_t; typedef __int32 int_fast32_t; typedef __int64 int_fast64_t; typedef unsigned __int8 uint_fast8_t; typedef unsigned __int16 uint_fast16_t; typedef unsigned __int32 uint_fast32_t; typedef unsigned __int64 uint_fast64_t; typedef __int64 intmax_t; typedef unsigned __int64 uintmax_t; # else # include # endif # if _MSC_VER < 1800 /* MSVC < 2013 */ # ifndef __cplusplus typedef unsigned char _Bool; # endif # endif #else # include # if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux) # include # endif #endif #ifdef __GNUC__ # define _CFFI_UNUSED_FN __attribute__((unused)) #else # define _CFFI_UNUSED_FN /* nothing */ #endif #ifdef __cplusplus # ifndef _Bool typedef bool _Bool; /* semi-hackish: C++ has no _Bool; bool is builtin */ # endif #endif /********** CPython-specific section **********/ #ifndef PYPY_VERSION #if PY_MAJOR_VERSION >= 3 # define PyInt_FromLong PyLong_FromLong #endif #define _cffi_from_c_double PyFloat_FromDouble #define _cffi_from_c_float PyFloat_FromDouble #define _cffi_from_c_long PyInt_FromLong #define _cffi_from_c_ulong PyLong_FromUnsignedLong #define _cffi_from_c_longlong PyLong_FromLongLong #define _cffi_from_c_ulonglong PyLong_FromUnsignedLongLong #define _cffi_from_c__Bool PyBool_FromLong #define _cffi_to_c_double PyFloat_AsDouble #define _cffi_to_c_float PyFloat_AsDouble #define _cffi_from_c_int(x, type) \ (((type)-1) > 0 ? /* unsigned */ \ (sizeof(type) < sizeof(long) ? \ PyInt_FromLong((long)x) : \ sizeof(type) == sizeof(long) ? \ PyLong_FromUnsignedLong((unsigned long)x) : \ PyLong_FromUnsignedLongLong((unsigned long long)x)) : \ (sizeof(type) <= sizeof(long) ? \ PyInt_FromLong((long)x) : \ PyLong_FromLongLong((long long)x))) #define _cffi_to_c_int(o, type) \ ((type)( \ sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \ : (type)_cffi_to_c_i8(o)) : \ sizeof(type) == 2 ? (((type)-1) > 0 ? (type)_cffi_to_c_u16(o) \ : (type)_cffi_to_c_i16(o)) : \ sizeof(type) == 4 ? (((type)-1) > 0 ? (type)_cffi_to_c_u32(o) \ : (type)_cffi_to_c_i32(o)) : \ sizeof(type) == 8 ? (((type)-1) > 0 ? (type)_cffi_to_c_u64(o) \ : (type)_cffi_to_c_i64(o)) : \ (Py_FatalError("unsupported size for type " #type), (type)0))) #define _cffi_to_c_i8 \ ((int(*)(PyObject *))_cffi_exports[1]) #define _cffi_to_c_u8 \ ((int(*)(PyObject *))_cffi_exports[2]) #define _cffi_to_c_i16 \ ((int(*)(PyObject *))_cffi_exports[3]) #define _cffi_to_c_u16 \ ((int(*)(PyObject *))_cffi_exports[4]) #define _cffi_to_c_i32 \ ((int(*)(PyObject *))_cffi_exports[5]) #define _cffi_to_c_u32 \ ((unsigned int(*)(PyObject *))_cffi_exports[6]) #define _cffi_to_c_i64 \ ((long long(*)(PyObject *))_cffi_exports[7]) #define _cffi_to_c_u64 \ ((unsigned long long(*)(PyObject *))_cffi_exports[8]) #define _cffi_to_c_char \ ((int(*)(PyObject *))_cffi_exports[9]) #define _cffi_from_c_pointer \ ((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[10]) #define _cffi_to_c_pointer \ ((char *(*)(PyObject *, struct _cffi_ctypedescr *))_cffi_exports[11]) #define _cffi_get_struct_layout \ not used any more #define _cffi_restore_errno \ ((void(*)(void))_cffi_exports[13]) #define _cffi_save_errno \ ((void(*)(void))_cffi_exports[14]) #define _cffi_from_c_char \ ((PyObject *(*)(char))_cffi_exports[15]) #define _cffi_from_c_deref \ ((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[16]) #define _cffi_to_c \ ((int(*)(char *, struct _cffi_ctypedescr *, PyObject *))_cffi_exports[17]) #define _cffi_from_c_struct \ ((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[18]) #define _cffi_to_c_wchar_t \ ((_cffi_wchar_t(*)(PyObject *))_cffi_exports[19]) #define _cffi_from_c_wchar_t \ ((PyObject *(*)(_cffi_wchar_t))_cffi_exports[20]) #define _cffi_to_c_long_double \ ((long double(*)(PyObject *))_cffi_exports[21]) #define _cffi_to_c__Bool \ ((_Bool(*)(PyObject *))_cffi_exports[22]) #define _cffi_prepare_pointer_call_argument \ ((Py_ssize_t(*)(struct _cffi_ctypedescr *, \ PyObject *, char **))_cffi_exports[23]) #define _cffi_convert_array_from_object \ ((int(*)(char *, struct _cffi_ctypedescr *, PyObject *))_cffi_exports[24]) #define _CFFI_CPIDX 25 #define _cffi_call_python \ ((void(*)(struct _cffi_externpy_s *, char *))_cffi_exports[_CFFI_CPIDX]) #define _cffi_to_c_wchar3216_t \ ((int(*)(PyObject *))_cffi_exports[26]) #define _cffi_from_c_wchar3216_t \ ((PyObject *(*)(int))_cffi_exports[27]) #define _CFFI_NUM_EXPORTS 28 struct _cffi_ctypedescr; static void *_cffi_exports[_CFFI_NUM_EXPORTS]; #define _cffi_type(index) ( \ assert((((uintptr_t)_cffi_types[index]) & 1) == 0), \ (struct _cffi_ctypedescr *)_cffi_types[index]) static PyObject *_cffi_init(const char *module_name, Py_ssize_t version, const struct _cffi_type_context_s *ctx) { PyObject *module, *o_arg, *new_module; void *raw[] = { (void *)module_name, (void *)version, (void *)_cffi_exports, (void *)ctx, }; module = PyImport_ImportModule("_cffi_backend"); if (module == NULL) goto failure; o_arg = PyLong_FromVoidPtr((void *)raw); if (o_arg == NULL) goto failure; new_module = PyObject_CallMethod( module, (char *)"_init_cffi_1_0_external_module", (char *)"O", o_arg); Py_DECREF(o_arg); Py_DECREF(module); return new_module; failure: Py_XDECREF(module); return NULL; } #ifdef HAVE_WCHAR_H typedef wchar_t _cffi_wchar_t; #else typedef uint16_t _cffi_wchar_t; /* same random pick as _cffi_backend.c */ #endif _CFFI_UNUSED_FN static uint16_t _cffi_to_c_char16_t(PyObject *o) { if (sizeof(_cffi_wchar_t) == 2) return (uint16_t)_cffi_to_c_wchar_t(o); else return (uint16_t)_cffi_to_c_wchar3216_t(o); } _CFFI_UNUSED_FN static PyObject *_cffi_from_c_char16_t(uint16_t x) { if (sizeof(_cffi_wchar_t) == 2) return _cffi_from_c_wchar_t((_cffi_wchar_t)x); else return _cffi_from_c_wchar3216_t((int)x); } _CFFI_UNUSED_FN static int _cffi_to_c_char32_t(PyObject *o) { if (sizeof(_cffi_wchar_t) == 4) return (int)_cffi_to_c_wchar_t(o); else return (int)_cffi_to_c_wchar3216_t(o); } _CFFI_UNUSED_FN static PyObject *_cffi_from_c_char32_t(int x) { if (sizeof(_cffi_wchar_t) == 4) return _cffi_from_c_wchar_t((_cffi_wchar_t)x); else return _cffi_from_c_wchar3216_t(x); } /********** end CPython-specific section **********/ #else _CFFI_UNUSED_FN static void (*_cffi_call_python_org)(struct _cffi_externpy_s *, char *); # define _cffi_call_python _cffi_call_python_org #endif #define _cffi_array_len(array) (sizeof(array) / sizeof((array)[0])) #define _cffi_prim_int(size, sign) \ ((size) == 1 ? ((sign) ? _CFFI_PRIM_INT8 : _CFFI_PRIM_UINT8) : \ (size) == 2 ? ((sign) ? _CFFI_PRIM_INT16 : _CFFI_PRIM_UINT16) : \ (size) == 4 ? ((sign) ? _CFFI_PRIM_INT32 : _CFFI_PRIM_UINT32) : \ (size) == 8 ? ((sign) ? _CFFI_PRIM_INT64 : _CFFI_PRIM_UINT64) : \ _CFFI__UNKNOWN_PRIM) #define _cffi_prim_float(size) \ ((size) == sizeof(float) ? _CFFI_PRIM_FLOAT : \ (size) == sizeof(double) ? _CFFI_PRIM_DOUBLE : \ (size) == sizeof(long double) ? _CFFI__UNKNOWN_LONG_DOUBLE : \ _CFFI__UNKNOWN_FLOAT_PRIM) #define _cffi_check_int(got, got_nonpos, expected) \ ((got_nonpos) == (expected <= 0) && \ (got) == (unsigned long long)expected) #ifdef MS_WIN32 # define _cffi_stdcall __stdcall #else # define _cffi_stdcall /* nothing */ #endif #ifdef __cplusplus } #endif /************************************************************/ char* longest(int argc, char *argv[]) { if (argc) { int len, max = 0, pos = 0; for (int i = 0; i < argc; i++) { len = strlen(argv[i]); if (len > max) { max = len; pos = i; } } return argv[pos]; } else { return '\0'; } } /************************************************************/ static void *_cffi_types[] = { /* 0 */ _CFFI_OP(_CFFI_OP_FUNCTION, 4), // char *()(int, char * *) /* 1 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), // int /* 2 */ _CFFI_OP(_CFFI_OP_POINTER, 4), // char * * /* 3 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), /* 4 */ _CFFI_OP(_CFFI_OP_POINTER, 5), // char * /* 5 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 2), // char }; static char * _cffi_d_longest(int x0, char * * x1) { return longest(x0, x1); } #ifndef PYPY_VERSION static PyObject * _cffi_f_longest(PyObject *self, PyObject *args) { int x0; char * * x1; Py_ssize_t datasize; char * result; PyObject *arg0; PyObject *arg1; if (!PyArg_UnpackTuple(args, "longest", 2, 2, &arg0, &arg1)) return NULL; x0 = _cffi_to_c_int(arg0, int); if (x0 == (int)-1 && PyErr_Occurred()) return NULL; datasize = _cffi_prepare_pointer_call_argument( _cffi_type(2), arg1, (char **)&x1); if (datasize != 0) { if (datasize < 0) return NULL; x1 = (char * *)alloca((size_t)datasize); memset((void *)x1, 0, (size_t)datasize); if (_cffi_convert_array_from_object((char *)x1, _cffi_type(2), arg1) < 0) return NULL; } Py_BEGIN_ALLOW_THREADS _cffi_restore_errno(); { result = longest(x0, x1); } _cffi_save_errno(); Py_END_ALLOW_THREADS (void)self; /* unused */ return _cffi_from_c_pointer((char *)result, _cffi_type(4)); } #else # define _cffi_f_longest _cffi_d_longest #endif static const struct _cffi_global_s _cffi_globals[] = { { "longest", (void *)_cffi_f_longest, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 0), (void *)_cffi_d_longest }, }; static const struct _cffi_type_context_s _cffi_type_context = { _cffi_types, _cffi_globals, NULL, /* no fields */ NULL, /* no struct_unions */ NULL, /* no enums */ NULL, /* no typenames */ 1, /* num_globals */ 0, /* num_struct_unions */ 0, /* num_enums */ 0, /* num_typenames */ NULL, /* no includes */ 6, /* num_types */ 0, /* flags */ }; #ifdef __GNUC__ # pragma GCC visibility push(default) /* for -fvisibility= */ #endif #ifdef PYPY_VERSION PyMODINIT_FUNC _cffi_pypyinit__nameless(const void *p[]) { p[0] = (const void *)0x2601; p[1] = &_cffi_type_context; #if PY_MAJOR_VERSION >= 3 return NULL; #endif } # ifdef _MSC_VER PyMODINIT_FUNC # if PY_MAJOR_VERSION >= 3 PyInit__nameless(void) { return NULL; } # else init_nameless(void) { } # endif # endif #elif PY_MAJOR_VERSION >= 3 PyMODINIT_FUNC PyInit__nameless(void) { return _cffi_init("nameless._nameless", 0x2601, &_cffi_type_context); } #else PyMODINIT_FUNC init_nameless(void) { _cffi_init("nameless._nameless", 0x2601, &_cffi_type_context); } #endif #ifdef __GNUC__ # pragma GCC visibility pop #endif