dtinfo subtree dtinfogen
authorUlrich Wilkens <mail@uwilkens.de>
Sun, 14 Oct 2012 15:13:07 +0000 (17:13 +0200)
committerJon Trulson <jon@radscan.com>
Mon, 15 Oct 2012 23:58:44 +0000 (17:58 -0600)
45 files changed:
cde/programs/dtinfo/dtinfogen/Imakefile
cde/programs/dtinfo/dtinfogen/infolib/Imakefile
cde/programs/dtinfo/dtinfogen/infolib/etc/AttributeList.C
cde/programs/dtinfo/dtinfogen/infolib/etc/AttributeRec.C
cde/programs/dtinfo/dtinfogen/infolib/etc/AttributeStore.C
cde/programs/dtinfo/dtinfogen/infolib/etc/AusTextStorage.C
cde/programs/dtinfo/dtinfogen/infolib/etc/BookTasks.C
cde/programs/dtinfo/dtinfogen/infolib/etc/ContentType.C
cde/programs/dtinfo/dtinfogen/infolib/etc/DataBase.C
cde/programs/dtinfo/dtinfogen/infolib/etc/DataRepository.C
cde/programs/dtinfo/dtinfogen/infolib/etc/FlexBuffer.C
cde/programs/dtinfo/dtinfogen/infolib/etc/FlexBuffer.h
cde/programs/dtinfo/dtinfogen/infolib/etc/GraphicsTask.C
cde/programs/dtinfo/dtinfogen/infolib/etc/Handler.h
cde/programs/dtinfo/dtinfogen/infolib/etc/Imakefile
cde/programs/dtinfo/dtinfogen/infolib/etc/MixedGen.C
cde/programs/dtinfo/dtinfogen/infolib/etc/NCFGen.C
cde/programs/dtinfo/dtinfogen/infolib/etc/NodeData.C
cde/programs/dtinfo/dtinfogen/infolib/etc/NodeParser.C
cde/programs/dtinfo/dtinfogen/infolib/etc/NodeTask.C
cde/programs/dtinfo/dtinfogen/infolib/etc/OL_DataExpr.C
cde/programs/dtinfo/dtinfogen/infolib/etc/RemoteId.C
cde/programs/dtinfo/dtinfogen/infolib/etc/ReplaceIdIdref.C
cde/programs/dtinfo/dtinfogen/infolib/etc/SGMLName.C
cde/programs/dtinfo/dtinfogen/infolib/etc/SearchPath.C
cde/programs/dtinfo/dtinfogen/infolib/etc/SearchStorage.C
cde/programs/dtinfo/dtinfogen/infolib/etc/StyleUpdate.C
cde/programs/dtinfo/dtinfogen/infolib/etc/StyleValidate.C
cde/programs/dtinfo/dtinfogen/infolib/etc/TKTemplate.C
cde/programs/dtinfo/dtinfogen/infolib/etc/Token.C
cde/programs/dtinfo/dtinfogen/infolib/etc/Token.h
cde/programs/dtinfo/dtinfogen/infolib/etc/dtinfogen
cde/programs/dtinfo/dtinfogen/infolib/etc/dtinfogen_worker.c
cde/programs/dtinfo/dtinfogen/infolib/etc/gr_type.C
cde/programs/dtinfo/dtinfogen/infolib/etc/lex.C
cde/programs/dtinfo/dtinfogen/infolib/etc/lex.l
cde/programs/dtinfo/dtinfogen/install/Imakefile
cde/programs/dtinfo/dtinfogen/install/valBase.C
cde/programs/dtinfo/dtinfogen/mmdb/Imakefile
cde/programs/dtinfo/dtinfogen/mmdb/StyleSheet/Imakefile
cde/programs/dtinfo/dtinfogen/mmdb/StyleSheet/validator.C
cde/programs/dtinfo/dtinfogen/mmdb/src/Imakefile
cde/programs/dtinfo/dtinfogen/mmdb/src/main.C
cde/programs/dtinfo/dtinfogen/mmdb/src/main_c_api.c
cde/programs/dtinfo/dtinfogen/mmdb/src/restore.C

index 8c0acb6d582ae6bbff04a77023e6bea2a6af6911..ae75ef78d3ec9c4628f05b309a5c07ac2b8b223c 100644 (file)
@@ -5,6 +5,17 @@ XCOMM $TOG: Imakefile /main/12 1998/08/10 15:54:48 mgreess $
 
 SUBDIRS=mmdb infolib install
 
+XCOMM redefine TopLevelProject to build DtInfo with standard CDE config dir
+#undef  TopLevelProject
+#define TopLevelProject                DtInfo
+IMAKE_DEFINES = -DTopLevelProject=TopLevelProject \
+               -DProjectTmplFile='<DtInfo.tmpl>' \
+               -DProjectRulesFile='<DtInfo.rules>'
+
+XCOMM Variables to switch on debug mode temporarily
+XCOMM CDEBUGFLAGS = -g -DDEBUG
+XCOMM CXXDEBUGFLAGS = -g -DDEBUG
+
 MakeSubdirs($(SUBDIRS))
 DependSubdirs($(SUBDIRS))
 NamedTargetSubdirs(install_buildtools,$(SUBDIRS),\
index 199798f8861ebee4a2720b8be61ac203b2b95ce2..b3fa65b24db2047328e113b1608819d6e483947e 100644 (file)
@@ -7,6 +7,17 @@ SUBDIRS=etc C.ISO-8859-1 ja_JP.EUC-JP
 
 LinkFile(C,C.ISO-8859-1)
 
+XCOMM redefine TopLevelProject to build DtInfo with standard CDE config dir
+#undef  TopLevelProject
+#define TopLevelProject                DtInfo
+IMAKE_DEFINES = -DTopLevelProject=TopLevelProject \
+               -DProjectTmplFile='<DtInfo.tmpl>' \
+               -DProjectRulesFile='<DtInfo.rules>'
+
+XCOMM Variables to switch on debug mode temporarily
+XCOMM CDEBUGFLAGS = -g -DDEBUG
+XCOMM CXXDEBUGFLAGS = -g -DDEBUG
+
 MakeSubdirs($(SUBDIRS))
 DependSubdirs($(SUBDIRS))
 NamedTargetSubdirs(install_buildtools,$(SUBDIRS),\
index 732e3a2f38db483b9a337d8ff716fc416c37d307..3bc2cb16e1698ec3c8af38065084bd0bf76b83c4 100644 (file)
@@ -34,7 +34,8 @@
  #include <stdio.h>
  #include <string.h>
  #include <stdlib.h>
- #include <iostream.h>
+ #include <iostream>
+using namespace std;
  #include <assert.h>
 
  #include "AttributeRec.h"
index 4478baad79edcfbd7bec669140547905b2c45725..b7851552c8dcca42a5b27fcf8a03a3c9c8190df7 100644 (file)
@@ -23,7 +23,8 @@
 /* $XConsortium: AttributeRec.cc /main/4 1996/07/18 16:08:22 drk $ */
 #include <string.h>
 #include <stdlib.h>
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 #include <assert.h>
 
 #include "SGMLDefn.h"
index 4c149288b95299fd432dc0fdbc127fa61b28a358..245f4d62298106fac9a55d6137991ca03bd21b26 100644 (file)
@@ -25,7 +25,8 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 
 #include "List.h"
 #include "AttributeRec.h"
index 13467440e8a3a2ddbcea3c079cd88cf236d4363d..bedb406fef5e7b412e1d1f2649f5dc837c6d3db1 100644 (file)
@@ -37,7 +37,8 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <assert.h>
-#include <stream.h>
+#include <sstream>
+using namespace std;
 
 /* imported interfaces */
 #include <misc/unique_id.h>
@@ -45,6 +46,7 @@
 #include "Task.h"
 #include "DataBase.h"
 #include "DataRepository.h"
+#include "api/utility.h"
 
 /* exported interfaces */
 #include "AusTextStorage.h"
@@ -297,7 +299,7 @@ AusTextStore::insert( const char *BookShortTitle,
          // The following was unique, but there is a limit to the size of
          // the key, so let's just use a simple counter.
 //       fprintf(afp, "%s%s%s\n", store->get_zone_name(pos), BookID, SectionID);
-         fprintf(afp, "%s%d\n", store->get_zone_name(pos), f_recordcount);
+         fprintf(afp, "%s%d\n", store->get_zone_name(pos), (int)f_recordcount);
 
          fprintf(afp, "0/0/0~0:0\n"); // null date
 
index 8fdeab976b90d957f30f61f82a811793c52268d3..d6a18d4e7a2fadefed54f2acea520bbc451c00f4 100644 (file)
@@ -32,7 +32,8 @@
  */
 
 
-#include <stream.h>
+#include <sstream>
+using namespace std;
 
 /* import... */
 #include <assert.h>
@@ -46,6 +47,7 @@
 #include "OL-Data.h"
 #include "StringList.h"
 #include "StyleTask.h"
+#include "api/utility.h"
 
 /* export... */
 #include "BookTasks.h"
index dd2809e4f25dee60327190eaf0b54dbcc5d8b72c..b0b81eabd99c16acaf956354efc6c4ea920fba51 100644 (file)
@@ -54,7 +54,7 @@
 
 #include <stdlib.h>
 
-#if !defined(__osf__) && !defined(USL)
+#if !defined(__osf__) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED)
 #include <osfcn.h>
 #endif
 
@@ -201,8 +201,9 @@ typedef struct ol_data_buffer_state *ol_data_BUFFER_STATE;
 
 #define ol_data_CHAR unsigned char
 #define INITIAL 0
-#include <iostream.h>
-#include <stream.h>  
+#include <iostream>
+#include <sstream>
+using namespace std;
 #include <stdio.h>
 #include <memory.h>
 #include <string.h>
@@ -217,6 +218,7 @@ typedef struct ol_data_buffer_state *ol_data_BUFFER_STATE;
 #include "Expression.h"
 #include "OL_DataExpr.tab.h"
 #include "ContentType.h"
+#include "api/utility.h"
   
 /* CurrentContentPtr is used as the communication media between
  * ol_dataparse and ContentType::Parse()
index c99a9137a2cfb70fe4dc93cb96b8415d27116fa1..00f01c8ed5a3564cd82f02acc8adbc3343342248 100644 (file)
@@ -477,6 +477,7 @@ void DBCursor::int_field(FILE *fp, int *out)
 void DBCursor::short_list(FILE *fp, int *qout, int ltype, void *out)
 {
   int c;
+  int ret;
       
   c = fgetc(fp);
   FRIENDLY_ASSERT(c == '#');
@@ -498,7 +499,7 @@ void DBCursor::short_list(FILE *fp, int *qout, int ltype, void *out)
        int ftype;
        
        ungetc(c, fp);
-       fscanf(fp, "%d\n", &ftype);
+       ret = fscanf(fp, "%d\n", &ftype);
        FRIENDLY_ASSERT(ftype == STRING_CODE);
        
        string_field(fp, &item, NULL);
index d1e4a6a3c4603ac559384c7743cda201650e1751..de929d86e4d779c64d21562f16485e5df7dfa4af 100644 (file)
@@ -33,7 +33,7 @@
 
 
 //-------------Initializer for the zone_name mapping ----------------  
-static char *zone_name[] = {
+static const char *zone_name[] = {
   "D",
   "H",
   "G",
index f1ef222d4c318493d6a842a792e958e6883b0665..22c063400417783cf69e543200d4e57874aeaf55 100644 (file)
@@ -22,7 +22,8 @@
  */
 /* $XConsortium: FlexBuffer.cc /main/2 1996/07/18 16:13:49 drk $ */
 
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 #include <memory.h>
 #include <string.h>
 #include "FlexBuffer.h"
index 119bbcc2e8288e05ae0e1b901f7709857b536537..d972b0f9089614eab0f61c71f737d16639693b38 100644 (file)
@@ -25,7 +25,8 @@
 #define FLEX_BFR_HDR
 
 #include <stddef.h>
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 
 class FlexBuffer {
   
index c8c4f34cd151cf61a004282f10bb5f7e97e0494a..689a790bd8832ceac9cb301685bc0ccc8330c9e1 100644 (file)
@@ -22,8 +22,9 @@
  */
 /* $XConsortium: GraphicsTask.cc /main/8 1996/08/14 16:59:38 rcs $ */
 #include <assert.h>
-#include <stream.h>
-#include <iostream.h>
+#include <sstream>
+#include <iostream>
+using namespace std;
 
 #include <sys/types.h>
 #include <netinet/in.h>
index 60d66d2f9d091246cda05ed46f38c7179b799e67..da98c2373366f747b142d137224482aa8c36d31d 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef __HandlerH__
 #define __HandlerH__
 
-#include <new.h>
+#include <new>
 extern void FreeStoreException();
 
 #endif
index 97adf2439e09fbf5e4e344b9e2c6aca63bbe9e0e..29ec75fbaa1cea1ebfd36d7696a7d72786d0262d 100644 (file)
@@ -1,6 +1,9 @@
 XCOMM $TOG: Imakefile /main/27 1997/09/05 11:29:30 samborn $
 
-DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
+CXXEXTRA_INCLUDES = -DEXPAND_TEMPLATES
+
+NormalCplusplusObjectRule()
 
 #ifdef RegenParserFiles
 XCOMM lex flags
@@ -287,6 +290,13 @@ SimpleCPlusPlusProgram(NodeParser, NodeParser.o libOLAFParse.a libOLAFParseT.a,$
 SimpleCPlusPlusProgram(NCFGen, NCFGen.o libOLAFParse.a libOLAFParseT.a,$(Libs) $(DTSVCLIB) $(TTLIB))
 SimpleCPlusPlusProgram(MixedGen, MixedGen.o RemoteId.o libOLAFParse.a libOLAFParseT.a,$(Libs) $(DTSVCLIB) $(TTLIB))
 SimpleCPlusPlusProgram(StyleUpdate, StyleUpdate.o libOLAFParse.a libOLAFParseT.a,$(Libs) $(DTSVCLIB) $(TTLIB))
+#elif defined(LinuxArchitecture) || defined(FreeBSDArchitecture) || defined(OpenBSDArchitecture)
+TEMPLATE_OBJS = TKTemplate.o
+RealLibrary(OLAFParse,$(OBJS),$(LIBDIR))
+SimpleCPlusPlusProgram(NodeParser, NodeParser.o $(TEMPLATE_OBJS) libOLAFParse.a,$(Libs))
+SimpleCPlusPlusProgram(NCFGen, NCFGen.o $(TEMPLATE_OBJS) libOLAFParse.a,$(Libs) $(DTSVCLIB) $(MTF_LIBRARIES) $(TTLIB))
+SimpleCPlusPlusProgram(MixedGen, MixedGen.o RemoteId.o $(TEMPLATE_OBJS) libOLAFParse.a,$(Libs) $(DTSVCLIB) $(MTF_LIBRARIES) $(TTLIB))
+SimpleCPlusPlusProgram(StyleUpdate, StyleUpdate.o $(TEMPLATE_OBJS) libOLAFParse.a,$(Libs) $(DTSVCLIB) $(MTF_LIBRARIES) $(TTLIB))
 #else
 TEMPLATE_OBJS = TKTemplate.o
 RealLibrary(OLAFParse,$(OBJS),$(LIBDIR))
index 8508377c1f672208b276152f21b90b408e4f2bcd..e51766a6b0aca9e79869d7bb15f6e1da8600b5be 100644 (file)
@@ -569,7 +569,8 @@ writeDLP(BookCaseDB &db, info_lib *mmdb,
 char *
 getGI( char * bufptr )
 {
-  for (char * cptr = bufptr; *cptr != '>'; cptr++) {
+  char* cptr;
+  for (cptr = bufptr; *cptr != '>'; cptr++) {
   }
   *cptr = '\0';
   char * retval = strdup(bufptr);
@@ -811,11 +812,11 @@ writeBooks(BookCaseDB& db,
   DBCursor *GraphicsCursorPtr;
   
   int process_graphics = 1;
-  try {
+  mtry {
     DBTable *graphics = db.table(BookCaseDB::Graphics, DB::READ);
     GraphicsCursorPtr = new DBCursor( *graphics );
   }
-  catch (PosixError&, p){
+  mcatch (PosixError&, p){
     /* error opening graphics stuff... skip graphics */
 
     process_graphics = 0;
@@ -876,7 +877,7 @@ writeLCF(BookCaseDB& db, info_lib *mmdb,
     const char *opaque, *nodeloc;
     char* reflabel;
     nodeloc = opaque = (const char *)loc_val->get_value();
-    reflabel = strchr(opaque, '\t');
+    reflabel = strchr((char*)opaque, '\t');
     *reflabel++ = 0;
     
     const char *nodeOID = to_oid(mmdb, bcname, nodeloc);
@@ -959,7 +960,7 @@ main(int argc, char **argv)
     char *bookcaseDir = argv[0];
     char *infobaseDir = argv[1];
     
-    try{
+    mtry{
       BookCaseDB db(bookcaseDir);
 
       const char *infolibDir;
@@ -979,7 +980,7 @@ main(int argc, char **argv)
             comp_agent[i] = 0;
         }
 
-       ostrstream str_buf( comp_agent, COMPRESSED_AGENT_SIZE );
+       ostringstream str_buf( comp_agent );
 
        info_base *bcptr = mmdb->get_info_base(bcname);
        handler *x = 
@@ -1004,11 +1005,11 @@ main(int argc, char **argv)
       ret = 0;
 
     }
-    catch(PosixError&, pe){
+    mcatch(PosixError&, pe){
       fprintf(stderr, "%s: error on %s: %s\n",
              progname, bookcaseDir, pe.msg());
     }
-    catch(Unexpected&, pe) {
+    mcatch(Unexpected&, pe) {
       fprintf(stderr, "(ERROR) %s\n\n", pe.msg() );
       exit(1);
     }end_try;
index ff90045e54553e03ce45c755b463693ac9a0e4eb..2ebd4e4c6f5398096182590b04eb8fc72ce8342f 100644 (file)
@@ -27,7 +27,8 @@
 #if !defined(__uxp__) && !defined(USL)
 #include <strings.h>
 #endif
-#include <strstream.h>
+#include <sstream>
+using namespace std;
 
 #include "Exceptions.hh"
 #include "DataBase.h"
@@ -150,7 +151,7 @@ buildNCF(BookCaseDB& db, const char *base_name, int compressed)
         comp_agent[i] = 0;
     }
 
-    ostrstream str_buf( comp_agent,COMPRESSED_AGENT_SIZE);
+    ostringstream str_buf( comp_agent );
     handler *x = (base_ptr->get_obj_dict()).get_handler(
       form("%s.%s", base_name, "sgml.dict"));
     x->its_oid().asciiOut(str_buf);
@@ -195,10 +196,8 @@ buildNCF(BookCaseDB& db, const char *base_name, int compressed)
       }
 
       stylesheet_smart_ptr sheet(base_ptr, style);
-      char oid_buf[BUFSIZE];
-      ostrstream strout(oid_buf,BUFSIZE,ios::out);
+      ostringstream strout;
       sheet.its_oid().asciiOut(strout);
-      oid_buf[strout.pcount()] = NULL;
 
       ncf->insert(STRING_CODE, nodeLocator,
                  STRING_CODE, title,
@@ -206,7 +205,7 @@ buildNCF(BookCaseDB& db, const char *base_name, int compressed)
                  COMPRESSED_STRING_CODE, comp_agent, "",
                  STRING_CODE, bookLocator,
                  OID_CODE, "0.0", /* pointer to Book/CCF/DOC object */
-                 OID_CODE, oid_buf,
+                 OID_CODE, (char *)strout.str().c_str(),
                  NULL);
     }
 
@@ -252,10 +251,8 @@ buildNCF(BookCaseDB& db, const char *base_name, int compressed)
       
       
       stylesheet_smart_ptr sheet(base_ptr, style);
-      char oid_buf[BUFSIZE];
-      ostrstream strout(oid_buf,BUFSIZE,ios::out);
+      ostringstream strout;
       sheet.its_oid().asciiOut(strout);
-      oid_buf[strout.pcount()] = NULL;
       
       ncf->insert(STRING_CODE, nodeLocator,
                  STRING_CODE, title,
@@ -263,7 +260,7 @@ buildNCF(BookCaseDB& db, const char *base_name, int compressed)
                  STRING_CODE, "",
                  STRING_CODE, bookLocator,
                  OID_CODE, "0.0", /* pointer to Book/CCF/DOC object */
-                 OID_CODE, oid_buf,
+                 OID_CODE, (char *)strout.str().c_str(),
                  NULL);
     }
     
@@ -327,7 +324,7 @@ main(int argc, char **argv)
     const char *base_name = argv[0];
     const char *bookcaseDir = argv[1];
 
-    try{
+    mtry{
       BookCaseDB db(bookcaseDir);
 
       if ( load_style_only ) {
@@ -339,20 +336,20 @@ main(int argc, char **argv)
       ret = 0;
     }
 
-    catch(PosixError&, pe){
+    mcatch(PosixError&, pe){
       fprintf(stderr, "%s: error on %s: %s\n",
              progname, bookcaseDir, pe.msg());
     }
 
-    catch(Unexpected&, pe) {
+    mcatch(Unexpected&, pe) {
       fprintf(stderr, "(ERROR) %s\n\n", pe.msg() );
     }
     
-    catch(mmdbException&, e) {
+    mcatch(mmdbException&, e) {
       cerr << e;
     }
     
-    catch_any() {
+    mcatch_any() {
       fprintf(stderr, "*** Internal Error ***: unexpected exception\n");
       abort();
     }end_try;
index b60cfc47a1d6b120c4b4cfdf9c05b79880172c31..e7249732e9db19ba5d2b353e97ff81d7c8e0459d 100644 (file)
@@ -35,8 +35,9 @@
 #include "NodeData.h"
   
 /* imported interfaces... */
-#include <iostream.h>
-#include <stream.h>
+#include <iostream>
+#include <sstream>
+using namespace std;
 #include <stdlib.h>
 #include <stdio.h>
 #include <assert.h>
@@ -54,6 +55,7 @@
 #include "BookCaseDB.h"
 #include "GraphicsTask.h"
 #include "Dispatch.h"  
+#include "api/utility.h"
 #ifdef UseQSearch
 #include "QSearch.h"
 #else
index ef807408bdedcd4cc8c29fab5348bd70ad3d9556..4356d3d3d94c459df05b3926b67918b040beeade 100644 (file)
@@ -93,32 +93,32 @@ int main(int argc, char **argv)
 
     Dispatch::setRoot(t, istack);
 
-    try{
+    mtry{
       extern int yylex();
       
       yylex();
 
       ret = 0;
     }
-    catch(Unexpected&, u)
+    mcatch(Unexpected&, u)
       {
-       try {
+       mtry {
          Dispatch::tok->reportError(Token::User, Token::Fatal,
                                     "markup error: %s", u.msg());
        }
-       catch(ErrorReported&, e)
+       mcatch(ErrorReported&, e)
          {
            if ( e.f_severity == Token::Fatal ) {
              exit(1);
            }
          }end_try;
       }
-    catch(PosixError&, pe)
+    mcatch(PosixError&, pe)
       {
        fprintf(stderr, "(ERROR) %s\n", pe.msg() );
        exit(1);
       }
-    catch(ErrorReported&, e)
+    mcatch(ErrorReported&, e)
       {
        if ( e.f_severity == Token::Fatal ) {
          exit(1);
index 9febbbdfeda9dfbdd7cdb93ae028aeaf2a4c34cd..08323e4800ee7837a8c9c3c3938dde219f278549 100644 (file)
@@ -23,7 +23,8 @@
 /* $XConsortium: NodeTask.C /main/6 1996/10/26 18:18:31 cde-hal $ */
 /* $Id */
 
-#include <stream.h>
+#include <sstream>
+using namespace std;
 
 /* exported interfaces... */
 #include "NodeTask.h"
@@ -42,6 +43,7 @@
 #include "OL-Data.h"
 #include "NodeData.h"
 #include "StyleTask.h"
+#include "api/utility.h"
 
 #ifdef FISH_DEBUG
 #include "dbug.h" /* Fred Fish's dbug.h */
index 1d74df113ce9f0e08c0a859eb2b363d5e562b5b8..c38c86f6c9b29305bdd76d4ed758f0d928a43c8d 100644 (file)
@@ -228,14 +228,16 @@ ol_dataloop:
         goto ol_datareduce;
     }
     if (ol_dataerrflag) goto ol_datainrecovery;
-#if 0                                  // Disable for now
+// Disable for now
+#if 0
 #ifdef lint
     goto ol_datanewerror;
 #endif
 ol_datanewerror:
 #endif /* 0 */
-    ol_dataerror("syntax error");
-#if 0                                  // Disable for now
+    ol_dataerror((char*)"syntax error");
+// Disable for now
+#if 0
 #ifdef lint
     goto ol_dataerrlab;
 #endif
@@ -424,7 +426,7 @@ to state %d\n", *ol_datassp, ol_datastate);
     *++ol_datavsp = ol_dataval;
     goto ol_dataloop;
 ol_dataoverflow:
-    ol_dataerror("yacc stack overflow");
+    ol_dataerror((char*)"yacc stack overflow");
 ol_dataabort:
     return (1);
 ol_dataaccept:
index bcfb0c44f27f80eae1f0fce723b80196a3e80e86..f5f892c731ff98af08141fae68762fb187aa9672 100644 (file)
@@ -53,7 +53,7 @@
 
 #include <stdlib.h>
 
-#if !defined(__osf__) && !defined(USL)
+#if !defined(__osf__) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED)
 # include <osfcn.h>
 #endif
 
index 79a83d5aacdb28d90518c495b2f3199e38fb7ad8..1ab488798c20c698b25b021e7a40237c21309eef 100644 (file)
@@ -43,7 +43,7 @@
 
 #include <stdlib.h>
 
-#if !defined(__osf__) && !defined(USL)
+#if !defined(__osf__) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED)
 #include <osfcn.h>
 #endif
 
@@ -195,8 +195,9 @@ typedef struct nodedata_buffer_state *nodedata_BUFFER_STATE;
 #include "NodeData.h"
   
 /* imported interfaces... */
-#include <iostream.h>
-#include <stream.h>
+#include <iostream>
+#include <sstream>
+using namespace std;
 #include <stdlib.h>
 #include <stdio.h>
 #include <assert.h>
@@ -214,6 +215,7 @@ typedef struct nodedata_buffer_state *nodedata_BUFFER_STATE;
 #include "BookCaseDB.h"
 #include "GraphicsTask.h"
 #include "Dispatch.h"  
+#include "api/utility.h"
 
 // Debugging macro
 #ifdef DEBUG
index 86adbf047784c931fb63ee0939b5daf8a14adf0a..e8f9af49c75ba10524242a8dab6a61769e8196b9 100644 (file)
@@ -114,6 +114,8 @@ StringToInt::StringToInt()
   total = used = 0;
 }
 
+
+int
 StringToInt::intern(const char *name)
 {
   int indx;
index fd04929c29cc30b2a458ce22c5dc2f04ec7d009c..47644d9303d342662d51f5920170c52a229ffcb5 100644 (file)
 #endif
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <stream.h>
+#include <sstream>
+using namespace std;
 
 #include "Exceptions.hh"
 #include "Task.h"
+#include "api/utility.h"
 
 /* exported interface */
 #include "SearchPath.h"
@@ -147,9 +149,6 @@ SearchPath::get_real_path( const char *file_name )
       fclose( fp );
       return ( full_path_name );
     }
-
-    fclose( fp );
-    
   }
 
   return NULL;
index 57fce88c5758e4ea678eba45335a161834d8497e..7ad7def038c44d8eec2ccfd046b3057a627f6b6c 100644 (file)
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <assert.h>
-#include <stream.h>
+#include <sstream>
+using namespace std;
 
 /* imported interfaces */
 #include <misc/unique_id.h>
 #include "FlexBuffer.h"
 #include "Task.h"
 #include "DataBase.h"
+#include "api/utility.h"
 
 /* exported interfaces */
 #include "SearchStorage.h"
index ec77ca7a9b1dfc7db4fffe52a3f1d7c70f045750..08eda63525a435d11b8ec49b3ac085e4cac8c7c6 100644 (file)
@@ -23,7 +23,8 @@
 /* $XConsortium: StyleUpdate.C /main/7 1996/08/21 15:47:33 drk $ */
 
 #include <stdio.h>
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 
 
 #include "Exceptions.hh"
@@ -79,8 +80,8 @@ int main(int argc, char **argv)
 
     Dispatch::setRoot(styleTask, istack);
 
-    try{
-      try{
+    mtry{
+      mtry{
        extern int yylex();
       
        yylex();
@@ -112,21 +113,21 @@ int main(int argc, char **argv)
 
        ret = 0;
 
-      }catch(Unexpected&, u){
+      }mcatch(Unexpected&, u){
        Dispatch::tok->reportError(Token::User, Token::Fatal,
                                   "markup error: %s", u.msg());
       }
-      catch(PosixError&, p){
+      mcatch(PosixError&, p){
        Token::signalError(Token::Internal, Token::Fatal, 0, 0,
                           "%s", p.msg() );
       }end_try;
        
-    }catch(ErrorReported&, e){
+    }mcatch(ErrorReported&, e){
       /* error is already reported. */
-    }catch(mmdbException&, e){
+    }mcatch(mmdbException&, e){
       cerr << e;
     }
-    catch_any() {
+    mcatch_any() {
       fprintf(stderr, "*** Internal Error ***: unexpected exception\n");
       abort();
     }end_try;
index 4ec17ab85e38c75a6dd3445fd9a6d3268f3c2fa4..cf6049070fde2b2def7300fff3b8fa7806eb705a 100644 (file)
  */
 /* $XConsortium: StyleValidate.cc /main/2 1996/07/18 16:18:13 drk $ */
 #include <stdio.h>
-#include <iostream.h>
-#include <stream.h>
+#include <iostream>
+#include <sstream>
+using namespace std;
 #include <unistd.h>
 #include <sys/wait.h>
 
 #include "DataBase.h"
 #include "StyleValidate.h"
+#include "api/utility.h"
 
 //---------------------------------------------------------------------
 int 
 validate_stylesheet( const char *buf, int buf_size, enum RENDERER_ENGINE_T t )
 {
 
-  char *styleFile = form( "/usr/tmp/style_sheet.%d", getpid() );
+  char *styleFile = form( "/tmp/style_sheet.%d", getpid() );
   
   FILE *fp = fopen( styleFile, "w" );
   if ( !fp ) {
@@ -49,10 +51,10 @@ validate_stylesheet( const char *buf, int buf_size, enum RENDERER_ENGINE_T t )
 
   switch ( t ) {
     case ONLINE:
-     renderer = "online";
+     renderer = (char*)"online";
      break;
     case PRINT:
-     renderer = "hardcopy";
+     renderer = (char*)"hardcopy";
      break;
     default:
      throw( PosixError(1, "Unknown renderer engine\n") );
index af4694ee94906febf34aa5bd98787ccbdbd9af69..4c08bc6866cec0bc7bacb7d7e7c7940c4dff99f2 100644 (file)
 #include "dti_cc/CC_Stack.h"
 #include "dti_cc/CC_Stack.C"
 #include "dti_cc/CC_Slist.h"
-#include "dti_cc/CC_Slist.C"
+// #include "dti_cc/CC_Slist.C"
 #include "dti_cc/cc_pvect.h"
-#include "dti_cc/cc_pvect.C"
+// #include "dti_cc/cc_pvect.C"
 #include "dti_cc/cc_hdict.h"
-#include "dti_cc/cc_hdict.C"
+// #include "dti_cc/cc_hdict.C"
 #include "BTCollectable.h"
 #include "DataRepository.h"
 #include "dti_cc/CC_String.h"
index d63101e99c47056cae425805479944f38eaba79a..4aa9ab38dba54b2b04a859c62d6793f35193ac90 100644 (file)
@@ -184,7 +184,7 @@ static void
 signalErrorVA(int src, int sev, const char *file, int line,
              const char *fmt, va_list ap)
 {
-  static char *srcMsg[] = { "Error", "**Internal Error**" };
+  static const char *srcMsg[] = { "Error", "**Internal Error**" };
 
   if(file){
     fprintf(stderr, "DtInfo Toolkit: %s at %s:%d: ", srcMsg[src], file, line);
index 44b66686b85f168dc68f8d023bebae8ce1e4b801..a64a0222baa99dd27e6baf9b92d3268d6c1828c0 100644 (file)
@@ -26,7 +26,8 @@
 #ifndef TOKEN_HEADER
 #define TOKEN_HEADER
 
-#include <strstream.h>
+#include <sstream>
+using namespace std;
 
 #include "Exceptions.hh"
 
index 4cd9fde657b1dbc3acfbef621689a92cacaf0844..369501ae3a0713c01afb18748dd4c29d29d5917a 100755 (executable)
@@ -1,5 +1,4 @@
 #!/bin/sh
-set -h
 
 ###############################################################################
 #
@@ -222,6 +221,14 @@ case "$OS" in
                ARCH=mips
        ;;
 
+       Linux*)
+               ARCH=i386
+       ;;
+
+       FreeBSD*)
+               ARCH=i386
+       ;;
+
        *)
                err_f "Does not run under [$OS]"
        ;;
index 0b4a6d8621f22ee3b71f91b4c5c48fe4bdcf6dfc..a6cb9597d22988019b45ccb179542a85cb1c9673 100644 (file)
@@ -181,7 +181,7 @@ t_entry langtbl[] =
   NULL,                        0,      NULL,           NULL,           NULL
 };
 
-static char *usageMsg = "USAGE:\n\
+static char *usageMsg1 = "USAGE:\n\
   " EXEC_NAME " -h\n\
   " EXEC_NAME " admin\n\
   " EXEC_NAME " build [-h] [-T <tmpdir>] [-m <catalog>] [-d <library description>]\n\
@@ -191,7 +191,9 @@ static char *usageMsg = "USAGE:\n\
   " EXEC_NAME " update [-h] [-m <catalog>] -l <library> -b <bookcase> <stylesheet>\n\
   " EXEC_NAME " validate [-h] [-T <tmpdir>] [-m <catalog>] <document>...\n\
 \n\
-options:\n\
+options:\n";
+
+static char *usageMsg2 = "\
     -T <tmpdir>          directory for intermediate processing files\n\
     -h                   help: show usage\n\
     -v                   verbose: more diagnostic output\n";
@@ -258,7 +260,8 @@ printUsage(char *preMsg, int exitCode)
     if (preMsg)
        fputs(preMsg, stderr);
 
-    fputs(usageMsg, stderr);
+    fputs(usageMsg1, stderr);
+    fputs(usageMsg2, stderr);
 
     exit(exitCode);
 }
@@ -526,12 +529,13 @@ makeWorkDir(void)
 static void
 removeWorkDir(void)
 {
+    int ret;
     char cmdBuf[MAXPATHLEN + 10];
 
     if (gStruct->workDir)
     {
        sprintf(cmdBuf, "rm -rf %s", gStruct->workDir);
-       system(cmdBuf);
+       ret = system(cmdBuf);
        XtFree(gStruct->workDir);
        gStruct->workDir = (char *)NULL;
     }
@@ -1422,6 +1426,8 @@ parseDocument(Boolean runCmd, ...)
 static void
 buildBookcase(char *cmdSrc, char *dirName)
 {
+    int ret1;
+    char *ret2;
     char *dataBase;
     char *tmpFile;
     char *newMmdbPathEnv;
@@ -1483,10 +1489,10 @@ buildBookcase(char *cmdSrc, char *dirName)
                        style_file, bookCaseName, bookCaseName);
       runShellCmd(cmd);
 
-      XtFree(style_file);
+      XtFree((char*)style_file);
 
       sprintf(cmd, "rm -f %s", style_file);
-      system(cmd);
+      ret1 = system(cmd);
     }
 
     sprintf(cmd, "NCFGen -compressed %s %s |\
@@ -1506,10 +1512,10 @@ buildBookcase(char *cmdSrc, char *dirName)
 
       runShellCmd(cmd);
 
-      XtFree(anonym_file);
+      XtFree((char*)anonym_file);
 
       sprintf(cmd, "rm -f %s", anonym_file);
-      system(cmd);
+      ret1 = system(cmd);
     }
 
     validateBookCase(bookCaseMap, bookCaseName);
@@ -1556,7 +1562,7 @@ buildBookcase(char *cmdSrc, char *dirName)
        }
 
        curDir[0] = '\0';
-       getcwd(curDir, MAXPATHLEN);
+       ret2 = getcwd(curDir, MAXPATHLEN);
        sprintf(newDir, "%s/%s", bookCaseDir, gStruct->searchEngine);
        if (chdir(newDir) != 0)
            dieRWD(-1, "%s: Cannot find %s: %s\n",
@@ -1678,6 +1684,7 @@ only 8 alphanumeric characters are allowed\n",
 static void
 validateBookCase(char *mapFile, char *bookCaseName)
 {
+    char *ret;
     FILE *fp;
     char lineBuf[MAXPATHLEN + 1];
     char cmdBuf[MAXPATHLEN + 1];
@@ -1687,7 +1694,7 @@ validateBookCase(char *mapFile, char *bookCaseName)
        dieRWD(-1, "%s: cannot open bookcase.map: %s\n",
               EXEC_NAME, strerror(errno));
 
-    fgets(lineBuf, MAXPATHLEN, fp); /* Skip first line. */
+    ret = fgets(lineBuf, MAXPATHLEN, fp); /* Skip first line. */
     while (fgets(lineBuf, MAXPATHLEN, fp) != (char *)NULL)
     {
        if ((bcName = strtok(lineBuf, "\t\n")) != (char *)NULL)
@@ -1709,6 +1716,7 @@ validateBookCase(char *mapFile, char *bookCaseName)
 static void
 editMapFile(char *bookCaseName, char *bookCaseMap)
 {
+    size_t ret;
     struct stat statBuf;
     FILE *fp;
     char *file;
@@ -1728,7 +1736,7 @@ editMapFile(char *bookCaseName, char *bookCaseMap)
               strerror(errno));
 
     file = XtMalloc((statBuf.st_size + 1) * sizeof(char));
-    fread(file, statBuf.st_size, sizeof(char), fp);
+    ret = fread(file, statBuf.st_size, sizeof(char), fp);
     if (file[statBuf.st_size - 1] == '\n')
        file[statBuf.st_size - 1] = '\0';
     else file[statBuf.st_size] = '\0';
index 06783abc777aaeaa06974d31b3ca15c8788155d6..e55fdb43770190a46937a1f9fb6374ce77d9dbe7 100644 (file)
@@ -54,7 +54,7 @@
 
 #include <stdlib.h>
 
-#if !defined(__osf__) && !defined(USL)
+#if !defined(__osf__) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED)
 # include <osfcn.h>
 #else
 # include <unistd.h>
@@ -205,9 +205,11 @@ typedef struct graphics_task_buffer_state *graphics_task_BUFFER_STATE;
 #define INITIAL 0
 
 #include <assert.h>
-#include <stream.h>
+#include <iostream>
+#include <sstream>
+using namespace std;
 
-#ifdef DEBUG
+#ifdef NODEBUG
 #include "oliasdb/olias_consts.h"
 GR_TYPE gtype;
 #else
@@ -2548,7 +2550,7 @@ FILE *file;
     }
 
 
-#ifndef DEBUG
+#ifndef NODEBUG
 void
 get_type()
 {
index 49863d54fb29ca3adad4940b6e9a1b1d6161efdd..d7d39e824b5e7963cfeffbe0fa6eec5083d5dfa6 100644 (file)
@@ -42,7 +42,7 @@
 #ifdef __cplusplus
 
 #include <stdlib.h>
-#if !defined(__osf__) && !defined(USL)
+#if !defined(__osf__) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED)
 #include <osfcn.h>
 #endif
 
@@ -190,15 +190,16 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #define YY_CHAR unsigned char
 #define INITIAL 0
 
-#if !defined(__osf__) && !defined(USL)
+#if !defined(__osf__) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED)
 #include <osfcn.h>
 #else
 #include <unistd.h>
 #endif
 
-#include <iostream.h>
+#include <iostream>
 #include <stdio.h>
-#include <stream.h>  
+#include <sstream>
+using namespace std;
 #include <string.h>
 
 #include "Exceptions.hh"
@@ -209,6 +210,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #include "AttributeList.h"  
 #include "FlexBuffer.h"
 #include "Token.h"
+#include "api/utility.h"
 
 static SGMLDefn *defn = new SGMLDefn();
 static FlexBuffer *DataBuffer = new FlexBuffer();
@@ -1845,7 +1847,7 @@ case 1:
                              type = SGMLName::intern(tstr);
 
                              if ( type != SGMLName::IMPLIED ){
-                              if(!value) value = "";
+                              if(!value) value = (char*)"";
                               Dispatch::tok->StoreAttribute( name, value, type);
                             }
                           }
index 275306c01bcb0e11328364fcd73c17259bae207c..a9cba57a76ca1bf486c898f12faaf4d77e0d5393 100644 (file)
@@ -1,7 +1,7 @@
 %{ /* -*- c++ -*- */
 /* $XConsortium: lex.l /main/5 1996/11/19 16:55:12 drk $ */
 
-#if !defined(__osf__) && !defined(USL)
+#if !defined(__osf__) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED)
 #include <osfcn.h>
 #else
 #include <unistd.h>
@@ -20,6 +20,7 @@
 #include "AttributeList.h"  
 #include "FlexBuffer.h"
 #include "Token.h"
+#include "api/utility.h"
 
 static SGMLDefn *defn = new SGMLDefn();
 static FlexBuffer *DataBuffer = new FlexBuffer();
index a582fc898a414cb1c01bea88deddeae6a422bd39..b89a575c498023d3f4825086ddf61be717181bb5 100644 (file)
@@ -25,10 +25,11 @@ XCOMM                  Campbell, CA  95008
 XCOMM 
 XCOMM 
 
-DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
 
-INCLUDES=$(GLOBAL_INCLUDES) $(MMDB_INCLUDES) $(EXCEPTIONS_INCLUDES)
+NormalCplusplusObjectRule()
 
+INCLUDES=$(GLOBAL_INCLUDES) $(MMDB_INCLUDES) $(EXCEPTIONS_INCLUDES)
 
 
  
@@ -205,6 +206,8 @@ ALL_MMDB_OBJS =     $(API_OBJS)             $(BTREE_OBJS) \
 
 #ifdef AIXArchitecture
 Libs=$(ALL_MMDB_OBJS) $(DTSVCLIB) $(TTLIB) $(MATH_LIB)
+#elif defined(LinuxArchitecture) || defined(FreeBSDArchitecture) || defined(OpenBSDArchitecture)
+Libs=$(MMDB_LIBS) $(DTSVCLIB) $(MTF_LIBRARIES) $(TTLIB) $(MATH_LIB)
 #else
 Libs=$(MMDB_LIBS) $(DTSVCLIB) $(TTLIB) $(MATH_LIB)
 #endif
index 2ed5472d3b07b848b1e05f8b1798b566d2e4caee..7f04e7d30d80f16ff5657551da0c36e30b3b9dc3 100644 (file)
@@ -47,7 +47,8 @@
  * 
  */
 
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 #include <assert.h>
 #include <string.h>
 #include <stdlib.h>
@@ -91,7 +92,7 @@ main(int argc, char **argv)
   
   dbgLevel = dbgInit();
 
-  try {
+  mtry {
     
    if ( argc < 2 ) {
      cerr << "Usage : valBase checkBase installBase\n";
@@ -167,7 +168,7 @@ main(int argc, char **argv)
 
    // Now to check locators
 
-   iterator *it = checkBase->first(LOCATOR_SET_NAME, LOCATOR_CODE );
+   Iterator *it = checkBase->first(LOCATOR_SET_NAME, LOCATOR_CODE );
 
    int DupLocFound=0;
    
@@ -204,7 +205,7 @@ main(int argc, char **argv)
    exit (0);
  } 
 
- catch ( mmdbException &, e )
mcatch ( mmdbException &, e )
  {
    debug(cerr, e );
    abort();
index 3496f40e4f7240f08c68030a7a07834af549fd59..48d326d00923819b3eb6ff269be4afa1990363c3 100644 (file)
@@ -5,6 +5,17 @@ XCOMM $TOG: Imakefile /main/7 1998/08/10 15:55:12 mgreess $
 
 SUBDIRS=src StyleSheet
 
+XCOMM redefine TopLevelProject to build DtInfo with standard CDE config dir
+#undef  TopLevelProject
+#define TopLevelProject                DtInfo
+IMAKE_DEFINES = -DTopLevelProject=TopLevelProject \
+               -DProjectTmplFile='<DtInfo.tmpl>' \
+               -DProjectRulesFile='<DtInfo.rules>'
+
+XCOMM Variables to switch on debug mode temporarily
+XCOMM CDEBUGFLAGS = -g -DDEBUG
+XCOMM CXXDEBUGFLAGS = -g -DDEBUG
+
 MakeSubdirs($(SUBDIRS))
 DependSubdirs($(SUBDIRS))
 NamedTargetSubdirs(install_buildtools,$(SUBDIRS),\
index 921ec47c8f5b4662bef1b9b134a8ec912fd989f1..bbb0c014bd01df09b776ee1ab52c03a4c5baa9d2 100644 (file)
@@ -1,6 +1,8 @@
 XCOMM $TOG: Imakefile /main/14 1997/09/05 11:32:36 samborn $
 
-DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
+
+NormalCplusplusObjectRule()
 
 INCLUDES=$(EXCEPTIONS_INCLUDES) $(COMMON_CLASS_INCLUDES)
 
index 95c84733e7ee378c33e0630982e2bdb37848fccd..4224726a09dc9d599c1ea4953a7220b776d6cbb8 100644 (file)
@@ -33,7 +33,8 @@
 #include "StyleSheet/FeatureDefDictionary.h"
 #include "StyleSheet/RendererHCV.h"
 #include "HardCopy/autoNumberFP.h"
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 #include <stdarg.h>
 
      
@@ -89,7 +90,7 @@ main(int argc, char** argv )
         quit(1);
   }
 
-  try {
+  mtry {
 
      if ( strcasecmp(argv[1], "hardcopy") == 0 )
         gRenderer = new RendererHCV();
@@ -133,14 +134,14 @@ main(int argc, char** argv )
      *defStream >> *g_FeatureDefDictionary;
 //cerr << *g_FeatureDefDictionary;
   }
-  catch_any()
+  mcatch_any()
   {
       cerr << "\nfeature definition has error.\n";
       quit(1);
   }
   end_try;
 
-  try {
+  mtry {
 
      fstream* styleStream = new fstream(argv[2], ios::in);
      if ( !(*styleStream) ) {
@@ -166,7 +167,7 @@ main(int argc, char** argv )
 
   }
 
-  catch_any()
+  mcatch_any()
   {
       report_error_location(); 
       quit(1);
index 03489ff58e536643951dff5d340c1618193d8349..5f7ad2bda9165f48529e8778c286860c4592485c 100644 (file)
@@ -1,6 +1,6 @@
 XCOMM $TOG: Imakefile /main/11 1997/12/31 09:07:38 bill $
 
-DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
 
 NormalLibraryObjectRule()
 
@@ -181,16 +181,22 @@ ALL_MMDB_OBJS =   $(API_OBJS)             $(BTREE_OBJS) \
 
 #ifdef AIXArchitecture
 Libs = $(ALL_MMDB_OBJS) $(MATH_LIB) $(DTSVCLIB) $(TTLIB) $(XLIB)
+#elif defined(LinuxArchitecture) || defined(FreeBSDArchitecture) || defined(OpenBSDArchitecture)
+Libs=$(MMDB_LIBS) $(MATH_LIB) $(DTSVCLIB) $(MTF_LIBRARIES) $(TTLIB) $(XLIB)
 #else
 Libs = $(MMDB_LIBS) $(MATH_LIB) $(DTSVCLIB) $(TTLIB) $(XLIB)
 #endif
 
+#if defined(LinuxArchitecture) || defined(FreeBSDArchitecture) || defined(OpenBSDArchitecture)
+Libs_C_API = $(MMDB_LIBS_C_API) $(DTSVCLIB) $(MTF_LIBRARIES) $(TTLIB) $(XLIB) $(MATH_LIB)
+#else
 Libs_C_API = $(MMDB_LIBS_C_API) $(DTSVCLIB) $(TTLIB) $(XLIB) $(MATH_LIB)
+#endif
 
 SimpleCPlusPlusProgram(dbdrv,main.o,$(Libs))
 SimpleCPlusPlusProgram(restore,restore.o,$(Libs))
 
-#ifdef USLArchitecture
+#if defined(USLArchitecture) || defined(LinuxArchitecture) || defined(FreeBSDArchitecture)
 SimpleCPlusPlusProgram(dbdrv_c_api,main_c_api.o,$(Libs_C_API))
 #else
 SimpleCProgram(dbdrv_c_api,main_c_api.o,$(Libs_C_API))
index 669edb153529cee77a292593499c21f6e01d1af8..e66664c6687b107fbedd290f82d06d40ff633226 100644 (file)
@@ -70,7 +70,7 @@ int select_and_process( int argc, char** argv )
    } else {
       if ( strcmp(argv[1], "define") == 0 ) {
 
-         infolib_ptr = mmdb.openInfoLib();  
+         infolib_ptr = mmdb.openInfoLib(getenv("MMDB_PATH"));
 
          if ( infolib_ptr == 0 ||
               infolib_ptr->define_info_base(argv[3],argv[4],argv[2]) == false
@@ -149,12 +149,12 @@ main( int argc, char** argv )
 
    int ok;
 
-   try 
+   mtry
    {
       ok = select_and_process( argc, argv );
    } 
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
       cerr << "Exception msg: " << e << "\n";
 #ifdef DEBUG
index 30d7b9b089ff778c7c2710991ad8440aa9d97590..1f20817bda02a9280da19a1deda2a909441a2c74 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "oliasdb/Mmdb.h"
 #include <stdio.h>
+#include <stdlib.h>
 
 
 usage(int argc, char** argv)
index e4bb0c7cb5a336042bcd92a5e7e26cfa7634b86f..43586209df308d2a7f3ca2c170701087998f8c88 100644 (file)
@@ -31,8 +31,9 @@
  * (c) Copyright 1996 Hitachi.
  */
 
-#include <fstream.h>
-#include <strstream.h>
+#include <fstream>
+#include <sstream>
+using namespace std;
 
 #include "utility/const.h"
 #include "utility/randomize.h"
@@ -49,7 +50,7 @@ main(int argc, char** argv)
 
   fstr.getline(schema_header, 1024);
 
-  int sz = bytes(fstr) - strlen(schema_header) - 1;
+  int sz = bytes(*(argv+1)) - strlen(schema_header) - 1;
 
   char* buf = new char[sz];