pytron-kit 0.3.12__py3-none-macosx_11_0_universal2.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (419) hide show
  1. pytron/__init__.py +112 -0
  2. pytron/application.py +562 -0
  3. pytron/apputils/__init__.py +0 -0
  4. pytron/apputils/chrome_ipc.py +203 -0
  5. pytron/apputils/codegen.py +261 -0
  6. pytron/apputils/config.py +303 -0
  7. pytron/apputils/deadmansswitch.py +47 -0
  8. pytron/apputils/extras.py +76 -0
  9. pytron/apputils/native.py +148 -0
  10. pytron/apputils/shell.py +73 -0
  11. pytron/apputils/windows.py +286 -0
  12. pytron/cli.py +384 -0
  13. pytron/commands/__init__.py +0 -0
  14. pytron/commands/android.py +28 -0
  15. pytron/commands/build.py +26 -0
  16. pytron/commands/doctor.py +221 -0
  17. pytron/commands/engine.py +23 -0
  18. pytron/commands/frontend.py +60 -0
  19. pytron/commands/harvest.py +112 -0
  20. pytron/commands/helpers.py +239 -0
  21. pytron/commands/info.py +50 -0
  22. pytron/commands/init.py +521 -0
  23. pytron/commands/install.py +294 -0
  24. pytron/commands/login.py +130 -0
  25. pytron/commands/package.py +228 -0
  26. pytron/commands/plugin.py +442 -0
  27. pytron/commands/run.py +312 -0
  28. pytron/commands/scan.py +210 -0
  29. pytron/commands/show.py +23 -0
  30. pytron/commands/uninstall.py +150 -0
  31. pytron/commands/utils.py +42 -0
  32. pytron/commands/workflow.py +95 -0
  33. pytron/console.py +133 -0
  34. pytron/core.py +18 -0
  35. pytron/dependencies/WebView2Loader.dll +0 -0
  36. pytron/dependencies/__init__.py +1 -0
  37. pytron/dependencies/pytron_native.so +0 -0
  38. pytron/engines/chrome/adapter.py +445 -0
  39. pytron/engines/chrome/engine.py +576 -0
  40. pytron/engines/chrome/forge.py +147 -0
  41. pytron/engines/chrome/shell/package.json +8 -0
  42. pytron/engines/chrome/shell/preload.js +12 -0
  43. pytron/engines/chrome/shell/shell.js +534 -0
  44. pytron/exceptions.py +36 -0
  45. pytron/inspector.py +201 -0
  46. pytron/inspector_ui.py +512 -0
  47. pytron/installer/Installation.nsi +236 -0
  48. pytron/installer/header.bmp +0 -0
  49. pytron/installer/pytron.ico +0 -0
  50. pytron/installer/sidebar.bmp +0 -0
  51. pytron/llms.md +98 -0
  52. pytron/manifests/README.md +29 -0
  53. pytron/manifests/windows-utf8.manifest +44 -0
  54. pytron/menu.py +128 -0
  55. pytron/nsis-setup.exe +0 -0
  56. pytron/pack/__init__.py +0 -0
  57. pytron/pack/assets.py +131 -0
  58. pytron/pack/compilers.py +289 -0
  59. pytron/pack/crystal.py +297 -0
  60. pytron/pack/graph.py +377 -0
  61. pytron/pack/inference.py +157 -0
  62. pytron/pack/installers.py +402 -0
  63. pytron/pack/introspect.py +357 -0
  64. pytron/pack/metadata.py +213 -0
  65. pytron/pack/modules.py +618 -0
  66. pytron/pack/nuitka.py +108 -0
  67. pytron/pack/pipeline.py +107 -0
  68. pytron/pack/pyinstaller.py +176 -0
  69. pytron/pack/rust_engine.py +273 -0
  70. pytron/pack/secure.py +309 -0
  71. pytron/pack/secure_loader/bin/pytron_rust_bootloader +0 -0
  72. pytron/pack/secure_loader/icon.ico +0 -0
  73. pytron/pack/utils.py +110 -0
  74. pytron/pack/virtual_root.py +124 -0
  75. pytron/platforms/__init__.py +0 -0
  76. pytron/platforms/android/__init__.py +3 -0
  77. pytron/platforms/android/android.py +103 -0
  78. pytron/platforms/android/builder.py +736 -0
  79. pytron/platforms/android/ops/build.py +79 -0
  80. pytron/platforms/android/ops/init.py +63 -0
  81. pytron/platforms/android/ops/run.py +79 -0
  82. pytron/platforms/android/ops/sync.py +770 -0
  83. pytron/platforms/android/ops/utils.py +8 -0
  84. pytron/platforms/android/shell/README.md +30 -0
  85. pytron/platforms/android/shell/app/build.gradle +64 -0
  86. pytron/platforms/android/shell/app/src/main/AndroidManifest.xml +29 -0
  87. pytron/platforms/android/shell/app/src/main/assets/python/main.py +86 -0
  88. pytron/platforms/android/shell/app/src/main/assets/python/python314.zip +0 -0
  89. pytron/platforms/android/shell/app/src/main/cpp/CMakeLists.txt +25 -0
  90. pytron/platforms/android/shell/app/src/main/cpp/include/Python.h +155 -0
  91. pytron/platforms/android/shell/app/src/main/cpp/include/abstract.h +915 -0
  92. pytron/platforms/android/shell/app/src/main/cpp/include/audit.h +30 -0
  93. pytron/platforms/android/shell/app/src/main/cpp/include/bltinmodule.h +14 -0
  94. pytron/platforms/android/shell/app/src/main/cpp/include/boolobject.h +54 -0
  95. pytron/platforms/android/shell/app/src/main/cpp/include/bytearrayobject.h +44 -0
  96. pytron/platforms/android/shell/app/src/main/cpp/include/bytesobject.h +66 -0
  97. pytron/platforms/android/shell/app/src/main/cpp/include/ceval.h +145 -0
  98. pytron/platforms/android/shell/app/src/main/cpp/include/codecs.h +176 -0
  99. pytron/platforms/android/shell/app/src/main/cpp/include/compile.h +22 -0
  100. pytron/platforms/android/shell/app/src/main/cpp/include/complexobject.h +30 -0
  101. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/abstract.h +104 -0
  102. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/audit.h +8 -0
  103. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/bytearrayobject.h +38 -0
  104. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/bytesobject.h +42 -0
  105. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/cellobject.h +50 -0
  106. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/ceval.h +43 -0
  107. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/classobject.h +71 -0
  108. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/code.h +340 -0
  109. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/compile.h +50 -0
  110. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/complexobject.h +33 -0
  111. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/context.h +107 -0
  112. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/critical_section.h +154 -0
  113. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/descrobject.h +62 -0
  114. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/dictobject.h +105 -0
  115. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/fileobject.h +16 -0
  116. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/fileutils.h +16 -0
  117. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/floatobject.h +27 -0
  118. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/frameobject.h +35 -0
  119. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/funcobject.h +185 -0
  120. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/genobject.h +56 -0
  121. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/import.h +30 -0
  122. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/initconfig.h +334 -0
  123. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/listobject.h +53 -0
  124. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/lock.h +74 -0
  125. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/longintrepr.h +184 -0
  126. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/longobject.h +89 -0
  127. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/memoryobject.h +50 -0
  128. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/methodobject.h +66 -0
  129. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/modsupport.h +26 -0
  130. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/monitoring.h +269 -0
  131. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/object.h +493 -0
  132. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/objimpl.h +104 -0
  133. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/odictobject.h +43 -0
  134. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/picklebufobject.h +31 -0
  135. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pthread_stubs.h +105 -0
  136. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic.h +614 -0
  137. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_gcc.h +615 -0
  138. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_msc.h +1197 -0
  139. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_std.h +1112 -0
  140. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyctype.h +39 -0
  141. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pydebug.h +38 -0
  142. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyerrors.h +132 -0
  143. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyfpe.h +15 -0
  144. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyframe.h +45 -0
  145. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyhash.h +54 -0
  146. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pylifecycle.h +89 -0
  147. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pymem.h +84 -0
  148. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pystate.h +275 -0
  149. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pystats.h +194 -0
  150. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pythonrun.h +96 -0
  151. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pythread.h +43 -0
  152. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pytime.h +27 -0
  153. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/setobject.h +71 -0
  154. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/traceback.h +13 -0
  155. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/tracemalloc.h +32 -0
  156. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/tupleobject.h +40 -0
  157. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/unicodeobject.h +773 -0
  158. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/warnings.h +20 -0
  159. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/weakrefobject.h +66 -0
  160. pytron/platforms/android/shell/app/src/main/cpp/include/critical_section.h +16 -0
  161. pytron/platforms/android/shell/app/src/main/cpp/include/datetime.h +267 -0
  162. pytron/platforms/android/shell/app/src/main/cpp/include/descrobject.h +100 -0
  163. pytron/platforms/android/shell/app/src/main/cpp/include/dictobject.h +108 -0
  164. pytron/platforms/android/shell/app/src/main/cpp/include/dynamic_annotations.h +499 -0
  165. pytron/platforms/android/shell/app/src/main/cpp/include/enumobject.h +17 -0
  166. pytron/platforms/android/shell/app/src/main/cpp/include/errcode.h +45 -0
  167. pytron/platforms/android/shell/app/src/main/cpp/include/exports.h +105 -0
  168. pytron/platforms/android/shell/app/src/main/cpp/include/fileobject.h +41 -0
  169. pytron/platforms/android/shell/app/src/main/cpp/include/fileutils.h +62 -0
  170. pytron/platforms/android/shell/app/src/main/cpp/include/floatobject.h +54 -0
  171. pytron/platforms/android/shell/app/src/main/cpp/include/frameobject.h +20 -0
  172. pytron/platforms/android/shell/app/src/main/cpp/include/genericaliasobject.h +14 -0
  173. pytron/platforms/android/shell/app/src/main/cpp/include/import.h +103 -0
  174. pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/atomic.h +392 -0
  175. pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/internal.h +969 -0
  176. pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/prim.h +329 -0
  177. pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/track.h +147 -0
  178. pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/types.h +721 -0
  179. pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc.h +565 -0
  180. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_abstract.h +61 -0
  181. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_asdl.h +112 -0
  182. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ast.h +945 -0
  183. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ast_state.h +271 -0
  184. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_atexit.h +31 -0
  185. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_audit.h +35 -0
  186. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_backoff.h +133 -0
  187. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bitutils.h +186 -0
  188. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_blocks_output_buffer.h +321 -0
  189. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_brc.h +73 -0
  190. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bytes_methods.h +82 -0
  191. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bytesobject.h +149 -0
  192. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_c_array.h +39 -0
  193. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_call.h +206 -0
  194. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_capsule.h +17 -0
  195. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_cell.h +75 -0
  196. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ceval.h +390 -0
  197. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ceval_state.h +48 -0
  198. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_code.h +671 -0
  199. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_codecs.h +76 -0
  200. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_compile.h +230 -0
  201. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_complexobject.h +34 -0
  202. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_condvar.h +93 -0
  203. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_context.h +59 -0
  204. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_critical_section.h +237 -0
  205. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_crossinterp.h +406 -0
  206. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_crossinterp_data_registry.h +41 -0
  207. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_debug_offsets.h +379 -0
  208. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_descrobject.h +28 -0
  209. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dict.h +410 -0
  210. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dict_state.h +28 -0
  211. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dtoa.h +40 -0
  212. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_emscripten_signal.h +30 -0
  213. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_emscripten_trampoline.h +70 -0
  214. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_exceptions.h +40 -0
  215. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_faulthandler.h +100 -0
  216. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_fileutils.h +320 -0
  217. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_fileutils_windows.h +98 -0
  218. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_floatobject.h +49 -0
  219. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_flowgraph.h +47 -0
  220. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_format.h +27 -0
  221. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_frame.h +61 -0
  222. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_freelist.h +111 -0
  223. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_freelist_state.h +70 -0
  224. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_function.h +53 -0
  225. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_gc.h +378 -0
  226. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_genobject.h +43 -0
  227. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_getopt.h +22 -0
  228. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_gil.h +66 -0
  229. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_objects.h +34 -0
  230. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_objects_fini_generated.h +1592 -0
  231. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_strings.h +854 -0
  232. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_hamt.h +113 -0
  233. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_hashtable.h +150 -0
  234. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_import.h +141 -0
  235. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_importdl.h +139 -0
  236. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_index_pool.h +36 -0
  237. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_initconfig.h +197 -0
  238. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_instruction_sequence.h +83 -0
  239. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_instruments.h +127 -0
  240. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interp.h +109 -0
  241. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interp_structs.h +977 -0
  242. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpframe.h +401 -0
  243. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpframe_structs.h +95 -0
  244. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpolation.h +26 -0
  245. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_intrinsics.h +51 -0
  246. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_jit.h +29 -0
  247. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_list.h +81 -0
  248. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_llist.h +106 -0
  249. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_lock.h +236 -0
  250. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_long.h +319 -0
  251. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_magic_number.h +305 -0
  252. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_memoryobject.h +20 -0
  253. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_mimalloc.h +69 -0
  254. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_modsupport.h +99 -0
  255. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_moduleobject.h +62 -0
  256. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_namespace.h +21 -0
  257. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object.h +1029 -0
  258. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_alloc.h +71 -0
  259. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_deferred.h +32 -0
  260. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_stack.h +95 -0
  261. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_state.h +49 -0
  262. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_obmalloc.h +702 -0
  263. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_obmalloc_init.h +66 -0
  264. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_opcode_metadata.h +2117 -0
  265. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_opcode_utils.h +90 -0
  266. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_optimizer.h +318 -0
  267. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_parking_lot.h +97 -0
  268. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_parser.h +78 -0
  269. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pathconfig.h +26 -0
  270. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyarena.h +68 -0
  271. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyatomic_ft_wrappers.h +174 -0
  272. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pybuffer.h +21 -0
  273. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyerrors.h +213 -0
  274. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyhash.h +91 -0
  275. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pylifecycle.h +136 -0
  276. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymath.h +205 -0
  277. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymem.h +145 -0
  278. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymem_init.h +103 -0
  279. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pystate.h +339 -0
  280. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pystats.h +21 -0
  281. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pythonrun.h +68 -0
  282. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pythread.h +172 -0
  283. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_qsbr.h +172 -0
  284. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_range.h +21 -0
  285. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime.h +63 -0
  286. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_init.h +239 -0
  287. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_init_generated.h +1589 -0
  288. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_structs.h +310 -0
  289. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_semaphore.h +67 -0
  290. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_setobject.h +41 -0
  291. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_signal.h +108 -0
  292. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_sliceobject.h +20 -0
  293. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_stackref.h +791 -0
  294. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_stats.h +97 -0
  295. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_strhex.h +39 -0
  296. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_structs.h +88 -0
  297. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_structseq.h +40 -0
  298. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_symtable.h +201 -0
  299. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_sysmodule.h +32 -0
  300. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_template.h +26 -0
  301. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_time.h +334 -0
  302. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_token.h +110 -0
  303. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_traceback.h +111 -0
  304. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tracemalloc.h +164 -0
  305. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tstate.h +88 -0
  306. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tuple.h +75 -0
  307. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typedefs.h +18 -0
  308. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typeobject.h +155 -0
  309. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typevarobject.h +28 -0
  310. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ucnhash.h +36 -0
  311. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unicodeobject.h +308 -0
  312. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unicodeobject_generated.h +3132 -0
  313. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unionobject.h +26 -0
  314. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uniqueid.h +57 -0
  315. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uop_ids.h +335 -0
  316. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uop_metadata.h +1204 -0
  317. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_warnings.h +21 -0
  318. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_weakref.h +133 -0
  319. pytron/platforms/android/shell/app/src/main/cpp/include/intrcheck.h +23 -0
  320. pytron/platforms/android/shell/app/src/main/cpp/include/iterobject.h +24 -0
  321. pytron/platforms/android/shell/app/src/main/cpp/include/listobject.h +55 -0
  322. pytron/platforms/android/shell/app/src/main/cpp/include/lock.h +16 -0
  323. pytron/platforms/android/shell/app/src/main/cpp/include/longobject.h +178 -0
  324. pytron/platforms/android/shell/app/src/main/cpp/include/marshal.h +31 -0
  325. pytron/platforms/android/shell/app/src/main/cpp/include/memoryobject.h +34 -0
  326. pytron/platforms/android/shell/app/src/main/cpp/include/methodobject.h +146 -0
  327. pytron/platforms/android/shell/app/src/main/cpp/include/modsupport.h +146 -0
  328. pytron/platforms/android/shell/app/src/main/cpp/include/moduleobject.h +122 -0
  329. pytron/platforms/android/shell/app/src/main/cpp/include/monitoring.h +18 -0
  330. pytron/platforms/android/shell/app/src/main/cpp/include/object.h +828 -0
  331. pytron/platforms/android/shell/app/src/main/cpp/include/objimpl.h +211 -0
  332. pytron/platforms/android/shell/app/src/main/cpp/include/opcode.h +43 -0
  333. pytron/platforms/android/shell/app/src/main/cpp/include/opcode_ids.h +259 -0
  334. pytron/platforms/android/shell/app/src/main/cpp/include/osdefs.h +57 -0
  335. pytron/platforms/android/shell/app/src/main/cpp/include/osmodule.h +17 -0
  336. pytron/platforms/android/shell/app/src/main/cpp/include/patchlevel.h +49 -0
  337. pytron/platforms/android/shell/app/src/main/cpp/include/py_curses.h +117 -0
  338. pytron/platforms/android/shell/app/src/main/cpp/include/pyatomic.h +16 -0
  339. pytron/platforms/android/shell/app/src/main/cpp/include/pybuffer.h +145 -0
  340. pytron/platforms/android/shell/app/src/main/cpp/include/pycapsule.h +58 -0
  341. pytron/platforms/android/shell/app/src/main/cpp/include/pyconfig.h +2088 -0
  342. pytron/platforms/android/shell/app/src/main/cpp/include/pydtrace.h +59 -0
  343. pytron/platforms/android/shell/app/src/main/cpp/include/pyerrors.h +335 -0
  344. pytron/platforms/android/shell/app/src/main/cpp/include/pyexpat.h +62 -0
  345. pytron/platforms/android/shell/app/src/main/cpp/include/pyframe.h +26 -0
  346. pytron/platforms/android/shell/app/src/main/cpp/include/pyhash.h +59 -0
  347. pytron/platforms/android/shell/app/src/main/cpp/include/pylifecycle.h +80 -0
  348. pytron/platforms/android/shell/app/src/main/cpp/include/pymacconfig.h +91 -0
  349. pytron/platforms/android/shell/app/src/main/cpp/include/pymacro.h +243 -0
  350. pytron/platforms/android/shell/app/src/main/cpp/include/pymath.h +65 -0
  351. pytron/platforms/android/shell/app/src/main/cpp/include/pymem.h +110 -0
  352. pytron/platforms/android/shell/app/src/main/cpp/include/pyport.h +710 -0
  353. pytron/platforms/android/shell/app/src/main/cpp/include/pystate.h +132 -0
  354. pytron/platforms/android/shell/app/src/main/cpp/include/pystats.h +28 -0
  355. pytron/platforms/android/shell/app/src/main/cpp/include/pystrcmp.h +23 -0
  356. pytron/platforms/android/shell/app/src/main/cpp/include/pystrtod.h +37 -0
  357. pytron/platforms/android/shell/app/src/main/cpp/include/pythonrun.h +42 -0
  358. pytron/platforms/android/shell/app/src/main/cpp/include/pythread.h +131 -0
  359. pytron/platforms/android/shell/app/src/main/cpp/include/pytypedefs.h +30 -0
  360. pytron/platforms/android/shell/app/src/main/cpp/include/rangeobject.h +27 -0
  361. pytron/platforms/android/shell/app/src/main/cpp/include/refcount.h +555 -0
  362. pytron/platforms/android/shell/app/src/main/cpp/include/setobject.h +49 -0
  363. pytron/platforms/android/shell/app/src/main/cpp/include/sliceobject.h +69 -0
  364. pytron/platforms/android/shell/app/src/main/cpp/include/structmember.h +56 -0
  365. pytron/platforms/android/shell/app/src/main/cpp/include/structseq.h +46 -0
  366. pytron/platforms/android/shell/app/src/main/cpp/include/sysmodule.h +27 -0
  367. pytron/platforms/android/shell/app/src/main/cpp/include/traceback.h +26 -0
  368. pytron/platforms/android/shell/app/src/main/cpp/include/tupleobject.h +46 -0
  369. pytron/platforms/android/shell/app/src/main/cpp/include/typeslots.h +96 -0
  370. pytron/platforms/android/shell/app/src/main/cpp/include/unicodeobject.h +1029 -0
  371. pytron/platforms/android/shell/app/src/main/cpp/include/warnings.h +45 -0
  372. pytron/platforms/android/shell/app/src/main/cpp/include/weakrefobject.h +46 -0
  373. pytron/platforms/android/shell/app/src/main/cpp/pytron_bridge.cpp +224 -0
  374. pytron/platforms/android/shell/app/src/main/java/com/pytron/shell/MainActivity.kt +208 -0
  375. pytron/platforms/android/shell/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  376. pytron/platforms/android/shell/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  377. pytron/platforms/android/shell/build.gradle +11 -0
  378. pytron/platforms/android/shell/gradle/wrapper/gradle-wrapper.jar +0 -0
  379. pytron/platforms/android/shell/gradle/wrapper/gradle-wrapper.properties +5 -0
  380. pytron/platforms/android/shell/gradle.properties +2 -0
  381. pytron/platforms/android/shell/gradlew.bat +85 -0
  382. pytron/platforms/android/shell/settings.gradle +16 -0
  383. pytron/platforms/darwin.py +82 -0
  384. pytron/platforms/darwin_ops/libs.py +31 -0
  385. pytron/platforms/darwin_ops/system.py +182 -0
  386. pytron/platforms/darwin_ops/utils.py +85 -0
  387. pytron/platforms/darwin_ops/webview.py +5 -0
  388. pytron/platforms/darwin_ops/window.py +102 -0
  389. pytron/platforms/interface.py +152 -0
  390. pytron/platforms/linux.py +82 -0
  391. pytron/platforms/linux_ops/libs.py +49 -0
  392. pytron/platforms/linux_ops/system.py +316 -0
  393. pytron/platforms/linux_ops/utils.py +19 -0
  394. pytron/platforms/linux_ops/webview.py +5 -0
  395. pytron/platforms/linux_ops/window.py +115 -0
  396. pytron/platforms/windows.py +136 -0
  397. pytron/platforms/windows_ops/__init__.py +0 -0
  398. pytron/platforms/windows_ops/constants.py +126 -0
  399. pytron/platforms/windows_ops/system.py +518 -0
  400. pytron/platforms/windows_ops/utils.py +3 -0
  401. pytron/platforms/windows_ops/webview.py +5 -0
  402. pytron/platforms/windows_ops/window.py +361 -0
  403. pytron/plugin.py +467 -0
  404. pytron/rcedit-x64.exe +0 -0
  405. pytron/router.py +146 -0
  406. pytron/serializer.py +240 -0
  407. pytron/shortcuts.py +279 -0
  408. pytron/state.py +76 -0
  409. pytron/tray.py +399 -0
  410. pytron/updater.py +181 -0
  411. pytron/utf8_hook.py +112 -0
  412. pytron/utils.py +44 -0
  413. pytron/webview.py +722 -0
  414. pytron_kit-0.3.12.dist-info/METADATA +131 -0
  415. pytron_kit-0.3.12.dist-info/RECORD +419 -0
  416. pytron_kit-0.3.12.dist-info/WHEEL +5 -0
  417. pytron_kit-0.3.12.dist-info/entry_points.txt +2 -0
  418. pytron_kit-0.3.12.dist-info/licenses/LICENSE +201 -0
  419. pytron_kit-0.3.12.dist-info/top_level.txt +1 -0
@@ -0,0 +1,499 @@
1
+ /* Copyright (c) 2008-2009, Google Inc.
2
+ * All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions are
6
+ * met:
7
+ *
8
+ * * Redistributions of source code must retain the above copyright
9
+ * notice, this list of conditions and the following disclaimer.
10
+ * * Neither the name of Google Inc. nor the names of its
11
+ * contributors may be used to endorse or promote products derived from
12
+ * this software without specific prior written permission.
13
+ *
14
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
+ *
26
+ * ---
27
+ * Author: Kostya Serebryany
28
+ * Copied to CPython by Jeffrey Yasskin, with all macros renamed to
29
+ * start with _Py_ to avoid colliding with users embedding Python, and
30
+ * with deprecated macros removed.
31
+ */
32
+
33
+ /* This file defines dynamic annotations for use with dynamic analysis
34
+ tool such as valgrind, PIN, etc.
35
+
36
+ Dynamic annotation is a source code annotation that affects
37
+ the generated code (that is, the annotation is not a comment).
38
+ Each such annotation is attached to a particular
39
+ instruction and/or to a particular object (address) in the program.
40
+
41
+ The annotations that should be used by users are macros in all upper-case
42
+ (e.g., _Py_ANNOTATE_NEW_MEMORY).
43
+
44
+ Actual implementation of these macros may differ depending on the
45
+ dynamic analysis tool being used.
46
+
47
+ See https://code.google.com/p/data-race-test/ for more information.
48
+
49
+ This file supports the following dynamic analysis tools:
50
+ - None (DYNAMIC_ANNOTATIONS_ENABLED is not defined or zero).
51
+ Macros are defined empty.
52
+ - ThreadSanitizer, Helgrind, DRD (DYNAMIC_ANNOTATIONS_ENABLED is 1).
53
+ Macros are defined as calls to non-inlinable empty functions
54
+ that are intercepted by Valgrind. */
55
+
56
+ #ifndef __DYNAMIC_ANNOTATIONS_H__
57
+ #define __DYNAMIC_ANNOTATIONS_H__
58
+
59
+ #ifndef DYNAMIC_ANNOTATIONS_ENABLED
60
+ # define DYNAMIC_ANNOTATIONS_ENABLED 0
61
+ #endif
62
+
63
+ #if DYNAMIC_ANNOTATIONS_ENABLED != 0
64
+
65
+ /* -------------------------------------------------------------
66
+ Annotations useful when implementing condition variables such as CondVar,
67
+ using conditional critical sections (Await/LockWhen) and when constructing
68
+ user-defined synchronization mechanisms.
69
+
70
+ The annotations _Py_ANNOTATE_HAPPENS_BEFORE() and
71
+ _Py_ANNOTATE_HAPPENS_AFTER() can be used to define happens-before arcs in
72
+ user-defined synchronization mechanisms: the race detector will infer an
73
+ arc from the former to the latter when they share the same argument
74
+ pointer.
75
+
76
+ Example 1 (reference counting):
77
+
78
+ void Unref() {
79
+ _Py_ANNOTATE_HAPPENS_BEFORE(&refcount_);
80
+ if (AtomicDecrementByOne(&refcount_) == 0) {
81
+ _Py_ANNOTATE_HAPPENS_AFTER(&refcount_);
82
+ delete this;
83
+ }
84
+ }
85
+
86
+ Example 2 (message queue):
87
+
88
+ void MyQueue::Put(Type *e) {
89
+ MutexLock lock(&mu_);
90
+ _Py_ANNOTATE_HAPPENS_BEFORE(e);
91
+ PutElementIntoMyQueue(e);
92
+ }
93
+
94
+ Type *MyQueue::Get() {
95
+ MutexLock lock(&mu_);
96
+ Type *e = GetElementFromMyQueue();
97
+ _Py_ANNOTATE_HAPPENS_AFTER(e);
98
+ return e;
99
+ }
100
+
101
+ Note: when possible, please use the existing reference counting and message
102
+ queue implementations instead of inventing new ones. */
103
+
104
+ /* Report that wait on the condition variable at address "cv" has succeeded
105
+ and the lock at address "lock" is held. */
106
+ #define _Py_ANNOTATE_CONDVAR_LOCK_WAIT(cv, lock) \
107
+ AnnotateCondVarWait(__FILE__, __LINE__, cv, lock)
108
+
109
+ /* Report that wait on the condition variable at "cv" has succeeded. Variant
110
+ w/o lock. */
111
+ #define _Py_ANNOTATE_CONDVAR_WAIT(cv) \
112
+ AnnotateCondVarWait(__FILE__, __LINE__, cv, NULL)
113
+
114
+ /* Report that we are about to signal on the condition variable at address
115
+ "cv". */
116
+ #define _Py_ANNOTATE_CONDVAR_SIGNAL(cv) \
117
+ AnnotateCondVarSignal(__FILE__, __LINE__, cv)
118
+
119
+ /* Report that we are about to signal_all on the condition variable at "cv". */
120
+ #define _Py_ANNOTATE_CONDVAR_SIGNAL_ALL(cv) \
121
+ AnnotateCondVarSignalAll(__FILE__, __LINE__, cv)
122
+
123
+ /* Annotations for user-defined synchronization mechanisms. */
124
+ #define _Py_ANNOTATE_HAPPENS_BEFORE(obj) _Py_ANNOTATE_CONDVAR_SIGNAL(obj)
125
+ #define _Py_ANNOTATE_HAPPENS_AFTER(obj) _Py_ANNOTATE_CONDVAR_WAIT(obj)
126
+
127
+ /* Report that the bytes in the range [pointer, pointer+size) are about
128
+ to be published safely. The race checker will create a happens-before
129
+ arc from the call _Py_ANNOTATE_PUBLISH_MEMORY_RANGE(pointer, size) to
130
+ subsequent accesses to this memory.
131
+ Note: this annotation may not work properly if the race detector uses
132
+ sampling, i.e. does not observe all memory accesses.
133
+ */
134
+ #define _Py_ANNOTATE_PUBLISH_MEMORY_RANGE(pointer, size) \
135
+ AnnotatePublishMemoryRange(__FILE__, __LINE__, pointer, size)
136
+
137
+ /* Instruct the tool to create a happens-before arc between mu->Unlock() and
138
+ mu->Lock(). This annotation may slow down the race detector and hide real
139
+ races. Normally it is used only when it would be difficult to annotate each
140
+ of the mutex's critical sections individually using the annotations above.
141
+ This annotation makes sense only for hybrid race detectors. For pure
142
+ happens-before detectors this is a no-op. For more details see
143
+ https://code.google.com/p/data-race-test/wiki/PureHappensBeforeVsHybrid . */
144
+ #define _Py_ANNOTATE_PURE_HAPPENS_BEFORE_MUTEX(mu) \
145
+ AnnotateMutexIsUsedAsCondVar(__FILE__, __LINE__, mu)
146
+
147
+ /* -------------------------------------------------------------
148
+ Annotations useful when defining memory allocators, or when memory that
149
+ was protected in one way starts to be protected in another. */
150
+
151
+ /* Report that a new memory at "address" of size "size" has been allocated.
152
+ This might be used when the memory has been retrieved from a free list and
153
+ is about to be reused, or when the locking discipline for a variable
154
+ changes. */
155
+ #define _Py_ANNOTATE_NEW_MEMORY(address, size) \
156
+ AnnotateNewMemory(__FILE__, __LINE__, address, size)
157
+
158
+ /* -------------------------------------------------------------
159
+ Annotations useful when defining FIFO queues that transfer data between
160
+ threads. */
161
+
162
+ /* Report that the producer-consumer queue (such as ProducerConsumerQueue) at
163
+ address "pcq" has been created. The _Py_ANNOTATE_PCQ_* annotations should
164
+ be used only for FIFO queues. For non-FIFO queues use
165
+ _Py_ANNOTATE_HAPPENS_BEFORE (for put) and _Py_ANNOTATE_HAPPENS_AFTER (for
166
+ get). */
167
+ #define _Py_ANNOTATE_PCQ_CREATE(pcq) \
168
+ AnnotatePCQCreate(__FILE__, __LINE__, pcq)
169
+
170
+ /* Report that the queue at address "pcq" is about to be destroyed. */
171
+ #define _Py_ANNOTATE_PCQ_DESTROY(pcq) \
172
+ AnnotatePCQDestroy(__FILE__, __LINE__, pcq)
173
+
174
+ /* Report that we are about to put an element into a FIFO queue at address
175
+ "pcq". */
176
+ #define _Py_ANNOTATE_PCQ_PUT(pcq) \
177
+ AnnotatePCQPut(__FILE__, __LINE__, pcq)
178
+
179
+ /* Report that we've just got an element from a FIFO queue at address "pcq". */
180
+ #define _Py_ANNOTATE_PCQ_GET(pcq) \
181
+ AnnotatePCQGet(__FILE__, __LINE__, pcq)
182
+
183
+ /* -------------------------------------------------------------
184
+ Annotations that suppress errors. It is usually better to express the
185
+ program's synchronization using the other annotations, but these can
186
+ be used when all else fails. */
187
+
188
+ /* Report that we may have a benign race at "pointer", with size
189
+ "sizeof(*(pointer))". "pointer" must be a non-void* pointer. Insert at the
190
+ point where "pointer" has been allocated, preferably close to the point
191
+ where the race happens. See also _Py_ANNOTATE_BENIGN_RACE_STATIC. */
192
+ #define _Py_ANNOTATE_BENIGN_RACE(pointer, description) \
193
+ AnnotateBenignRaceSized(__FILE__, __LINE__, pointer, \
194
+ sizeof(*(pointer)), description)
195
+
196
+ /* Same as _Py_ANNOTATE_BENIGN_RACE(address, description), but applies to
197
+ the memory range [address, address+size). */
198
+ #define _Py_ANNOTATE_BENIGN_RACE_SIZED(address, size, description) \
199
+ AnnotateBenignRaceSized(__FILE__, __LINE__, address, size, description)
200
+
201
+ /* Request the analysis tool to ignore all reads in the current thread
202
+ until _Py_ANNOTATE_IGNORE_READS_END is called.
203
+ Useful to ignore intentional racey reads, while still checking
204
+ other reads and all writes.
205
+ See also _Py_ANNOTATE_UNPROTECTED_READ. */
206
+ #define _Py_ANNOTATE_IGNORE_READS_BEGIN() \
207
+ AnnotateIgnoreReadsBegin(__FILE__, __LINE__)
208
+
209
+ /* Stop ignoring reads. */
210
+ #define _Py_ANNOTATE_IGNORE_READS_END() \
211
+ AnnotateIgnoreReadsEnd(__FILE__, __LINE__)
212
+
213
+ /* Similar to _Py_ANNOTATE_IGNORE_READS_BEGIN, but ignore writes. */
214
+ #define _Py_ANNOTATE_IGNORE_WRITES_BEGIN() \
215
+ AnnotateIgnoreWritesBegin(__FILE__, __LINE__)
216
+
217
+ /* Stop ignoring writes. */
218
+ #define _Py_ANNOTATE_IGNORE_WRITES_END() \
219
+ AnnotateIgnoreWritesEnd(__FILE__, __LINE__)
220
+
221
+ /* Start ignoring all memory accesses (reads and writes). */
222
+ #define _Py_ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() \
223
+ do {\
224
+ _Py_ANNOTATE_IGNORE_READS_BEGIN();\
225
+ _Py_ANNOTATE_IGNORE_WRITES_BEGIN();\
226
+ }while(0)\
227
+
228
+ /* Stop ignoring all memory accesses. */
229
+ #define _Py_ANNOTATE_IGNORE_READS_AND_WRITES_END() \
230
+ do {\
231
+ _Py_ANNOTATE_IGNORE_WRITES_END();\
232
+ _Py_ANNOTATE_IGNORE_READS_END();\
233
+ }while(0)\
234
+
235
+ /* Similar to _Py_ANNOTATE_IGNORE_READS_BEGIN, but ignore synchronization events:
236
+ RWLOCK* and CONDVAR*. */
237
+ #define _Py_ANNOTATE_IGNORE_SYNC_BEGIN() \
238
+ AnnotateIgnoreSyncBegin(__FILE__, __LINE__)
239
+
240
+ /* Stop ignoring sync events. */
241
+ #define _Py_ANNOTATE_IGNORE_SYNC_END() \
242
+ AnnotateIgnoreSyncEnd(__FILE__, __LINE__)
243
+
244
+
245
+ /* Enable (enable!=0) or disable (enable==0) race detection for all threads.
246
+ This annotation could be useful if you want to skip expensive race analysis
247
+ during some period of program execution, e.g. during initialization. */
248
+ #define _Py_ANNOTATE_ENABLE_RACE_DETECTION(enable) \
249
+ AnnotateEnableRaceDetection(__FILE__, __LINE__, enable)
250
+
251
+ /* -------------------------------------------------------------
252
+ Annotations useful for debugging. */
253
+
254
+ /* Request to trace every access to "address". */
255
+ #define _Py_ANNOTATE_TRACE_MEMORY(address) \
256
+ AnnotateTraceMemory(__FILE__, __LINE__, address)
257
+
258
+ /* Report the current thread name to a race detector. */
259
+ #define _Py_ANNOTATE_THREAD_NAME(name) \
260
+ AnnotateThreadName(__FILE__, __LINE__, name)
261
+
262
+ /* -------------------------------------------------------------
263
+ Annotations useful when implementing locks. They are not
264
+ normally needed by modules that merely use locks.
265
+ The "lock" argument is a pointer to the lock object. */
266
+
267
+ /* Report that a lock has been created at address "lock". */
268
+ #define _Py_ANNOTATE_RWLOCK_CREATE(lock) \
269
+ AnnotateRWLockCreate(__FILE__, __LINE__, lock)
270
+
271
+ /* Report that the lock at address "lock" is about to be destroyed. */
272
+ #define _Py_ANNOTATE_RWLOCK_DESTROY(lock) \
273
+ AnnotateRWLockDestroy(__FILE__, __LINE__, lock)
274
+
275
+ /* Report that the lock at address "lock" has been acquired.
276
+ is_w=1 for writer lock, is_w=0 for reader lock. */
277
+ #define _Py_ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) \
278
+ AnnotateRWLockAcquired(__FILE__, __LINE__, lock, is_w)
279
+
280
+ /* Report that the lock at address "lock" is about to be released. */
281
+ #define _Py_ANNOTATE_RWLOCK_RELEASED(lock, is_w) \
282
+ AnnotateRWLockReleased(__FILE__, __LINE__, lock, is_w)
283
+
284
+ /* -------------------------------------------------------------
285
+ Annotations useful when implementing barriers. They are not
286
+ normally needed by modules that merely use barriers.
287
+ The "barrier" argument is a pointer to the barrier object. */
288
+
289
+ /* Report that the "barrier" has been initialized with initial "count".
290
+ If 'reinitialization_allowed' is true, initialization is allowed to happen
291
+ multiple times w/o calling barrier_destroy() */
292
+ #define _Py_ANNOTATE_BARRIER_INIT(barrier, count, reinitialization_allowed) \
293
+ AnnotateBarrierInit(__FILE__, __LINE__, barrier, count, \
294
+ reinitialization_allowed)
295
+
296
+ /* Report that we are about to enter barrier_wait("barrier"). */
297
+ #define _Py_ANNOTATE_BARRIER_WAIT_BEFORE(barrier) \
298
+ AnnotateBarrierWaitBefore(__FILE__, __LINE__, barrier)
299
+
300
+ /* Report that we just exited barrier_wait("barrier"). */
301
+ #define _Py_ANNOTATE_BARRIER_WAIT_AFTER(barrier) \
302
+ AnnotateBarrierWaitAfter(__FILE__, __LINE__, barrier)
303
+
304
+ /* Report that the "barrier" has been destroyed. */
305
+ #define _Py_ANNOTATE_BARRIER_DESTROY(barrier) \
306
+ AnnotateBarrierDestroy(__FILE__, __LINE__, barrier)
307
+
308
+ /* -------------------------------------------------------------
309
+ Annotations useful for testing race detectors. */
310
+
311
+ /* Report that we expect a race on the variable at "address".
312
+ Use only in unit tests for a race detector. */
313
+ #define _Py_ANNOTATE_EXPECT_RACE(address, description) \
314
+ AnnotateExpectRace(__FILE__, __LINE__, address, description)
315
+
316
+ /* A no-op. Insert where you like to test the interceptors. */
317
+ #define _Py_ANNOTATE_NO_OP(arg) \
318
+ AnnotateNoOp(__FILE__, __LINE__, arg)
319
+
320
+ /* Force the race detector to flush its state. The actual effect depends on
321
+ * the implementation of the detector. */
322
+ #define _Py_ANNOTATE_FLUSH_STATE() \
323
+ AnnotateFlushState(__FILE__, __LINE__)
324
+
325
+
326
+ #else /* DYNAMIC_ANNOTATIONS_ENABLED == 0 */
327
+
328
+ #define _Py_ANNOTATE_RWLOCK_CREATE(lock) /* empty */
329
+ #define _Py_ANNOTATE_RWLOCK_DESTROY(lock) /* empty */
330
+ #define _Py_ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) /* empty */
331
+ #define _Py_ANNOTATE_RWLOCK_RELEASED(lock, is_w) /* empty */
332
+ #define _Py_ANNOTATE_BARRIER_INIT(barrier, count, reinitialization_allowed) /* */
333
+ #define _Py_ANNOTATE_BARRIER_WAIT_BEFORE(barrier) /* empty */
334
+ #define _Py_ANNOTATE_BARRIER_WAIT_AFTER(barrier) /* empty */
335
+ #define _Py_ANNOTATE_BARRIER_DESTROY(barrier) /* empty */
336
+ #define _Py_ANNOTATE_CONDVAR_LOCK_WAIT(cv, lock) /* empty */
337
+ #define _Py_ANNOTATE_CONDVAR_WAIT(cv) /* empty */
338
+ #define _Py_ANNOTATE_CONDVAR_SIGNAL(cv) /* empty */
339
+ #define _Py_ANNOTATE_CONDVAR_SIGNAL_ALL(cv) /* empty */
340
+ #define _Py_ANNOTATE_HAPPENS_BEFORE(obj) /* empty */
341
+ #define _Py_ANNOTATE_HAPPENS_AFTER(obj) /* empty */
342
+ #define _Py_ANNOTATE_PUBLISH_MEMORY_RANGE(address, size) /* empty */
343
+ #define _Py_ANNOTATE_UNPUBLISH_MEMORY_RANGE(address, size) /* empty */
344
+ #define _Py_ANNOTATE_SWAP_MEMORY_RANGE(address, size) /* empty */
345
+ #define _Py_ANNOTATE_PCQ_CREATE(pcq) /* empty */
346
+ #define _Py_ANNOTATE_PCQ_DESTROY(pcq) /* empty */
347
+ #define _Py_ANNOTATE_PCQ_PUT(pcq) /* empty */
348
+ #define _Py_ANNOTATE_PCQ_GET(pcq) /* empty */
349
+ #define _Py_ANNOTATE_NEW_MEMORY(address, size) /* empty */
350
+ #define _Py_ANNOTATE_EXPECT_RACE(address, description) /* empty */
351
+ #define _Py_ANNOTATE_BENIGN_RACE(address, description) /* empty */
352
+ #define _Py_ANNOTATE_BENIGN_RACE_SIZED(address, size, description) /* empty */
353
+ #define _Py_ANNOTATE_PURE_HAPPENS_BEFORE_MUTEX(mu) /* empty */
354
+ #define _Py_ANNOTATE_MUTEX_IS_USED_AS_CONDVAR(mu) /* empty */
355
+ #define _Py_ANNOTATE_TRACE_MEMORY(arg) /* empty */
356
+ #define _Py_ANNOTATE_THREAD_NAME(name) /* empty */
357
+ #define _Py_ANNOTATE_IGNORE_READS_BEGIN() /* empty */
358
+ #define _Py_ANNOTATE_IGNORE_READS_END() /* empty */
359
+ #define _Py_ANNOTATE_IGNORE_WRITES_BEGIN() /* empty */
360
+ #define _Py_ANNOTATE_IGNORE_WRITES_END() /* empty */
361
+ #define _Py_ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() /* empty */
362
+ #define _Py_ANNOTATE_IGNORE_READS_AND_WRITES_END() /* empty */
363
+ #define _Py_ANNOTATE_IGNORE_SYNC_BEGIN() /* empty */
364
+ #define _Py_ANNOTATE_IGNORE_SYNC_END() /* empty */
365
+ #define _Py_ANNOTATE_ENABLE_RACE_DETECTION(enable) /* empty */
366
+ #define _Py_ANNOTATE_NO_OP(arg) /* empty */
367
+ #define _Py_ANNOTATE_FLUSH_STATE() /* empty */
368
+
369
+ #endif /* DYNAMIC_ANNOTATIONS_ENABLED */
370
+
371
+ /* Use the macros above rather than using these functions directly. */
372
+ #ifdef __cplusplus
373
+ extern "C" {
374
+ #endif
375
+ void AnnotateRWLockCreate(const char *file, int line,
376
+ const volatile void *lock);
377
+ void AnnotateRWLockDestroy(const char *file, int line,
378
+ const volatile void *lock);
379
+ void AnnotateRWLockAcquired(const char *file, int line,
380
+ const volatile void *lock, long is_w);
381
+ void AnnotateRWLockReleased(const char *file, int line,
382
+ const volatile void *lock, long is_w);
383
+ void AnnotateBarrierInit(const char *file, int line,
384
+ const volatile void *barrier, long count,
385
+ long reinitialization_allowed);
386
+ void AnnotateBarrierWaitBefore(const char *file, int line,
387
+ const volatile void *barrier);
388
+ void AnnotateBarrierWaitAfter(const char *file, int line,
389
+ const volatile void *barrier);
390
+ void AnnotateBarrierDestroy(const char *file, int line,
391
+ const volatile void *barrier);
392
+ void AnnotateCondVarWait(const char *file, int line,
393
+ const volatile void *cv,
394
+ const volatile void *lock);
395
+ void AnnotateCondVarSignal(const char *file, int line,
396
+ const volatile void *cv);
397
+ void AnnotateCondVarSignalAll(const char *file, int line,
398
+ const volatile void *cv);
399
+ void AnnotatePublishMemoryRange(const char *file, int line,
400
+ const volatile void *address,
401
+ long size);
402
+ void AnnotateUnpublishMemoryRange(const char *file, int line,
403
+ const volatile void *address,
404
+ long size);
405
+ void AnnotatePCQCreate(const char *file, int line,
406
+ const volatile void *pcq);
407
+ void AnnotatePCQDestroy(const char *file, int line,
408
+ const volatile void *pcq);
409
+ void AnnotatePCQPut(const char *file, int line,
410
+ const volatile void *pcq);
411
+ void AnnotatePCQGet(const char *file, int line,
412
+ const volatile void *pcq);
413
+ void AnnotateNewMemory(const char *file, int line,
414
+ const volatile void *address,
415
+ long size);
416
+ void AnnotateExpectRace(const char *file, int line,
417
+ const volatile void *address,
418
+ const char *description);
419
+ void AnnotateBenignRace(const char *file, int line,
420
+ const volatile void *address,
421
+ const char *description);
422
+ void AnnotateBenignRaceSized(const char *file, int line,
423
+ const volatile void *address,
424
+ long size,
425
+ const char *description);
426
+ void AnnotateMutexIsUsedAsCondVar(const char *file, int line,
427
+ const volatile void *mu);
428
+ void AnnotateTraceMemory(const char *file, int line,
429
+ const volatile void *arg);
430
+ void AnnotateThreadName(const char *file, int line,
431
+ const char *name);
432
+ void AnnotateIgnoreReadsBegin(const char *file, int line);
433
+ void AnnotateIgnoreReadsEnd(const char *file, int line);
434
+ void AnnotateIgnoreWritesBegin(const char *file, int line);
435
+ void AnnotateIgnoreWritesEnd(const char *file, int line);
436
+ void AnnotateEnableRaceDetection(const char *file, int line, int enable);
437
+ void AnnotateNoOp(const char *file, int line,
438
+ const volatile void *arg);
439
+ void AnnotateFlushState(const char *file, int line);
440
+
441
+ /* Return non-zero value if running under valgrind.
442
+
443
+ If "valgrind.h" is included into dynamic_annotations.c,
444
+ the regular valgrind mechanism will be used.
445
+ See http://valgrind.org/docs/manual/manual-core-adv.html about
446
+ RUNNING_ON_VALGRIND and other valgrind "client requests".
447
+ The file "valgrind.h" may be obtained by doing
448
+ svn co svn://svn.valgrind.org/valgrind/trunk/include
449
+
450
+ If for some reason you can't use "valgrind.h" or want to fake valgrind,
451
+ there are two ways to make this function return non-zero:
452
+ - Use environment variable: export RUNNING_ON_VALGRIND=1
453
+ - Make your tool intercept the function RunningOnValgrind() and
454
+ change its return value.
455
+ */
456
+ int RunningOnValgrind(void);
457
+
458
+ #ifdef __cplusplus
459
+ }
460
+ #endif
461
+
462
+ #if DYNAMIC_ANNOTATIONS_ENABLED != 0 && defined(__cplusplus)
463
+
464
+ /* _Py_ANNOTATE_UNPROTECTED_READ is the preferred way to annotate racey reads.
465
+
466
+ Instead of doing
467
+ _Py_ANNOTATE_IGNORE_READS_BEGIN();
468
+ ... = x;
469
+ _Py_ANNOTATE_IGNORE_READS_END();
470
+ one can use
471
+ ... = _Py_ANNOTATE_UNPROTECTED_READ(x); */
472
+ template <class T>
473
+ inline T _Py_ANNOTATE_UNPROTECTED_READ(const volatile T &x) {
474
+ _Py_ANNOTATE_IGNORE_READS_BEGIN();
475
+ T res = x;
476
+ _Py_ANNOTATE_IGNORE_READS_END();
477
+ return res;
478
+ }
479
+ /* Apply _Py_ANNOTATE_BENIGN_RACE_SIZED to a static variable. */
480
+ #define _Py_ANNOTATE_BENIGN_RACE_STATIC(static_var, description) \
481
+ namespace { \
482
+ class static_var ## _annotator { \
483
+ public: \
484
+ static_var ## _annotator() { \
485
+ _Py_ANNOTATE_BENIGN_RACE_SIZED(&static_var, \
486
+ sizeof(static_var), \
487
+ # static_var ": " description); \
488
+ } \
489
+ }; \
490
+ static static_var ## _annotator the ## static_var ## _annotator;\
491
+ }
492
+ #else /* DYNAMIC_ANNOTATIONS_ENABLED == 0 */
493
+
494
+ #define _Py_ANNOTATE_UNPROTECTED_READ(x) (x)
495
+ #define _Py_ANNOTATE_BENIGN_RACE_STATIC(static_var, description) /* empty */
496
+
497
+ #endif /* DYNAMIC_ANNOTATIONS_ENABLED */
498
+
499
+ #endif /* __DYNAMIC_ANNOTATIONS_H__ */
@@ -0,0 +1,17 @@
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 */
@@ -0,0 +1,45 @@
1
+ // Error codes passed around between file input, tokenizer, parser and
2
+ // interpreter. This is necessary so we can turn them into Python
3
+ // exceptions at a higher level. Note that some errors have a
4
+ // slightly different meaning when passed from the tokenizer to the
5
+ // parser than when passed from the parser to the interpreter; e.g.
6
+ // the parser only returns E_EOF when it hits EOF immediately, and it
7
+ // never returns E_OK.
8
+ //
9
+ // The public PyRun_InteractiveOneObjectEx() function can return E_EOF,
10
+ // same as its variants:
11
+ //
12
+ // * PyRun_InteractiveOneObject()
13
+ // * PyRun_InteractiveOneFlags()
14
+ // * PyRun_InteractiveOne()
15
+
16
+ #ifndef Py_ERRCODE_H
17
+ #define Py_ERRCODE_H
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+ #define E_OK 10 /* No error */
23
+ #define E_EOF 11 /* End Of File */
24
+ #define E_INTR 12 /* Interrupted */
25
+ #define E_TOKEN 13 /* Bad token */
26
+ #define E_SYNTAX 14 /* Syntax error */
27
+ #define E_NOMEM 15 /* Ran out of memory */
28
+ #define E_DONE 16 /* Parsing complete */
29
+ #define E_ERROR 17 /* Execution error */
30
+ #define E_TABSPACE 18 /* Inconsistent mixing of tabs and spaces */
31
+ #define E_OVERFLOW 19 /* Node had too many children */
32
+ #define E_TOODEEP 20 /* Too many indentation levels */
33
+ #define E_DEDENT 21 /* No matching outer block for dedent */
34
+ #define E_DECODE 22 /* Error in decoding into Unicode */
35
+ #define E_EOFS 23 /* EOF in triple-quoted string */
36
+ #define E_EOLS 24 /* EOL in single-quoted string */
37
+ #define E_LINECONT 25 /* Unexpected characters after a line continuation */
38
+ #define E_BADSINGLE 27 /* Ill-formed single statement input */
39
+ #define E_INTERACT_STOP 28 /* Interactive mode stopped tokenization */
40
+ #define E_COLUMNOVERFLOW 29 /* Column offset overflow */
41
+
42
+ #ifdef __cplusplus
43
+ }
44
+ #endif
45
+ #endif /* !Py_ERRCODE_H */
@@ -0,0 +1,105 @@
1
+ #ifndef Py_EXPORTS_H
2
+ #define Py_EXPORTS_H
3
+
4
+ /* Declarations for symbol visibility.
5
+
6
+ PyAPI_FUNC(type): Declares a public Python API function and return type
7
+ PyAPI_DATA(type): Declares public Python data and its type
8
+ PyMODINIT_FUNC: A Python module init function. If these functions are
9
+ inside the Python core, they are private to the core.
10
+ If in an extension module, it may be declared with
11
+ external linkage depending on the platform.
12
+
13
+ As a number of platforms support/require "__declspec(dllimport/dllexport)",
14
+ we support a HAVE_DECLSPEC_DLL macro to save duplication.
15
+ */
16
+
17
+ /*
18
+ All windows ports, except cygwin, are handled in PC/pyconfig.h.
19
+
20
+ Cygwin is the only other autoconf platform requiring special
21
+ linkage handling and it uses __declspec().
22
+ */
23
+ #if defined(__CYGWIN__)
24
+ # define HAVE_DECLSPEC_DLL
25
+ #endif
26
+
27
+ #if defined(_WIN32) || defined(__CYGWIN__)
28
+ #if defined(Py_ENABLE_SHARED)
29
+ #define Py_IMPORTED_SYMBOL __declspec(dllimport)
30
+ #define Py_EXPORTED_SYMBOL __declspec(dllexport)
31
+ #define Py_LOCAL_SYMBOL
32
+ #else
33
+ #define Py_IMPORTED_SYMBOL
34
+ #define Py_EXPORTED_SYMBOL
35
+ #define Py_LOCAL_SYMBOL
36
+ #endif
37
+ #else
38
+ /*
39
+ * If we only ever used gcc >= 5, we could use __has_attribute(visibility)
40
+ * as a cross-platform way to determine if visibility is supported. However,
41
+ * we may still need to support gcc >= 4, as some Ubuntu LTS and Centos versions
42
+ * have 4 < gcc < 5.
43
+ */
44
+ #if (defined(__GNUC__) && (__GNUC__ >= 4)) ||\
45
+ (defined(__clang__) && _Py__has_attribute(visibility))
46
+ #define Py_IMPORTED_SYMBOL __attribute__ ((visibility ("default")))
47
+ #define Py_EXPORTED_SYMBOL __attribute__ ((visibility ("default")))
48
+ #define Py_LOCAL_SYMBOL __attribute__ ((visibility ("hidden")))
49
+ #else
50
+ #define Py_IMPORTED_SYMBOL
51
+ #define Py_EXPORTED_SYMBOL
52
+ #define Py_LOCAL_SYMBOL
53
+ #endif
54
+ #endif
55
+
56
+ /* only get special linkage if built as shared or platform is Cygwin */
57
+ #if defined(Py_ENABLE_SHARED) || defined(__CYGWIN__)
58
+ # if defined(HAVE_DECLSPEC_DLL)
59
+ # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
60
+ # define PyAPI_FUNC(RTYPE) Py_EXPORTED_SYMBOL RTYPE
61
+ # define PyAPI_DATA(RTYPE) extern Py_EXPORTED_SYMBOL RTYPE
62
+ /* module init functions inside the core need no external linkage */
63
+ /* except for Cygwin to handle embedding */
64
+ # if defined(__CYGWIN__)
65
+ # define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject*
66
+ # else /* __CYGWIN__ */
67
+ # define PyMODINIT_FUNC PyObject*
68
+ # endif /* __CYGWIN__ */
69
+ # else /* Py_BUILD_CORE */
70
+ /* Building an extension module, or an embedded situation */
71
+ /* public Python functions and data are imported */
72
+ /* Under Cygwin, auto-import functions to prevent compilation */
73
+ /* failures similar to those described at the bottom of 4.1: */
74
+ /* http://docs.python.org/extending/windows.html#a-cookbook-approach */
75
+ # if !defined(__CYGWIN__)
76
+ # define PyAPI_FUNC(RTYPE) Py_IMPORTED_SYMBOL RTYPE
77
+ # endif /* !__CYGWIN__ */
78
+ # define PyAPI_DATA(RTYPE) extern Py_IMPORTED_SYMBOL RTYPE
79
+ /* module init functions outside the core must be exported */
80
+ # if defined(__cplusplus)
81
+ # define PyMODINIT_FUNC extern "C" Py_EXPORTED_SYMBOL PyObject*
82
+ # else /* __cplusplus */
83
+ # define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject*
84
+ # endif /* __cplusplus */
85
+ # endif /* Py_BUILD_CORE */
86
+ # endif /* HAVE_DECLSPEC_DLL */
87
+ #endif /* Py_ENABLE_SHARED */
88
+
89
+ /* If no external linkage macros defined by now, create defaults */
90
+ #ifndef PyAPI_FUNC
91
+ # define PyAPI_FUNC(RTYPE) Py_EXPORTED_SYMBOL RTYPE
92
+ #endif
93
+ #ifndef PyAPI_DATA
94
+ # define PyAPI_DATA(RTYPE) extern Py_EXPORTED_SYMBOL RTYPE
95
+ #endif
96
+ #ifndef PyMODINIT_FUNC
97
+ # if defined(__cplusplus)
98
+ # define PyMODINIT_FUNC extern "C" Py_EXPORTED_SYMBOL PyObject*
99
+ # else /* __cplusplus */
100
+ # define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject*
101
+ # endif /* __cplusplus */
102
+ #endif
103
+
104
+
105
+ #endif /* Py_EXPORTS_H */