vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1 | #ifndef _ASN1_COMPILER_INTERNAL_H_ |
| 2 | #define _ASN1_COMPILER_INTERNAL_H_ |
| 3 | |
vlm | 1f1d8cb | 2004-08-13 16:58:19 +0000 | [diff] [blame] | 4 | #ifdef HAVE_CONFIG_H |
| 5 | #include <config.h> |
| 6 | #endif |
| 7 | |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 8 | #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) */ |
vlm | 1d03669 | 2004-08-19 13:29:46 +0000 | [diff] [blame] | 14 | #include <string.h> /* for strlen(3) and memset(3) */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 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 | |
| 22 | typedef 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 | |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 46 | /* |
| 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_ */ |