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