├── .gitignore ├── Cartfile ├── Cartfile.resolved ├── Frameworks ├── BZip2.framework │ ├── Headers │ ├── Versions │ │ ├── 1.0.6 │ │ │ ├── Headers │ │ │ │ └── bzlib.h │ │ │ └── bzip2 │ │ └── Current │ └── bzip2 ├── OpenSSL.framework │ ├── Headers │ ├── OpenSSL │ └── Versions │ │ ├── 1.0.2h │ │ ├── Headers │ │ │ └── openssl │ │ │ │ ├── aes.h │ │ │ │ ├── asn1.h │ │ │ │ ├── asn1_mac.h │ │ │ │ ├── asn1t.h │ │ │ │ ├── bio.h │ │ │ │ ├── blowfish.h │ │ │ │ ├── bn.h │ │ │ │ ├── buffer.h │ │ │ │ ├── camellia.h │ │ │ │ ├── cast.h │ │ │ │ ├── cmac.h │ │ │ │ ├── cms.h │ │ │ │ ├── comp.h │ │ │ │ ├── conf.h │ │ │ │ ├── conf_api.h │ │ │ │ ├── crypto.h │ │ │ │ ├── des.h │ │ │ │ ├── des_old.h │ │ │ │ ├── dh.h │ │ │ │ ├── dsa.h │ │ │ │ ├── dso.h │ │ │ │ ├── dtls1.h │ │ │ │ ├── e_os2.h │ │ │ │ ├── ebcdic.h │ │ │ │ ├── ec.h │ │ │ │ ├── ecdh.h │ │ │ │ ├── ecdsa.h │ │ │ │ ├── engine.h │ │ │ │ ├── err.h │ │ │ │ ├── evp.h │ │ │ │ ├── hmac.h │ │ │ │ ├── idea.h │ │ │ │ ├── krb5_asn.h │ │ │ │ ├── kssl.h │ │ │ │ ├── lhash.h │ │ │ │ ├── md4.h │ │ │ │ ├── md5.h │ │ │ │ ├── mdc2.h │ │ │ │ ├── modes.h │ │ │ │ ├── obj_mac.h │ │ │ │ ├── objects.h │ │ │ │ ├── ocsp.h │ │ │ │ ├── opensslconf.h │ │ │ │ ├── opensslv.h │ │ │ │ ├── ossl_typ.h │ │ │ │ ├── pem.h │ │ │ │ ├── pem2.h │ │ │ │ ├── pkcs12.h │ │ │ │ ├── pkcs7.h │ │ │ │ ├── pqueue.h │ │ │ │ ├── rand.h │ │ │ │ ├── rc2.h │ │ │ │ ├── rc4.h │ │ │ │ ├── ripemd.h │ │ │ │ ├── rsa.h │ │ │ │ ├── safestack.h │ │ │ │ ├── seed.h │ │ │ │ ├── sha.h │ │ │ │ ├── srp.h │ │ │ │ ├── srtp.h │ │ │ │ ├── ssl.h │ │ │ │ ├── ssl2.h │ │ │ │ ├── ssl23.h │ │ │ │ ├── ssl3.h │ │ │ │ ├── stack.h │ │ │ │ ├── symhacks.h │ │ │ │ ├── tls1.h │ │ │ │ ├── ts.h │ │ │ │ ├── txt_db.h │ │ │ │ ├── ui.h │ │ │ │ ├── ui_compat.h │ │ │ │ ├── whrlpool.h │ │ │ │ ├── x509.h │ │ │ │ ├── x509_vfy.h │ │ │ │ └── x509v3.h │ │ └── OpenSSL │ │ └── Current └── Python.framework │ ├── Headers │ ├── Python │ ├── Resources │ └── Versions │ ├── 2.7 │ ├── Headers │ │ ├── Python-ast.h │ │ ├── Python.h │ │ ├── abstract.h │ │ ├── asdl.h │ │ ├── ast.h │ │ ├── bitset.h │ │ ├── boolobject.h │ │ ├── bufferobject.h │ │ ├── bytearrayobject.h │ │ ├── bytes_methods.h │ │ ├── bytesobject.h │ │ ├── cStringIO.h │ │ ├── cellobject.h │ │ ├── ceval.h │ │ ├── classobject.h │ │ ├── cobject.h │ │ ├── code.h │ │ ├── codecs.h │ │ ├── compile.h │ │ ├── complexobject.h │ │ ├── datetime.h │ │ ├── descrobject.h │ │ ├── dictobject.h │ │ ├── dtoa.h │ │ ├── enumobject.h │ │ ├── errcode.h │ │ ├── eval.h │ │ ├── fileobject.h │ │ ├── floatobject.h │ │ ├── frameobject.h │ │ ├── funcobject.h │ │ ├── genobject.h │ │ ├── graminit.h │ │ ├── grammar.h │ │ ├── import.h │ │ ├── intobject.h │ │ ├── intrcheck.h │ │ ├── iterobject.h │ │ ├── listobject.h │ │ ├── longintrepr.h │ │ ├── longobject.h │ │ ├── marshal.h │ │ ├── memoryobject.h │ │ ├── metagrammar.h │ │ ├── methodobject.h │ │ ├── modsupport.h │ │ ├── moduleobject.h │ │ ├── node.h │ │ ├── object.h │ │ ├── objimpl.h │ │ ├── opcode.h │ │ ├── osdefs.h │ │ ├── parsetok.h │ │ ├── patchlevel.h │ │ ├── pgen.h │ │ ├── pgenheaders.h │ │ ├── py_curses.h │ │ ├── pyarena.h │ │ ├── pycapsule.h │ │ ├── pyconfig-arm64.h │ │ ├── pyconfig-armv7.h │ │ ├── pyconfig-armv7s.h │ │ ├── pyconfig-i386.h │ │ ├── pyconfig-x86_64.h │ │ ├── pyconfig.h │ │ ├── pyctype.h │ │ ├── pydebug.h │ │ ├── pyerrors.h │ │ ├── pyexpat.h │ │ ├── pyfpe.h │ │ ├── pygetopt.h │ │ ├── pymacconfig.h │ │ ├── pymactoolbox.h │ │ ├── pymath.h │ │ ├── pymem.h │ │ ├── pyport.h │ │ ├── pystate.h │ │ ├── pystrcmp.h │ │ ├── pystrtod.h │ │ ├── pythonrun.h │ │ ├── pythread.h │ │ ├── rangeobject.h │ │ ├── setobject.h │ │ ├── sliceobject.h │ │ ├── stringobject.h │ │ ├── structmember.h │ │ ├── structseq.h │ │ ├── symtable.h │ │ ├── sysmodule.h │ │ ├── timefuncs.h │ │ ├── token.h │ │ ├── traceback.h │ │ ├── tupleobject.h │ │ ├── ucnhash.h │ │ ├── unicodeobject.h │ │ ├── warnings.h │ │ └── weakrefobject.h │ ├── Python │ └── Resources │ │ ├── include │ │ └── python2.7 │ │ │ ├── Python.h │ │ │ ├── pyconfig-arm64.h │ │ │ ├── pyconfig-armv7.h │ │ │ ├── pyconfig-armv7s.h │ │ │ ├── pyconfig-i386.h │ │ │ ├── pyconfig-x86_64.h │ │ │ └── pyconfig.h │ │ └── lib │ │ └── python27.zip │ └── Current ├── LICENSE ├── Python ├── pytest.py └── test-extractor.py ├── README.md ├── YoutubeDL.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── pdebie.xcuserdatad │ └── xcschemes │ ├── YoutubeDL.xcscheme │ └── xcschememanagement.plist ├── YoutubeDL ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── DownloadManager.swift ├── Info.plist ├── PlaylistViewController.swift ├── PlaylistsViewController.swift ├── PythonBridge.h ├── PythonBridge.m ├── VideoViewCell.swift ├── YoutubeDL-Bridging-Header.h ├── YoutubeModels │ ├── DataStore.swift │ ├── DownloadProgress.swift │ ├── Playlist.swift │ └── Video.swift └── sample.mp4 ├── YoutubeDLTests ├── Info.plist ├── PlaylistTests.swift └── YoutubeDLTests.swift └── YoutubeDLUITests ├── Info.plist └── YoutubeDLUITests.swift /.gitignore: -------------------------------------------------------------------------------- 1 | YoutubeDL.xcodeproj/xcuserdata 2 | DerivedData 3 | Python/**/*.pyc 4 | Carthage/ 5 | -------------------------------------------------------------------------------- /Cartfile: -------------------------------------------------------------------------------- 1 | github "rs/SDWebImage" 2 | github "rg3/youtube-dl" 3 | -------------------------------------------------------------------------------- /Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "rs/SDWebImage" "3.8.2" 2 | github "rg3/youtube-dl" "2016.10.07" 3 | -------------------------------------------------------------------------------- /Frameworks/BZip2.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Frameworks/BZip2.framework/Versions/1.0.6/bzip2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pieter/YoutubeDL-iOS/1e7e17e0362f32a70744ece44573c306631cd739/Frameworks/BZip2.framework/Versions/1.0.6/bzip2 -------------------------------------------------------------------------------- /Frameworks/BZip2.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | 1.0.6 -------------------------------------------------------------------------------- /Frameworks/BZip2.framework/bzip2: -------------------------------------------------------------------------------- 1 | Versions/Current/bzip2 -------------------------------------------------------------------------------- /Frameworks/OpenSSL.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Frameworks/OpenSSL.framework/OpenSSL: -------------------------------------------------------------------------------- 1 | Versions/Current/OpenSSL -------------------------------------------------------------------------------- /Frameworks/OpenSSL.framework/Versions/1.0.2h/Headers/openssl/cmac.h: -------------------------------------------------------------------------------- 1 | /* crypto/cmac/cmac.h */ 2 | /* 3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 4 | * project. 5 | */ 6 | /* ==================================================================== 7 | * Copyright (c) 2010 The OpenSSL Project. All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in 18 | * the documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * 3. All advertising materials mentioning features or use of this 22 | * software must display the following acknowledgment: 23 | * "This product includes software developed by the OpenSSL Project 24 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 25 | * 26 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 27 | * endorse or promote products derived from this software without 28 | * prior written permission. For written permission, please contact 29 | * licensing@OpenSSL.org. 30 | * 31 | * 5. Products derived from this software may not be called "OpenSSL" 32 | * nor may "OpenSSL" appear in their names without prior written 33 | * permission of the OpenSSL Project. 34 | * 35 | * 6. Redistributions of any form whatsoever must retain the following 36 | * acknowledgment: 37 | * "This product includes software developed by the OpenSSL Project 38 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 39 | * 40 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 41 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 43 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 44 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 46 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 47 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 49 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 50 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51 | * OF THE POSSIBILITY OF SUCH DAMAGE. 52 | * ==================================================================== 53 | */ 54 | 55 | #ifndef HEADER_CMAC_H 56 | # define HEADER_CMAC_H 57 | 58 | #ifdef __cplusplus 59 | extern "C" { 60 | #endif 61 | 62 | # include 63 | 64 | /* Opaque */ 65 | typedef struct CMAC_CTX_st CMAC_CTX; 66 | 67 | CMAC_CTX *CMAC_CTX_new(void); 68 | void CMAC_CTX_cleanup(CMAC_CTX *ctx); 69 | void CMAC_CTX_free(CMAC_CTX *ctx); 70 | EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx); 71 | int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in); 72 | 73 | int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen, 74 | const EVP_CIPHER *cipher, ENGINE *impl); 75 | int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen); 76 | int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen); 77 | int CMAC_resume(CMAC_CTX *ctx); 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | #endif 83 | -------------------------------------------------------------------------------- /Frameworks/OpenSSL.framework/Versions/1.0.2h/Headers/openssl/comp.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef HEADER_COMP_H 3 | # define HEADER_COMP_H 4 | 5 | # include 6 | 7 | # ifdef OPENSSL_NO_COMP 8 | # error COMP is disabled. 9 | # endif 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef struct comp_ctx_st COMP_CTX; 16 | 17 | typedef struct comp_method_st { 18 | int type; /* NID for compression library */ 19 | const char *name; /* A text string to identify the library */ 20 | int (*init) (COMP_CTX *ctx); 21 | void (*finish) (COMP_CTX *ctx); 22 | int (*compress) (COMP_CTX *ctx, 23 | unsigned char *out, unsigned int olen, 24 | unsigned char *in, unsigned int ilen); 25 | int (*expand) (COMP_CTX *ctx, 26 | unsigned char *out, unsigned int olen, 27 | unsigned char *in, unsigned int ilen); 28 | /* 29 | * The following two do NOTHING, but are kept for backward compatibility 30 | */ 31 | long (*ctrl) (void); 32 | long (*callback_ctrl) (void); 33 | } COMP_METHOD; 34 | 35 | struct comp_ctx_st { 36 | COMP_METHOD *meth; 37 | unsigned long compress_in; 38 | unsigned long compress_out; 39 | unsigned long expand_in; 40 | unsigned long expand_out; 41 | CRYPTO_EX_DATA ex_data; 42 | }; 43 | 44 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); 45 | void COMP_CTX_free(COMP_CTX *ctx); 46 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, 47 | unsigned char *in, int ilen); 48 | int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, 49 | unsigned char *in, int ilen); 50 | COMP_METHOD *COMP_rle(void); 51 | COMP_METHOD *COMP_zlib(void); 52 | void COMP_zlib_cleanup(void); 53 | 54 | # ifdef HEADER_BIO_H 55 | # ifdef ZLIB 56 | BIO_METHOD *BIO_f_zlib(void); 57 | # endif 58 | # endif 59 | 60 | /* BEGIN ERROR CODES */ 61 | /* 62 | * The following lines are auto generated by the script mkerr.pl. Any changes 63 | * made after this point may be overwritten when the script is next run. 64 | */ 65 | void ERR_load_COMP_strings(void); 66 | 67 | /* Error codes for the COMP functions. */ 68 | 69 | /* Function codes. */ 70 | # define COMP_F_BIO_ZLIB_FLUSH 99 71 | # define COMP_F_BIO_ZLIB_NEW 100 72 | # define COMP_F_BIO_ZLIB_READ 101 73 | # define COMP_F_BIO_ZLIB_WRITE 102 74 | 75 | /* Reason codes. */ 76 | # define COMP_R_ZLIB_DEFLATE_ERROR 99 77 | # define COMP_R_ZLIB_INFLATE_ERROR 100 78 | # define COMP_R_ZLIB_NOT_SUPPORTED 101 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | #endif 84 | -------------------------------------------------------------------------------- /Frameworks/OpenSSL.framework/Versions/1.0.2h/Headers/openssl/conf_api.h: -------------------------------------------------------------------------------- 1 | /* conf_api.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_CONF_API_H 60 | # define HEADER_CONF_API_H 61 | 62 | # include 63 | # include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | /* Up until OpenSSL 0.9.5a, this was new_section */ 70 | CONF_VALUE *_CONF_new_section(CONF *conf, const char *section); 71 | /* Up until OpenSSL 0.9.5a, this was get_section */ 72 | CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section); 73 | /* Up until OpenSSL 0.9.5a, this was CONF_get_section */ 74 | STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, 75 | const char *section); 76 | 77 | int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value); 78 | char *_CONF_get_string(const CONF *conf, const char *section, 79 | const char *name); 80 | long _CONF_get_number(const CONF *conf, const char *section, 81 | const char *name); 82 | 83 | int _CONF_new_data(CONF *conf); 84 | void _CONF_free_data(CONF *conf); 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | #endif 90 | -------------------------------------------------------------------------------- /Frameworks/OpenSSL.framework/Versions/1.0.2h/Headers/openssl/ebcdic.h: -------------------------------------------------------------------------------- 1 | /* crypto/ebcdic.h */ 2 | 3 | #ifndef HEADER_EBCDIC_H 4 | # define HEADER_EBCDIC_H 5 | 6 | # include 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | /* Avoid name clashes with other applications */ 13 | # define os_toascii _openssl_os_toascii 14 | # define os_toebcdic _openssl_os_toebcdic 15 | # define ebcdic2ascii _openssl_ebcdic2ascii 16 | # define ascii2ebcdic _openssl_ascii2ebcdic 17 | 18 | extern const unsigned char os_toascii[256]; 19 | extern const unsigned char os_toebcdic[256]; 20 | void *ebcdic2ascii(void *dest, const void *srce, size_t count); 21 | void *ascii2ebcdic(void *dest, const void *srce, size_t count); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | #endif 27 | -------------------------------------------------------------------------------- /Frameworks/OpenSSL.framework/Versions/1.0.2h/Headers/openssl/mdc2.h: -------------------------------------------------------------------------------- 1 | /* crypto/mdc2/mdc2.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_MDC2_H 60 | # define HEADER_MDC2_H 61 | 62 | # include 63 | 64 | #ifdef __cplusplus 65 | extern "C" { 66 | #endif 67 | 68 | # ifdef OPENSSL_NO_MDC2 69 | # error MDC2 is disabled. 70 | # endif 71 | 72 | # define MDC2_BLOCK 8 73 | # define MDC2_DIGEST_LENGTH 16 74 | 75 | typedef struct mdc2_ctx_st { 76 | unsigned int num; 77 | unsigned char data[MDC2_BLOCK]; 78 | DES_cblock h, hh; 79 | int pad_type; /* either 1 or 2, default 1 */ 80 | } MDC2_CTX; 81 | 82 | # ifdef OPENSSL_FIPS 83 | int private_MDC2_Init(MDC2_CTX *c); 84 | # endif 85 | int MDC2_Init(MDC2_CTX *c); 86 | int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len); 87 | int MDC2_Final(unsigned char *md, MDC2_CTX *c); 88 | unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md); 89 | 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /Frameworks/OpenSSL.framework/Versions/1.0.2h/Headers/openssl/opensslv.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_OPENSSLV_H 2 | # define HEADER_OPENSSLV_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /*- 9 | * Numeric release version identifier: 10 | * MNNFFPPS: major minor fix patch status 11 | * The status nibble has one of the values 0 for development, 1 to e for betas 12 | * 1 to 14, and f for release. The patch level is exactly that. 13 | * For example: 14 | * 0.9.3-dev 0x00903000 15 | * 0.9.3-beta1 0x00903001 16 | * 0.9.3-beta2-dev 0x00903002 17 | * 0.9.3-beta2 0x00903002 (same as ...beta2-dev) 18 | * 0.9.3 0x0090300f 19 | * 0.9.3a 0x0090301f 20 | * 0.9.4 0x0090400f 21 | * 1.2.3z 0x102031af 22 | * 23 | * For continuity reasons (because 0.9.5 is already out, and is coded 24 | * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level 25 | * part is slightly different, by setting the highest bit. This means 26 | * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start 27 | * with 0x0090600S... 28 | * 29 | * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.) 30 | * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for 31 | * major minor fix final patch/beta) 32 | */ 33 | # define OPENSSL_VERSION_NUMBER 0x1000208fL 34 | # ifdef OPENSSL_FIPS 35 | # define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2h-fips 3 May 2016" 36 | # else 37 | # define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2h 3 May 2016" 38 | # endif 39 | # define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT 40 | 41 | /*- 42 | * The macros below are to be used for shared library (.so, .dll, ...) 43 | * versioning. That kind of versioning works a bit differently between 44 | * operating systems. The most usual scheme is to set a major and a minor 45 | * number, and have the runtime loader check that the major number is equal 46 | * to what it was at application link time, while the minor number has to 47 | * be greater or equal to what it was at application link time. With this 48 | * scheme, the version number is usually part of the file name, like this: 49 | * 50 | * libcrypto.so.0.9 51 | * 52 | * Some unixen also make a softlink with the major verson number only: 53 | * 54 | * libcrypto.so.0 55 | * 56 | * On Tru64 and IRIX 6.x it works a little bit differently. There, the 57 | * shared library version is stored in the file, and is actually a series 58 | * of versions, separated by colons. The rightmost version present in the 59 | * library when linking an application is stored in the application to be 60 | * matched at run time. When the application is run, a check is done to 61 | * see if the library version stored in the application matches any of the 62 | * versions in the version string of the library itself. 63 | * This version string can be constructed in any way, depending on what 64 | * kind of matching is desired. However, to implement the same scheme as 65 | * the one used in the other unixen, all compatible versions, from lowest 66 | * to highest, should be part of the string. Consecutive builds would 67 | * give the following versions strings: 68 | * 69 | * 3.0 70 | * 3.0:3.1 71 | * 3.0:3.1:3.2 72 | * 4.0 73 | * 4.0:4.1 74 | * 75 | * Notice how version 4 is completely incompatible with version, and 76 | * therefore give the breach you can see. 77 | * 78 | * There may be other schemes as well that I haven't yet discovered. 79 | * 80 | * So, here's the way it works here: first of all, the library version 81 | * number doesn't need at all to match the overall OpenSSL version. 82 | * However, it's nice and more understandable if it actually does. 83 | * The current library version is stored in the macro SHLIB_VERSION_NUMBER, 84 | * which is just a piece of text in the format "M.m.e" (Major, minor, edit). 85 | * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways, 86 | * we need to keep a history of version numbers, which is done in the 87 | * macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and 88 | * should only keep the versions that are binary compatible with the current. 89 | */ 90 | # define SHLIB_VERSION_HISTORY "" 91 | # define SHLIB_VERSION_NUMBER "1.0.0" 92 | 93 | 94 | #ifdef __cplusplus 95 | } 96 | #endif 97 | #endif /* HEADER_OPENSSLV_H */ 98 | -------------------------------------------------------------------------------- /Frameworks/OpenSSL.framework/Versions/1.0.2h/Headers/openssl/pem2.h: -------------------------------------------------------------------------------- 1 | /* ==================================================================== 2 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * 3. All advertising materials mentioning features or use of this 17 | * software must display the following acknowledgment: 18 | * "This product includes software developed by the OpenSSL Project 19 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 20 | * 21 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 22 | * endorse or promote products derived from this software without 23 | * prior written permission. For written permission, please contact 24 | * licensing@OpenSSL.org. 25 | * 26 | * 5. Products derived from this software may not be called "OpenSSL" 27 | * nor may "OpenSSL" appear in their names without prior written 28 | * permission of the OpenSSL Project. 29 | * 30 | * 6. Redistributions of any form whatsoever must retain the following 31 | * acknowledgment: 32 | * "This product includes software developed by the OpenSSL Project 33 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 34 | * 35 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 36 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 37 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 38 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 39 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 40 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 41 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 42 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 43 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 44 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 45 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 46 | * OF THE POSSIBILITY OF SUCH DAMAGE. 47 | * ==================================================================== 48 | * 49 | * This product includes cryptographic software written by Eric Young 50 | * (eay@cryptsoft.com). This product includes software written by Tim 51 | * Hudson (tjh@cryptsoft.com). 52 | * 53 | */ 54 | 55 | /* 56 | * This header only exists to break a circular dependency between pem and err 57 | * Ben 30 Jan 1999. 58 | */ 59 | 60 | #ifdef __cplusplus 61 | extern "C" { 62 | #endif 63 | 64 | #ifndef HEADER_PEM_H 65 | void ERR_load_PEM_strings(void); 66 | #endif 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | -------------------------------------------------------------------------------- /Frameworks/OpenSSL.framework/Versions/1.0.2h/Headers/openssl/pqueue.h: -------------------------------------------------------------------------------- 1 | /* crypto/pqueue/pqueue.h */ 2 | /* 3 | * DTLS implementation written by Nagendra Modadugu 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 5 | */ 6 | /* ==================================================================== 7 | * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in 18 | * the documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * 3. All advertising materials mentioning features or use of this 22 | * software must display the following acknowledgment: 23 | * "This product includes software developed by the OpenSSL Project 24 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 25 | * 26 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 27 | * endorse or promote products derived from this software without 28 | * prior written permission. For written permission, please contact 29 | * openssl-core@OpenSSL.org. 30 | * 31 | * 5. Products derived from this software may not be called "OpenSSL" 32 | * nor may "OpenSSL" appear in their names without prior written 33 | * permission of the OpenSSL Project. 34 | * 35 | * 6. Redistributions of any form whatsoever must retain the following 36 | * acknowledgment: 37 | * "This product includes software developed by the OpenSSL Project 38 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 39 | * 40 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 41 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 43 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 44 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 46 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 47 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 49 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 50 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51 | * OF THE POSSIBILITY OF SUCH DAMAGE. 52 | * ==================================================================== 53 | * 54 | * This product includes cryptographic software written by Eric Young 55 | * (eay@cryptsoft.com). This product includes software written by Tim 56 | * Hudson (tjh@cryptsoft.com). 57 | * 58 | */ 59 | 60 | #ifndef HEADER_PQUEUE_H 61 | # define HEADER_PQUEUE_H 62 | 63 | # include 64 | # include 65 | # include 66 | 67 | #ifdef __cplusplus 68 | extern "C" { 69 | #endif 70 | typedef struct _pqueue *pqueue; 71 | 72 | typedef struct _pitem { 73 | unsigned char priority[8]; /* 64-bit value in big-endian encoding */ 74 | void *data; 75 | struct _pitem *next; 76 | } pitem; 77 | 78 | typedef struct _pitem *piterator; 79 | 80 | pitem *pitem_new(unsigned char *prio64be, void *data); 81 | void pitem_free(pitem *item); 82 | 83 | pqueue pqueue_new(void); 84 | void pqueue_free(pqueue pq); 85 | 86 | pitem *pqueue_insert(pqueue pq, pitem *item); 87 | pitem *pqueue_peek(pqueue pq); 88 | pitem *pqueue_pop(pqueue pq); 89 | pitem *pqueue_find(pqueue pq, unsigned char *prio64be); 90 | pitem *pqueue_iterator(pqueue pq); 91 | pitem *pqueue_next(piterator *iter); 92 | 93 | void pqueue_print(pqueue pq); 94 | int pqueue_size(pqueue pq); 95 | 96 | #ifdef __cplusplus 97 | } 98 | #endif 99 | #endif /* ! HEADER_PQUEUE_H */ 100 | -------------------------------------------------------------------------------- /Frameworks/OpenSSL.framework/Versions/1.0.2h/Headers/openssl/rc4.h: -------------------------------------------------------------------------------- 1 | /* crypto/rc4/rc4.h */ 2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_RC4_H 60 | # define HEADER_RC4_H 61 | 62 | # include /* OPENSSL_NO_RC4, RC4_INT */ 63 | # ifdef OPENSSL_NO_RC4 64 | # error RC4 is disabled. 65 | # endif 66 | 67 | # include 68 | 69 | #ifdef __cplusplus 70 | extern "C" { 71 | #endif 72 | 73 | typedef struct rc4_key_st { 74 | RC4_INT x, y; 75 | RC4_INT data[256]; 76 | } RC4_KEY; 77 | 78 | const char *RC4_options(void); 79 | void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); 80 | void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); 81 | void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, 82 | unsigned char *outdata); 83 | 84 | #ifdef __cplusplus 85 | } 86 | #endif 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /Frameworks/OpenSSL.framework/Versions/1.0.2h/Headers/openssl/ripemd.h: -------------------------------------------------------------------------------- 1 | /* crypto/ripemd/ripemd.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_RIPEMD_H 60 | # define HEADER_RIPEMD_H 61 | 62 | # include 63 | # include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | # ifdef OPENSSL_NO_RIPEMD 70 | # error RIPEMD is disabled. 71 | # endif 72 | 73 | # if defined(__LP32__) 74 | # define RIPEMD160_LONG unsigned long 75 | # elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) 76 | # define RIPEMD160_LONG unsigned long 77 | # define RIPEMD160_LONG_LOG2 3 78 | # else 79 | # define RIPEMD160_LONG unsigned int 80 | # endif 81 | 82 | # define RIPEMD160_CBLOCK 64 83 | # define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4) 84 | # define RIPEMD160_DIGEST_LENGTH 20 85 | 86 | typedef struct RIPEMD160state_st { 87 | RIPEMD160_LONG A, B, C, D, E; 88 | RIPEMD160_LONG Nl, Nh; 89 | RIPEMD160_LONG data[RIPEMD160_LBLOCK]; 90 | unsigned int num; 91 | } RIPEMD160_CTX; 92 | 93 | # ifdef OPENSSL_FIPS 94 | int private_RIPEMD160_Init(RIPEMD160_CTX *c); 95 | # endif 96 | int RIPEMD160_Init(RIPEMD160_CTX *c); 97 | int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); 98 | int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); 99 | unsigned char *RIPEMD160(const unsigned char *d, size_t n, unsigned char *md); 100 | void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b); 101 | #ifdef __cplusplus 102 | } 103 | #endif 104 | 105 | #endif 106 | -------------------------------------------------------------------------------- /Frameworks/OpenSSL.framework/Versions/1.0.2h/Headers/openssl/ssl23.h: -------------------------------------------------------------------------------- 1 | /* ssl/ssl23.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_SSL23_H 60 | # define HEADER_SSL23_H 61 | 62 | #ifdef __cplusplus 63 | extern "C" { 64 | #endif 65 | 66 | /* 67 | * client 68 | */ 69 | /* write to server */ 70 | # define SSL23_ST_CW_CLNT_HELLO_A (0x210|SSL_ST_CONNECT) 71 | # define SSL23_ST_CW_CLNT_HELLO_B (0x211|SSL_ST_CONNECT) 72 | /* read from server */ 73 | # define SSL23_ST_CR_SRVR_HELLO_A (0x220|SSL_ST_CONNECT) 74 | # define SSL23_ST_CR_SRVR_HELLO_B (0x221|SSL_ST_CONNECT) 75 | 76 | /* server */ 77 | /* read from client */ 78 | # define SSL23_ST_SR_CLNT_HELLO_A (0x210|SSL_ST_ACCEPT) 79 | # define SSL23_ST_SR_CLNT_HELLO_B (0x211|SSL_ST_ACCEPT) 80 | 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | #endif 85 | -------------------------------------------------------------------------------- /Frameworks/OpenSSL.framework/Versions/1.0.2h/Headers/openssl/ui_compat.h: -------------------------------------------------------------------------------- 1 | /* crypto/ui/ui.h */ 2 | /* 3 | * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project 4 | * 2001. 5 | */ 6 | /* ==================================================================== 7 | * Copyright (c) 2001 The OpenSSL Project. All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in 18 | * the documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * 3. All advertising materials mentioning features or use of this 22 | * software must display the following acknowledgment: 23 | * "This product includes software developed by the OpenSSL Project 24 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 25 | * 26 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 27 | * endorse or promote products derived from this software without 28 | * prior written permission. For written permission, please contact 29 | * openssl-core@openssl.org. 30 | * 31 | * 5. Products derived from this software may not be called "OpenSSL" 32 | * nor may "OpenSSL" appear in their names without prior written 33 | * permission of the OpenSSL Project. 34 | * 35 | * 6. Redistributions of any form whatsoever must retain the following 36 | * acknowledgment: 37 | * "This product includes software developed by the OpenSSL Project 38 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 39 | * 40 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 41 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 43 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 44 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 46 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 47 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 49 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 50 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51 | * OF THE POSSIBILITY OF SUCH DAMAGE. 52 | * ==================================================================== 53 | * 54 | * This product includes cryptographic software written by Eric Young 55 | * (eay@cryptsoft.com). This product includes software written by Tim 56 | * Hudson (tjh@cryptsoft.com). 57 | * 58 | */ 59 | 60 | #ifndef HEADER_UI_COMPAT_H 61 | # define HEADER_UI_COMPAT_H 62 | 63 | # include 64 | # include 65 | 66 | #ifdef __cplusplus 67 | extern "C" { 68 | #endif 69 | 70 | /* 71 | * The following functions were previously part of the DES section, and are 72 | * provided here for backward compatibility reasons. 73 | */ 74 | 75 | # define des_read_pw_string(b,l,p,v) \ 76 | _ossl_old_des_read_pw_string((b),(l),(p),(v)) 77 | # define des_read_pw(b,bf,s,p,v) \ 78 | _ossl_old_des_read_pw((b),(bf),(s),(p),(v)) 79 | 80 | int _ossl_old_des_read_pw_string(char *buf, int length, const char *prompt, 81 | int verify); 82 | int _ossl_old_des_read_pw(char *buf, char *buff, int size, const char *prompt, 83 | int verify); 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | #endif 89 | -------------------------------------------------------------------------------- /Frameworks/OpenSSL.framework/Versions/1.0.2h/Headers/openssl/whrlpool.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_WHRLPOOL_H 2 | # define HEADER_WHRLPOOL_H 3 | 4 | # include 5 | # include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | # define WHIRLPOOL_DIGEST_LENGTH (512/8) 12 | # define WHIRLPOOL_BBLOCK 512 13 | # define WHIRLPOOL_COUNTER (256/8) 14 | 15 | typedef struct { 16 | union { 17 | unsigned char c[WHIRLPOOL_DIGEST_LENGTH]; 18 | /* double q is here to ensure 64-bit alignment */ 19 | double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)]; 20 | } H; 21 | unsigned char data[WHIRLPOOL_BBLOCK / 8]; 22 | unsigned int bitoff; 23 | size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)]; 24 | } WHIRLPOOL_CTX; 25 | 26 | # ifndef OPENSSL_NO_WHIRLPOOL 27 | # ifdef OPENSSL_FIPS 28 | int private_WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 29 | # endif 30 | int WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 31 | int WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *inp, size_t bytes); 32 | void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *inp, size_t bits); 33 | int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c); 34 | unsigned char *WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md); 35 | # endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Frameworks/OpenSSL.framework/Versions/1.0.2h/OpenSSL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pieter/YoutubeDL-iOS/1e7e17e0362f32a70744ece44573c306631cd739/Frameworks/OpenSSL.framework/Versions/1.0.2h/OpenSSL -------------------------------------------------------------------------------- /Frameworks/OpenSSL.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | 1.0.2h -------------------------------------------------------------------------------- /Frameworks/Python.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Frameworks/Python.framework/Python: -------------------------------------------------------------------------------- 1 | Versions/Current/Python -------------------------------------------------------------------------------- /Frameworks/Python.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/asdl.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_ASDL_H 2 | #define Py_ASDL_H 3 | 4 | typedef PyObject * identifier; 5 | typedef PyObject * string; 6 | typedef PyObject * object; 7 | 8 | #ifndef __cplusplus 9 | typedef enum {false, true} bool; 10 | #endif 11 | 12 | /* It would be nice if the code generated by asdl_c.py was completely 13 | independent of Python, but it is a goal the requires too much work 14 | at this stage. So, for example, I'll represent identifiers as 15 | interned Python strings. 16 | */ 17 | 18 | /* XXX A sequence should be typed so that its use can be typechecked. */ 19 | 20 | typedef struct { 21 | int size; 22 | void *elements[1]; 23 | } asdl_seq; 24 | 25 | typedef struct { 26 | int size; 27 | int elements[1]; 28 | } asdl_int_seq; 29 | 30 | asdl_seq *asdl_seq_new(int size, PyArena *arena); 31 | asdl_int_seq *asdl_int_seq_new(int size, PyArena *arena); 32 | 33 | #define asdl_seq_GET(S, I) (S)->elements[(I)] 34 | #define asdl_seq_LEN(S) ((S) == NULL ? 0 : (S)->size) 35 | #ifdef Py_DEBUG 36 | #define asdl_seq_SET(S, I, V) { \ 37 | int _asdl_i = (I); \ 38 | assert((S) && _asdl_i < (S)->size); \ 39 | (S)->elements[_asdl_i] = (V); \ 40 | } 41 | #else 42 | #define asdl_seq_SET(S, I, V) (S)->elements[I] = (V) 43 | #endif 44 | 45 | #endif /* !Py_ASDL_H */ 46 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/ast.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_AST_H 2 | #define Py_AST_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | PyAPI_FUNC(mod_ty) PyAST_FromNode(const node *, PyCompilerFlags *flags, 8 | const char *, PyArena *); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | #endif /* !Py_AST_H */ 14 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/bitset.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_BITSET_H 3 | #define Py_BITSET_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* Bitset interface */ 9 | 10 | #define BYTE char 11 | 12 | typedef BYTE *bitset; 13 | 14 | bitset newbitset(int nbits); 15 | void delbitset(bitset bs); 16 | #define testbit(ss, ibit) (((ss)[BIT2BYTE(ibit)] & BIT2MASK(ibit)) != 0) 17 | int addbit(bitset bs, int ibit); /* Returns 0 if already set */ 18 | int samebitset(bitset bs1, bitset bs2, int nbits); 19 | void mergebitset(bitset bs1, bitset bs2, int nbits); 20 | 21 | #define BITSPERBYTE (8*sizeof(BYTE)) 22 | #define NBYTES(nbits) (((nbits) + BITSPERBYTE - 1) / BITSPERBYTE) 23 | 24 | #define BIT2BYTE(ibit) ((ibit) / BITSPERBYTE) 25 | #define BIT2SHIFT(ibit) ((ibit) % BITSPERBYTE) 26 | #define BIT2MASK(ibit) (1 << BIT2SHIFT(ibit)) 27 | #define BYTE2BIT(ibyte) ((ibyte) * BITSPERBYTE) 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | #endif /* !Py_BITSET_H */ 33 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/boolobject.h: -------------------------------------------------------------------------------- 1 | /* Boolean object interface */ 2 | 3 | #ifndef Py_BOOLOBJECT_H 4 | #define Py_BOOLOBJECT_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | 10 | typedef PyIntObject PyBoolObject; 11 | 12 | PyAPI_DATA(PyTypeObject) PyBool_Type; 13 | 14 | #define PyBool_Check(x) (Py_TYPE(x) == &PyBool_Type) 15 | 16 | /* Py_False and Py_True are the only two bools in existence. 17 | Don't forget to apply Py_INCREF() when returning either!!! */ 18 | 19 | /* Don't use these directly */ 20 | PyAPI_DATA(PyIntObject) _Py_ZeroStruct, _Py_TrueStruct; 21 | 22 | /* Use these macros */ 23 | #define Py_False ((PyObject *) &_Py_ZeroStruct) 24 | #define Py_True ((PyObject *) &_Py_TrueStruct) 25 | 26 | /* Macros for returning Py_True or Py_False, respectively */ 27 | #define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True 28 | #define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False 29 | 30 | /* Function to return a bool from a C long */ 31 | PyAPI_FUNC(PyObject *) PyBool_FromLong(long); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | #endif /* !Py_BOOLOBJECT_H */ 37 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/bufferobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Buffer object interface */ 3 | 4 | /* Note: the object's structure is private */ 5 | 6 | #ifndef Py_BUFFEROBJECT_H 7 | #define Py_BUFFEROBJECT_H 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | 13 | PyAPI_DATA(PyTypeObject) PyBuffer_Type; 14 | 15 | #define PyBuffer_Check(op) (Py_TYPE(op) == &PyBuffer_Type) 16 | 17 | #define Py_END_OF_BUFFER (-1) 18 | 19 | PyAPI_FUNC(PyObject *) PyBuffer_FromObject(PyObject *base, 20 | Py_ssize_t offset, Py_ssize_t size); 21 | PyAPI_FUNC(PyObject *) PyBuffer_FromReadWriteObject(PyObject *base, 22 | Py_ssize_t offset, 23 | Py_ssize_t size); 24 | 25 | PyAPI_FUNC(PyObject *) PyBuffer_FromMemory(void *ptr, Py_ssize_t size); 26 | PyAPI_FUNC(PyObject *) PyBuffer_FromReadWriteMemory(void *ptr, Py_ssize_t size); 27 | 28 | PyAPI_FUNC(PyObject *) PyBuffer_New(Py_ssize_t size); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | #endif /* !Py_BUFFEROBJECT_H */ 34 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/bytearrayobject.h: -------------------------------------------------------------------------------- 1 | /* ByteArray object interface */ 2 | 3 | #ifndef Py_BYTEARRAYOBJECT_H 4 | #define Py_BYTEARRAYOBJECT_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #include 10 | 11 | /* Type PyByteArrayObject represents a mutable array of bytes. 12 | * The Python API is that of a sequence; 13 | * the bytes are mapped to ints in [0, 256). 14 | * Bytes are not characters; they may be used to encode characters. 15 | * The only way to go between bytes and str/unicode is via encoding 16 | * and decoding. 17 | * For the convenience of C programmers, the bytes type is considered 18 | * to contain a char pointer, not an unsigned char pointer. 19 | */ 20 | 21 | /* Object layout */ 22 | typedef struct { 23 | PyObject_VAR_HEAD 24 | /* XXX(nnorwitz): should ob_exports be Py_ssize_t? */ 25 | int ob_exports; /* how many buffer exports */ 26 | Py_ssize_t ob_alloc; /* How many bytes allocated */ 27 | char *ob_bytes; 28 | } PyByteArrayObject; 29 | 30 | /* Type object */ 31 | PyAPI_DATA(PyTypeObject) PyByteArray_Type; 32 | PyAPI_DATA(PyTypeObject) PyByteArrayIter_Type; 33 | 34 | /* Type check macros */ 35 | #define PyByteArray_Check(self) PyObject_TypeCheck(self, &PyByteArray_Type) 36 | #define PyByteArray_CheckExact(self) (Py_TYPE(self) == &PyByteArray_Type) 37 | 38 | /* Direct API functions */ 39 | PyAPI_FUNC(PyObject *) PyByteArray_FromObject(PyObject *); 40 | PyAPI_FUNC(PyObject *) PyByteArray_Concat(PyObject *, PyObject *); 41 | PyAPI_FUNC(PyObject *) PyByteArray_FromStringAndSize(const char *, Py_ssize_t); 42 | PyAPI_FUNC(Py_ssize_t) PyByteArray_Size(PyObject *); 43 | PyAPI_FUNC(char *) PyByteArray_AsString(PyObject *); 44 | PyAPI_FUNC(int) PyByteArray_Resize(PyObject *, Py_ssize_t); 45 | 46 | /* Macros, trading safety for speed */ 47 | #define PyByteArray_AS_STRING(self) \ 48 | (assert(PyByteArray_Check(self)), \ 49 | Py_SIZE(self) ? ((PyByteArrayObject *)(self))->ob_bytes : _PyByteArray_empty_string) 50 | #define PyByteArray_GET_SIZE(self) (assert(PyByteArray_Check(self)),Py_SIZE(self)) 51 | 52 | PyAPI_DATA(char) _PyByteArray_empty_string[]; 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | #endif /* !Py_BYTEARRAYOBJECT_H */ 58 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/bytes_methods.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_BYTES_CTYPE_H 2 | #define Py_BYTES_CTYPE_H 3 | 4 | /* 5 | * The internal implementation behind PyString (bytes) and PyBytes (buffer) 6 | * methods of the given names, they operate on ASCII byte strings. 7 | */ 8 | extern PyObject* _Py_bytes_isspace(const char *cptr, Py_ssize_t len); 9 | extern PyObject* _Py_bytes_isalpha(const char *cptr, Py_ssize_t len); 10 | extern PyObject* _Py_bytes_isalnum(const char *cptr, Py_ssize_t len); 11 | extern PyObject* _Py_bytes_isdigit(const char *cptr, Py_ssize_t len); 12 | extern PyObject* _Py_bytes_islower(const char *cptr, Py_ssize_t len); 13 | extern PyObject* _Py_bytes_isupper(const char *cptr, Py_ssize_t len); 14 | extern PyObject* _Py_bytes_istitle(const char *cptr, Py_ssize_t len); 15 | 16 | /* These store their len sized answer in the given preallocated *result arg. */ 17 | extern void _Py_bytes_lower(char *result, const char *cptr, Py_ssize_t len); 18 | extern void _Py_bytes_upper(char *result, const char *cptr, Py_ssize_t len); 19 | extern void _Py_bytes_title(char *result, char *s, Py_ssize_t len); 20 | extern void _Py_bytes_capitalize(char *result, char *s, Py_ssize_t len); 21 | extern void _Py_bytes_swapcase(char *result, char *s, Py_ssize_t len); 22 | 23 | /* Shared __doc__ strings. */ 24 | extern const char _Py_isspace__doc__[]; 25 | extern const char _Py_isalpha__doc__[]; 26 | extern const char _Py_isalnum__doc__[]; 27 | extern const char _Py_isdigit__doc__[]; 28 | extern const char _Py_islower__doc__[]; 29 | extern const char _Py_isupper__doc__[]; 30 | extern const char _Py_istitle__doc__[]; 31 | extern const char _Py_lower__doc__[]; 32 | extern const char _Py_upper__doc__[]; 33 | extern const char _Py_title__doc__[]; 34 | extern const char _Py_capitalize__doc__[]; 35 | extern const char _Py_swapcase__doc__[]; 36 | 37 | /* These are left in for backward compatibility and will be removed 38 | in 2.8/3.2 */ 39 | #define ISLOWER(c) Py_ISLOWER(c) 40 | #define ISUPPER(c) Py_ISUPPER(c) 41 | #define ISALPHA(c) Py_ISALPHA(c) 42 | #define ISDIGIT(c) Py_ISDIGIT(c) 43 | #define ISXDIGIT(c) Py_ISXDIGIT(c) 44 | #define ISALNUM(c) Py_ISALNUM(c) 45 | #define ISSPACE(c) Py_ISSPACE(c) 46 | 47 | #undef islower 48 | #define islower(c) undefined_islower(c) 49 | #undef isupper 50 | #define isupper(c) undefined_isupper(c) 51 | #undef isalpha 52 | #define isalpha(c) undefined_isalpha(c) 53 | #undef isdigit 54 | #define isdigit(c) undefined_isdigit(c) 55 | #undef isxdigit 56 | #define isxdigit(c) undefined_isxdigit(c) 57 | #undef isalnum 58 | #define isalnum(c) undefined_isalnum(c) 59 | #undef isspace 60 | #define isspace(c) undefined_isspace(c) 61 | 62 | /* These are left in for backward compatibility and will be removed 63 | in 2.8/3.2 */ 64 | #define TOLOWER(c) Py_TOLOWER(c) 65 | #define TOUPPER(c) Py_TOUPPER(c) 66 | 67 | #undef tolower 68 | #define tolower(c) undefined_tolower(c) 69 | #undef toupper 70 | #define toupper(c) undefined_toupper(c) 71 | 72 | /* this is needed because some docs are shared from the .o, not static */ 73 | #define PyDoc_STRVAR_shared(name,str) const char name[] = PyDoc_STR(str) 74 | 75 | #endif /* !Py_BYTES_CTYPE_H */ 76 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/bytesobject.h: -------------------------------------------------------------------------------- 1 | #define PyBytesObject PyStringObject 2 | #define PyBytes_Type PyString_Type 3 | 4 | #define PyBytes_Check PyString_Check 5 | #define PyBytes_CheckExact PyString_CheckExact 6 | #define PyBytes_CHECK_INTERNED PyString_CHECK_INTERNED 7 | #define PyBytes_AS_STRING PyString_AS_STRING 8 | #define PyBytes_GET_SIZE PyString_GET_SIZE 9 | #define Py_TPFLAGS_BYTES_SUBCLASS Py_TPFLAGS_STRING_SUBCLASS 10 | 11 | #define PyBytes_FromStringAndSize PyString_FromStringAndSize 12 | #define PyBytes_FromString PyString_FromString 13 | #define PyBytes_FromFormatV PyString_FromFormatV 14 | #define PyBytes_FromFormat PyString_FromFormat 15 | #define PyBytes_Size PyString_Size 16 | #define PyBytes_AsString PyString_AsString 17 | #define PyBytes_Repr PyString_Repr 18 | #define PyBytes_Concat PyString_Concat 19 | #define PyBytes_ConcatAndDel PyString_ConcatAndDel 20 | #define _PyBytes_Resize _PyString_Resize 21 | #define _PyBytes_Eq _PyString_Eq 22 | #define PyBytes_Format PyString_Format 23 | #define _PyBytes_FormatLong _PyString_FormatLong 24 | #define PyBytes_DecodeEscape PyString_DecodeEscape 25 | #define _PyBytes_Join _PyString_Join 26 | #define PyBytes_AsStringAndSize PyString_AsStringAndSize 27 | #define _PyBytes_InsertThousandsGrouping _PyString_InsertThousandsGrouping 28 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/cStringIO.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_CSTRINGIO_H 2 | #define Py_CSTRINGIO_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | /* 7 | 8 | This header provides access to cStringIO objects from C. 9 | Functions are provided for calling cStringIO objects and 10 | macros are provided for testing whether you have cStringIO 11 | objects. 12 | 13 | Before calling any of the functions or macros, you must initialize 14 | the routines with: 15 | 16 | PycString_IMPORT 17 | 18 | This would typically be done in your init function. 19 | 20 | */ 21 | 22 | #define PycStringIO_CAPSULE_NAME "cStringIO.cStringIO_CAPI" 23 | 24 | #define PycString_IMPORT \ 25 | PycStringIO = ((struct PycStringIO_CAPI*)PyCapsule_Import(\ 26 | PycStringIO_CAPSULE_NAME, 0)) 27 | 28 | /* Basic functions to manipulate cStringIO objects from C */ 29 | 30 | static struct PycStringIO_CAPI { 31 | 32 | /* Read a string from an input object. If the last argument 33 | is -1, the remainder will be read. 34 | */ 35 | int(*cread)(PyObject *, char **, Py_ssize_t); 36 | 37 | /* Read a line from an input object. Returns the length of the read 38 | line as an int and a pointer inside the object buffer as char** (so 39 | the caller doesn't have to provide its own buffer as destination). 40 | */ 41 | int(*creadline)(PyObject *, char **); 42 | 43 | /* Write a string to an output object*/ 44 | int(*cwrite)(PyObject *, const char *, Py_ssize_t); 45 | 46 | /* Get the output object as a Python string (returns new reference). */ 47 | PyObject *(*cgetvalue)(PyObject *); 48 | 49 | /* Create a new output object */ 50 | PyObject *(*NewOutput)(int); 51 | 52 | /* Create an input object from a Python string 53 | (copies the Python string reference). 54 | */ 55 | PyObject *(*NewInput)(PyObject *); 56 | 57 | /* The Python types for cStringIO input and output objects. 58 | Note that you can do input on an output object. 59 | */ 60 | PyTypeObject *InputType, *OutputType; 61 | 62 | } *PycStringIO; 63 | 64 | /* These can be used to test if you have one */ 65 | #define PycStringIO_InputCheck(O) \ 66 | (Py_TYPE(O)==PycStringIO->InputType) 67 | #define PycStringIO_OutputCheck(O) \ 68 | (Py_TYPE(O)==PycStringIO->OutputType) 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | #endif /* !Py_CSTRINGIO_H */ 74 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/cellobject.h: -------------------------------------------------------------------------------- 1 | /* Cell object interface */ 2 | 3 | #ifndef Py_CELLOBJECT_H 4 | #define Py_CELLOBJECT_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | typedef struct { 10 | PyObject_HEAD 11 | PyObject *ob_ref; /* Content of the cell or NULL when empty */ 12 | } PyCellObject; 13 | 14 | PyAPI_DATA(PyTypeObject) PyCell_Type; 15 | 16 | #define PyCell_Check(op) (Py_TYPE(op) == &PyCell_Type) 17 | 18 | PyAPI_FUNC(PyObject *) PyCell_New(PyObject *); 19 | PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *); 20 | PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *); 21 | 22 | #define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref) 23 | #define PyCell_SET(op, v) (((PyCellObject *)(op))->ob_ref = v) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif /* !Py_TUPLEOBJECT_H */ 29 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/classobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Class object interface */ 3 | 4 | /* Revealing some structures (not for general use) */ 5 | 6 | #ifndef Py_CLASSOBJECT_H 7 | #define Py_CLASSOBJECT_H 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | typedef struct { 13 | PyObject_HEAD 14 | PyObject *cl_bases; /* A tuple of class objects */ 15 | PyObject *cl_dict; /* A dictionary */ 16 | PyObject *cl_name; /* A string */ 17 | /* The following three are functions or NULL */ 18 | PyObject *cl_getattr; 19 | PyObject *cl_setattr; 20 | PyObject *cl_delattr; 21 | PyObject *cl_weakreflist; /* List of weak references */ 22 | } PyClassObject; 23 | 24 | typedef struct { 25 | PyObject_HEAD 26 | PyClassObject *in_class; /* The class object */ 27 | PyObject *in_dict; /* A dictionary */ 28 | PyObject *in_weakreflist; /* List of weak references */ 29 | } PyInstanceObject; 30 | 31 | typedef struct { 32 | PyObject_HEAD 33 | PyObject *im_func; /* The callable object implementing the method */ 34 | PyObject *im_self; /* The instance it is bound to, or NULL */ 35 | PyObject *im_class; /* The class that asked for the method */ 36 | PyObject *im_weakreflist; /* List of weak references */ 37 | } PyMethodObject; 38 | 39 | PyAPI_DATA(PyTypeObject) PyClass_Type, PyInstance_Type, PyMethod_Type; 40 | 41 | #define PyClass_Check(op) ((op)->ob_type == &PyClass_Type) 42 | #define PyInstance_Check(op) ((op)->ob_type == &PyInstance_Type) 43 | #define PyMethod_Check(op) ((op)->ob_type == &PyMethod_Type) 44 | 45 | PyAPI_FUNC(PyObject *) PyClass_New(PyObject *, PyObject *, PyObject *); 46 | PyAPI_FUNC(PyObject *) PyInstance_New(PyObject *, PyObject *, 47 | PyObject *); 48 | PyAPI_FUNC(PyObject *) PyInstance_NewRaw(PyObject *, PyObject *); 49 | PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *, PyObject *); 50 | 51 | PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *); 52 | PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *); 53 | PyAPI_FUNC(PyObject *) PyMethod_Class(PyObject *); 54 | 55 | /* Look up attribute with name (a string) on instance object pinst, using 56 | * only the instance and base class dicts. If a descriptor is found in 57 | * a class dict, the descriptor is returned without calling it. 58 | * Returns NULL if nothing found, else a borrowed reference to the 59 | * value associated with name in the dict in which name was found. 60 | * The point of this routine is that it never calls arbitrary Python 61 | * code, so is always "safe": all it does is dict lookups. The function 62 | * can't fail, never sets an exception, and NULL is not an error (it just 63 | * means "not found"). 64 | */ 65 | PyAPI_FUNC(PyObject *) _PyInstance_Lookup(PyObject *pinst, PyObject *name); 66 | 67 | /* Macros for direct access to these values. Type checks are *not* 68 | done, so use with care. */ 69 | #define PyMethod_GET_FUNCTION(meth) \ 70 | (((PyMethodObject *)meth) -> im_func) 71 | #define PyMethod_GET_SELF(meth) \ 72 | (((PyMethodObject *)meth) -> im_self) 73 | #define PyMethod_GET_CLASS(meth) \ 74 | (((PyMethodObject *)meth) -> im_class) 75 | 76 | PyAPI_FUNC(int) PyClass_IsSubclass(PyObject *, PyObject *); 77 | 78 | PyAPI_FUNC(int) PyMethod_ClearFreeList(void); 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | #endif /* !Py_CLASSOBJECT_H */ 84 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/cobject.h: -------------------------------------------------------------------------------- 1 | /* 2 | CObjects are marked Pending Deprecation as of Python 2.7. 3 | The full schedule for 2.x is as follows: 4 | - CObjects are marked Pending Deprecation in Python 2.7. 5 | - CObjects will be marked Deprecated in Python 2.8 6 | (if there is one). 7 | - CObjects will be removed in Python 2.9 (if there is one). 8 | 9 | Additionally, for the Python 3.x series: 10 | - CObjects were marked Deprecated in Python 3.1. 11 | - CObjects will be removed in Python 3.2. 12 | 13 | You should switch all use of CObjects to capsules. Capsules 14 | have a safer and more consistent API. For more information, 15 | see Include/pycapsule.h, or read the "Capsules" topic in 16 | the "Python/C API Reference Manual". 17 | 18 | Python 2.7 no longer uses CObjects itself; all objects which 19 | were formerly CObjects are now capsules. Note that this change 20 | does not by itself break binary compatibility with extensions 21 | built for previous versions of Python--PyCObject_AsVoidPtr() 22 | has been changed to also understand capsules. 23 | 24 | */ 25 | 26 | /* original file header comment follows: */ 27 | 28 | /* C objects to be exported from one extension module to another. 29 | 30 | C objects are used for communication between extension modules. 31 | They provide a way for an extension module to export a C interface 32 | to other extension modules, so that extension modules can use the 33 | Python import mechanism to link to one another. 34 | 35 | */ 36 | 37 | #ifndef Py_COBJECT_H 38 | #define Py_COBJECT_H 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | PyAPI_DATA(PyTypeObject) PyCObject_Type; 44 | 45 | #define PyCObject_Check(op) (Py_TYPE(op) == &PyCObject_Type) 46 | 47 | /* Create a PyCObject from a pointer to a C object and an optional 48 | destructor function. If the second argument is non-null, then it 49 | will be called with the first argument if and when the PyCObject is 50 | destroyed. 51 | 52 | */ 53 | PyAPI_FUNC(PyObject *) PyCObject_FromVoidPtr( 54 | void *cobj, void (*destruct)(void*)); 55 | 56 | 57 | /* Create a PyCObject from a pointer to a C object, a description object, 58 | and an optional destructor function. If the third argument is non-null, 59 | then it will be called with the first and second arguments if and when 60 | the PyCObject is destroyed. 61 | */ 62 | PyAPI_FUNC(PyObject *) PyCObject_FromVoidPtrAndDesc( 63 | void *cobj, void *desc, void (*destruct)(void*,void*)); 64 | 65 | /* Retrieve a pointer to a C object from a PyCObject. */ 66 | PyAPI_FUNC(void *) PyCObject_AsVoidPtr(PyObject *); 67 | 68 | /* Retrieve a pointer to a description object from a PyCObject. */ 69 | PyAPI_FUNC(void *) PyCObject_GetDesc(PyObject *); 70 | 71 | /* Import a pointer to a C object from a module using a PyCObject. */ 72 | PyAPI_FUNC(void *) PyCObject_Import(char *module_name, char *cobject_name); 73 | 74 | /* Modify a C object. Fails (==0) if object has a destructor. */ 75 | PyAPI_FUNC(int) PyCObject_SetVoidPtr(PyObject *self, void *cobj); 76 | 77 | 78 | typedef struct { 79 | PyObject_HEAD 80 | void *cobject; 81 | void *desc; 82 | void (*destructor)(void *); 83 | } PyCObject; 84 | 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | #endif /* !Py_COBJECT_H */ 90 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/compile.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_COMPILE_H 3 | #define Py_COMPILE_H 4 | 5 | #include "code.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | /* Public interface */ 12 | struct _node; /* Declare the existence of this type */ 13 | PyAPI_FUNC(PyCodeObject *) PyNode_Compile(struct _node *, const char *); 14 | 15 | /* Future feature support */ 16 | 17 | typedef struct { 18 | int ff_features; /* flags set by future statements */ 19 | int ff_lineno; /* line number of last future statement */ 20 | } PyFutureFeatures; 21 | 22 | #define FUTURE_NESTED_SCOPES "nested_scopes" 23 | #define FUTURE_GENERATORS "generators" 24 | #define FUTURE_DIVISION "division" 25 | #define FUTURE_ABSOLUTE_IMPORT "absolute_import" 26 | #define FUTURE_WITH_STATEMENT "with_statement" 27 | #define FUTURE_PRINT_FUNCTION "print_function" 28 | #define FUTURE_UNICODE_LITERALS "unicode_literals" 29 | 30 | 31 | struct _mod; /* Declare the existence of this type */ 32 | PyAPI_FUNC(PyCodeObject *) PyAST_Compile(struct _mod *, const char *, 33 | PyCompilerFlags *, PyArena *); 34 | PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(struct _mod *, const char *); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif /* !Py_COMPILE_H */ 41 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/complexobject.h: -------------------------------------------------------------------------------- 1 | /* Complex number structure */ 2 | 3 | #ifndef Py_COMPLEXOBJECT_H 4 | #define Py_COMPLEXOBJECT_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | typedef struct { 10 | double real; 11 | double imag; 12 | } Py_complex; 13 | 14 | /* Operations on complex numbers from complexmodule.c */ 15 | 16 | #define c_sum _Py_c_sum 17 | #define c_diff _Py_c_diff 18 | #define c_neg _Py_c_neg 19 | #define c_prod _Py_c_prod 20 | #define c_quot _Py_c_quot 21 | #define c_pow _Py_c_pow 22 | #define c_abs _Py_c_abs 23 | 24 | PyAPI_FUNC(Py_complex) c_sum(Py_complex, Py_complex); 25 | PyAPI_FUNC(Py_complex) c_diff(Py_complex, Py_complex); 26 | PyAPI_FUNC(Py_complex) c_neg(Py_complex); 27 | PyAPI_FUNC(Py_complex) c_prod(Py_complex, Py_complex); 28 | PyAPI_FUNC(Py_complex) c_quot(Py_complex, Py_complex); 29 | PyAPI_FUNC(Py_complex) c_pow(Py_complex, Py_complex); 30 | PyAPI_FUNC(double) c_abs(Py_complex); 31 | 32 | 33 | /* Complex object interface */ 34 | 35 | /* 36 | PyComplexObject represents a complex number with double-precision 37 | real and imaginary parts. 38 | */ 39 | 40 | typedef struct { 41 | PyObject_HEAD 42 | Py_complex cval; 43 | } PyComplexObject; 44 | 45 | PyAPI_DATA(PyTypeObject) PyComplex_Type; 46 | 47 | #define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type) 48 | #define PyComplex_CheckExact(op) (Py_TYPE(op) == &PyComplex_Type) 49 | 50 | PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex); 51 | PyAPI_FUNC(PyObject *) PyComplex_FromDoubles(double real, double imag); 52 | 53 | PyAPI_FUNC(double) PyComplex_RealAsDouble(PyObject *op); 54 | PyAPI_FUNC(double) PyComplex_ImagAsDouble(PyObject *op); 55 | PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op); 56 | 57 | /* Format the object based on the format_spec, as defined in PEP 3101 58 | (Advanced String Formatting). */ 59 | PyAPI_FUNC(PyObject *) _PyComplex_FormatAdvanced(PyObject *obj, 60 | char *format_spec, 61 | Py_ssize_t format_spec_len); 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | #endif /* !Py_COMPLEXOBJECT_H */ 67 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/descrobject.h: -------------------------------------------------------------------------------- 1 | /* Descriptors */ 2 | #ifndef Py_DESCROBJECT_H 3 | #define Py_DESCROBJECT_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | typedef PyObject *(*getter)(PyObject *, void *); 9 | typedef int (*setter)(PyObject *, PyObject *, void *); 10 | 11 | typedef struct PyGetSetDef { 12 | char *name; 13 | getter get; 14 | setter set; 15 | char *doc; 16 | void *closure; 17 | } PyGetSetDef; 18 | 19 | typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args, 20 | void *wrapped); 21 | 22 | typedef PyObject *(*wrapperfunc_kwds)(PyObject *self, PyObject *args, 23 | void *wrapped, PyObject *kwds); 24 | 25 | struct wrapperbase { 26 | char *name; 27 | int offset; 28 | void *function; 29 | wrapperfunc wrapper; 30 | char *doc; 31 | int flags; 32 | PyObject *name_strobj; 33 | }; 34 | 35 | /* Flags for above struct */ 36 | #define PyWrapperFlag_KEYWORDS 1 /* wrapper function takes keyword args */ 37 | 38 | /* Various kinds of descriptor objects */ 39 | 40 | #define PyDescr_COMMON \ 41 | PyObject_HEAD \ 42 | PyTypeObject *d_type; \ 43 | PyObject *d_name 44 | 45 | typedef struct { 46 | PyDescr_COMMON; 47 | } PyDescrObject; 48 | 49 | typedef struct { 50 | PyDescr_COMMON; 51 | PyMethodDef *d_method; 52 | } PyMethodDescrObject; 53 | 54 | typedef struct { 55 | PyDescr_COMMON; 56 | struct PyMemberDef *d_member; 57 | } PyMemberDescrObject; 58 | 59 | typedef struct { 60 | PyDescr_COMMON; 61 | PyGetSetDef *d_getset; 62 | } PyGetSetDescrObject; 63 | 64 | typedef struct { 65 | PyDescr_COMMON; 66 | struct wrapperbase *d_base; 67 | void *d_wrapped; /* This can be any function pointer */ 68 | } PyWrapperDescrObject; 69 | 70 | PyAPI_DATA(PyTypeObject) PyWrapperDescr_Type; 71 | PyAPI_DATA(PyTypeObject) PyDictProxy_Type; 72 | PyAPI_DATA(PyTypeObject) PyGetSetDescr_Type; 73 | PyAPI_DATA(PyTypeObject) PyMemberDescr_Type; 74 | 75 | PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *); 76 | PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *); 77 | PyAPI_FUNC(PyObject *) PyDescr_NewMember(PyTypeObject *, 78 | struct PyMemberDef *); 79 | PyAPI_FUNC(PyObject *) PyDescr_NewGetSet(PyTypeObject *, 80 | struct PyGetSetDef *); 81 | PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *, 82 | struct wrapperbase *, void *); 83 | #define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL) 84 | 85 | PyAPI_FUNC(PyObject *) PyDictProxy_New(PyObject *); 86 | PyAPI_FUNC(PyObject *) PyWrapper_New(PyObject *, PyObject *); 87 | 88 | 89 | PyAPI_DATA(PyTypeObject) PyProperty_Type; 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | #endif /* !Py_DESCROBJECT_H */ 94 | 95 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/dtoa.h: -------------------------------------------------------------------------------- 1 | #ifndef PY_NO_SHORT_FLOAT_REPR 2 | #ifdef __cplusplus 3 | extern "C" { 4 | #endif 5 | 6 | PyAPI_FUNC(double) _Py_dg_strtod(const char *str, char **ptr); 7 | PyAPI_FUNC(char *) _Py_dg_dtoa(double d, int mode, int ndigits, 8 | int *decpt, int *sign, char **rve); 9 | PyAPI_FUNC(void) _Py_dg_freedtoa(char *s); 10 | 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/enumobject.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_ENUMOBJECT_H 2 | #define Py_ENUMOBJECT_H 3 | 4 | /* Enumerate Object */ 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | PyAPI_DATA(PyTypeObject) PyEnum_Type; 11 | PyAPI_DATA(PyTypeObject) PyReversed_Type; 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif /* !Py_ENUMOBJECT_H */ 18 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/errcode.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_ERRCODE_H 2 | #define Py_ERRCODE_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | /* Error codes passed around between file input, tokenizer, parser and 9 | interpreter. This is necessary so we can turn them into Python 10 | exceptions at a higher level. Note that some errors have a 11 | slightly different meaning when passed from the tokenizer to the 12 | parser than when passed from the parser to the interpreter; e.g. 13 | the parser only returns E_EOF when it hits EOF immediately, and it 14 | never returns E_OK. */ 15 | 16 | #define E_OK 10 /* No error */ 17 | #define E_EOF 11 /* End Of File */ 18 | #define E_INTR 12 /* Interrupted */ 19 | #define E_TOKEN 13 /* Bad token */ 20 | #define E_SYNTAX 14 /* Syntax error */ 21 | #define E_NOMEM 15 /* Ran out of memory */ 22 | #define E_DONE 16 /* Parsing complete */ 23 | #define E_ERROR 17 /* Execution error */ 24 | #define E_TABSPACE 18 /* Inconsistent mixing of tabs and spaces */ 25 | #define E_OVERFLOW 19 /* Node had too many children */ 26 | #define E_TOODEEP 20 /* Too many indentation levels */ 27 | #define E_DEDENT 21 /* No matching outer block for dedent */ 28 | #define E_DECODE 22 /* Error in decoding into Unicode */ 29 | #define E_EOFS 23 /* EOF in triple-quoted string */ 30 | #define E_EOLS 24 /* EOL in single-quoted string */ 31 | #define E_LINECONT 25 /* Unexpected characters after a line continuation */ 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | #endif /* !Py_ERRCODE_H */ 37 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/eval.h: -------------------------------------------------------------------------------- 1 | 2 | /* Interface to execute compiled code */ 3 | 4 | #ifndef Py_EVAL_H 5 | #define Py_EVAL_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyCodeObject *, PyObject *, PyObject *); 11 | 12 | PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyCodeObject *co, 13 | PyObject *globals, 14 | PyObject *locals, 15 | PyObject **args, int argc, 16 | PyObject **kwds, int kwdc, 17 | PyObject **defs, int defc, 18 | PyObject *closure); 19 | 20 | PyAPI_FUNC(PyObject *) _PyEval_CallTracing(PyObject *func, PyObject *args); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | #endif /* !Py_EVAL_H */ 26 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/fileobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* File object interface */ 3 | 4 | #ifndef Py_FILEOBJECT_H 5 | #define Py_FILEOBJECT_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef struct { 11 | PyObject_HEAD 12 | FILE *f_fp; 13 | PyObject *f_name; 14 | PyObject *f_mode; 15 | int (*f_close)(FILE *); 16 | int f_softspace; /* Flag used by 'print' command */ 17 | int f_binary; /* Flag which indicates whether the file is 18 | open in binary (1) or text (0) mode */ 19 | char* f_buf; /* Allocated readahead buffer */ 20 | char* f_bufend; /* Points after last occupied position */ 21 | char* f_bufptr; /* Current buffer position */ 22 | char *f_setbuf; /* Buffer for setbuf(3) and setvbuf(3) */ 23 | int f_univ_newline; /* Handle any newline convention */ 24 | int f_newlinetypes; /* Types of newlines seen */ 25 | int f_skipnextlf; /* Skip next \n */ 26 | PyObject *f_encoding; 27 | PyObject *f_errors; 28 | PyObject *weakreflist; /* List of weak references */ 29 | int unlocked_count; /* Num. currently running sections of code 30 | using f_fp with the GIL released. */ 31 | int readable; 32 | int writable; 33 | } PyFileObject; 34 | 35 | PyAPI_DATA(PyTypeObject) PyFile_Type; 36 | 37 | #define PyFile_Check(op) PyObject_TypeCheck(op, &PyFile_Type) 38 | #define PyFile_CheckExact(op) (Py_TYPE(op) == &PyFile_Type) 39 | 40 | PyAPI_FUNC(PyObject *) PyFile_FromString(char *, char *); 41 | PyAPI_FUNC(void) PyFile_SetBufSize(PyObject *, int); 42 | PyAPI_FUNC(int) PyFile_SetEncoding(PyObject *, const char *); 43 | PyAPI_FUNC(int) PyFile_SetEncodingAndErrors(PyObject *, const char *, char *errors); 44 | PyAPI_FUNC(PyObject *) PyFile_FromFile(FILE *, char *, char *, 45 | int (*)(FILE *)); 46 | PyAPI_FUNC(FILE *) PyFile_AsFile(PyObject *); 47 | PyAPI_FUNC(void) PyFile_IncUseCount(PyFileObject *); 48 | PyAPI_FUNC(void) PyFile_DecUseCount(PyFileObject *); 49 | PyAPI_FUNC(PyObject *) PyFile_Name(PyObject *); 50 | PyAPI_FUNC(PyObject *) PyFile_GetLine(PyObject *, int); 51 | PyAPI_FUNC(int) PyFile_WriteObject(PyObject *, PyObject *, int); 52 | PyAPI_FUNC(int) PyFile_SoftSpace(PyObject *, int); 53 | PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *); 54 | PyAPI_FUNC(int) PyObject_AsFileDescriptor(PyObject *); 55 | 56 | /* The default encoding used by the platform file system APIs 57 | If non-NULL, this is different than the default encoding for strings 58 | */ 59 | PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding; 60 | 61 | /* Routines to replace fread() and fgets() which accept any of \r, \n 62 | or \r\n as line terminators. 63 | */ 64 | #define PY_STDIOTEXTMODE "b" 65 | char *Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *); 66 | size_t Py_UniversalNewlineFread(char *, size_t, FILE *, PyObject *); 67 | 68 | /* A routine to do sanity checking on the file mode string. returns 69 | non-zero on if an exception occurred 70 | */ 71 | int _PyFile_SanitizeMode(char *mode); 72 | 73 | #if defined _MSC_VER && _MSC_VER >= 1400 74 | /* A routine to check if a file descriptor is valid on Windows. Returns 0 75 | * and sets errno to EBADF if it isn't. This is to avoid Assertions 76 | * from various functions in the Windows CRT beginning with 77 | * Visual Studio 2005 78 | */ 79 | int _PyVerify_fd(int fd); 80 | #elif defined _MSC_VER && _MSC_VER >= 1200 81 | /* fdopen doesn't set errno EBADF and crashes for large fd on debug build */ 82 | #define _PyVerify_fd(fd) (_get_osfhandle(fd) >= 0) 83 | #else 84 | #define _PyVerify_fd(A) (1) /* dummy */ 85 | #endif 86 | 87 | /* A routine to check if a file descriptor can be select()-ed. */ 88 | #ifdef HAVE_SELECT 89 | #define _PyIsSelectable_fd(FD) (((FD) >= 0) && ((FD) < FD_SETSIZE)) 90 | #else 91 | #define _PyIsSelectable_fd(FD) (1) 92 | #endif /* HAVE_SELECT */ 93 | 94 | #ifdef __cplusplus 95 | } 96 | #endif 97 | #endif /* !Py_FILEOBJECT_H */ 98 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/frameobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Frame object interface */ 3 | 4 | #ifndef Py_FRAMEOBJECT_H 5 | #define Py_FRAMEOBJECT_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef struct { 11 | int b_type; /* what kind of block this is */ 12 | int b_handler; /* where to jump to find handler */ 13 | int b_level; /* value stack level to pop to */ 14 | } PyTryBlock; 15 | 16 | typedef struct _frame { 17 | PyObject_VAR_HEAD 18 | struct _frame *f_back; /* previous frame, or NULL */ 19 | PyCodeObject *f_code; /* code segment */ 20 | PyObject *f_builtins; /* builtin symbol table (PyDictObject) */ 21 | PyObject *f_globals; /* global symbol table (PyDictObject) */ 22 | PyObject *f_locals; /* local symbol table (any mapping) */ 23 | PyObject **f_valuestack; /* points after the last local */ 24 | /* Next free slot in f_valuestack. Frame creation sets to f_valuestack. 25 | Frame evaluation usually NULLs it, but a frame that yields sets it 26 | to the current stack top. */ 27 | PyObject **f_stacktop; 28 | PyObject *f_trace; /* Trace function */ 29 | 30 | /* If an exception is raised in this frame, the next three are used to 31 | * record the exception info (if any) originally in the thread state. See 32 | * comments before set_exc_info() -- it's not obvious. 33 | * Invariant: if _type is NULL, then so are _value and _traceback. 34 | * Desired invariant: all three are NULL, or all three are non-NULL. That 35 | * one isn't currently true, but "should be". 36 | */ 37 | PyObject *f_exc_type, *f_exc_value, *f_exc_traceback; 38 | 39 | PyThreadState *f_tstate; 40 | int f_lasti; /* Last instruction if called */ 41 | /* Call PyFrame_GetLineNumber() instead of reading this field 42 | directly. As of 2.3 f_lineno is only valid when tracing is 43 | active (i.e. when f_trace is set). At other times we use 44 | PyCode_Addr2Line to calculate the line from the current 45 | bytecode index. */ 46 | int f_lineno; /* Current line number */ 47 | int f_iblock; /* index in f_blockstack */ 48 | PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */ 49 | PyObject *f_localsplus[1]; /* locals+stack, dynamically sized */ 50 | } PyFrameObject; 51 | 52 | 53 | /* Standard object interface */ 54 | 55 | PyAPI_DATA(PyTypeObject) PyFrame_Type; 56 | 57 | #define PyFrame_Check(op) ((op)->ob_type == &PyFrame_Type) 58 | #define PyFrame_IsRestricted(f) \ 59 | ((f)->f_builtins != (f)->f_tstate->interp->builtins) 60 | 61 | PyAPI_FUNC(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *, 62 | PyObject *, PyObject *); 63 | 64 | 65 | /* The rest of the interface is specific for frame objects */ 66 | 67 | /* Block management functions */ 68 | 69 | PyAPI_FUNC(void) PyFrame_BlockSetup(PyFrameObject *, int, int, int); 70 | PyAPI_FUNC(PyTryBlock *) PyFrame_BlockPop(PyFrameObject *); 71 | 72 | /* Extend the value stack */ 73 | 74 | PyAPI_FUNC(PyObject **) PyFrame_ExtendStack(PyFrameObject *, int, int); 75 | 76 | /* Conversions between "fast locals" and locals in dictionary */ 77 | 78 | PyAPI_FUNC(void) PyFrame_LocalsToFast(PyFrameObject *, int); 79 | PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *); 80 | 81 | PyAPI_FUNC(int) PyFrame_ClearFreeList(void); 82 | 83 | /* Return the line of code the frame is currently executing. */ 84 | PyAPI_FUNC(int) PyFrame_GetLineNumber(PyFrameObject *); 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | #endif /* !Py_FRAMEOBJECT_H */ 90 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/funcobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Function object interface */ 3 | 4 | #ifndef Py_FUNCOBJECT_H 5 | #define Py_FUNCOBJECT_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | /* Function objects and code objects should not be confused with each other: 11 | * 12 | * Function objects are created by the execution of the 'def' statement. 13 | * They reference a code object in their func_code attribute, which is a 14 | * purely syntactic object, i.e. nothing more than a compiled version of some 15 | * source code lines. There is one code object per source code "fragment", 16 | * but each code object can be referenced by zero or many function objects 17 | * depending only on how many times the 'def' statement in the source was 18 | * executed so far. 19 | */ 20 | 21 | typedef struct { 22 | PyObject_HEAD 23 | PyObject *func_code; /* A code object */ 24 | PyObject *func_globals; /* A dictionary (other mappings won't do) */ 25 | PyObject *func_defaults; /* NULL or a tuple */ 26 | PyObject *func_closure; /* NULL or a tuple of cell objects */ 27 | PyObject *func_doc; /* The __doc__ attribute, can be anything */ 28 | PyObject *func_name; /* The __name__ attribute, a string object */ 29 | PyObject *func_dict; /* The __dict__ attribute, a dict or NULL */ 30 | PyObject *func_weakreflist; /* List of weak references */ 31 | PyObject *func_module; /* The __module__ attribute, can be anything */ 32 | 33 | /* Invariant: 34 | * func_closure contains the bindings for func_code->co_freevars, so 35 | * PyTuple_Size(func_closure) == PyCode_GetNumFree(func_code) 36 | * (func_closure may be NULL if PyCode_GetNumFree(func_code) == 0). 37 | */ 38 | } PyFunctionObject; 39 | 40 | PyAPI_DATA(PyTypeObject) PyFunction_Type; 41 | 42 | #define PyFunction_Check(op) (Py_TYPE(op) == &PyFunction_Type) 43 | 44 | PyAPI_FUNC(PyObject *) PyFunction_New(PyObject *, PyObject *); 45 | PyAPI_FUNC(PyObject *) PyFunction_GetCode(PyObject *); 46 | PyAPI_FUNC(PyObject *) PyFunction_GetGlobals(PyObject *); 47 | PyAPI_FUNC(PyObject *) PyFunction_GetModule(PyObject *); 48 | PyAPI_FUNC(PyObject *) PyFunction_GetDefaults(PyObject *); 49 | PyAPI_FUNC(int) PyFunction_SetDefaults(PyObject *, PyObject *); 50 | PyAPI_FUNC(PyObject *) PyFunction_GetClosure(PyObject *); 51 | PyAPI_FUNC(int) PyFunction_SetClosure(PyObject *, PyObject *); 52 | 53 | /* Macros for direct access to these values. Type checks are *not* 54 | done, so use with care. */ 55 | #define PyFunction_GET_CODE(func) \ 56 | (((PyFunctionObject *)func) -> func_code) 57 | #define PyFunction_GET_GLOBALS(func) \ 58 | (((PyFunctionObject *)func) -> func_globals) 59 | #define PyFunction_GET_MODULE(func) \ 60 | (((PyFunctionObject *)func) -> func_module) 61 | #define PyFunction_GET_DEFAULTS(func) \ 62 | (((PyFunctionObject *)func) -> func_defaults) 63 | #define PyFunction_GET_CLOSURE(func) \ 64 | (((PyFunctionObject *)func) -> func_closure) 65 | 66 | /* The classmethod and staticmethod types lives here, too */ 67 | PyAPI_DATA(PyTypeObject) PyClassMethod_Type; 68 | PyAPI_DATA(PyTypeObject) PyStaticMethod_Type; 69 | 70 | PyAPI_FUNC(PyObject *) PyClassMethod_New(PyObject *); 71 | PyAPI_FUNC(PyObject *) PyStaticMethod_New(PyObject *); 72 | 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | #endif /* !Py_FUNCOBJECT_H */ 77 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/genobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Generator object interface */ 3 | 4 | #ifndef Py_GENOBJECT_H 5 | #define Py_GENOBJECT_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | struct _frame; /* Avoid including frameobject.h */ 11 | 12 | typedef struct { 13 | PyObject_HEAD 14 | /* The gi_ prefix is intended to remind of generator-iterator. */ 15 | 16 | /* Note: gi_frame can be NULL if the generator is "finished" */ 17 | struct _frame *gi_frame; 18 | 19 | /* True if generator is being executed. */ 20 | int gi_running; 21 | 22 | /* The code object backing the generator */ 23 | PyObject *gi_code; 24 | 25 | /* List of weak reference. */ 26 | PyObject *gi_weakreflist; 27 | } PyGenObject; 28 | 29 | PyAPI_DATA(PyTypeObject) PyGen_Type; 30 | 31 | #define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type) 32 | #define PyGen_CheckExact(op) (Py_TYPE(op) == &PyGen_Type) 33 | 34 | PyAPI_FUNC(PyObject *) PyGen_New(struct _frame *); 35 | PyAPI_FUNC(int) PyGen_NeedsFinalizing(PyGenObject *); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif /* !Py_GENOBJECT_H */ 41 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/graminit.h: -------------------------------------------------------------------------------- 1 | /* Generated by Parser/pgen */ 2 | 3 | #define single_input 256 4 | #define file_input 257 5 | #define eval_input 258 6 | #define decorator 259 7 | #define decorators 260 8 | #define decorated 261 9 | #define funcdef 262 10 | #define parameters 263 11 | #define varargslist 264 12 | #define fpdef 265 13 | #define fplist 266 14 | #define stmt 267 15 | #define simple_stmt 268 16 | #define small_stmt 269 17 | #define expr_stmt 270 18 | #define augassign 271 19 | #define print_stmt 272 20 | #define del_stmt 273 21 | #define pass_stmt 274 22 | #define flow_stmt 275 23 | #define break_stmt 276 24 | #define continue_stmt 277 25 | #define return_stmt 278 26 | #define yield_stmt 279 27 | #define raise_stmt 280 28 | #define import_stmt 281 29 | #define import_name 282 30 | #define import_from 283 31 | #define import_as_name 284 32 | #define dotted_as_name 285 33 | #define import_as_names 286 34 | #define dotted_as_names 287 35 | #define dotted_name 288 36 | #define global_stmt 289 37 | #define exec_stmt 290 38 | #define assert_stmt 291 39 | #define compound_stmt 292 40 | #define if_stmt 293 41 | #define while_stmt 294 42 | #define for_stmt 295 43 | #define try_stmt 296 44 | #define with_stmt 297 45 | #define with_item 298 46 | #define except_clause 299 47 | #define suite 300 48 | #define testlist_safe 301 49 | #define old_test 302 50 | #define old_lambdef 303 51 | #define test 304 52 | #define or_test 305 53 | #define and_test 306 54 | #define not_test 307 55 | #define comparison 308 56 | #define comp_op 309 57 | #define expr 310 58 | #define xor_expr 311 59 | #define and_expr 312 60 | #define shift_expr 313 61 | #define arith_expr 314 62 | #define term 315 63 | #define factor 316 64 | #define power 317 65 | #define atom 318 66 | #define listmaker 319 67 | #define testlist_comp 320 68 | #define lambdef 321 69 | #define trailer 322 70 | #define subscriptlist 323 71 | #define subscript 324 72 | #define sliceop 325 73 | #define exprlist 326 74 | #define testlist 327 75 | #define dictorsetmaker 328 76 | #define classdef 329 77 | #define arglist 330 78 | #define argument 331 79 | #define list_iter 332 80 | #define list_for 333 81 | #define list_if 334 82 | #define comp_iter 335 83 | #define comp_for 336 84 | #define comp_if 337 85 | #define testlist1 338 86 | #define encoding_decl 339 87 | #define yield_expr 340 88 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/grammar.h: -------------------------------------------------------------------------------- 1 | 2 | /* Grammar interface */ 3 | 4 | #ifndef Py_GRAMMAR_H 5 | #define Py_GRAMMAR_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #include "bitset.h" /* Sigh... */ 11 | 12 | /* A label of an arc */ 13 | 14 | typedef struct { 15 | int lb_type; 16 | char *lb_str; 17 | } label; 18 | 19 | #define EMPTY 0 /* Label number 0 is by definition the empty label */ 20 | 21 | /* A list of labels */ 22 | 23 | typedef struct { 24 | int ll_nlabels; 25 | label *ll_label; 26 | } labellist; 27 | 28 | /* An arc from one state to another */ 29 | 30 | typedef struct { 31 | short a_lbl; /* Label of this arc */ 32 | short a_arrow; /* State where this arc goes to */ 33 | } arc; 34 | 35 | /* A state in a DFA */ 36 | 37 | typedef struct { 38 | int s_narcs; 39 | arc *s_arc; /* Array of arcs */ 40 | 41 | /* Optional accelerators */ 42 | int s_lower; /* Lowest label index */ 43 | int s_upper; /* Highest label index */ 44 | int *s_accel; /* Accelerator */ 45 | int s_accept; /* Nonzero for accepting state */ 46 | } state; 47 | 48 | /* A DFA */ 49 | 50 | typedef struct { 51 | int d_type; /* Non-terminal this represents */ 52 | char *d_name; /* For printing */ 53 | int d_initial; /* Initial state */ 54 | int d_nstates; 55 | state *d_state; /* Array of states */ 56 | bitset d_first; 57 | } dfa; 58 | 59 | /* A grammar */ 60 | 61 | typedef struct { 62 | int g_ndfas; 63 | dfa *g_dfa; /* Array of DFAs */ 64 | labellist g_ll; 65 | int g_start; /* Start symbol of the grammar */ 66 | int g_accel; /* Set if accelerators present */ 67 | } grammar; 68 | 69 | /* FUNCTIONS */ 70 | 71 | grammar *newgrammar(int start); 72 | dfa *adddfa(grammar *g, int type, char *name); 73 | int addstate(dfa *d); 74 | void addarc(dfa *d, int from, int to, int lbl); 75 | dfa *PyGrammar_FindDFA(grammar *g, int type); 76 | 77 | int addlabel(labellist *ll, int type, char *str); 78 | int findlabel(labellist *ll, int type, char *str); 79 | char *PyGrammar_LabelRepr(label *lb); 80 | void translatelabels(grammar *g); 81 | 82 | void addfirstsets(grammar *g); 83 | 84 | void PyGrammar_AddAccelerators(grammar *g); 85 | void PyGrammar_RemoveAccelerators(grammar *); 86 | 87 | void printgrammar(grammar *g, FILE *fp); 88 | void printnonterminals(grammar *g, FILE *fp); 89 | 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | #endif /* !Py_GRAMMAR_H */ 94 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/import.h: -------------------------------------------------------------------------------- 1 | 2 | /* Module definition and import interface */ 3 | 4 | #ifndef Py_IMPORT_H 5 | #define Py_IMPORT_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | PyAPI_FUNC(long) PyImport_GetMagicNumber(void); 11 | PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule(char *name, PyObject *co); 12 | PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleEx( 13 | char *name, PyObject *co, char *pathname); 14 | PyAPI_FUNC(PyObject *) PyImport_GetModuleDict(void); 15 | PyAPI_FUNC(PyObject *) PyImport_AddModule(const char *name); 16 | PyAPI_FUNC(PyObject *) PyImport_ImportModule(const char *name); 17 | PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock(const char *); 18 | PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel(char *name, 19 | PyObject *globals, PyObject *locals, PyObject *fromlist, int level); 20 | 21 | #define PyImport_ImportModuleEx(n, g, l, f) \ 22 | PyImport_ImportModuleLevel(n, g, l, f, -1) 23 | 24 | PyAPI_FUNC(PyObject *) PyImport_GetImporter(PyObject *path); 25 | PyAPI_FUNC(PyObject *) PyImport_Import(PyObject *name); 26 | PyAPI_FUNC(PyObject *) PyImport_ReloadModule(PyObject *m); 27 | PyAPI_FUNC(void) PyImport_Cleanup(void); 28 | PyAPI_FUNC(int) PyImport_ImportFrozenModule(char *); 29 | 30 | #ifdef WITH_THREAD 31 | PyAPI_FUNC(void) _PyImport_AcquireLock(void); 32 | PyAPI_FUNC(int) _PyImport_ReleaseLock(void); 33 | #else 34 | #define _PyImport_AcquireLock() 35 | #define _PyImport_ReleaseLock() 1 36 | #endif 37 | 38 | PyAPI_FUNC(struct filedescr *) _PyImport_FindModule( 39 | const char *, PyObject *, char *, size_t, FILE **, PyObject **); 40 | PyAPI_FUNC(int) _PyImport_IsScript(struct filedescr *); 41 | PyAPI_FUNC(void) _PyImport_ReInitLock(void); 42 | 43 | PyAPI_FUNC(PyObject *) _PyImport_FindExtension(char *, char *); 44 | PyAPI_FUNC(PyObject *) _PyImport_FixupExtension(char *, char *); 45 | 46 | struct _inittab { 47 | char *name; 48 | void (*initfunc)(void); 49 | }; 50 | 51 | PyAPI_DATA(PyTypeObject) PyNullImporter_Type; 52 | PyAPI_DATA(struct _inittab *) PyImport_Inittab; 53 | 54 | PyAPI_FUNC(int) PyImport_AppendInittab(const char *name, void (*initfunc)(void)); 55 | PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab); 56 | 57 | struct _frozen { 58 | char *name; 59 | unsigned char *code; 60 | int size; 61 | }; 62 | 63 | /* Embedding apps may change this pointer to point to their favorite 64 | collection of frozen modules: */ 65 | 66 | PyAPI_DATA(struct _frozen *) PyImport_FrozenModules; 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | #endif /* !Py_IMPORT_H */ 72 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/intobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Integer object interface */ 3 | 4 | /* 5 | PyIntObject represents a (long) integer. This is an immutable object; 6 | an integer cannot change its value after creation. 7 | 8 | There are functions to create new integer objects, to test an object 9 | for integer-ness, and to get the integer value. The latter functions 10 | returns -1 and sets errno to EBADF if the object is not an PyIntObject. 11 | None of the functions should be applied to nil objects. 12 | 13 | The type PyIntObject is (unfortunately) exposed here so we can declare 14 | _Py_TrueStruct and _Py_ZeroStruct in boolobject.h; don't use this. 15 | */ 16 | 17 | #ifndef Py_INTOBJECT_H 18 | #define Py_INTOBJECT_H 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | typedef struct { 24 | PyObject_HEAD 25 | long ob_ival; 26 | } PyIntObject; 27 | 28 | PyAPI_DATA(PyTypeObject) PyInt_Type; 29 | 30 | #define PyInt_Check(op) \ 31 | PyType_FastSubclass((op)->ob_type, Py_TPFLAGS_INT_SUBCLASS) 32 | #define PyInt_CheckExact(op) ((op)->ob_type == &PyInt_Type) 33 | 34 | PyAPI_FUNC(PyObject *) PyInt_FromString(char*, char**, int); 35 | #ifdef Py_USING_UNICODE 36 | PyAPI_FUNC(PyObject *) PyInt_FromUnicode(Py_UNICODE*, Py_ssize_t, int); 37 | #endif 38 | PyAPI_FUNC(PyObject *) PyInt_FromLong(long); 39 | PyAPI_FUNC(PyObject *) PyInt_FromSize_t(size_t); 40 | PyAPI_FUNC(PyObject *) PyInt_FromSsize_t(Py_ssize_t); 41 | PyAPI_FUNC(long) PyInt_AsLong(PyObject *); 42 | PyAPI_FUNC(Py_ssize_t) PyInt_AsSsize_t(PyObject *); 43 | PyAPI_FUNC(int) _PyInt_AsInt(PyObject *); 44 | PyAPI_FUNC(unsigned long) PyInt_AsUnsignedLongMask(PyObject *); 45 | #ifdef HAVE_LONG_LONG 46 | PyAPI_FUNC(unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *); 47 | #endif 48 | 49 | PyAPI_FUNC(long) PyInt_GetMax(void); 50 | 51 | /* Macro, trading safety for speed */ 52 | #define PyInt_AS_LONG(op) (((PyIntObject *)(op))->ob_ival) 53 | 54 | /* These aren't really part of the Int object, but they're handy; the protos 55 | * are necessary for systems that need the magic of PyAPI_FUNC and that want 56 | * to have stropmodule as a dynamically loaded module instead of building it 57 | * into the main Python shared library/DLL. Guido thinks I'm weird for 58 | * building it this way. :-) [cjh] 59 | */ 60 | PyAPI_FUNC(unsigned long) PyOS_strtoul(char *, char **, int); 61 | PyAPI_FUNC(long) PyOS_strtol(char *, char **, int); 62 | 63 | /* free list api */ 64 | PyAPI_FUNC(int) PyInt_ClearFreeList(void); 65 | 66 | /* Convert an integer to the given base. Returns a string. 67 | If base is 2, 8 or 16, add the proper prefix '0b', '0o' or '0x'. 68 | If newstyle is zero, then use the pre-2.6 behavior of octal having 69 | a leading "0" */ 70 | PyAPI_FUNC(PyObject*) _PyInt_Format(PyIntObject* v, int base, int newstyle); 71 | 72 | /* Format the object based on the format_spec, as defined in PEP 3101 73 | (Advanced String Formatting). */ 74 | PyAPI_FUNC(PyObject *) _PyInt_FormatAdvanced(PyObject *obj, 75 | char *format_spec, 76 | Py_ssize_t format_spec_len); 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | #endif /* !Py_INTOBJECT_H */ 82 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/intrcheck.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_INTRCHECK_H 3 | #define Py_INTRCHECK_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_FUNC(int) PyOS_InterruptOccurred(void); 9 | PyAPI_FUNC(void) PyOS_InitInterrupts(void); 10 | PyAPI_FUNC(void) PyOS_AfterFork(void); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | #endif /* !Py_INTRCHECK_H */ 16 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/iterobject.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_ITEROBJECT_H 2 | #define Py_ITEROBJECT_H 3 | /* Iterators (the basic kind, over a sequence) */ 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_DATA(PyTypeObject) PySeqIter_Type; 9 | 10 | #define PySeqIter_Check(op) (Py_TYPE(op) == &PySeqIter_Type) 11 | 12 | PyAPI_FUNC(PyObject *) PySeqIter_New(PyObject *); 13 | 14 | PyAPI_DATA(PyTypeObject) PyCallIter_Type; 15 | 16 | #define PyCallIter_Check(op) (Py_TYPE(op) == &PyCallIter_Type) 17 | 18 | PyAPI_FUNC(PyObject *) PyCallIter_New(PyObject *, PyObject *); 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | #endif /* !Py_ITEROBJECT_H */ 23 | 24 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/listobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* List object interface */ 3 | 4 | /* 5 | Another generally useful object type is a list of object pointers. 6 | This is a mutable type: the list items can be changed, and items can be 7 | added or removed. Out-of-range indices or non-list objects are ignored. 8 | 9 | *** WARNING *** PyList_SetItem does not increment the new item's reference 10 | count, but does decrement the reference count of the item it replaces, 11 | if not nil. It does *decrement* the reference count if it is *not* 12 | inserted in the list. Similarly, PyList_GetItem does not increment the 13 | returned item's reference count. 14 | */ 15 | 16 | #ifndef Py_LISTOBJECT_H 17 | #define Py_LISTOBJECT_H 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | typedef struct { 23 | PyObject_VAR_HEAD 24 | /* Vector of pointers to list elements. list[0] is ob_item[0], etc. */ 25 | PyObject **ob_item; 26 | 27 | /* ob_item contains space for 'allocated' elements. The number 28 | * currently in use is ob_size. 29 | * Invariants: 30 | * 0 <= ob_size <= allocated 31 | * len(list) == ob_size 32 | * ob_item == NULL implies ob_size == allocated == 0 33 | * list.sort() temporarily sets allocated to -1 to detect mutations. 34 | * 35 | * Items must normally not be NULL, except during construction when 36 | * the list is not yet visible outside the function that builds it. 37 | */ 38 | Py_ssize_t allocated; 39 | } PyListObject; 40 | 41 | PyAPI_DATA(PyTypeObject) PyList_Type; 42 | 43 | #define PyList_Check(op) \ 44 | PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS) 45 | #define PyList_CheckExact(op) (Py_TYPE(op) == &PyList_Type) 46 | 47 | PyAPI_FUNC(PyObject *) PyList_New(Py_ssize_t size); 48 | PyAPI_FUNC(Py_ssize_t) PyList_Size(PyObject *); 49 | PyAPI_FUNC(PyObject *) PyList_GetItem(PyObject *, Py_ssize_t); 50 | PyAPI_FUNC(int) PyList_SetItem(PyObject *, Py_ssize_t, PyObject *); 51 | PyAPI_FUNC(int) PyList_Insert(PyObject *, Py_ssize_t, PyObject *); 52 | PyAPI_FUNC(int) PyList_Append(PyObject *, PyObject *); 53 | PyAPI_FUNC(PyObject *) PyList_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t); 54 | PyAPI_FUNC(int) PyList_SetSlice(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *); 55 | PyAPI_FUNC(int) PyList_Sort(PyObject *); 56 | PyAPI_FUNC(int) PyList_Reverse(PyObject *); 57 | PyAPI_FUNC(PyObject *) PyList_AsTuple(PyObject *); 58 | PyAPI_FUNC(PyObject *) _PyList_Extend(PyListObject *, PyObject *); 59 | 60 | /* Macro, trading safety for speed */ 61 | #define PyList_GET_ITEM(op, i) (((PyListObject *)(op))->ob_item[i]) 62 | #define PyList_SET_ITEM(op, i, v) (((PyListObject *)(op))->ob_item[i] = (v)) 63 | #define PyList_GET_SIZE(op) Py_SIZE(op) 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | #endif /* !Py_LISTOBJECT_H */ 69 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/longintrepr.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_LONGINTREPR_H 2 | #define Py_LONGINTREPR_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | /* This is published for the benefit of "friend" marshal.c only. */ 9 | 10 | /* Parameters of the long integer representation. There are two different 11 | sets of parameters: one set for 30-bit digits, stored in an unsigned 32-bit 12 | integer type, and one set for 15-bit digits with each digit stored in an 13 | unsigned short. The value of PYLONG_BITS_IN_DIGIT, defined either at 14 | configure time or in pyport.h, is used to decide which digit size to use. 15 | 16 | Type 'digit' should be able to hold 2*PyLong_BASE-1, and type 'twodigits' 17 | should be an unsigned integer type able to hold all integers up to 18 | PyLong_BASE*PyLong_BASE-1. x_sub assumes that 'digit' is an unsigned type, 19 | and that overflow is handled by taking the result modulo 2**N for some N > 20 | PyLong_SHIFT. The majority of the code doesn't care about the precise 21 | value of PyLong_SHIFT, but there are some notable exceptions: 22 | 23 | - long_pow() requires that PyLong_SHIFT be divisible by 5 24 | 25 | - PyLong_{As,From}ByteArray require that PyLong_SHIFT be at least 8 26 | 27 | - long_hash() requires that PyLong_SHIFT is *strictly* less than the number 28 | of bits in an unsigned long, as do the PyLong <-> long (or unsigned long) 29 | conversion functions 30 | 31 | - the long <-> size_t/Py_ssize_t conversion functions expect that 32 | PyLong_SHIFT is strictly less than the number of bits in a size_t 33 | 34 | - the marshal code currently expects that PyLong_SHIFT is a multiple of 15 35 | 36 | The values 15 and 30 should fit all of the above requirements, on any 37 | platform. 38 | */ 39 | 40 | #if PYLONG_BITS_IN_DIGIT == 30 41 | #if !(defined HAVE_UINT64_T && defined HAVE_UINT32_T && \ 42 | defined HAVE_INT64_T && defined HAVE_INT32_T) 43 | #error "30-bit long digits requested, but the necessary types are not available on this platform" 44 | #endif 45 | typedef PY_UINT32_T digit; 46 | typedef PY_INT32_T sdigit; /* signed variant of digit */ 47 | typedef PY_UINT64_T twodigits; 48 | typedef PY_INT64_T stwodigits; /* signed variant of twodigits */ 49 | #define PyLong_SHIFT 30 50 | #define _PyLong_DECIMAL_SHIFT 9 /* max(e such that 10**e fits in a digit) */ 51 | #define _PyLong_DECIMAL_BASE ((digit)1000000000) /* 10 ** DECIMAL_SHIFT */ 52 | #elif PYLONG_BITS_IN_DIGIT == 15 53 | typedef unsigned short digit; 54 | typedef short sdigit; /* signed variant of digit */ 55 | typedef unsigned long twodigits; 56 | typedef long stwodigits; /* signed variant of twodigits */ 57 | #define PyLong_SHIFT 15 58 | #define _PyLong_DECIMAL_SHIFT 4 /* max(e such that 10**e fits in a digit) */ 59 | #define _PyLong_DECIMAL_BASE ((digit)10000) /* 10 ** DECIMAL_SHIFT */ 60 | #else 61 | #error "PYLONG_BITS_IN_DIGIT should be 15 or 30" 62 | #endif 63 | #define PyLong_BASE ((digit)1 << PyLong_SHIFT) 64 | #define PyLong_MASK ((digit)(PyLong_BASE - 1)) 65 | 66 | /* b/w compatibility with Python 2.5 */ 67 | #define SHIFT PyLong_SHIFT 68 | #define BASE PyLong_BASE 69 | #define MASK PyLong_MASK 70 | 71 | #if PyLong_SHIFT % 5 != 0 72 | #error "longobject.c requires that PyLong_SHIFT be divisible by 5" 73 | #endif 74 | 75 | /* Long integer representation. 76 | The absolute value of a number is equal to 77 | SUM(for i=0 through abs(ob_size)-1) ob_digit[i] * 2**(SHIFT*i) 78 | Negative numbers are represented with ob_size < 0; 79 | zero is represented by ob_size == 0. 80 | In a normalized number, ob_digit[abs(ob_size)-1] (the most significant 81 | digit) is never zero. Also, in all cases, for all valid i, 82 | 0 <= ob_digit[i] <= MASK. 83 | The allocation function takes care of allocating extra memory 84 | so that ob_digit[0] ... ob_digit[abs(ob_size)-1] are actually available. 85 | 86 | CAUTION: Generic code manipulating subtypes of PyVarObject has to 87 | aware that longs abuse ob_size's sign bit. 88 | */ 89 | 90 | struct _longobject { 91 | PyObject_VAR_HEAD 92 | digit ob_digit[1]; 93 | }; 94 | 95 | PyAPI_FUNC(PyLongObject *) _PyLong_New(Py_ssize_t); 96 | 97 | /* Return a copy of src. */ 98 | PyAPI_FUNC(PyObject *) _PyLong_Copy(PyLongObject *src); 99 | 100 | #ifdef __cplusplus 101 | } 102 | #endif 103 | #endif /* !Py_LONGINTREPR_H */ 104 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/marshal.h: -------------------------------------------------------------------------------- 1 | 2 | /* Interface for marshal.c */ 3 | 4 | #ifndef Py_MARSHAL_H 5 | #define Py_MARSHAL_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #define Py_MARSHAL_VERSION 2 11 | 12 | PyAPI_FUNC(void) PyMarshal_WriteLongToFile(long, FILE *, int); 13 | PyAPI_FUNC(void) PyMarshal_WriteObjectToFile(PyObject *, FILE *, int); 14 | PyAPI_FUNC(PyObject *) PyMarshal_WriteObjectToString(PyObject *, int); 15 | 16 | PyAPI_FUNC(long) PyMarshal_ReadLongFromFile(FILE *); 17 | PyAPI_FUNC(int) PyMarshal_ReadShortFromFile(FILE *); 18 | PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromFile(FILE *); 19 | PyAPI_FUNC(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *); 20 | PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(char *, Py_ssize_t); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | #endif /* !Py_MARSHAL_H */ 26 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/memoryobject.h: -------------------------------------------------------------------------------- 1 | /* Memory view object. In Python this is available as "memoryview". */ 2 | 3 | #ifndef Py_MEMORYOBJECT_H 4 | #define Py_MEMORYOBJECT_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | PyAPI_DATA(PyTypeObject) PyMemoryView_Type; 10 | 11 | #define PyMemoryView_Check(op) (Py_TYPE(op) == &PyMemoryView_Type) 12 | 13 | /* Get a pointer to the underlying Py_buffer of a memoryview object. */ 14 | #define PyMemoryView_GET_BUFFER(op) (&((PyMemoryViewObject *)(op))->view) 15 | /* Get a pointer to the PyObject from which originates a memoryview object. */ 16 | #define PyMemoryView_GET_BASE(op) (((PyMemoryViewObject *)(op))->view.obj) 17 | 18 | 19 | PyAPI_FUNC(PyObject *) PyMemoryView_GetContiguous(PyObject *base, 20 | int buffertype, 21 | char fort); 22 | 23 | /* Return a contiguous chunk of memory representing the buffer 24 | from an object in a memory view object. If a copy is made then the 25 | base object for the memory view will be a *new* bytes object. 26 | 27 | Otherwise, the base-object will be the object itself and no 28 | data-copying will be done. 29 | 30 | The buffertype argument can be PyBUF_READ, PyBUF_WRITE, 31 | PyBUF_SHADOW to determine whether the returned buffer 32 | should be READONLY, WRITABLE, or set to update the 33 | original buffer if a copy must be made. If buffertype is 34 | PyBUF_WRITE and the buffer is not contiguous an error will 35 | be raised. In this circumstance, the user can use 36 | PyBUF_SHADOW to ensure that a writable temporary 37 | contiguous buffer is returned. The contents of this 38 | contiguous buffer will be copied back into the original 39 | object after the memoryview object is deleted as long as 40 | the original object is writable and allows setting an 41 | exclusive write lock. If this is not allowed by the 42 | original object, then a BufferError is raised. 43 | 44 | If the object is multi-dimensional and if fortran is 'F', 45 | the first dimension of the underlying array will vary the 46 | fastest in the buffer. If fortran is 'C', then the last 47 | dimension will vary the fastest (C-style contiguous). If 48 | fortran is 'A', then it does not matter and you will get 49 | whatever the object decides is more efficient. 50 | 51 | A new reference is returned that must be DECREF'd when finished. 52 | */ 53 | 54 | PyAPI_FUNC(PyObject *) PyMemoryView_FromObject(PyObject *base); 55 | 56 | PyAPI_FUNC(PyObject *) PyMemoryView_FromBuffer(Py_buffer *info); 57 | /* create new if bufptr is NULL 58 | will be a new bytesobject in base */ 59 | 60 | 61 | /* The struct is declared here so that macros can work, but it shouldn't 62 | be considered public. Don't access those fields directly, use the macros 63 | and functions instead! */ 64 | typedef struct { 65 | PyObject_HEAD 66 | PyObject *base; 67 | Py_buffer view; 68 | } PyMemoryViewObject; 69 | 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | #endif /* !Py_MEMORYOBJECT_H */ 75 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/metagrammar.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_METAGRAMMAR_H 2 | #define Py_METAGRAMMAR_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | #define MSTART 256 9 | #define RULE 257 10 | #define RHS 258 11 | #define ALT 259 12 | #define ITEM 260 13 | #define ATOM 261 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | #endif /* !Py_METAGRAMMAR_H */ 19 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/methodobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Method object interface */ 3 | 4 | #ifndef Py_METHODOBJECT_H 5 | #define Py_METHODOBJECT_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | /* This is about the type 'builtin_function_or_method', 11 | not Python methods in user-defined classes. See classobject.h 12 | for the latter. */ 13 | 14 | PyAPI_DATA(PyTypeObject) PyCFunction_Type; 15 | 16 | #define PyCFunction_Check(op) (Py_TYPE(op) == &PyCFunction_Type) 17 | 18 | typedef PyObject *(*PyCFunction)(PyObject *, PyObject *); 19 | typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *, 20 | PyObject *); 21 | typedef PyObject *(*PyNoArgsFunction)(PyObject *); 22 | 23 | PyAPI_FUNC(PyCFunction) PyCFunction_GetFunction(PyObject *); 24 | PyAPI_FUNC(PyObject *) PyCFunction_GetSelf(PyObject *); 25 | PyAPI_FUNC(int) PyCFunction_GetFlags(PyObject *); 26 | 27 | /* Macros for direct access to these values. Type checks are *not* 28 | done, so use with care. */ 29 | #define PyCFunction_GET_FUNCTION(func) \ 30 | (((PyCFunctionObject *)func) -> m_ml -> ml_meth) 31 | #define PyCFunction_GET_SELF(func) \ 32 | (((PyCFunctionObject *)func) -> m_self) 33 | #define PyCFunction_GET_FLAGS(func) \ 34 | (((PyCFunctionObject *)func) -> m_ml -> ml_flags) 35 | PyAPI_FUNC(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *); 36 | 37 | struct PyMethodDef { 38 | const char *ml_name; /* The name of the built-in function/method */ 39 | PyCFunction ml_meth; /* The C function that implements it */ 40 | int ml_flags; /* Combination of METH_xxx flags, which mostly 41 | describe the args expected by the C func */ 42 | const char *ml_doc; /* The __doc__ attribute, or NULL */ 43 | }; 44 | typedef struct PyMethodDef PyMethodDef; 45 | 46 | PyAPI_FUNC(PyObject *) Py_FindMethod(PyMethodDef[], PyObject *, const char *); 47 | 48 | #define PyCFunction_New(ML, SELF) PyCFunction_NewEx((ML), (SELF), NULL) 49 | PyAPI_FUNC(PyObject *) PyCFunction_NewEx(PyMethodDef *, PyObject *, 50 | PyObject *); 51 | 52 | /* Flag passed to newmethodobject */ 53 | #define METH_OLDARGS 0x0000 54 | #define METH_VARARGS 0x0001 55 | #define METH_KEYWORDS 0x0002 56 | /* METH_NOARGS and METH_O must not be combined with the flags above. */ 57 | #define METH_NOARGS 0x0004 58 | #define METH_O 0x0008 59 | 60 | /* METH_CLASS and METH_STATIC are a little different; these control 61 | the construction of methods for a class. These cannot be used for 62 | functions in modules. */ 63 | #define METH_CLASS 0x0010 64 | #define METH_STATIC 0x0020 65 | 66 | /* METH_COEXIST allows a method to be entered eventhough a slot has 67 | already filled the entry. When defined, the flag allows a separate 68 | method, "__contains__" for example, to coexist with a defined 69 | slot like sq_contains. */ 70 | 71 | #define METH_COEXIST 0x0040 72 | 73 | typedef struct PyMethodChain { 74 | PyMethodDef *methods; /* Methods of this type */ 75 | struct PyMethodChain *link; /* NULL or base type */ 76 | } PyMethodChain; 77 | 78 | PyAPI_FUNC(PyObject *) Py_FindMethodInChain(PyMethodChain *, PyObject *, 79 | const char *); 80 | 81 | typedef struct { 82 | PyObject_HEAD 83 | PyMethodDef *m_ml; /* Description of the C function to call */ 84 | PyObject *m_self; /* Passed as 'self' arg to the C func, can be NULL */ 85 | PyObject *m_module; /* The __module__ attribute, can be anything */ 86 | } PyCFunctionObject; 87 | 88 | PyAPI_FUNC(int) PyCFunction_ClearFreeList(void); 89 | 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | #endif /* !Py_METHODOBJECT_H */ 94 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/moduleobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Module object interface */ 3 | 4 | #ifndef Py_MODULEOBJECT_H 5 | #define Py_MODULEOBJECT_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | PyAPI_DATA(PyTypeObject) PyModule_Type; 11 | 12 | #define PyModule_Check(op) PyObject_TypeCheck(op, &PyModule_Type) 13 | #define PyModule_CheckExact(op) (Py_TYPE(op) == &PyModule_Type) 14 | 15 | PyAPI_FUNC(PyObject *) PyModule_New(const char *); 16 | PyAPI_FUNC(PyObject *) PyModule_GetDict(PyObject *); 17 | PyAPI_FUNC(char *) PyModule_GetName(PyObject *); 18 | PyAPI_FUNC(char *) PyModule_GetFilename(PyObject *); 19 | PyAPI_FUNC(void) _PyModule_Clear(PyObject *); 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | #endif /* !Py_MODULEOBJECT_H */ 25 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/node.h: -------------------------------------------------------------------------------- 1 | 2 | /* Parse tree node interface */ 3 | 4 | #ifndef Py_NODE_H 5 | #define Py_NODE_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef struct _node { 11 | short n_type; 12 | char *n_str; 13 | int n_lineno; 14 | int n_col_offset; 15 | int n_nchildren; 16 | struct _node *n_child; 17 | } node; 18 | 19 | PyAPI_FUNC(node *) PyNode_New(int type); 20 | PyAPI_FUNC(int) PyNode_AddChild(node *n, int type, 21 | char *str, int lineno, int col_offset); 22 | PyAPI_FUNC(void) PyNode_Free(node *n); 23 | PyAPI_FUNC(Py_ssize_t) _PyNode_SizeOf(node *n); 24 | 25 | /* Node access functions */ 26 | #define NCH(n) ((n)->n_nchildren) 27 | 28 | #define CHILD(n, i) (&(n)->n_child[i]) 29 | #define RCHILD(n, i) (CHILD(n, NCH(n) + i)) 30 | #define TYPE(n) ((n)->n_type) 31 | #define STR(n) ((n)->n_str) 32 | 33 | /* Assert that the type of a node is what we expect */ 34 | #define REQ(n, type) assert(TYPE(n) == (type)) 35 | 36 | PyAPI_FUNC(void) PyNode_ListTree(node *); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif /* !Py_NODE_H */ 42 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/osdefs.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_OSDEFS_H 2 | #define Py_OSDEFS_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | /* Operating system dependencies */ 9 | 10 | /* Mod by chrish: QNX has WATCOM, but isn't DOS */ 11 | #if !defined(__QNX__) 12 | #if defined(MS_WINDOWS) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__DJGPP__) || defined(PYOS_OS2) 13 | #if defined(PYOS_OS2) && defined(PYCC_GCC) 14 | #define MAXPATHLEN 260 15 | #define SEP '/' 16 | #define ALTSEP '\\' 17 | #else 18 | #define SEP '\\' 19 | #define ALTSEP '/' 20 | #define MAXPATHLEN 256 21 | #endif 22 | #define DELIM ';' 23 | #endif 24 | #endif 25 | 26 | #ifdef RISCOS 27 | #define SEP '.' 28 | #define MAXPATHLEN 256 29 | #define DELIM ',' 30 | #endif 31 | 32 | 33 | /* Filename separator */ 34 | #ifndef SEP 35 | #define SEP '/' 36 | #endif 37 | 38 | /* Max pathname length */ 39 | #ifdef __hpux 40 | #include 41 | #include 42 | #ifndef PATH_MAX 43 | #define PATH_MAX MAXPATHLEN 44 | #endif 45 | #endif 46 | 47 | #ifndef MAXPATHLEN 48 | #if defined(PATH_MAX) && PATH_MAX > 1024 49 | #define MAXPATHLEN PATH_MAX 50 | #else 51 | #define MAXPATHLEN 1024 52 | #endif 53 | #endif 54 | 55 | /* Search path entry delimiter */ 56 | #ifndef DELIM 57 | #define DELIM ':' 58 | #endif 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | #endif /* !Py_OSDEFS_H */ 64 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/parsetok.h: -------------------------------------------------------------------------------- 1 | 2 | /* Parser-tokenizer link interface */ 3 | 4 | #ifndef Py_PARSETOK_H 5 | #define Py_PARSETOK_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef struct { 11 | int error; 12 | const char *filename; 13 | int lineno; 14 | int offset; 15 | char *text; 16 | int token; 17 | int expected; 18 | } perrdetail; 19 | 20 | #if 0 21 | #define PyPARSE_YIELD_IS_KEYWORD 0x0001 22 | #endif 23 | 24 | #define PyPARSE_DONT_IMPLY_DEDENT 0x0002 25 | 26 | #if 0 27 | #define PyPARSE_WITH_IS_KEYWORD 0x0003 28 | #endif 29 | 30 | #define PyPARSE_PRINT_IS_FUNCTION 0x0004 31 | #define PyPARSE_UNICODE_LITERALS 0x0008 32 | 33 | 34 | 35 | PyAPI_FUNC(node *) PyParser_ParseString(const char *, grammar *, int, 36 | perrdetail *); 37 | PyAPI_FUNC(node *) PyParser_ParseFile (FILE *, const char *, grammar *, int, 38 | char *, char *, perrdetail *); 39 | 40 | PyAPI_FUNC(node *) PyParser_ParseStringFlags(const char *, grammar *, int, 41 | perrdetail *, int); 42 | PyAPI_FUNC(node *) PyParser_ParseFileFlags(FILE *, const char *, grammar *, 43 | int, char *, char *, 44 | perrdetail *, int); 45 | PyAPI_FUNC(node *) PyParser_ParseFileFlagsEx(FILE *, const char *, grammar *, 46 | int, char *, char *, 47 | perrdetail *, int *); 48 | 49 | PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename(const char *, 50 | const char *, 51 | grammar *, int, 52 | perrdetail *, int); 53 | PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilenameEx(const char *, 54 | const char *, 55 | grammar *, int, 56 | perrdetail *, int *); 57 | 58 | /* Note that he following function is defined in pythonrun.c not parsetok.c. */ 59 | PyAPI_FUNC(void) PyParser_SetError(perrdetail *); 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | #endif /* !Py_PARSETOK_H */ 65 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/patchlevel.h: -------------------------------------------------------------------------------- 1 | 2 | /* Newfangled version identification scheme. 3 | 4 | This scheme was added in Python 1.5.2b2; before that time, only PATCHLEVEL 5 | was available. To test for presence of the scheme, test for 6 | defined(PY_MAJOR_VERSION). 7 | 8 | When the major or minor version changes, the VERSION variable in 9 | configure.ac must also be changed. 10 | 11 | There is also (independent) API version information in modsupport.h. 12 | */ 13 | 14 | /* Values for PY_RELEASE_LEVEL */ 15 | #define PY_RELEASE_LEVEL_ALPHA 0xA 16 | #define PY_RELEASE_LEVEL_BETA 0xB 17 | #define PY_RELEASE_LEVEL_GAMMA 0xC /* For release candidates */ 18 | #define PY_RELEASE_LEVEL_FINAL 0xF /* Serial should be 0 here */ 19 | /* Higher for patch releases */ 20 | 21 | /* Version parsed out into numeric values */ 22 | /*--start constants--*/ 23 | #define PY_MAJOR_VERSION 2 24 | #define PY_MINOR_VERSION 7 25 | #define PY_MICRO_VERSION 12 26 | #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL 27 | #define PY_RELEASE_SERIAL 0 28 | 29 | /* Version as a string */ 30 | #define PY_VERSION "2.7.12" 31 | /*--end constants--*/ 32 | 33 | /* Subversion Revision number of this file (not of the repository). Empty 34 | since Mercurial migration. */ 35 | #define PY_PATCHLEVEL_REVISION "" 36 | 37 | /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. 38 | Use this for numeric comparisons, e.g. #if PY_VERSION_HEX >= ... */ 39 | #define PY_VERSION_HEX ((PY_MAJOR_VERSION << 24) | \ 40 | (PY_MINOR_VERSION << 16) | \ 41 | (PY_MICRO_VERSION << 8) | \ 42 | (PY_RELEASE_LEVEL << 4) | \ 43 | (PY_RELEASE_SERIAL << 0)) 44 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/pgen.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_PGEN_H 2 | #define Py_PGEN_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | /* Parser generator interface */ 9 | 10 | extern grammar *meta_grammar(void); 11 | 12 | struct _node; 13 | extern grammar *pgen(struct _node *); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | #endif /* !Py_PGEN_H */ 19 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/pgenheaders.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_PGENHEADERS_H 2 | #define Py_PGENHEADERS_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | /* Include files and extern declarations used by most of the parser. */ 9 | 10 | #include "Python.h" 11 | 12 | PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) 13 | Py_GCC_ATTRIBUTE((format(printf, 1, 2))); 14 | PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...) 15 | Py_GCC_ATTRIBUTE((format(printf, 1, 2))); 16 | 17 | #define addarc _Py_addarc 18 | #define addbit _Py_addbit 19 | #define adddfa _Py_adddfa 20 | #define addfirstsets _Py_addfirstsets 21 | #define addlabel _Py_addlabel 22 | #define addstate _Py_addstate 23 | #define delbitset _Py_delbitset 24 | #define dumptree _Py_dumptree 25 | #define findlabel _Py_findlabel 26 | #define mergebitset _Py_mergebitset 27 | #define meta_grammar _Py_meta_grammar 28 | #define newbitset _Py_newbitset 29 | #define newgrammar _Py_newgrammar 30 | #define pgen _Py_pgen 31 | #define printgrammar _Py_printgrammar 32 | #define printnonterminals _Py_printnonterminals 33 | #define printtree _Py_printtree 34 | #define samebitset _Py_samebitset 35 | #define showtree _Py_showtree 36 | #define tok_dump _Py_tok_dump 37 | #define translatelabels _Py_translatelabels 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | #endif /* !Py_PGENHEADERS_H */ 43 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/pyarena.h: -------------------------------------------------------------------------------- 1 | /* An arena-like memory interface for the compiler. 2 | */ 3 | 4 | #ifndef Py_PYARENA_H 5 | #define Py_PYARENA_H 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | typedef struct _arena PyArena; 12 | 13 | /* PyArena_New() and PyArena_Free() create a new arena and free it, 14 | respectively. Once an arena has been created, it can be used 15 | to allocate memory via PyArena_Malloc(). Pointers to PyObject can 16 | also be registered with the arena via PyArena_AddPyObject(), and the 17 | arena will ensure that the PyObjects stay alive at least until 18 | PyArena_Free() is called. When an arena is freed, all the memory it 19 | allocated is freed, the arena releases internal references to registered 20 | PyObject*, and none of its pointers are valid. 21 | XXX (tim) What does "none of its pointers are valid" mean? Does it 22 | XXX mean that pointers previously obtained via PyArena_Malloc() are 23 | XXX no longer valid? (That's clearly true, but not sure that's what 24 | XXX the text is trying to say.) 25 | 26 | PyArena_New() returns an arena pointer. On error, it 27 | returns a negative number and sets an exception. 28 | XXX (tim): Not true. On error, PyArena_New() actually returns NULL, 29 | XXX and looks like it may or may not set an exception (e.g., if the 30 | XXX internal PyList_New(0) returns NULL, PyArena_New() passes that on 31 | XXX and an exception is set; OTOH, if the internal 32 | XXX block_new(DEFAULT_BLOCK_SIZE) returns NULL, that's passed on but 33 | XXX an exception is not set in that case). 34 | */ 35 | PyAPI_FUNC(PyArena *) PyArena_New(void); 36 | PyAPI_FUNC(void) PyArena_Free(PyArena *); 37 | 38 | /* Mostly like malloc(), return the address of a block of memory spanning 39 | * `size` bytes, or return NULL (without setting an exception) if enough 40 | * new memory can't be obtained. Unlike malloc(0), PyArena_Malloc() with 41 | * size=0 does not guarantee to return a unique pointer (the pointer 42 | * returned may equal one or more other pointers obtained from 43 | * PyArena_Malloc()). 44 | * Note that pointers obtained via PyArena_Malloc() must never be passed to 45 | * the system free() or realloc(), or to any of Python's similar memory- 46 | * management functions. PyArena_Malloc()-obtained pointers remain valid 47 | * until PyArena_Free(ar) is called, at which point all pointers obtained 48 | * from the arena `ar` become invalid simultaneously. 49 | */ 50 | PyAPI_FUNC(void *) PyArena_Malloc(PyArena *, size_t size); 51 | 52 | /* This routine isn't a proper arena allocation routine. It takes 53 | * a PyObject* and records it so that it can be DECREFed when the 54 | * arena is freed. 55 | */ 56 | PyAPI_FUNC(int) PyArena_AddPyObject(PyArena *, PyObject *); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif /* !Py_PYARENA_H */ 63 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/pycapsule.h: -------------------------------------------------------------------------------- 1 | 2 | /* Capsule objects let you wrap a C "void *" pointer in a Python 3 | object. They're a way of passing data through the Python interpreter 4 | without creating your own custom type. 5 | 6 | Capsules are used for communication between extension modules. 7 | They provide a way for an extension module to export a C interface 8 | to other extension modules, so that extension modules can use the 9 | Python import mechanism to link to one another. 10 | 11 | For more information, please see "c-api/capsule.html" in the 12 | documentation. 13 | */ 14 | 15 | #ifndef Py_CAPSULE_H 16 | #define Py_CAPSULE_H 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | PyAPI_DATA(PyTypeObject) PyCapsule_Type; 22 | 23 | typedef void (*PyCapsule_Destructor)(PyObject *); 24 | 25 | #define PyCapsule_CheckExact(op) (Py_TYPE(op) == &PyCapsule_Type) 26 | 27 | 28 | PyAPI_FUNC(PyObject *) PyCapsule_New( 29 | void *pointer, 30 | const char *name, 31 | PyCapsule_Destructor destructor); 32 | 33 | PyAPI_FUNC(void *) PyCapsule_GetPointer(PyObject *capsule, const char *name); 34 | 35 | PyAPI_FUNC(PyCapsule_Destructor) PyCapsule_GetDestructor(PyObject *capsule); 36 | 37 | PyAPI_FUNC(const char *) PyCapsule_GetName(PyObject *capsule); 38 | 39 | PyAPI_FUNC(void *) PyCapsule_GetContext(PyObject *capsule); 40 | 41 | PyAPI_FUNC(int) PyCapsule_IsValid(PyObject *capsule, const char *name); 42 | 43 | PyAPI_FUNC(int) PyCapsule_SetPointer(PyObject *capsule, void *pointer); 44 | 45 | PyAPI_FUNC(int) PyCapsule_SetDestructor(PyObject *capsule, PyCapsule_Destructor destructor); 46 | 47 | PyAPI_FUNC(int) PyCapsule_SetName(PyObject *capsule, const char *name); 48 | 49 | PyAPI_FUNC(int) PyCapsule_SetContext(PyObject *capsule, void *context); 50 | 51 | PyAPI_FUNC(void *) PyCapsule_Import(const char *name, int no_block); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | #endif /* !Py_CAPSULE_H */ 57 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/pyconfig.h: -------------------------------------------------------------------------------- 1 | #ifdef __arm__ 2 | #include "pyconfig-armv7.h" 3 | #endif 4 | 5 | #ifdef __arm64__ 6 | #include "pyconfig-arm64.h" 7 | #endif 8 | 9 | #ifdef __i386__ 10 | #include "pyconfig-i386.h" 11 | #endif 12 | 13 | #ifdef __x86_64__ 14 | #include "pyconfig-x86_64.h" 15 | #endif -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/pyctype.h: -------------------------------------------------------------------------------- 1 | #ifndef PYCTYPE_H 2 | #define PYCTYPE_H 3 | 4 | #define PY_CTF_LOWER 0x01 5 | #define PY_CTF_UPPER 0x02 6 | #define PY_CTF_ALPHA (PY_CTF_LOWER|PY_CTF_UPPER) 7 | #define PY_CTF_DIGIT 0x04 8 | #define PY_CTF_ALNUM (PY_CTF_ALPHA|PY_CTF_DIGIT) 9 | #define PY_CTF_SPACE 0x08 10 | #define PY_CTF_XDIGIT 0x10 11 | 12 | PyAPI_DATA(const unsigned int) _Py_ctype_table[256]; 13 | 14 | /* Unlike their C counterparts, the following macros are not meant to 15 | * handle an int with any of the values [EOF, 0-UCHAR_MAX]. The argument 16 | * must be a signed/unsigned char. */ 17 | #define Py_ISLOWER(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_LOWER) 18 | #define Py_ISUPPER(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_UPPER) 19 | #define Py_ISALPHA(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALPHA) 20 | #define Py_ISDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_DIGIT) 21 | #define Py_ISXDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_XDIGIT) 22 | #define Py_ISALNUM(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALNUM) 23 | #define Py_ISSPACE(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_SPACE) 24 | 25 | PyAPI_DATA(const unsigned char) _Py_ctype_tolower[256]; 26 | PyAPI_DATA(const unsigned char) _Py_ctype_toupper[256]; 27 | 28 | #define Py_TOLOWER(c) (_Py_ctype_tolower[Py_CHARMASK(c)]) 29 | #define Py_TOUPPER(c) (_Py_ctype_toupper[Py_CHARMASK(c)]) 30 | 31 | #endif /* !PYCTYPE_H */ 32 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/pydebug.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_PYDEBUG_H 3 | #define Py_PYDEBUG_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_DATA(int) Py_DebugFlag; 9 | PyAPI_DATA(int) Py_VerboseFlag; 10 | PyAPI_DATA(int) Py_InteractiveFlag; 11 | PyAPI_DATA(int) Py_InspectFlag; 12 | PyAPI_DATA(int) Py_OptimizeFlag; 13 | PyAPI_DATA(int) Py_NoSiteFlag; 14 | PyAPI_DATA(int) Py_BytesWarningFlag; 15 | PyAPI_DATA(int) Py_UseClassExceptionsFlag; 16 | PyAPI_DATA(int) Py_FrozenFlag; 17 | PyAPI_DATA(int) Py_TabcheckFlag; 18 | PyAPI_DATA(int) Py_UnicodeFlag; 19 | PyAPI_DATA(int) Py_IgnoreEnvironmentFlag; 20 | PyAPI_DATA(int) Py_DivisionWarningFlag; 21 | PyAPI_DATA(int) Py_DontWriteBytecodeFlag; 22 | PyAPI_DATA(int) Py_NoUserSiteDirectory; 23 | /* _XXX Py_QnewFlag should go away in 3.0. It's true iff -Qnew is passed, 24 | on the command line, and is used in 2.2 by ceval.c to make all "/" divisions 25 | true divisions (which they will be in 3.0). */ 26 | PyAPI_DATA(int) _Py_QnewFlag; 27 | /* Warn about 3.x issues */ 28 | PyAPI_DATA(int) Py_Py3kWarningFlag; 29 | PyAPI_DATA(int) Py_HashRandomizationFlag; 30 | 31 | /* this is a wrapper around getenv() that pays attention to 32 | Py_IgnoreEnvironmentFlag. It should be used for getting variables like 33 | PYTHONPATH and PYTHONHOME from the environment */ 34 | #define Py_GETENV(s) (Py_IgnoreEnvironmentFlag ? NULL : getenv(s)) 35 | 36 | PyAPI_FUNC(void) Py_FatalError(const char *message); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif /* !Py_PYDEBUG_H */ 42 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/pyexpat.h: -------------------------------------------------------------------------------- 1 | /* Stuff to export relevant 'expat' entry points from pyexpat to other 2 | * parser modules, such as cElementTree. */ 3 | 4 | /* note: you must import expat.h before importing this module! */ 5 | 6 | #define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.0" 7 | #define PyExpat_CAPSULE_NAME "pyexpat.expat_CAPI" 8 | 9 | struct PyExpat_CAPI 10 | { 11 | char* magic; /* set to PyExpat_CAPI_MAGIC */ 12 | int size; /* set to sizeof(struct PyExpat_CAPI) */ 13 | int MAJOR_VERSION; 14 | int MINOR_VERSION; 15 | int MICRO_VERSION; 16 | /* pointers to selected expat functions. add new functions at 17 | the end, if needed */ 18 | const XML_LChar * (*ErrorString)(enum XML_Error code); 19 | enum XML_Error (*GetErrorCode)(XML_Parser parser); 20 | XML_Size (*GetErrorColumnNumber)(XML_Parser parser); 21 | XML_Size (*GetErrorLineNumber)(XML_Parser parser); 22 | enum XML_Status (*Parse)( 23 | XML_Parser parser, const char *s, int len, int isFinal); 24 | XML_Parser (*ParserCreate_MM)( 25 | const XML_Char *encoding, const XML_Memory_Handling_Suite *memsuite, 26 | const XML_Char *namespaceSeparator); 27 | void (*ParserFree)(XML_Parser parser); 28 | void (*SetCharacterDataHandler)( 29 | XML_Parser parser, XML_CharacterDataHandler handler); 30 | void (*SetCommentHandler)( 31 | XML_Parser parser, XML_CommentHandler handler); 32 | void (*SetDefaultHandlerExpand)( 33 | XML_Parser parser, XML_DefaultHandler handler); 34 | void (*SetElementHandler)( 35 | XML_Parser parser, XML_StartElementHandler start, 36 | XML_EndElementHandler end); 37 | void (*SetNamespaceDeclHandler)( 38 | XML_Parser parser, XML_StartNamespaceDeclHandler start, 39 | XML_EndNamespaceDeclHandler end); 40 | void (*SetProcessingInstructionHandler)( 41 | XML_Parser parser, XML_ProcessingInstructionHandler handler); 42 | void (*SetUnknownEncodingHandler)( 43 | XML_Parser parser, XML_UnknownEncodingHandler handler, 44 | void *encodingHandlerData); 45 | void (*SetUserData)(XML_Parser parser, void *userData); 46 | /* always add new stuff to the end! */ 47 | }; 48 | 49 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/pygetopt.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_PYGETOPT_H 3 | #define Py_PYGETOPT_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_DATA(int) _PyOS_opterr; 9 | PyAPI_DATA(int) _PyOS_optind; 10 | PyAPI_DATA(char *) _PyOS_optarg; 11 | 12 | PyAPI_FUNC(void) _PyOS_ResetGetOpt(void); 13 | PyAPI_FUNC(int) _PyOS_GetOpt(int argc, char **argv, char *optstring); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | #endif /* !Py_PYGETOPT_H */ 19 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/pymacconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef PYMACCONFIG_H 2 | #define PYMACCONFIG_H 3 | /* 4 | * This file moves some of the autoconf magic to compile-time 5 | * when building on MacOSX. This is needed for building 4-way 6 | * universal binaries and for 64-bit universal binaries because 7 | * the values redefined below aren't configure-time constant but 8 | * only compile-time constant in these scenarios. 9 | */ 10 | 11 | #if defined(__APPLE__) 12 | 13 | # undef SIZEOF_LONG 14 | # undef SIZEOF_PTHREAD_T 15 | # undef SIZEOF_SIZE_T 16 | # undef SIZEOF_TIME_T 17 | # undef SIZEOF_VOID_P 18 | # undef SIZEOF__BOOL 19 | # undef SIZEOF_UINTPTR_T 20 | # undef SIZEOF_PTHREAD_T 21 | # undef WORDS_BIGENDIAN 22 | # undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 23 | # undef DOUBLE_IS_BIG_ENDIAN_IEEE754 24 | # undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754 25 | # undef HAVE_GCC_ASM_FOR_X87 26 | 27 | # undef VA_LIST_IS_ARRAY 28 | # if defined(__LP64__) && defined(__x86_64__) 29 | # define VA_LIST_IS_ARRAY 1 30 | # endif 31 | 32 | # undef HAVE_LARGEFILE_SUPPORT 33 | # ifndef __LP64__ 34 | # define HAVE_LARGEFILE_SUPPORT 1 35 | # endif 36 | 37 | # undef SIZEOF_LONG 38 | # ifdef __LP64__ 39 | # define SIZEOF__BOOL 1 40 | # define SIZEOF__BOOL 1 41 | # define SIZEOF_LONG 8 42 | # define SIZEOF_PTHREAD_T 8 43 | # define SIZEOF_SIZE_T 8 44 | # define SIZEOF_TIME_T 8 45 | # define SIZEOF_VOID_P 8 46 | # define SIZEOF_UINTPTR_T 8 47 | # define SIZEOF_PTHREAD_T 8 48 | # else 49 | # ifdef __ppc__ 50 | # define SIZEOF__BOOL 4 51 | # else 52 | # define SIZEOF__BOOL 1 53 | # endif 54 | # define SIZEOF_LONG 4 55 | # define SIZEOF_PTHREAD_T 4 56 | # define SIZEOF_SIZE_T 4 57 | # define SIZEOF_TIME_T 4 58 | # define SIZEOF_VOID_P 4 59 | # define SIZEOF_UINTPTR_T 4 60 | # define SIZEOF_PTHREAD_T 4 61 | # endif 62 | 63 | # if defined(__LP64__) 64 | /* MacOSX 10.4 (the first release to support 64-bit code 65 | * at all) only supports 64-bit in the UNIX layer. 66 | * Therefore surpress the toolbox-glue in 64-bit mode. 67 | */ 68 | 69 | /* In 64-bit mode setpgrp always has no arguments, in 32-bit 70 | * mode that depends on the compilation environment 71 | */ 72 | # undef SETPGRP_HAVE_ARG 73 | 74 | # endif 75 | 76 | #ifdef __BIG_ENDIAN__ 77 | #define WORDS_BIGENDIAN 1 78 | #define DOUBLE_IS_BIG_ENDIAN_IEEE754 79 | #else 80 | #define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 81 | #endif /* __BIG_ENDIAN */ 82 | 83 | #ifdef __i386__ 84 | # define HAVE_GCC_ASM_FOR_X87 85 | #endif 86 | 87 | /* 88 | * The definition in pyconfig.h is only valid on the OS release 89 | * where configure ran on and not necessarily for all systems where 90 | * the executable can be used on. 91 | * 92 | * Specifically: OSX 10.4 has limited supported for '%zd', while 93 | * 10.5 has full support for '%zd'. A binary built on 10.5 won't 94 | * work properly on 10.4 unless we surpress the definition 95 | * of PY_FORMAT_SIZE_T 96 | */ 97 | #undef PY_FORMAT_SIZE_T 98 | 99 | 100 | #endif /* defined(_APPLE__) */ 101 | 102 | #endif /* PYMACCONFIG_H */ 103 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/pystrcmp.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_STRCMP_H 2 | #define Py_STRCMP_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_FUNC(int) PyOS_mystrnicmp(const char *, const char *, Py_ssize_t); 9 | PyAPI_FUNC(int) PyOS_mystricmp(const char *, const char *); 10 | 11 | #if defined(MS_WINDOWS) || defined(PYOS_OS2) 12 | #define PyOS_strnicmp strnicmp 13 | #define PyOS_stricmp stricmp 14 | #else 15 | #define PyOS_strnicmp PyOS_mystrnicmp 16 | #define PyOS_stricmp PyOS_mystricmp 17 | #endif 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif /* !Py_STRCMP_H */ 24 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/pystrtod.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_STRTOD_H 2 | #define Py_STRTOD_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | 9 | PyAPI_FUNC(double) PyOS_ascii_strtod(const char *str, char **ptr); 10 | PyAPI_FUNC(double) PyOS_ascii_atof(const char *str); 11 | 12 | /* Deprecated in 2.7 and 3.1. Will disappear in 2.8 (if it exists) and 3.2 */ 13 | PyAPI_FUNC(char *) PyOS_ascii_formatd(char *buffer, size_t buf_len, 14 | const char *format, double d); 15 | PyAPI_FUNC(double) PyOS_string_to_double(const char *str, 16 | char **endptr, 17 | PyObject *overflow_exception); 18 | 19 | /* The caller is responsible for calling PyMem_Free to free the buffer 20 | that's is returned. */ 21 | PyAPI_FUNC(char *) PyOS_double_to_string(double val, 22 | char format_code, 23 | int precision, 24 | int flags, 25 | int *type); 26 | 27 | PyAPI_FUNC(double) _Py_parse_inf_or_nan(const char *p, char **endptr); 28 | 29 | 30 | /* PyOS_double_to_string's "flags" parameter can be set to 0 or more of: */ 31 | #define Py_DTSF_SIGN 0x01 /* always add the sign */ 32 | #define Py_DTSF_ADD_DOT_0 0x02 /* if the result is an integer add ".0" */ 33 | #define Py_DTSF_ALT 0x04 /* "alternate" formatting. it's format_code 34 | specific */ 35 | 36 | /* PyOS_double_to_string's "type", if non-NULL, will be set to one of: */ 37 | #define Py_DTST_FINITE 0 38 | #define Py_DTST_INFINITE 1 39 | #define Py_DTST_NAN 2 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif /* !Py_STRTOD_H */ 46 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/pythread.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_PYTHREAD_H 3 | #define Py_PYTHREAD_H 4 | 5 | typedef void *PyThread_type_lock; 6 | typedef void *PyThread_type_sema; 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | PyAPI_FUNC(void) PyThread_init_thread(void); 13 | PyAPI_FUNC(long) PyThread_start_new_thread(void (*)(void *), void *); 14 | PyAPI_FUNC(void) PyThread_exit_thread(void); 15 | PyAPI_FUNC(long) PyThread_get_thread_ident(void); 16 | 17 | PyAPI_FUNC(PyThread_type_lock) PyThread_allocate_lock(void); 18 | PyAPI_FUNC(void) PyThread_free_lock(PyThread_type_lock); 19 | PyAPI_FUNC(int) PyThread_acquire_lock(PyThread_type_lock, int); 20 | #define WAIT_LOCK 1 21 | #define NOWAIT_LOCK 0 22 | PyAPI_FUNC(void) PyThread_release_lock(PyThread_type_lock); 23 | 24 | PyAPI_FUNC(size_t) PyThread_get_stacksize(void); 25 | PyAPI_FUNC(int) PyThread_set_stacksize(size_t); 26 | 27 | /* Thread Local Storage (TLS) API */ 28 | PyAPI_FUNC(int) PyThread_create_key(void); 29 | PyAPI_FUNC(void) PyThread_delete_key(int); 30 | PyAPI_FUNC(int) PyThread_set_key_value(int, void *); 31 | PyAPI_FUNC(void *) PyThread_get_key_value(int); 32 | PyAPI_FUNC(void) PyThread_delete_key_value(int key); 33 | 34 | /* Cleanup after a fork */ 35 | PyAPI_FUNC(void) PyThread_ReInitTLS(void); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif /* !Py_PYTHREAD_H */ 42 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/rangeobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Range object interface */ 3 | 4 | #ifndef Py_RANGEOBJECT_H 5 | #define Py_RANGEOBJECT_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | /* This is about the type 'xrange', not the built-in function range(), which 11 | returns regular lists. */ 12 | 13 | /* 14 | A range object represents an integer range. This is an immutable object; 15 | a range cannot change its value after creation. 16 | 17 | Range objects behave like the corresponding tuple objects except that 18 | they are represented by a start, stop, and step datamembers. 19 | */ 20 | 21 | PyAPI_DATA(PyTypeObject) PyRange_Type; 22 | 23 | #define PyRange_Check(op) (Py_TYPE(op) == &PyRange_Type) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif /* !Py_RANGEOBJECT_H */ 29 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/setobject.h: -------------------------------------------------------------------------------- 1 | /* Set object interface */ 2 | 3 | #ifndef Py_SETOBJECT_H 4 | #define Py_SETOBJECT_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | 10 | /* 11 | There are three kinds of slots in the table: 12 | 13 | 1. Unused: key == NULL 14 | 2. Active: key != NULL and key != dummy 15 | 3. Dummy: key == dummy 16 | 17 | Note: .pop() abuses the hash field of an Unused or Dummy slot to 18 | hold a search finger. The hash field of Unused or Dummy slots has 19 | no meaning otherwise. 20 | */ 21 | 22 | #define PySet_MINSIZE 8 23 | 24 | typedef struct { 25 | long hash; /* cached hash code for the entry key */ 26 | PyObject *key; 27 | } setentry; 28 | 29 | 30 | /* 31 | This data structure is shared by set and frozenset objects. 32 | */ 33 | 34 | typedef struct _setobject PySetObject; 35 | struct _setobject { 36 | PyObject_HEAD 37 | 38 | Py_ssize_t fill; /* # Active + # Dummy */ 39 | Py_ssize_t used; /* # Active */ 40 | 41 | /* The table contains mask + 1 slots, and that's a power of 2. 42 | * We store the mask instead of the size because the mask is more 43 | * frequently needed. 44 | */ 45 | Py_ssize_t mask; 46 | 47 | /* table points to smalltable for small tables, else to 48 | * additional malloc'ed memory. table is never NULL! This rule 49 | * saves repeated runtime null-tests. 50 | */ 51 | setentry *table; 52 | setentry *(*lookup)(PySetObject *so, PyObject *key, long hash); 53 | setentry smalltable[PySet_MINSIZE]; 54 | 55 | long hash; /* only used by frozenset objects */ 56 | PyObject *weakreflist; /* List of weak references */ 57 | }; 58 | 59 | PyAPI_DATA(PyTypeObject) PySet_Type; 60 | PyAPI_DATA(PyTypeObject) PyFrozenSet_Type; 61 | 62 | /* Invariants for frozensets: 63 | * data is immutable. 64 | * hash is the hash of the frozenset or -1 if not computed yet. 65 | * Invariants for sets: 66 | * hash is -1 67 | */ 68 | 69 | #define PyFrozenSet_CheckExact(ob) (Py_TYPE(ob) == &PyFrozenSet_Type) 70 | #define PyAnySet_CheckExact(ob) \ 71 | (Py_TYPE(ob) == &PySet_Type || Py_TYPE(ob) == &PyFrozenSet_Type) 72 | #define PyAnySet_Check(ob) \ 73 | (Py_TYPE(ob) == &PySet_Type || Py_TYPE(ob) == &PyFrozenSet_Type || \ 74 | PyType_IsSubtype(Py_TYPE(ob), &PySet_Type) || \ 75 | PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type)) 76 | #define PySet_Check(ob) \ 77 | (Py_TYPE(ob) == &PySet_Type || \ 78 | PyType_IsSubtype(Py_TYPE(ob), &PySet_Type)) 79 | #define PyFrozenSet_Check(ob) \ 80 | (Py_TYPE(ob) == &PyFrozenSet_Type || \ 81 | PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type)) 82 | 83 | PyAPI_FUNC(PyObject *) PySet_New(PyObject *); 84 | PyAPI_FUNC(PyObject *) PyFrozenSet_New(PyObject *); 85 | PyAPI_FUNC(Py_ssize_t) PySet_Size(PyObject *anyset); 86 | #define PySet_GET_SIZE(so) (((PySetObject *)(so))->used) 87 | PyAPI_FUNC(int) PySet_Clear(PyObject *set); 88 | PyAPI_FUNC(int) PySet_Contains(PyObject *anyset, PyObject *key); 89 | PyAPI_FUNC(int) PySet_Discard(PyObject *set, PyObject *key); 90 | PyAPI_FUNC(int) PySet_Add(PyObject *set, PyObject *key); 91 | PyAPI_FUNC(int) _PySet_Next(PyObject *set, Py_ssize_t *pos, PyObject **key); 92 | PyAPI_FUNC(int) _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, long *hash); 93 | PyAPI_FUNC(PyObject *) PySet_Pop(PyObject *set); 94 | PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable); 95 | 96 | #ifdef __cplusplus 97 | } 98 | #endif 99 | #endif /* !Py_SETOBJECT_H */ 100 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/sliceobject.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_SLICEOBJECT_H 2 | #define Py_SLICEOBJECT_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | /* The unique ellipsis object "..." */ 8 | 9 | PyAPI_DATA(PyObject) _Py_EllipsisObject; /* Don't use this directly */ 10 | 11 | #define Py_Ellipsis (&_Py_EllipsisObject) 12 | 13 | /* Slice object interface */ 14 | 15 | /* 16 | 17 | A slice object containing start, stop, and step data members (the 18 | names are from range). After much talk with Guido, it was decided to 19 | let these be any arbitrary python type. Py_None stands for omitted values. 20 | */ 21 | 22 | typedef struct { 23 | PyObject_HEAD 24 | PyObject *start, *stop, *step; /* not NULL */ 25 | } PySliceObject; 26 | 27 | PyAPI_DATA(PyTypeObject) PySlice_Type; 28 | PyAPI_DATA(PyTypeObject) PyEllipsis_Type; 29 | 30 | #define PySlice_Check(op) (Py_TYPE(op) == &PySlice_Type) 31 | 32 | PyAPI_FUNC(PyObject *) PySlice_New(PyObject* start, PyObject* stop, 33 | PyObject* step); 34 | PyAPI_FUNC(PyObject *) _PySlice_FromIndices(Py_ssize_t start, Py_ssize_t stop); 35 | PyAPI_FUNC(int) PySlice_GetIndices(PySliceObject *r, Py_ssize_t length, 36 | Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step); 37 | PyAPI_FUNC(int) PySlice_GetIndicesEx(PySliceObject *r, Py_ssize_t length, 38 | Py_ssize_t *start, Py_ssize_t *stop, 39 | Py_ssize_t *step, Py_ssize_t *slicelength); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | #endif /* !Py_SLICEOBJECT_H */ 45 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/structmember.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_STRUCTMEMBER_H 2 | #define Py_STRUCTMEMBER_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | /* Interface to map C struct members to Python object attributes */ 9 | 10 | #include /* For offsetof */ 11 | 12 | /* The offsetof() macro calculates the offset of a structure member 13 | in its structure. Unfortunately this cannot be written down 14 | portably, hence it is provided by a Standard C header file. 15 | For pre-Standard C compilers, here is a version that usually works 16 | (but watch out!): */ 17 | 18 | #ifndef offsetof 19 | #define offsetof(type, member) ( (int) & ((type*)0) -> member ) 20 | #endif 21 | 22 | /* An array of memberlist structures defines the name, type and offset 23 | of selected members of a C structure. These can be read by 24 | PyMember_Get() and set by PyMember_Set() (except if their READONLY flag 25 | is set). The array must be terminated with an entry whose name 26 | pointer is NULL. */ 27 | 28 | struct memberlist { 29 | /* Obsolete version, for binary backwards compatibility */ 30 | char *name; 31 | int type; 32 | int offset; 33 | int flags; 34 | }; 35 | 36 | typedef struct PyMemberDef { 37 | /* Current version, use this */ 38 | char *name; 39 | int type; 40 | Py_ssize_t offset; 41 | int flags; 42 | char *doc; 43 | } PyMemberDef; 44 | 45 | /* Types */ 46 | #define T_SHORT 0 47 | #define T_INT 1 48 | #define T_LONG 2 49 | #define T_FLOAT 3 50 | #define T_DOUBLE 4 51 | #define T_STRING 5 52 | #define T_OBJECT 6 53 | /* XXX the ordering here is weird for binary compatibility */ 54 | #define T_CHAR 7 /* 1-character string */ 55 | #define T_BYTE 8 /* 8-bit signed int */ 56 | /* unsigned variants: */ 57 | #define T_UBYTE 9 58 | #define T_USHORT 10 59 | #define T_UINT 11 60 | #define T_ULONG 12 61 | 62 | /* Added by Jack: strings contained in the structure */ 63 | #define T_STRING_INPLACE 13 64 | 65 | /* Added by Lillo: bools contained in the structure (assumed char) */ 66 | #define T_BOOL 14 67 | 68 | #define T_OBJECT_EX 16 /* Like T_OBJECT, but raises AttributeError 69 | when the value is NULL, instead of 70 | converting to None. */ 71 | #ifdef HAVE_LONG_LONG 72 | #define T_LONGLONG 17 73 | #define T_ULONGLONG 18 74 | #endif /* HAVE_LONG_LONG */ 75 | 76 | #define T_PYSSIZET 19 /* Py_ssize_t */ 77 | 78 | 79 | /* Flags */ 80 | #define READONLY 1 81 | #define RO READONLY /* Shorthand */ 82 | #define READ_RESTRICTED 2 83 | #define PY_WRITE_RESTRICTED 4 84 | #define RESTRICTED (READ_RESTRICTED | PY_WRITE_RESTRICTED) 85 | 86 | 87 | /* Obsolete API, for binary backwards compatibility */ 88 | PyAPI_FUNC(PyObject *) PyMember_Get(const char *, struct memberlist *, const char *); 89 | PyAPI_FUNC(int) PyMember_Set(char *, struct memberlist *, const char *, PyObject *); 90 | 91 | /* Current API, use this */ 92 | PyAPI_FUNC(PyObject *) PyMember_GetOne(const char *, struct PyMemberDef *); 93 | PyAPI_FUNC(int) PyMember_SetOne(char *, struct PyMemberDef *, PyObject *); 94 | 95 | 96 | #ifdef __cplusplus 97 | } 98 | #endif 99 | #endif /* !Py_STRUCTMEMBER_H */ 100 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/structseq.h: -------------------------------------------------------------------------------- 1 | 2 | /* Tuple object interface */ 3 | 4 | #ifndef Py_STRUCTSEQ_H 5 | #define Py_STRUCTSEQ_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef struct PyStructSequence_Field { 11 | char *name; 12 | char *doc; 13 | } PyStructSequence_Field; 14 | 15 | typedef struct PyStructSequence_Desc { 16 | char *name; 17 | char *doc; 18 | struct PyStructSequence_Field *fields; 19 | int n_in_sequence; 20 | } PyStructSequence_Desc; 21 | 22 | extern char* PyStructSequence_UnnamedField; 23 | 24 | PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type, 25 | PyStructSequence_Desc *desc); 26 | 27 | PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type); 28 | 29 | typedef struct { 30 | PyObject_VAR_HEAD 31 | PyObject *ob_item[1]; 32 | } PyStructSequence; 33 | 34 | /* Macro, *only* to be used to fill in brand new objects */ 35 | #define PyStructSequence_SET_ITEM(op, i, v) \ 36 | (((PyStructSequence *)(op))->ob_item[i] = v) 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif /* !Py_STRUCTSEQ_H */ 42 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/symtable.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_SYMTABLE_H 2 | #define Py_SYMTABLE_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock } 9 | _Py_block_ty; 10 | 11 | struct _symtable_entry; 12 | 13 | struct symtable { 14 | const char *st_filename; /* name of file being compiled */ 15 | struct _symtable_entry *st_cur; /* current symbol table entry */ 16 | struct _symtable_entry *st_top; /* module entry */ 17 | PyObject *st_symbols; /* dictionary of symbol table entries */ 18 | PyObject *st_stack; /* stack of namespace info */ 19 | PyObject *st_global; /* borrowed ref to MODULE in st_symbols */ 20 | int st_nblocks; /* number of blocks */ 21 | PyObject *st_private; /* name of current class or NULL */ 22 | PyFutureFeatures *st_future; /* module's future features */ 23 | }; 24 | 25 | typedef struct _symtable_entry { 26 | PyObject_HEAD 27 | PyObject *ste_id; /* int: key in st_symbols */ 28 | PyObject *ste_symbols; /* dict: name to flags */ 29 | PyObject *ste_name; /* string: name of block */ 30 | PyObject *ste_varnames; /* list of variable names */ 31 | PyObject *ste_children; /* list of child ids */ 32 | _Py_block_ty ste_type; /* module, class, or function */ 33 | int ste_unoptimized; /* false if namespace is optimized */ 34 | int ste_nested; /* true if block is nested */ 35 | unsigned ste_free : 1; /* true if block has free variables */ 36 | unsigned ste_child_free : 1; /* true if a child block has free vars, 37 | including free refs to globals */ 38 | unsigned ste_generator : 1; /* true if namespace is a generator */ 39 | unsigned ste_varargs : 1; /* true if block has varargs */ 40 | unsigned ste_varkeywords : 1; /* true if block has varkeywords */ 41 | unsigned ste_returns_value : 1; /* true if namespace uses return with 42 | an argument */ 43 | int ste_lineno; /* first line of block */ 44 | int ste_opt_lineno; /* lineno of last exec or import * */ 45 | int ste_tmpname; /* counter for listcomp temp vars */ 46 | struct symtable *ste_table; 47 | } PySTEntryObject; 48 | 49 | PyAPI_DATA(PyTypeObject) PySTEntry_Type; 50 | 51 | #define PySTEntry_Check(op) (Py_TYPE(op) == &PySTEntry_Type) 52 | 53 | PyAPI_FUNC(int) PyST_GetScope(PySTEntryObject *, PyObject *); 54 | 55 | PyAPI_FUNC(struct symtable *) PySymtable_Build(mod_ty, const char *, 56 | PyFutureFeatures *); 57 | PyAPI_FUNC(PySTEntryObject *) PySymtable_Lookup(struct symtable *, void *); 58 | 59 | PyAPI_FUNC(void) PySymtable_Free(struct symtable *); 60 | 61 | /* Flags for def-use information */ 62 | 63 | #define DEF_GLOBAL 1 /* global stmt */ 64 | #define DEF_LOCAL 2 /* assignment in code block */ 65 | #define DEF_PARAM 2<<1 /* formal parameter */ 66 | #define USE 2<<2 /* name is used */ 67 | #define DEF_FREE 2<<3 /* name used but not defined in nested block */ 68 | #define DEF_FREE_CLASS 2<<4 /* free variable from class's method */ 69 | #define DEF_IMPORT 2<<5 /* assignment occurred via import */ 70 | 71 | #define DEF_BOUND (DEF_LOCAL | DEF_PARAM | DEF_IMPORT) 72 | 73 | /* GLOBAL_EXPLICIT and GLOBAL_IMPLICIT are used internally by the symbol 74 | table. GLOBAL is returned from PyST_GetScope() for either of them. 75 | It is stored in ste_symbols at bits 12-14. 76 | */ 77 | #define SCOPE_OFF 11 78 | #define SCOPE_MASK 7 79 | 80 | #define LOCAL 1 81 | #define GLOBAL_EXPLICIT 2 82 | #define GLOBAL_IMPLICIT 3 83 | #define FREE 4 84 | #define CELL 5 85 | 86 | /* The following three names are used for the ste_unoptimized bit field */ 87 | #define OPT_IMPORT_STAR 1 88 | #define OPT_EXEC 2 89 | #define OPT_BARE_EXEC 4 90 | #define OPT_TOPLEVEL 8 /* top-level names, including eval and exec */ 91 | 92 | #define GENERATOR 1 93 | #define GENERATOR_EXPRESSION 2 94 | 95 | #ifdef __cplusplus 96 | } 97 | #endif 98 | #endif /* !Py_SYMTABLE_H */ 99 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/sysmodule.h: -------------------------------------------------------------------------------- 1 | 2 | /* System module interface */ 3 | 4 | #ifndef Py_SYSMODULE_H 5 | #define Py_SYSMODULE_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | PyAPI_FUNC(PyObject *) PySys_GetObject(char *); 11 | PyAPI_FUNC(int) PySys_SetObject(char *, PyObject *); 12 | PyAPI_FUNC(FILE *) PySys_GetFile(char *, FILE *); 13 | PyAPI_FUNC(void) PySys_SetArgv(int, char **); 14 | PyAPI_FUNC(void) PySys_SetArgvEx(int, char **, int); 15 | PyAPI_FUNC(void) PySys_SetPath(char *); 16 | 17 | PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) 18 | Py_GCC_ATTRIBUTE((format(printf, 1, 2))); 19 | PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...) 20 | Py_GCC_ATTRIBUTE((format(printf, 1, 2))); 21 | 22 | PyAPI_FUNC(void) PySys_ResetWarnOptions(void); 23 | PyAPI_FUNC(void) PySys_AddWarnOption(char *); 24 | PyAPI_FUNC(int) PySys_HasWarnOptions(void); 25 | 26 | PyAPI_FUNC(size_t) _PySys_GetSizeOf(PyObject *); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif /* !Py_SYSMODULE_H */ 32 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/timefuncs.h: -------------------------------------------------------------------------------- 1 | /* timefuncs.h 2 | */ 3 | 4 | /* Utility function related to timemodule.c. */ 5 | 6 | #ifndef TIMEFUNCS_H 7 | #define TIMEFUNCS_H 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | 13 | /* Cast double x to time_t, but raise ValueError if x is too large 14 | * to fit in a time_t. ValueError is set on return iff the return 15 | * value is (time_t)-1 and PyErr_Occurred(). 16 | */ 17 | PyAPI_FUNC(time_t) _PyTime_DoubleToTimet(double x); 18 | 19 | /* Get the current time since the epoch in seconds */ 20 | PyAPI_FUNC(double) _PyTime_FloatTime(void); 21 | 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | #endif /* TIMEFUNCS_H */ 27 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/token.h: -------------------------------------------------------------------------------- 1 | 2 | /* Token types */ 3 | 4 | #ifndef Py_TOKEN_H 5 | #define Py_TOKEN_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #undef TILDE /* Prevent clash of our definition with system macro. Ex AIX, ioctl.h */ 11 | 12 | #define ENDMARKER 0 13 | #define NAME 1 14 | #define NUMBER 2 15 | #define STRING 3 16 | #define NEWLINE 4 17 | #define INDENT 5 18 | #define DEDENT 6 19 | #define LPAR 7 20 | #define RPAR 8 21 | #define LSQB 9 22 | #define RSQB 10 23 | #define COLON 11 24 | #define COMMA 12 25 | #define SEMI 13 26 | #define PLUS 14 27 | #define MINUS 15 28 | #define STAR 16 29 | #define SLASH 17 30 | #define VBAR 18 31 | #define AMPER 19 32 | #define LESS 20 33 | #define GREATER 21 34 | #define EQUAL 22 35 | #define DOT 23 36 | #define PERCENT 24 37 | #define BACKQUOTE 25 38 | #define LBRACE 26 39 | #define RBRACE 27 40 | #define EQEQUAL 28 41 | #define NOTEQUAL 29 42 | #define LESSEQUAL 30 43 | #define GREATEREQUAL 31 44 | #define TILDE 32 45 | #define CIRCUMFLEX 33 46 | #define LEFTSHIFT 34 47 | #define RIGHTSHIFT 35 48 | #define DOUBLESTAR 36 49 | #define PLUSEQUAL 37 50 | #define MINEQUAL 38 51 | #define STAREQUAL 39 52 | #define SLASHEQUAL 40 53 | #define PERCENTEQUAL 41 54 | #define AMPEREQUAL 42 55 | #define VBAREQUAL 43 56 | #define CIRCUMFLEXEQUAL 44 57 | #define LEFTSHIFTEQUAL 45 58 | #define RIGHTSHIFTEQUAL 46 59 | #define DOUBLESTAREQUAL 47 60 | #define DOUBLESLASH 48 61 | #define DOUBLESLASHEQUAL 49 62 | #define AT 50 63 | /* Don't forget to update the table _PyParser_TokenNames in tokenizer.c! */ 64 | #define OP 51 65 | #define ERRORTOKEN 52 66 | #define N_TOKENS 53 67 | 68 | /* Special definitions for cooperation with parser */ 69 | 70 | #define NT_OFFSET 256 71 | 72 | #define ISTERMINAL(x) ((x) < NT_OFFSET) 73 | #define ISNONTERMINAL(x) ((x) >= NT_OFFSET) 74 | #define ISEOF(x) ((x) == ENDMARKER) 75 | 76 | 77 | PyAPI_DATA(char *) _PyParser_TokenNames[]; /* Token names */ 78 | PyAPI_FUNC(int) PyToken_OneChar(int); 79 | PyAPI_FUNC(int) PyToken_TwoChars(int, int); 80 | PyAPI_FUNC(int) PyToken_ThreeChars(int, int, int); 81 | 82 | #ifdef __cplusplus 83 | } 84 | #endif 85 | #endif /* !Py_TOKEN_H */ 86 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/traceback.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_TRACEBACK_H 3 | #define Py_TRACEBACK_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | struct _frame; 9 | 10 | /* Traceback interface */ 11 | 12 | typedef struct _traceback { 13 | PyObject_HEAD 14 | struct _traceback *tb_next; 15 | struct _frame *tb_frame; 16 | int tb_lasti; 17 | int tb_lineno; 18 | } PyTracebackObject; 19 | 20 | PyAPI_FUNC(int) PyTraceBack_Here(struct _frame *); 21 | PyAPI_FUNC(int) PyTraceBack_Print(PyObject *, PyObject *); 22 | PyAPI_FUNC(int) _Py_DisplaySourceLine(PyObject *, const char *, int, int); 23 | 24 | /* Reveal traceback type so we can typecheck traceback objects */ 25 | PyAPI_DATA(PyTypeObject) PyTraceBack_Type; 26 | #define PyTraceBack_Check(v) (Py_TYPE(v) == &PyTraceBack_Type) 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif /* !Py_TRACEBACK_H */ 32 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/tupleobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Tuple object interface */ 3 | 4 | #ifndef Py_TUPLEOBJECT_H 5 | #define Py_TUPLEOBJECT_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | /* 11 | Another generally useful object type is a tuple of object pointers. 12 | For Python, this is an immutable type. C code can change the tuple items 13 | (but not their number), and even use tuples are general-purpose arrays of 14 | object references, but in general only brand new tuples should be mutated, 15 | not ones that might already have been exposed to Python code. 16 | 17 | *** WARNING *** PyTuple_SetItem does not increment the new item's reference 18 | count, but does decrement the reference count of the item it replaces, 19 | if not nil. It does *decrement* the reference count if it is *not* 20 | inserted in the tuple. Similarly, PyTuple_GetItem does not increment the 21 | returned item's reference count. 22 | */ 23 | 24 | typedef struct { 25 | PyObject_VAR_HEAD 26 | PyObject *ob_item[1]; 27 | 28 | /* ob_item contains space for 'ob_size' elements. 29 | * Items must normally not be NULL, except during construction when 30 | * the tuple is not yet visible outside the function that builds it. 31 | */ 32 | } PyTupleObject; 33 | 34 | PyAPI_DATA(PyTypeObject) PyTuple_Type; 35 | 36 | #define PyTuple_Check(op) \ 37 | PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS) 38 | #define PyTuple_CheckExact(op) (Py_TYPE(op) == &PyTuple_Type) 39 | 40 | PyAPI_FUNC(PyObject *) PyTuple_New(Py_ssize_t size); 41 | PyAPI_FUNC(Py_ssize_t) PyTuple_Size(PyObject *); 42 | PyAPI_FUNC(PyObject *) PyTuple_GetItem(PyObject *, Py_ssize_t); 43 | PyAPI_FUNC(int) PyTuple_SetItem(PyObject *, Py_ssize_t, PyObject *); 44 | PyAPI_FUNC(PyObject *) PyTuple_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t); 45 | PyAPI_FUNC(int) _PyTuple_Resize(PyObject **, Py_ssize_t); 46 | PyAPI_FUNC(PyObject *) PyTuple_Pack(Py_ssize_t, ...); 47 | PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *); 48 | 49 | /* Macro, trading safety for speed */ 50 | #define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i]) 51 | #define PyTuple_GET_SIZE(op) Py_SIZE(op) 52 | 53 | /* Macro, *only* to be used to fill in brand new tuples */ 54 | #define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v) 55 | 56 | PyAPI_FUNC(int) PyTuple_ClearFreeList(void); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | #endif /* !Py_TUPLEOBJECT_H */ 62 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/ucnhash.h: -------------------------------------------------------------------------------- 1 | /* Unicode name database interface */ 2 | 3 | #ifndef Py_UCNHASH_H 4 | #define Py_UCNHASH_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | /* revised ucnhash CAPI interface (exported through a "wrapper") */ 10 | 11 | #define PyUnicodeData_CAPSULE_NAME "unicodedata.ucnhash_CAPI" 12 | 13 | typedef struct { 14 | 15 | /* Size of this struct */ 16 | int size; 17 | 18 | /* Get name for a given character code. Returns non-zero if 19 | success, zero if not. Does not set Python exceptions. 20 | If self is NULL, data come from the default version of the database. 21 | If it is not NULL, it should be a unicodedata.ucd_X_Y_Z object */ 22 | int (*getname)(PyObject *self, Py_UCS4 code, char* buffer, int buflen); 23 | 24 | /* Get character code for a given name. Same error handling 25 | as for getname. */ 26 | int (*getcode)(PyObject *self, const char* name, int namelen, Py_UCS4* code); 27 | 28 | } _PyUnicode_Name_CAPI; 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | #endif /* !Py_UCNHASH_H */ 34 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/warnings.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_WARNINGS_H 2 | #define Py_WARNINGS_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | PyAPI_FUNC(void) _PyWarnings_Init(void); 8 | 9 | PyAPI_FUNC(int) PyErr_WarnEx(PyObject *, const char *, Py_ssize_t); 10 | PyAPI_FUNC(int) PyErr_WarnExplicit(PyObject *, const char *, const char *, int, 11 | const char *, PyObject *); 12 | 13 | #define PyErr_WarnPy3k(msg, stacklevel) \ 14 | (Py_Py3kWarningFlag ? PyErr_WarnEx(PyExc_DeprecationWarning, msg, stacklevel) : 0) 15 | 16 | /* DEPRECATED: Use PyErr_WarnEx() instead. */ 17 | #define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1) 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | #endif /* !Py_WARNINGS_H */ 23 | 24 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Headers/weakrefobject.h: -------------------------------------------------------------------------------- 1 | /* Weak references objects for Python. */ 2 | 3 | #ifndef Py_WEAKREFOBJECT_H 4 | #define Py_WEAKREFOBJECT_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | 10 | typedef struct _PyWeakReference PyWeakReference; 11 | 12 | /* PyWeakReference is the base struct for the Python ReferenceType, ProxyType, 13 | * and CallableProxyType. 14 | */ 15 | struct _PyWeakReference { 16 | PyObject_HEAD 17 | 18 | /* The object to which this is a weak reference, or Py_None if none. 19 | * Note that this is a stealth reference: wr_object's refcount is 20 | * not incremented to reflect this pointer. 21 | */ 22 | PyObject *wr_object; 23 | 24 | /* A callable to invoke when wr_object dies, or NULL if none. */ 25 | PyObject *wr_callback; 26 | 27 | /* A cache for wr_object's hash code. As usual for hashes, this is -1 28 | * if the hash code isn't known yet. 29 | */ 30 | long hash; 31 | 32 | /* If wr_object is weakly referenced, wr_object has a doubly-linked NULL- 33 | * terminated list of weak references to it. These are the list pointers. 34 | * If wr_object goes away, wr_object is set to Py_None, and these pointers 35 | * have no meaning then. 36 | */ 37 | PyWeakReference *wr_prev; 38 | PyWeakReference *wr_next; 39 | }; 40 | 41 | PyAPI_DATA(PyTypeObject) _PyWeakref_RefType; 42 | PyAPI_DATA(PyTypeObject) _PyWeakref_ProxyType; 43 | PyAPI_DATA(PyTypeObject) _PyWeakref_CallableProxyType; 44 | 45 | #define PyWeakref_CheckRef(op) PyObject_TypeCheck(op, &_PyWeakref_RefType) 46 | #define PyWeakref_CheckRefExact(op) \ 47 | (Py_TYPE(op) == &_PyWeakref_RefType) 48 | #define PyWeakref_CheckProxy(op) \ 49 | ((Py_TYPE(op) == &_PyWeakref_ProxyType) || \ 50 | (Py_TYPE(op) == &_PyWeakref_CallableProxyType)) 51 | 52 | #define PyWeakref_Check(op) \ 53 | (PyWeakref_CheckRef(op) || PyWeakref_CheckProxy(op)) 54 | 55 | 56 | PyAPI_FUNC(PyObject *) PyWeakref_NewRef(PyObject *ob, 57 | PyObject *callback); 58 | PyAPI_FUNC(PyObject *) PyWeakref_NewProxy(PyObject *ob, 59 | PyObject *callback); 60 | PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref); 61 | 62 | PyAPI_FUNC(Py_ssize_t) _PyWeakref_GetWeakrefCount(PyWeakReference *head); 63 | 64 | PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self); 65 | 66 | /* Explanation for the Py_REFCNT() check: when a weakref's target is part 67 | of a long chain of deallocations which triggers the trashcan mechanism, 68 | clearing the weakrefs can be delayed long after the target's refcount 69 | has dropped to zero. In the meantime, code accessing the weakref will 70 | be able to "see" the target object even though it is supposed to be 71 | unreachable. See issue #16602. */ 72 | 73 | #define PyWeakref_GET_OBJECT(ref) \ 74 | (Py_REFCNT(((PyWeakReference *)(ref))->wr_object) > 0 \ 75 | ? ((PyWeakReference *)(ref))->wr_object \ 76 | : Py_None) 77 | 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | #endif /* !Py_WEAKREFOBJECT_H */ 83 | -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Python: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pieter/YoutubeDL-iOS/1e7e17e0362f32a70744ece44573c306631cd739/Frameworks/Python.framework/Versions/2.7/Python -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Resources/include/python2.7/pyconfig.h: -------------------------------------------------------------------------------- 1 | #ifdef __arm__ 2 | #include "pyconfig-armv7.h" 3 | #endif 4 | 5 | #ifdef __arm64__ 6 | #include "pyconfig-arm64.h" 7 | #endif 8 | 9 | #ifdef __i386__ 10 | #include "pyconfig-i386.h" 11 | #endif 12 | 13 | #ifdef __x86_64__ 14 | #include "pyconfig-x86_64.h" 15 | #endif -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/2.7/Resources/lib/python27.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pieter/YoutubeDL-iOS/1e7e17e0362f32a70744ece44573c306631cd739/Frameworks/Python.framework/Versions/2.7/Resources/lib/python27.zip -------------------------------------------------------------------------------- /Frameworks/Python.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | 2.7 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /Python/pytest.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | import youtube_dl 3 | from youtube_dl.extractor import youtube 4 | import json 5 | import traceback 6 | 7 | def get_info(url): 8 | try: 9 | ytb = youtube_dl.YoutubeDL({ 10 | "nocheckcertificate": True 11 | }) 12 | info = ytb.extract_info(url, download=False) 13 | return json.dumps(info, sort_keys=True, indent=4) 14 | except Exception: 15 | print "Error extracting info:" 16 | print(traceback.format_exc()) 17 | raise 18 | 19 | def download(url, output_file, progress_cb): 20 | def progress_hook(event): 21 | progress_cb(json.dumps(event, sort_keys=True, indent=4)) 22 | 23 | try: 24 | print "Going to download %s to %s" % (url, output_file) 25 | ytb = youtube_dl.YoutubeDL({ 26 | "nocheckcertificate": True, 27 | "progress_hooks": [progress_hook], 28 | "restrictfilenames": True, 29 | "nooverwrites": True, 30 | "format": "best[ext=mp4]", 31 | "outtmpl": unicode(output_file) 32 | }) 33 | 34 | ytb.download([unicode(url)]) 35 | except Exception: 36 | print "Error downloading file:" 37 | print(traceback.format_exc()) 38 | raise 39 | 40 | def load_playlist(url, update_cb, context=None): 41 | try: 42 | print 43 | ytb = youtube_dl.YoutubeDL({"nocheckcertificate": True}) 44 | extractor = youtube.YoutubePlaylistIE() 45 | extractor.set_downloader(ytb) 46 | data = extractor.extract(url) 47 | entries = data.pop("entries") 48 | 49 | update_cb(context, json.dumps({ 50 | 'type': 'initial', 51 | 'data': data 52 | })) 53 | 54 | for entry in entries: 55 | update_cb(context, json.dumps({ 56 | "type": "entry", 57 | "data": entry 58 | })) 59 | except Exception: 60 | print "Error Loading Playlist:" 61 | print(traceback.format_exc()) 62 | raise 63 | -------------------------------------------------------------------------------- /Python/test-extractor.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import json 3 | 4 | def callback(context, str): 5 | data = json.loads(str) 6 | print data 7 | 8 | pytest.load_playlist("https://www.youtube.com/playlist?list=PLBsP89CPrMeMKjHnLfO3WAhiOOxiv5Xqo", callback) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | YoutubeDL-iOS is a wrapper around [youtube-dl](https://rg3.github.io/youtube-dl/) and allows you to download YouTube movies to your iOS device. Because it uses youtube-dl, it'll always try to get the best quality, and should work with most youtube movies. 2 | 3 | ## How do I use this? 4 | 5 | This isn't distributed through the App Store, and is unlikely to get approved by Apple. So, you'll have to build it yourself and put it on your own iOS device. It should support both iPhones and iPads. 6 | 7 | Once you have it running, press the '+' and paste in the URL of a YouTube playlist. You should then be able to download all the movies in that playlist. It doesn't support individual movies, or YouTube users yet. 8 | 9 | ## How does this differ from existing projects that do the same? 10 | 11 | Mainly because it uses youtube-dl. 12 | 13 | ## This code is ugly! 14 | 15 | Yup, it's the first time I touched Cocoa stuff since 2009 or so. Never used Swift before, and only spent a few hours on this. 16 | 17 | ## Why did you check in a copy of Python? It's huge! 18 | 19 | Yeah, would be great to fix this. It uses [Python-Apple-support](https://github.com/pybee/Python-Apple-support), so we can possibly download a copy from github instead. I wanted to make it relatively easy to get started with this. 20 | 21 | ## Why don't you use the official YouTube API? 22 | 23 | The official API requires an API key, and I'm a bit hesitant to use that with a project like this. 24 | 25 | ## I'd like to have feature X, Y, ... 26 | 27 | Great, I'm open to all contributions! -------------------------------------------------------------------------------- /YoutubeDL.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /YoutubeDL.xcodeproj/xcuserdata/pdebie.xcuserdatad/xcschemes/YoutubeDL.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /YoutubeDL.xcodeproj/xcuserdata/pdebie.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | YoutubeDL.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 7705444A1D9FFB8000A8EFF0 16 | 17 | primary 18 | 19 | 20 | 770544601D9FFB8100A8EFF0 21 | 22 | primary 23 | 24 | 25 | 7705446B1D9FFB8100A8EFF0 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /YoutubeDL/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // YoutubeDL 4 | // 5 | // Created by Pieter de Bie on 01/10/2016. 6 | // Copyright © 2016 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import AVFoundation 11 | 12 | @UIApplicationMain 13 | class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate { 14 | 15 | var window: UIWindow? 16 | 17 | 18 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 19 | // Override point for customization after application launch. 20 | let splitViewController = self.window!.rootViewController as! UISplitViewController 21 | let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as! UINavigationController 22 | navigationController.topViewController!.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem 23 | splitViewController.delegate = self 24 | print("Download manager: \(DownloadManager.sharedDownloadManager)") 25 | 26 | do { 27 | try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback) 28 | } catch { 29 | print("Error setting type: \(error)") 30 | } 31 | 32 | 33 | return true 34 | } 35 | 36 | func applicationWillResignActive(_ application: UIApplication) { 37 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 38 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 39 | } 40 | 41 | func applicationDidEnterBackground(_ application: UIApplication) { 42 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 43 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 44 | } 45 | 46 | func applicationWillEnterForeground(_ application: UIApplication) { 47 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 48 | } 49 | 50 | func applicationDidBecomeActive(_ application: UIApplication) { 51 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 52 | } 53 | 54 | func applicationWillTerminate(_ application: UIApplication) { 55 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 56 | } 57 | 58 | // MARK: - Split view 59 | 60 | func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController:UIViewController, onto primaryViewController:UIViewController) -> Bool { 61 | guard let secondaryAsNavController = secondaryViewController as? UINavigationController else { return false } 62 | guard let topAsDetailController = secondaryAsNavController.topViewController as? PlaylistViewController else { return false } 63 | // if topAsDetailController.detailItem == nil { 64 | // // Return true to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded. 65 | // return true 66 | // } 67 | return true 68 | } 69 | 70 | } 71 | 72 | -------------------------------------------------------------------------------- /YoutubeDL/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /YoutubeDL/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /YoutubeDL/DownloadManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DownloadManager.swift 3 | // YoutubeDL 4 | // 5 | // Created by Pieter de Bie on 01/10/2016. 6 | // Copyright © 2016 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Dispatch 11 | 12 | class DownloadManager { 13 | 14 | static let sharedDownloadManager = DownloadManager() 15 | 16 | 17 | var queue = DispatchQueue(label: "Python", qos: DispatchQoS.utility) 18 | var activeVideo: Video? 19 | var updateCallback: ((DownloadProgress) -> ())? 20 | 21 | init() { 22 | queue.async { 23 | YDL_initialize() 24 | YDL_setProgressCallback { data in 25 | let update = DownloadProgress(dict: data!) 26 | if let video = self.activeVideo { 27 | video.progress = update; 28 | } 29 | if let updateCb = self.updateCallback { 30 | DispatchQueue.main.async { 31 | updateCb(update) 32 | } 33 | } 34 | } 35 | } 36 | } 37 | 38 | func refreshPlaylist(playlist: Playlist, onUpdate: @escaping () -> ()) { 39 | queue.async { 40 | playlist.state = .Loading 41 | YDL_playlistDataForUrl(playlist.url, { (data) in 42 | print("Have playlist data: \(data)") 43 | let type = data!["type"]! as! String 44 | let attrs = data!["data"]! as! [String: String] 45 | 46 | if type == "initial" { 47 | playlist.id = attrs["id"] 48 | playlist.title = attrs["title"]! 49 | DispatchQueue.main.async(execute: onUpdate) 50 | print("Updated playlist attrs \(playlist.id) \(playlist.title)") 51 | } else if type == "entry" { 52 | let video = Video(id: attrs["id"]!, title: attrs["title"]!) 53 | playlist.addVideo(video: video) 54 | DispatchQueue.main.async(execute: onUpdate) 55 | } 56 | }) 57 | DispatchQueue.main.async { 58 | playlist.state = .Loaded 59 | onUpdate() 60 | } 61 | 62 | } 63 | } 64 | 65 | func downloadVideo(video: Video, onUpdate: @escaping (DownloadProgress) -> ()) { 66 | video.progress = DownloadProgress(status: .Queued) 67 | queue.async { 68 | print("Strating download for \(video.id)") 69 | self.activeVideo = video 70 | self.updateCallback = onUpdate 71 | video.progress = DownloadProgress(status: .Preparing) 72 | DispatchQueue.main.async { onUpdate(video.progress!) } 73 | YDL_downloadVideo(video.url, video.downloadLocation()) 74 | video.progress = nil 75 | self.activeVideo = nil 76 | self.updateCallback = nil 77 | print("Done with download for \(video.id)") 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /YoutubeDL/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UIStatusBarTintParameters 32 | 33 | UINavigationBar 34 | 35 | Style 36 | UIBarStyleDefault 37 | Translucent 38 | 39 | 40 | 41 | UISupportedInterfaceOrientations 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationLandscapeLeft 45 | UIInterfaceOrientationLandscapeRight 46 | 47 | UISupportedInterfaceOrientations~ipad 48 | 49 | UIInterfaceOrientationPortrait 50 | UIInterfaceOrientationPortraitUpsideDown 51 | UIInterfaceOrientationLandscapeLeft 52 | UIInterfaceOrientationLandscapeRight 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /YoutubeDL/PythonBridge.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | // This module is not Thread-safe; You should make sure 4 | // to always call it from the same thread. 5 | // All these calls are blocking. 6 | 7 | // Call before calling any of the functions below 8 | void YDL_initialize(); 9 | 10 | 11 | // Downloading of videos, require a global progress function 12 | typedef void (^YDL_progressUpdate)(NSDictionary *updateData); 13 | void YDL_setProgressCallback(YDL_progressUpdate callback); 14 | void YDL_downloadVideo(NSURL *url, NSURL *filePath); 15 | 16 | // Extracting playlist data, can accept local progress 17 | void YDL_playlistDataForUrl(NSURL *url, YDL_progressUpdate callback); 18 | -------------------------------------------------------------------------------- /YoutubeDL/PythonBridge.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+PythonBridge.m 3 | // YoutubeDL 4 | // 5 | // Created by Pieter de Bie on 01/10/2016. 6 | // Copyright © 2016 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | #import "PythonBridge.h" 10 | #import 11 | 12 | static PyObject *getModule(char *moduleName) { 13 | PyObject *modName = PyString_FromString(moduleName); 14 | PyObject *module = PyImport_Import(modName); 15 | Py_DECREF(modName); 16 | 17 | return module; 18 | } 19 | 20 | static PyObject *getModuleFn(char *mod, char *fn) { 21 | PyObject *module = getModule(mod); 22 | PyObject *fnStr = PyString_FromString(fn); 23 | 24 | PyObject *function = PyObject_GetAttr(module, fnStr); 25 | Py_DecRef(fnStr); 26 | Py_DecRef(module); 27 | 28 | return function; 29 | } 30 | 31 | static YDL_progressUpdate progressUpdate; 32 | static PyObject *module; 33 | 34 | static NSDictionary *parseJSON(char *json) { 35 | NSData *data = [NSData dataWithBytes:json length:strlen(json)]; 36 | 37 | NSError *error; 38 | NSDictionary *result = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error]; 39 | if (error) { 40 | NSLog(@"Error deserializing JSON: %@", error); 41 | return NULL; 42 | } else { 43 | return result; 44 | } 45 | } 46 | 47 | static PyObject *callback(PyObject *o, PyObject *args) { 48 | NSLog(@"Callback ran!"); 49 | 50 | char *status; 51 | PyArg_ParseTuple(args, "s", &status); 52 | if (progressUpdate) { 53 | progressUpdate(parseJSON(status)); 54 | } 55 | 56 | Py_RETURN_NONE; 57 | } 58 | 59 | PyMethodDef progressCallback = { "progressCallback", callback, METH_VARARGS, NULL }; 60 | 61 | void YDL_setProgressCallback(YDL_progressUpdate callback) { 62 | progressUpdate = callback; 63 | } 64 | 65 | 66 | static PyObject *playlistCallback(PyObject *o, PyObject *args) { 67 | PyObject *capsule; 68 | char *strData; 69 | PyArg_ParseTuple(args, "Os", &capsule, &strData); 70 | void *cbPtr = PyCapsule_GetPointer(capsule, NULL); 71 | 72 | NSDictionary *data = parseJSON(strData); 73 | YDL_progressUpdate updater = (__bridge YDL_progressUpdate)cbPtr; 74 | updater(data); 75 | 76 | Py_RETURN_NONE; 77 | } 78 | 79 | PyMethodDef playlistCallbackDef = { "playlistCallback", playlistCallback, METH_VARARGS, NULL }; 80 | 81 | 82 | 83 | void YDL_initialize() { 84 | NSArray * bundles = [NSBundle allBundles]; 85 | for (NSBundle *bundle in bundles) { 86 | NSLog(@"Found bundle: %@ %@", bundle, [bundle bundleIdentifier]); 87 | } 88 | 89 | NSString *path = [[NSBundle mainBundle] resourcePath]; 90 | NSString *pythonHome = [path stringByAppendingPathComponent:@"PythonHome"]; 91 | 92 | Py_SetPythonHome((char *)[pythonHome UTF8String]); 93 | Py_Initialize(); 94 | // Get the module, so that youtube-dl is loaded ASAP, even if we don't need it yet. 95 | module = getModule("pytest"); 96 | NSLog(@"Python initialized"); 97 | } 98 | 99 | void YDL_playlistDataForUrl(NSURL *url, YDL_progressUpdate callback) { 100 | PyObject *function = getModuleFn("pytest", "load_playlist"); 101 | 102 | PyObject *context = PyCapsule_New((__bridge void*)callback, NULL, NULL); 103 | PyObject *progress = PyCFunction_New(&playlistCallbackDef, NULL); 104 | 105 | PyObject_CallFunction(function, "sOO", [[url absoluteString] UTF8String], progress, context); 106 | } 107 | 108 | void YDL_downloadVideo(NSURL *url, NSURL *filePath) { 109 | PyObject *function = getModuleFn("pytest", "download"); 110 | PyObject *progress = PyCFunction_New(&progressCallback, NULL); 111 | 112 | NSLog(@"Going to download video %@ to: %@", url, filePath); 113 | PyObject_CallFunction(function, "ssO", [[url absoluteString] UTF8String], [[filePath path] UTF8String], progress); 114 | NSLog(@"Done from ObjC"); 115 | } 116 | -------------------------------------------------------------------------------- /YoutubeDL/VideoViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VideoViewCell.swift 3 | // YoutubeDL 4 | // 5 | // Created by Pieter de Bie on 03/10/2016. 6 | // Copyright © 2016 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class VideoViewCell: UITableViewCell { 12 | @IBOutlet weak var title: UILabel! 13 | @IBOutlet weak var detail: UILabel! 14 | @IBOutlet weak var thumbnail: UIImageView! 15 | 16 | func detailText(video: Video) -> String { 17 | if video.hasBeenDownloaded() { 18 | if (video.watchedPosition == 0) { 19 | return "\(video.time) - NEW" 20 | } else { 21 | return "\(video.time) - Watched up to \(video.watchedPosition / 60):\(video.watchedPosition % 60)" 22 | } 23 | } 24 | 25 | if let progress = video.progress { 26 | switch progress.status { 27 | case .Preparing: 28 | return "Preparing for Download" 29 | case .Queued: 30 | return "Queued" 31 | default: 32 | return "Downloading \(Int((progress.progress) * 100))% - \(Int(progress.speed / 1024))KB/s" 33 | } 34 | } 35 | 36 | if video.hasPartial() { 37 | return "\(video.time) -- Partially Downloaded. Tap to resume." 38 | } 39 | return video.duration == 0 ? "" : "\(video.time)" 40 | } 41 | 42 | func updateFrom(video: Video) { 43 | title.text = video.title 44 | detail.text = detailText(video: video) 45 | thumbnail.sd_setImage(with: URL(string: "https://i.ytimg.com/vi/\(video.id)/maxresdefault.jpg")!) 46 | thumbnail.alpha = video.hasBeenDownloaded() ? 1 : 0.2 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /YoutubeDL/YoutubeDL-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import "PythonBridge.h" 6 | -------------------------------------------------------------------------------- /YoutubeDL/YoutubeModels/DataStore.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DataStore.swift 3 | // YoutubeDL 4 | // 5 | // Created by Pieter de Bie on 01/10/2016. 6 | // Copyright © 2016 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | func prefPath() -> String { 12 | let dir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first! 13 | return dir.appendingPathComponent("playlists.plist").path 14 | } 15 | 16 | 17 | class DataStore { 18 | 19 | static let sharedStore = DataStore() 20 | var playlists: [Playlist] 21 | 22 | init() { 23 | playlists = [] 24 | playlists = loadFromDisk() 25 | } 26 | 27 | func addPlaylist(url: URL) -> Playlist { 28 | let playlist = Playlist(url: url) 29 | playlists.append(playlist) 30 | return playlist 31 | } 32 | 33 | func remove(playlist: Playlist) { 34 | playlists.remove(at: playlists.index(of: playlist)!) 35 | saveToDisk() 36 | } 37 | 38 | func loadFromDisk() -> [Playlist] { 39 | print("Loading preferences from \(prefPath())") 40 | if let playlists = NSKeyedUnarchiver.unarchiveObject(withFile: prefPath()) as? [Playlist] { 41 | return playlists 42 | } else { 43 | return [] 44 | } 45 | } 46 | 47 | func saveToDisk() { 48 | NSKeyedArchiver.archiveRootObject(playlists, toFile: prefPath()) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /YoutubeDL/YoutubeModels/DownloadProgress.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DownloadProgress.swift 3 | // YoutubeDL 4 | // 5 | // Created by Pieter de Bie on 02/10/2016. 6 | // Copyright © 2016 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class DownloadProgress : NSObject { 12 | var downloadedBytes = 0 13 | var totalBytes = 0 14 | var speed = 0 15 | var status = Status.Queued 16 | 17 | enum Status { 18 | case Queued 19 | case Preparing 20 | case Downloading 21 | } 22 | 23 | var progress: Float { 24 | return Float(downloadedBytes) / Float(totalBytes) 25 | } 26 | 27 | init(status: Status) { 28 | self.status = status 29 | } 30 | 31 | init(dict: [AnyHashable: Any]) { 32 | status = .Downloading 33 | downloadedBytes = Int(dict["downloaded_bytes"]! as! NSNumber) 34 | speed = Int(dict["speed"] as? NSNumber ?? 0) 35 | totalBytes = Int(dict["total_bytes"]! as! NSNumber) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /YoutubeDL/YoutubeModels/Playlist.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Playlist.swift 3 | // YoutubeDL 4 | // 5 | // Created by Pieter de Bie on 01/10/2016. 6 | // Copyright © 2016 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | final class Playlist : NSObject, NSCoding { 12 | 13 | var state = Status.Loaded 14 | var videos = [Video]() 15 | 16 | var title: String? 17 | var id: String? 18 | var url: URL 19 | 20 | enum Status { 21 | case Loading 22 | case Loaded 23 | } 24 | 25 | init(url: URL) { 26 | self.url = url 27 | } 28 | 29 | required convenience init(coder decoder: NSCoder) { 30 | self.init(url: decoder.decodeObject(forKey: "url") as! URL) 31 | title = decoder.decodeObject(forKey: "title") as? String 32 | videos = decoder.decodeObject(forKey: "videos") as! [Video] 33 | id = decoder.decodeObject(forKey: "id") as? String 34 | } 35 | 36 | func addVideo(video: Video) { 37 | if findVideo(id: video.id) == nil { 38 | videos.append(video); 39 | } 40 | } 41 | 42 | func findVideo(id: String) -> Video? { 43 | return videos.first { $0.id == id } 44 | } 45 | 46 | func updateFromJson(json: [String: AnyObject]) { 47 | title = json["title"] as? String 48 | id = json["id"] as! String? 49 | 50 | let entries = json["entries"]! as! [[String: AnyObject]] 51 | let videos = entries.map { Video.fromJson(json: $0) } 52 | // Keep old video if we already have it, since it include played state etc. 53 | self.videos = videos.map { findVideo(id: $0.id) ?? $0 } 54 | } 55 | 56 | class func fromJson(json: [String: AnyObject]) -> Playlist { 57 | let playlist = Playlist(url: URL(string: json["webpage_url"]! as! String)!) 58 | playlist.updateFromJson(json: json) 59 | 60 | return playlist 61 | } 62 | 63 | func deleteFiles() { 64 | videos.forEach { (video) in 65 | video.deleteFile() 66 | } 67 | } 68 | 69 | func encode(with coder: NSCoder) { 70 | coder.encode(title, forKey: "title") 71 | coder.encode(id, forKey: "id") 72 | coder.encode(url, forKey: "url") 73 | coder.encode(videos, forKey: "videos") 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /YoutubeDL/YoutubeModels/Video.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Video.swift 3 | // YoutubeDL 4 | // 5 | // Created by Pieter de Bie on 01/10/2016. 6 | // Copyright © 2016 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | final class Video : NSObject, NSCoding { 12 | var id: String 13 | var title: String 14 | var progress: DownloadProgress? 15 | var duration = 0 16 | var watchedPosition = 0 17 | 18 | init(id: String, title: String) { 19 | self.id = id 20 | self.title = title 21 | } 22 | 23 | required convenience init(coder decoder: NSCoder) { 24 | let id = decoder.decodeObject(forKey: "id") as! String 25 | let title = decoder.decodeObject(forKey: "title") as! String 26 | self.init(id: id, title: title) 27 | duration = decoder.decodeInteger(forKey: "duration") 28 | watchedPosition = decoder.decodeInteger(forKey: "watchedPosition") 29 | } 30 | 31 | func encode(with coder: NSCoder) { 32 | coder.encode(title, forKey: "title") 33 | coder.encode(id, forKey: "id") 34 | coder.encode(duration, forKey: "duration") 35 | coder.encode(watchedPosition, forKey: "watchedPosition") 36 | } 37 | 38 | func downloadLocation() -> URL { 39 | let docDir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first! 40 | return docDir.appendingPathComponent("videos").appendingPathComponent("\(id).mp4") 41 | } 42 | 43 | var url: URL { 44 | return URL(string: "https://www.youtube.com/watch?v=\(id)")! 45 | } 46 | 47 | var partialDownloadLocation: URL { 48 | return downloadLocation().appendingPathExtension("part") 49 | } 50 | 51 | func deleteFile() { 52 | do { 53 | if hasBeenDownloaded() { 54 | try FileManager.default.removeItem(at: downloadLocation()) 55 | print("Checking \(partialDownloadLocation.path)") 56 | } 57 | if FileManager.default.fileExists(atPath: partialDownloadLocation.path) { 58 | print("Removing partial file \(partialDownloadLocation)") 59 | try FileManager.default.removeItem(at: partialDownloadLocation) 60 | } 61 | } catch let error as NSError { 62 | print("Error deleting file: \(error)") 63 | } 64 | } 65 | 66 | var time: String { 67 | return "\(duration / 60):\(duration % 60)" 68 | } 69 | 70 | func hasPartial() -> Bool { 71 | return FileManager.default.fileExists(atPath: partialDownloadLocation.path) 72 | } 73 | 74 | func hasBeenDownloaded() -> Bool { 75 | return FileManager.default.fileExists(atPath: downloadLocation().path) 76 | } 77 | 78 | class func fromJson(json: [String: AnyObject]) -> Video { 79 | print("Deserialize from json! \(json)") 80 | let video = Video(id: json["id"]! as! String, title: json["title"]! as! String) 81 | video.duration = Int(json["duration"]! as! NSNumber) 82 | return video 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /YoutubeDL/sample.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pieter/YoutubeDL-iOS/1e7e17e0362f32a70744ece44573c306631cd739/YoutubeDL/sample.mp4 -------------------------------------------------------------------------------- /YoutubeDLTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /YoutubeDLTests/PlaylistTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PlaylistTests.swift 3 | // YoutubeDL 4 | // 5 | // Created by Pieter de Bie on 02/10/2016. 6 | // Copyright © 2016 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | import Foundation 11 | 12 | class PlaylistTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testInit() { 25 | let playlist = Playlist(url: URL(string: "http://youtube.com")!) 26 | 27 | XCTAssertEqual(playlist.url.absoluteString, "http://youtube.com") 28 | XCTAssertEqual(playlist.videos, []) 29 | } 30 | 31 | func testSerialization() { 32 | let originalPlaylist = Playlist(url: URL(string: "http://test.com")!) 33 | originalPlaylist.state = .Loading 34 | originalPlaylist.title = "some title" 35 | originalPlaylist.id = "main id" 36 | 37 | let serialized = NSKeyedArchiver.archivedData(withRootObject: originalPlaylist) 38 | let deserializedPlayist = NSKeyedUnarchiver.unarchiveObject(with: serialized)! as! Playlist 39 | 40 | XCTAssertEqual(originalPlaylist.url, deserializedPlayist.url) 41 | XCTAssertEqual(originalPlaylist.id, deserializedPlayist.id) 42 | XCTAssertEqual(originalPlaylist.title, deserializedPlayist.title) 43 | } 44 | 45 | func testUpdate() { 46 | 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /YoutubeDLTests/YoutubeDLTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YoutubeDLTests.swift 3 | // YoutubeDLTests 4 | // 5 | // Created by Pieter de Bie on 01/10/2016. 6 | // Copyright © 2016 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import YoutubeDL 11 | 12 | class YoutubeDLTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /YoutubeDLUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /YoutubeDLUITests/YoutubeDLUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YoutubeDLUITests.swift 3 | // YoutubeDLUITests 4 | // 5 | // Created by Pieter de Bie on 01/10/2016. 6 | // Copyright © 2016 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class YoutubeDLUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | --------------------------------------------------------------------------------