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,1029 @@
1
+ #ifndef Py_UNICODEOBJECT_H
2
+ #define Py_UNICODEOBJECT_H
3
+
4
+ /*
5
+
6
+ Unicode implementation based on original code by Fredrik Lundh,
7
+ modified by Marc-Andre Lemburg (mal@lemburg.com) according to the
8
+ Unicode Integration Proposal. (See
9
+ http://www.egenix.com/files/python/unicode-proposal.txt).
10
+
11
+ Copyright (c) Corporation for National Research Initiatives.
12
+
13
+
14
+ Original header:
15
+ --------------------------------------------------------------------
16
+
17
+ * Yet another Unicode string type for Python. This type supports the
18
+ * 16-bit Basic Multilingual Plane (BMP) only.
19
+ *
20
+ * Written by Fredrik Lundh, January 1999.
21
+ *
22
+ * Copyright (c) 1999 by Secret Labs AB.
23
+ * Copyright (c) 1999 by Fredrik Lundh.
24
+ *
25
+ * fredrik@pythonware.com
26
+ * http://www.pythonware.com
27
+ *
28
+ * --------------------------------------------------------------------
29
+ * This Unicode String Type is
30
+ *
31
+ * Copyright (c) 1999 by Secret Labs AB
32
+ * Copyright (c) 1999 by Fredrik Lundh
33
+ *
34
+ * By obtaining, using, and/or copying this software and/or its
35
+ * associated documentation, you agree that you have read, understood,
36
+ * and will comply with the following terms and conditions:
37
+ *
38
+ * Permission to use, copy, modify, and distribute this software and its
39
+ * associated documentation for any purpose and without fee is hereby
40
+ * granted, provided that the above copyright notice appears in all
41
+ * copies, and that both that copyright notice and this permission notice
42
+ * appear in supporting documentation, and that the name of Secret Labs
43
+ * AB or the author not be used in advertising or publicity pertaining to
44
+ * distribution of the software without specific, written prior
45
+ * permission.
46
+ *
47
+ * SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO
48
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
49
+ * FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR
50
+ * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
51
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
52
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
53
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
54
+ * -------------------------------------------------------------------- */
55
+
56
+ /* === Internal API ======================================================= */
57
+
58
+ /* --- Internal Unicode Format -------------------------------------------- */
59
+
60
+ /* Python 3.x requires unicode */
61
+ #define Py_USING_UNICODE
62
+
63
+ #ifndef SIZEOF_WCHAR_T
64
+ #error Must define SIZEOF_WCHAR_T
65
+ #endif
66
+
67
+ #define Py_UNICODE_SIZE SIZEOF_WCHAR_T
68
+
69
+ /* If wchar_t can be used for UCS-4 storage, set Py_UNICODE_WIDE.
70
+ Otherwise, Unicode strings are stored as UCS-2 (with limited support
71
+ for UTF-16) */
72
+
73
+ #if Py_UNICODE_SIZE >= 4
74
+ #define Py_UNICODE_WIDE
75
+ #endif
76
+
77
+ /* Set these flags if the platform has "wchar.h" and the
78
+ wchar_t type is a 16-bit unsigned type */
79
+ /* #define HAVE_WCHAR_H */
80
+ /* #define HAVE_USABLE_WCHAR_T */
81
+
82
+ /* If the compiler provides a wchar_t type we try to support it
83
+ through the interface functions PyUnicode_FromWideChar(),
84
+ PyUnicode_AsWideChar() and PyUnicode_AsWideCharString(). */
85
+
86
+ #ifdef HAVE_USABLE_WCHAR_T
87
+ # ifndef HAVE_WCHAR_H
88
+ # define HAVE_WCHAR_H
89
+ # endif
90
+ #endif
91
+
92
+ /* Py_UCS4 and Py_UCS2 are typedefs for the respective
93
+ unicode representations. */
94
+ typedef uint32_t Py_UCS4;
95
+ typedef uint16_t Py_UCS2;
96
+ typedef uint8_t Py_UCS1;
97
+
98
+ #ifdef __cplusplus
99
+ extern "C" {
100
+ #endif
101
+
102
+
103
+ PyAPI_DATA(PyTypeObject) PyUnicode_Type;
104
+ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
105
+
106
+ #define PyUnicode_Check(op) \
107
+ PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS)
108
+ #define PyUnicode_CheckExact(op) Py_IS_TYPE((op), &PyUnicode_Type)
109
+
110
+ /* --- Constants ---------------------------------------------------------- */
111
+
112
+ /* This Unicode character will be used as replacement character during
113
+ decoding if the errors argument is set to "replace". Note: the
114
+ Unicode character U+FFFD is the official REPLACEMENT CHARACTER in
115
+ Unicode 3.0. */
116
+
117
+ #define Py_UNICODE_REPLACEMENT_CHARACTER ((Py_UCS4) 0xFFFD)
118
+
119
+ /* === Public API ========================================================= */
120
+
121
+ /* Similar to PyUnicode_FromUnicode(), but u points to UTF-8 encoded bytes */
122
+ PyAPI_FUNC(PyObject*) PyUnicode_FromStringAndSize(
123
+ const char *u, /* UTF-8 encoded string */
124
+ Py_ssize_t size /* size of buffer */
125
+ );
126
+
127
+ /* Similar to PyUnicode_FromUnicode(), but u points to null-terminated
128
+ UTF-8 encoded bytes. The size is determined with strlen(). */
129
+ PyAPI_FUNC(PyObject*) PyUnicode_FromString(
130
+ const char *u /* UTF-8 encoded string */
131
+ );
132
+
133
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
134
+ PyAPI_FUNC(PyObject*) PyUnicode_Substring(
135
+ PyObject *str,
136
+ Py_ssize_t start,
137
+ Py_ssize_t end);
138
+ #endif
139
+
140
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
141
+ /* Copy the string into a UCS4 buffer including the null character if copy_null
142
+ is set. Return NULL and raise an exception on error. Raise a SystemError if
143
+ the buffer is smaller than the string. Return buffer on success.
144
+
145
+ buflen is the length of the buffer in (Py_UCS4) characters. */
146
+ PyAPI_FUNC(Py_UCS4*) PyUnicode_AsUCS4(
147
+ PyObject *unicode,
148
+ Py_UCS4* buffer,
149
+ Py_ssize_t buflen,
150
+ int copy_null);
151
+
152
+ /* Copy the string into a UCS4 buffer. A new buffer is allocated using
153
+ * PyMem_Malloc; if this fails, NULL is returned with a memory error
154
+ exception set. */
155
+ PyAPI_FUNC(Py_UCS4*) PyUnicode_AsUCS4Copy(PyObject *unicode);
156
+ #endif
157
+
158
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
159
+ /* Get the length of the Unicode object. */
160
+
161
+ PyAPI_FUNC(Py_ssize_t) PyUnicode_GetLength(
162
+ PyObject *unicode
163
+ );
164
+ #endif
165
+
166
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
167
+ /* Read a character from the string. */
168
+
169
+ PyAPI_FUNC(Py_UCS4) PyUnicode_ReadChar(
170
+ PyObject *unicode,
171
+ Py_ssize_t index
172
+ );
173
+
174
+ /* Write a character to the string. The string must have been created through
175
+ PyUnicode_New, must not be shared, and must not have been hashed yet.
176
+
177
+ Return 0 on success, -1 on error. */
178
+
179
+ PyAPI_FUNC(int) PyUnicode_WriteChar(
180
+ PyObject *unicode,
181
+ Py_ssize_t index,
182
+ Py_UCS4 character
183
+ );
184
+ #endif
185
+
186
+ /* Resize a Unicode object. The length is the number of codepoints.
187
+
188
+ *unicode is modified to point to the new (resized) object and 0
189
+ returned on success.
190
+
191
+ Try to resize the string in place (which is usually faster than allocating
192
+ a new string and copy characters), or create a new string.
193
+
194
+ Error handling is implemented as follows: an exception is set, -1
195
+ is returned and *unicode left untouched.
196
+
197
+ WARNING: The function doesn't check string content, the result may not be a
198
+ string in canonical representation. */
199
+
200
+ PyAPI_FUNC(int) PyUnicode_Resize(
201
+ PyObject **unicode, /* Pointer to the Unicode object */
202
+ Py_ssize_t length /* New length */
203
+ );
204
+
205
+ /* Decode obj to a Unicode object.
206
+
207
+ bytes, bytearray and other bytes-like objects are decoded according to the
208
+ given encoding and error handler. The encoding and error handler can be
209
+ NULL to have the interface use UTF-8 and "strict".
210
+
211
+ All other objects (including Unicode objects) raise an exception.
212
+
213
+ The API returns NULL in case of an error. The caller is responsible
214
+ for decref'ing the returned objects.
215
+
216
+ */
217
+
218
+ PyAPI_FUNC(PyObject*) PyUnicode_FromEncodedObject(
219
+ PyObject *obj, /* Object */
220
+ const char *encoding, /* encoding */
221
+ const char *errors /* error handling */
222
+ );
223
+
224
+ /* Copy an instance of a Unicode subtype to a new true Unicode object if
225
+ necessary. If obj is already a true Unicode object (not a subtype), return
226
+ the reference with *incremented* refcount.
227
+
228
+ The API returns NULL in case of an error. The caller is responsible
229
+ for decref'ing the returned objects.
230
+
231
+ */
232
+
233
+ PyAPI_FUNC(PyObject*) PyUnicode_FromObject(
234
+ PyObject *obj /* Object */
235
+ );
236
+
237
+ PyAPI_FUNC(PyObject *) PyUnicode_FromFormatV(
238
+ const char *format, /* ASCII-encoded string */
239
+ va_list vargs
240
+ );
241
+ PyAPI_FUNC(PyObject *) PyUnicode_FromFormat(
242
+ const char *format, /* ASCII-encoded string */
243
+ ...
244
+ );
245
+
246
+ PyAPI_FUNC(void) PyUnicode_InternInPlace(PyObject **);
247
+ PyAPI_FUNC(PyObject *) PyUnicode_InternFromString(
248
+ const char *u /* UTF-8 encoded string */
249
+ );
250
+
251
+ /* --- wchar_t support for platforms which support it --------------------- */
252
+
253
+ #ifdef HAVE_WCHAR_H
254
+
255
+ /* Create a Unicode Object from the wchar_t buffer w of the given
256
+ size.
257
+
258
+ The buffer is copied into the new object. */
259
+
260
+ PyAPI_FUNC(PyObject*) PyUnicode_FromWideChar(
261
+ const wchar_t *w, /* wchar_t buffer */
262
+ Py_ssize_t size /* size of buffer */
263
+ );
264
+
265
+ /* Copies the Unicode Object contents into the wchar_t buffer w. At
266
+ most size wchar_t characters are copied.
267
+
268
+ Note that the resulting wchar_t string may or may not be
269
+ 0-terminated. It is the responsibility of the caller to make sure
270
+ that the wchar_t string is 0-terminated in case this is required by
271
+ the application.
272
+
273
+ Returns the number of wchar_t characters copied (excluding a
274
+ possibly trailing 0-termination character) or -1 in case of an
275
+ error. */
276
+
277
+ PyAPI_FUNC(Py_ssize_t) PyUnicode_AsWideChar(
278
+ PyObject *unicode, /* Unicode object */
279
+ wchar_t *w, /* wchar_t buffer */
280
+ Py_ssize_t size /* size of buffer */
281
+ );
282
+
283
+ /* Convert the Unicode object to a wide character string. The output string
284
+ always ends with a nul character. If size is not NULL, write the number of
285
+ wide characters (excluding the null character) into *size.
286
+
287
+ Returns a buffer allocated by PyMem_Malloc() (use PyMem_Free() to free it)
288
+ on success. On error, returns NULL, *size is undefined and raises a
289
+ MemoryError. */
290
+
291
+ PyAPI_FUNC(wchar_t*) PyUnicode_AsWideCharString(
292
+ PyObject *unicode, /* Unicode object */
293
+ Py_ssize_t *size /* number of characters of the result */
294
+ );
295
+
296
+ #endif
297
+
298
+ /* --- Unicode ordinals --------------------------------------------------- */
299
+
300
+ /* Create a Unicode Object from the given Unicode code point ordinal.
301
+
302
+ The ordinal must be in range(0x110000). A ValueError is
303
+ raised in case it is not.
304
+
305
+ */
306
+
307
+ PyAPI_FUNC(PyObject*) PyUnicode_FromOrdinal(int ordinal);
308
+
309
+ /* === Builtin Codecs =====================================================
310
+
311
+ Many of these APIs take two arguments encoding and errors. These
312
+ parameters encoding and errors have the same semantics as the ones
313
+ of the builtin str() API.
314
+
315
+ Setting encoding to NULL causes the default encoding (UTF-8) to be used.
316
+
317
+ Error handling is set by errors which may also be set to NULL
318
+ meaning to use the default handling defined for the codec. Default
319
+ error handling for all builtin codecs is "strict" (ValueErrors are
320
+ raised).
321
+
322
+ The codecs all use a similar interface. Only deviation from the
323
+ generic ones are documented.
324
+
325
+ */
326
+
327
+ /* --- Manage the default encoding ---------------------------------------- */
328
+
329
+ /* Returns "utf-8". */
330
+ PyAPI_FUNC(const char*) PyUnicode_GetDefaultEncoding(void);
331
+
332
+ /* --- Generic Codecs ----------------------------------------------------- */
333
+
334
+ /* Create a Unicode object by decoding the encoded string s of the
335
+ given size. */
336
+
337
+ PyAPI_FUNC(PyObject*) PyUnicode_Decode(
338
+ const char *s, /* encoded string */
339
+ Py_ssize_t size, /* size of buffer */
340
+ const char *encoding, /* encoding */
341
+ const char *errors /* error handling */
342
+ );
343
+
344
+ /* Decode a Unicode object unicode and return the result as Python
345
+ object.
346
+
347
+ This API is DEPRECATED and will be removed in 3.15.
348
+ The only supported standard encoding is rot13.
349
+ Use PyCodec_Decode() to decode with rot13 and non-standard codecs
350
+ that decode from str. */
351
+
352
+ Py_DEPRECATED(3.6) PyAPI_FUNC(PyObject*) PyUnicode_AsDecodedObject(
353
+ PyObject *unicode, /* Unicode object */
354
+ const char *encoding, /* encoding */
355
+ const char *errors /* error handling */
356
+ );
357
+
358
+ /* Decode a Unicode object unicode and return the result as Unicode
359
+ object.
360
+
361
+ This API is DEPRECATED and will be removed in 3.15.
362
+ The only supported standard encoding is rot13.
363
+ Use PyCodec_Decode() to decode with rot13 and non-standard codecs
364
+ that decode from str to str. */
365
+
366
+ Py_DEPRECATED(3.6) PyAPI_FUNC(PyObject*) PyUnicode_AsDecodedUnicode(
367
+ PyObject *unicode, /* Unicode object */
368
+ const char *encoding, /* encoding */
369
+ const char *errors /* error handling */
370
+ );
371
+
372
+ /* Encodes a Unicode object and returns the result as Python
373
+ object.
374
+
375
+ This API is DEPRECATED and will be removed in 3.15.
376
+ It is superseded by PyUnicode_AsEncodedString()
377
+ since all standard encodings (except rot13) encode str to bytes.
378
+ Use PyCodec_Encode() for encoding with rot13 and non-standard codecs
379
+ that encode form str to non-bytes. */
380
+
381
+ Py_DEPRECATED(3.6) PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedObject(
382
+ PyObject *unicode, /* Unicode object */
383
+ const char *encoding, /* encoding */
384
+ const char *errors /* error handling */
385
+ );
386
+
387
+ /* Encodes a Unicode object and returns the result as Python string
388
+ object. */
389
+
390
+ PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedString(
391
+ PyObject *unicode, /* Unicode object */
392
+ const char *encoding, /* encoding */
393
+ const char *errors /* error handling */
394
+ );
395
+
396
+ /* Encodes a Unicode object and returns the result as Unicode
397
+ object.
398
+
399
+ This API is DEPRECATED and will be removed in 3.15.
400
+ The only supported standard encodings is rot13.
401
+ Use PyCodec_Encode() to encode with rot13 and non-standard codecs
402
+ that encode from str to str. */
403
+
404
+ Py_DEPRECATED(3.6) PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedUnicode(
405
+ PyObject *unicode, /* Unicode object */
406
+ const char *encoding, /* encoding */
407
+ const char *errors /* error handling */
408
+ );
409
+
410
+ /* Build an encoding map. */
411
+
412
+ PyAPI_FUNC(PyObject*) PyUnicode_BuildEncodingMap(
413
+ PyObject* string /* 256 character map */
414
+ );
415
+
416
+ /* --- UTF-7 Codecs ------------------------------------------------------- */
417
+
418
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF7(
419
+ const char *string, /* UTF-7 encoded string */
420
+ Py_ssize_t length, /* size of string */
421
+ const char *errors /* error handling */
422
+ );
423
+
424
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF7Stateful(
425
+ const char *string, /* UTF-7 encoded string */
426
+ Py_ssize_t length, /* size of string */
427
+ const char *errors, /* error handling */
428
+ Py_ssize_t *consumed /* bytes consumed */
429
+ );
430
+
431
+ /* --- UTF-8 Codecs ------------------------------------------------------- */
432
+
433
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF8(
434
+ const char *string, /* UTF-8 encoded string */
435
+ Py_ssize_t length, /* size of string */
436
+ const char *errors /* error handling */
437
+ );
438
+
439
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF8Stateful(
440
+ const char *string, /* UTF-8 encoded string */
441
+ Py_ssize_t length, /* size of string */
442
+ const char *errors, /* error handling */
443
+ Py_ssize_t *consumed /* bytes consumed */
444
+ );
445
+
446
+ PyAPI_FUNC(PyObject*) PyUnicode_AsUTF8String(
447
+ PyObject *unicode /* Unicode object */
448
+ );
449
+
450
+ /* Returns a pointer to the default encoding (UTF-8) of the
451
+ Unicode object unicode and the size of the encoded representation
452
+ in bytes stored in *size.
453
+
454
+ In case of an error, no *size is set.
455
+
456
+ This function caches the UTF-8 encoded string in the unicodeobject
457
+ and subsequent calls will return the same string. The memory is released
458
+ when the unicodeobject is deallocated.
459
+ */
460
+
461
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000
462
+ PyAPI_FUNC(const char *) PyUnicode_AsUTF8AndSize(
463
+ PyObject *unicode,
464
+ Py_ssize_t *size);
465
+ #endif
466
+
467
+ /* --- UTF-32 Codecs ------------------------------------------------------ */
468
+
469
+ /* Decodes length bytes from a UTF-32 encoded buffer string and returns
470
+ the corresponding Unicode object.
471
+
472
+ errors (if non-NULL) defines the error handling. It defaults
473
+ to "strict".
474
+
475
+ If byteorder is non-NULL, the decoder starts decoding using the
476
+ given byte order:
477
+
478
+ *byteorder == -1: little endian
479
+ *byteorder == 0: native order
480
+ *byteorder == 1: big endian
481
+
482
+ In native mode, the first four bytes of the stream are checked for a
483
+ BOM mark. If found, the BOM mark is analysed, the byte order
484
+ adjusted and the BOM skipped. In the other modes, no BOM mark
485
+ interpretation is done. After completion, *byteorder is set to the
486
+ current byte order at the end of input data.
487
+
488
+ If byteorder is NULL, the codec starts in native order mode.
489
+
490
+ */
491
+
492
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF32(
493
+ const char *string, /* UTF-32 encoded string */
494
+ Py_ssize_t length, /* size of string */
495
+ const char *errors, /* error handling */
496
+ int *byteorder /* pointer to byteorder to use
497
+ 0=native;-1=LE,1=BE; updated on
498
+ exit */
499
+ );
500
+
501
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF32Stateful(
502
+ const char *string, /* UTF-32 encoded string */
503
+ Py_ssize_t length, /* size of string */
504
+ const char *errors, /* error handling */
505
+ int *byteorder, /* pointer to byteorder to use
506
+ 0=native;-1=LE,1=BE; updated on
507
+ exit */
508
+ Py_ssize_t *consumed /* bytes consumed */
509
+ );
510
+
511
+ /* Returns a Python string using the UTF-32 encoding in native byte
512
+ order. The string always starts with a BOM mark. */
513
+
514
+ PyAPI_FUNC(PyObject*) PyUnicode_AsUTF32String(
515
+ PyObject *unicode /* Unicode object */
516
+ );
517
+
518
+ /* Returns a Python string object holding the UTF-32 encoded value of
519
+ the Unicode data.
520
+
521
+ If byteorder is not 0, output is written according to the following
522
+ byte order:
523
+
524
+ byteorder == -1: little endian
525
+ byteorder == 0: native byte order (writes a BOM mark)
526
+ byteorder == 1: big endian
527
+
528
+ If byteorder is 0, the output string will always start with the
529
+ Unicode BOM mark (U+FEFF). In the other two modes, no BOM mark is
530
+ prepended.
531
+
532
+ */
533
+
534
+ /* --- UTF-16 Codecs ------------------------------------------------------ */
535
+
536
+ /* Decodes length bytes from a UTF-16 encoded buffer string and returns
537
+ the corresponding Unicode object.
538
+
539
+ errors (if non-NULL) defines the error handling. It defaults
540
+ to "strict".
541
+
542
+ If byteorder is non-NULL, the decoder starts decoding using the
543
+ given byte order:
544
+
545
+ *byteorder == -1: little endian
546
+ *byteorder == 0: native order
547
+ *byteorder == 1: big endian
548
+
549
+ In native mode, the first two bytes of the stream are checked for a
550
+ BOM mark. If found, the BOM mark is analysed, the byte order
551
+ adjusted and the BOM skipped. In the other modes, no BOM mark
552
+ interpretation is done. After completion, *byteorder is set to the
553
+ current byte order at the end of input data.
554
+
555
+ If byteorder is NULL, the codec starts in native order mode.
556
+
557
+ */
558
+
559
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF16(
560
+ const char *string, /* UTF-16 encoded string */
561
+ Py_ssize_t length, /* size of string */
562
+ const char *errors, /* error handling */
563
+ int *byteorder /* pointer to byteorder to use
564
+ 0=native;-1=LE,1=BE; updated on
565
+ exit */
566
+ );
567
+
568
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF16Stateful(
569
+ const char *string, /* UTF-16 encoded string */
570
+ Py_ssize_t length, /* size of string */
571
+ const char *errors, /* error handling */
572
+ int *byteorder, /* pointer to byteorder to use
573
+ 0=native;-1=LE,1=BE; updated on
574
+ exit */
575
+ Py_ssize_t *consumed /* bytes consumed */
576
+ );
577
+
578
+ /* Returns a Python string using the UTF-16 encoding in native byte
579
+ order. The string always starts with a BOM mark. */
580
+
581
+ PyAPI_FUNC(PyObject*) PyUnicode_AsUTF16String(
582
+ PyObject *unicode /* Unicode object */
583
+ );
584
+
585
+ /* --- Unicode-Escape Codecs ---------------------------------------------- */
586
+
587
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUnicodeEscape(
588
+ const char *string, /* Unicode-Escape encoded string */
589
+ Py_ssize_t length, /* size of string */
590
+ const char *errors /* error handling */
591
+ );
592
+
593
+ PyAPI_FUNC(PyObject*) PyUnicode_AsUnicodeEscapeString(
594
+ PyObject *unicode /* Unicode object */
595
+ );
596
+
597
+ /* --- Raw-Unicode-Escape Codecs ------------------------------------------ */
598
+
599
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeRawUnicodeEscape(
600
+ const char *string, /* Raw-Unicode-Escape encoded string */
601
+ Py_ssize_t length, /* size of string */
602
+ const char *errors /* error handling */
603
+ );
604
+
605
+ PyAPI_FUNC(PyObject*) PyUnicode_AsRawUnicodeEscapeString(
606
+ PyObject *unicode /* Unicode object */
607
+ );
608
+
609
+ /* --- Latin-1 Codecs -----------------------------------------------------
610
+
611
+ Note: Latin-1 corresponds to the first 256 Unicode ordinals. */
612
+
613
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeLatin1(
614
+ const char *string, /* Latin-1 encoded string */
615
+ Py_ssize_t length, /* size of string */
616
+ const char *errors /* error handling */
617
+ );
618
+
619
+ PyAPI_FUNC(PyObject*) PyUnicode_AsLatin1String(
620
+ PyObject *unicode /* Unicode object */
621
+ );
622
+
623
+ /* --- ASCII Codecs -------------------------------------------------------
624
+
625
+ Only 7-bit ASCII data is expected. All other codes generate errors.
626
+
627
+ */
628
+
629
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeASCII(
630
+ const char *string, /* ASCII encoded string */
631
+ Py_ssize_t length, /* size of string */
632
+ const char *errors /* error handling */
633
+ );
634
+
635
+ PyAPI_FUNC(PyObject*) PyUnicode_AsASCIIString(
636
+ PyObject *unicode /* Unicode object */
637
+ );
638
+
639
+ /* --- Character Map Codecs -----------------------------------------------
640
+
641
+ This codec uses mappings to encode and decode characters.
642
+
643
+ Decoding mappings must map byte ordinals (integers in the range from 0 to
644
+ 255) to Unicode strings, integers (which are then interpreted as Unicode
645
+ ordinals) or None. Unmapped data bytes (ones which cause a LookupError)
646
+ as well as mapped to None, 0xFFFE or '\ufffe' are treated as "undefined
647
+ mapping" and cause an error.
648
+
649
+ Encoding mappings must map Unicode ordinal integers to bytes objects,
650
+ integers in the range from 0 to 255 or None. Unmapped character
651
+ ordinals (ones which cause a LookupError) as well as mapped to
652
+ None are treated as "undefined mapping" and cause an error.
653
+
654
+ */
655
+
656
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeCharmap(
657
+ const char *string, /* Encoded string */
658
+ Py_ssize_t length, /* size of string */
659
+ PyObject *mapping, /* decoding mapping */
660
+ const char *errors /* error handling */
661
+ );
662
+
663
+ PyAPI_FUNC(PyObject*) PyUnicode_AsCharmapString(
664
+ PyObject *unicode, /* Unicode object */
665
+ PyObject *mapping /* encoding mapping */
666
+ );
667
+
668
+ /* --- MBCS codecs for Windows -------------------------------------------- */
669
+
670
+ #ifdef MS_WINDOWS
671
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCS(
672
+ const char *string, /* MBCS encoded string */
673
+ Py_ssize_t length, /* size of string */
674
+ const char *errors /* error handling */
675
+ );
676
+
677
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCSStateful(
678
+ const char *string, /* MBCS encoded string */
679
+ Py_ssize_t length, /* size of string */
680
+ const char *errors, /* error handling */
681
+ Py_ssize_t *consumed /* bytes consumed */
682
+ );
683
+
684
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
685
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeCodePageStateful(
686
+ int code_page, /* code page number */
687
+ const char *string, /* encoded string */
688
+ Py_ssize_t length, /* size of string */
689
+ const char *errors, /* error handling */
690
+ Py_ssize_t *consumed /* bytes consumed */
691
+ );
692
+ #endif
693
+
694
+ PyAPI_FUNC(PyObject*) PyUnicode_AsMBCSString(
695
+ PyObject *unicode /* Unicode object */
696
+ );
697
+
698
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
699
+ PyAPI_FUNC(PyObject*) PyUnicode_EncodeCodePage(
700
+ int code_page, /* code page number */
701
+ PyObject *unicode, /* Unicode object */
702
+ const char *errors /* error handling */
703
+ );
704
+ #endif
705
+
706
+ #endif /* MS_WINDOWS */
707
+
708
+ /* --- Locale encoding --------------------------------------------------- */
709
+
710
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
711
+ /* Decode a string from the current locale encoding. The decoder is strict if
712
+ *surrogateescape* is equal to zero, otherwise it uses the 'surrogateescape'
713
+ error handler (PEP 383) to escape undecodable bytes. If a byte sequence can
714
+ be decoded as a surrogate character and *surrogateescape* is not equal to
715
+ zero, the byte sequence is escaped using the 'surrogateescape' error handler
716
+ instead of being decoded. *str* must end with a null character but cannot
717
+ contain embedded null characters. */
718
+
719
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeLocaleAndSize(
720
+ const char *str,
721
+ Py_ssize_t len,
722
+ const char *errors);
723
+
724
+ /* Similar to PyUnicode_DecodeLocaleAndSize(), but compute the string
725
+ length using strlen(). */
726
+
727
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeLocale(
728
+ const char *str,
729
+ const char *errors);
730
+
731
+ /* Encode a Unicode object to the current locale encoding. The encoder is
732
+ strict is *surrogateescape* is equal to zero, otherwise the
733
+ "surrogateescape" error handler is used. Return a bytes object. The string
734
+ cannot contain embedded null characters. */
735
+
736
+ PyAPI_FUNC(PyObject*) PyUnicode_EncodeLocale(
737
+ PyObject *unicode,
738
+ const char *errors
739
+ );
740
+ #endif
741
+
742
+ /* --- File system encoding ---------------------------------------------- */
743
+
744
+ /* ParseTuple converter: encode str objects to bytes using
745
+ PyUnicode_EncodeFSDefault(); bytes objects are output as-is. */
746
+
747
+ PyAPI_FUNC(int) PyUnicode_FSConverter(PyObject*, void*);
748
+
749
+ /* ParseTuple converter: decode bytes objects to unicode using
750
+ PyUnicode_DecodeFSDefaultAndSize(); str objects are output as-is. */
751
+
752
+ PyAPI_FUNC(int) PyUnicode_FSDecoder(PyObject*, void*);
753
+
754
+ /* Decode a null-terminated string from the Python filesystem encoding
755
+ and error handler.
756
+
757
+ If the string length is known, use PyUnicode_DecodeFSDefaultAndSize(). */
758
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefault(
759
+ const char *s /* encoded string */
760
+ );
761
+
762
+ /* Decode a string from the Python filesystem encoding and error handler. */
763
+ PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefaultAndSize(
764
+ const char *s, /* encoded string */
765
+ Py_ssize_t size /* size */
766
+ );
767
+
768
+ /* Encode a Unicode object to the Python filesystem encoding and error handler.
769
+ Return bytes. */
770
+ PyAPI_FUNC(PyObject*) PyUnicode_EncodeFSDefault(
771
+ PyObject *unicode
772
+ );
773
+
774
+ /* --- Methods & Slots ----------------------------------------------------
775
+
776
+ These are capable of handling Unicode objects and strings on input
777
+ (we refer to them as strings in the descriptions) and return
778
+ Unicode objects or integers as appropriate. */
779
+
780
+ /* Concat two strings giving a new Unicode string. */
781
+
782
+ PyAPI_FUNC(PyObject*) PyUnicode_Concat(
783
+ PyObject *left, /* Left string */
784
+ PyObject *right /* Right string */
785
+ );
786
+
787
+ /* Concat two strings and put the result in *pleft
788
+ (sets *pleft to NULL on error) */
789
+
790
+ PyAPI_FUNC(void) PyUnicode_Append(
791
+ PyObject **pleft, /* Pointer to left string */
792
+ PyObject *right /* Right string */
793
+ );
794
+
795
+ /* Concat two strings, put the result in *pleft and drop the right object
796
+ (sets *pleft to NULL on error) */
797
+
798
+ PyAPI_FUNC(void) PyUnicode_AppendAndDel(
799
+ PyObject **pleft, /* Pointer to left string */
800
+ PyObject *right /* Right string */
801
+ );
802
+
803
+ /* Split a string giving a list of Unicode strings.
804
+
805
+ If sep is NULL, splitting will be done at all whitespace
806
+ substrings. Otherwise, splits occur at the given separator.
807
+
808
+ At most maxsplit splits will be done. If negative, no limit is set.
809
+
810
+ Separators are not included in the resulting list.
811
+
812
+ */
813
+
814
+ PyAPI_FUNC(PyObject*) PyUnicode_Split(
815
+ PyObject *s, /* String to split */
816
+ PyObject *sep, /* String separator */
817
+ Py_ssize_t maxsplit /* Maxsplit count */
818
+ );
819
+
820
+ /* Dito, but split at line breaks.
821
+
822
+ CRLF is considered to be one line break. Line breaks are not
823
+ included in the resulting list. */
824
+
825
+ PyAPI_FUNC(PyObject*) PyUnicode_Splitlines(
826
+ PyObject *s, /* String to split */
827
+ int keepends /* If true, line end markers are included */
828
+ );
829
+
830
+ /* Partition a string using a given separator. */
831
+
832
+ PyAPI_FUNC(PyObject*) PyUnicode_Partition(
833
+ PyObject *s, /* String to partition */
834
+ PyObject *sep /* String separator */
835
+ );
836
+
837
+ /* Partition a string using a given separator, searching from the end of the
838
+ string. */
839
+
840
+ PyAPI_FUNC(PyObject*) PyUnicode_RPartition(
841
+ PyObject *s, /* String to partition */
842
+ PyObject *sep /* String separator */
843
+ );
844
+
845
+ /* Split a string giving a list of Unicode strings.
846
+
847
+ If sep is NULL, splitting will be done at all whitespace
848
+ substrings. Otherwise, splits occur at the given separator.
849
+
850
+ At most maxsplit splits will be done. But unlike PyUnicode_Split
851
+ PyUnicode_RSplit splits from the end of the string. If negative,
852
+ no limit is set.
853
+
854
+ Separators are not included in the resulting list.
855
+
856
+ */
857
+
858
+ PyAPI_FUNC(PyObject*) PyUnicode_RSplit(
859
+ PyObject *s, /* String to split */
860
+ PyObject *sep, /* String separator */
861
+ Py_ssize_t maxsplit /* Maxsplit count */
862
+ );
863
+
864
+ /* Translate a string by applying a character mapping table to it and
865
+ return the resulting Unicode object.
866
+
867
+ The mapping table must map Unicode ordinal integers to Unicode strings,
868
+ Unicode ordinal integers or None (causing deletion of the character).
869
+
870
+ Mapping tables may be dictionaries or sequences. Unmapped character
871
+ ordinals (ones which cause a LookupError) are left untouched and
872
+ are copied as-is.
873
+
874
+ */
875
+
876
+ PyAPI_FUNC(PyObject *) PyUnicode_Translate(
877
+ PyObject *str, /* String */
878
+ PyObject *table, /* Translate table */
879
+ const char *errors /* error handling */
880
+ );
881
+
882
+ /* Join a sequence of strings using the given separator and return
883
+ the resulting Unicode string. */
884
+
885
+ PyAPI_FUNC(PyObject*) PyUnicode_Join(
886
+ PyObject *separator, /* Separator string */
887
+ PyObject *seq /* Sequence object */
888
+ );
889
+
890
+ /* Return 1 if substr matches str[start:end] at the given tail end, 0
891
+ otherwise. */
892
+
893
+ PyAPI_FUNC(Py_ssize_t) PyUnicode_Tailmatch(
894
+ PyObject *str, /* String */
895
+ PyObject *substr, /* Prefix or Suffix string */
896
+ Py_ssize_t start, /* Start index */
897
+ Py_ssize_t end, /* Stop index */
898
+ int direction /* Tail end: -1 prefix, +1 suffix */
899
+ );
900
+
901
+ /* Return the first position of substr in str[start:end] using the
902
+ given search direction or -1 if not found. -2 is returned in case
903
+ an error occurred and an exception is set. */
904
+
905
+ PyAPI_FUNC(Py_ssize_t) PyUnicode_Find(
906
+ PyObject *str, /* String */
907
+ PyObject *substr, /* Substring to find */
908
+ Py_ssize_t start, /* Start index */
909
+ Py_ssize_t end, /* Stop index */
910
+ int direction /* Find direction: +1 forward, -1 backward */
911
+ );
912
+
913
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
914
+ /* Like PyUnicode_Find, but search for single character only. */
915
+ PyAPI_FUNC(Py_ssize_t) PyUnicode_FindChar(
916
+ PyObject *str,
917
+ Py_UCS4 ch,
918
+ Py_ssize_t start,
919
+ Py_ssize_t end,
920
+ int direction
921
+ );
922
+ #endif
923
+
924
+ /* Count the number of occurrences of substr in str[start:end]. */
925
+
926
+ PyAPI_FUNC(Py_ssize_t) PyUnicode_Count(
927
+ PyObject *str, /* String */
928
+ PyObject *substr, /* Substring to count */
929
+ Py_ssize_t start, /* Start index */
930
+ Py_ssize_t end /* Stop index */
931
+ );
932
+
933
+ /* Replace at most maxcount occurrences of substr in str with replstr
934
+ and return the resulting Unicode object. */
935
+
936
+ PyAPI_FUNC(PyObject *) PyUnicode_Replace(
937
+ PyObject *str, /* String */
938
+ PyObject *substr, /* Substring to find */
939
+ PyObject *replstr, /* Substring to replace */
940
+ Py_ssize_t maxcount /* Max. number of replacements to apply;
941
+ -1 = all */
942
+ );
943
+
944
+ /* Compare two strings and return -1, 0, 1 for less than, equal,
945
+ greater than resp.
946
+ Raise an exception and return -1 on error. */
947
+
948
+ PyAPI_FUNC(int) PyUnicode_Compare(
949
+ PyObject *left, /* Left string */
950
+ PyObject *right /* Right string */
951
+ );
952
+
953
+ /* Compare a Unicode object with C string and return -1, 0, 1 for less than,
954
+ equal, and greater than, respectively. It is best to pass only
955
+ ASCII-encoded strings, but the function interprets the input string as
956
+ ISO-8859-1 if it contains non-ASCII characters.
957
+ This function does not raise exceptions. */
958
+
959
+ PyAPI_FUNC(int) PyUnicode_CompareWithASCIIString(
960
+ PyObject *left,
961
+ const char *right /* ASCII-encoded string */
962
+ );
963
+
964
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030D0000
965
+ /* Compare a Unicode object with UTF-8 encoded C string.
966
+ Return 1 if they are equal, or 0 otherwise.
967
+ This function does not raise exceptions. */
968
+
969
+ PyAPI_FUNC(int) PyUnicode_EqualToUTF8(PyObject *, const char *);
970
+ PyAPI_FUNC(int) PyUnicode_EqualToUTF8AndSize(PyObject *, const char *, Py_ssize_t);
971
+ #endif
972
+
973
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030e0000
974
+ PyAPI_FUNC(int) PyUnicode_Equal(PyObject *str1, PyObject *str2);
975
+ #endif
976
+
977
+ /* Rich compare two strings and return one of the following:
978
+
979
+ - NULL in case an exception was raised
980
+ - Py_True or Py_False for successful comparisons
981
+ - Py_NotImplemented in case the type combination is unknown
982
+
983
+ Possible values for op:
984
+
985
+ Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE
986
+
987
+ */
988
+
989
+ PyAPI_FUNC(PyObject *) PyUnicode_RichCompare(
990
+ PyObject *left, /* Left string */
991
+ PyObject *right, /* Right string */
992
+ int op /* Operation: Py_EQ, Py_NE, Py_GT, etc. */
993
+ );
994
+
995
+ /* Apply an argument tuple or dictionary to a format string and return
996
+ the resulting Unicode string. */
997
+
998
+ PyAPI_FUNC(PyObject *) PyUnicode_Format(
999
+ PyObject *format, /* Format string */
1000
+ PyObject *args /* Argument tuple or dictionary */
1001
+ );
1002
+
1003
+ /* Checks whether element is contained in container and return 1/0
1004
+ accordingly.
1005
+
1006
+ element has to coerce to a one element Unicode string. -1 is
1007
+ returned in case of an error. */
1008
+
1009
+ PyAPI_FUNC(int) PyUnicode_Contains(
1010
+ PyObject *container, /* Container string */
1011
+ PyObject *element /* Element string */
1012
+ );
1013
+
1014
+ /* Checks whether argument is a valid identifier. */
1015
+
1016
+ PyAPI_FUNC(int) PyUnicode_IsIdentifier(PyObject *s);
1017
+
1018
+ /* === Characters Type APIs =============================================== */
1019
+
1020
+ #ifndef Py_LIMITED_API
1021
+ # define Py_CPYTHON_UNICODEOBJECT_H
1022
+ # include "cpython/unicodeobject.h"
1023
+ # undef Py_CPYTHON_UNICODEOBJECT_H
1024
+ #endif
1025
+
1026
+ #ifdef __cplusplus
1027
+ }
1028
+ #endif
1029
+ #endif /* !Py_UNICODEOBJECT_H */