Imported Upstream version 0.4.8
[platform/upstream/libsmi.git] / tools / smidump.h
1 /*
2  * smidump.h --
3  *
4  *      This header contains the entry points into the modules
5  *      which dump MIB modules in various output format.
6  *
7  * Copyright (c) 1999 Frank Strauss, Technical University of Braunschweig.
8  * Copyright (c) 1999 J. Schoenwaelder, Technical University of Braunschweig.
9  *
10  * See the file "COPYING" for information on usage and redistribution
11  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
12  *
13  * @(#) $Id: smidump.h 7870 2008-03-11 19:29:58Z schoenw $
14  */
15
16 #ifndef _SMIDUMP_H
17 #define _SMIDUMP_H
18
19 #include "shhopt.h"
20
21
22
23 /*
24  * The following flags can be passed to output drivers in the flags
25  * member of the struct above.
26  */
27
28 #define SMIDUMP_FLAG_SILENT     0x01    /* suppress comments */
29 #define SMIDUMP_FLAG_UNITE      0x02    /* generated united output */
30 #define SMIDUMP_FLAG_ERROR      0x04    /* parser hit serious parse errors */
31
32
33 /*
34  * Driver capability flags which are used to warn about options not
35  * understood by a particular output driver.
36  */
37
38 #define SMIDUMP_DRIVER_CANT_UNITE       0x02
39 #define SMIDUMP_DRIVER_CANT_OUTPUT      0x04
40
41
42
43 /*
44  * The data structure which represents a driver specific option.
45  * A static array of these options (with the last option's type
46  * being OPT_END) is used in SmidumpDriver.
47  * The SmidumpDriverOption structure is based on shhopt.h:optStruct.
48  */
49
50 typedef struct SmidumpDriverOption {
51     char *name;
52     optArgType type;
53     void *arg;
54     int flags;
55     char *descr;
56 } SmidumpDriverOption;
57
58
59
60 /*
61  * The data structure which represents the entry point for an output
62  * driver. The ignflags contain the driver capabilities as described
63  * above.
64  */
65
66 typedef struct SmidumpDriver {
67     char *name;                         /* Name of the output driver. */
68     void (*func) (int, SmiModule **,    /* Output generating function. */
69                   int, char *);
70     int smiflags;                       /* Flags for the SMI parser. */
71     int ignflags;                       /* Output driver flags ignored. */
72     char *descr;                        /* Short description. */
73     SmidumpDriverOption *opt;           /* Driver specific options. */
74     struct SmidumpDriver *next;
75 } SmidumpDriver;
76
77
78
79 /*
80  * The entry points for the output drivers that currently exist for
81  * smidump.
82  */
83
84 extern void initSmi(void);
85 extern void initSming(void);
86 extern void initSppi(void);
87 extern void initSvg(void);
88 extern void initImports(void);
89 extern void initTypes(void);
90 extern void initTree(void);
91 extern void initIdentifiers(void);
92 extern void initMetrics(void);
93 extern void initMosy(void);
94 extern void initXml(void);
95 extern void initCorba(void);
96 extern void initCm(void);
97 extern void initNetsnmp(void);
98 extern void initJax(void);
99 extern void initPython(void);
100 extern void initPerl(void);
101 extern void initScli(void);
102 extern void initXsd(void);
103 extern void initSizes(void);
104 extern void initCompliances(void);
105 extern void initYang(void);
106 extern void initBoilerplate(void);
107
108 extern void initSql(void);
109 extern void initFig(void);
110
111
112 /*
113  * The functions are wrappers for the malloc functions which handle
114  * memory allocation errors by terminating the program.
115  */
116
117 extern void *xmalloc(size_t size);
118 extern void *xrealloc(void *ptr, size_t size);
119 extern void *xcalloc(size_t nmemb, size_t size);
120 extern char *xstrdup(const char *s);
121 extern void xfree(void *ptr);
122
123 extern void smidumpRegisterDriver(SmidumpDriver *driver);
124
125 #endif /* _SMIDUMP_H */