@pairling/runtime-darwin-x64 0.2.0 → 0.2.2

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 (159) hide show
  1. package/README.md +1 -1
  2. package/bin/pairling-connectd +0 -0
  3. package/manifest.json +4 -4
  4. package/package.json +3 -3
  5. package/python/bin/python3 +0 -0
  6. package/python/bin/python3.12 +0 -0
  7. package/python/lib/libpython3.12.dylib +0 -0
  8. package/python/lib/python3.12/lib-dynload/_crypt.cpython-312-darwin.so +0 -0
  9. package/python/lib/python3.12/lib-dynload/_dbm.cpython-312-darwin.so +0 -0
  10. package/python/lib/python3.12/site-packages/_cffi_backend.cpython-312-darwin.so +0 -0
  11. package/python/lib/python3.12/site-packages/cffi/__init__.py +14 -0
  12. package/python/lib/python3.12/site-packages/cffi/_cffi_errors.h +149 -0
  13. package/python/lib/python3.12/site-packages/cffi/_cffi_include.h +389 -0
  14. package/python/lib/python3.12/site-packages/cffi/_embedding.h +550 -0
  15. package/python/lib/python3.12/site-packages/cffi/_imp_emulation.py +83 -0
  16. package/python/lib/python3.12/site-packages/cffi/_shimmed_dist_utils.py +45 -0
  17. package/python/lib/python3.12/site-packages/cffi/api.py +967 -0
  18. package/python/lib/python3.12/site-packages/cffi/backend_ctypes.py +1121 -0
  19. package/python/lib/python3.12/site-packages/cffi/cffi_opcode.py +187 -0
  20. package/python/lib/python3.12/site-packages/cffi/commontypes.py +82 -0
  21. package/python/lib/python3.12/site-packages/cffi/cparser.py +1015 -0
  22. package/python/lib/python3.12/site-packages/cffi/error.py +31 -0
  23. package/python/lib/python3.12/site-packages/cffi/ffiplatform.py +113 -0
  24. package/python/lib/python3.12/site-packages/cffi/lock.py +30 -0
  25. package/python/lib/python3.12/site-packages/cffi/model.py +618 -0
  26. package/python/lib/python3.12/site-packages/cffi/parse_c_type.h +181 -0
  27. package/python/lib/python3.12/site-packages/cffi/pkgconfig.py +121 -0
  28. package/python/lib/python3.12/site-packages/cffi/recompiler.py +1598 -0
  29. package/python/lib/python3.12/site-packages/cffi/setuptools_ext.py +216 -0
  30. package/python/lib/python3.12/site-packages/cffi/vengine_cpy.py +1084 -0
  31. package/python/lib/python3.12/site-packages/cffi/vengine_gen.py +679 -0
  32. package/python/lib/python3.12/site-packages/cffi/verifier.py +306 -0
  33. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/INSTALLER +1 -0
  34. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/LICENSE +26 -0
  35. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/METADATA +40 -0
  36. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/RECORD +30 -0
  37. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/WHEEL +5 -0
  38. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/entry_points.txt +2 -0
  39. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/top_level.txt +2 -0
  40. package/python/lib/python3.12/site-packages/cryptography/__about__.py +17 -0
  41. package/python/lib/python3.12/site-packages/cryptography/__init__.py +26 -0
  42. package/python/lib/python3.12/site-packages/cryptography/exceptions.py +52 -0
  43. package/python/lib/python3.12/site-packages/cryptography/fernet.py +224 -0
  44. package/python/lib/python3.12/site-packages/cryptography/hazmat/__init__.py +13 -0
  45. package/python/lib/python3.12/site-packages/cryptography/hazmat/_oid.py +348 -0
  46. package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/__init__.py +13 -0
  47. package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/openssl/__init__.py +9 -0
  48. package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/openssl/backend.py +308 -0
  49. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/__init__.py +3 -0
  50. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/__init__.pyi +37 -0
  51. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/_openssl.pyi +8 -0
  52. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/asn1.pyi +7 -0
  53. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/exceptions.pyi +17 -0
  54. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/ocsp.pyi +117 -0
  55. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/__init__.pyi +75 -0
  56. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/aead.pyi +107 -0
  57. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ciphers.pyi +38 -0
  58. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/cmac.pyi +18 -0
  59. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/dh.pyi +51 -0
  60. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/dsa.pyi +41 -0
  61. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ec.pyi +52 -0
  62. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed25519.pyi +13 -0
  63. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed448.pyi +13 -0
  64. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/hashes.pyi +28 -0
  65. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/hmac.pyi +22 -0
  66. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/kdf.pyi +49 -0
  67. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/keys.pyi +34 -0
  68. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/poly1305.pyi +15 -0
  69. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/rsa.pyi +55 -0
  70. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/x25519.pyi +13 -0
  71. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/x448.pyi +13 -0
  72. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/pkcs12.pyi +52 -0
  73. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/pkcs7.pyi +50 -0
  74. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/test_support.pyi +23 -0
  75. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/x509.pyi +313 -0
  76. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust.abi3.so +0 -0
  77. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/__init__.py +3 -0
  78. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/_conditional.py +191 -0
  79. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/binding.py +122 -0
  80. package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/__init__.py +5 -0
  81. package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/ciphers/__init__.py +5 -0
  82. package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/ciphers/algorithms.py +112 -0
  83. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/__init__.py +3 -0
  84. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_asymmetric.py +19 -0
  85. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_cipheralgorithm.py +60 -0
  86. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_serialization.py +168 -0
  87. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/__init__.py +3 -0
  88. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/dh.py +147 -0
  89. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/dsa.py +167 -0
  90. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ec.py +447 -0
  91. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ed25519.py +129 -0
  92. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ed448.py +131 -0
  93. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/padding.py +113 -0
  94. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/rsa.py +277 -0
  95. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/types.py +111 -0
  96. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/utils.py +24 -0
  97. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/x25519.py +122 -0
  98. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/x448.py +125 -0
  99. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/__init__.py +27 -0
  100. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/aead.py +23 -0
  101. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py +183 -0
  102. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/base.py +146 -0
  103. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/modes.py +268 -0
  104. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/cmac.py +10 -0
  105. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/constant_time.py +14 -0
  106. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/hashes.py +246 -0
  107. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/hmac.py +13 -0
  108. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/__init__.py +23 -0
  109. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/argon2.py +13 -0
  110. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/concatkdf.py +125 -0
  111. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/hkdf.py +101 -0
  112. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.py +305 -0
  113. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/pbkdf2.py +62 -0
  114. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/scrypt.py +19 -0
  115. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/x963kdf.py +61 -0
  116. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/keywrap.py +177 -0
  117. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/padding.py +69 -0
  118. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/poly1305.py +11 -0
  119. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/__init__.py +65 -0
  120. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/base.py +14 -0
  121. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/pkcs12.py +176 -0
  122. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/pkcs7.py +411 -0
  123. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/ssh.py +1619 -0
  124. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/__init__.py +9 -0
  125. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/hotp.py +101 -0
  126. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/totp.py +56 -0
  127. package/python/lib/python3.12/site-packages/cryptography/py.typed +0 -0
  128. package/python/lib/python3.12/site-packages/cryptography/utils.py +139 -0
  129. package/python/lib/python3.12/site-packages/cryptography/x509/__init__.py +270 -0
  130. package/python/lib/python3.12/site-packages/cryptography/x509/base.py +848 -0
  131. package/python/lib/python3.12/site-packages/cryptography/x509/certificate_transparency.py +35 -0
  132. package/python/lib/python3.12/site-packages/cryptography/x509/extensions.py +2528 -0
  133. package/python/lib/python3.12/site-packages/cryptography/x509/general_name.py +281 -0
  134. package/python/lib/python3.12/site-packages/cryptography/x509/name.py +477 -0
  135. package/python/lib/python3.12/site-packages/cryptography/x509/ocsp.py +379 -0
  136. package/python/lib/python3.12/site-packages/cryptography/x509/oid.py +37 -0
  137. package/python/lib/python3.12/site-packages/cryptography/x509/verification.py +34 -0
  138. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/INSTALLER +1 -0
  139. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/METADATA +139 -0
  140. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/RECORD +106 -0
  141. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/REQUESTED +0 -0
  142. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/WHEEL +4 -0
  143. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE +3 -0
  144. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE.APACHE +202 -0
  145. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE.BSD +27 -0
  146. package/python/lib/python3.12/site-packages/pycparser/__init__.py +99 -0
  147. package/python/lib/python3.12/site-packages/pycparser/_ast_gen.py +355 -0
  148. package/python/lib/python3.12/site-packages/pycparser/_c_ast.cfg +195 -0
  149. package/python/lib/python3.12/site-packages/pycparser/ast_transforms.py +174 -0
  150. package/python/lib/python3.12/site-packages/pycparser/c_ast.py +1341 -0
  151. package/python/lib/python3.12/site-packages/pycparser/c_generator.py +573 -0
  152. package/python/lib/python3.12/site-packages/pycparser/c_lexer.py +706 -0
  153. package/python/lib/python3.12/site-packages/pycparser/c_parser.py +2376 -0
  154. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/INSTALLER +1 -0
  155. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/METADATA +244 -0
  156. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/RECORD +14 -0
  157. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/WHEEL +5 -0
  158. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/licenses/LICENSE +27 -0
  159. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/top_level.txt +1 -0
package/README.md CHANGED
@@ -16,4 +16,4 @@ signature and Team ID before staging it — an unsigned or re-signed binary is
16
16
  rejected, fail closed.
17
17
 
18
18
  - Product: https://pairling.dev
19
- - Source mirror & publish pipeline: https://github.com/mergimg0/pairling-helper
19
+ - Source mirror & publish pipeline: https://pairling.dev
Binary file
package/manifest.json CHANGED
@@ -2,17 +2,17 @@
2
2
  "files": [
3
3
  {
4
4
  "path": "bin/pairling-connectd",
5
- "sha256": "6110a1487cd8f9bc8330b9310180bbf4fd5031307466a821bea8073dc847e013",
5
+ "sha256": "05da872d33362df876e3fbca2d527f8acd33225917a774068bd3894fe2cbec84",
6
6
  "team_id": "965AVD34A3"
7
7
  },
8
8
  {
9
9
  "identifier": "dev.pairling.python",
10
10
  "path": "python/bin/python3",
11
- "sha256": "f5190f31c832694e35c03c42e472a762b53d090170d27ebf66ec662cdfc6bd77",
11
+ "sha256": "8258411653807eb1e43d3aa4ee25a66f655233004696abf7aa844d050a8c1649",
12
12
  "team_id": "965AVD34A3"
13
13
  }
14
14
  ],
15
- "package_version": "0.2.0",
15
+ "package_version": "0.2.2",
16
16
  "schema_version": 1,
17
- "source_revision": "58288e6"
17
+ "source_revision": "a1eaa1ac"
18
18
  }
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@pairling/runtime-darwin-x64",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Pairling Mac runtime binaries for Intel Macs. Installed automatically as an optional dependency of the `pairling` package \u2014 do not install directly.",
5
5
  "homepage": "https://pairling.dev",
6
6
  "bugs": {
7
- "url": "https://github.com/mergimg0/pairling-helper/issues"
7
+ "url": "https://pairling.dev/support"
8
8
  },
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "git+https://github.com/mergimg0/pairling-helper.git"
11
+ "url": "https://pairling.dev"
12
12
  },
13
13
  "license": "UNLICENSED",
14
14
  "author": "Pairling (https://pairling.dev)",
Binary file
Binary file
Binary file
@@ -0,0 +1,14 @@
1
+ __all__ = ['FFI', 'VerificationError', 'VerificationMissing', 'CDefError',
2
+ 'FFIError']
3
+
4
+ from .api import FFI
5
+ from .error import CDefError, FFIError, VerificationError, VerificationMissing
6
+ from .error import PkgConfigError
7
+
8
+ __version__ = "1.17.1"
9
+ __version_info__ = (1, 17, 1)
10
+
11
+ # The verifier module file names are based on the CRC32 of a string that
12
+ # contains the following version number. It may be older than __version__
13
+ # if nothing is clearly incompatible.
14
+ __version_verifier_modules__ = "0.8.6"
@@ -0,0 +1,149 @@
1
+ #ifndef CFFI_MESSAGEBOX
2
+ # ifdef _MSC_VER
3
+ # define CFFI_MESSAGEBOX 1
4
+ # else
5
+ # define CFFI_MESSAGEBOX 0
6
+ # endif
7
+ #endif
8
+
9
+
10
+ #if CFFI_MESSAGEBOX
11
+ /* Windows only: logic to take the Python-CFFI embedding logic
12
+ initialization errors and display them in a background thread
13
+ with MessageBox. The idea is that if the whole program closes
14
+ as a result of this problem, then likely it is already a console
15
+ program and you can read the stderr output in the console too.
16
+ If it is not a console program, then it will likely show its own
17
+ dialog to complain, or generally not abruptly close, and for this
18
+ case the background thread should stay alive.
19
+ */
20
+ static void *volatile _cffi_bootstrap_text;
21
+
22
+ static PyObject *_cffi_start_error_capture(void)
23
+ {
24
+ PyObject *result = NULL;
25
+ PyObject *x, *m, *bi;
26
+
27
+ if (InterlockedCompareExchangePointer(&_cffi_bootstrap_text,
28
+ (void *)1, NULL) != NULL)
29
+ return (PyObject *)1;
30
+
31
+ m = PyImport_AddModule("_cffi_error_capture");
32
+ if (m == NULL)
33
+ goto error;
34
+
35
+ result = PyModule_GetDict(m);
36
+ if (result == NULL)
37
+ goto error;
38
+
39
+ #if PY_MAJOR_VERSION >= 3
40
+ bi = PyImport_ImportModule("builtins");
41
+ #else
42
+ bi = PyImport_ImportModule("__builtin__");
43
+ #endif
44
+ if (bi == NULL)
45
+ goto error;
46
+ PyDict_SetItemString(result, "__builtins__", bi);
47
+ Py_DECREF(bi);
48
+
49
+ x = PyRun_String(
50
+ "import sys\n"
51
+ "class FileLike:\n"
52
+ " def write(self, x):\n"
53
+ " try:\n"
54
+ " of.write(x)\n"
55
+ " except: pass\n"
56
+ " self.buf += x\n"
57
+ " def flush(self):\n"
58
+ " pass\n"
59
+ "fl = FileLike()\n"
60
+ "fl.buf = ''\n"
61
+ "of = sys.stderr\n"
62
+ "sys.stderr = fl\n"
63
+ "def done():\n"
64
+ " sys.stderr = of\n"
65
+ " return fl.buf\n", /* make sure the returned value stays alive */
66
+ Py_file_input,
67
+ result, result);
68
+ Py_XDECREF(x);
69
+
70
+ error:
71
+ if (PyErr_Occurred())
72
+ {
73
+ PyErr_WriteUnraisable(Py_None);
74
+ PyErr_Clear();
75
+ }
76
+ return result;
77
+ }
78
+
79
+ #pragma comment(lib, "user32.lib")
80
+
81
+ static DWORD WINAPI _cffi_bootstrap_dialog(LPVOID ignored)
82
+ {
83
+ Sleep(666); /* may be interrupted if the whole process is closing */
84
+ #if PY_MAJOR_VERSION >= 3
85
+ MessageBoxW(NULL, (wchar_t *)_cffi_bootstrap_text,
86
+ L"Python-CFFI error",
87
+ MB_OK | MB_ICONERROR);
88
+ #else
89
+ MessageBoxA(NULL, (char *)_cffi_bootstrap_text,
90
+ "Python-CFFI error",
91
+ MB_OK | MB_ICONERROR);
92
+ #endif
93
+ _cffi_bootstrap_text = NULL;
94
+ return 0;
95
+ }
96
+
97
+ static void _cffi_stop_error_capture(PyObject *ecap)
98
+ {
99
+ PyObject *s;
100
+ void *text;
101
+
102
+ if (ecap == (PyObject *)1)
103
+ return;
104
+
105
+ if (ecap == NULL)
106
+ goto error;
107
+
108
+ s = PyRun_String("done()", Py_eval_input, ecap, ecap);
109
+ if (s == NULL)
110
+ goto error;
111
+
112
+ /* Show a dialog box, but in a background thread, and
113
+ never show multiple dialog boxes at once. */
114
+ #if PY_MAJOR_VERSION >= 3
115
+ text = PyUnicode_AsWideCharString(s, NULL);
116
+ #else
117
+ text = PyString_AsString(s);
118
+ #endif
119
+
120
+ _cffi_bootstrap_text = text;
121
+
122
+ if (text != NULL)
123
+ {
124
+ HANDLE h;
125
+ h = CreateThread(NULL, 0, _cffi_bootstrap_dialog,
126
+ NULL, 0, NULL);
127
+ if (h != NULL)
128
+ CloseHandle(h);
129
+ }
130
+ /* decref the string, but it should stay alive as 'fl.buf'
131
+ in the small module above. It will really be freed only if
132
+ we later get another similar error. So it's a leak of at
133
+ most one copy of the small module. That's fine for this
134
+ situation which is usually a "fatal error" anyway. */
135
+ Py_DECREF(s);
136
+ PyErr_Clear();
137
+ return;
138
+
139
+ error:
140
+ _cffi_bootstrap_text = NULL;
141
+ PyErr_Clear();
142
+ }
143
+
144
+ #else
145
+
146
+ static PyObject *_cffi_start_error_capture(void) { return NULL; }
147
+ static void _cffi_stop_error_capture(PyObject *ecap) { }
148
+
149
+ #endif
@@ -0,0 +1,389 @@
1
+ #define _CFFI_
2
+
3
+ /* We try to define Py_LIMITED_API before including Python.h.
4
+
5
+ Mess: we can only define it if Py_DEBUG, Py_TRACE_REFS and
6
+ Py_REF_DEBUG are not defined. This is a best-effort approximation:
7
+ we can learn about Py_DEBUG from pyconfig.h, but it is unclear if
8
+ the same works for the other two macros. Py_DEBUG implies them,
9
+ but not the other way around.
10
+
11
+ The implementation is messy (issue #350): on Windows, with _MSC_VER,
12
+ we have to define Py_LIMITED_API even before including pyconfig.h.
13
+ In that case, we guess what pyconfig.h will do to the macros above,
14
+ and check our guess after the #include.
15
+
16
+ Note that on Windows, with CPython 3.x, you need >= 3.5 and virtualenv
17
+ version >= 16.0.0. With older versions of either, you don't get a
18
+ copy of PYTHON3.DLL in the virtualenv. We can't check the version of
19
+ CPython *before* we even include pyconfig.h. ffi.set_source() puts
20
+ a ``#define _CFFI_NO_LIMITED_API'' at the start of this file if it is
21
+ running on Windows < 3.5, as an attempt at fixing it, but that's
22
+ arguably wrong because it may not be the target version of Python.
23
+ Still better than nothing I guess. As another workaround, you can
24
+ remove the definition of Py_LIMITED_API here.
25
+
26
+ See also 'py_limited_api' in cffi/setuptools_ext.py.
27
+ */
28
+ #if !defined(_CFFI_USE_EMBEDDING) && !defined(Py_LIMITED_API)
29
+ # ifdef _MSC_VER
30
+ # if !defined(_DEBUG) && !defined(Py_DEBUG) && !defined(Py_TRACE_REFS) && !defined(Py_REF_DEBUG) && !defined(_CFFI_NO_LIMITED_API)
31
+ # define Py_LIMITED_API
32
+ # endif
33
+ # include <pyconfig.h>
34
+ /* sanity-check: Py_LIMITED_API will cause crashes if any of these
35
+ are also defined. Normally, the Python file PC/pyconfig.h does not
36
+ cause any of these to be defined, with the exception that _DEBUG
37
+ causes Py_DEBUG. Double-check that. */
38
+ # ifdef Py_LIMITED_API
39
+ # if defined(Py_DEBUG)
40
+ # error "pyconfig.h unexpectedly defines Py_DEBUG, but Py_LIMITED_API is set"
41
+ # endif
42
+ # if defined(Py_TRACE_REFS)
43
+ # error "pyconfig.h unexpectedly defines Py_TRACE_REFS, but Py_LIMITED_API is set"
44
+ # endif
45
+ # if defined(Py_REF_DEBUG)
46
+ # error "pyconfig.h unexpectedly defines Py_REF_DEBUG, but Py_LIMITED_API is set"
47
+ # endif
48
+ # endif
49
+ # else
50
+ # include <pyconfig.h>
51
+ # if !defined(Py_DEBUG) && !defined(Py_TRACE_REFS) && !defined(Py_REF_DEBUG) && !defined(_CFFI_NO_LIMITED_API)
52
+ # define Py_LIMITED_API
53
+ # endif
54
+ # endif
55
+ #endif
56
+
57
+ #include <Python.h>
58
+ #ifdef __cplusplus
59
+ extern "C" {
60
+ #endif
61
+ #include <stddef.h>
62
+ #include "parse_c_type.h"
63
+
64
+ /* this block of #ifs should be kept exactly identical between
65
+ c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py
66
+ and cffi/_cffi_include.h */
67
+ #if defined(_MSC_VER)
68
+ # include <malloc.h> /* for alloca() */
69
+ # if _MSC_VER < 1600 /* MSVC < 2010 */
70
+ typedef __int8 int8_t;
71
+ typedef __int16 int16_t;
72
+ typedef __int32 int32_t;
73
+ typedef __int64 int64_t;
74
+ typedef unsigned __int8 uint8_t;
75
+ typedef unsigned __int16 uint16_t;
76
+ typedef unsigned __int32 uint32_t;
77
+ typedef unsigned __int64 uint64_t;
78
+ typedef __int8 int_least8_t;
79
+ typedef __int16 int_least16_t;
80
+ typedef __int32 int_least32_t;
81
+ typedef __int64 int_least64_t;
82
+ typedef unsigned __int8 uint_least8_t;
83
+ typedef unsigned __int16 uint_least16_t;
84
+ typedef unsigned __int32 uint_least32_t;
85
+ typedef unsigned __int64 uint_least64_t;
86
+ typedef __int8 int_fast8_t;
87
+ typedef __int16 int_fast16_t;
88
+ typedef __int32 int_fast32_t;
89
+ typedef __int64 int_fast64_t;
90
+ typedef unsigned __int8 uint_fast8_t;
91
+ typedef unsigned __int16 uint_fast16_t;
92
+ typedef unsigned __int32 uint_fast32_t;
93
+ typedef unsigned __int64 uint_fast64_t;
94
+ typedef __int64 intmax_t;
95
+ typedef unsigned __int64 uintmax_t;
96
+ # else
97
+ # include <stdint.h>
98
+ # endif
99
+ # if _MSC_VER < 1800 /* MSVC < 2013 */
100
+ # ifndef __cplusplus
101
+ typedef unsigned char _Bool;
102
+ # endif
103
+ # endif
104
+ # define _cffi_float_complex_t _Fcomplex /* include <complex.h> for it */
105
+ # define _cffi_double_complex_t _Dcomplex /* include <complex.h> for it */
106
+ #else
107
+ # include <stdint.h>
108
+ # if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux)
109
+ # include <alloca.h>
110
+ # endif
111
+ # define _cffi_float_complex_t float _Complex
112
+ # define _cffi_double_complex_t double _Complex
113
+ #endif
114
+
115
+ #ifdef __GNUC__
116
+ # define _CFFI_UNUSED_FN __attribute__((unused))
117
+ #else
118
+ # define _CFFI_UNUSED_FN /* nothing */
119
+ #endif
120
+
121
+ #ifdef __cplusplus
122
+ # ifndef _Bool
123
+ typedef bool _Bool; /* semi-hackish: C++ has no _Bool; bool is builtin */
124
+ # endif
125
+ #endif
126
+
127
+ /********** CPython-specific section **********/
128
+ #ifndef PYPY_VERSION
129
+
130
+
131
+ #if PY_MAJOR_VERSION >= 3
132
+ # define PyInt_FromLong PyLong_FromLong
133
+ #endif
134
+
135
+ #define _cffi_from_c_double PyFloat_FromDouble
136
+ #define _cffi_from_c_float PyFloat_FromDouble
137
+ #define _cffi_from_c_long PyInt_FromLong
138
+ #define _cffi_from_c_ulong PyLong_FromUnsignedLong
139
+ #define _cffi_from_c_longlong PyLong_FromLongLong
140
+ #define _cffi_from_c_ulonglong PyLong_FromUnsignedLongLong
141
+ #define _cffi_from_c__Bool PyBool_FromLong
142
+
143
+ #define _cffi_to_c_double PyFloat_AsDouble
144
+ #define _cffi_to_c_float PyFloat_AsDouble
145
+
146
+ #define _cffi_from_c_int(x, type) \
147
+ (((type)-1) > 0 ? /* unsigned */ \
148
+ (sizeof(type) < sizeof(long) ? \
149
+ PyInt_FromLong((long)x) : \
150
+ sizeof(type) == sizeof(long) ? \
151
+ PyLong_FromUnsignedLong((unsigned long)x) : \
152
+ PyLong_FromUnsignedLongLong((unsigned long long)x)) : \
153
+ (sizeof(type) <= sizeof(long) ? \
154
+ PyInt_FromLong((long)x) : \
155
+ PyLong_FromLongLong((long long)x)))
156
+
157
+ #define _cffi_to_c_int(o, type) \
158
+ ((type)( \
159
+ sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \
160
+ : (type)_cffi_to_c_i8(o)) : \
161
+ sizeof(type) == 2 ? (((type)-1) > 0 ? (type)_cffi_to_c_u16(o) \
162
+ : (type)_cffi_to_c_i16(o)) : \
163
+ sizeof(type) == 4 ? (((type)-1) > 0 ? (type)_cffi_to_c_u32(o) \
164
+ : (type)_cffi_to_c_i32(o)) : \
165
+ sizeof(type) == 8 ? (((type)-1) > 0 ? (type)_cffi_to_c_u64(o) \
166
+ : (type)_cffi_to_c_i64(o)) : \
167
+ (Py_FatalError("unsupported size for type " #type), (type)0)))
168
+
169
+ #define _cffi_to_c_i8 \
170
+ ((int(*)(PyObject *))_cffi_exports[1])
171
+ #define _cffi_to_c_u8 \
172
+ ((int(*)(PyObject *))_cffi_exports[2])
173
+ #define _cffi_to_c_i16 \
174
+ ((int(*)(PyObject *))_cffi_exports[3])
175
+ #define _cffi_to_c_u16 \
176
+ ((int(*)(PyObject *))_cffi_exports[4])
177
+ #define _cffi_to_c_i32 \
178
+ ((int(*)(PyObject *))_cffi_exports[5])
179
+ #define _cffi_to_c_u32 \
180
+ ((unsigned int(*)(PyObject *))_cffi_exports[6])
181
+ #define _cffi_to_c_i64 \
182
+ ((long long(*)(PyObject *))_cffi_exports[7])
183
+ #define _cffi_to_c_u64 \
184
+ ((unsigned long long(*)(PyObject *))_cffi_exports[8])
185
+ #define _cffi_to_c_char \
186
+ ((int(*)(PyObject *))_cffi_exports[9])
187
+ #define _cffi_from_c_pointer \
188
+ ((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[10])
189
+ #define _cffi_to_c_pointer \
190
+ ((char *(*)(PyObject *, struct _cffi_ctypedescr *))_cffi_exports[11])
191
+ #define _cffi_get_struct_layout \
192
+ not used any more
193
+ #define _cffi_restore_errno \
194
+ ((void(*)(void))_cffi_exports[13])
195
+ #define _cffi_save_errno \
196
+ ((void(*)(void))_cffi_exports[14])
197
+ #define _cffi_from_c_char \
198
+ ((PyObject *(*)(char))_cffi_exports[15])
199
+ #define _cffi_from_c_deref \
200
+ ((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[16])
201
+ #define _cffi_to_c \
202
+ ((int(*)(char *, struct _cffi_ctypedescr *, PyObject *))_cffi_exports[17])
203
+ #define _cffi_from_c_struct \
204
+ ((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[18])
205
+ #define _cffi_to_c_wchar_t \
206
+ ((_cffi_wchar_t(*)(PyObject *))_cffi_exports[19])
207
+ #define _cffi_from_c_wchar_t \
208
+ ((PyObject *(*)(_cffi_wchar_t))_cffi_exports[20])
209
+ #define _cffi_to_c_long_double \
210
+ ((long double(*)(PyObject *))_cffi_exports[21])
211
+ #define _cffi_to_c__Bool \
212
+ ((_Bool(*)(PyObject *))_cffi_exports[22])
213
+ #define _cffi_prepare_pointer_call_argument \
214
+ ((Py_ssize_t(*)(struct _cffi_ctypedescr *, \
215
+ PyObject *, char **))_cffi_exports[23])
216
+ #define _cffi_convert_array_from_object \
217
+ ((int(*)(char *, struct _cffi_ctypedescr *, PyObject *))_cffi_exports[24])
218
+ #define _CFFI_CPIDX 25
219
+ #define _cffi_call_python \
220
+ ((void(*)(struct _cffi_externpy_s *, char *))_cffi_exports[_CFFI_CPIDX])
221
+ #define _cffi_to_c_wchar3216_t \
222
+ ((int(*)(PyObject *))_cffi_exports[26])
223
+ #define _cffi_from_c_wchar3216_t \
224
+ ((PyObject *(*)(int))_cffi_exports[27])
225
+ #define _CFFI_NUM_EXPORTS 28
226
+
227
+ struct _cffi_ctypedescr;
228
+
229
+ static void *_cffi_exports[_CFFI_NUM_EXPORTS];
230
+
231
+ #define _cffi_type(index) ( \
232
+ assert((((uintptr_t)_cffi_types[index]) & 1) == 0), \
233
+ (struct _cffi_ctypedescr *)_cffi_types[index])
234
+
235
+ static PyObject *_cffi_init(const char *module_name, Py_ssize_t version,
236
+ const struct _cffi_type_context_s *ctx)
237
+ {
238
+ PyObject *module, *o_arg, *new_module;
239
+ void *raw[] = {
240
+ (void *)module_name,
241
+ (void *)version,
242
+ (void *)_cffi_exports,
243
+ (void *)ctx,
244
+ };
245
+
246
+ module = PyImport_ImportModule("_cffi_backend");
247
+ if (module == NULL)
248
+ goto failure;
249
+
250
+ o_arg = PyLong_FromVoidPtr((void *)raw);
251
+ if (o_arg == NULL)
252
+ goto failure;
253
+
254
+ new_module = PyObject_CallMethod(
255
+ module, (char *)"_init_cffi_1_0_external_module", (char *)"O", o_arg);
256
+
257
+ Py_DECREF(o_arg);
258
+ Py_DECREF(module);
259
+ return new_module;
260
+
261
+ failure:
262
+ Py_XDECREF(module);
263
+ return NULL;
264
+ }
265
+
266
+
267
+ #ifdef HAVE_WCHAR_H
268
+ typedef wchar_t _cffi_wchar_t;
269
+ #else
270
+ typedef uint16_t _cffi_wchar_t; /* same random pick as _cffi_backend.c */
271
+ #endif
272
+
273
+ _CFFI_UNUSED_FN static uint16_t _cffi_to_c_char16_t(PyObject *o)
274
+ {
275
+ if (sizeof(_cffi_wchar_t) == 2)
276
+ return (uint16_t)_cffi_to_c_wchar_t(o);
277
+ else
278
+ return (uint16_t)_cffi_to_c_wchar3216_t(o);
279
+ }
280
+
281
+ _CFFI_UNUSED_FN static PyObject *_cffi_from_c_char16_t(uint16_t x)
282
+ {
283
+ if (sizeof(_cffi_wchar_t) == 2)
284
+ return _cffi_from_c_wchar_t((_cffi_wchar_t)x);
285
+ else
286
+ return _cffi_from_c_wchar3216_t((int)x);
287
+ }
288
+
289
+ _CFFI_UNUSED_FN static int _cffi_to_c_char32_t(PyObject *o)
290
+ {
291
+ if (sizeof(_cffi_wchar_t) == 4)
292
+ return (int)_cffi_to_c_wchar_t(o);
293
+ else
294
+ return (int)_cffi_to_c_wchar3216_t(o);
295
+ }
296
+
297
+ _CFFI_UNUSED_FN static PyObject *_cffi_from_c_char32_t(unsigned int x)
298
+ {
299
+ if (sizeof(_cffi_wchar_t) == 4)
300
+ return _cffi_from_c_wchar_t((_cffi_wchar_t)x);
301
+ else
302
+ return _cffi_from_c_wchar3216_t((int)x);
303
+ }
304
+
305
+ union _cffi_union_alignment_u {
306
+ unsigned char m_char;
307
+ unsigned short m_short;
308
+ unsigned int m_int;
309
+ unsigned long m_long;
310
+ unsigned long long m_longlong;
311
+ float m_float;
312
+ double m_double;
313
+ long double m_longdouble;
314
+ };
315
+
316
+ struct _cffi_freeme_s {
317
+ struct _cffi_freeme_s *next;
318
+ union _cffi_union_alignment_u alignment;
319
+ };
320
+
321
+ _CFFI_UNUSED_FN static int
322
+ _cffi_convert_array_argument(struct _cffi_ctypedescr *ctptr, PyObject *arg,
323
+ char **output_data, Py_ssize_t datasize,
324
+ struct _cffi_freeme_s **freeme)
325
+ {
326
+ char *p;
327
+ if (datasize < 0)
328
+ return -1;
329
+
330
+ p = *output_data;
331
+ if (p == NULL) {
332
+ struct _cffi_freeme_s *fp = (struct _cffi_freeme_s *)PyObject_Malloc(
333
+ offsetof(struct _cffi_freeme_s, alignment) + (size_t)datasize);
334
+ if (fp == NULL)
335
+ return -1;
336
+ fp->next = *freeme;
337
+ *freeme = fp;
338
+ p = *output_data = (char *)&fp->alignment;
339
+ }
340
+ memset((void *)p, 0, (size_t)datasize);
341
+ return _cffi_convert_array_from_object(p, ctptr, arg);
342
+ }
343
+
344
+ _CFFI_UNUSED_FN static void
345
+ _cffi_free_array_arguments(struct _cffi_freeme_s *freeme)
346
+ {
347
+ do {
348
+ void *p = (void *)freeme;
349
+ freeme = freeme->next;
350
+ PyObject_Free(p);
351
+ } while (freeme != NULL);
352
+ }
353
+
354
+ /********** end CPython-specific section **********/
355
+ #else
356
+ _CFFI_UNUSED_FN
357
+ static void (*_cffi_call_python_org)(struct _cffi_externpy_s *, char *);
358
+ # define _cffi_call_python _cffi_call_python_org
359
+ #endif
360
+
361
+
362
+ #define _cffi_array_len(array) (sizeof(array) / sizeof((array)[0]))
363
+
364
+ #define _cffi_prim_int(size, sign) \
365
+ ((size) == 1 ? ((sign) ? _CFFI_PRIM_INT8 : _CFFI_PRIM_UINT8) : \
366
+ (size) == 2 ? ((sign) ? _CFFI_PRIM_INT16 : _CFFI_PRIM_UINT16) : \
367
+ (size) == 4 ? ((sign) ? _CFFI_PRIM_INT32 : _CFFI_PRIM_UINT32) : \
368
+ (size) == 8 ? ((sign) ? _CFFI_PRIM_INT64 : _CFFI_PRIM_UINT64) : \
369
+ _CFFI__UNKNOWN_PRIM)
370
+
371
+ #define _cffi_prim_float(size) \
372
+ ((size) == sizeof(float) ? _CFFI_PRIM_FLOAT : \
373
+ (size) == sizeof(double) ? _CFFI_PRIM_DOUBLE : \
374
+ (size) == sizeof(long double) ? _CFFI__UNKNOWN_LONG_DOUBLE : \
375
+ _CFFI__UNKNOWN_FLOAT_PRIM)
376
+
377
+ #define _cffi_check_int(got, got_nonpos, expected) \
378
+ ((got_nonpos) == (expected <= 0) && \
379
+ (got) == (unsigned long long)expected)
380
+
381
+ #ifdef MS_WIN32
382
+ # define _cffi_stdcall __stdcall
383
+ #else
384
+ # define _cffi_stdcall /* nothing */
385
+ #endif
386
+
387
+ #ifdef __cplusplus
388
+ }
389
+ #endif