Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

thd_compress.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002    Major portions of this software are copyrighted by the Medical College
00003    of Wisconsin, 1994-2000, and are released under the Gnu General Public
00004    License, Version 2.  See the file README.Copyright for details.
00005 ******************************************************************************/
00006    
00007 #ifndef _MCW_COMPRESSOR_
00008 #define _MCW_COMPRESSOR_
00009 
00010 #include <unistd.h>
00011 #include <stdlib.h>
00012 #include <stdio.h>
00013 #include <string.h>
00014 #include <errno.h>
00015 #include <ctype.h>
00016 #include <sys/types.h>
00017 #include <sys/stat.h>
00018 #include <sys/mman.h>
00019 #include <fcntl.h>
00020 
00021 #include "mcw_malloc.h"
00022 
00023 #define COMPRESS_NOFILE    -666
00024 #define COMPRESS_NONE      -1
00025 #define COMPRESS_GZIP       0
00026 #define COMPRESS_BZIP2      1
00027 #define COMPRESS_COMPRESS   2
00028 
00029 /* PJR 07/22/98- adding brikcomp decompression to afni.
00030    Compression with brikcomp is not supported because it needs the header information. */
00031 #define COMPRESS_BRIKCOMP   3
00032 
00033 #define COMPRESS_LASTCODE   3
00034 
00035 static char * COMPRESS_suffix[]     = { ".gz" , ".bz2" , ".Z", ".briz" } ;
00036 static int    COMPRESS_suffix_len[] = { 3    , 4       , 2    , 5} ;
00037 
00038 static char * COMPRESS_program[]    = { "gzip -1c > %s"  ,
00039                                         "bzip2 -1c > %s" ,
00040                                         "compress > %s"  ,
00041                                         "cat > %s"} ;         /* shouldn't be called */
00042 
00043 static int    COMPRESS_program_ok[] = { 1 , 1 , 1 , 0 } ;     /* RWCox 03 Aug 1998 */
00044 
00045 static char * COMPRESS_unprogram[]  = { "gzip -dc %s"  ,
00046                                         "bzip2 -dc %s" ,
00047                                         "uncompress -c %s",
00048                                         "brikcomp -c %s" } ;
00049 
00050 static char * COMPRESS_enviro[] = { "GZIP" , "BZIP2" , "COMPRESS" , "BRIKCOMP" } ;
00051 
00052 #define   NUM_COMPRESS_elist 3 
00053 static char * COMPRESS_elist[] = { "GZIP" , "BZIP2" , "COMPRESS" } ;
00054 
00055 /*---------- prototypes ----------*/
00056 
00057 extern int COMPRESS_is_file( char * pathname ) ;
00058 extern int COMPRESS_has_suffix( char * fname , int mode ) ;
00059 extern int COMPRESS_filecode( char * fname ) ;
00060 extern int COMPRESS_fclose( FILE * fp ) ;
00061 extern FILE * COMPRESS_fopen_read( char * fname ) ;
00062 extern FILE * COMPRESS_fopen_write( char * fname , int mm ) ;
00063 
00064 extern char * COMPRESS_filename( char * fname ) ; /* Feb 1998 */
00065 extern int COMPRESS_unlink( char * fname ) ;      /* Feb 1998 */
00066 
00067 extern char * COMPRESS_add_suffix( char * fname , int mode ) ; /* May 1998 */
00068 
00069 #endif
 

Powered by Plone

This site conforms to the following standards: