[esnacc-dev] [PATCH 1/2] do-macros: Add a header

Aaron Conole aconole at bytheb.org
Tue Mar 28 20:11:52 UTC 2017


Signed-off-by: Aaron Conole <aconole at bytheb.org>
---
 compiler/core/do-macros.c | 67 +--------------------------------------
 compiler/core/snacc.c     |  3 +-
 compiler/do-macros.h      | 80 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 82 insertions(+), 68 deletions(-)
 create mode 100644 compiler/do-macros.h

diff --git a/compiler/core/do-macros.c b/compiler/core/do-macros.c
index fa42591..51782bd 100644
--- a/compiler/core/do-macros.c
+++ b/compiler/core/do-macros.c
@@ -77,72 +77,7 @@
 #include "str-util.h"
 #include "snacc-util.h"
 #include "lib-types.h"
-
-/* Function Prototypes */
-void AddAnyRefByOid PROTO ((AnyRefList **arl, char *enumIdName, AsnOid *oid));
-void AddAnyRefByInt PROTO ((AnyRefList **arl, char *enumIdName, AsnInt intId));
-void NormalizeValue PROTO ((Module *m, ValueDef *vd, Value *v, int quiet));
-void ProcessMacrosInTypeDef PROTO ((Module *m, TypeDef *td));
-void ProcessMacrosInValueDef PROTO ((Module *m, ValueDef *vd));
-void ProcessMacrosInType PROTO ((Module *m, TypeDef *td, Type *t,
-								ValueDef *v));
-void ProcessMacrosInElmtTypes PROTO ((Module *m, TypeDef *td, NamedTypeList *e,
-									 ValueDef *v));
-void ProcessMacrosInBasicType PROTO ((Module  *m, TypeDef *td, Type *type,
-									 BasicType *bt, ValueDef *v));
-void DefineType PROTO ((Module *m, TypeDef *td, Type *t, char *name));
-void ProcessRosOperationMacroType PROTO ((Module *m, TypeDef *td, Type *t,
-										 BasicType *bt, RosOperationMacroType *op, ValueDef *v));
-void ProcessRosErrorMacroType PROTO ((Module *m, TypeDef *td, Type *t,
-									 BasicType *bt, RosErrorMacroType *err,
-									 ValueDef *v));
-void ProcessRosBindMacroType PROTO ((Module *m, TypeDef *td, Type *t,
-									BasicType *bt, RosBindMacroType *bind,
-									ValueDef *v));
-void ProcessRosAseMacroType PROTO ((Module *m, TypeDef *td, Type *t,
-								   BasicType *bt, RosAseMacroType *ase,
-								   ValueDef *v));
-void ProcessRosAcMacroType PROTO ((Module *m, TypeDef *td, Type *t,
-								  BasicType *bt, RosAcMacroType *ac,
-								  ValueDef *v));
-void ProcessMtsasExtensionsMacroType PROTO ((Module *m, TypeDef *td, Type *t,
-											BasicType *bt,
-											MtsasExtensionsMacroType *exts,
-											ValueDef *v));
-void ProcessMtsasExtensionMacroType PROTO ((Module *m, TypeDef *td, Type *t,
-										   BasicType *bt,
-										   MtsasExtensionMacroType *ext,
-										   ValueDef *v));
-void ProcessMtsasExtensionAttributeMacroType PROTO ((Module *m, TypeDef *td,
-													Type *t, BasicType *bt,
-													MtsasExtensionAttributeMacroType *ext,
-													ValueDef *v));
-void ProcessMtsasTokenMacroType PROTO ((Module *m, TypeDef *td, Type *t,
-									   BasicType *bt, MtsasTokenMacroType *tok,
-									   ValueDef *v));
-void ProcessMtsasTokenDataMacroType PROTO ((Module *m, TypeDef *td, Type *t,
-										   BasicType *bt,
-										   MtsasTokenDataMacroType *tok,
-										   ValueDef *v));
-void ProcessMtsasSecurityCategoryMacroType PROTO ((Module *m, TypeDef *td,
-												  Type *t, BasicType *bt,
-												  MtsasSecurityCategoryMacroType *sec,
-												  ValueDef *v));
-void ProcessAsnObjectMacroType PROTO ((Module *m, TypeDef *td, Type *t,
-									  BasicType *bt, AsnObjectMacroType *obj,
-									  ValueDef *v));
-void ProcessAsnPortMacroType PROTO ((Module *m, TypeDef *td, Type *t,
-									BasicType *bt, AsnPortMacroType *p,
-									ValueDef *v));
-void ProcessAsnAbstractBindMacroType PROTO ((Module *m, TypeDef *td, Type *t,
-											BasicType *bt,
-											AsnAbstractBindMacroType *bind,
-											ValueDef *v));
-void ProcessSnmpObjectTypeMacroType PROTO ((Module *m, TypeDef *td, Type *t,
-										   BasicType *bt,
-										   SnmpObjectTypeMacroType *bind,
-										   ValueDef *v));
-
+#include "do-macros.h"
 
 /*
 static TypeDef  *snmpObjectSyntaxesG = NULL;
diff --git a/compiler/core/snacc.c b/compiler/core/snacc.c
index 407394b..8f27bad 100644
--- a/compiler/core/snacc.c
+++ b/compiler/core/snacc.c
@@ -75,7 +75,7 @@ char *bVDAGlobalDLLExport=(char *)0;
 #if META
 #include "meta.h"
 #endif
-
+#include "do-macros.h"
 #include "c-gen/rules.h"		/* for c file generation */
 #include "c-gen/type-info.h"
 
@@ -136,7 +136,6 @@ void PrintPyCode (FILE *src, FILE *hdr, if_META (MetaNameStyle genMeta COMMA
 				   if_TCL (int printTcl COMMA) int novolatilefuncs);
 void PrintIDLCode PROTO ((FILE *idl, ModuleList *mods, Module *m, IDLRules *r,
 						 long int longJmpVal, int printValues));
-void ProcessMacros PROTO ((Module *m));
 void SortAllDependencies PROTO ((ModuleList *m));
 int  yyparse();
 
diff --git a/compiler/do-macros.h b/compiler/do-macros.h
new file mode 100644
index 0000000..81e38e7
--- /dev/null
+++ b/compiler/do-macros.h
@@ -0,0 +1,80 @@
+/**
+ * do-macros.h
+ */
+
+#include <string.h>
+#include <ctype.h>		/* for islower() */
+#include "asn-incl.h"
+#include "asn1module.h"
+#include "str-util.h"
+#include "snacc-util.h"
+#include "lib-types.h"
+
+#ifndef SNACC_DO_MACROS_H__
+#define SNACC_DO_MACROS_H__
+
+/* Function Prototypes */
+void AddAnyRefByOid PROTO ((AnyRefList **arl, char *enumIdName, AsnOid *oid));
+void AddAnyRefByInt PROTO ((AnyRefList **arl, char *enumIdName, AsnInt intId));
+void NormalizeValue PROTO ((Module *m, ValueDef *vd, Value *v, int quiet));
+void ProcessMacrosInTypeDef PROTO ((Module *m, TypeDef *td));
+void ProcessMacrosInValueDef PROTO ((Module *m, ValueDef *vd));
+void ProcessMacrosInType PROTO ((Module *m, TypeDef *td, Type *t,
+								ValueDef *v));
+void ProcessMacrosInElmtTypes PROTO ((Module *m, TypeDef *td, NamedTypeList *e,
+									 ValueDef *v));
+void ProcessMacrosInBasicType PROTO ((Module  *m, TypeDef *td, Type *type,
+									 BasicType *bt, ValueDef *v));
+void DefineType PROTO ((Module *m, TypeDef *td, Type *t, char *name));
+void ProcessRosOperationMacroType PROTO ((Module *m, TypeDef *td, Type *t,
+										 BasicType *bt, RosOperationMacroType *op, ValueDef *v));
+void ProcessRosErrorMacroType PROTO ((Module *m, TypeDef *td, Type *t,
+									 BasicType *bt, RosErrorMacroType *err,
+									 ValueDef *v));
+void ProcessRosBindMacroType PROTO ((Module *m, TypeDef *td, Type *t,
+									BasicType *bt, RosBindMacroType *bind,
+									ValueDef *v));
+void ProcessRosAseMacroType PROTO ((Module *m, TypeDef *td, Type *t,
+								   BasicType *bt, RosAseMacroType *ase,
+								   ValueDef *v));
+void ProcessRosAcMacroType PROTO ((Module *m, TypeDef *td, Type *t,
+								  BasicType *bt, RosAcMacroType *ac,
+								  ValueDef *v));
+void ProcessMtsasExtensionsMacroType PROTO ((Module *m, TypeDef *td, Type *t,
+											BasicType *bt,
+											MtsasExtensionsMacroType *exts,
+											ValueDef *v));
+void ProcessMtsasExtensionMacroType PROTO ((Module *m, TypeDef *td, Type *t,
+										   BasicType *bt,
+										   MtsasExtensionMacroType *ext,
+										   ValueDef *v));
+void ProcessMtsasExtensionAttributeMacroType PROTO ((Module *m, TypeDef *td,
+													Type *t, BasicType *bt,
+													MtsasExtensionAttributeMacroType *ext,
+													ValueDef *v));
+void ProcessMtsasTokenMacroType PROTO ((Module *m, TypeDef *td, Type *t,
+									   BasicType *bt, MtsasTokenMacroType *tok,
+									   ValueDef *v));
+void ProcessMtsasTokenDataMacroType PROTO ((Module *m, TypeDef *td, Type *t,
+										   BasicType *bt,
+										   MtsasTokenDataMacroType *tok,
+										   ValueDef *v));
+void ProcessMtsasSecurityCategoryMacroType PROTO ((Module *m, TypeDef *td,
+												  Type *t, BasicType *bt,
+												  MtsasSecurityCategoryMacroType *sec,
+												  ValueDef *v));
+void ProcessAsnObjectMacroType PROTO ((Module *m, TypeDef *td, Type *t,
+									  BasicType *bt, AsnObjectMacroType *obj,
+									  ValueDef *v));
+void ProcessAsnPortMacroType PROTO ((Module *m, TypeDef *td, Type *t,
+									BasicType *bt, AsnPortMacroType *p,
+									ValueDef *v));
+void ProcessAsnAbstractBindMacroType PROTO ((Module *m, TypeDef *td, Type *t,
+											BasicType *bt,
+											AsnAbstractBindMacroType *bind,
+											ValueDef *v));
+void ProcessSnmpObjectTypeMacroType PROTO ((Module *m, TypeDef *td, Type *t,
+										   BasicType *bt,
+										   SnmpObjectTypeMacroType *bind,
+										   ValueDef *v));
+#endif
-- 
2.9.3




More information about the dev mailing list