~ubuntu-branches/ubuntu/intrepid/asn1c/intrepid

« back to all changes in this revision

Viewing changes to libasn1compiler/asn1c_internal.h

  • Committer: Bazaar Package Importer
  • Author(s): W. Borgert
  • Date: 2005-05-28 12:36:42 UTC
  • Revision ID: james.westby@ubuntu.com-20050528123642-3h6kstws5u0xcovl
Tags: upstream-0.9.14
ImportĀ upstreamĀ versionĀ 0.9.14

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _ASN1_COMPILER_INTERNAL_H_
 
2
#define _ASN1_COMPILER_INTERNAL_H_
 
3
 
 
4
#ifdef  HAVE_CONFIG_H
 
5
#include <config.h>
 
6
#endif
 
7
 
 
8
#include <stdio.h>
 
9
#include <stdlib.h>
 
10
#include <string.h>             /* for strlen(3) and memset(3) */
 
11
#include <ctype.h>              /* for isalnum(3) */
 
12
#include <sys/types.h>          /* for fstat(2) */
 
13
#include <stdarg.h>
 
14
#include <errno.h>
 
15
#include <assert.h>
 
16
 
 
17
#ifdef  HAVE_SYS_STAT_H
 
18
#include <sys/stat.h>           /* for fstat(2) */
 
19
#endif
 
20
 
 
21
#ifdef  HAVE_UNISTD_H
 
22
#include <unistd.h>             /* for unlink(2) */
 
23
#endif
 
24
 
 
25
#ifdef  WIN32
 
26
#include <io.h>
 
27
#define open    _open
 
28
#define close   _close
 
29
#define alloca          _alloca
 
30
#define snprintf        _snprintf
 
31
#define vsnprintf       _vsnprintf
 
32
#else
 
33
#include <fcntl.h>              /* for open(2) */
 
34
#include <glob.h>               /* for glob(3) */
 
35
#endif
 
36
 
 
37
#ifdef  HAVE_SYS_PARAM_H
 
38
#include <sys/param.h>  /* For MAXPATHLEN */
 
39
#endif
 
40
 
 
41
#include "asn1compiler.h"
 
42
 
 
43
typedef struct arg_s {
 
44
 
 
45
        enum asn1c_flags flags;
 
46
 
 
47
        void (*logger_cb)(int _severity, const char *fmt, ...);
 
48
 
 
49
        int (*default_cb)(struct arg_s *);
 
50
 
 
51
        struct compiler_streams *target;
 
52
 
 
53
        asn1p_t         *asn;
 
54
        asn1p_module_t  *mod;
 
55
        asn1p_expr_t    *expr;
 
56
 
 
57
        int embed;
 
58
} arg_t;
 
59
 
 
60
/*
 
61
 * Logging.
 
62
 */
 
63
#define LOG(ll, fmt, args...)   do {                    \
 
64
                arg->logger_cb(ll, fmt, ##args);        \
 
65
        } while(0)
 
66
#define DEBUG(fmt, args...)     do {            \
 
67
                if(arg->flags & A1C_DEBUG)      \
 
68
                        LOG(-1, fmt, ##args);   \
 
69
        } while(0)
 
70
#define WARNING(fmt, args...)   LOG(0, fmt, ##args);
 
71
#define FATAL(fmt, args...)     LOG(1, fmt, ##args);
 
72
 
 
73
#endif  /* _ASN1_COMPILER_INTERNAL_H_ */