* used extensively by asn1.yacc * (was a macro) */ void SetupType PARAMS ((t, typeId, lineNum), Type **t _AND_ enum BasicTypeChoiceId typeId _AND_ unsigned long lineNum) { Tag **tmpPtr; (*t) = (Type*)Malloc (sizeof (Type)); (*t)->lineNo = lineNum; (*t)->basicType = (BasicType*)Malloc (sizeof (BasicType)); (*t)->basicType->choiceId = typeId; (*t)->tags = (TagList*)AsnListNew (sizeof (void*)); if (LIBTYPE_GET_UNIV_TAG_CODE ((typeId)) != NO_TAG_CODE) { tmpPtr = (Tag**)AsnListAppend ((AsnList*)(*t)->tags); *tmpPtr = (Tag*)Malloc (sizeof (Tag)); (*tmpPtr)->tclass = UNIV; (*tmpPtr)->code = LIBTYPE_GET_UNIV_TAG_CODE ((typeId)); } } /* SetupType */ /* * Allocates and initializes a type and it's basicType to MACROTYPE * and sets the MACROTYPE type to the given macrotype */ void
/* * returns 0 if no parse errors occurred * otherwise returns non-zero */ int ParseValues PARAMS ((mods, m), ModuleList *mods _AND_ Module *m) { ValueDef *v; Value *pv; newValsG = AsnListNew (sizeof (void*)); FOR_EACH_LIST_ELMT (v, m->valueDefs) { if (v->value->basicValue->choiceId == BASICVALUE_VALUENOTATION) { valLineNoG = v->value->lineNo; pv = ParseValue (mods, m, v, v->value->type, v->value->basicValue->a.valueNotation->octs, v->value->basicValue->a.valueNotation->octetLen); /* replace value notation value with parsed version */ if (pv != NULL) { pv->lineNo = v->value->lineNo; pv->type = v->value->type; Free (v->value->basicValue->a.valueNotation->octs); Free (v->value->basicValue->a.valueNotation);