blob: 6192650c072718cb1ccc28239bd6e77ade2d9f32 [file] [log] [blame]
Lev Walkinf15320b2004-06-03 03:38:44 +00001#ifndef _ASN1_COMPILER_INTERNAL_H_
2#define _ASN1_COMPILER_INTERNAL_H_
3
4#include <stdio.h>
5#include <stdlib.h>
6#include <sys/stat.h> /* for fstat(2) */
7#include <unistd.h> /* for unlink(2) */
8#include <fcntl.h> /* for open(2) */
9#include <glob.h> /* for glob(3) */
10#include <libgen.h> /* for basename(3) */
11#include <string.h>
12#include <ctype.h> /* for isalnum(3) */
13#include <stdarg.h>
14#include <errno.h>
15#include <assert.h>
16
17#include "asn1compiler.h"
18
19typedef struct arg_s {
20
21 enum asn1c_flags flags;
22
23 void (*logger_cb)(int _severity, const char *fmt, ...);
24
25 int (*default_cb)(struct arg_s *);
26
27 struct compiler_streams *target;
28
29 asn1p_t *asn;
30 asn1p_module_t *mod;
31 asn1p_expr_t *expr;
32
33 int indent_level;
34 int indented;
35 int embed;
36} arg_t;
37
38#include "asn1c_lang.h" /* Target language initialization */
39#include "asn1c_misc.h" /* Miscellaneous functions */
40#include "asn1c_out.h" /* Handle output during compilation */
41#include "asn1c_save.h" /* Save compiled output */
42
Lev Walkinf15320b2004-06-03 03:38:44 +000043/*
44 * Logging.
45 */
46#define LOG(ll, fmt, args...) do { \
47 arg->logger_cb(ll, fmt, ##args); \
48 } while(0)
49#define DEBUG(fmt, args...) do { \
50 if(arg->flags & A1C_DEBUG) \
51 LOG(-1, fmt, ##args); \
52 } while(0)
53#define WARNING(fmt, args...) LOG(0, fmt, ##args);
54#define FATAL(fmt, args...) LOG(1, fmt, ##args);
55
56#endif /* _ASN1_COMPILER_INTERNAL_H_ */