sfhdr.h revision 7c2fbfb345896881c631598ee3852ce9ce33fb07
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews/***********************************************************************
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews* This software is part of the ast package *
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews* Copyright (c) 1985-2008 AT&T Intellectual Property *
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews* and is licensed under the *
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews* Common Public License, Version 1.0 *
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews* by AT&T Intellectual Property *
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews* A copy of the License is available at *
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews* http://www.opensource.org/licenses/cpl1.0.txt *
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews* Information and Software Systems Research *
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews* AT&T Research *
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews* Florham Park NJ *
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews* Glenn Fowler <gsf@research.att.com> *
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews* David Korn <dgk@research.att.com> *
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews* Phong Vo <kpv@research.att.com> *
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews***********************************************************************/
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews/* Internal definitions for sfio.
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews** Written by Kiem-Phong Vo
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews/* define va_list, etc. before including sfio_t.h (sfio.h) */
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews/* some systems don't know large files */
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews#if defined(_NO_LARGEFILE64_SOURCE) || _mips == 2 /* || __hppa */
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews#if !_NO_LARGEFILE64_SOURCE && _typ_off64_t && _lib_lseek64 && _lib_stat64
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews#define _LARGEFILE64_SOURCE 1 /* enabling the *64 stuff */
#if _hdr_stdarg
#include <stdarg.h>
#include <varargs.h>
#if !__STD_C
#include "sfio_t.h"
/* note that the macro vt_threaded has effect on vthread.h */
#include <vthread.h>
#if _PACKAGE_ast
#include <ast.h>
#include <ast_time.h>
#include <ast_tty.h>
#include <ls.h>
#if _SFBINARY_H
#if _hdr_stdlib
#include <stdlib.h>
#if _hdr_string
#include <string.h>
#if _hdr_time
#include <time.h>
#if _sys_time
#if _sys_stat
#if _hdr_stat
#include <stat.h>
#ifndef _sys_stat
#ifndef _sys_stat
#define _sys_stat 0
#include <fcntl.h>
#ifndef F_SETFD
#ifndef FIOCLEX
#if _hdr_filio
#include <filio.h>
#if _sys_filio
#if _hdr_unistd
#include <unistd.h>
#if !_mmap_worthy
#if _hdr_mman
#include <mman.h>
#if _sys_mman
#if _typ_off64_t
#if _lib_lseek64
#if _lib_stat64
#if _lib_fstat64
#if _lib_mmap64
#if _lib_munmap64
#if _lib_open64
#if _lib_creat64
#if _lib_close64
#if _lib_ftruncate64
#if _lib_remove
#if !_mmap_worthy
#include <errno.h>
#include <ctype.h>
#if _PACKAGE_ast
#include <wchar.h>
#include <wchar.h>
#include <wchar.h>
#ifdef MB_CUR_MAX
#if !_has_multibyte
#if vt_threaded
if(_Sfnotify) \
{ if(_Sfnotify) \
#define SF_MTSAFE 0
#define POOLMTXLOCK(p)
#define POOLMTXUNLOCK(p)
#define POOLMTXENTER(p)
#define POOLMTXRETURN(p,v) { return(v); }
#if _lib_select
#if _lib_poll
#include <poll.h>
#if _lib_poll_fd_1
#if _stream_peek
#include <stropts.h>
#if _socket_peek
#ifndef X_OK
#if _hdr_vfork
#include <vfork.h>
#if _sys_vfork
#if __STD_C
#define NOTUSED(x) (void)(x)
#if _has_multibyte
#define SFWCSET(f)
#define SFWCGET(f,v)
/* bits for the mode field, SF_INIT defined in sfio_t.h */
#ifdef DEBUG
#define ASSERT(p)
#define NIL(t) ((t)0)
#define reg register
#ifndef uchar
#define uchar unsigned char
#ifndef ulong
#define ulong unsigned long
#ifndef uint
#define uint unsigned int
#ifndef ushort
#define ushort unsigned short
#ifndef S_IFMT
#define S_IFMT 0
#ifndef S_IFDIR
#define S_IFDIR 0
#ifndef S_IFREG
#define S_IFREG 0
#ifndef S_IFCHR
#define S_IFCHR 0
#ifndef S_IFIFO
#define S_IFIFO 0
#ifndef S_ISDIR
#ifndef S_ISREG
#ifndef S_ISCHR
#ifndef S_ISFIFO
# ifdef S_IFIFO
# define S_ISFIFO(m) (0)
#ifdef S_IRUSR
#ifdef F_SETFD
# ifndef FD_CLOEXEC
# ifdef FIOCLEX
#ifndef EINTR
#ifndef EBADF
#ifndef EAGAIN
#ifndef ENOMEM
#ifndef EINVAL
#ifndef ESPIPE
#include "lclib.h"
do if (*(dp) == 0) { \
#include <locale.h>
if(*(decimal) == 0) \
#if !defined(SFSETLOCALE)
struct _sfpool_s
struct _sfrsrv_s
struct _sfproc_s
#define FP_WIDTH 0
{ int i, *ip;
long l, *lp;
short h, *hp;
#if _has_multibyte
char c, *s, **sp;
} Argv_t;
struct _fmt_s
struct _fmtpos_s
#ifndef CHAR_BIT
/* format flags&types, must coexist with those in sfio.h */
typedef struct _sfextern_s
int sf_exiting;
int sf_done;
} Sfextern_t;
#ifndef MAP_VARIABLE
#define MAP_VARIABLE 0
#ifndef _mmap_fixed
#define _mmap_fixed 0
#define SFMMSEQON(f,a,s) \
#define SFMMSEQOFF(f,a,s) \
#define SFMMSEQON(f,a,s)
#define SFMMSEQOFF(f,a,s)
((v) || (f)->extent < 0 || \
#define SFOPEN(f,l) (void)((l) ? 0 : \
{ Sfdisc_t* d; \
if(!(dc)) \
if(d) (dc) = d; \
if(s > (f)->here) \
#ifdef O_CREAT
#define _has_oflags 0
#ifndef O_RDONLY
#define O_RDONLY 000
#ifndef O_WRONLY
#ifndef O_RDWR
#ifndef O_BINARY
#define O_BINARY 000
#ifndef O_TEXT
#define O_TEXT 000
#ifndef O_TEMPORARY
#define O_TEMPORARY 000
#if _PACKAGE_ast
#if !_ast_fltmax_double
struct _sfieee_s
typedef struct _sftab_
} Sftab_t;
#define min(x,y) ((x) < (y) ? (x) : (y))
#define max(x,y) ((x) > (y) ? (x) : (y))
#if _PACKAGE_ast
#define MEMSET(s,c,n) \
#define extern __EXPORT__
#define extern extern __IMPORT__
#undef extern
#ifndef errno
extern int errno;
#ifndef frexpl
#if !__STDC__
#ifndef ldexpl
#if !__STDC__
#if !_PACKAGE_ast
#ifndef memcpy
#if !defined(strtod)
#if !defined(remove)
#if !_hdr_unistd
#if !defined(fork)
#if _lib_unlink
#if _lib_poll
#if _lib_poll_fd_1