forked from bat67/python-source-code-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobject.h
More file actions
43 lines (34 loc) · 838 Bytes
/
object.h
File metadata and controls
43 lines (34 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef __SPY_OBJECT_H_
#define __SPY_OBJECT_H_
#include <string>
#include <vector>
#include <map>
#include <iostream>
using namespace std;
//definition of PyObject
#define PyObject_HEAD \
int refCount;\
struct tagPyTypeObject *type
#define PyObject_HEAD_INIT(typePtr)\
0, typePtr
typedef struct tagPyObject
{
PyObject_HEAD;
}PyObject;
//definition of PyTypeObject
typedef void (*PrintFun)(PyObject* object, FILE* target);
typedef PyObject* (*AddFun)(PyObject* left, PyObject* right);
typedef long (*HashFun)(PyObject* object);
typedef struct tagPyTypeObject
{
PyObject_HEAD;
char* name;
PrintFun print;
AddFun add;
HashFun hash;
}PyTypeObject;
extern PyTypeObject PyType_Type;
extern PyObject PyNoneObject;
#define PyNone (&PyNoneObject);
bool CheckType(const char* caller, PyObject* object, PyTypeObject* type);
#endif