1N/A * Copyright (c) 2000-2002, 2004 Sendmail, Inc. and its suppliers. 1N/A * All rights reserved. 1N/A * By using this file, you agree to the terms and conditions set 1N/A * forth in the LICENSE file which can be found at the top level of 1N/A * the sendmail distribution. 1N/A#
pragma ident "%Z%%M% %I% %E% SMI" 1N/A** This is a file type which implements a layer on top of the system 1N/A** stdio. fp->f_cookie is the FILE* of stdio. The cookie may be 1N/A** "bound late" because of the manner which Linux implements stdio. 1N/A** When binding late (when fp->f_cookie==NULL) then the value of 1N/A** fp->f_ival is used (0, 1 or 2) to map to stdio's stdin, stdout or 1N/A** SM_STDIOOPEN -- open a file to system stdio implementation 1N/A** fp -- file pointer assign for this open 1N/A** info -- info about file to open 1N/A** flags -- indicating method of opening 1N/A#
endif /* SM_IO_BINARY != 0 */ 1N/A** SETUP -- assign file type cookie when not already assigned 1N/A** fp - the file pointer to get the cookie assigned 1N/A** SM_STDIOREAD -- read from the file 1N/A** fp -- the file pointer 1N/A** buf -- location to place the read data 1N/A** n - number of bytes to read 1N/A** result from fread(). 1N/A** SM_STDIOWRITE -- write to the file 1N/A** fp -- the file pointer 1N/A** buf -- location of data to write 1N/A** n - number of bytes to write 1N/A** result from fwrite(). 1N/A** SM_STDIOSEEK -- set position within file 1N/A** fp -- the file pointer 1N/A** offset -- new location based on 'whence' 1N/A** whence -- indicates "base" for 'offset' 1N/A** result from fseek(). 1N/A** SM_STDIOCLOSE -- close the file 1N/A** fp -- close file pointer 1N/A** status from fclose() 1N/A** SM_STDIOSETINFO -- set info for this open file 1N/A** fp -- the file pointer 1N/A** what -- type of information setting 1N/A** valp -- memory location of info to set 1N/A** Failure: -1 and sets errno 1N/A** Success: none (currently). 1N/A** SM_STDIOGETINFO -- get info for this open file 1N/A** fp -- the file pointer 1N/A** what -- type of information request 1N/A** valp -- memory location to place info 1N/A** Failure: -1 and sets errno 1N/A** Success: none (currently). 1N/A** SM_IO_STDIOOPEN -- create an SM_FILE which interfaces to a stdio FILE 1N/A** stream -- an open stdio stream, as returned by fopen() 1N/A** mode -- the mode argument to fopen() which describes stream 1N/A** On success, return a pointer to an SM_FILE object which 1N/A** can be used for reading and writing 'stream'. 1N/A** Abort if mode is gibberish or stream is bad. 1N/A** Raise an exception if we can't allocate memory.