mirror of https://gerrit.osmocom.org/asn1c
restructured member variable names
This commit is contained in:
parent
2c14a696f3
commit
b36317c2a8
|
@ -208,7 +208,7 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps) {
|
|||
" * From ASN.1 module \"%s\"\n"
|
||||
" * \tfound in \"%s\"\n"
|
||||
" */\n\n",
|
||||
arg->mod->Identifier,
|
||||
arg->mod->ModuleName,
|
||||
arg->mod->source_file_name
|
||||
);
|
||||
fprintf(fp_h,
|
||||
|
@ -217,7 +217,7 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps) {
|
|||
" * From ASN.1 module \"%s\"\n"
|
||||
" * \tfound in \"%s\"\n"
|
||||
" */\n\n",
|
||||
arg->mod->Identifier,
|
||||
arg->mod->ModuleName,
|
||||
arg->mod->source_file_name
|
||||
);
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ asn1f_fix_module__phase_1(arg_t *arg) {
|
|||
TQ_FOR(omod, &arg->asn->modules, mod_next) {
|
||||
int sameNames;
|
||||
if(omod == arg->mod) break;
|
||||
sameNames = strcmp(omod->Identifier, arg->mod->Identifier)?0:1;
|
||||
sameNames = strcmp(omod->ModuleName, arg->mod->ModuleName)?0:1;
|
||||
if(omod->module_oid && arg->mod->module_oid) {
|
||||
/* Compare only the OID. */
|
||||
if(asn1p_oid_compare(omod->module_oid,
|
||||
|
@ -126,18 +126,18 @@ asn1f_fix_module__phase_1(arg_t *arg) {
|
|||
FATAL("ASN.1 module %s in %s "
|
||||
"has the same OBJECT IDENTIFIER"
|
||||
" as module %s",
|
||||
omod->Identifier,
|
||||
omod->ModuleName,
|
||||
omod->source_file_name,
|
||||
arg->mod->Identifier
|
||||
arg->mod->ModuleName
|
||||
);
|
||||
RET2RVAL(-1, rvalue);
|
||||
} else if(sameNames) {
|
||||
WARNING("ASN.1 module %s is defined more than once, with different OIDs", omod->Identifier);
|
||||
WARNING("ASN.1 module %s is defined more than once, with different OIDs", omod->ModuleName);
|
||||
RET2RVAL(1, rvalue);
|
||||
}
|
||||
} else if(sameNames) {
|
||||
FATAL("ASN.1 module %s is defined more than once",
|
||||
omod->Identifier);
|
||||
omod->ModuleName);
|
||||
RET2RVAL(-1, rvalue);
|
||||
}
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ asn1f_fix_module__phase_1(arg_t *arg) {
|
|||
break;
|
||||
default:
|
||||
FATAL("Module %s defined with ambiguous global tagging mode",
|
||||
arg->mod->Identifier);
|
||||
arg->mod->ModuleName);
|
||||
RET2RVAL(-1, rvalue);
|
||||
}
|
||||
|
||||
|
@ -162,7 +162,7 @@ asn1f_fix_module__phase_1(arg_t *arg) {
|
|||
break;
|
||||
case MSF_unk_INSTRUCTIONS:
|
||||
WARNING("Module %s defined with unrecognized "
|
||||
"encoding reference", arg->mod->Identifier);
|
||||
"encoding reference", arg->mod->ModuleName);
|
||||
RET2RVAL(1, rvalue);
|
||||
/* Fall through */
|
||||
case MSF_TAG_INSTRUCTIONS:
|
||||
|
@ -170,7 +170,7 @@ asn1f_fix_module__phase_1(arg_t *arg) {
|
|||
break;
|
||||
default:
|
||||
FATAL("Module %s defined with ambiguous encoding reference",
|
||||
arg->mod->Identifier);
|
||||
arg->mod->ModuleName);
|
||||
RET2RVAL(-1, rvalue);
|
||||
}
|
||||
|
||||
|
@ -452,10 +452,10 @@ asn1f_check_duplicate(arg_t *arg) {
|
|||
"Please rename either instance to resolve the conflict",
|
||||
arg->expr->Identifier,
|
||||
arg->expr->_lineno,
|
||||
arg->mod->Identifier,
|
||||
arg->mod->ModuleName,
|
||||
tmparg.expr->Identifier,
|
||||
tmparg.expr->_lineno,
|
||||
tmparg.mod->Identifier,
|
||||
tmparg.mod->ModuleName,
|
||||
diff_files ? " (" : "",
|
||||
diff_files ? tmparg.mod->source_file_name : "",
|
||||
diff_files ? ")" : ""
|
||||
|
|
|
@ -446,7 +446,7 @@ _asn1f_compare_tags(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b) {
|
|||
"improper use of "
|
||||
"EXTENSIBILITY IMPLIED flag "
|
||||
"of module %s",
|
||||
arg->mod->Identifier);
|
||||
arg->mod->ModuleName);
|
||||
}
|
||||
return -1;
|
||||
} else {
|
||||
|
|
|
@ -51,7 +51,7 @@ asn1f_lookup_in_imports(arg_t *arg, asn1p_module_t *mod, const char *name) {
|
|||
* Okay, right now we have a module name and, hopefully, an OID.
|
||||
* Search the arg->asn for the specified module.
|
||||
*/
|
||||
mod = asn1f_lookup_module(arg, xp->from, xp->from_oid);
|
||||
mod = asn1f_lookup_module(arg, xp->fromModuleName, xp->identifier.oid);
|
||||
if(mod == NULL) {
|
||||
/* Conditional debug */
|
||||
if(!(arg->expr->_mark & TM_BROKEN)) {
|
||||
|
@ -59,7 +59,7 @@ asn1f_lookup_in_imports(arg_t *arg, asn1p_module_t *mod, const char *name) {
|
|||
FATAL("Cannot find external module \"%s\" "
|
||||
"mentioned for "
|
||||
"\"%s\" at line %d",
|
||||
xp->from, name, arg->expr->_lineno);
|
||||
xp->fromModuleName, name, arg->expr->_lineno);
|
||||
}
|
||||
/* ENOENT/ETOOMANYREFS */
|
||||
return NULL;
|
||||
|
@ -97,7 +97,7 @@ asn1f_lookup_module(arg_t *arg, const char *module_name, asn1p_oid_t *oid) {
|
|||
* somewhere in the IMPORTS section AND OID is given.
|
||||
*/
|
||||
TQ_FOR(xp, &(arg->mod->imports), xp_next) {
|
||||
if(strcmp(module_name, xp->from))
|
||||
if(strcmp(module_name, xp->fromModuleName))
|
||||
continue;
|
||||
if(oid) {
|
||||
FATAL("Ambiguous reference: "
|
||||
|
@ -111,7 +111,7 @@ asn1f_lookup_module(arg_t *arg, const char *module_name, asn1p_oid_t *oid) {
|
|||
* Yes, there is a renaming.
|
||||
* Make lookup use OID instead.
|
||||
*/
|
||||
oid = xp->from_oid;
|
||||
oid = xp->identifier.oid;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -134,7 +134,7 @@ asn1f_lookup_module(arg_t *arg, const char *module_name, asn1p_oid_t *oid) {
|
|||
}
|
||||
}
|
||||
|
||||
if(strcmp(module_name, mod->Identifier) == 0)
|
||||
if(strcmp(module_name, mod->ModuleName) == 0)
|
||||
return mod;
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ asn1f_lookup_symbol(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
|
|||
|
||||
DEBUG("(%s) in %s for line %d",
|
||||
asn1f_printable_reference(ref),
|
||||
mod->Identifier,
|
||||
mod->ModuleName,
|
||||
ref->_lineno);
|
||||
|
||||
if(ref->comp_count == 1) {
|
||||
|
@ -251,16 +251,16 @@ asn1f_lookup_symbol(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
|
|||
if(modulename) {
|
||||
FATAL("Module %s referred by %s in module %s "
|
||||
"does not contain the requested symbol",
|
||||
imports_from->Identifier,
|
||||
imports_from->ModuleName,
|
||||
asn1f_printable_reference(ref),
|
||||
mod->Identifier);
|
||||
mod->ModuleName);
|
||||
} else {
|
||||
FATAL("Module %s referred in IMPORTS section "
|
||||
"for %s of module %s does not contain "
|
||||
"the requested symbol",
|
||||
imports_from->Identifier,
|
||||
imports_from->ModuleName,
|
||||
asn1f_printable_reference(ref),
|
||||
mod->Identifier);
|
||||
mod->ModuleName);
|
||||
}
|
||||
}
|
||||
return expr;
|
||||
|
@ -277,7 +277,7 @@ asn1f_lookup_symbol(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
|
|||
if(ref_tc == NULL) {
|
||||
DEBUG("Module \"%s\" does not contain \"%s\" "
|
||||
"mentioned at line %d: %s",
|
||||
mod->Identifier,
|
||||
mod->ModuleName,
|
||||
identifier,
|
||||
ref->_lineno,
|
||||
strerror(errno)
|
||||
|
@ -406,7 +406,7 @@ asn1f_compatible_with_exports(arg_t *arg, asn1p_module_t *mod, const char *name)
|
|||
arg->expr->_mark |= TM_BROKEN;
|
||||
FATAL("EXPORTS section of module %s in %s "
|
||||
"does not mention %s at line %d",
|
||||
mod->Identifier, mod->source_file_name, name,
|
||||
mod->ModuleName, mod->source_file_name, name,
|
||||
arg->expr->_lineno);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,8 +27,8 @@ asn1p_module_free(asn1p_module_t *mod) {
|
|||
if(mod) {
|
||||
asn1p_expr_t *expr;
|
||||
|
||||
if(mod->Identifier)
|
||||
free(mod->Identifier);
|
||||
if(mod->ModuleName)
|
||||
free(mod->ModuleName);
|
||||
|
||||
if(mod->module_oid)
|
||||
asn1p_oid_free(mod->module_oid);
|
||||
|
|
|
@ -36,9 +36,9 @@ typedef struct asn1p_module_s {
|
|||
char *source_file_name;
|
||||
|
||||
/*
|
||||
* Human-readable module identifier.
|
||||
* Human-readable module reference.
|
||||
*/
|
||||
char *Identifier; /* Module name */
|
||||
char *ModuleName;
|
||||
|
||||
/*
|
||||
* Unique module identifier, OID.
|
||||
|
|
|
@ -25,10 +25,10 @@ asn1p_xports_new() {
|
|||
void
|
||||
asn1p_xports_free(asn1p_xports_t *xp) {
|
||||
if(xp) {
|
||||
if(xp->from)
|
||||
free(xp->from);
|
||||
if(xp->from_oid)
|
||||
asn1p_oid_free(xp->from_oid);
|
||||
if(xp->fromModuleName)
|
||||
free(xp->fromModuleName);
|
||||
if(xp->identifier.oid)
|
||||
asn1p_oid_free(xp->identifier.oid);
|
||||
free(xp);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,8 +17,11 @@ typedef struct asn1p_xports_s {
|
|||
/*
|
||||
* Module name and optional OID, occur after FROM.
|
||||
*/
|
||||
char *from; /* Name of the module */
|
||||
asn1p_oid_t *from_oid; /* Optional OID of the module */
|
||||
char *fromModuleName; /* Name of the module */
|
||||
struct AssignedIdentifier {
|
||||
asn1p_oid_t *oid; /* Optional OID of the module */
|
||||
asn1p_value_t *value; /* DefinedValue */
|
||||
} identifier;
|
||||
|
||||
/*
|
||||
* Number of entities to import.
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -7,6 +7,7 @@ typedef union {
|
|||
asn1p_constraint_t *a_constr; /* Constraint */
|
||||
enum asn1p_constraint_type_e a_ctype;/* Constraint type */
|
||||
asn1p_xports_t *a_xports; /* IMports/EXports */
|
||||
struct AssignedIdentifier a_aid; /* Assigned Identifier */
|
||||
asn1p_oid_t *a_oid; /* Object Identifier */
|
||||
asn1p_oid_arc_t a_oid_arc; /* Single OID's arc */
|
||||
struct asn1p_type_tag_s a_tag; /* A tag */
|
||||
|
|
|
@ -65,9 +65,9 @@ asn1print_module(asn1p_t *asn, asn1p_module_t *mod, enum asn1print_flags flags)
|
|||
if(flags & APF_PRINT_XML_DTD)
|
||||
printf("<!-- ASN.1 module\n");
|
||||
|
||||
printf("%s ", mod->Identifier);
|
||||
printf("%s ", mod->ModuleName);
|
||||
if(mod->module_oid) {
|
||||
asn1print_oid(strlen(mod->Identifier), mod->module_oid, flags);
|
||||
asn1print_oid(strlen(mod->ModuleName), mod->module_oid, flags);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue