dtinfo subtree DtMmdb
authorUlrich Wilkens <mail@uwilkens.de>
Sun, 14 Oct 2012 13:38:27 +0000 (15:38 +0200)
committerJon Trulson <jon@radscan.com>
Mon, 15 Oct 2012 23:57:14 +0000 (17:57 -0600)
186 files changed:
cde/programs/dtinfo/DtMmdb/HardCopy/FPExceptions.h
cde/programs/dtinfo/DtMmdb/HardCopy/HardCopyFP.C
cde/programs/dtinfo/DtMmdb/HardCopy/HardCopyFP.h
cde/programs/dtinfo/DtMmdb/HardCopy/autoNumber.C
cde/programs/dtinfo/DtMmdb/HardCopy/autoNumberFP.C
cde/programs/dtinfo/DtMmdb/Imakefile
cde/programs/dtinfo/DtMmdb/StyleSheet/Attribute.C
cde/programs/dtinfo/DtMmdb/StyleSheet/Attribute.h
cde/programs/dtinfo/DtMmdb/StyleSheet/BitVector.h
cde/programs/dtinfo/DtMmdb/StyleSheet/Debug.h
cde/programs/dtinfo/DtMmdb/StyleSheet/DocParser.C
cde/programs/dtinfo/DtMmdb/StyleSheet/DocParser.h
cde/programs/dtinfo/DtMmdb/StyleSheet/Element.C
cde/programs/dtinfo/DtMmdb/StyleSheet/Expression.C
cde/programs/dtinfo/DtMmdb/StyleSheet/Feature.h
cde/programs/dtinfo/DtMmdb/StyleSheet/FeatureDefDictionary.C
cde/programs/dtinfo/DtMmdb/StyleSheet/FeatureSet.C
cde/programs/dtinfo/DtMmdb/StyleSheet/FeatureValue.C
cde/programs/dtinfo/DtMmdb/StyleSheet/PQTest.C
cde/programs/dtinfo/DtMmdb/StyleSheet/PathTable.h
cde/programs/dtinfo/DtMmdb/StyleSheet/SSPath.C
cde/programs/dtinfo/DtMmdb/StyleSheet/StyleSheetExceptions.h
cde/programs/dtinfo/DtMmdb/StyleSheet/SymTab.h
cde/programs/dtinfo/DtMmdb/StyleSheet/defParser.C
cde/programs/dtinfo/DtMmdb/StyleSheet/defParser.y
cde/programs/dtinfo/DtMmdb/StyleSheet/defToken.C
cde/programs/dtinfo/DtMmdb/StyleSheet/defToken.l
cde/programs/dtinfo/DtMmdb/StyleSheet/docparser.C
cde/programs/dtinfo/DtMmdb/StyleSheet/style.C
cde/programs/dtinfo/DtMmdb/StyleSheet/style.y
cde/programs/dtinfo/DtMmdb/StyleSheet/tokenStyle.C
cde/programs/dtinfo/DtMmdb/api/Imakefile
cde/programs/dtinfo/DtMmdb/api/base.C
cde/programs/dtinfo/DtMmdb/api/info_base.C
cde/programs/dtinfo/DtMmdb/api/info_base.h
cde/programs/dtinfo/DtMmdb/api/info_lib.C
cde/programs/dtinfo/DtMmdb/api/info_lib.h
cde/programs/dtinfo/DtMmdb/api/smart_ptr.C
cde/programs/dtinfo/DtMmdb/api/utility.h
cde/programs/dtinfo/DtMmdb/btree/Imakefile
cde/programs/dtinfo/DtMmdb/btree_berkeley/bt_put.c
cde/programs/dtinfo/DtMmdb/btree_berkeley/cdefs.h
cde/programs/dtinfo/DtMmdb/btree_berkeley/memmove.c
cde/programs/dtinfo/DtMmdb/btree_berkeley/snprintf.c
cde/programs/dtinfo/DtMmdb/compression/Imakefile
cde/programs/dtinfo/DtMmdb/compression/huffman.C
cde/programs/dtinfo/DtMmdb/compression/ps.C
cde/programs/dtinfo/DtMmdb/compression/sgml.C
cde/programs/dtinfo/DtMmdb/compression/trie.C
cde/programs/dtinfo/DtMmdb/compression/zip.C
cde/programs/dtinfo/DtMmdb/diskhash/Imakefile
cde/programs/dtinfo/DtMmdb/diskhash/disk_hash.C
cde/programs/dtinfo/DtMmdb/dstr/Imakefile
cde/programs/dtinfo/DtMmdb/dstr/dlist.C
cde/programs/dtinfo/DtMmdb/dstr/token_stack.C
cde/programs/dtinfo/DtMmdb/dti_cc/CC_Dlist.C
cde/programs/dtinfo/DtMmdb/dti_cc/CC_Slist.C
cde/programs/dtinfo/DtMmdb/dti_cc/CC_Slist.h
cde/programs/dtinfo/DtMmdb/dti_cc/CC_Stack.C
cde/programs/dtinfo/DtMmdb/dti_cc/CC_Stack.h
cde/programs/dtinfo/DtMmdb/dti_cc/cc_exceptions.C
cde/programs/dtinfo/DtMmdb/dti_cc/cc_exceptions.h
cde/programs/dtinfo/DtMmdb/dti_cc/cc_hdict.C
cde/programs/dtinfo/DtMmdb/dti_cc/cc_hdict.h
cde/programs/dtinfo/DtMmdb/dti_cc/cc_povec.h
cde/programs/dtinfo/DtMmdb/dti_cc/cc_pvect.C
cde/programs/dtinfo/DtMmdb/dti_cc/cc_pvect.h
cde/programs/dtinfo/DtMmdb/dti_excs/Destructable_il.hh
cde/programs/dtinfo/DtMmdb/dti_excs/Exception.hh
cde/programs/dtinfo/DtMmdb/dti_excs/Exceptions.C
cde/programs/dtinfo/DtMmdb/dti_excs/Exceptions.hh
cde/programs/dtinfo/DtMmdb/dti_excs/Imakefile
cde/programs/dtinfo/DtMmdb/dti_excs/init.C
cde/programs/dtinfo/DtMmdb/dti_excs/new_delete_simple.h
cde/programs/dtinfo/DtMmdb/dti_excs/terminate.C
cde/programs/dtinfo/DtMmdb/dynhash/Imakefile
cde/programs/dtinfo/DtMmdb/dynhash/bsearch.C
cde/programs/dtinfo/DtMmdb/dynhash/data_t.C
cde/programs/dtinfo/DtMmdb/dynhash/imp_die.C
cde/programs/dtinfo/DtMmdb/hmphf/Imakefile
cde/programs/dtinfo/DtMmdb/hmphf/buckets.C
cde/programs/dtinfo/DtMmdb/hmphf/mphf_funcs.C
cde/programs/dtinfo/DtMmdb/hmphf/mphf_funcs.h
cde/programs/dtinfo/DtMmdb/hmphf/mphf_hash_table.C
cde/programs/dtinfo/DtMmdb/hmphf/params.C
cde/programs/dtinfo/DtMmdb/hmphf/params.h
cde/programs/dtinfo/DtMmdb/hmphf/sorter.C
cde/programs/dtinfo/DtMmdb/hmphf/sorter.h
cde/programs/dtinfo/DtMmdb/index/Imakefile
cde/programs/dtinfo/DtMmdb/index/btree_index.C
cde/programs/dtinfo/DtMmdb/index/btree_index.h
cde/programs/dtinfo/DtMmdb/index/dyn_disk_index.C
cde/programs/dtinfo/DtMmdb/index/dyn_disk_index.h
cde/programs/dtinfo/DtMmdb/index/dyn_index.C
cde/programs/dtinfo/DtMmdb/index/dyn_memory_index.C
cde/programs/dtinfo/DtMmdb/index/dyn_memory_index.h
cde/programs/dtinfo/DtMmdb/index/fast_mphf.C
cde/programs/dtinfo/DtMmdb/index/index.C
cde/programs/dtinfo/DtMmdb/index/index.h
cde/programs/dtinfo/DtMmdb/index/inv_lists.C
cde/programs/dtinfo/DtMmdb/index/mphf_index.C
cde/programs/dtinfo/DtMmdb/index/mphf_index.h
cde/programs/dtinfo/DtMmdb/mgrs/Imakefile
cde/programs/dtinfo/DtMmdb/mgrs/template_mgr.C
cde/programs/dtinfo/DtMmdb/misc/unique_id.c
cde/programs/dtinfo/DtMmdb/object/Imakefile
cde/programs/dtinfo/DtMmdb/object/convert.C
cde/programs/dtinfo/DtMmdb/object/cset.C
cde/programs/dtinfo/DtMmdb/object/new_delete.h
cde/programs/dtinfo/DtMmdb/object/oid_t.C
cde/programs/dtinfo/DtMmdb/object/oid_t.h
cde/programs/dtinfo/DtMmdb/object/random_gen.C
cde/programs/dtinfo/DtMmdb/oliasdb/Imakefile
cde/programs/dtinfo/DtMmdb/oliasdb/asciiIn_filters.C
cde/programs/dtinfo/DtMmdb/oliasdb/c_api_book.C
cde/programs/dtinfo/DtMmdb/oliasdb/c_api_bookcase.C
cde/programs/dtinfo/DtMmdb/oliasdb/c_api_common.C
cde/programs/dtinfo/DtMmdb/oliasdb/c_api_dlp.C
cde/programs/dtinfo/DtMmdb/oliasdb/c_api_graphic.C
cde/programs/dtinfo/DtMmdb/oliasdb/c_api_infolib.C
cde/programs/dtinfo/DtMmdb/oliasdb/c_api_locator.C
cde/programs/dtinfo/DtMmdb/oliasdb/c_api_section.C
cde/programs/dtinfo/DtMmdb/oliasdb/c_api_stylesheet.C
cde/programs/dtinfo/DtMmdb/oliasdb/c_api_toc.C
cde/programs/dtinfo/DtMmdb/oliasdb/doc_test.C
cde/programs/dtinfo/DtMmdb/oliasdb/graphic_hd.C
cde/programs/dtinfo/DtMmdb/oliasdb/graphic_test.C
cde/programs/dtinfo/DtMmdb/oliasdb/loc_test.C
cde/programs/dtinfo/DtMmdb/oliasdb/locator_hd.C
cde/programs/dtinfo/DtMmdb/oliasdb/mark.C
cde/programs/dtinfo/DtMmdb/oliasdb/mmdb.C
cde/programs/dtinfo/DtMmdb/oliasdb/node_hd.C
cde/programs/dtinfo/DtMmdb/oliasdb/node_test.C
cde/programs/dtinfo/DtMmdb/oliasdb/olias_consts.h
cde/programs/dtinfo/DtMmdb/oliasdb/olias_funcs.C
cde/programs/dtinfo/DtMmdb/oliasdb/olias_test.C
cde/programs/dtinfo/DtMmdb/oliasdb/stylesheet_hd.C
cde/programs/dtinfo/DtMmdb/oliasdb/stylesheet_test.C
cde/programs/dtinfo/DtMmdb/oliasdb/toc_test.C
cde/programs/dtinfo/DtMmdb/oliasdb/user_base.C
cde/programs/dtinfo/DtMmdb/schema/Imakefile
cde/programs/dtinfo/DtMmdb/schema/desc.C
cde/programs/dtinfo/DtMmdb/schema/object_dict.C
cde/programs/dtinfo/DtMmdb/schema/sheet.C
cde/programs/dtinfo/DtMmdb/schema/sheet.tab.h
cde/programs/dtinfo/DtMmdb/schema/token.C
cde/programs/dtinfo/DtMmdb/storage/Imakefile
cde/programs/dtinfo/DtMmdb/storage/lru.h
cde/programs/dtinfo/DtMmdb/storage/page_storage.C
cde/programs/dtinfo/DtMmdb/storage/rep_cell.h
cde/programs/dtinfo/DtMmdb/storage/storage.h
cde/programs/dtinfo/DtMmdb/storage/unixf_storage.C
cde/programs/dtinfo/DtMmdb/utility/Imakefile
cde/programs/dtinfo/DtMmdb/utility/atoi_fast.C
cde/programs/dtinfo/DtMmdb/utility/atoi_larson.h
cde/programs/dtinfo/DtMmdb/utility/atoi_pearson.C
cde/programs/dtinfo/DtMmdb/utility/buffer.C
cde/programs/dtinfo/DtMmdb/utility/buffer.h
cde/programs/dtinfo/DtMmdb/utility/c_ios.h
cde/programs/dtinfo/DtMmdb/utility/c_stream.h
cde/programs/dtinfo/DtMmdb/utility/c_string.h [new file with mode: 0644]
cde/programs/dtinfo/DtMmdb/utility/c_stringstream.h [new file with mode: 0644]
cde/programs/dtinfo/DtMmdb/utility/c_strstream.h [deleted file]
cde/programs/dtinfo/DtMmdb/utility/filebuf.C
cde/programs/dtinfo/DtMmdb/utility/filter.h
cde/programs/dtinfo/DtMmdb/utility/funcs.C
cde/programs/dtinfo/DtMmdb/utility/funcs.h
cde/programs/dtinfo/DtMmdb/utility/ios.C
cde/programs/dtinfo/DtMmdb/utility/iostream.C
cde/programs/dtinfo/DtMmdb/utility/mmdb_exception.C
cde/programs/dtinfo/DtMmdb/utility/mmdb_exception.h
cde/programs/dtinfo/DtMmdb/utility/ostring.C
cde/programs/dtinfo/DtMmdb/utility/prolatex.C
cde/programs/dtinfo/DtMmdb/utility/randomize.C
cde/programs/dtinfo/DtMmdb/utility/rw_lock.C
cde/programs/dtinfo/DtMmdb/utility/stream.C
cde/programs/dtinfo/DtMmdb/utility/streambuf.C
cde/programs/dtinfo/DtMmdb/utility/string.C [new file with mode: 0644]
cde/programs/dtinfo/DtMmdb/utility/stringstream.C [new file with mode: 0644]
cde/programs/dtinfo/DtMmdb/utility/strstream.C [deleted file]
cde/programs/dtinfo/DtMmdb/utility/tst_filebuf.C
cde/programs/dtinfo/DtMmdb/utility/tst_streambuf.C
cde/programs/dtinfo/DtMmdb/utility/tst_strstream.C
cde/programs/dtinfo/DtMmdb/utility/types.h
cde/programs/dtinfo/DtMmdb/utility/xclock.h
cde/programs/dtinfo/DtMmdb/utility/xtime.h

index 43d5b701955eeb2c556e3b3b18addfd1843e2ae8..e0f5b884f34d443c4abd568fb81d2d7e8c562e24 100644 (file)
@@ -37,11 +37,7 @@ public:
   DECLARE_EXCEPTION(hardCopyRendererException, Exception);
 };
 
-#if defined(linux)
-#define CASTHCREXCEPT (hardCopyRendererException*)
-#else
 #define CASTHCREXCEPT
-#endif
 
 #endif /* _FPExceptions_h */
 /* DO NOT ADD ANY LINES AFTER THIS #endif */
index 348ea10737f5fbb6de4aeb9c5921e92c95a30fa7..61d490a63fb4b4f116f49024eafb183ac3d510c0 100644 (file)
@@ -186,7 +186,7 @@ featureProcessor::getFeatureValueArray(const Feature* f)
      if ( f -> value() -> type() == FeatureValue::array ) 
         return (FeatureValueArray*)(f -> value());
      else {
-        MESSAGE(cerr, form("%s is not of an array type.", f -> name()));
+        MESSAGE(cerr, form("%s is not of an array type.", f -> name().name()));
         throw(CASTHCREXCEPT hardCopyRendererException());
      }
   } else
index e7ab6644cfc069248d350a5c18557cdae6c0afdd..e51fc79d0c8c10b8c22a0bbf13749196b91ab510 100644 (file)
 #ifndef _fp_h
 #define _fp_h 1
 
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 #include "FPExceptions.h"
 #include "StyleSheet/Feature.h"
 #include "StyleSheet/FeatureValue.h"
 #include "StyleSheet/Element.h"
 #include "StyleSheet/Const.h"
 #include "StyleSheet/Debug.h"
+#include "utility/funcs.h"
 
 enum BLOCK_MODE { NON_BLOCK, BLOCK };
 extern enum BLOCK_MODE g_block_mode;
index 567898334dc312bc61b469b02213a1fbde3dedd9..d0b808461f3710006e6e7955a47d64449d93d2bd 100644 (file)
 // $TOG: autoNumber.C /main/6 1998/04/17 11:47:13 mgreess $
 
 #include <ctype.h>
+#if defined(CSRG_BASED)
+#define MAXINT INT_MAX
+#else
 #include <values.h>
+#endif
 
 #include "HardCopy/autoNumber.h"
 #include "HardCopy/FPExceptions.h"
@@ -137,7 +141,7 @@ autoNumberNumeric::getValue()
    char* ptr = f_buf.get_base();
 
    if (f_values.entries())
-     sprintf(ptr, form("%s%d%s", f_prefix, f_values.top(), f_postfix));
+     sprintf(ptr, "%s", form("%s%d%s", f_prefix, f_values.top(), f_postfix));
    else
      *ptr = 0;
 
@@ -291,10 +295,12 @@ const char* autoNumberAlphabetic::intToAlpha(int x, enum CaseType a_case)
       x = z;
    }
 
-   for (int k=0; k<digits-i; k++ )
+   int k;
+   for (k=0; k<digits-i; k++ )
       buf[k] = letters[0];
 
-   for (int n=0; n<i; n++ )
+   int n;
+   for (n=0; n<i; n++ )
       buf[k+n] = buf1[n];
 
    buf[k+n] = 0;
@@ -317,7 +323,7 @@ const char* autoNumberAlphabetic::getValue()
    char* ptr = f_buf.get_base();
 
    if (f_values.entries())
-     sprintf(ptr, form("%s%s%s", f_prefix,
+     sprintf(ptr, "%s", form("%s%s%s", f_prefix,
                     intToAlpha(f_values.top(), f_case), f_postfix));
    else
      *ptr = 0;
@@ -481,13 +487,14 @@ autoNumberRoman::ArabicToRoman(int x)
         const char* romanCardinal = romanCardinals[j][buf[i]-'1'];
         char  precise_romanCardinal[8];
 
+        int k;
         if (f_case == UPPER) {
-           for (int k=0; romanCardinal[k]; k++)
+           for (k=0; romanCardinal[k]; k++)
                precise_romanCardinal[k] = romanCardinal[k];
            precise_romanCardinal[k] = 0;
         }
         else {
-           for (int k=0; romanCardinal[k]; k++)
+           for (k=0; romanCardinal[k]; k++)
                precise_romanCardinal[k] = tolower(romanCardinal[k]);
            precise_romanCardinal[k] = 0;
         }
index 8323afb4ff570fb1a0007cf5fea26be705c54e41..bc7d212febfa104ffce95126f97c35109899fd4e 100644 (file)
@@ -284,7 +284,8 @@ autoNumberFP::defineAutoNumber(const char* nm, const FeatureValue* f)
 
    const char* gi = 0;
    autoNumberListT* anList = 0;
-   for (int i=0; i<controlList -> length(); i++ ) {
+   int i;
+   for (i=0; i<controlList -> length(); i++ ) {
 
       gi = stringToCharPtr((*controlList)[i]);
       key = new CC_String(gi);
@@ -353,11 +354,11 @@ autoNumberFP::accept(const char* name, const Expression* expr)
 {
    FeatureValue* fv = 0;
 
-   try
+   mtry
     {
       fv = expr -> evaluate();
     }
-   catch_any()
+   mcatch_any()
     {
       return false;
     }
index 762756b64140c5761a480b5524a4cd9138f6e03d..93477866042b03876216d75d06e189f8f6c19120 100644 (file)
@@ -54,6 +54,13 @@ DONES = \
 
 EXTRALIBRARYDEPS = $(DONES)
 
+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>'
+
 MakeSubdirs($(SUBDIRS))
 ForceSubdirs($(SUBDIRS))
 DependSubdirs($(SUBDIRS))
@@ -201,8 +208,8 @@ UTILITY_OBJS = \
        utility/filter.o                utility/mmdb_exception.o \
        utility/randomize.o     \
        utility/streambuf.o     utility/charbuf.o       utility/filebuf.o \
-       utility/strstream.o     utility/iostream.o      utility/fstream.o \
-       utility/stream.o        utility/ios.o
+       utility/stringstream.o  utility/iostream.o      utility/fstream.o \
+       utility/stream.o        utility/string.o        utility/ios.o
 
 
 OBJS = $(API_OBJS)             $(BTREE_OBJS) \
@@ -221,4 +228,8 @@ DYNAMIC =
 
 #include <Library.tmpl>
 
+XCOMM Variables to switch on debug mode temporarily
+XCOMM CDEBUGFLAGS = -g -DDEBUG
+XCOMM CXXDEBUGFLAGS = -g -DDEBUG
+
 DependTarget()
index e8e7922b52183c91be3a2c03777b9c90c0fd6e52..1ceb4b7c54b0b5376a32ca5705110a716a13ad4c 100644 (file)
@@ -38,6 +38,7 @@ Attribute::~Attribute()
   delete f_value ;
 }
 
+bool
 Attribute::operator==(const Attribute &attr) const
 {
 /*
index 7b95c337f0abd74a195f60b488256ee8e4fb1dfa..25916bbbe39868661b70a35a2268160668bb55d3 100644 (file)
@@ -39,7 +39,7 @@ public:
   ~Attribute();
 
   const Symbol &name() const   { return f_name; }
-  operator==(const Attribute &) const ;
+  bool operator==(const Attribute &) const ;
 
   const char   *value() const  { return f_value ; } 
 
index e53a651c273bb698454b3edbdfca3d594f46832c..2579e26de95ab7c92a5aee4768df75ee71cef086 100644 (file)
@@ -25,7 +25,9 @@
 #ifndef _BitVector_h
 #define _BitVector_h 1
 
-#include <stream.h>
+#include <sstream>
+#include <ostream>
+using namespace std;
 
 #ifndef CDE_NEXT
 
index dcff31679010fa909e6073c053068f6c15ceac4d..e36dfd4253e0b5be0669567c2e282506e8e1cb36 100644 (file)
@@ -46,7 +46,8 @@
 #ifndef _debug_h
 #define _debug_h 1
 
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 
 #ifdef DEBUG
 #define ON_DEBUG(stmt) stmt
index c139fb8066819037d33f726e95dda1aa1f123193..d3f9f59c22174e63087d5acd884ae6b0ff7f6d11 100644 (file)
@@ -52,7 +52,7 @@ DocParser::DocParser(Resolver &r)
   f_buffer(new char[DATA_BUF_SIZ]),
   f_output(f_buffer, DATA_BUF_SIZ)
 #else
-  f_streambuf(new strstreambuf(DATA_BUF_SIZ)),
+  f_streambuf(new stringbuf()),
   f_output(f_streambuf)
 #endif
 {
@@ -93,7 +93,7 @@ DocParser::rawParse(istream &input)
        Symbol name(gElemSymTab->intern(terminate(f_output).str()));
        f_output.rdbuf()->freeze(0);
 #else
-       char *data = f_streambuf->str();
+       char *data = (char *)f_streambuf->str().c_str();
 
 /*
 MESSAGE(cerr, "StartTag case:");
@@ -102,9 +102,8 @@ debug(cerr, data);
 */
 
 #if !defined(SC3) && !defined(__osf__)
-       data[f_streambuf->pcount()] = 0;
+       data[f_streambuf->str().size()] = 0;
 #endif
-       f_streambuf->freeze(0);
        Symbol name(gElemSymTab->intern(data));
 #endif
        process(input, f_output, name, 1, 1);
@@ -161,7 +160,7 @@ DocParser::process(istream &input, ostream &output,
 
   int ignore = 0 ;
 
-  try
+  mtry
     {
       // process whatever comes right after start tag 
       TagType tt = read_tag(input, output);
@@ -194,15 +193,14 @@ DocParser::process(istream &input, ostream &output,
 
            process(input, output, name, child++, child_relative_sibling_number);
 #else
-           char *data = f_streambuf->str();
+           char *data = (char *)f_streambuf->str().c_str();
 #if !defined(SC3)  && !defined(__osf__)
-           data[f_streambuf->pcount()] = 0;
+           data[f_streambuf->str().size()] = 0;
 #endif
            Symbol name(gElemSymTab->intern(data));
            update_last_seen_child_name(last_seen_child_name, 
                                 child_relative_sibling_number, name);
 
-           f_streambuf->freeze(0);
            process(input, output, name,
                    child++, child_relative_sibling_number);
 #endif
@@ -216,12 +214,11 @@ DocParser::process(istream &input, ostream &output,
            char *data = terminate(f_output).str();
            f_output.rdbuf()->freeze(0);
 #else
-           char *data = f_streambuf->str();
+           char *data = (char*)f_streambuf->str().c_str();
 //#ifdef _IBMR2
 #if !defined(SC3)  && !defined(__osf__)
-           data[f_streambuf->pcount()] = 0;
+           data[f_streambuf->str().size()] = 0;
 #endif
-           f_streambuf->freeze(0);
 #endif
            cerr << "EndTag: " << data << endl;
            assert(gElemSymTab->intern(data) == name);
@@ -246,7 +243,8 @@ DocParser::process(istream &input, ostream &output,
     !defined(_IBMR2) && \
     !defined(__uxp__) && \
     !defined(USL) && \
-    !defined(linux)
+    !defined(linux) && \
+    !defined(CSRG_BASED)
            volatile
 #endif
            AttributeList *attrs = 0;
@@ -255,12 +253,13 @@ DocParser::process(istream &input, ostream &output,
     !defined(_IBMR2) && \
     !defined(__uxp__) && \
     !defined(USL) && \
-    !defined(linux)
+    !defined(linux) && \
+    !defined(CSRG_BASED)
            volatile
 #endif
            AttributeList *olias_attrs = 0;
 
-           try
+           mtry
              {
                process_attributes(input, output, attrs, olias_attrs);
 
@@ -278,7 +277,7 @@ DocParser::process(istream &input, ostream &output,
                    f_ignoring_element = ignore ;
                  }
              }
-           catch_any()
+           mcatch_any()
              {
 /*
                delete attrs ;
@@ -318,16 +317,15 @@ DocParser::process(istream &input, ostream &output,
                f_resolver.data(string, size);
                f_output.rdbuf()->freeze(0);
 #else
-               char *string = f_streambuf->str();
+               char *string = (char *)f_streambuf->str().c_str();
 //#ifdef _IBMR2
 #if !defined(SC3) && !defined(__osf__)
-               string[f_streambuf->pcount()] = 0;
-               int   size = f_streambuf->pcount() ;
+               string[f_streambuf->str().size()] = 0;
+               int   size = f_streambuf->str().size() ;
 #else
                int   size = f_streambuf->pcount() - 1 ;
 #endif
                f_resolver.data(string, size);
-               f_streambuf->freeze(0); // unfreeze buffer frozen by str() call
 #endif
              }
          }
@@ -347,12 +345,11 @@ DocParser::process(istream &input, ostream &output,
              *(data + f_output.pcount()) = 0;
              f_output.rdbuf()->freeze(0);
 #else
-             char *data = f_streambuf->str();
+             char *data = (char *)f_streambuf->str().c_str();
 //#ifdef _IBMR2
 #if !defined(SC3) && !defined(__osf__)
-              data[f_streambuf->pcount ()] = 0;
+              data[f_streambuf->str().size()] = 0;
 #endif
-             f_streambuf->freeze(0);
 #endif
 
 /*
@@ -391,16 +388,15 @@ debug(cerr, f_streambuf->pcount ());
                  f_resolver.data(string, size);
                  f_output.rdbuf()->freeze(0);
 #else
-                 char *string = f_streambuf->str();
+                 char *string = (char *)f_streambuf->str().c_str();
 //#ifdef _IBMR2
 #if !defined(SC3) && !defined(__osf__)
-                 string[f_streambuf->pcount()] = 0;
-                 int   size = f_streambuf->pcount() ;
+                 string[f_streambuf->str().size()] = 0;
+                 int   size = f_streambuf->str().size() ;
 #else
                  int   size = f_streambuf->pcount() - 1 ;
 #endif
                  f_resolver.data(string, size);
-                 f_streambuf->freeze(0); // unfreeze buffer frozen by str() call
 #endif
                }
            }
@@ -411,12 +407,11 @@ debug(cerr, f_streambuf->pcount ());
        char *data = terminate(f_output).str();
        f_output.rdbuf()->freeze(0);
 #else
-       char *data = f_streambuf->str();
+       char *data = (char*)f_streambuf->str().c_str();
 //#ifdef _IBMR2
 #if !defined(SC3) && !defined(__osf__)
-       data[f_streambuf->pcount ()] = 0;
+       data[f_streambuf->str().size()] = 0;
 #endif
-       f_streambuf->freeze(0);
 #endif
        cerr << "EndTag: " << data << endl;
        assert(gElemSymTab->intern(data) == name);
@@ -430,7 +425,7 @@ debug(cerr, f_streambuf->pcount ());
       if (ignore)
        f_ignoring_element = 0;
     }
-  catch_any()
+  mcatch_any()
     {
       rethrow;
     }
@@ -454,7 +449,7 @@ DocParser::process_attributes(istream &input, ostream &output,
 
   char *theData = 0;
 
-  try {
+  mtry {
      while ((tt = read_tag(input,output)) != NoTag)
        {
          switch (tt)
@@ -463,8 +458,8 @@ DocParser::process_attributes(istream &input, ostream &output,
           {
 //#ifdef _IBMR2
 #if !defined(SC3) && !defined(__osf__)
-         theData = f_streambuf->str ();
-          theData[f_streambuf->pcount()] = 0;
+         theData = (char *)f_streambuf->str().c_str();
+          theData[f_streambuf->str().size()] = 0;
 #endif
          if (!attrs)
            attrs = new AttributeList ;
@@ -495,8 +490,8 @@ DocParser::process_attributes(istream &input, ostream &output,
        case OliasAttribute:
 //#ifdef _IBMR2
 #if !defined(SC3) && !defined(__osf__)
-         theData = f_streambuf->str ();
-          theData[f_streambuf->pcount()] = 0;
+         theData = (char *)f_streambuf->str().c_str();
+          theData[f_streambuf->str().size()] = 0;
 #endif
          // mirrors attribute 
          if (!olias_attrs)
@@ -525,7 +520,7 @@ DocParser::process_attributes(istream &input, ostream &output,
        }
        }
    }
-   catch_any()
+   mcatch_any()
    {
      delete newAttribute;
 
@@ -568,12 +563,11 @@ DocParser::process_attribute(istream &input, ostream &output,
   *(data + f_output.pcount()) = 0;
   f_output.rdbuf()->freeze(0);
 #else
-  char *data = f_streambuf->str();
+  char *data = (char *)f_streambuf->str().c_str();
 //#ifdef _IBMR2
 #if !defined(SC3)  && !defined(__osf__)
-  data[f_streambuf->pcount ()] = 0;
+  data[f_streambuf->str().size()] = 0;
 #endif
-  f_streambuf->freeze(0);
 #endif
   Attribute *attr = new Attribute(name, strdup(data));
 
index 23ef2f37a6ab218b0778225234c2b97a328a9e13..c2ba160c498efa78838da7c4d7e43e0a87908ace 100644 (file)
@@ -24,8 +24,9 @@
 /*     Copyright (c) 1995 FUJITSU LIMITED      */
 /*     All Rights Reserved                     */
 
-#include <iostream.h>
-#include <strstream.h>
+#include <iostream>
+#include <sstream>
+using namespace std;
 
 #include "SymTab.h"
 #include "Exceptions.hh"
@@ -84,7 +85,7 @@ private:
   char* const  f_buffer;
   ostrstream   f_output;
 #else
-  strstreambuf *f_streambuf ;
+  stringbuf    *f_streambuf;
   ostream      f_output;
 #endif
   Resolver     &f_resolver;
index be8fd160ccce30213e04845f8ac8f6c955cc4117..3863e7d1a47fb88c66e6c63ba131208de69d927a 100644 (file)
@@ -21,7 +21,8 @@
  * Floor, Boston, MA 02110-1301 USA
  */
 // $TOG: Element.C /main/5 1998/04/17 11:48:25 mgreess $
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 #include <stdlib.h>
 #include "StyleSheetExceptions.h"
 #include "Element.h"
index 4745618b2efc943227ec31f2970ed75ad0c885ce..0668ec000a0240300d3ca896d04e0e2437a8b6cf 100644 (file)
@@ -30,7 +30,7 @@
 #include "VariableTable.h"
 #include "Renderer.h"
 #include "Debug.h"
-#include <stream.h>
+#include <sstream>
 
 #include "HardCopy/autoNumberFP.h"
 
@@ -141,20 +141,20 @@ BinaryOperatorNode::evaluate() const
 {
   // calculate children trees and then have feature value do the operation 
 
-#if !defined(SC3) && !defined(_IBMR2) && !defined(__uxp__) && !defined(__osf__) && !defined(USL) && !defined(linux)
+#if !defined(SC3) && !defined(_IBMR2) && !defined(__uxp__) && !defined(__osf__) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED)
   volatile
 #endif
   FeatureValue *left =  0;
-#if !defined(SC3) && !defined(_IBMR2) && !defined(__uxp__) && !defined(__osf__) && !defined(USL) && !defined(linux)
+#if !defined(SC3) && !defined(_IBMR2) && !defined(__uxp__) && !defined(__osf__) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED)
   volatile
 #endif
   FeatureValue *right = 0;
-#if !defined(SC3) && !defined(_IBMR2) && !defined(__uxp__) && !defined(__osf__) && !defined(USL) && !defined(linux)
+#if !defined(SC3) && !defined(_IBMR2) && !defined(__uxp__) && !defined(__osf__) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED)
   volatile
 #endif
   FeatureValue *result = 0;
 
-  try
+  mtry
     {
       left  = f_left->evaluate();
       right = f_right->evaluate();
@@ -176,7 +176,7 @@ BinaryOperatorNode::evaluate() const
        }
 
     }
-  catch_any()
+  mcatch_any()
     {
       delete left ;
       delete right ;
@@ -219,11 +219,11 @@ VariableNode::evaluate() const
   // etc.  
   FeatureValue *return_variable = 0;
 
-  try
+  mtry
     {
       return_variable = variable_value->evaluate() ;
     }
-  catch_any()
+  mcatch_any()
     {
       delete return_variable; 
       delete variable_value ;
index 70e472ac3b142f268df0b02535e995d726dcf9c7..67d58329d10fb68477c2e7c9ec07fae8e07eb00c 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef _Feature_h
 #define _Feature_h
 
-#include <stream.h>
+#include <sstream>
 
 #ifndef CDE_NEXT
 
index e970d391e6f6cce92805e226dadf294cb2a6e566..4cab8c514747f36231f5ad2784a2b5ce99608d5c 100644 (file)
@@ -28,7 +28,8 @@
 #include "StyleSheet/StyleSheetExceptions.h"
 #include "utility/const.h"
 #include "utility/funcs.h"
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 
 featureDefDictionary* g_FeatureDefDictionary = 0;
 
@@ -314,34 +315,34 @@ MESSAGE(cerr, "");
    }
 
    FeatureValue * fv = 0;
-   try {
+   mtry {
      fv = f -> evaluate();
    }
-   catch (undefinedAttributeException&, e) {
+   mcatch (undefinedAttributeException&, e) {
       return true;
    }
 
-   catch (undefinedVariableException&, e) {
+   mcatch (undefinedVariableException&, e) {
       report_error_location();
       cerr << "Undefined variable error.\n";
       return false;
    }
 
 /*
-   catch (badCastException&, e) {
+   mcatch (badCastException&, e) {
       report_error_location();
       cerr << "Evaluating expression error.\n";
       return false;
    }
 
-   catch (badEvaluationException&, e) {
+   mcatch (badEvaluationException&, e) {
       report_error_location();
       cerr << "Evaluating expression error.\n";
       return false;
    }
 */
 
-   catch_any() {
+   mcatch_any() {
       //report_error_location();
       //cerr << "There might be an error in the expression.\n";
       return true;
index d347d3030ee6f20213026aea7b9c08c03c0dcfce..53f9efa082b0738516546ce7e9634891826bc86d 100644 (file)
@@ -75,16 +75,16 @@ FeatureSet::evaluate(FeatureSet *result_set) const
   while(++next)
     {
       FeatureValue *value ;
-      try
+      mtry
        {
          value = next.key()->evaluate();
          result_set->append(new Feature(next.key()->name(),
                                         value));
        }
 #ifdef UXPDS
-      catch_any()
+      mcatch_any()
 #else
-      catch_noarg(badEvaluationException)
+      mcatch_noarg(badEvaluationException)
 #endif
        {
          /* do nothing...we just ignore any that will not evaluate */
@@ -143,7 +143,8 @@ FeatureSet::print(ostream &o) const
   // cast to non-const to get iterator 
   CC_TPtrSlistIterator<Feature> next(*(CC_TPtrSlist<Feature>*)this);
   
-  for (int i = 0 ; i < f_print_indent_level; i++)
+  int i;
+  for (i = 0 ; i < f_print_indent_level; i++)
     o << "  " ;
 
   o << "{" << endl;
index 554676a5772167ee8d747865d46598f78e20a865..d20c2f76cd803c13b9380d2ab895d8f35b4dd3cb 100644 (file)
@@ -522,7 +522,8 @@ FeatureValueString::operator+(const FeatureValue& x) const
 
      char* newString = new char[len1 + len2 + 1];
 
-     for ( int i=0; i<len1; i++ )
+     int i;
+     for ( i=0; i<len1; i++ )
         newString[i] = str1[i];
        
      for ( i=0; i<len2; i++ )
@@ -560,14 +561,14 @@ FeatureValueString::operator+(const FeatureValueExpression& expr) const
 {
    FeatureValue *x = 0;
    FeatureValue *y = 0;
-   try
+   mtry
     {
       x = expr.evaluate();
       y = operator+(*x);
       delete x;
       return y;
     }
-   catch_any()
+   mcatch_any()
     {
       delete x;
       rethrow;
@@ -2343,13 +2344,13 @@ FeatureValueArray::FeatureValueArray(const FeatureValueArray& x) :
    f_name(strdup(x.f_name)), FeatureValue(array), 
    pointer_vector<FeatureValue>(x.length(), 0)
 {
-   try
+   mtry
     {
       for ( int i=0; i<length(); i++ )
          (*this)[i] = x[i] -> clone();
       return;
     }
-   catch_any()
+   mcatch_any()
     {
       for ( int i=0; i<length(); i++ )
          delete (*this)[i];
@@ -2371,14 +2372,14 @@ FeatureValueArray::evaluate() const
 {
   FeatureValueArray *result = new FeatureValueArray(f_name, length());
 
-  try
+  mtry
     {
       for ( int i=0; i<length(); i++ ) {
         (*result)[i] = (*this)[i] -> evaluate();
       }
       return result;
     }
-   catch_any()
+   mcatch_any()
     {
       delete result;
       rethrow;
index 799a818aed802c5e8cd7ae3039a4fa4e2c92f888..89f935de80673cf913b48a3d02155bf6e366c8e8 100644 (file)
@@ -21,7 +21,8 @@
  * Floor, Boston, MA 02110-1301 USA
  */
 // $XConsortium: PQTest.cc /main/3 1996/06/11 17:07:26 cde-hal $
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 #include "SymTab.h"
 #include "PathQualifier.h"
 #include "Element.h"
index c67d2aab76092b0995811169bbce4ff0558f61c0..5300b5d0421bdfeffff4f1ca16c715ccc4868488 100644 (file)
@@ -32,7 +32,7 @@
 #include "dti_cc/cc_hdict.h"
 #endif
 
-#include <stream.h>
+#include <sstream>
 #include "Types.h"
 #include "SymTab.h"
 #include "SSPath.h"
index da161daab1c5d15b44bb509bc4863dcbbc02a201..1c313fd79b5b2c992026238f016dc3a16e2d5417 100644 (file)
@@ -64,7 +64,7 @@ unsigned int PathTerm::operator ==(const PathTerm&)
 
 ostream& operator <<(ostream& out, PathTerm& pt)
 {
-   out << pt.symbol() << " (" << int(pt.f_PQExpr) << ") ";
+   out << pt.symbol() << " (" << size_t(pt.f_PQExpr) << ") ";
    return out;
 }
 
index 118616def68138924b021985159750c07082fc71..ba6a8af1b3940dbf3850617bad55bf02a1afd9b6 100644 (file)
 #include "Exceptions.hh"
 #include "SymTab.h"
 
-#if defined(linux)
-#define CASTEXCEPT (Exception*)
-#define CASTBCEXCEPT (badCastException*)
-#define CASTBEEXCEPT (badEvaluationException*)
-#define CASTDPEXCEPT (docParserException*)
-#define CASTDPUCEXCEPT (docParserUnexpectedCharacter*)
-#define CASTDPUTEXCEPT (docParserUnexpectedTag*)
-#define CASTDPUDEXCEPT (docParserUnexpectedData*)
-#define CASTDPUEEXCEPT (docParserUnexpectedEof*)
-#define CASTSSEXCEPT (StyleSheetException*)
-#define CASTSSSEEXCEPT (StyleSheetSyntaxError*)
-#define CASTUAEXCEPT (undefinedAttributeException*)
-#define CASTUTEXCEPT (unknownTagException*)
-#define CASTUVEXCEPT (undefinedVariableException*)
-#else
 #define CASTEXCEPT
 #define CASTBCEXCEPT
 #define CASTBEEXCEPT
@@ -55,7 +40,6 @@
 #define CASTUAEXCEPT
 #define CASTUTEXCEPT
 #define CASTUVEXCEPT
-#endif
 
 class StyleSheetException : public Exception
 {
index 8f8da682e4b014f4156773c7d484c7e275b669ba..33ebd0a59d0ee5c578f97cbf765661973e61f554 100644 (file)
@@ -31,7 +31,8 @@
 #include "dti_cc/CC_String.h"
 #include "dti_cc/cc_hdict.h"
 //#include "StyleSheet/cde_next.h"
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 #endif
 
 #include "Types.h"
index 74ed84a129c4e14b5199db8f3a9085883d6063c0..f8c1d5d4ed0e1f81ed5b4218cc3eecad45264726 100644 (file)
@@ -27,8 +27,9 @@ static char defParsersccsid[] = "@(#)yaccpar  1.8 (Berkeley) 01/20/90";
 #define defParserBYACC 1
 #include <stdio.h>
 #include <ctype.h>
-#include <stream.h>
-#include <iostream.h>
+#include <sstream>
+#include <iostream>
+using namespace std;
 #include "Debug.h"
 #include "FeatureDefDictionary.h"
 
@@ -269,14 +270,16 @@ defParserloop:
         goto defParserreduce;
     }
     if (defParsererrflag) goto defParserinrecovery;
-#if 0                                  // Disable for now
+// Disable for now
+#if 0
 #ifdef lint
     goto defParsernewerror;
 #endif
 defParsernewerror:
 #endif /* 0 */
-    defParsererror("syntax error");
-#if 0                                  // Disable for now
+    defParsererror((char*)"syntax error");
+// Disable for now
+#if 0
 #ifdef lint
     goto defParsererrlab;
 #endif
@@ -516,7 +519,7 @@ to state %d\n", *defParserssp, defParserstate);
     *++defParservsp = defParserval;
     goto defParserloop;
 defParseroverflow:
-    defParsererror("yacc stack overflow");
+    defParsererror((char*)"yacc stack overflow");
 defParserabort:
     return (1);
 defParseraccept:
index 33e60e2753ace4ef5a5d2d6650580bc315adeb1b..097815e8b4041ffa5f2b27460d111a141d8ce5a2 100644 (file)
@@ -3,7 +3,7 @@
 %{
 #include <stdio.h>
 #include <ctype.h>
-#include <stream.h>
+#include <sstream>
 #include <iostream.h>
 #include "Debug.h"
 #include "FeatureDefDictionary.h"
index 238f295418840b3552a92ed7afc0db9545836c11..67f618a65a07f2d6b4816198e93c233b7316d97b 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
 
@@ -196,7 +196,8 @@ typedef struct defParser_buffer_state *defParser_BUFFER_STATE;
 #include "FeatureDefDictionary.h"
 #include "defParser.tab.h"
 #include "Debug.h"
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 
 extern istream *g_defParserin;
 
index fcee33c8c6d85e568fd4e26ca19bef5752b266d8..0aa971d6addc8bd3522d88f0065453f3eedfcfc5 100644 (file)
@@ -13,7 +13,8 @@
 #include "FeatureDefDictionary.h"
 #include "defParser.tab.h"
 #include "Debug.h"
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 
 extern istream *g_yyin;
 
index 4f8c938a05cd0a97d1887b40fd46c34dbcf953d0..6d251f764819f0c7afba1bb4789f9920efbc670a 100644 (file)
@@ -30,7 +30,8 @@
 #include "StyleSheet.h"
 #include "StyleSheetExceptions.h"
 #include "VariableTable.h"
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 
 Renderer *gRenderer = 0;
 class TestRenderer : public Renderer
index fc75df54b3e69825a92be179e7f222060392974b..2605417da53ae766a7a9d3f91f9602a088368e24 100644 (file)
@@ -27,8 +27,9 @@ static char stylesccsid[] = "@(#)yaccpar      1.8 (Berkeley) 01/20/90";
 #define styleBYACC 1
 #include <stdio.h>
 #include <ctype.h>
-#include <stream.h>
-#include <iostream.h>
+#include <sstream>
+#include <iostream>
+using namespace std;
 #include <assert.h>
 #include "StyleSheetExceptions.h"
 #include "VariableTable.h"
@@ -533,7 +534,7 @@ styleloop:
 #endif
 stylenewerror:
 #endif /* if 0 */
-    styleerror("syntax error");
+    styleerror((char*)"syntax error");
 #if 0                                  /* remove if needed */
 #ifdef lint
     goto styleerrlab;
@@ -1353,7 +1354,7 @@ to state %d\n", *stylessp, stylestate);
     *++stylevsp = styleval;
     goto styleloop;
 styleoverflow:
-    styleerror("yacc stack overflow");
+    styleerror((char*)"yacc stack overflow");
 styleabort:
     return (1);
 styleaccept:
index 6a13a24486c66d36d4173d1d995eadf946a37912..0846f5d0e55cc58bea2c8fe4188f375eb38c84e9 100644 (file)
@@ -3,7 +3,7 @@
 %{
 #include <stdio.h>
 #include <ctype.h>
-#include <stream.h>
+#include <sstream>
 #include <iostream.h>
 #include <assert.h>
 #include "StyleSheetExceptions.h"
index 8258e70890af9ac195389402f6e0311a26d8f3db..93ec6137d10664b14696cea6dae3ce7ece2702b2 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
 
@@ -228,7 +228,8 @@ typedef struct style_buffer_state *style_BUFFER_STATE;
 #include "StyleSheetExceptions.h"
 #include "style.tab.h"
 #include "Debug.h"
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 
 istream *g_stylein = 0;
 
index 6582bcac4676007ee4dac88b7f7a60efa8203f3e..f58f4ee16ddd35d0db93b0b1d2b58ad29f00afa0 100644 (file)
@@ -23,7 +23,7 @@ XCOMM         .../programs/dtinfo/mmdb/<subdir>/Imakefile
 #define LargePICTable  YES
 
 #define CplusplusSource        YES
-DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
 
 XCOMM In DtMmdb we compile as C_API sources.
 DEFINES  = -DC_API
index 57ea70491fa2ea666cd1fa33f5f837a1050725d8..e4fc08896535e008d7dbd85979ff28766b12022f 100644 (file)
@@ -102,5 +102,6 @@ base::base(object_dict* obj_dict,
    
 base::~base() 
 {
+   ;
 }
 
index c202bf3722ebf309c08fa3e805c812f9a58e33fa..490cf6636d7608e6762c87b8d983656baff09a93 100644 (file)
  */
 
 
+#ifndef C_API
+#include <sstream>
+using namespace std;
+#endif
 #include "api/info_base.h"
 #include "compression/abs_agent.h"
 
@@ -74,21 +78,22 @@ debug(cerr, base_ds);
      *info_base_locale = 0;
 
    char* nm ;
+   int i;
  
 //////////////////////
 // sets
 //////////////////////
    info_base_set_ptrs = new cset_handlerPtr[num_cset_ptrs];
 
-   for ( int i=0; i<num_cset_ptrs; i++ ) {
+   for ( i=0; i<num_cset_ptrs; i++ ) {
 
       nm = form("%s.%s", base_nm, info_base_set_names[i]);
 
-      try {
+      mtry {
          info_base_set_ptrs[i] = (cset_handler*)
               (f_obj_dict -> get_handler(nm));
       }
-      catch_any()
+      mcatch_any()
           {
          info_base_set_ptrs[i] = 0;
           }
@@ -104,11 +109,11 @@ debug(cerr, base_ds);
 
       nm = form("%s.%s", base_nm, info_base_list_names[i]);
 
-      try {
+      mtry {
          info_base_list_ptrs[i] = (dl_list_handler*)
              obj_dict.get_handler(nm);
       }
-      catch_any()
+      mcatch_any()
           {
          info_base_list_ptrs[i] = 0;
           }
@@ -195,23 +200,23 @@ int info_base::num_of_docs()
 //
 ////////////////////////////////////////////////////////////////////
 
-iterator::iterator( handler* x, c_code_t y) :
+Iterator::Iterator( handler* x, c_code_t y) :
    collection_hd(x), instance_c_code(y), ind(0)
 {
 }
 
-iterator::~iterator()
+Iterator::~Iterator()
 {
 }
 
-iterator::operator void*()
+Iterator::operator void*()
 { 
    return ( ind == 0 ) ? 0 : (void*)1; 
 }
 
 
 
-iterator* info_base::first(char* col_nm, c_code_t code)
+Iterator* info_base::first(char* col_nm, c_code_t code)
 {
    handler* x = get_set(col_nm);
 
@@ -233,7 +238,7 @@ iterator* info_base::first(char* col_nm, c_code_t code)
       throw(stringException("non page store no supported"));
    }
 
-   iterator* it = new iterator(x, code);
+   Iterator* it = new Iterator(x, code);
 
    it -> ind = s -> first_loc();
 
@@ -244,7 +249,7 @@ iterator* info_base::first(char* col_nm, c_code_t code)
    return it;
 }
 
-oid_t info_base::get_oid(const iterator& it)
+oid_t info_base::get_oid(const Iterator& it)
 {
    page_storage *s = (page_storage*)( it.collection_hd -> its_store() );
 
@@ -256,7 +261,7 @@ oid_t info_base::get_oid(const iterator& it)
    return r -> my_oid();
 }
 
-void info_base::next(iterator& it)
+void info_base::next(Iterator& it)
 {
    page_storage *s = (page_storage*)( it.collection_hd -> its_store());
 
index 1a2fb7865a395a0b1ee3429d3123eb7dd10ae1ec..dad56433968faa23ba74e64890afd5d1b17a7315 100644 (file)
 #include "object/cset.h"
 #include "object/dl_list.h"
 
-class iterator 
+class Iterator
 {
 public:
-   iterator( handler*, c_code_t );
-   ~iterator();
+   Iterator( handler*, c_code_t );
+   ~Iterator();
 
    operator void*();
 
@@ -106,9 +106,9 @@ public:
    mm_version& data_version() { return f_v; };
 
 // iterate over all instances with 'c_code' in a set or a list
-   iterator* first(char* col_nm, c_code_t c_code);
-   oid_t get_oid(const iterator& ind);
-   void next(iterator&);
+   Iterator* first(char* col_nm, c_code_t c_code);
+   oid_t get_oid(const Iterator& ind);
+   void next(Iterator&);
 
 #ifdef C_API
 // an integer id within the infolib
index e29c1d9c8ad3448e5ac342159eb161131097c6cf..69940cdeee216d5b58f0b28b4f6aeb1b436a51a2 100644 (file)
@@ -317,7 +317,7 @@ debug(cerr, base_name);
 
 //fprintf(stderr, "try to init %s\n", base_name);
 
-     try {
+     mtry {
         f_obj_dict -> init_a_base((char*)base_path, (char*)base_name);
 
         x = new info_base(*f_obj_dict, set_nm_list, list_nm_list,
@@ -328,7 +328,7 @@ debug(cerr, base_name);
         info_base_list.insert_as_tail(new dlist_void_ptr_cell(x));
      }
 
-     catch (mmdbException &,e)
+     mcatch (mmdbException &,e)
      {
 //fprintf(stderr, "in catch block\n");
        return 0;
@@ -445,7 +445,8 @@ info_lib::define_info_base( char* base_name, char* base_desc,
 /*************************************/
       char* lib_nm = form("%s/%s", info_lib_path, MAP_FILE_8_3);
 
-      fstream nm_out(lib_nm, ios::app, open_file_prot());
+      fstream nm_out(lib_nm, ios::out | ios::app);
+//    fstream nm_out(lib_nm, ios::app, open_file_prot());
 
       if ( !nm_out ) {
          MESSAGE(cerr, form("can't open %s/%s for append", 
@@ -454,7 +455,7 @@ info_lib::define_info_base( char* base_name, char* base_desc,
          throw(streamException(nm_out.rdstate()));
       }
 
-      if ( bytes(nm_out) == 0 ) {
+      if ( bytes(lib_nm) == 0 ) {
          char* lib_entry = form("%s\t%s\n", info_lib_name, unique_id());
 
          if ( !(nm_out << lib_entry) ) {
@@ -589,7 +590,7 @@ info_lib::getInfobaseByComponent(const char *locator_string, enum TestSelector s
       if (ib==0)
          throw(stringException("null info_base ptr"));
 
-      try { // since an infobase may not have any graphics, we catch
+      mtry { // since an infobase may not have any graphics, we catch
             // any exceptions there and try next infobase.
 
          switch (sel) {
@@ -615,7 +616,7 @@ info_lib::getInfobaseByComponent(const char *locator_string, enum TestSelector s
          }
       }
 
-      catch (mmdbException &,e)
+      mcatch (mmdbException &,e)
       {
       } end_try;
 
@@ -630,7 +631,8 @@ info_base**
 info_lib::getInfobasesByComponent(char **locator_strings, int count, enum TestSelector sel)
 {
    info_base** ibs = new info_basePtr[count];
-   for ( int i=0; i<count; ibs[i++] = 0 );
+   int i;
+   for ( i=0; i<count; ibs[i++] = 0 );
 
    info_base* ib = 0;
 
@@ -645,7 +647,7 @@ info_lib::getInfobasesByComponent(char **locator_strings, int count, enum TestSe
 
       for ( i=0; i<count; i++ ) {
 
-         try {
+         mtry {
    
             if ( locator_strings[i] && ibs[i] == 0 ) {         
               switch (sel) {
@@ -674,7 +676,7 @@ info_lib::getInfobasesByComponent(char **locator_strings, int count, enum TestSe
             }
          }
 
-         catch (mmdbException &,e)
+         mcatch (mmdbException &,e)
          {
          } end_try;
 
index 4622116103110a886c34ff746eb8067f46609ca8..10616eb6ee22cd1c6cf97ec76b7e0fc574710cc8 100644 (file)
@@ -55,6 +55,7 @@
 #include "dstr/dlist_void_ptr_cell.h"
 #include "api/info_base.h"
 #include "utility/funcs.h"
+#include "schema/object_dict.h"
 
 /*************************************/
 // The info_lib class
index c58a01b12771ef6bc11fa5436de7efd7d081ce1b..7a56ef5f531da09dc3399b127895c932ef89175c 100644 (file)
@@ -288,8 +288,8 @@ void smart_ptr::update_oid(int i, const oid_t& x)
    handler* z = get_handler(i, OID_CODE);
    oid_handler* y = (oid_handler*)z;
 
-   sprintf(buf, "%d.%d\n", x.ccode(), x.icode());
-   istrstream in(buf, 64);
+   sprintf(buf, "%d.%d\n", x.ccode(), (int)x.icode());
+   istringstream in(buf);
 
    (*y) -> asciiIn(in);
 
index 4216f4ec6c0ce5cdbd67037d644f04badeea296b..a3f4f688c7c9488cc07b787435c41517f28b26b4 100644 (file)
@@ -52,9 +52,9 @@
 #define _utility_h 1
 
 #ifdef C_API
-#include "utility/c_strstream.h"
+#include "utility/c_stringstream.h"
 #else
-#include <strstream.h>
+#include <sstream>
 #endif
 
 #include <string.h>
index e2eb84755435f6ba4393dc7c3360cb51f7159e7f..559a549f85521db74e1e1116642dc214c780f791 100644 (file)
@@ -23,7 +23,7 @@ XCOMM         .../programs/dtinfo/mmdb/<subdir>/Imakefile
 #define LargePICTable  YES
 
 #define CplusplusSource        YES
-DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
 
 XCOMM In DtMmdb we compile as C_API sources.
 DEFINES  = -DC_API
index 921b9bcc236be29adb2586fe44d7089b28f54d75..6b34452d9b7a5d088791f8356afaf39e3becc6a7 100644 (file)
@@ -289,7 +289,7 @@ bt_fast(t, key, data, exactp)
        const DBT *key, *data;
        int *exactp;
 {
-       EPG e;
+       static EPG e;
        PAGE *h;
        size_t nbytes;
        int cmp;
index 4a41bed9957dcca2357144e4712b22290d67fe03..ab698baefa4b88111de31e186be14f3d592f101c 100644 (file)
 #define        _CDEFS_H_
 
 #if defined(__cplusplus)
+#ifndef        __BEGIN_DECLS
 #define        __BEGIN_DECLS   extern "C" {
+#endif
+#ifndef        __END_DECLS
 #define        __END_DECLS     };
+#endif
 #else
 #define        __BEGIN_DECLS
 #define        __END_DECLS
@@ -79,7 +83,9 @@
 #undef  __P
 #endif
 #define        __P(protos)     protos          /* full-blown ANSI C */
+#ifndef __CONCAT
 #define        __CONCAT(x,y)   x ## y
+#endif
 #define        __STRING(x)     #x
 
 #else  /* !(__STDC__ || __cplusplus) */
  */
 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 #define __dead __volatile
+#ifndef __pure
 #define __pure __const
+#endif
 #else
 #define __dead
 #define __pure
index 9a85a10e6161b3bb95e1bbfde252115cf1c54c3a..fe4e715d1285701bebd917e4ac90c4e594c9dfe0 100644 (file)
@@ -111,13 +111,13 @@ bcopy(src0, dst0, length)
                /*
                 * Copy forward.
                 */
-               t = (int)src;   /* only need low bits */
-               if ((t | (int)dst) & wmask) {
+               t = (size_t)src;        /* only need low bits */
+               if ((t | (size_t)dst) & wmask) {
                        /*
                         * Try to align operands.  This cannot be done
                         * unless the low bits match.
                         */
-                       if ((t ^ (int)dst) & wmask || length < wsize)
+                       if ((t ^ (size_t)dst) & wmask || length < wsize)
                                t = length;
                        else
                                t = wsize - (t & wmask);
@@ -139,9 +139,9 @@ bcopy(src0, dst0, length)
                 */
                src += length;
                dst += length;
-               t = (int)src;
-               if ((t | (int)dst) & wmask) {
-                       if ((t ^ (int)dst) & wmask || length <= wsize)
+               t = (size_t)src;
+               if ((t | (size_t)dst) & wmask) {
+                       if ((t ^ (size_t)dst) & wmask || length <= wsize)
                                t = length;
                        else
                                t &= wmask;
index 4258cce2c3d0293c5dd78616839959f70c36bd21..bec78092765b71549e3ae2721ef3a2569f772fbc 100644 (file)
@@ -25,6 +25,7 @@
 #include "cdefs.h"
 
 #include <compat.h>
+#include <string.h>
 
 #ifdef __STDC__
 #include <stdarg.h>
@@ -52,7 +53,7 @@ snprintf(str, n, fmt, va_alist)
        va_start(ap);
 #endif
 #ifdef VSPRINTF_CHARSTAR
-       rp = vsprintf(str, fmt, ap);
+       rp = (char*)(size_t)vsprintf(str, fmt, ap);
        va_end(ap);
        return (strlen(rp));
 #else
@@ -70,7 +71,7 @@ vsnprintf(str, n, fmt, ap)
        va_list ap;
 {
 #ifdef VSPRINTF_CHARSTAR
-       return (strlen(vsprintf(str, fmt, ap)));
+       return (strlen((char*)(size_t)vsprintf(str, fmt, ap)));
 #else
        return (vsprintf(str, fmt, ap));
 #endif
index 58b0c63b2ce72abfa0b4daf12e29e1af2715a389..d7453dd17f4de8027c8d900849731bd2ef0bdf47 100644 (file)
@@ -23,7 +23,7 @@ XCOMM         .../programs/dtinfo/mmdb/<subdir>/Imakefile
 #define LargePICTable  YES
 
 #define CplusplusSource        YES
-DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
 
 XCOMM In DtMmdb we compile as C_API sources.
 DEFINES  = -DC_API
index 612403c7e975db6aeda342f4784c17f524847fc9..f6501bd8ea5156e4eaad1ba96eaa5b6919e58988 100644 (file)
@@ -400,11 +400,12 @@ io_status huff::cdrOut(buffer& buf)
 //MESSAGE(cerr, "huff::cdrOut");
 //debug(cerr, my_oid());
    static buffer v_out_buf(LBUFSIZ);
+   int i;
 
    if ( cts > 0 ) {
 //MESSAGE(cerr, "huff::cdrOut: dict out");
       int sz = sizeof(int);
-      for ( int i=0; i<cts; i++ ) {
+      for ( i=0; i<cts; i++ ) {
          sz += ( e_units[i] -> word -> size() +
                         sizeof(unsigned int) +
                         sizeof(char)
index decd747e654f143061d41c16aa6eab7584671d9f..dcf394331c27d631a659b62d1e40260a7cd3341f 100644 (file)
 
 #include <stdlib.h>
 
-#if !defined(__osf__) && !defined(USL)
+#if defined(__osf__) || defined(linux) || defined(CSRG_BASED)
+#include <unistd.h>
+#else
+#if !defined(__uxp__) && !defined(USL)
 #include <osfcn.h>
 #endif
+#endif
 
 /* use prototypes in function declarations */
 #define ps_USE_PROTOS
index 1720de22fb12fcd46c6bba48764db6c01ee0226e..24896568453238d83fa82ce7bf1c3586de1fb138 100644 (file)
 
 #include <stdlib.h>
 
-#if !defined(__osf__) && !defined(USL)
+#if defined(__osf__) || defined(linux) || defined(CSRG_BASED)
+#include <unistd.h>
+#else
+#if !defined(__uxp__) && !defined(USL)
 #include <osfcn.h>
 #endif
+#endif
 
 /* use prototypes in function declarations */
 #define sgml_USE_PROTOS
index 341d2fac4fec341591d73e58c6d41ad31d1b03dc..3f4fd2755ac3d533adcb6939514edfadf25d8246 100644 (file)
@@ -360,9 +360,9 @@ Boolean trie::travers_to(char* str, int len,
       
 
    node = root;
-   int j;
+   int i, j;
 
-   for ( int i=0; i<len; i++ ) {
+   for ( i=0; i<len; i++ ) {
       j = str[i];
 
 //debug(cerr, str[i]);
index 739be38a3b456e05f898c551896913f963c4ffc4..8350e8635648ca8111b473f190606038c8f88cd4 100644 (file)
@@ -61,6 +61,7 @@ void zip::compress(const buffer& uncompressed, buffer& compressed)
 // code for testing. I know it is slow. 
 ////////////////////////////////////////
 
+   int ret;
    fstream out(UNCOMPRESSED, ios::out|ios::trunc);
 
    if ( !out )
@@ -71,14 +72,14 @@ void zip::compress(const buffer& uncompressed, buffer& compressed)
 
    out.close();
 
-   system(form("gzip -c %s > %s", UNCOMPRESSED, COMPRESSED));
+   ret = system(form("gzip -c %s > %s", (char*)UNCOMPRESSED,(char*)COMPRESSED));
 
    fstream in(COMPRESSED, ios::in);
 
    if ( !in )
       throw(streamException(in.rdstate()));
 
-   int x = bytes(in);
+   int x = bytes((char*)COMPRESSED);
 
    compressed.expand_chunk(x);
 
@@ -94,6 +95,7 @@ void zip::compress(const buffer& uncompressed, buffer& compressed)
 
 void zip::decompress(buffer& compressed, buffer& uncompressed) 
 {
+   int ret;
    fstream out(COMPRESSED, ios::out|ios::trunc);
 
    if ( !out )
@@ -104,14 +106,14 @@ void zip::decompress(buffer& compressed, buffer& uncompressed)
 
    out.close();
 
-   system(form("gzip -cd %s > %s", COMPRESSED, UNCOMPRESSED));
+   ret = system(form("gzip -cd %s > %s",(char*)COMPRESSED,(char*)UNCOMPRESSED));
 
    fstream in(UNCOMPRESSED, ios::in);
 
    if ( !in )
       throw(streamException(in.rdstate()));
 
-   int x = bytes(in);
+   int x = bytes((char*)UNCOMPRESSED);
 
    uncompressed.expand_chunk(x);
 
index 3866f75376838c7060094ea15b087844d019b13c..497554c644b23505787bf0f8d2a76ababa8882dc 100644 (file)
@@ -23,7 +23,7 @@ XCOMM         .../programs/dtinfo/mmdb/<subdir>/Imakefile
 #define LargePICTable  YES
 
 #define CplusplusSource        YES
-DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
 
 XCOMM In DtMmdb we compile as C_API sources.
 DEFINES  = -DC_API
index c1b52024e705bdac8f3d53a0056f0738bc5c0c7c..2b68cc8fa27ab1e010d9e9fc6774956e1d9da72e 100644 (file)
@@ -315,7 +315,7 @@ void disk_hash::caching(disk_bucket& b, data_t& w, int slot_num)
 
       if ( x ) {
          hash_vector -> insert(
-                   voidPtr(ind), 
+                   (voidPtr)(size_t)ind,
                    x -> slot_num(k, r, p, hash_vector -> count())
                               );
       }
@@ -330,7 +330,7 @@ void disk_hash::caching(disk_bucket& b, data_t& w, int slot_num)
 // others may be overwritten. 
 ////////////////////////////////////////
    hash_vector -> insert(
-         voidPtr(slot_num), 
+         (voidPtr)(size_t)slot_num,
          w.slot_num(k, r, p, hash_vector -> count())
                         );
 }
index ea20792c13f32fb0502ebbe86561e33c14b313ca..6a846419d616c6bb61bd0aa56148aee2dba7a1b7 100644 (file)
@@ -23,7 +23,7 @@ XCOMM         .../programs/dtinfo/mmdb/<subdir>/Imakefile
 #define LargePICTable  YES
 
 #define CplusplusSource        YES
-DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
 
 XCOMM In DtMmdb we compile as C_API sources.
 DEFINES  = -DC_API
index 0ec178deb1eab5e5b781c7400aba537318615490..d2ccb3a9d90bd8ca7a84c4e8a45e857a7f4ae309 100644 (file)
@@ -53,7 +53,8 @@
 #ifdef C_API
 #include "utility/c_stream.h"
 #else
-#include <stream.h>
+#include <sstream>
+using namespace std;
 #endif
 
    
index 2d87cd0ab2f338ea5c789b6de926857769c907d3..fa9aa26a6512943d27786e5ce2ff8538ab428c87 100644 (file)
@@ -53,7 +53,8 @@
 #ifdef C_API
 #include "utility/c_stream.h"
 #else
-#include <stream.h>
+#include <sstream>
+using namespace std;
 #endif
 
 token_stack::token_stack() : curr_token_start(0)
index 8bcc1ac398b0d411084be441282ec8ef0845ae2a..793a39b0818587b5323db22302100c889a03291a 100644 (file)
@@ -56,7 +56,7 @@ CC_TPtrDlist<T>::CC_TPtrDlist(const CC_TPtrDlist<T>&adlist)
 template <class T>
 void CC_TPtrDlist<T>::clear()
 {
-  if ( !destructed ) {
+  if ( !this->get_destructed() ) {
     CC_TPtrSlistIterator<T> iter(*this);
     if (++iter) {
       while (1) {
@@ -82,7 +82,7 @@ template <class T>
 void CC_TPtrDlist<T>::clearAndDestroy()
 {
     
-    destructed = TRUE;
+    this->set_destructed(TRUE);
     CC_TPtrDlistIterator<T> iter(*this);
     if ( ++iter ) {
        while (1) {
index ec30dec80c4559396ddb89c7a7ace366abe0290b..48b3430fb3ad61dde63d51ac4adc48099c439815 100644 (file)
@@ -41,23 +41,6 @@ CC_TPtrSlist<T>::CC_TPtrSlist(const CC_TPtrSlist<T>&slist)
   
 }
 
-
-//------------------------------------------------------------------
-template<class T>
-T *CC_TPtrSlist<T>::at(size_t pos) const 
-{
-  
-// Hack to get it passed to iter
-  CC_TPtrSlistIterator<T> iter( *(CC_TPtrSlist<T> *)this );
-  for ( int i = 0; i <=pos; i++ ) {
-    if ( !(++iter) ) {
-      throw(CASTCCBEXCEPT ccBoundaryException(0,0,i));
-    }
-  }
-
-  return( iter.key() );
-}
-
 //------------------------------------------------------------------
 template<class T>
 T *CC_TPtrSlist<T>::removeAt(size_t pos) {
index 2f98686c709889bd092977060885043dfeb2a4f4..5d10f66cef5f5fb623d121e250eaf1ec44142f18 100644 (file)
@@ -25,6 +25,7 @@
 #define __CC_Slist_h
 
 #include "CC_Listbase.h"
+#include "cc_exceptions.h"
 
 template <class T> class CC_TPtrSlist;
 template <class T> class CC_TPtrSlistIterator;
@@ -65,7 +66,7 @@ class CC_TPtrSlist : public CC_Listbase
    friend class CC_List_Iterator<T>;
 
 protected:
-  CC_Boolean destructed;
+   CC_Boolean destructed;
 
 // Inherit public members from CC_Listbase
 /*
@@ -97,9 +98,20 @@ public:
   void insert(T* element)
   { CC_Listbase::append (new CC_Link<T> (element)); }
 
-  T*  at(size_t pos) const; /* throw boundaryException 
+  T*  at(size_t pos) const  /* throw boundaryException
                             * if list size is smaller than pos
                             */
+  {
+    // Hack to get it passed to iter
+    CC_TPtrSlistIterator<T> iter( *(CC_TPtrSlist<T> *)this );
+    for ( int i = 0; i <=pos; i++ ) {
+      if ( !(++iter) ) {
+        throw(CASTCCBEXCEPT ccBoundaryException(0,0,i));
+      }
+    }
+
+    return( iter.key() );
+  }
 
   T*  removeAt(size_t pos); /* throw boundaryException 
                             * if list size is smaller than pos 
@@ -146,7 +158,11 @@ public:
 
   operator CC_Listbase *() { return(this); }
 
+  CC_Boolean get_destructed() const
+    { return (destructed); }
 
+  CC_Boolean set_destructed(CC_Boolean what)
+    { destructed = what; }
 
 };
 
index e4cd29cd0f42265e80bd0ec34beb9b4e2d26b14c..ffcc3799656cfd33a3d07ec5806a497ad55dab19 100644 (file)
 // $XConsortium: CC_Stack.C /main/4 1996/10/08 19:22:53 cde-hal $
 #include "CC_Stack.h"
 
-//------------------------------------------------------------------------
-template <class T> Stack<T>::Stack ()
-{
-  Items = new CC_TValSlist<T>();
-}
-
-//-------------------------------------------------------------------------
-template <class T> Stack<T>::~Stack ()
-{
-  delete Items;
-}
-
-//-------------------------------------------------------------------------
-template <class T>
-void
-Stack<T>::push (const T newItem) 
-{
-  Items->append ( newItem );
-}
-
-//---------------------------------------------------------------------------
-template <class T>
-T 
-Stack<T>::pop () {
-  CC_Link<T> *last_elem = (CC_Link<T> *)Items->removeLast();
-
-  if ( !last_elem ) {
-    throw (Exception());
-  }
-
-  T *ret = last_elem->f_element;
-  delete last_elem;
-
-  T ret_value = *ret;
-  delete ret;
-
-  return(ret_value);
-}
-
-//---------------------------------------------------------------------------
-template <class T>
-T& 
-Stack<T>::top () const
-{
-  CC_Link<T> *last_elem = (CC_Link<T> *)Items->last();
-  if ( !last_elem ) {
-    throw(Exception());
-  }
-
-  return ( *last_elem->f_element );
-}
index 9a645fc3a300ba5b452fe74577217892ba07145a..e6f3a5146df066a9e3ca8424cac62e1cf11a3bb5 100644 (file)
@@ -31,19 +31,55 @@ template <class T> class Stack: public Destructable
 {
 
 public:
-  Stack ();  /* This is a value stack, ie an assignment operator  
-              * for T is assumed */
+  /* This is a value stack, ie an assignment operator for T is assumed */
+  Stack ()
+  {
+    Items = new CC_TValSlist<T>();
+  }
   
-  ~Stack ();
+  ~Stack ()
+  {
+    delete Items;
+  }
 
 public:
-  T    pop ();      
-  void push (const T);
-  T&   top () const;
+  T    pop ()
+  {
+    CC_Link<T> *last_elem = (CC_Link<T> *)Items->removeLast();
+
+    if ( !last_elem ) {
+      throw (Exception());
+    }
+
+    T *ret = last_elem->f_element;
+    delete last_elem;
+
+    T ret_value = *ret;
+    delete ret;
+
+    return(ret_value);
+  }
+
+  void push (const T newItem)
+  {
+    Items->append ( newItem );
+  }
+
+  T&   top () const
+  {
+    CC_Link<T> *last_elem = (CC_Link<T> *)Items->last();
+    if ( !last_elem ) {
+      throw(Exception());
+    }
+
+    return ( *last_elem->f_element );
+  }
+
   int   entries() const
   { 
     return( Items->entries() );  //ie no. of elements in the stack
   }
+
   int     empty() const {
     return( Items->entries() == 0 );
   }
index 4e7f43b35523740b90ecbe38f4d2eee7c8782c68..1912e41e2524de6405b1b198c9f6b969e9049624 100644 (file)
@@ -23,6 +23,7 @@
 // $XConsortium: cc_exceptions.C /main/4 1996/08/21 15:48:54 drk $
 
 #include "dti_cc/cc_exceptions.h"
+using namespace std;
 
 ostream& ccException::asciiOut(ostream& out)
 {
@@ -43,7 +44,7 @@ ostream& ccBoundaryException::asciiOut(ostream& out)
 {
    cerr << low << "\t";
    cerr << high << "\t";
-   cerr << index << "\n";
+   cerr << mindex << "\n";
    return out;
 }
 
index 2fffaa00519a56e589a3552c1e14975a50604858..5a149185ed2d1c4866153cf8fab9629fd98459d1 100644 (file)
@@ -25,7 +25,9 @@
 #ifndef _cc_exception_h
 #define _cc_exception_h 1
 
-#include <fstream.h>
+#include <fstream>
+#include <iostream>
+using namespace std;
 #include "Exceptions.hh"
 
 #define END_TRY end_try 
 extern int errno;
 #endif
 
-#if defined(linux)
-#define CASTCCEXCEPT (ccException*)
-#define CASTCCSEXCEPT (ccStringException*)
-#define CASTCCBEXCEPT (ccBoundaryException*)
-#else
 #define CASTCCEXCEPT
 #define CASTCCSEXCEPT
 #define CASTCCBEXCEPT
-#endif
 
 class ccException : public Exception
 {
@@ -69,7 +65,7 @@ protected:
 public:
    DECLARE_EXCEPTION(ccStringException, ccException);
 
-   ccStringException(char* m) : msg(m) {};
+   ccStringException(char const* m) : msg((char*)m) {};
    ~ccStringException() {};
 
    virtual ostream& asciiOut(ostream&);
@@ -81,13 +77,13 @@ class ccBoundaryException : public ccException
 protected:
    int low;
    int high;
-   int index;
+   int mindex;
 
 public:
    DECLARE_EXCEPTION(ccBoundaryException, ccException);
 
    ccBoundaryException(int l, int h, int i) : 
-     low(l), high(h), index(i) {};
+     low(l), high(h), mindex(i) {};
    ~ccBoundaryException() {};
 
    virtual ostream& asciiOut(ostream&);
index 020959b59cd932f4446993895f5969103690ccc9..98ab4498fe0345394d8209fc5f22b59e83b26f46 100644 (file)
@@ -1,30 +1,8 @@
-/*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these librararies and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
 // $TOG: cc_hdict.C /main/5 1998/04/17 11:45:00 mgreess $
 
 #include "dti_cc/cc_exceptions.h"
 
-#if !defined(__osf__) && !defined(linux)
+#if !defined(__osf__)
 template <class K, class V> CC_Boolean kv_pair<K, V>::f_needRemove = FALSE;
 #endif
 
index 1f0f4d944149b1aae12ef4a46c71ae0286e4bb9c..0254f9e4c903ccb06524bbe1c1a190c8943b4a1c 100644 (file)
@@ -29,7 +29,8 @@
 #include "dti_cc/cc_pvect.h"
 #include "dti_cc/CC_Slist.h"
 
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 
 template <class K, class V> 
 class kv_pair {
index d33d59c0799cc20a8e66785f95c0a02f2821722e..c70da6f778545cfe90becfb19d9beb9bc8aff8dd 100644 (file)
@@ -26,6 +26,7 @@
 #define _cc_dlist_array_h
 
 #include "dti_cc/CC_Dlist.h"
+#include "dti_cc/cc_exceptions.h"
 
 template <class T> 
 class dlist_array : public CC_TPtrDlist<T>
@@ -46,6 +47,21 @@ public:
    T* first() ;
 */
 
+   T*  at(size_t pos) const  /* throw boundaryException
+                             * if list size is smaller than pos
+                             */
+   {
+     // Hack to get it passed to iter
+     CC_TPtrSlistIterator<T> iter( *(CC_TPtrSlist<T> *)this );
+     for ( int i = 0; i <=pos; i++ ) {
+       if ( !(++iter) ) {
+         throw(CASTCCBEXCEPT ccBoundaryException(0,0,i));
+       }
+     }
+
+     return( iter.key() );
+   }
+
    T* operator()(size_t i) const { return at(i); };
    T* operator[](size_t i) const { return at(i); };
 };
index ac1288e684cbcd7ea2d7e8f45afec58f0e7871f6..4733257160575039b140148cd6e6f70f38dac4e7 100644 (file)
@@ -50,7 +50,7 @@ pointer_vector<T>::~pointer_vector()
 }
 
 template <class T> 
-T* pointer_vector<T>::operator[](size_t i) const
+T* pointer_vector<T>::operator[](ptrdiff_t i) const
 {
   if ( i<0 || i>= f_size )
     throw(CASTCCBEXCEPT ccBoundaryException(0, f_size-1, i));
@@ -59,7 +59,7 @@ T* pointer_vector<T>::operator[](size_t i) const
 }
 
 template <class T> 
-T*& pointer_vector<T>::operator[](size_t i) 
+T*& pointer_vector<T>::operator[](ptrdiff_t i)
 {
   if ( i<0 || i>= f_size )
     throw(CASTCCBEXCEPT ccBoundaryException(0, f_size-1, i));
index de9255e7b3424373691d75042b3a0623ef0f27b6..e702b60c80658ae2d955f9f92c86481c2e92eb6f 100644 (file)
@@ -25,6 +25,7 @@
 #ifndef _cc_pvector_h
 #define _cc_pvector_h 1
 
+#include <stddef.h>
 #include "dti_cc/types.h"
 
 template <class T> 
@@ -45,8 +46,8 @@ public:
    pointer_vector(size_t, T* = 0);
    ~pointer_vector();
 
-   T* operator[](size_t) const;
-   T*& operator[](size_t);
+   T* operator[](ptrdiff_t) const;
+   T*& operator[](ptrdiff_t);
 
 //   size_t entries() const { return f_items; };
    size_t length() const { return f_size; };
index 45299f5a6ce3651e3a9c937f4168e11f26445a0d..1d5497a19300f07b911390c4bf5bced5d166cd47 100644 (file)
@@ -80,7 +80,7 @@ Destructable::~Destructable()
 inline void
 Destructable::destruct()
 {
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
   delete this;
 #else
   // Have to call this here since some compilers don't allow
index 6adffafcfb7b9faef9fb02e6963d839df130a390..9fbc7cfeffbdc678e74448d2b39188ad8bf5d6ef 100644 (file)
@@ -1,13 +1,9 @@
-// $TOG: Exception.hh /main/11 1998/04/20 09:55:15 mgreess $
+
 #include <ctype.h>
 
 #define G_TEMP_SPACE_SIZE 1024
 
-#if defined(linux)
-#define CASTEXCEPT (Exception*)
-#else
 #define CASTEXCEPT
-#endif
 
 class Exception : public Destructable
 {
@@ -158,7 +154,7 @@ private:
     { Exception *temp; \
       if (in_stack()) { \
        temp = new (0) NAME (*this); \
-       (Exception *) (((NAME *)temp)->f_temporary = 1); \
+       ((NAME *)temp)->f_temporary = 1; \
       } else \
         temp = this; \
       temp->do_throw (line, file, dbg); } \
index 4ac43740d5ab6cc9016f81b69f75e05f68d2af95..79b241030afb13a3601208fe06db8bc9a09645fa 100644 (file)
@@ -43,42 +43,47 @@ char* Exceptions::f_msg_out_of_exception_memory = 0;
 char* Exceptions::f_msg_out_of_obj_stack_memory = 0;
 char* Exceptions::f_msg_memory_already_freed = 0;
 #else
-char *Exceptions::f_msg_internal_error =     "Internal exceptions error:";
-char *Exceptions::f_msg_application_error =  "Application exceptions error:";
-char *Exceptions::f_msg_throw_message =      "Application threw exception:";
+char *Exceptions::f_msg_internal_error =
+  (char*)"Internal exceptions error:";
+
+char *Exceptions::f_msg_application_error =
+  (char*)"Application exceptions error:";
+
+char *Exceptions::f_msg_throw_message =
+  (char*)"Application threw exception:";
 
 char *Exceptions::f_msg_not_initialized =
-  "Exceptions library not initialized with INIT_EXCEPTIONS().";
+  (char*)"Exceptions library not initialized with INIT_EXCEPTIONS().";
 
 char *Exceptions::f_msg_initialized_twice =
-  "Attept to call INIT_EXCEPTIONS() more than once.";
+  (char*)"Attept to call INIT_EXCEPTIONS() more than once.";
   
 char *Exceptions::f_msg_not_caught =
-  "Exception not caught.";
+  (char*)"Exception not caught.";
 
 char *Exceptions::f_msg_no_current_exception =
-  "There is no current exception (for catch or rethrow).";
+  (char*)"There is no current exception (for catch or rethrow).";
 
 char *Exceptions::f_msg_throw_from_terminate =
-  "Exceptions may not be thrown from terminate.";
+  (char*)"Exceptions may not be thrown from terminate.";
 
 char *Exceptions::f_msg_throw_from_error_handler =
-  "Exceptions may not be thrown from error handler.";
+  (char*)"Exceptions may not be thrown from error handler.";
 
 char *Exceptions::f_msg_throw_from_destructor =
-  "Exited destructor with throw while handling an exception.";
+  (char*)"Exited destructor with throw while handling an exception.";
 
 char *Exceptions::f_msg_throw_ptr_to_stack =
-  "Threw a pointer to an automatic (stack-based) exceptions object.";
+  (char*)"Threw a pointer to an automatic (stack-based) exceptions object.";
 
 char *Exceptions::f_msg_out_of_exception_memory =
-  "Not enough memory to allocate an exception object.";
+  (char*)"Not enough memory to allocate an exception object.";
 
 char *Exceptions::f_msg_out_of_obj_stack_memory =
-  "Not enough memory to allocate object stack.";
+  (char*)"Not enough memory to allocate object stack.";
 
 char *Exceptions::f_msg_memory_already_freed =
-  "Tried to alloc or realloc pool memory that was previously freed.";
+  (char*)"Tried to alloc or realloc pool memory that was previously freed.";
 
 #endif
 
@@ -183,7 +188,7 @@ Exceptions::error (const char *message, error_type_t error_type)
   // Call user print function if set, otherwise just dump lines.
   if (g_error_handler != NULL)
     {
-      try
+      mtry
        {
          // Reset global variable to NULL before calling to prevent
          // the possibility of recursive calls. 
@@ -191,7 +196,7 @@ Exceptions::error (const char *message, error_type_t error_type)
          (*current) ((const char**)lines, count);
          set_error_handler (current);
        }
-      catch_any()
+      mcatch_any()
        {
          // Error handler will be NULL at this point. 
          Exceptions::error (Exceptions::f_msg_throw_from_error_handler,
index 754b3427ecd398621e75e910c38fd72abdcd3a28..e0e08f35b4def3567570e5b85b962c63bdc47a26 100644 (file)
@@ -4,14 +4,27 @@
 
 #define _Exceptions_hh_active
 
+#ifndef C_API
 #ifndef NATIVE_EXCEPTIONS
+#define NATIVE_EXCEPTIONS
+#endif
+#define Exception mException
+#endif
 
+#ifndef NATIVE_EXCEPTIONS
 extern "C" {
 #include <setjmp.h>
 #include <stdio.h>
 #include <stdlib.h>
 }
+#else
+extern "C" {
+#include <stdio.h>
+#include <stdlib.h>
+}
+#endif
 
+#ifndef NATIVE_EXCEPTIONS
 #ifdef EXC_DEBUG
 #define PRINTF(MSG) printf MSG
 #ifndef DEBUG
@@ -45,12 +58,14 @@ extern "C" {
 
 #define INIT_EXCEPTIONS()
 
-#define throw(OBJ) throw OBJ
+#define mthrow(OBJ) throw OBJ
 #define rethrow throw
 
-#define catch_any() catch(...)
-#define catch_noarg(OBJ) catch(OBJ)
-#define catch(TYPE,OBJ) catch(TYPE OBJ)
+#define mtry try
+
+#define mcatch_any() catch(...)
+#define mcatch_noarg(OBJ) catch(OBJ)
+#define mcatch(TYPE,OBJ) catch(TYPE OBJ)
 
 #define end_try
 
@@ -64,7 +79,7 @@ extern "C" {
 
 // TRY MACRO 
 
-#define try \
+#define mtry \
   { \
     Jump_Environment __jump_env; \
     if (setjmp (__jump_env.f_env) == 0) {
@@ -81,10 +96,10 @@ extern "C" {
 // This works if OBJ is an object or a pointer since Exception objects
 // overload operator ->.
 #if !defined(hpux) && !defined(USL)
-#define throw(OBJ) \
+#define mthrow(OBJ) \
   (OBJ)->throw_it (__LINE__, __FILE__, DEBUG_THROW_FLAG)
 #else
-#define throw(OBJ) \
+#define mthrow(OBJ) \
   OBJ->throw_it (__LINE__, __FILE__, DEBUG_THROW_FLAG)
 #endif
 
@@ -105,16 +120,16 @@ extern "C" {
 #define PRINT_CATCH
 #endif
 
-#define catch_any() \
+#define mcatch_any() \
     } else if (1) { \
       PRINT_CATCH
 
-#define catch_noarg(OBJ) \
+#define mcatch_noarg(OBJ) \
     } else if (Exception::current_exception().isa (STRINGIFY(OBJ))) { \
       PRINT_CATCH
 
-#define catch(TYPE,OBJ) \
-    catch_noarg (TYPE) \
+#define mcatch(TYPE,OBJ) \
+    mcatch_noarg (TYPE) \
     TYPE OBJ = (TYPE) Exception::current_exception();
 
 #define end_try \
index b28fbd147d77d5092050ec77425b72685c48d0ff..c13a8dc4c4cad09d453107a582fd3bd96203dc2b 100644 (file)
@@ -23,7 +23,7 @@ XCOMM         .../programs/dtinfo/mmdb/<subdir>/Imakefile
 #define LargePICTable  YES
 
 #define CplusplusSource        YES
-DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
 
 #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3
 EXCEPTION_DEFINES  = -DHAS_TERMINATE
index cceb8f12e3f6a5e4e3f0fa4ee1dd61d3b7c9f467..b732feda0c1108cbb5adc1bda07b8874d41f6642 100644 (file)
 void initialize_exception()
 {
 
-Exceptions::f_msg_internal_error =     "Internal exceptions error:";
-Exceptions::f_msg_application_error =  "Application exceptions error:";
-Exceptions::f_msg_throw_message =      "Application threw exception:";
+Exceptions::f_msg_internal_error =     (char*)"Internal exceptions error:";
+Exceptions::f_msg_application_error =  (char*)"Application exceptions error:";
+Exceptions::f_msg_throw_message =      (char*)"Application threw exception:";
 
 Exceptions::f_msg_not_initialized =
-  "Exceptions library not initialized with INIT_EXCEPTIONS().";
+  (char*)"Exceptions library not initialized with INIT_EXCEPTIONS().";
 
 Exceptions::f_msg_initialized_twice =
-  "Attept to call INIT_EXCEPTIONS() more than once.";
+  (char*)"Attept to call INIT_EXCEPTIONS() more than once.";
   
 Exceptions::f_msg_not_caught =
-  "Exception not caught.";
+  (char*)"Exception not caught.";
 
 Exceptions::f_msg_no_current_exception =
-  "There is no current exception (for catch or rethrow).";
+  (char*)"There is no current exception (for catch or rethrow).";
 
 Exceptions::f_msg_throw_from_terminate =
-  "Exceptions may not be thrown from terminate.";
+  (char*)"Exceptions may not be thrown from terminate.";
 
 Exceptions::f_msg_throw_from_error_handler =
-  "Exceptions may not be thrown from error handler.";
+  (char*)"Exceptions may not be thrown from error handler.";
 
 Exceptions::f_msg_throw_from_destructor =
-  "Exited destructor with throw while handling an exception.";
+  (char*)"Exited destructor with throw while handling an exception.";
 
 Exceptions::f_msg_throw_ptr_to_stack =
-  "Threw a pointer to an automatic (stack-based) exceptions object.";
+  (char*)"Threw a pointer to an automatic (stack-based) exceptions object.";
 
 Exceptions::f_msg_out_of_exception_memory =
-  "Not enough memory to allocate an exception object.";
+  (char*)"Not enough memory to allocate an exception object.";
 
 Exceptions::f_msg_out_of_obj_stack_memory =
-  "Not enough memory to allocate object stack.";
+  (char*)"Not enough memory to allocate object stack.";
 
 Exceptions::f_msg_memory_already_freed =
-  "Tried to alloc or realloc pool memory that was previously freed.";
+  (char*)"Tried to alloc or realloc pool memory that was previously freed.";
 
    Unwind_Stack::g_stack = new Unwind_Record[UNWIND_STACK_SIZE];
    Exception::g_temp_space = new char[G_TEMP_SPACE_SIZE];
index eacd2b5941525c2aeed4c13e1fc4311af2696946..036869a86abb6e60229bc31d5714d8f8d7a96d5e 100644 (file)
@@ -54,7 +54,8 @@ void class_name::operator delete( void* p )\
 
 
 #else
-#include <new.h>
+#include <new>
+using namespace std;
 #endif
 
 
index 8d30ebb5a31fffb1c61827781c4ee1d1f45259b4..90d4b8eedb9a0fb120d82f0bc94dd2b71a5ea5f3 100644 (file)
@@ -48,11 +48,11 @@ terminate()
       // abuse in the terminate handler. 
       PFV handler = _terminate_handler;
       _terminate_handler = NULL;
-      try
+      mtry
        {
          (*handler)();
        }
-      catch_any()
+      mcatch_any()
        {
          Exceptions::error (Exceptions::f_msg_throw_from_terminate,
                             Exceptions::APPLICATION_ERROR);
index 0c25071b8dfda5bd954c933e0e228890aa95847c..ebcc961ac4dd75dc92fa21dd49c76996b6fed209 100644 (file)
@@ -23,7 +23,7 @@ XCOMM         .../programs/dtinfo/mmdb/<subdir>/Imakefile
 #define LargePICTable  YES
 
 #define CplusplusSource        YES
-DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
 
 XCOMM In DtMmdb we compile as C_API sources.
 DEFINES  = -DC_API
index 3050585c35c88b946264647c80f46dce516a267d..59d135f8c669f2d2600efc9bfa7a6c7a70bb617a 100644 (file)
@@ -44,7 +44,8 @@
 
 #include <sys/time.h>
 #include <math.h>
-#include <fstream.h>
+#include <fstream>
+using namespace std;
 #include <search.h>
 #include "dynhash/bucket.h"
 
index 33695a3ecb13ccd57eb7fb94bdf73abaf50e45ed..99a896db71ddf15a65dd7f764cef22777b36d8a8 100644 (file)
@@ -59,7 +59,7 @@ atoi_larson* data_t::larson_convertor_ptr;
 atoi_pearson* data_t::pearson_convertor_ptr;
 #else
 atoi_larson data_t::larson_convertor;
-atoi_pearson data_t::pearson_convertor(MAXSHORT, 256);
+atoi_pearson data_t::pearson_convertor(SHRT_MAX, 256);
 #endif
 
 data_t::data_t(data_t& d)
@@ -214,7 +214,7 @@ istream& operator >>(istream& i, data_t& d)
       delete d.key.str_key;
 
    d.flag = (data_t::flag_type)atoi(buf);
-   d.dt = voidPtr(atoi(voidPtr_ptr));
+   d.dt = (voidPtr)(size_t)atoi(voidPtr_ptr);
 
    if ( d.flag == data_t::INT )
       d.key.int_key = atoi(key_ptr);
index bf01029a96a88d2356499ad924d482b48771b067..04fb178376978b3bde4ba1747c191326af6ecb67 100644 (file)
@@ -53,7 +53,8 @@
 #ifdef C_API
 #include "utility/c_iostream.h"
 #else
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 #endif
 
 int steps[] = { 2, 3, 5, 7, 11, 13, 17, 21, 23, 29, 31, 37, 41, 43, 47, 51 };
@@ -129,7 +130,8 @@ void imp_die::alloc_table(int new_H)
 
 void imp_die::init_table()
 {
-   for ( int i = 0; i < B; i++ ) {
+   int i;
+   for ( i = 0; i < B; i++ ) {
       bucket_array[i] = 0 ; 
    }
    for ( i = 0; i < H; i++ ) {
@@ -142,7 +144,8 @@ void imp_die::clean()
    n = 0;
    collect_all_keys();
 
-   for ( int i=0; i<B; i++ ) {
+   int i;
+   for ( i=0; i<B; i++ ) {
       if ( bucket_array[i] ) {
          delete bucket_array[i];
          bucket_array[i] = 0 ;
index 677861997e913a9c9202c10424ca7d03be3def8c..82d99ce0a84e17d48e47d9318c8742e04fdb041d 100644 (file)
@@ -23,7 +23,7 @@ XCOMM         .../programs/dtinfo/mmdb/<subdir>/Imakefile
 #define LargePICTable  YES
 
 #define CplusplusSource        YES
-DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
 
 XCOMM In DtMmdb we compile as C_API sources.
 DEFINES  = -DC_API -DPORTABLE_DB
index d174aeec686d98a7462dc7f70f198ce893e02797..f67eb6b6b25a32e9807291d86f81b89bd95bbc0c 100644 (file)
@@ -140,7 +140,8 @@ h_convertor(pms.v_n, 128, rnd)
 {
    v_bucket_array = new bucketPtr[v_no_buckets]; 
 
-   for ( int i=0; i<v_no_buckets; v_bucket_array[i++] = 0);
+   int i;
+   for ( i=0; i<v_no_buckets; v_bucket_array[i++] = 0);
 
 //debug(cerr, pms);
 
@@ -234,7 +235,8 @@ void buckets::sort_by_size()
 {
 //MESSAGE(cerr, "sort()");
    int* links = new int[v_no_buckets];
-   for ( int i=0; i<v_no_buckets; links[i++]=-1 );
+   int i;
+   for ( i=0; i<v_no_buckets; links[i++]=-1 );
 
    int* sizes = new int[v_max_bucket_sz+1];
    for ( i=0; i<v_max_bucket_sz+1; sizes[i++]=-1 );
index 2113df027c5baefcccf83746eed9ac15ebd533e4..c48aab03976c40b08a45123894e2e9681a9216d5 100644 (file)
@@ -57,7 +57,7 @@
 
 //compute_a_mphf(char* key_file, params& pms, char* mphf_spec_file)
 
-compute_a_mphf(char** keys, params& pms, buffer& mphf_buffer)
+int compute_a_mphf(char** keys, params& pms, buffer& mphf_buffer)
 {
    mphf_hash_table ht(pms);      
 
@@ -98,7 +98,7 @@ compute_a_mphf(char** keys, params& pms, buffer& mphf_buffer)
    return 1;
 }
 
-search(buckets& bs, mphf_hash_table& ht, params& pms)
+int search(buckets& bs, mphf_hash_table& ht, params& pms)
 {
    int i = 0,
        fails = 0,
@@ -158,7 +158,7 @@ search(buckets& bs, mphf_hash_table& ht, params& pms)
    return ( patternFit >= 0 ) ? 0 : -1;
 }
 
-verify(buckets& bs, mphf_hash_table& ht, params& pms)
+int verify(buckets& bs, mphf_hash_table& ht, params& pms)
 {
    int i;
    int_pattern new_pattern(bs.max_bucket_sz());
@@ -246,7 +246,7 @@ int write_spec(buckets& bs, params& pms, buffer& mphf_buffer)
    mphf_buffer.put((char*)c_array, g_array_bytes); mphf_buffer.put('\n');
 */
 
-   ostrstream fout(mphf_buffer.get_base(), mphf_buffer.buf_sz(), ios::out);
+   ostringstream fout(mphf_buffer.get_base(), ios::out);
 
    fout << pms.v_n << "\n";
    fout << pms.v_b << "\n";
@@ -267,6 +267,7 @@ int write_spec(buckets& bs, params& pms, buffer& mphf_buffer)
 
 
    mphf_buffer.set_content_sz(spec_bytes);
+   memcpy(mphf_buffer.get_base(), fout.str().c_str(), spec_bytes);
 
    delete c_array;
 
index ef04185cdeb8cc3c52621fd93fed9eb46609b24e..6c0962b628030c13d24561211ee5bbe6121eaece 100644 (file)
@@ -53,9 +53,9 @@
 #define _mphf_funcs_h 1
 
 #ifdef C_API
-#include "utility/c_strstream.h"
+#include "utility/c_stringstream.h"
 #else
-#include <strstream.h>
+#include <sstream>
 #endif
 
 #include "utility/funcs.h"
index fc7c30876272f704eb62d690746965b0ff9ad4e2..b9c923c2f1f267664f1cd1e8b2130ea70ff5b6f0 100644 (file)
@@ -152,10 +152,10 @@ int mphf_hash_table::fit_hash_table(int_pattern& pat)
 {
    int i, j;
    for ( i=0; i<pat.no_elmts(); i++ ) {
-      if ( v_rep[int(pat[i])] != (int) NULL ) {
+      if ( v_rep[int(pat[i])] != (int) 0 ) {
 
          for ( j=0; j<=i; j++ ) 
-           v_rep[int(pat[j])] = (int) NULL; 
+           v_rep[int(pat[j])] = (int) 0;
      
          v_num_filled_slots -= i+1;
          return -1;
index d52bfc3d8c7516dc4bed5d92056ea4055dfde467..701123f9ee141075d98cfd4482ee5125b8358cc9 100644 (file)
@@ -62,7 +62,8 @@ struct partition_t {
 
 void params::select_value(float bts)  
 {
-   for ( int i=0; ; i++ ) {
+   int i;
+   for ( i=0; ; i++ ) {
       if ( v_n <= partition_tbl[i].upper_bound )
          break;
    }
index 42fd184f679e54db53c8824cd36ad1c470d4722d..588ed568c4fc9ac66c3c28de027625aa5ae46ddf 100644 (file)
 #ifndef _params_h
 #define _params_h 1
 
+#include <limits.h>
+#if defined(CSRG_BASED)
+#define MAXINT INT_MAX
+#else
 #include <values.h>
+#endif
 #include "utility/funcs.h"
 
 class params 
index 230f9a8c41a71351afd9c46c3fe8b92291ca71e1..532a5f9468561e5cb262066846f5e4e930829ba9 100644 (file)
@@ -78,7 +78,8 @@ void sorter::_init(istream& in)
 {
    v_bucket_array = new bucketPtr[NUM_BUCKETS];
 
-   for ( int i=0; i<NUM_BUCKETS; v_bucket_array[i++] = 0);
+   int i;
+   for ( i=0; i<NUM_BUCKETS; v_bucket_array[i++] = 0);
 
    char key_buf[LBUFSIZ];
 
@@ -105,7 +106,8 @@ void sorter::_init(istream& in)
 
 sorter::~sorter() 
 {
-   for ( int i=0; i<NUM_BUCKETS; delete v_bucket_array[i++] );
+   int i;
+   for ( i=0; i<NUM_BUCKETS; delete v_bucket_array[i++] );
    delete v_bucket_array;
 
    for ( i=0; i<v_no_unique_keys; delete v_unique_keys[i++] );
@@ -117,7 +119,8 @@ void sorter::filter_by_hash()
 // a small hash table for keys to map to
    v_map_table = new charPtr[2*v_max_bucket_sz];
 
-   for ( int i=0; i<2*v_max_bucket_sz; v_map_table[i++] = 0 );
+   int i;
+   for ( i=0; i<2*v_max_bucket_sz; v_map_table[i++] = 0 );
 
 // an int table remembering slots in the v_map_table
 // that have been mapped.
@@ -283,7 +286,8 @@ void sorter::remove_keys(bucketPtr bkt, char* key, slist_void_ptr_cell* lp)
 
 void sorter::assemble_unique_keys()
 {
-   for ( int i=0; i<NUM_BUCKETS; i++ ) {
+   int i;
+   for ( i=0; i<NUM_BUCKETS; i++ ) {
       if ( v_bucket_array[i] ) {
          v_no_unique_keys += v_bucket_array[i] -> v_no_keys;
       }
index 5e65e36e471efebc75954aea7405fdab593d8e18..2e1c50d762ca75ca480c3138574b2689ec94e080 100644 (file)
 #ifndef _sorter_h
 #define _sorter_h 1
 
+#include <limits.h>
+#if defined(CSRG_BASED)
+#define MAXINT INT_MAX
+#else
 #include <values.h>
+#endif
 #include "utility/funcs.h"
 #include "utility/atoi_fast.h"
 #include "hmphf/buckets.h"
index cb37a9b62c4e2524396a6154c57c8c8dfadb0647..e82b53f3cd041c87e670ca329d8720cceaadf9a7 100644 (file)
@@ -23,7 +23,7 @@ XCOMM         .../programs/dtinfo/mmdb/<subdir>/Imakefile
 #define LargePICTable  YES
 
 #define CplusplusSource        YES
-DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
 
 XCOMM In DtMmdb we compile as C_API sources.
 DEFINES  = -DC_API -DPORTABLE_DB
index 4ae5708d56f9b35b1a75768fc70408c591d25d85..ea00337c7328c085b159310538b844238e0b59d2 100644 (file)
@@ -76,7 +76,7 @@ btree_index::~btree_index()
    delete v_idx_agent_ptr;
 }
 
-int btree_index::handler_to_inv_idx(const handler& query)
+size_t btree_index::handler_to_inv_idx(const handler& query)
 {
    get_key_string(query);
 
@@ -85,7 +85,7 @@ int btree_index::handler_to_inv_idx(const handler& query)
    if ( v_idx_agent_ptr -> member(k) == false )
      throw(stringException("first_of_invlist(): key is not in btree"));
 
-   return int(k.dt);
+   return size_t(k.dt);
 }
 
  
index 0475e38edcb70667a8317b2fee774aa2fe659233..bcf0549d1b281454afaf6966739196ffef004f1b 100644 (file)
@@ -65,7 +65,7 @@ public:
 //init run time data members
    Boolean init_data_member( inv_lists_handler*, const char* btree_store );
 
-   int handler_to_inv_idx(const handler& query);
+   size_t handler_to_inv_idx(const handler& query);
 
    MMDB_SIGNATURES(btree_index);
 };
index 638b78336e3a5e15882086727b475a29c98b1fcf..8907f44beb2af5b00a1219ac566c2ea0e772a2b6 100644 (file)
@@ -72,7 +72,7 @@ dyn_disk_index::init_data_member(inv_lists_handler* y, abs_storage* store)
    return true;
 }
 
-int dyn_disk_index::handler_to_inv_idx(const handler&)
+size_t dyn_disk_index::handler_to_inv_idx(const handler&)
 {
    throw(stringException("handler_to_int() not implemented"));
    return 0;
index 53f0e161c4fb19853b243cb2fb7da55551551818..13436a90bc98f38388314322e1f52b9ede78b998 100644 (file)
@@ -65,7 +65,7 @@ public:
 //init run time data components
    Boolean init_data_member( inv_lists_handler*, abs_storage* );
 
-   int handler_to_inv_idx(const handler&);
+   size_t handler_to_inv_idx(const handler&);
 
    MMDB_SIGNATURES(dyn_disk_index);
 };
index 7f9f54587d8771b197b7c3b774b9d1dc1c1633a4..cc64dae5b8adf8366bbd8cde6daa4b4be046054b 100644 (file)
@@ -160,7 +160,7 @@ MESSAGE(cerr, "insert to list after");
 
        (*v_inv_lists_hd) -> append_list(list);
 
-       intKey.dt = voidPtr((*v_inv_lists_hd) -> count());
+       intKey.dt = (voidPtr)(size_t)(*v_inv_lists_hd) -> count();
 //debug(cerr, int(intKey.dt));
 
        v_idx_agent_ptr -> insert( intKey );
index 3442496826a9c53d470b9b89f53b919c3dd8b433..b697e6f7fb9fbaac81dee424c5d044744118a9c2 100644 (file)
@@ -93,7 +93,7 @@ dyn_memory_index::~dyn_memory_index()
       char buf[PATHSIZ]; 
       for ( int i=0; i<PATHSIZ; buf[i++]=0 );
 
-      ostrstream oid_t_out(buf, PATHSIZ);
+      ostringstream oid_t_out(buf, PATHSIZ);
       my_oid().asciiOut(oid_t_out);
 */
 
@@ -106,7 +106,7 @@ dyn_memory_index::~dyn_memory_index()
    }
 }
 
-int dyn_memory_index::handler_to_inv_idx(const handler&)
+size_t dyn_memory_index::handler_to_inv_idx(const handler&)
 {
    throw(stringException(
          "dyn_memory_index::handler_to_int(): not implemented yet"
index 469932d0fc564da27adbf1b48581e152d819a5ae..88e462b91051eb7b89d917f87e152ee0817a5e82 100644 (file)
@@ -67,7 +67,7 @@ public:
 //init run time data components
    Boolean init_data_member( inv_lists_handler*, abs_storage* );
 
-   int handler_to_inv_idx(const handler&);
+   size_t handler_to_inv_idx(const handler&);
 
    virtual Boolean remove_loc(handler&, const oid_t&);
    virtual Boolean remove_loc(const oid_t&, const oid_t&);
index efaed7d1d52bd5c0c17cd3fc5f13cf309f47fe0c..87bb4a5697a1c4453e78e3f8b4bdd07604cce110 100644 (file)
@@ -398,11 +398,14 @@ Boolean fast_mphf::build(istream& in)
       throw(stringException("finding a mphf failed"));
    }
    
-   istrstream strin(mphf_spec.get_base(), mphf_spec.content_sz());
+   stringstream strin;
 
    if ( !strin ) {
       throw(streamException(strin.rdstate()));
    }
+   else {
+      strin.write(mphf_spec.get_base(), mphf_spec.content_sz());
+   }
 
    asciiIn(strin);
 
index 471ca3811fcc6378826ba970cbc025c277ff8270..055a6051a843549ed8f252ccb377574ec3451a4e 100644 (file)
@@ -107,10 +107,11 @@ oid_t c_index::first_of_invlist(int ind)
 
 Boolean c_index::get_key_string(const handler& t) const
 {
-   ostrstream out(v_static_key.get(), v_static_key.alloc_size());
+   ostringstream out(v_static_key.get());
 
    ((handler&)t) -> asciiOut(out);
-   v_static_key.set_size(out.pcount());
+   v_static_key.set_size(out.str().size());
+   strcpy(v_static_key.get(), out.str().c_str());
 
    return true;
 }
@@ -119,10 +120,11 @@ Boolean c_index::get_key_string(const oid_t& t) const
 {
    v_static_key.reset();
 
-   ostrstream out(v_static_key.get(), v_static_key.alloc_size());
+   ostringstream out(v_static_key.get());
    t.asciiOut(out);
 
-   v_static_key.set_size(out.pcount());
+   v_static_key.set_size(out.str().size());
+   strcpy(v_static_key.get(), out.str().c_str());
 
    return true;
 }
index acc58492a74efff59ab2708cc6aed4a097054393..c6784aa80d5364f4dfcbd9015666785303458dfe 100644 (file)
@@ -52,9 +52,9 @@
 #define _index_h 1
 
 #ifdef C_API
-#include "utility/c_strstream.h"
+#include "utility/c_stringstream.h"
 #else
-#include <strstream.h>
+#include <sstream>
 #endif
 
 #include "object/oid_list.h"
@@ -100,7 +100,7 @@ public:
    virtual int invlist_length(handler&) = 0;
 
 // translate a query to an index of an inv_list
-   virtual int handler_to_inv_idx(const handler& query) = 0;
+   virtual size_t handler_to_inv_idx(const handler& query) = 0;
 
 // status inquiry functions
    int bound_to() const { return v_cmp_selector; } ;
index 1db0b31ca7724fd929ea904a0573758273553318..f95552e9bff846eff3e049a796e3298625caed95 100644 (file)
@@ -151,7 +151,7 @@ MESSAGE(cerr, "inv::insert");
 debug(cerr, index);
 */
 
-   if ( INRANGE(list_id.ccode(), 0, 1) && 
+   if ( INRANGE((short)list_id.ccode(), 0, 1) &&
         id.ccode() != OID_LIST_CODE 
    ) {
 
index 033cd0dd5156a6053458bd25adce1da45eaa27de..e4947801fc4bf8a3a0785ffadea8beea0fd079b3 100644 (file)
@@ -193,7 +193,7 @@ oid_list_handler* mphf_index::get_loc_list(const oid_t& )
    return 0;
 }
 
-int mphf_index::handler_to_inv_idx(const handler& t) 
+size_t mphf_index::handler_to_inv_idx(const handler& t)
 {
    get_key_string(t);
 //debug(cerr, v_static_key);
@@ -224,7 +224,7 @@ Boolean mphf_index::batch_index_begin()
 {
 /*
 MESSAGE(cerr, "batch_index_begin()");
-debug(cerr, cmp_selector);
+debug(cerr, v_cmp_selector);
 debug(cerr, count());
 debug(cerr, int(this));
 */
index 3f47dfb0d23d8ce9518cde36a2b96d5dea6fb9d5..b8301c8079c0390c8689521537ff59230f9b42cd 100644 (file)
@@ -97,7 +97,7 @@ public:
    virtual oid_t first_of_invlist(const handler&);
 
 //
-   int handler_to_inv_idx(const handler& query);
+   size_t handler_to_inv_idx(const handler& query);
 
 // status inquiry functions
    virtual Boolean sorted() const { return false; };  
index 6a1bd448e06192361c82b63d84f5d006173769a1..2de957684257746e2cada63b1c8fc66ec01d78ab 100644 (file)
@@ -23,7 +23,7 @@ XCOMM         .../programs/dtinfo/mmdb/<subdir>/Imakefile
 #define LargePICTable  YES
 
 #define CplusplusSource        YES
-DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
 
 XCOMM In DtMmdb we compile as C_API sources.
 DEFINES  = -DC_API -DCOMPACTED_DISK_REP -DPORTABLE_DB
index 9bc0f52a755709206841966ceeca675979883018..2db64369c58bb752d1caa0cbdf415bf1fffd5a78 100644 (file)
@@ -217,7 +217,7 @@ template_mgr_t::init_obj(abs_storage* store, mmdb_pos_t pos, root*& x)
      char* dbg_char_ptr;
      int   dbg_int;
      store->get_str_ptr(pos, dbg_char_ptr, dbg_int);
-     fprintf(stderr, "init_obj ptr=0x%lx len=%d\n", dbg_char_ptr, dbg_int);
+     fprintf(stderr, "init_obj ptr=0x%lx len=%d\n", (long)dbg_char_ptr,dbg_int);
    }
 #endif
 
@@ -508,7 +508,8 @@ debug(cerr, CLASS_CODE_BYTES);
       char* dbg_char_ptr;
       int   dbg_int;
       store->get_str_ptr(pinfo.position, dbg_char_ptr, dbg_int);
-      fprintf(stderr, "create_obj ptr=0x%lx len=%d\n", dbg_char_ptr, dbg_int);
+      fprintf(stderr, "create_obj ptr=0x%lx len=%d\n",
+                                       (long)dbg_char_ptr, dbg_int);
     }
 #endif
 #endif
index 4f3b2ccb00adf1ecb50fedc36a4a04c6c30072c8..881aac50c4a8801044b2cf4904abdeb627688961 100644 (file)
@@ -53,6 +53,7 @@
 #include <sys/types.h>
 #include <sys/time.h>
 #include <stdio.h>
+#include <stdlib.h>
 
 #ifdef SVR4
 #include <sys/systeminfo.h>
@@ -159,8 +160,8 @@ unique_id (void)
        hostid = gethostid();
 
 #ifdef DEBUG
-      PRINT_BITS (cur_time.tv_usec);
-      PRINT_BITS (cur_time.tv_sec);
+      PRINT_BITS ((unsigned int)cur_time.tv_usec);
+      PRINT_BITS ((unsigned int)cur_time.tv_sec);
       PRINT_BITS (pid);
       PRINT_BITS (hostid);
 #endif
index ceae7d65e509ef0d02d251e3cc5064f657c2ae46..b98197568e09ef3a3769c5ee41bbc4eda49e7ad5 100644 (file)
@@ -23,7 +23,7 @@ XCOMM         .../programs/dtinfo/mmdb/<subdir>/Imakefile
 #define LargePICTable  YES
 
 #define CplusplusSource        YES
-DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
 
 XCOMM In DtMmdb we compile as C_API sources.
 DEFINES  = -DC_API -DPORTABLE_DB
index e41712adbf6c9e128204e37b74534b9794b6cc81..fa2b8bb05da3d60c228950cc2eeccac140123424 100644 (file)
@@ -22,7 +22,8 @@
  */
 // $XConsortium: convert.cc /main/3 1996/06/11 17:23:53 cde-hal $
 
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 
 /*****************************************/
 //Note: convert node.dat file to new format
index 23154bc71cbcac38ad571cf3d9218e9631ba4545..b14008c51f0c3cf2d4360bbd005c3ca0425bd6b2 100644 (file)
@@ -168,14 +168,14 @@ io_status cset::asciiIn(istream& in)
 io_status cset::batch_asciiIn(istream& in) 
 {
    handler* root_hd_ptr = 0;
-
+/*
 #ifdef DEBUG
 xtime tmr;
 float f1;
 long f2;
 tmr.start();
 #endif
-
+*/
    char ccode_buf[LBUFSIZ];
    int c;
 //fprintf(stderr, "batch_asciiIn() : start looping \n");
index 26372bd183c7036a3beeb71fd3211f316bd86529..e8924139f68ad58619bc898428d68ca7a5d0555d 100644 (file)
@@ -56,7 +56,8 @@
 #ifdef C_API
 #include <stdlib.h>
 #else
-#include <new.h>
+#include <new>
+using namespace std;
 #endif
 
 #define NEW_AND_DELETE_BODIES(class_name) \
index 61ad5574db04285e994a232192b33fbd98ff57b9..987909670145c58edd1e70718b0e36acde10878f 100644 (file)
@@ -98,7 +98,7 @@ oid_t::oid_t(const char* source, Boolean ascii_format, Boolean swap_order)
 #endif
 
    } else {
-      istrstream in((char*)source);
+      istringstream in((char*)source);
 
       in >> v_c_code;
 
index da87de5f0e4335cabf386b0d52a6d810b2d994bd..0c1cc14704bacd52ba3a6f19a9f390cc2c55b45e 100644 (file)
@@ -52,9 +52,9 @@
 #define _oid_t_h 1
 
 #ifdef C_API
-#include "utility/c_strstream.h"
+#include "utility/c_stringstream.h"
 #else
-#include <strstream.h>
+#include <sstream>
 #endif
 
 #include "utility/funcs.h"
@@ -83,7 +83,7 @@ public:
 // oid_t equal and less test
    Boolean eq(const oid_t&) const;
    Boolean ls(const oid_t&) const;
-   operator==(const oid_t& arg) const { return eq(arg); };
+   bool  operator==(const oid_t& arg) const { return eq(arg); };
 
 // class code, oid type and instance code export functions
    const c_code_t ccode() const { return v_c_code; } ;
index 019ab05225f6ce0cdd198f4bf986e1922a503fdc..bcaa3955033d34ffac911601a231b4eda5bc56c2 100644 (file)
@@ -86,7 +86,8 @@ const char* random_gen::get_random_string(int low, int high)
       delete buf;
       buf = new char[buf_len+1];
    }
-   for ( int i=0; i<buf_len; i++ )
+   int i;
+   for ( i=0; i<buf_len; i++ )
      buf[i] = char_set[rand_gen.rand() % sizeof(char_set)]; 
 
    buf[i] = 0;
index 1b3346f0ace43bb2db21bccdd76cf9bfc1474dfb..4d592d5b12599e618c7dd3b6b3c14083f4d72b30 100644 (file)
@@ -23,7 +23,7 @@ XCOMM         .../programs/dtinfo/mmdb/<subdir>/Imakefile
 #define LargePICTable  YES
 
 #define CplusplusSource        YES
-DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
 
 #ifdef DtinfoClient
 DEFINES= -DC_API -DNO_DB_LOCK -DCDE_NEXT
index 7b7ed1ea23dbc0a889272f70b006b10485da809a..146d0f481bbc21d9a930c8c11566a077a2258697 100644 (file)
@@ -62,7 +62,7 @@ char* get_oid(info_lib* infolib_ptr, char* base_str, char* locator_line)
     if ( strcmp(locator, "     0000000000000000000000") == 0 ||
          strcmp(locator, "0") == 0 ) 
     {
-        return "0.0";
+        return (char*)"0.0";
     }
 
     return get_oid_2(infolib_ptr, base_str, locator);
@@ -75,9 +75,9 @@ char* get_oid_2(info_lib* infolib_ptr, char* base_str, char* locator)
     const char *this_node_locator = x.locator();
 
     if ( strcmp( this_node_locator, locator) == 0 ) {
-        ostrstream strout(oid_in_string_buf, BUFSIZ, ios::out);
+        ostringstream strout(oid_in_string_buf, ios::out);
         x.its_oid().asciiOut(strout);
-        oid_in_string_buf[strout.pcount()] = NULL;
+        strcpy(oid_in_string_buf, strout.str().c_str());
     } else {
          cerr << "dangling locator " << locator << "\n"
               << "mismatches with " << this_node_locator << "\n"
index d29ee17c2d01422b79f15da1f2ce0f40989116a6..eaad18045841f13b77fb69aaeabedca0ff4262fc 100644 (file)
@@ -27,7 +27,7 @@
 static doc_smart_ptr*
 getDocUsingPrOrSecOrSeq(DtMmdbInfoRequest* request)
 {
-   try {
+   mtry {
       info_base* x = getBookCase(request -> bookcase_descriptor);
       if ( x == 0 ) return 0;
 
@@ -51,7 +51,7 @@ getDocUsingPrOrSecOrSeq(DtMmdbInfoRequest* request)
       return new doc_smart_ptr(x, seq+1);
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -61,7 +61,7 @@ getDocUsingPrOrSecOrSeq(DtMmdbInfoRequest* request)
 DtMmdbHandle*
 DtMmdbBookGetTocObjectId(DtMmdbInfoRequest* request)
 {
-   try {
+   mtry {
       doc_smart_ptr* x = getDocUsingPrOrSecOrSeq(request);
       if ( x == 0 ) return 0;
 
@@ -71,7 +71,7 @@ DtMmdbBookGetTocObjectId(DtMmdbInfoRequest* request)
       return z;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -81,7 +81,7 @@ DtMmdbBookGetTocObjectId(DtMmdbInfoRequest* request)
 const char*
 DtMmdbBookGetShortTitle(DtMmdbInfoRequest* request, unsigned int* length)
 {
-   try {
+   mtry {
       doc_smart_ptr* x = getDocUsingPrOrSecOrSeq(request);
       if ( x == 0 ) return 0;
 
@@ -93,7 +93,7 @@ DtMmdbBookGetShortTitle(DtMmdbInfoRequest* request, unsigned int* length)
       return z;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -103,7 +103,7 @@ DtMmdbBookGetShortTitle(DtMmdbInfoRequest* request, unsigned int* length)
 const char*
 DtMmdbBookGetLongTitle(DtMmdbInfoRequest* request, unsigned int* length)
 {
-   try {
+   mtry {
       doc_smart_ptr* x = getDocUsingPrOrSecOrSeq(request);
       if ( x == 0 ) return 0;
 
@@ -115,7 +115,7 @@ DtMmdbBookGetLongTitle(DtMmdbInfoRequest* request, unsigned int* length)
       return z;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -124,7 +124,7 @@ DtMmdbBookGetLongTitle(DtMmdbInfoRequest* request, unsigned int* length)
 
 int DtMmdbBookGetSeqNum(DtMmdbInfoRequest* request)
 {
-   try {
+   mtry {
       doc_smart_ptr* x = getDocUsingPrOrSecOrSeq(request);
       if ( x == 0 ) return 0;
 
@@ -134,7 +134,7 @@ int DtMmdbBookGetSeqNum(DtMmdbInfoRequest* request)
       return z;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -144,7 +144,7 @@ int DtMmdbBookGetSeqNum(DtMmdbInfoRequest* request)
 const char*
 DtMmdbBookGetSeqLIcense(DtMmdbInfoRequest* request, unsigned int* length)
 {
-    try {
+    mtry {
       doc_smart_ptr* x = getDocUsingPrOrSecOrSeq(request);
       if ( x == 0 ) return 0;
 
@@ -156,7 +156,7 @@ DtMmdbBookGetSeqLIcense(DtMmdbInfoRequest* request, unsigned int* length)
       return z;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -165,7 +165,7 @@ DtMmdbBookGetSeqLIcense(DtMmdbInfoRequest* request, unsigned int* length)
 
 DtMmdbHandle** DtMmdbBookGetTabList(DtMmdbInfoRequest* request, unsigned int* length)
 {
-   try {
+   mtry {
       doc_smart_ptr* x = getDocUsingPrOrSecOrSeq(request);
       if ( x == 0 ) return 0;
 
@@ -182,7 +182,8 @@ DtMmdbHandle** DtMmdbBookGetTabList(DtMmdbInfoRequest* request, unsigned int* le
       const char* desc = 0;
       pstring_handler *p = 0;
 
-      for (int i=0; i<count; i++) {
+      int i;
+      for (i=0; i<count; i++) {
          p = (pstring_handler *)((*z)->get_component (i+1));
 
 // The format is the title, a tab char, then the section oid.
@@ -211,7 +212,7 @@ DtMmdbHandle** DtMmdbBookGetTabList(DtMmdbInfoRequest* request, unsigned int* le
       return u;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
index 89a7748bffb55384fb9085b913b83cf323015fd7..60ff2ef914803c83fcff347f1948658521ac3b6d 100644 (file)
@@ -35,7 +35,7 @@ extern OLIAS_DB* mmdb_ptr;
 int
 DtMmdbGetBookCaseByName(int infolib_descriptor, const char* name)
 {
-   try {
+   mtry {
       info_lib* x = mmdb_ptr -> getInfoLib(infolib_descriptor);
 
       if ( x == 0 ) return -1;
@@ -48,7 +48,7 @@ DtMmdbGetBookCaseByName(int infolib_descriptor, const char* name)
          return base -> index_id();
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
       return -1;
    } end_try;
@@ -58,7 +58,7 @@ DtMmdbGetBookCaseByName(int infolib_descriptor, const char* name)
 int
 DtMmdbGetBookCaseByIndex(int infolib_descriptor, int index)
 {
-   try {
+   mtry {
       info_lib* x = mmdb_ptr -> getInfoLib(infolib_descriptor);
 
       if ( x == 0 ) return -1;
@@ -81,7 +81,7 @@ DtMmdbGetBookCaseByIndex(int infolib_descriptor, int index)
       } else
         return -1;
    }
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
       return -1;
    } end_try;
@@ -91,7 +91,7 @@ DtMmdbGetBookCaseByIndex(int infolib_descriptor, int index)
 int
 DtMmdbGetBookCaseByLoc(int infolib_descriptor, const char* locator)
 {
-   try {
+   mtry {
       info_lib* x = mmdb_ptr -> getInfoLib(infolib_descriptor);
 
       if ( x == 0 ) return -1;
@@ -105,7 +105,7 @@ DtMmdbGetBookCaseByLoc(int infolib_descriptor, const char* locator)
             return base -> index_id();
       
    }
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
       return -1;
    } end_try;
@@ -118,7 +118,7 @@ DtMmdbGetBookCaseByLocs(int infolib_descriptor, const char** locators,
        int* count_ptr)
 {
 
-    try {
+    mtry {
       info_lib* x = mmdb_ptr -> getInfoLib(infolib_descriptor);
 
       if ( x == 0 ) return 0;
@@ -146,7 +146,7 @@ DtMmdbGetBookCaseByLocs(int infolib_descriptor, const char** locators,
       return ds;
 
    }
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
       if (count_ptr) *count_ptr = 0;
       return 0;
@@ -159,7 +159,7 @@ DtMmdbGetBookCaseByLocs(int infolib_descriptor, const char** locators,
 DtMmdbBookCaseInfo* 
 DtMmdbBookCaseGetInfo(int bookcase_descriptor)
 {
-   try {
+   mtry {
         info_base* x = getBookCase(bookcase_descriptor);
   
         if ( x == 0 ) return 0;
@@ -175,7 +175,7 @@ DtMmdbBookCaseGetInfo(int bookcase_descriptor)
         return y;
 
    }
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
       return 0;
    } end_try;
index 35448a6895956056a9db1b6ff56fc15396bdb333..55f61322689fe5fb6f6fdf1a42cf274a71c54d03 100644 (file)
@@ -26,6 +26,7 @@
 #include "storage/page_storage.h"
 #include "api/info_lib.h"
 #include <stdlib.h>
+#include <limits.h>
 #include "schema/store_desc.h"
 #include "dynhash/data_t.h"
 #include "index/index.h"
@@ -62,7 +63,7 @@ void initialize_MMDB()
    ostring::input_buf = new char[LBUFSIZ];
 
    data_t::larson_convertor_ptr = new atoi_larson;
-   data_t::pearson_convertor_ptr = new atoi_pearson(MAXSHORT, 256);
+   data_t::pearson_convertor_ptr = new atoi_pearson(SHRT_MAX, 256);
 
    ground_ptr = new oid_t(c_code_t(0), i_code_t(0));
 
@@ -230,7 +231,7 @@ DtMmdbGraphicInfo* newDtMmdbGraphicInfo()
 void DtMmdbFreeHandle(DtMmdbHandle* x)
 {
    if ( x ) {
-      delete x -> oid_ptr;
+//    delete x -> oid_ptr;
       free((void*)x);
    }
 }
@@ -254,7 +255,7 @@ extern int auto_test(int argc, char** argv, OLIAS_DB& db);
 extern "C" {
 int auto_test_c_api(int argc, char** argv)
 {
-   try
+   mtry
    {
 #ifdef REGRESSION_TEST
       OLIAS_DB db;
@@ -264,7 +265,7 @@ int auto_test_c_api(int argc, char** argv)
 #endif
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
       cerr << "Exception msg: " << e << "\n";
       return -1;
@@ -331,7 +332,7 @@ char* DtMmdbHandleToString(DtMmdbHandle* x)
    static char buf[100];
    if ( x -> oid_ptr) {
       oid_t *z = (oid_t*)(x -> oid_ptr);
-      sprintf(buf, "%d.%d", z -> ccode(), z -> icode());
+      sprintf(buf, "%d.%d", z -> ccode(), (int)z -> icode());
    } else
      buf[0] = 0;
 
index 6d576ca0ff1a12d7ca83beb63ef3898a97adcd5c..bd8218766318adadf4e03fe815015afd0a590c4a 100644 (file)
@@ -27,7 +27,7 @@
 static dlp_smart_ptr*
 getDlpUsingProid(DtMmdbInfoRequest* request)
 {
-   try {
+   mtry {
       info_base* x = getBookCase(request -> bookcase_descriptor);
       if ( x == 0 ) return 0;
 
@@ -40,7 +40,7 @@ getDlpUsingProid(DtMmdbInfoRequest* request)
       return 0;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -50,7 +50,7 @@ getDlpUsingProid(DtMmdbInfoRequest* request)
 DtMmdbHandle*
 DtMmdbDlpGetPrevSectionId(DtMmdbInfoRequest* request)
 {
-   try {
+   mtry {
       dlp_smart_ptr* x = getDlpUsingProid(request);
       if ( x == 0 ) return 0;
       DtMmdbHandle *z = 0;
@@ -64,7 +64,7 @@ DtMmdbDlpGetPrevSectionId(DtMmdbInfoRequest* request)
       return z;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -74,7 +74,7 @@ DtMmdbDlpGetPrevSectionId(DtMmdbInfoRequest* request)
 DtMmdbHandle*
 DtMmdbDlpGetNextSectionId(DtMmdbInfoRequest* request)
 {
-   try {
+   mtry {
       dlp_smart_ptr* x = getDlpUsingProid(request);
       if ( x == 0 ) return 0;
 
@@ -89,7 +89,7 @@ DtMmdbDlpGetNextSectionId(DtMmdbInfoRequest* request)
       return z;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
index 53d4b0d342338348e8a8e47a56bdd84e6cab51e3..0308d59521ce078f483f6963911690004ee4e907 100644 (file)
@@ -27,7 +27,7 @@
 static graphic_smart_ptr*
 getGraphicUsingLocAndProid(DtMmdbInfoRequest* request, Boolean checkLocOnly = false)
 {
-   try {
+   mtry {
       info_base* x = getBookCase(request -> bookcase_descriptor);
       if ( x == 0 ) return 0;
 
@@ -46,7 +46,7 @@ getGraphicUsingLocAndProid(DtMmdbInfoRequest* request, Boolean checkLocOnly = fa
       return new graphic_smart_ptr(x, *id);
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -56,13 +56,13 @@ getGraphicUsingLocAndProid(DtMmdbInfoRequest* request, Boolean checkLocOnly = fa
 const char*
 DtMmdbGraphicGetData(DtMmdbInfoRequest* request, unsigned int* data_length)
 {
-   try {
+   mtry {
       graphic_smart_ptr* x = getGraphicUsingLocAndProid(request, true);
 
       if ( x == 0 ) return 0;
 
 #ifdef DEBUG
-      fprintf(stderr, " graphicInfo: mmdb_oid = %d.%d\n", (*x).its_oid().ccode(), (*x).its_oid().icode());
+      fprintf(stderr, " graphicInfo: mmdb_oid = %d.%d\n", (int)(*x).its_oid().ccode(), (int)(*x).its_oid().icode());
 #endif
 
       const char* y = x -> data();
@@ -72,7 +72,7 @@ DtMmdbGraphicGetData(DtMmdbInfoRequest* request, unsigned int* data_length)
       return y;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -83,7 +83,7 @@ DtMmdbGraphicInfo*
 DtMmdbGraphicGetInfo(DtMmdbInfoRequest* request)
 {
 
-   try {
+   mtry {
       graphic_smart_ptr* x = getGraphicUsingLocAndProid(request, true);
 
       if ( x == 0 ) return 0;
@@ -107,7 +107,7 @@ DtMmdbGraphicGetInfo(DtMmdbInfoRequest* request)
       return z;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -116,7 +116,7 @@ DtMmdbGraphicGetInfo(DtMmdbInfoRequest* request)
 
 const char* DtMmdbGraphicGetLoc(DtMmdbInfoRequest* request)
 {
-   try {
+   mtry {
       graphic_smart_ptr* x = getGraphicUsingLocAndProid(request, true);
 
       if ( x == 0 ) return 0;
@@ -127,7 +127,7 @@ const char* DtMmdbGraphicGetLoc(DtMmdbInfoRequest* request)
       return y;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
index 0da4bc79bc36d83a53874842ad09681be9ef01b6..8e8339a1ab6cb564bef47eeb75b080d0725fc6f1 100644 (file)
@@ -54,7 +54,7 @@ DtMmdbOpenInfoLib(
        DtMmdbBool delayed_infolib_init
                )
 {
-   try {
+   mtry {
 
       Boolean option = (delayed_infolib_init == DtMmdbTrue) ? true : false;
 
@@ -74,7 +74,7 @@ DtMmdbOpenInfoLib(
       return i;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
       return -1;
    } end_try;
@@ -94,7 +94,7 @@ void DtMmdbCloseInfoLib(int infolib_descriptor)
 DtMmdbInfoLibInfo* 
 DtMmdbInfoLibGetInfo(int infolib_descriptor)
 {
-   try {
+   mtry {
         info_lib* x = mmdb_ptr -> getInfoLib(infolib_descriptor);
    
         if ( x == 0 ) return 0;
@@ -111,7 +111,7 @@ DtMmdbInfoLibGetInfo(int infolib_descriptor)
         return y;
    
    }
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
       return 0;
    } end_try;
index 9ffdfe968d26753b1c252c9bee353a0b066c1463..5c13a6aa00f6c1d9089f06ab7066c14d58a3f55d 100644 (file)
@@ -27,7 +27,7 @@
 static locator_smart_ptr*
 getLocatorUsingLocAndProid(DtMmdbInfoRequest* request, Boolean checkLocOnly = false)
 {
-   try {
+   mtry {
       info_base* x = getBookCase(request -> bookcase_descriptor);
       if ( x == 0 ) return 0;
 
@@ -49,7 +49,7 @@ getLocatorUsingLocAndProid(DtMmdbInfoRequest* request, Boolean checkLocOnly = fa
 */
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -59,7 +59,7 @@ getLocatorUsingLocAndProid(DtMmdbInfoRequest* request, Boolean checkLocOnly = fa
 const char*
 DtMmdbLocatorGetSectionLoc(DtMmdbInfoRequest* request)
 {
-   try {
+   mtry {
       locator_smart_ptr* x = getLocatorUsingLocAndProid(request, false);
 
       if ( x == 0 ) return 0;
@@ -68,7 +68,7 @@ DtMmdbLocatorGetSectionLoc(DtMmdbInfoRequest* request)
       return y;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -78,7 +78,7 @@ DtMmdbLocatorGetSectionLoc(DtMmdbInfoRequest* request)
 DtMmdbHandle*
 DtMmdbLocatorGetSectionObjectId(DtMmdbInfoRequest* request)
 {
-   try {
+   mtry {
       locator_smart_ptr* x = getLocatorUsingLocAndProid(request, true);
       if ( x == 0 ) return 0;
       DtMmdbHandle *z = newDtMmdbHandle(x -> node_id());
@@ -86,7 +86,7 @@ DtMmdbLocatorGetSectionObjectId(DtMmdbInfoRequest* request)
       return z;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
index 4dfe0777e2b81560d4a78d52977678a20e3ea920..bbba476d608d90415e397c71dfd35dc9e5e1545b 100644 (file)
@@ -27,7 +27,7 @@
 const char* 
 DtMmdbSectionGetLoc(DtMmdbInfoRequest* request)
 {
-   try {
+   mtry {
       info_base* x = getBookCase(request -> bookcase_descriptor);
       if ( x == 0 ) return 0;
    
@@ -40,7 +40,7 @@ DtMmdbSectionGetLoc(DtMmdbInfoRequest* request)
       return y.locator();
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -50,7 +50,7 @@ DtMmdbSectionGetLoc(DtMmdbInfoRequest* request)
 static node_smart_ptr* 
 getSectionUsingLocAndProid(DtMmdbInfoRequest* request)
 {
-   try {
+   mtry {
       info_base* x = getBookCase(request -> bookcase_descriptor);
       if ( x == 0 ) return 0;
 
@@ -67,7 +67,7 @@ getSectionUsingLocAndProid(DtMmdbInfoRequest* request)
       return new node_smart_ptr(x, *id);
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -80,7 +80,7 @@ DtMmdbSectionGetLongTitle(
        unsigned int* title_length
                         )
 {
-   try {
+   mtry {
       node_smart_ptr* x = getSectionUsingLocAndProid(request);
 
       if ( x == 0 ) return 0;
@@ -98,7 +98,7 @@ DtMmdbSectionGetLongTitle(
       return y;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -111,7 +111,7 @@ DtMmdbSectionGetShortTitle(
        unsigned int* title_length
                          )
 {
-   try {
+   mtry {
       node_smart_ptr* x = getSectionUsingLocAndProid(request);
 
       if ( x == 0 ) return 0;
@@ -122,7 +122,7 @@ DtMmdbSectionGetShortTitle(
       return y;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -136,7 +136,7 @@ DtMmdbSectionGetData
        unsigned int* data_length
        )
 {
-   try {
+   mtry {
       node_smart_ptr* x = getSectionUsingLocAndProid(request);
 
       if ( x == 0 ) return 0;
@@ -147,7 +147,7 @@ DtMmdbSectionGetData
       return y;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -156,7 +156,7 @@ DtMmdbSectionGetData
 
 int DtMmdbSectionGetDataSize(DtMmdbInfoRequest* request)
 {
-   try {
+   mtry {
       node_smart_ptr* x = getSectionUsingLocAndProid(request);
 
       if ( x == 0 ) return -1;
@@ -167,7 +167,7 @@ int DtMmdbSectionGetDataSize(DtMmdbInfoRequest* request)
       return y;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return -1;
    } end_try;
@@ -177,7 +177,7 @@ int DtMmdbSectionGetDataSize(DtMmdbInfoRequest* request)
        
 const char* DtMmdbSectionGetTocLoc(DtMmdbInfoRequest* request)
 {
-   try {
+   mtry {
       node_smart_ptr* x = getSectionUsingLocAndProid(request);
 
       if ( x == 0 ) return 0;
@@ -187,7 +187,7 @@ const char* DtMmdbSectionGetTocLoc(DtMmdbInfoRequest* request)
       return y;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -198,7 +198,7 @@ const char* DtMmdbSectionGetTocLoc(DtMmdbInfoRequest* request)
 DtMmdbHandle* 
 DtMmdbSectionGetBookId(DtMmdbInfoRequest* request)
 {
-   try {
+   mtry {
       node_smart_ptr* x = getSectionUsingLocAndProid(request);
 
       if ( x == 0 ) return 0;
@@ -209,7 +209,7 @@ DtMmdbSectionGetBookId(DtMmdbInfoRequest* request)
       return z;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -219,7 +219,7 @@ DtMmdbSectionGetBookId(DtMmdbInfoRequest* request)
 DtMmdbHandle* 
 DtMmdbSectionGetStyleSheetId(DtMmdbInfoRequest* request)
 {
-   try {
+   mtry {
       node_smart_ptr* x = getSectionUsingLocAndProid(request);
 
       if ( x == 0 ) return 0;
@@ -230,7 +230,7 @@ DtMmdbSectionGetStyleSheetId(DtMmdbInfoRequest* request)
       return z;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
index 3351305d6294c27a6c2c53214b9426fdb9cc06b5..75b314a3090449133cf83b2dee068e3d6b19c5aa 100644 (file)
@@ -27,7 +27,7 @@
 static stylesheet_smart_ptr*
 getStylesheetUsingLocAndProid(DtMmdbInfoRequest* request, Boolean checkPIDOnly = false)
 {
-   try {
+   mtry {
       info_base* x = getBookCase(request -> bookcase_descriptor);
       if ( x == 0 ) return 0;
 
@@ -48,7 +48,7 @@ getStylesheetUsingLocAndProid(DtMmdbInfoRequest* request, Boolean checkPIDOnly =
 
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -58,7 +58,7 @@ getStylesheetUsingLocAndProid(DtMmdbInfoRequest* request, Boolean checkPIDOnly =
 const char*
 DtMmdbStylesheetGetName(DtMmdbInfoRequest* request)
 {
-   try {
+   mtry {
       stylesheet_smart_ptr* x = getStylesheetUsingLocAndProid(request, true);
 
       if ( x == 0 ) return 0;
@@ -67,7 +67,7 @@ DtMmdbStylesheetGetName(DtMmdbInfoRequest* request)
       return y;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -77,14 +77,14 @@ DtMmdbStylesheetGetName(DtMmdbInfoRequest* request)
 const char*
 DtMmdbStylesheetGetata(DtMmdbInfoRequest* request, unsigned int* data_length)
 {
-   try {
+   mtry {
       stylesheet_smart_ptr* x = getStylesheetUsingLocAndProid(request, false);
 
       if ( x == 0 ) return 0;
 
 #ifdef DEBUG
-      fprintf(stderr, " stylesheetInfo: mmdb_oid = %d.%d\n", (*x).its_oid().ccode()
-, (*x).its_oid().icode());
+      fprintf(stderr, " stylesheetInfo: mmdb_oid = %d.%d\n", (int)(*x).its_oid().ccode()
+, (int)(*x).its_oid().icode());
 #endif
 
       const char* y = x -> online_data();
@@ -95,7 +95,7 @@ DtMmdbStylesheetGetata(DtMmdbInfoRequest* request, unsigned int* data_length)
       return y;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
index c7745cd8e167f8f18357e33d700549fda33e8334..b54549fbe4f6aa45f014e51986228f7be31f5183 100644 (file)
@@ -27,7 +27,7 @@
 static toc_smart_ptr*
 getTocUsingProid(DtMmdbInfoRequest* request)
 {
-   try {
+   mtry {
       info_base* x = getBookCase(request -> bookcase_descriptor);
       if ( x == 0 ) return 0;
 
@@ -38,7 +38,7 @@ getTocUsingProid(DtMmdbInfoRequest* request)
       return new toc_smart_ptr(x, *id);
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -49,7 +49,7 @@ getTocUsingProid(DtMmdbInfoRequest* request)
 DtMmdbHandle*
 DtMmdbTocGetParentId(DtMmdbInfoRequest* request)
 {
-   try {
+   mtry {
       toc_smart_ptr* x = getTocUsingProid(request);
       if ( x == 0 ) return 0;
 
@@ -64,7 +64,7 @@ DtMmdbTocGetParentId(DtMmdbInfoRequest* request)
       return z; 
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -77,7 +77,7 @@ DtMmdbTocGetChildIds(
         unsigned int* list_length
         )
 {
-   try {
+   mtry {
       toc_smart_ptr* x = getTocUsingProid(request);
       if ( x == 0 ) return 0;
 
@@ -92,7 +92,8 @@ DtMmdbTocGetChildIds(
 //fprintf(stderr, "z=%x\n", (void*)z);
       if ( z == 0 ) return 0;
     
-      for (int i=0; i<count; i++) { 
+      int i;
+      for (i=0; i<count; i++) {
          z[i] = newDtMmdbHandle(oid_t(OLIAS_NODE_CODE, ((*y) -> operator()(i+1)).icode()));
       }
 
@@ -107,7 +108,7 @@ DtMmdbTocGetChildIds(
       return z;
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return 0;
    } end_try;
@@ -116,7 +117,7 @@ DtMmdbTocGetChildIds(
 
 int DtMmdbTocGetNumOfChildren( DtMmdbInfoRequest* request)
 {
-   try {
+   mtry {
       toc_smart_ptr* x = getTocUsingProid(request);
       if ( x == 0 ) return -1;
       int y = x -> subtree_size();
@@ -124,7 +125,7 @@ int DtMmdbTocGetNumOfChildren( DtMmdbInfoRequest* request)
       return y; 
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
      return -1;
    } end_try;
index 9f592d023b24bd2e5a3bbe23998d438650528287..3a43fb1ead8d9f339c769290b8b04cd78ab9d7b2 100644 (file)
@@ -60,12 +60,12 @@ void print_doc(doc_smart_ptr& x, ostream& out, Boolean out_it_oid, Boolean out_t
 int compare_doc(doc_smart_ptr& pattern, info_base* base_ptr)
 {
    char pattern_buf[LARGE_BUFSIZ];
-   ostrstream pattern_out(pattern_buf, LARGE_BUFSIZ, ios::out);
+   ostringstream pattern_out(pattern_buf, LARGE_BUFSIZ, ios::out);
    print_doc(pattern, pattern_out, false, false);
 
    doc_smart_ptr x( base_ptr, pattern.seq_num());
    char db_buf[LARGE_BUFSIZ];
-   ostrstream db_out(db_buf, LARGE_BUFSIZ, ios::out);
+   ostringstream db_out(db_buf, LARGE_BUFSIZ, ios::out);
    print_doc(x, db_out, false, false);
 
    return compare_stream(pattern_out, db_out);
index 279515a1b2aac52af87f000b201342163535b540..287a78f214f0ac01d4cdd339d01191124df60074 100644 (file)
@@ -174,12 +174,12 @@ int graphic_smart_ptr::data_size()
 
 const char* graphic_smart_ptr::title()
 {
-  try 
+  mtry
   {
      return get_string(BASE_COMPONENT_INDEX+5);
   }
 
-  catch (mmdbException&,e)
+  mcatch (mmdbException&,e)
   {
      return 0;
   } 
index 0c98f72742e3a90e393b187d9b5807c2d6563a7f..6def80fee7421196f30be80eaad6c83e296934e2 100644 (file)
@@ -67,7 +67,7 @@ void print_graphic(graphic_smart_ptr& x, ostream& out, Boolean out_misc)
 int compare_graphic(graphic_smart_ptr& pattern, info_base* base_ptr)
 {
    char pattern_buf[LARGE_BUFSIZ];
-   ostrstream pattern_out(pattern_buf, LARGE_BUFSIZ, ios::out);
+   ostringstream pattern_out(pattern_buf, LARGE_BUFSIZ, ios::out);
    print_graphic(pattern, pattern_out, false);
 
    char loc[BUFSIZ];
@@ -75,7 +75,7 @@ int compare_graphic(graphic_smart_ptr& pattern, info_base* base_ptr)
 
    graphic_smart_ptr x( base_ptr, loc );
    char db_buf[LARGE_BUFSIZ];
-   ostrstream db_out(db_buf, LARGE_BUFSIZ, ios::out);
+   ostringstream db_out(db_buf, LARGE_BUFSIZ, ios::out);
    print_graphic(x, db_out, false);
 
    return compare_stream(pattern_out, db_out);
index 0c2d6eb8f184170b998bbb8e893f7baff15b3c07..46bbf4a929e73643d863c0448f17ab1d2933ed0f 100644 (file)
@@ -38,12 +38,12 @@ void print_loc(locator_smart_ptr& x, ostream& out)
 int compare_locator(locator_smart_ptr& pattern, info_base* base_ptr)
 {
    char pattern_buf[LARGE_BUFSIZ];
-   ostrstream pattern_out(pattern_buf, LARGE_BUFSIZ, ios::out);
+   ostringstream pattern_out(pattern_buf, LARGE_BUFSIZ, ios::out);
    print_loc(pattern, pattern_out);
 
    locator_smart_ptr x( base_ptr, pattern.inside_node_locator_str());
    char db_buf[LARGE_BUFSIZ];
-   ostrstream db_out(db_buf, LARGE_BUFSIZ, ios::out);
+   ostringstream db_out(db_buf, LARGE_BUFSIZ, ios::out);
    print_loc(x, db_out);
 
    return compare_stream(pattern_out, db_out);
index d7d95a7e65415dcf40e83974ac1961a18690719b..22dc78a2e48d65899193a1542a22a2eb3f9de7a6 100644 (file)
@@ -100,11 +100,11 @@ const char* locator_smart_ptr::label()
 {
   const char* rval;
 
-  try
+  mtry
     {
       rval = get_string(BASE_COMPONENT_INDEX+2);
     }
-  catch_any()
+  mcatch_any()
     {
       // catch exceptions to ensure backwards compatibility
       rval = 0;
index 66dae0e76dcaaf97b25defdd13b5f8f2baa977b2..ffc0f0bf7191510515e86b1407879b8d389f6b69 100644 (file)
@@ -71,7 +71,7 @@ debug(cerr, node_locator);
 
    mark_set_hd_ptr = uptr->mark_set_hd;
 
-   try {
+   mtry {
       mbase -> trans().begin();
    
       abs_storage* marks_store = mark_set_hd_ptr -> its_store();
@@ -126,17 +126,17 @@ debug(cerr, int(v_mark_hd));
      mbase -> trans().end();
    }
 
-   catch (beginTransException&, e)
+   mcatch (beginTransException&, e)
       {
          smart_ptr::_init(ground, 0); // mark the mark obsolete
          rethrow;
       }
-   catch (commitTransException&, e)
+   mcatch (commitTransException&, e)
       {
          smart_ptr::_init(ground, 0); // mark the mark obsolete
          rethrow;
       }
-   catch (mmdbException&, e)
+   mcatch (mmdbException&, e)
       {
          smart_ptr::_init(ground, 0); // mark the mark obsolete
          mbase -> trans().rollback();
@@ -156,7 +156,7 @@ debug(cerr, uptr -> get_base_name());
 debug(cerr, mark_id);
 #endif
 
-   try 
+   mtry
    {
       v_loct_hd = (pstring_handler*)
                get_handler(BASE_COMPONENT_INDEX, STRING_CODE);
@@ -164,7 +164,7 @@ debug(cerr, mark_id);
                get_handler(BASE_COMPONENT_INDEX+1, STRING_CODE);
    }
 
-   catch (mmdbException&, e)
+   mcatch (mmdbException&, e)
       {
          smart_ptr::_init(ground, 0); // mark the mark obsolete
          rethrow;
@@ -187,7 +187,7 @@ void mark_smart_ptr::update_usermark(const pstring& new_mark)
 void mark_smart_ptr::update_usermark(const char* new_mark_str,
                               int new_mark_str_sz)
 {
-   try {
+   mtry {
       mbase -> trans().begin();
 
       (*v_mark_hd) -> update(new_mark_str, new_mark_str_sz);
@@ -196,15 +196,15 @@ void mark_smart_ptr::update_usermark(const char* new_mark_str,
       mbase -> trans().end();
    }
 
-   catch (beginTransException&, e)
+   mcatch (beginTransException&, e)
       {
          rethrow;
       }
-   catch (commitTransException&, e)
+   mcatch (commitTransException&, e)
       {
          rethrow;
       }
-   catch (mmdbException&, e)
+   mcatch (mmdbException&, e)
       {
          mbase -> trans().rollback();
          rethrow;
@@ -214,7 +214,7 @@ void mark_smart_ptr::update_usermark(const char* new_mark_str,
 
 void mark_smart_ptr::remove_from_db()
 {
-   try {
+   mtry {
       mbase -> trans().begin();
 
       (*mark_set_hd_ptr) -> remove_component(its_oid()); 
@@ -223,15 +223,15 @@ void mark_smart_ptr::remove_from_db()
       mbase -> trans().end();
    }
 
-   catch (beginTransException&, e)
+   mcatch (beginTransException&, e)
       {
          rethrow;
       }
-   catch (commitTransException&, e)
+   mcatch (commitTransException&, e)
       {
          rethrow;
       }
-   catch (mmdbException&, e)
+   mcatch (mmdbException&, e)
       {
          mbase -> trans().rollback();
          rethrow;
index ebb3445e9f01d6f9d3ee6b01eab9e97cc9068f60..8d0053347c0956d16b800fe24e669976cd45d0f8 100644 (file)
@@ -78,7 +78,7 @@ OLIAS_DB::~OLIAS_DB()
 
 int OLIAS_DB::validInfoLibPath(const char* path)
 {
-  try
+  mtry
    {
      if ( exist_dir(path) == false )
        return 0;
@@ -91,7 +91,7 @@ int OLIAS_DB::validInfoLibPath(const char* path)
    
    }
 
-   catch (mmdbException &,e)
+   mcatch (mmdbException &,e)
    {
       return 0;
    }
@@ -104,7 +104,8 @@ info_lib*
 OLIAS_DB::openInfoLib(const char* infoLibPath, const char* selectedBaseName,
                  const char* infoLibName) 
 {
-   for ( int i=0; i<infolib_array.no_elmts(); i++ ) {
+   int i;
+   for ( i=0; i<infolib_array.no_elmts(); i++ ) {
       if ( infolib_array[i] == 0 )
         break;
    }
index be5b5b38e90457d9bde0c5740cf94e80dc3ddfa1..f933677a9d5e67d2566b8a07599272184b9d621f 100644 (file)
 #include "oliasdb/node_hd.h"
 
 #ifdef C_API
-#include "utility/c_strstream.h"
+#include "utility/c_stringstream.h"
 #else
-#include <strstream.h>
+#include <sstream>
+using namespace std;
 #endif
 
 MMDB_BODIES(olias_node)
index 92260088039e1c3d70ca2ddb033cd37653a927fe..95b7eb7ff70198198c9b329f0ffeb0e7dbd07f0f 100644 (file)
@@ -51,7 +51,7 @@ void print_node(node_smart_ptr& x, ostream& out, Boolean get_data, Boolean get_d
 int compare_node(node_smart_ptr& pattern, info_base* base_ptr)
 {
    char pattern_buf[LARGE_BUFSIZ];
-   ostrstream pattern_out(pattern_buf, LARGE_BUFSIZ, ios::out);
+   ostringstream pattern_out(pattern_buf, LARGE_BUFSIZ, ios::out);
    print_node(pattern, pattern_out, false, false);
 
    char loc[BUFSIZ];
@@ -59,7 +59,7 @@ int compare_node(node_smart_ptr& pattern, info_base* base_ptr)
 
    node_smart_ptr x( base_ptr, loc );
    char db_buf[LARGE_BUFSIZ];
-   ostrstream db_out(db_buf, LARGE_BUFSIZ, ios::out);
+   ostringstream db_out(db_buf, LARGE_BUFSIZ, ios::out);
    print_node(x, db_out, false, false);
 
    return compare_stream(pattern_out, db_out);
@@ -88,14 +88,14 @@ debug(cerr, loc_size);
 
    char* db_buf;
    int data_size ;
-   ostrstream* db_out;
+   ostringstream* db_out;
 
    if ( doingTest ) {
       node_smart_ptr x( base_ptr, loc );
       data_size = x.data_size();
    
       db_buf = new char[data_size+1];
-      db_out = new ostrstream(db_buf, data_size+1, ios::out);
+      db_out = new ostringstream(db_buf, data_size+1, ios::out);
    
       const char* z = x.data();
       for ( int i=0; i<data_size; i++ )
@@ -105,7 +105,7 @@ debug(cerr, loc_size);
    in >> data_size; in.get(); 
 
    char* pattern_buf = new char[data_size+1];
-   ostrstream pattern_out(pattern_buf, data_size+1, ios::out);
+   ostringstream pattern_out(pattern_buf, data_size+1, ios::out);
 
    for ( i=0; i<data_size; i++ )
       pattern_out.put((char)in.get());
index 0ad54120471922fabe94b2d968247a2dfb0a4321..8769531d0e8a639b20ccdf8da6ce539f7e255697 100644 (file)
 #define USER_MARK_CODE                 1006
 #define USER_CONFIG_CODE       1007
 
-#define DOC_SET_NAME           "doc"
-#define NODE_SET_NAME          "node"
-#define TOC_SET_NAME           "toc"
-#define LOCATOR_SET_NAME       "loc"
-#define GRAPHIC_SET_NAME       "graphic"
-#define STYLESHEET_SET_NAME    "stylesheet"
+#define DOC_SET_NAME           (char*)"doc"
+#define NODE_SET_NAME          (char*)"node"
+#define TOC_SET_NAME           (char*)"toc"
+#define LOCATOR_SET_NAME       (char*)"loc"
+#define GRAPHIC_SET_NAME       (char*)"graphic"
+#define STYLESHEET_SET_NAME    (char*)"stylesheet"
 
-#define DLP_LIST_NAME          "dlp"
+#define DLP_LIST_NAME          (char*)"dlp"
 
-#define USER_MARK_SET_NAME     "mark"
-#define USER_CONFIG_SET_NAME   "config"
+#define USER_MARK_SET_NAME     (char*)"mark"
+#define USER_CONFIG_SET_NAME   (char*)"config"
 
-#define MARK_SPEC "mmdb.mark.spec"
-#define PREF_SPEC "mmdb.pref.spec"
+#define MARK_SPEC              (char*)"mmdb.mark.spec"
+#define PREF_SPEC              (char*)"mmdb.pref.spec"
 
 #define NODE_SET_POS           0
 #define TOC_SET_POS            1
index 1e3f830533a71de3286b1ff20d1b5910a348cb77..c5768813f5ea6566bd62f913f665ee242b57b837 100644 (file)
@@ -76,16 +76,16 @@ struct map_record {
 
 struct map_record set_map[]=
 { 
-   {"loc", LOCATOR_CODE, 0},
-   {"toc", TOC_CODE, 0 },
-   {"doc", DOC_CODE, 0 },
-   {"graphic", GRAPHIC_CODE, 0 },
-//   {"stylesheet", STYLESHEET_CODE, 0 },
+   {(char*)"loc", LOCATOR_CODE, 0},
+   {(char*)"toc", TOC_CODE, 0 },
+   {(char*)"doc", DOC_CODE, 0 },
+   {(char*)"graphic", GRAPHIC_CODE, 0 },
+//   {(char*)"stylesheet", STYLESHEET_CODE, 0 },
 }; 
 
 struct map_record list_map[]=
 { 
-   {"dlp", DLP_CODE, 0},
+   {(char*)"dlp", DLP_CODE, 0},
 }; 
 
 //#define SET_MAP_SZ 5
@@ -104,7 +104,8 @@ void insert_to_collection(c_code_t ccode, istream& in)
     abs_storage* store = 0;
     handler* hd = 0;
 
-    for ( int i = 0; i<SET_MAP_SZ ; i++ ) {
+    int i;
+    for ( i = 0; i<SET_MAP_SZ ; i++ ) {
       if ( set_map[i].instance_class_code == ccode ) {
          obj_type = SET;
          store = set_map[i].collection_hd -> its_store();
@@ -176,7 +177,8 @@ int _load_mixed_objects_from_cin(info_base* base_ptr)
 
 int _load_mixed_objects(info_base* base_ptr, istream& in)
 {
-   for ( int i = 0; i<SET_MAP_SZ ; i++ ) {
+   int i;
+   for ( i = 0; i<SET_MAP_SZ ; i++ ) {
       cset_handlerPtr x = base_ptr -> get_set(set_map[i].col_name);
 
       if (x==0)
index 32cee7d4eb7474d111e5a5c0ec4842b8b0f38cd7..1874de8406c098df96044b1f56bf1dd077a70a05 100644 (file)
@@ -48,6 +48,7 @@
  */
 
 
+#include "oliasdb/olias_test.h"
 #include "api/utility.h"
 #include "utility/pm_random.h"
 #include "misc/unique_id.h"
@@ -55,7 +56,6 @@
 #include "dstr/dstr_test.h"
 #include "storage/store_test.h"
 #include "oliasdb/olias_funcs.h"
-#include "oliasdb/olias_test.h"
 
 #include "object/random_gen.h"
 
@@ -76,7 +76,7 @@
 #include "oliasdb/mmdb.h"
 
       
-#ifdef DEBUG
+#ifdef NODEBUG
 void test_collector_iterator(info_base* base)
 {
    MESSAGE(cerr, "node locators:");
@@ -108,7 +108,7 @@ int dump_instances(info_base* base_ptr, char* col_nm, c_code_t ins_code)
    if ( base_ptr == 0 )
       throw(stringException("null base ptr"));
 
-   iterator *it = base_ptr -> first(col_nm, ins_code);
+   Iterator *it = base_ptr -> first(col_nm, ins_code);
   
    if (it==0)
       throw(stringException("null iterator pointer"));
@@ -159,7 +159,8 @@ int cache_test( info_lib* infolib_ptr, const char* base_name, int argc, char** a
    locator_smart_ptrPtr* ptr_array = new locator_smart_ptrPtr[argc];
 debug(cerr, argc);
 
-   for ( int i=0; i<argc; i++ ) {
+   int i;
+   for ( i=0; i<argc; i++ ) {
       ptr_array[i] = new locator_smart_ptr(infolib_ptr, base_name, argv[i]);
    
       cerr << form("node_id of locator %s:\n", argv[i]);
@@ -241,7 +242,8 @@ int generate_stream(info_base* b_ptr, char* path, int num_sections, int min, int
    if ( !stylesheet_stream )
      return -1;
 
-   for (int i=0; i<stylesheets; i++ ) {
+   int i;
+   for (i=0; i<stylesheets; i++ ) {
 // assume the stylesheet and section are of approx. length
      generate_stylesheet_instance(x, stylesheet_stream, min, max);
    }
@@ -303,12 +305,12 @@ int generate_stream(info_base* b_ptr, char* path, int num_sections, int min, int
 
 int destroy_stream(char* path)
 {
-   try {
+   mtry {
       del_file(TEST_STY_FILE, path);
       del_file(TEST_SEC_FILE, path);
       del_file(TEST_MIX_FILE, path);
    }
-   catch_any() 
+   mcatch_any()
    {
       return -1;
    }
@@ -323,7 +325,7 @@ int extract_and_compare_objects(istream& in, info_base* base_ptr, int code)
 
    handler* root_hd_ptr = 0;
 
-   vm_storage st("", "");
+   vm_storage st((char*)"", (char*)"");
 
    char ccode_buf[LBUFSIZ];
    int c;
@@ -338,9 +340,9 @@ int extract_and_compare_objects(istream& in, info_base* base_ptr, int code)
 
       if ( c == SGML_CONTENT_CODE ) {
         if ( code == c || code == 0 )
-           ok |= compare_SGML_content(in, base_ptr, true);
+           ok |= compare_SGML_content(in, base_ptr, (Boolean)true);
         else
-           compare_SGML_content(in, base_ptr, false);
+           compare_SGML_content(in, base_ptr, (Boolean)false);
       } else {
 
          root_hd_ptr = new handler(c, &st);
@@ -384,13 +386,13 @@ struct {
    c_code_t code;
 } auto_test_spec[] = 
 {
-  {"auto_node_test", OLIAS_NODE_CODE},
-  {"auto_SGML_content_test", SGML_CONTENT_CODE},
-  {"auto_stylesheet_test", STYLESHEET_CODE},
-  {"auto_graphic_test", GRAPHIC_CODE},
-  {"auto_doc_test", DOC_CODE},
-  {"auto_toc_test", TOC_CODE},
-  {"auto_loc_test", LOCATOR_CODE},
+  {(char*)"auto_node_test", OLIAS_NODE_CODE},
+  {(char*)"auto_SGML_content_test", SGML_CONTENT_CODE},
+  {(char*)"auto_stylesheet_test", STYLESHEET_CODE},
+  {(char*)"auto_graphic_test", GRAPHIC_CODE},
+  {(char*)"auto_doc_test", DOC_CODE},
+  {(char*)"auto_toc_test", TOC_CODE},
+  {(char*)"auto_loc_test", LOCATOR_CODE},
 };
 
 #define NUM_OF_AUTO_TESTS 7
@@ -570,7 +572,7 @@ int select_debug_routine(int argc, char** argv, OLIAS_DB& db)
    } 
 
    ok =mark_test(argc, argv);
-#ifdef DEBUG
+#ifdef NODEBUG
    if (ok < 0) {
      cerr << "mark_test failed." << endl;
      return ok;
@@ -604,7 +606,7 @@ int select_debug_routine(int argc, char** argv, OLIAS_DB& db)
       }
 #endif
 
-#ifdef DEBUG
+#ifdef NODEBUG
    if ( strcmp(argv[1], "random_gen") == 0 ) {
         if ( argc != 7 ) {
            cerr << "random_gen args: " << "random_gen base_name path num_sections min_section_len max_sec_len\n";
index 4483715ef4cd09b48fbfb629a0eb90cede0e9640..4edf249ba70042d110b491cfc0f57d3e3a6ee40a 100644 (file)
@@ -132,7 +132,7 @@ void stylesheet_smart_ptr::update_hardcopy_data(istream& in)
 void stylesheet_smart_ptr::update_data(istream& in, int index)
 {
    transaction trans ;
-   try {
+   mtry {
       trans.begin();
 
       update_string(index, in);
@@ -140,15 +140,15 @@ void stylesheet_smart_ptr::update_data(istream& in, int index)
       trans.end();
    }
 
-   catch (beginTransException&, e)
+   mcatch (beginTransException&, e)
       {
          rethrow;
       }
-   catch (commitTransException&, e)
+   mcatch (commitTransException&, e)
       {
          rethrow;
       }
-   catch (mmdbException&, e)
+   mcatch (mmdbException&, e)
       {
          trans.rollback();
          rethrow;
@@ -172,7 +172,7 @@ void
 stylesheet_smart_ptr::update_data(const char* buf, int size, int index)
 {
    transaction trans ;
-   try {
+   mtry {
       trans.begin();
 
       update_string(index, buf, size);
@@ -180,15 +180,15 @@ stylesheet_smart_ptr::update_data(const char* buf, int size, int index)
       trans.end();
    }
 
-   catch (beginTransException&, e)
+   mcatch (beginTransException&, e)
       {
          rethrow;
       }
-   catch (commitTransException&, e)
+   mcatch (commitTransException&, e)
       {
          rethrow;
       }
-   catch (mmdbException&, e)
+   mcatch (mmdbException&, e)
       {
          trans.rollback();
          rethrow;
index 79e60140b08442433811e97602930f1d16de6eba..2a818b102293aa30bc5df9773a4648f8d077e3d4 100644 (file)
@@ -40,7 +40,7 @@ void print_stylesheet(stylesheet_smart_ptr& x, ostream& out)
 int compare_stylesheet(stylesheet_smart_ptr& pattern, info_base* base_ptr)
 {
    char pattern_buf[LARGE_BUFSIZ];
-   ostrstream pattern_out(pattern_buf, LARGE_BUFSIZ, ios::out);
+   ostringstream pattern_out(pattern_buf, LARGE_BUFSIZ, ios::out);
    print_stylesheet(pattern, pattern_out);
 
    char loc[BUFSIZ];
@@ -48,7 +48,7 @@ int compare_stylesheet(stylesheet_smart_ptr& pattern, info_base* base_ptr)
 
    stylesheet_smart_ptr x( base_ptr, loc );
    char db_buf[LARGE_BUFSIZ];
-   ostrstream db_out(db_buf, LARGE_BUFSIZ, ios::out);
+   ostringstream db_out(db_buf, LARGE_BUFSIZ, ios::out);
    print_stylesheet(x, db_out);
 
    return compare_stream(pattern_out, db_out);
index 7116c344ab0cb18a36b1761f5c130e0730ba42a1..7d3e1170998f9e8b5a261af52b8a0e5b1359b348 100644 (file)
@@ -47,12 +47,12 @@ void print_toc(toc_smart_ptr& x, ostream& out)
 int compare_toc(toc_smart_ptr& pattern, info_base* base_ptr)
 {
    char pattern_buf[LARGE_BUFSIZ];
-   ostrstream pattern_out(pattern_buf, LARGE_BUFSIZ, ios::out);
+   ostringstream pattern_out(pattern_buf, LARGE_BUFSIZ, ios::out);
    print_toc(pattern, pattern_out);
 
    toc_smart_ptr x(base_ptr, pattern.toc_node_oid());
    char db_buf[LARGE_BUFSIZ];
-   ostrstream db_out(db_buf, LARGE_BUFSIZ, ios::out);
+   ostringstream db_out(db_buf, LARGE_BUFSIZ, ios::out);
    print_toc(x, db_out);
 
    return compare_stream(pattern_out, db_out);
index 976fdbd9212b1e337a37fca6d64b09e9c6a57f4c..675bb27fa05f4033407f748ee11752f21f50f67d 100644 (file)
@@ -89,7 +89,7 @@ user_base::user_base( const char* spec_path, rw_flag_t rw) :
    char* name = getenv("USER");
 
    if ( name == 0 )
-      name = "";
+      name = (char*)"";
 
    strcpy(base_path, path);
    strcpy(base_name, name);
@@ -119,7 +119,7 @@ user_base::user_base( const char* base_dir,
 
 user_base::checking_status_t user_base::check_mode()
 {
-   try {
+   mtry {
 
      switch ( rw_flag ) {
          case user_base::READ:
@@ -139,7 +139,7 @@ user_base::checking_status_t user_base::check_mode()
      }
    }
 
-   catch (systemException&, e)
+   mcatch (systemException&, e)
       {
          return user_base::FAIL;
       }
@@ -176,7 +176,7 @@ user_base::checking_status_t user_base::check_lock()
 
         if (
          read_lock(atomic_lock_path, write_lock_path, 
-                   ai_path, access_info("read"), offset, ai_info
+                   ai_path, access_info((char*)"read"), offset, ai_info
                   ) == false
            ) {
             if ( ai_info ) {
@@ -192,7 +192,7 @@ user_base::checking_status_t user_base::check_lock()
 
          if (
           write_lock(atomic_lock_path, write_lock_path, 
-                    ai_path, access_info("write"), ai_info
+                    ai_path, access_info((char*)"write"), ai_info
                    ) == false
          ) {
              if ( ai_info ) {
@@ -243,7 +243,7 @@ void user_base::_init()
            break;
        }
 
-       try
+       mtry
          {
            ubase_trans.begin();
 
@@ -254,14 +254,14 @@ void user_base::_init()
    
          }
 
-       catch (beginTransException &,e)
+       mcatch (beginTransException &,e)
          {
 // cases: can't open log or write size info to log
            checking_status = user_base::FAIL;
            clean_up();
            break;
          }
-       catch (commitTransException &,e)
+       mcatch (commitTransException &,e)
          {
 // cases: bad log file, can't write to store, etc.
            checking_status = user_base::FAIL;
@@ -269,7 +269,7 @@ void user_base::_init()
            break;
          }
 // cases: can't do define()
-       catch (mmdbException &,e)
+       mcatch (mmdbException &,e)
          {
            checking_status = user_base::FAIL;
            ubase_trans.rollback(); 
@@ -285,7 +285,7 @@ void user_base::_init()
 
     case user_base::SUCC:
 
-       try {
+       mtry {
           ubase_trans.begin();
 
           first_desc_ptr = f_obj_dict -> init_a_base(base_path, base_name);
@@ -293,7 +293,7 @@ void user_base::_init()
           ubase_trans.end();
        }
 
-       catch (mmdbException &,e) {
+       mcatch (mmdbException &,e) {
 #ifdef DEBUG
          fprintf(stderr, "mmdbException caught @ %s line:%d.\n",
                                                __FILE__, __LINE__);
@@ -372,14 +372,14 @@ void user_base::clean_up()
         store_ptr = desc_ptr -> get_store();
 
         if ( store_ptr ) {
-          try {
+          mtry {
 /*
 MESSAGE(cerr, "removing: ");
 MESSAGE(cerr, store_ptr -> my_name());
 */
                store_ptr->remove();
           }
-          catch (mmdbException &,e)
+          mcatch (mmdbException &,e)
           {
           } end_try;
         }
index 14927d95c0727cd46d758041af7a1c7ad96ba216..ffc2766a150b732b04215ed713e7cbacfb04ba0f 100644 (file)
@@ -23,7 +23,7 @@ XCOMM         .../programs/dtinfo/mmdb/<subdir>/Imakefile
 #define LargePICTable  YES
 
 #define CplusplusSource        YES
-DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
 
 XCOMM In DtMmdb we compile as C_API sources.
 DEFINES  = -DC_API -DPORTABLE_DB
index 5d813160e7bc85c479a7e77be36e885c0b7269ca..3508c366e160dc98275461e2e12ba7ad7372eccb 100644 (file)
@@ -78,7 +78,7 @@ void desc::set_nm(const char* name)
 
 void desc::set_oid(const char* source)
 {
-   istrstream in((char*)source);
+   istringstream in((char*)source);
    v_oid._asciiIn(in);
 }
 
index 076074f6b47de0d4ee84b56403e90fa915dea9ef..71c9bed5ea4786a475c98fd8c514ee3043f3118d 100644 (file)
@@ -131,7 +131,7 @@ desc* object_dict::init_a_base(char* db_path, char* db_name)
       x = parse(schema_path);
    } else {
 
-      int sz = bytes(in) - strlen(schema_header) - 1;
+      int sz = bytes(schema_path) - strlen(schema_header) - 1;
       char* buf = new char[sz];
    
       if ( !in.read(buf, sz) ) 
@@ -188,7 +188,7 @@ desc* object_dict::init_a_base(char* define_desc_path, char* db_path,
       throw(stringException(form("%s does not exist.", define_desc_path)));
    }
 
-   unsigned long len = bytes(in_test)*4;
+   unsigned long len = bytes(define_desc_path)*4;
 
    in_test.close();
 
@@ -213,21 +213,19 @@ desc* object_dict::init_a_base(char* define_desc_path, char* db_path,
        throw(streamException(in.rdstate()));
    } 
 
-   int sz = bytes(in);
+   int sz = bytes(define_desc_path);
    in.close();
 
    char* schema_buf = new char[sz*3];
 
-   ostrstream* string_out = new ostrstream(schema_buf, sz*3);
+   ostringstream* string_out = new ostringstream(schema_buf);
    if ( !(*string_out) ) {
        throw(streamException(string_out -> rdstate()));
    } 
 
    x -> asciiOutList(*string_out);
 
-   string_out -> put('\0'); // make NULL terminated string
-
-
+   strcpy(schema_buf, string_out->str().c_str());
    delete string_out;
 
    sz = strlen(schema_buf);
@@ -242,7 +240,8 @@ desc* object_dict::init_a_base(char* define_desc_path, char* db_path,
 /////////////////////////////
 // save the output to db_path
 /////////////////////////////
-   fstream out(form("%s/%s.%s", db_path, db_name, SCHEMA_FILE_SUFFIX), ios::out, open_file_prot());
+   fstream out(form("%s/%s.%s", db_path, db_name, SCHEMA_FILE_SUFFIX), ios::out);
+// fstream out(form("%s/%s.%s", db_path, db_name, SCHEMA_FILE_SUFFIX), ios::out, open_file_prot());
 
    if ( !out ) {
        MESSAGE(cerr, form("bad file name: %s", db_path));
@@ -290,11 +289,11 @@ desc* object_dict::parse(buffer& desc_buf)
 
     desc* x = 0;
 
-    try {
+    mtry {
        x = parse(unique_nm);
     }
 
-    catch (mmdbException &,e) {
+    mcatch (mmdbException &,e) {
        del_file(unique_nm);
        rethrow;
     } end_try;
@@ -318,14 +317,14 @@ desc* object_dict::parse(char* define_desc_path)
     else 
        ct = 1;
 
-    try {
+    mtry {
        if ( schemaparse() != 0 ) {
           fclose(schemain);
           throw(stringException("Parsing input failed"));
        }
     }
 
-    catch (mmdbException &,e) {
+    mcatch (mmdbException &,e) {
       fclose(schemain);
       rethrow;
     } end_try;
@@ -341,14 +340,14 @@ void object_dict::_init(desc* x)
 
    desc *ptr = x;
 
-   try { // init all stores
+   mtry { // init all stores
       while ( ptr ) {
          ptr -> init_store(this -> v_db_path);
          ptr = ptr -> next_desc;
       }
    }
 
-   catch (mmdbException &,e) {
+   mcatch (mmdbException &,e) {
       _quit_stores(x, ptr);
       _quit_descs(x, ptr);
       rethrow;
@@ -390,10 +389,10 @@ void object_dict::_quit_stores(desc* start_ptr, desc* end_ptr, Boolean sync)
    if ( sync == true ) {
       while ( ptr != end_ptr ) {
    
-         try {
+         mtry {
             ptr -> sync_store();
          }
-         catch (mmdbException &,e)
+         mcatch (mmdbException &,e)
          {
 #ifdef DEBUG
            fprintf(stderr, "mmdbException caught @ %s line:%d.\n",
@@ -410,11 +409,11 @@ void object_dict::_quit_stores(desc* start_ptr, desc* end_ptr, Boolean sync)
    ptr = start_ptr;
 
    while ( ptr != end_ptr ) {
-      try {
+      mtry {
          ptr -> quit_store();
       }
 
-      catch (mmdbException &,e)
+      mcatch (mmdbException &,e)
       {
 #ifdef DEBUG
            fprintf(stderr, "mmdbException caught @ %s line:%d.\n",
@@ -434,12 +433,12 @@ void object_dict::_quit_stored_objects(desc* start_ptr, desc* end_ptr)
 
    while ( ptr != end_ptr ) {
 
-      try {
+      mtry {
          ptr -> quit_handler();
 //debug(cerr, *ptr);
       }
 
-      catch (mmdbException &,e)
+      mcatch (mmdbException &,e)
       {
 #ifdef DEBUG
         fprintf(stderr, "mmdbException caught @ %s line:%d.\n",
index df7f7aa97168060906d932b3084994a05d723517..1769b63e38598ccb6fb5e0f22c54ea69e9430497 100644 (file)
@@ -53,6 +53,7 @@ extern desc* last_desc_ptr;
 
 #define CAST_TO_CONTAINER(x)   ((container_desc*)x)
 
+#undef  alloca
 #define alloca(x)      (malloc(x))
 
 extern void  schemaerror(char*);
@@ -97,6 +98,7 @@ typedef union
 #define MODE 284
 #define PAGE_SZ 285
 #define CACHED_PAGES 286
+#undef  BYTE_ORDER
 #define BYTE_ORDER 287
 #define SEPARATOR 288
 #define  schemaERRCODE 256
@@ -414,7 +416,7 @@ int
 #endif
  schemanewerror:
 #endif
-     schemaerror("syntax error");
+     schemaerror((char*)"syntax error");
 #if 0                          /* remove if needed */
 #ifdef lint
     goto  schemaerrlab;
@@ -799,7 +801,7 @@ to state %d\n", * schemassp,  schemastate);
     *++ schemavsp =  schemaval;
     goto  schemaloop;
  schemaoverflow:
-     schemaerror("yacc stack overflow");
+     schemaerror((char*)"yacc stack overflow");
  schemaabort:
     return (1);
  schemaaccept:
index dd7b1dac194c4695c40db85dcbf3ce545b4e92e9..1178a880a9890c33e775e7235111b72d7d22991d 100644 (file)
@@ -51,6 +51,7 @@
 #define MODE 284
 #define PAGE_SZ 285
 #define CACHED_PAGES 286
+#undef  BYTE_ORDER
 #define BYTE_ORDER 287
 #define SEPARATOR 288
 typedef union
index 52c3a9ee8947b2d80307737147a54fc223d52607..b8caadd76b89586163cbf07d777a989cc9209eca 100644 (file)
 
 #include <stdlib.h>
 
-#if !defined(__osf__) && !defined(USL)
+#if defined(__osf__) || defined(linux) || defined(CSRG_BASED)
+#include <unistd.h>
+#else
+#if !defined(__uxp__) && !defined(USL)
 #include <osfcn.h>
 #endif
+#endif
 
 /* use prototypes in function declarations */
 #define  schema_USE_PROTOS
index ee32ae4bcedcd4df9ac486144bb10d9c64d563f8..82ea47c2ac68cb7a5afceab50666a9d45bc3212d 100644 (file)
@@ -23,7 +23,7 @@ XCOMM         .../programs/dtinfo/mmdb/<subdir>/Imakefile
 #define LargePICTable  YES
 
 #define CplusplusSource        YES
-DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
 
 XCOMM In DtMmdb we compile as C_API sources.
 DEFINES  = -DC_API -DPORTABLE_DB
index ebe81b76ae17512bcfb15c9a31f24ac3219cc751..394b077a078e67264e933a3682756092ec437a5e 100644 (file)
@@ -48,7 +48,7 @@
 #ifdef C_API
 #include "utility/c_stream.h"
 #else
-#include <stream.h>
+#include <sstream>
 #endif
 
 #include "utility/debug.h"
index 2b34145a75f1dd6c353fc894fbccbf94d753e8e4..aa15811f8f41ef48569bee0dc2d904b04b1d32d3 100644 (file)
@@ -1110,7 +1110,7 @@ Boolean page_storage::io_mode(int mode)
 
 void page_storage::begin_trans()
 {
-   try {
+   mtry {
       if ( trans_info.status == store_trans::ENABLED )
          throw(stringException("trans is still in progress"));
    
@@ -1127,7 +1127,7 @@ void page_storage::begin_trans()
         updateString(0, (char*)&l_max_pages, sizeof(l_max_pages), 0, true);
   }
 
-  catch (mmdbException&, e) {
+  mcatch (mmdbException&, e) {
 // workaround for solaris's /SUNWspro/bin/CC compiler.
      beginTransException x;
      throw(x);
@@ -1141,7 +1141,7 @@ void page_storage::commit_trans()
 //////////////////////////////
 // sync the touched pages
 //////////////////////////////
-   try {
+   mtry {
       int ind = trans_info.log_index -> first_bucket();
    
       while ( ind != -1 ) {
@@ -1165,7 +1165,7 @@ void page_storage::commit_trans()
       trans_info.status = store_trans::DISABLED;
    }
 
-   catch (mmdbException &,e) {
+   mcatch (mmdbException &,e) {
 // workaround for solaris's /SUNWspro/bin/CC compiler.
       commitTransException x;
       throw(x);
@@ -1174,7 +1174,7 @@ void page_storage::commit_trans()
 
 void page_storage::roll_back()
 {
-   try 
+   mtry
    {
       if ( exist_file(form("%s.log", name), path) == false ) 
          return;
@@ -1270,7 +1270,7 @@ void page_storage::roll_back()
       trans_info.status = store_trans::DISABLED;
   }
 
-  catch (mmdbException &,e)
+  mcatch (mmdbException &,e)
   {
 // workaround for solaris's /SUNWspro/bin/CC compiler.
       rollbackTransException x;
@@ -1310,7 +1310,7 @@ debug(cerr, trans_info.max_pages);
 
          int log_bytes_before = trans_info.log_store -> bytes();
    
-         try {
+         mtry {
             if ( swap_order() == true ) // swap to desired order
                ORDER_SWAP_UINT(l_pid);
 
@@ -1331,7 +1331,7 @@ debug(cerr, trans_info.max_pages);
             trans_info.log_index -> insert(pkey);
          }
 
-         catch (mmdbException&, e) {
+         mcatch (mmdbException&, e) {
             trans_info.log_store -> truncate(log_bytes_before);
             rethrow;
          }
index 6e88e59f2dfa2cb96113a7dbfbfedcf18c87b22b..205fc3e361860676beca205260a87b3217267f46 100644 (file)
@@ -48,7 +48,7 @@
 #ifdef C_API
 #include "utility/c_stream.h"
 #else
-#include <stream.h>
+#include <sstream>
 #endif
 
 #include "dstr/dlist.h"
index 611b8eafc0e737f298da9add1d145bd6a769d6a2..5ec9b3c7f65fa71a09786d136e586c15a559c20a 100644 (file)
@@ -57,7 +57,8 @@
 #ifdef C_API
 #include "utility/c_fstream.h"
 #else
-#include <fstream.h>
+#include <fstream>
+using namespace std;
 #endif
 
 #include "utility/macro.h"
index 93f5292b47a1a6aea4658a412428b19a1aa845e1..7c2f9041d428a973b6246546411ac438a0e1ebe6 100644 (file)
@@ -86,9 +86,13 @@ MESSAGE(cerr, "~unixf storeage ()");
 
 void unixf_storage::remove()
 {
+#ifdef C_API
    int fd = rdbuf() -> fd();
    fsync(fd);
    ::close(fd);
+#else
+   rdbuf() -> close();
+#endif
    del_file(my_name(), my_path());
 /*
    int md = mode;
@@ -133,7 +137,7 @@ int unixf_storage::_open(int new_mode)
    }
 
    if ( v_file_exist == false ) {
-      SET_BIT(new_mode, ios::out);
+      SET_BIT(new_mode, ios::out | ios::app);
       v_file_exist = true;
    }
 
@@ -157,13 +161,23 @@ int unixf_storage::_open(int new_mode)
       SET_BIT(mode, new_mode);
 
       fmt = ::form("%s/%s", path, name);
-      fstream::open((const char *) fmt, mode, open_file_prot());
+#ifdef C_API
+      fstream::open((const char *) fmt, mode);
+#else
+      fstream::open((const char *) fmt, (ios_base::openmode)mode);
+#endif
+//    fstream::open((const char *) fmt, mode, open_file_prot());
 
    } else {
 
       if ( ! fstream::rdbuf() -> is_open() )  {
         fmt = ::form("%s/%s", path, name);
-        fstream::open((const char *) fmt, mode, open_file_prot());
+#ifdef C_API
+        fstream::open((const char *) fmt, mode);
+#else
+        fstream::open((const char *) fmt, (ios_base::openmode)mode);
+#endif
+//      fstream::open((const char *) fmt, mode, open_file_prot());
       }
 
    }
@@ -254,11 +268,11 @@ fprintf(stderr, "flush option=%d\n", flush_opt);
       flush();
 
 #ifdef DEBUG
-   fprintf(stderr, "%d bytes have been written at offset %d in %s/%s @ %s:%d\n", len, loc+string_ofst, path, name, __FILE__, __LINE__);
+   fprintf(stderr, "%d bytes have been written at offset %ld in %s/%s @ %s:%d\n", len, loc+string_ofst, path, name, __FILE__, __LINE__);
 #ifndef C_API
    {
      char fname[64];
-     sprintf(fname, "%s.%d-%d", name, loc+string_ofst, len);
+     sprintf(fname, "%s.%ld-%d", name, loc+string_ofst, len);
      ofstream output(fname);
      output.write(base, len);      
      output.flush();
@@ -296,14 +310,18 @@ int unixf_storage::bytes()
 {
    if ( total_bytes == -1 ) {
 
+      char* info_lib_file = form("%s/%s", path, name);
+
       _open(ios::in);
-  
 
       if ( !good() ) 
          clear();
 
-      
+#ifdef C_API
       total_bytes = ::bytes(rdbuf() -> fd());
+#else
+      total_bytes = ::bytes(info_lib_file);
+#endif
    }
 
    return total_bytes;
@@ -318,7 +336,12 @@ Boolean unixf_storage::io_mode(int test_mode)
       fstream::close();
    }
 
-   fstream::open(name, test_mode, open_file_prot());
+#ifdef C_API
+   fstream::open(name, test_mode);
+#else
+   fstream::open(name, (ios_base::openmode)test_mode);
+#endif
+// fstream::open(name, test_mode, open_file_prot());
 
    if ( ! fstream::rdbuf() -> is_open() )
       return false;
@@ -326,7 +349,12 @@ Boolean unixf_storage::io_mode(int test_mode)
       fstream::close();
     
       if ( opened == true )
+#ifdef C_API
          fstream::open(name, mode, open_file_prot());
+#else
+         fstream::open(name, (ios_base::openmode)mode);
+#endif
+//       fstream::open(name, mode, open_file_prot());
 
       return true;
    }
index 11dac22a49a61a6a11806af1fc8e8aa72bc935ae..cf71ccb2f32e0cd82ae09515e86340b20e7ea476 100644 (file)
@@ -23,7 +23,7 @@ XCOMM         .../programs/dtinfo/mmdb/<subdir>/Imakefile
 #define LargePICTable  YES
 
 #define CplusplusSource        YES
-DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
 
 XCOMM In DtMmdb we compile as C_API sources.
 DEFINES  = -DC_API -DPORTABLE_DB
@@ -36,8 +36,9 @@ BASE_SRCS = \
        randomize.C
 
 C_API_SRCS = \
-       streambuf.C     charbuf.C       filebuf.C       strstream.C \
-       iostream.C      fstream.C       stream.C        ios.C
+       streambuf.C     charbuf.C       filebuf.C       string.C \
+       stringstream.C  iostream.C      fstream.C       stream.C \
+       ios.C
 
 SRCS = $(BASE_SRCS)      $(C_API_SRCS)
 OBJS = $(BASE_SRCS:.C=.o) $(C_API_SRCS:.C=.o)
index c51720365d3dba1544e4cb398363b7cb7cacba5e..f19ef0a7c1e2d37633c9e0f240f40e237e3f528f 100644 (file)
@@ -66,7 +66,8 @@ void atoi_fast::init(int r, int, pm_random& rdm_generator)
 
    v_tbl = new char[v_entries];
 
-   for ( int i = 0; i < v_entries; i++ )
+   int i;
+   for ( i = 0; i < v_entries; i++ )
      v_tbl[i] = i;
 
    for ( i = 0; i < v_entries - 1;  i++ ) {
index 386708a533875b1f43a13dc6b1b8c44dc4f06ac6..40dcc4843beeb19db61d5c1da0b60fedcca99017 100644 (file)
 #ifndef _atoi_larson_h
 #define _atoi_larson_h 1
 
+#include <limits.h>
+#if defined(CSRG_BASED)
+#define MAXINT INT_MAX
+#else
 #include <values.h>
+#endif
 #include "key.h"
 
 // Based on Larson's algorithm presented in CACM ???.
index 70b139a4e9015978ab0b5299537ad83650c2e869..6e9a9f5d182c1771307503fe35047fc0dea2c385 100644 (file)
@@ -75,7 +75,8 @@ void atoi_pearson::init(int r, int, pm_random& rdm_generator)
 
    v_tbl = new char[v_entries];
 
-   for ( int i = 0; i < v_entries; i++ )
+   int i;
+   for ( i = 0; i < v_entries; i++ )
       v_tbl[i] = i;
 
 /*
index 0a6ce41607bea39c840783c129b820f16aec9c73..344ef69f09d6334f9ac96bde1093622eb08c5a12 100644 (file)
@@ -162,11 +162,7 @@ int buffer::expand_chunk(const int newsz)
    return 0;
 }
 
-#if defined(linux)
-#define CASTBNDEXCEPT (boundaryException*)
-#else
 #define CASTBNDEXCEPT
-#endif
 
 /***********************************************************/
 // Get sz chars to the array x. x is supposed allocated
@@ -433,10 +429,6 @@ Boolean operator ==(buffer&x, buffer& y)
           debug(cerr, i);
           debug(cerr, x_buf[i]);
           debug(cerr, y_buf[i]);
-#ifndef __osf__
-          debug(cerr, hex(x_buf[i]));
-          debug(cerr, hex(y_buf[i]));
-#endif
           //return false;
        }
    }
@@ -459,8 +451,8 @@ ostream& operator<<(ostream& s, buffer& b)
 
    int x = b.v_eptr - b.v_base ;
 
-
-   for ( int i = 0; i < x; i++ ) {
+   int i;
+   for ( i = 0; i < x; i++ ) {
       s << b.v_base[i];
 
 /*
index 2cf9f2de0a91fe606a2fbc1a39cfc3c46534ad27..020b29109498aec14b5925aa1784a0c3ccd227a5 100644 (file)
@@ -52,6 +52,7 @@
 #define _buffer_h 1
 
 #include <ctype.h>
+#include <iomanip>
 #include "utility/funcs.h"
 
 class buffer 
index f5ba78f687de96df6b2f34625586f0fc36062c2d..5ee86840788d12441271114cbaf85ed7103b2344 100644 (file)
@@ -25,6 +25,7 @@
 #ifndef _ios_h
 #define _ios_h
 
+#include <sys/types.h>
 #include "utility/macro.h"
 #include "utility/c_streambuf.h"
 
@@ -57,7 +58,7 @@ public:
   void clear() { f_state = OK; };
 
   int operator!() { return fail(); };
-  operator void*() { return (void*)good(); };
+  operator void*() { return (void*)(size_t)good(); };
 
 };
 
index 09ab1a7bc24922aa721849a51e056d0fe628ce87..f38c8ae7765379531f829af409e5c579bfa69ef6 100644 (file)
@@ -27,6 +27,6 @@
 
 #include "utility/c_streambuf.h"
 
-extern char*  form(const char* ...);
+extern char*  sform(const char* ...);
 
 #endif
diff --git a/cde/programs/dtinfo/DtMmdb/utility/c_string.h b/cde/programs/dtinfo/DtMmdb/utility/c_string.h
new file mode 100644 (file)
index 0000000..2fabba2
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these librararies and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
+/* $XConsortium: c_string.h /main/5 2012/09/18 22:54:47 xxx $ */
+
+#ifndef _string_h
+#define _string_h
+
+#include <string.h>
+#include "utility/c_iostream.h"
+#include "utility/c_charbuf.h"
+
+class string
+{
+public:
+   string(char* str);
+   string(char* str, int size);
+   ~string() ;
+
+   char* c_str();
+   int size();
+
+protected:
+   streambuf*  sbuf; // buffer that provides char sequence read/write
+};
+
+#endif
diff --git a/cde/programs/dtinfo/DtMmdb/utility/c_stringstream.h b/cde/programs/dtinfo/DtMmdb/utility/c_stringstream.h
new file mode 100644 (file)
index 0000000..3c8e7eb
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these librararies and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
+/* $XConsortium: c_stringstream.h /main/5 1996/08/21 15:55:22 drk $ */
+
+#ifndef _strstream_h
+#define _strstream_h
+
+#include <string.h>
+#include "utility/c_iostream.h"
+#include "utility/c_string.h"
+
+#define BUF_INITSZ 4096
+
+class istringstream : public istream
+{
+public:
+   istringstream();
+   istringstream(char* str);
+   ~istringstream() ;
+};
+
+class ostringstream : public ostream
+{
+public:
+   ostringstream();
+   ostringstream(char* str, int=ios::out);
+   ~ostringstream() ;
+
+   string str();
+};
+
+class stringstream : public istringstream, public ostringstream
+{
+public:
+   stringstream();
+   stringstream(char* str);
+   virtual ~stringstream() {};
+};
+
+
+#endif
diff --git a/cde/programs/dtinfo/DtMmdb/utility/c_strstream.h b/cde/programs/dtinfo/DtMmdb/utility/c_strstream.h
deleted file mode 100644 (file)
index b0b2b59..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these librararies and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
-/* $XConsortium: c_strstream.h /main/5 1996/08/21 15:55:22 drk $ */
-
-#ifndef _strstream_h
-#define _strstream_h
-
-#include <string.h>
-#include "utility/c_iostream.h"
-
-class istrstream : public istream
-{
-public:
-   istrstream(char* str, int size) ;
-   istrstream(char* str);
-   ~istrstream() ;
-};
-
-class ostrstream : public ostream
-{
-public:
-   ostrstream(char* str, int size, int=ios::out);
-   ~ostrstream() ;
-
-   int pcount() ;
-
-   char* str();
-};
-
-
-#endif
index c09aacb9a69bfb8eecde6dd2991383258392151a..9e1865ec0282e612a781c011d160700c19ae61c2 100644 (file)
@@ -26,7 +26,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#if !defined(hpux) && !defined(__osf__) && !defined(USL)
+#if !defined(hpux) && !defined(__osf__) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED)
 #include <sysent.h>
 #endif
 
index 1c3a5eb33be821ab1388deef2becfafad14a9343..4c31ea1026329a9b4d3f16693143aaeacf6d2411 100644 (file)
@@ -52,9 +52,9 @@
 #define _filter_h 1
 
 #ifdef C_API
-#include "utility/c_strstream.h"
+#include "utility/c_stringstream.h"
 #else
-#include <strstream.h>
+#include <sstream>
 #endif
 
 #include "utility/funcs.h"
index a837b59195f3bd387aae7bad04c8b48304e99a13..96e8cfedcf195013e694038593eed179b95cc071 100644 (file)
 
 #if defined(linux)
 #include <sys/vfs.h>
+#include <stdarg.h>
 #elif defined(_AIX)
 #include <sys/vfs.h>
 #include <sys/statfs.h>
 #include <sys/statvfs.h>
 #else
 #include <sys/statvfs.h>
+#include <stdio.h>
+#include <stdarg.h>
 #endif
 #ifdef __osf__
 extern "C"
@@ -138,24 +141,24 @@ int gethostname(char* name, int namelen)
 }
 #endif
 
-int compare_stream(ostrstream& x, ostrstream& y)
+int compare_stream(ostringstream& x, ostringstream& y)
 {
-   if ( x.pcount() != y.pcount() ) {
-      cerr << x.pcount() << "---" << y.pcount() << endl;
-//debug(cerr, x.str());
-//debug(cerr, y.str());
+   if ( x.str().size() != y.str().size() ) {
+      cerr << x.str().size() << "---" << y.str().size() << endl;
+//debug(cerr, x.str().c_str());
+//debug(cerr, y.str().c_str());
       return 1;
    } else {
 
-     char* u = x.str();
-     char* v = y.str();
+     char* u = (char *)x.str().c_str();
+     char* v = (char *)y.str().c_str();
 
 //debug(cerr, u);
 //debug(cerr, v);
 //fprintf(stderr, "u=%s, pcount() = %d\n", u, x.pcount());
 //fprintf(stderr, "v=%s, pcount() = %d\n", v, y.pcount());
 
-     if ( memcmp(u, v, x.pcount()) != 0 ) {
+     if ( memcmp(u, v, x.str().size()) != 0 ) {
        STDERR_MESSAGE("two streams do not match.");
 debug(cerr, u);
 debug(cerr, v);
@@ -208,6 +211,7 @@ int pos_of_LSB(const unsigned int y)
    //debug(cerr, x);
    //debug(cerr, hex(x));
    
+      int i;
       for ( int i =0; i<sizeof(x); i++ ) {
          if ( ( 0x000000ff & x) == 0 ) 
             x >>= 8;
@@ -217,7 +221,8 @@ int pos_of_LSB(const unsigned int y)
    
    //debug(cerr, i);
    
-      for ( int j =1; j<=8; j++ )
+      int j;
+      for ( j =1; j<=8; j++ )
          if ( (0x00000001 & x) == 0 ) 
             x >>= 1;
          else
@@ -441,7 +446,7 @@ Boolean check_and_create_dir(const char* path)
 
 // create the subdirecties
    while ( path_tail[0] != 0 &&
-           ( slash_ptr = strchr(path_tail, '/') ) ) {
+           ( slash_ptr = (char *)strchr(path_tail, '/') ) ) {
 
        path_tail = slash_ptr + 1; // set for the next check
        slash_ptr[0] = 0;          // temp. set the slash to 0.
@@ -632,6 +637,7 @@ char* time_stamp(_Xctimeparams *ctime_buf)
    return _XCtime(&x, *ctime_buf);
 }
 
+#ifdef C_API
 int bytes(fstream& fs)
 {
    struct stat file_info;
@@ -651,6 +657,49 @@ int bytes(int fd)
    else
       return int(file_info.st_size);
 }
+#else
+int bytes(fstream* fs)
+{
+   streampos begin, current, end;
+   int total_bytes;
+
+   current = fs->tellg();
+   fs->seekg(ios::beg);
+   begin = fs->tellg();
+   fs->seekg(ios::end);
+   end = fs->tellg();
+   fs->seekg(current);
+   total_bytes = end - begin;
+   return int(total_bytes);
+}
+#endif
+
+int bytes(char * file_name)
+{
+   struct stat file_info;
+
+   if ( stat( file_name, &file_info) != 0 )
+      return 0;
+   else
+      return int(file_info.st_size);
+}
+
+char* form(const char* fmt, ...)
+{
+   static char formbuf[BUFSIZ];
+   char tempbuf[BUFSIZ];
+   va_list args;
+
+   va_start(args, fmt);
+
+   strcpy(tempbuf, formbuf);
+   (void) vsprintf(tempbuf, fmt, args);
+
+   va_end(args);
+
+   strcpy(formbuf, tempbuf);
+   return formbuf;
+}
 
 static char info_buf[BUFSIZ];
 
@@ -685,9 +734,8 @@ char* access_info( char* request )
    char userid[L_cuserid];
 
 #ifndef SVR4
-   sprintf(info_buf, "%s-%s-%s-%ld-%s-%s",
+   sprintf(info_buf, "%s-%s-%ld-%s-%s",
            host_name, dm_name,
-           ( cuserid(userid)[0] == 0 ) ? "???" : userid,
            /* getenv("USER"), */
            (long)getpid(), x, request
           );
@@ -725,7 +773,7 @@ Boolean cc_is_digit(istream& in)
 
 unsigned long disk_space(const char* path)
 {
-#if defined(__osf__) || defined (hpux) || defined (SVR4)
+#if defined(__osf__) || defined (hpux) || defined (SVR4) || defined(CSRG_BASED)
    struct statvfs statfs_buf;
 #else
    struct statfs statfs_buf;
@@ -733,7 +781,7 @@ unsigned long disk_space(const char* path)
 
    long free_bytes;
 
-#if defined(__osf__) || defined (hpux) || defined (SVR4)
+#if defined(__osf__) || defined (hpux) || defined (SVR4) || defined(CSRG_BASED)
    if ( statvfs(path, &statfs_buf) == 0 ) {
       free_bytes = statfs_buf.f_bavail * statfs_buf.f_frsize ;
 #else
@@ -754,8 +802,8 @@ Boolean writeToTmpFile(char* unique_nm, char* str, int size)
     fstream *out = 0;
     char* tmp_dir_tbl[4];
     tmp_dir_tbl[0] = getenv("TMPDIR");
-    tmp_dir_tbl[1] = "/tmp";
-    tmp_dir_tbl[2] = "/usr/tmp";
+    tmp_dir_tbl[1] = (char*)"/tmp";
+    tmp_dir_tbl[2] = (char*)"/usr/tmp";
     tmp_dir_tbl[3] = getenv("HOME");
 
     int tmp_dir_tbl_size = 4;
@@ -769,7 +817,7 @@ Boolean writeToTmpFile(char* unique_nm, char* str, int size)
 
        strcpy(unique_nm, form("%s/tmp.%s", tmp_dir_tbl[i], uid));
 
-       try {
+       mtry {
 //debug(cerr, tmp_dir_tbl[i]);
 //debug(cerr, disk_space(tmp_dir_tbl[i]));
           if ( disk_space(tmp_dir_tbl[i]) <= size )
@@ -795,7 +843,7 @@ Boolean writeToTmpFile(char* unique_nm, char* str, int size)
           }
    
        }
-       catch_any() 
+       mcatch_any()
        {
          continue;
        }
index 3c1a54d679693ce43bdba42e6de4061d4cffc2ea..f46a04d87370db57b68aaaede70d8d5fcb347e69 100644 (file)
 #ifndef _funcs_h
 #define _funcs_h 1
 
-#if !defined(USL) && !defined(__osf__)
+#if !defined(USL) && !defined(__osf__) && !defined(linux) && \
+    !defined(CSRG_BASED)
 #include <libc.h>
 #endif
-#if defined(hpux) || defined(sgi) || defined(USL) ||defined(__osf__)
+#if defined(hpux) || defined(sgi) || defined(USL) ||defined(__osf__) || \
+    defined(linux) || defined(CSRG_BASED)
 #include <unistd.h>
 #else
 #include <sysent.h>
 #ifdef C_API
 #include "utility/c_stream.h"
 #include "utility/c_fstream.h"
-#include "utility/c_strstream.h"
+#include "utility/c_stringstream.h"
 #else
 #include <assert.h>
-#include <stream.h>
-#include <fstream.h>
-#include <strstream.h>
+#include <iostream>
+#include <fstream>
+#include <sstream>
+using namespace std;
 #endif
 
 #include <math.h>
@@ -109,7 +112,9 @@ extern int  strncasecmp(const char *, const char *, size_t);
 int gethostname(char* name, int namelen);
 #endif
 
-int compare_stream(ostrstream& x, ostrstream& y);
+int compare_stream(ostringstream& x, ostringstream& y);
+
+char * cuserid(char *s);
 
 
 inline float flog2(unsigned int x) {
@@ -195,8 +200,8 @@ int open_dir_prot();
 
 Boolean cc_is_digit(istream&); // "cc" stands for current char
 
-int bytes(fstream&);
 unsigned long disk_space(const char* path);
+char* access_info( char* request );
 
 Boolean int_eq(void*, void*);
 Boolean int_ls(void*, void*);
@@ -217,8 +222,15 @@ Boolean timed_unlock( int fd, int seconds = 5);
 void onalarm(int);
 */
 
+#ifdef C_API
 int bytes(int fd);
-char* access_info( char* request );
+int bytes(fstream&);
+#else
+int bytes(fstream*);
+#endif
+int bytes(char* file_name);
+
+char*  form(const char* ...);
 
 // lsb is considered as the 0th bit
 void lsb_putbits(unsigned& target, unsigned position_from_lsb, 
index 2196a533148b8718fdb5df3042301df0e21567f2..ba87e3536430bb4b3479a8dc059f90672e2881fe 100644 (file)
@@ -22,9 +22,9 @@
  */
 // $XConsortium: ios.C /main/4 1996/08/21 15:54:46 drk $
 
-#include "utility/c_ios.h"
 #include <ctype.h>
 #include <stdio.h>
+#include "utility/c_ios.h"
 
 ios::ios(streambuf* sb) : sbuf(sb), f_state(OK)
 {
index 759e0273ecea9073c081b7205e6b7c448bf6ae05..a7932b560f67e83da5057e2a4fde160060de4f70 100644 (file)
@@ -83,7 +83,8 @@ istream& istream::_getline(char* b, int lim, int delim, int fill_zero)
 
    int i;
 
-   for ( int count = 0 ; count < lim-1; count++ ) {
+   int count;
+   for ( count = 0 ; count < lim-1; count++ ) {
 
       i = sbuf -> get();
 
index 7e4b114dbb5df4bf06fb939bf48782216eda065d..519e0daa5424ff119be951a0dede3318e364d233 100644 (file)
@@ -78,7 +78,7 @@ ostream& boundaryException::asciiOut(ostream& out)
 {
    cerr << low << "\t";
    cerr << high << "\t";
-   cerr << index << "\n";
+   cerr << mindex << "\n";
    return out;
 }
 
index 4b7bbf144c2e997c8b63c50ba6c7127d458ab2c5..e1aa01ce0db229b4c346b9f8ed09a5b7158b3cf2 100644 (file)
@@ -56,7 +56,9 @@
 #ifdef C_API
 #include "utility/c_fstream.h"
 #else
-#include <fstream.h>
+#include <fstream>
+#include <iostream>
+using namespace std;
 #endif
 
 #define END_TRY end_try 
@@ -90,7 +92,7 @@ protected:
 public:
    DECLARE_EXCEPTION(stringException, mmdbException);
 
-   stringException(char* m) : msg(m) {};
+   stringException(char const* m) : msg((char*)m) {};
    ~stringException() {};
 
    virtual ostream& asciiOut(ostream&);
@@ -104,7 +106,7 @@ protected:
 public:
    DECLARE_EXCEPTION(formatException, stringException);
 
-   formatException(char* m) : stringException(m) {};
+   formatException(char const* m) : stringException(m) {};
    ~formatException() {};
 };
 
@@ -155,13 +157,13 @@ class boundaryException : public mmdbException
 protected:
    long low;
    long high;
-   long index;
+   long mindex;
 
 public:
    DECLARE_EXCEPTION(boundaryException, mmdbException);
 
    boundaryException(long l, long h, long i) : 
-     low(l), high(h), index(i) {};
+     low(l), high(h), mindex(i) {};
    ~boundaryException() {};
 
    virtual ostream& asciiOut(ostream&);
index d4dd78d298d94be6c66c6970e7775e87533e392c..0e931ec4ab815a92c096fba594e25cc92af4011a 100644 (file)
@@ -203,7 +203,8 @@ ostring& ostring::operator +(ostring& s)
 
    ostring *new_ostring = new ostring(l1+l2);
 
-   for ( int i = 0; i<l1; (*new_ostring).v_p[i] = s.v_p[i] ) i++;
+   int i;
+   for ( i = 0; i<l1; (*new_ostring).v_p[i] = s.v_p[i] ) i++;
    for ( i = 0; i<l2; (*new_ostring).v_p[l1 + i] = s.v_p[i] ) i++;
 
    return *new_ostring;
index 221f46e0b4e210e83a32fb756e3eb43be0eb428c..c2ffe17743e0d5719fbe60e16577264abc8fd091 100644 (file)
@@ -24,7 +24,8 @@
 
 #include <stdlib.h> 
 #include <string.h> 
-#include <iostream.h> 
+#include <iostream>
+using namespace std;
 
 #define BUFSIZ 1000
 
index 82f74a9066f261afe5f8a1102d473885300d1bb3..3a5542c925bc1ff7e5903d7c397c6ee16a8b14fc 100644 (file)
@@ -44,7 +44,8 @@ void randomize::restore(buffer& scrambled)
 
    int *pos = new int[bytes-1];
 
-   for ( int i=0; i<bytes-1; i++ ) {
+   int i;
+   for ( i=0; i<bytes-1; i++ ) {
       pos[i] = rdn.rand() % ( bytes - i ) + i;
    }
 
index 3d63efc1876863a2bf3fdd4ca9f7d4a1e5f2a3b6..412b47bb5b72c077c680e230b734d16380cd0294 100644 (file)
@@ -75,7 +75,11 @@ Boolean read_lock(char* lock_file_path,
          throw(streamException(x.rdstate()));
       }
 
+#ifdef C_API
       offset = bytes(x.rdbuf() -> fd());
+#else
+      offset = bytes(ai_info);
+#endif
       x << "A-" << reader_info << "\n";
 
       x.close();
@@ -89,7 +93,11 @@ Boolean read_lock(char* lock_file_path,
          throw(streamException(x.rdstate()));
       }
 
+#ifdef C_API
       int sz = bytes(x.rdbuf() -> fd());
+#else
+      int sz = bytes(ai_info);
+#endif
 
       ai_info = new char[sz+1];
       ai_info[0] = 0;
@@ -134,7 +142,11 @@ Boolean read_unlock(char* lock_file_path, char* ai_path, int offset)
 // and the file size is over 1k
 ///////////////////////////////////////////////
 
+#ifdef C_API
    if ( bytes(x.rdbuf() -> fd()) > 1024 ) {
+#else
+   if ( bytes(ai_path) > 1024 ) {
+#endif
 
       ok = false;
       char buf[BUFSIZ];
@@ -172,6 +184,7 @@ Boolean write_lock(char* lock_file_path,
                    char*& ai_info
                   )
 {
+   int ret;
    atomic_lock l(lock_file_path);
 
    if ( l.lock() == false ) {
@@ -190,7 +203,11 @@ Boolean write_lock(char* lock_file_path,
 
    char buf[BUFSIZ];
 
+#ifdef C_API
    int sz = bytes(x.rdbuf() -> fd());
+#else
+   int sz = bytes(ai_path);
+#endif
    ai_info = new char[sz+1]; 
    ai_info[0] = 0;
    
@@ -215,7 +232,7 @@ Boolean write_lock(char* lock_file_path,
 /////////////////////////////////////////
 // create the access info file
 /////////////////////////////////////////
-         truncate(ai_path, 0);
+         ret = truncate(ai_path, 0);
          fstream x(ai_path, ios::out);
          x << "A-" << writer_info << "\n";
    
index 8f02207805c374b7471ed3dcfc9963e39cc949ed..3447e68f5475505e2df6851b4ae4da651c5e474e 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "utility/c_stream.h"
 
-char*  form(const char* fmt ...)
+char*  sform(const char* fmt ...)
 {
    static char buf[1024];
 
index edf88813d2ffe254c44992a656c823c4e5d6c065..832087d0dfc86f714359e076fd775dcad88bbefd 100644 (file)
 /* $XConsortium: streambuf.C /main/8 1996/08/21 15:55:14 drk $ */
 #include "utility/c_streambuf.h"
 
-#if !defined(USL) && !defined(__osf__)
-#include <libc.h>
-#endif
-
-#if defined(USL) || defined(__osf__)
+#if defined(USL) || defined(__osf__) || defined(linux) || defined(CSRG_BASED)
 #include <stdlib.h>
+#else
+#include <libc.h>
 #endif
 
 #define DEF_BUF_SIZ 4096
diff --git a/cde/programs/dtinfo/DtMmdb/utility/string.C b/cde/programs/dtinfo/DtMmdb/utility/string.C
new file mode 100644 (file)
index 0000000..e5baf2c
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these librararies and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
+// $XConsortium: string.C /main/5 2012/09/18 22:56:32 xxx $
+
+#include "utility/c_string.h"
+#include "utility/c_charbuf.h"
+#include <string.h>
+
+string::string(char* str)
+{
+   sbuf = new charbuf(str, strlen(str), 1);
+}
+
+string::string(char* str, int size)
+{
+   sbuf = new charbuf(str, size);
+}
+
+string::~string()
+{
+}
+
+char* string::c_str()
+{
+   char* x = sbuf -> get_buf();
+// x[pcount()] = 0;
+   return x;
+}
+
+int string::size()
+{
+   char* x = sbuf -> get_buf();
+   return(strlen(x));
+}
diff --git a/cde/programs/dtinfo/DtMmdb/utility/stringstream.C b/cde/programs/dtinfo/DtMmdb/utility/stringstream.C
new file mode 100644 (file)
index 0000000..66b48df
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these librararies and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
+// $XConsortium: stringstream.C /main/5 1996/08/21 15:55:17 drk $
+
+#include "utility/c_stringstream.h"
+#include "utility/c_charbuf.h"
+#include <string.h>
+
+istringstream::istringstream() : istream(0)
+{
+   char str[BUF_INITSZ];
+   sbuf = new charbuf(str, strlen(str), 1);
+}
+
+istringstream::istringstream(char* str) :
+   //ios(new charbuf(str, strlen(str))), istream(0)
+   istream(0)
+{
+   sbuf = new charbuf(str, strlen(str), 1);
+}
+
+istringstream::~istringstream()
+{
+}
+
+ostringstream::ostringstream() : ostream(0)
+{
+   char str[BUF_INITSZ];
+   sbuf = new charbuf(str, strlen(str));
+}
+
+ostringstream::ostringstream(char* str, int) :
+   //ios(new charbuf(str, size)), ostream(0)
+   ostream(0)
+{
+   sbuf = new charbuf(str, strlen(str));
+}
+
+ostringstream::~ostringstream()
+{
+}
+
+string ostringstream::str()
+{
+   string x = sbuf -> get_buf();
+// x[pcount()] = 0;
+   return x;
+}
+
+stringstream::stringstream() : istringstream(), ostringstream()
+{
+}
+
+stringstream::stringstream(char* str) : istringstream(str), ostringstream(str)
+{
+   sbuf = new charbuf(str, strlen(str));
+}
diff --git a/cde/programs/dtinfo/DtMmdb/utility/strstream.C b/cde/programs/dtinfo/DtMmdb/utility/strstream.C
deleted file mode 100644 (file)
index f706ce2..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these librararies and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
-// $XConsortium: strstream.C /main/5 1996/08/21 15:55:17 drk $
-
-#include "utility/c_strstream.h"
-#include "utility/c_charbuf.h"
-#include <string.h>
-
-istrstream::istrstream(char* str) : 
-   //ios(new charbuf(str, strlen(str))), istream(0)
-   istream(0)
-{
-   sbuf = new charbuf(str, strlen(str), 1);
-}
-
-istrstream::istrstream(char* str, int size ) : 
-   //istream(new charbuf(str, size))
-   istream(0)
-{
-   sbuf = new charbuf(str, size, 1);
-}
-
-istrstream::~istrstream() 
-{
-}
-
-ostrstream::ostrstream(char* str, int size, int) :
-   //ios(new charbuf(str, size)), ostream(0)
-   ostream(0)
-{
-   sbuf = new charbuf(str, size);
-}
-
-ostrstream::~ostrstream() 
-{
-}
-
-char* ostrstream::str() 
-{
-   char* x = sbuf -> get_buf();
-   x[pcount()] = 0;
-   return x;
-}
-
-int ostrstream::pcount() 
-{
-   int x = sbuf -> pcount();
-   return x;
-}
-
index 60bff3f1251f50d0c8d244e73776deadc3a02f68..dc5b8e1a6d70fbee2bf7b25c523c275171455ab3 100644 (file)
@@ -22,7 +22,8 @@
  */
 // $XConsortium: tst_filebuf.C /main/4 1996/08/21 15:55:25 drk $
 
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 
 #include "utility/debug.h"
 #include "utility/c_fstream.h"
index 7fa9ee5a7d695fef70a69c05d7d047f34a6124db..b6bd0e30a1e90e901472b6e32d59494679977210 100644 (file)
@@ -22,7 +22,8 @@
  */
 // $XConsortium: tst_streambuf.C /main/4 1996/08/21 15:55:40 drk $
 
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 
 #include "utility/debug.h"
 #include "utility/c_charbuf.h"
index 9231d180bf4cca2ba7bf468f07b924f9c67fb14d..672d9dea8a292fa174257617c0b5cd5028aa2879 100644 (file)
 
 
 #include <stdio.h>
-#include "utility/c_strstream.h"
+#include "utility/c_stringstream.h"
 
-tst_ostrstream()
+tst_ostringstream()
 {
    char buf[1024];
-   ostrstream os(buf, 1024);
+   ostringstream os(buf, 1024);
    os << "istream : virtual public ios.";
    fprintf(stderr, "buf=%s\n", buf);
 }
 
-tst_istrstream()
+tst_istringstream()
 {
    char* buf = "303.0";
-   istrstream is(buf, strlen(buf));
+   istringstream is(buf, strlen(buf));
 
    int c = is.get() ;
    fprintf(stderr, "c=%c\n", c);
@@ -51,6 +51,6 @@ tst_istrstream()
 
 main()
 {
-   tst_ostrstream();
-   tst_istrstream();
+   tst_ostringstream();
+   tst_istringstream();
 }
index ee0b9ea76bd5ff0bfa4445c8224cbe4f703feee3..1a319c6eb1e41ea18bd865bad45210fd8d9332d9 100644 (file)
@@ -49,7 +49,8 @@
 #ifdef C_API
 #include "utility/c_iostream.h"
 #else
-#include <iostream.h>
+#include <iostream>
+using namespace std;
 #endif
 
 #define true  1
index 2496cc50d5f4f7627436a7e0b044718960bcc59c..d9a03bdeeb877cd3760f5edc7a9b2a7513927516 100644 (file)
@@ -59,7 +59,7 @@
 #ifdef C_API
 #include "utility/c_stream.h"
 #else
-#include <stream.h>
+#include <sstream>
 #endif
 
 #include "utility/funcs.h"
index e23b7418ca45543bec0e069fb13838143da5f33d..afed1fc0abc2b9f9110a36b285c88262735a8f01 100644 (file)
@@ -56,7 +56,6 @@
 #include <sys/types.h>
 #include <sys/times.h>
 #include <sys/time.h>
-#include <sys/timeb.h>
 
 #include "funcs.h"