Zen-C
Loading...
Searching...
No Matches
zprep_plugin.h
Go to the documentation of this file.
1
2#ifndef ZPREP_PLUGIN_H
3#define ZPREP_PLUGIN_H
4
5#include <stddef.h>
6#include <stdio.h>
7
13typedef struct
14{
15 // Context Information (Where are we?).
16 const char *filename;
18 FILE *out;
19 FILE *hoist_out;
20} ZApi;
21
30typedef void (*ZPluginTranspileFn)(const char *input_body, const ZApi *api);
31
35typedef struct
36{
37 char name[32];
39} ZPlugin;
40
46typedef ZPlugin *(*ZPluginInitFn)(void);
47
48#endif
const char *const name
Definition cJSON.h:307
Host API provided to plugins.
Definition zprep_plugin.h:14
const char * filename
Current file name being processed.
Definition zprep_plugin.h:16
FILE * out
Inline output stream (replaces the macro call).
Definition zprep_plugin.h:18
FILE * hoist_out
Hoisted output stream (writes to file scope/header).
Definition zprep_plugin.h:19
int current_line
Current line number.
Definition zprep_plugin.h:17
Plugin definition structure.
Definition zprep_plugin.h:36
ZPluginTranspileFn fn
Pointer to the transpilation function.
Definition zprep_plugin.h:38
void(* ZPluginTranspileFn)(const char *input_body, const ZApi *api)
The Plugin Function Signature.
Definition zprep_plugin.h:30