aboutsummaryrefslogtreecommitdiffstats
path: root/libasn1parser/asn1p_module.h
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2004-06-03 03:38:44 +0000
committerLev Walkin <vlm@lionet.info>2004-06-03 03:38:44 +0000
commitf15320bf6b50a0c02636405561ac8323ae901abd (patch)
tree33461d45122896c6dde35f82f5c7d19b62004a6b /libasn1parser/asn1p_module.h
parent746cb60bbccf47019563665f4aec4b6c462c4163 (diff)
Initial revision
Diffstat (limited to 'libasn1parser/asn1p_module.h')
-rw-r--r--libasn1parser/asn1p_module.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/libasn1parser/asn1p_module.h b/libasn1parser/asn1p_module.h
new file mode 100644
index 00000000..906c784a
--- /dev/null
+++ b/libasn1parser/asn1p_module.h
@@ -0,0 +1,88 @@
+/*
+ * A Module definition structure used by the ASN.1 parser.
+ */
+#ifndef ASN1_PARSER_MODULE_H
+#define ASN1_PARSER_MODULE_H
+
+/*
+ * Flags specific to a module.
+ */
+typedef enum asn1p_module_flags {
+ MSF_NOFLAGS,
+ MSF_EXPLICIT_TAGS = 0x1,
+ MSF_IMPLICIT_TAGS = 0x2,
+ MSF_AUTOMATIC_TAGS = 0x4,
+ MSF_EXTENSIBILITY_IMPLIED = 0x8,
+} asn1p_module_flags_e;
+
+/*
+ * === EXAMPLE ===
+ * MySyntax DEFINITIONS AUTOMATIC TAGS ::=
+ * BEGIN
+ * ...
+ * END
+ * === EOF ===
+ */
+typedef struct asn1p_module_s {
+
+ /*
+ * Name of the source file.
+ */
+ char *source_file_name;
+
+ /*
+ * Human-readable module identifier.
+ */
+ char *Identifier; /* Module name */
+
+ /*
+ * Unique module identifier, OID.
+ */
+ asn1p_oid_t *module_oid; /* Optional OID of the module */
+
+ /*
+ * Module flags.
+ */
+ asn1p_module_flags_e module_flags; /* AUTOMATIC TAGS? */
+
+ /*
+ * List of everything that this module IMPORTS.
+ */
+ TQ_HEAD(struct asn1p_xports_s) imports;
+
+ /*
+ * List of everything that this module EXPORTS.
+ */
+ TQ_HEAD(struct asn1p_xports_s) exports;
+
+ /*
+ * List of everything that this module defines itself.
+ */
+ TQ_HEAD(struct asn1p_expr_s) members;
+
+ /*
+ * Next module in the list.
+ */
+ TQ_ENTRY(struct asn1p_module_s)
+ mod_next;
+
+} asn1p_module_t;
+
+/*
+ * Constructor and destructor.
+ */
+asn1p_module_t *asn1p_module_new(void);
+void asn1p_module_free(asn1p_module_t *mod);
+
+/*
+ * No more than a container for several modules.
+ */
+typedef struct asn1p_s {
+ TQ_HEAD(struct asn1p_module_s) modules;
+} asn1p_t;
+
+asn1p_t *asn1p_new(void);
+void asn1p_free(asn1p_t *asn);
+
+
+#endif /* ASN1_PARSER_MODULE_H */