The great includes migration of 2019 (autotools)

Ok - so one of the steps in building CDE is an early phase called the
includes phase (make includes).  At this point, all of the public
header files are exported to exports/include/Dt, DtI, ...

Then, the software is built using that include dir.

This of course does not work in autotools.  Much of the software does
things like #include <Dt/something.h>, so in order for the build to
succeed, this behavior must be represented/replicated in some way.

It seems the usual way of dealing with this is to place all public
headers (and in some projects, ALL headers) into a toplevel include
directory.

We now do this for all public headers - they have been moved from
wherever they were and placed in the appropriate spot in includes/

This will break the Imake 'make includes' phase unless the Imakefiles
are fixed (remove the HEADERS = stuff, and the incdir defines).  This
has not been done at this point since in reality, once autotools works
properly, there will be no need for the Imake stuff anymore, and I
intend to get rid of it.

This is just a warning for now - Imake builds in this tree will now
fail at the 'includes' stage.

This commit is only the migration.  In upcoming commits, libtt will be
fixed so that the hack being used before to get around this problem is
removed as there will no longer be any need.

And then the autotools work continues...
This commit is contained in:
Jon Trulson
2019-10-25 17:01:34 -06:00
parent 7c2983185d
commit 369308b737
180 changed files with 1 additions and 30 deletions

View File

@@ -0,0 +1,71 @@
/*
* 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
*/
/*
* File: MemoryMgr.h $XConsortium: MemoryMgr.h /main/3 1995/10/26 15:45:08 rswiston $
* Language: C
*
* (c) Copyright 1988, Hewlett-Packard Company, all rights reserved.
*
* (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. *
*/
/* Allocation routines */
#ifndef _MemoryMgr_h
#define _MemoryMgr_h
void *XeMalloc
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(size_t size);
#else
();
#endif
void XeFree
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(void * ptr);
#else
();
#endif
#define Xe_make_struct(type) ((struct type *)XeMalloc(sizeof(struct type)))
#define Xe_make_ntype(n, type) ((type *) XeMalloc((n)*sizeof(type)))
#define Xe_make_buffer(size) ((XeString) XeMalloc(size))
#define Xe_make_str(size) ((XeString) XeMalloc((size)+1))
#define XeCopyStringM(string_xxx) (string_xxx \
? (XeString) strcpy(Xe_make_str(strlen(string_xxx)), string_xxx) \
: (XeString) NULL)
/* Dellocation */
#define Xe_release_ntype(ptr, n, type) XeFree(ptr)
#define Xe_release_str(ptr) XeFree(ptr)
#endif /* _MemoryMgr_h */
/* PLACE NOTHING AFTER THIS endif */

97
cde/include/bms/SbEvent.h Normal file
View File

@@ -0,0 +1,97 @@
/*
* 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
*/
/*
* File: SbEvent.h $XConsortium: SbEvent.h /main/3 1995/10/26 15:45:29 rswiston $
* Language: C
*
* (c) Copyright 1990, Hewlett-Packard Company, all rights reserved.
*
* (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. *
*/
#ifndef _SbEvent_h
#define _SbEvent_h
typedef unsigned long SbInputId;
typedef void (*SbInputCallbackProc)
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(void* data, int *fd, SbInputId *id);
#else
();
#endif
extern SbInputId (*SbAddInput_hookfn)
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(int fd, SbInputCallbackProc proc, void* data);
#else
();
#endif
extern SbInputId (*SbAddException_hookfn)
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(int fd, SbInputCallbackProc proc, void* data);
#else
();
#endif
extern void (*SbRemoveInput_hookfn)
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(SbInputId id);
#else
();
#endif
extern void (*SbRemoveException_hookfn)
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(SbInputId id);
#else
();
#endif
extern void (*SbMainLoopUntil_hookfn)
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(Boolean *flag);
#else
();
#endif
extern void XeCall_SbMainLoopUntil
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(Boolean *flag);
#else
();
#endif
extern void (*SbBreakMainLoop_hookfn)
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(void);
#else
();
#endif
#endif /* _SbEvent_h */

372
cde/include/bms/Symbolic.h Normal file
View File

@@ -0,0 +1,372 @@
/*
* 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
*/
/*
* File: Symbolic.h $XConsortium: Symbolic.h /main/3 1995/10/26 15:45:51 rswiston $
* Language: C
*
* (c) Copyright 1988, Hewlett-Packard Company, all rights reserved.
*
* (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. *
*/
/* SYMBOLS */
#ifndef _Symbolic_h_
#define _Symbolic_h_
/* -------------------------------------------- */
/* Requires: */
#ifdef __recursive_includes
#include <bms/bms.h>
#endif
/* -------------------------------------------- */
/****************************************************************************/
/* Symbol (hash) Tables */
/*
There are two types of symbol (hash) tables. The common case is where the
key (index) is ascii string. The Xe_intern() and XeRegisterSymbol()
routines assume this type of table. In these cases an "XeSymbol" entry is
created in the symbol table (see type below). After it is created a COPY of
the string is made and stored in the "name" field. The "value" field is
free for the user to fill in on his own.
*/
typedef struct _XeSymbol {
XeString name;
void *value;
} *XeSymbol;
/*
This type is used for the XeRegisterFunction() routine.
*/
typedef void (*XeAnyFunction) ();
/*
The second type of table is where the user defines his own type of
data, hash functions, compare functions, etc.
*/
/* The following types for the the user configurable functions that */
/* are set with the Xe_set_syms_fns() routine. */
/* ---------------------------------------------------------------- */
/* CMP_FN: */
/* */
/* Any user defined function should return "0" for a "match" */
/* */
/* Used for Xe_intern() and XeRegisterSymbol() */
/* */
/* If NO "cmp_fn", strcmp("next_table_entry"->name, "name") */
/* If "cmp_fn", cmp_fn("next_table_entry"->name, "name") */
/* */
/* Used for Xe_intern_anysym() */
/* */
/* If NO "cmp_fn", strcmp("next_table_entry"->name, "data"->name) */
/* If "cmp_fn", cmp_fn("next_table_entry", "data") */
/* -------------------------------------------------------------------- */
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
typedef int (*XeSymFn_cmp) (void *, void *); /* 0 mean match */
#else
typedef int (*XeSymFn_cmp) ();
#endif
/* HASH_FN: */
/* */
/* Note, the internal hash function in not user accesable. */
/* */
/* Used for Xe_intern() and XeRegisterSymbol() */
/* */
/* If NO "hash_fn", internal_hash("next_table_entry"->name, "name") */
/* If "hash_fn", hash_fn("next_table_entry"->name, "name") */
/* */
/* Used for Xe_intern_anysym() */
/* */
/* If NO "hash_fn", internal_hash("next_table_entry"->name, "data"->name)*/
/* If "hash_fn", hash_fn("next_table_entry" , "data") */
/* ----------------------------------------------------------------------- */
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
typedef unsigned int (*XeSymFn_hash) (void *, unsigned int);
#else
typedef unsigned int (*XeSymFn_hash) ();
#endif
/* INIT_FN: */
/* */
/* Used for Xe_intern() and XeRegisterSymbol() */
/* */
/* 1) A XeSymbol entry is created, */
/* - XeSymbol->name = strdup("name"), */
/* - XeSymbol->value = NULL */
/* 2) If a "init_fn" is configured, */
/* - XeSymbol->value = init_fn( XeSymbol, 0 ) */
/* */
/* Used for Xe_intern_anysym() */
/* */
/* 1) If "size" != 0, */
/* - malloc "size" bytes, */
/* - copy "size" bytes from "data" into malloced space, */
/* - Save pointer to malloc space as user's data pointer */
/* Else */
/* - Save "data" as pointer to user's data */
/* 3) If a "init_fn" is configured, */
/* - call init_fn( user's data pointer, "size" ) */
/* - set user's data pointer to return value of init_fn */
/* ONLY if "size" was zero. */
/* */
/* If size is non zero AND there is a user's malloc function, */
/* beware that the return value from the malloc function is not */
/* save anywhere by these routines. If size was zero, the */
/* return value of the user's function is kept. */
/* */
/* -------------------------------------------------------------------- */
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
typedef void * (*XeSymFn_init)(void *, unsigned int);
#else
typedef void * (*XeSymFn_init)();
#endif
/* CLEAN_FN: */
/* */
/* If created by Xe_intern() or XeRegisterSymbol() */
/* */
/* 1) free(XeSymbol->name) */
/* 2) If a "clean_fn" is configured, */
/* - clean_fn(XeSymbol->value), */
/* - the XeSymbol entry is deleted. */
/* */
/* If created by Xe_intern_anysym() */
/* */
/* 1) If a "clean_fn" is configured, */
/* - init_fn( user's data pointer, "size" ) */
/* 2) If "size" != 0 during at creation time, */
/* - free( user's data pointer ) */
/* */
/* Take note of the what happens during creation with "size" is */
/* non-zero and there is a user's malloc function. The result of */
/* the user's malloc function will be passed to this clean function */
/* only if "size" was zero at creation time. Otherwise, the memory */
/* malloc'ed by this routine due to the non-zero size parameter is */
/* what is passed to the user's clean function. */
/* -------------------------------------------------------------------- */
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
typedef void (*XeSymFn_clean) (void *);
#else
typedef void (*XeSymFn_clean) ();
#endif
/* This is what an internal symbol table entry looks like: */
/* ------------------------------------------------------- */
typedef struct _XeSymtabList {
struct _XeSymtabList *rest;
void *data;
Boolean data_is_XeSymbol;
Boolean data_is_malloc_mem;
} *XeSymtabList;
/* This is the master record for a symbol table */
/* -------------------------------------------- */
typedef struct _XeSymTable
{
unsigned int hashsize; /* # of hash buckets. */
XeSymtabList *list; /* Hash buckets. */
XeSymtabList curr_list; /* Used to dump/traver the table. */
unsigned int curr_hash;
XeSymFn_cmp cmp_fn; /* Read above description with each */
XeSymFn_hash hash_fn; /* function typedef for more info. */
XeSymFn_init init_fn;
XeSymFn_clean clean_fn;
} *XeSymTable;
/* Create a new hashtable. "hashsize must be power of 2 if using default */
/* hash function (no checking is done to ensure this). */
/* --------------------------------------------------------------------- */
XeSymTable Xe_new_symtab
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(unsigned int hashsize);
#else
();
#endif
/* Create the default symbol table. If already created, just */
/* return the symtable pointer. */
/* ---------------------------------------------------------- */
XeSymTable Xe_default_symtab
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(void);
#else
();
#endif
/* Configure user defined function for use with symtab routines. */
/* NOTE: Be sure you understand the interaction of these functions */
/* Read the decriptions with each of the typdef's above. A */
/* null function pointer will overwrite any previously */
/* installed value. */
/* --------------------------------------------------------------- */
XeSymTable Xe_set_sym_fns
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeSymTable t,
XeSymFn_cmp cmp_fn,
XeSymFn_init init_fn,
XeSymFn_clean clean_fn,
XeSymFn_hash hash_fn);
#else
();
#endif
/* Find or create a symbol for "name". Its "value" is set to NULL. */
/* None of the user defined init/cmp, etc functions are honored by */
/* this routine */
/* WARNING: Read the notes for the function typedef's above. */
/* ----------------------------------------------------------------- */
XeSymbol Xe_intern
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeSymTable t, ConstXeString const name);
#else
();
#endif
/* Find the symbol for "name". NULL is returned if not found. */
/* None of the user defined init/cmp, etc functions are honored by */
/* this routine */
/* WARNING: Read the notes for the function typedef's above. */
/* ----------------------------------------------------------------- */
XeSymbol Xe_lookup
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeSymTable t, ConstXeString const name);
#else
();
#endif
/****************************************************************************/
/* LISTS */
typedef struct _XeList {
struct _XeList *rest;
void *data;
} *XeList;
/* make a list from data and rest */
/* ------------------------------ */
XeList Xe_make_list
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(void *data, XeList rest);
#else
();
#endif
/****************************************************************************/
/* QUEUES */
typedef struct _XeQueue {
XeList head;
XeList tail;
void * null;
} *XeQueue;
/* for static or auto struct queues */
/* -------------------------------- */
XeQueue Xe_init_queue
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeQueue q, void * nullval);
#else
();
#endif
XeQueue Xe_make_queue
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(void * nullval);
#else
();
#endif
void Xe_release_queue
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeQueue q);
#else
();
#endif
/* nullval returned if queue empty */
/* ------------------------------- */
void * Xe_pop_queue
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeQueue q);
#else
();
#endif
/* nullval returned if not found */
/* ------------------------------- */
void * Xe_delete_queue_element
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeQueue q, void * val);
#else
();
#endif
void Xe_push_queue
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeQueue q, void * val);
#else
();
#endif
/* user declares his own "type var" */
/* -------------------------------- */
#define Xe_for_queue(type,var,q) \
XeList q_next, q_list; \
for(q_list = q->head; \
q_list && (var = (type) q_list->data, q_next = q_list->rest , 1);\
q_list = q_next)
/* PUT NOTHING AFTER THIS endif */
#endif /* _Symbolic_h_ */

View File

@@ -0,0 +1,67 @@
/*
* 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
*/
/*
* File: XeUserMsg.h $XConsortium: XeUserMsg.h /main/3 1995/10/26 15:46:16 rswiston $
* Language: C
*
* (c) Copyright 1988, Hewlett-Packard Company, all rights reserved.
*
* (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. *
*/
#ifndef _XeUserMsg_h
#define _XeUserMsg_h
#include <bms/sbport.h>
/* Global Variables */
/* ---------------- */
extern XeString XeProgName; /* saves value of arg[0] */
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
typedef enum {
XeIgnore,
XeInformation,
XeWarning,
XeError,
XeFatalError,
XeInternalError
} XeSeverity;
#else
# define XeIgnore 0
# define XeInformation 1
# define XeWarning 2
# define XeError 3
# define XeFatalError 4
# define XeInternalError 5
typedef int XeSeverity;
#endif
#define export /* Use this noop to mark non-static procedures. */
#endif /* _XeUserMsg_h */
/* DON'T ADD STUFF AFTER THIS #endif */

76
cde/include/bms/bms.h Normal file
View File

@@ -0,0 +1,76 @@
/*
* 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
*/
/*
* File: bms.h $XConsortium: bms.h /main/4 1996/06/21 17:20:07 ageorge $
* Language: C
*
* (c) Copyright 1988, Hewlett-Packard Company, all rights reserved.
*
* (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. *
*/
#ifndef _bms_h
#define _bms_h
#ifdef SVR4
#include <netdb.h> /* MAXHOSTNAMELEN */
#else
#include <sys/param.h> /* MAXHOSTNAMELEN */
#endif
/* WARNINGS: */
/* */
/* 1) <bms/sbport.h> MUST included before this file. */
/* 2) Any <X11/...> includes MUST come before this file. */
/* ---------------------------------------------------------- */
#ifndef _XtIntrinsic_h /* Define "Boolean" if not already */
typedef char Boolean; /* defined from <X11/Intrinsic.h> */
#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
extern char *XeToolClass;
extern XeString XeProgName; /* From noXinit.c */
extern XeString /* Returns Malloc'ed memory */
XeSBTempPath
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeString);
#else
();
#endif
/* DON'T ADD STUFF AFTER THIS #endif */
#endif /* _bms_h */

223
cde/include/bms/connect.h Normal file
View File

@@ -0,0 +1,223 @@
/*
* 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
*/
/*
* File: connect.h $XConsortium: connect.h /main/3 1995/10/26 15:47:00 rswiston $
* Language: C
*
* (c) Copyright 1988, Hewlett-Packard Company, all rights reserved.
*
* (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. *
*/
#ifndef _connect_h
#define _connect_h
#if defined(__cplusplus) && defined(__c_callable)
extern "C" {
#endif
int XeParseFileString
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeString line, XeString *host_addr, XeString *path_addr);
#else
();
#endif
#if defined(__cplusplus) && defined(__c_callable)
}
#endif
/*
Take the filespec as a line and return a path the host and path
components as separate fields (finds the ':' and replaces it with
NULL). THIS FUNCTION MUNGES THE ORIGINAL LINE.
*/
extern XeString XeFindHost
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeString host_spec);
#else
();
#endif
extern XeString XeFindShortHost
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeString host_spec);
#else
();
#endif
/*
Returns a host name corresponding to host_spec.
In all cases a NEW STRING, OWNED BY THE
CALLER, is returned. XeFindHost returns the full host specification
including domain if there is one. XeFindShortHost does not
include the domain. These functions can be used to convert between
domain and simple names when needed. The domain names should be
used always internally and the simple names only used for display.
*/
extern int Xegethostname
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeString hostname, unsigned int size);
#else
();
#endif
#if defined(__cplusplus) && defined(__c_callable)
extern "C" {
#else
extern
#endif
int Xegetshorthostname
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeString hostname, unsigned int size);
#else
();
#endif
#if defined(__cplusplus) && defined(__c_callable)
}
#endif
/*
Identical to the libc function gethostname, except that Xegethostname
returns a full domain qualified name and Xegetshorthostname returns
a simple name. These functions are necessary because the system
hostname may or may not contain a domain name and the internal
representation should always be canonical form (domain qualified).
Use Xegethostname except when the name is being used for display
purposes only. Storage allocation is identical to gethostname
(it copies into the caller's buffer).
*/
#if defined(__cplusplus) && defined(__c_callable)
extern "C" {
#else
extern
#endif
Boolean XeIsLocalHostP
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeString hostname);
#else
();
#endif
#if defined(__cplusplus) && defined(__c_callable)
}
#endif
/*
Returns true if the hostname passed in identifies the host on which
this function is executed. This is needed in order to handle all
combinations of simple and domain-qualified names for either the
hostname passed in or the one defined on the local host. Be sure
to include Xe.h or provide a local declaration for this function
as Boolean is not the same length as int and it won't function
correctly without the declaration.
*/
#if defined(__cplusplus) && defined(__c_callable)
extern "C" {
#else
extern
#endif
Boolean XeIsSameHostP
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeString host1, XeString host2);
#else
();
#endif
#if defined(__cplusplus) && defined(__c_callable)
}
#endif
/*
Returns true if host1 and host2 specify the same host. This is
needed, because either or both hosts may be specified with or
without domain qualifiers, and the correct result must be
obtained. This function canonicalizes both and compares them
only in canonical form.
*/
extern Boolean XeIsSameHostP
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeString host1, XeString host2);
#else
();
#endif
/*
Returns true if host1 and host2 specify the same host. This is
needed, because either or both hosts may be specified with or
without domain qualifiers, and the correct result must be
obtained. This function canonicalizes both and compares them
only in canonical form.
*/
XeString XeCreateContextString
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeString host, XeString directory, XeString file);
#else
();
#endif
/*
XeCreateContextString changes the given context into a
label which is exactly the same as the one shown in a
fileview modeline. A NEW STRING, OWNED BY THE CALLER,
is returned.
*/
#define XeEliminateDots(path) (XeString)pathcollapse(path, path, FALSE)
/*
Removes /./'s and /../ 's from path. THIS ROUTINE OVERWRITES
THE path IT WAS PASSED. If there are too many ..'s in path,
NULL is returned, so you better keep a pointer to path if you hope
to reclaim it. Does not handle host:/path, shell variables or other
exotic animals.
*/
int Xechdir
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(const char *path);
#else
();
#endif
/*
performs a chdir and caches the new directory in $PWD so that
Xegetcwd() can get the current directory without slow stat calls
*/
char *Xegetcwd
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(char *buf,
int size);
#else
();
#endif
/*
version of getcwd() which uses cached $PWD (or $PWD from shell)
if available and calls getcwd only when PWD not set
*/
/* DON'T ADD STUFF AFTER THIS #endif */
#endif /* _connect_h */

View File

@@ -0,0 +1,45 @@
/*
* 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
*/
/*
* File: pathwexp.h $XConsortium: pathwexp.h /main/3 1995/10/26 15:47:18 rswiston $
* Language: C
*
* (c) Copyright 1988, Hewlett-Packard Company, all rights reserved.
*
* (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. *
*/
#ifndef _pathwexp_h
#define _pathwexp_h
extern XeString Xe_shellexp
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeString path);
#else
();
#endif
#endif /* _pathwexp_h */

294
cde/include/bms/sbport.h Normal file
View File

@@ -0,0 +1,294 @@
/*
* 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
*/
/*
* File: sbport.h $TOG: sbport.h /main/4 1998/03/16 14:40:52 mgreess $
* Language: C
*
* (c) Copyright 1988, Hewlett-Packard Company, all rights reserved.
*
* (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. *
*/
#ifndef PORT_H_INCLUDED
#define PORT_H_INCLUDED
/*---------------------------------------------------------------------------
The following is a list of #defines that may be tested for in the code:
=======================================================================
__STDC__ - Will be set for ANSI C compilers
__cplusplus - Will be set for C++ compilers
__STDCPP__ - Will be set for ANSI and C++ compilers
__hpux - Will be set for HP-UX systems
__sun - Will be set for SUN systems
__aix - Will be set for IBM (AIX) systems
__sysv - Set when using SYSV semantics (e.g. HP, SUN)
SYSV - Set when __sysv is set (needed for some X11 includes)
__bsd - Set when using BSD semantics
__hp_7_0 - For running on HP-UX 7.0
__hp_nls_16 - Set if HP's 16 bit support is to be compiled in
__hp_color_object - Set if HP's ColorObject extension is available in the Motif library
__hp9000s300 - Set for S300 (and S400?) HP-UX machines
__hp9000s800 - Set for S800 (PA-RISC) machines
__sparc - Set for SUN sparc machines
__sun68k - Set for SUN m68k machines
__identification_strings - Set when RCS header strings are to be in code
__recursive_includes - Set to have .h files #includes prerequisite files
__char_ptr_yytext - Set if the lex/yacc variable yytext is defined
to be of type char[].
__unsigned_char_ptr_yytext - Set if the lex/yacc variable yytext is defined
to be of type unsigned char[].
KEEP_DEADWOOD - Currently set to "FALSE". If set to "TRUE",
lots of old code and semantics will be enabled.
----------------------------------------------------------------------------*/
/* First task is to make sure all of the defines that we use in the */
/* code are properly set up. */
/* ---------------------------------------------------------------- */
#if !defined(sun)
#if !defined(__STDCPP__) && (defined(__STDC__) || defined(__cplusplus))
# define __STDCPP__
#endif
#endif
#if defined(sun) && !defined(__sun)
# define __sun
#endif
#if defined(hpux) && !defined(__hpux)
# define __hpux
#endif
#if defined(_AIX) && !defined(__aix)
# define __aix
# define OSF_MOTIF_1_1_1
# define OSF_BUG
#endif
#ifdef __hpux
# define __sysv
/* __hp9000s300 or __hp9000s800 is defined by HP-UX cpp */
# if !defined (__hpux_8_0)
# define __hp_7_0
# endif
# define __hp_nls_16
# define __hp_color_object
# define __unsigned_char_ptr_yytext
#endif /* __hpux */
#ifdef __sun
# if defined(sparc) && !defined(__sparc)
# define __sparc
# else
# if defined(mc68000) || defined(__mc68000)
# define __sun68k
# endif
# endif
# define __hp_color_object /* Should only be set if linking with */
/* HP's version of Motif (1.1 or later). */
# define __char_ptr_yytext
# define __c_callable /* Set so VUE can link with libbms. */
#endif
#ifdef __aix
# define __sysv
#endif
#if defined(__sysv) && !defined(SYSV)
# define SYSV /* Needed for X11 include files */
#endif
#ifndef KEEP_DEADWOOD /* Setting this to "TRUE" will cause */
# define KEEP_DEADWOOD FALSE /* all sorts of unknown problems. */
#endif
#ifdef __cplusplus
#define UNUSED_PARM(_parm)
#else
#define UNUSED_PARM(_parm) _parm
#endif /* __cplusplus */
/* There are a few things that are not part of XPG3 that we need. */
/* sockets are one of them. To use this stuff, we just include the */
/* non XOPEN include files and things work. However, there are a */
/* few XOPEN include files that have stuff to support this extra */
/* functionality (e.g. sockets) that are #ifdef'ed for conditional */
/* inclusion with the _XOPEN_SOURCE define. In order to pull those */
/* extra types in, we relas the XPG3 compliance for that file. The */
/* following are the three areas where we must do this: */
/* */
/* __need_timeval gets "struct timeval" */
/* __need_fd_set gets "typedef struct fd_set {..." */
/* __need_S_IF gets "S_IFNWK, S_IFLNK" */
/* __need_all_signals gets all SIGxxx values */
/* __need_all_errors gets all errno values */
/* */
/* We get at these declarations differently on each platform... */
/* ----------------------------------------------------------------- */
#if defined(__need_timeval) /* Get "struct timeval" */
# if defined(__sun) || defined(__aix)
# include <sys/time.h>
# endif
#endif /* __need_timeval */
#if defined(__need_fd_set) /* Get "typedef struct fd_set" */
# ifdef _AIX
# include <sys/select.h>
# endif
#endif /* __need_fd_st */
/* We also use the following non XPG3 types. However, they may be */
/* defined when we relax the XPG3 compliance to get the stuff talked */
/* about above. So, declare them only if we don't already have them */
/* ----------------------------------------------------------------- */
#if defined(_HPUX_SOURCE) || defined(__sun) || defined(_INCLUDE_BSD_SOURCE) || defined(__aix) || defined(__linux__)
/* the "u_types" are defined in standard files */
# undef _INCLUDE_BSD_SOURCE
#else
typedef unsigned int u_int;
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned long u_long;
#endif
/* Use these if you must ensure that you get a specific number of bits */
/* -------------------------------------------------------------------- */
typedef char int8;
typedef short int16;
typedef long int32;
typedef unsigned char u_int8;
typedef unsigned short u_int16;
typedef unsigned long u_int32;
#define __xechar_is_signed
#undef __xechar_is_unsigned
#ifdef __xechar_is_signed
typedef char XeChar;
#else
typedef unsigned char XeChar;
#endif
/* The following type is a VARIABLE pointer to a VARIABLE XeChar. */
typedef XeChar *XeString;
/***********************************************************************
* The following type is a VARIABLE pointer to a CONST XeChar.
* Thus, ConstXeString p;
* p = "abcd"; #Legal
* *p = "\0'; #Illegal
*
* This is NOT the same as (const XeString)
* which is equivilent to (XeChar * const)
*
* Thus, const XeString p;
* p = "abcd"; #Illegal
* *p = "\0'; #Legal
*
************************************************************************/
typedef const XeChar *ConstXeString;
typedef unsigned short XeChar16;
typedef XeChar16 *XeString16;
#define XeString_NULL (XeString) 0
#define XeString_Empty (XeString) ""
#define XeChar_NULL (XeChar) 0
/* XtPointer was added in R4, so define it ourselves in R3 */
#ifdef __motif10
typedef void * XtPointer;
#endif
/* The X11 R4 header file "Intrinsic.h" is internally inconsistent */
/* with respect to XtAppAddInput. The third parameter ("condition") */
/* is defined to be of type XtPointer (void *), but the input masks */
/* commonly used with it are scalar values. Until the problem is */
/* corrected by M.I.T, use the following type as a cast in calls */
/* to XtAppAddInput. When it is corrected, change this typedef */
/* accordingly. */
/* ---------------------------------------------------------------- */
typedef void * XeInputMask;
#ifdef __cplusplus
/* Define several macros to handle the C++ vs XtOffset problem. */
/* The problem is that C++ cannot at compile time evaluate the */
/* XtOffset macro within an initializer. XtOffset is most often */
/* used within an XtResource array initialization list. */
/* class_names must be a typedef, non pointer type. */
/* ---------------------------------------------------------------- */
#define XtOffsetSimpleField(class_name,field) \
((Cardinal) &class_name::field - 1)
#define XtOffsetCompoundField(class_name1,field1,class_name2,field2) \
(((Cardinal) &class_name1::field1 - 1) + ((Cardinal) &class_name2::field2 - 1))
#else
#define XtOffsetSimpleField(class_name,field) \
((Cardinal) (((char *) (&(((class_name *)NULL)->field))) - ((char *) NULL)))
#define XtOffsetCompoundField(class_name1,field1,class_name2,field2) \
((Cardinal) (((char *) (&(((class_name1 *)NULL)->field1))) - ((char *) NULL))) + \
((Cardinal) (((char *) (&(((class_name2 *)NULL)->field2))) - ((char *) NULL)))
#endif
#ifndef __identification_strings
#define SUPPRESS_RCS_ID /*forces equivalent action for VED/EDIT shared files*/
#endif
#ifndef SBSTDINC_H_NO_INCLUDE
#include <bms/sbstdinc.h>
#endif
#ifdef __aix
# undef NULL
# define NULL 0 /* AIX uses NULL=(void *)0 */
#endif
#endif /* PORT_H_INCLUDED */

244
cde/include/bms/sbstdinc.h Normal file
View File

@@ -0,0 +1,244 @@
/*
* 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
*/
/*
* File: sbstdinc.h $TOG: sbstdinc.h /main/7 1998/07/31 17:50:45 mgreess $
* Language: C
*
* (c) Copyright 1988, Hewlett-Packard Company, all rights reserved.
*
* (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. *
*/
#ifndef _sbstdinc_h
#define _sbstdinc_h
#include <sys/types.h>
#include <sys/param.h>
#ifdef SVR4
#include <netdb.h> /* MAXHOSTNAMELEN */
#endif /* SVR4 */
#ifndef howmany
#define howmany(x, y) (((x)+((y)-1))/(y)) /* From <sys/param.h>, but not an XPG3 file */
#endif
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>
#include <stdio.h>
#include <fcntl.h>
#include <nl_types.h>
/************************************************************************/
/* Routines not defined in include files (yet). */
/************************************************************************/
/* BSD has bzero(), bcmp(), and bcopy() defined. */
#if !defined(__bsd) && !defined(CSRG_BASED)
#if defined(__STDC__)
#if !defined(__linux__) && !defined(_XFUNCS_H_) && !defined(sun)
extern void bcopy(char *b1, char *b2, int length);
extern int bcmp(char *b1, char *b2, int length);
extern void bzero(char *b, int length);
#endif
extern char *mktemp(char *tmplate);
#elif ! defined(__cplusplus)
#if !defined(__linux__) && !defined(_XFUNCS_H_)
extern void bcopy();
extern int bcmp();
extern void bzero();
#endif
extern char *mktemp();
#endif
#endif
#ifndef SBSTDINC_H_NO_REDEFINE /* sbstdinc.c turns this on */
/************************************************************************/
/* Routines from <string.h> */
/* --- These always get redefined so we can catch null ptr deref's */
/************************************************************************/
#if defined(__STDC__) || defined(__cplusplus)
extern XeString Xestrcat(XeString s1, ConstXeString s2);
#else
extern XeString Xestrcat();
#endif
#ifdef strcat
# undef strcat
#endif
#define strcat Xestrcat
#if defined(__STDC__) || defined(__cplusplus)
extern XeString Xestrncat(XeString s1, ConstXeString s2, size_t n);
#else
extern XeString Xestrncat();
#endif
#ifdef strncat
# undef strncat
#endif
#define strncat Xestrncat
#if defined(__STDC__) || defined(__cplusplus)
extern int Xestrcmp(ConstXeString s1, ConstXeString s2);
#else
extern int Xestrcmp();
#endif
#ifdef strcmp
# undef strcmp
#endif
#define strcmp Xestrcmp
#if defined(__STDC__) || defined(__cplusplus)
extern int Xestrncmp(ConstXeString s1, ConstXeString s2, size_t n);
#else
extern int Xestrncmp();
#endif
#ifdef strncmp
# undef strncmp
#endif
#define strncmp Xestrncmp
#if defined(__STDC__) || defined(__cplusplus)
extern XeString Xestrcpy(XeString s1, ConstXeString s2);
#else
extern XeString Xestrcpy();
#endif
#ifdef strcpy
# undef strcpy
#endif
#define strcpy Xestrcpy
#if defined(__STDC__) || defined(__cplusplus)
extern XeString Xestrncpy(XeString s1, ConstXeString s2, size_t n);
#else
extern XeString Xestrncpy();
#endif
#ifdef strncpy
# undef strncpy
#endif
#define strncpy Xestrncpy
#if defined(__STDC__) || defined(__cplusplus)
extern int Xestrcoll(ConstXeString s1, ConstXeString s2);
#else
extern int Xestrcoll();
#endif
#ifdef strcoll
# undef strcoll
#endif
#define strcoll Xestrcoll
#if defined(__STDC__) || defined(__cplusplus)
extern size_t Xestrxfrm(XeString s1, ConstXeString s2, size_t n);
#else
extern size_t Xestrxfrm();
#endif
#ifdef strxfrm
# undef strxfrm
#endif
#define strxfrm Xestrxfrm
#if defined(__STDC__) || defined(__cplusplus)
extern XeString Xestrchr(ConstXeString s, int c);
#else
extern XeString Xestrchr();
#endif
#ifdef strchr
# undef strchr
#endif
#define strchr Xestrchr
#if defined(__STDC__) || defined(__cplusplus)
extern XeString Xestrpbrk(ConstXeString s1, ConstXeString s2);
#else
extern XeString Xestrpbrk();
#endif
#ifdef strpbrk
# undef strpbrk
#endif
#define strpbrk Xestrpbrk
#if defined(__STDC__) || defined(__cplusplus)
extern XeString Xestrrchr(ConstXeString s, int c);
#else
extern XeString Xestrrchr();
#endif
#ifdef strrchr
# undef strrchr
#endif
#define strrchr Xestrrchr
#if defined(__STDC__) || defined(__cplusplus)
extern XeString Xestrstr(ConstXeString s1, ConstXeString s2);
#else
extern XeString Xestrstr();
#endif
#ifdef strstr
# undef strstr
#endif
#define strstr Xestrstr
#if defined(__STDC__) || defined(__cplusplus)
extern XeString Xestrtok(XeString s1, ConstXeString s2);
#else
extern XeString Xestrtok();
#endif
#ifdef strtok
# undef strtok
#endif
#define strtok Xestrtok
#if defined(__STDC__) || defined(__cplusplus)
extern size_t Xestrlen(ConstXeString s);
#else
extern size_t Xestrlen();
#endif
#ifdef strlen
# undef strlen
#endif
#define strlen Xestrlen
#if defined(__STDC__) || defined(__cplusplus)
extern XeString Xestrdup(ConstXeString s);
#else
extern XeString Xestrdup();
#endif
#ifdef strdup
# undef strdup
#endif
#define strdup Xestrdup
#endif /* ifndef SBSTDINC_H_NO_REDEFINE */
#endif /* _sbstdinc_h */

162
cde/include/bms/scoop.h Normal file
View File

@@ -0,0 +1,162 @@
/*
* 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
*/
/*
* File: scoop.h $XConsortium: scoop.h /main/3 1995/10/26 15:48:17 rswiston $
* Language: C
*
* (c) Copyright 1988, Hewlett-Packard Company, all rights reserved.
*
* (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. *
*/
#ifndef _scoop_h
#define _scoop_h
#ifndef NULL
#define NULL 0L
#endif
#ifndef TRUE
#define FALSE 0
#define TRUE 1
#endif /* TRUE */
#if !defined(__sun)
# if (defined(__STDC__) || defined(__STDCPP__) || defined(__cplusplus) || defined(c_plusplus))
# define CAT(a,b) a##b
# else
# define CAT(a,b) a/**/b
# endif
#else
/* Sun C++ compiler uses the non-ansi cpp. */
# if defined(__cplusplus)
# define CAT(a,b) a/**/b
# else
# define CAT(a,b) a##b
# endif
#endif
typedef long OSizeType ;
typedef struct root_class *root_clasp, *object_clasp ;
typedef struct object_struct object;
typedef void (*SC_class_init)(object_clasp);
typedef void (*SC_object_init)(object *);
typedef object * (*SC_new_obj)(object_clasp);
typedef void (*SC_free_obj)(object *);
typedef object * (*SC_clone)(object *, object *);
#define root_class_part \
XeString name ; /* class name */ \
SC_class_init class_init; /* fn to init my class struct */ \
OSizeType object_size ; /* size of object of this class */ \
short init ; /* boolean--class initialized state */ \
SC_object_init object_init; /* fn to init my object struct */ \
SC_new_obj new_obj; /* fn to allocate class objects */ \
SC_free_obj free_obj; /* fn to free class objects */ \
SC_clone clone; /* `method' to clone an object */ \
/* no root private parts */
#define root_object_part
struct object_struct
{ root_clasp class_ptr;
root_object_part
};
struct root_class
{ object_clasp base ; /* pointer to base class */
root_class_part } ;
#define memf(vref, fn, arglist) ( (vref class_ptr)->fn arglist)
#define memvf0(v,fn) memf(v., fn, (&(v)))
#define memvf1(v,fn,a1) memf(v., fn, (&(v),a1))
#define memvf2(v,fn,a1,a2) memf(v., fn, (&(v),a1,a2))
#define memvf3(v,fn,a1,a2,a3) memf(v., fn, (&(v),a1,a2,a3))
#define memvf4(v,fn,a1,a2,a3,a4) memf(v., fn, (&(v),a1,a2,a3,a4))
#define memvf5(v,fn,a1,a2,a3,a4,a5) memf(v., fn, (&(v),a1,a2,a3,a4,a5))
#define memvf6(v,fn,a1,a2,a3,a4,a5,a6) memf(v., fn, (&(v),a1,a2,a3,a4,a5,a6))
#define memvf7(v,fn,a1,a2,a3,a4,a5,a6,a7) \
memf(v., fn, (&(v),a1,a2,a3,a4,a5,a6,a7))
#define memvf8(v,fn,a1,a2,a3,a4,a5,a6,a7,a8) \
memf(v., fn, (&(v),a1,a2,a3,a4,a5,a6,a7,a8))
#define memvf9(v,fn,a1,a2,a3,a4,a5,a6,a7,a8,a9) \
memf(v., fn, (&(v),a1,a2,a3,a4,a5,a6,a7,a8,a9))
#define mempf0(p,fn) memf(p->, fn, (p))
#define mempf1(p,fn,a1) memf(p->, fn, (p,a1))
#define mempf2(p,fn,a1,a2) memf(p->, fn, (p,a1,a2))
#define mempf3(p,fn,a1,a2,a3) memf(p->, fn, (p,a1,a2,a3))
#define mempf4(p,fn,a1,a2,a3,a4) memf(p->, fn, (p,a1,a2,a3,a4))
#define mempf5(p,fn,a1,a2,a3,a4,a5) memf(p->, fn, (p,a1,a2,a3,a4,a5))
#define mempf6(p,fn,a1,a2,a3,a4,a5,a6) memf(p->, fn, (p,a1,a2,a3,a4,a5,a6))
#define mempf7(p,fn,a1,a2,a3,a4,a5,a6,a7) \
memf(p->, fn, (p,a1,a2,a3,a4,a5,a6,a7))
#define mempf8(p,fn,a1,a2,a3,a4,a5,a6,a7,a8) \
memf(p->, fn, (p,a1,a2,a3,a4,a5,a6,a7,a8))
#define mempf9(p,fn,a1,a2,a3,a4,a5,a6,a7,a8,a9) \
memf(p->, fn, (p,a1,a2,a3,a4,a5,a6,a7,a8,a9))
#define memd(vref, dm) (vref dm)
#define base_memf(my_class, fn, arglist) \
((*(my_class->base->fn)) arglist)
#define memfp(vref, fn, arglist) memf (vref, CLASS.fn, arglist)
#define memdp(vref, dm) memd (vref, CLASS.dm)
#define memvs(v, sdm) (*((v.class_ptr)->sdm))
#define memps(p, sdm) (*((p->class_ptr)->sdm))
#define stat_def(name, type) type *name; type CAT(name,_static) ;
#define stat_init(def_class, class_ptr, name) \
(class_ptr->name) = &(def_class->CAT(name,_static))
extern object_clasp root_class ;
extern void object_destroy
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(object *p);
#else
();
#endif
extern object *object_create
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(object_clasp c);
#else
();
#endif
extern void object_init
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(object_clasp c, object *p);
#else
();
#endif
#endif /* _scoop_h */
/* PLACE NOTHING AFTER THIS endif */

489
cde/include/bms/spc.h Normal file
View File

@@ -0,0 +1,489 @@
/*
* 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
*/
/*
* File: spc.h $XConsortium: spc.h /main/3 1995/10/26 15:48:38 rswiston $
* Language: C
*
* (c) Copyright 1988, Hewlett-Packard Company, all rights reserved.
*
* (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. *
*/
#ifndef _spc_h
#define _spc_h
/* -------------------------------------------- */
/* Requires: */
#include <stdio.h>
#include <bms/XeUserMsg.h>
#include <termios.h>
/* -------------------------------------------- */
typedef struct _SPC_Channel *SPC_Channel_Ptr;
typedef struct _XeHostInfo {
XeString os;
XeString os_ver;
XeString hw_arch;
} *XeHostInfo;
extern FILE *SPC_Print_Protocol;
extern FILE *spc_logF;
extern XeString spc_user_environment_file;
/* Error returns for SPC routines */
#define SPC_ERROR FALSE /* Use this value for error checking */
/*
* These are the channel connector definitions
*/
#define STDIN 0
#define STDOUT 1
#define STDERR 2
#define MASTER_SIDE 0
#define SLAVE_SIDE 1
/* These are the sub-process notification identifiers */
#define SPC_PROCESS_STOPPED 1 /* Child process is in background */
#define SPC_PROCESS_EXITED 2 /* Child process called exit(cause); */
#define SPC_PROCESS_SIGNALLED 3 /* Child process received signal: cause */
#define SPC_PROCESS_INTERRUPT 4 /* Child process WAIT was interrupted */
#define SPC_PROCESS_DUMPED(a) ((a) & 0200) /* True when core dumped */
/* This is the maximum size of an SPC I/O Buffer */
#define SPC_BUFSIZ 4096
/*
* These macros define the bit field portion of an SPC_IOMode
*/
#define SPCIO_ALL_MASK 0xffffffff
/* The IO Modes that define the input and output sources */
#define SPCIO_SOURCE_MASK 0xf
#define SPCIO_NOIO 0x0 /* The default - no input/output */
#define SPCIO_WRITEONLY 0x1 /* Only write app stdin */
#define SPCIO_READONLY 0x2 /* Only read app stdout */
#define SPCIO_READWRITE 0x3 /* Read stdout, write stdin */
#define SPCIO_ERRORONLY 0x4 /* Only read stderr */
#define SPCIO_WRITEERROR 0x5 /* Write stdin, read stderr */
#define SPCIO_READERROR 0x6 /* Only read stdout/stderr */
#define SPCIO_READWRITEERROR 0x7 /* Full std (in, out, err) */
/* Use this bit with above IO Mode for splitting stdout and stderr data */
#define SPCIO_SEPARATEREADERROR 0x8 /* Separate stdout & stderr */
/* The IO Modes that deal with communication styles (features) */
#define SPCIO_STYLE_MASK 0x70
#define SPCIO_PTY 0x10 /* Use a PTY */
#define SPCIO_PIPE 0x20 /* Use pipe() - no line editing */
#define SPCIO_NOIOMODE 0x40 /* Use neither */
#define SPCIO_LINEEDIT 0x80 /* Valid only with PTY */
/* Other flags */
#define SPCIO_SYSTEM 0x100 /* Use system() - Spawns a SHELL */
#define SPCIO_LINEORIENTED 0x200 /* Invoke callback on line bounds */
/* It is possible to break two byte
characters. See note on XeSPCRead. */
#define SPCIO_WAIT 0x400 /* Wait for process to finish */
#define SPCIO_USE_XTOOLKIT 0x800 /* Use the X toolkit */
#define SPCIO_SYNC_TERMINATOR 0x1000 /* Handle termination synchronously */
#define SPCIO_USE_LOGFILE 0x2000 /* Use logfile for stderr -- only
valid with SPCIO_NOIO */
#define SPCIO_SIGNAL_PGRP 0x20000 /* Propagate signals to entire process
group. */
#define SPCIO_FORCE_CONTEXT 0x40000 /* Error on SPC Spawn if context dir
is not present */
/*
* Routines
*/
/* spc.c */
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
# define EXTERN_DECL(type, name, arglist) type name arglist
# if defined(__cplusplus) && defined(__c_callable)
# define EXTERN_C_CALLABLE(type, name, arglist) \
extern "C" { type name arglist ; }
# else
# define EXTERN_C_CALLABLE(type, name, arglist) \
EXTERN_DECL(type, name, arglist)
# endif
#else
#ifdef _AIX
# define EXTERN_C_CALLABLE(type, name, arglist) \
extern type name arglist
# define EXTERN_DECL(type, name, arglist) \
type name arglist
#else /* _AIX */
# define EXTERN_DECL(type, name, arglist) name arglist
# define EXTERN_C_DECL(type, name, arglist) EXTERN_DECL(type, name, arglist)
#endif /* (_AIX) */
#endif
EXTERN_C_CALLABLE(SPC_Channel_Ptr, XeSPCOpen, (XeString hostname, int iomode));
/*
Open an SPC channel. Process will run on 'hostname' (or the local
host if value is NULL), with the specified iomode.
*/
EXTERN_C_CALLABLE(int, XeSPCClose, (SPC_Channel_Ptr channel));
/*
Close an SPC channel. Closing a channel will automatically deactivate it
(meaning that any subprocess associated with the channel is terminated).
*/
EXTERN_DECL(int, XeSPCReset, (SPC_Channel_Ptr channel));
/*
Reset an SPC channel. This will allow it to be used in a subsequent
spawn or exec call.
*/
EXTERN_DECL(int, XeSPCRead,
(SPC_Channel_Ptr channel, int connector,
XeString buffer, int length));
/*
Read length characters from an SPC channel into some preallocated buffer.
Note that it is possible to split a two-byte character, if the first
byte if the character is read in just at buffer[length]. However, the
next read will return the second byte (just like Unix read). The
'connector' value is either STDOUT or STDERR.
*/
EXTERN_DECL(int, XeSPCWrite,
(SPC_Channel_Ptr channel, XeString buffer, int length));
/*
Write length characters from buffer to the standard input of a
process on the other side of an SPC channel.
*/
EXTERN_C_CALLABLE(int, XeSPCActive, (SPC_Channel_Ptr channel));
/*
Returns True when channel is active, False otherwise
*/
EXTERN_DECL(int, XeSPCData, (SPC_Channel_Ptr channel));
/*
Returns True when channel be read from, False otherwise
*/
EXTERN_C_CALLABLE(int, XeSPCSpawn,
(XeString pathname, XeString context_dir, XeString *argv,
XeString *envp, SPC_Channel_Ptr channel));
/*
Spawn an application under SPC
*/
EXTERN_DECL(SPC_Channel_Ptr, XeSPCOpenAndSpawn,
(XeString hostname, int iomode, XeString pathname,
XeString context_dir, XeString *argv, XeString *envp));
/*
Combine the Open and Spawn channel operations
*/
EXTERN_DECL(int, XeSPCExecuteProcess, (SPC_Channel_Ptr channel));
/*
Restart a new subprocess on a channel
*/
EXTERN_C_CALLABLE(void, XeSPCKillProcesses, (int wait));
/*
Kill all known executing processes (useful for catching SIGTERM, etc)
*/
EXTERN_DECL(int, XeSPCKillProcess, (SPC_Channel_Ptr channel, int wait));
/*
Kill executing process on an SPC channel. 'wait' TRUE means don't
return from call until process is completely terminated (including
after user specified callbacks are called).
*/
EXTERN_DECL(int, XeSPCInterruptProcess, (SPC_Channel_Ptr channel));
/*
Interrupt executing process on an SPC channel (send SIGINT).
*/
EXTERN_DECL(int, XeSPCSignalProcess, (SPC_Channel_Ptr channel, int sig));
/*
Send an arbitrary signal to executing process on an SPC channel.
*/
typedef
EXTERN_DECL(void, (*SbInputHandlerProc),
(void *client_data, XeString buf, int nchars, int connector));
EXTERN_C_CALLABLE(int, XeSPCAddInput,
(SPC_Channel_Ptr channel,
SbInputHandlerProc handler,
void *client_data));
/*
Add an input channel handler
*/
/*
* The user input handler takes the following form:
*
* void UserInputHandler(client_data, text, size, connection)
* void * client_data; *** Useful for passing widet destination ***
* XeString text; *** The text coming from the SPC channel ***
* int size; *** The number of character in passed text ***
* int connection; *** The connection where data was received ***
* *** (STDOUT or STDERR) ***
*/
typedef
EXTERN_DECL(void, (*SPC_TerminateHandlerType),
(SPC_Channel_Ptr chan,
int pid,
int type,
int cause,
void *Terminate_Data));
EXTERN_C_CALLABLE(int, XeSPCRegisterTerminator,
(SPC_Channel_Ptr channel,
SPC_TerminateHandlerType teminator,
void * client_data));
/*
Add a termination handler to a channel (called when sub-process dies)
*/
/*
* The user termination handler takes the following form:
*
* void UserTerminator(channel, pid, type, cause, client_data)
* SPC_CHannel_ptr channel;
* int pid; *** The Process ID of the terminated appl. ***
* int type; *** The type of termination (see above) ***
* int cause; *** The number associated w/termination ***
* void * client_data; *** User specified client data ***
*/
/*
* These are the channel access routines
*/
EXTERN_DECL(XeString, XeSPCGetDevice,
(SPC_Channel_Ptr channel, int connector, int side));
/*
Return the device name associated with a side of a channel device
pair. 'connector' is either STDIN, STDOUT, or STDERR, and 'side' is
either MASTER_SIDE or SLAVE_SIDE. This call is valid only in PTY
channels.
*/
EXTERN_DECL(int, XeSPCGetProcessStatus,
(SPC_Channel_Ptr channel, int *type, int *cause));
/*
Fill in the type and cause of a process termination.
*/
EXTERN_DECL(int, XeSPCAttach, (SPC_Channel_Ptr channel, int pid));
/*
Returns True if a process ID was associated with an SPC channel.
*/
EXTERN_DECL(int, XeSPCDetach, (SPC_Channel_Ptr channel));
EXTERN_DECL(int, XeSPCGetPID, (SPC_Channel_Ptr channel));
/*
Returns the Process ID of the channel or NULL if none
*/
EXTERN_DECL(int, XeSPCGetLogfile,
(SPC_Channel_Ptr channel, XeString *host, XeString *file));
/*
Return the logfile for the channel. If the channel was not opened
with SPCIO_USE_LOGFILE specified, it will return NULL. Also note
that it returns an XeString *, not an XeString.
*/
EXTERN_DECL(int, XeSPCRemoveLogfile, (SPC_Channel_Ptr channel));
/*
Remove the logfile associated with the channel
*/
/*
*
* Features currently not implemented:
*
* SPCIO_WAIT with ptys
*
* SEPARATEREADERROR with ptys
*
* Complete error checking. For example, there
* are no checks for trying to write to a channel
* opened W/O SPCIO_WRITE specified
*
*/
EXTERN_DECL(int, XeSPCGetChannelSyncFd, (SPC_Channel_Ptr channel));
/*
Get the file descriptor for checking synchronous termination. This
is used for interfacing with event loops.
*/
EXTERN_DECL(SPC_Channel_Ptr, XeSPCHandleTerminator, (int fd));
/*
Handle a synchronous termination condition
This routine is to be used with the file descriptor returned by
XeSPCGetChannelSyncFd. The idea is that one opens a channel using
SPCIO_SYNC_TERMINATOR set in the iomode, and then at some point
checks for input available on the returned file descriptor (possibly
using a select(2) system call). If there is input, it means that
some SYNC_TERMINATOR channel had a subprocess die. The program then
calls XeSPCHandleTerminator to get the termination handler invoked.
IT IS THE RESPONSIBILITY OF THE USER PROGRAM TO EVENTUALLY CALL
XeSPCHandleTerminator. IF IT DOES NOT, THE PROGRAM MAY DEADLOCK
ITSELF.
*/
/* SPC Error handling */
typedef struct _SPCError { /* An SPC Error message */
XeString text; /* The text */
XeString format; /* How to format args */
XeSeverity severity; /* How bad is it, doc? */
char use_errno; /* Whether to use the system errno */
} SPCError;
/* Use this to get the current error number */
extern int XeSPCErrorNumber;
EXTERN_DECL(SPCError *, XeSPCLookupError, (int errnum));
/*
Returns the SPCError structure associated with the passed error number or
NULL if the passed error number is not a valid SPC error. The
error structure returned will be overwritten by a subsequent
XeSPCLookupError call.
*/
EXTERN_DECL(void, XeSPCShutdownCallbacks, (void));
EXTERN_DECL(void, XeSPCRestartCallbacks, (void));
/* These two routines are used to temporarily suspend SPC callbacks */
EXTERN_DECL(int, XeSetpgrp, (int read_current_termio));
/*
This routine will do the following:
1. open /dev/tty
2. get the termio information from the file descriptor just opened
3. close /dev/tty
3. allocate a master / slave pty pair, opening the master side
4. set the termio info of the master side to be the result of step 2
5. setpgrp
6. open the slave side.
All of this has the effect of making the process which called this
routine immune to interrupts, etc., but also passing on the termio
characteristics of the original tty.
If read_current_termio is non-zero, steps 1-3 will NOT be performed, but
instead this routine will get the information from the following termio
struct:
*/
EXTERN_DECL(XeHostInfo, SPC_GetHostinfo, (SPC_Channel_Ptr channel));
/*
Return information about the host (os, os-ver, hw) to which "channel"
is currently connected. The return is to a static structure of static
strings. Do not modify or free and of them!
*/
/*
**
** New B.00 functions
**
*/
EXTERN_C_CALLABLE(int, XeSPCSendEOF, (SPC_Channel_Ptr channel));
/*
Close the standard input of the process on the other side of the channel
*/
EXTERN_C_CALLABLE(int, XeSPCSetTermio,
(SPC_Channel_Ptr channel,
int connection,
int side,
struct termios *termio));
/*
Set the termio value of the PTY associated with 'connection' (STDIN,
STDOUT, or STDERR), on 'side' (MASTER_SIDE or SLAVE_SIDE) to the
value pointed to by termio. This call must be made before the
subprocess is spawned.
*/
#endif /* #ifdef _spc_h */

View File

@@ -0,0 +1,69 @@
/*
* 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
*/
/*
* File: stringbuf.h $XConsortium: stringbuf.h /main/3 1995/10/26 15:49:00 rswiston $
* Language: C
*
* (c) Copyright 1988, Hewlett-Packard Company, all rights reserved.
*
* (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. *
*/
#ifndef _stringbuf_h
#define _stringbuf_h
typedef struct _XeStringBuffer {
int last_char; /* index of trailing NULL */
int size;
int increment; /* how much to expand when more space is needed */
XeString buffer;
} *XeStringBuffer;
int XeAppendToStringBuffer
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeStringBuffer buffer, XeString string);
#else
();
#endif
XeStringBuffer XeMakeStringBuffer
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(int increment_size);
#else
();
#endif
/* erase the contents (but don't deallocate any space). */
void XeClearStringBuffer
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeStringBuffer buffer);
#else
();
#endif
/*** add nothing after the following endif ***/
#endif /* _stringbuf_h */

61
cde/include/bms/usersig.h Normal file
View File

@@ -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 libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* File: usersig.h $XConsortium: usersig.h /main/3 1995/10/26 15:49:19 rswiston $
* Language: C
*
* (c) Copyright 1989, Hewlett-Packard Company, all rights reserved.
*
* (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. *
*/
#ifndef _usersig_h
#define _usersig_h
/* -------------------------------------------- */
/* Requires: */
#ifdef __recursive_includes
#include <signal.h>
#endif
/* -------------------------------------------- */
#define XE_SIG_NOT_IN_TABLE -2
extern int XeNameToSignal
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(XeString name);
#else
();
#endif
extern XeString XeSignalToName
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
(int sig);
#else
();
#endif
#endif /* _usersig_h */