Mercurial > hg > minc-tools
changeset 1881:d6ba467edc86
Minor changes for Windows compatibility
author | bert <bert> |
---|---|
date | Fri, 15 Oct 2004 13:44:52 +0000 |
parents | 2785fdbe52e2 |
children | 4f060d43902e |
files | libsrc/ParseArgv.h libsrc/dim_conversion.c libsrc/image_conversion.c libsrc/minc.h libsrc/minc_convenience.c libsrc/minc_error.c libsrc/minc_error.h libsrc/minc_private.h libsrc/minc_routines.h libsrc/minc_useful.h libsrc/nd_loop.c libsrc/nd_loop.h libsrc/netcdf_convenience.c libsrc/time_stamp.c libsrc/time_stamp.h libsrc/value_conversion.c libsrc/voxel_loop.c libsrc/voxel_loop.h |
diffstat | 18 files changed, 483 insertions(+), 416 deletions(-) [+] |
line wrap: on
line diff
--- a/libsrc/ParseArgv.h +++ b/libsrc/ParseArgv.h @@ -15,9 +15,10 @@ * * This file has been modified to be used only for argv parsing without * reference to tk, tcl or X11. Base on tk.h from tk2.3 - * $Header: /private-cvsroot/minc/libsrc/ParseArgv.h,v 6.5 2004-02-02 18:21:41 bert Exp $ SPRITE (Berkeley) + * $Header: /private-cvsroot/minc/libsrc/ParseArgv.h,v 6.6 2004-10-15 13:44:52 bert Exp $ SPRITE (Berkeley) */ +#include "minc.h" /* * Definitions that allow this header file to be used either with or * without ANSI C features like function prototypes. @@ -84,7 +85,7 @@ extern "C" { #endif -extern int ParseArgv _ANSI_ARGS_((int *argcPtr, char **argv, +MNCAPI int ParseArgv _ANSI_ARGS_((int *argcPtr, char **argv, ArgvInfo *argTable, int flags)); #if defined(__cplusplus)
--- a/libsrc/dim_conversion.c +++ b/libsrc/dim_conversion.c @@ -18,7 +18,10 @@ @CREATED : September 9, 1992. (Peter Neelin) @MODIFIED : * $Log: dim_conversion.c,v $ - * Revision 6.3 2003-11-14 16:52:24 stever + * Revision 6.4 2004-10-15 13:44:52 bert + * Minor changes for Windows compatibility + * + * Revision 6.3 2003/11/14 16:52:24 stever * More last-minute fixes. * * Revision 6.2 2003/09/18 16:16:15 bert @@ -80,24 +83,24 @@ ---------------------------------------------------------------------------- */ #ifndef lint -static char rcsid[] = "$Header: /private-cvsroot/minc/libsrc/dim_conversion.c,v 6.3 2003-11-14 16:52:24 stever Exp $ MINC (MNI)"; +static char rcsid[] = "$Header: /private-cvsroot/minc/libsrc/dim_conversion.c,v 6.4 2004-10-15 13:44:52 bert Exp $ MINC (MNI)"; #endif +#include "minc_private.h" #include <math.h> #include <type_limits.h> -#include <minc_private.h> /* Private functions */ -private int MI_icv_get_dim(mi_icv_type *icvp, int cdfid, int varid); -private int MI_get_dim_flip(mi_icv_type *icvp, int cdfid, int dimvid[], +PRIVATE int MI_icv_get_dim(mi_icv_type *icvp, int cdfid, int varid); +PRIVATE int MI_get_dim_flip(mi_icv_type *icvp, int cdfid, int dimvid[], int subsc[]); -private int MI_get_dim_scale(mi_icv_type *icvp, int cdfid, int dimvid[]); -private int MI_get_dim_bufsize_step(mi_icv_type *icvp, int subsc[]); -private int MI_icv_get_dim_conversion(mi_icv_type *icvp, int subsc[]); -private int MI_icv_dimconvert(int operation, mi_icv_type *icvp, +PRIVATE int MI_get_dim_scale(mi_icv_type *icvp, int cdfid, int dimvid[]); +PRIVATE int MI_get_dim_bufsize_step(mi_icv_type *icvp, int subsc[]); +PRIVATE int MI_icv_get_dim_conversion(mi_icv_type *icvp, int subsc[]); +PRIVATE int MI_icv_dimconvert(int operation, mi_icv_type *icvp, long start[], long count[], void *values, long bufstart[], long bufcount[], void *buffer); -private int MI_icv_dimconv_init(int operation, mi_icv_type *icvp, +PRIVATE int MI_icv_dimconv_init(int operation, mi_icv_type *icvp, mi_icv_dimconv_type *dcp, long start[], long count[], void *values, long bufstart[], long bufcount[], void *buffer); @@ -120,7 +123,7 @@ @CREATED : September 9, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int miicv_attach(int icvid, int cdfid, int varid) +MNCAPI int miicv_attach(int icvid, int cdfid, int varid) { mi_icv_type *icvp; /* Pointer to icv structure */ long size_diff, user_dim_size; @@ -199,7 +202,7 @@ @CREATED : August 10, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_icv_get_dim(mi_icv_type *icvp, int cdfid, int varid) +PRIVATE int MI_icv_get_dim(mi_icv_type *icvp, int cdfid, int varid) /* ARGSUSED */ { int oldncopts; /* For saving value of ncopts */ @@ -278,7 +281,7 @@ @CREATED : September 1, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_get_dim_flip(mi_icv_type *icvp, int cdfid, int dimvid[], +PRIVATE int MI_get_dim_flip(mi_icv_type *icvp, int cdfid, int dimvid[], int subsc[]) { int oldncopts; /* For saving value of ncopts */ @@ -349,7 +352,7 @@ @CREATED : September 1, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_get_dim_scale(mi_icv_type *icvp, int cdfid, int dimvid[]) +PRIVATE int MI_get_dim_scale(mi_icv_type *icvp, int cdfid, int dimvid[]) { int oldncopts; /* For saving value of ncopts */ int min_grow, dim_grow; @@ -500,7 +503,7 @@ @CREATED : September 3, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_get_dim_bufsize_step(mi_icv_type *icvp, int subsc[]) +PRIVATE int MI_get_dim_bufsize_step(mi_icv_type *icvp, int subsc[]) { int idim; @@ -542,7 +545,7 @@ @CREATED : September 8, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_icv_get_dim_conversion(mi_icv_type *icvp, int subsc[]) +PRIVATE int MI_icv_get_dim_conversion(mi_icv_type *icvp, int subsc[]) /* ARGSUSED */ { int idim; @@ -612,7 +615,7 @@ @CREATED : August 27, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_icv_dimconvert(int operation, mi_icv_type *icvp, +PRIVATE int MI_icv_dimconvert(int operation, mi_icv_type *icvp, long start[], long count[], void *values, long bufstart[], long bufcount[], void *buffer) { @@ -793,7 +796,7 @@ @CREATED : September 4, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_icv_dimconv_init(int operation, mi_icv_type *icvp, +PRIVATE int MI_icv_dimconv_init(int operation, mi_icv_type *icvp, mi_icv_dimconv_type *dcp, long start[], long count[], void *values, long bufstart[], long bufcount[], void *buffer)
--- a/libsrc/image_conversion.c +++ b/libsrc/image_conversion.c @@ -34,7 +34,10 @@ @CREATED : July 27, 1992. (Peter Neelin, Montreal Neurological Institute) @MODIFIED : * $Log: image_conversion.c,v $ - * Revision 6.11 2004-04-27 15:40:22 bert + * Revision 6.12 2004-10-15 13:45:28 bert + * Minor changes for Windows compatibility + * + * Revision 6.11 2004/04/27 15:40:22 bert * Revised logging/error handling * * Revision 6.10 2003/09/18 16:17:00 bert @@ -150,24 +153,24 @@ ---------------------------------------------------------------------------- */ #ifndef lint -static char rcsid[] = "$Header: /private-cvsroot/minc/libsrc/image_conversion.c,v 6.11 2004-04-27 15:40:22 bert Exp $ MINC (MNI)"; +static char rcsid[] = "$Header: /private-cvsroot/minc/libsrc/image_conversion.c,v 6.12 2004-10-15 13:45:28 bert Exp $ MINC (MNI)"; #endif -#include <type_limits.h> -#include <minc_private.h> +#include "type_limits.h" +#include "minc_private.h" /* Private functions */ -private int MI_icv_get_type(mi_icv_type *icvp, int cdfid, int varid); -private int MI_icv_get_vrange(mi_icv_type *icvp, int cdfid, int varid); -private double MI_get_default_range(char *what, nc_type datatype, int sign); -private int MI_icv_get_norm(mi_icv_type *icvp, int cdfid, int varid); -private int MI_icv_access(int operation, mi_icv_type *icvp, long start[], +PRIVATE int MI_icv_get_type(mi_icv_type *icvp, int cdfid, int varid); +PRIVATE int MI_icv_get_vrange(mi_icv_type *icvp, int cdfid, int varid); +PRIVATE double MI_get_default_range(char *what, nc_type datatype, int sign); +PRIVATE int MI_icv_get_norm(mi_icv_type *icvp, int cdfid, int varid); +PRIVATE int MI_icv_access(int operation, mi_icv_type *icvp, long start[], long count[], void *values); -private int MI_icv_zero_buffer(mi_icv_type *icvp, long count[], void *values); -private int MI_icv_coords_tovar(mi_icv_type *icvp, +PRIVATE int MI_icv_zero_buffer(mi_icv_type *icvp, long count[], void *values); +PRIVATE int MI_icv_coords_tovar(mi_icv_type *icvp, long icv_start[], long icv_count[], long var_start[], long var_count[]); -private int MI_icv_calc_scale(int operation, mi_icv_type *icvp, long coords[]); +PRIVATE int MI_icv_calc_scale(int operation, mi_icv_type *icvp, long coords[]); /* Array of pointers to image conversion structures */ static int minc_icv_list_nalloc = 0; @@ -186,7 +189,7 @@ @CREATED : August 7, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int miicv_create() +MNCAPI int miicv_create() { int new_icv; /* Id of newly created icv */ mi_icv_type *icvp; /* Pointer to new icv structure */ @@ -299,7 +302,7 @@ @CREATED : August 7, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int miicv_free(int icvid) +MNCAPI int miicv_free(int icvid) { mi_icv_type *icvp; @@ -342,7 +345,7 @@ @CREATED : August 7, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int miicv_setdbl(int icvid, int icv_property, double value) +MNCAPI int miicv_setdbl(int icvid, int icv_property, double value) { int ival, idim; mi_icv_type *icvp; @@ -460,7 +463,7 @@ @MODIFIED : January 22, 1993 (P.N.) - modified handling of icv properties ---------------------------------------------------------------------------- */ -public int miicv_setint(int icvid, int icv_property, int value) +MNCAPI int miicv_setint(int icvid, int icv_property, int value) { MI_SAVE_ROUTINE_NAME("miicv_setint"); @@ -488,7 +491,7 @@ @CREATED : January 22, 1993 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int miicv_setlong(int icvid, int icv_property, long value) +MNCAPI int miicv_setlong(int icvid, int icv_property, long value) { MI_SAVE_ROUTINE_NAME("miicv_setlong"); @@ -516,7 +519,7 @@ @CREATED : January 22, 1993 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int miicv_setstr(int icvid, int icv_property, char *value) +MNCAPI int miicv_setstr(int icvid, int icv_property, char *value) { mi_icv_type *icvp; @@ -602,7 +605,7 @@ @CREATED : January 22, 1993 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int miicv_inqdbl(int icvid, int icv_property, double *value) +MNCAPI int miicv_inqdbl(int icvid, int icv_property, double *value) { int idim; mi_icv_type *icvp; @@ -719,7 +722,7 @@ @CREATED : January 22, 1993 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int miicv_inqint(int icvid, int icv_property, int *value) +MNCAPI int miicv_inqint(int icvid, int icv_property, int *value) { double dvalue; @@ -747,7 +750,7 @@ @CREATED : January 22, 1993 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int miicv_inqlong(int icvid, int icv_property, long *value) +MNCAPI int miicv_inqlong(int icvid, int icv_property, long *value) { double dvalue; @@ -776,7 +779,7 @@ @CREATED : @MODIFIED : ---------------------------------------------------------------------------- */ -public int miicv_inqstr(int icvid, int icv_property, char *value) +MNCAPI int miicv_inqstr(int icvid, int icv_property, char *value) { mi_icv_type *icvp; @@ -873,7 +876,7 @@ @CREATED : September 9, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int miicv_ndattach(int icvid, int cdfid, int varid) +MNCAPI int miicv_ndattach(int icvid, int cdfid, int varid) { mi_icv_type *icvp; /* Pointer to icv structure */ int idim; @@ -968,7 +971,7 @@ @CREATED : August 10, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_icv_get_type(mi_icv_type *icvp, int cdfid, int varid) +PRIVATE int MI_icv_get_type(mi_icv_type *icvp, int cdfid, int varid) { int oldncopts; /* For saving value of ncopts */ char stringa[MI_MAX_ATTSTR_LEN]; @@ -1015,7 +1018,7 @@ @CREATED : August 10, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_icv_get_vrange(mi_icv_type *icvp, int cdfid, int varid) +PRIVATE int MI_icv_get_vrange(mi_icv_type *icvp, int cdfid, int varid) { double vrange[2]; /* Valid range buffer */ @@ -1046,7 +1049,7 @@ @CREATED : August 10, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private double MI_get_default_range(char *what, nc_type datatype, int sign) +PRIVATE double MI_get_default_range(char *what, nc_type datatype, int sign) { double range[2]; @@ -1082,7 +1085,7 @@ @CREATED : August 10, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_icv_get_norm(mi_icv_type *icvp, int cdfid, int varid) +PRIVATE int MI_icv_get_norm(mi_icv_type *icvp, int cdfid, int varid) /* ARGSUSED */ { int oldncopts; /* For saving value of ncopts */ @@ -1169,7 +1172,7 @@ @CREATED : August 10, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int miicv_detach(int icvid) +MNCAPI int miicv_detach(int icvid) { mi_icv_type *icvp; int idim; @@ -1217,7 +1220,7 @@ @CREATED : August 10, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int miicv_get(int icvid, long start[], long count[], void *values) +MNCAPI int miicv_get(int icvid, long start[], long count[], void *values) { mi_icv_type *icvp; @@ -1250,7 +1253,7 @@ @CREATED : @MODIFIED : ---------------------------------------------------------------------------- */ -public int miicv_put(int icvid, long start[], long count[], void *values) +MNCAPI int miicv_put(int icvid, long start[], long count[], void *values) { mi_icv_type *icvp; @@ -1283,7 +1286,7 @@ @CREATED : August 11, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_icv_access(int operation, mi_icv_type *icvp, long start[], +PRIVATE int MI_icv_access(int operation, mi_icv_type *icvp, long start[], long count[], void *values) { int *bufsize_step; /* Pointer to array giving increments @@ -1415,7 +1418,7 @@ @CREATED : September 9, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_icv_zero_buffer(mi_icv_type *icvp, long count[], void *values) +PRIVATE int MI_icv_zero_buffer(mi_icv_type *icvp, long count[], void *values) { double zeroval, zerobuf; void *zerostart; @@ -1471,7 +1474,7 @@ @CREATED : September 1, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_icv_coords_tovar(mi_icv_type *icvp, +PRIVATE int MI_icv_coords_tovar(mi_icv_type *icvp, long icv_start[], long icv_count[], long var_start[], long var_count[]) { @@ -1573,7 +1576,7 @@ @CREATED : August 10, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_icv_calc_scale(int operation, mi_icv_type *icvp, long coords[]) +PRIVATE int MI_icv_calc_scale(int operation, mi_icv_type *icvp, long coords[]) { long mmcoords[MAX_VAR_DIMS]; /* Coordinates for max/min variable */ double usr_imgmax, usr_imgmin; @@ -1765,7 +1768,7 @@ @CREATED : August 7, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -semiprivate mi_icv_type *MI_icv_chkid(int icvid) +SEMIPRIVATE mi_icv_type *MI_icv_chkid(int icvid) { MI_SAVE_ROUTINE_NAME("MI_icv_chkid");
--- a/libsrc/minc.h +++ b/libsrc/minc.h @@ -19,7 +19,10 @@ @CREATED : July 24, 1992. (Peter Neelin, Montreal Neurological Institute) @MODIFIED : * $Log: minc.h,v $ - * Revision 6.14 2004-08-11 20:50:54 bert + * Revision 6.15 2004-10-15 13:48:13 bert + * Minor changes for Windows compatibility + * + * Revision 6.14 2004/08/11 20:50:54 bert * Fix incompatibility with netCDF 3.5.1 by fixing MI_MAX_IMGDIMS at 100 * * Revision 6.13 2004/06/04 18:14:52 bert @@ -128,7 +131,7 @@ make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. -@RCSID : $Header: /private-cvsroot/minc/libsrc/minc.h,v 6.14 2004-08-11 20:50:54 bert Exp $ MINC (MNI) +@RCSID : $Header: /private-cvsroot/minc/libsrc/minc.h,v 6.15 2004-10-15 13:48:13 bert Exp $ MINC (MNI) ---------------------------------------------------------------------------- */ #include <netcdf.h> @@ -454,100 +457,99 @@ #define MI_ERR_UNCOMPRESS 1349 /* Not able to uncompress file */ /* MINC public functions */ -/* Define public constant */ -#ifndef public -#define public -#define MINC_NEED_TO_UNDEF_PUBLIC -#endif +#ifndef MNCAPI +#if defined(_MSC_VER) +/* If we are building on the Microsoft C compiler, we want to + * explicitly import all public functions from the DLL + */ +#define MNCAPI __declspec(dllimport) +#else +#define MNCAPI +#endif /* _MSC_VER not defined */ +#endif /* MNCAPI not defined */ /* From netcdf_convenience.c */ -public char *miexpand_file(char *path, char *tempfile, +MNCAPI char *miexpand_file(char *path, char *tempfile, int header_only, int *created_tempfile); -public int miopen(char *path, int mode); -public int micreate(char *path, int cmode); -public int miclose(int cdfid); -public int miattget_with_sign(int cdfid, int varid, char *name, +MNCAPI int miopen(char *path, int mode); +MNCAPI int micreate(char *path, int cmode); +MNCAPI int miclose(int cdfid); +MNCAPI int miattget_with_sign(int cdfid, int varid, char *name, char *insign, nc_type datatype, char *outsign, int max_length, void *value, int *att_length); -public int miattget(int cdfid, int varid, char *name, nc_type datatype, +MNCAPI int miattget(int cdfid, int varid, char *name, nc_type datatype, int max_length, void *value, int *att_length); -public int miattget1(int cdfid, int varid, char *name, nc_type datatype, +MNCAPI int miattget1(int cdfid, int varid, char *name, nc_type datatype, void *value); -public char *miattgetstr(int cdfid, int varid, char *name, +MNCAPI char *miattgetstr(int cdfid, int varid, char *name, int maxlen, char *value); -public int miattputint(int cdfid, int varid, char *name, int value); -public int miattputdbl(int cdfid, int varid, char *name, double value); -public int miattputstr(int cdfid, int varid, char *name, char *value); -public int mivarget(int cdfid, int varid, long start[], long count[], +MNCAPI int miattputint(int cdfid, int varid, char *name, int value); +MNCAPI int miattputdbl(int cdfid, int varid, char *name, double value); +MNCAPI int miattputstr(int cdfid, int varid, char *name, char *value); +MNCAPI int mivarget(int cdfid, int varid, long start[], long count[], nc_type datatype, char *sign, void *values); -public int mivarget1(int cdfid, int varid, long mindex[], +MNCAPI int mivarget1(int cdfid, int varid, long mindex[], nc_type datatype, char *sign, void *value); -public int mivarput(int cdfid, int varid, long start[], long count[], +MNCAPI int mivarput(int cdfid, int varid, long start[], long count[], nc_type datatype, char *sign, void *values); -public int mivarput1(int cdfid, int varid, long mindex[], +MNCAPI int mivarput1(int cdfid, int varid, long mindex[], nc_type datatype, char *sign, void *value); -public long *miset_coords(int nvals, long value, long coords[]); -public long *mitranslate_coords(int cdfid, +MNCAPI long *miset_coords(int nvals, long value, long coords[]); +MNCAPI long *mitranslate_coords(int cdfid, int invar, long incoords[], int outvar, long outcoords[]); -public int micopy_all_atts(int incdfid, int invarid, +MNCAPI int micopy_all_atts(int incdfid, int invarid, int outcdfid, int outvarid); -public int micopy_var_def(int incdfid, int invarid, int outcdfid); -public int micopy_var_values(int incdfid, int invarid, +MNCAPI int micopy_var_def(int incdfid, int invarid, int outcdfid); +MNCAPI int micopy_var_values(int incdfid, int invarid, int outcdfid, int outvarid); -public int micopy_all_var_defs(int incdfid, int outcdfid, int nexclude, +MNCAPI int micopy_all_var_defs(int incdfid, int outcdfid, int nexclude, int excluded_vars[]); -public int micopy_all_var_values(int incdfid, int outcdfid, int nexclude, +MNCAPI int micopy_all_var_values(int incdfid, int outcdfid, int nexclude, int excluded_vars[]); -public char *micreate_tempfile(void); +MNCAPI char *micreate_tempfile(void); /* From minc_convenience.c */ -public int miget_datatype(int cdfid, int imgid, +MNCAPI int miget_datatype(int cdfid, int imgid, nc_type *datatype, int *is_signed); -public int miget_default_range(nc_type datatype, int is_signed, +MNCAPI int miget_default_range(nc_type datatype, int is_signed, double default_range[]); -public int miget_valid_range(int cdfid, int imgid, double valid_range[]); -public int miset_valid_range(int cdfid, int imgid, double valid_range[]); -public int miget_image_range(int cdfid, double image_range[]); -public int mivar_exists(int cdfid, char *varname); -public int miattput_pointer(int cdfid, int varid, char *name, int ptrvarid); -public int miattget_pointer(int cdfid, int varid, char *name); -public int miadd_child(int cdfid, int parent_varid, int child_varid); -public int micreate_std_variable(int cdfid, char *name, nc_type datatype, +MNCAPI int miget_valid_range(int cdfid, int imgid, double valid_range[]); +MNCAPI int miset_valid_range(int cdfid, int imgid, double valid_range[]); +MNCAPI int miget_image_range(int cdfid, double image_range[]); +MNCAPI int mivar_exists(int cdfid, char *varname); +MNCAPI int miattput_pointer(int cdfid, int varid, char *name, int ptrvarid); +MNCAPI int miattget_pointer(int cdfid, int varid, char *name); +MNCAPI int miadd_child(int cdfid, int parent_varid, int child_varid); +MNCAPI int micreate_std_variable(int cdfid, char *name, nc_type datatype, int ndims, int dim[]); -public int micreate_group_variable(int cdfid, char *name); -public const char *miget_version(void); -public int miappend_history(int fd, const char *tm_stamp); -public int micreate_ident(char * id_str, size_t length); +MNCAPI int micreate_group_variable(int cdfid, char *name); +MNCAPI const char *miget_version(void); +MNCAPI int miappend_history(int fd, const char *tm_stamp); +MNCAPI int micreate_ident(char * id_str, size_t length); /* From image_conversion.c */ -public int miicv_create(void); -public int miicv_free(int icvid); -public int miicv_setdbl(int icvid, int icv_property, double value); -public int miicv_setint(int icvid, int icv_property, int value); -public int miicv_setlong(int icvid, int icv_property, long value); -public int miicv_setstr(int icvid, int icv_property, char *value); -public int miicv_inqdbl(int icvid, int icv_property, double *value); -public int miicv_inqint(int icvid, int icv_property, int *value); -public int miicv_inqlong(int icvid, int icv_property, long *value); -public int miicv_inqstr(int icvid, int icv_property, char *value); -public int miicv_ndattach(int icvid, int cdfid, int varid); -public int miicv_detach(int icvid); -public int miicv_get(int icvid, long start[], long count[], void *values); -public int miicv_put(int icvid, long start[], long count[], void *values); +MNCAPI int miicv_create(void); +MNCAPI int miicv_free(int icvid); +MNCAPI int miicv_setdbl(int icvid, int icv_property, double value); +MNCAPI int miicv_setint(int icvid, int icv_property, int value); +MNCAPI int miicv_setlong(int icvid, int icv_property, long value); +MNCAPI int miicv_setstr(int icvid, int icv_property, char *value); +MNCAPI int miicv_inqdbl(int icvid, int icv_property, double *value); +MNCAPI int miicv_inqint(int icvid, int icv_property, int *value); +MNCAPI int miicv_inqlong(int icvid, int icv_property, long *value); +MNCAPI int miicv_inqstr(int icvid, int icv_property, char *value); +MNCAPI int miicv_ndattach(int icvid, int cdfid, int varid); +MNCAPI int miicv_detach(int icvid); +MNCAPI int miicv_get(int icvid, long start[], long count[], void *values); +MNCAPI int miicv_put(int icvid, long start[], long count[], void *values); /* From dim_conversion.c */ -public int miicv_attach(int icvid, int cdfid, int varid); +MNCAPI int miicv_attach(int icvid, int cdfid, int varid); /* From minc_error.c */ -public void milog_init(const char *); -public int milog_set_verbosity(int); - -/* Undefine public if needed */ -#ifdef MINC_NEED_TO_UNDEF_PUBLIC -#undef public -#undef MINC_NEED_TO_UNDEF_PUBLIC -#endif +MNCAPI void milog_init(const char *); +MNCAPI int milog_set_verbosity(int); #ifdef MINC2
--- a/libsrc/minc_convenience.c +++ b/libsrc/minc_convenience.c @@ -30,7 +30,10 @@ @CREATED : July 27, 1992. (Peter Neelin, Montreal Neurological Institute) @MODIFIED : * $Log: minc_convenience.c,v $ - * Revision 6.15 2004-08-26 16:14:21 bert + * Revision 6.16 2004-10-15 13:46:15 bert + * Minor changes for Windows compatibility + * + * Revision 6.15 2004/08/26 16:14:21 bert * Fix up miappend_history() again * * Revision 6.14 2004/06/04 18:15:46 bert @@ -128,32 +131,31 @@ ---------------------------------------------------------------------------- */ #ifndef lint -static char rcsid[] = "$Header: /private-cvsroot/minc/libsrc/minc_convenience.c,v 6.15 2004-08-26 16:14:21 bert Exp $ MINC (MNI)"; +static char rcsid[] = "$Header: /private-cvsroot/minc/libsrc/minc_convenience.c,v 6.16 2004-10-15 13:46:15 bert Exp $ MINC (MNI)"; #endif -#include "config.h" -#include <type_limits.h> -#include <minc_private.h> -#include <minc_varlists.h> +#include "minc_private.h" +#include "type_limits.h" +#include "minc_varlists.h" #include <time.h> /* Private functions */ -private int MI_create_dim_variable(int cdfid, char *name, +PRIVATE int MI_create_dim_variable(int cdfid, char *name, nc_type datatype, int ndims); -private int MI_create_dimwidth_variable(int cdfid, char *name, +PRIVATE int MI_create_dimwidth_variable(int cdfid, char *name, nc_type datatype, int ndims); -private int MI_create_image_variable(int cdfid, char *name, nc_type datatype, +PRIVATE int MI_create_image_variable(int cdfid, char *name, nc_type datatype, int ndims, int dim[]); -private int MI_create_imaxmin_variable(int cdfid, char *name, nc_type datatype, +PRIVATE int MI_create_imaxmin_variable(int cdfid, char *name, nc_type datatype, int ndims, int dim[]); -private int MI_verify_maxmin_dims(int cdfid, +PRIVATE int MI_verify_maxmin_dims(int cdfid, int image_ndims, int image_dim[], int maxmin_ndims, int maxmin_dim[]); -private int MI_create_root_variable(int cdfid, char *name); -private int MI_create_simple_variable(int cdfid, char *name); -private int MI_add_stdgroup(int cdfid, int varid); -private int MI_is_in_list(char *string, char *list[]); +PRIVATE int MI_create_root_variable(int cdfid, char *name); +PRIVATE int MI_create_simple_variable(int cdfid, char *name); +PRIVATE int MI_add_stdgroup(int cdfid, int varid); +PRIVATE int MI_is_in_list(char *string, char *list[]); /* ----------------------------- MNI Header ----------------------------------- @@ -170,7 +172,7 @@ @CREATED : August 15, 2001 @MODIFIED : ---------------------------------------------------------------------------- */ -public int miget_datatype(int cdfid, int imgid, +MNCAPI int miget_datatype(int cdfid, int imgid, nc_type *datatype, int *is_signed) { int old_ncopts; @@ -230,7 +232,7 @@ @CREATED : August 15, 2001 @MODIFIED : ---------------------------------------------------------------------------- */ -public int miget_default_range(nc_type datatype, int is_signed, +MNCAPI int miget_default_range(nc_type datatype, int is_signed, double default_range[]) { MI_SAVE_ROUTINE_NAME("miget_default_range"); @@ -282,7 +284,7 @@ @CREATED : August 15, 2001 @MODIFIED : ---------------------------------------------------------------------------- */ -public int miget_valid_range(int cdfid, int imgid, double valid_range[]) +MNCAPI int miget_valid_range(int cdfid, int imgid, double valid_range[]) { int old_ncopts; int status; @@ -382,7 +384,7 @@ @CREATED : August 15, 2001 @MODIFIED : ---------------------------------------------------------------------------- */ -public int miset_valid_range(int cdfid, int imgid, double valid_range[]) +MNCAPI int miset_valid_range(int cdfid, int imgid, double valid_range[]) { nc_type datatype; int is_signed; @@ -437,7 +439,7 @@ @CREATED : October 19, 2001 @MODIFIED : ---------------------------------------------------------------------------- */ -public int miget_image_range(int cdfid, double image_range[]) +MNCAPI int miget_image_range(int cdfid, double image_range[]) { int oldncopts; /* For saving value of ncopt */ int vid[2]; /* Variable ids for min and max */ @@ -571,7 +573,7 @@ @CREATED : October 22, 2001 @MODIFIED : ---------------------------------------------------------------------------- */ -public int mivar_exists(int cdfid, char *varname) +MNCAPI int mivar_exists(int cdfid, char *varname) { int oldncopts; /* For saving value of ncopt */ int exists; /* Flag */ @@ -605,7 +607,7 @@ @CREATED : August 5, 1992 @MODIFIED : ---------------------------------------------------------------------------- */ -public int miattput_pointer(int cdfid, int varid, char *name, int ptrvarid) +MNCAPI int miattput_pointer(int cdfid, int varid, char *name, int ptrvarid) { /* String to hold pointer to variable */ char pointer_string[MAX_NC_NAME+sizeof(MI_VARATT_POINTER_PREFIX)]; @@ -652,7 +654,7 @@ @CREATED : August 5, 1992 @MODIFIED : ---------------------------------------------------------------------------- */ -public int miattget_pointer(int cdfid, int varid, char *name) +MNCAPI int miattget_pointer(int cdfid, int varid, char *name) { /* Character string to hold attribute */ char pointer_string[MAX_NC_NAME+sizeof(MI_VARATT_POINTER_PREFIX)]; @@ -698,7 +700,7 @@ @CREATED : August 5, 1992 @MODIFIED : ---------------------------------------------------------------------------- */ -public int miadd_child(int cdfid, int parent_varid, int child_varid) +MNCAPI int miadd_child(int cdfid, int parent_varid, int child_varid) { char *child_list; /* Pointer to string list of children */ int child_list_size; /* Length of child list string */ @@ -803,7 +805,7 @@ @CREATED : August 5, 1992 @MODIFIED : ---------------------------------------------------------------------------- */ -public int micreate_std_variable(int cdfid, char *name, nc_type datatype, +MNCAPI int micreate_std_variable(int cdfid, char *name, nc_type datatype, int ndims, int dim[]) { int varid; /* Created variable id */ @@ -871,7 +873,7 @@ @CREATED : August 5, 1992 @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_create_dim_variable(int cdfid, char *name, +PRIVATE int MI_create_dim_variable(int cdfid, char *name, nc_type datatype, int ndims) { int dimid; /* Dimension id (for dimensions variables) */ @@ -945,7 +947,7 @@ @CREATED : August 5, 1992 @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_create_dimwidth_variable(int cdfid, char *name, +PRIVATE int MI_create_dimwidth_variable(int cdfid, char *name, nc_type datatype, int ndims) { int dimid; /* Dimension id (for dimensions variables) */ @@ -1004,7 +1006,7 @@ @CREATED : August 6, 1992 @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_create_image_variable(int cdfid, char *name, nc_type datatype, +PRIVATE int MI_create_image_variable(int cdfid, char *name, nc_type datatype, int ndims, int dim[]) { int varid; /* Created variable id */ @@ -1075,7 +1077,7 @@ @CREATED : August 6, 1992 @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_create_imaxmin_variable(int cdfid, char *name, nc_type datatype, +PRIVATE int MI_create_imaxmin_variable(int cdfid, char *name, nc_type datatype, int ndims, int dim[]) { int varid; /* Created variable id */ @@ -1154,7 +1156,7 @@ @CREATED : August 7, 1992 @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_verify_maxmin_dims(int cdfid, +PRIVATE int MI_verify_maxmin_dims(int cdfid, int image_ndims, int image_dim[], int maxmin_ndims, int maxmin_dim[]) { @@ -1197,7 +1199,7 @@ @CREATED : August 6, 1992 @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_create_root_variable(int cdfid, char *name) +PRIVATE int MI_create_root_variable(int cdfid, char *name) { int varid; /* Created variable id */ @@ -1232,7 +1234,7 @@ @CREATED : August 6, 1992 @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_create_simple_variable(int cdfid, char *name) +PRIVATE int MI_create_simple_variable(int cdfid, char *name) { int varid; /* Created variable id */ @@ -1263,7 +1265,7 @@ @CREATED : August 6, 1992 @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_add_stdgroup(int cdfid, int varid) +PRIVATE int MI_add_stdgroup(int cdfid, int varid) { int root_varid; /* Id of root variable */ int oldncopts; /* Old value of ncopts */ @@ -1306,7 +1308,7 @@ @CREATED : August 6, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int micreate_group_variable(int cdfid, char *name) +MNCAPI int micreate_group_variable(int cdfid, char *name) { int varid; @@ -1333,7 +1335,7 @@ @CREATED : January 1, 2004 (Bert Vincent) @MODIFIED : ---------------------------------------------------------------------------- */ -public int +MNCAPI int miappend_history(int fd, const char *tm_stamp) { nc_type att_type; @@ -1402,7 +1404,7 @@ @CREATED : August 5, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_is_in_list(char *string, char *list[]) +PRIVATE int MI_is_in_list(char *string, char *list[]) { int i; @@ -1428,7 +1430,7 @@ @CREATED : December 8 2003 @MODIFIED : ---------------------------------------------------------------------------- */ -public const char * miget_version(void) +MNCAPI const char * miget_version(void) { return (VERSION); } @@ -1450,7 +1452,7 @@ ---------------------------------------------------------------------------- */ #define MI_IDENT_SEP ':' -public int micreate_ident( char * id_str, size_t length ) +MNCAPI int micreate_ident( char * id_str, size_t length ) { static int identx = 1; /* Static ID counter */ time_t now;
--- a/libsrc/minc_error.c +++ b/libsrc/minc_error.c @@ -7,7 +7,10 @@ @CREATED : August 7, 1992 (Peter Neelin) @MODIFIED : * $Log: minc_error.c,v $ - * Revision 6.3 2004-04-27 15:47:25 bert + * Revision 6.4 2004-10-15 13:46:15 bert + * Minor changes for Windows compatibility + * + * Revision 6.3 2004/04/27 15:47:25 bert * Move most message text into this file * * Revision 6.2 2001/04/17 18:40:13 neelin @@ -53,7 +56,7 @@ ---------------------------------------------------------------------------- */ #ifndef lint -static char rcsid[] = "$Header: /private-cvsroot/minc/libsrc/minc_error.c,v 6.3 2004-04-27 15:47:25 bert Exp $ MINC (MNI)"; +static char rcsid[] = "$Header: /private-cvsroot/minc/libsrc/minc_error.c,v 6.4 2004-10-15 13:46:15 bert Exp $ MINC (MNI)"; #endif #include <errno.h> @@ -121,35 +124,35 @@ { MI_MSG_ERROR, "Illegal variable access operation" } /* MI_MSG_BADOP */ }; -semiprivate int MI_save_routine_name(char *name) +SEMIPRIVATE int MI_save_routine_name(char *name) { MI_ROUTINE_VAR = name; return(TRUE); } -semiprivate int MI_return(void) +SEMIPRIVATE int MI_return(void) { return(TRUE); } -semiprivate int MI_return_error(void) +SEMIPRIVATE int MI_return_error(void) { MI_LOG_PKG_ERROR2(0, "MINC package entry point"); return(TRUE); } -semiprivate void MI_log_pkg_error2(int p1, char *p2) +SEMIPRIVATE void MI_log_pkg_error2(int p1, char *p2) { (void) fprintf(stderr, "%s: ", MI_ROUTINE_VAR); (void) fprintf(stderr, p2); (void) fputc('\n', stderr); (void) fflush(stderr); } -semiprivate void MI_log_pkg_error3(int p1, char *p2, char *p3) +SEMIPRIVATE void MI_log_pkg_error3(int p1, char *p2, char *p3) { (void) fprintf(stderr, "%s: ", MI_ROUTINE_VAR); (void) fprintf(stderr, p2, p3); (void) fputc('\n', stderr); (void) fflush(stderr); } -semiprivate void MI_log_sys_error1(char *p1) +SEMIPRIVATE void MI_log_sys_error1(char *p1) { char *message; int errnum = errno; @@ -177,7 +180,7 @@ MI_MSG_ERROR, {""}, NULL }; -public void milog_init(const char *name) +MNCAPI void milog_init(const char *name) { char *fname_str = miget_cfg_str(MICFG_LOGFILE); int level = miget_cfg_int(MICFG_LOGLEVEL); @@ -208,14 +211,14 @@ } } -public int milog_set_verbosity(int lvl) +MNCAPI int milog_set_verbosity(int lvl) { int lvl_prev = _MI_log.level; _MI_log.level = lvl; return (lvl_prev); } -public int milog_message(mimsgcode_t code, ...) +MNCAPI int milog_message(mimsgcode_t code, ...) { va_list ap; int lvl;
--- a/libsrc/minc_error.h +++ b/libsrc/minc_error.h @@ -7,7 +7,10 @@ @MODIFIED : * * $Log: minc_error.h,v $ - * Revision 6.1 2004-04-27 15:42:47 bert + * Revision 6.2 2004-10-15 13:46:15 bert + * Minor changes for Windows compatibility + * + * Revision 6.1 2004/04/27 15:42:47 bert * Define MINC logging codes * * @@ -90,5 +93,5 @@ MI_MSG_BADOP } mimsgcode_t; -semiprivate int milog_message(mimsgcode_t code, ...); +SEMIPRIVATE int milog_message(mimsgcode_t code, ...); #endif /* _MINC_ERROR_H_ not defined */
--- a/libsrc/minc_private.h +++ b/libsrc/minc_private.h @@ -14,7 +14,10 @@ @CREATED : July 29, 1992 (Peter Neelin) @MODIFIED : * $Log: minc_private.h,v $ - * Revision 6.2 2004-04-27 15:47:47 bert + * Revision 6.3 2004-10-15 13:47:31 bert + * Minor changes for Windows compatibility + * + * Revision 6.2 2004/04/27 15:47:47 bert * #include minc_config.h and minc_error.h * * Revision 6.1 1999/10/19 14:45:09 neelin @@ -57,18 +60,28 @@ make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. -@RCSID : $Header: /private-cvsroot/minc/libsrc/minc_private.h,v 6.2 2004-04-27 15:47:47 bert Exp $ MINC (MNI) +@RCSID : $Header: /private-cvsroot/minc/libsrc/minc_private.h,v 6.3 2004-10-15 13:47:31 bert Exp $ MINC (MNI) ---------------------------------------------------------------------------- */ +#if defined(_MSC_VER) +/* If we are building on the Microsoft C compiler, we want to + * explicitly export all public functions from the DLL + */ +#define MNCAPI __declspec(dllexport) +#else +#define MNCAPI +#endif + +#include "config.h" #include <stdlib.h> #include <stdio.h> #include <string.h> #include <memory.h> -#include <minc.h> -#include <minc_useful.h> -#include <minc_basic.h> -#include <minc_structures.h> -#include <minc_routines.h> -#include <minc_config.h> -#include <minc_error.h> +#include "minc.h" +#include "minc_useful.h" +#include "minc_basic.h" +#include "minc_structures.h" +#include "minc_routines.h" +#include "minc_config.h" +#include "minc_error.h" #endif
--- a/libsrc/minc_routines.h +++ b/libsrc/minc_routines.h @@ -13,7 +13,10 @@ @CREATED : August 28, 1992 (Peter Neelin) @MODIFIED : * $Log: minc_routines.h,v $ - * Revision 6.1 1999-10-19 14:45:10 neelin + * Revision 6.2 2004-10-15 13:47:39 bert + * Minor changes for Windows compatibility + * + * Revision 6.1 1999/10/19 14:45:10 neelin * Fixed Log subsitutions for CVS * * Revision 6.0 1997/09/12 13:24:54 neelin @@ -53,38 +56,38 @@ make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. -@RCSID : $Header: /private-cvsroot/minc/libsrc/minc_routines.h,v 6.1 1999-10-19 14:45:10 neelin Exp $ MINC (MNI) +@RCSID : $Header: /private-cvsroot/minc/libsrc/minc_routines.h,v 6.2 2004-10-15 13:47:39 bert Exp $ MINC (MNI) ---------------------------------------------------------------------------- */ /* MINC routines that should only be visible to the package (semiprivate) */ /* From minc_error.c */ -semiprivate int MI_save_routine_name(char *name); -semiprivate int MI_return(void); -semiprivate int MI_return_error(void); -semiprivate void MI_log_pkg_error2(int p1, char *p2); -semiprivate void MI_log_pkg_error3(int p1, char *p2, char *p3); -semiprivate void MI_log_sys_error1(char *p1); +SEMIPRIVATE int MI_save_routine_name(char *name); +SEMIPRIVATE int MI_return(void); +SEMIPRIVATE int MI_return_error(void); +SEMIPRIVATE void MI_log_pkg_error2(int p1, char *p2); +SEMIPRIVATE void MI_log_pkg_error3(int p1, char *p2, char *p3); +SEMIPRIVATE void MI_log_sys_error1(char *p1); /* From value_conversion.c */ -semiprivate int MI_varaccess(int operation, int cdfid, int varid, +SEMIPRIVATE int MI_varaccess(int operation, int cdfid, int varid, long start[], long count[], nc_type datatype, int sign, void *values, int *bufsize_step, mi_icv_type *icvp); -semiprivate int MI_var_loop(int ndims, long start[], long count[], +SEMIPRIVATE int MI_var_loop(int ndims, long start[], long count[], int value_size, int *bufsize_step, long max_buffer_size, void *caller_data, int (*action_func) (int, long [], long [], long, void *, void *)); -semiprivate int MI_get_sign_from_string(nc_type datatype, char *sign); -semiprivate int MI_convert_type(long number_of_values, +SEMIPRIVATE int MI_get_sign_from_string(nc_type datatype, char *sign); +SEMIPRIVATE int MI_convert_type(long number_of_values, nc_type intype, int insign, void *invalues, nc_type outtype, int outsign, void *outvalues, mi_icv_type *icvp); /* From image_conversion.c */ -semiprivate mi_icv_type *MI_icv_chkid(int icvid); +SEMIPRIVATE mi_icv_type *MI_icv_chkid(int icvid); #endif
--- a/libsrc/minc_useful.h +++ b/libsrc/minc_useful.h @@ -15,7 +15,10 @@ @CREATED : July 15, 1991 David MacDonald @MODIFIED : * $Log: minc_useful.h,v $ - * Revision 6.1 1999-10-19 14:45:10 neelin + * Revision 6.2 2004-10-15 13:47:55 bert + * Minor changes for Windows compatibility + * + * Revision 6.1 1999/10/19 14:45:10 neelin * Fixed Log subsitutions for CVS * * Revision 6.0 1997/09/12 13:24:54 neelin @@ -55,7 +58,7 @@ make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. -@RCSID : $Header: /private-cvsroot/minc/libsrc/minc_useful.h,v 6.1 1999-10-19 14:45:10 neelin Exp $ MINC (MNI) +@RCSID : $Header: /private-cvsroot/minc/libsrc/minc_useful.h,v 6.2 2004-10-15 13:47:55 bert Exp $ MINC (MNI) ---------------------------------------------------------------------------- */ /* ------------ define signed for vaxes ----------------- */ @@ -65,11 +68,11 @@ /* --------- define the prefixes to all functions ---------- */ -#ifndef public -# define public +#ifndef MNCAPI +# define MNCAPI #endif -#define private static -#define semiprivate +#define PRIVATE static +#define SEMIPRIVATE /* --------- define TRUE and FALSE ------------------------ */
--- a/libsrc/nd_loop.c +++ b/libsrc/nd_loop.c @@ -6,7 +6,10 @@ @CREATED : March 10, 1994 (Peter Neelin) @MODIFIED : * $Log: nd_loop.c,v $ - * Revision 6.1 2002-01-14 21:28:26 neelin + * Revision 6.2 2004-10-15 13:47:13 bert + * Minor changes for Windows compatibility + * + * Revision 6.1 2002/01/14 21:28:26 neelin * Moved nd_loop, voxel_loop, ParseArgv and time_stamp from ../progs/Proglib * in order to include them in the main minc library. * @@ -47,14 +50,11 @@ ---------------------------------------------------------------------------- */ #ifndef lint -static char rcsid[]="$Header: /private-cvsroot/minc/libsrc/nd_loop.c,v 6.1 2002-01-14 21:28:26 neelin Exp $"; +static char rcsid[]="$Header: /private-cvsroot/minc/libsrc/nd_loop.c,v 6.2 2004-10-15 13:47:13 bert Exp $"; #endif -#include <stdlib.h> -#include <stdio.h> - -/* Constant definition */ -#define public +#include "minc_private.h" +#include "nd_loop.h" /* ----------------------------- MNI Header ----------------------------------- @NAME : nd_begin_looping @@ -70,7 +70,7 @@ @CREATED : October 28, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void nd_begin_looping(long start[], long current[], int ndims) +MNCAPI void nd_begin_looping(long start[], long current[], int ndims) { int idim; @@ -93,7 +93,7 @@ @CREATED : March 10, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int nd_end_of_loop(long current[], long end[], int ndims) +MNCAPI int nd_end_of_loop(long current[], long end[], int ndims) /* ARGSUSED */ { return (current[0] >= end[0]); @@ -116,7 +116,7 @@ @CREATED : October 28, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void nd_update_current_count(long current[], +MNCAPI void nd_update_current_count(long current[], long increment[], long end[], long current_count[], int ndims) @@ -150,7 +150,7 @@ @CREATED : March 10, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void nd_increment_loop(long current[], +MNCAPI void nd_increment_loop(long current[], long start[], long increment[], long end[], int ndims) {
--- a/libsrc/nd_loop.h +++ b/libsrc/nd_loop.h @@ -19,7 +19,10 @@ @CREATED : December 2, 1994 (Peter Neelin) @MODIFIED : * $Log: nd_loop.h,v $ - * Revision 6.1 2002-01-14 21:28:26 neelin + * Revision 6.2 2004-10-15 13:47:13 bert + * Minor changes for Windows compatibility + * + * Revision 6.1 2002/01/14 21:28:26 neelin * Moved nd_loop, voxel_loop, ParseArgv and time_stamp from ../progs/Proglib * in order to include them in the main minc library. * @@ -59,12 +62,22 @@ express or implied warranty. ---------------------------------------------------------------------------- */ -public void nd_begin_looping(long start[], long current[], int ndims); -public int nd_end_of_loop(long current[], long end[], int ndims); -public void nd_update_current_count(long current[], +#include "minc.h" + +#if defined(__cplusplus) +extern "C" { +#endif + +MNCAPI void nd_begin_looping(long start[], long current[], int ndims); +MNCAPI int nd_end_of_loop(long current[], long end[], int ndims); +MNCAPI void nd_update_current_count(long current[], long increment[], long end[], long current_count[], int ndims); -public void nd_increment_loop(long current[], +MNCAPI void nd_increment_loop(long current[], long start[], long increment[], long end[], int ndims); + +#if defined(__cplusplus) +} +#endif
--- a/libsrc/netcdf_convenience.c +++ b/libsrc/netcdf_convenience.c @@ -39,7 +39,10 @@ @CREATED : July 27, 1992. (Peter Neelin, Montreal Neurological Institute) @MODIFIED : * $Log: netcdf_convenience.c,v $ - * Revision 6.13 2004-06-04 18:16:25 bert + * Revision 6.14 2004-10-15 13:48:33 bert + * Minor changes for Windows compatibility + * + * Revision 6.13 2004/06/04 18:16:25 bert * Create and add an 'ident' attribute when a file is created * * Revision 6.12 2004/04/30 18:57:39 bert @@ -154,11 +157,11 @@ ---------------------------------------------------------------------------- */ #ifndef lint -static char rcsid[] = "$Header: /private-cvsroot/minc/libsrc/netcdf_convenience.c,v 6.13 2004-06-04 18:16:25 bert Exp $ MINC (MNI)"; +static char rcsid[] = "$Header: /private-cvsroot/minc/libsrc/netcdf_convenience.c,v 6.14 2004-10-15 13:48:33 bert Exp $ MINC (MNI)"; #endif #include "config.h" /* From configure */ -#include <minc_private.h> +#include "minc_private.h" #if HAVE_UNISTD_H #include <unistd.h> @@ -184,9 +187,9 @@ #endif /* Private functions */ -private int execute_decompress_command(char *command, char *infile, +PRIVATE int execute_decompress_command(char *command, char *infile, char *outfile, int header_only); -private int MI_vcopy_action(int ndims, long start[], long count[], +PRIVATE int MI_vcopy_action(int ndims, long start[], long count[], long nvalues, void *var_buffer, void *caller_data); @@ -219,7 +222,7 @@ @CREATED : January 20, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int execute_decompress_command(char *command, char *infile, +PRIVATE int execute_decompress_command(char *command, char *infile, char *outfile, int header_only) { int oldncopts; @@ -373,7 +376,7 @@ @CREATED : January 20, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public char *miexpand_file(char *path, char *tempfile, int header_only, +MNCAPI char *miexpand_file(char *path, char *tempfile, int header_only, int *created_tempfile) { typedef enum @@ -554,7 +557,7 @@ @CREATED : November 2, 1993 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int miopen(char *path, int mode) +MNCAPI int miopen(char *path, int mode) { int status, oldncopts, created_tempfile; char *tempfile; @@ -581,7 +584,6 @@ else { hmode = H5F_ACC_RDONLY; } - status = hdf_open(path, hmode); /* If there is no error then return */ @@ -651,7 +653,7 @@ @MODIFIED : ---------------------------------------------------------------------------- */ #ifdef MINC2 -public int micreatex(char *path, int cmode, struct mi2opts *opts_ptr) +MNCAPI int micreatex(char *path, int cmode, struct mi2opts *opts_ptr) { int fd; @@ -685,16 +687,16 @@ MI_RETURN(fd); } -public int micreate(char *path, int cmode) +MNCAPI int micreate(char *path, int cmode) { MI_SAVE_ROUTINE_NAME("micreate"); - return micreatex(path, cmode, NULL); + MI_RETURN(micreatex(path, cmode, NULL)); } #else -public int micreate(char *path, int cmode) +MNCAPI int micreate(char *path, int cmode) { int fd; @@ -723,7 +725,7 @@ @CREATED : November 2, 1993 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int miclose(int cdfid) +MNCAPI int miclose(int cdfid) { int status; @@ -772,7 +774,7 @@ @MODIFIED : August 20, 2001 (P.N.) - changed to call miattget_with_sign ---------------------------------------------------------------------------- */ -public int miattget(int cdfid, int varid, char *name, nc_type datatype, +MNCAPI int miattget(int cdfid, int varid, char *name, nc_type datatype, int max_length, void *value, int *att_length) { int status; @@ -814,7 +816,7 @@ - slightly modified version of old miattget @MODIFIED : ---------------------------------------------------------------------------- */ -public int miattget_with_sign(int cdfid, int varid, char *name, +MNCAPI int miattget_with_sign(int cdfid, int varid, char *name, char *insign, nc_type datatype, char *outsign, int max_length, void *value, int *att_length) { @@ -908,7 +910,7 @@ @CREATED : July 27, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int miattget1(int cdfid, int varid, char *name, nc_type datatype, +MNCAPI int miattget1(int cdfid, int varid, char *name, nc_type datatype, void *value) { int att_length; /* Actual length of the attribute */ @@ -952,7 +954,7 @@ @CREATED : July 28, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public char *miattgetstr(int cdfid, int varid, char *name, +MNCAPI char *miattgetstr(int cdfid, int varid, char *name, int maxlen, char *value) { nc_type att_type; /* Type of attribute */ @@ -1031,7 +1033,7 @@ @CREATED : November 25, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int miattputint(int cdfid, int varid, char *name, int value) +MNCAPI int miattputint(int cdfid, int varid, char *name, int value) { int lvalue; int status; @@ -1062,7 +1064,7 @@ @CREATED : August 5, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int miattputdbl(int cdfid, int varid, char *name, double value) +MNCAPI int miattputdbl(int cdfid, int varid, char *name, double value) { int status; MI_SAVE_ROUTINE_NAME("miattputdbl"); @@ -1089,7 +1091,7 @@ @CREATED : July 28, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int miattputstr(int cdfid, int varid, char *name, char *value) +MNCAPI int miattputstr(int cdfid, int varid, char *name, char *value) { int status; MI_SAVE_ROUTINE_NAME("miattputstr"); @@ -1128,7 +1130,7 @@ @CREATED : July 29, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int mivarget(int cdfid, int varid, long start[], long count[], +MNCAPI int mivarget(int cdfid, int varid, long start[], long count[], nc_type datatype, char *sign, void *values) { int status; @@ -1168,7 +1170,7 @@ @CREATED : July 29, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int mivarget1(int cdfid, int varid, long mindex[], +MNCAPI int mivarget1(int cdfid, int varid, long mindex[], nc_type datatype, char *sign, void *value) { int status; @@ -1213,7 +1215,7 @@ @CREATED : July 29, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int mivarput(int cdfid, int varid, long start[], long count[], +MNCAPI int mivarput(int cdfid, int varid, long start[], long count[], nc_type datatype, char *sign, void *values) { int status; @@ -1253,7 +1255,7 @@ @CREATED : July 29, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int mivarput1(int cdfid, int varid, long mindex[], +MNCAPI int mivarput1(int cdfid, int varid, long mindex[], nc_type datatype, char *sign, void *value) { int status; @@ -1285,7 +1287,7 @@ @CREATED : July 29, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public long *miset_coords(int nvals, long value, long coords[]) +MNCAPI long *miset_coords(int nvals, long value, long coords[]) { int i; @@ -1320,7 +1322,7 @@ @CREATED : July 29, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public long *mitranslate_coords(int cdfid, +MNCAPI long *mitranslate_coords(int cdfid, int invar, long incoords[], int outvar, long outcoords[]) { @@ -1379,7 +1381,7 @@ @MODIFIED : ---------------------------------------------------------------------------- */ -public int micopy_all_atts(int incdfid, int invarid, +MNCAPI int micopy_all_atts(int incdfid, int invarid, int outcdfid, int outvarid) { int num_atts; /* Number of attributes */ @@ -1462,7 +1464,7 @@ @CREATED : @MODIFIED : ---------------------------------------------------------------------------- */ -public int micopy_var_def(int incdfid, int invarid, int outcdfid) +MNCAPI int micopy_var_def(int incdfid, int invarid, int outcdfid) { char varname[MAX_NC_NAME]; /* Name of variable */ char dimname[MAX_NC_NAME]; /* Name of dimension */ @@ -1610,7 +1612,7 @@ @CREATED : @MODIFIED : ---------------------------------------------------------------------------- */ -public int micopy_var_values(int incdfid, int invarid, +MNCAPI int micopy_var_values(int incdfid, int invarid, int outcdfid, int outvarid) { nc_type intype, outtype; /* Data types */ @@ -1683,7 +1685,7 @@ @CREATED : August 3, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_vcopy_action(int ndims, long start[], long count[], +PRIVATE int MI_vcopy_action(int ndims, long start[], long count[], long nvalues, void *var_buffer, void *caller_data) /* ARGSUSED */ { @@ -1728,7 +1730,7 @@ @CREATED : August 3, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int micopy_all_var_defs(int incdfid, int outcdfid, int nexclude, +MNCAPI int micopy_all_var_defs(int incdfid, int outcdfid, int nexclude, int excluded_vars[]) { int num_vars; /* Number of variables in input file */ @@ -1797,7 +1799,7 @@ @CREATED : @MODIFIED : ---------------------------------------------------------------------------- */ -public int micopy_all_var_values(int incdfid, int outcdfid, int nexclude, +MNCAPI int micopy_all_var_values(int incdfid, int outcdfid, int nexclude, int excluded_vars[]) { int num_vars; /* Number of variables in input file */ @@ -1871,7 +1873,7 @@ #define P_tmpdir "/var/tmp" #endif /* P_tmpdir not defined */ -public char * +MNCAPI char * micreate_tempfile(void) { int tmp_fd;
--- a/libsrc/time_stamp.c +++ b/libsrc/time_stamp.c @@ -5,7 +5,10 @@ @CREATED : February 1, 1993 (Peter Neelin) @MODIFIED : * $Log: time_stamp.c,v $ - * Revision 6.1 2002-01-14 21:28:26 neelin + * Revision 6.2 2004-10-15 13:46:51 bert + * Minor changes for Windows compatibility + * + * Revision 6.1 2002/01/14 21:28:26 neelin * Moved nd_loop, voxel_loop, ParseArgv and time_stamp from ../progs/Proglib * in order to include them in the main minc library. * @@ -47,14 +50,13 @@ software for any purpose. It is provided "as is" without express or implied warranty. ---------------------------------------------------------------------------- */ -#include <stdlib.h> -#include <string.h> + +#include "minc_private.h" #include <time.h> - #include <time_stamp.h> #ifndef lint -static char rcsid[]="$Header: /private-cvsroot/minc/libsrc/time_stamp.c,v 6.1 2002-01-14 21:28:26 neelin Exp $"; +static char rcsid[]="$Header: /private-cvsroot/minc/libsrc/time_stamp.c,v 6.2 2004-10-15 13:46:51 bert Exp $"; #endif /* ----------------------------- MNI Header -----------------------------------
--- a/libsrc/time_stamp.h +++ b/libsrc/time_stamp.h @@ -5,7 +5,10 @@ @CREATED : February 1, 1993 (Peter Neelin) @MODIFIED : * $Log: time_stamp.h,v $ - * Revision 6.1 2002-01-14 21:28:26 neelin + * Revision 6.2 2004-10-15 13:46:51 bert + * Minor changes for Windows compatibility + * + * Revision 6.1 2002/01/14 21:28:26 neelin * Moved nd_loop, voxel_loop, ParseArgv and time_stamp from ../progs/Proglib * in order to include them in the main minc library. * @@ -48,5 +51,15 @@ express or implied warranty. ---------------------------------------------------------------------------- */ -char *time_stamp(int argc, char *argv[]); +#include "minc.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ +MNCAPI char *time_stamp(int argc, char *argv[]); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +
--- a/libsrc/value_conversion.c +++ b/libsrc/value_conversion.c @@ -14,7 +14,10 @@ @CREATED : July 27, 1992. (Peter Neelin, Montreal Neurological Institute) @MODIFIED : * $Log: value_conversion.c,v $ - * Revision 6.5 2004-04-27 15:49:51 bert + * Revision 6.6 2004-10-15 13:45:28 bert + * Minor changes for Windows compatibility + * + * Revision 6.5 2004/04/27 15:49:51 bert * Use new logging, gettext preparation * * Revision 6.4 2003/11/14 16:52:24 stever @@ -85,17 +88,17 @@ ---------------------------------------------------------------------------- */ #ifndef lint -static char rcsid[] = "$Header: /private-cvsroot/minc/libsrc/value_conversion.c,v 6.5 2004-04-27 15:49:51 bert Exp $ MINC (MNI)"; +static char rcsid[] = "$Header: /private-cvsroot/minc/libsrc/value_conversion.c,v 6.6 2004-10-15 13:45:28 bert Exp $ MINC (MNI)"; #endif +#include "minc_private.h" #include <math.h> -#include <type_limits.h> -#include <minc_private.h> +#include "type_limits.h" /* Private functions */ -private int MI_var_action(int ndims, long var_start[], long var_count[], +PRIVATE int MI_var_action(int ndims, long var_start[], long var_count[], long nvalues, void *var_buffer, void *caller_data); -private int MI_get_sign(nc_type datatype, int sign); +PRIVATE int MI_get_sign(nc_type datatype, int sign); @@ -149,7 +152,7 @@ @CREATED : July 29, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -semiprivate int MI_varaccess(int operation, int cdfid, int varid, +SEMIPRIVATE int MI_varaccess(int operation, int cdfid, int varid, long start[], long count[], nc_type datatype, int sign, void *values, int *bufsize_step, mi_icv_type *icvp) @@ -255,7 +258,7 @@ @CREATED : July 30, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_var_action(int ndims, long var_start[], long var_count[], +PRIVATE int MI_var_action(int ndims, long var_start[], long var_count[], long nvalues, void *var_buffer, void *caller_data) /* ARGSUSED */ { @@ -352,7 +355,7 @@ @CREATED : July 29, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -semiprivate int MI_var_loop(int ndims, long start[], long count[], +SEMIPRIVATE int MI_var_loop(int ndims, long start[], long count[], int value_size, int *bufsize_step, long max_buffer_size, void *caller_data, @@ -468,7 +471,7 @@ @CREATED : July 30, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -semiprivate int MI_get_sign_from_string(nc_type datatype, char *sign) +SEMIPRIVATE int MI_get_sign_from_string(nc_type datatype, char *sign) { MI_SAVE_ROUTINE_NAME("MI_get_sign_from_string"); @@ -502,7 +505,7 @@ @CREATED : July 27, 1992 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int MI_get_sign(nc_type datatype, int sign) +PRIVATE int MI_get_sign(nc_type datatype, int sign) { MI_SAVE_ROUTINE_NAME("MI_get_sign"); @@ -555,7 +558,7 @@ @MODIFIED : August 28, 1992 (P.N.) - replaced type conversions with macros ---------------------------------------------------------------------------- */ -semiprivate int MI_convert_type(long number_of_values, +SEMIPRIVATE int MI_convert_type(long number_of_values, nc_type intype, int insign, void *invalues, nc_type outtype, int outsign, void *outvalues, mi_icv_type *icvp)
--- a/libsrc/voxel_loop.c +++ b/libsrc/voxel_loop.c @@ -7,7 +7,10 @@ @CREATED : January 10, 1994 (Peter Neelin) @MODIFIED : * $Log: voxel_loop.c,v $ - * Revision 6.4 2004-04-27 15:43:29 bert + * Revision 6.5 2004-10-15 13:46:52 bert + * Minor changes for Windows compatibility + * + * Revision 6.4 2004/04/27 15:43:29 bert * Support MINC 2.0 format * * Revision 6.3 2003/11/14 16:52:24 stever @@ -120,23 +123,15 @@ ---------------------------------------------------------------------------- */ #ifndef lint -static char rcsid[]="$Header: /private-cvsroot/minc/libsrc/voxel_loop.c,v 6.4 2004-04-27 15:43:29 bert Exp $"; +static char rcsid[]="$Header: /private-cvsroot/minc/libsrc/voxel_loop.c,v 6.5 2004-10-15 13:46:52 bert Exp $"; #endif -#include <stdlib.h> -#include <stdio.h> -#include <string.h> +#include "minc_private.h" #include <float.h> #include <math.h> -#include <minc.h> #include <minc_def.h> -#include <voxel_loop.h> -#include <nd_loop.h> - -#ifndef TRUE -# define TRUE 1 -# define FALSE 0 -#endif +#include "voxel_loop.h" +#include "nd_loop.h" /* Minimum number of voxels to put in a buffer. If this is too small, then for large images excessive reading can result. If it is @@ -215,91 +210,91 @@ }; /* Function prototypes */ -private int get_loop_dim_size(int inmincid, Loop_Options *loop_options); -private void translate_input_coords(int inmincid, +PRIVATE int get_loop_dim_size(int inmincid, Loop_Options *loop_options); +PRIVATE void translate_input_coords(int inmincid, long chunk_cur[], long input_cur[], long chunk_curcount[], long input_curcount[], int *loop_dim_index, Loop_Options *loop_options); -private void check_input_files(Loop_Options *loop_options, +PRIVATE void check_input_files(Loop_Options *loop_options, Loopfile_Info *loopfile_info); -private int input_image_varinq(int mincid, int imgid, char *name, +PRIVATE int input_image_varinq(int mincid, int imgid, char *name, nc_type *datatype, int *ndims, int dim[], int *natts, Loop_Options *loop_options); -private void get_dim_info(int mincid, int *ndims, long size[], +PRIVATE void get_dim_info(int mincid, int *ndims, long size[], char dimname[][MAX_NC_NAME], double start[], double step[], double dircos[][3], int is_regular[], Loop_Options *loop_options); -private void setup_output_files(Loop_Options *loop_options, +PRIVATE void setup_output_files(Loop_Options *loop_options, Loopfile_Info *loopfile_info, char *arg_string); -private long get_vector_length(int mincid, Loop_Options *loop_options); -private void setup_variables(int inmincid, int outmincid, +PRIVATE long get_vector_length(int mincid, Loop_Options *loop_options); +PRIVATE void setup_variables(int inmincid, int outmincid, int output_curfile, char *arg_string, Loop_Options *loop_options); -private void update_history(int mincid, char *arg_string); -private void setup_icvs(Loop_Options *loop_options, +PRIVATE void update_history(int mincid, char *arg_string); +PRIVATE void setup_icvs(Loop_Options *loop_options, Loopfile_Info *loopfile_info); -private void do_voxel_loop(Loop_Options *loop_options, +PRIVATE void do_voxel_loop(Loop_Options *loop_options, Loopfile_Info *loopfile_info); -private void setup_looping(Loop_Options *loop_options, +PRIVATE void setup_looping(Loop_Options *loop_options, Loopfile_Info *loopfile_info, int *ndims, long block_start[], long block_end[], long block_incr[], long *block_num_voxels, long chunk_incr[], long *chunk_num_voxels); -private void initialize_file_and_index(Loop_Options *loop_options, +PRIVATE void initialize_file_and_index(Loop_Options *loop_options, Loopfile_Info *loopfile_info, int do_loop, int *ifile, int *dim_index, int *dummy_index); -private int finish_file_and_index(Loop_Options *loop_options, +PRIVATE int finish_file_and_index(Loop_Options *loop_options, Loopfile_Info *loopfile_info, int do_loop, int ifile, int dim_index, int dummy_index); -private void increment_file_and_index(Loop_Options *loop_options, +PRIVATE void increment_file_and_index(Loop_Options *loop_options, Loopfile_Info *loopfile_info, int do_loop, int *ifile, int *dim_index, int *dummy_index); -private Loopfile_Info *initialize_loopfile_info(int num_input_files, +PRIVATE Loopfile_Info *initialize_loopfile_info(int num_input_files, char *input_files[], int num_output_files, char *output_files[], Loop_Options *loop_options); -private void cleanup_loopfile_info(Loopfile_Info *loopfile_info); -private int get_input_numfiles(Loopfile_Info *loopfile_info); -private int get_output_numfiles(Loopfile_Info *loopfile_info); -private char *get_input_filename(Loopfile_Info *loopfile_info, int file_num); -private char *get_output_filename(Loopfile_Info *loopfile_info, int file_num); -private void set_input_headers_only(Loopfile_Info *loopfile_info, +PRIVATE void cleanup_loopfile_info(Loopfile_Info *loopfile_info); +PRIVATE int get_input_numfiles(Loopfile_Info *loopfile_info); +PRIVATE int get_output_numfiles(Loopfile_Info *loopfile_info); +PRIVATE char *get_input_filename(Loopfile_Info *loopfile_info, int file_num); +PRIVATE char *get_output_filename(Loopfile_Info *loopfile_info, int file_num); +PRIVATE void set_input_headers_only(Loopfile_Info *loopfile_info, int headers_only); -private void set_input_sequential(Loopfile_Info *loopfile_info, +PRIVATE void set_input_sequential(Loopfile_Info *loopfile_info, int sequential_access); -private int get_input_mincid(Loopfile_Info *loopfile_info, +PRIVATE int get_input_mincid(Loopfile_Info *loopfile_info, int file_num); -private int get_output_mincid(Loopfile_Info *loopfile_info, +PRIVATE int get_output_mincid(Loopfile_Info *loopfile_info, int file_num); -private int create_output_file(Loopfile_Info *loopfile_info, +PRIVATE int create_output_file(Loopfile_Info *loopfile_info, int file_num); -private int get_input_icvid(Loopfile_Info *loopfile_info, +PRIVATE int get_input_icvid(Loopfile_Info *loopfile_info, int file_num); -private int get_output_icvid(Loopfile_Info *loopfile_info, +PRIVATE int get_output_icvid(Loopfile_Info *loopfile_info, int file_num); -private int create_input_icvid(Loopfile_Info *loopfile_info, +PRIVATE int create_input_icvid(Loopfile_Info *loopfile_info, int file_num); -private int create_output_icvid(Loopfile_Info *loopfile_info, +PRIVATE int create_output_icvid(Loopfile_Info *loopfile_info, int file_num); -private Loop_Info *create_loop_info(void); -private void initialize_loop_info(Loop_Info *loop_info); -private void free_loop_info(Loop_Info *loop_info); -private void set_info_shape(Loop_Info *loop_info, long start[], long count[]); -private void set_info_current_file(Loop_Info *loop_info, int current_file); -private void set_info_current_index(Loop_Info *loop_info, int current_index); -private void set_info_loopfile_info(Loop_Info *loop_info, +PRIVATE Loop_Info *create_loop_info(void); +PRIVATE void initialize_loop_info(Loop_Info *loop_info); +PRIVATE void free_loop_info(Loop_Info *loop_info); +PRIVATE void set_info_shape(Loop_Info *loop_info, long start[], long count[]); +PRIVATE void set_info_current_file(Loop_Info *loop_info, int current_file); +PRIVATE void set_info_current_index(Loop_Info *loop_info, int current_index); +PRIVATE void set_info_loopfile_info(Loop_Info *loop_info, Loopfile_Info *loopfile_info); /* ----------------------------- MNI Header ----------------------------------- @@ -323,7 +318,7 @@ @CREATED : January 10, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void voxel_loop(int num_input_files, char *input_files[], +MNCAPI void voxel_loop(int num_input_files, char *input_files[], int num_output_files, char *output_files[], char *arg_string, Loop_Options *loop_options, @@ -405,7 +400,7 @@ @CREATED : January 24, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int get_loop_dim_size(int inmincid, Loop_Options *loop_options) +PRIVATE int get_loop_dim_size(int inmincid, Loop_Options *loop_options) { int dimid; long dim_length; @@ -461,7 +456,7 @@ @CREATED : January 24, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private void translate_input_coords(int inmincid, +PRIVATE void translate_input_coords(int inmincid, long chunk_cur[], long input_cur[], long chunk_curcount[], long input_curcount[], @@ -515,7 +510,7 @@ @CREATED : November 30, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private void check_input_files(Loop_Options *loop_options, +PRIVATE void check_input_files(Loop_Options *loop_options, Loopfile_Info *loopfile_info) { int ifile, idim, jdim; @@ -673,7 +668,7 @@ @CREATED : January 20, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int input_image_varinq(int mincid, int imgid, char *name, +PRIVATE int input_image_varinq(int mincid, int imgid, char *name, nc_type *datatype, int *ndims, int dim[], int *natts, Loop_Options *loop_options) { @@ -746,7 +741,7 @@ @CREATED : November 30, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private void get_dim_info(int mincid, int *ndims, long size[], +PRIVATE void get_dim_info(int mincid, int *ndims, long size[], char dimname[][MAX_NC_NAME], double start[], double step[], double dircos[][3], int is_regular[], @@ -840,7 +835,7 @@ @CREATED : November 30, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private void setup_output_files(Loop_Options *loop_options, +PRIVATE void setup_output_files(Loop_Options *loop_options, Loopfile_Info *loopfile_info, char *arg_string) { @@ -870,7 +865,7 @@ @CREATED : November 30, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private long get_vector_length(int mincid, Loop_Options *loop_options) +PRIVATE long get_vector_length(int mincid, Loop_Options *loop_options) { int imgid; int ndims; @@ -915,7 +910,7 @@ @CREATED : January 10, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private void setup_variables(int inmincid, int outmincid, +PRIVATE void setup_variables(int inmincid, int outmincid, int output_curfile, char *arg_string, Loop_Options *loop_options) { @@ -1128,7 +1123,7 @@ @CREATED : August 26, 1993 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private void update_history(int mincid, char *arg_string) +PRIVATE void update_history(int mincid, char *arg_string) { nc_type datatype; int att_length; @@ -1171,7 +1166,7 @@ @CREATED : November 30, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private void setup_icvs(Loop_Options *loop_options, +PRIVATE void setup_icvs(Loop_Options *loop_options, Loopfile_Info *loopfile_info) { int ifile; @@ -1218,7 +1213,7 @@ @CREATED : January 10, 1994 (Peter Neelin) @MODIFIED : November 30, 1994 (P.N.) ---------------------------------------------------------------------------- */ -private void do_voxel_loop(Loop_Options *loop_options, +PRIVATE void do_voxel_loop(Loop_Options *loop_options, Loopfile_Info *loopfile_info) { long block_start[MAX_VAR_DIMS], block_end[MAX_VAR_DIMS]; @@ -1695,7 +1690,7 @@ @CREATED : December 2, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private void setup_looping(Loop_Options *loop_options, +PRIVATE void setup_looping(Loop_Options *loop_options, Loopfile_Info *loopfile_info, int *ndims, long block_start[], long block_end[], @@ -1806,7 +1801,7 @@ @CREATED : March 1, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private void initialize_file_and_index(Loop_Options *loop_options, +PRIVATE void initialize_file_and_index(Loop_Options *loop_options, Loopfile_Info *loopfile_info, int do_loop, int *ifile, int *dim_index, @@ -1842,7 +1837,7 @@ @CREATED : March 1, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int finish_file_and_index(Loop_Options *loop_options, +PRIVATE int finish_file_and_index(Loop_Options *loop_options, Loopfile_Info *loopfile_info, int do_loop, int ifile, int dim_index, @@ -1878,7 +1873,7 @@ @CREATED : March 1, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private void increment_file_and_index(Loop_Options *loop_options, +PRIVATE void increment_file_and_index(Loop_Options *loop_options, Loopfile_Info *loopfile_info, int do_loop, int *ifile, int *dim_index, @@ -1918,7 +1913,7 @@ @CREATED : November 30, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private Loopfile_Info *initialize_loopfile_info(int num_input_files, +PRIVATE Loopfile_Info *initialize_loopfile_info(int num_input_files, char *input_files[], int num_output_files, char *output_files[], @@ -2043,7 +2038,7 @@ @CREATED : November 30, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private void cleanup_loopfile_info(Loopfile_Info *loopfile_info) +PRIVATE void cleanup_loopfile_info(Loopfile_Info *loopfile_info) { int num_files, ifile; @@ -2101,7 +2096,7 @@ @CREATED : March 1, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int get_input_numfiles(Loopfile_Info *loopfile_info) +PRIVATE int get_input_numfiles(Loopfile_Info *loopfile_info) { return loopfile_info->num_input_files; } @@ -2118,7 +2113,7 @@ @CREATED : March 1, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int get_output_numfiles(Loopfile_Info *loopfile_info) +PRIVATE int get_output_numfiles(Loopfile_Info *loopfile_info) { return loopfile_info->num_output_files; } @@ -2136,7 +2131,7 @@ @CREATED : March 1, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private char *get_input_filename(Loopfile_Info *loopfile_info, int file_num) +PRIVATE char *get_input_filename(Loopfile_Info *loopfile_info, int file_num) { /* Check for bad file_num */ if ((file_num < 0) || (file_num >= loopfile_info->num_input_files)) { @@ -2160,7 +2155,7 @@ @CREATED : March 1, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private char *get_output_filename(Loopfile_Info *loopfile_info, int file_num) +PRIVATE char *get_output_filename(Loopfile_Info *loopfile_info, int file_num) { /* Check for bad file_num */ if ((file_num < 0) || (file_num >= loopfile_info->num_output_files)) { @@ -2188,7 +2183,7 @@ @CREATED : March 1, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private void set_input_headers_only(Loopfile_Info *loopfile_info, +PRIVATE void set_input_headers_only(Loopfile_Info *loopfile_info, int headers_only) { int num_files, ifile; @@ -2251,7 +2246,7 @@ @CREATED : March 1, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private void set_input_sequential(Loopfile_Info *loopfile_info, +PRIVATE void set_input_sequential(Loopfile_Info *loopfile_info, int sequential_access) { int old_input_all_open; @@ -2318,7 +2313,7 @@ @CREATED : November 30, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int get_input_mincid(Loopfile_Info *loopfile_info, +PRIVATE int get_input_mincid(Loopfile_Info *loopfile_info, int file_num) { int index; @@ -2377,7 +2372,7 @@ @CREATED : November 30, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int get_output_mincid(Loopfile_Info *loopfile_info, +PRIVATE int get_output_mincid(Loopfile_Info *loopfile_info, int file_num) { int index; @@ -2428,7 +2423,7 @@ @CREATED : November 30, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int create_output_file(Loopfile_Info *loopfile_info, +PRIVATE int create_output_file(Loopfile_Info *loopfile_info, int file_num) { int index; @@ -2482,7 +2477,7 @@ @CREATED : November 30, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int get_input_icvid(Loopfile_Info *loopfile_info, +PRIVATE int get_input_icvid(Loopfile_Info *loopfile_info, int file_num) { int mincid, icv_mincid, icvid; @@ -2531,7 +2526,7 @@ @CREATED : November 30, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int get_output_icvid(Loopfile_Info *loopfile_info, +PRIVATE int get_output_icvid(Loopfile_Info *loopfile_info, int file_num) { int mincid, icv_mincid, icvid; @@ -2582,7 +2577,7 @@ @CREATED : November 30, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int create_input_icvid(Loopfile_Info *loopfile_info, +PRIVATE int create_input_icvid(Loopfile_Info *loopfile_info, int file_num) { int index; @@ -2626,7 +2621,7 @@ @CREATED : November 30, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private int create_output_icvid(Loopfile_Info *loopfile_info, +PRIVATE int create_output_icvid(Loopfile_Info *loopfile_info, int file_num) { int index; @@ -2668,7 +2663,7 @@ @CREATED : December 6, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public Loop_Options *create_loop_options(void) +MNCAPI Loop_Options *create_loop_options(void) { Loop_Options *loop_options; @@ -2723,7 +2718,7 @@ @CREATED : December 6, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void free_loop_options(Loop_Options *loop_options) +MNCAPI void free_loop_options(Loop_Options *loop_options) { free_loop_info(loop_options->loop_info); if (loop_options->loop_dimension != NULL) @@ -2744,7 +2739,7 @@ @CREATED : December 6, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void set_loop_clobber(Loop_Options *loop_options, +MNCAPI void set_loop_clobber(Loop_Options *loop_options, int clobber) { loop_options->clobber = clobber; @@ -2764,7 +2759,7 @@ @CREATED : October 8, 2003 (Bert Vincent) @MODIFIED : ---------------------------------------------------------------------------- */ -public void set_loop_v2format(Loop_Options *loop_options, int v2format) +MNCAPI void set_loop_v2format(Loop_Options *loop_options, int v2format) { loop_options->v2format = v2format; } @@ -2783,7 +2778,7 @@ @CREATED : December 6, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void set_loop_verbose(Loop_Options *loop_options, +MNCAPI void set_loop_verbose(Loop_Options *loop_options, int verbose) { loop_options->verbose = verbose; @@ -2807,7 +2802,7 @@ @CREATED : January 20, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void set_loop_datatype(Loop_Options *loop_options, +MNCAPI void set_loop_datatype(Loop_Options *loop_options, nc_type datatype, int is_signed, double valid_min, double valid_max) { @@ -2831,7 +2826,7 @@ @CREATED : December 6, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void set_loop_max_open_files(Loop_Options *loop_options, +MNCAPI void set_loop_max_open_files(Loop_Options *loop_options, int max_open_files) { if ((max_open_files <= 0) || (max_open_files > MAX_NC_OPEN)) { @@ -2858,7 +2853,7 @@ @CREATED : March 16, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void set_loop_check_dim_info(Loop_Options *loop_options, +MNCAPI void set_loop_check_dim_info(Loop_Options *loop_options, int check_dim_info) { loop_options->check_all_input_dim_info = check_dim_info; @@ -2878,7 +2873,7 @@ @CREATED : December 6, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void set_loop_convert_input_to_scalar(Loop_Options *loop_options, +MNCAPI void set_loop_convert_input_to_scalar(Loop_Options *loop_options, int convert_input_to_scalar) { loop_options->convert_input_to_scalar = convert_input_to_scalar; @@ -2899,7 +2894,7 @@ @CREATED : December 6, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void set_loop_output_vector_size(Loop_Options *loop_options, +MNCAPI void set_loop_output_vector_size(Loop_Options *loop_options, int output_vector_size) { if (output_vector_size < 0) { @@ -2925,7 +2920,7 @@ @CREATED : December 6, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void set_loop_first_input_mincid(Loop_Options *loop_options, +MNCAPI void set_loop_first_input_mincid(Loop_Options *loop_options, int input_mincid) { loop_options->input_mincid = input_mincid; @@ -2944,7 +2939,7 @@ @CREATED : December 6, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void set_loop_buffer_size(Loop_Options *loop_options, +MNCAPI void set_loop_buffer_size(Loop_Options *loop_options, long buffer_size) { if (buffer_size <= 0) { @@ -2970,7 +2965,7 @@ @CREATED : January 24, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void set_loop_dimension(Loop_Options *loop_options, +MNCAPI void set_loop_dimension(Loop_Options *loop_options, char *dimension_name) { if (loop_options->loop_dimension != NULL) @@ -3000,7 +2995,7 @@ @CREATED : January 20, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void set_loop_input_file_function +MNCAPI void set_loop_input_file_function (Loop_Options *loop_options, VoxelInputFileFunction input_file_function) { @@ -3024,7 +3019,7 @@ @CREATED : December 6, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void set_loop_output_file_function +MNCAPI void set_loop_output_file_function (Loop_Options *loop_options, VoxelOutputFileFunction output_file_function) { @@ -3045,7 +3040,7 @@ @CREATED : March 13, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void set_loop_copy_all_header(Loop_Options *loop_options, +MNCAPI void set_loop_copy_all_header(Loop_Options *loop_options, int copy_all_header) { loop_options->copy_all_header_info = copy_all_header; @@ -3079,7 +3074,7 @@ @CREATED : December 6, 1994 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void set_loop_accumulate(Loop_Options *loop_options, +MNCAPI void set_loop_accumulate(Loop_Options *loop_options, int do_accumulation, int num_extra_buffers, VoxelStartFunction start_function, @@ -3124,7 +3119,7 @@ @CREATED : Aug 29, 2000 (J. Taylor) @MODIFIED : Sept. 19, 2000 (P. Neelin) ---------------------------------------------------------------------------- */ -public void set_loop_allocate_buffer_function(Loop_Options *loop_options, +MNCAPI void set_loop_allocate_buffer_function(Loop_Options *loop_options, AllocateBufferFunction allocate_buffer_function) { @@ -3145,7 +3140,7 @@ @CREATED : January 20, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private Loop_Info *create_loop_info(void) +PRIVATE Loop_Info *create_loop_info(void) { Loop_Info *loop_info; @@ -3171,7 +3166,7 @@ @CREATED : February 28, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private void initialize_loop_info(Loop_Info *loop_info) +PRIVATE void initialize_loop_info(Loop_Info *loop_info) { int idim; @@ -3198,7 +3193,7 @@ @CREATED : January 20, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private void free_loop_info(Loop_Info *loop_info) +PRIVATE void free_loop_info(Loop_Info *loop_info) { FREE(loop_info); } @@ -3217,7 +3212,7 @@ @CREATED : January 20, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private void set_info_shape(Loop_Info *loop_info, long start[], long count[]) +PRIVATE void set_info_shape(Loop_Info *loop_info, long start[], long count[]) { int idim; long size; @@ -3254,7 +3249,7 @@ @CREATED : January 20, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void get_info_shape(Loop_Info *loop_info, int ndims, +MNCAPI void get_info_shape(Loop_Info *loop_info, int ndims, long start[], long count[]) { int idim; @@ -3282,7 +3277,7 @@ @CREATED : November 28, 2001 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public void get_info_voxel_index(Loop_Info *loop_info, long subscript, +MNCAPI void get_info_voxel_index(Loop_Info *loop_info, long subscript, int ndims, long index[]) { int idim; @@ -3315,7 +3310,7 @@ @CREATED : February 28, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private void set_info_current_file(Loop_Info *loop_info, int current_file) +PRIVATE void set_info_current_file(Loop_Info *loop_info, int current_file) { loop_info->current_file = current_file; @@ -3334,7 +3329,7 @@ @CREATED : February 28, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int get_info_current_file(Loop_Info *loop_info) +MNCAPI int get_info_current_file(Loop_Info *loop_info) { return loop_info->current_file; @@ -3353,7 +3348,7 @@ @CREATED : March 8, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int get_info_current_mincid(Loop_Info *loop_info) +MNCAPI int get_info_current_mincid(Loop_Info *loop_info) { if (loop_info->loopfile_info == NULL) return MI_ERROR; @@ -3375,7 +3370,7 @@ @CREATED : February 28, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private void set_info_current_index(Loop_Info *loop_info, int current_index) +PRIVATE void set_info_current_index(Loop_Info *loop_info, int current_index) { loop_info->current_index = current_index; @@ -3394,7 +3389,7 @@ @CREATED : February 28, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int get_info_current_index(Loop_Info *loop_info) +MNCAPI int get_info_current_index(Loop_Info *loop_info) { return loop_info->current_index; @@ -3414,7 +3409,7 @@ @CREATED : March 7, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -private void set_info_loopfile_info(Loop_Info *loop_info, +PRIVATE void set_info_loopfile_info(Loop_Info *loop_info, Loopfile_Info *loopfile_info) { @@ -3436,7 +3431,7 @@ @CREATED : March 7, 1995 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -public int get_info_whole_file(Loop_Info *loop_info) +MNCAPI int get_info_whole_file(Loop_Info *loop_info) { Loopfile_Info *loopfile_info;
--- a/libsrc/voxel_loop.h +++ b/libsrc/voxel_loop.h @@ -5,7 +5,10 @@ @CREATED : January 10, 1994 (Peter Neelin) @MODIFIED : * $Log: voxel_loop.h,v $ - * Revision 6.2 2004-04-27 15:43:04 bert + * Revision 6.3 2004-10-15 13:46:52 bert + * Minor changes for Windows compatibility + * + * Revision 6.2 2004/04/27 15:43:04 bert * Added set_loop_v2format() * * Revision 6.1 2002/01/14 21:28:26 neelin @@ -73,15 +76,11 @@ express or implied warranty. ---------------------------------------------------------------------------- */ -#ifndef public -# define public -#endif -#ifndef private -# define private static -#endif - /* Includes */ -#include <minc.h> +#include "minc.h" +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ /* Incomplete structure typedefs */ @@ -245,58 +244,62 @@ Loop_Info *loop_info); /* Function declarations */ -public void voxel_loop(int num_input_files, char *input_files[], +MNCAPI void voxel_loop(int num_input_files, char *input_files[], int num_output_files, char *output_files[], char *arg_string, Loop_Options *loop_options, VoxelFunction voxel_function, void *caller_data); -public Loop_Options *create_loop_options(void); -public void free_loop_options(Loop_Options *loop_options); -public void set_loop_clobber(Loop_Options *loop_options, +MNCAPI Loop_Options *create_loop_options(void); +MNCAPI void free_loop_options(Loop_Options *loop_options); +MNCAPI void set_loop_clobber(Loop_Options *loop_options, int clobber); #ifdef MINC2 -public void set_loop_v2format(Loop_Options *loop_options, +MNCAPI void set_loop_v2format(Loop_Options *loop_options, int use_v2_format); #endif /* MINC2 defined */ -public void set_loop_verbose(Loop_Options *loop_options, +MNCAPI void set_loop_verbose(Loop_Options *loop_options, int verbose); -public void set_loop_datatype(Loop_Options *loop_options, +MNCAPI void set_loop_datatype(Loop_Options *loop_options, nc_type datatype, int is_signed, double valid_min, double valid_max); -public void set_loop_max_open_files(Loop_Options *loop_options, +MNCAPI void set_loop_max_open_files(Loop_Options *loop_options, int max_open_files); -public void set_loop_check_dim_info(Loop_Options *loop_options, +MNCAPI void set_loop_check_dim_info(Loop_Options *loop_options, int check_dim_info); -public void set_loop_convert_input_to_scalar(Loop_Options *loop_options, +MNCAPI void set_loop_convert_input_to_scalar(Loop_Options *loop_options, int convert_input_to_scalar); -public void set_loop_output_vector_size(Loop_Options *loop_options, +MNCAPI void set_loop_output_vector_size(Loop_Options *loop_options, int output_vector_size); -public void set_loop_first_input_mincid(Loop_Options *loop_options, +MNCAPI void set_loop_first_input_mincid(Loop_Options *loop_options, int input_mincid); -public void set_loop_buffer_size(Loop_Options *loop_options, +MNCAPI void set_loop_buffer_size(Loop_Options *loop_options, long buffer_size); -public void set_loop_dimension(Loop_Options *loop_options, +MNCAPI void set_loop_dimension(Loop_Options *loop_options, char *dimension_name); -public void set_loop_input_file_function +MNCAPI void set_loop_input_file_function (Loop_Options *loop_options, VoxelInputFileFunction input_file_function); -public void set_loop_output_file_function +MNCAPI void set_loop_output_file_function (Loop_Options *loop_options, VoxelOutputFileFunction output_file_function); -public void set_loop_copy_all_header(Loop_Options *loop_options, +MNCAPI void set_loop_copy_all_header(Loop_Options *loop_options, int copy_all_header); -public void set_loop_accumulate(Loop_Options *loop_options, +MNCAPI void set_loop_accumulate(Loop_Options *loop_options, int do_accumulation, int num_extra_buffers, VoxelStartFunction start_function, VoxelFinishFunction finish_function); -public void set_loop_allocate_buffer_function(Loop_Options *loop_options, +MNCAPI void set_loop_allocate_buffer_function(Loop_Options *loop_options, AllocateBufferFunction allocate_buffer_function); -public void get_info_shape(Loop_Info *loop_info, int ndims, +MNCAPI void get_info_shape(Loop_Info *loop_info, int ndims, long start[], long count[]); -public void get_info_voxel_index(Loop_Info *loop_info, long subscript, +MNCAPI void get_info_voxel_index(Loop_Info *loop_info, long subscript, int ndims, long index[]); -public int get_info_current_file(Loop_Info *loop_info); -public int get_info_current_mincid(Loop_Info *loop_info); -public int get_info_current_index(Loop_Info *loop_info); -public int get_info_whole_file(Loop_Info *loop_info); +MNCAPI int get_info_current_file(Loop_Info *loop_info); +MNCAPI int get_info_current_mincid(Loop_Info *loop_info); +MNCAPI int get_info_current_index(Loop_Info *loop_info); +MNCAPI int get_info_whole_file(Loop_Info *loop_info); + +#ifdef __cplusplus +} +#endif /* __cplusplus */