mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
add public.h
This commit is contained in:
parent
ea269686b5
commit
17d0c87c96
@ -7,20 +7,12 @@
|
|||||||
#include "string.h"
|
#include "string.h"
|
||||||
|
|
||||||
#include "pocketpy/common/utils.h"
|
#include "pocketpy/common/utils.h"
|
||||||
|
#include "pocketpy/objects/public.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef int16_t pkpy_Type;
|
|
||||||
|
|
||||||
typedef struct PyObject PyObject;
|
|
||||||
typedef struct pkpy_VM pkpy_VM;
|
|
||||||
|
|
||||||
struct pkpy_G {
|
|
||||||
pkpy_VM* vm;
|
|
||||||
} extern pkpy_g;
|
|
||||||
|
|
||||||
typedef struct PyVar{
|
typedef struct PyVar{
|
||||||
pkpy_Type type;
|
pkpy_Type type;
|
||||||
bool is_ptr;
|
bool is_ptr;
|
||||||
@ -77,10 +69,6 @@ PK_INLINE bool PyVar__IS_OP(const PyVar* a, const PyVar* b){
|
|||||||
|
|
||||||
extern PyVar pkpy_NULL, pkpy_OP_CALL, pkpy_OP_YIELD;
|
extern PyVar pkpy_NULL, pkpy_OP_CALL, pkpy_OP_YIELD;
|
||||||
|
|
||||||
bool py_eq(const PyVar*, const PyVar*);
|
|
||||||
bool py_le(const PyVar*, const PyVar*);
|
|
||||||
int64_t py_hash(const PyVar*);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
24
include/pocketpy/objects/public.h
Normal file
24
include/pocketpy/objects/public.h
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "stdint.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef int16_t pkpy_Type;
|
||||||
|
typedef struct PyObject PyObject;
|
||||||
|
typedef struct PyVar PyVar;
|
||||||
|
typedef struct pkpy_VM pkpy_VM;
|
||||||
|
|
||||||
|
struct pkpy_G {
|
||||||
|
pkpy_VM* vm;
|
||||||
|
} extern pkpy_g;
|
||||||
|
|
||||||
|
bool py_eq(const PyVar*, const PyVar*);
|
||||||
|
bool py_le(const PyVar*, const PyVar*);
|
||||||
|
int64_t py_hash(const PyVar*);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
@ -3,6 +3,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include "pocketpy/objects/public.h"
|
||||||
|
|
||||||
#define DICT_MAX_LOAD 0.75
|
#define DICT_MAX_LOAD 0.75
|
||||||
#define DICT_HASH_NEXT(h) ((h) * 5 + 1)
|
#define DICT_HASH_NEXT(h) ((h) * 5 + 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user