Initial import of the CDE 2.1.30 sources from the Open Group.
This commit is contained in:
17
cde/lib/DtSvc/include/bms/Imakefile
Normal file
17
cde/lib/DtSvc/include/bms/Imakefile
Normal file
@@ -0,0 +1,17 @@
|
||||
XCOMM $XConsortium: Imakefile /main/4 1996/04/21 19:09:58 drk $
|
||||
|
||||
HEADERS = \
|
||||
MemoryMgr.h SbEvent.h Symbolic.h \
|
||||
XeUserMsg.h bms.h connect.h \
|
||||
pathwexp.h sbport.h sbstdinc.h \
|
||||
scoop.h spc.h stringbuf.h \
|
||||
usersig.h
|
||||
|
||||
all::
|
||||
|
||||
BuildIncludes($(HEADERS),bms,..)
|
||||
InstallMultipleFlags($(HEADERS),$(INCDIR)/bms,$(INSTINCFLAGS))
|
||||
|
||||
depend::
|
||||
|
||||
clean::
|
||||
49
cde/lib/DtSvc/include/bms/MemoryMgr.h
Normal file
49
cde/lib/DtSvc/include/bms/MemoryMgr.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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 */
|
||||
|
||||
75
cde/lib/DtSvc/include/bms/SbEvent.h
Normal file
75
cde/lib/DtSvc/include/bms/SbEvent.h
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* 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 */
|
||||
350
cde/lib/DtSvc/include/bms/Symbolic.h
Normal file
350
cde/lib/DtSvc/include/bms/Symbolic.h
Normal file
@@ -0,0 +1,350 @@
|
||||
/*
|
||||
* 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_ */
|
||||
|
||||
45
cde/lib/DtSvc/include/bms/XeUserMsg.h
Normal file
45
cde/lib/DtSvc/include/bms/XeUserMsg.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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 */
|
||||
54
cde/lib/DtSvc/include/bms/bms.h
Normal file
54
cde/lib/DtSvc/include/bms/bms.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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 */
|
||||
|
||||
201
cde/lib/DtSvc/include/bms/connect.h
Normal file
201
cde/lib/DtSvc/include/bms/connect.h
Normal file
@@ -0,0 +1,201 @@
|
||||
/*
|
||||
* 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 */
|
||||
|
||||
23
cde/lib/DtSvc/include/bms/pathwexp.h
Normal file
23
cde/lib/DtSvc/include/bms/pathwexp.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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 */
|
||||
388
cde/lib/DtSvc/include/bms/sbport.h
Normal file
388
cde/lib/DtSvc/include/bms/sbport.h
Normal file
@@ -0,0 +1,388 @@
|
||||
/*
|
||||
* 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
|
||||
__apollo - Will be set for APOLLO (domain) 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
|
||||
|
||||
|
||||
__apollo88k - Set for apollo (domain) risc (PRISM) machines
|
||||
__apollo68k - Set for apollo (domain) m68k machines
|
||||
__apollo_null - Set to allow null pointer dereferences on domain
|
||||
|
||||
__apollo_paths - Set to have "//<host>" converted to "host:"
|
||||
|
||||
__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(apollo) && !defined(__apollo)
|
||||
# define __apollo
|
||||
#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
|
||||
|
||||
#if defined(__osf__) && !defined(__osf)
|
||||
# define __osf
|
||||
# define __sysv
|
||||
# define OSF_BUG
|
||||
# define __char_ptr_yytext
|
||||
#endif
|
||||
|
||||
#if defined(osf) && !defined(__osf)
|
||||
# define __osf
|
||||
# define __sysv
|
||||
# define __osfs700
|
||||
# define OSF_BUG
|
||||
# define __hp_color_object
|
||||
# define __char_ptr_yytext
|
||||
#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 __apollo
|
||||
# ifndef __bsd
|
||||
# define __sysv /* NOTE: not bsd!!! */
|
||||
# endif
|
||||
# ifndef __apollo_paths
|
||||
# define __apollo_paths
|
||||
# endif
|
||||
# ifndef __apollo_null
|
||||
# define __apollo_null
|
||||
# endif
|
||||
# if defined(a88k) && !defined(__apollo88k)
|
||||
# define __apollo88k
|
||||
# endif
|
||||
# if defined(_ISP__A88K) && !defined(__apollo88k)
|
||||
# define __apollo88k
|
||||
# endif
|
||||
# if defined(m68k) && !defined(__apollo68k)
|
||||
# define __apollo68k
|
||||
# endif
|
||||
# if defined(_ISP__M68K) && !defined(__apollo68k)
|
||||
# define __apollo68k
|
||||
# endif
|
||||
# define __hp_color_object
|
||||
# define __unsigned_char_ptr_yytext
|
||||
#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
|
||||
|
||||
#ifndef __apollo_paths
|
||||
# define __apollo_paths /* We always want this feature */
|
||||
#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" */
|
||||
# ifdef __osf
|
||||
# define _OSF_SOURCE
|
||||
# include <sys/time.h>
|
||||
# endif
|
||||
# ifdef __sun
|
||||
# include <sys/time.h>
|
||||
# endif
|
||||
#if defined(USL) || defined(__uxp__)
|
||||
# include <sys/time.h>
|
||||
# endif
|
||||
# ifdef __apollo
|
||||
# include <sys/time.h>
|
||||
# endif
|
||||
# ifdef __aix
|
||||
# include <sys/time.h>
|
||||
# endif
|
||||
#endif /* __need_timeval */
|
||||
|
||||
|
||||
#if defined(__need_fd_set) /* Get "typedef struct fd_set" */
|
||||
# ifdef __osf
|
||||
# define _OSF_SOURCE
|
||||
# include <sys/types.h>
|
||||
# endif
|
||||
# ifdef __apollo
|
||||
# define _INCLUDE_BSD_SOURCE
|
||||
# include "/bsd4.3/usr/include/sys/types.h"
|
||||
# endif
|
||||
# ifdef _AIX
|
||||
# include <sys/select.h>
|
||||
# endif
|
||||
/*
|
||||
# if defined(USL) || defined(__uxp__)
|
||||
# include <sys/select.h>
|
||||
# endif
|
||||
*/
|
||||
#endif /* __need_fd_st */
|
||||
|
||||
|
||||
#if defined(__need_S_IF) /* Get S_IFNWK, S_IFLNK */
|
||||
# ifdef __osf
|
||||
# define _OSF_SOURCE
|
||||
# endif
|
||||
# ifdef __apollo
|
||||
# define _APOLLO_SOURCE
|
||||
# endif
|
||||
#endif /* __need_S_IF */
|
||||
|
||||
#if defined(__need_all_errors)
|
||||
# ifdef __apollo
|
||||
# define _APOLLO_SOURCE
|
||||
# undef _SYS_STDSYMS_INCLUDED /* So we can include <sys/stdsyms.h> again */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__need_all_signals) /* Get all SIGxxx values */
|
||||
# ifdef __osf
|
||||
# define _OSF_SOURCE
|
||||
# endif
|
||||
# ifdef __apollo
|
||||
# define _APOLLO_SOURCE
|
||||
# include "/bsd4.3/usr/include/sys/types.h"
|
||||
# endif
|
||||
#endif /* __need_all_signal */
|
||||
|
||||
/* 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(USL) || defined(_INCLUDE_BSD_SOURCE) || defined(_OSF_SOURCE) || defined(__aix) || defined(__uxp__) || defined(__osf__) || 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;
|
||||
#ifndef __osf__
|
||||
typedef long int32;
|
||||
#endif
|
||||
typedef unsigned char u_int8;
|
||||
typedef unsigned short u_int16;
|
||||
#ifndef __osf__
|
||||
typedef unsigned long u_int32;
|
||||
#endif
|
||||
|
||||
#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 */
|
||||
|
||||
224
cde/lib/DtSvc/include/bms/sbstdinc.h
Normal file
224
cde/lib/DtSvc/include/bms/sbstdinc.h
Normal file
@@ -0,0 +1,224 @@
|
||||
/*
|
||||
* 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). */
|
||||
/************************************************************************/
|
||||
|
||||
/* Domain/OS BSD has bzero(), bcmp(), and bcopy() defined. */
|
||||
#if !defined(apollo) || !defined(__bsd)
|
||||
|
||||
#if defined(__STDC__)
|
||||
#if !defined(linux) && !defined(__osf__) && !defined(_XFUNCS_H_)
|
||||
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(__osf__) && !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
|
||||
#ifndef __osf__
|
||||
# ifdef strlen
|
||||
# undef strlen
|
||||
# endif
|
||||
# define strlen Xestrlen
|
||||
#endif
|
||||
|
||||
#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 */
|
||||
140
cde/lib/DtSvc/include/bms/scoop.h
Normal file
140
cde/lib/DtSvc/include/bms/scoop.h
Normal file
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
* 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 */
|
||||
467
cde/lib/DtSvc/include/bms/spc.h
Normal file
467
cde/lib/DtSvc/include/bms/spc.h
Normal file
@@ -0,0 +1,467 @@
|
||||
/*
|
||||
* 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 */
|
||||
47
cde/lib/DtSvc/include/bms/stringbuf.h
Normal file
47
cde/lib/DtSvc/include/bms/stringbuf.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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 */
|
||||
39
cde/lib/DtSvc/include/bms/usersig.h
Normal file
39
cde/lib/DtSvc/include/bms/usersig.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* 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 _usesig_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 */
|
||||
Reference in New Issue
Block a user