[Redbutton-devel] SF.net SVN: redbutton: [441] redbutton-author/trunk
Brought to you by:
skilvington
|
From: <ski...@us...> - 2007-10-16 13:01:42
|
Revision: 441
http://redbutton.svn.sourceforge.net/redbutton/?rev=441&view=rev
Author: skilvington
Date: 2007-10-16 06:01:37 -0700 (Tue, 16 Oct 2007)
Log Message:
-----------
propogate the current tag to ENUMERATED types
Modified Paths:
--------------
redbutton-author/trunk/asn1tag.h
redbutton-author/trunk/ccc.y
Modified: redbutton-author/trunk/asn1tag.h
===================================================================
--- redbutton-author/trunk/asn1tag.h 2007-10-16 11:27:20 UTC (rev 440)
+++ redbutton-author/trunk/asn1tag.h 2007-10-16 13:01:37 UTC (rev 441)
@@ -753,5 +753,34 @@
/* ContentReference is [69] except in ReferencedContent */
#define ASN1TAGCLASS_ContentReference ASN1TAG_SYNTHETIC
+/* needed by mhegd */
+#define FIXME 9999
+#define ASN1TAGCLASS_ActionSlot FIXME
+#define ASN1TAGCLASS_ActionSlotSeq FIXME
+#define ASN1TAGCLASS_ButtonStyleEnum ASN1TAGCLASS_ENUMERATED
+#define ASN1TAGCLASS_Colour FIXME
+#define ASN1TAGCLASS_ContentBody FIXME
+#define ASN1TAGCLASS_DefaultAttribute FIXME
+#define ASN1TAGCLASS_ElementaryAction FIXME
+#define ASN1TAGCLASS_EventDataBody FIXME
+#define ASN1TAGCLASS_EventTypeEnum ASN1TAGCLASS_ENUMERATED
+#define ASN1TAGCLASS_FontBody FIXME
+#define ASN1TAGCLASS_GenericBoolean FIXME
+#define ASN1TAGCLASS_GenericContentReference FIXME
+#define ASN1TAGCLASS_GenericInteger FIXME
+#define ASN1TAGCLASS_GenericObjectReference FIXME
+#define ASN1TAGCLASS_GenericOctetString FIXME
+#define ASN1TAGCLASS_GroupItem FIXME
+#define ASN1TAGCLASS_InputTypeEnum ASN1TAGCLASS_ENUMERATED
+#define ASN1TAGCLASS_JustificationEnum ASN1TAGCLASS_ENUMERATED
+#define ASN1TAGCLASS_LineOrientationEnum ASN1TAGCLASS_ENUMERATED
+#define ASN1TAGCLASS_OrientationEnum ASN1TAGCLASS_ENUMERATED
+#define ASN1TAGCLASS_OriginalValueBody FIXME
+#define ASN1TAGCLASS_Parameter FIXME
+#define ASN1TAGCLASS_SliderStyleEnum ASN1TAGCLASS_ENUMERATED
+#define ASN1TAGCLASS_StartCornerEnum ASN1TAGCLASS_ENUMERATED
+#define ASN1TAGCLASS_StorageEnum ASN1TAGCLASS_ENUMERATED
+#define ASN1TAGCLASS_StreamComponent FIXME
+#define ASN1TAGCLASS_TerminationEnum ASN1TAGCLASS_ENUMERATED
+
#endif /* __ASN1TAG_H__ */
-
Modified: redbutton-author/trunk/ccc.y
===================================================================
--- redbutton-author/trunk/ccc.y 2007-10-16 11:27:20 UTC (rev 440)
+++ redbutton-author/trunk/ccc.y 2007-10-16 13:01:37 UTC (rev 441)
@@ -819,11 +819,22 @@
for(item=state.items; item && item->type==IT_LITERAL; item=item->next)
buf_append(&state.decode_fns, "\tfprintf(out, \"%%s \", %s);\n\n", item->name);
/* decode the item */
+ buf_append(&state.decode_fns, "\tlong pretag = ftell(der);\n");
buf_append(&state.decode_fns, "\tif((sublen = der_decode_Tag(der, &tag)) < 0)\n");
buf_append(&state.decode_fns, "\t\treturn der_error(\"%s\");\n", name);
buf_append(&state.decode_fns, "\tleft -= sublen;\n\n");
buf_append(&state.decode_fns, "\tif(is_%s(tag.class, tag.number))\n\t{\n", item->name);
- buf_append(&state.decode_fns, "\t\tasn1decode_%s(der, out, tag.length);\n", item->name);
+ /* if it is a synthetic or ENUMERATED type, we still need the current tag */
+ buf_append(&state.decode_fns, "\t\tif(ASN1TAGCLASS_%s == ASN1TAG_SYNTHETIC\n", item->name);
+ buf_append(&state.decode_fns, "\t\t|| ASN1TAGCLASS_%s == ASN1TAGCLASS_ENUMERATED)\n", item->name);
+ buf_append(&state.decode_fns, "\t\t{\n");
+ buf_append(&state.decode_fns, "\t\t\tfseek(der, pretag, SEEK_SET);\n");
+ buf_append(&state.decode_fns, "\t\t\tasn1decode_%s(der, out, sublen + tag.length);\n", item->name);
+ buf_append(&state.decode_fns, "\t\t}\n");
+ buf_append(&state.decode_fns, "\t\telse\n");
+ buf_append(&state.decode_fns, "\t\t{\n");
+ buf_append(&state.decode_fns, "\t\t\tasn1decode_%s(der, out, tag.length);\n", item->name);
+ buf_append(&state.decode_fns, "\t\t}\n");
buf_append(&state.decode_fns, "\t\tleft -= tag.length;\n");
buf_append(&state.decode_fns, "\t}\n\telse\n");
buf_append(&state.decode_fns, "\t{\n\t\treturn der_error(\"%s\");\n\t}\n\n", name);
@@ -892,8 +903,9 @@
buf_append(&state.decode_fns, "\t\telse ");
first = false;
buf_append(&state.decode_fns, "if(is_%s(tag.class, tag.number))\n\t\t{\n", item->name);
- /* if it is a synthetic type, we still need the current tag */
- buf_append(&state.decode_fns, "\t\t\tif(ASN1TAGCLASS_%s == ASN1TAG_SYNTHETIC)\n", item->name);
+ /* if it is a synthetic or ENUMERATED type, we still need the current tag */
+ buf_append(&state.decode_fns, "\t\t\tif(ASN1TAGCLASS_%s == ASN1TAG_SYNTHETIC\n", item->name);
+ buf_append(&state.decode_fns, "\t\t\t|| ASN1TAGCLASS_%s == ASN1TAGCLASS_ENUMERATED)\n", item->name);
buf_append(&state.decode_fns, "\t\t\t{\n");
buf_append(&state.decode_fns, "\t\t\t\tfseek(der, pretag, SEEK_SET);\n");
buf_append(&state.decode_fns, "\t\t\t\tasn1decode_%s(der, out, sublen + tag.length);\n", item->name);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|