Initial import of the CDE 2.1.30 sources from the Open Group.

This commit is contained in:
Peter Howkins
2012-03-10 18:21:40 +00:00
commit 83b6996daa
18978 changed files with 3945623 additions and 0 deletions

View File

@@ -0,0 +1,203 @@
XCOMM $TOG: Imakefile /main/11 1997/12/31 09:07:38 bill $
DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
NormalLibraryObjectRule()
INCLUDES = -I.. $(EXCEPTIONS_INCLUDES) $(COMMON_CLASS_INCLUDES)
CINCLUDES = -I..
MMDB_DIR=../../../mmdb
#ifdef AIXArchitecture
API_OBJS = \
$(MMDB_DIR)/api/base.o $(MMDB_DIR)/api/info_base.o \
$(MMDB_DIR)/api/info_lib.o $(MMDB_DIR)/api/smart_ptr.o \
$(MMDB_DIR)/api/transaction.o $(MMDB_DIR)/api/utility.o
BTREE_OBJS = \
$(MMDB_DIR)/btree/mmdb_btree.o
#if !defined(AIXArchitecture)
EXTRA_BTREE_BERKELEY_OBJS = $(MMDB_DIR)/btree_berkeley/memmove.o
#endif
BTREE_BERKELEY_OBJS = \
$(MMDB_DIR)/btree_berkeley/bt_close.o $(MMDB_DIR)/btree_berkeley/bt_conv.o \
$(MMDB_DIR)/btree_berkeley/bt_debug.o $(MMDB_DIR)/btree_berkeley/bt_delete.o \
$(MMDB_DIR)/btree_berkeley/bt_get.o $(MMDB_DIR)/btree_berkeley/bt_open.o \
$(MMDB_DIR)/btree_berkeley/bt_overflow.o $(MMDB_DIR)/btree_berkeley/bt_page.o \
$(MMDB_DIR)/btree_berkeley/bt_put.o $(MMDB_DIR)/btree_berkeley/bt_search.o \
$(MMDB_DIR)/btree_berkeley/bt_seq.o $(MMDB_DIR)/btree_berkeley/bt_split.o \
$(MMDB_DIR)/btree_berkeley/bt_stack.o $(MMDB_DIR)/btree_berkeley/bt_utils.o \
$(MMDB_DIR)/btree_berkeley/mktemp.o $(MMDB_DIR)/btree_berkeley/realloc.o \
$(MMDB_DIR)/btree_berkeley/snprintf.o $(EXTRA_BTREE_BERKELEY_OBJS) \
$(MMDB_DIR)/btree_berkeley/mpool.o $(MMDB_DIR)/btree_berkeley/db.o
COMPRESSION_OBJS = \
$(MMDB_DIR)/compression/abs_agent.o $(MMDB_DIR)/compression/zip.o \
$(MMDB_DIR)/compression/huffman.o $(MMDB_DIR)/compression/trie.o \
$(MMDB_DIR)/compression/code.o $(MMDB_DIR)/compression/lzss.o \
$(MMDB_DIR)/compression/sgml.o $(MMDB_DIR)/compression/ps.o
DISKHASH_OBJS = \
$(MMDB_DIR)/diskhash/disk_bucket.o $(MMDB_DIR)/diskhash/bucket_array.o \
$(MMDB_DIR)/diskhash/disk_hash.o
DSTR_OBJS = \
$(MMDB_DIR)/dstr/set.o $(MMDB_DIR)/dstr/bset.o \
$(MMDB_DIR)/dstr/slist.o $(MMDB_DIR)/dstr/dlist_cell.o \
$(MMDB_DIR)/dstr/dlist.o $(MMDB_DIR)/dstr/heap.o \
$(MMDB_DIR)/dstr/void_ptr_array.o $(MMDB_DIR)/dstr/void_ptr_stack.o \
$(MMDB_DIR)/dstr/memory_pool.o $(MMDB_DIR)/dstr/dstr_test.o \
$(MMDB_DIR)/dstr/index_agent.o $(MMDB_DIR)/dstr/token_stack.o \
$(MMDB_DIR)/dstr/slist_char_ptr_cell.o
DTI_EXCS_OBJS = \
$(MMDB_DIR)/dti_excs/Jump_Environment.o $(MMDB_DIR)/dti_excs/Exceptions.o \
$(MMDB_DIR)/dti_excs/Exception.o $(MMDB_DIR)/dti_excs/Destructable.o \
$(MMDB_DIR)/dti_excs/terminate.o
DYNHASH_OBJS = \
$(MMDB_DIR)/dynhash/data_t.o $(MMDB_DIR)/dynhash/imp_bucket.o \
$(MMDB_DIR)/dynhash/imp_die.o
HMPHF_OBJS = \
$(MMDB_DIR)/hmphf/buckets.o $(MMDB_DIR)/hmphf/mphf_funcs.o \
$(MMDB_DIR)/hmphf/mphf_hash_table.o $(MMDB_DIR)/hmphf/params.o \
$(MMDB_DIR)/hmphf/pattern.o $(MMDB_DIR)/hmphf/sorter.o
INDEX_OBJS = \
$(MMDB_DIR)/index/btree_index.o $(MMDB_DIR)/index/dyn_disk_index.o \
$(MMDB_DIR)/index/dyn_index.o $(MMDB_DIR)/index/dyn_memory_index.o \
$(MMDB_DIR)/index/fast_mphf.o $(MMDB_DIR)/index/hash.o \
$(MMDB_DIR)/index/index.o $(MMDB_DIR)/index/inv_lists.o \
$(MMDB_DIR)/index/mphf_index.o
MGRS_OBJS = \
$(MMDB_DIR)/mgrs/managers.o $(MMDB_DIR)/mgrs/misc.o \
$(MMDB_DIR)/mgrs/query_mgr.o $(MMDB_DIR)/mgrs/template_mgr.o
MISC_OBJS = \
$(MMDB_DIR)/misc/unique_id.o
OBJECT_OBJS = \
$(MMDB_DIR)/object/composite.o $(MMDB_DIR)/object/compressed_pstring.o \
$(MMDB_DIR)/object/cset.o $(MMDB_DIR)/object/dl_list.o \
$(MMDB_DIR)/object/dl_list_cell.o $(MMDB_DIR)/object/handler.o \
$(MMDB_DIR)/object/integer.o $(MMDB_DIR)/object/long_pstring.o \
$(MMDB_DIR)/object/oid.o $(MMDB_DIR)/object/oid_list.o \
$(MMDB_DIR)/object/oid_t.o $(MMDB_DIR)/object/primitive.o \
$(MMDB_DIR)/object/pstring.o $(MMDB_DIR)/object/random_gen.o \
$(MMDB_DIR)/object/root.o $(MMDB_DIR)/object/short_list.o \
$(MMDB_DIR)/object/tuple.o
OLIASDB_OBJS = \
$(MMDB_DIR)/oliasdb/asciiIn_filters.o $(MMDB_DIR)/oliasdb/collectionIterator.o \
$(MMDB_DIR)/oliasdb/dlp_hd.o $(MMDB_DIR)/oliasdb/dlp_test.o \
$(MMDB_DIR)/oliasdb/doc_hd.o $(MMDB_DIR)/oliasdb/doc_test.o \
$(MMDB_DIR)/oliasdb/graphic_hd.o $(MMDB_DIR)/oliasdb/graphic_test.o \
$(MMDB_DIR)/oliasdb/loc_test.o $(MMDB_DIR)/oliasdb/locator_hd.o \
$(MMDB_DIR)/oliasdb/mark.o $(MMDB_DIR)/oliasdb/mark_base.o \
$(MMDB_DIR)/oliasdb/mark_test.o $(MMDB_DIR)/oliasdb/mmdb.o \
$(MMDB_DIR)/oliasdb/node_hd.o $(MMDB_DIR)/oliasdb/node_test.o \
$(MMDB_DIR)/oliasdb/olias_funcs.o $(MMDB_DIR)/oliasdb/olias_test.o \
$(MMDB_DIR)/oliasdb/stylesheet_hd.o $(MMDB_DIR)/oliasdb/stylesheet_test.o \
$(MMDB_DIR)/oliasdb/toc_hd.o $(MMDB_DIR)/oliasdb/toc_test.o \
$(MMDB_DIR)/oliasdb/user_base.o
SCHEMA_OBJS = \
$(MMDB_DIR)/schema/desc.o $(MMDB_DIR)/schema/store_desc.o \
$(MMDB_DIR)/schema/object_dict.o $(MMDB_DIR)/schema/stored_object_desc.o \
$(MMDB_DIR)/schema/index_desc.o $(MMDB_DIR)/schema/inv_desc.o \
$(MMDB_DIR)/schema/agent_desc.o $(MMDB_DIR)/schema/container_desc.o \
$(MMDB_DIR)/schema/sheet.o $(MMDB_DIR)/schema/token.o
STORAGE_OBJS = \
$(MMDB_DIR)/storage/abs_storage.o $(MMDB_DIR)/storage/chunks_index.o \
$(MMDB_DIR)/storage/heap_comp_funcs.o $(MMDB_DIR)/storage/lru.o \
$(MMDB_DIR)/storage/page.o $(MMDB_DIR)/storage/page_cache.o \
$(MMDB_DIR)/storage/page_rep.o $(MMDB_DIR)/storage/page_storage.o \
$(MMDB_DIR)/storage/rep_cell.o $(MMDB_DIR)/storage/rep_policy.o \
$(MMDB_DIR)/storage/store_test.o $(MMDB_DIR)/storage/unixf_storage.o \
$(MMDB_DIR)/storage/version.o $(MMDB_DIR)/storage/vm_storage.o
UTILITY_OBJS = \
$(MMDB_DIR)/utility/funcs.o $(MMDB_DIR)/utility/ostring.o \
$(MMDB_DIR)/utility/pm_random.o $(MMDB_DIR)/utility/atoi_pearson.o \
$(MMDB_DIR)/utility/xtime.o $(MMDB_DIR)/utility/buffer.o \
$(MMDB_DIR)/utility/atoi_larson.o $(MMDB_DIR)/utility/atomic_lock.o \
$(MMDB_DIR)/utility/rw_lock.o $(MMDB_DIR)/utility/atoi_fast.o \
$(MMDB_DIR)/utility/filter.o $(MMDB_DIR)/utility/mmdb_exception.o \
$(MMDB_DIR)/utility/randomize.o
DTI_CC_OBJS = \
$(MMDB_DIR)/dti_cc/CC_Listbase.o $(MMDB_DIR)/dti_cc/cc_exceptions.o \
$(MMDB_DIR)/dti_cc/CC_String.o $(MMDB_DIR)/dti_cc/CC_Tokenizer.o \
$(MMDB_DIR)/dti_cc/CC_Stack.o $(MMDB_DIR)/dti_cc/CC_Slist.o
#if defined(HPArchitecture) || !defined(CplusplusCompilerMajorVersion) || (CplusplusCompilerMajorVersion != 4)
EXTRA_HARDCOPY_OBJS = $(MMDB_DIR)/HardCopy/TemplatesAutoNumber.o
#endif
HARDCOPY_OBJS = \
$(MMDB_DIR)/HardCopy/FPset.o $(MMDB_DIR)/HardCopy/HardCopyFP.o \
$(MMDB_DIR)/HardCopy/autoNumber.o $(MMDB_DIR)/HardCopy/autoNumberFP.o \
$(EXTRA_HARDCOPY_OBJS)
#if defined(HPArchitecture) || !defined(CplusplusCompilerMajorVersion) || (CplusplusCompilerMajorVersion != 4)
EXTRA_STYLESHEET_OBJS = $(MMDB_DIR)/StyleSheet/SSTemplates.o
#endif
STYLESHEET_OBJS = \
$(MMDB_DIR)/StyleSheet/Attribute.o $(MMDB_DIR)/StyleSheet/AttributeList.o \
$(MMDB_DIR)/StyleSheet/BitVector.o $(MMDB_DIR)/StyleSheet/DocParser.o \
$(MMDB_DIR)/StyleSheet/Element.o $(MMDB_DIR)/StyleSheet/Expression.o \
$(MMDB_DIR)/StyleSheet/Feature.o $(MMDB_DIR)/StyleSheet/FeatureDefDictionary.o \
$(MMDB_DIR)/StyleSheet/FeatureSet.o $(MMDB_DIR)/StyleSheet/FeatureValue.o \
$(MMDB_DIR)/StyleSheet/PathQualifier.o $(MMDB_DIR)/StyleSheet/PathTable.o \
$(MMDB_DIR)/StyleSheet/Resolver.o $(MMDB_DIR)/StyleSheet/ResolverStack.o \
$(MMDB_DIR)/StyleSheet/SSPath.o $(MMDB_DIR)/StyleSheet/StyleSheet.o \
$(MMDB_DIR)/StyleSheet/StyleSheetExceptions.o \
$(MMDB_DIR)/StyleSheet/SymTab.o $(MMDB_DIR)/StyleSheet/VariableTable.o \
$(MMDB_DIR)/StyleSheet/defParser.o $(MMDB_DIR)/StyleSheet/defToken.o \
$(MMDB_DIR)/StyleSheet/style.o $(MMDB_DIR)/StyleSheet/tokenStyle.o \
$(MMDB_DIR)/StyleSheet/RendererHCV.o $(EXTRA_STYLESHEET_OBJS)
MMDB_OBJS = $(HARDCOPY_OBJS) $(STYLESHEET_OBJS) $(DTI_CC_OBJS)
ALL_MMDB_OBJS = $(API_OBJS) $(BTREE_OBJS) \
$(BTREE_BERKELEY_OBJS) $(COMPRESSION_OBJS) \
$(DISKHASH_OBJS) $(DSTR_OBJS) \
$(DTI_EXCS_OBJS) $(DYNHASH_OBJS) \
$(HMPHF_OBJS) $(INDEX_OBJS) \
$(MGRS_OBJS) $(MISC_OBJS) \
$(OBJECT_OBJS) $(OLIASDB_OBJS) \
$(SCHEMA_OBJS) $(STORAGE_OBJS) \
$(UTILITY_OBJS) $(MMDB_OBJS)
#endif
#ifdef AIXArchitecture
Libs = $(ALL_MMDB_OBJS) $(MATH_LIB) $(DTSVCLIB) $(TTLIB) $(XLIB)
#else
Libs = $(MMDB_LIBS) $(MATH_LIB) $(DTSVCLIB) $(TTLIB) $(XLIB)
#endif
Libs_C_API = $(MMDB_LIBS_C_API) $(DTSVCLIB) $(TTLIB) $(XLIB) $(MATH_LIB)
SimpleCPlusPlusProgram(dbdrv,main.o,$(Libs))
SimpleCPlusPlusProgram(restore,restore.o,$(Libs))
#ifdef USLArchitecture
SimpleCPlusPlusProgram(dbdrv_c_api,main_c_api.o,$(Libs_C_API))
#else
SimpleCProgram(dbdrv_c_api,main_c_api.o,$(Libs_C_API))
#endif
InstallBuildToolsBinary(dbdrv)
SRCS = main.C main_c_api.c
DependTarget()

View File

@@ -0,0 +1,149 @@
/*
* $XConsortium: main.cc /main/5 1996/07/18 15:24:26 drk $
*
* Copyright (c) 1992 HAL Computer Systems International, Ltd.
* All rights reserved. Unpublished -- rights reserved under
* the Copyright Laws of the United States. USE OF A COPYRIGHT
* NOTICE IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
* OR DISCLOSURE.
*
* THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE
* SECRETS OF HAL COMPUTER SYSTEMS INTERNATIONAL, LTD. USE,
* DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT THE
* PRIOR EXPRESS WRITTEN PERMISSION OF HAL COMPUTER SYSTEMS
* INTERNATIONAL, LTD.
*
* RESTRICTED RIGHTS LEGEND
* Use, duplication, or disclosure by the Government is subject
* to the restrictions as set forth in subparagraph (c)(l)(ii)
* of the Rights in Technical Data and Computer Software clause
* at DFARS 252.227-7013.
*
* HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.
* 1315 Dell Avenue
* Campbell, CA 95008
*
*/
#include "api/utility.h"
#include "oliasdb/mmdb.h"
#include "oliasdb/olias_funcs.h"
#include "oliasdb/olias_test.h"
void usage(const char* command)
{
cerr << "unknown operation type: " << command << "\n";
}
int select_and_process( int argc, char** argv )
{
int ok = -1;
OLIAS_DB mmdb;
info_lib* infolib_ptr = 0;
if ( argc < 2 ) {
ok = -1;
} else {
if ( strcmp(argv[1], "define") == 0 ) {
infolib_ptr = mmdb.openInfoLib();
if ( infolib_ptr == 0 ||
infolib_ptr->define_info_base(argv[3],argv[4],argv[2]) == false
)
ok = -1;
else
ok = 0;
} else
if ( strcmp(argv[1], "build_dict") == 0 ) {
// args: build_dict $base $compress_agent_name
infolib_ptr = mmdb.openInfoLib(getenv("MMDB_PATH"), argv[2]);
info_base* base_ptr = infolib_ptr -> get_info_base(argv[2]);
if ( base_ptr == 0 )
throw(stringException(form("unknown base: %s", argv[2])));
base_ptr -> build_dict(argv[3]);
ok = 0;
} else
if ( strcmp(argv[1], "stdin_load") == 0 ) {
if ( argc == 4 ) {
infolib_ptr =
mmdb.openInfoLib(getenv("MMDB_PATH"), argv[2]);
info_base* base_ptr = infolib_ptr -> get_info_base(argv[2]);
ok = load( base_ptr, argv[3] );
} else {
MESSAGE(cerr,
"stdin_load args: stdin_load base_nm obj_name");
}
} else
if ( strcmp(argv[1], "simple_mixed_load") == 0 ) {
if ( argc != 3 ) {
MESSAGE(cerr, "mixed_load args: mixed_load base_name");
} else {
infolib_ptr =
mmdb.openInfoLib(getenv("MMDB_PATH"), argv[2]);
info_base* base_ptr = infolib_ptr -> get_info_base(argv[2]);
ok = _load_mixed_objects_from_cin(base_ptr);
}
} else
if ( strcmp(argv[1], "mixed_load") == 0 ) {
if ( argc != 3 ) {
MESSAGE(cerr, "mixed_load args: mixed_load base_name");
} else {
infolib_ptr =
mmdb.openInfoLib(getenv("MMDB_PATH"), argv[2]);
info_base* base_ptr = infolib_ptr -> get_info_base(argv[2]);
ok = load_mixed_objects_from_cin(base_ptr);
}
} else
if ( (ok = select_debug_routine(argc, argv, mmdb)) == 2 )
{
usage(argv[1]);
}
}
return (ok);
}
main( int argc, char** argv )
{
//quantify_clear_data();
INIT_EXCEPTIONS();
int ok;
try
{
ok = select_and_process( argc, argv );
}
catch (mmdbException &,e)
{
cerr << "Exception msg: " << e << "\n";
#ifdef DEBUG
//abort();
#else
ok = -1;
#endif
}
end_try;
exit(ok);
}

View File

@@ -0,0 +1,114 @@
/* $XConsortium: main_c_api.c /main/5 1996/06/11 17:29:25 cde-hal $ */
#include "oliasdb/Mmdb.h"
#include <stdio.h>
usage(int argc, char** argv)
{
fprintf(stderr, "Usage:\n");
fprintf(stderr, " %s 0 libpath [bookcaseName]\n", argv[0]);
fprintf(stderr, " %s 1 libpath bookcaseName locator (show bookcase)\n", argv[0]);
fprintf(stderr, " %s 2 libpath bookcaseName locator (show section)\n", argv[0]);
fprintf(stderr, " %s 3 libpath bookcaseName mmdboid (show section)\n", argv[0]);
fprintf(stderr, " %s 4 libpath bookcaseName mmdboid (show TOC)\n", argv[0]);
fprintf(stderr, " %s 5 libpath bookcaseName loc (show LOC)\n", argv[0]);
/*
fprintf(stderr, " %s 6 libpath bookcaseName mmdboid (show LOC)\n", argv[0]);
*/
fprintf(stderr, " %s 7 libpath bookcaseName loc (show graphic)\n", argv[0]);
fprintf(stderr, " %s 8 libpath bookcaseName mmdboid (show graphic)\n", argv[0]);
fprintf(stderr, " %s 9 libpath bookcaseName loc (show stylesheet)\n", argv[0]);
fprintf(stderr, " %s 10 libpath bookcaseName mmdboid (show stylesheet)\n", argv[0]);
fprintf(stderr, " %s 11 libpath bookcaseName mmdboid (show dlp)\n", argv[0]);
fprintf(stderr, " %s 12 libpath bookcaseName TOC_section_mmdboid (show book)\n", argv[0]);
fprintf(stderr, " %s 13 libpath bookcaseName book_mmdboid (show book)\n", argv[0]);
fprintf(stderr, " %s 14 libpath bookcaseName book_seq_num (show book)\n", argv[0]);
fprintf(stderr, " %s 15 info_lib_path info_base_spec base_name number_of_sections max_section_size, min_section_size [true|false](delete test db)\n", argv[0]);
}
extern int test0(int argc, char** argv);
extern int test1(int argc, char** argv);
extern int test2(int argc, char** argv);
extern int test3(int argc, char** argv);
extern int test4(int argc, char** argv);
extern int test_loc1(int argc, char** argv);
extern int test_loc2(int argc, char** argv);
extern int test_graphic1(int argc, char** argv);
extern int test_graphic2(int argc, char** argv);
extern int test_ss1(int argc, char** argv);
extern int test_ss2(int argc, char** argv);
extern int test_dlp(int argc, char** argv);
extern int test_book1(int argc, char** argv);
extern int test_book2(int argc, char** argv);
extern int test_book3(int argc, char** argv);
extern int auto_test_c_api(int argc, char** argv);
main( int argc, char** argv )
{
int ok = 0;
DtMmdbInit();
if ( argc == 1 || 0==isdigit(argv[1][0]) ) {
usage(argc, argv);
} else
switch ( atoi(argv[1]) ) {
case 0:
test0(argc, argv);
break;
case 1:
test1(argc, argv);
break;
case 2:
test2(argc, argv);
break;
case 3:
test3(argc, argv);
break;
case 4:
test4(argc, argv);
break;
case 5:
test_loc1(argc, argv);
break;
/*
case 6:
test_loc2(argc, argv);
break;
*/
case 7:
test_graphic1(argc, argv);
break;
case 8:
test_graphic2(argc, argv);
break;
case 9:
test_ss1(argc, argv);
break;
case 10:
test_ss2(argc, argv);
break;
case 11:
test_dlp(argc, argv);
break;
case 12:
test_book1(argc, argv);
break;
case 13:
test_book2(argc, argv);
break;
case 14:
test_book3(argc, argv);
break;
case 15:
ok = auto_test_c_api(argc, argv);
break;
default:
usage(argc, argv);
}
DtMmdbQuit();
exit(ok);
}

View File

@@ -0,0 +1,48 @@
/* $XConsortium: restore.C /main/2 1996/11/11 11:10:03 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
#include <fstream.h>
#include <strstream.h>
#include "utility/const.h"
#include "utility/randomize.h"
main(int argc, char** argv)
{
if (argc < 2) {
cerr << "usage: " << *argv << " filename\n" << flush;
return 1;
}
char schema_header[LBUFSIZ];
fstream fstr(*(argv+1), ios::in);
fstr.getline(schema_header, 1024);
int sz = bytes(fstr) - strlen(schema_header) - 1;
char* buf = new char[sz];
if ( !fstr.read(buf, sz) )
return 0;
fstr.close();
buffer orig(0);
orig.set_chunk(buf, sz);
orig.set_content_sz(sz);
randomize rd(233);
rd.restore(orig);
cout << buf << flush;
}