implement TeletexString

This commit is contained in:
Love Hornquist Astrand
2009-09-30 00:48:18 -07:00
parent 0b144cdf8d
commit 4d06f484ec
9 changed files with 37 additions and 1 deletions

View File

@@ -220,7 +220,6 @@ gen_files_rfc2459 = \
asn1_SubjectPublicKeyInfo.x \
asn1_TBSCRLCertList.x \
asn1_TBSCertificate.x \
asn1_TeletexStringx.x \
asn1_Time.x \
asn1_UniqueIdentifier.x \
asn1_ValidationParms.x \

View File

@@ -687,6 +687,11 @@ RestrictedCharactedStringType: kw_GeneralString
$$ = new_tag(ASN1_C_UNIV, UT_GeneralString,
TE_EXPLICIT, new_type(TGeneralString));
}
| kw_TeletexString
{
$$ = new_tag(ASN1_C_UNIV, UT_TeletexString,
TE_EXPLICIT, new_type(TTeletexString));
}
| kw_UTF8String
{
$$ = new_tag(ASN1_C_UNIV, UT_UTF8String,

View File

@@ -494,6 +494,9 @@ define_asn1 (int level, Type *t)
case TGeneralString:
fprintf (headerfile, "GeneralString");
break;
case TTeletexString:
fprintf (headerfile, "TeletexString");
break;
case TTag: {
const char *classnames[] = { "UNIVERSAL ", "APPLICATION ",
"" /* CONTEXT */, "PRIVATE " };
@@ -685,6 +688,10 @@ define_type (int level, const char *name, Type *t, int typedefp, int preservep)
space(level);
fprintf (headerfile, "heim_general_string %s;\n", name);
break;
case TTeletexString:
space(level);
fprintf (headerfile, "heim_general_string %s;\n", name);
break;
case TTag:
define_type (level, name, t->subtype, typedefp, preservep);
break;

View File

@@ -184,6 +184,9 @@ copy_type (const char *from, const char *to, const Type *t, int preserve)
case TGeneralString:
copy_primitive ("general_string", from, to);
break;
case TTeletexString:
copy_primitive ("general_string", from, to);
break;
case TUTCTime:
fprintf(codefile, "*(%s) = *(%s);\n", to, from);
break;

View File

@@ -67,6 +67,7 @@ is_primitive_type(int type)
case TEnumerated:
case TGeneralizedTime:
case TGeneralString:
case TTeletexString:
case TOID:
case TUTCTime:
case TUTF8String:
@@ -109,6 +110,11 @@ find_tag (const Type *t,
*ty = PRIM;
*tag = UT_GeneralString;
break;
case TTeletexString:
*cl = ASN1_C_UNIV;
*ty = PRIM;
*tag = UT_TeletexString;
break;
case TGeneralizedTime:
*cl = ASN1_C_UNIV;
*ty = PRIM;
@@ -489,6 +495,9 @@ decode_type (const char *name, const Type *t, int optional,
case TGeneralString:
decode_primitive ("general_string", name, forwstr);
break;
case TTeletexString:
decode_primitive ("general_string", name, forwstr);
break;
case TTag:{
char *tname, *typestring;
char *ide = NULL;
@@ -703,6 +712,7 @@ generate_type_decode (const Symbol *s)
case TOID:
case TGeneralizedTime:
case TGeneralString:
case TTeletexString:
case TUTF8String:
case TPrintableString:
case TIA5String:

View File

@@ -383,6 +383,10 @@ encode_type (const char *name, const Type *t, const char *tmpstr)
encode_primitive ("general_string", name);
constructed = 0;
break;
case TTeletexString:
encode_primitive ("general_string", name);
constructed = 0;
break;
case TTag: {
char *tname;
int c;
@@ -521,6 +525,7 @@ generate_type_encode (const Symbol *s)
case TOctetString:
case TGeneralizedTime:
case TGeneralString:
case TTeletexString:
case TUTCTime:
case TUTF8String:
case TPrintableString:

View File

@@ -145,6 +145,9 @@ free_type (const char *name, const Type *t, int preserve)
case TGeneralString:
free_primitive ("general_string", name);
break;
case TTeletexString:
free_primitive ("general_string", name);
break;
case TUTF8String:
free_primitive ("utf8string", name);
break;

View File

@@ -219,6 +219,9 @@ length_type (const char *name, const Type *t,
case TGeneralString:
length_primitive ("general_string", name, variable);
break;
case TTeletexString:
length_primitive ("general_string", name, variable);
break;
case TUTCTime:
length_primitive ("utctime", name, variable);
break;

View File

@@ -44,6 +44,7 @@ enum typetype {
TChoice,
TEnumerated,
TGeneralString,
TTeletexString,
TGeneralizedTime,
TIA5String,
TInteger,