Mercurial > hg > minc-tools
changeset 1335:00ab908e04cf
Start of modifications to get minc working with netcdf 3.5.
author | neelin <neelin> |
---|---|
date | Tue, 10 Apr 2001 22:05:28 +0000 |
parents | 5b5010d4b6be |
children | 8c04b124e8e0 |
files | configure configure.in fortran/.cvsignore fortran/Makefile libsrc/minc.h |
diffstat | 5 files changed, 138 insertions(+), 320 deletions(-) [+] |
line wrap: on
line diff
--- a/configure +++ b/configure @@ -11,7 +11,7 @@ ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: -ac_default_prefix='$(ROOT)/..' +ac_default_prefix='/usr/local' # Initialize some variables set by options. # The variables have the same names as the options, with @@ -660,15 +660,17 @@ # Check for an ANSI'ish C compiler, starting with CC (we really just look for # void's, prototypes and enum's because you can't always # trust __STDC__ and those are the main things that we need) +# If CC is not defined, then use cc. If either of those fail, then +# look for gcc with AC_PROG_CC. #------------------------------------------------------------------------ echo "checking for ANSI-ish compiler" 1>&6 -echo "configure:666: checking for ANSI-ish compiler" >&5 +echo "configure:668: checking for ANSI-ish compiler" >&5 : ${CC=cc} if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 672 "configure" +#line 674 "configure" #include "confdefs.h" typedef enum {FIRST, SECOND} enum_type; @@ -687,7 +689,7 @@ } EOF -if { (eval echo configure:691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -698,7 +700,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:702: checking for $ac_word" >&5 +echo "configure:704: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -728,7 +730,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:732: checking for $ac_word" >&5 +echo "configure:734: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -779,7 +781,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:783: checking for $ac_word" >&5 +echo "configure:785: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -811,7 +813,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:815: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:817: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -822,12 +824,12 @@ cat > conftest.$ac_ext << EOF -#line 826 "configure" +#line 828 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -853,12 +855,12 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:857: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:859: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:862: checking whether we are using GNU C" >&5 +echo "configure:864: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -867,7 +869,7 @@ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -886,7 +888,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:890: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:892: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -927,151 +929,22 @@ #------------------------------------------------------------------------ -# Set up libraries -#------------------------------------------------------------------------ -echo $ac_n "checking for xdr_long in -lc""... $ac_c" 1>&6 -echo "configure:934: checking for xdr_long in -lc" >&5 -ac_lib_var=`echo c'_'xdr_long | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lc $LIBS" -cat > conftest.$ac_ext <<EOF -#line 942 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char xdr_long(); - -int main() { -xdr_long() -; return 0; } -EOF -if { (eval echo configure:953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for xdr_long in -lsun""... $ac_c" 1>&6 -echo "configure:972: checking for xdr_long in -lsun" >&5 -ac_lib_var=`echo sun'_'xdr_long | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lsun $LIBS" -cat > conftest.$ac_ext <<EOF -#line 980 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char xdr_long(); - -int main() { -xdr_long() -; return 0; } -EOF -if { (eval echo configure:991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo sun | sed -e 's/^a-zA-Z0-9_/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <<EOF -#define $ac_tr_lib 1 -EOF - - LIBS="-lsun $LIBS" - -else - echo "$ac_t""no" 1>&6 -fi - -fi - -echo $ac_n "checking for main in -lc_s""... $ac_c" 1>&6 -echo "configure:1021: checking for main in -lc_s" >&5 -ac_lib_var=`echo c_s'_'main | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lc_s $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1029 "configure" -#include "confdefs.h" - -int main() { -main() -; return 0; } -EOF -if { (eval echo configure:1036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo c_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <<EOF -#define $ac_tr_lib 1 -EOF - - LIBS="-lc_s $LIBS" - -else - echo "$ac_t""no" 1>&6 -fi - - -#------------------------------------------------------------------------ # Look for netcdf header, etc #------------------------------------------------------------------------ -echo "checking for netcdf package" 1>&6 -echo "configure:1068: checking for netcdf package" >&5 +echo $ac_n "checking for netcdf package""... $ac_c" 1>&6 +echo "configure:936: checking for netcdf package" >&5 ROOT=. -for testdir in '${ROOT}/..' /usr/local +latest_netcdf=`find .. -name 'netcdf-*' -type d -prune -print |sort |tail -1` +if test "x$latest_netcdf" != x +then + latest_netcdf='${ROOT}/'"$latest_netcdf" +fi +for testdir in "$latest_netcdf" '${ROOT}/..' /usr/local do if test -z "$NETCDF_PREFIX" then thedir=`eval echo $testdir` - if test -r "$thedir/include/netcdf.h" + if test -d "$thedir" -a -r "$thedir/include/netcdf.h" then NETCDF_PREFIX=`echo "$testdir" |sed -e s'/{/(/' -e s'/}/)/'` fi @@ -1079,15 +952,17 @@ done if test -z "$NETCDF_PREFIX" then + echo "$ac_t""""" 1>&6 { echo "configure: error: Cannot find the netcdf package - define NETCDF_PREFIX" 1>&2; exit 1; } fi +echo "$ac_t""found in $NETCDF_PREFIX" 1>&6 #------------------------------------------------------------------------ # Check make variants #------------------------------------------------------------------------ echo "checking make handling of targets in the dependency" 1>&6 -echo "configure:1091: checking make handling of targets in the dependency" >&5 +echo "configure:966: checking make handling of targets in the dependency" >&5 : ${TARGET_IN_DEPENDENCY='$$@'} cat > conftest.Make <<EOF conf-target : @@ -1115,16 +990,25 @@ rm -f conftest.Make #------------------------------------------------------------------------ -# Check os type (should match netcdf os type) +# Check to see if we should use fortran. +# We now only support fortran on irix since netcdf has abandoned its +# m4 approach to wrapper building as of 3.x +# We still set the OS_TYPE just in case it is useful to someone #------------------------------------------------------------------------ - +echo $ac_n "checking whether to build fortran jackets""... $ac_c" 1>&6 +echo "configure:1000: checking whether to build fortran jackets" >&5 +if test "$BUILD_FORTRAN" = "yes" +then + FORTRAN_SUBDIR=fortran + FORTRAN_OBJ='$(ROOT)/$(FORTRAN_SUBDIR)/minc_jackets.o' + # Make sure we can run config.sub. if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:1128: checking host system type" >&5 +echo "configure:1012: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -1144,18 +1028,13 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 -OS_TYPE=`echo $host_os | sed 's/^\([^0-9\]*\)[0-9].*$/\1/'` - - -#------------------------------------------------------------------------ -# Check to see if we should use fortran -#------------------------------------------------------------------------ -for ac_prog in f77 + OS_TYPE=`echo $host_os | sed 's/^\([^0-9\]*\)[0-9].*$/\1/'` + for ac_prog in f77 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1159: checking for $ac_word" >&5 +echo "configure:1038: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_FC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1184,20 +1063,14 @@ test -n "$FC" && break done -echo $ac_n "checking whether to build fortran jackets""... $ac_c" 1>&6 -echo "configure:1189: checking whether to build fortran jackets" >&5 -if test "$BUILD_FORTRAN" = "yes" || - ( test "$OS_TYPE" = "irix" && test "$FC" = "f77" && - test "$BUILD_FORTRAN" != "no" ) -then - FORTRAN_SUBDIR=fortran - FORTRAN_OBJ='$(ROOT)/$(FORTRAN_SUBDIR)/minc_jackets.o' else + OS_TYPE= FORTRAN_SUBDIR= FORTRAN_OBJ= fi + if test "$FORTRAN_SUBDIR" then echo "$ac_t""yes" 1>&6 @@ -1208,13 +1081,11 @@ #------------------------------------------------------------------------ # Look for library functions #------------------------------------------------------------------------ -#AC_CHECK_FUNC(strerror, GLOBAL_CDEFINES="", GLOBAL_CDEFINES=-DNO_STRERROR) GLOBAL_CDEFINES="" - trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -1371,8 +1242,8 @@ s%@host_cpu@%$host_cpu%g s%@host_vendor@%$host_vendor%g s%@host_os@%$host_os%g +s%@FC@%$FC%g s%@OS_TYPE@%$OS_TYPE%g -s%@FC@%$FC%g s%@FORTRAN_SUBDIR@%$FORTRAN_SUBDIR%g s%@FORTRAN_OBJ@%$FORTRAN_OBJ%g s%@GLOBAL_CDEFINES@%$GLOBAL_CDEFINES%g
--- a/configure.in +++ b/configure.in @@ -24,6 +24,8 @@ # Check for an ANSI'ish C compiler, starting with CC (we really just look for # void's, prototypes and enum's because you can't always # trust __STDC__ and those are the main things that we need) +# If CC is not defined, then use cc. If either of those fail, then +# look for gcc with AC_PROG_CC. #------------------------------------------------------------------------ AC_CHECKING(for ANSI-ish compiler) : ${CC=cc} @@ -50,22 +52,21 @@ fi],:) #------------------------------------------------------------------------ -# Set up libraries -#------------------------------------------------------------------------ -AC_CHECK_LIB(c, xdr_long,:,AC_CHECK_LIB(sun, xdr_long)) -AC_CHECK_LIB(c_s, main) - -#------------------------------------------------------------------------ # Look for netcdf header, etc #------------------------------------------------------------------------ -AC_CHECKING(for netcdf package) +AC_MSG_CHECKING(for netcdf package) ROOT=. -for testdir in '${ROOT}/..' /usr/local +latest_netcdf=`find .. -name 'netcdf-*' -type d -prune -print |sort |tail -1` +if test "x$latest_netcdf" != x +then + latest_netcdf='${ROOT}/'"$latest_netcdf" +fi +for testdir in "$latest_netcdf" '${ROOT}/..' /usr/local do if test -z "$NETCDF_PREFIX" then thedir=`eval echo $testdir` - if test -r "$thedir/include/netcdf.h" + if test -d "$thedir" -a -r "$thedir/include/netcdf.h" then NETCDF_PREFIX=`echo "$testdir" |sed -e s'/{/(/' -e s'/}/)/'` fi @@ -73,8 +74,10 @@ done if test -z "$NETCDF_PREFIX" then + AC_MSG_RESULT("") AC_MSG_ERROR(Cannot find the netcdf package - define NETCDF_PREFIX) fi +AC_MSG_RESULT(found in $NETCDF_PREFIX) AC_SUBST(NETCDF_PREFIX) #------------------------------------------------------------------------ @@ -108,29 +111,27 @@ rm -f conftest.Make #------------------------------------------------------------------------ -# Check os type (should match netcdf os type) +# Check to see if we should use fortran. +# We now only support fortran on irix since netcdf has abandoned its +# m4 approach to wrapper building as of 3.x +# We still set the OS_TYPE just in case it is useful to someone #------------------------------------------------------------------------ -AC_CANONICAL_HOST -changequote(<<, >>)dnl -OS_TYPE=`echo $host_os | sed 's/^\([^0-9\]*\)[0-9].*$/\1/'` -changequote([, ])dnl -AC_SUBST(OS_TYPE) - -#------------------------------------------------------------------------ -# Check to see if we should use fortran -#------------------------------------------------------------------------ -AC_CHECK_PROGS(FC, f77) AC_MSG_CHECKING(whether to build fortran jackets) -if test "$BUILD_FORTRAN" = "yes" || - ( test "$OS_TYPE" = "irix" && test "$FC" = "f77" && - test "$BUILD_FORTRAN" != "no" ) +if test "$BUILD_FORTRAN" = "yes" then FORTRAN_SUBDIR=fortran FORTRAN_OBJ='$(ROOT)/$(FORTRAN_SUBDIR)/minc_jackets.o' + AC_CANONICAL_HOST + changequote(<<, >>)dnl + OS_TYPE=`echo $host_os | sed 's/^\([^0-9\]*\)[0-9].*$/\1/'` + changequote([, ])dnl + AC_CHECK_PROGS(FC, f77) else + OS_TYPE= FORTRAN_SUBDIR= FORTRAN_OBJ= fi +AC_SUBST(OS_TYPE) AC_SUBST(FORTRAN_SUBDIR) AC_SUBST(FORTRAN_OBJ) if test "$FORTRAN_SUBDIR" @@ -143,11 +144,9 @@ #------------------------------------------------------------------------ # Look for library functions #------------------------------------------------------------------------ -#AC_CHECK_FUNC(strerror, GLOBAL_CDEFINES="", GLOBAL_CDEFINES=-DNO_STRERROR) GLOBAL_CDEFINES="" AC_SUBST(GLOBAL_CDEFINES) - -AC_PREFIX_DEFAULT('$(ROOT)/..') +AC_PREFIX_DEFAULT('/usr/local') AC_OUTPUT(Make_machine_specific Make_configuration)
--- a/fortran/Makefile +++ b/fortran/Makefile @@ -29,10 +29,11 @@ all: build lint library test -build : $(PROGS) library +# Make sure that we build the jackets first +build : $(JACKETS_OBJ) $(PROGS) library #Dependency on Makefile -$(JACKETS_C) $(JACKETS_OBJ) $(JACKETS_LN) $(PROG_OBJ) : Makefile +$(JACKETS_OBJ) $(JACKETS_LN) $(PROG_OBJ) : Makefile .c.ln:# defines the rule for creating .ln $(LINT) $(LINTFLAGS) -c $< -o $@ @@ -44,20 +45,16 @@ $(FC) $(FFLAGS) -c $< -o $@ # How to make executables -$(PROGS) : $(TARGET_IN_DEPENDENCY).o $(JACKETS_OBJ) $(CC_MINC_LIB) +$(PROGS) : $(TARGET_IN_DEPENDENCY).o $(CC_MINC_LIB) $(FC) -o $@ $@.o $(JACKETS_OBJ) $(FFLAGS) $(LDOPT) # How to run test test: $(PROGS) minc_ftest -$(JACKETS_C): $(JACKETS_SRC) \ - $(NETCDF_FORTRAN_DIR)/fortc1.sed \ - $(NETCDF_FORTRAN_DIR)/fortc2.sed \ - $(NETCDF_FORTRAN_DIR)/common.m4 \ - $(NETCDF_FORTRAN_DIR)/$(OS_TYPE).m4 +$(JACKETS_C): $(JACKETS_SRC) $(NETCDF_FORTRAN_DIR)/fortc -L $(NETCDF_FORTRAN_DIR) -O $(OS_TYPE) \ - $(JACKETS_SRC) > $@ + $(JACKETS_SRC) > $@.new && mv $@.new $@ # how to lint the executable source lint: $(JACKETS_LN)
--- 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.1 1999-10-19 14:45:08 neelin + * Revision 6.2 2001-04-10 22:05:30 neelin + * Start of modifications to get minc working with netcdf 3.5. + * + * Revision 6.1 1999/10/19 14:45:08 neelin * Fixed Log subsitutions for CVS * * Revision 6.0 1997/09/12 13:24:54 neelin @@ -77,20 +80,9 @@ 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.1 1999-10-19 14:45:08 neelin Exp $ MINC (MNI) +@RCSID : $Header: /private-cvsroot/minc/libsrc/minc.h,v 6.2 2001-04-10 22:05:30 neelin Exp $ MINC (MNI) ---------------------------------------------------------------------------- */ -#ifndef MINC_PRIVATE_HEADER_FILE -#ifndef lint -static char minc_h_rcsid[] = "$Header: /private-cvsroot/minc/libsrc/minc.h,v 6.1 1999-10-19 14:45:08 neelin Exp $ MINC (MNI)"; -#endif -#endif - -/* Set HAVE_PROTOTYPES for SGI's ANSI C with extensions */ -#ifdef __EXTENSIONS__ -# define HAVE_PROTOTYPES -#endif - #include <netcdf.h> /* Some useful constants */ @@ -382,108 +374,68 @@ #endif /* From netcdf_convenience.c */ -public char *miexpand_file - PROTO((char *path, char *tempfile, int header_only, int *created_tempfile)); -public int miopen - PROTO((char *path, int mode)); -public int micreate - PROTO((char *path, int cmode)); -public int miclose - PROTO((int cdfid)); -public int miattget - PROTO((int cdfid, int varid, char *name, nc_type datatype, - int max_length, void *value, int *att_length)); -public int miattget1 - PROTO((int cdfid, int varid, char *name, nc_type datatype, - void *value)); -public char *miattgetstr - PROTO((int cdfid, int varid, char *name, - int maxlen, char *value)); -public int miattputint - PROTO((int cdfid, int varid, char *name, int value)); -public int miattputdbl - PROTO((int cdfid, int varid, char *name, double value)); -public int miattputstr - PROTO((int cdfid, int varid, char *name, char *value)); -public int mivarget - PROTO((int cdfid, int varid, long start[], long count[], - nc_type datatype, char *sign, void *values)); -public int mivarget1 - PROTO((int cdfid, int varid, long mindex[], - nc_type datatype, char *sign, void *value)); -public int mivarput - PROTO((int cdfid, int varid, long start[], long count[], - nc_type datatype, char *sign, void *values)); -public int mivarput1 - PROTO((int cdfid, int varid, long mindex[], - nc_type datatype, char *sign, void *value)); -public long *miset_coords - PROTO((int nvals, long value, long coords[])); -public long *mitranslate_coords - PROTO((int cdfid, - int invar, long incoords[], - int outvar, long outcoords[])); -public int micopy_all_atts - PROTO((int incdfid, int invarid, - int outcdfid, int outvarid)); -public int micopy_var_def - PROTO((int incdfid, int invarid, int outcdfid)); -public int micopy_var_values - PROTO((int incdfid, int invarid, - int outcdfid, int outvarid)); -public int micopy_all_var_defs - PROTO((int incdfid, int outcdfid, int nexclude, - int excluded_vars[])); -public int micopy_all_var_values - PROTO((int incdfid, int outcdfid, int nexclude, - int excluded_vars[])); +public 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(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, + void *value); +public 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[], + nc_type datatype, char *sign, void *values); +public 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[], + nc_type datatype, char *sign, void *values); +public 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, + int invar, long incoords[], + int outvar, long outcoords[]); +public 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, + int outcdfid, int outvarid); +public 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, + int excluded_vars[]); /* From minc_convenience.c */ -public int miattput_pointer - PROTO((int cdfid, int varid, char *name, int ptrvarid)); -public int miattget_pointer - PROTO((int cdfid, int varid, char *name)); -public int miadd_child - PROTO((int cdfid, int parent_varid, int child_varid)); -public int micreate_std_variable - PROTO((int cdfid, char *name, nc_type datatype, - int ndims, int dim[])); -public int micreate_group_variable - PROTO((int cdfid, char *name)); +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, + int ndims, int dim[]); +public int micreate_group_variable(int cdfid, char *name); /* From image_conversion.c */ -public int miicv_create - PROTO((void)); -public int miicv_free - PROTO((int icvid)); -public int miicv_setdbl - PROTO((int icvid, int icv_property, double value)); -public int miicv_setint - PROTO((int icvid, int icv_property, int value)); -public int miicv_setlong - PROTO((int icvid, int icv_property, long value)); -public int miicv_setstr - PROTO((int icvid, int icv_property, char *value)); -public int miicv_inqdbl - PROTO((int icvid, int icv_property, double *value)); -public int miicv_inqint - PROTO((int icvid, int icv_property, int *value)); -public int miicv_inqlong - PROTO((int icvid, int icv_property, long *value)); -public int miicv_inqstr - PROTO((int icvid, int icv_property, char *value)); -public int miicv_ndattach - PROTO((int icvid, int cdfid, int varid)); -public int miicv_detach - PROTO((int icvid)); -public int miicv_get - PROTO((int icvid, long start[], long count[], void *values)); -public int miicv_put - PROTO((int icvid, long start[], long count[], void *values)); +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); /* From dim_conversion.c */ -public int miicv_attach - PROTO((int icvid, int cdfid, int varid)); +public int miicv_attach(int icvid, int cdfid, int varid); /* Undefine public if needed */ #ifdef MINC_NEED_TO_UNDEF_PUBLIC