-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils.h
54 lines (42 loc) · 1.28 KB
/
utils.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
#ifndef UTILS_H
#define UTILS_H
#include "llvm-c/Core.h"
#include "ast.h"
#define MAX_FILENAME_SIZE 120
#define MAX_NUMBER_PORTS 64
#define MAX_PORT_ATTR_SIZE 24
#define PORT_TYPE_AUDIO "AudioPort"
#define PORT_TYPE_CONTROL "ControlPort"
#define PORT_DIRECTION_IN "InputPort"
#define PORT_DIRECTION_OUT "OutputPort"
struct plugin_filenames {
char plugin_name[MAX_FILENAME_SIZE];
char bc_filename[MAX_FILENAME_SIZE];
char ll_filename[MAX_FILENAME_SIZE];
char bundle_dirname[MAX_FILENAME_SIZE];
char manifest_ttlname[MAX_FILENAME_SIZE];
char plugin_ttlname[MAX_FILENAME_SIZE];
char so_filename[MAX_FILENAME_SIZE];
char trace_filename[MAX_FILENAME_SIZE];
};
struct a_port {
char direction[MAX_PORT_ATTR_SIZE];
char data_type[MAX_PORT_ATTR_SIZE];
char symbol[MAX_PORT_ATTR_SIZE];
float def;
float min;
float max;
};
struct port_info {
int num_ports;
struct a_port port[MAX_NUMBER_PORTS];
};
extern struct plugin_filenames names;
extern struct port_info *info;
int get_plugin_name(char *name, char *path);
int build_names(char *path, struct plugin_filenames *names);
void generate_obj_lib(LLVMModuleRef mod, struct plugin_filenames *names);
struct port_info *get_port_info(struct ast *a);
void dump_current_function(LLVMBuilderRef builder);
void trace(char *message);
#endif