comparison progs/minc_modify_header/minc_modify_header.c @ 1286:4342fd888f8f

Added support for bzipped files (thanks to Steve Robbins).
author neelin <neelin>
date Wed, 13 Sep 2000 14:12:35 +0000
parents 0e93a7d6edd4
children 90245dd1af3f
comparison
equal deleted inserted replaced
1285:26dcce6f5b86 1286:4342fd888f8f
8 @GLOBALS : 8 @GLOBALS :
9 @CALLS : 9 @CALLS :
10 @CREATED : March 31, 1995 (Peter Neelin) 10 @CREATED : March 31, 1995 (Peter Neelin)
11 @MODIFIED : 11 @MODIFIED :
12 * $Log: minc_modify_header.c,v $ 12 * $Log: minc_modify_header.c,v $
13 * Revision 6.1 1999-10-19 14:45:17 neelin 13 * Revision 6.2 2000-09-13 14:12:35 neelin
14 * Added support for bzipped files (thanks to Steve Robbins).
15 *
16 * Revision 6.1 1999/10/19 14:45:17 neelin
14 * Fixed Log subsitutions for CVS 17 * Fixed Log subsitutions for CVS
15 * 18 *
16 * Revision 6.0 1997/09/12 13:24:07 neelin 19 * Revision 6.0 1997/09/12 13:24:07 neelin
17 * Release of minc version 0.6 20 * Release of minc version 0.6
18 * 21 *
45 software for any purpose. It is provided "as is" without 48 software for any purpose. It is provided "as is" without
46 express or implied warranty. 49 express or implied warranty.
47 ---------------------------------------------------------------------------- */ 50 ---------------------------------------------------------------------------- */
48 51
49 #ifndef lint 52 #ifndef lint
50 static char rcsid[]="$Header: /private-cvsroot/minc/progs/minc_modify_header/minc_modify_header.c,v 6.1 1999-10-19 14:45:17 neelin Exp $"; 53 static char rcsid[]="$Header: /private-cvsroot/minc/progs/minc_modify_header/minc_modify_header.c,v 6.2 2000-09-13 14:12:35 neelin Exp $";
51 #endif 54 #endif
52 55
53 #include <stdlib.h> 56 #include <stdlib.h>
54 #include <stdio.h> 57 #include <stdio.h>
55 #include <string.h> 58 #include <string.h>
59 #include <ParseArgv.h> 62 #include <ParseArgv.h>
60 #include <minc_def.h> 63 #include <minc_def.h>
61 64
62 /* Constants */ 65 /* Constants */
63 #define MINC_EXTENSION ".mnc" 66 #define MINC_EXTENSION ".mnc"
67 #define BZIP_EXTENSION ".bz"
68 #define BZIP2_EXTENSION ".bz2"
64 #define GZIP_EXTENSION ".gz" 69 #define GZIP_EXTENSION ".gz"
65 #define COMPRESS_EXTENSION ".Z" 70 #define COMPRESS_EXTENSION ".Z"
66 #define PACK_EXTENSION ".z" 71 #define PACK_EXTENSION ".z"
67 #define ZIP_EXTENSION ".zip" 72 #define ZIP_EXTENSION ".zip"
68 #ifndef TRUE 73 #ifndef TRUE
141 if (*tempfile == '\0') 146 if (*tempfile == '\0')
142 tempfile = NULL; 147 tempfile = NULL;
143 } 148 }
144 else { 149 else {
145 tempfile = strstr(string, GZIP_EXTENSION); 150 tempfile = strstr(string, GZIP_EXTENSION);
151 if (tempfile == NULL)
152 tempfile = strstr(string, BZIP_EXTENSION);
153 if (tempfile == NULL)
154 tempfile = strstr(string, BZIP2_EXTENSION);
146 if (tempfile == NULL) 155 if (tempfile == NULL)
147 tempfile = strstr(string, COMPRESS_EXTENSION); 156 tempfile = strstr(string, COMPRESS_EXTENSION);
148 if (tempfile == NULL) 157 if (tempfile == NULL)
149 tempfile = strstr(string, PACK_EXTENSION); 158 tempfile = strstr(string, PACK_EXTENSION);
150 if (tempfile == NULL) 159 if (tempfile == NULL)