|
8 | 8 |
|
9 | 9 | // clang-format off
|
10 | 10 |
|
11 |
| -#define PK_VERSION "2.0.4" |
| 11 | +#define PK_VERSION "2.0.6" |
12 | 12 | #define PK_VERSION_MAJOR 2
|
13 | 13 | #define PK_VERSION_MINOR 0
|
14 |
| -#define PK_VERSION_PATCH 4 |
| 14 | +#define PK_VERSION_PATCH 6 |
15 | 15 |
|
16 | 16 | /*************** feature settings ***************/
|
17 | 17 |
|
@@ -202,6 +202,8 @@ typedef struct py_Callbacks {
|
202 | 202 | char* (*importfile)(const char*);
|
203 | 203 | /// Used by `print` to output a string.
|
204 | 204 | void (*print)(const char*);
|
| 205 | + /// Used by `input` to get a character. |
| 206 | + int (*getchar)(); |
205 | 207 | } py_Callbacks;
|
206 | 208 |
|
207 | 209 | #define PY_RAISE
|
@@ -321,6 +323,8 @@ PK_API void py_newstr(py_OutRef, const char*);
|
321 | 323 | PK_API char* py_newstrn(py_OutRef, int);
|
322 | 324 | /// Create a `str` object from a `c11_sv`.
|
323 | 325 | PK_API void py_newstrv(py_OutRef, c11_sv);
|
| 326 | +/// Create a formatted `str` object. |
| 327 | +PK_API void py_newfstr(py_OutRef, const char*, ...); |
324 | 328 | /// Create a `bytes` object with `n` UNINITIALIZED bytes.
|
325 | 329 | PK_API unsigned char* py_newbytes(py_OutRef, int n);
|
326 | 330 | /// Create a `None` object.
|
@@ -647,11 +651,13 @@ PK_API bool py_pusheval(const char* expr, py_GlobalRef module) PY_RAISE;
|
647 | 651 | PK_API py_GlobalRef py_newmodule(const char* path);
|
648 | 652 | /// Get a module by path.
|
649 | 653 | PK_API py_GlobalRef py_getmodule(const char* path);
|
| 654 | +/// Reload an existing module. |
| 655 | +PK_API bool py_importlib_reload(py_GlobalRef module) PY_RAISE PY_RETURN; |
650 | 656 |
|
651 | 657 | /// Import a module.
|
652 | 658 | /// The result will be set to `py_retval()`.
|
653 | 659 | /// -1: error, 0: not found, 1: success
|
654 |
| -PK_API int py_import(const char* path) PY_RAISE; |
| 660 | +PK_API int py_import(const char* path) PY_RAISE PY_RETURN; |
655 | 661 |
|
656 | 662 | /************* Errors *************/
|
657 | 663 |
|
|
0 commit comments