1 #include "asn1fix_internal.h"
2 #include "asn1fix_export.h"
4 extern arg_t a1f_replace_me_with_proper_interface_arg;
6 static asn1p_t *asn1f_ssn_asn_;
9 _add_standard_namespaces(asn1_namespace_t *ns) {
10 asn1p_oid_t *uioc_oid;
11 asn1p_oid_arc_t arcs[] = {{1, "iso"}, {3, "org"},
12 {6, "dod"}, {1, "internet"},
13 {4, "private"}, {1, "enterprise"},
14 {9363, "spelio"}, {1, "software"},
15 {5, "asn1c"}, {3, "standard-modules"},
16 {0, "auto-imported"}, {1, 0}};
18 uioc_oid = asn1p_oid_construct(arcs, sizeof(arcs) / sizeof(arcs[0]));
20 asn1p_module_t *module = asn1f_lookup_module_ex(
21 asn1f_ssn_asn_, "ASN1C-UsefulInformationObjectClasses", uioc_oid);
22 asn1p_oid_free(uioc_oid);
25 asn1_namespace_add_module(ns, module, 0);
30 asn1f_use_standard_namespaces(asn1p_t *asn) {
32 asn1_namespace_add_standard_namespaces_callback(_add_standard_namespaces);
36 asn1f_lookup_module_ex(asn1p_t *asn, const char *module_name,
37 const asn1p_oid_t *oid) {
40 memset(&arg, 0, sizeof(arg));
43 arg.eh = a1f_replace_me_with_proper_interface_arg.eh;
44 arg.debug = a1f_replace_me_with_proper_interface_arg.debug;
45 return asn1f_lookup_module(&arg, module_name, oid);
49 asn1f_lookup_symbol_ex(asn1p_t *asn, asn1_namespace_t *ns, asn1p_expr_t *expr,
50 const asn1p_ref_t *ref) {
53 memset(&arg, 0, sizeof(arg));
57 arg.mod = expr->module;
59 arg.eh = a1f_replace_me_with_proper_interface_arg.eh;
60 arg.debug = a1f_replace_me_with_proper_interface_arg.debug;
62 return asn1f_lookup_symbol(&arg, expr->rhs_pspecs, ref);
66 asn1f_class_access_ex(asn1p_t *asn,
70 asn1p_expr_t *rhs_pspecs,
71 const asn1p_ref_t *ref) {
74 memset(&arg, 0, sizeof(arg));
80 arg.eh = a1f_replace_me_with_proper_interface_arg.eh;
81 arg.debug = a1f_replace_me_with_proper_interface_arg.debug;
83 return asn1f_class_access(&arg, rhs_pspecs, ref);
87 asn1f_find_terminal_type_ex(asn1p_t *asn, asn1_namespace_t *ns,
91 memset(&arg, 0, sizeof(arg));
95 arg.mod = expr->module;
97 arg.eh = a1f_replace_me_with_proper_interface_arg.eh;
98 arg.debug = a1f_replace_me_with_proper_interface_arg.debug;
100 return asn1f_find_terminal_type(&arg, expr);
104 asn1f_find_ancestor_type_with_PER_constraint_ex(asn1p_t *asn, asn1p_expr_t *expr) {
107 memset(&arg, 0, sizeof(arg));
110 arg.mod = expr->module;
112 arg.eh = a1f_replace_me_with_proper_interface_arg.eh;
113 arg.debug = a1f_replace_me_with_proper_interface_arg.debug;
115 return asn1f_find_ancestor_type_with_PER_constraint(&arg, expr);
119 asn1f_fix_dereference_values_ex(asn1p_t *asn, asn1p_module_t *mod,
120 asn1p_expr_t *expr) {
123 memset(&arg, 0, sizeof(arg));
128 arg.eh = a1f_replace_me_with_proper_interface_arg.eh;
129 arg.debug = a1f_replace_me_with_proper_interface_arg.debug;
131 return asn1f_fix_dereference_values(&arg);