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

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

View File

@@ -0,0 +1,274 @@
/* $XConsortium: ast.h /main/3 1995/11/01 17:34:52 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Advanced Software Technology Library
* AT&T Bell Laboratories
*
* std + posix + ast
*/
#ifndef _AST_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _AST_H
#ifndef _AST_STD_H
#include <ast_std.h>
#endif
#ifndef _SFIO_H
#include <sfio.h>
#endif
#ifndef ast
#define ast _ast_info
#endif
#ifndef PATH_MAX
#define PATH_MAX 1024
#endif
/*
* workaround botched headers that assume <stdio.h>
*/
#ifndef FILE
#define FILE Sfio_t
#endif
/*
* exit() support -- this matches shell exit codes
*/
#define EXIT_BITS 8 /* # exit status bits */
#define EXIT_USAGE 2 /* usage exit code */
#define EXIT_NOTFOUND ((1<<(EXIT_BITS-1))-1) /* command not found */
#define EXIT_NOEXEC ((1<<(EXIT_BITS-1))-2) /* other exec error */
#define EXIT_CODE(x) ((x)&((1<<EXIT_BITS)-1))
#define EXIT_CORE(x) (EXIT_CODE(x)|(1<<EXIT_BITS)|(1<<(EXIT_BITS-1)))
#define EXIT_TERM(x) (EXIT_CODE(x)|(1<<EXIT_BITS))
/*
* NOTE: for compatibility the following work for EXIT_BITS={7,8}
*/
#define EXITED_CORE(x) (((x)&((1<<EXIT_BITS)|(1<<(EXIT_BITS-1))))==((1<<EXIT_BITS)|(1<<(EXIT_BITS-1)))||((x)&((1<<(EXIT_BITS-1))|(1<<(EXIT_BITS-2))))==((1<<(EXIT_BITS-1))|(1<<(EXIT_BITS-2))))
#define EXITED_TERM(x) ((x)&((1<<EXIT_BITS)|(1<<(EXIT_BITS-1))))
/*
* pathcanon() flags
*/
#define PATH_PHYSICAL 01
#define PATH_DOTDOT 02
#define PATH_EXISTS 04
/*
* pathaccess() flags
*/
#define PATH_READ 004
#define PATH_WRITE 002
#define PATH_EXECUTE 001
#define PATH_REGULAR 010
#define PATH_ABSOLUTE 020
/*
* pathcheck() info
*/
typedef struct
{
unsigned long date;
char* feature;
char* host;
char* user;
} Pathcheck_t;
/*
* strmatch() flags
*/
#define STR_MAXIMAL 01
#define STR_LEFT 02
#define STR_RIGHT 04
/*
* common macros
*/
#define elementsof(x) (sizeof(x)/sizeof(x[0]))
#define newof(p,t,n,x) ((p)?(t*)realloc((char*)(p),sizeof(t)*(n)+(x)):(t*)calloc(1,sizeof(t)*(n)+(x)))
#define oldof(p,t,n,x) ((p)?(t*)realloc((char*)(p),sizeof(t)*(n)+(x)):(t*)malloc(sizeof(t)*(n)+(x)))
#define roundof(x,y) (((x)+(y)-1)&~((y)-1))
#define streq(a,b) (*(a)==*(b)&&!strcmp(a,b))
#define strneq(a,b,n) (*(a)==*(b)&&!strncmp(a,b,n))
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
#define NiL 0
#define NoP(x) (void)(x)
#else
#define NiL ((char*)0)
#define NoP(x) (&x,1)
#endif
#if !defined(NoN)
#if defined(__STDC__) || defined(__STDPP__)
#define NoN(x) int _STUB_ ## x;
#else
#define NoN(x) int _STUB_/**/x;
#endif
#if !defined(_STUB_)
#define _STUB_
#endif
#endif
#define NOT_USED(x) NoP(x)
typedef int (*Ast_confdisc_t) __PROTO__((const char*, const char*, const char*));
extern __MANGLE__ char* astconf __PROTO__((const char*, const char*, const char*));
extern __MANGLE__ Ast_confdisc_t astconfdisc __PROTO__((Ast_confdisc_t));
extern __MANGLE__ void astconflist __PROTO__((Sfio_t*, const char*, int));
extern __MANGLE__ off_t astcopy __PROTO__((int, int, off_t));
extern __MANGLE__ int astquery __PROTO__((int, const char*, ...));
extern __MANGLE__ void astwinsize __PROTO__((int, int*, int*));
extern __MANGLE__ int chresc __PROTO__((const char*, char**));
extern __MANGLE__ int chrtoi __PROTO__((const char*));
extern __MANGLE__ char* fmtbase __PROTO__((long, int, int));
extern __MANGLE__ char* fmtdev __PROTO__((struct stat*));
extern __MANGLE__ char* fmtelapsed __PROTO__((unsigned long, int));
extern __MANGLE__ char* fmterror __PROTO__((int));
extern __MANGLE__ char* fmtesc __PROTO__((const char*));
extern __MANGLE__ char* fmtfs __PROTO__((struct stat*));
extern __MANGLE__ char* fmtgid __PROTO__((int));
extern __MANGLE__ char* fmtmatch __PROTO__((const char*));
extern __MANGLE__ char* fmtmode __PROTO__((int, int));
extern __MANGLE__ char* fmtperm __PROTO__((int));
extern __MANGLE__ char* fmtre __PROTO__((const char*));
extern __MANGLE__ char* fmtsignal __PROTO__((int));
extern __MANGLE__ char* fmttime __PROTO__((const char*, time_t));
extern __MANGLE__ char* fmtuid __PROTO__((int));
extern __MANGLE__ void mematoe __PROTO__((__V_*, const __V_*, size_t));
extern __MANGLE__ __V_* memdup __PROTO__((const __V_*, size_t));
extern __MANGLE__ void memetoa __PROTO__((__V_*, const __V_*, size_t));
extern __MANGLE__ char* pathaccess __PROTO__((char*, const char*, const char*, const char*, int));
extern __MANGLE__ char* pathbin __PROTO__((void));
extern __MANGLE__ char* pathcanon __PROTO__((char*, int));
extern __MANGLE__ char* pathcat __PROTO__((char*, const char*, int, const char*, const char*));
extern __MANGLE__ int pathcd __PROTO__((const char*, const char*));
extern __MANGLE__ int pathcheck __PROTO__((const char*, const char*, Pathcheck_t*));
extern __MANGLE__ int pathgetlink __PROTO__((const char*, char*, int));
extern __MANGLE__ char* pathkey __PROTO__((char*, char*, const char*, const char*));
extern __MANGLE__ char* pathpath __PROTO__((char*, const char*, const char*, int));
extern __MANGLE__ char* pathprobe __PROTO__((char*, char*, const char*, const char*, const char*, int));
extern __MANGLE__ char* pathrepl __PROTO__((char*, const char*, const char*));
extern __MANGLE__ char* pathtemp __PROTO__((char*, const char*, const char*));
extern __MANGLE__ int pathsetlink __PROTO__((const char*, const char*));
extern __MANGLE__ char* pathshell __PROTO__((void));
extern __MANGLE__ char* setenviron __PROTO__((const char*));
extern __MANGLE__ int sigcritical __PROTO__((int));
extern __MANGLE__ char* strcopy __PROTO__((char*, const char*));
extern __MANGLE__ char* strdup __PROTO__((const char*));
extern __MANGLE__ unsigned long strelapsed __PROTO__((const char*, char**, int));
extern __MANGLE__ char* strerror __PROTO__((int));
extern __MANGLE__ int stresc __PROTO__((char*));
extern __MANGLE__ long streval __PROTO__((const char*, char**, long(*)(const char*, char**)));
extern __MANGLE__ long strexpr __PROTO__((const char*, char**, long(*)(const char*, char**, __V_*), __V_*));
extern __MANGLE__ int strgid __PROTO__((const char*));
extern __MANGLE__ int strgrpmatch __PROTO__((const char*, const char*, int*, int, int));
extern __MANGLE__ __V_* strlook __PROTO__((const __V_*, int, const char*));
extern __MANGLE__ int strmatch __PROTO__((const char*, const char*));
extern __MANGLE__ int strmode __PROTO__((const char*));
extern __MANGLE__ int stropt __PROTO__((const char*, const __V_*, int, int(*)(__V_*, const __V_*, int, const char*), __V_*));
extern __MANGLE__ int strperm __PROTO__((const char*, char**, int));
extern __MANGLE__ char* strsignal __PROTO__((int));
extern __MANGLE__ void strsort __PROTO__((char**, int, int(*)(const char*, const char*)));
extern __MANGLE__ char* strsubmatch __PROTO__((const char*, const char*, int));
extern __MANGLE__ char* strtape __PROTO__((const char*, char**));
extern __MANGLE__ long strton __PROTO__((const char*, char**, char*, int));
extern __MANGLE__ int struid __PROTO__((const char*));
/*
* C library global data symbols not prototyped by <unistd.h>
*/
#ifndef environ
#if _DLL_INDIRECT_DATA && _DLL
#define environ (*_ast_getdll()->_ast_environ)
#else
extern __MANGLE__ char** environ;
#endif
#endif
#endif

View File

@@ -0,0 +1,102 @@
/* $XConsortium: ast_dir.h /main/3 1995/11/01 17:35:07 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* common dirent maintenance interface
*/
#ifndef _AST_DIR_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _AST_DIR_H
#include <ast_lib.h>
#include <dirent.h>
#if _mem_d_fileno_dirent || _mem_d_ino_dirent
#if !_mem_d_fileno_dirent
#define _mem_d_fileno_dirent 1
#define d_fileno d_ino
#endif
#endif
#if _mem_d_fileno_dirent
#define D_FILENO(d) ((d)->d_fileno)
#else
#define D_FILENO(d) (1)
#endif
#if _mem_d_namlen_dirent
#define D_NAMLEN(d) ((d)->d_namlen)
#else
#define D_NAMLEN(d) (strlen((d)->d_name))
#endif
#endif

View File

@@ -0,0 +1,906 @@
/* $XConsortium: ast_std.h /main/3 1995/11/01 17:35:19 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Advanced Software Technology Department
* AT&T Bell Laboratories
*
* a union of the following standard headers that works
*
* <limits.h>
* <stdarg.h>
* <stddef.h>
* <stdlib.h>
* <sys/types.h>
* <string.h>
* <unistd.h>
* <fcntl.h>
* <locale.h>
*
* the following ast implementation specific headers are also included
* these do not stomp on the std namespace
*
* <ast_botch.h>
* <ast_fcntl.h>
* <ast_hdr.h>
* <ast_lib.h>
* <ast_types.h>
* <ast_unistd.h>
*
* NOTE: the C++ versions of most ANSI and POSIX files are fubar
*/
#ifndef _AST_STD_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _AST_STD_H
#include <ast_hdr.h>
#ifndef _ast_info
#if _DLL_INDIRECT_DATA && !_DLL
#define _ast_info (*_ast_state)
#else
#define _ast_info _ast_state
#endif
#endif
#ifdef _SFSTDIO_H
#define _SKIP_SFSTDIO_H
#else
#define _SFSTDIO_H
#define FILE int
#if defined(__STDPP__directive) && defined(__STDPP__hide)
#if !_std_def_calloc
__STDPP__directive pragma pp:hide calloc
#endif
#if !_std_def_free
__STDPP__directive pragma pp:hide free
#endif
#if !_std_def_malloc
__STDPP__directive pragma pp:hide malloc
#endif
#if !_std_def_realloc
__STDPP__directive pragma pp:hide realloc
#endif
__STDPP__directive pragma pp:hide bcopy bzero execl execle execlp execv
__STDPP__directive pragma pp:hide execvp getcwd putenv setenv setpgrp sleep
__STDPP__directive pragma pp:hide spawnve spawnveg strdup
__STDPP__directive pragma pp:hide vfprintf vprintf vsprintf
#else
#if !_std_def_calloc
#define calloc ______calloc
#endif
#if !_std_def_free
#define free ______free
#endif
#if !_std_def_malloc
#define malloc ______malloc
#endif
#if !_std_def_realloc
#define realloc ______realloc
#endif
#define bcopy ______bcopy
#define bzero ______bzero
#define execl ______execl
#define execle ______execle
#define execlp ______execlp
#define execv ______execv
#define execvp ______execvp
#define getcwd ______getcwd
#define putenv ______putenv
#define setenv ______setenv
#define setpgrp ______setpgrp
#define sleep ______sleep
#define spawnve ______spawnve
#define spawnveg ______spawnveg
#define strdup ______strdup
#define vfprintf ______vfprintf
#define vprintf ______vprintf
#define vsprintf ______vsprintf
#endif
#endif
#if defined(__STDPP__directive) && defined(__STDPP__note)
__STDPP__directive pragma pp:note clock_t dev_t div_t gid_t ino_t ldiv_t mode_t
__STDPP__directive pragma pp:note nlink_t off_t pid_t ptrdiff_t size_t ssize_t
__STDPP__directive pragma pp:note time_t uid_t wchar_t
#endif
#include <sys/types.h>
#if !defined(va_start)
#if defined(__STDARG__)
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#endif
#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:initial
#endif
#include <limits.h>
#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:noinitial
#endif
#if defined(_std_stddef) || defined(__STDC__) || defined(__cplusplus)
#include <stddef.h>
#endif
#ifndef offsetof
#define offsetof(type,member) ((size_t)&(((type*)0)->member))
#endif
#if !defined(__cplusplus) && (defined(_std_stdlib) || defined(__STDC__))
#include <stdlib.h>
#else
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
#define MB_CUR_MAX 1
#define RAND_MAX 32767
#endif
#ifdef _SKIP_SFSTDIO_H
#undef _SKIP_SFSTDIO_H
#else
#undef _SFSTDIO_H
#undef FILE
#if defined(__STDPP__directive) && defined(__STDPP__hide)
#if !_std_def_calloc
__STDPP__directive pragma pp:nohide calloc
#endif
#if !_std_def_free
__STDPP__directive pragma pp:nohide free
#endif
#if !_std_def_malloc
__STDPP__directive pragma pp:nohide malloc
#endif
#if !_std_def_realloc
__STDPP__directive pragma pp:nohide realloc
#endif
__STDPP__directive pragma pp:nohide bcopy bzero execl execle execlp execv
__STDPP__directive pragma pp:nohide execvp getcwd putenv setenv setpgrp sleep
__STDPP__directive pragma pp:nohide strdup spawnve spawnveg
__STDPP__directive pragma pp:nohide vfprintf vprintf vsprintf
#else
#if !_std_def_calloc
#undef calloc
#endif
#if !_std_def_free
#undef free
#endif
#if !_std_def_malloc
#undef malloc
#endif
#if !_std_def_realloc
#undef realloc
#endif
#undef bcopy
#undef bzero
#undef execl
#undef execle
#undef execlp
#undef execv
#undef execvp
#undef getcwd
#undef putenv
#undef setenv
#undef setpgrp
#undef sleep
#undef spawnve
#undef spawnveg
#undef strdup
#undef vfprintf
#undef vprintf
#undef vsprintf
#endif
#endif
#if defined(__STDPP__directive) && defined(__STDPP__note)
#if !noticed(dev_t)
typedef short dev_t;
#endif
#if !noticed(div_t)
typedef struct { int quot; int rem; } div_t;
#endif
#if !noticed(gid_t)
typedef unsigned short gid_t;
#endif
#if !noticed(ino_t)
typedef unsigned long ino_t;
#endif
#if !noticed(ldiv_t)
typedef struct { long quot; long rem; } ldiv_t;
#endif
#if !noticed(mode_t)
typedef unsigned short mode_t;
#endif
#if !noticed(nlink_t)
typedef short nlink_t;
#endif
#if !noticed(off_t)
typedef long off_t;
#endif
#if !noticed(pid_t)
typedef int pid_t;
#endif
#if !noticed(ptrdiff_t)
typedef long ptrdiff_t;
#endif
#if !noticed(size_t)
typedef unsigned int size_t;
#endif
#if !noticed(ssize_t)
typedef int ssize_t;
#endif
#if !noticed(uid_t)
typedef unsigned short uid_t;
#endif
#if !noticed(wchar_t)
typedef unsigned short wchar_t;
#endif
#else
#include <ast_types.h>
#endif
struct stat;
#if defined(__cplusplus) || !defined(_std_stdlib) && !defined(__STDC__)
/* <stdlib.h> */
extern __MANGLE__ double atof __PROTO__((const char*));
extern __MANGLE__ int atoi __PROTO__((const char*));
extern __MANGLE__ long atol __PROTO__((const char*));
extern __MANGLE__ double strtod __PROTO__((const char*, char**));
extern __MANGLE__ long strtol __PROTO__((const char*, char**, int));
extern __MANGLE__ unsigned long strtoul __PROTO__((const char*, char**, int));
extern __MANGLE__ int rand __PROTO__((void));
extern __MANGLE__ void srand __PROTO__((unsigned int));
extern __MANGLE__ void abort __PROTO__((void));
extern __MANGLE__ int atexit __PROTO__((void(*)(void)));
extern __MANGLE__ void exit __PROTO__((int));
extern __MANGLE__ char* getenv __PROTO__((const char*));
extern __MANGLE__ int system __PROTO__((const char*));
extern __MANGLE__ __V_* bsearch __PROTO__((const __V_*, const __V_*, size_t, size_t,
int(*)(const __V_*, const __V_*)));
extern __MANGLE__ void qsort __PROTO__((__V_*, size_t, size_t,
int(*)(const __V_*, const __V_*)));
extern __MANGLE__ int abs __PROTO__((int));
extern __MANGLE__ div_t div __PROTO__((int, int));
extern __MANGLE__ long labs __PROTO__((long));
extern __MANGLE__ ldiv_t ldiv __PROTO__((long, long));
extern __MANGLE__ int mblen __PROTO__((const char*, size_t));
extern __MANGLE__ int mbtowc __PROTO__((wchar_t*, const char*, size_t));
extern __MANGLE__ int wctomb __PROTO__((char*, wchar_t));
extern __MANGLE__ size_t mbstowcs __PROTO__((wchar_t*, const char*, size_t));
extern __MANGLE__ size_t wcstombs __PROTO__((char*, const wchar_t*, size_t));
#endif
#if !_std_def_calloc
extern __MANGLE__ __V_* calloc __PROTO__((size_t, size_t));
#endif
#if !_std_def_free
extern __MANGLE__ void free __PROTO__((__V_*));
#endif
#if !_std_def_malloc
extern __MANGLE__ __V_* malloc __PROTO__((size_t));
#endif
#if !_std_def_realloc
extern __MANGLE__ __V_* realloc __PROTO__((__V_*, size_t));
#endif
/* <string.h> */
extern __MANGLE__ __V_* memchr __PROTO__((const __V_*, int, size_t));
extern __MANGLE__ int memcmp __PROTO__((const __V_*, const __V_*, size_t));
extern __MANGLE__ __V_* memcpy __PROTO__((__V_*, const __V_*, size_t));
extern __MANGLE__ __V_* memmove __PROTO__((__V_*, const __V_*, size_t));
extern __MANGLE__ __V_* memset __PROTO__((__V_*, int, size_t));
extern __MANGLE__ char* strcat __PROTO__((char*, const char*));
extern __MANGLE__ char* strchr __PROTO__((const char*, int));
extern __MANGLE__ int strcmp __PROTO__((const char*, const char*));
extern __MANGLE__ int strcoll __PROTO__((const char*, const char*));
extern __MANGLE__ char* strcpy __PROTO__((char*, const char*));
extern __MANGLE__ size_t strcspn __PROTO__((const char*, const char*));
extern __MANGLE__ size_t strlen __PROTO__((const char*));
extern __MANGLE__ char* strncat __PROTO__((char*, const char*, size_t));
extern __MANGLE__ int strncmp __PROTO__((const char*, const char*, size_t));
extern __MANGLE__ char* strncpy __PROTO__((char*, const char*, size_t));
extern __MANGLE__ char* strpbrk __PROTO__((const char*, const char*));
extern __MANGLE__ char* strrchr __PROTO__((const char*, int));
extern __MANGLE__ size_t strspn __PROTO__((const char*, const char*));
extern __MANGLE__ char* strstr __PROTO__((const char*, const char*));
extern __MANGLE__ char* strtok __PROTO__((char*, const char*));
extern __MANGLE__ size_t strxfrm __PROTO__((char*, const char*, size_t));
#if defined(__STDPP__directive) && defined(__STDPP__ignore)
__STDPP__directive pragma pp:ignore "libc.h"
__STDPP__directive pragma pp:ignore "malloc.h"
__STDPP__directive pragma pp:ignore "memory.h"
__STDPP__directive pragma pp:ignore "stdlib.h"
__STDPP__directive pragma pp:ignore "string.h"
#else
#ifndef _libc_h
#define _libc_h
#endif
#ifndef _libc_h_
#define _libc_h_
#endif
#ifndef __libc_h
#define __libc_h
#endif
#ifndef __libc_h__
#define __libc_h__
#endif
#ifndef _LIBC_H
#define _LIBC_H
#endif
#ifndef _LIBC_H_
#define _LIBC_H_
#endif
#ifndef __LIBC_H
#define __LIBC_H
#endif
#ifndef __LIBC_H__
#define __LIBC_H__
#endif
#ifndef _LIBC_INCLUDED
#define _LIBC_INCLUDED
#endif
#ifndef __LIBC_INCLUDED
#define __LIBC_INCLUDED
#endif
#ifndef _H_LIBC
#define _H_LIBC
#endif
#ifndef __H_LIBC
#define __H_LIBC
#endif
#ifndef _malloc_h
#define _malloc_h
#endif
#ifndef _malloc_h_
#define _malloc_h_
#endif
#ifndef __malloc_h
#define __malloc_h
#endif
#ifndef __malloc_h__
#define __malloc_h__
#endif
#ifndef _MALLOC_H
#define _MALLOC_H
#endif
#ifndef _MALLOC_H_
#define _MALLOC_H_
#endif
#ifndef __MALLOC_H
#define __MALLOC_H
#endif
#ifndef __MALLOC_H__
#define __MALLOC_H__
#endif
#ifndef _MALLOC_INCLUDED
#define _MALLOC_INCLUDED
#endif
#ifndef __MALLOC_INCLUDED
#define __MALLOC_INCLUDED
#endif
#ifndef _H_MALLOC
#define _H_MALLOC
#endif
#ifndef __H_MALLOC
#define __H_MALLOC
#endif
#ifndef _memory_h
#define _memory_h
#endif
#ifndef _memory_h_
#define _memory_h_
#endif
#ifndef __memory_h
#define __memory_h
#endif
#ifndef __memory_h__
#define __memory_h__
#endif
#ifndef _MEMORY_H
#define _MEMORY_H
#endif
#ifndef _MEMORY_H_
#define _MEMORY_H_
#endif
#ifndef __MEMORY_H
#define __MEMORY_H
#endif
#ifndef __MEMORY_H__
#define __MEMORY_H__
#endif
#ifndef _MEMORY_INCLUDED
#define _MEMORY_INCLUDED
#endif
#ifndef __MEMORY_INCLUDED
#define __MEMORY_INCLUDED
#endif
#ifndef _H_MEMORY
#define _H_MEMORY
#endif
#ifndef __H_MEMORY
#define __H_MEMORY
#endif
#ifndef _stdlib_h
#define _stdlib_h
#endif
#ifndef _stdlib_h_
#define _stdlib_h_
#endif
#ifndef __stdlib_h
#define __stdlib_h
#endif
#ifndef __stdlib_h__
#define __stdlib_h__
#endif
#ifndef _STDLIB_H
#define _STDLIB_H
#endif
#ifndef _STDLIB_H_
#define _STDLIB_H_
#endif
#ifndef __STDLIB_H
#define __STDLIB_H
#endif
#ifndef __STDLIB_H__
#define __STDLIB_H__
#endif
#ifndef _STDLIB_INCLUDED
#define _STDLIB_INCLUDED
#endif
#ifndef __STDLIB_INCLUDED
#define __STDLIB_INCLUDED
#endif
#ifndef _H_STDLIB
#define _H_STDLIB
#endif
#ifndef __H_STDLIB
#define __H_STDLIB
#endif
#ifndef _string_h
#define _string_h
#endif
#ifndef _string_h_
#define _string_h_
#endif
#ifndef __string_h
#define __string_h
#endif
#ifndef __string_h__
#define __string_h__
#endif
#ifndef _STRING_H
#define _STRING_H
#endif
#ifndef _STRING_H_
#define _STRING_H_
#endif
#ifndef __STRING_H
#define __STRING_H
#endif
#ifndef __STRING_H__
#define __STRING_H__
#endif
#ifndef _STRING_INCLUDED
#define _STRING_INCLUDED
#endif
#ifndef __STRING_INCLUDED
#define __STRING_INCLUDED
#endif
#ifndef _H_STRING
#define _H_STRING
#endif
#ifndef __H_STRING
#define __H_STRING
#endif
#endif
#include <ast_fcntl.h>
/* <unistd.h> */
#ifdef _WIN32
#include <unistd.h>
#else
#include <ast_unistd.h>
#endif
#include <ast_botch.h>
#ifndef STDIN_FILENO
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
#endif
#ifndef NULL
#define NULL 0
#endif
#ifndef SEEK_SET
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#endif
#ifndef F_OK
#define F_OK 0
#define X_OK 1
#define W_OK 2
#define R_OK 4
#endif
extern __MANGLE__ void _exit __PROTO__((int));
extern __MANGLE__ int access __PROTO__((const char*, int));
extern __MANGLE__ unsigned alarm __PROTO__((unsigned));
extern __MANGLE__ int chdir __PROTO__((const char*));
extern __MANGLE__ int chown __PROTO__((const char*, uid_t, gid_t));
extern __MANGLE__ int close __PROTO__((int));
extern __MANGLE__ size_t confstr __PROTO__((int, char*, size_t));
extern __MANGLE__ int dup __PROTO__((int));
extern __MANGLE__ int dup2 __PROTO__((int, int));
extern __MANGLE__ int execl __PROTO__((const char*, const char*, ...));
extern __MANGLE__ int execle __PROTO__((const char*, const char*, ...));
extern __MANGLE__ int execlp __PROTO__((const char*, const char*, ...));
extern __MANGLE__ int execv __PROTO__((const char*, char* const[]));
extern __MANGLE__ int execve __PROTO__((const char*, char* const[], char* const[]));
extern __MANGLE__ int execvp __PROTO__((const char*, char* const[]));
extern __MANGLE__ pid_t fork __PROTO__((void));
extern __MANGLE__ long fpathconf __PROTO__((int, int));
extern __MANGLE__ char* getcwd __PROTO__((char*, size_t));
extern __MANGLE__ gid_t getegid __PROTO__((void));
extern __MANGLE__ uid_t geteuid __PROTO__((void));
extern __MANGLE__ gid_t getgid __PROTO__((void));
extern __MANGLE__ int getgroups __PROTO__((int, gid_t[]));
extern __MANGLE__ char* getlogin __PROTO__((void));
extern __MANGLE__ pid_t getpgrp __PROTO__((void));
extern __MANGLE__ pid_t getpid __PROTO__((void));
extern __MANGLE__ pid_t getppid __PROTO__((void));
extern __MANGLE__ uid_t getuid __PROTO__((void));
extern __MANGLE__ int isatty __PROTO__((int));
extern __MANGLE__ int link __PROTO__((const char*, const char*));
extern __MANGLE__ off_t lseek __PROTO__((int, off_t, int));
extern __MANGLE__ long pathconf __PROTO__((const char*, int));
extern __MANGLE__ int pause __PROTO__((void));
extern __MANGLE__ int pipe __PROTO__((int[]));
extern __MANGLE__ ssize_t read __PROTO__((int, __V_*, size_t));
extern __MANGLE__ int rmdir __PROTO__((const char*));
extern __MANGLE__ int setgid __PROTO__((gid_t));
extern __MANGLE__ int setpgid __PROTO__((pid_t, pid_t));
extern __MANGLE__ pid_t setsid __PROTO__((void));
extern __MANGLE__ int setuid __PROTO__((uid_t));
extern __MANGLE__ unsigned sleep __PROTO__((unsigned int));
extern __MANGLE__ pid_t spawnve __PROTO__((const char*, char* const[], char* const[]));
extern __MANGLE__ pid_t spawnveg __PROTO__((const char*, char* const[], char* const[], pid_t));
extern __MANGLE__ long sysconf __PROTO__((int));
extern __MANGLE__ pid_t tcgetpgrp __PROTO__((int));
extern __MANGLE__ int tcsetpgrp __PROTO__((int, pid_t));
extern __MANGLE__ char* ttyname __PROTO__((int));
extern __MANGLE__ int unlink __PROTO__((const char*));
extern __MANGLE__ ssize_t write __PROTO__((int, const __V_*, size_t));
#ifndef _WIN32
/*
* yes, we don't trust anyone's interpretation but our own
*/
#undef confstr
#define confstr _ast_confstr
#undef fpathconf
#define fpathconf _ast_fpathconf
#undef pathconf
#define pathconf _ast_pathconf
#undef sysconf
#define sysconf _ast_sysconf
extern __MANGLE__ size_t confstr __PROTO__((int, char*, size_t));
extern __MANGLE__ long fpathconf __PROTO__((int, int));
extern __MANGLE__ long pathconf __PROTO__((const char*, int));
extern __MANGLE__ long sysconf __PROTO__((int));
#endif
#if defined(__STDPP__directive) && defined(__STDPP__ignore)
__STDPP__directive pragma pp:ignore "unistd.h"
__STDPP__directive pragma pp:ignore "sys/unistd.h"
#else
#ifndef _unistd_h
#define _unistd_h
#endif
#ifndef _unistd_h_
#define _unistd_h_
#endif
#ifndef __unistd_h
#define __unistd_h
#endif
#ifndef __unistd_h__
#define __unistd_h__
#endif
#ifndef _UNISTD_H
#define _UNISTD_H
#endif
#ifndef _UNISTD_H_
#define _UNISTD_H_
#endif
#ifndef __UNISTD_H
#define __UNISTD_H
#endif
#ifndef __UNISTD_H__
#define __UNISTD_H__
#endif
#ifndef _UNISTD_INCLUDED
#define _UNISTD_INCLUDED
#endif
#ifndef __UNISTD_INCLUDED
#define __UNISTD_INCLUDED
#endif
#ifndef _H_UNISTD
#define _H_UNISTD
#endif
#ifndef __H_UNISTD
#define __H_UNISTD
#endif
#ifndef _SYS_UNISTD_H
#define _SYS_UNISTD_H
#endif
#endif
#if defined(__cplusplus)
#if defined(__STDPP__directive) && defined(__STDPP__ignore)
__STDPP__directive pragma pp:ignore "sysent.h"
#else
#ifndef _sysent_h
#define _sysent_h
#endif
#ifndef _sysent_h_
#define _sysent_h_
#endif
#ifndef __sysent_h
#define __sysent_h
#endif
#ifndef __sysent_h__
#define __sysent_h__
#endif
#ifndef _SYSENT_H
#define _SYSENT_H
#endif
#ifndef _SYSENT_H_
#define _SYSENT_H_
#endif
#ifndef __SYSENT_H
#define __SYSENT_H
#endif
#ifndef __SYSENT_H__
#define __SYSENT_H__
#endif
#ifndef _SYSENT_INCLUDED
#define _SYSENT_INCLUDED
#endif
#ifndef __SYSENT_INCLUDED
#define __SYSENT_INCLUDED
#endif
#ifndef _H_SYSENT
#define _H_SYSENT
#endif
#ifndef __H_SYSENT
#define __H_SYSENT
#endif
#endif
#endif
#include <ast_lib.h>
/* locale stuff */
#if _hdr_locale
#include <locale.h>
#if _sys_localedef
#include <sys/localedef.h>
#endif
#endif
#undef setlocale
extern __MANGLE__ char* _ast_setlocale __PROTO__((int, const char*));
#ifdef LC_ALL
#define setlocale _ast_setlocale
#else
#define setlocale(a,b) _ast_setlocale(0,b)
#endif
#undef strcoll
#if _std_strcoll
#define strcoll _ast_info.collate
#else
#define strcoll strcmp
#endif
#define LC_SET_COLLATE (1<<0)
#define LC_SET_CTYPE (1<<1)
#define LC_SET_MESSAGES (1<<2)
#define LC_SET_MONETARY (1<<3)
#define LC_SET_NUMERIC (1<<4)
#define LC_SET_TIME (1<<5)
typedef struct
{
struct
{
unsigned int serial;
unsigned int set;
} locale;
long tmp_long;
size_t tmp_size;
int tmp_int;
short tmp_short;
char tmp_char;
wchar_t tmp_wchar;
int (*collate) __PROTO__((const char*, const char*));
__V_* tmp_pointer;
} _Ast_info_t;
extern __MANGLE__ _Ast_info_t _ast_info;
/* stuff from std headers not used by ast, e.g., <stdio.h> */
extern __MANGLE__ __V_* memzero __PROTO__((__V_*, size_t));
extern __MANGLE__ int remove __PROTO__((const char*));
extern __MANGLE__ int rename __PROTO__((const char*, const char*));
/* direct macro access for bsd crossover */
#if !defined(memcpy) && !defined(_lib_memcpy) && defined(_lib_bcopy)
extern __MANGLE__ void bcopy __PROTO__((__V_*, __V_*, size_t));
#define memcpy(t,f,n) (bcopy(f,t,n),(t))
#endif
#if !defined(memzero)
#if defined(_lib_bzero)
extern __MANGLE__ void bzero __PROTO__((__V_*, size_t));
#if defined(FD_ZERO)
#undef FD_ZERO
#define FD_ZERO(p) memzero(p,sizeof(*p))
#endif
#define memzero(b,n) (bzero(b,n),(b))
#else
#define memzero(b,n) memset(b,0,n)
#endif
#endif
#if !defined(remove) && !defined(_lib_remove)
extern __MANGLE__ int unlink __PROTO__((const char*));
#define remove(p) unlink(p)
#endif
#if !defined(strchr) && !defined(_lib_strchr) && defined(_lib_index)
extern __MANGLE__ char* index __PROTO__((const char*, int));
#define strchr(s,c) index(s,c)
#endif
#if !defined(strrchr) && !defined(_lib_strrchr) && defined(_lib_rindex)
extern __MANGLE__ char* rindex __PROTO__((const char*, int));
#define strrchr(s,c) rindex(s,c)
#endif
/* and now introducing prototypes botched by the standard(s) */
#undef getpgrp
#define getpgrp() _ast_getpgrp()
extern __MANGLE__ int _ast_getpgrp __PROTO__((void));
#endif

View File

@@ -0,0 +1,95 @@
/* $XConsortium: debug.h /main/3 1995/11/01 17:35:38 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* common ast debug definitions
* include after the ast headers
*/
#ifndef _DEBUG_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _DEBUG_H
#include <ast.h>
#include <error.h>
#if DEBUG || _TRACE_
#define debug(x) x
#define libmessage(x) do if (error_info.trace < 0) { liberror x; } while (0)
#define message(x) do if (error_info.trace < 0) { error x; } while (0)
#else
#define debug(x)
#define libmessage(x)
#define message(x)
#endif
extern __MANGLE__ void systrace __PROTO__((const char*));
#endif

View File

@@ -0,0 +1,195 @@
/* $XConsortium: error.h /main/3 1995/11/01 17:35:55 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Glenn Fowler
* AT&T Bell Laboratories
*
* option, error and message formatter external definitions
*/
#ifndef _ERROR_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _ERROR_H
#include <ast.h>
#include <option.h>
#include <errno.h>
#if _DLL_INDIRECT_DATA && _DLL
#undef errno
#define errno (*_ast_getdll()->_ast_errno)
#endif
#ifndef error_info
#if _DLL_INDIRECT_DATA && !_DLL
#define error_info (*_error_info_)
#else
#define error_info _error_info_
#endif
#endif
#define ERROR_debug(n) (-(n))
#define ERROR_exit(n) ((n)+ERROR_ERROR)
#define ERROR_system(n) (((n)+ERROR_ERROR)|ERROR_SYSTEM)
#define ERROR_usage(n) ((((n)?2:0)+ERROR_ERROR)|ERROR_USAGE)
#define ERROR_warn(n) (ERROR_WARNING)
#define ERROR_dictionary(t) (t)
#if _hdr_locale && _lib_setlocale
#define ERROR_translate(t,m) ((error_info.translate&&(ast.locale.set&LC_SET_MESSAGES))?(*error_info.translate)(t,m):(t))
#else
#define ERROR_translate(t,m) (t)
#endif
#define ERROR_INFO 0 /* info message -- no err_id */
#define ERROR_WARNING 1 /* warning message */
#define ERROR_ERROR 2 /* error message -- no err_exit */
#define ERROR_FATAL 3 /* error message with err_exit */
#define ERROR_NOEXEC EXIT_NOEXEC /* shell convention */
#define ERROR_NOENT EXIT_NOTFOUND /* shell convention */
#define ERROR_PANIC ERROR_LEVEL /* panic message with err_exit */
#define ERROR_LEVEL 000377 /* level portion of status */
#define ERROR_SYSTEM 000400 /* report system errno message */
#define ERROR_OUTPUT 001000 /* next arg is error fd */
#define ERROR_SOURCE 002000 /* next 2 args are FILE,LINE */
#define ERROR_USAGE 004000 /* usage message */
#define ERROR_PROMPT 010000 /* omit trailing newline */
#define ERROR_NOID 020000 /* omit err_id */
#define ERROR_LIBRARY 040000 /* library routine error */
#define ERROR_INTERACTIVE 000001 /* context is interactive */
#define ERROR_SILENT 000002 /* context is silent */
#define errorpush(p,f) (*(p)= *ERROR_CONTEXT_BASE,*ERROR_CONTEXT_BASE=error_info.empty,error_info.context=(p),error_info.flags=(f))
#define errorpop(p) (*ERROR_CONTEXT_BASE= *(p))
#define ERROR_CONTEXT_BASE ((Error_context_t*)&error_info.context)
#define ERROR_CONTEXT \
Error_context_t* context; /* prev context stack element */ \
int errors; /* >= ERROR_ERROR count */ \
int flags; /* context flags */ \
int line; /* input|output line number */ \
int warnings; /* ERROR_WARNING count */ \
char* file; /* input|output file name */ \
char* id /* command id */
typedef struct errorcontext Error_context_t;
struct errorcontext /* context stack element */
{
ERROR_CONTEXT;
};
typedef struct /* error state */
{
int fd; /* write(2) fd */
void (*exit) __PROTO__((int)); /* error exit */
ssize_t (*write) __PROTO__((int, const __V_*, size_t)); /* error output */
/* the rest are implicitly initialized */
int clear; /* default clear ERROR_* flags */
int core; /* level>=core -> core dump */
int indent; /* debug trace indent level */
int init; /* initialized */
int last_errno; /* last reported errno */
int mask; /* multi level debug trace mask */
int set; /* default set ERROR_* flags */
int trace; /* debug trace level */
char* version; /* ERROR_SOURCE command version */
int (*auxilliary) __PROTO__((Sfio_t*, int, int)); /* aux info to append */
ERROR_CONTEXT; /* top of context stack */
Error_context_t empty; /* empty context stack element */
unsigned long time; /* debug time trace */
char* (*translate) __PROTO__((const char*, int)); /* format translator */
} Error_info_t;
extern __MANGLE__ Error_info_t error_info; /* global error state */
#ifndef errno
extern __MANGLE__ int errno; /* system call error status */
#endif
extern __MANGLE__ void error __PROTO__((int, ...));
extern __MANGLE__ void errorv __PROTO__((const char*, int, va_list));
extern __MANGLE__ void liberror __PROTO__((const char*, int, ...));
#endif

View File

@@ -0,0 +1,86 @@
/* $XConsortium: find.h /main/2 1996/05/08 19:43:20 drk $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Glenn Fowler
* AT&T Bell Laboratories
*
* fast find interface definitions
*/
#ifndef _FIND_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _FIND_H
extern __MANGLE__ __V_* findopen __PROTO__((const char*));
extern __MANGLE__ char* findnext __PROTO__((__V_*));
extern __MANGLE__ void findclose __PROTO__((__V_*));
#endif

View File

@@ -0,0 +1,151 @@
/* $XConsortium: fs3d.h /main/3 1995/11/01 17:36:21 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Glenn Fowler
* AT&T Bell Laboratories
*
* 3d fs interface definitions
*/
#ifndef _FS3D_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _FS3D_H
#include <ast_fs.h>
#if _int_st_spare1
#define iview(p) ((p)->st_spare1)
#define IVIEW(p,v) ((p)->st_spare1=(v))
#else
#if _ary_st_spare4
#define iview(p) ((p)->st_spare4[0])
#define IVIEW(p,v) ((p)->st_spare4[0]=(v))
#else
#if _ary_st_pad4
#define iview(p) ((p)->st_pad4[0])
#define IVIEW(p,v) ((p)->st_pad4[0]=(v))
#else
#if _mem_st_rdev_stat
#define iview(p) ((S_ISBLK((p)->st_mode)||S_ISCHR((p)->st_mode))?0:(p)->st_rdev)
#define IVIEW(p,v) do{if(!S_ISBLK((p)->st_mode)&&!S_ISCHR((p)->st_mode))(p)->st_rdev=(v);}while(0)
#else
#define iview(p) 0
#define IVIEW(p,v)
#endif
#endif
#endif
#endif
/*
* special options
*/
#define FS3D_init "/#option/init"
#define FS3D_on "/#option/3d"
#define FS3D_off "/#option/2d"
/*
* fs3d(3) ops
*/
#define FS3D_OP(o,a) (((a)<<3)|(o))
#define FS3D_INIT FS3D_OP_INIT /* re-initialize tables */
#define FS3D_OFF FS3D_OP_OFF
#define FS3D_ON FS3D_OP_ON
#define FS3D_TEST FS3D_OP_TEST
#define FS3D_LIMIT(n) FS3D_OP(FS3D_OP_LIMIT,n)
#define FS3D_op(x) ((x)&07)
#define FS3D_arg(x) (((x)>>3)&07777)
#define FS3D_OP_OFF 0
#define FS3D_OP_ON 1
#define FS3D_OP_TEST 2
#define FS3D_OP_LIMIT 3
#define FS3D_OP_INIT 7
/*
* mount(2) ops
*/
#define FS3D_ALL (FS3D_VIEW|FS3D_VERSION)
#define FS3D_VIEW 002
#define FS3D_VERSION 004
#define FS3D_GET 010
#define FS3D_SIZE(n) ((n)<<4)
#define FS3D_SIZEOF(n) ((n)>>4)
extern __MANGLE__ int fs3d __PROTO__((int));
extern __MANGLE__ int mount __PROTO__((const char*, char*, int, __V_*));
extern __MANGLE__ char* pathnext __PROTO__((char*, char*, long*));
#endif

View File

@@ -0,0 +1,168 @@
/* $XConsortium: ftwalk.h /main/3 1995/11/01 17:36:34 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* K. P. Vo
* AT&T Bell Laboratories
*
* ftwalk(3) interface definitions
*/
#ifndef _FTWALK_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _FTWALK_H
#include <ls.h>
/*
* ftwalk() argument flags
*/
#define FTW_CHILDREN (1<<0) /* call user function on child dirs too */
#define FTW_DELAY (1<<1) /* do child stat after parent preorder */
#define FTW_DOT (1<<2) /* don't chdir(2) to subdirectories */
#define FTW_MULTIPLE (1<<3) /* path arg is 0 terminated char** argv */
#define FTW_PHYSICAL (1<<4) /* physical rather than logical walk */
#define FTW_POST (1<<5) /* visit descendants before parent */
#define FTW_TWICE (1<<6) /* visit parent before&after descendants*/
#define FTW_META (1<<7) /* follow top dir symlinks even if phys */
#define FTW_USER (1<<10) /* first user flag bit */
typedef struct FTW Ftw_t;
struct FTW /* user function arg */
{
Ftw_t* left; /* left child in cycle check tree */
Ftw_t* right; /* right child in cycle check tree */
Ftw_t* link; /* identical to this elt on search path */
Ftw_t* parent; /* parent in current search path */
union
{
long number; /* local number */
char* pointer;/* local pointer */
} local; /* local user data */
struct stat statb; /* stat buffer of this object */
char* path; /* full pathname */
short pathlen;/* strlen(path) */
unsigned short info; /* FTW_* type bits */
unsigned short status; /* user function entry/return status */
short level; /* current tree depth */
short namelen;/* strlen(name) */
char name[sizeof(int)]; /* file base name */
};
/*
* individual Ftw_t size
*/
#define FTWSIZE(f) ((f)->namelen+1+sizeof(Ftw_t)-sizeof(int))
/*
* Ftw_t.info type bits
*/
#define FTW_NS (1<<0) /* stat failed - unknown */
#define FTW_F (1<<1) /* file - not directory or symbolic link*/
#define FTW_SL (1<<2) /* symbolic link */
#define FTW_D (1<<3) /* directory - pre-order visit */
#define FTW_C (1<<4) /* causes cycle */
#define FTW_NR (1<<5) /* cannot read */
#define FTW_NX (1<<6) /* cannot search */
#define FTW_P (1<<7) /* post-order visit */
#define FTW_DC (FTW_D|FTW_C) /* directory - would cause cycle */
#define FTW_DNR (FTW_D|FTW_NR) /* directory - no read permission */
#define FTW_DNX (FTW_D|FTW_NX) /* directory - no search permission */
#define FTW_DP (FTW_D|FTW_P) /* directory - post-order visit */
/*
* Ftw_t.status entry values
*/
#define FTW_NAME (1<<0) /* use Ftw_t.name instead of Ftw_t.path */
#define FTW_PATH (1<<1) /* use Ftw_t.path instead of Ftw_t.name */
/*
* Ftw_t.status return values
*/
#define FTW_AGAIN (1<<2) /* process entry again */
#define FTW_FOLLOW (1<<3) /* follow FTW_SL symlink */
#define FTW_NOPOST (1<<4) /* skip post order visit */
#define FTW_SKIP (1<<5) /* skip FTW_D directory */
#define FTW_STAT (1<<6) /* userf did stat */
extern __MANGLE__ int ftwalk __PROTO__((const char*, int(*)(Ftw_t*), int, int(*)(Ftw_t*, Ftw_t*)));
extern __MANGLE__ int ftwflags __PROTO__((void));
#endif

View File

@@ -0,0 +1,254 @@
/* $XConsortium: hash.h /main/3 1995/11/01 17:36:47 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Glenn Fowler
* AT&T Bell Laboratories
*
* hash table library interface definitions
*/
#ifndef _HASH_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _HASH_H
/*
* NOTE: hash_info is obsolete; use hashlast()
*/
#if _DLL_INDIRECT_DATA && !_DLL
#define hash_info (*_hash_info_)
#else
#define hash_info _hash_info_
#endif
#define HASH_ALLOCATE (1L<<0) /* allocate new key names */
#define HASH_FIXED (1L<<1) /* fixed table size */
#define HASH_HASHED (1L<<6) /* key names already hashed */
#define HASH_RESIZE (1L<<2) /* table has been resized */
#define HASH_SCANNING (1L<<3) /* currently scanning scope */
#define HASH_SCOPE (1L<<4) /* push scope / create in bot */
#define HASH_STATIC (1L<<5) /* static table allocation */
#define HASH_CREATE (1L<<8) /* create bucket if not found */
#define HASH_DELETE (1L<<9) /* delete bucket if found */
#define HASH_LOOKUP 0 /* default op */
#define HASH_BUCKET (1L<<11) /* name is installed bucket */
#define HASH_INSTALL (1L<<12) /* install allocated bucket */
#define HASH_NOSCOPE (1L<<13) /* top scope only */
#define HASH_OPAQUE (1L<<14) /* opaque bucket */
#define HASH_VALUE (1L<<15) /* value bucket field used */
#define HASH_SIZE(n) (((long)(n))<<16) /* fixed bucket size */
#define HASH_SIZEOF(f) ((((long)(f))>>16)&0xffff) /* extract size */
#define HASH_DELETED ((unsigned long)1<<(8*sizeof(int)-1)) /* deleted placeholder */
#define HASH_KEEP (1L<<(8*sizeof(int)-2)) /* no free on bucket */
#define HASH_HIDDEN (1L<<(8*sizeof(int)-3)) /* hidden by scope */
#define HASH_HIDES (1L<<(8*sizeof(int)-4)) /* hides lower scope */
#define HASH_OPAQUED (1L<<(8*sizeof(int)-5)) /* opaqued placeholder */
#define HASH_RESET (HASH_RESIZE|HASH_SCOPE|HASH_STATIC|HASH_VALUE)
#define HASH_INTERNAL (HASH_BUCKET|HASH_RESIZE|HASH_SCANNING|HASH_STATIC)
#define HASH_FLAGS (HASH_DELETED|HASH_HIDDEN|HASH_HIDES|HASH_KEEP|HASH_OPAQUED)
#define HASH_alloc 1
#define HASH_clear 2
#define HASH_compare 3
#define HASH_free 4
#define HASH_hash 5
#define HASH_meanchain 6
#define HASH_name 7
#define HASH_namesize 8
#define HASH_set 9
#define HASH_size 10
#define HASH_table 11
#define HASH_va_list 12
#define HASH_bucketsize 13
#define HASH_region 14
#include <hashpart.h>
#define hashclear(t,f) ((t)->flags &= ~((f) & ~HASH_INTERNAL))
#define hashcover(b) (((b)->hash&HASH_HIDES)?(Hash_bucket_t*)((b)->name):(Hash_bucket_t*)0)
#define hashdel(t,n) hashlook(t, (char*)(n), HASH_DELETE, (char*)0)
#define hashget(t,n) hashlook(t, (char*)(n), HASH_LOOKUP|HASH_VALUE, (char*)0)
#define hashkeep(b) ((b)->hash|=HASH_KEEP)
#define hashname(b) ((((b)->hash&HASH_HIDES)?((Hash_bucket_t*)((b)->name)):(b))->name)
#define hashput(t,n,v) hashlook(t, (char*)(n), HASH_CREATE|HASH_VALUE, (char*)(v))
#define hashref(t,n) hashlook(t, (char*)(n), HASH_LOOKUP|HASH_INTERNAL|HASH_VALUE, (char*)0)
#define hashscope(t) ((t)->scope)
#define hashset(t,f) ((t)->flags |= ((f) & ~HASH_INTERNAL))
/*
* DEPRECATED renames for compatibility
*/
#define Hashbin_t Hash_bucket_t
#define HASHBUCKET Hash_bucket_t
#define Hashhdr_t Hash_header_t
#define HASHHEADER Hash_header_t
#define Hashpos_t Hash_position_t
#define HASHPOSITION Hash_position_t
#define Hashtab_t Hash_table_t
#define HASHTABLE Hash_table_t
#define vhashalloc hashvalloc
#define hashvalloc(t,a) hashalloc(t,HASH_va_list,a,0)
/*
* the #define's avoid union tags
*/
typedef struct Hash_bucket Hash_bucket_t;
typedef struct Hash_root Hash_root_t;
typedef struct Hash_table Hash_table_t;
#define HASH_HEADER /* common bucket header */ \
Hash_bucket_t* next; /* next in collision chain */ \
unsigned int hash; /* hash flags and value */ \
char* name /* key name */
#define HASH_DEFAULT /* HASH_VALUE bucket elements */ \
char* value /* key value */
typedef struct /* bucket header */
{
HASH_HEADER;
} Hash_header_t;
struct Hash_bucket /* prototype bucket */
{
HASH_HEADER;
HASH_DEFAULT;
};
typedef struct /* hash scan bucket position */
{
Hash_bucket_t* bucket; /* bucket */
#ifdef _HASH_POSITION_PRIVATE_
_HASH_POSITION_PRIVATE_
#endif
} Hash_position_t;
struct Hash_root /* root hash table information */
{
int accesses; /* number of accesses */
int collisions; /* number of collisions */
int flags; /* flags: see HASH_[A-Z]* */
#ifdef _HASH_ROOT_PRIVATE_
_HASH_ROOT_PRIVATE_
#endif
};
struct Hash_table /* hash table information */
{
Hash_root_t* root; /* root hash table information */
int size; /* table size */
int buckets; /* active bucket count */
char* name; /* table name */
Hash_table_t* scope; /* scope covered table */
short flags; /* flags: see HASH_[A-Z]* */
#ifdef _HASH_TABLE_PRIVATE_
_HASH_TABLE_PRIVATE_
#endif
};
typedef struct /* library hash info */
{
Hash_bucket_t* last; /* most recent lookup bucket */
Hash_table_t* table; /* most recent lookup table */
#ifdef _HASH_INFO_PRIVATE_
_HASH_INFO_PRIVATE_
#endif
} Hash_info_t;
extern __MANGLE__ Hash_info_t hash_info;
extern __MANGLE__ Hash_table_t* hashalloc __PROTO__((Hash_table_t*, ...));
extern __MANGLE__ void hashdone __PROTO__((Hash_position_t*));
extern __MANGLE__ void hashdump __PROTO__((Hash_table_t*, int));
extern __MANGLE__ Hash_table_t* hashfree __PROTO__((Hash_table_t*));
extern __MANGLE__ Hash_bucket_t* hashlast __PROTO__((Hash_table_t*));
extern __MANGLE__ char* hashlook __PROTO__((Hash_table_t*, const char*, long, const char*));
extern __MANGLE__ Hash_bucket_t* hashnext __PROTO__((Hash_position_t*));
extern __MANGLE__ Hash_position_t* hashscan __PROTO__((Hash_table_t*, int));
extern __MANGLE__ void hashsize __PROTO__((Hash_table_t*, int));
extern __MANGLE__ int hashwalk __PROTO__((Hash_table_t*, int, int (*)(const char*, char*, __V_*), __V_*));
extern __MANGLE__ unsigned int memhash __PROTO__((const __V_*, int));
extern __MANGLE__ unsigned long memsum __PROTO__((const __V_*, int, unsigned long));
extern __MANGLE__ unsigned int strhash __PROTO__((const char*));
extern __MANGLE__ unsigned long strsum __PROTO__((const char*, unsigned long));
#endif

View File

@@ -0,0 +1,100 @@
/* $XConsortium: hashpart.h /main/3 1995/11/01 17:37:00 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* K. P. Vo
* G. S. Fowler
* AT&T Bell Laboratories
*
* ``the best'' combined linear congruent checksum/hash/PRNG
*/
#ifndef _HASHPART_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _HASHPART_H
#define HASH_ADD(h) (0x9c39c33dL)
#if __sparc__ || sparc
#define HASH_A(h,n) ((((h) << 2) - (h)) << (n))
#define HASH_B(h,n) ((((h) << 4) - (h)) << (n))
#define HASH_C(h,n) ((HASH_A(h,7) + HASH_B(h,0)) << (n))
#define HASH_MPY(h) (HASH_C(h,22)+HASH_C(h,10)+HASH_A(h,6)+HASH_A(h,3)+(h))
#else
#define HASH_MPY(h) ((h)*0x63c63cd9L)
#endif
#define HASHPART(h,c) (h = HASH_MPY(h) + HASH_ADD(h) + (c))
#endif

View File

@@ -0,0 +1,154 @@
/* $XConsortium: ls.h /main/3 1995/11/01 17:37:12 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Glenn Fowler
* AT&T Bell Laboratories
*
* ls formatter interface definitions
*/
#ifndef _LS_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _LS_H
#include <ast_fs.h>
#include <ast_mode.h>
/*
* some systems (could it beee AIX) pollute the std name space
*/
#undef fileid
#define fileid fileID
#if _mem_st_blocks_stat
#define iblocks(p) (((p)->st_blocks+1)/2)
#else
#define iblocks(p) _iblocks(p)
extern __MANGLE__ off_t _iblocks __PROTO__((struct stat*));
#endif
#if _mem_st_rdev_stat
#define idevice(p) ((p)->st_rdev)
#define IDEVICE(p,v) ((p)->st_rdev=(v))
#else
#define idevice(p) 0
#define IDEVICE(p,v)
#endif
#define LS_ATIME (1<<0) /* list st_atime */
#define LS_BLOCKS (1<<1) /* list blocks used by file */
#define LS_CTIME (1<<2) /* list st_ctime */
#define LS_EXTERNAL (1<<3) /* st_mode is modex canonical */
#define LS_INUMBER (1<<4) /* list st_ino */
#define LS_LONG (1<<5) /* long listing */
#define LS_MARK (1<<6) /* append file name marks */
#define LS_NOGROUP (1<<7) /* omit group name for LS_LONG */
#define LS_NOUSER (1<<8) /* omit user name for LS_LONG */
#define LS_NUMBER (1<<9) /* number instead of name */
#define LS_USER (1<<10) /* first user flag bit */
#define LS_W_BLOCKS 6 /* LS_BLOCKS field width */
#define LS_W_INUMBER 7 /* LS_INUMBER field width */
#define LS_W_LONG 55 /* LS_LONG width (w/o names) */
#define LS_W_LINK 4 /* link text width (w/o names) */
#define LS_W_MARK 1 /* LS_MARK field width */
#define LS_W_NAME 9 /* group|user name field width */
#if defined(_AST_H) || defined(_POSIX_SOURCE)
#define _AST_mode_t mode_t
#else
#define _AST_mode_t int
#endif
extern __MANGLE__ char* fmtls __PROTO__((char*, const char*, struct stat*, const char*, const char*, int));
extern __MANGLE__ int chmod __PROTO__((const char*, _AST_mode_t));
#if !defined(_ver_fstat)
extern __MANGLE__ int fstat __PROTO__((int, struct stat*));
#endif
#if !defined(_ver_lstat)
extern __MANGLE__ int lstat __PROTO__((const char*, struct stat*));
#endif
extern __MANGLE__ int mkdir __PROTO__((const char*, _AST_mode_t));
extern __MANGLE__ int mkfifo __PROTO__((const char*, _AST_mode_t));
#if !defined(_ver_mknod)
extern __MANGLE__ int mknod __PROTO__((const char*, _AST_mode_t, dev_t));
#endif
extern __MANGLE__ int pathstat __PROTO__((const char*, struct stat*));
#if !defined(_ver_stat)
extern __MANGLE__ int stat __PROTO__((const char*, struct stat*));
#endif
extern __MANGLE__ _AST_mode_t umask __PROTO__((_AST_mode_t));
#undef _AST_mode_t
#endif

View File

@@ -0,0 +1,110 @@
/* $XConsortium: magic.h /main/2 1996/05/08 19:43:33 drk $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Glenn Fowler
* AT&T Bell Laboratories
*
* magic interface definitions
*/
#ifndef _MAGIC_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _MAGIC_H
#include <ls.h>
#ifndef MAGIC_FILE
#define MAGIC_FILE "lib/file/magic"
#endif
#define MAGIC_PHYSICAL (1<<0) /* don't follow symlinks */
#define MAGIC_STAT (1<<1) /* magictype stat already done */
#define MAGIC_VERBOSE (1<<2) /* verbose magic file errors */
#define MAGIC_USER (1<<8) /* first user flag bit */
typedef struct
{
unsigned long flags; /* MAGIC_* flags */
#ifdef _MAGIC_PRIVATE_
_MAGIC_PRIVATE_
#endif
} Magic_t;
extern __MANGLE__ Magic_t* magicopen __PROTO__((unsigned long));
extern __MANGLE__ int magicload __PROTO__((Magic_t*, const char*, unsigned long));
extern __MANGLE__ int magiclist __PROTO__((Magic_t*, Sfio_t*));
extern __MANGLE__ char* magictype __PROTO__((Magic_t*, const char*, struct stat*));
extern __MANGLE__ void magicclose __PROTO__((Magic_t*));
#endif

View File

@@ -0,0 +1,112 @@
/* $XConsortium: modecanon.h /main/3 1995/11/01 17:37:38 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Glenn Fowler
* AT&T Bell Laboratories
*
* canonical mode_t representation
*/
#ifndef _MODECANON_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _MODECANON_H
#define X_ITYPE(m) ((m)&X_IFMT)
#define X_IFMT 0170000
#define X_IFSOCK 0140000
#define X_IFLNK 0120000
#define X_IFCTG 0110000
#define X_IFREG 0100000
#define X_IFBLK 0060000
#define X_IFDIR 0040000
#define X_IFCHR 0020000
#define X_IFIFO 0010000
#define X_IPERM 0007777
#define X_ISUID 0004000
#define X_ISGID 0002000
#define X_ISVTX 0001000
#define X_IRUSR 0000400
#define X_IWUSR 0000200
#define X_IXUSR 0000100
#define X_IRGRP 0000040
#define X_IWGRP 0000020
#define X_IXGRP 0000010
#define X_IROTH 0000004
#define X_IWOTH 0000002
#define X_IXOTH 0000001
#define X_IRWXU (X_IRUSR|X_IWUSR|X_IXUSR)
#define X_IRWXG (X_IRGRP|X_IWGRP|X_IXGRP)
#define X_IRWXO (X_IROTH|X_IWOTH|X_IXOTH)
#endif

View File

@@ -0,0 +1,94 @@
/* $XConsortium: modex.h /main/3 1995/11/01 17:37:50 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* AT&T Bell Laboratories
*
* external mode_t representation support
*/
#ifndef _MODEX_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _MODEX_H
#include <ast_fs.h>
#include <modecanon.h>
extern __MANGLE__ int modei __PROTO__((int));
extern __MANGLE__ int modex __PROTO__((int));
#if _S_IDPERM
#define modei(m) ((m)&X_IPERM)
#if _S_IDTYPE
#define modex(m) (m)
#endif
#endif
#endif

View File

@@ -0,0 +1,91 @@
/* $XConsortium: namval.h /main/3 1995/11/01 17:38:03 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Glenn Fowler
* AT&T Bell Laboratories
*
* common name-value struct support
*/
#ifndef _NAMVAL_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _NAMVAL_H
typedef struct
{
char* name;
int value;
#ifdef _NAMVAL_PRIVATE_
_NAMVAL_PRIVATE_
#endif
} Namval_t;
#endif

View File

@@ -0,0 +1,84 @@
/* $XConsortium: national.h /main/3 1995/11/01 17:38:14 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF *
* AT&T BELL LABORATORIES *
* AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN *
* ACCORDANCE WITH APPLICABLE AGREEMENTS *
* *
* Copyright (c) 1993 AT&T Bell Laboratories *
* Unpublished & Not for Publication *
* All Rights Reserved *
* *
* The copyright notice above does not evidence any *
* actual or intended publication of such source code *
* *
* This software was created by the *
* Advanced Software Technology Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* {ulysses,attmail}!dgk *
* dgk@ulysses.att.com *
* David Korn 908-582-7975 *
* *
***************************************************************/
#line 1
/* %W% */
/*
* national.h - definitions for international character sets
*
* David Korn
* AT&T Bell Laboratories
* Room 5D-112
* Murray Hill, N. J. 07974
* Tel. x7975
*
*/
/*
* This data must be defined for each country in defs.c
*/
#ifndef HIGHBIT
# define HIGHBIT (1<<(CHAR_BIT-1))
#endif /* HIGHBIT */
#ifndef ESS_MAXCHAR /* allow multiple includes */
/*
* This section may change from country to country
*/
#define ESS_MAXCHAR 2 /* Maximum number of non-escape bytes
for any and all character sets */
#define CCS1_IN_SIZE 2
#define CCS1_OUT_SIZE 2
#define CCS2_IN_SIZE 1
#define CCS2_OUT_SIZE 1
#define CCS3_IN_SIZE 2
#define CCS3_OUT_SIZE 2
/*
* This part is generic
*/
#define MARKER 0x100 /* Must be invalid character */
#define ESS2 0x8e /* Escape to char set 2 */
#define ESS3 0x8f /* Escape to char set 3 */
#define ESS_SETMASK (3<<(7*ESS_MAXCHAR)) /* character set bits */
#define echarset(c) ((c)==ESS3?3:((c)==ESS2)?2:((c)>>7)&1)
#define icharset(i) ((i)>>(7*ESS_MAXCHAR)&3)
#define in_csize(s) int_charsize[s]
#define out_csize(s) int_charsize[s+4]
extern char int_charsize[8];
#endif /* ESS_MAXCHAR */

View File

@@ -0,0 +1,126 @@
/* $XConsortium: option.h /main/3 1995/11/01 17:38:26 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Glenn Fowler
* AT&T Bell Laboratories
*
* command line option parse assist definitions
*/
#ifndef _OPTION_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _OPTION_H
#if _DLL_INDIRECT_DATA && !_DLL
#define opt_info (*_opt_info_)
#else
#define opt_info _opt_info_
#endif
/*
* obsolete interface mappings
*/
#define opt_again opt_info.again
#define opt_arg opt_info.arg
#define opt_argv opt_info.argv
#define opt_char opt_info.offset
#define opt_index opt_info.index
#define opt_msg opt_info.msg
#define opt_num opt_info.num
#define opt_option opt_info.option
#define opt_pindex opt_info.pindex
#define opt_pchar opt_info.poffset
typedef struct
{
int again; /* see optjoin() */
char* arg; /* {:,#} string argument */
char** argv; /* most recent argv */
int index; /* argv index */
char* msg; /* error/usage message buffer */
long num; /* # numeric argument */
int offset; /* char offset in argv[index] */
char option[3]; /* current flag {-,+} + option */
int pindex; /* prev index for backup */
int poffset; /* prev offset for backup */
#ifdef _OPT_INFO_PRIVATE
_OPT_INFO_PRIVATE
#endif
} Opt_info_t;
extern __MANGLE__ Opt_info_t opt_info; /* global option state */
extern __MANGLE__ int optget __PROTO__((char**, const char*));
extern __MANGLE__ int optjoin __PROTO__((char**, ...));
extern __MANGLE__ char* optusage __PROTO__((const char*));
#endif

View File

@@ -0,0 +1,143 @@
/* $XConsortium: proc.h /main/3 1995/11/01 17:38:40 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* process library interface
*/
#ifndef _PROC_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _PROC_H
#include <ast.h>
#define PROC_ARGMOD (1<<0) /* argv[-1],argv[0] can be modified */
#define PROC_BACKGROUND (1<<1) /* shell background (&) setup */
#define PROC_CLEANUP (1<<2) /* close parent redirect fds on error */
#define PROC_DAEMON (1<<3) /* daemon setup */
#define PROC_ENVCLEAR (1<<4) /* clear environment */
#define PROC_GID (1<<5) /* setgid(getgid()) */
#define PROC_IGNORE (1<<6) /* ignore parent pipe errors */
#define PROC_OVERLAY (1<<7) /* overlay current process if possible */
#define PROC_PARANOID (1<<8) /* restrict everything */
#define PROC_PRIVELEGED (1<<9) /* setuid(0), setgid(getegid()) */
#define PROC_READ (1<<10) /* proc pipe fd 1 returned */
#define PROC_SESSION (1<<11) /* session leader */
#define PROC_UID (1<<12) /* setuid(getuid()) */
#define PROC_WRITE (1<<13) /* proc pipe fd 0 returned */
#define PROC_ARG_BIT 14 /* bits per op arg */
#define PROC_OP_BIT 4 /* bits per op */
#define PROC_ARG_NULL ((1<<PROC_ARG_BIT)-1)
#define PROC_fd_dup 0x4
#define PROC_FD_CHILD 0x1
#define PROC_FD_PARENT 0x2
#define PROC_sig_dfl 0x8
#define PROC_sig_ign 0x9
#define PROC_sys_pgrp 0xa
#define PROC_sys_umask 0xb
#define PROC_op1(o,a) (((o)<<(2*PROC_ARG_BIT))|((a)&((PROC_ARG_NULL<<PROC_ARG_BIT)|PROC_ARG_NULL)))
#define PROC_op2(o,a,b) (((o)<<(2*PROC_ARG_BIT))|(((b)&PROC_ARG_NULL)<<PROC_ARG_BIT)|((a)&PROC_ARG_NULL))
#define PROC_FD_CLOSE(p,f) PROC_op2(PROC_fd_dup|(f),p,PROC_ARG_NULL)
#define PROC_FD_DUP(p,c,f) PROC_op2(PROC_fd_dup|(f),p,c)
#define PROC_SIG_DFL(s) PROC_op1(PROC_sig_dfl,s,0)
#define PROC_SIG_IGN(s) PROC_op1(PROC_sig_ign,s,0)
#define PROC_SYS_PGRP(g) PROC_op1(PROC_sys_pgrp,g)
#define PROC_SYS_UMASK(m) PROC_op1(PROC_sys_umask,m,0)
#define PROC_OP(x) (((x)>>(2*PROC_ARG_BIT))&((1<<PROC_OP_BIT)-1))
#define PROC_ARG(x,n) ((n)?(((x)>>(((n)-1)*PROC_ARG_BIT))&PROC_ARG_NULL):(((x)&~((1<<(2*PROC_ARG_BIT))-1))==~((1<<(2*PROC_ARG_BIT))-1))?(-1):((x)&~((1<<(2*PROC_ARG_BIT))-1)))
typedef struct
{
pid_t pid; /* process id */
pid_t pgrp; /* process group id */
int rfd; /* read fd if applicable */
int wfd; /* write fd if applicable */
#ifdef _PROC_PRIVATE_
_PROC_PRIVATE_
#endif
} Proc_t;
extern __MANGLE__ int procclose __PROTO__((Proc_t*));
extern __MANGLE__ int procfree __PROTO__((Proc_t*));
extern __MANGLE__ Proc_t* procopen __PROTO__((const char*, char**, char**, long*, long));
extern __MANGLE__ int procrun __PROTO__((const char*, char**));
#endif

View File

@@ -0,0 +1,117 @@
/* $XConsortium: re.h /main/3 1995/11/01 17:38:54 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Glenn Fowler
* AT&T Bell Laboratories
*
* regular expression library definitions
*/
#ifndef _RE_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _RE_H
#include <sfio.h>
#define RE_ALL (1<<0) /* substitute all occurrences */
#define RE_EDSTYLE (1<<1) /* ed(1) style magic characters */
#define RE_LOWER (1<<2) /* substitute to lower case */
#define RE_MATCH (1<<3) /* record matches in Re_program_t.match */
#define RE_UPPER (1<<4) /* substitute to upper case */
#define RE_EXTERNAL 8 /* first external flag bit */
typedef struct /* sub-expression match */
{
char* sp; /* start in source string */
char* ep; /* end in source string */
} Re_match_t;
typedef struct /* compiled regular expression program */
{
#ifdef _RE_PROGRAM_PRIVATE_
_RE_PROGRAM_PRIVATE_
#else
Re_match_t match['9'-'0'+1];/* sub-expression match table*/
#endif
} Re_program_t, reprogram;
/*
* interface routines
*/
extern __MANGLE__ Re_program_t* recomp __PROTO__((const char*, int));
extern __MANGLE__ int reexec __PROTO__((Re_program_t*, const char*));
extern __MANGLE__ void refree __PROTO__((Re_program_t*));
extern __MANGLE__ void reerror __PROTO__((const char*));
extern __MANGLE__ char* resub __PROTO__((Re_program_t*, const char*, const char*, char*, int));
extern __MANGLE__ void ressub __PROTO__((Re_program_t*, Sfio_t*, const char*, const char*, int));
#endif

View File

@@ -0,0 +1,98 @@
/* $XConsortium: sfdisc.h /main/2 1996/05/08 19:43:47 drk $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* AT&T Bell Laboratories
*
* sfio discipline interface definitions
*/
#ifndef _SFDISC_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _SFDISC_H
#include <ast.h>
/*
* %(...) printf support
*/
typedef int (*Sf_key_lookup_t) __PROTO__((__V_*, const char*, const char*, int, char**, long*));
typedef char* (*Sf_key_convert_t) __PROTO__((__V_*, const char*, const char*, int, char*, long));
extern __MANGLE__ int sfkeyprintf __PROTO__((Sfio_t*, __V_*, const char*, Sf_key_lookup_t, Sf_key_convert_t));
/*
* slow io exception discipline
*/
extern __MANGLE__ int sfslowio __PROTO__((Sfio_t*));
#endif

View File

@@ -0,0 +1,355 @@
/* $XConsortium: sfio.h /main/3 1995/11/01 17:39:20 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
#ifndef _SFIO_H
#define _SFIO_H 1
/* Public header file for the safe fast io package.
**
** Written by Kiem-Phong Vo, kpv@research.att.com.
*/
#ifndef __KPV__
#define __KPV__ 1
#ifndef __STD_C
#ifdef __STDC__
#define __STD_C 1
#else
#if __cplusplus
#define __STD_C 1
#else
#define __STD_C 0
#endif /*__cplusplus*/
#endif /*__STDC__*/
#endif /*__STD_C*/
#ifndef _BEGIN_EXTERNS_
#if __cplusplus
#define _BEGIN_EXTERNS_ extern "C" {
#define _END_EXTERNS_ }
#else
#define _BEGIN_EXTERNS_
#define _END_EXTERNS_
#endif
#endif /*_BEGIN_EXTERNS_*/
#ifndef _ARG_
#if __STD_C
#define _ARG_(x) x
#else
#define _ARG_(x) ()
#endif
#endif /*_ARG_*/
#ifndef Void_t
#if __STD_C
#define Void_t void
#else
#define Void_t char
#endif
#endif /*Void_t*/
#ifndef NIL
#define NIL(type) ((type)0)
#endif /*NIL*/
#endif /*__KPV__*/
/* mostly to prevent stupid C++ stdarg.h from including stdio.h */
#if __cplusplus
#ifndef __stdio_h__
#define __stdio_h__ 1
#endif
#ifndef _stdio_h_
#define _stdio_h_ 1
#endif
#ifndef _stdio_h
#define _stdio_h 1
#endif
#ifndef __h_stdio__
#define __h_stdio__ 1
#endif
#ifndef _h_stdio_
#define _h_stdio_ 1
#endif
#ifndef _h_stdio
#define _h_stdio 1
#endif
#ifndef __STDIO_H__
#define __STDIO_H__ 1
#endif
#ifndef _STDIO_H_
#define _STDIO_H_ 1
#endif
#ifndef _STDIO_H
#define _STDIO_H 1
#endif
#ifndef __H_STDIO__
#define __H_STDIO__ 1
#endif
#ifndef _H_STDIO_
#define _H_STDIO_ 1
#endif
#ifndef _H_STDIO
#define _H_STDIO 1
#endif
#ifndef _stdio_included
#define _stdio_included 1
#endif
#ifndef _included_stdio
#define _included_stdio 1
#endif
#ifndef _INCLUDED_STDIO
#define _INCLUDED_STDIO 1
#endif
#ifndef _STDIO_INCLUDED
#define _STDIO_INCLUDED 1
#endif
#ifndef FILE
#define FILE Sfio_t
#endif
#endif /* __cplusplus */
typedef struct _sfio_ Sfile_t, Sfio_t, SFIO;
typedef struct _sfdc_ Sfdisc_t;
typedef int (*Sfread_f)_ARG_((Sfio_t*, Void_t*, int, Sfdisc_t*));
typedef int (*Sfwrite_f)_ARG_((Sfio_t*, const Void_t*, int, Sfdisc_t*));
typedef long (*Sfseek_f)_ARG_((Sfio_t*, long, int, Sfdisc_t*));
typedef int (*Sfexcept_f)_ARG_((Sfio_t*, int, Sfdisc_t*));
/* discipline structure */
struct _sfdc_
{
Sfread_f readf; /* read function */
Sfwrite_f writef; /* write function */
Sfseek_f seekf; /* seek function */
Sfexcept_f exceptf; /* to handle exceptions */
Sfdisc_t* disc; /* the continuing discipline */
};
/* a file structure */
struct _sfio_
{
unsigned char* next; /* next position to read/write from */
unsigned char* endw; /* end of write buffer */
unsigned char* endr; /* end of read buffer */
unsigned char* endb; /* end of buffer */
struct _sfio_* push; /* the stream that was pushed on */
unsigned short flags; /* type of stream */
short file; /* file descriptor */
unsigned char* data; /* base of data buffer */
int size; /* buffer size */
#ifdef _SFIO_PRIVATE
_SFIO_PRIVATE
#endif
};
/* various constants */
#ifndef NULL
#define NULL 0
#endif
#ifndef EOF
#define EOF (-1)
#endif
#ifndef __osf__
#ifndef SEEK_SET
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#endif
#endif
/* bits for various types of files */
#define SF_READ 0000001 /* open for reading */
#define SF_WRITE 0000002 /* open for writing */
#define SF_STRING 0000004 /* a string stream */
#define _SF_APPEND 0000010 /* associated file is in append mode */
#define SF_APPEND _SF_APPEND /* ask bsd about this */
#define SF_MALLOC 0000020 /* buffered space malloc-ed */
#define SF_LINE 0000040 /* line buffering */
#define SF_SHARE 0000100 /* file stream that is shared */
#define SF_EOF 0000200 /* eof was detected */
#define SF_ERROR 0000400 /* an error happened */
#define SF_STATIC 0001000 /* a stream that cannot be freed */
#define SF_IOCHECK 0002000 /* call exceptf before doing IO */
#define SF_PUBLIC 0004000 /* SF_SHARE and follow physical seek */
#define SF_FLAGS 0005177 /* PUBLIC FLAGS PASSABLE TO SFNEW() */
#define SF_SETS 0007163 /* flags passable to sfset() */
/* exception events: SF_NEW(0), SF_READ(1), SF_WRITE(2) and the below */
#define SF_SEEK 3 /* seek error */
#define SF_CLOSE 4 /* when stream is being closed */
#define SF_DPUSH 5 /* when discipline is being pushed */
#define SF_DPOP 6 /* when discipline is being popped */
#define SF_DPOLL 7 /* see if stream is ready for I/O */
#define SF_DBUFFER 8 /* buffer not empty during push or pop */
#define SF_SYNC 9 /* a sfsync() call was issued */
#define SF_PURGE 10 /* a sfpurge() call was issued */
/* for stack and disciplines */
#define SF_POPSTACK NIL(Sfio_t*) /* pop the stream stack */
#define SF_POPDISC NIL(Sfdisc_t*) /* pop the discipline stack */
/* for the notify function and discipline exception */
#define SF_NEW 0 /* new stream */
#define SF_SETFD -1 /* about to set the file descriptor */
#define SF_BUFSIZE 8192 /* suggested default buffer size */
#define SF_UNBOUND (-1) /* unbounded buffer size */
#if __STD_C
#include <stdarg.h>
#endif
_BEGIN_EXTERNS_
#if _DLL_INDIRECT_DATA && _DLL
#define sfstdin ((Sfio_t*)_ast_dll->_ast_stdin)
#define sfstdout ((Sfio_t*)_ast_dll->_ast_stdout)
#define sfstderr ((Sfio_t*)_ast_dll->_ast_stderr)
#else
#define sfstdin (&_Sfstdin)
#define sfstdout (&_Sfstdout)
#define sfstderr (&_Sfstderr)
extern Sfio_t _Sfstdin; /* std input stream */
extern Sfio_t _Sfstdout; /* std output stream */
extern Sfio_t _Sfstderr; /* std error stream */
#endif
extern int _Sfi;
extern Sfio_t* sfnew _ARG_((Sfio_t*, Void_t*, int, int, int));
extern Sfio_t* sfopen _ARG_((Sfio_t*, const char*, const char*));
extern Sfio_t* sfpopen _ARG_((Sfio_t*, const char*, const char*));
extern Sfio_t* sfstack _ARG_((Sfio_t*, Sfio_t*));
extern Sfio_t* sfswap _ARG_((Sfio_t*, Sfio_t*));
extern Sfio_t* sftmp _ARG_((int));
extern int _sfflsbuf _ARG_((Sfio_t*, int));
extern int _sffilbuf _ARG_((Sfio_t*, int));
extern int sfpurge _ARG_((Sfio_t*));
extern int sfpoll _ARG_((Sfio_t**, int, int));
extern int sfpeek _ARG_((Sfio_t*, Void_t**, int));
extern Void_t* sfreserve _ARG_((Sfio_t*, int, int));
extern int sfsync _ARG_((Sfio_t*));
extern int sfclrlock _ARG_((Sfio_t*));
extern Void_t* sfsetbuf _ARG_((Sfio_t*, Void_t*, int));
extern Sfdisc_t* sfdisc _ARG_((Sfio_t*,Sfdisc_t*));
extern int sfnotify _ARG_((void(*)(Sfio_t*, int, int)));
extern int sfset _ARG_((Sfio_t*, int, int));
extern int sfsetfd _ARG_((Sfio_t*, int));
extern Sfio_t* sfpool _ARG_((Sfio_t*, Sfio_t*, int));
extern int sfread _ARG_((Sfio_t*, Void_t*, int));
extern int sfwrite _ARG_((Sfio_t*, const Void_t*, int));
extern long sfmove _ARG_((Sfio_t*, Sfio_t*, long, int));
extern int sfclose _ARG_((Sfio_t*));
extern long sftell _ARG_((Sfio_t*));
extern long sfseek _ARG_((Sfio_t*, long, int));
extern int sfllen _ARG_((long));
extern int sfdlen _ARG_((double));
extern int sfputr _ARG_((Sfio_t*, const char*, int));
extern char* sfgetr _ARG_((Sfio_t*, int, int));
extern int sfnputc _ARG_((Sfio_t*, int, int));
extern int _sfputu _ARG_((Sfio_t*, unsigned long));
extern int _sfputl _ARG_((Sfio_t*, long));
extern unsigned long _sfgetu _ARG_((Sfio_t*));
extern long _sfgetl _ARG_((Sfio_t*));
extern int _sfputd _ARG_((Sfio_t*, double));
extern double sfgetd _ARG_((Sfio_t*));
extern int sfungetc _ARG_((Sfio_t*, int));
extern char* sfprints _ARG_((const char*, ...));
extern int sfprintf _ARG_((Sfio_t*, const char*, ...));
extern int sfsprintf _ARG_((char*, int, const char*, ...));
extern int sfscanf _ARG_((Sfio_t*, const char*, ...));
extern int sfsscanf _ARG_((const char*, const char*, ...));
extern int sfvprintf _ARG_((Sfio_t*, const char*, va_list));
extern int sfvscanf _ARG_((Sfio_t*, const char*, va_list));
extern char* sfecvt _ARG_((double,int,int*,int*));
extern char* sffcvt _ARG_((double,int,int*,int*));
/* io functions with discipline continuation */
extern int sfrd _ARG_((Sfio_t*, Void_t*, int, Sfdisc_t*));
extern int sfwr _ARG_((Sfio_t*, const Void_t*, int, Sfdisc_t*));
extern long sfsk _ARG_((Sfio_t*, long, int, Sfdisc_t*));
extern int sfpkrd _ARG_((int, Void_t*, int, int, long, int));
/* function analogues of fast in-line functions */
extern int sfgetc _ARG_((Sfio_t*));
extern long sfgetl _ARG_((Sfio_t*));
extern unsigned long sfgetu _ARG_((Sfio_t*));
extern int sfputc _ARG_((Sfio_t*,int));
extern int sfputd _ARG_((Sfio_t*,double));
extern int sfputl _ARG_((Sfio_t*,long));
extern int sfputu _ARG_((Sfio_t*,unsigned long));
extern int sfslen _ARG_((void));
extern int sfulen _ARG_((unsigned long));
extern long sfsize _ARG_((Sfio_t*));
extern int sfclrerr _ARG_((Sfio_t*));
extern int sfeof _ARG_((Sfio_t*));
extern int sferror _ARG_((Sfio_t*));
extern int sffileno _ARG_((Sfio_t*));
extern int sfstacked _ARG_((Sfio_t*));
_END_EXTERNS_
/* fast in-line functions */
#define sfputc(f,c) ((f)->next >= (f)->endw ? \
_sfflsbuf(f,(int)((unsigned char)(c))) : \
(int)(*(f)->next++ = (unsigned char)(c)))
#define sfgetc(f) ((f)->next >= (f)->endr ? _sffilbuf(f,0) : (int)(*(f)->next++))
#if !_DLL_INDIRECT_DATA || _DLL
#define sfslen() (_Sfi)
#endif
#define sffileno(f) ((f)->file)
#define sfeof(f) ((f)->flags&SF_EOF)
#define sferror(f) ((f)->flags&SF_ERROR)
#define sfclrerr(f) ((f)->flags &= ~(SF_ERROR|SF_EOF))
#define sfstacked(f) ((f)->push != NIL(Sfio_t*))
/* coding long integers in a portable and compact fashion */
#define SF_SBITS 6
#define SF_UBITS 7
#define SF_SIGN (1 << SF_SBITS)
#define SF_MORE (1 << SF_UBITS)
#define SF_U1 SF_MORE
#define SF_U2 (SF_U1*SF_U1)
#define SF_U3 (SF_U2*SF_U1)
#define SF_U4 (SF_U3*SF_U1)
#define sfulen(v) ((v) < SF_U1 ? 1 : (v) < SF_U2 ? 2 : \
(v) < SF_U3 ? 3 : (v) < SF_U4 ? 4 : 5)
#define sfgetu(f) ((_Sfi = sfgetc(f)) < 0 ? -1 : \
((_Sfi&SF_MORE) ? _sfgetu(f) : (unsigned long)_Sfi))
#define sfgetl(f) ((_Sfi = sfgetc(f)) < 0 ? -1 : \
((_Sfi&(SF_MORE|SF_SIGN)) ? _sfgetl(f) : (long)_Sfi))
#define sfputu(f,v) _sfputu((f),(unsigned long)(v))
#define sfputl(f,v) _sfputl((f),(long)(v))
#define sfputd(f,v) _sfputd((f),(double)(v))
#endif /* _SFIO_H */

View File

@@ -0,0 +1,56 @@
/* $XConsortium: sfstr.h /main/3 1995/11/01 17:39:35 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/*
* macro interface for sfio write strings
*
* NOTE: see <stak.h> for an alternative interface
* read operations require sfseek()
*/
#ifndef _SFSTR_H
#define _SFSTR_H
#include <sfio.h>
#define sfstropen() sfnew((Sfile_t*)0,(char*)0,-1,-1,SF_WRITE|SF_STRING)
#define sfstrnew(m) sfnew((Sfile_t*)0,(char*)0,-1,-1,(m)|SF_STRING)
#define sfstrclose(f) sfclose(f)
#define sfstrtell(f) ((f)->next - (f)->data)
#define sfstrrel(f,p) ((p) == (0) ? (char*)(f)->next : \
((f)->next += (p), \
((f)->next >= (f)->data && (f)->next <= (f)->endb) ? \
(char*)(f)->next : ((f)->next -= (p), (char*)0) ) )
#define sfstrset(f,p) (((p) >= 0 && (p) <= (f)->size) ? \
(char*)((f)->next = (f)->data+(p)) : (char*)0 )
#define sfstrbase(f) ((char*)(f)->data)
#define sfstrsize(f) ((f)->size)
#define sfstrrsrv(f,n) (sfreserve(f,(long)(n),1)?(sfwrite(f,(char*)(f)->next,0),(char*)(f)->next):(char*)0)
#define sfstruse(f) (sfputc(f,0), (char*)((f)->next = (f)->data) )
#endif

View File

@@ -0,0 +1,126 @@
/* $XConsortium: stack.h /main/3 1995/11/01 17:39:49 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Glenn Fowler
* AT&T Bell Laboratories
*
* homogenous stack routine definitions
*/
#ifndef _STACK_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _STACK_H
typedef struct stacktable* STACK; /* stack pointer */
typedef struct stackposition STACKPOS; /* stack position */
struct stackblock /* stack block cell */
{
__V_** stack; /* actual stack */
struct stackblock* prev; /* previous block in list */
struct stackblock* next; /* next block in list */
};
struct stackposition /* stack position */
{
struct stackblock* block; /* current block pointer */
int index; /* index within current block */
};
struct stacktable /* stack information */
{
struct stackblock* blocks; /* stack table blocks */
__V_* error; /* error return value */
int size; /* size of each block */
STACKPOS position; /* current stack position */
};
/*
* map old names to new
*/
#define mkstack stackalloc
#define rmstack stackfree
#define clrstack stackclear
#define getstack stackget
#define pushstack stackpush
#define popstack stackpop
#define posstack stacktell
extern __MANGLE__ STACK stackalloc __PROTO__((int, __V_*));
extern __MANGLE__ void stackfree __PROTO__((STACK));
extern __MANGLE__ void stackclear __PROTO__((STACK));
extern __MANGLE__ __V_* stackget __PROTO__((STACK));
extern __MANGLE__ int stackpush __PROTO__((STACK, __V_*));
extern __MANGLE__ int stackpop __PROTO__((STACK));
extern __MANGLE__ void stacktell __PROTO__((STACK, int, STACKPOS*));
#endif

View File

@@ -0,0 +1,104 @@
/* $XConsortium: stak.h /main/3 1995/11/01 17:40:02 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* David Korn
* AT&T Bell Laboratories
*
* Interface definitions for a stack-like storage library
*
*/
#ifndef _STAK_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _STAK_H
#include <stk.h>
#define Stak_t Sfio_t
#define staksp stkstd
#define STAK_SMALL STK_SMALL
#define stakptr(n) stkptr(stkstd,n)
#define staktell() stktell(stkstd)
#define stakputc(c) sfputc(stkstd,(c))
#define stakwrite(b,n) sfwrite(stkstd,(b),(n))
#define stakputs(s) (sfputr(stkstd,(s),0),--stkstd->next)
#define stakseek(n) stkseek(stkstd,n)
#define stakcreate(n) stkopen(n)
#define stakinstall(s,f) stkinstall(s,f)
#define stakdelete(s) stkclose(s)
#define staklink(s) stklink(s)
#define stakalloc(n) stkalloc(stkstd,n)
#define stakcopy(s) stkcopy(stkstd,s)
#define stakset(c,n) stkset(stkstd,c,n)
#define stakfreeze(n) stkfreeze(stkstd,n)
#endif

View File

@@ -0,0 +1,208 @@
/* $XConsortium: stdio.h /main/3 1995/11/01 17:40:15 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
#ifndef _SFSTDIO_H /* protect against multiple #includes */
#define _SFSTDIO_H 1
#define stdin sfstdin
#define stdout sfstdout
#define stderr sfstderr
#define BUFSIZ SF_BUFSIZE
#ifdef FILE
#undef FILE
#endif
#define FILE Sfio_t
#include <sfio.h>
#define _IOFBF 0
#define _IONBF 1
#define _IOLBF 2
#define L_ctermid 9
#define L_cuserid 9
#define P_tmpdir "/usr/tmp/"
#define L_tmpnam (sizeof(P_tmpdir)+15)
_BEGIN_EXTERNS_
extern char* ctermid _ARG_((char*));
extern char* cuserid _ARG_((char*));
extern char* tmpnam _ARG_((char*));
extern char* tempnam _ARG_((const char*, const char*));
#ifndef remove
extern int remove _ARG_((const char*));
#endif
extern void perror _ARG_((const char*));
extern Sfio_t* _stdopen _ARG_((int, const char*));
extern char* _stdgets _ARG_((Sfio_t*, char*, int n, int isgets));
extern int _stdprintf _ARG_((const char*, ...));
extern int _stdsprintf _ARG_((char*, const char*, ...));
extern int _stdscanf _ARG_((const char*, ...));
extern int _stdsetvbuf _ARG_((Sfio_t*, char*, int, int));
_END_EXTERNS_
#define _SFSIZEOF(s) (sizeof(s) != sizeof(char*) ? sizeof(s) : BUFSIZ)
#define printf _stdprintf
#define _doscan sfvscanf
#define fdopen _stdopen
#define fprintf sfprintf
#define fscanf sfscanf
#define scanf _stdscanf
#define setvbuf _stdsetvbuf
#define sprintf _stdsprintf
#define snprintf sfsprintf
#define sscanf sfsscanf
#define vfprintf sfvprintf
#define vfscanf sfvscanf
#define vsprintf _stdvsprintf
#define vsnprintf _stdvsnprintf
#define vsscanf _stdvssanf
#if __cplusplus
inline FILE* fopen(const char* f, const char* m)
{ return sfopen((Sfio_t*)0,f,m); }
inline FILE* freopen(const char* f, const char* m, FILE* p)
{ return sfopen(p,f,m); }
inline FILE* popen(const char* cmd, const char* m)
{ return sfpopen((Sfio_t*)0,cmd,m); }
inline FILE* tmpfile()
{ return sftmp(SF_BUFSIZE); }
inline int fclose(FILE* f)
{ return sfclose(f); }
inline int pclose(FILE* f)
{ return sfclose(f); }
inline int fwrite(const void* p, int s, int n, FILE* f)
{ return ((_Sfi = sfwrite(f,p,(s)*(n))) <= 0 ? _Sfi : _Sfi/(s)); }
inline int fputc(int c, FILE* f)
{ return sfputc(f,c); }
inline int putc(int c, FILE* f)
{ return sfputc(f,c); }
inline int putw(int w, FILE* f)
{ return (_Sfi = (int)w, sfwrite(f,&_Sfi,sizeof(int)) <= 0 ? 1 : 0); }
inline int putchar(int c)
{ return sfputc(sfstdout,c); }
inline int fputs(const char* s, FILE* f)
{ return sfputr(f,s,-1); }
inline int puts(const char* s)
{ return sfputr(sfstdout,s,'\n'); }
inline int vprintf(const char* fmt, va_list a)
{ return sfvprintf(sfstdout,fmt,a); }
inline int _doprnt(const char* fmt, va_list a, FILE* f)
{ return sfvprintf(f,fmt,a); }
inline int fread(void* p, int s, int n, FILE* f)
{ return ((_Sfi = sfread(f,p,(s)*(n))) <= 0 ? _Sfi : _Sfi/(s)); }
inline int fgetc(FILE* f)
{ return sfgetc(f); }
inline int getc(FILE* f)
{ return sfgetc(f); }
inline int getw(FILE* f)
{ return (sfread(f,&_Sfi,sizeof(int)) == sizeof(int) ? _Sfi : -1); }
inline int getchar()
{ return sfgetc(sfstdin); }
inline int ungetc(int c, FILE* f)
{ return sfungetc(f,c); }
inline char* fgets(char* s, int n, FILE* f)
{ return _stdgets(f,s,n,0); }
inline char* gets(char* s)
{ return _stdgets(sfstdin,s,_SFSIZEOF(s),1); }
inline int vscanf(const char* f, va_list a)
{ return sfvscanf(sfstdin,f,a); }
inline int fflush(FILE* f)
{ return sfsync(f); }
inline int fseek(FILE* f, long o, int t)
{ return (sfseek(f,o,t) < 0L ? -1 : 0); }
inline void rewind(FILE* f)
{ (void) sfseek((f),0L,0); }
inline long ftell(FILE* f)
{ return sftell(f); }
inline int fgetpos(FILE* f, long* pos)
{ return (*pos = sftell(f)) >= 0 ? 0 : -1; }
inline int fsetpos(FILE* f, long* pos)
{ return (!pos || *pos < 0 || sfseek(f,*pos,0) != *pos) ? -1 : 0; }
inline void setbuf(FILE* f, char* b)
{ (void)sfsetbuf(f,b,(b) ? BUFSIZ : 0); }
inline int setbuffer(FILE* f, char* b, int n)
{ return sfsetbuf(f,b,n) ? 0 : -1; }
inline int setlinebuf(FILE* f)
{ return sfset(f,SF_LINE,1); }
inline int fileno(FILE* f)
{ return sffileno(f); }
inline int feof(FILE* f)
{ return sfeof(f); }
inline int ferror(FILE* f)
{ return sferror(f); }
inline void clearerr(FILE* f)
{ (void)(sfclrerr(f),sfclrlock(f)); }
#else
#define fopen(f,m) sfopen((Sfio_t*)0,(f),(m))
#define freopen(f,m,p) sfopen((p),(f),(m))
#define popen(cmd,m) sfpopen((Sfio_t*)0,(cmd),(m))
#define tmpfile() sftmp(SF_BUFSIZE)
#define fclose(f) sfclose(f)
#define pclose(f) sfclose(f)
#define fwrite(p,s,n,f) ((_Sfi = sfwrite((f),(p),(s)*(n))) <= 0 ? _Sfi : _Sfi/(s))
#define fputc(c,f) sfputc((f),(c))
#define putc(c,f) sfputc((f),(c))
#define putw(w,f) (_Sfi = (int)(w), sfwrite((f),&_Sfi,sizeof(int)) <= 0 ? 1 : 0)
#define putchar(c) sfputc(sfstdout,(c))
#define fputs(s,f) sfputr((f),(s),-1)
#define puts(s) sfputr(sfstdout,(s),'\n')
#define vprintf(fmt,a) sfvprintf(sfstdout,(fmt),(a))
#define _doprnt(fmt,a,f) sfvprintf((f),(fmt),(a))
#define fread(p,s,n,f) ((_Sfi = sfread((f),(p),(s)*(n))) <= 0 ? _Sfi : _Sfi/(s))
#define fgetc(f) sfgetc(f)
#define getc(f) sfgetc(f)
#define getw(f) (sfread((f),&_Sfi,sizeof(int)) == sizeof(int) ? _Sfi : -1)
#define getchar() sfgetc(sfstdin)
#define ungetc(c,f) sfungetc((f),(c))
#define fgets(s,n,f) _stdgets((f),(s),(n),0)
#define gets(s) _stdgets(sfstdin,(s),_SFSIZEOF(s),1)
#define vscanf(fmt,a) sfvscanf(sfstdin,(fmt),(a))
#define fflush(f) sfsync(f)
#define fseek(f,o,t) (sfseek((f),(o),(t)) < 0L ? -1 : 0)
#define rewind(f) sfseek((f),0L,0)
#define ftell(f) sftell(f)
#define fgetpos(f,pos) ((*(pos) = sftell(f)) >= 0 ? 0 : -1)
#define fsetpos(f,pos) (sfseek(f,*(pos),0) != (*pos) ? -1 : 0)
#define setbuf(f,b) (void)sfsetbuf((f),(b),(b) ? BUFSIZ : 0)
#define setbuffer(f,b,n) (sfsetbuf((f),(b),(n)) ? 0 : -1)
#define setlinebuf(f) sfset((f),SF_LINE,1)
#define fileno(f) sffileno(f)
#define feof(f) sfeof(f)
#define ferror(f) sferror(f)
#define clearerr(f) (void)(sfclrerr(f),sfclrlock(f))
#endif
#endif /* _SFSTDIO_H */

View File

@@ -0,0 +1,112 @@
/* $XConsortium: stk.h /main/2 1996/05/08 19:44:00 drk $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* David Korn
* AT&T Bell Laboratories
*
* Interface definitions for a stack-like storage library
*
*/
#ifndef _STK_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _STK_H
#include <sfio.h>
#if _DLL_INDIRECT_DATA && !_DLL
#define _Stk_data (*_Stak_data)
#else
#define _Stk_data _Stak_data
#endif
extern __MANGLE__ Sfio_t _Stk_data;
#define stkstd (&_Stk_data)
#define Stk_t Sfio_t
#define STK_SMALL 1 /* argument to stkopen */
#define stkptr(sp,n) ((char*)((sp)->data)+(n))
#define stktell(sp) ((sp)->next-(sp)->data)
#define stkseek(sp,n) ((n)==0?(char*)((sp)->next=(sp)->data):_stkseek(sp,n))
extern __MANGLE__ Stk_t* stkopen __PROTO__((int));
extern __MANGLE__ Stk_t* stkinstall __PROTO__((Stk_t*, char*(*)(int)));
extern __MANGLE__ int stkclose __PROTO__((Stk_t*));
extern __MANGLE__ int stklink __PROTO__((Stk_t*));
extern __MANGLE__ char* stkalloc __PROTO__((Stk_t*, unsigned));
extern __MANGLE__ char* stkcopy __PROTO__((Stk_t*,const char*));
extern __MANGLE__ char* stkset __PROTO__((Stk_t*, char*, unsigned));
extern __MANGLE__ char* _stkseek __PROTO__((Stk_t*, unsigned));
extern __MANGLE__ char* stkfreeze __PROTO__((Stk_t*, unsigned));
#endif

View File

@@ -0,0 +1,92 @@
/* $XConsortium: swap.h /main/3 1995/11/01 17:40:40 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Glenn Fowler
* AT&T Bell Laboratories
*
* integral representation conversion support definitions
* supports sizeof(integral_type)<=sizeof(int_max)
*/
#ifndef _SWAP_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _SWAP_H
#include <int.h>
#define SWAP_MAX 8
extern __MANGLE__ __V_* swapmem __PROTO__((int, const __V_*, __V_*, size_t));
extern __MANGLE__ int_max swapget __PROTO__((int, const __V_*, int));
extern __MANGLE__ __V_* swapput __PROTO__((int, __V_*, int, int_max));
extern __MANGLE__ int swapop __PROTO__((const __V_*, const __V_*, int));
#endif

View File

@@ -0,0 +1,164 @@
/* $XConsortium: tar.h /main/3 1995/11/01 17:40:52 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Standard Archive Format
* USTAR - Uniform Standard Tape ARchive
*/
#ifndef _TAR_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _TAR_H
#define TBLOCK 512
#define NAMSIZ 100
#define PFXSIZ 155
#define TMODLEN 8
#define TUIDLEN 8
#define TGIDLEN 8
#define TSIZLEN 12
#define TMTMLEN 12
#define TCKSLEN 8
#define TMAGIC "ustar" /* ustar and a null */
#define TMAGLEN 6
#define TVERSION "00" /* 00 and no null */
#define TVERSLEN 2
#define TUNMLEN 32
#define TGNMLEN 32
#define TDEVLEN 8
/*
* values used in typeflag field
*/
#define REGTYPE '0' /* regular file */
#define AREGTYPE 0 /* alternate REGTYPE */
#define LNKTYPE '1' /* hard link */
#define SYMTYPE '2' /* soft link */
#define CHRTYPE '3' /* character special */
#define BLKTYPE '4' /* block special */
#define DIRTYPE '5' /* directory */
#define FIFOTYPE '6' /* FIFO special */
#define CONTYPE '7' /* reserved */
#define SOKTYPE '8' /* socket -- reserved */
#define VERTYPE 'V' /* version -- reserved */
#define EXTTYPE 'x' /* extended header -- reserved */
/*
* bits used in mode field
*/
#define TSUID 04000 /* set uid on exec */
#define TSGID 02000 /* set gid on exec */
#define TSVTX 01000 /* sticky bit -- reserved */
/*
* file permissions
*/
#define TUREAD 00400 /* read by owner */
#define TUWRITE 00200 /* write by owner */
#define TUEXEC 00100 /* execute by owner */
#define TGREAD 00040 /* read by group */
#define TGWRITE 00020 /* execute by group */
#define TGEXEC 00010 /* write by group */
#define TOREAD 00004 /* read by other */
#define TOWRITE 00002 /* write by other */
#define TOEXEC 00001 /* execute by other */
struct header
{
char name[NAMSIZ];
char mode[TMODLEN];
char uid[TUIDLEN];
char gid[TGIDLEN];
char size[TSIZLEN];
char mtime[TMTMLEN];
char chksum[TCKSLEN];
char typeflag;
char linkname[NAMSIZ];
char magic[TMAGLEN];
char version[TVERSLEN];
char uname[TUNMLEN];
char gname[TGNMLEN];
char devmajor[TDEVLEN];
char devminor[TDEVLEN];
char prefix[PFXSIZ];
};
union hblock
{
char dummy[TBLOCK];
struct header dbuf;
};
#endif

View File

@@ -0,0 +1,115 @@
/* $XConsortium: times.h /main/3 1995/11/01 17:41:05 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Glenn Fowler
* AT&T Bell Laboratories
*
* -last clock_t,time_t interface definitions plus
*
* <ast.h>
* <time.h>
* <sys/time.h>
* <sys/times.h>
*/
#ifndef _TIMES_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _TIMES_H
#if defined(__STDPP__directive) && defined(__STDPP__note)
#if !noticed(clock_t)
__STDPP__directive pragma pp:note clock_t
#endif
#if !noticed(time_t)
__STDPP__directive pragma pp:note time_t
#endif
#endif
#include <ast.h>
#undef _TIMES_H
#include <ast_time.h>
#ifndef _TIMES_H
#define _TIMES_H
#endif
#if defined(__STDPP__directive) && defined(__STDPP__note)
#if !noticed(clock_t)
typedef unsigned long clock_t;
#endif
#if !noticed(time_t)
typedef unsigned long time_t;
#endif
#endif
extern __MANGLE__ int touch __PROTO__((const char*, time_t, time_t, int));
#endif

View File

@@ -0,0 +1,186 @@
/* $XConsortium: tm.h /main/3 1995/11/01 17:41:18 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Glenn Fowler
* AT&T Bell Laboratories
*
* time conversion support definitions
*/
#ifndef _TM_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _TM_H
#if _DLL_INDIRECT_DATA && !_DLL
#define tm_data (*_tm_data_)
#define tm_info (*_tm_info_)
#else
#define tm_data _tm_data_
#define tm_info _tm_info_
#endif
#include <ast.h>
#include <times.h>
#define tmset(z) do{if(!tm_info.zone||(z)&&tm_info.zone!=(z)||!(z)&&tm_info.zone!=tm_info.local)tminit(z);}while(0)
#define TM_ADJUST (1<<0) /* local doesn't do leap secs */
#define TM_LEAP (1<<1) /* do leap seconds */
#define TM_UTC (1<<2) /* universal coordinated ref */
#define TM_DST (-60) /* default minutes for DST */
#define TM_LOCALZONE (25 * 60) /* use local time zone offset */
#define TM_MAXLEAP 1 /* max leap secs per leap */
/*
* these indices must agree with tm_dform[]
*/
#define TM_MONTH_3 0
#define TM_MONTH 12
#define TM_DAY_3 24
#define TM_DAY 31
#define TM_TIME 38
#define TM_DATE 39
#define TM_DEFAULT 40
#define TM_MERIDIAN 41
#define TM_UT 43
#define TM_DT 47
#define TM_SUFFIXES 51
#define TM_PARTS 55
#define TM_HOURS 62
#define TM_DAYS 66
#define TM_LAST 69
#define TM_THIS 72
#define TM_NEXT 75
#define TM_EXACT 78
#define TM_NOISE 81
#define TM_NFORM 85
typedef struct /* leap second info */
{
time_t time; /* the leap second event */
int total; /* inclusive total since epoch */
} Tm_leap_t;
typedef struct /* time zone info */
{
char* type; /* type name */
char* standard; /* standard time name */
char* daylight; /* daylight or summertime name */
short west; /* minutes west of GMT */
short dst; /* add to tz.west for DST */
} Tm_zone_t;
typedef struct /* tm library readonly data */
{
char** format; /* default TM_* format strings */
char* lex; /* format lex type classes */
char* digit; /* output digits */
short* days; /* days in month i */
short* sum; /* days in months before i */
Tm_leap_t* leap; /* leap second table */
Tm_zone_t* zone; /* alternate timezone table */
} Tm_data_t;
typedef struct /* tm library global info */
{
char* deformat; /* TM_DEFAULT override */
int flags; /* flags */
char** format; /* current format strings */
Tm_zone_t* date; /* timezone from last tmdate() */
Tm_zone_t* local; /* local timezone */
Tm_zone_t* zone; /* current timezone */
} Tm_info_t;
typedef struct tm Tm_t;
extern __MANGLE__ Tm_data_t tm_data;
extern __MANGLE__ Tm_info_t tm_info;
extern __MANGLE__ time_t tmdate __PROTO__((const char*, char**, time_t*));
extern __MANGLE__ Tm_t* tmfix __PROTO__((Tm_t*));
extern __MANGLE__ char* tmfmt __PROTO__((char*, size_t, const char*, time_t*));
extern __MANGLE__ char* tmform __PROTO__((char*, const char*, time_t*));
extern __MANGLE__ int tmgoff __PROTO__((const char*, char**, int));
extern __MANGLE__ void tminit __PROTO__((Tm_zone_t*));
extern __MANGLE__ time_t tmleap __PROTO__((time_t*));
extern __MANGLE__ int tmlex __PROTO__((const char*, char**, char**, int, char**, int));
extern __MANGLE__ Tm_t* tmmake __PROTO__((time_t*));
extern __MANGLE__ char* tmpoff __PROTO__((char*, const char*, int, int));
extern __MANGLE__ time_t tmtime __PROTO__((Tm_t*, int));
extern __MANGLE__ Tm_zone_t* tmtype __PROTO__((const char*, char**));
extern __MANGLE__ int tmword __PROTO__((const char*, char**, const char*, char**, int));
extern __MANGLE__ Tm_zone_t* tmzone __PROTO__((const char*, char**, const char*, int*));
#endif

View File

@@ -0,0 +1,90 @@
/* $XConsortium: tok.h /main/2 1996/05/08 19:44:16 drk $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Glenn Fowler
* AT&T Bell Laboratories
*
* token stream interface definitions
*/
#ifndef _TOK_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _TOK_H
#include <ast.h>
extern __MANGLE__ Sfio_t* tokline __PROTO__((const char*, int, int*));
extern __MANGLE__ int tokscan __PROTO__((char*, char**, const char*, ...));
extern __MANGLE__ char* tokopen __PROTO__((char*, int));
extern __MANGLE__ void tokclose __PROTO__((char*));
extern __MANGLE__ char* tokread __PROTO__((char*));
#endif

View File

@@ -0,0 +1,95 @@
/* $XConsortium: vdb.h /main/3 1995/11/01 17:41:44 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Glenn Fowler
* AT&T Bell Laboratories
*
* virtual db file directory entry constants
*/
#ifndef VDB_MAGIC
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define VDB_MAGIC "vdb"
#define VDB_DIRECTORY "DIRECTORY"
#define VDB_UNION "UNION"
#define VDB_DATE "DATE"
#define VDB_MODE "MODE"
#define VDB_DELIMITER ';'
#define VDB_IGNORE '_'
#define VDB_FIXED 10
#define VDB_LENGTH (sizeof(VDB_DIRECTORY)+2*(VDB_FIXED+1))
#define VDB_OFFSET (sizeof(VDB_DIRECTORY))
#define VDB_SIZE (VDB_OFFSET+VDB_FIXED+1)
#endif

View File

@@ -0,0 +1,88 @@
/* $XConsortium: vecargs.h /main/3 1995/11/01 17:41:56 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* Glenn Fowler
* AT&T Bell Laboratories
*
* vector argument interface definitions
*/
#ifndef _VECARGS_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _VECARGS_H
extern __MANGLE__ int vecargs __PROTO__((char**, int*, char***));
extern __MANGLE__ char** vecfile __PROTO__((const char*));
extern __MANGLE__ void vecfree __PROTO__((char**, int));
extern __MANGLE__ char** vecload __PROTO__((char*));
extern __MANGLE__ char** vecstring __PROTO__((const char*));
#endif

View File

@@ -0,0 +1,298 @@
/* $XConsortium: vmalloc.h /main/2 1996/05/08 19:44:30 drk $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
#ifndef _VMALLOC_H
#define _VMALLOC_H 1
/* Public header file for the virtual malloc package.
** If installation fails because "size_t" is not defined,
** look for the comments concerning "size_t" below.
**
** Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/94.
*/
#if _DLL_INDIRECT_DATA && !_DLL
#define _ADR_
#define _PTR_ *
#else
#define _ADR_ &
#define _PTR_
#endif
/* standardize conventions to include ANSI-C and C++ */
#ifndef __KPV__
#define __KPV__ 1
#ifndef __STD_C
#ifdef __STDC__
#define __STD_C 1
#else
#if __cplusplus
#define __STD_C 1
#else
#define __STD_C 0
#endif /*__cplusplus*/
#endif /*__STDC__*/
#endif /*__STD_C*/
#ifndef _BEGIN_EXTERNS_
#if __cplusplus
#define _BEGIN_EXTERNS_ extern "C" {
#define _END_EXTERNS_ }
#else
#define _BEGIN_EXTERNS_
#define _END_EXTERNS_
#endif
#endif /*_BEGIN_EXTERNS_*/
#ifndef _ARG_
#if __STD_C
#define _ARG_(x) x
#else
#define _ARG_(x) ()
#endif
#endif /*_ARG_*/
#ifndef Void_t
#if __STD_C
#define Void_t void
#else
#define Void_t char
#endif
#endif /*Void_t*/
#ifndef NIL
#define NIL(type) ((type)0)
#endif /*NIL*/
#endif /*__KPV__*/
/* The below #includes are to define the type "size_t". If it doesn't work,
** try to figure out what system header file defines "size_t" and include
** that. If none does, then uncomment the below "typedef" statement.
*/
#ifndef _AST_STD_H
#if __STD_C
#include <stddef.h>
#else
#include <sys/types.h> /* for UNIX systems */
#endif
/* typedef unsigned int size_t; */
#endif
typedef struct _vmalloc_s Vmalloc_t;
typedef struct _vmstat_s Vmstat_t;
typedef struct _vmdisc_s Vmdisc_t;
typedef struct _vmethod_s Vmethod_t;
typedef Void_t* (*Vmemory_f)_ARG_((Vmalloc_t*, Void_t*, size_t, size_t, Vmdisc_t*));
typedef int (*Vmexcept_f)_ARG_((Vmalloc_t*, int, Void_t*, Vmdisc_t*));
struct _vmstat_s
{ int n_busy; /* number of busy blocks */
int n_free; /* number of free blocks */
size_t s_busy; /* total amount of busy space */
size_t s_free; /* total amount of free space */
size_t m_busy; /* largest busy piece */
size_t m_free; /* largest free piece */
int n_seg; /* number of segments */
size_t extent; /* total size of region */
};
struct _vmdisc_s
{ Vmemory_f memoryf; /* memory manipulator */
Vmexcept_f exceptf; /* exception handler */
size_t round; /* rounding requirement */
};
struct _vmethod_s
{ Void_t* (*allocf)_ARG_((Vmalloc_t*,size_t));
Void_t* (*resizef)_ARG_((Vmalloc_t*,Void_t*,size_t,int));
int (*freef)_ARG_((Vmalloc_t*,Void_t*));
long (*addrf)_ARG_((Vmalloc_t*,Void_t*));
long (*sizef)_ARG_((Vmalloc_t*,Void_t*));
int (*compactf)_ARG_((Vmalloc_t*));
Void_t* (*alignf)_ARG_((Vmalloc_t*,size_t,size_t));
unsigned short meth;
};
struct _vmalloc_s
{ Vmethod_t meth; /* method for allocation */
#ifdef _VM_PRIVATE_
_VM_PRIVATE_
#endif
};
#define VM_TRUST 0000001 /* forgo some security checks */
#define VM_TRACE 0000002 /* generate trace */
#define VM_DBCHECK 0000004 /* check for boundary overwrite */
#define VM_DBABORT 0000010 /* abort on any warning */
#define VM_FLAGS 0000017 /* user-settable flags */
#define VM_MTBEST 0000100 /* Vmbest method */
#define VM_MTPOOL 0000200 /* Vmpool method */
#define VM_MTLAST 0000400 /* Vmlast method */
#define VM_MTDEBUG 0001000 /* Vmdebug method */
#define VM_MTPROFILE 0002000 /* Vmdebug method */
#define VM_METHODS 0003700 /* available allocation methods */
/* resize flags */
#define VM_RSCOPY 01 /* copy old contents */
#define VM_RSFREE 02 /* free old contents */
#define VM_RSZERO 04 /* set uncopied part to 0 */
/* exception types */
#define VM_OPEN 0 /* region being opened */
#define VM_CLOSE 1 /* region being closed */
#define VM_DCCHANGE 2 /* vmdisc() discipline change */
#define VM_NOMEM 3 /* can't obtain memory */
#define VM_BADADDR 4 /* bad addr in vmfree/vmresize */
#define Vmbest (_ADR_ _Vmbest)
#define Vmlast (_ADR_ _Vmlast)
#define Vmpool (_ADR_ _Vmpool)
#define Vmdebug (_ADR_ _Vmdebug)
#define Vmprofile (_ADR_ _Vmprofile)
#define Vmdcheap (_ADR_ _Vmdcheap)
#define Vmdcsbrk (_ADR_ _Vmdcsbrk)
#define Vmheap (_ADR_ _Vmheap)
#define Vmregion (_PTR_ _Vmregion)
_BEGIN_EXTERNS_ /* externally visible declarations */
extern Vmethod_t _PTR_ _Vmbest; /* best allocation */
extern Vmethod_t _PTR_ _Vmlast; /* last-block allocation */
extern Vmethod_t _PTR_ _Vmpool; /* pool allocation */
extern Vmethod_t _PTR_ _Vmdebug; /* allocation with debugging */
extern Vmethod_t _PTR_ _Vmprofile;/* profiling memory usage */
extern Vmdisc_t _PTR_ _Vmdcheap;/* heap discipline */
extern Vmdisc_t _PTR_ _Vmdcsbrk;/* sbrk discipline */
extern Vmalloc_t _PTR_ _Vmheap; /* heap region */
extern Vmalloc_t* Vmregion; /* current region */
extern Vmalloc_t* vmopen _ARG_(( Vmdisc_t*, Vmethod_t*, int ));
extern int vmclose _ARG_(( Vmalloc_t* ));
extern int vmclear _ARG_(( Vmalloc_t* ));
extern int vmcompact _ARG_(( Vmalloc_t* ));
extern Void_t* vmalloc _ARG_(( Vmalloc_t*, size_t ));
extern Void_t* vmalign _ARG_(( Vmalloc_t*, size_t, size_t ));
extern Void_t* vmresize _ARG_(( Vmalloc_t*, Void_t*, size_t, int ));
extern int vmfree _ARG_(( Vmalloc_t*, Void_t* ));
extern long vmaddr _ARG_(( Vmalloc_t*, Void_t* ));
extern long vmsize _ARG_(( Vmalloc_t*, Void_t* ));
extern Vmalloc_t* vmregion _ARG_(( Void_t* ));
extern Void_t* vmsegment _ARG_(( Vmalloc_t*, Void_t* ));
extern int vmset _ARG_(( Vmalloc_t*, int, int ));
extern Vmdisc_t* vmdisc _ARG_(( Vmalloc_t*, Vmdisc_t* ));
extern Void_t* vmdbwatch _ARG_(( Void_t* ));
extern int vmdbcheck _ARG_(( Vmalloc_t* ));
extern int vmprofile _ARG_(( Vmalloc_t*, int ));
extern int vmtrace _ARG_(( int ));
extern int vmstat _ARG_((Vmalloc_t*, Vmstat_t*));
extern char* vmstrdup _ARG_((Vmalloc_t*, const char*));
#ifndef _AST_STD_H
extern Void_t* malloc _ARG_(( size_t ));
extern Void_t* realloc _ARG_(( Void_t*, size_t ));
extern void free _ARG_(( Void_t* ));
extern void cfree _ARG_(( Void_t* ));
extern Void_t* calloc _ARG_(( size_t, size_t ));
extern Void_t* memalign _ARG_(( size_t, size_t ));
extern Void_t* valloc _ARG_(( size_t ));
#endif
_END_EXTERNS_
#define vmnewof(v,p,t,n,x) ((t*)vmresize(v,p,sizeof(t)*(n)+(x),VM_RSCOPY|VM_RSFREE|VM_RSZERO))
#define vmoldof(v,p,t,n,x) ((t*)vmresize(v,p,sizeof(t)*(n)+(x),VM_RSFREE))
#define vmaddr(vm,addr) ((*((vm)->meth.addrf))((vm),(Void_t*)(addr)) )
#define vmsize(vm,addr) ((*((vm)->meth.sizef))((vm),(Void_t*)(addr)) )
#define vmcompact(vm) ((*((vm)->meth.compactf))((vm)) )
/* enable recording of where a call originates from */
#ifdef VMFL
#ifdef __FILE__
#ifdef __LINE__
#define _Vmfile (_PTR_ _Vm_file)
#define _Vmline (_PTR_ _Vm_line)
_BEGIN_EXTERNS_
extern char* _Vmfile;
extern int _Vmline;
extern Void_t* _vmflmalloc _ARG_((size_t, char*, int));
extern Void_t* _vmflcalloc _ARG_((size_t, size_t, char*, int));
extern Void_t* _vmflmemalign _ARG_((size_t, size_t, char*, int));
extern Void_t* _vmflvalloc _ARG_((size_t, char*, int));
extern Void_t* _vmflrealloc _ARG_((Void_t*, size_t, char*, int));
extern void _vmflfree _ARG_((Void_t*, char*, int));
_END_EXTERNS_
#define _VMFL_(vm) (_Vmfile=__FILE__, _Vmline=__LINE__)
#define vmalloc(vm,sz) (_VMFL_(vm), \
(*((vm)->meth.allocf))((vm),(sz)) )
#define vmresize(vm,d,sz,type) (_VMFL_(vm), \
(*((vm)->meth.resizef))((vm),(Void_t*)(d),(sz),(type)) )
#define vmfree(vm,d) (_VMFL_(vm), \
(*((vm)->meth.freef))((vm),(Void_t*)(d)) )
#define vmalign(vm,sz,align) (_VMFL_(vm), \
(*((vm)->meth.alignf))((vm),(sz),(align)) )
#define malloc(s) _vmflmalloc((size_t)(s), __FILE__, __LINE__)
#define realloc(d,s) _vmflrealloc((Void_t*)(d),(size_t)(s),__FILE__,__LINE__)
#define calloc(n,s) _vmflcalloc((size_t)n, (size_t)(s), __FILE__, __LINE__)
#define free(d) _vmflfree((Void_t*)(d),__FILE__,__LINE__)
#define cfree(d) _vmflfree((Void_t*)(d),__FILE__,__LINE__)
#define memalign(a,s) _vmflmemalign((size_t)(a),(size_t)(s),__FILE__,__LINE__)
#define valloc(s) _vmflvalloc((size_t)(s), __FILE__, __LINE__)
#endif /*__LINE__*/
#endif /*__FILE__*/
#endif /*VMFL*/
/* non-debugging/profiling allocation calls */
#ifndef vmalloc
#define vmalloc(vm,sz) ((*((vm)->meth.allocf))((vm),(sz)) )
#endif
#ifndef vmresize
#define vmresize(vm,d,sz,flags) ((*((vm)->meth.resizef))((vm),(Void_t*)(d),(sz),(flags)) )
#endif
#ifndef vmfree
#define vmfree(vm,d) ((*((vm)->meth.freef))((vm),(Void_t*)(d)) )
#endif
#ifndef vmalign
#define vmalign(vm,sz,align) ((*((vm)->meth.alignf))((vm),(sz),(align)) )
#endif
#endif /* _VMALLOC_H */

View File

@@ -0,0 +1,147 @@
/* $XConsortium: wait.h /main/3 1995/11/01 17:42:20 rswiston $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
/*
* ast POSIX wait/exit support
*/
#ifndef _WAIT_H
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#define _WAIT_H
#include <ast.h>
#include <ast_wait.h>
#if _sys_wait
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide wait waitpid
#else
#define wait ______wait
#define waitpid ______waitpid
#endif
#include <sys/wait.h>
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide wait waitpid
#else
#undef wait
#undef waitpid
#endif
#endif
#ifndef WNOHANG
#define WNOHANG 1
#endif
#ifndef WUNTRACED
#define WUNTRACED 2
#endif
#if !_ok_wif
#undef WIFEXITED
#undef WEXITSTATUS
#undef WIFSIGNALED
#undef WTERMSIG
#undef WIFSTOPPED
#undef WSTOPSIG
#undef WTERMCORE
#endif
#ifndef WIFEXITED
#define WIFEXITED(x) (!((x)&((1<<(EXIT_BITS-1))-1)))
#endif
#ifndef WEXITSTATUS
#define WEXITSTATUS(x) (((x)>>EXIT_BITS)&((1<<EXIT_BITS)-1))
#endif
#ifndef WIFSIGNALED
#define WIFSIGNALED(x) (((x)&((1<<(EXIT_BITS-1))-1))!=0)
#endif
#ifndef WTERMSIG
#define WTERMSIG(x) ((x)&((1<<(EXIT_BITS-1))-1))
#endif
#ifndef WIFSTOPPED
#define WIFSTOPPED(x) (((x)&((1<<EXIT_BITS)-1))==((1<<(EXIT_BITS-1))-1))
#endif
#ifndef WSTOPSIG
#define WSTOPSIG(x) WEXITSTATUS(x)
#endif
#ifndef WTERMCORE
#define WTERMCORE(x) ((x)&(1<<(EXIT_BITS-1)))
#endif
extern __MANGLE__ pid_t wait __PROTO__((int*));
extern __MANGLE__ pid_t waitpid __PROTO__((pid_t, int*, int));
#endif