diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-03-05 18:05:27 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-03-05 18:05:27 -0500 |
commit | 4a3aef3f7236d2b3267aead61f11c587c6f4bddb (patch) | |
tree | bea89287f8cf6290fc230fb82fb11b3b9a5c6e0f /include/ricecomp.h | |
parent | 9166f1762976cb64acfd8c9ecc067132ffefa615 (diff) | |
download | calfuse-4a3aef3f7236d2b3267aead61f11c587c6f4bddb.tar.gz |
Further improvements
Diffstat (limited to 'include/ricecomp.h')
-rw-r--r-- | include/ricecomp.h | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/include/ricecomp.h b/include/ricecomp.h deleted file mode 100644 index 4a48328..0000000 --- a/include/ricecomp.h +++ /dev/null @@ -1,107 +0,0 @@ -/* @(#) buffer.h 1.1 98/07/21 12:34:27 */ -/* buffer.h: structure for compression to buffer rather than to a file, including - * bit I/O buffer - * - * R. White, 19 June 1998 - */ - - -typedef unsigned char Buffer_t; - -typedef struct { - int bitbuffer; /* bit buffer */ - int bits_to_go; /* bits to go in buffer */ - Buffer_t *start; /* start of buffer */ - Buffer_t *current; /* current position in buffer */ - Buffer_t *end; /* end of buffer */ -} Buffer; - -#define buffree(mf) (free(mf->start), free(mf)) -#define bufused(mf) (mf->current - mf->start) -#define bufreset(mf) (mf->current = mf->start) - -/* - * getcbuf, putcbuf macros for character IO to buffer - * putcbuf returns EOF on end of buffer, else returns 0 - */ -#define getcbuf(mf) ((mf->current >= mf->end) ? EOF : *(mf->current)++) -#define putcbuf(c,mf) \ - ((mf->current >= mf->end) ? \ - EOF :\ - ((*(mf->current)++ = c), 0)) - -/* - * bufalloc sets up buffer of length n - */ - -/* not needed by CFITSIO - -static Buffer *bufalloc(int n) -{ -Buffer *mf; - - mf = (Buffer *) malloc(sizeof(Buffer)); - if (mf == (Buffer *)NULL) return((Buffer *)NULL); - - mf->start = (Buffer_t *) malloc(n*sizeof(Buffer_t)); - if (mf->start == (Buffer_t *)NULL) { - free(mf); - return((Buffer *)NULL); - } - mf->bits_to_go = 8; - mf->end = mf->start + n; - mf->current = mf->start; - return(mf); -} -*/ - -/* - * bufrealloc extends buffer (or truncates it) by - * reallocating memory - */ - -/* not needed by CFITSIO -static int bufrealloc(Buffer *mf, int n) -{ -int len; - - len = mf->current - mf->start; - - * silently throw away data if buffer is already longer than n * - if (len>n) len = n; - if (len<0) len = 0; - - mf->start = (Buffer_t *) realloc(mf->start, n*sizeof(Buffer_t)); - if (mf->start == (Buffer_t *)NULL) return(0); - - mf->end = mf->start + n; - mf->current = mf->start + len; - return(n); -} -*/ - -/* - * bufdump dumps contents of buffer to outfile and resets - * it to be empty. Returns number of bytes written. - * - * Note we don't write out the bit buffer -- you must call - * done_outputing_bits() first to ensure that the bit buffer - * is written out. I do it this way to allow incremental - * buffer dumps while bit IO is still going on. - */ - -/* not needed by CFITSIO - -static int bufdump(FILE *outfile, Buffer *buffer) -{ -int ndump; - - ndump = bufused(buffer); - if (fwrite(buffer->start, 1, ndump, outfile) != ndump) { - fprintf(stderr, "bufdump: error in write\n"); - exit(1); - } - bufreset(buffer); - return(ndump); -} -*/ |