io.h (90792) | io.h (94334) |
---|---|
1/* | 1/* |
2 * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. | 2 * Copyright (c) 2000-2002 Sendmail, Inc. and its suppliers. |
3 * All rights reserved. 4 * Copyright (c) 1990 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * Chris Torek. 9 * 10 * By using this file, you agree to the terms and conditions set 11 * forth in the LICENSE file which can be found at the top level of 12 * the sendmail distribution. 13 * | 3 * All rights reserved. 4 * Copyright (c) 1990 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * Chris Torek. 9 * 10 * By using this file, you agree to the terms and conditions set 11 * forth in the LICENSE file which can be found at the top level of 12 * the sendmail distribution. 13 * |
14 * $Id: io.h,v 1.19 2001/07/10 21:56:46 gshapiro Exp $ | 14 * $Id: io.h,v 1.23 2002/02/23 19:32:17 gshapiro Exp $ |
15 */ 16 17/*- 18 * @(#)stdio.h 5.17 (Berkeley) 6/3/91 19 */ 20 21#ifndef SM_IO_H 22#define SM_IO_H --- 18 unchanged lines hidden (view full) --- 41/* flags for info what's with different types (exposed) */ 42#define SM_IO_WHAT_MODE 1 43#define SM_IO_WHAT_VECTORS 2 44#define SM_IO_WHAT_FD 3 45#define SM_IO_WHAT_TYPE 4 46#define SM_IO_WHAT_ISTYPE 5 47#define SM_IO_IS_READABLE 6 48#define SM_IO_WHAT_TIMEOUT 7 | 15 */ 16 17/*- 18 * @(#)stdio.h 5.17 (Berkeley) 6/3/91 19 */ 20 21#ifndef SM_IO_H 22#define SM_IO_H --- 18 unchanged lines hidden (view full) --- 41/* flags for info what's with different types (exposed) */ 42#define SM_IO_WHAT_MODE 1 43#define SM_IO_WHAT_VECTORS 2 44#define SM_IO_WHAT_FD 3 45#define SM_IO_WHAT_TYPE 4 46#define SM_IO_WHAT_ISTYPE 5 47#define SM_IO_IS_READABLE 6 48#define SM_IO_WHAT_TIMEOUT 7 |
49#define SM_IO_WHAT_SIZE 8 |
|
49 50/* info flags (exposed) */ 51#define SM_IO_FTYPE_CREATE 1 52#define SM_IO_FTYPE_MODIFY 2 53#define SM_IO_FTYPE_DELETE 3 54 55#define SM_IO_SL_PRIO 1 56 --- 49 unchanged lines hidden (view full) --- 106 int f_ival; 107 108 /* operations */ 109 int (*f_close) __P((SM_FILE_T *)); 110 ssize_t (*f_read) __P((SM_FILE_T *, char *, size_t)); 111 off_t (*f_seek) __P((SM_FILE_T *, off_t, int)); 112 ssize_t (*f_write) __P((SM_FILE_T *, const char *, size_t)); 113 int (*f_open) __P((SM_FILE_T *, const void *, int, | 50 51/* info flags (exposed) */ 52#define SM_IO_FTYPE_CREATE 1 53#define SM_IO_FTYPE_MODIFY 2 54#define SM_IO_FTYPE_DELETE 3 55 56#define SM_IO_SL_PRIO 1 57 --- 49 unchanged lines hidden (view full) --- 107 int f_ival; 108 109 /* operations */ 110 int (*f_close) __P((SM_FILE_T *)); 111 ssize_t (*f_read) __P((SM_FILE_T *, char *, size_t)); 112 off_t (*f_seek) __P((SM_FILE_T *, off_t, int)); 113 ssize_t (*f_write) __P((SM_FILE_T *, const char *, size_t)); 114 int (*f_open) __P((SM_FILE_T *, const void *, int, |
114 const void *)); | 115 const void *)); |
115 int (*f_setinfo) __P((SM_FILE_T *, int , void *)); 116 int (*f_getinfo) __P((SM_FILE_T *, int , void *)); 117 int f_timeout; 118 int f_timeoutstate; /* either blocking or non-blocking */ 119 char *f_type; /* for by-type lookups */ | 116 int (*f_setinfo) __P((SM_FILE_T *, int , void *)); 117 int (*f_getinfo) __P((SM_FILE_T *, int , void *)); 118 int f_timeout; 119 int f_timeoutstate; /* either blocking or non-blocking */ 120 char *f_type; /* for by-type lookups */ |
120 void *f_self; /* self for reference */ | |
121 struct sm_file *f_flushfp; /* flush this before reading parent */ 122 struct sm_file *f_modefp; /* sync mode with this fp */ 123 124 /* separate buffer for long sequences of ungetc() */ 125 struct smbuf f_ub; /* ungetc buffer */ 126 unsigned char *f_up; /* saved f_p when f_p is doing ungetc */ 127 int f_ur; /* saved f_r when f_r is counting ungetc */ 128 129 /* tricks to meet minimum requirements even when malloc() fails */ 130 unsigned char f_ubuf[3]; /* guarantee an ungetc() buffer */ 131 unsigned char f_nbuf[1]; /* guarantee a getc() buffer */ 132 | 121 struct sm_file *f_flushfp; /* flush this before reading parent */ 122 struct sm_file *f_modefp; /* sync mode with this fp */ 123 124 /* separate buffer for long sequences of ungetc() */ 125 struct smbuf f_ub; /* ungetc buffer */ 126 unsigned char *f_up; /* saved f_p when f_p is doing ungetc */ 127 int f_ur; /* saved f_r when f_r is counting ungetc */ 128 129 /* tricks to meet minimum requirements even when malloc() fails */ 130 unsigned char f_ubuf[3]; /* guarantee an ungetc() buffer */ 131 unsigned char f_nbuf[1]; /* guarantee a getc() buffer */ 132 |
133 /* separate buffer for fgetln() when line crosses buffer boundary */ 134 struct smbuf f_lb; /* buffer for fgetln() */ 135 | |
136 /* Unix stdio files get aligned to block boundaries on fseek() */ 137 int f_blksize; /* stat.st_blksize (may be != bf.size) */ 138 off_t f_lseekoff; /* current lseek offset */ 139 int f_dup_cnt; /* count file dup'd */ 140}; 141 142__BEGIN_DECLS 143extern SM_FILE_T SmIoF[]; --- 75 unchanged lines hidden (view full) --- 219#define SMMBF 0x000200 /* buf is from malloc */ 220#define SMAPP 0x000400 /* fdopen()ed in append mode */ 221#define SMSTR 0x000800 /* this is an snprintf string */ 222#define SMOPT 0x001000 /* do fseek() optimisation */ 223#define SMNPT 0x002000 /* do not do fseek() optimisation */ 224#define SMOFF 0x004000 /* set iff offset is in fact correct */ 225#define SMALC 0x010000 /* allocate string space dynamically */ 226 | 133 /* Unix stdio files get aligned to block boundaries on fseek() */ 134 int f_blksize; /* stat.st_blksize (may be != bf.size) */ 135 off_t f_lseekoff; /* current lseek offset */ 136 int f_dup_cnt; /* count file dup'd */ 137}; 138 139__BEGIN_DECLS 140extern SM_FILE_T SmIoF[]; --- 75 unchanged lines hidden (view full) --- 216#define SMMBF 0x000200 /* buf is from malloc */ 217#define SMAPP 0x000400 /* fdopen()ed in append mode */ 218#define SMSTR 0x000800 /* this is an snprintf string */ 219#define SMOPT 0x001000 /* do fseek() optimisation */ 220#define SMNPT 0x002000 /* do not do fseek() optimisation */ 221#define SMOFF 0x004000 /* set iff offset is in fact correct */ 222#define SMALC 0x010000 /* allocate string space dynamically */ 223 |
227#define SMACCESSMASK 0x0070 228#define SMMODEMASK 0x011C | 224#define SMMODEMASK 0x0070 /* read/write mode */ |
229 230/* defines for timeout constants */ 231#define SM_TIME_IMMEDIATE (0) 232#define SM_TIME_FOREVER (-1) 233#define SM_TIME_DEFAULT (-2) 234 235/* timeout state for blocking */ 236#define SM_TIME_BLOCK (0) /* XXX just bool? */ --- 146 unchanged lines hidden --- | 225 226/* defines for timeout constants */ 227#define SM_TIME_IMMEDIATE (0) 228#define SM_TIME_FOREVER (-1) 229#define SM_TIME_DEFAULT (-2) 230 231/* timeout state for blocking */ 232#define SM_TIME_BLOCK (0) /* XXX just bool? */ --- 146 unchanged lines hidden --- |