├── PySideExample.pro
├── README
├── android
├── .classpath
├── .project
├── .settings
│ ├── org.eclipse.jdt.core.prefs
│ └── org.eclipse.jdt.launching.prefs
├── AndroidManifest.xml
├── build.xml
├── libs
│ ├── armeabi-v7a
│ │ └── gdbserver
│ ├── armeabi
│ │ ├── gdbserver
│ │ └── libcom_googlecode_android_scripting_Exec.so
│ ├── guava-r06.jar
│ ├── libGoogleAnalytics.jar
│ ├── locale_platform.jar
│ └── script.jar
├── proguard-project.txt
├── project.properties
├── res
│ ├── drawable-ldpi
│ │ └── icon.png
│ ├── drawable
│ │ ├── icon.png
│ │ └── logo.png
│ ├── layout
│ │ └── splash.xml
│ ├── raw
│ │ ├── my_python_project.zip
│ │ └── python_27.zip
│ ├── values-de
│ │ └── strings.xml
│ ├── values-el
│ │ └── strings.xml
│ ├── values-es
│ │ └── strings.xml
│ ├── values-et
│ │ └── strings.xml
│ ├── values-fa
│ │ └── strings.xml
│ ├── values-fr
│ │ └── strings.xml
│ ├── values-id
│ │ └── strings.xml
│ ├── values-it
│ │ └── strings.xml
│ ├── values-ja
│ │ └── strings.xml
│ ├── values-ms
│ │ └── strings.xml
│ ├── values-nb
│ │ └── strings.xml
│ ├── values-nl
│ │ └── strings.xml
│ ├── values-pl
│ │ └── strings.xml
│ ├── values-pt-rBR
│ │ └── strings.xml
│ ├── values-ro
│ │ └── strings.xml
│ ├── values-rs
│ │ └── strings.xml
│ ├── values-ru
│ │ └── strings.xml
│ ├── values-zh-rCN
│ │ └── strings.xml
│ ├── values-zh-rTW
│ │ └── strings.xml
│ └── values
│ │ ├── libs.xml
│ │ └── strings.xml
├── src
│ └── org
│ │ └── kde
│ │ └── necessitas
│ │ ├── ministro
│ │ ├── IMinistro.aidl
│ │ └── IMinistroCallback.aidl
│ │ └── origo
│ │ ├── GlobalConstants.java
│ │ ├── QtActivity.java
│ │ ├── QtApplication.java
│ │ └── Utils.java
└── version.xml
├── build_dependencies
└── python
│ ├── include
│ ├── 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.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
│ └── libpython2.7.so
├── main.cpp
├── main.h
└── rename_project.sh
/PySideExample.pro:
--------------------------------------------------------------------------------
1 | QT += core gui declarative
2 |
3 | TARGET = PySideExample
4 |
5 | INCLUDEPATH += $$PWD/build_dependencies/python/include/
6 | LIBS += -L$$PWD/build_dependencies/python -lpython2.7
7 |
8 | QMAKE_CXXFLAGS += -std=gnu++0x
9 | SOURCES += main.cpp
10 |
11 | HEADERS += \
12 | main.h
13 | OTHER_FILES += \
14 | android/src/org/kde/necessitas/ministro/IMinistro.aidl \
15 | android/src/org/kde/necessitas/ministro/IMinistroCallback.aidl \
16 | android/src/org/kde/necessitas/origo/QtApplication.java \
17 | android/src/org/kde/necessitas/origo/QtActivity.java \
18 | android/src/org/kde/necessitas/origo/GlobalConstants.java \
19 | android/src/org/kde/necessitas/origo/Utils.java \
20 | android/version.xml \
21 | android/res/raw/my_python_project.zip \
22 | android/res/raw/python_27.zip \
23 | android/res/raw/python_extras_27.zip \
24 | android/res/values-el/strings.xml \
25 | android/res/values-rs/strings.xml \
26 | android/res/values-ro/strings.xml \
27 | android/res/values-it/strings.xml \
28 | android/res/values-zh-rCN/strings.xml \
29 | android/res/values-nl/strings.xml \
30 | android/res/drawable-hdpi/icon.png \
31 | android/res/drawable-mdpi/icon.png \
32 | android/res/values-nb/strings.xml \
33 | android/res/values-pt-rBR/strings.xml \
34 | android/res/values-ms/strings.xml \
35 | android/res/values-fr/strings.xml \
36 | android/res/drawable/logo.png \
37 | android/res/drawable/icon.png \
38 | android/res/values-fa/strings.xml \
39 | android/res/values-zh-rTW/strings.xml \
40 | android/res/values/strings.xml \
41 | android/res/values/libs.xml \
42 | android/res/layout/splash.xml \
43 | android/res/values-es/strings.xml \
44 | android/res/values-ru/strings.xml \
45 | android/res/values-de/strings.xml \
46 | android/res/drawable-ldpi/icon.png \
47 | android/res/values-pl/strings.xml \
48 | android/res/values-id/strings.xml \
49 | android/res/values-ja/strings.xml \
50 | android/res/values-et/strings.xml \
51 | android/AndroidManifest.xml
52 |
53 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | Android PySide example project
2 | ==============================
3 | This is an example project that demonstrates how to build
4 | self-contained Python + PySide + Qt Components Applications
5 | for Android.
6 |
7 | Just load it to the Necessitas QtCreator and press "deploy".
8 | It will automatically generate a self-contained APK an deploy
9 | it either to the Android simulator or to any device that is connected with
10 | USB and has debugging enabled.
11 |
12 | You can also modify this project and use it as a base for you
13 | own application.
14 |
15 | More information
16 | ================
17 | For more information about this project & PySide for android,
18 | check out the main info page on:
19 | http://modrana.org/trac/wiki/PySideForAndroid
20 |
--------------------------------------------------------------------------------
/android/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/android/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | PyDroid
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/android/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.builder.cleanOutputFolder=clean
3 | org.eclipse.jdt.core.builder.duplicateResourceTask=warning
4 | org.eclipse.jdt.core.builder.invalidClasspath=ignore
5 | org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
6 | org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
7 | org.eclipse.jdt.core.circularClasspath=error
8 | org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
9 | org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
10 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
11 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
12 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
13 | org.eclipse.jdt.core.compiler.compliance=1.5
14 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
15 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
16 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
17 | org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
18 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
19 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
20 | org.eclipse.jdt.core.compiler.source=1.5
21 | org.eclipse.jdt.core.incompatibleJDKLevel=ignore
22 | org.eclipse.jdt.core.incompleteClasspath=warning
23 |
--------------------------------------------------------------------------------
/android/.settings/org.eclipse.jdt.launching.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning
3 |
--------------------------------------------------------------------------------
/android/AndroidManifest.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/android/build.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
29 |
30 |
31 |
35 |
36 |
37 |
38 |
39 |
40 |
49 |
50 |
51 |
52 |
56 |
57 |
69 |
70 |
71 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/android/libs/armeabi-v7a/gdbserver:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/M4rtinK/android-pyside-example-project/13877d449844edb0dee2efff1f2f98fe1fd4f7b5/android/libs/armeabi-v7a/gdbserver
--------------------------------------------------------------------------------
/android/libs/armeabi/gdbserver:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/M4rtinK/android-pyside-example-project/13877d449844edb0dee2efff1f2f98fe1fd4f7b5/android/libs/armeabi/gdbserver
--------------------------------------------------------------------------------
/android/libs/armeabi/libcom_googlecode_android_scripting_Exec.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/M4rtinK/android-pyside-example-project/13877d449844edb0dee2efff1f2f98fe1fd4f7b5/android/libs/armeabi/libcom_googlecode_android_scripting_Exec.so
--------------------------------------------------------------------------------
/android/libs/guava-r06.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/M4rtinK/android-pyside-example-project/13877d449844edb0dee2efff1f2f98fe1fd4f7b5/android/libs/guava-r06.jar
--------------------------------------------------------------------------------
/android/libs/libGoogleAnalytics.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/M4rtinK/android-pyside-example-project/13877d449844edb0dee2efff1f2f98fe1fd4f7b5/android/libs/libGoogleAnalytics.jar
--------------------------------------------------------------------------------
/android/libs/locale_platform.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/M4rtinK/android-pyside-example-project/13877d449844edb0dee2efff1f2f98fe1fd4f7b5/android/libs/locale_platform.jar
--------------------------------------------------------------------------------
/android/libs/script.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/M4rtinK/android-pyside-example-project/13877d449844edb0dee2efff1f2f98fe1fd4f7b5/android/libs/script.jar
--------------------------------------------------------------------------------
/android/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/android/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-8
15 |
--------------------------------------------------------------------------------
/android/res/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/M4rtinK/android-pyside-example-project/13877d449844edb0dee2efff1f2f98fe1fd4f7b5/android/res/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/android/res/drawable/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/M4rtinK/android-pyside-example-project/13877d449844edb0dee2efff1f2f98fe1fd4f7b5/android/res/drawable/icon.png
--------------------------------------------------------------------------------
/android/res/drawable/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/M4rtinK/android-pyside-example-project/13877d449844edb0dee2efff1f2f98fe1fd4f7b5/android/res/drawable/logo.png
--------------------------------------------------------------------------------
/android/res/layout/splash.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/android/res/raw/my_python_project.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/M4rtinK/android-pyside-example-project/13877d449844edb0dee2efff1f2f98fe1fd4f7b5/android/res/raw/my_python_project.zip
--------------------------------------------------------------------------------
/android/res/raw/python_27.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/M4rtinK/android-pyside-example-project/13877d449844edb0dee2efff1f2f98fe1fd4f7b5/android/res/raw/python_27.zip
--------------------------------------------------------------------------------
/android/res/values-de/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Ministro-Dienst wurde nicht gefunden.\nAnwendung kann nicht gestartet werden
4 | Diese Anwendung benötigt den Ministro-Dienst. Möchten Sie ihn installieren?
5 | In Ihrer Anwendung ist ein schwerwiegender Fehler aufgetreten, sie kann nicht fortgesetzt werden
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values-el/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Δεν ήταν δυνατή η εύρεση της υπηρεσίας Ministro. Δεν είναι δυνατή η εκκίνηση της εφαρμογής.
4 | Η εφαρμογή απαιτεί την υπηρεσία Ministro. Να εγκατασταθεί η υπηρεσία?
5 | Παρουσιάστηκε ένα κρίσιμο σφάλμα και η εφαρμογή δεν μπορεί να συνεχίσει.
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values-es/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Servicio Ministro inesistente. Imposible ejecutar la aplicación.
4 | Esta aplicación requiere el servicio Ministro. Instalarlo?
5 | La aplicación ha causado un error grave y no es posible continuar.
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values-et/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Ei suuda leida Ministro teenust.\nProgrammi ei saa käivitada.
4 | See programm vajab Ministro teenust.\nKas soovite paigaldada?
5 | Programmiga juhtus fataalne viga.\nKahjuks ei saa jätkata.
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values-fa/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | سرویس Ministro را پیدا نمیکند. برنامه نمیتواند آغاز شود.
4 | این نرمافزار به سرویس Ministro احتیاج دارد. آیا دوست دارید آن را نصب کنید؟
5 | خطایی اساسی در برنامهتان رخ داد و اجرای برنامه نمیتواند ادامه یابد.
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values-fr/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Le service Ministro est introuvable.\nL\'application ne peut pas démarrer.
4 | Cette application requiert le service Ministro. Voulez-vous l\'installer?
5 | Votre application a rencontré une erreur fatale et ne peut pas continuer.
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values-id/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Layanan Ministro tidak bisa ditemukan.\nAplikasi tidak bisa dimulai.
4 | Aplikasi ini membutuhkan layanan Ministro. Apakah Anda ingin menginstalnya?
5 | Aplikasi Anda mengalami kesalahan fatal dan tidak dapat melanjutkan.
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values-it/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Servizio Ministro inesistente. Impossibile eseguire \nl\'applicazione.
4 | Questa applicazione richiede il servizio Ministro.Installarlo?
5 | L\'applicazione ha provocato un errore grave e non puo\' continuare.
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values-ja/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Ministroサービスが見つかりません。\nアプリケーションが起動できません。
4 | このアプリケーションにはMinistroサービスが必要です。 インストールしてもよろしいですか?
5 | アプリケーションで致命的なエラーが発生したため続行できません。
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values-ms/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Tidak jumpa servis Ministro.\nAplikasi tidak boleh dimulakan.
4 | Aplikasi ini memerlukan servis Ministro. Adakah anda ingin pasang servis itu?
5 | Aplikasi anda menemui ralat muat dan tidak boleh diteruskan.
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values-nb/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Kan ikke finne tjenesten Ministro. Applikasjonen kan ikke starte.
4 | Denne applikasjonen krever tjenesten Ministro. Vil du installere denne?
5 | Applikasjonen fikk en kritisk feil og kan ikke fortsette
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values-nl/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | De Ministro service is niet gevonden.\nDe applicatie kan niet starten.
4 | Deze applicatie maakt gebruik van de Ministro service. Wilt u deze installeren?
5 | Er is een fatale fout in de applicatie opgetreden. De applicatie kan niet verder gaan.
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values-pl/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Usługa Ministro nie została znaleziona.\nAplikacja nie może zostać uruchomiona.
4 | Aplikacja wymaga usługi Ministro. Czy chcesz ją zainstalować?
5 | Wystąpił błąd krytyczny. Aplikacja zostanie zamknięta.
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values-pt-rBR/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Não foi possível encontrar o serviço Ministro.\nA aplicação não pode iniciar.
4 | Essa aplicação requer o serviço Ministro. Gostaria de instalá-lo?
5 | Sua aplicação encontrou um erro fatal e não pode continuar.
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values-ro/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Serviciul Ministro nu poate fi găsit.\nAplicaţia nu poate porni.
4 | Această aplicaţie necesită serviciul Ministro.\nDoriţi să-l instalaţi?
5 | Aplicaţia dumneavoastră a întâmpinat o eroare fatală şi nu poate continua.
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values-rs/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Ministro servise nije pronađen. Aplikacija ne može biti pokrenuta.
4 | Ova aplikacija zahteva Ministro servis. Želite li da ga instalirate?
5 | Vaša aplikacija je naišla na fatalnu grešku i ne može nastaviti sa radom.
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values-ru/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Сервис Ministro не найден.\nПриложение нельзя запустить.
4 | Этому приложению необходим сервис Ministro. Вы хотите его установить?
5 | Ваше приложение столкнулось с фатальной ошибкой и не может более работать.
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values-zh-rCN/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 无法找到Ministro服务。\n应用程序无法启动。
4 | 此应用程序需要Ministro服务。您想安装它吗?
5 | 您的应用程序遇到一个致命错误导致它无法继续。
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values-zh-rTW/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 無法找到Ministro服務。\n應用程序無法啟動。
4 | 此應用程序需要Ministro服務。您想安裝它嗎?
5 | 您的應用程序遇到一個致命錯誤導致它無法繼續。
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values/libs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - QtCore
6 | - QtFeedback
7 | - QtGui
8 | - QtNetwork
9 | - QtScript
10 | - QtSensors
11 | - QtSql
12 | - QtXml
13 | - QtOpenGL
14 | - QtSvg
15 | - QtSystemInfo
16 | - QtXmlPatterns
17 | - QtDeclarative
18 |
19 |
20 |
--------------------------------------------------------------------------------
/android/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | PySideExample
4 | Can\'t find Ministro service.\nThe application can\'t start.
5 | This application requires Ministro service. Would you like to install it?
6 | Your application encountered a fatal error and cannot continue.
7 |
8 |
--------------------------------------------------------------------------------
/android/src/org/kde/necessitas/ministro/IMinistro.aidl:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2011, BogDan Vatra
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 | 2. Redistributions in binary form must reproduce the above copyright
11 | notice, this list of conditions and the following disclaimer in the
12 | documentation and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | */
25 |
26 |
27 | package org.kde.necessitas.ministro;
28 |
29 | import org.kde.necessitas.ministro.IMinistroCallback;
30 |
31 | interface IMinistro
32 | {
33 | /**
34 | * Check/download required libs to run the application
35 | *
36 | * param callback - interface used by Minsitro service to notify the client when the loader is ready
37 | * param parameters
38 | * parameters fields:
39 | * * Key Name Key type Explanations
40 | * "required.modules" StringArray Required modules by your application
41 | * "application.title" String Application name, used to show more informations to user
42 | * "qt.provider" String Qt libs provider, currently only "necessitas" is supported.
43 | * "minimum.ministro.api" Integer Minimum Ministro API level, used to check if Ministro service compatible with your application. Current API Level is 1 !
44 | * "minimum.qt.version" Integer Minimim Qt version (e.g. 0x040800, which means Qt 4.8.0, check http://doc.trolltech.com/4.8/qtglobal.html#QT_VERSION)!
45 | * "3rd.party.repositories" StringArray 3rd party repositories, which should be downloaded by ministro, needs minimum.ministro.api >= 2
46 | * Check http://community.kde.org/Necessitas/Ministro for more details.
47 | */
48 | void requestLoader(in IMinistroCallback callback, in Bundle parameters);
49 | }
50 |
--------------------------------------------------------------------------------
/android/src/org/kde/necessitas/ministro/IMinistroCallback.aidl:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2011, BogDan Vatra
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 | 2. Redistributions in binary form must reproduce the above copyright
11 | notice, this list of conditions and the following disclaimer in the
12 | documentation and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | */
25 |
26 | package org.kde.necessitas.ministro;
27 |
28 | oneway interface IMinistroCallback {
29 | /**
30 | * This method is called by the Ministro service back into the application which
31 | * implements this interface.
32 | *
33 | * param in - loaderParams
34 | * loaderParams fields:
35 | * * Key Name Key type Explanations
36 | * * "error.code" Integer See below
37 | * * "error.message" String Missing if no error, otherwise will contain the error message translated into phone language where available.
38 | * * "dex.path" String The list of jar/apk files containing classes and resources, needed to be passed to application DexClassLoader
39 | * * "lib.path" String The list of directories containing native libraries; may be missing, needed to be passed to application DexClassLoader
40 | * * "loader.class.name" String Loader class name.
41 | *
42 | * "error.code" field possible errors:
43 | * - 0 no error.
44 | * - 1 incompatible Ministro version. Ministro needs to be upgraded.
45 | * - 2 not all modules could be satisfy.
46 | * - 3 invalid parameters
47 | *
48 | * This parameter will contain additional fields which are used by the loader to start your application, so it must be passed to loader.
49 | */
50 |
51 | void loaderReady(in Bundle loaderParams);
52 | }
53 |
--------------------------------------------------------------------------------
/android/src/org/kde/necessitas/origo/GlobalConstants.java:
--------------------------------------------------------------------------------
1 | package org.kde.necessitas.origo;
2 |
3 | public class GlobalConstants {
4 |
5 | public static final String PYTHON_MAIN_SCRIPT_NAME = "main.py";
6 | public static final String PYTHON_PROJECT_ZIP_NAME = "my_python_project.zip";
7 | public static final String PYTHON_ZIP_NAME = "python_27.zip";
8 | public static final String PYTHON_EXTRAS_ZIP_NAME = "python_extras_27.zip";
9 |
10 | public static final boolean IS_FOREGROUND_SERVICE = true;
11 |
12 | public static final String PYTHON_BIN_RELATIVE_PATH = "/python/bin/python";
13 | public static final String PYTHON_NAME = "python";
14 | public static final String PYTHON_NICE_NAME = "Python 2.7.2";
15 |
16 | public static String[] SCRIPT_ARGS = { "--foreground" };
17 |
18 | public static final String LOG_TAG = "PythonAPK";
19 | }
20 |
--------------------------------------------------------------------------------
/android/src/org/kde/necessitas/origo/Utils.java:
--------------------------------------------------------------------------------
1 | package org.kde.necessitas.origo;
2 |
3 | import android.os.Environment;
4 | import android.util.Log;
5 |
6 | import com.googlecode.android_scripting.FileUtils;
7 |
8 | import java.io.BufferedInputStream;
9 | import java.io.BufferedOutputStream;
10 | import java.io.File;
11 | import java.io.FileNotFoundException;
12 | import java.io.FileOutputStream;
13 | import java.io.InputStream;
14 | import java.util.zip.ZipEntry;
15 | import java.util.zip.ZipFile;
16 | import java.util.zip.ZipInputStream;
17 |
18 | public class Utils {
19 | public static String getFileExtension(String sFileName) {
20 | int dotIndex = sFileName.lastIndexOf('.');
21 | if (dotIndex == -1) {
22 | return null;
23 | }
24 | return sFileName.substring(dotIndex);
25 | }
26 |
27 | //-------------------------------------------------------------------------------------------------
28 |
29 | public static boolean unzip(InputStream inputStream, String dest, boolean replaceIfExists) {
30 |
31 | final int BUFFER_SIZE = 4096;
32 |
33 | BufferedOutputStream bufferedOutputStream = null;
34 |
35 | boolean succeed = true;
36 |
37 | try {
38 | ZipInputStream zipInputStream = new ZipInputStream(new BufferedInputStream(inputStream));
39 | ZipEntry zipEntry;
40 |
41 | while ((zipEntry = zipInputStream.getNextEntry()) != null){
42 |
43 | String zipEntryName = zipEntry.getName();
44 |
45 |
46 | // if(!zipEntry.isDirectory()) {
47 | // File fil = new File(dest + zipEntryName);
48 | // fil.getParent()
49 | // }
50 |
51 | // file exists ? delete ?
52 | File file2 = new File(dest + zipEntryName);
53 |
54 | if(file2.exists()) {
55 | if (replaceIfExists) {
56 |
57 | try {
58 | boolean b = deleteDir(file2);
59 | if(!b) {
60 | Log.e(GlobalConstants.LOG_TAG, "Unzip failed to delete " + dest + zipEntryName);
61 | }
62 | else {
63 | Log.d(GlobalConstants.LOG_TAG, "Unzip deleted " + dest + zipEntryName);
64 | }
65 | } catch (Exception e) {
66 | Log.e(GlobalConstants.LOG_TAG, "Unzip failed to delete " + dest + zipEntryName, e);
67 | }
68 | }
69 | }
70 |
71 | // extract
72 | File file = new File(dest + zipEntryName);
73 |
74 | if (file.exists()){
75 |
76 | } else {
77 | if(zipEntry.isDirectory()){
78 | file.mkdirs();
79 | FileUtils.chmod(file, 0755);
80 |
81 | }else{
82 |
83 | // create parent file folder if not exists yet
84 | if(!file.getParentFile().exists()) {
85 | file.getParentFile().mkdirs();
86 | FileUtils.chmod(file.getParentFile(), 0755);
87 | }
88 |
89 | byte buffer[] = new byte[BUFFER_SIZE];
90 | bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(file), BUFFER_SIZE);
91 | int count;
92 |
93 | while ((count = zipInputStream.read(buffer, 0, BUFFER_SIZE)) != -1) {
94 | bufferedOutputStream.write(buffer, 0, count);
95 | }
96 |
97 | bufferedOutputStream.flush();
98 | bufferedOutputStream.close();
99 | }
100 | }
101 |
102 | // enable standalone python
103 | if(file.getName().endsWith(".so")) {
104 | FileUtils.chmod(file, 0755);
105 | }
106 |
107 | Log.d(GlobalConstants.LOG_TAG,"Unzip extracted " + dest + zipEntryName);
108 | }
109 |
110 | zipInputStream.close();
111 |
112 | } catch (FileNotFoundException e) {
113 | Log.e(GlobalConstants.LOG_TAG,"Unzip error, file not found", e);
114 | succeed = false;
115 | }catch (Exception e) {
116 | Log.e(GlobalConstants.LOG_TAG,"Unzip error: ", e);
117 | succeed = false;
118 | }
119 |
120 | return succeed;
121 | }
122 |
123 | //-------------------------------------------------------------------------------------------------
124 |
125 | public static boolean deleteDir(File dir) {
126 | try {
127 | if (dir.isDirectory()) {
128 | String[] children = dir.list();
129 | for (int i=0; i
2 |
3 | AndroidManifest.xml
4 | libs.xml
5 | logo.png
6 | icon.png
7 |
8 |
9 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/Python.h:
--------------------------------------------------------------------------------
1 | #ifndef Py_PYTHON_H
2 | #define Py_PYTHON_H
3 | /* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */
4 |
5 | /* Include nearly all Python header files */
6 |
7 | #include "patchlevel.h"
8 | #include "pyconfig.h"
9 | #include "pymacconfig.h"
10 |
11 | /* Cyclic gc is always enabled, starting with release 2.3a1. Supply the
12 | * old symbol for the benefit of extension modules written before then
13 | * that may be conditionalizing on it. The core doesn't use it anymore.
14 | */
15 | #ifndef WITH_CYCLE_GC
16 | #define WITH_CYCLE_GC 1
17 | #endif
18 |
19 | #include
20 |
21 | #ifndef UCHAR_MAX
22 | #error "Something's broken. UCHAR_MAX should be defined in limits.h."
23 | #endif
24 |
25 | #if UCHAR_MAX != 255
26 | #error "Python's source code assumes C's unsigned char is an 8-bit type."
27 | #endif
28 |
29 | #if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE)
30 | #define _SGI_MP_SOURCE
31 | #endif
32 |
33 | #include
34 | #ifndef NULL
35 | # error "Python.h requires that stdio.h define NULL."
36 | #endif
37 |
38 | #include
39 | #ifdef HAVE_ERRNO_H
40 | #include
41 | #endif
42 | #include
43 | #ifdef HAVE_UNISTD_H
44 | #include
45 | #endif
46 |
47 | /* For size_t? */
48 | #ifdef HAVE_STDDEF_H
49 | #include
50 | #endif
51 |
52 | /* CAUTION: Build setups should ensure that NDEBUG is defined on the
53 | * compiler command line when building Python in release mode; else
54 | * assert() calls won't be removed.
55 | */
56 | #include
57 |
58 | #include "pyport.h"
59 |
60 | /* pyconfig.h or pyport.h may or may not define DL_IMPORT */
61 | #ifndef DL_IMPORT /* declarations for DLL import/export */
62 | #define DL_IMPORT(RTYPE) RTYPE
63 | #endif
64 | #ifndef DL_EXPORT /* declarations for DLL import/export */
65 | #define DL_EXPORT(RTYPE) RTYPE
66 | #endif
67 |
68 | /* Debug-mode build with pymalloc implies PYMALLOC_DEBUG.
69 | * PYMALLOC_DEBUG is in error if pymalloc is not in use.
70 | */
71 | #if defined(Py_DEBUG) && defined(WITH_PYMALLOC) && !defined(PYMALLOC_DEBUG)
72 | #define PYMALLOC_DEBUG
73 | #endif
74 | #if defined(PYMALLOC_DEBUG) && !defined(WITH_PYMALLOC)
75 | #error "PYMALLOC_DEBUG requires WITH_PYMALLOC"
76 | #endif
77 | #include "pymath.h"
78 | #include "pymem.h"
79 |
80 | #include "object.h"
81 | #include "objimpl.h"
82 |
83 | #include "pydebug.h"
84 |
85 | #include "unicodeobject.h"
86 | #include "intobject.h"
87 | #include "boolobject.h"
88 | #include "longobject.h"
89 | #include "floatobject.h"
90 | #ifndef WITHOUT_COMPLEX
91 | #include "complexobject.h"
92 | #endif
93 | #include "rangeobject.h"
94 | #include "stringobject.h"
95 | #include "memoryobject.h"
96 | #include "bufferobject.h"
97 | #include "bytesobject.h"
98 | #include "bytearrayobject.h"
99 | #include "tupleobject.h"
100 | #include "listobject.h"
101 | #include "dictobject.h"
102 | #include "enumobject.h"
103 | #include "setobject.h"
104 | #include "methodobject.h"
105 | #include "moduleobject.h"
106 | #include "funcobject.h"
107 | #include "classobject.h"
108 | #include "fileobject.h"
109 | #include "cobject.h"
110 | #include "pycapsule.h"
111 | #include "traceback.h"
112 | #include "sliceobject.h"
113 | #include "cellobject.h"
114 | #include "iterobject.h"
115 | #include "genobject.h"
116 | #include "descrobject.h"
117 | #include "warnings.h"
118 | #include "weakrefobject.h"
119 |
120 | #include "codecs.h"
121 | #include "pyerrors.h"
122 |
123 | #include "pystate.h"
124 |
125 | #include "pyarena.h"
126 | #include "modsupport.h"
127 | #include "pythonrun.h"
128 | #include "ceval.h"
129 | #include "sysmodule.h"
130 | #include "intrcheck.h"
131 | #include "import.h"
132 |
133 | #include "abstract.h"
134 |
135 | #include "compile.h"
136 | #include "eval.h"
137 |
138 | #include "pyctype.h"
139 | #include "pystrtod.h"
140 | #include "pystrcmp.h"
141 | #include "dtoa.h"
142 |
143 | /* _Py_Mangle is defined in compile.c */
144 | PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
145 |
146 | /* PyArg_GetInt is deprecated and should not be used, use PyArg_Parse(). */
147 | #define PyArg_GetInt(v, a) PyArg_Parse((v), "i", (a))
148 |
149 | /* PyArg_NoArgs should not be necessary.
150 | Set ml_flags in the PyMethodDef to METH_NOARGS. */
151 | #define PyArg_NoArgs(v) PyArg_Parse(v, "")
152 |
153 | /* Argument must be a char or an int in [-128, 127] or [0, 255]. */
154 | #define Py_CHARMASK(c) ((unsigned char)((c) & 0xff))
155 |
156 | #include "pyfpe.h"
157 |
158 | /* These definitions must match corresponding definitions in graminit.h.
159 | There's code in compile.c that checks that they are the same. */
160 | #define Py_single_input 256
161 | #define Py_file_input 257
162 | #define Py_eval_input 258
163 |
164 | #ifdef HAVE_PTH
165 | /* GNU pth user-space thread support */
166 | #include
167 | #endif
168 |
169 | /* Define macros for inline documentation. */
170 | #define PyDoc_VAR(name) static char name[]
171 | #define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str)
172 | #ifdef WITH_DOC_STRINGS
173 | #define PyDoc_STR(str) str
174 | #else
175 | #define PyDoc_STR(str) ""
176 | #endif
177 |
178 | #endif /* !Py_PYTHON_H */
179 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/ceval.h:
--------------------------------------------------------------------------------
1 | #ifndef Py_CEVAL_H
2 | #define Py_CEVAL_H
3 | #ifdef __cplusplus
4 | extern "C" {
5 | #endif
6 |
7 |
8 | /* Interface to random parts in ceval.c */
9 |
10 | PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
11 | PyObject *, PyObject *, PyObject *);
12 |
13 | /* Inline this */
14 | #define PyEval_CallObject(func,arg) \
15 | PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL)
16 |
17 | PyAPI_FUNC(PyObject *) PyEval_CallFunction(PyObject *obj,
18 | const char *format, ...);
19 | PyAPI_FUNC(PyObject *) PyEval_CallMethod(PyObject *obj,
20 | const char *methodname,
21 | const char *format, ...);
22 |
23 | PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
24 | PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *);
25 |
26 | struct _frame; /* Avoid including frameobject.h */
27 |
28 | PyAPI_FUNC(PyObject *) PyEval_GetBuiltins(void);
29 | PyAPI_FUNC(PyObject *) PyEval_GetGlobals(void);
30 | PyAPI_FUNC(PyObject *) PyEval_GetLocals(void);
31 | PyAPI_FUNC(struct _frame *) PyEval_GetFrame(void);
32 | PyAPI_FUNC(int) PyEval_GetRestricted(void);
33 |
34 | /* Look at the current frame's (if any) code's co_flags, and turn on
35 | the corresponding compiler flags in cf->cf_flags. Return 1 if any
36 | flag was set, else return 0. */
37 | PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf);
38 |
39 | PyAPI_FUNC(int) Py_FlushLine(void);
40 |
41 | PyAPI_FUNC(int) Py_AddPendingCall(int (*func)(void *), void *arg);
42 | PyAPI_FUNC(int) Py_MakePendingCalls(void);
43 |
44 | /* Protection against deeply nested recursive calls */
45 | PyAPI_FUNC(void) Py_SetRecursionLimit(int);
46 | PyAPI_FUNC(int) Py_GetRecursionLimit(void);
47 |
48 | #define Py_EnterRecursiveCall(where) \
49 | (_Py_MakeRecCheck(PyThreadState_GET()->recursion_depth) && \
50 | _Py_CheckRecursiveCall(where))
51 | #define Py_LeaveRecursiveCall() \
52 | (--PyThreadState_GET()->recursion_depth)
53 | PyAPI_FUNC(int) _Py_CheckRecursiveCall(char *where);
54 | PyAPI_DATA(int) _Py_CheckRecursionLimit;
55 | #ifdef USE_STACKCHECK
56 | # define _Py_MakeRecCheck(x) (++(x) > --_Py_CheckRecursionLimit)
57 | #else
58 | # define _Py_MakeRecCheck(x) (++(x) > _Py_CheckRecursionLimit)
59 | #endif
60 |
61 | PyAPI_FUNC(const char *) PyEval_GetFuncName(PyObject *);
62 | PyAPI_FUNC(const char *) PyEval_GetFuncDesc(PyObject *);
63 |
64 | PyAPI_FUNC(PyObject *) PyEval_GetCallStats(PyObject *);
65 | PyAPI_FUNC(PyObject *) PyEval_EvalFrame(struct _frame *);
66 | PyAPI_FUNC(PyObject *) PyEval_EvalFrameEx(struct _frame *f, int exc);
67 |
68 | /* this used to be handled on a per-thread basis - now just two globals */
69 | PyAPI_DATA(volatile int) _Py_Ticker;
70 | PyAPI_DATA(int) _Py_CheckInterval;
71 |
72 | /* Interface for threads.
73 |
74 | A module that plans to do a blocking system call (or something else
75 | that lasts a long time and doesn't touch Python data) can allow other
76 | threads to run as follows:
77 |
78 | ...preparations here...
79 | Py_BEGIN_ALLOW_THREADS
80 | ...blocking system call here...
81 | Py_END_ALLOW_THREADS
82 | ...interpret result here...
83 |
84 | The Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS pair expands to a
85 | {}-surrounded block.
86 | To leave the block in the middle (e.g., with return), you must insert
87 | a line containing Py_BLOCK_THREADS before the return, e.g.
88 |
89 | if (...premature_exit...) {
90 | Py_BLOCK_THREADS
91 | PyErr_SetFromErrno(PyExc_IOError);
92 | return NULL;
93 | }
94 |
95 | An alternative is:
96 |
97 | Py_BLOCK_THREADS
98 | if (...premature_exit...) {
99 | PyErr_SetFromErrno(PyExc_IOError);
100 | return NULL;
101 | }
102 | Py_UNBLOCK_THREADS
103 |
104 | For convenience, that the value of 'errno' is restored across
105 | Py_END_ALLOW_THREADS and Py_BLOCK_THREADS.
106 |
107 | WARNING: NEVER NEST CALLS TO Py_BEGIN_ALLOW_THREADS AND
108 | Py_END_ALLOW_THREADS!!!
109 |
110 | The function PyEval_InitThreads() should be called only from
111 | initthread() in "threadmodule.c".
112 |
113 | Note that not yet all candidates have been converted to use this
114 | mechanism!
115 | */
116 |
117 | PyAPI_FUNC(PyThreadState *) PyEval_SaveThread(void);
118 | PyAPI_FUNC(void) PyEval_RestoreThread(PyThreadState *);
119 |
120 | #ifdef WITH_THREAD
121 |
122 | PyAPI_FUNC(int) PyEval_ThreadsInitialized(void);
123 | PyAPI_FUNC(void) PyEval_InitThreads(void);
124 | PyAPI_FUNC(void) PyEval_AcquireLock(void);
125 | PyAPI_FUNC(void) PyEval_ReleaseLock(void);
126 | PyAPI_FUNC(void) PyEval_AcquireThread(PyThreadState *tstate);
127 | PyAPI_FUNC(void) PyEval_ReleaseThread(PyThreadState *tstate);
128 | PyAPI_FUNC(void) PyEval_ReInitThreads(void);
129 |
130 | #define Py_BEGIN_ALLOW_THREADS { \
131 | PyThreadState *_save; \
132 | _save = PyEval_SaveThread();
133 | #define Py_BLOCK_THREADS PyEval_RestoreThread(_save);
134 | #define Py_UNBLOCK_THREADS _save = PyEval_SaveThread();
135 | #define Py_END_ALLOW_THREADS PyEval_RestoreThread(_save); \
136 | }
137 |
138 | #else /* !WITH_THREAD */
139 |
140 | #define Py_BEGIN_ALLOW_THREADS {
141 | #define Py_BLOCK_THREADS
142 | #define Py_UNBLOCK_THREADS
143 | #define Py_END_ALLOW_THREADS }
144 |
145 | #endif /* !WITH_THREAD */
146 |
147 | PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *);
148 |
149 |
150 | #ifdef __cplusplus
151 | }
152 | #endif
153 | #endif /* !Py_CEVAL_H */
154 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/code.h:
--------------------------------------------------------------------------------
1 | /* Definitions for bytecode */
2 |
3 | #ifndef Py_CODE_H
4 | #define Py_CODE_H
5 | #ifdef __cplusplus
6 | extern "C" {
7 | #endif
8 |
9 | /* Bytecode object */
10 | typedef struct {
11 | PyObject_HEAD
12 | int co_argcount; /* #arguments, except *args */
13 | int co_nlocals; /* #local variables */
14 | int co_stacksize; /* #entries needed for evaluation stack */
15 | int co_flags; /* CO_..., see below */
16 | PyObject *co_code; /* instruction opcodes */
17 | PyObject *co_consts; /* list (constants used) */
18 | PyObject *co_names; /* list of strings (names used) */
19 | PyObject *co_varnames; /* tuple of strings (local variable names) */
20 | PyObject *co_freevars; /* tuple of strings (free variable names) */
21 | PyObject *co_cellvars; /* tuple of strings (cell variable names) */
22 | /* The rest doesn't count for hash/cmp */
23 | PyObject *co_filename; /* string (where it was loaded from) */
24 | PyObject *co_name; /* string (name, for reference) */
25 | int co_firstlineno; /* first source line number */
26 | PyObject *co_lnotab; /* string (encoding addr<->lineno mapping) See
27 | Objects/lnotab_notes.txt for details. */
28 | void *co_zombieframe; /* for optimization only (see frameobject.c) */
29 | PyObject *co_weakreflist; /* to support weakrefs to code objects */
30 | } PyCodeObject;
31 |
32 | /* Masks for co_flags above */
33 | #define CO_OPTIMIZED 0x0001
34 | #define CO_NEWLOCALS 0x0002
35 | #define CO_VARARGS 0x0004
36 | #define CO_VARKEYWORDS 0x0008
37 | #define CO_NESTED 0x0010
38 | #define CO_GENERATOR 0x0020
39 | /* The CO_NOFREE flag is set if there are no free or cell variables.
40 | This information is redundant, but it allows a single flag test
41 | to determine whether there is any extra work to be done when the
42 | call frame it setup.
43 | */
44 | #define CO_NOFREE 0x0040
45 |
46 | #if 0
47 | /* This is no longer used. Stopped defining in 2.5, do not re-use. */
48 | #define CO_GENERATOR_ALLOWED 0x1000
49 | #endif
50 | #define CO_FUTURE_DIVISION 0x2000
51 | #define CO_FUTURE_ABSOLUTE_IMPORT 0x4000 /* do absolute imports by default */
52 | #define CO_FUTURE_WITH_STATEMENT 0x8000
53 | #define CO_FUTURE_PRINT_FUNCTION 0x10000
54 | #define CO_FUTURE_UNICODE_LITERALS 0x20000
55 |
56 | /* This should be defined if a future statement modifies the syntax.
57 | For example, when a keyword is added.
58 | */
59 | #if 1
60 | #define PY_PARSER_REQUIRES_FUTURE_KEYWORD
61 | #endif
62 |
63 | #define CO_MAXBLOCKS 20 /* Max static block nesting within a function */
64 |
65 | PyAPI_DATA(PyTypeObject) PyCode_Type;
66 |
67 | #define PyCode_Check(op) (Py_TYPE(op) == &PyCode_Type)
68 | #define PyCode_GetNumFree(op) (PyTuple_GET_SIZE((op)->co_freevars))
69 |
70 | /* Public interface */
71 | PyAPI_FUNC(PyCodeObject *) PyCode_New(
72 | int, int, int, int, PyObject *, PyObject *, PyObject *, PyObject *,
73 | PyObject *, PyObject *, PyObject *, PyObject *, int, PyObject *);
74 | /* same as struct above */
75 |
76 | /* Creates a new empty code object with the specified source location. */
77 | PyAPI_FUNC(PyCodeObject *)
78 | PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno);
79 |
80 | /* Return the line number associated with the specified bytecode index
81 | in this code object. If you just need the line number of a frame,
82 | use PyFrame_GetLineNumber() instead. */
83 | PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int);
84 |
85 | /* for internal use only */
86 | #define _PyCode_GETCODEPTR(co, pp) \
87 | ((*Py_TYPE((co)->co_code)->tp_as_buffer->bf_getreadbuffer) \
88 | ((co)->co_code, 0, (void **)(pp)))
89 |
90 | typedef struct _addr_pair {
91 | int ap_lower;
92 | int ap_upper;
93 | } PyAddrPair;
94 |
95 | /* Update *bounds to describe the first and one-past-the-last instructions in the
96 | same line as lasti. Return the number of that line.
97 | */
98 | PyAPI_FUNC(int) _PyCode_CheckLineNumber(PyCodeObject* co,
99 | int lasti, PyAddrPair *bounds);
100 |
101 | PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts,
102 | PyObject *names, PyObject *lineno_obj);
103 |
104 | #ifdef __cplusplus
105 | }
106 | #endif
107 | #endif /* !Py_CODE_H */
108 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/codecs.h:
--------------------------------------------------------------------------------
1 | #ifndef Py_CODECREGISTRY_H
2 | #define Py_CODECREGISTRY_H
3 | #ifdef __cplusplus
4 | extern "C" {
5 | #endif
6 |
7 | /* ------------------------------------------------------------------------
8 |
9 | Python Codec Registry and support functions
10 |
11 |
12 | Written by Marc-Andre Lemburg (mal@lemburg.com).
13 |
14 | Copyright (c) Corporation for National Research Initiatives.
15 |
16 | ------------------------------------------------------------------------ */
17 |
18 | /* Register a new codec search function.
19 |
20 | As side effect, this tries to load the encodings package, if not
21 | yet done, to make sure that it is always first in the list of
22 | search functions.
23 |
24 | The search_function's refcount is incremented by this function. */
25 |
26 | PyAPI_FUNC(int) PyCodec_Register(
27 | PyObject *search_function
28 | );
29 |
30 | /* Codec register lookup API.
31 |
32 | Looks up the given encoding and returns a CodecInfo object with
33 | function attributes which implement the different aspects of
34 | processing the encoding.
35 |
36 | The encoding string is looked up converted to all lower-case
37 | characters. This makes encodings looked up through this mechanism
38 | effectively case-insensitive.
39 |
40 | If no codec is found, a KeyError is set and NULL returned.
41 |
42 | As side effect, this tries to load the encodings package, if not
43 | yet done. This is part of the lazy load strategy for the encodings
44 | package.
45 |
46 | */
47 |
48 | PyAPI_FUNC(PyObject *) _PyCodec_Lookup(
49 | const char *encoding
50 | );
51 |
52 | /* Generic codec based encoding API.
53 |
54 | object is passed through the encoder function found for the given
55 | encoding using the error handling method defined by errors. errors
56 | may be NULL to use the default method defined for the codec.
57 |
58 | Raises a LookupError in case no encoder can be found.
59 |
60 | */
61 |
62 | PyAPI_FUNC(PyObject *) PyCodec_Encode(
63 | PyObject *object,
64 | const char *encoding,
65 | const char *errors
66 | );
67 |
68 | /* Generic codec based decoding API.
69 |
70 | object is passed through the decoder function found for the given
71 | encoding using the error handling method defined by errors. errors
72 | may be NULL to use the default method defined for the codec.
73 |
74 | Raises a LookupError in case no encoder can be found.
75 |
76 | */
77 |
78 | PyAPI_FUNC(PyObject *) PyCodec_Decode(
79 | PyObject *object,
80 | const char *encoding,
81 | const char *errors
82 | );
83 |
84 | /* --- Codec Lookup APIs --------------------------------------------------
85 |
86 | All APIs return a codec object with incremented refcount and are
87 | based on _PyCodec_Lookup(). The same comments w/r to the encoding
88 | name also apply to these APIs.
89 |
90 | */
91 |
92 | /* Get an encoder function for the given encoding. */
93 |
94 | PyAPI_FUNC(PyObject *) PyCodec_Encoder(
95 | const char *encoding
96 | );
97 |
98 | /* Get a decoder function for the given encoding. */
99 |
100 | PyAPI_FUNC(PyObject *) PyCodec_Decoder(
101 | const char *encoding
102 | );
103 |
104 | /* Get a IncrementalEncoder object for the given encoding. */
105 |
106 | PyAPI_FUNC(PyObject *) PyCodec_IncrementalEncoder(
107 | const char *encoding,
108 | const char *errors
109 | );
110 |
111 | /* Get a IncrementalDecoder object function for the given encoding. */
112 |
113 | PyAPI_FUNC(PyObject *) PyCodec_IncrementalDecoder(
114 | const char *encoding,
115 | const char *errors
116 | );
117 |
118 | /* Get a StreamReader factory function for the given encoding. */
119 |
120 | PyAPI_FUNC(PyObject *) PyCodec_StreamReader(
121 | const char *encoding,
122 | PyObject *stream,
123 | const char *errors
124 | );
125 |
126 | /* Get a StreamWriter factory function for the given encoding. */
127 |
128 | PyAPI_FUNC(PyObject *) PyCodec_StreamWriter(
129 | const char *encoding,
130 | PyObject *stream,
131 | const char *errors
132 | );
133 |
134 | /* Unicode encoding error handling callback registry API */
135 |
136 | /* Register the error handling callback function error under the given
137 | name. This function will be called by the codec when it encounters
138 | unencodable characters/undecodable bytes and doesn't know the
139 | callback name, when name is specified as the error parameter
140 | in the call to the encode/decode function.
141 | Return 0 on success, -1 on error */
142 | PyAPI_FUNC(int) PyCodec_RegisterError(const char *name, PyObject *error);
143 |
144 | /* Lookup the error handling callback function registered under the given
145 | name. As a special case NULL can be passed, in which case
146 | the error handling callback for "strict" will be returned. */
147 | PyAPI_FUNC(PyObject *) PyCodec_LookupError(const char *name);
148 |
149 | /* raise exc as an exception */
150 | PyAPI_FUNC(PyObject *) PyCodec_StrictErrors(PyObject *exc);
151 |
152 | /* ignore the unicode error, skipping the faulty input */
153 | PyAPI_FUNC(PyObject *) PyCodec_IgnoreErrors(PyObject *exc);
154 |
155 | /* replace the unicode encode error with ? or U+FFFD */
156 | PyAPI_FUNC(PyObject *) PyCodec_ReplaceErrors(PyObject *exc);
157 |
158 | /* replace the unicode encode error with XML character references */
159 | PyAPI_FUNC(PyObject *) PyCodec_XMLCharRefReplaceErrors(PyObject *exc);
160 |
161 | /* replace the unicode encode error with backslash escapes (\x, \u and \U) */
162 | PyAPI_FUNC(PyObject *) PyCodec_BackslashReplaceErrors(PyObject *exc);
163 |
164 | #ifdef __cplusplus
165 | }
166 | #endif
167 | #endif /* !Py_CODECREGISTRY_H */
168 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 | #ifdef __cplusplus
88 | }
89 | #endif
90 | #endif /* !Py_FILEOBJECT_H */
91 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/floatobject.h:
--------------------------------------------------------------------------------
1 |
2 | /* Float object interface */
3 |
4 | /*
5 | PyFloatObject represents a (double precision) floating point number.
6 | */
7 |
8 | #ifndef Py_FLOATOBJECT_H
9 | #define Py_FLOATOBJECT_H
10 | #ifdef __cplusplus
11 | extern "C" {
12 | #endif
13 |
14 | typedef struct {
15 | PyObject_HEAD
16 | double ob_fval;
17 | } PyFloatObject;
18 |
19 | PyAPI_DATA(PyTypeObject) PyFloat_Type;
20 |
21 | #define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type)
22 | #define PyFloat_CheckExact(op) (Py_TYPE(op) == &PyFloat_Type)
23 |
24 | /* The str() precision PyFloat_STR_PRECISION is chosen so that in most cases,
25 | the rounding noise created by various operations is suppressed, while
26 | giving plenty of precision for practical use. */
27 |
28 | #define PyFloat_STR_PRECISION 12
29 |
30 | #ifdef Py_NAN
31 | #define Py_RETURN_NAN return PyFloat_FromDouble(Py_NAN)
32 | #endif
33 |
34 | #define Py_RETURN_INF(sign) do \
35 | if (copysign(1., sign) == 1.) { \
36 | return PyFloat_FromDouble(Py_HUGE_VAL); \
37 | } else { \
38 | return PyFloat_FromDouble(-Py_HUGE_VAL); \
39 | } while(0)
40 |
41 | PyAPI_FUNC(double) PyFloat_GetMax(void);
42 | PyAPI_FUNC(double) PyFloat_GetMin(void);
43 | PyAPI_FUNC(PyObject *) PyFloat_GetInfo(void);
44 |
45 | /* Return Python float from string PyObject. Second argument ignored on
46 | input, and, if non-NULL, NULL is stored into *junk (this tried to serve a
47 | purpose once but can't be made to work as intended). */
48 | PyAPI_FUNC(PyObject *) PyFloat_FromString(PyObject*, char** junk);
49 |
50 | /* Return Python float from C double. */
51 | PyAPI_FUNC(PyObject *) PyFloat_FromDouble(double);
52 |
53 | /* Extract C double from Python float. The macro version trades safety for
54 | speed. */
55 | PyAPI_FUNC(double) PyFloat_AsDouble(PyObject *);
56 | #define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval)
57 |
58 | /* Write repr(v) into the char buffer argument, followed by null byte. The
59 | buffer must be "big enough"; >= 100 is very safe.
60 | PyFloat_AsReprString(buf, x) strives to print enough digits so that
61 | PyFloat_FromString(buf) then reproduces x exactly. */
62 | PyAPI_FUNC(void) PyFloat_AsReprString(char*, PyFloatObject *v);
63 |
64 | /* Write str(v) into the char buffer argument, followed by null byte. The
65 | buffer must be "big enough"; >= 100 is very safe. Note that it's
66 | unusual to be able to get back the float you started with from
67 | PyFloat_AsString's result -- use PyFloat_AsReprString() if you want to
68 | preserve precision across conversions. */
69 | PyAPI_FUNC(void) PyFloat_AsString(char*, PyFloatObject *v);
70 |
71 | /* _PyFloat_{Pack,Unpack}{4,8}
72 | *
73 | * The struct and pickle (at least) modules need an efficient platform-
74 | * independent way to store floating-point values as byte strings.
75 | * The Pack routines produce a string from a C double, and the Unpack
76 | * routines produce a C double from such a string. The suffix (4 or 8)
77 | * specifies the number of bytes in the string.
78 | *
79 | * On platforms that appear to use (see _PyFloat_Init()) IEEE-754 formats
80 | * these functions work by copying bits. On other platforms, the formats the
81 | * 4- byte format is identical to the IEEE-754 single precision format, and
82 | * the 8-byte format to the IEEE-754 double precision format, although the
83 | * packing of INFs and NaNs (if such things exist on the platform) isn't
84 | * handled correctly, and attempting to unpack a string containing an IEEE
85 | * INF or NaN will raise an exception.
86 | *
87 | * On non-IEEE platforms with more precision, or larger dynamic range, than
88 | * 754 supports, not all values can be packed; on non-IEEE platforms with less
89 | * precision, or smaller dynamic range, not all values can be unpacked. What
90 | * happens in such cases is partly accidental (alas).
91 | */
92 |
93 | /* The pack routines write 4 or 8 bytes, starting at p. le is a bool
94 | * argument, true if you want the string in little-endian format (exponent
95 | * last, at p+3 or p+7), false if you want big-endian format (exponent
96 | * first, at p).
97 | * Return value: 0 if all is OK, -1 if error (and an exception is
98 | * set, most likely OverflowError).
99 | * There are two problems on non-IEEE platforms:
100 | * 1): What this does is undefined if x is a NaN or infinity.
101 | * 2): -0.0 and +0.0 produce the same string.
102 | */
103 | PyAPI_FUNC(int) _PyFloat_Pack4(double x, unsigned char *p, int le);
104 | PyAPI_FUNC(int) _PyFloat_Pack8(double x, unsigned char *p, int le);
105 |
106 | /* Used to get the important decimal digits of a double */
107 | PyAPI_FUNC(int) _PyFloat_Digits(char *buf, double v, int *signum);
108 | PyAPI_FUNC(void) _PyFloat_DigitsInit(void);
109 |
110 | /* The unpack routines read 4 or 8 bytes, starting at p. le is a bool
111 | * argument, true if the string is in little-endian format (exponent
112 | * last, at p+3 or p+7), false if big-endian (exponent first, at p).
113 | * Return value: The unpacked double. On error, this is -1.0 and
114 | * PyErr_Occurred() is true (and an exception is set, most likely
115 | * OverflowError). Note that on a non-IEEE platform this will refuse
116 | * to unpack a string that represents a NaN or infinity.
117 | */
118 | PyAPI_FUNC(double) _PyFloat_Unpack4(const unsigned char *p, int le);
119 | PyAPI_FUNC(double) _PyFloat_Unpack8(const unsigned char *p, int le);
120 |
121 | /* free list api */
122 | PyAPI_FUNC(int) PyFloat_ClearFreeList(void);
123 |
124 | /* Format the object based on the format_spec, as defined in PEP 3101
125 | (Advanced String Formatting). */
126 | PyAPI_FUNC(PyObject *) _PyFloat_FormatAdvanced(PyObject *obj,
127 | char *format_spec,
128 | Py_ssize_t format_spec_len);
129 |
130 | /* Round a C double x to the closest multiple of 10**-ndigits. Returns a
131 | Python float on success, or NULL (with an appropriate exception set) on
132 | failure. Used in builtin_round in bltinmodule.c. */
133 | PyAPI_FUNC(PyObject *) _Py_double_round(double x, int ndigits);
134 |
135 |
136 |
137 | #ifdef __cplusplus
138 | }
139 | #endif
140 | #endif /* !Py_FLOATOBJECT_H */
141 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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(unsigned long) PyInt_AsUnsignedLongMask(PyObject *);
44 | #ifdef HAVE_LONG_LONG
45 | PyAPI_FUNC(unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *);
46 | #endif
47 |
48 | PyAPI_FUNC(long) PyInt_GetMax(void);
49 |
50 | /* Macro, trading safety for speed */
51 | #define PyInt_AS_LONG(op) (((PyIntObject *)(op))->ob_ival)
52 |
53 | /* These aren't really part of the Int object, but they're handy; the protos
54 | * are necessary for systems that need the magic of PyAPI_FUNC and that want
55 | * to have stropmodule as a dynamically loaded module instead of building it
56 | * into the main Python shared library/DLL. Guido thinks I'm weird for
57 | * building it this way. :-) [cjh]
58 | */
59 | PyAPI_FUNC(unsigned long) PyOS_strtoul(char *, char **, int);
60 | PyAPI_FUNC(long) PyOS_strtol(char *, char **, int);
61 |
62 | /* free list api */
63 | PyAPI_FUNC(int) PyInt_ClearFreeList(void);
64 |
65 | /* Convert an integer to the given base. Returns a string.
66 | If base is 2, 8 or 16, add the proper prefix '0b', '0o' or '0x'.
67 | If newstyle is zero, then use the pre-2.6 behavior of octal having
68 | a leading "0" */
69 | PyAPI_FUNC(PyObject*) _PyInt_Format(PyIntObject* v, int base, int newstyle);
70 |
71 | /* Format the object based on the format_spec, as defined in PEP 3101
72 | (Advanced String Formatting). */
73 | PyAPI_FUNC(PyObject *) _PyInt_FormatAdvanced(PyObject *obj,
74 | char *format_spec,
75 | Py_ssize_t format_spec_len);
76 |
77 | #ifdef __cplusplus
78 | }
79 | #endif
80 | #endif /* !Py_INTOBJECT_H */
81 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/listobject.h:
--------------------------------------------------------------------------------
1 |
2 | /* List object interface */
3 |
4 | /*
5 | Another generally useful object type is an 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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/longobject.h:
--------------------------------------------------------------------------------
1 | #ifndef Py_LONGOBJECT_H
2 | #define Py_LONGOBJECT_H
3 | #ifdef __cplusplus
4 | extern "C" {
5 | #endif
6 |
7 |
8 | /* Long (arbitrary precision) integer object interface */
9 |
10 | typedef struct _longobject PyLongObject; /* Revealed in longintrepr.h */
11 |
12 | PyAPI_DATA(PyTypeObject) PyLong_Type;
13 |
14 | #define PyLong_Check(op) \
15 | PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
16 | #define PyLong_CheckExact(op) (Py_TYPE(op) == &PyLong_Type)
17 |
18 | PyAPI_FUNC(PyObject *) PyLong_FromLong(long);
19 | PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLong(unsigned long);
20 | PyAPI_FUNC(PyObject *) PyLong_FromDouble(double);
21 | PyAPI_FUNC(PyObject *) PyLong_FromSize_t(size_t);
22 | PyAPI_FUNC(PyObject *) PyLong_FromSsize_t(Py_ssize_t);
23 | PyAPI_FUNC(long) PyLong_AsLong(PyObject *);
24 | PyAPI_FUNC(long) PyLong_AsLongAndOverflow(PyObject *, int *);
25 | PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLong(PyObject *);
26 | PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLongMask(PyObject *);
27 | PyAPI_FUNC(Py_ssize_t) PyLong_AsSsize_t(PyObject *);
28 | PyAPI_FUNC(PyObject *) PyLong_GetInfo(void);
29 |
30 | /* For use by intobject.c only */
31 | #define _PyLong_AsSsize_t PyLong_AsSsize_t
32 | #define _PyLong_FromSize_t PyLong_FromSize_t
33 | #define _PyLong_FromSsize_t PyLong_FromSsize_t
34 | PyAPI_DATA(int) _PyLong_DigitValue[256];
35 |
36 | /* _PyLong_Frexp returns a double x and an exponent e such that the
37 | true value is approximately equal to x * 2**e. e is >= 0. x is
38 | 0.0 if and only if the input is 0 (in which case, e and x are both
39 | zeroes); otherwise, 0.5 <= abs(x) < 1.0. On overflow, which is
40 | possible if the number of bits doesn't fit into a Py_ssize_t, sets
41 | OverflowError and returns -1.0 for x, 0 for e. */
42 | PyAPI_FUNC(double) _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e);
43 |
44 | PyAPI_FUNC(double) PyLong_AsDouble(PyObject *);
45 | PyAPI_FUNC(PyObject *) PyLong_FromVoidPtr(void *);
46 | PyAPI_FUNC(void *) PyLong_AsVoidPtr(PyObject *);
47 |
48 | #ifdef HAVE_LONG_LONG
49 | PyAPI_FUNC(PyObject *) PyLong_FromLongLong(PY_LONG_LONG);
50 | PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLongLong(unsigned PY_LONG_LONG);
51 | PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLong(PyObject *);
52 | PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLong(PyObject *);
53 | PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *);
54 | PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLongAndOverflow(PyObject *, int *);
55 | #endif /* HAVE_LONG_LONG */
56 |
57 | PyAPI_FUNC(PyObject *) PyLong_FromString(char *, char **, int);
58 | #ifdef Py_USING_UNICODE
59 | PyAPI_FUNC(PyObject *) PyLong_FromUnicode(Py_UNICODE*, Py_ssize_t, int);
60 | #endif
61 |
62 | /* _PyLong_Sign. Return 0 if v is 0, -1 if v < 0, +1 if v > 0.
63 | v must not be NULL, and must be a normalized long.
64 | There are no error cases.
65 | */
66 | PyAPI_FUNC(int) _PyLong_Sign(PyObject *v);
67 |
68 |
69 | /* _PyLong_NumBits. Return the number of bits needed to represent the
70 | absolute value of a long. For example, this returns 1 for 1 and -1, 2
71 | for 2 and -2, and 2 for 3 and -3. It returns 0 for 0.
72 | v must not be NULL, and must be a normalized long.
73 | (size_t)-1 is returned and OverflowError set if the true result doesn't
74 | fit in a size_t.
75 | */
76 | PyAPI_FUNC(size_t) _PyLong_NumBits(PyObject *v);
77 |
78 | /* _PyLong_FromByteArray: View the n unsigned bytes as a binary integer in
79 | base 256, and return a Python long with the same numeric value.
80 | If n is 0, the integer is 0. Else:
81 | If little_endian is 1/true, bytes[n-1] is the MSB and bytes[0] the LSB;
82 | else (little_endian is 0/false) bytes[0] is the MSB and bytes[n-1] the
83 | LSB.
84 | If is_signed is 0/false, view the bytes as a non-negative integer.
85 | If is_signed is 1/true, view the bytes as a 2's-complement integer,
86 | non-negative if bit 0x80 of the MSB is clear, negative if set.
87 | Error returns:
88 | + Return NULL with the appropriate exception set if there's not
89 | enough memory to create the Python long.
90 | */
91 | PyAPI_FUNC(PyObject *) _PyLong_FromByteArray(
92 | const unsigned char* bytes, size_t n,
93 | int little_endian, int is_signed);
94 |
95 | /* _PyLong_AsByteArray: Convert the least-significant 8*n bits of long
96 | v to a base-256 integer, stored in array bytes. Normally return 0,
97 | return -1 on error.
98 | If little_endian is 1/true, store the MSB at bytes[n-1] and the LSB at
99 | bytes[0]; else (little_endian is 0/false) store the MSB at bytes[0] and
100 | the LSB at bytes[n-1].
101 | If is_signed is 0/false, it's an error if v < 0; else (v >= 0) n bytes
102 | are filled and there's nothing special about bit 0x80 of the MSB.
103 | If is_signed is 1/true, bytes is filled with the 2's-complement
104 | representation of v's value. Bit 0x80 of the MSB is the sign bit.
105 | Error returns (-1):
106 | + is_signed is 0 and v < 0. TypeError is set in this case, and bytes
107 | isn't altered.
108 | + n isn't big enough to hold the full mathematical value of v. For
109 | example, if is_signed is 0 and there are more digits in the v than
110 | fit in n; or if is_signed is 1, v < 0, and n is just 1 bit shy of
111 | being large enough to hold a sign bit. OverflowError is set in this
112 | case, but bytes holds the least-signficant n bytes of the true value.
113 | */
114 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
115 | unsigned char* bytes, size_t n,
116 | int little_endian, int is_signed);
117 |
118 | /* _PyLong_Format: Convert the long to a string object with given base,
119 | appending a base prefix of 0[box] if base is 2, 8 or 16.
120 | Add a trailing "L" if addL is non-zero.
121 | If newstyle is zero, then use the pre-2.6 behavior of octal having
122 | a leading "0", instead of the prefix "0o" */
123 | PyAPI_FUNC(PyObject *) _PyLong_Format(PyObject *aa, int base, int addL, int newstyle);
124 |
125 | /* Format the object based on the format_spec, as defined in PEP 3101
126 | (Advanced String Formatting). */
127 | PyAPI_FUNC(PyObject *) _PyLong_FormatAdvanced(PyObject *obj,
128 | char *format_spec,
129 | Py_ssize_t format_spec_len);
130 |
131 | #ifdef __cplusplus
132 | }
133 | #endif
134 | #endif /* !Py_LONGOBJECT_H */
135 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/modsupport.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef Py_MODSUPPORT_H
3 | #define Py_MODSUPPORT_H
4 | #ifdef __cplusplus
5 | extern "C" {
6 | #endif
7 |
8 | /* Module support interface */
9 |
10 | #include
11 |
12 | /* If PY_SSIZE_T_CLEAN is defined, each functions treats #-specifier
13 | to mean Py_ssize_t */
14 | #ifdef PY_SSIZE_T_CLEAN
15 | #define PyArg_Parse _PyArg_Parse_SizeT
16 | #define PyArg_ParseTuple _PyArg_ParseTuple_SizeT
17 | #define PyArg_ParseTupleAndKeywords _PyArg_ParseTupleAndKeywords_SizeT
18 | #define PyArg_VaParse _PyArg_VaParse_SizeT
19 | #define PyArg_VaParseTupleAndKeywords _PyArg_VaParseTupleAndKeywords_SizeT
20 | #define Py_BuildValue _Py_BuildValue_SizeT
21 | #define Py_VaBuildValue _Py_VaBuildValue_SizeT
22 | #else
23 | PyAPI_FUNC(PyObject *) _Py_VaBuildValue_SizeT(const char *, va_list);
24 | #endif
25 |
26 | PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char *, ...);
27 | PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
28 | PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,
29 | const char *, char **, ...);
30 | PyAPI_FUNC(int) PyArg_UnpackTuple(PyObject *, const char *, Py_ssize_t, Py_ssize_t, ...);
31 | PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...);
32 | PyAPI_FUNC(PyObject *) _Py_BuildValue_SizeT(const char *, ...);
33 | PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kw);
34 |
35 | PyAPI_FUNC(int) PyArg_VaParse(PyObject *, const char *, va_list);
36 | PyAPI_FUNC(int) PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *,
37 | const char *, char **, va_list);
38 | PyAPI_FUNC(PyObject *) Py_VaBuildValue(const char *, va_list);
39 |
40 | PyAPI_FUNC(int) PyModule_AddObject(PyObject *, const char *, PyObject *);
41 | PyAPI_FUNC(int) PyModule_AddIntConstant(PyObject *, const char *, long);
42 | PyAPI_FUNC(int) PyModule_AddStringConstant(PyObject *, const char *, const char *);
43 | #define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c)
44 | #define PyModule_AddStringMacro(m, c) PyModule_AddStringConstant(m, #c, c)
45 |
46 | #define PYTHON_API_VERSION 1013
47 | #define PYTHON_API_STRING "1013"
48 | /* The API version is maintained (independently from the Python version)
49 | so we can detect mismatches between the interpreter and dynamically
50 | loaded modules. These are diagnosed by an error message but
51 | the module is still loaded (because the mismatch can only be tested
52 | after loading the module). The error message is intended to
53 | explain the core dump a few seconds later.
54 |
55 | The symbol PYTHON_API_STRING defines the same value as a string
56 | literal. *** PLEASE MAKE SURE THE DEFINITIONS MATCH. ***
57 |
58 | Please add a line or two to the top of this log for each API
59 | version change:
60 |
61 | 22-Feb-2006 MvL 1013 PEP 353 - long indices for sequence lengths
62 |
63 | 19-Aug-2002 GvR 1012 Changes to string object struct for
64 | interning changes, saving 3 bytes.
65 |
66 | 17-Jul-2001 GvR 1011 Descr-branch, just to be on the safe side
67 |
68 | 25-Jan-2001 FLD 1010 Parameters added to PyCode_New() and
69 | PyFrame_New(); Python 2.1a2
70 |
71 | 14-Mar-2000 GvR 1009 Unicode API added
72 |
73 | 3-Jan-1999 GvR 1007 Decided to change back! (Don't reuse 1008!)
74 |
75 | 3-Dec-1998 GvR 1008 Python 1.5.2b1
76 |
77 | 18-Jan-1997 GvR 1007 string interning and other speedups
78 |
79 | 11-Oct-1996 GvR renamed Py_Ellipses to Py_Ellipsis :-(
80 |
81 | 30-Jul-1996 GvR Slice and ellipses syntax added
82 |
83 | 23-Jul-1996 GvR For 1.4 -- better safe than sorry this time :-)
84 |
85 | 7-Nov-1995 GvR Keyword arguments (should've been done at 1.3 :-( )
86 |
87 | 10-Jan-1995 GvR Renamed globals to new naming scheme
88 |
89 | 9-Jan-1995 GvR Initial version (incompatible with older API)
90 | */
91 |
92 | #ifdef MS_WINDOWS
93 | /* Special defines for Windows versions used to live here. Things
94 | have changed, and the "Version" is now in a global string variable.
95 | Reason for this is that this for easier branding of a "custom DLL"
96 | without actually needing a recompile. */
97 | #endif /* MS_WINDOWS */
98 |
99 | #if SIZEOF_SIZE_T != SIZEOF_INT
100 | /* On a 64-bit system, rename the Py_InitModule4 so that 2.4
101 | modules cannot get loaded into a 2.5 interpreter */
102 | #define Py_InitModule4 Py_InitModule4_64
103 | #endif
104 |
105 | #ifdef Py_TRACE_REFS
106 | /* When we are tracing reference counts, rename Py_InitModule4 so
107 | modules compiled with incompatible settings will generate a
108 | link-time error. */
109 | #if SIZEOF_SIZE_T != SIZEOF_INT
110 | #undef Py_InitModule4
111 | #define Py_InitModule4 Py_InitModule4TraceRefs_64
112 | #else
113 | #define Py_InitModule4 Py_InitModule4TraceRefs
114 | #endif
115 | #endif
116 |
117 | PyAPI_FUNC(PyObject *) Py_InitModule4(const char *name, PyMethodDef *methods,
118 | const char *doc, PyObject *self,
119 | int apiver);
120 |
121 | #define Py_InitModule(name, methods) \
122 | Py_InitModule4(name, methods, (char *)NULL, (PyObject *)NULL, \
123 | PYTHON_API_VERSION)
124 |
125 | #define Py_InitModule3(name, methods, doc) \
126 | Py_InitModule4(name, methods, doc, (PyObject *)NULL, \
127 | PYTHON_API_VERSION)
128 |
129 | PyAPI_DATA(char *) _Py_PackageContext;
130 |
131 | #ifdef __cplusplus
132 | }
133 | #endif
134 | #endif /* !Py_MODSUPPORT_H */
135 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
24 | /* Node access functions */
25 | #define NCH(n) ((n)->n_nchildren)
26 |
27 | #define CHILD(n, i) (&(n)->n_child[i])
28 | #define RCHILD(n, i) (CHILD(n, NCH(n) + i))
29 | #define TYPE(n) ((n)->n_type)
30 | #define STR(n) ((n)->n_str)
31 |
32 | /* Assert that the type of a node is what we expect */
33 | #define REQ(n, type) assert(TYPE(n) == (type))
34 |
35 | PyAPI_FUNC(void) PyNode_ListTree(node *);
36 |
37 | #ifdef __cplusplus
38 | }
39 | #endif
40 | #endif /* !Py_NODE_H */
41 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/opcode.h:
--------------------------------------------------------------------------------
1 | #ifndef Py_OPCODE_H
2 | #define Py_OPCODE_H
3 | #ifdef __cplusplus
4 | extern "C" {
5 | #endif
6 |
7 |
8 | /* Instruction opcodes for compiled code */
9 |
10 | #define STOP_CODE 0
11 | #define POP_TOP 1
12 | #define ROT_TWO 2
13 | #define ROT_THREE 3
14 | #define DUP_TOP 4
15 | #define ROT_FOUR 5
16 | #define NOP 9
17 |
18 | #define UNARY_POSITIVE 10
19 | #define UNARY_NEGATIVE 11
20 | #define UNARY_NOT 12
21 | #define UNARY_CONVERT 13
22 |
23 | #define UNARY_INVERT 15
24 |
25 | #define BINARY_POWER 19
26 |
27 | #define BINARY_MULTIPLY 20
28 | #define BINARY_DIVIDE 21
29 | #define BINARY_MODULO 22
30 | #define BINARY_ADD 23
31 | #define BINARY_SUBTRACT 24
32 | #define BINARY_SUBSCR 25
33 | #define BINARY_FLOOR_DIVIDE 26
34 | #define BINARY_TRUE_DIVIDE 27
35 | #define INPLACE_FLOOR_DIVIDE 28
36 | #define INPLACE_TRUE_DIVIDE 29
37 |
38 | #define SLICE 30
39 | /* Also uses 31-33 */
40 |
41 | #define STORE_SLICE 40
42 | /* Also uses 41-43 */
43 |
44 | #define DELETE_SLICE 50
45 | /* Also uses 51-53 */
46 |
47 | #define STORE_MAP 54
48 | #define INPLACE_ADD 55
49 | #define INPLACE_SUBTRACT 56
50 | #define INPLACE_MULTIPLY 57
51 | #define INPLACE_DIVIDE 58
52 | #define INPLACE_MODULO 59
53 | #define STORE_SUBSCR 60
54 | #define DELETE_SUBSCR 61
55 |
56 | #define BINARY_LSHIFT 62
57 | #define BINARY_RSHIFT 63
58 | #define BINARY_AND 64
59 | #define BINARY_XOR 65
60 | #define BINARY_OR 66
61 | #define INPLACE_POWER 67
62 | #define GET_ITER 68
63 |
64 | #define PRINT_EXPR 70
65 | #define PRINT_ITEM 71
66 | #define PRINT_NEWLINE 72
67 | #define PRINT_ITEM_TO 73
68 | #define PRINT_NEWLINE_TO 74
69 | #define INPLACE_LSHIFT 75
70 | #define INPLACE_RSHIFT 76
71 | #define INPLACE_AND 77
72 | #define INPLACE_XOR 78
73 | #define INPLACE_OR 79
74 | #define BREAK_LOOP 80
75 | #define WITH_CLEANUP 81
76 | #define LOAD_LOCALS 82
77 | #define RETURN_VALUE 83
78 | #define IMPORT_STAR 84
79 | #define EXEC_STMT 85
80 | #define YIELD_VALUE 86
81 | #define POP_BLOCK 87
82 | #define END_FINALLY 88
83 | #define BUILD_CLASS 89
84 |
85 | #define HAVE_ARGUMENT 90 /* Opcodes from here have an argument: */
86 |
87 | #define STORE_NAME 90 /* Index in name list */
88 | #define DELETE_NAME 91 /* "" */
89 | #define UNPACK_SEQUENCE 92 /* Number of sequence items */
90 | #define FOR_ITER 93
91 | #define LIST_APPEND 94
92 |
93 | #define STORE_ATTR 95 /* Index in name list */
94 | #define DELETE_ATTR 96 /* "" */
95 | #define STORE_GLOBAL 97 /* "" */
96 | #define DELETE_GLOBAL 98 /* "" */
97 | #define DUP_TOPX 99 /* number of items to duplicate */
98 | #define LOAD_CONST 100 /* Index in const list */
99 | #define LOAD_NAME 101 /* Index in name list */
100 | #define BUILD_TUPLE 102 /* Number of tuple items */
101 | #define BUILD_LIST 103 /* Number of list items */
102 | #define BUILD_SET 104 /* Number of set items */
103 | #define BUILD_MAP 105 /* Always zero for now */
104 | #define LOAD_ATTR 106 /* Index in name list */
105 | #define COMPARE_OP 107 /* Comparison operator */
106 | #define IMPORT_NAME 108 /* Index in name list */
107 | #define IMPORT_FROM 109 /* Index in name list */
108 | #define JUMP_FORWARD 110 /* Number of bytes to skip */
109 |
110 | #define JUMP_IF_FALSE_OR_POP 111 /* Target byte offset from beginning
111 | of code */
112 | #define JUMP_IF_TRUE_OR_POP 112 /* "" */
113 | #define JUMP_ABSOLUTE 113 /* "" */
114 | #define POP_JUMP_IF_FALSE 114 /* "" */
115 | #define POP_JUMP_IF_TRUE 115 /* "" */
116 |
117 | #define LOAD_GLOBAL 116 /* Index in name list */
118 |
119 | #define CONTINUE_LOOP 119 /* Start of loop (absolute) */
120 | #define SETUP_LOOP 120 /* Target address (relative) */
121 | #define SETUP_EXCEPT 121 /* "" */
122 | #define SETUP_FINALLY 122 /* "" */
123 |
124 | #define LOAD_FAST 124 /* Local variable number */
125 | #define STORE_FAST 125 /* Local variable number */
126 | #define DELETE_FAST 126 /* Local variable number */
127 |
128 | #define RAISE_VARARGS 130 /* Number of raise arguments (1, 2 or 3) */
129 | /* CALL_FUNCTION_XXX opcodes defined below depend on this definition */
130 | #define CALL_FUNCTION 131 /* #args + (#kwargs<<8) */
131 | #define MAKE_FUNCTION 132 /* #defaults */
132 | #define BUILD_SLICE 133 /* Number of items */
133 |
134 | #define MAKE_CLOSURE 134 /* #free vars */
135 | #define LOAD_CLOSURE 135 /* Load free variable from closure */
136 | #define LOAD_DEREF 136 /* Load and dereference from closure cell */
137 | #define STORE_DEREF 137 /* Store into cell */
138 |
139 | /* The next 3 opcodes must be contiguous and satisfy
140 | (CALL_FUNCTION_VAR - CALL_FUNCTION) & 3 == 1 */
141 | #define CALL_FUNCTION_VAR 140 /* #args + (#kwargs<<8) */
142 | #define CALL_FUNCTION_KW 141 /* #args + (#kwargs<<8) */
143 | #define CALL_FUNCTION_VAR_KW 142 /* #args + (#kwargs<<8) */
144 |
145 | #define SETUP_WITH 143
146 |
147 | /* Support for opargs more than 16 bits long */
148 | #define EXTENDED_ARG 145
149 |
150 | #define SET_ADD 146
151 | #define MAP_ADD 147
152 |
153 |
154 | enum cmp_op {PyCmp_LT=Py_LT, PyCmp_LE=Py_LE, PyCmp_EQ=Py_EQ, PyCmp_NE=Py_NE, PyCmp_GT=Py_GT, PyCmp_GE=Py_GE,
155 | PyCmp_IN, PyCmp_NOT_IN, PyCmp_IS, PyCmp_IS_NOT, PyCmp_EXC_MATCH, PyCmp_BAD};
156 |
157 | #define HAS_ARG(op) ((op) >= HAVE_ARGUMENT)
158 |
159 | #ifdef __cplusplus
160 | }
161 | #endif
162 | #endif /* !Py_OPCODE_H */
163 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 | #ifndef MAXPATHLEN
40 | #if defined(PATH_MAX) && PATH_MAX > 1024
41 | #define MAXPATHLEN PATH_MAX
42 | #else
43 | #define MAXPATHLEN 1024
44 | #endif
45 | #endif
46 |
47 | /* Search path entry delimiter */
48 | #ifndef DELIM
49 | #define DELIM ':'
50 | #endif
51 |
52 | #ifdef __cplusplus
53 | }
54 | #endif
55 | #endif /* !Py_OSDEFS_H */
56 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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.in 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 2
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.2"
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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/py_curses.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef Py_CURSES_H
3 | #define Py_CURSES_H
4 |
5 | #ifdef __APPLE__
6 | /*
7 | ** On Mac OS X 10.2 [n]curses.h and stdlib.h use different guards
8 | ** against multiple definition of wchar_t.
9 | */
10 | #ifdef _BSD_WCHAR_T_DEFINED_
11 | #define _WCHAR_T
12 | #endif
13 |
14 | /* the following define is necessary for OS X 10.6; without it, the
15 | Apple-supplied ncurses.h sets NCURSES_OPAQUE to 1, and then Python
16 | can't get at the WINDOW flags field. */
17 | #define NCURSES_OPAQUE 0
18 | #endif /* __APPLE__ */
19 |
20 | #ifdef __FreeBSD__
21 | /*
22 | ** On FreeBSD, [n]curses.h and stdlib.h/wchar.h use different guards
23 | ** against multiple definition of wchar_t and wint_t.
24 | */
25 | #ifdef _XOPEN_SOURCE_EXTENDED
26 | #ifndef __FreeBSD_version
27 | #include
28 | #endif
29 | #if __FreeBSD_version >= 500000
30 | #ifndef __wchar_t
31 | #define __wchar_t
32 | #endif
33 | #ifndef __wint_t
34 | #define __wint_t
35 | #endif
36 | #else
37 | #ifndef _WCHAR_T
38 | #define _WCHAR_T
39 | #endif
40 | #ifndef _WINT_T
41 | #define _WINT_T
42 | #endif
43 | #endif
44 | #endif
45 | #endif
46 |
47 | #ifdef HAVE_NCURSES_H
48 | #include
49 | #else
50 | #include
51 | #ifdef HAVE_TERM_H
52 | /* for tigetstr, which is not declared in SysV curses */
53 | #include
54 | #endif
55 | #endif
56 |
57 | #ifdef HAVE_NCURSES_H
58 | /* configure was checking , but we will
59 | use , which has all these features. */
60 | #ifndef WINDOW_HAS_FLAGS
61 | #define WINDOW_HAS_FLAGS 1
62 | #endif
63 | #ifndef MVWDELCH_IS_EXPRESSION
64 | #define MVWDELCH_IS_EXPRESSION 1
65 | #endif
66 | #endif
67 |
68 | #ifdef __cplusplus
69 | extern "C" {
70 | #endif
71 |
72 | #define PyCurses_API_pointers 4
73 |
74 | /* Type declarations */
75 |
76 | typedef struct {
77 | PyObject_HEAD
78 | WINDOW *win;
79 | } PyCursesWindowObject;
80 |
81 | #define PyCursesWindow_Check(v) (Py_TYPE(v) == &PyCursesWindow_Type)
82 |
83 | #define PyCurses_CAPSULE_NAME "_curses._C_API"
84 |
85 |
86 | #ifdef CURSES_MODULE
87 | /* This section is used when compiling _cursesmodule.c */
88 |
89 | #else
90 | /* This section is used in modules that use the _cursesmodule API */
91 |
92 | static void **PyCurses_API;
93 |
94 | #define PyCursesWindow_Type (*(PyTypeObject *) PyCurses_API[0])
95 | #define PyCursesSetupTermCalled {if (! ((int (*)(void))PyCurses_API[1]) () ) return NULL;}
96 | #define PyCursesInitialised {if (! ((int (*)(void))PyCurses_API[2]) () ) return NULL;}
97 | #define PyCursesInitialisedColor {if (! ((int (*)(void))PyCurses_API[3]) () ) return NULL;}
98 |
99 | #define import_curses() \
100 | PyCurses_API = (void **)PyCapsule_Import(PyCurses_CAPSULE_NAME, 1);
101 |
102 | #endif
103 |
104 | /* general error messages */
105 | static char *catchall_ERR = "curses function returned ERR";
106 | static char *catchall_NULL = "curses function returned NULL";
107 |
108 | /* Function Prototype Macros - They are ugly but very, very useful. ;-)
109 |
110 | X - function name
111 | TYPE - parameter Type
112 | ERGSTR - format string for construction of the return value
113 | PARSESTR - format string for argument parsing
114 | */
115 |
116 | #define NoArgNoReturnFunction(X) \
117 | static PyObject *PyCurses_ ## X (PyObject *self) \
118 | { \
119 | PyCursesInitialised \
120 | return PyCursesCheckERR(X(), # X); }
121 |
122 | #define NoArgOrFlagNoReturnFunction(X) \
123 | static PyObject *PyCurses_ ## X (PyObject *self, PyObject *args) \
124 | { \
125 | int flag = 0; \
126 | PyCursesInitialised \
127 | switch(PyTuple_Size(args)) { \
128 | case 0: \
129 | return PyCursesCheckERR(X(), # X); \
130 | case 1: \
131 | if (!PyArg_ParseTuple(args, "i;True(1) or False(0)", &flag)) return NULL; \
132 | if (flag) return PyCursesCheckERR(X(), # X); \
133 | else return PyCursesCheckERR(no ## X (), # X); \
134 | default: \
135 | PyErr_SetString(PyExc_TypeError, # X " requires 0 or 1 arguments"); \
136 | return NULL; } }
137 |
138 | #define NoArgReturnIntFunction(X) \
139 | static PyObject *PyCurses_ ## X (PyObject *self) \
140 | { \
141 | PyCursesInitialised \
142 | return PyInt_FromLong((long) X()); }
143 |
144 |
145 | #define NoArgReturnStringFunction(X) \
146 | static PyObject *PyCurses_ ## X (PyObject *self) \
147 | { \
148 | PyCursesInitialised \
149 | return PyString_FromString(X()); }
150 |
151 | #define NoArgTrueFalseFunction(X) \
152 | static PyObject *PyCurses_ ## X (PyObject *self) \
153 | { \
154 | PyCursesInitialised \
155 | if (X () == FALSE) { \
156 | Py_INCREF(Py_False); \
157 | return Py_False; \
158 | } \
159 | Py_INCREF(Py_True); \
160 | return Py_True; }
161 |
162 | #define NoArgNoReturnVoidFunction(X) \
163 | static PyObject *PyCurses_ ## X (PyObject *self) \
164 | { \
165 | PyCursesInitialised \
166 | X(); \
167 | Py_INCREF(Py_None); \
168 | return Py_None; }
169 |
170 | #ifdef __cplusplus
171 | }
172 | #endif
173 |
174 | #endif /* !defined(Py_CURSES_H) */
175 |
176 |
177 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 | extern 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 | extern const unsigned char _Py_ctype_tolower[256];
26 | extern 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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
30 | /* this is a wrapper around getenv() that pays attention to
31 | Py_IgnoreEnvironmentFlag. It should be used for getting variables like
32 | PYTHONPATH and PYTHONHOME from the environment */
33 | #define Py_GETENV(s) (Py_IgnoreEnvironmentFlag ? NULL : getenv(s))
34 |
35 | PyAPI_FUNC(void) Py_FatalError(const char *message);
36 |
37 | #ifdef __cplusplus
38 | }
39 | #endif
40 | #endif /* !Py_PYDEBUG_H */
41 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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(int) _PyOS_GetOpt(int argc, char **argv, char *optstring);
13 |
14 | #ifdef __cplusplus
15 | }
16 | #endif
17 | #endif /* !Py_PYGETOPT_H */
18 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 argments, 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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/pymem.h:
--------------------------------------------------------------------------------
1 | /* The PyMem_ family: low-level memory allocation interfaces.
2 | See objimpl.h for the PyObject_ memory family.
3 | */
4 |
5 | #ifndef Py_PYMEM_H
6 | #define Py_PYMEM_H
7 |
8 | #include "pyport.h"
9 |
10 | #ifdef __cplusplus
11 | extern "C" {
12 | #endif
13 |
14 | /* BEWARE:
15 |
16 | Each interface exports both functions and macros. Extension modules should
17 | use the functions, to ensure binary compatibility across Python versions.
18 | Because the Python implementation is free to change internal details, and
19 | the macros may (or may not) expose details for speed, if you do use the
20 | macros you must recompile your extensions with each Python release.
21 |
22 | Never mix calls to PyMem_ with calls to the platform malloc/realloc/
23 | calloc/free. For example, on Windows different DLLs may end up using
24 | different heaps, and if you use PyMem_Malloc you'll get the memory from the
25 | heap used by the Python DLL; it could be a disaster if you free()'ed that
26 | directly in your own extension. Using PyMem_Free instead ensures Python
27 | can return the memory to the proper heap. As another example, in
28 | PYMALLOC_DEBUG mode, Python wraps all calls to all PyMem_ and PyObject_
29 | memory functions in special debugging wrappers that add additional
30 | debugging info to dynamic memory blocks. The system routines have no idea
31 | what to do with that stuff, and the Python wrappers have no idea what to do
32 | with raw blocks obtained directly by the system routines then.
33 |
34 | The GIL must be held when using these APIs.
35 | */
36 |
37 | /*
38 | * Raw memory interface
39 | * ====================
40 | */
41 |
42 | /* Functions
43 |
44 | Functions supplying platform-independent semantics for malloc/realloc/
45 | free. These functions make sure that allocating 0 bytes returns a distinct
46 | non-NULL pointer (whenever possible -- if we're flat out of memory, NULL
47 | may be returned), even if the platform malloc and realloc don't.
48 | Returned pointers must be checked for NULL explicitly. No action is
49 | performed on failure (no exception is set, no warning is printed, etc).
50 | */
51 |
52 | PyAPI_FUNC(void *) PyMem_Malloc(size_t);
53 | PyAPI_FUNC(void *) PyMem_Realloc(void *, size_t);
54 | PyAPI_FUNC(void) PyMem_Free(void *);
55 |
56 | /* Starting from Python 1.6, the wrappers Py_{Malloc,Realloc,Free} are
57 | no longer supported. They used to call PyErr_NoMemory() on failure. */
58 |
59 | /* Macros. */
60 | #ifdef PYMALLOC_DEBUG
61 | /* Redirect all memory operations to Python's debugging allocator. */
62 | #define PyMem_MALLOC _PyMem_DebugMalloc
63 | #define PyMem_REALLOC _PyMem_DebugRealloc
64 | #define PyMem_FREE _PyMem_DebugFree
65 |
66 | #else /* ! PYMALLOC_DEBUG */
67 |
68 | /* PyMem_MALLOC(0) means malloc(1). Some systems would return NULL
69 | for malloc(0), which would be treated as an error. Some platforms
70 | would return a pointer with no memory behind it, which would break
71 | pymalloc. To solve these problems, allocate an extra byte. */
72 | /* Returns NULL to indicate error if a negative size or size larger than
73 | Py_ssize_t can represent is supplied. Helps prevents security holes. */
74 | #define PyMem_MALLOC(n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
75 | : malloc((n) ? (n) : 1))
76 | #define PyMem_REALLOC(p, n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
77 | : realloc((p), (n) ? (n) : 1))
78 | #define PyMem_FREE free
79 |
80 | #endif /* PYMALLOC_DEBUG */
81 |
82 | /*
83 | * Type-oriented memory interface
84 | * ==============================
85 | *
86 | * Allocate memory for n objects of the given type. Returns a new pointer
87 | * or NULL if the request was too large or memory allocation failed. Use
88 | * these macros rather than doing the multiplication yourself so that proper
89 | * overflow checking is always done.
90 | */
91 |
92 | #define PyMem_New(type, n) \
93 | ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
94 | ( (type *) PyMem_Malloc((n) * sizeof(type)) ) )
95 | #define PyMem_NEW(type, n) \
96 | ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
97 | ( (type *) PyMem_MALLOC((n) * sizeof(type)) ) )
98 |
99 | /*
100 | * The value of (p) is always clobbered by this macro regardless of success.
101 | * The caller MUST check if (p) is NULL afterwards and deal with the memory
102 | * error if so. This means the original value of (p) MUST be saved for the
103 | * caller's memory error handler to not lose track of it.
104 | */
105 | #define PyMem_Resize(p, type, n) \
106 | ( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
107 | (type *) PyMem_Realloc((p), (n) * sizeof(type)) )
108 | #define PyMem_RESIZE(p, type, n) \
109 | ( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
110 | (type *) PyMem_REALLOC((p), (n) * sizeof(type)) )
111 |
112 | /* PyMem{Del,DEL} are left over from ancient days, and shouldn't be used
113 | * anymore. They're just confusing aliases for PyMem_{Free,FREE} now.
114 | */
115 | #define PyMem_Del PyMem_Free
116 | #define PyMem_DEL PyMem_FREE
117 |
118 | #ifdef __cplusplus
119 | }
120 | #endif
121 |
122 | #endif /* !Py_PYMEM_H */
123 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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_DATA(PyObject *) _PySys_TraceFunc, *_PySys_ProfileFunc;
23 | PyAPI_DATA(int) _PySys_CheckInterval;
24 |
25 | PyAPI_FUNC(void) PySys_ResetWarnOptions(void);
26 | PyAPI_FUNC(void) PySys_AddWarnOption(char *);
27 | PyAPI_FUNC(int) PySys_HasWarnOptions(void);
28 |
29 | #ifdef __cplusplus
30 | }
31 | #endif
32 | #endif /* !Py_SYSMODULE_H */
33 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
20 | #ifdef __cplusplus
21 | }
22 | #endif
23 | #endif /* TIMEFUNCS_H */
24 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 |
--------------------------------------------------------------------------------
/build_dependencies/python/include/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 | /* This macro calls PyWeakref_CheckRef() last since that can involve a
53 | function call; this makes it more likely that the function call
54 | will be avoided. */
55 | #define PyWeakref_Check(op) \
56 | (PyWeakref_CheckRef(op) || PyWeakref_CheckProxy(op))
57 |
58 |
59 | PyAPI_FUNC(PyObject *) PyWeakref_NewRef(PyObject *ob,
60 | PyObject *callback);
61 | PyAPI_FUNC(PyObject *) PyWeakref_NewProxy(PyObject *ob,
62 | PyObject *callback);
63 | PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref);
64 |
65 | PyAPI_FUNC(Py_ssize_t) _PyWeakref_GetWeakrefCount(PyWeakReference *head);
66 |
67 | PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self);
68 |
69 | #define PyWeakref_GET_OBJECT(ref) (((PyWeakReference *)(ref))->wr_object)
70 |
71 |
72 | #ifdef __cplusplus
73 | }
74 | #endif
75 | #endif /* !Py_WEAKREFOBJECT_H */
76 |
--------------------------------------------------------------------------------
/build_dependencies/python/libpython2.7.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/M4rtinK/android-pyside-example-project/13877d449844edb0dee2efff1f2f98fe1fd4f7b5/build_dependencies/python/libpython2.7.so
--------------------------------------------------------------------------------
/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include "main.h"
4 | #include
5 | int main(int argc, char *argv[])
6 | {
7 | setenv("PYTHONHOME", PYTHON_HOME, 1);
8 | setenv("PYTHONPATH", PYTHON_PATH, 1);
9 | setenv("LD_LIBRARY_PATH", LD_LIBRARY_PATH, 1);
10 | setenv("PATH", PATH, 1);
11 | setenv("M_THEME_DIR", THEME_PATH, 1);
12 | setenv("QML_IMPORT_PATH", QML_IMPORT_PATH, 1);
13 | setenv("PYSIDE_APPLICATION_FOLDER", PYSIDE_APPLICATION_FOLDER, 1);
14 |
15 | //QApplication app(argc, argv);
16 | Py_Initialize();
17 | PySys_SetArgv(argc, argv);
18 | PySys_SetPath(PYTHON_PATH);
19 | FILE *fp = fopen(MAIN_PYTHON_FILE, "r");
20 | PyRun_SimpleFile(fp, MAIN_PYTHON_FILE);
21 | fclose(fp);
22 | Py_Finalize();
23 | //app.exec();
24 | }
25 |
--------------------------------------------------------------------------------
/main.h:
--------------------------------------------------------------------------------
1 | #ifndef MAIN_H
2 | #define MAIN_H
3 |
4 | #define MAIN_PYTHON_FILE "/data/data/org.modrana.PySideExample/files/main.py"
5 |
6 | #define PYTHON_HOME "/data/data/org.modrana.PySideExample/files/python/"
7 |
8 | #define PYTHON_PATH "/data/data/org.modrana.PySideExample/files/python/lib/python2.7/lib-dynload:/data/data/org.modrana.PySideExample/files/python/lib/python2.7/:/data/data/org.modrana.PySideExample/files/python/lib/python2.7/site-packages:/data/data/org.modrana.PySideExample/files/python/lib"
9 |
10 | #define LD_LIBRARY_PATH "/data/data/org.modrana.PySideExample/files/python/lib:/data/data/org.modrana.PySideExample/files/python/lib/python2.7/lib-dynload:/data/data/org.kde.necessitas.ministro/files/qt/lib/"
11 |
12 | #define PATH "/data/data/org.modrana.PySideExample/files/python/bin:$PATH"
13 |
14 | #define THEME_PATH "/data/data/org.modrana.PySideExample/files/python/themes/"
15 |
16 | #define QML_IMPORT_PATH "/data/data/org.modrana.PySideExample/files/python/imports/"
17 |
18 | #define PYSIDE_APPLICATION_FOLDER "/data/data/org.modrana.PySideExample/"
19 |
20 | #endif // MAIN_H
21 |
--------------------------------------------------------------------------------
/rename_project.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # renames the application
4 | # -> just replace NEW_NAME and NEW_UNIQU_NAME with with valid names of you choice and you are set :)
5 | #
6 | # NOTE: value NEW_UNIQUE_NAME should be unique as not to clash with other
7 | # unique Android application names
8 |
9 | NEW_NAME="BarApp"
10 | NEW_UNIQUE_NAME="foo.foomatic.${NEW_NAME}"
11 |
12 | mv PySideExample.pro "${NEW_NAME}.pro"
13 | sed -i "s/PySideExample/${NEW_NAME}/g" "${NEW_NAME}.pro"
14 | sed -i "s/org.modrana.PySideExample/${NEW_UNIQUE_NAME}/g" main.h
15 | sed -i "s/org.modrana.PySideExample/${NEW_UNIQUE_NAME}/g" android/src/org/kde/necessitas/origo/QtActivity.java
16 | sed -i "s/org.modrana.PySideExample/${NEW_UNIQUE_NAME}/g" android/AndroidManifest.xml
17 | sed -i "s/PySideExample/${NEW_NAME}/g" android/AndroidManifest.xml
18 | sed -i "s/PySideExample/${NEW_NAME}/g" android/res/values/strings.xml
19 | sed -i "s/PySideExample/${NEW_NAME}/g" android/build.xml
20 |
--------------------------------------------------------------------------------