00001 /* @file IOBuffer.h 00002 * @brief input/output character buffer 00003 * 00004 * @author EAM, IfA 00005 * 00006 * @version $Revision: 1.2 $ $Name: $ 00007 * @date $Date: 2007/01/24 02:54:15 $ 00008 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii 00009 */ 00010 00011 #ifndef PS_IO_BUFFER_H 00012 #define PS_IO_BUFFER_H 00013 00014 /// @addtogroup Extras Miscellaneous Funtions 00015 /// @{ 00016 00017 typedef struct 00018 { 00019 char *data; 00020 int nAlloc; // current size of allocated buffer 00021 int nReset; // size to set buffer after flush 00022 int nBlock; // number of bytes to try to read at a time 00023 int n; // current size of filled data 00024 } 00025 psIOBuffer; 00026 00027 // psIOBuffer functions 00028 psIOBuffer *psIOBufferAlloc (int nBuffer); 00029 bool psIOBufferFlush (psIOBuffer *buffer); 00030 int psIOBufferRead (psIOBuffer *buffer, int fd); 00031 int psIOBufferReadEmpty (psIOBuffer *buffer, int maxRetries, int fd); 00032 00033 /// @} 00034 # endif
1.5.1