mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
...
This commit is contained in:
parent
58d00d45b8
commit
35f03bf2e2
@ -16,7 +16,7 @@ typedef int64_t py_i64;
|
|||||||
typedef double py_f64;
|
typedef double py_f64;
|
||||||
|
|
||||||
/* string_view */
|
/* string_view */
|
||||||
typedef struct c11_sv{
|
typedef struct c11_sv {
|
||||||
const char* data;
|
const char* data;
|
||||||
int size;
|
int size;
|
||||||
} c11_sv;
|
} c11_sv;
|
||||||
@ -136,25 +136,25 @@ py_GlobalRef py_tpmagic(py_Type type, py_Name name);
|
|||||||
// new style decl-based bindings
|
// new style decl-based bindings
|
||||||
void py_bind(py_Ref obj, const char* sig, py_CFunction f);
|
void py_bind(py_Ref obj, const char* sig, py_CFunction f);
|
||||||
py_ObjectRef py_bind2(py_Ref obj,
|
py_ObjectRef py_bind2(py_Ref obj,
|
||||||
const char* sig,
|
const char* sig,
|
||||||
py_CFunction f,
|
py_CFunction f,
|
||||||
enum BindType bt,
|
enum BindType bt,
|
||||||
const char* docstring,
|
const char* docstring,
|
||||||
int slots);
|
int slots);
|
||||||
|
|
||||||
py_ObjectRef py_bind3(py_Ref obj,
|
py_ObjectRef py_bind3(py_Ref obj,
|
||||||
py_CFunction f,
|
py_CFunction f,
|
||||||
c11_sv name,
|
c11_sv name,
|
||||||
c11_sv* args,
|
c11_sv* args,
|
||||||
int argc,
|
int argc,
|
||||||
c11_sv starred_arg,
|
c11_sv starred_arg,
|
||||||
c11_sv* kwargs,
|
c11_sv* kwargs,
|
||||||
int kwargc,
|
int kwargc,
|
||||||
py_Ref kwdefaults, // a tuple contains default values
|
py_Ref kwdefaults, // a tuple contains default values
|
||||||
c11_sv starred_kwarg,
|
c11_sv starred_kwarg,
|
||||||
enum BindType bt,
|
enum BindType bt,
|
||||||
const char* docstring,
|
const char* docstring,
|
||||||
int slots);
|
int slots);
|
||||||
|
|
||||||
// old style argc-based bindings
|
// old style argc-based bindings
|
||||||
void py_bindmethod(py_Type type, const char* name, py_CFunction f);
|
void py_bindmethod(py_Type type, const char* name, py_CFunction f);
|
||||||
@ -321,8 +321,8 @@ bool py_str(py_Ref val);
|
|||||||
/// The return value of the most recent call.
|
/// The return value of the most recent call.
|
||||||
py_GlobalRef py_retval();
|
py_GlobalRef py_retval();
|
||||||
|
|
||||||
#define py_isnil(self) ((self)->type == 0)
|
#define py_isnil(self) py_istype(self, 0)
|
||||||
#define py_isnone(self) ((self)->type == tp_none_type)
|
#define py_isnone(self) py_istype(self, tp_none_type)
|
||||||
|
|
||||||
/* tuple */
|
/* tuple */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user