1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Generify source code

Previously we would fail in some parts of the code if we did not have a
premade configuration, now we use any code that was marked as Linux, BSD and
Solaris as our basis in order to support building unknown Unix systems.
This commit is contained in:
Chase 2022-08-03 23:15:45 -05:00 committed by Jon Trulson
parent 06863e826e
commit 45cee195bd
70 changed files with 46 additions and 1250 deletions

123
cde/.gitignore vendored
View file

@ -22,130 +22,14 @@ imports/motif
# exports of libraries/headers
exports
# admin/IntegTools/
admin/IntegTools/post_install/*.list
admin/IntegTools/post_install/*.lst
admin/IntegTools/post_install/linux/CDE-MIN.list
admin/IntegTools/post_install/linux/CDE-MIN.lst
admin/IntegTools/post_install/linux/CDE-RUN.list
admin/IntegTools/post_install/linux/CDE-RUN.lst
admin/IntegTools/post_install/linux/CDE-SHLIBS.list
admin/IntegTools/post_install/linux/CDE-SHLIBS.lst
admin/IntegTools/post_install/linux/CDE-TT.list
admin/IntegTools/post_install/linux/CDE-TT.lst
admin/IntegTools/post_install/linux/configMin
admin/IntegTools/post_install/linux/configRun
admin/IntegTools/post_install/linux/configShlibs
admin/IntegTools/post_install/linux/configTT
admin/IntegTools/post_install/freebsd/CDE-MIN.list
admin/IntegTools/post_install/freebsd/CDE-MIN.lst
admin/IntegTools/post_install/freebsd/CDE-RUN.list
admin/IntegTools/post_install/freebsd/CDE-RUN.lst
admin/IntegTools/post_install/freebsd/CDE-SHLIBS.list
admin/IntegTools/post_install/freebsd/CDE-SHLIBS.lst
admin/IntegTools/post_install/freebsd/CDE-TT.list
admin/IntegTools/post_install/freebsd/CDE-TT.lst
admin/IntegTools/post_install/freebsd/configMin
admin/IntegTools/post_install/freebsd/configRun
admin/IntegTools/post_install/freebsd/configShlibs
admin/IntegTools/post_install/freebsd/configTT
admin/IntegTools/post_install/openbsd/CDE-MIN.list
admin/IntegTools/post_install/openbsd/CDE-MIN.lst
admin/IntegTools/post_install/openbsd/CDE-RUN.list
admin/IntegTools/post_install/openbsd/CDE-RUN.lst
admin/IntegTools/post_install/openbsd/CDE-SHLIBS.list
admin/IntegTools/post_install/openbsd/CDE-SHLIBS.lst
admin/IntegTools/post_install/openbsd/CDE-TT.list
admin/IntegTools/post_install/openbsd/CDE-TT.lst
admin/IntegTools/post_install/openbsd/configMin
admin/IntegTools/post_install/openbsd/configRun
admin/IntegTools/post_install/openbsd/configShlibs
admin/IntegTools/post_install/openbsd/configTT
admin/IntegTools/post_install/netbsd/CDE-MIN.list
admin/IntegTools/post_install/netbsd/CDE-MIN.lst
admin/IntegTools/post_install/netbsd/CDE-RUN.list
admin/IntegTools/post_install/netbsd/CDE-RUN.lst
admin/IntegTools/post_install/netbsd/CDE-SHLIBS.list
admin/IntegTools/post_install/netbsd/CDE-SHLIBS.lst
admin/IntegTools/post_install/netbsd/CDE-TT.list
admin/IntegTools/post_install/netbsd/CDE-TT.lst
admin/IntegTools/post_install/netbsd/configMin
admin/IntegTools/post_install/netbsd/configRun
admin/IntegTools/post_install/netbsd/configShlibs
admin/IntegTools/post_install/netbsd/configTT
admin/IntegTools/post_install/sun/CDE-MIN.list
admin/IntegTools/post_install/sun/CDE-MIN.lst
admin/IntegTools/post_install/sun/CDE-RUN.list
admin/IntegTools/post_install/sun/CDE-RUN.lst
admin/IntegTools/post_install/sun/CDE-SHLIBS.list
admin/IntegTools/post_install/sun/CDE-SHLIBS.lst
admin/IntegTools/post_install/sun/CDE-TT.list
admin/IntegTools/post_install/sun/CDE-TT.lst
admin/IntegTools/post_install/sun/configMin
admin/IntegTools/post_install/sun/configRun
admin/IntegTools/post_install/sun/configShlibs
admin/IntegTools/post_install/sun/configTT
admin/IntegTools/post_install/configDemos
admin/IntegTools/post_install/configFonts
admin/IntegTools/post_install/configHelp
admin/IntegTools/post_install/configHelpPrg
admin/IntegTools/post_install/configHelpRun
admin/IntegTools/post_install/configIcons
admin/IntegTools/post_install/configInc
admin/IntegTools/post_install/configMan
admin/IntegTools/post_install/configManDev
admin/IntegTools/post_install/configMsgCat
admin/IntegTools/post_install/configPrg
admin/IntegTools/post_install/configShlibs
install.dt
install.dt.hp
install.dt.ibm
install.dt.sun
dinstall.dt
dinstallCDE
installCDE
updateCDE
installCDE.*.log
cscope.out
# Makefiles (generated by Imakefiles)
# Makefiles
Makefile
xmakefile
# generated db files
databases/*\.db
databases/*\.tmp
databases/CDE-MIN.udb
databases/CDE-RUN.udb
databases/CDE-C.udb
databases/CDE-DE.udb
databases/CDE-ES.udb
databases/CDE-FR.udb
databases/CDE-IT.udb
databases/CDE-JP.udb
databases/CDE-INFOLIB-*\.udb
databases/CDE-HELP-*\.udb
databases/CDE-MSG-*\.udb
databases/CDE-SHLIBS\.udb
# config
config/imake/imake
config/makedepend/makedepend
config/util/lndir
config/util/makestrs
config/util/mergelib
config/util/xmkmf
# exampls
# examples
examples/tt/broadcast
# Compiled binaries and misc generated program files
@ -367,9 +251,6 @@ programs/dtappbuilder/src/abmf/dtcodegen.cat
programs/dtappbuilder/src/libABil/bil_parse.c
programs/dtappbuilder/src/libABil/bil_parse.h
# imake
config/imake/Makefile.proto
# doc
book.log
book.out.idx

View file

@ -86,7 +86,6 @@
# define __SVR4_I386_ABI_L1__
#endif
#include <limits.h> /* pickup WORD_BIT, LONG_BIT */
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
# undef __SVR4_I386_ABI_L1__
# ifndef WORD_BIT
# define WORD_BIT 32
@ -94,7 +93,6 @@
# ifndef LONG_BIT
# define LONG_BIT 32
# endif
#endif
#define db_VERSION "3.dt" /* was "3.10" */
#define dbd_VERSION "V3.dt\032" /* was "V3.00\032" */

View file

@ -52,9 +52,7 @@ extern "C" {
** System V R4 based systems define the stuff we need in
** sys/types.h. Include that and then we are done.
*/
#if defined(__linux__) || defined(SunOS) || defined(CSRG_BASED)
# include <sys/types.h>
#endif
#include <sys/types.h>
#if defined(CSRG_BASED) || defined(__linux__)
# include <sys/socket.h>

View file

@ -242,15 +242,7 @@ DocParser::process(istream &input, ostringstream &output,
break;
case AttributeSection:
{
#if !defined(SC3) && !defined(_IBMR2) && !defined(__linux__) && \
!defined(CSRG_BASED) && !defined(sun)
volatile
#endif
AttributeList *attrs = 0;
#if !defined(SC3) && !defined(_IBMR2) && !defined(__linux__) && \
!defined(CSRG_BASED) && !defined(sun)
volatile
#endif
AttributeList *olias_attrs = 0;
mtry

View file

@ -141,20 +141,8 @@ BinaryOperatorNode::evaluate() const
{
// calculate children trees and then have feature value do the operation
#if !defined(SC3) && !defined(_IBMR2) && !defined(__linux__) && \
!defined(CSRG_BASED) && !defined(sun)
volatile
#endif
FeatureValue *left = 0;
#if !defined(SC3) && !defined(_IBMR2) && !defined(__linux__) && \
!defined(CSRG_BASED) && !defined(sun)
volatile
#endif
FeatureValue *right = 0;
#if !defined(SC3) && !defined(_IBMR2) && !defined(__linux__) && \
!defined(CSRG_BASED) && !defined(sun)
volatile
#endif
FeatureValue *result = 0;
mtry

View file

@ -85,14 +85,6 @@ typedef unsigned int size_t;
typedef unsigned int sigset_t;
#endif
/*
* If your system's vsnprintf returns a char *, not an int,
* change the 0 to a 1.
*/
#if !defined(_AIX) && !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
#define VSPRINTF_CHARSTAR
#endif
/*
* If you don't have POSIX 1003.1 signals, the signal code surrounding the
* temporary file creation is intended to block all of the possible signals

View file

@ -102,12 +102,6 @@ Destructable::~Destructable()
inline void
Destructable::destruct()
{
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
delete this;
#else
// Have to call this here since some compilers don't allow
// qualified calls through object pointer.
Destructable::~Destructable();
#endif
}
#endif

View file

@ -26,10 +26,6 @@
#include <sys/types.h>
#include <unistd.h>
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
#include <sysent.h>
#endif
#include <fcntl.h>
#include <string.h>

View file

@ -52,14 +52,7 @@
#ifndef _funcs_h
#define _funcs_h 1
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
#include <libc.h>
#endif
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <unistd.h>
#else
#include <sysent.h>
#endif
#include <time.h>
#include <errno.h>
#include <string.h>

View file

@ -22,12 +22,7 @@
*/
/* $XConsortium: streambuf.C /main/8 1996/08/21 15:55:14 drk $ */
#include "utility/c_streambuf.h"
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <stdlib.h>
#else
#include <libc.h>
#endif
#define DEF_BUF_SIZ 4096

View file

@ -7,16 +7,10 @@ libraima_la_CFLAGS = -DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\" \
-DCDE_CONFIGURATION_TOP=\"$(CDE_CONFIGURATION_TOP)\" \
-DNO_TRANS -DUNIX -D_POSIX_SOURCE -DMULTIBYTE
if LINUX
libraima_la_CFLAGS += -D_XOPEN_SOURCE=700
endif
if BSD
libraima_la_CFLAGS += -D_XOPEN_SOURCE=700
endif
if SOLARIS
libraima_la_CFLAGS += -D_XOPEN_SOURCE=500 -DNO_REGCOMP
libraima_la_CFLAGS += -D_XOPEN_SOURCE=500
else
libraima_la_CFLAGS += -D_XOPEN_SOURCE=700
endif

View file

@ -36,15 +36,7 @@
#ifndef __DYNARRAY_H_
#define __DYNARRAY_H_
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
#include <generic.h>
#endif
#if defined(sun) || defined(__linux__) || defined(CSRG_BASED)
#define _DELETE_ARRAY(sz) delete[]
#else
#define _DELETE_ARRAY(sz) delete[(sz)]
#endif
// this is used to create an ARRAY of a TYPE
#define declare_array(ARRAY, TYPE, BUMP) \

View file

@ -41,14 +41,6 @@ typedef void (*privbuf_func)(void *v);
#include <stddef.h>
#include <stdlib.h>
#if defined(sun) || defined(__linux__) || defined(CSRG_BASED)
// Rejects valid inline declarations, claiming they have both internal and
// external linkage.
#else
inline static void *operator new(size_t size) { return malloc((unsigned)size); }
inline static void operator delete(void *p) { if (p) free((char*)p); }
#endif
#include <codelibs/dynarray.h>
declare_array(privbuf_charbuf, char, 128)
declare_array(privbuf_strvec, char*, 128)

View file

@ -66,28 +66,11 @@ extern "C"
#ifdef __cplusplus
char *strtokx(char *&ptr, const char *sep);
# if !defined(__linux__) && !defined(sun) && !defined(CSRG_BASED)
char **strsep(const char *str, const char *sep,
boolean whsp = TRUE, int *num = NULL);
const char *strcmbn(const char **vec, const char *sep = " ");
# endif
#else /* __STDC__ */
char *strtokx(char **ptr, const char *sep);
# if !defined(__linux__) && !defined(sun) && !defined(CSRG_BASED)
char **strsep(const char *str, const char *sep,
boolean whsp, int *num);
#endif
const char *strcmbn(const char **vec, const char *sep);
#endif /* __STDC__ */
#ifdef __OBSOLETE
size_t nl_strlen(const char *str); /* __OBSOLETE */
int strcharsize(const char *str); /* __OBSOLETE */
#endif /* __OBSOLETE */
#else /* C */
extern void strfree();
@ -102,12 +85,6 @@ extern unsigned strhashi();
extern char *strupper(), *strlower();
#ifdef __OBSOLETE
extern int strcharsize(); /* __OBSOLETE */
extern size_t nl_strlen(); /* __OBSOLETE */
#endif /* __OBSOLETE */
#endif /* C */
#if defined(__cplusplus)
}
@ -145,12 +122,6 @@ inline char *strdup(const char *s)
/* macros for funcs that work on top of privbuf versions */
/* for backward compatibility only - __OBSOLETE */
#ifdef __OBSOLETE
#define strpos strstrx /* __OBSOLETE */
#define strrpos strrstrx /* __OBSOLETE */
#endif /* __OBSOLETE */
#endif /* C || __STDC__ */
#endif /* __STRINGX_H_ */

View file

@ -33,11 +33,7 @@
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#include <stdarg.h>
#include "TermHeader.h"
#include "TermPrimDebug.h"
#include <signal.h>

View file

@ -37,7 +37,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "util/copyright.h"
#if defined(__linux__) || defined(sgi) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
#include <getopt.h>
#endif
#include "dbck.h"

View file

@ -58,9 +58,6 @@ typedef int Bool;
extern char *ProgramName;
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
extern char *malloc(), *realloc();
#endif
int process_command(), auth_initialize(), auth_finalize();
extern int print_help();
extern int verbose;

View file

@ -214,11 +214,7 @@ main(int argc, char** argv, char **envp)
void install_signal_handler();
SVCXPRT *transp;
struct sockaddr_in saddr;
# if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
socklen_t asize = sizeof(saddr);
# else
size_t asize = sizeof(saddr);
# endif
int is_aix = 0;
int do_garbage_collect = 0;

View file

@ -37,13 +37,7 @@
#include <stdlib.h>
#include <sys/param.h>
#include <sys/stat.h>
#if defined(__linux__) || defined(sun) || defined(CSRG_BASED)
#include <unistd.h>
#else
#if !defined(sun)
#include <osfcn.h>
#endif
#endif
#include <netdb.h>
#include <locale.h>
#include <errno.h>

View file

@ -33,11 +33,7 @@
*/
#include <errno.h>
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <unistd.h>
#else
#include <osfcn.h>
#endif
#include <sys/param.h>
#include "api/c/api_api.h"
#include "Tt/tt_c.h"

View file

@ -32,11 +32,7 @@
*
*/
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <unistd.h>
#else
#include <osfcn.h>
#endif
#include "Tt/tt_c.h"
#include "util/tt_iostream.h"
#include "tttar_utils.h"

View file

@ -4,11 +4,6 @@ SUBDIRS = api db mp util tttk
lib_LTLIBRARIES = libtt.la
# if you are on a system that does not support realpath(), you may need to
# include realpath.c in the _SOURCES
#
#libtt_la_SOURCES = realpath.c
libtt_la_SOURCES =
# fake things so libtool creates this as a C++ library

View file

@ -1,160 +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 libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*%% (c) Copyright 1993, 1994 Hewlett-Packard Company */
/*%% (c) Copyright 1993, 1994 International Business Machines Corp. */
/*%% (c) Copyright 1993, 1994 Sun Microsystems, Inc. */
/*%% (c) Copyright 1993, 1994 Novell, Inc. */
/*%% $XConsortium: realpath.c /main/3 1995/10/23 09:49:50 rswiston $ */
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <strings.h>
#include <errno.h>
/* This is used when the operating system does not provide us with
* a realpath implementation. It's named differently so there is
* no name clash between it and the system version of realpath.
*/
char *
_tt_internal_realpath(pathname, finalpath)
char *pathname;
char *finalpath;
{
struct stat sbuf;
char curpath[MAXPATHLEN],
workpath[MAXPATHLEN],
linkpath[MAXPATHLEN],
namebuf[MAXPATHLEN],
*where,
*ptr,
*last;
int len;
int nlink = 0; /* To keep track of loops in the path. */
strcpy(curpath, pathname);
if (*pathname != '/') {
#if defined(__STDC__)
if (!getcwd(workpath)) {
#else
if (!getwd(workpath)) {
#endif
strcpy(finalpath, ".");
return(NULL);
}
} else *workpath = NULL;
/* curpath is the path we're still resolving */
/* linkpath is the path a symbolic link points to */
/* workpath is the path we've resolved */
loop:
where = curpath;
while (*where != NULL) {
if (!strcmp(where, ".")) {
where++;
continue;
}
/* deal with "./" */
if (!strncmp(where, "./", 2)) {
where += 2;
continue;
}
/* deal with "../" */
if (!strncmp(where, "../", 3)) {
where += 3;
ptr = last = workpath;
while (*ptr) {
if (*ptr == '/') last = ptr;
ptr++;
}
*last = NULL;
continue;
}
ptr = strchr(where, '/');
if (!ptr)
ptr = where + strlen(where) - 1;
else
*ptr = NULL;
strcpy(namebuf, workpath);
for (last = namebuf; *last; last++) continue;
/* tack on a trailing, or leading, `/` */
if (last == namebuf || *--last != '/') {
strcat(namebuf, "/");
}
strcat(namebuf, where);
where = ++ptr;
if (lstat(namebuf, &sbuf) == -1) {
strcpy(finalpath, namebuf);
return(NULL);
}
if ((sbuf.st_mode & S_IFLNK) == S_IFLNK) {
/* Look for loop in path such as link to self. */
nlink++;
if (nlink > MAXSYMLINKS) {
errno = ELOOP;
return (NULL);
}
len = readlink(namebuf, linkpath, MAXPATHLEN);
if (len == 0) {
strcpy(finalpath, namebuf);
return(NULL);
}
*(linkpath + len) = NULL; /* readlink doesn't null-terminate result */
if (*linkpath == '/') *workpath = NULL;
if (*where) {
strcat(linkpath, "/");
strcat(linkpath, where);
}
strcpy(curpath, linkpath);
goto loop;
}
if ((sbuf.st_mode & S_IFDIR) == S_IFDIR) {
strcpy(workpath, namebuf);
continue;
}
if (*where) {
strcpy(finalpath, namebuf);
return(NULL); /* path/notadir/morepath */
} else
strcpy(workpath, namebuf);
}
strcpy(finalpath, workpath);
return(finalpath);
}

View file

@ -1,146 +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 libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*%% (c) Copyright 1993, 1994 Hewlett-Packard Company */
/*%% (c) Copyright 1993, 1994 International Business Machines Corp. */
/*%% (c) Copyright 1993, 1994 Sun Microsystems, Inc. */
/*%% (c) Copyright 1993, 1994 Novell, Inc. */
/*%% $XConsortium: realpath.hp.c /main/3 1995/10/23 09:49:57 rswiston $ */
/* @(#)realpath.hp.c 1.3 93/07/30
* Version of realpath for HP/UX systems */
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <strings.h>
char *
realpath(pathname, finalpath)
char *pathname;
char *finalpath;
{
struct stat sbuf;
char curpath[MAXPATHLEN],
workpath[MAXPATHLEN],
linkpath[MAXPATHLEN],
namebuf[MAXPATHLEN],
*where,
*ptr,
*last;
int len;
strcpy(curpath, pathname);
if (*pathname != '/') {
#if defined(__STDC__)
if (!getcwd(workpath)) {
#else
if (!getwd(workpath)) {
#endif
strcpy(finalpath, ".");
return(NULL);
}
} else *workpath = NULL;
/* curpath is the path we're still resolving */
/* linkpath is the path a symbolic link points to */
/* workpath is the path we've resolved */
loop:
where = curpath;
while (*where != NULL) {
if (!strcmp(where, ".")) {
where++;
continue;
}
/* deal with "./" */
if (!strncmp(where, "./", 2)) {
where += 2;
continue;
}
/* deal with "../" */
if (!strncmp(where, "../", 3)) {
where += 3;
ptr = last = workpath;
while (*ptr) {
if (*ptr == '/') last = ptr;
ptr++;
}
*last = NULL;
continue;
}
ptr = strchr(where, '/');
if (!ptr)
ptr = where + strlen(where) - 1;
else
*ptr = NULL;
strcpy(namebuf, workpath);
for (last = namebuf; *last; last++) continue;
/* tack on a trailing, or leading, `/` */
if (last == namebuf || *--last != '/') {
strcat(namebuf, "/");
}
strcat(namebuf, where);
where = ++ptr;
if (lstat(namebuf, &sbuf) == -1) {
strcpy(finalpath, namebuf);
return(NULL);
}
if ((sbuf.st_mode & S_IFLNK) == S_IFLNK) {
len = readlink(namebuf, linkpath, MAXPATHLEN);
if (len == 0) {
strcpy(finalpath, namebuf);
return(NULL);
}
*(linkpath + len) = NULL; /* readlink doesn't null-terminate result */
if (*linkpath == '/') *workpath = NULL;
if (*where) {
strcat(linkpath, "/");
strcat(linkpath, where);
}
strcpy(curpath, linkpath);
goto loop;
}
if ((sbuf.st_mode & S_IFDIR) == S_IFDIR) {
strcpy(workpath, namebuf);
continue;
}
if (*where) {
strcpy(finalpath, namebuf);
return(NULL); /* path/notadir/morepath */
} else
strcpy(workpath, namebuf);
}
strcpy(finalpath, workpath);
return(finalpath);
}

View file

@ -65,9 +65,6 @@
*
* OPT_PATCH -- if defined, build patch info into objects
*
* OPT_BUG_SUNOS_4 -- used to flag special hacks only needed because
* of bugs or quirks in SunOS 4.x.
*
* OPT_BUG_SUNOS_5 -- used to flag special hacks only needed because
* of bugs or quirks in SunOS 5.x.
*
@ -77,9 +74,9 @@
* OPT_XDR_LONG_TYPE -- used for (64-bit) architectures where
* <rcp/xdr.h> defines x_putlong and x_getlong to not take "long*".
*
* OPT_POSIX_SIGNAL -- set to assume posix-style sigaction() call.
* OPT_POSIX_SIGNAL -- set to assume posix-style sigaction() call (default).
* OPT_BSD_SIGNAL -- set to assume bsd-style signal() call.
* If *neither* OPT_POSIX_SIGNAL or OPT_BSD_SIGNAL is defined, use
* If OPT_POSIX_SIGNAL is undefined and OPT_BSD_SIGNAL is not set, use
* the old SVR2-style sigset().
*
* OPT_BSD_WAIT -- set to assume bsd-style wait() calls, which expect
@ -117,9 +114,6 @@
* the tttarfile file will appear after extracts, a small flaw but not a
* fatal one.
*
* OPT_HAS_REALPATH -- set if the system provides a realpath() library
* function; otherwise we'll use our local copy.
*
* OPT_PING_TRIES - The number of times to rpc-ping ttsession to
* see if ttsession is alive.
*
@ -191,136 +185,50 @@
# define GNU_STRCAST
#endif
/*
* To avoid ugly cpp command-line options, we instead centralize
* in the following code all knowledge about deducing the OS version
* from the definitions cpp gives us.
*/
#if defined(sun)
# if !defined(OS_VERSION)
# if defined(OSMajorVersion)
# define OS_VERSION OSMajorVersion
# define OS_MINOR_VERSION OSMinorVersion
# else
# if !defined(_STDIO_H) && !defined(__stdio_h)
# include <stdio.h>
# endif
# if defined(_SIZE_T)
# define OS_VERSION 5
# else
# define OS_VERSION 4
# endif
# endif
# endif
#undef OPT_CPP_PATH
#define OPT_CPP_PATH CPP_PROGRAM
#ifdef sun
#define OPT_CPP_OPTIONS "-B"
#else
#define OPT_BUG_RPCINTR
#define OPT_CPP_OPTIONS ""
#define OPT_AUTOMOUNT_PATH_FIX
#define OPT_DEFINE_SIG_PF
#endif
#ifdef __linux__
#define OPT_LOCAL_MOUNT_TYPE "ext2fs"
#else
#define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
#endif
#define OPT_POSIX_SIGNAL
#define OPT_CATGETS
#define OPT_TAR_HAS_EXCLUDE_OPTION
#if defined(_AIX)
# undef OPT_UNIX_SOCKET_RPC
# undef OPT_TLI
# undef OPT_DLOPEN_X11
# undef OPT_DLOPEN_CE
# undef OPT_ADDMSG_DIRECT
# undef OPT_BUG_RPCINTR
# undef OPT_LOCAL_MOUNT_TYPE
# undef OPT_TAR_HAS_EXCLUDE_OPTION
# define OPT_BUG_AIX
# undef OPT_SECURE_RPC
# undef OPT_CLASSING_ENGINE
# undef OPT_BSD_SIGNAL
# define OPT_POSIX_SIGNAL
# undef OPT_BSD_WAIT
# undef OPT_DGETTEXT
# define OPT_CATGETS
# define OPT_GETDTABLESIZE
# undef OPT_SYSINFO
# define OPT_CPP_PATH "/usr/ccs/lib/cpp"
# define OPT_CPP_OPTIONS ""
# undef OPT_SVR4_GETMNTENT
# undef OPT_LOCKF_MNTENT
# define OPT_DEFINE_SIG_PF
# undef OPT_TAR_HAS_EXCLUDE_OPTION
# undef OPT_HAS_REALPATH
# define OPT_AUTOMOUNT_PATH_FIX
/* # define OPT_XTHREADS 1 */ /* Defaulted by -DXTHREADS */
#elif defined(sun) && (OS_VERSION <= 4)
# define OPT_UNIX_SOCKET_RPC
# undef OPT_TLI
/* for 4.1.1 systems turning on any dlopen features on the */
/* client side would break clients with ld errors unless they */
/* linked with -ldl. OPT_DLOPEN_CE is ok since clients don't */
/* ever execute ce_* functions. */
# undef OPT_DLOPEN_X11
# undef OPT_DLOPEN_CE
# undef OPT_ADDMSG_DIRECT
# define OPT_SECURE_RPC
# undef OPT_CLASSING_ENGINE
# undef OPT_PATCH
# define OPT_BSD_SIGNAL
# define OPT_BSD_WAIT
# define OPT_DGETTEXT
# undef OPT_CATGETS
# undef OPT_GETDTABLESIZE
# undef OPT_SYSINFO
# define OPT_CPP_PATH "/usr/lib/cpp"
# define OPT_CPP_OPTIONS "-B"
# undef OPT_SVR4_GETMNTENT
# undef OPT_LOCKF_MNTENT
# define OPT_LOCAL_MOUNT_TYPE MNTTYPE_42
# undef OPT_OLD_RPC
# undef OPT_DEFINE_SIG_PF
# define OPT_TAR_HAS_EXCLUDE_OPTION
# define OPT_BUG_SUNOS_4
# define OPT_HAS_REALPATH
# undef OPT_AUTOMOUNT_PATH_FIX
#elif defined(sun) && (OS_VERSION >= 5)
# undef OPT_UNIX_SOCKET_RPC
# define OPT_TLI
# undef OPT_DLOPEN_X11
# undef OPT_DLOPEN_CE
# undef OPT_ADDMSG_DIRECT
# define OPT_SECURE_RPC
# undef OPT_CLASSING_ENGINE
# undef OPT_BSD_SIGNAL
# define OPT_POSIX_SIGNAL
# undef OPT_BSD_WAIT
# undef OPT_DGETTEXT
# define OPT_CATGETS
# undef OPT_GETDTABLESIZE
# define OPT_SYSINFO
# define OPT_CPP_PATH "/usr/ccs/lib/cpp"
# define OPT_CPP_OPTIONS "-B"
# define OPT_SVR4_GETMNTENT
# define OPT_LOCKF_MNTENT
# define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
# undef OPT_DEFINE_SIG_PF
# define OPT_TAR_HAS_EXCLUDE_OPTION
# define OPT_HAS_REALPATH
# undef OPT_AUTOMOUNT_PATH_FIX
/* Does not work on X86 */
# if defined(i386) && OS_MINOR_VERSION <= 4
# undef OPT_GARBAGE_THREADS
# undef OPT_SOLARIS_THREADED_TRIES
# else
# define OPT_SOLARIS_THREADS 1
# define OPT_SOLARIS_THREADS 1
/* # define OPT_XTHREADS 1 */ /* Defaulted by -DXTHREADS */
# define OPT_GARBAGE_THREADS 1
# define OPT_SOLARIS_THREADED_TRIES 10
# endif
# define OPT_GARBAGE_THREADS 1
# define OPT_SOLARIS_THREADED_TRIES 10
/* Solaris 2.5 and above, supports clnt_create_timed(3N) */
# if (OS_MINOR_VERSION >= 5)
# define OPT_HAS_CLNT_CREATE_TIMED 1
# define OPT_CLNT_CREATE_TIMEOUT 30
# endif
/* TURN THESE OFF FOR NOW */
# undef OPT_GARBAGE_IN_PARALLEL
# undef OPT_GARBAGE_THREADS
# define OPT_HAS_CLNT_CREATE_TIMED 1
# define OPT_CLNT_CREATE_TIMEOUT 30
/* Turn ON/OFF parallel threads for garbage collection */
# if defined(OPT_DO_AUTO_GARBAGE_COLLECT) && defined(OPT_SOLARIS_THREADS)
@ -328,140 +236,23 @@
# define OPT_GARBAGE_THREADS 1
# else
# define OPT_GARBAGE_IN_PARALLEL 0 /* used as a const */
# undef OPT_GARBAGE_THREADS
# endif
#elif defined(__linux__)
# undef OPT_UNIX_SOCKET_RPC
# undef OPT_TLI
# undef OPT_DLOPEN_X11
# undef OPT_DLOPEN_CE
# undef OPT_ADDMSG_DIRECT
# undef OPT_SECURE_RPC
# undef OPT_CLASSING_ENGINE
# undef OPT_PATCH
# define OPT_POSIX_SIGNAL
# undef OPT_BSD_WAIT
# undef OPT_DGETTEXT
# define OPT_CATGETS
# undef OPT_GETDTABLESIZE
# undef OPT_SYSINFO
# define OPT_CPP_PATH "/usr/bin/cpp"
# define OPT_CPP_OPTIONS ""
# undef OPT_SVR4_GETMNTENT
# undef OPT_LOCKF_MNTENT
# define OPT_LOCAL_MOUNT_TYPE "ext2fs"
# undef OPT_OLD_RPC
# define OPT_DEFINE_SIG_PF
# define OPT_TAR_HAS_EXCLUDE_OPTION
# define OPT_HAS_REALPATH
# define OPT_AUTOMOUNT_PATH_FIX
# define OPT_BUG_RPCINTR
# undef OPT_XTHREADS
# define OPT_CONST_CORRECT
#elif defined(__OpenBSD__)
# undef OPT_UNIX_SOCKET_RPC
# undef OPT_TLI
# undef OPT_DLOPEN_X11
# undef OPT_DLOPEN_CE
# undef OPT_ADDMSG_DIRECT
# undef OPT_SECURE_RPC
# undef OPT_CLASSING_ENGINE
# undef OPT_PATCH
# define OPT_POSIX_SIGNAL
# undef OPT_BSD_WAIT
# undef OPT_DGETTEXT
# define OPT_CATGETS
# undef OPT_GETDTABLESIZE
# undef OPT_SYSINFO
# define OPT_CPP_PATH "/usr/libexec/cpp"
# define OPT_CPP_OPTIONS ""
# undef OPT_SVR4_GETMNTENT
# undef OPT_LOCKF_MNTENT
# define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
# undef OPT_OLD_RPC
# define OPT_DEFINE_SIG_PF
# define OPT_TAR_HAS_EXCLUDE_OPTION
# define OPT_HAS_REALPATH
# define OPT_AUTOMOUNT_PATH_FIX
# define OPT_BUG_RPCINTR
# undef OPT_XTHREADS
#elif defined(__FreeBSD__)
# undef OPT_UNIX_SOCKET_RPC
# undef OPT_TLI
# undef OPT_DLOPEN_X11
# undef OPT_DLOPEN_CE
# undef OPT_ADDMSG_DIRECT
# undef OPT_SECURE_RPC
# undef OPT_CLASSING_ENGINE
# undef OPT_PATCH
# define OPT_POSIX_SIGNAL
# undef OPT_BSD_WAIT
# undef OPT_DGETTEXT
# define OPT_CATGETS
# undef OPT_GETDTABLESIZE
# undef OPT_SYSINFO
# if defined(OSMAJORVERSION) && (OSMAJORVERSION >= 5)
# define OPT_CPP_PATH "/usr/bin/cpp"
# else
# define OPT_CPP_PATH "/usr/libexec/cpp"
# endif
# define OPT_CPP_OPTIONS ""
# undef OPT_SVR4_GETMNTENT
# undef OPT_LOCKF_MNTENT
# define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
# undef OPT_OLD_RPC
# define OPT_DEFINE_SIG_PF
# define OPT_TAR_HAS_EXCLUDE_OPTION
# define OPT_HAS_REALPATH
# define OPT_AUTOMOUNT_PATH_FIX
# define OPT_BUG_RPCINTR
# undef OPT_XTHREADS
# define OPT_CONST_CORRECT
#elif defined(__NetBSD__)
# undef OPT_UNIX_SOCKET_RPC
# undef OPT_TLI
# undef OPT_DLOPEN_X11
# undef OPT_DLOPEN_CE
# undef OPT_ADDMSG_DIRECT
# undef OPT_SECURE_RPC
# undef OPT_CLASSING_ENGINE
# undef OPT_PATCH
# define OPT_POSIX_SIGNAL
# undef OPT_BSD_WAIT
# undef OPT_DGETTEXT
# define OPT_CATGETS
# undef OPT_GETDTABLESIZE
# undef OPT_SYSINFO
# define OPT_CPP_PATH "/usr/bin/cpp"
# define OPT_CPP_OPTIONS ""
# undef OPT_SVR4_GETMNTENT
# undef OPT_LOCKF_MNTENT
# define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS
# undef OPT_OLD_RPC
# define OPT_DEFINE_SIG_PF
# define OPT_TAR_HAS_EXCLUDE_OPTION
# define OPT_HAS_REALPATH
# define OPT_AUTOMOUNT_PATH_FIX
# define OPT_BUG_RPCINTR
# undef OPT_XTHREADS
# define OPT_CONST_CORRECT
# define HAS_STATVFS
#else
/* Unknown configuration, complain */
}}}} You must edit lib/tt_options.h and add a section defining the options for your configuration.
#endif
#ifdef CPP_PROGRAM
# undef OPT_CPP_PATH
# define OPT_CPP_PATH CPP_PROGRAM
#warning "Your system is unknown to us, things might not build properly without editing tt_options.h"
#endif
#endif /* _TT_OPTIONS_H */

View file

@ -45,9 +45,6 @@ extern "C" in_addr_t inet_addr(const char *);
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
#include <osfcn.h>
#endif
#define X_INCLUDE_NETDB_H
#define XOS_USE_XT_LOCKING

View file

@ -34,9 +34,6 @@
#include <stdio.h>
#include <stdlib.h>
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
#include <osfcn.h>
#endif
#define X_INCLUDE_TIME_H
#define XOS_USE_XT_LOCKING

View file

@ -59,23 +59,10 @@
#undef rindex
#endif
// Not everybody has realpath() in libc, sometimes we have to define
// it ourselves, see realpath*.c in tt/lib
#if !defined(OPT_HAS_REALPATH)
extern "C" { char *_tt_internal_realpath(char*, char*); }
#endif
// Use the system realpath on OS's that have it, otherwise
// use the ToolTalk implementation of it.
char *
_tt_get_realpath(char *pathname, char *finalpath)
{
#ifdef OPT_HAS_REALPATH
return realpath(pathname, finalpath);
#else
return _tt_internal_realpath(pathname, finalpath);
#endif
}
/*

View file

@ -51,9 +51,7 @@
#include <memory.h>
#include <stdlib.h>
#include <ctype.h>
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <wctype.h>
#endif
#include "util/tt_string.h"
#include "util/tt_assert.h"
#include "util/tt_xdr_utils.h"

View file

@ -36,11 +36,7 @@
* Generic control function
*/
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "isam_impl.h"
@ -76,25 +72,13 @@
typedef int (* intfunc)();
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
int
iscntl(int isfd, int func, ...)
#else
int
iscntl(isfd, func, va_alist)
int isfd;
int func;
va_dcl
#endif
{
va_list pvar;
int ret;
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
va_start(pvar, func);
#else
va_start(pvar);
#endif
switch (func) {
case ISCNTL_MASKSIGNALS:

View file

@ -38,11 +38,9 @@
#include <time.h>
#include <ctype.h>
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
#include <unistd.h>
#include <locale.h>
#include <fcntl.h>
#endif
#define MAXHEADLINES 3
#define FNAMELEN 513
@ -170,19 +168,11 @@ struct search {
EXTERN SEARCH *path INIT(NULL) ;
EXTERN SEARCH **endpath INIT(&path) ;
EXTERN char dirsep
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
INIT('/')
#else
****define directory separator here****
#endif
;
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
#define CSEP '/'
#define SSEP "/"
#else
****define directory separator here****
#endif
/* Location in .TEX file of two \wlog messages */
EXTERN long wlog ;

View file

@ -349,10 +349,7 @@ m_free(string, "GetDefaultHeaderString return");
/* construct a qualified file name */
static int mb_getqualified(char *qualname, char *unqualname)
{
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
FILE *f;
#endif
char fn[FNAMELEN];
char tokstr [ 20 ], *gp, *p, *pp, *fnp, curdir[FNAMELEN-1];
int roomleft = FNAMELEN - 1;
@ -374,7 +371,6 @@ else
fnp = fn;
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
qualname[0] = '\0';
gp = qualname + strlen(qualname);
roomleft = roomleft - strlen(qualname);
@ -402,49 +398,6 @@ else
strcat(qualname,SSEP);
roomleft--;
}
#else
/* if MS-DOS, force to upper case, then get drive spec */
strupr ( fn );
if ( fn[1] == ':' ) {
strncpy ( qualname, fn, 2 );
fnp += 2;
}
else {
getcwd(qualname, roomleft);
}
qualname[2] = '\0';
gp = qualname + strlen ( qualname );
roomleft = roomleft - strlen ( qualname );
/* if path is from root, tack that on, else tack on the current
directory (for the referenced drive, if MS-DOS) */
if ( *fnp == CSEP ) {
strcat ( qualname, SSEP );
roomleft--;
++fnp;
}
else {
/* assume current directory always !!! */
*gp = CSEP;
getcwd(curdir, FNAMELEN-1);
if (*curdir != *qualname) {
m_err1("Relative directory %s for non-current drive, can't qualify",
unqualname);
return (-1);
}
if (strlen(curdir) > 3) {
if ((strlen(curdir+3)+1) < roomleft) { /* "1" for SSEP */
strcpy( gp+1, curdir+3 );
strcat ( qualname, SSEP );
roomleft = roomleft - strlen(curdir+3) - 1; /* "1" for SSEP */
}
else {
m_err1("Internal error. File name too long for qualifying: %s",
unqualname);
return (-1);
}
}
}
#endif
strcpy(tokstr, " \r\n\t");
strcat(tokstr, SSEP);
@ -488,11 +441,6 @@ do {
while (1);
*strrchr(qualname, CSEP) = '\0';
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
#else
strupr ( qualname );
#endif
return ( 0 );
} /* end mb_getqualified */

View file

@ -350,9 +350,7 @@ m_free(string, "GetDefaultHeaderString return");
/* construct a qualified file name */
static int mb_getqualified(char *qualname, char *unqualname)
{
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
FILE *f;
#endif
char fn[FNAMELEN];
char tokstr [ 20 ], *gp, *p, *pp, *fnp, curdir[FNAMELEN-1];
int roomleft = FNAMELEN - 1;
@ -374,7 +372,6 @@ else
fnp = fn;
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
qualname[0] = '\0';
gp = qualname + strlen(qualname);
roomleft = roomleft - strlen(qualname);
@ -402,49 +399,6 @@ else
strcat(qualname,SSEP);
roomleft--;
}
#else
/* if MS-DOS, force to upper case, then get drive spec */
strupr ( fn );
if ( fn[1] == ':' ) {
strncpy ( qualname, fn, 2 );
fnp += 2;
}
else {
getcwd(qualname, roomleft);
}
qualname[2] = '\0';
gp = qualname + strlen ( qualname );
roomleft = roomleft - strlen ( qualname );
/* if path is from root, tack that on, else tack on the current
directory (for the referenced drive, if MS-DOS) */
if ( *fnp == CSEP ) {
strcat ( qualname, SSEP );
roomleft--;
++fnp;
}
else {
/* assume current directory always !!! */
*gp = CSEP;
getcwd(curdir, FNAMELEN-1);
if (*curdir != *qualname) {
m_err1("Relative directory %s for non-current drive, can't qualify",
unqualname);
return (-1);
}
if (strlen(curdir) > 3) {
if ((strlen(curdir+3)+1) < roomleft) { /* "1" for SSEP */
strcpy( gp+1, curdir+3 );
strcat ( qualname, SSEP );
roomleft = roomleft - strlen(curdir+3) - 1; /* "1" for SSEP */
}
else {
m_err1("Internal error. File name too long for qualifying: %s",
unqualname);
return (-1);
}
}
}
#endif
strcpy(tokstr, " \r\n\t");
strcat(tokstr, SSEP);
@ -488,11 +442,6 @@ do {
while (1);
*strrchr(qualname, CSEP) = '\0';
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
#else
strupr ( qualname );
#endif
return ( 0 );
} /* end mb_getqualified */

View file

@ -38,11 +38,9 @@
#include <time.h>
#include <ctype.h>
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
#include <unistd.h>
#include <locale.h>
#include <fcntl.h>
#endif
#ifndef MB_MAX_LEN
#define MB_MAX_LEN 4

View file

@ -171,12 +171,7 @@ static unsigned char anno_double_bits[] = {
0x0a, 0x20, 0xea, 0x2f, 0x0a, 0x20, 0xea, 0x2f, 0x0a, 0x20, 0xfa, 0x3f,
0x02, 0x08, 0xfe, 0x0f, 0x00, 0x00};
#if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED)
#include <signal.h>
#else
#include <sys/signal.h>
#endif
#include <unistd.h>
#include <stdio.h>

View file

@ -63,9 +63,6 @@
#include <ctype.h>
#include <stdio.h>
#include <unistd.h>
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
#include <sysent.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>

View file

@ -77,9 +77,7 @@
#include <WWL/WXmPushButton.h>
#include <stdlib.h>
#if defined(SVR4) || defined(SYSV) || defined(__linux__) || defined(CSRG_BASED)
#include <limits.h>
#endif
#define CLASS QueryTermView

View file

@ -71,20 +71,12 @@ private:
};
template <class T>
#if defined(_IBMR2) || defined(__linux__) || defined(CSRG_BASED) || defined(sun)
class xList : public List_base
#else
class xList : private List_base
#endif
{
// NOTE: This friend declaration is too general because cfront
// barfs when I do it the correct way. 22:05 22-Jul-93 DJB
#ifdef SC3
friend class List_Iterator<T>;
#else
#if !defined(_IBMR2) && !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
template <class T> friend class List_Iterator;
#endif
#endif
public:
xList() { }
@ -118,11 +110,7 @@ public:
template <class T>
#if defined(_IBMR2) || defined(__linux__) || defined(CSRG_BASED) || defined(sun)
class List_Iterator : public List_Iterator_base
#else
class List_Iterator : private List_Iterator_base
#endif
{
friend class xList<T>;
public:

View file

@ -45,13 +45,8 @@
#define WArgList_h
// Allow setting of resources by name in arg list
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#define CASTRNAM (char*)
#define CASTVAL (void*)(size_t)
#else
#define CASTRNAM
#define CASTVAL
#endif
#define RSRC_SET(RSC,TYP,RNAM) \
inline WArgList& RSC(TYP val) { return Add(CASTRNAM RNAM, CASTVAL val); }

View file

@ -45,19 +45,10 @@
#define wwl_h
// Widget Wrapper Library by:
//
// ___ 0 Jean-Daniel Fekete uucp : jdf@lri.lri.fr
// / \ / LRI - Bat 490 bitnet: jdf@FRLRI61.bitnet
// / _/ / Universite de Paris-Sud voice : +33 (1) 69 41 65 91
// /__ \/ F-91405 ORSAY Cedex +33 (1) 69 41 66 29
#include <X11/Intrinsic.h>
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
#include <generic.h>
#else
#define name2(__n1,__n2) __paste2(__n1,__n2)
#define __paste2(__p1,__p2) __p1##__p2
#endif
#include <Xm/Xm.h>
#include "WXmString.h"
@ -78,13 +69,8 @@ class WComposite;
typedef void (* XtProc)();
#endif
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#define CASTRNAM (char*)
#define CASTVAL (void*)(size_t)
#else
#define CASTRNAM
#define CASTVAL
#endif
#define DEFINE_GETTER(rsc,typ,rnam) \
inline typ rsc() const \

View file

@ -42,11 +42,7 @@
#ifdef __cplusplus
#include <stdlib.h>
#if !defined(__DECCXX) && !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
#include <osfcn.h>
#else
#include <unistd.h>
#endif
/* use prototypes in function declarations */
#define YY_USE_PROTOS

View file

@ -64,11 +64,7 @@ Dtlogin*startup: Xstartup
Dtlogin*reset: Xreset
Dtlogin*setup: Xsetup
#if defined (_AIX) || defined (sun) || defined(CSRG_BASED) || defined(__linux__)
Dtlogin*failsafeClient: Xfailsafe
#else
Dtlogin*failsafeClient: /usr/bin/X11/xterm
#endif
XCOMM #########################################################################
XCOMM To specify the system env vars to be exported to the users session

View file

@ -63,11 +63,7 @@
# include <time.h>
# include <utime.h>
# include <pwd.h>
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#if defined(SYSV) || defined(SVR4) || defined(__linux__)
#ifndef F_TLOCK

View file

@ -213,7 +213,6 @@ bitsToBytes (unsigned long bits[2], char bytes[64])
* the OS's random number device.
*/
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#define READ_LIMIT (sizeof (long) * 2)
static int
@ -254,45 +253,6 @@ sumFile (char *name, long sum[2])
#undef READ_LIMIT
#else /* linux || CSRG_BASED */
static int
sumFile (char *name, long sum[2])
{
long buf[1024*2];
int cnt;
int fd;
int loops;
int reads;
int i;
int ret_status = 0;
fd = open (name, 0);
if (fd < 0) {
LogError((unsigned char *) "Cannot open randomFile \"%s\", errno = %d\n", name, errno);
return 0;
}
#ifdef FRAGILE_DEV_MEM
if (strcmp(name, "/dev/mem") == 0) lseek (fd, (off_t) 0x100000, SEEK_SET);
#endif
reads = FILE_LIMIT;
sum[0] = 0;
sum[1] = 0;
while ((cnt = read (fd, (char *) buf, sizeof (buf))) > 0 && --reads > 0) {
loops = cnt / (2 * sizeof (long));
for (i = 0; i < loops; i+= 2) {
sum[0] += buf[i];
sum[1] += buf[i+1];
ret_status = 1;
}
}
if (cnt < 0)
LogError((unsigned char *) "Cannot read randomFile \"%s\", errno = %d\n", name, errno);
close (fd);
return ret_status;
}
#endif /* linux || CSRG_BASED */
void
GenerateAuthData (char *auth, int len)
{

View file

@ -125,9 +125,6 @@ class BufferMemory : public Buffer {
virtual int getSize(void); // get total size of the buffer
private:
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
class Chunk;
#endif
BufferMemory(const Buffer&); // try and avoid copies
void initBuffer(int size); // common constructor

View file

@ -975,14 +975,7 @@ RFCTransport::signalRegister(void)
if (initialized) return;
initialized = 1;
#if defined(_aix) || defined(__linux__) || \
(defined(sun) && OSMAJORVERSION>=5 && OSMINORVERSION>4) || defined(CSRG_BASED)
// SunOS 5.5 and above defined prototype for signal handler
act.sa_handler = (void (*)(int))&RFCTransport::childHandler;
#else
// SunOS 5.4 and before defined prototype signal handler
act.sa_handler = (void (*)())&RFCTransport::childHandler;
#endif
sigemptyset(&act.sa_mask);
sigaddset(&act.sa_mask, SIGCHLD);
act.sa_flags = 0;

View file

@ -41,22 +41,6 @@
#include "dtscreen.h"
#if !defined(_AIX) && !defined(__linux__) && !defined(sun) && !defined(CSRG_BASED)
int
usleep(unsigned long usec)
{
#ifdef SYSV
poll((struct poll *) 0, (size_t) 0, usec / 1000); /* ms resolution */
#else
struct timeval timeout;
timeout.tv_usec = usec % (unsigned long) 1000000;
timeout.tv_sec = usec / (unsigned long) 1000000;
select(0, (void *) 0, (void *) 0, (void *) 0, &timeout);
#endif
return 0;
}
#endif /* !_AIX && */
/*
* returns the number of seconds since 01-Jan-70.
* This is used to control rate and timeout in many of the animations.

View file

@ -88,15 +88,6 @@ typedef struct {
int size[MAXCOLORS];
} wormstruct;
#if !defined(CSRG_BASED) && !defined(sun) && !defined(__linux__)
int
round(float x)
{
return ((int) floor((double) x));
}
#endif
void
worm_doit(perwindow *pwin, wormstruct *wp, int which, unsigned long color)
{

View file

@ -31,11 +31,7 @@
#include "Options.h"
#include <stdlib.h>
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <iostream>
#else
#include <iostream.h>
#endif
#include <stdio.h>
#include <pwd.h>

View file

@ -75,11 +75,7 @@
#include "dtappgather.h"
#include "DirIterator.h"
#include <stdlib.h>
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <iostream>
#else
#include <iostream.h>
#endif
Options * options;
@ -88,7 +84,7 @@ void LegacyCleanUp
CDEEnvironment * user
)
{
//XXX:
// For now, remove the old ApplicationManager subdirectory
// so that we don't leave old CDE users with extra baggage
// under $HOME.

View file

@ -136,25 +136,13 @@ void ManSearchPath::Print()
}
}
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
std::ostream & operator<<
(
std::ostream & os,
const ManSearchPath & sp
)
#else
ostream & operator<<
(
ostream & os,
const ManSearchPath & sp
)
#endif
{
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
os << sp.GetEnvVar() << std::endl;
#else
os << sp.GetEnvVar() << endl;
#endif
sp.PrettyPrint(os);
return os;
}

View file

@ -33,11 +33,7 @@
#include "Options.h"
#include <stdlib.h>
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <iostream>
#else
#include <iostream.h>
#endif
#include <stdio.h>
#include <pwd.h>

View file

@ -387,33 +387,18 @@ void SearchPath::Print()
*
****************************************************************/
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
void SearchPath::PrettyPrint
(
std::ostream & os
) const
#else
void SearchPath::PrettyPrint
(
ostream & os
) const
#endif
{
CTokenizedString path (GetSearchPath(), Separator().data());
CString subpath = path.next();
while (!subpath.isNull()) {
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
os << " " << subpath << std::endl;
#else
os << " " << subpath << endl;
#endif
subpath = path.next();
}
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
os << std::endl;
#else
os << endl;
#endif
}
@ -424,25 +409,13 @@ void SearchPath::PrettyPrint
*
****************************************************************/
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
std::ostream & operator<<
(
std::ostream & os,
const SearchPath & sp
)
#else
ostream & operator<<
(
ostream & os,
const SearchPath & sp
)
#endif
{
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
os << sp.GetEnvVar() << "SEARCHPATH:" << std::endl;
#else
os << sp.GetEnvVar() << "SEARCHPATH:" << endl;
#endif
sp.PrettyPrint(os);
return os;
}

View file

@ -34,11 +34,7 @@
#include "Environ.h"
#include "cstring.h"
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <iostream>
#else
#include <iostream.h>
#endif
#include <stdio.h>
class SearchPath {
@ -51,15 +47,9 @@ class SearchPath {
virtual void Print();
virtual void AddPredefinedPath();
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
virtual void PrettyPrint (std::ostream &) const;
friend std::ostream & operator<< (std::ostream &, const SearchPath &);
#else
virtual void PrettyPrint (ostream &) const;
friend ostream & operator<< (ostream &, const SearchPath &);
#endif
const char * GetEnvVar() const { return environment_var; }
CString GetSearchPath() const { return final_search_path; }
@ -186,11 +176,7 @@ class ManSearchPath : public SearchPath {
virtual void ExportPath ();
virtual void Print();
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
friend std::ostream & operator<< (std::ostream &, const ManSearchPath &);
#else
friend ostream & operator<< (ostream &, const ManSearchPath &);
#endif
protected:
virtual void MakePath (const CString &);

View file

@ -95,32 +95,15 @@ TTFile & TTFile::operator=
return *this;
}
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
std::ostream & operator<<
(
std::ostream & os,
TTFile & file
)
#else
ostream & operator<<
(
ostream & os,
TTFile & file
)
#endif
{
if (file.ttFileOpFailed())
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
return os << "Error in filename mapping; status = "
<< file.getStatus() << std::endl;
#else
return os << "Error in filename mapping; status = "
<< file.getStatus() << endl;
#endif
else
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
return os << file.data() << std::endl;
#else
return os << file.data() << endl;
#endif
}

View file

@ -65,11 +65,7 @@ class TTFile : public CString {
};
#else
void TT_Exception (char *);
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
friend std::ostream & operator<< (std::ostream &, TTFile &);
#else
friend ostream & operator<< (ostream &, TTFile &);
#endif
#endif
int ttFileOpFailed () { return status != TT_OK; }

View file

@ -34,11 +34,7 @@
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <iostream>
#else
#include <iostream.h>
#endif
#include <stdio.h>
#include <unistd.h>
#include <grp.h>
@ -50,10 +46,8 @@
#endif
#include <errno.h>
#if defined(sun) || defined(_AIX) || defined(__linux__) || defined(CSRG_BASED)
#define UID_NO_CHANGE ((uid_t) -1)
#define GID_NO_CHANGE ((gid_t) -1)
#endif
UnixEnvironment::UnixEnvironment()
{

View file

@ -566,19 +566,11 @@ int i;
}
}
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
std::ostream & operator<<
(
std::ostream & os,
const CString & s
)
#else
ostream & operator<<
(
ostream & os,
const CString & s
)
#endif
{
if (s.isNull())
return os << "(null)";

View file

@ -32,11 +32,7 @@
#ifndef _CSTRING_H_
#define _CSTRING_H_
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <iostream>
#else
#include <iostream.h>
#endif
#include <string.h>
class CString {
@ -72,11 +68,7 @@ class CString {
int isNull() const;
void replace (const CString &, const CString &);
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
friend std::ostream & operator<< (std::ostream &, const CString &);
#else
friend ostream & operator<< (ostream &, const CString &);
#endif
protected:
char * contents;

View file

@ -65,7 +65,6 @@ endif
if FREEBSD
LOCAL_CPP_DEFINES += -DFREEBSD -D__FreeBSD__
SUBDIRS += config
endif
if SOLARIS
@ -78,7 +77,6 @@ endif
if NETBSD
LOCAL_CPP_DEFINES += -D__NetBSD__
SUBDIRS += config
endif
if BSD

View file

@ -945,11 +945,7 @@ GetUdcFontName(
{
FILE *fp ;
pid_t chld_pid = 0;
#if defined( SVR4 ) || defined( SYSV ) || defined(CSRG_BASED) || defined(__linux__)
int chld_stat ;
#else
union wait chld_stat ;
#endif
struct ptobhead head ;
char *p, *tmp_font ;
char readbuf[BUFSIZE], fntbuf[BUFSIZE] ;

View file

@ -163,12 +163,7 @@ WriteBdfHeader( struct ptobhead *head )
char buf[BUFSIZE], *p;
pid_t chld_pid = 0;
#if defined( SVR4 ) || defined( SYSV ) || defined(CSRG_BASED) || defined(__linux__)
int chld_stat ;
#else
union wait chld_stat ;
#endif
if (head->snf_file != NULL) {
if (pipe(fd) != 0) {

View file

@ -98,7 +98,7 @@ extern XmMenuState _XmGetMenuState();
static unsigned int GetEventInverseMask(XEvent *event);
#if (defined(__linux__) || defined(sun) || defined(CSRG_BASED)) && !defined(_NFILE)
#if !defined(_NFILE)
#define _NFILE FOPEN_MAX
#endif

View file

@ -3,12 +3,6 @@
if SOLARIS
LANG=fr
endif
if LINUX
LANG=fr_FR.UTF-8
endif
if BSD
else
LANG=fr_FR.UTF-8
endif

View file

@ -3,12 +3,6 @@
if SOLARIS
LANG=de
endif
if LINUX
LANG=de_DE.UTF-8
endif
if BSD
else
LANG=de_DE.UTF-8
endif

View file

@ -3,12 +3,6 @@
if SOLARIS
LANG=it
endif
if LINUX
LANG=it_IT.UTF-8
endif
if BSD
else
LANG=it_IT.UTF-8
endif

View file

@ -3,12 +3,6 @@
if SOLARIS
LANG=ja
endif
if LINUX
LANG=ja_JP.UTF-8
endif
if BSD
else
LANG=ja_JP.UTF-8
endif

View file

@ -3,12 +3,6 @@
if SOLARIS
LANG=es
endif
if LINUX
LANG=es_ES.UTF-8
endif
if BSD
else
LANG=es_ES.UTF-8
endif

View file

@ -29,12 +29,8 @@
#ifndef TT_CXX_H
#define TT_CXX_H
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <iostream>
using namespace std;
#else
#include <iostream.h>
#endif
#include <Tt/tt_c.h>

View file

@ -190,12 +190,10 @@ signalHandler(
}
}
#if defined(SVR4) || defined(aix) || defined(__linux__) || defined(CSRG_BASED)
#if !defined(SIG_PF)
typedef void (*sig_pf_t)(int);
#define SIG_PF sig_pf_t
#endif
#endif
int
_tt_sigset(