private.h
Go to the documentation of this file.
1 
8 #include "kuroko/kuroko.h"
9 
10 extern void _createAndBind_numericClasses(void);
11 extern void _createAndBind_strClass(void);
12 extern void _createAndBind_listClass(void);
13 extern void _createAndBind_tupleClass(void);
14 extern void _createAndBind_bytesClass(void);
15 extern void _createAndBind_dictClass(void);
16 extern void _createAndBind_functionClass(void);
17 extern void _createAndBind_rangeClass(void);
18 extern void _createAndBind_setClass(void);
19 extern void _createAndBind_generatorClass(void);
20 extern void _createAndBind_sliceClass(void);
21 extern void _createAndBind_builtins(void);
22 extern void _createAndBind_type(void);
23 extern void _createAndBind_exceptions(void);
24 extern void _createAndBind_longClass(void);
25 extern void _createAndBind_compilerClass(void);
26 
38 typedef enum {
39  #define CACHED_METHOD(a,b,c) METHOD_ ## a,
40  #define SPECIAL_ATTRS(a,b) METHOD_ ## a,
41  #include "methods.h"
42  #undef CACHED_METHOD
43  #undef SPECIAL_ATTRS
44  METHOD__MAX,
46 
47 
48 #define FORMAT_OP_EQ (1 << 0)
49 #define FORMAT_OP_REPR (1 << 1)
50 #define FORMAT_OP_STR (1 << 2)
51 #define FORMAT_OP_FORMAT (1 << 3)
52 
54  const char * fill;
55  char align;
56  char sign;
57  int width;
58  int alt;
59  char sep;
60  int prec;
61  int hasWidth;
62  int hasPrecision;
63  int fillSize;
64 };
65 
66 /* We inline hashing in a few places, so it's nice to have this in one place.
67  * This is the "sdbm" hash. I've been using it in various places for many years,
68  * and this specific version apparently traces to gawk. */
69 #define krk_hash_advance(hash,c) do { hash = (int)(c) + (hash << 6) + (hash << 16) - hash; } while (0)
70 
71 #ifndef KRK_DISABLE_DEBUG
72 #include <kuroko/debug.h>
74  KrkCodeObject * inFunction;
75  size_t offset;
76  int flags;
77  uint8_t originalOpcode;
78 };
79 
80 #define MAX_BREAKPOINTS 32
81 struct DebuggerState {
82  int breakpointsCount;
83  KrkDebugCallback debuggerHook;
84 
85  /* XXX This was previously thread-local; it probably should still be
86  * specific to an individual thread... but we don't really do
87  * much thread debugging, so... */
88  int repeatStack_top;
89  int repeatStack_bottom;
90  int thisWasForced;
91 
92  struct BreakpointEntry breakpoints[MAX_BREAKPOINTS];
93 };
94 #endif
Functions for debugging bytecode execution.
int(* KrkDebugCallback)(KrkCallFrame *frame)
Function pointer for a debugger hook. krk_debug_registerCallback()
Definition: debug.h:73
Top-level header with configuration macros.
void _createAndBind_exceptions(void)
Bind native methods and classes for exceptions.
Definition: exceptions.c:184
KrkSpecialMethods
Index numbers for always-available interned strings representing important method and member names.
Definition: private.h:38
Code object.
Definition: object.h:163