From patchwork Tue Jan 3 22:25:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [esnacc-dev,RFC,1/5] snacc: Change c and c++ api X-Patchwork-Submitter: Aaron Conole X-Patchwork-Id: 1 X-Patchwork-Delegate: aconole@bytheb.org Message-Id: <1483482316-10045-2-git-send-email-aconole@bytheb.org> To: dev@lists.esnacc.org Date: Tue, 3 Jan 2017 17:25:12 -0500 From: Aaron Conole List-Id: eSNACC Development discussion This is an API breaking change which moves snacc.h into the c-lib and cxx-lib include directories. A future follow up will adjust the code generators to point to the include paths. Signed-off-by: Aaron Conole --- Makefile.am | 2 +- c-lib/.gitignore | 2 + c-lib/automake.mk | 14 +++- cxx-lib/.gitignore | 2 + cxx-lib/automake.mk | 14 +++- debian/libesnacc-dev.install | 2 - policy.h | 27 ------- redhat/esnacc.spec.in | 2 - snacc.h | 168 -------------------------------------- snacc.h.in | 189 +++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 217 insertions(+), 205 deletions(-) delete mode 100644 policy.h delete mode 100644 snacc.h create mode 100644 snacc.h.in diff --git a/Makefile.am b/Makefile.am index 60853fc..f5875fc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -61,7 +61,7 @@ MAN_FRAGMENTS = MAN_ROOTS = noinst_DATA = noinst_HEADERS = -nobase_include_HEADERS = snacc.h policy.h +nobase_include_HEADERS = lib_LTLIBRARIES = noinst_man_MANS = noinst_PROGRAMS = diff --git a/c-lib/.gitignore b/c-lib/.gitignore index b1af50e..1231747 100644 --- a/c-lib/.gitignore +++ b/c-lib/.gitignore @@ -2,3 +2,5 @@ .libs .deps libesnacc.pc +inc/snacc.h +inc/snacc.h.in diff --git a/c-lib/automake.mk b/c-lib/automake.mk index 4393e9f..677d231 100644 --- a/c-lib/automake.mk +++ b/c-lib/automake.mk @@ -1,6 +1,10 @@ lib_LTLIBRARIES += c-lib/libcasn1.la +BUILT_SOURCES += c-lib/inc/snacc.h + c_lib_libcasn1_la_SOURCES = \ + c-lib/inc/snacc.h \ + c-lib/inc/snacc.h.in \ c-lib/src/asn1init.c \ c-lib/src/asn-octs.c \ c-lib/src/mem.c \ @@ -71,6 +75,7 @@ nobase_include_HEADERS += c-lib/inc/asn-any.h \ c-lib/inc/min-buf.h \ c-lib/inc/nibble-alloc.h \ c-lib/inc/print.h \ + c-lib/inc/snacc.h \ c-lib/inc/sbuf.h \ c-lib/inc/snaccCder.h \ c-lib/inc/str-stk.h \ @@ -85,7 +90,6 @@ nobase_include_HEADERS += c-lib/inc/asn-any.h \ c-lib/inc/tbl-util.h c_lib_libcasn1_la_CFLAGS = \ - -I$(top_srcdir) \ -I$(top_srcdir)/c-lib \ -I$(top_srcdir)/c-lib/src \ -I$(top_srcdir)/c-lib/inc @@ -96,7 +100,11 @@ c_lib_libcasn1_la_LDFLAGS = \ $(all_lib_LDFLAGS) EXTRA_DIST += \ - c-lib/libesnacc.pc.in + c-lib/libesnacc.pc.in \ + c-lib/inc/snacc.h.in pkgconfig_DATA += c-lib/libesnacc.pc -DISTCLEANFILES += c-lib/libesnacc.pc +DISTCLEANFILES += c-lib/libesnacc.pc c-lib/inc/snacc.h + +c-lib/inc/snacc.h.in: snacc.h.in + cp $< $@ diff --git a/cxx-lib/.gitignore b/cxx-lib/.gitignore index f841655..82f7b10 100644 --- a/cxx-lib/.gitignore +++ b/cxx-lib/.gitignore @@ -2,3 +2,5 @@ .libs .deps libesnaccxx.pc +inc/snacc.h +inc/snacc.h.in diff --git a/cxx-lib/automake.mk b/cxx-lib/automake.mk index 249f2dc..4495a77 100644 --- a/cxx-lib/automake.mk +++ b/cxx-lib/automake.mk @@ -1,5 +1,7 @@ lib_LTLIBRARIES += cxx-lib/libcxxasn1.la +BUILT_SOURCES += cxx-lib/inc/snacc.h + nobase_include_HEADERS += cxx-lib/inc/asn-buf.h \ cxx-lib/inc/asn-chartraits.h \ cxx-lib/inc/asn-config.h \ @@ -10,11 +12,14 @@ nobase_include_HEADERS += cxx-lib/inc/asn-buf.h \ cxx-lib/inc/asn-usefultypes.h \ cxx-lib/inc/init.h \ cxx-lib/inc/meta.h \ + cxx-lib/inc/snacc.h \ cxx-lib/inc/snaccdll.h \ cxx-lib/inc/snaccexcept.h \ cxx-lib/inc/tcl-if.h cxx_lib_libcxxasn1_la_SOURCES = \ + cxx-lib/inc/snacc.h \ + cxx-lib/inc/snacc.h.in \ cxx-lib/src/asn-null.cpp \ cxx-lib/src/asn-oid.cpp \ cxx-lib/src/asn-RelativeOid.cpp \ @@ -80,7 +85,12 @@ cxx_lib_libcxxasn1_la_LDFLAGS = \ $(cxx_lib_libcxxasn1_la_WIN32_LDFLAGS) EXTRA_DIST += \ - cxx-lib/libesnaccxx.pc.in + cxx-lib/libesnaccxx.pc.in \ + cxx-lib/inc/snacc.h.in pkgconfig_DATA += cxx-lib/libesnaccxx.pc -DISTCLEANFILES += cxx-lib/libesnaccxx.pc +DISTCLEANFILES += cxx-lib/libesnaccxx.pc cxx-lib/inc/snacc.h + +cxx-lib/inc/snacc.h.in: snacc.h.in + cp $< $@ + diff --git a/debian/libesnacc-dev.install b/debian/libesnacc-dev.install index 046154d..b4a6dfb 100644 --- a/debian/libesnacc-dev.install +++ b/debian/libesnacc-dev.install @@ -1,7 +1,5 @@ debian/tmp/usr/include/c-lib/inc debian/tmp/usr/include/cxx-lib/inc -debian/tmp/usr/include/snacc.h -debian/tmp/usr/include/policy.h debian/tmp/usr/lib/libcasn1.a debian/tmp/usr/lib/libcasn1.la debian/tmp/usr/lib/libcxxasn1.a diff --git a/policy.h b/policy.h deleted file mode 100644 index a92e019..0000000 --- a/policy.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * file: policy.h - * - */ - -/* - * enable the snacc compiler's Tcl interface generating code? - * set it to 0 or 1. - */ -#ifndef NO_TCL -#define NO_TCL 0 -#endif - -/* - * enable code for meta code generation? - * the Tcl code needs it. - */ -#ifndef NO_META -#define NO_META NO_TCL -#endif - -/* - * enable code for CORBA IDL generation? - */ -#ifndef IDL -#define IDL 1 -#endif diff --git a/redhat/esnacc.spec.in b/redhat/esnacc.spec.in index 290a21c..245d3f8 100644 --- a/redhat/esnacc.spec.in +++ b/redhat/esnacc.spec.in @@ -79,8 +79,6 @@ make DESTDIR=%{buildroot} install %files devel %_includedir/c-lib/inc %_includedir/cxx-lib/inc -%_includedir/snacc.h -%_includedir/policy.h %_libdir/lib*.a %_libdir/lib*.la %{_libdir}/pkgconfig/libesnacc.pc diff --git a/snacc.h b/snacc.h deleted file mode 100644 index d324a08..0000000 --- a/snacc.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * file: snacc.h - * - * INSERT_VDA_COMMENTS - * - * $Header: /baseline/SNACC/snacc.h,v 1.13 2004/03/22 20:04:00 gronej Exp $ - * $Log: snacc.h,v $ - * Revision 1.13 2004/03/22 20:04:00 gronej - * took IBM references out of the code (to the best of our knowledge, we don't use any of it anymore) - * - * Revision 1.12 2003/12/17 19:05:02 gronej - * SNACC baseline merged with PER v1_7 tag - * - * Revision 1.11.2.1 2003/11/05 14:58:53 gronej - * working PER code merged with esnacc_1_6 - * - * Revision 1.11 2003/02/21 12:13:16 leonberp - * cleaned up project settings for 1.5 release - * - * Revision 1.10 2002/12/16 17:23:11 mcphersc - * DISABLED TCL - * - * Revision 1.9 2002/12/13 17:43:43 mcphersc - * Modified the defines for META and TCL for use with the configure script - * - * Revision 1.8 2002/12/13 17:31:56 mcphersc - * Modified TCL/META defines - * - * Revision 1.7 2002/12/10 14:21:19 mcphersc - * *** empty log message *** - * - * Revision 1.6 2002/12/10 13:41:10 mcphersc - * Added undefine of TCL for compiler code only. - * - * Revision 1.5 2002/09/04 18:33:43 vracarl - * got rid of c++ comments - * - * Revision 1.4 2002/05/10 16:25:43 leonberp - * latest changes for release 2.2 - * - * Revision 1.3 2002/01/10 20:04:41 sfl - * Updates to Unix ./configure script so that config.h is named - * config_Used.h (similar to config_win32.h for windows). This allows the - * run-time libs and includes to use a unique include, but still be - * dynamically built for the individual platform. - * - * Revision 1.2 2000/10/24 14:54:37 rwc - * Updated to remove high-level warnings (level 4 on MSVC++) for an easier build. - * SOME warnings persist due to difficulty in modifying the SNACC compiler to - * properly build clean source; also some files are built by Lex/Yacc. - * - * Revision 1.1.1.1 2000/08/21 20:35:45 leonberp - * First CVS Version of SNACC. - * - * Revision 1.7 1997/04/07 13:13:18 wan - * Made more C++ readable (credits to Steve Walker) - * - * Revision 1.6 1997/02/28 13:39:35 wan - * Modifications collected for new version 1.3: Bug fixes, tk4.2. - * - * Revision 1.5 1997/02/15 20:38:48 rj - * In member functions, return *this after calling abort() for stupid compilers that don't seem to know about volatile abort() (they would otherwise abort with an error). - * - * Revision 1.4 1995/07/24 15:06:52 rj - * configure checks for mem* functions. define replacements using b* functions, if necessary. - * - */ - -#ifndef _SNACC_H_ -#define _SNACC_H_ - -#define GLASS 1 -#define KHO 1 - -#define memzero(p, len) memset(p, 0, len) - -#ifdef __cplusplus - -#ifdef VOLATILE_RETRUN -# define RETURN_THIS_FOR_COMPILERS_WITHOUT_VOLATILE_FUNCTIONS return *this; -#else -# define RETURN_THIS_FOR_COMPILERS_WITHOUT_VOLATILE_FUNCTIONS -#endif - -#else /* !__cplusplus */ - -#ifndef FALSE -#define FALSE 0 -#endif -#ifndef TRUE -#define TRUE 1 -#endif - -#endif /* __cplusplus */ - -/* - * Inspired by gdb 4.0, for better or worse... - * (grabbed from Barry Brachman - MS) - * - * These macros munge C routine declarations such - * that they work for ANSI or non-ANSI C compilers - */ -#ifndef __USE_NON_ANSI_C__ - -#define PROTO( X) X -#define PARAMS( arglist, args) (args) -#define NOPARAMS() (void) -#define _AND_ , -#define DOTS , ... - -#else /* __USE_ANSI_C__ */ - -#define PROTO( X) () -#define PARAMS( arglist, args) arglist args; -#define NOPARAMS() () -#define _AND_ ; -#define DOTS -#define void char - -#endif /* __USE_ANSI_C__ */ - -#include "policy.h" - -#if COMPILER - // If we have TCL on this system then add TCL to the compiler - #if defined (HAVE_TCLNOT) - #define TCL HAVE_TCL - #define META 1 - #endif -#elif defined (ENABLE_TCL) && defined (HAVE_TCL) - #define TCL 1; - #define META 1; -#endif - -#ifdef ENABLE_META -#ifndef META - #define META 1 -#endif -#endif - -#define COMMA , - -#define if_IBM_ENC( code) - - -#ifdef META -#define if_META( code) code -#else -#define if_META( code) -#endif - -#if defined(TCL) && defined (META) -#define if_TCL( code) code -#else -#define if_TCL( code) -#endif - -#if __GNUC__ -#define ESNACC_UNUSED __attribute__((__unused__)) -#else -#define ESNACC_UNUSED -#endif - -#ifdef WIN32 -#define inline __inline -#endif - -#endif /* _SNACC_H_ */ diff --git a/snacc.h.in b/snacc.h.in new file mode 100644 index 0000000..fd68178 --- /dev/null +++ b/snacc.h.in @@ -0,0 +1,189 @@ +/* + * file: snacc.h + * + * INSERT_VDA_COMMENTS + * + * $Header: /baseline/SNACC/snacc.h,v 1.13 2004/03/22 20:04:00 gronej Exp $ + * $Log: snacc.h,v $ + * Revision 1.13 2004/03/22 20:04:00 gronej + * took IBM references out of the code (to the best of our knowledge, we don't use any of it anymore) + * + * Revision 1.12 2003/12/17 19:05:02 gronej + * SNACC baseline merged with PER v1_7 tag + * + * Revision 1.11.2.1 2003/11/05 14:58:53 gronej + * working PER code merged with esnacc_1_6 + * + * Revision 1.11 2003/02/21 12:13:16 leonberp + * cleaned up project settings for 1.5 release + * + * Revision 1.10 2002/12/16 17:23:11 mcphersc + * DISABLED TCL + * + * Revision 1.9 2002/12/13 17:43:43 mcphersc + * Modified the defines for META and TCL for use with the configure script + * + * Revision 1.8 2002/12/13 17:31:56 mcphersc + * Modified TCL/META defines + * + * Revision 1.7 2002/12/10 14:21:19 mcphersc + * *** empty log message *** + * + * Revision 1.6 2002/12/10 13:41:10 mcphersc + * Added undefine of TCL for compiler code only. + * + * Revision 1.5 2002/09/04 18:33:43 vracarl + * got rid of c++ comments + * + * Revision 1.4 2002/05/10 16:25:43 leonberp + * latest changes for release 2.2 + * + * Revision 1.3 2002/01/10 20:04:41 sfl + * Updates to Unix ./configure script so that config.h is named + * config_Used.h (similar to config_win32.h for windows). This allows the + * run-time libs and includes to use a unique include, but still be + * dynamically built for the individual platform. + * + * Revision 1.2 2000/10/24 14:54:37 rwc + * Updated to remove high-level warnings (level 4 on MSVC++) for an easier build. + * SOME warnings persist due to difficulty in modifying the SNACC compiler to + * properly build clean source; also some files are built by Lex/Yacc. + * + * Revision 1.1.1.1 2000/08/21 20:35:45 leonberp + * First CVS Version of SNACC. + * + * Revision 1.7 1997/04/07 13:13:18 wan + * Made more C++ readable (credits to Steve Walker) + * + * Revision 1.6 1997/02/28 13:39:35 wan + * Modifications collected for new version 1.3: Bug fixes, tk4.2. + * + * Revision 1.5 1997/02/15 20:38:48 rj + * In member functions, return *this after calling abort() for stupid compilers that don't seem to know about volatile abort() (they would otherwise abort with an error). + * + * Revision 1.4 1995/07/24 15:06:52 rj + * configure checks for mem* functions. define replacements using b* functions, if necessary. + * + */ + +#ifndef _SNACC_H_ +#define _SNACC_H_ + +#define GLASS 1 +#define KHO 1 + +#define memzero(p, len) memset(p, 0, len) + +#ifdef __cplusplus + +#ifdef VOLATILE_RETRUN +# define RETURN_THIS_FOR_COMPILERS_WITHOUT_VOLATILE_FUNCTIONS return *this; +#else +# define RETURN_THIS_FOR_COMPILERS_WITHOUT_VOLATILE_FUNCTIONS +#endif + +#else /* !__cplusplus */ + +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE 1 +#endif + +#endif /* __cplusplus */ + +/* + * Inspired by gdb 4.0, for better or worse... + * (grabbed from Barry Brachman - MS) + * + * These macros munge C routine declarations such + * that they work for ANSI or non-ANSI C compilers + */ +#ifndef __USE_NON_ANSI_C__ + +#define PROTO( X) X +#define PARAMS( arglist, args) (args) +#define NOPARAMS() (void) +#define _AND_ , +#define DOTS , ... + +#else /* __USE_ANSI_C__ */ + +#define PROTO( X) () +#define PARAMS( arglist, args) arglist args; +#define NOPARAMS() () +#define _AND_ ; +#define DOTS +#define void char + +#endif /* __USE_ANSI_C__ */ + +/* + * enable the snacc compiler's Tcl interface generating code? + * set it to 0 or 1. + */ +#ifndef NO_TCL +#define NO_TCL 0 +#endif + +/* + * enable code for meta code generation? + * the Tcl code needs it. + */ +#ifndef NO_META +#define NO_META NO_TCL +#endif + +/* + * enable code for CORBA IDL generation? + */ +#ifndef IDL +#define IDL 1 +#endif + +#if COMPILER + // If we have TCL on this system then add TCL to the compiler + #if defined (HAVE_TCLNOT) + #define TCL HAVE_TCL + #define META 1 + #endif +#elif defined (ENABLE_TCL) && defined (HAVE_TCL) + #define TCL 1; + #define META 1; +#endif + +#ifdef ENABLE_META +#ifndef META + #define META 1 +#endif +#endif + +#define COMMA , + +#define if_IBM_ENC( code) + + +#ifdef META +#define if_META( code) code +#else +#define if_META( code) +#endif + +#if defined(TCL) && defined (META) +#define if_TCL( code) code +#else +#define if_TCL( code) +#endif + +#if __GNUC__ +#define ESNACC_UNUSED __attribute__((__unused__)) +#else +#define ESNACC_UNUSED +#endif + +#ifdef WIN32 +#define inline __inline +#endif + +#endif /* _SNACC_H_ */ From patchwork Tue Jan 3 22:25:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [esnacc-dev,RFC,2/5] gen-code: Use the detailed inc directory for generated code X-Patchwork-Submitter: Aaron Conole X-Patchwork-Id: 2 X-Patchwork-Delegate: aconole@bytheb.org Message-Id: <1483482316-10045-3-git-send-email-aconole@bytheb.org> To: dev@lists.esnacc.org Date: Tue, 3 Jan 2017 17:25:13 -0500 From: Aaron Conole List-Id: eSNACC Development discussion Generated code should spell out the full path to the include files. Signed-off-by: Aaron Conole --- compiler/back-ends/c++-gen/gen-code.c | 4 ++-- compiler/back-ends/c-gen/gen-code.c | 30 ++++-------------------------- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/compiler/back-ends/c++-gen/gen-code.c b/compiler/back-ends/c++-gen/gen-code.c index 0e4e991..b647a00 100644 --- a/compiler/back-ends/c++-gen/gen-code.c +++ b/compiler/back-ends/c++-gen/gen-code.c @@ -4082,8 +4082,8 @@ PrintCxxCode PARAMS ((src, hdr, if_META (printMeta COMMA meta COMMA meta_pdus CO } #endif /* META */ - fprintf(hdr, "#include \"asn-incl.h\"\n"); - fprintf(hdr, "#include \"asn-listset.h\"\n"); + fprintf(hdr, "#include \"cxx-lib/inc/asn-incl.h\"\n"); + fprintf(hdr, "#include \"cxx-lib/inc/asn-listset.h\"\n"); fprintf(src, "\n"); PrintSrcIncludes(src, mods, m); diff --git a/compiler/back-ends/c-gen/gen-code.c b/compiler/back-ends/c-gen/gen-code.c index 63b1c4d..86c5f65 100644 --- a/compiler/back-ends/c-gen/gen-code.c +++ b/compiler/back-ends/c-gen/gen-code.c @@ -139,8 +139,7 @@ static void PrintCSrcComment PROTO ((FILE *src, Module *m)); static void PrintCSrcIncludes PROTO ((FILE *src, Module *m, ModuleList *mods)); static void PrintCHdrComment PROTO ((FILE *hdr, Module *m)); static void PrintCHdrObjectDeclaration_and_Init PROTO ((FILE *hdr, Module *m, CRules *r)); -//RWC;static void PrintCHdrObjectField PROTO ((FILE *hdr, Module *m, CRules *r, char *objName, ObjectAssignmentField *oaf)); -//extern short ImportedFilesG; + /* * Fills the hdr file with the C type and encode/decode prototypes * Fills the src file with the encoded/decode routine definitions @@ -166,17 +165,12 @@ PrintCCode PARAMS ((src, hdr, mods, m, r, longJmpVal, printTypes, printValues, p /* Deepak: suppose the asn source file is test.asn * then the C source file name is test.c and C header file is test.h */ - PrintCSrcComment (src, m); // Deepak: Write the comments in the source file. - PrintCSrcIncludes (hdr/*RWC;src*/, m, mods); // Deepak: #include "asn-incl.h" and #include "test.h". + PrintCSrcComment (src, m); + PrintCSrcIncludes (hdr, m, mods); PrintCHdrComment (hdr, m); // Deepak: Write the comments in the header file. PrintConditionalIncludeOpen (hdr, m->cHdrFileName); - /* Deepak: the above fn writes - * #ifndef _test_h_ - * #define _test_h_ - */ - /* PIERCE TBD: Is this necessary still after Deepak's mods? * * Add include reference to source file @@ -535,7 +529,7 @@ PrintCSrcIncludes PARAMS ((inFile, m, mods ), /* * include snacc runtime library related hdrs */ - fprintf (inFile, "\n#include \"asn-incl.h\"\n"); + fprintf (inFile, "\n#include \"c-lib/inc/asn-incl.h\"\n"); /* * print out include files in same order of the module @@ -561,26 +555,10 @@ PrintCSrcIncludes PARAMS ((inFile, m, mods ), } mods->curr = currModTmp; // RWC;RESET loop control } -// if ((ImportedFilesG == FALSE) || (impMod->ImportedFlag == TRUE)) -// { -// // Only include if Module was exported -// if (impMod->exportStatus != 0) -// { -// // Check that the source header is not part of -// // These references. -// if ((strcmp(impMod->cHdrFileName, srcref) != 0)) -// fprintf (src, "#include \"%s\"\n", impMod->cHdrFileName); -// } -// } // endif - // fprintf (src, "#include \"%s\"\n", impMod->cHdrFileName); } - //RWC;if (m->cHdrFileName != NULL) - //RWC; fprintf (inFile, "#include \"%s\"\n", m->cHdrFileName); - SET_CURR_LIST_NODE (mods, tmp); - m=m; /* AVOIDS warning. */ } /* PrintCSrcIncludes */ From patchwork Tue Jan 3 22:25:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [esnacc-dev,RFC,3/5] c-lib: Rename all of the include directories X-Patchwork-Submitter: Aaron Conole X-Patchwork-Id: 3 X-Patchwork-Delegate: aconole@bytheb.org Message-Id: <1483482316-10045-4-git-send-email-aconole@bytheb.org> To: dev@lists.esnacc.org Date: Tue, 3 Jan 2017 17:25:14 -0500 From: Aaron Conole List-Id: eSNACC Development discussion The c-library includes all point to the c-lib/inc/ directory, now. This will facilitate moving away from having custom pkgconfig CFLAGS for the include directories. Signed-off-by: Aaron Conole --- c-lib/inc/asn-any.h | 2 +- c-lib/inc/asn-config.h | 10 ++++---- c-lib/inc/asn-der.h | 4 +-- c-lib/inc/asn-incl.h | 59 +++++++++++++++++++------------------------- c-lib/inc/asn-oid.h | 2 +- c-lib/inc/asn-relative-oid.h | 2 +- c-lib/inc/gen-buf.h | 3 +-- c-lib/inc/mem.h | 4 +-- c-lib/inc/tbl-dbg.h | 2 +- c-lib/inc/tbl-gen.h | 2 +- c-lib/inc/tbl-incl.h | 14 +++++------ 11 files changed, 48 insertions(+), 56 deletions(-) diff --git a/c-lib/inc/asn-any.h b/c-lib/inc/asn-any.h index 8f7b544..a4d8b8f 100644 --- a/c-lib/inc/asn-any.h +++ b/c-lib/inc/asn-any.h @@ -20,7 +20,7 @@ #ifndef _asn_any_h_ #define _asn_any_h_ -#include "hash.h" +#include "c-lib/inc/hash.h" #ifdef __cplusplus extern "C" { diff --git a/c-lib/inc/asn-config.h b/c-lib/inc/asn-config.h index 9a31d6e..1c30f2c 100644 --- a/c-lib/inc/asn-config.h +++ b/c-lib/inc/asn-config.h @@ -102,7 +102,7 @@ /* for pow() used in asn_real.c - must include to avoid casting err on pow */ /* #include */ -#include "snacc.h" +#include "c-lib/inc/snacc.h" /* used to test if optionals are present */ @@ -151,7 +151,7 @@ Asn1ErrorHandler Asn1InstallErrorHandler PROTO ((Asn1ErrorHandler handler)); #endif /* __cplusplus */ #ifdef USE_NIBBLE_MEMORY -#include "nibble-alloc.h" +#include "c-lib/inc/nibble-alloc.h" #define Asn1Alloc( size) NibbleAlloc (size) #define Asn1Free( ptr) /* empty */ @@ -161,7 +161,7 @@ Asn1ErrorHandler Asn1InstallErrorHandler PROTO ((Asn1ErrorHandler handler)); #else /* !USE_NIBBLE_MEMORY */ -#include "mem.h" +#include "c-lib/inc/mem.h" #define Asn1Alloc( size) Malloc (size) #define Asn1Free( ptr) Free (ptr) @@ -184,7 +184,7 @@ Asn1ErrorHandler Asn1InstallErrorHandler PROTO ((Asn1ErrorHandler handler)); * the GenBufs aren't such a big performance hit for table stuff. * */ -#include "gen-buf.h" +#include "c-lib/inc/gen-buf.h" //#define BUF_TYPE GenBuf * #define BufGetByte( b) GenBufGetByte (b) @@ -205,7 +205,7 @@ Asn1ErrorHandler Asn1InstallErrorHandler PROTO ((Asn1ErrorHandler handler)); -#include "print.h" /* for printing set up */ +#include "c-lib/inc/print.h" /* for printing set up */ #ifdef WIN32 #pragma warning( disable : 4127 ) /* IGNORE constant conditional expression. */ diff --git a/c-lib/inc/asn-der.h b/c-lib/inc/asn-der.h index 314e658..5623f1b 100644 --- a/c-lib/inc/asn-der.h +++ b/c-lib/inc/asn-der.h @@ -44,8 +44,8 @@ */ #ifndef _asn_der_h #define _asn_der_h -#include "exp-buf.h" -#include "gen-buf.h" +#include "c-lib/inc/exp-buf.h" +#include "c-lib/inc/gen-buf.h" #ifdef __cplusplus extern "C" { diff --git a/c-lib/inc/asn-incl.h b/c-lib/inc/asn-incl.h index 7cd2af8..dd4782d 100644 --- a/c-lib/inc/asn-incl.h +++ b/c-lib/inc/asn-incl.h @@ -83,37 +83,30 @@ * */ -#include "asn-config.h" -#include "gen-buf.h" -/* -#include "exp-buf.h" -#include "sbuf.h" -*/ -#include "asn-len.h" -#include "asn-tag.h" -#include "asn-bool.h" -#include "asn-int.h" -#include "asn-enum.h" -#include "asn-real.h" -#include "asn-octs.h" -#include "asn-bits.h" -#include "asn-oid.h" -#include "asn-relative-oid.h" -#include "asn-null.h" -#include "asn-any.h" -#include "asn-list.h" -#include "asn-der.h" -#include "asn-PrintableStr.h" -#include "asn-UniversalString.h" -#include "asn-BMPString.h" -#include "asn-UTF8String.h" -#include "asn-VisibleString.h" -#include "asn-IA5String.h" -#include "asn-NumericString.h" -#include "asn-TeletexString.h" -#include "snaccCder.h" -#include "print.h" +#include "c-lib/inc/asn-config.h" +#include "c-lib/inc/gen-buf.h" +#include "c-lib/inc/asn-len.h" +#include "c-lib/inc/asn-tag.h" +#include "c-lib/inc/asn-bool.h" +#include "c-lib/inc/asn-int.h" +#include "c-lib/inc/asn-enum.h" +#include "c-lib/inc/asn-real.h" +#include "c-lib/inc/asn-octs.h" +#include "c-lib/inc/asn-bits.h" +#include "c-lib/inc/asn-oid.h" +#include "c-lib/inc/asn-relative-oid.h" +#include "c-lib/inc/asn-null.h" +#include "c-lib/inc/asn-any.h" +#include "c-lib/inc/asn-list.h" +#include "c-lib/inc/asn-der.h" +#include "c-lib/inc/asn-PrintableStr.h" +#include "c-lib/inc/asn-UniversalString.h" +#include "c-lib/inc/asn-BMPString.h" +#include "c-lib/inc/asn-UTF8String.h" +#include "c-lib/inc/asn-VisibleString.h" +#include "c-lib/inc/asn-IA5String.h" +#include "c-lib/inc/asn-NumericString.h" +#include "c-lib/inc/asn-TeletexString.h" +#include "c-lib/inc/snaccCder.h" +#include "c-lib/inc/print.h" #define MAX_BUF 4096 - - - diff --git a/c-lib/inc/asn-oid.h b/c-lib/inc/asn-oid.h index 0ee1078..5f495ca 100644 --- a/c-lib/inc/asn-oid.h +++ b/c-lib/inc/asn-oid.h @@ -22,7 +22,7 @@ #ifndef _asn_oid_h_ #define _asn_oid_h_ -#include "asn-octs.h" +#include "c-lib/inc/asn-octs.h" #ifdef __cplusplus extern "C" { diff --git a/c-lib/inc/asn-relative-oid.h b/c-lib/inc/asn-relative-oid.h index a8be659..41de534 100644 --- a/c-lib/inc/asn-relative-oid.h +++ b/c-lib/inc/asn-relative-oid.h @@ -22,7 +22,7 @@ #ifndef _asn_relative_oid_h_ #define _asn_relative_oid_h_ -#include "asn-octs.h" +#include "c-lib/inc/asn-octs.h" #ifdef __cplusplus extern "C" { diff --git a/c-lib/inc/gen-buf.h b/c-lib/inc/gen-buf.h index 699a033..d52868c 100644 --- a/c-lib/inc/gen-buf.h +++ b/c-lib/inc/gen-buf.h @@ -26,8 +26,7 @@ #ifndef _gen_buf_h_ #define _gen_buf_h_ -#include "config.h" -#include "snacc.h" +#include "c-lib/inc/snacc.h" #ifdef __cplusplus extern "C" { diff --git a/c-lib/inc/mem.h b/c-lib/inc/mem.h index 3b2fc6b..efbc41f 100644 --- a/c-lib/inc/mem.h +++ b/c-lib/inc/mem.h @@ -47,8 +47,8 @@ extern "C" { #endif -#include "snacc.h" -#include "asn-incl.h" +#include "c-lib/inc/snacc.h" +#include "c-lib/inc/asn-incl.h" void *Malloc PROTO ((int size)); void *Realloc PROTO ((void *ptr, int newsize)); diff --git a/c-lib/inc/tbl-dbg.h b/c-lib/inc/tbl-dbg.h index c31c4df..14756ed 100644 --- a/c-lib/inc/tbl-dbg.h +++ b/c-lib/inc/tbl-dbg.h @@ -1,7 +1,7 @@ #ifndef TBL_DBG_H #define TBL_DBG_H -#include "tbl-gen.h" +#include "c-lib/inc/tbl-gen.h" extern TdeExceptionCode DBGMinCode; /* Defaults to TDEINFO */ int DBGSimple PROTO ((AsnTag tag, AsnOcts* v, int begin)); diff --git a/c-lib/inc/tbl-gen.h b/c-lib/inc/tbl-gen.h index 019920e..57917ec 100644 --- a/c-lib/inc/tbl-gen.h +++ b/c-lib/inc/tbl-gen.h @@ -2,7 +2,7 @@ #define TBL_GEN_H #define USE_GEN_BUF 1 -#include "tbl-incl.h" +#include "c-lib/inc/tbl-incl.h" typedef enum {TDEINFO, TDEEOC=TDEINFO, TDEPEEKTAG, TDEPUSHTAG, TDEWARNING, TDEUNEXPECTED=TDEWARNING, TDENONOPTIONAL, TDEMANDATORY, diff --git a/c-lib/inc/tbl-incl.h b/c-lib/inc/tbl-incl.h index 8eb4d57..fdd8c1b 100644 --- a/c-lib/inc/tbl-incl.h +++ b/c-lib/inc/tbl-incl.h @@ -38,8 +38,8 @@ #define TTBL 3 -#include "asn-incl.h" -#include "tbl.h" +#include "c-lib/inc/asn-incl.h" +#include "c-lib/inc/tbl.h" typedef void AVal; @@ -52,11 +52,11 @@ typedef struct AChoiceVal } AChoiceVal; -#include "tbl-util.h" -#include "tbl-enc.h" -#include "tbl-dec.h" -#include "tbl-print.h" -#include "tbl-free.h" +#include "c-lib/inc/tbl-util.h" +#include "c-lib/inc/tbl-enc.h" +#include "c-lib/inc/tbl-dec.h" +#include "c-lib/inc/tbl-print.h" +#include "c-lib/inc/tbl-free.h" /* * TblError (char *str) - configure error handler From patchwork Tue Jan 3 22:25:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [esnacc-dev,RFC,4/5] cxx-lib: Rename all of the include directories X-Patchwork-Submitter: Aaron Conole X-Patchwork-Id: 4 X-Patchwork-Delegate: aconole@bytheb.org Message-Id: <1483482316-10045-5-git-send-email-aconole@bytheb.org> To: dev@lists.esnacc.org Date: Tue, 3 Jan 2017 17:25:15 -0500 From: Aaron Conole List-Id: eSNACC Development discussion The c++ library includes all point to the cxx-lib/inc/ directory, now. This will facilitate moving away from having custom pkgconfig CCFLAGS for the include directories. Signed-off-by: Aaron Conole --- cxx-lib/inc/asn-incl.h | 16 ++++++++-------- cxx-lib/inc/asn-iomanip.h | 2 +- cxx-lib/inc/asn-listset.h | 2 +- cxx-lib/inc/snaccexcept.h | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cxx-lib/inc/asn-incl.h b/cxx-lib/inc/asn-incl.h index 5ec988c..00df67c 100644 --- a/cxx-lib/inc/asn-incl.h +++ b/cxx-lib/inc/asn-incl.h @@ -8,9 +8,9 @@ #define SNACC_CXX_ASN_INCL_H -#include "asn-config.h" -#include "asn-buf.h" -#include "snaccexcept.h" +#include "cxx-lib/inc/asn-config.h" +#include "cxx-lib/inc/asn-buf.h" +#include "cxx-lib/inc/snaccexcept.h" #ifdef WIN32 #if defined(_MSC_VER) @@ -24,7 +24,7 @@ #else // WIN32 #include #include - #include "asn-chartraits.h" + #include "cxx-lib/inc/asn-chartraits.h" #if defined(SunOS) || defined(SCO_SV) || defined(HPUX) || defined(HPUX32) namespace std @@ -41,7 +41,7 @@ #endif #if META -#include "meta.h" +#include "cxx-lib/inc/meta.h" #endif void SNACCDLL_API BDEC_2ND_EOC_OCTET(const SNACC::AsnBuf& b, @@ -1447,8 +1447,8 @@ enum SNACCEncodeDecodeRules { _END_SNACC_NAMESPACE -#include "asn-iomanip.h" -#include "snaccexcept.h" -#include "asn-usefultypes.h" +#include "cxx-lib/inc/asn-iomanip.h" +#include "cxx-lib/inc/snaccexcept.h" +#include "cxx-lib/inc/asn-usefultypes.h" #endif diff --git a/cxx-lib/inc/asn-iomanip.h b/cxx-lib/inc/asn-iomanip.h index 4338844..5a4bfae 100644 --- a/cxx-lib/inc/asn-iomanip.h +++ b/cxx-lib/inc/asn-iomanip.h @@ -1,7 +1,7 @@ #ifndef __ASN_IOMANIP_H__ #define __ASN_IOMANIP_H__ -#include "asn-config.h" +#include "cxx-lib/inc/asn-config.h" #include _BEGIN_SNACC_NAMESPACE diff --git a/cxx-lib/inc/asn-listset.h b/cxx-lib/inc/asn-listset.h index 96adc6c..cad72b4 100644 --- a/cxx-lib/inc/asn-listset.h +++ b/cxx-lib/inc/asn-listset.h @@ -8,7 +8,7 @@ #ifndef SNACC_ASN_LISTSET_H #define SNACC_ASN_LISTSET_H -#include "snacc.h" +#include "cxx-lib/inc/snacc.h" #ifdef _MSC_VER #pragma warning(disable: 4786) // Disable symbols truncated warning diff --git a/cxx-lib/inc/snaccexcept.h b/cxx-lib/inc/snaccexcept.h index 57b4f84..5054e14 100644 --- a/cxx-lib/inc/snaccexcept.h +++ b/cxx-lib/inc/snaccexcept.h @@ -16,7 +16,7 @@ #include #endif -#include "asn-config.h" +#include "cxx-lib/inc/asn-config.h" #define STACK_DEPTH 20 From patchwork Tue Jan 3 22:25:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [esnacc-dev,RFC,5/5] doc/developer-guide-sample-app: Update compile line X-Patchwork-Submitter: Aaron Conole X-Patchwork-Id: 5 X-Patchwork-Delegate: aconole@bytheb.org Message-Id: <1483482316-10045-6-git-send-email-aconole@bytheb.org> To: dev@lists.esnacc.org Date: Tue, 3 Jan 2017 17:25:16 -0500 From: Aaron Conole List-Id: eSNACC Development discussion The developer guide for C++ includes a now superfluous reference to the cxx-lib include directory. With a prior change, if the esnacc library is installed in a standard prefix (aka `/usr`), there is no longer a need to spell out the includes, so remove it. Signed-off-by: Aaron Conole --- doc/developer-guide-sample-app.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/developer-guide-sample-app.md b/doc/developer-guide-sample-app.md index 8e69b15..9249fc5 100644 --- a/doc/developer-guide-sample-app.md +++ b/doc/developer-guide-sample-app.md @@ -480,7 +480,7 @@ Wrapping each of the C++ code sections above in a single file called We can compile this with the following simple command: `g++ -std=c++0x -o test discovery.cpp NodeDiscovery.cpp - -I. -I/usr/include/cxx-lib/inc -lcxxasn1 -pthread -lrt` + -I. -lcxxasn1 -pthread -lrt` That will generate the *test* binary, which can be executed on our host machine. It is important not to run this in production - after all it is meant