/*--------------------------------------------------------------------*/ /* This file contains all the I/O low level function definition used */ /* by the Frame Library. */ /* (Code proposed by Roy Willams, Caltech) (Aug 09, 2002 version) */ /*--------------------------------------------------------------------*/ #ifdef FR_LONG_LONG /*----- to use 8 bytes long ----------------------*/ typedef long long FRLONG; typedef unsigned long long FRULONG; #define FRLLD "lld" #else /*--------- default regular long---------------- ----*/ typedef long FRLONG; typedef unsigned long FRULONG; #define FRLLD "ld" #endif #if !defined(FRIO_DEFINED) #define FRIO_DEFINED #include #ifdef FRRFIO /*---- this is for HPSS-------------------------*/ #include #endif #define FRIOBSIZE 2048 /*--- local buffer to speed up the read process ---*/ struct FrIO{ #ifdef FRIOCFILE FILE *fp; #else int fd; #endif char buffer[FRIOBSIZE]; int position; /*---------- position in the local buffer, if position = BSIZE when the buffer is empty */ }; typedef struct FrIO FrIO; FrIO *FrIOOpenR(char* filename); FrIO *FrIOOpenW(char* filename); int FrIOClose (FrIO *frfd); FRLONG FrIOWrite (FrIO *frfd, char* buf, FRLONG nbyte); FRLONG FrIORead (FrIO *frfd, char* buf, FRLONG nbyte); FRLONG FrIOSet (FrIO *frfd, FRLONG offset); FRLONG FrIOSetFromEnd(FrIO *frfd, FRLONG offset); FRLONG FrIOSetFromCur(FrIO *frfd, FRLONG offset); FRLONG FrIOTell(struct FrIO *frfd); #endif