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,205 @@
XCOMM $TOG: Imakefile /main/14 1997/09/05 11:32:36 samborn $
DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
INCLUDES=$(EXCEPTIONS_INCLUDES) $(COMMON_CLASS_INCLUDES)
DEFINES=-DCDE_NEXT
#if defined(CplusplusCompilerMajorVersion) && (CplusplusCompilerMajorVersion == 4)
TEMPLATE_OBJS=
#else
TEMPLATE_OBJS=$(OLIAS)/mmdb/StyleSheet/SSTemplates.o
#endif
#if defined (USLArchitecture)
SYS_LIBRARIES = -lfs
#endif
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= $(STATIC) $(ALL_MMDB_OBJS) $(MATH_LIB) $(DTSVC_LIBRARY) $(TTLIB) $(SYS_LIBRARIES)
#elif defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3
Libs= $(STATIC) -L../../../mmdb -lMMDB -lMMDBTemplates $(MATH_LIB) $(SYS_LIBRARIES)
#else
Libs= $(STATIC) -L../../../mmdb -lMMDB $(MATH_LIB) $(SYS_LIBRARIES)
#endif
SimpleCPlusPlusProgram(validator,validator.o $(TEMPLATE_OBJS),$(Libs))
InstallBuildToolsBinary(validator);
SRCS = validator.C
DependTarget()

View File

@@ -0,0 +1,156 @@
// $XConsortium: validator.C /main/6 1996/08/21 15:51:12 drk $
#include "StyleSheet/Debug.h"
#include "StyleSheet/Element.h"
#include "StyleSheet/PathTable.h"
#include "StyleSheet/Resolver.h"
#include "StyleSheet/StyleSheet.h"
#include "StyleSheet/StyleSheetExceptions.h"
#include "StyleSheet/VariableTable.h"
#include "StyleSheet/Feature.h"
#include "StyleSheet/FeatureDefDictionary.h"
#include "StyleSheet/RendererHCV.h"
#include "HardCopy/autoNumberFP.h"
#include <iostream.h>
#include <stdarg.h>
extern featureDefDictionary* g_FeatureDefDictionary;
Renderer* gRenderer = 0;
fstream* defStream = 0;
extern unsigned g_validation_mode;
extern unsigned g_hasSemanticError;
extern void report_error_location();
/*
void styleerror(char *errorstr)
{
cerr << errorstr ;
}
*/
extern FILE *stylein;
extern int styleparse();
extern void stylerestart(FILE *);
extern istream* g_stylein;
int stylewrap()
{
return 0;
}
void report_error()
{
MESSAGE(cerr, "\nStyle sheet has error.\n");
}
void quit(int code)
{
delete g_FeatureDefDictionary;
delete gRenderer;
delete defStream;
exit(code);
}
main(int argc, char** argv )
{
INIT_EXCEPTIONS();
StyleSheet ss ;
g_validation_mode = true;
if ( argc != 4 && argc != 3 ) {
cerr << form("usage: %s online|hardcopy styleSheetFile [FeatureDefinitionFile]\n", argv[0]);
quit(1);
}
try {
if ( strcasecmp(argv[1], "hardcopy") == 0 )
gRenderer = new RendererHCV();
else
if ( strcasecmp(argv[1], "online") == 0 )
gRenderer = 0;
else {
cerr << form("bad validation option: %s\n", argv[1]);
quit(1);
}
if ( argc == 4 ) {
defStream = new fstream(argv[3], ios::in);
if ( !( *defStream ) ) {
cerr << form("bad feature definition file name: %s\n", argv[3]);
quit(1);
}
} else {
char* path = getenv("DTINFO_HOME");
if ( path == 0 ) {
cerr << "DTINFO_HOME is undefined.\n";
quit(1);
}
char* spec_file_path = form("%s/infolib/etc/%s.feature.spec", path, argv[1]);
defStream = new fstream(spec_file_path, ios::in);
if ( !( *defStream ) ) {
cerr << form("bad feature definition file name: %s", spec_file_path);
quit(1);
}
}
defStream -> unsetf(ios::skipws);
g_FeatureDefDictionary = new featureDefDictionary();
*defStream >> *g_FeatureDefDictionary;
//cerr << *g_FeatureDefDictionary;
}
catch_any()
{
cerr << "\nfeature definition has error.\n";
quit(1);
}
end_try;
try {
fstream* styleStream = new fstream(argv[2], ios::in);
if ( !(*styleStream) ) {
cerr << form("bad stylesheet file name: %s\n", argv[2]);
quit(1);
}
styleStream -> unsetf(ios::skipws);
g_stylein = styleStream;
int ok = styleparse();
delete styleStream;
if ( ok != 0 || g_hasSemanticError == true ) {
report_error_location();
quit(1);
}
//debug(cerr, *gPathTab);
}
catch_any()
{
report_error_location();
quit(1);
}
end_try;
MESSAGE(cerr, "\nThe style sheet is ok.");
quit(0);
}