Update of /cvsroot/teem/teem/src/nrrd
In directory sc8-pr-cvs1:/tmp/cvs-serv5594/nrrd
Modified Files:
encoding.c encodingAscii.c encodingBzip2.c encodingGzip.c
encodingHex.c encodingRaw.c format.c formatEPS.c formatNRRD.c
formatPNG.c formatPNM.c formatText.c formatVTK.c methodsNrrd.c
parseNrrd.c nrrd.h privateNrrd.h read.c write.c
Log Message:
API RENAME: NrrdIO --> NrrdIoState
Index: encoding.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/encoding.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** encoding.c 24 Sep 2003 06:09:38 -0000 1.1
--- encoding.c 29 Nov 2003 08:16:07 -0000 1.2
***************
*** 49,53 ****
int
! _nrrdEncodingUnknown_read(Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdEncodingUnknown_read", err[AIR_STRLEN_MED];
--- 49,53 ----
int
! _nrrdEncodingUnknown_read(Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdEncodingUnknown_read", err[AIR_STRLEN_MED];
***************
*** 64,68 ****
int
! _nrrdEncodingUnknown_write(const Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdEncodingUnknown_write", err[AIR_STRLEN_MED];
--- 64,68 ----
int
! _nrrdEncodingUnknown_write(const Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdEncodingUnknown_write", err[AIR_STRLEN_MED];
Index: encodingAscii.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/encodingAscii.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** encodingAscii.c 13 Oct 2003 15:05:54 -0000 1.2
--- encodingAscii.c 29 Nov 2003 08:16:07 -0000 1.3
***************
*** 28,32 ****
int
! _nrrdEncodingAscii_read(Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdEncodingAscii_read", err[AIR_STRLEN_MED],
numbStr[AIR_STRLEN_HUGE]; /* HEY: fix this */
--- 28,32 ----
int
! _nrrdEncodingAscii_read(Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdEncodingAscii_read", err[AIR_STRLEN_MED],
numbStr[AIR_STRLEN_HUGE]; /* HEY: fix this */
***************
*** 82,86 ****
int
! _nrrdEncodingAscii_write(const Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdEncodingAscii_write", err[AIR_STRLEN_MED],
buff[AIR_STRLEN_MED];
--- 82,86 ----
int
! _nrrdEncodingAscii_write(const Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdEncodingAscii_write", err[AIR_STRLEN_MED],
buff[AIR_STRLEN_MED];
Index: encodingBzip2.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/encodingBzip2.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** encodingBzip2.c 13 Oct 2003 15:05:54 -0000 1.2
--- encodingBzip2.c 29 Nov 2003 08:16:07 -0000 1.3
***************
*** 36,40 ****
int
! _nrrdEncodingBzip2_read(Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdEncodingBzip2_read", err[AIR_STRLEN_MED];
#if TEEM_BZIP2
--- 36,40 ----
int
! _nrrdEncodingBzip2_read(Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdEncodingBzip2_read", err[AIR_STRLEN_MED];
#if TEEM_BZIP2
***************
*** 151,155 ****
int
! _nrrdEncodingBzip2_write(const Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdEncodingBzip2_write", err[AIR_STRLEN_MED];
#if TEEM_BZIP2
--- 151,155 ----
int
! _nrrdEncodingBzip2_write(const Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdEncodingBzip2_write", err[AIR_STRLEN_MED];
#if TEEM_BZIP2
Index: encodingGzip.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/encodingGzip.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** encodingGzip.c 13 Oct 2003 15:05:54 -0000 1.2
--- encodingGzip.c 29 Nov 2003 08:16:07 -0000 1.3
***************
*** 32,36 ****
int
! _nrrdEncodingGzip_read(Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdEncodingGzip_read", err[AIR_STRLEN_MED];
#if TEEM_ZLIB
--- 32,36 ----
int
! _nrrdEncodingGzip_read(Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdEncodingGzip_read", err[AIR_STRLEN_MED];
#if TEEM_ZLIB
***************
*** 142,146 ****
int
! _nrrdEncodingGzip_write(const Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdEncodingGzip_write", err[AIR_STRLEN_MED];
#if TEEM_ZLIB
--- 142,146 ----
int
! _nrrdEncodingGzip_write(const Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdEncodingGzip_write", err[AIR_STRLEN_MED];
#if TEEM_ZLIB
***************
*** 172,176 ****
}
! /* Set format string based on the NrrdIO parameters. */
fmt[fmt_i++] = 'w';
if (0 <= nio->zlibLevel && nio->zlibLevel <= 9)
--- 172,176 ----
}
! /* Set format string based on the NrrdIoState parameters. */
fmt[fmt_i++] = 'w';
if (0 <= nio->zlibLevel && nio->zlibLevel <= 9)
Index: encodingHex.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/encodingHex.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** encodingHex.c 13 Oct 2003 15:05:54 -0000 1.3
--- encodingHex.c 29 Nov 2003 08:16:07 -0000 1.4
***************
*** 58,62 ****
int
! _nrrdEncodingHex_read(Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdEncodingHex_read", err[AIR_STRLEN_MED];
size_t nibIdx, nibNum;
--- 58,62 ----
int
! _nrrdEncodingHex_read(Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdEncodingHex_read", err[AIR_STRLEN_MED];
size_t nibIdx, nibNum;
***************
*** 110,114 ****
int
! _nrrdEncodingHex_write(const Nrrd *nrrd, NrrdIO *nio) {
/* char me[]="_nrrdEncodingHex_write", err[AIR_STRLEN_MED]; */
unsigned char *data;
--- 110,114 ----
int
! _nrrdEncodingHex_write(const Nrrd *nrrd, NrrdIoState *nio) {
/* char me[]="_nrrdEncodingHex_write", err[AIR_STRLEN_MED]; */
unsigned char *data;
Index: encodingRaw.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/encodingRaw.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** encodingRaw.c 14 Nov 2003 22:08:05 -0000 1.3
--- encodingRaw.c 29 Nov 2003 08:16:07 -0000 1.4
***************
*** 28,32 ****
int
! _nrrdEncodingRaw_read(Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdEncodingRaw_read", err[AIR_STRLEN_MED];
size_t num, bsize, size, ret, dio;
--- 28,32 ----
int
! _nrrdEncodingRaw_read(Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdEncodingRaw_read", err[AIR_STRLEN_MED];
size_t num, bsize, size, ret, dio;
***************
*** 111,115 ****
int
! _nrrdEncodingRaw_write(const Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdEncodingRaw_write", err[AIR_STRLEN_MED];
size_t size, ret, dio;
--- 111,115 ----
int
! _nrrdEncodingRaw_write(const Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdEncodingRaw_write", err[AIR_STRLEN_MED];
size_t size, ret, dio;
Index: format.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/format.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** format.c 24 Sep 2003 06:09:38 -0000 1.1
--- format.c 29 Nov 2003 08:16:07 -0000 1.2
***************
*** 74,78 ****
int
! _nrrdFormatUnknown_contentStartsLike(NrrdIO *nio) {
/* insert code here */
--- 74,78 ----
int
! _nrrdFormatUnknown_contentStartsLike(NrrdIoState *nio) {
/* insert code here */
***************
*** 82,86 ****
int
! _nrrdFormatUnknown_read(FILE *file, Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdFormatUnknown_read", err[AIR_STRLEN_MED];
--- 82,86 ----
int
! _nrrdFormatUnknown_read(FILE *file, Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdFormatUnknown_read", err[AIR_STRLEN_MED];
***************
*** 93,97 ****
int
! _nrrdFormatUnknown_write(FILE *file, const Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdFormatUnknown_write", err[AIR_STRLEN_MED];
--- 93,97 ----
int
! _nrrdFormatUnknown_write(FILE *file, const Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdFormatUnknown_write", err[AIR_STRLEN_MED];
Index: formatEPS.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/formatEPS.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** formatEPS.c 24 Sep 2003 07:23:48 -0000 1.2
--- formatEPS.c 29 Nov 2003 08:16:07 -0000 1.3
***************
*** 79,83 ****
int
! _nrrdFormatEPS_contentStartsLike(NrrdIO *nio) {
/* this is a write-only format */
--- 79,83 ----
int
! _nrrdFormatEPS_contentStartsLike(NrrdIoState *nio) {
/* this is a write-only format */
***************
*** 86,90 ****
int
! _nrrdFormatEPS_read(FILE *file, Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdFormatEPS_read", err[AIR_STRLEN_MED];
--- 86,90 ----
int
! _nrrdFormatEPS_read(FILE *file, Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdFormatEPS_read", err[AIR_STRLEN_MED];
***************
*** 95,99 ****
int
! _nrrdFormatEPS_write(FILE *file, const Nrrd *_nrrd, NrrdIO *nio) {
char me[]="_nrrdFormatEPS_write", err[AIR_STRLEN_MED];
int color, sx, sy;
--- 95,99 ----
int
! _nrrdFormatEPS_write(FILE *file, const Nrrd *_nrrd, NrrdIoState *nio) {
char me[]="_nrrdFormatEPS_write", err[AIR_STRLEN_MED];
int color, sx, sy;
Index: formatNRRD.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/formatNRRD.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** formatNRRD.c 30 Sep 2003 09:54:30 -0000 1.3
--- formatNRRD.c 29 Nov 2003 08:16:07 -0000 1.4
***************
*** 55,59 ****
int
! _nrrdFormatNRRD_contentStartsLike(NrrdIO *nio) {
return (!strcmp(MAGIC0, nio->line)
--- 55,59 ----
int
! _nrrdFormatNRRD_contentStartsLike(NrrdIoState *nio) {
return (!strcmp(MAGIC0, nio->line)
***************
*** 71,75 ****
*/
int
! _nrrdHeaderCheck (Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdHeaderCheck", err[AIR_STRLEN_MED];
int i;
--- 71,75 ----
*/
int
! _nrrdHeaderCheck (Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdHeaderCheck", err[AIR_STRLEN_MED];
int i;
***************
*** 123,127 ****
*/
int
! _nrrdFormatNRRD_read(FILE *file, Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdFormatNRRD_read", *err=NULL;
/* NOTE: err has to be dynamically allocated because of the
--- 123,127 ----
*/
int
! _nrrdFormatNRRD_read(FILE *file, Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdFormatNRRD_read", *err=NULL;
/* NOTE: err has to be dynamically allocated because of the
***************
*** 298,302 ****
int
! _nrrdFormatNRRD_write(FILE *file, const Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdFormatNRRD_write", err[AIR_STRLEN_MED],
tmp[AIR_STRLEN_HUGE], trueDataFN[AIR_STRLEN_HUGE];
--- 298,302 ----
int
! _nrrdFormatNRRD_write(FILE *file, const Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdFormatNRRD_write", err[AIR_STRLEN_MED],
tmp[AIR_STRLEN_HUGE], trueDataFN[AIR_STRLEN_HUGE];
Index: formatPNG.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/formatPNG.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** formatPNG.c 2 Oct 2003 07:53:59 -0000 1.2
--- formatPNG.c 29 Nov 2003 08:16:07 -0000 1.3
***************
*** 102,106 ****
int
! _nrrdFormatPNG_contentStartsLike(NrrdIO *nio) {
return !strcmp(MAGIC, nio->line);
--- 102,106 ----
int
! _nrrdFormatPNG_contentStartsLike(NrrdIoState *nio) {
return !strcmp(MAGIC, nio->line);
***************
*** 157,161 ****
int
! _nrrdFormatPNG_read(FILE *file, Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdFormatPNG_read", err[AIR_STRLEN_MED];
#if TEEM_PNG
--- 157,161 ----
int
! _nrrdFormatPNG_read(FILE *file, Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdFormatPNG_read", err[AIR_STRLEN_MED];
#if TEEM_PNG
***************
*** 370,374 ****
int
! _nrrdFormatPNG_write(FILE *file, const Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdFormatPNG_write", err[AIR_STRLEN_MED];
#if TEEM_PNG
--- 370,374 ----
int
! _nrrdFormatPNG_write(FILE *file, const Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdFormatPNG_write", err[AIR_STRLEN_MED];
#if TEEM_PNG
Index: formatPNM.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/formatPNM.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** formatPNM.c 24 Sep 2003 06:09:38 -0000 1.1
--- formatPNM.c 29 Nov 2003 08:16:07 -0000 1.2
***************
*** 90,94 ****
int
! _nrrdFormatPNM_contentStartsLike(NrrdIO *nio) {
return (!strcmp(MAGIC_P6, nio->line)
--- 90,94 ----
int
! _nrrdFormatPNM_contentStartsLike(NrrdIoState *nio) {
return (!strcmp(MAGIC_P6, nio->line)
***************
*** 99,103 ****
int
! _nrrdFormatPNM_read(FILE *file, Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdFormatPNM_read", err[AIR_STRLEN_MED], *perr;
const char *fs;
--- 99,103 ----
int
! _nrrdFormatPNM_read(FILE *file, Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdFormatPNM_read", err[AIR_STRLEN_MED], *perr;
const char *fs;
***************
*** 272,276 ****
int
! _nrrdFormatPNM_write(FILE *file, const Nrrd *_nrrd, NrrdIO *nio) {
char me[]="_nrrdFormatPNM_write", err[AIR_STRLEN_MED];
int i, color, sx, sy, magic;
--- 272,276 ----
int
! _nrrdFormatPNM_write(FILE *file, const Nrrd *_nrrd, NrrdIoState *nio) {
char me[]="_nrrdFormatPNM_write", err[AIR_STRLEN_MED];
int i, color, sx, sy, magic;
Index: formatText.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/formatText.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** formatText.c 2 Oct 2003 06:06:04 -0000 1.2
--- formatText.c 29 Nov 2003 08:16:07 -0000 1.3
***************
*** 56,60 ****
int
! _nrrdFormatText_contentStartsLike(NrrdIO *nio) {
float oneFloat;
--- 56,60 ----
int
! _nrrdFormatText_contentStartsLike(NrrdIoState *nio) {
float oneFloat;
***************
*** 64,68 ****
int
! _nrrdFormatText_read(FILE *file, Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdFormatText_read", err[AIR_STRLEN_MED], *errS;
const char *fs;
--- 64,68 ----
int
! _nrrdFormatText_read(FILE *file, Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdFormatText_read", err[AIR_STRLEN_MED], *errS;
const char *fs;
***************
*** 251,255 ****
int
! _nrrdFormatText_write(FILE *file, const Nrrd *nrrd, NrrdIO *nio) {
char cmt[AIR_STRLEN_SMALL], buff[AIR_STRLEN_SMALL];
size_t I;
--- 251,255 ----
int
! _nrrdFormatText_write(FILE *file, const Nrrd *nrrd, NrrdIoState *nio) {
char cmt[AIR_STRLEN_SMALL], buff[AIR_STRLEN_SMALL];
size_t I;
Index: formatVTK.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/formatVTK.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** formatVTK.c 14 Oct 2003 20:10:44 -0000 1.4
--- formatVTK.c 29 Nov 2003 08:16:07 -0000 1.5
***************
*** 82,86 ****
int
! _nrrdFormatVTK_contentStartsLike(NrrdIO *nio) {
return (!strcmp(MAGIC1, nio->line)
--- 82,86 ----
int
! _nrrdFormatVTK_contentStartsLike(NrrdIoState *nio) {
return (!strcmp(MAGIC1, nio->line)
***************
*** 89,93 ****
int
! _nrrdFormatVTK_read(FILE *file, Nrrd *nrrd, NrrdIO *nio) {
char me[]="_nrrdReadVTK", err[AIR_STRLEN_MED], *three[3];
int len, sx, sy, sz, ret, N;
--- 89,93 ----
int
! _nrrdFormatVTK_read(FILE *file, Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdReadVTK", err[AIR_STRLEN_MED], *three[3];
int len, sx, sy, sz, ret, N;
***************
*** 252,256 ****
/* this strongly assumes that nrrdFitsInFormat() was true */
int
! _nrrdFormatVTK_write(FILE *file, const Nrrd *_nrrd, NrrdIO *nio) {
char me[]="_nrrdFormatVTK_write", err[AIR_STRLEN_MED];
int i, sx, sy, sz, sax;
--- 252,256 ----
/* this strongly assumes that nrrdFitsInFormat() was true */
int
! _nrrdFormatVTK_write(FILE *file, const Nrrd *_nrrd, NrrdIoState *nio) {
char me[]="_nrrdFormatVTK_write", err[AIR_STRLEN_MED];
int i, sx, sy, sz, sax;
Index: methodsNrrd.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/methodsNrrd.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** methodsNrrd.c 16 Nov 2003 16:25:19 -0000 1.33
--- methodsNrrd.c 29 Nov 2003 08:16:07 -0000 1.34
***************
*** 25,29 ****
void
! nrrdIOInit (NrrdIO *nio) {
if (nio) {
--- 25,29 ----
void
! nrrdIoStateInit (NrrdIoState *nio) {
if (nio) {
***************
*** 55,63 ****
}
! NrrdIO *
! nrrdIONew (void) {
! NrrdIO *nio;
! nio = calloc(1, sizeof(NrrdIO));
if (nio) {
nio->path = NULL;
--- 55,63 ----
}
! NrrdIoState *
! nrrdIoStateNew (void) {
! NrrdIoState *nio;
! nio = calloc(1, sizeof(NrrdIoState));
if (nio) {
nio->path = NULL;
***************
*** 68,78 ****
nio->format = NULL;
nio->encoding = NULL;
! nrrdIOInit(nio);
}
return nio;
}
! NrrdIO *
! nrrdIONix (NrrdIO *nio) {
AIR_FREE(nio->path);
--- 68,78 ----
nio->format = NULL;
nio->encoding = NULL;
! nrrdIoStateInit(nio);
}
return nio;
}
! NrrdIoState *
! nrrdIoStateNix (NrrdIoState *nio) {
AIR_FREE(nio->path);
Index: parseNrrd.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/parseNrrd.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** parseNrrd.c 4 Oct 2003 06:22:52 -0000 1.18
--- parseNrrd.c 29 Nov 2003 08:16:07 -0000 1.19
***************
*** 22,26 ****
int
! _nrrdReadNrrdParse_nonfield (Nrrd *nrrd, NrrdIO *io, int useBiff) {
/*
char c;
--- 22,26 ----
int
! _nrrdReadNrrdParse_nonfield (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
/*
char c;
***************
*** 36,40 ****
int
! _nrrdReadNrrdParse_comment (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_comment", err[AIR_STRLEN_MED];
char *info;
--- 36,40 ----
int
! _nrrdReadNrrdParse_comment (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_comment", err[AIR_STRLEN_MED];
char *info;
***************
*** 50,54 ****
int
! _nrrdReadNrrdParse_type (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_type", err[AIR_STRLEN_MED];
char *info;
--- 50,54 ----
int
! _nrrdReadNrrdParse_type (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_type", err[AIR_STRLEN_MED];
char *info;
***************
*** 63,67 ****
int
! _nrrdReadNrrdParse_encoding (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_encoding", err[AIR_STRLEN_MED];
char *info;
--- 63,67 ----
int
! _nrrdReadNrrdParse_encoding (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_encoding", err[AIR_STRLEN_MED];
char *info;
***************
*** 79,83 ****
int
! _nrrdReadNrrdParse_endian (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_endian", err[AIR_STRLEN_MED];
char *info;
--- 79,83 ----
int
! _nrrdReadNrrdParse_endian (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_endian", err[AIR_STRLEN_MED];
char *info;
***************
*** 98,102 ****
int
! _nrrdReadNrrdParse_dimension (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_dimension", err[AIR_STRLEN_MED];
char *info;
--- 98,102 ----
int
! _nrrdReadNrrdParse_dimension (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_dimension", err[AIR_STRLEN_MED];
char *info;
***************
*** 131,135 ****
int
! _nrrdReadNrrdParse_sizes (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_sizes", err[AIR_STRLEN_MED];
int ret, val[NRRD_DIM_MAX];
--- 131,135 ----
int
! _nrrdReadNrrdParse_sizes (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_sizes", err[AIR_STRLEN_MED];
int ret, val[NRRD_DIM_MAX];
***************
*** 149,153 ****
int
! _nrrdReadNrrdParse_spacings (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_spacings", err[AIR_STRLEN_MED];
int i, ret;
--- 149,153 ----
int
! _nrrdReadNrrdParse_spacings (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_spacings", err[AIR_STRLEN_MED];
int i, ret;
***************
*** 170,174 ****
int
! _nrrdReadNrrdParse_axis_mins (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_axis_mins", err[AIR_STRLEN_MED];
int ret, i, sgn;
--- 170,174 ----
int
! _nrrdReadNrrdParse_axis_mins (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_axis_mins", err[AIR_STRLEN_MED];
int ret, i, sgn;
***************
*** 191,195 ****
int
! _nrrdReadNrrdParse_axis_maxs (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_axis_maxs", err[AIR_STRLEN_MED];
int ret, i, sgn;
--- 191,195 ----
int
! _nrrdReadNrrdParse_axis_maxs (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_axis_maxs", err[AIR_STRLEN_MED];
int ret, i, sgn;
***************
*** 215,219 ****
*/
int
! _nrrdReadNrrdParse_centers (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_centers", err[AIR_STRLEN_MED];
int i;
--- 215,219 ----
*/
int
! _nrrdReadNrrdParse_centers (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_centers", err[AIR_STRLEN_MED];
int i;
***************
*** 305,309 ****
int
! _nrrdReadNrrdParse_labels (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_labels", err[AIR_STRLEN_MED];
char *h; /* this is the "here" pointer which gradually progresses
--- 305,309 ----
int
! _nrrdReadNrrdParse_labels (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_labels", err[AIR_STRLEN_MED];
char *h; /* this is the "here" pointer which gradually progresses
***************
*** 330,334 ****
int
! _nrrdReadNrrdParse_units (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_unitss", err[AIR_STRLEN_MED];
char *h;
--- 330,334 ----
int
! _nrrdReadNrrdParse_units (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_unitss", err[AIR_STRLEN_MED];
char *h;
***************
*** 354,358 ****
int
! _nrrdReadNrrdParse_number (Nrrd *nrrd, NrrdIO *io, int useBiff) {
/*
char me[]="_nrrdReadNrrdParse_number", err[AIR_STRLEN_MED];
--- 354,358 ----
int
! _nrrdReadNrrdParse_number (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
/*
char me[]="_nrrdReadNrrdParse_number", err[AIR_STRLEN_MED];
***************
*** 381,385 ****
int
! _nrrdReadNrrdParse_content (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_content", err[AIR_STRLEN_MED];
char *info;
--- 381,385 ----
int
! _nrrdReadNrrdParse_content (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_content", err[AIR_STRLEN_MED];
char *info;
***************
*** 394,398 ****
int
! _nrrdReadNrrdParse_block_size (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_block_size", err[AIR_STRLEN_MED];
char *info;
--- 394,398 ----
int
! _nrrdReadNrrdParse_block_size (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_block_size", err[AIR_STRLEN_MED];
char *info;
***************
*** 416,420 ****
int
! _nrrdReadNrrdParse_min (Nrrd *nrrd, NrrdIO *io, int useBiff) {
/* This field is no longer assumed to be anything meaningful,
--- 416,420 ----
int
! _nrrdReadNrrdParse_min (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
/* This field is no longer assumed to be anything meaningful,
***************
*** 427,431 ****
int
! _nrrdReadNrrdParse_max (Nrrd *nrrd, NrrdIO *io, int useBiff) {
/* nrrd->max no longer exists, see above */
--- 427,431 ----
int
! _nrrdReadNrrdParse_max (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
/* nrrd->max no longer exists, see above */
***************
*** 435,439 ****
int
! _nrrdReadNrrdParse_old_min (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_old_min", err[AIR_STRLEN_MED];
char *info;
--- 435,439 ----
int
! _nrrdReadNrrdParse_old_min (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_old_min", err[AIR_STRLEN_MED];
char *info;
***************
*** 450,454 ****
int
! _nrrdReadNrrdParse_old_max (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_old_max", err[AIR_STRLEN_MED];
char *info;
--- 450,454 ----
int
! _nrrdReadNrrdParse_old_max (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_old_max", err[AIR_STRLEN_MED];
char *info;
***************
*** 470,474 ****
** Note lack of thread-safety: strerror(errno) */
int
! _nrrdReadNrrdParse_data_file (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_data_file", err[AIR_STRLEN_MED],
dataName[AIR_STRLEN_HUGE];
--- 470,474 ----
** Note lack of thread-safety: strerror(errno) */
int
! _nrrdReadNrrdParse_data_file (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_data_file", err[AIR_STRLEN_MED],
dataName[AIR_STRLEN_HUGE];
***************
*** 499,503 ****
int
! _nrrdReadNrrdParse_line_skip (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_line_skip", err[AIR_STRLEN_MED];
char *info;
--- 499,503 ----
int
! _nrrdReadNrrdParse_line_skip (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_line_skip", err[AIR_STRLEN_MED];
char *info;
***************
*** 513,517 ****
int
! _nrrdReadNrrdParse_byte_skip (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_byte_skip", err[AIR_STRLEN_MED];
char *info;
--- 513,517 ----
int
! _nrrdReadNrrdParse_byte_skip (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_byte_skip", err[AIR_STRLEN_MED];
char *info;
***************
*** 527,531 ****
int
! _nrrdReadNrrdParse_keyvalue (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_keyvalue", err[AIR_STRLEN_MED];
char *keysep, *line, *key, *value;
--- 527,531 ----
int
! _nrrdReadNrrdParse_keyvalue (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_keyvalue", err[AIR_STRLEN_MED];
char *keysep, *line, *key, *value;
***************
*** 564,568 ****
*/
int
! (*_nrrdReadNrrdParseInfo[NRRD_FIELD_MAX+1])(Nrrd *, NrrdIO *, int) = {
_nrrdReadNrrdParse_nonfield,
_nrrdReadNrrdParse_comment,
--- 564,568 ----
*/
int
! (*_nrrdReadNrrdParseInfo[NRRD_FIELD_MAX+1])(Nrrd *, NrrdIoState *, int) = {
_nrrdReadNrrdParse_nonfield,
_nrrdReadNrrdParse_comment,
***************
*** 597,601 ****
*/
int
! _nrrdReadNrrdParseField (Nrrd *nrrd, NrrdIO *io, int useBiff) {
char me[]="_nrrdReadNrrdParseField", err[AIR_STRLEN_MED], *next,
*buff, *colon, *keysep;
--- 597,601 ----
*/
int
! _nrrdReadNrrdParseField (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParseField", err[AIR_STRLEN_MED], *next,
*buff, *colon, *keysep;
Index: nrrd.h
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/nrrd.h,v
retrieving revision 1.123
retrieving revision 1.124
diff -C2 -d -r1.123 -r1.124
*** nrrd.h 16 Nov 2003 16:25:19 -0000 1.123
--- nrrd.h 29 Nov 2003 08:16:07 -0000 1.124
***************
*** 261,265 ****
} NrrdIter;
! struct NrrdIO_t;
struct NrrdEncoding_t;
--- 261,265 ----
} NrrdIter;
! struct NrrdIoState_t;
struct NrrdEncoding_t;
***************
*** 291,299 ****
/* (for reading) returns non-zero if what has been read in so far
is recognized as the beginning of this format */
! int (*contentStartsLike)(struct NrrdIO_t *nio);
/* reader and writer */
! int (*read)(FILE *file, Nrrd *nrrd, struct NrrdIO_t *nio);
! int (*write)(FILE *file, const Nrrd *nrrd, struct NrrdIO_t *nio);
} NrrdFormat;
--- 291,299 ----
/* (for reading) returns non-zero if what has been read in so far
is recognized as the beginning of this format */
! int (*contentStartsLike)(struct NrrdIoState_t *nio);
/* reader and writer */
! int (*read)(FILE *file, Nrrd *nrrd, struct NrrdIoState_t *nio);
! int (*write)(FILE *file, const Nrrd *nrrd, struct NrrdIoState_t *nio);
} NrrdFormat;
***************
*** 312,321 ****
isCompression;
int (*available)(void);
! int (*read)(Nrrd *nrrd, struct NrrdIO_t *nio);
! int (*write)(const Nrrd *nrrd, struct NrrdIO_t *nio);
} NrrdEncoding;
/*
! ******** NrrdIO struct
**
** Everything transient relating to how the nrrd is read and written.
--- 312,321 ----
isCompression;
int (*available)(void);
! int (*read)(Nrrd *nrrd, struct NrrdIoState_t *nio);
! int (*write)(const Nrrd *nrrd, struct NrrdIoState_t *nio);
} NrrdEncoding;
/*
! ******** NrrdIoState struct
**
** Everything transient relating to how the nrrd is read and written.
***************
*** 325,329 ****
** keepNrrdDataFileOpen
*/
! typedef struct NrrdIO_t {
char *path, /* allows us to remember the directory
from whence this nrrd was "load"ed, or
--- 325,329 ----
** keepNrrdDataFileOpen
*/
! typedef struct NrrdIoState_t {
char *path, /* allows us to remember the directory
from whence this nrrd was "load"ed, or
***************
*** 410,414 ****
const NrrdFormat *format;
const NrrdEncoding *encoding;
! } NrrdIO;
/******** defaults (nrrdDef..) and state (nrrdState..) */
--- 410,414 ----
const NrrdFormat *format;
const NrrdEncoding *encoding;
! } NrrdIoState;
/******** defaults (nrrdDef..) and state (nrrdState..) */
***************
*** 475,481 ****
/******** pseudo-constructors, pseudo-destructors, and such */
/* methodsNrrd.c */
! extern NrrdIO *nrrdIONew(void);
! extern void nrrdIOInit(NrrdIO *io);
! extern NrrdIO *nrrdIONix(NrrdIO *io);
extern NrrdResampleInfo *nrrdResampleInfoNew(void);
extern NrrdResampleInfo *nrrdResampleInfoNix(NrrdResampleInfo *info);
--- 475,481 ----
/******** pseudo-constructors, pseudo-destructors, and such */
/* methodsNrrd.c */
! extern NrrdIoState *nrrdIoStateNew(void);
! extern void nrrdIoStateInit(NrrdIoState *io);
! extern NrrdIoState *nrrdIoStateNix(NrrdIoState *io);
extern NrrdResampleInfo *nrrdResampleInfoNew(void);
extern NrrdResampleInfo *nrrdResampleInfoNix(NrrdResampleInfo *info);
***************
*** 628,638 ****
const nrrdEncodingArray[NRRD_ENCODING_TYPE_MAX+1];
/* read.c */
! extern int nrrdLineSkip(NrrdIO *io);
! extern int nrrdByteSkip(Nrrd *nrrd, NrrdIO *io);
! extern int nrrdLoad(Nrrd *nrrd, const char *filename, NrrdIO *io);
! extern int nrrdRead(Nrrd *nrrd, FILE *file, NrrdIO *io);
/* write.c */
! extern int nrrdSave(const char *filename, const Nrrd *nrrd, NrrdIO *io);
! extern int nrrdWrite(FILE *file, const Nrrd *nrrd, NrrdIO *io);
/******** expressing the range of values in a nrrd */
--- 628,638 ----
const nrrdEncodingArray[NRRD_ENCODING_TYPE_MAX+1];
/* read.c */
! extern int nrrdLineSkip(NrrdIoState *io);
! extern int nrrdByteSkip(Nrrd *nrrd, NrrdIoState *io);
! extern int nrrdLoad(Nrrd *nrrd, const char *filename, NrrdIoState *io);
! extern int nrrdRead(Nrrd *nrrd, FILE *file, NrrdIoState *io);
/* write.c */
! extern int nrrdSave(const char *filename, const Nrrd *nrrd, NrrdIoState *io);
! extern int nrrdWrite(FILE *file, const Nrrd *nrrd, NrrdIoState *io);
/******** expressing the range of values in a nrrd */
Index: privateNrrd.h
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/privateNrrd.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** privateNrrd.h 30 Sep 2003 09:54:53 -0000 1.27
--- privateNrrd.h 29 Nov 2003 08:16:07 -0000 1.28
***************
*** 87,91 ****
/* read.c */
! extern int _nrrdOneLine (int *lenP, NrrdIO *io, FILE *file);
extern int _nrrdCalloc (Nrrd *nrrd);
--- 87,91 ----
/* read.c */
! extern int _nrrdOneLine (int *lenP, NrrdIoState *io, FILE *file);
extern int _nrrdCalloc (Nrrd *nrrd);
***************
*** 125,138 ****
/* write.c */
! extern int _nrrdFieldInteresting (const Nrrd *nrrd, NrrdIO *nio, int field);
extern void _nrrdSprintFieldInfo(char **strP, char *prefix,
! const Nrrd *nrrd, NrrdIO *nio, int field);
extern void _nrrdFprintFieldInfo(FILE *file, char *prefix,
! const Nrrd *nrrd, NrrdIO *nio, int field);
extern int _nrrdReshapeDownGrayscale(Nrrd *nimg);
! /* parse.c */
! extern int (*_nrrdReadNrrdParseInfo[NRRD_FIELD_MAX+1])(Nrrd *, NrrdIO *, int);
! extern int _nrrdReadNrrdParseField(Nrrd *nrrd, NrrdIO *io, int useBiff);
/* methods.c */
--- 125,142 ----
/* write.c */
! extern int _nrrdFieldInteresting (const Nrrd *nrrd, NrrdIoState *nio,
! int field);
extern void _nrrdSprintFieldInfo(char **strP, char *prefix,
! const Nrrd *nrrd, NrrdIoState *nio,
! int field);
extern void _nrrdFprintFieldInfo(FILE *file, char *prefix,
! const Nrrd *nrrd, NrrdIoState *nio,
! int field);
extern int _nrrdReshapeDownGrayscale(Nrrd *nimg);
! /* parseNrrd.c */
! extern int (*_nrrdReadNrrdParseInfo[NRRD_FIELD_MAX+1])(Nrrd *, NrrdIoState *,
! int useBiff);
! extern int _nrrdReadNrrdParseField(Nrrd *nrrd, NrrdIoState *io, int useBiff);
/* methods.c */
Index: read.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/read.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -C2 -d -r1.82 -r1.83
*** read.c 14 Nov 2003 22:08:05 -0000 1.82
--- read.c 29 Nov 2003 08:16:07 -0000 1.83
***************
*** 36,40 ****
**
** wrapper around airOneLine; does re-allocation of line buffer
! ** ("line") in the NrrdIO if needed. The return value semantics
** are similar, except that what airOneLine would return, we put
** in *lenP. If there is an error (airOneLine returned -1,
--- 36,40 ----
**
** wrapper around airOneLine; does re-allocation of line buffer
! ** ("line") in the NrrdIoState if needed. The return value semantics
** are similar, except that what airOneLine would return, we put
** in *lenP. If there is an error (airOneLine returned -1,
***************
*** 46,50 ****
*/
int
! _nrrdOneLine (int *lenP, NrrdIO *nio, FILE *file) {
char me[]="_nrrdOneLine", err[AIR_STRLEN_MED], **line;
airArray *lineArr;
--- 46,50 ----
*/
int
! _nrrdOneLine (int *lenP, NrrdIoState *nio, FILE *file) {
char me[]="_nrrdOneLine", err[AIR_STRLEN_MED], **line;
airArray *lineArr;
***************
*** 145,149 ****
*/
int
! nrrdLineSkip (NrrdIO *nio) {
int i, skipRet;
char me[]="nrrdLineSkip", err[AIR_STRLEN_MED];
--- 145,149 ----
*/
int
! nrrdLineSkip (NrrdIoState *nio) {
int i, skipRet;
char me[]="nrrdLineSkip", err[AIR_STRLEN_MED];
***************
*** 168,172 ****
int
! nrrdByteSkip (Nrrd *nrrd, NrrdIO *nio) {
int i, skipRet;
char me[]="nrrdByteSkip", err[AIR_STRLEN_MED];
--- 168,172 ----
int
! nrrdByteSkip (Nrrd *nrrd, NrrdIoState *nio) {
int i, skipRet;
char me[]="nrrdByteSkip", err[AIR_STRLEN_MED];
***************
*** 223,227 ****
*/
int
! nrrdRead (Nrrd *nrrd, FILE *file, NrrdIO *nio) {
char err[AIR_STRLEN_MED], me[] = "nrrdRead";
int len, fi;
--- 223,227 ----
*/
int
! nrrdRead (Nrrd *nrrd, FILE *file, NrrdIoState *nio) {
char err[AIR_STRLEN_MED], me[] = "nrrdRead";
int len, fi;
***************
*** 234,243 ****
mop = airMopNew();
if (!nio) {
! nio = nrrdIONew();
if (!nio) {
sprintf(err, "%s: couldn't alloc I/O struct", me);
biffAdd(NRRD, err); return 1;
}
! airMopAdd(mop, nio, (airMopper)nrrdIONix, airMopAlways);
}
--- 234,243 ----
mop = airMopNew();
if (!nio) {
! nio = nrrdIoStateNew();
if (!nio) {
sprintf(err, "%s: couldn't alloc I/O struct", me);
biffAdd(NRRD, err); return 1;
}
! airMopAdd(mop, nio, (airMopper)nrrdIoStateNix, airMopAlways);
}
***************
*** 342,346 ****
*/
int
! nrrdLoad (Nrrd *nrrd, const char *filename, NrrdIO *nio) {
char me[]="nrrdLoad", err[AIR_STRLEN_MED];
FILE *file;
--- 342,346 ----
*/
int
! nrrdLoad (Nrrd *nrrd, const char *filename, NrrdIoState *nio) {
char me[]="nrrdLoad", err[AIR_STRLEN_MED];
FILE *file;
***************
*** 354,363 ****
mop = airMopNew();
if (!nio) {
! nio = nrrdIONew();
if (!nio) {
sprintf(err, "%s: couldn't alloc I/O struct", me);
biffAdd(NRRD, err); return 1;
}
! airMopAdd(mop, nio, (airMopper)nrrdIONix, airMopAlways);
}
--- 354,363 ----
mop = airMopNew();
if (!nio) {
! nio = nrrdIoStateNew();
if (!nio) {
sprintf(err, "%s: couldn't alloc I/O struct", me);
biffAdd(NRRD, err); return 1;
}
! airMopAdd(mop, nio, (airMopper)nrrdIoStateNix, airMopAlways);
}
Index: write.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/write.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -C2 -d -r1.85 -r1.86
*** write.c 30 Sep 2003 09:28:15 -0000 1.85
--- write.c 29 Nov 2003 08:16:07 -0000 1.86
***************
*** 28,32 ****
int
! _nrrdFieldInteresting (const Nrrd *nrrd, NrrdIO *nio, int field) {
int d, ret;
--- 28,32 ----
int
! _nrrdFieldInteresting (const Nrrd *nrrd, NrrdIoState *nio, int field) {
int d, ret;
***************
*** 141,145 ****
void
_nrrdSprintFieldInfo (char **strP, char *prefix,
! const Nrrd *nrrd, NrrdIO *nio, int field) {
char me[]="_nrrdSprintFieldInfo", buff[AIR_STRLEN_MED];
const char *fs;
--- 141,145 ----
void
_nrrdSprintFieldInfo (char **strP, char *prefix,
! const Nrrd *nrrd, NrrdIoState *nio, int field) {
char me[]="_nrrdSprintFieldInfo", buff[AIR_STRLEN_MED];
const char *fs;
***************
*** 329,333 ****
void
_nrrdFprintFieldInfo (FILE *file, char *prefix,
! const Nrrd *nrrd, NrrdIO *nio, int field) {
char *line=NULL;
--- 329,333 ----
void
_nrrdFprintFieldInfo (FILE *file, char *prefix,
! const Nrrd *nrrd, NrrdIoState *nio, int field) {
char *line=NULL;
***************
*** 341,345 ****
int
! _nrrdEncodingMaybeSet(NrrdIO *nio) {
char me[]="_nrrdEncodingMaybeSet", err[AIR_STRLEN_MED];
--- 341,345 ----
int
! _nrrdEncodingMaybeSet(NrrdIoState *nio) {
char me[]="_nrrdEncodingMaybeSet", err[AIR_STRLEN_MED];
***************
*** 366,370 ****
*/
int
! _nrrdFormatMaybeGuess (const Nrrd *nrrd, NrrdIO *nio, const char *filename) {
char me[]="_nrrdFormatMaybeGuess", err[AIR_STRLEN_MED], mesg[AIR_STRLEN_MED];
int fi, guessed, available, fits;
--- 366,370 ----
*/
int
! _nrrdFormatMaybeGuess (const Nrrd *nrrd, NrrdIoState *nio, const char *filename) {
char me[]="_nrrdFormatMaybeGuess", err[AIR_STRLEN_MED], mesg[AIR_STRLEN_MED];
int fi, guessed, available, fits;
***************
*** 415,419 ****
int
! _nrrdFormatMaybeSet(NrrdIO *nio) {
char me[]="_nrrdFormatMaybeSet", err[AIR_STRLEN_MED];
--- 415,419 ----
int
! _nrrdFormatMaybeSet(NrrdIoState *nio) {
char me[]="_nrrdFormatMaybeSet", err[AIR_STRLEN_MED];
***************
*** 441,445 ****
*/
int
! nrrdWrite (FILE *file, const Nrrd *nrrd, NrrdIO *nio) {
char me[]="nrrdWrite", err[AIR_STRLEN_MED];
airArray *mop;
--- 441,445 ----
*/
int
! nrrdWrite (FILE *file, const Nrrd *nrrd, NrrdIoState *nio) {
char me[]="nrrdWrite", err[AIR_STRLEN_MED];
airArray *mop;
***************
*** 455,464 ****
mop = airMopNew();
if (!nio) {
! nio = nrrdIONew();
if (!nio) {
! sprintf(err, "%s: couldn't alloc local NrrdIO", me);
biffAdd(NRRD, err); airMopError(mop); return 1;
}
! airMopAdd(mop, nio, (airMopper)nrrdIONix, airMopAlways);
}
if (_nrrdEncodingMaybeSet(nio)) {
--- 455,464 ----
mop = airMopNew();
if (!nio) {
! nio = nrrdIoStateNew();
if (!nio) {
! sprintf(err, "%s: couldn't alloc local NrrdIoState", me);
biffAdd(NRRD, err); airMopError(mop); return 1;
}
! airMopAdd(mop, nio, (airMopper)nrrdIoStateNix, airMopAlways);
}
if (_nrrdEncodingMaybeSet(nio)) {
***************
*** 496,500 ****
*/
int
! nrrdSave (const char *filename, const Nrrd *nrrd, NrrdIO *nio) {
char me[]="nrrdSave", err[AIR_STRLEN_MED];
FILE *file;
--- 496,500 ----
*/
int
! nrrdSave (const char *filename, const Nrrd *nrrd, NrrdIoState *nio) {
char me[]="nrrdSave", err[AIR_STRLEN_MED];
FILE *file;
***************
*** 507,516 ****
mop = airMopNew();
if (!nio) {
! nio = nrrdIONew();
if (!nio) {
! sprintf(err, "%s: couldn't alloc local NrrdIO", me);
biffAdd(NRRD, err); return 1;
}
! airMopAdd(mop, nio, (airMopper)nrrdIONix, airMopAlways);
}
if (_nrrdEncodingMaybeSet(nio)) {
--- 507,516 ----
mop = airMopNew();
if (!nio) {
! nio = nrrdIoStateNew();
if (!nio) {
! sprintf(err, "%s: couldn't alloc local NrrdIoState", me);
biffAdd(NRRD, err); return 1;
}
! airMopAdd(mop, nio, (airMopper)nrrdIoStateNix, airMopAlways);
}
if (_nrrdEncodingMaybeSet(nio)) {
|