/
extend.h
104 lines (88 loc) · 3.3 KB
/
extend.h
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* extend.h
* Copyright (C) 2001-2014, Parrot Foundation.
* Overview:
* This is the Parrot extension mechanism, the face we present to
* extension modules and whatnot
* Data Structure and Algorithms:
* History:
* Notes:
* References:
* extend.c, docs/pdds/pdd11_extending.pod.
*/
#ifndef PARROT_EXTEND_H_GUARD
#define PARROT_EXTEND_H_GUARD
#include <stdarg.h>
#include "parrot/parrot.h"
#include "parrot/core_types.h"
#include "parrot/config.h" /* PARROT_VERSION... */
#include "parrot/interpreter.h" /* give us the interpreter flags */
#include "parrot/warnings.h" /* give us the warnings flags */
/* Two versions of each routine, one for when we're building the core
and one for when people are writing extensions. If this gets abused
we'll split this into two pieces and not install the core version,
but that would be really annoying */
#if defined(PARROT_IN_CORE)
#else
typedef Parrot_Int Parrot_Language;
typedef void * Parrot_Encoding;
typedef void * Parrot_CharType;
typedef const void * Parrot_Const_Encoding;
typedef const void * Parrot_Const_CharType;
#endif
#include "parrot/extend_vtable.h" /* the auto-generated prototypes */
/* Backcompat versions for old embed API functions, not yet deprecated */
#define Parrot_new_string(interp, buf, len, encoding, flags) \
Parrot_str_new_init((interp), (buf), (len), (encoding), (flags))
/* HEADERIZER BEGIN: src/extend.c */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
PARROT_EXPORT
Parrot_PMC Parrot_compile_string(PARROT_INTERP,
Parrot_String type,
ARGIN(const char *code),
ARGOUT(Parrot_String *error))
__attribute__nonnull__(1)
__attribute__nonnull__(3)
__attribute__nonnull__(4)
FUNC_MODIFIES(*error);
PARROT_EXPORT
void Parrot_ext_call(PARROT_INTERP,
ARGIN(Parrot_PMC sub_pmc),
ARGIN(const char *signature),
...)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3);
PARROT_EXPORT
void Parrot_ext_try(PARROT_INTERP,
ARGIN_NULLOK(void (*cfunction)(Parrot_Interp,
ARGIN_NULLOK(void *))),
ARGIN_NULLOK(void (*chandler)(Parrot_Interp,
ARGIN_NULLOK(PMC *),
ARGIN_NULLOK(void *))),
ARGIN_NULLOK(void *data))
__attribute__nonnull__(1);
PARROT_EXPORT
Parrot_Int Parrot_PMC_typenum(PARROT_INTERP,
ARGIN_NULLOK(const char *_class))
__attribute__nonnull__(1);
#define ASSERT_ARGS_Parrot_compile_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(code) \
, PARROT_ASSERT_ARG(error))
#define ASSERT_ARGS_Parrot_ext_call __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(sub_pmc) \
, PARROT_ASSERT_ARG(signature))
#define ASSERT_ARGS_Parrot_ext_try __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_PMC_typenum __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: src/extend.c */
#endif /* PARROT_EXTEND_H_GUARD */
/*
* Local variables:
* c-file-style: "parrot"
* End:
* vim: expandtab shiftwidth=4 cinoptions='\:2=2' :
*/