patch to netCDF 2.0

Hi,

This is patch #2 for the netCDF package.  It upgrades netCDF version
2.01 to version 2.02, and accomplishes the following:

BUG FIXES

    A "memory leak" is fixed that would cause any program that opened and
    closed many netCDF files to grow.

    Condilation compilation tests now test for "__MSDOS__" as well as
    "MSDOS" to permit compilation with Borland's compiler as well as
    Microsoft's. 

ENHANCEMENTS

    All inquire functions (ncinquire, ncdiminq, ncvarinq, ncattinq) now
    permit a NULL pointer to be given for any of their return parameters, to
    indicate when no return value for that parameter is desired.

MISCELLANEOUS

    The default library type that is built by the distributed Makefile is
    now "nonsharable" rather than "sharable".

    The format that ncdump uses to output byte data is changed from octal to
    decimal.

This patch-file is designed to be applied from the top-level directory
via Larry Wall's patch(1) utility, e.g.

        $ cd /usr/local/sdm/src/netcdf
        $ patch -p0 < this_file

The "-p0" option is necessary.

You may apply this patch, or, alternatively, obtain the latest distribution
(with all patches applied) via anonymous FTP:

        host:   unidata.ucar.edu
        files:  pub/netcdf.tar.Z

Regards,
Support      <support@xxxxxxxxxxxxxxxx>


Prereq: 1

diff -c2 -r ../netcdf-2.01/CHANGES ./CHANGES
*** ../netcdf-2.01/CHANGES      Thu Oct 24 19:20:22 1991
--- ./CHANGES   Mon Dec 23 04:58:53 1991
***************
*** 1,3 ****
! $Id: CHANGES,v 1.18 1991/10/09 16:55:31 russ Exp $
  
  ------ Wed Oct  9 1991        Changes in netCDF (1.11 to 2.0)
--- 1,29 ----
! $Id: CHANGES,v 1.19 1991/12/23 11:54:29 russ Exp $
! 
! ------ Mon Dec 23 MST 1991  Changes in netCDF (2.01 to 2.02)
! 
! A "memory leak" is fixed that would cause any program that opened and closed
! many netCDF files to grow.
! 
! All inquire functions (ncinquire, ncdiminq, ncvarinq, ncattinq) now permit a
! NULL pointer to be given for any of their return parameters, to indicate
! when no return value for that parameter is desired.
! 
! The default library type that is built by the distributes Makefile is now
! "nonsharable" rather than "sharable".
! 
! The format that ncdump uses to output byte data is changed from octal to
! decimal.
! 
! ------ Mon Nov 25 1991        Changes in netCDF (2.0 to 2.01)
! 
! Correct usage of the XDR_LD macro is added to all appropriate
! program-building rules in all appropriate sub-Makefiles.  This is needed for
! proper program-creation under the IRIX operating-system.
! 
! Corrects the major.minor revision ID for SunOS sharable libraries to 2.01.
! 
! Adds support for the creation of the netCDF Fortran interface under the IRIX
! operating-system.
  
  ------ Wed Oct  9 1991        Changes in netCDF (1.11 to 2.0)
diff -c2 -r ../netcdf-2.01/INSTALL ./INSTALL
*** ../netcdf-2.01/INSTALL      Mon Nov  4 16:13:29 1991
--- ./INSTALL   Mon Dec 23 04:58:54 1991
***************
*** 24,33 ****
     XDR library and run it.  This will superficially verify your vendor's XDR
     implementation.  Systems that we know already have a satisfactory XDR
!    library include Sun (in libc), CRAY/UNICOS (in librpc), and IBM
!    RS6000/AIX (in libc).  Systems for which you should build an XDR library
!    from the sources we provide include MSDOS, OS/2, VAX/VMS (unless you have
!    a vendor-supplied one, e.g. from TGV), and DECstation/Ultrix (because of
!    a bug in the vendor-supplied library, see note below).  You might also
!    wish to use our XDR library for VAXstation/Ultrix systems.
  
     Assuming you will use the XDR routines provided, do you want the XDR
--- 24,34 ----
     XDR library and run it.  This will superficially verify your vendor's XDR
     implementation.  Systems that we know already have a satisfactory XDR
!    library include Sun (in libc), CRAY/UNICOS (in librpc), SGI/IRIX (in
!    libsun) and IBM RS6000/AIX (in libc).  Systems for which you should build
!    an XDR library from the sources we provide include MSDOS, OS/2, VAX/VMS
!    (unless you have a vendor-supplied one, e.g. from TGV), and
!    DECstation/Ultrix (because of a bug in the vendor-supplied library, see
!    note below).  You might also wish to use our XDR library for
!    VAXstation/Ultrix systems.
  
     Assuming you will use the XDR routines provided, do you want the XDR
***************
*** 89,97 ****
     of the netCDF User's Guide.  See a Texinfo manual for how to do this.
  
! 5) Make "clean".  If you are installing on a Sun and have just made the
!    sharable library (the default), at this point it is recommended that you
!    also make and install a nonsharable library for use in potential future
!    debugging.  You can do this by changing LIBTYPE to "nonsharable" and
!    rerunning "make", "make install", and "make clean".
  
  6) Here's some examples of what worked for us on some of the platforms we
--- 90,98 ----
     of the netCDF User's Guide.  See a Texinfo manual for how to do this.
  
! 5) Make "clean".  If you are installing on a Sun or AIX platform and have
!    just made the nonsharable library (the default), at this point you may
!    want to also make and install a sharable library.  You can do this by
!    changing LIBTYPE to "sharable" and rerunning "make", "make install", and
!    "make clean".
  
  6) Here's some examples of what worked for us on some of the platforms we
***************
*** 112,115 ****
--- 113,122 ----
        make LIBTYPE=nonsharable OS=ultrix_4.2 XDR_INC=  all
  
+    IRIX 4.0 on Silicon Graphics:
+       unset TMPDIR  [if it's set to a directory in another file system]
+       make CC="cc -cckr" LIBTYPE=nonsharable OS=irix_4.0 \
+               RANLIB=touch XDR_LD=-lsun  all
+       [for IRIX 3.3.2, use COPTS="-O -signed" instead of CC="cc -cckr"]
+ 
     UNICOS 6.1.4 on a Cray Y-MP:
        make FC=cf77 FOPTS= INSTALL=install.sh LIBTYPE=nonsharable \
***************
*** 116,119 ****
--- 123,129 ----
             OS=unicos RANLIB=touch  all
     
+    HPUX on a HP9000/720:
+       make COPTS="-Aa -O -D_HPUX_SOUCE -Wl,-a,archive" FC=fort77 \
+            INSTALL=install.bsd LIBTYPE=nonsharable OS=hpux FOPTS="-w -K"
  
  On a VMS system:
diff -c2 -r ../netcdf-2.01/Makefile ./Makefile
*** ../netcdf-2.01/Makefile     Thu Oct 24 19:20:22 1991
--- ./Makefile  Mon Dec 23 04:58:54 1991
***************
*** 1,3 ****
! # $Id: Makefile,v 1.16 1991/09/25 15:21:40 steve Exp $
  #
  #          Makefile to build netcdf library and utilities
--- 1,3 ----
! # $Id: Makefile,v 1.17 1991/12/20 17:12:09 russ Exp $
  #
  #          Makefile to build netcdf library and utilities
***************
*** 23,27 ****
  #                             "/usr/bin/install").
  LIBMODE       = 664#                  File protection mode for installed 
libraries
! LIBTYPE       = sharable#             "nonsharable" or "sharable"
  MANMODE       = 664#                  File-protection mode for installed 
man(1) pages
  OS    = sunos_4.1.1#          Operating-system and version
--- 23,27 ----
  #                             "/usr/bin/install").
  LIBMODE       = 664#                  File protection mode for installed 
libraries
! LIBTYPE       = nonsharable#          "nonsharable" or "sharable"
  MANMODE       = 664#                  File-protection mode for installed 
man(1) pages
  OS    = sunos_4.1.1#          Operating-system and version
diff -c2 -r ../netcdf-2.01/PATCHLEVEL ./PATCHLEVEL
*** ../netcdf-2.01/PATCHLEVEL   Tue Nov 19 09:30:05 1991
--- ./PATCHLEVEL        Mon Dec 23 04:58:55 1991
***************
*** 1 ****
! 1
--- 1 ----
! 2
diff -c2 -r ../netcdf-2.01/doc/guide.txn ./doc/guide.txn
*** ../netcdf-2.01/doc/guide.txn        Thu Oct 24 19:20:37 1991
--- ./doc/guide.txn     Mon Dec 23 04:59:13 1991
***************
*** 2465,2469 ****
  @findex ncopen
  @findex ncredef
! @vindex NC_NOWRITE
  Here is an example using @code{ncredef} to open an existing NetCDF file
  named @file{foo.cdf} and put it into define mode:
--- 2465,2469 ----
  @findex ncopen
  @findex ncredef
! @vindex NC_WRITE
  Here is an example using @code{ncredef} to open an existing NetCDF file
  named @file{foo.cdf} and put it into define mode:
***************
*** 2474,2478 ****
  int cdfid;
     @dots{}
! cdfid = ncopen("foo.cdf", NC_NOWRITE);    /* open file */
     @dots{}
  ncredef(cdfid);                        /* put in define mode */
--- 2474,2478 ----
  int cdfid;
     @dots{}
! cdfid = ncopen("foo.cdf", NC_WRITE);    /* open file */
     @dots{}
  ncredef(cdfid);                        /* put in define mode */
***************
*** 2497,2501 ****
  @findex NCOPN
  @findex NCREDF
! @vindex NCNOWRIT
  Here is an example of using @code{NCREDF} to open an existing netCDF file
  named @file{foo.cdf} and put it into define mode:
--- 2497,2501 ----
  @findex NCOPN
  @findex NCREDF
! @vindex NCWRITE
  Here is an example of using @code{NCREDF} to open an existing netCDF file
  named @file{foo.cdf} and put it into define mode:
***************
*** 2506,2510 ****
        INTEGER CDFID
           @dots{}
!       CDFID = NCOPN('foo.cdf', NCNOWRIT, RCODE)
           @dots{}
        CALL NCREDF(CDFID, RCODE)
--- 2506,2510 ----
        INTEGER CDFID
           @dots{}
!       CDFID = NCOPN('foo.cdf', NCWRITE, RCODE)
           @dots{}
        CALL NCREDF(CDFID, RCODE)
***************
*** 2743,2751 ****
  @cindex number of dimensions
  @item ndims
! Returned number of dimensions defined for this netCDF file.
  
  @cindex number of variables
  @item nvars
! Returned number of variables defined for this netCDF file.
  
  @cindex number of global attributes
--- 2743,2755 ----
  @cindex number of dimensions
  @item ndims
! Returned number of dimensions defined for this netCDF file.  If this
! parameter is given as @samp{(int *) 0}, the number of dimensions will not be
! returned so no variable to hold this information needs to be declared.
  
  @cindex number of variables
  @item nvars
! Returned number of variables defined for this netCDF file.  If this
! parameter is given as @samp{(int *) 0}, the number of variables will not be
! returned so no variable to hold this information needs to be declared.
  
  @cindex number of global attributes
***************
*** 2752,2756 ****
  @cindex global attributes
  @item ngatts
! Returned number of global attributes defined for this netCDF file.
  
  @cindex unlimited dimension ID
--- 2756,2763 ----
  @cindex global attributes
  @item ngatts
! Returned number of global attributes defined for this netCDF file.  If
! this parameter is given as @samp{(int *) 0}, the number of global attributes
! will not be returned so no variable to hold this information needs to be
! declared.
  
  @cindex unlimited dimension ID
***************
*** 2758,2762 ****
  Returned ID of the unlimited dimension, if there is one for this netCDF
  file.  If no unlimited size dimension has been defined, -1 is returned
! for the value of @code{recdim}.
  @end table
  
--- 2765,2771 ----
  Returned ID of the unlimited dimension, if there is one for this netCDF
  file.  If no unlimited size dimension has been defined, -1 is returned
! for the value of @code{recdim}.  If this parameter is given as
! @samp{(int *) 0}, the record dimension ID will not be returned so no
! variable to hold this information needs to be declared.
  @end table
  
***************
*** 3583,3587 ****
  Returned size of dimension.  For the unlimited dimension, this is the
  current maximum value used for writing any variables with this
! dimension, that is the maximum record number.
  @end table
  
--- 3592,3598 ----
  Returned size of dimension.  For the unlimited dimension, this is the
  current maximum value used for writing any variables with this
! dimension, that is the maximum record number.  If this parameter is
! given as @samp{(long *) 0}, the size will not be returned, so no space
! for this information need be declared or allocated.
  @end table
  
***************
*** 4229,4238 ****
  header file.  The valid netCDF data types are @code{NC_BYTE},
  @code{NC_CHAR}, @code{NC_SHORT}, @code{NC_LONG}, @code{NC_FLOAT}, and
! @code{NC_DOUBLE}.
  
  @item ndims
  Returned number of dimensions the variable was defined as using.  For
! example, @code{2} specifies a matrix, @code{1} specifies a vector, and 
@code{0} means the
! variable is a scalar with no dimensions.
  
  @cindex variable dimensions
--- 4240,4253 ----
  header file.  The valid netCDF data types are @code{NC_BYTE},
  @code{NC_CHAR}, @code{NC_SHORT}, @code{NC_LONG}, @code{NC_FLOAT}, and
! @code{NC_DOUBLE}.  If this parameter is given as @samp{(nc_type *) 0},
! no type will be returned so no variable to hold the type needs to be
! declared.
  
  @item ndims
  Returned number of dimensions the variable was defined as using.  For
! example, @code{2} specifies a matrix, @code{1} specifies a vector, and
! @code{0} means the variable is a scalar with no dimensions.  If this
! parameter is given as @samp{(int *) 0}, no number of dimensions will be
! returned so no variable to hold this information needs to be declared.
  
  @cindex variable dimensions
***************
*** 4240,4251 ****
  @vindex MAX_VAR_DIMS
  @item dim
! Returned vector of @code{ndims} dimension IDs corresponding to the variable
! dimensions.  The caller must allocate enough space for a vector of at least
! @code{ndims} integers to be returned.  The maximum possible number of
! dimensions for a variable is given by the predefined constant
! @code{MAX_VAR_DIMS}.
  
  @item natts
! Returned number of variable attributes assigned to this variable.
  @end table
  @sp 1
--- 4255,4271 ----
  @vindex MAX_VAR_DIMS
  @item dim
! Returned vector of @code{ndims} dimension IDs corresponding to the
! variable dimensions.  The caller must allocate enough space for a vector
! of at least @code{ndims} integers to be returned.  The maximum possible
! number of dimensions for a variable is given by the predefined constant
! @code{MAX_VAR_DIMS}.  If this parameter is given as @samp{(int *) 0}, no
! vector will be returned so no space to hold the dimension IDs needs to
! be declared or allocated.
  
  @item natts
! Returned number of variable attributes assigned to this variable.  If
! this parameter is given as @samp{(int *) 0}, the number of attributes
! will not be returned so no space to hold this information needs to be
! declared or allocated.
  @end table
  @sp 1
***************
*** 6108,6112 ****
  header file.  The valid netCDF data types are @code{NC_BYTE},
  @code{NC_CHAR}, @code{NC_SHORT}, @code{NC_LONG}, @code{NC_FLOAT}, and
! @code{NC_DOUBLE}.
  
  @cindex data types
--- 6128,6134 ----
  header file.  The valid netCDF data types are @code{NC_BYTE},
  @code{NC_CHAR}, @code{NC_SHORT}, @code{NC_LONG}, @code{NC_FLOAT}, and
! @code{NC_DOUBLE}.  If this parameter is given as @samp{(nc_type *) 0},
! no type will be returned so no variable to hold the type needs to be
! declared.
  
  @cindex data types
***************
*** 6114,6118 ****
  Returned number of values currently stored in the attribute.  If the
  attribute is of type @code{NC_CHAR}, this is one more than the string
! length (since the terminating null character is stored).
  @end table
  
--- 6136,6142 ----
  Returned number of values currently stored in the attribute.  If the
  attribute is of type @code{NC_CHAR}, this is one more than the string
! length (since the terminating null character is stored).  If this
! parameter is given as @samp{(int *) 0}, no length will be returned so no
! variable to hold this information needs to be declared.
  @end table
  
diff -c2 -r ../netcdf-2.01/fortran/common.inc ./fortran/common.inc
*** ../netcdf-2.01/fortran/common.inc   Thu Oct 24 19:20:44 1991
--- ./fortran/common.inc        Mon Dec 23 04:59:21 1991
***************
*** 3,6 ****
--- 3,7 ----
  c     These declarations may cause "unused variable" warnings
        integer nccre, ncopn, ncddef, ncdid, ncvdef, ncvid, nctlen
+       integer ncsfil
  
        integer NCRDWR,NCCREAT,NCEXCL,NCINDEF,NCNSYNC,NCHSYNC
diff -c2 -r ../netcdf-2.01/ncdump/vardata.c ./ncdump/vardata.c
*** ../netcdf-2.01/ncdump/vardata.c     Tue Oct 29 16:54:01 1991
--- ./ncdump/vardata.c  Mon Dec 23 04:59:49 1991
***************
*** 2,6 ****
   *   Copyright 1989, University Corporation for Atmospheric Research
   *   See netcdf/README file for copying and redistribution conditions.
!  *   $Header: /home/russ/sdmsrc/netcdf/ncdump/RCS/vardata.c,v 1.19 1991/10/29 
23:34:25 russ Exp $
   *********************************************************************/
  
--- 2,6 ----
   *   Copyright 1989, University Corporation for Atmospheric Research
   *   See netcdf/README file for copying and redistribution conditions.
!  *   $Header: /usr/local/home/russ/sdmsrc/netcdf/ncdump/RCS/vardata.c,v 1.20 
1991/12/23 11:21:19 russ Exp $
   *********************************************************************/
  
***************
*** 46,53 ****
        gp.cp = (char *) vals;
        for (iel = 0; iel < len-1; iel++) {
!           (void) sprintf (sout, "0%o, ",*gp.cp++ & 0377);
            lput (sout);
        }
!       (void) sprintf (sout, "0%o",*gp.cp++ & 0377);
        lput (sout);
        break;
--- 46,53 ----
        gp.cp = (char *) vals;
        for (iel = 0; iel < len-1; iel++) {
!           (void) sprintf (sout, "%d, ",*gp.cp++);
            lput (sout);
        }
!       (void) sprintf (sout, "%d",*gp.cp++);
        lput (sout);
        break;
diff -c2 -r ../netcdf-2.01/nctest/Makefile ./nctest/Makefile
*** ../netcdf-2.01/nctest/Makefile      Tue Nov 19 09:30:06 1991
--- ./nctest/Makefile   Mon Dec 23 05:00:21 1991
***************
*** 3,7 ****
  #   See netcdf/README file for copying and redistribution conditions.
  #
! #   $Id: Makefile,v 1.17 1991/11/06 23:03:26 steve Exp $
  #********************************************************************/
  #
--- 3,7 ----
  #   See netcdf/README file for copying and redistribution conditions.
  #
! #   $Id: Makefile,v 1.19 1991/12/20 17:23:24 davis Exp $
  #********************************************************************/
  #
***************
*** 11,15 ****
  # Anticipated, changeable macros (others won't be passed to recursive makes):
  #CC   =#                      Commented-out in order to use default
! COPTS = -O#                   Compiler options
  DESTDIR       = /usr/local/ldm#       Assumed to contain "bin", "etc", 
"include",
  #                             "lib", and "man" subdirectories
--- 11,15 ----
  # Anticipated, changeable macros (others won't be passed to recursive makes):
  #CC   =#                      Commented-out in order to use default
! COPTS = -g#                   Compiler options
  DESTDIR       = /usr/local/ldm#       Assumed to contain "bin", "etc", 
"include",
  #                             "lib", and "man" subdirectories
***************
*** 31,35 ****
  CPPOPTS               = $(INCLUDES) $(DEFINES)
  CFLAGS                = $(CPPOPTS) $(COPTS)
! NC_LIB                = -L../src -lnetcdf -L$(LIBDIR) -lnetcdf
  SYSLIBS               = `case $(OS) in unicos*) echo -lrpc;; esac` $(XDR_LD)
  
--- 31,35 ----
  CPPOPTS               = $(INCLUDES) $(DEFINES)
  CFLAGS                = $(CPPOPTS) $(COPTS)
! NC_LIB                = -L../src -lnetcdf
  SYSLIBS               = `case $(OS) in unicos*) echo -lrpc;; esac` $(XDR_LD)
  
diff -c2 -r ../netcdf-2.01/src/Makefile ./src/Makefile
*** ../netcdf-2.01/src/Makefile Tue Nov 19 09:30:05 1991
--- ./src/Makefile      Mon Dec 23 05:00:38 1991
***************
*** 1,3 ****
! # $Id: Makefile,v 1.22 1991/11/19 15:58:12 steve Exp $
  #
  #          Makefile for Network CDF library
--- 1,3 ----
! # $Id: Makefile,v 1.25 1991/12/06 00:26:16 davis Exp $
  #
  #          Makefile for Network CDF library
***************
*** 64,68 ****
  CFLAGS                = $(CPPOPTS) $(COPTS)
  SHELL         = /bin/sh
! RELEASE_NO    =  2.01#        <Major>.<minor> release number
  ARFLAGS               = ruv
  SYSLIBS               = `case $(OS) in unicos*) echo -lrpc;; esac` $(XDR_LD)
--- 64,68 ----
  CFLAGS                = $(CPPOPTS) $(COPTS)
  SHELL         = /bin/sh
! RELEASE_NO    =  2.02#        <Major>.<minor> release number
  ARFLAGS               = ruv
  SYSLIBS               = `case $(OS) in unicos*) echo -lrpc;; esac` $(XDR_LD)
***************
*** 73,82 ****
                    cdftest.c descrip.mms dim.c error.c error.h globdef.c \
                    file.c htons.mar iarray.c local_nc.h netcdf.h ntohs.mar \
!                   putget.c sharray.c string.c test.cdf.sav var.c
  CSRCS         = array.c attr.c cdf.c dim.c file.c iarray.c error.c \
!                   globdef.c putget.c sharray.c string.c var.c
  HSRCS         = local_nc.h netcdf.h alloc.h error.h
  OBJS          = array.o attr.o cdf.o dim.o file.o iarray.o error.o \
!                   globdef.o putget.o sharray.o string.o var.o
  SA_OBJS               = globdef.o
  
--- 73,82 ----
                    cdftest.c descrip.mms dim.c error.c error.h globdef.c \
                    file.c htons.mar iarray.c local_nc.h netcdf.h ntohs.mar \
!                   putget.c sharray.c string.c test.cdf.sav var.c version.c
  CSRCS         = array.c attr.c cdf.c dim.c file.c iarray.c error.c \
!                   globdef.c putget.c sharray.c string.c var.c version.c
  HSRCS         = local_nc.h netcdf.h alloc.h error.h
  OBJS          = array.o attr.o cdf.o dim.o file.o iarray.o error.o \
!                   globdef.o putget.o sharray.o string.o var.o version.o
  SA_OBJS               = globdef.o
  
***************
*** 262,266 ****
  #
  $(INCDIR)/netcdf.h:   netcdf.h
!       $(INSTALL) -c -m $(INCMODE) netcdf.h $(INCDIR)
  
  cdftest:              cdftest.o $(OBJS)
--- 262,273 ----
  #
  $(INCDIR)/netcdf.h:   netcdf.h
!       -@if [ ! "$<" ]; then \
!               ($(INSTALL) -c -m $(INCMODE) netcdf.h $(INCDIR) && \
!                       echo 'install $@') ; \
!       else \
!               cmp -s $< $@ || \
!               ($(INSTALL) -c -m $(INCMODE) netcdf.h $(INCDIR) && \
!                       echo 'update $@') ; \
!       fi
  
  cdftest:              cdftest.o $(OBJS)
***************
*** 292,293 ****
--- 299,301 ----
  string.o: string.c local_nc.h netcdf.h alloc.h
  var.o: var.c local_nc.h netcdf.h alloc.h
+ version.o: version.c
diff -c2 -r ../netcdf-2.01/src/array.c ./src/array.c
*** ../netcdf-2.01/src/array.c  Thu Oct 24 19:21:48 1991
--- ./src/array.c       Mon Dec 23 05:00:24 1991
***************
*** 3,7 ****
   *      See netcdf/README file for copying and redistribution conditions.
   */
! /*    $Id: array.c,v 1.40 1991/09/16 20:47:12 steve Exp $ */
  
  #include      "local_nc.h"
--- 3,7 ----
   *      See netcdf/README file for copying and redistribution conditions.
   */
! /*    $Id: array.c,v 1.42 1991/12/18 20:48:22 steve Exp $ */
  
  #include      "local_nc.h"
***************
*** 310,314 ****
                case NC_FLOAT :
                case NC_DOUBLE :
-                       m_free(array->values) ;
                        break ;
                case NC_STRING  :
--- 310,313 ----
***************
*** 356,359 ****
--- 355,360 ----
                        break ;
                }
+ 
+               m_free(array->values) ;
        }
  
diff -c2 -r ../netcdf-2.01/src/attr.c ./src/attr.c
*** ../netcdf-2.01/src/attr.c   Thu Oct 24 19:21:49 1991
--- ./src/attr.c        Mon Dec 23 05:00:26 1991
***************
*** 3,7 ****
   *      See netcdf/README file for copying and redistribution conditions.
   */
! /*    $Id: attr.c,v 1.25 1991/08/02 19:20:27 davis Exp $ */
  
  #include      <string.h> 
--- 3,7 ----
   *      See netcdf/README file for copying and redistribution conditions.
   */
! /*    $Id: attr.c,v 1.26 1991/11/25 23:26:16 davis Exp $ */
  
  #include      <string.h> 
***************
*** 338,343 ****
                return(-1) ;
  
!       *datatypep = (*attr)->data->type ;
!       *countp = (*attr)->data->count ;
        return(1) ;
  }
--- 338,345 ----
                return(-1) ;
  
!       if(datatypep != 0)
!               *datatypep = (*attr)->data->type ;
!       if(countp != 0)
!               *countp = (*attr)->data->count ;
        return(1) ;
  }
diff -c2 -r ../netcdf-2.01/src/cdf.c ./src/cdf.c
*** ../netcdf-2.01/src/cdf.c    Thu Oct 24 19:21:49 1991
--- ./src/cdf.c Mon Dec 23 05:00:27 1991
***************
*** 3,7 ****
   *      See netcdf/README file for copying and redistribution conditions.
   */
! /*    $Id: cdf.c,v 1.41 1991/10/09 20:15:56 russ Exp $ */
  
  #include      "local_nc.h"
--- 3,7 ----
   *      See netcdf/README file for copying and redistribution conditions.
   */
! /*    $Id: cdf.c,v 1.43 1991/12/20 19:03:19 steve Exp $ */
  
  #include      "local_nc.h"
***************
*** 160,165 ****
                return(-1) ;
        
!       *nvarsp = (handle->vars != NULL) ? handle->vars->count : 0 ;
!       *nattrsp = (handle->attrs != NULL) ? handle->attrs->count : 0 ;
        if(handle->dims != NULL)
        {
--- 160,167 ----
                return(-1) ;
        
!       if(nvarsp != NULL)
!               *nvarsp = (handle->vars != NULL) ? handle->vars->count : 0 ;
!       if(nattrsp != NULL)
!               *nattrsp = (handle->attrs != NULL) ? handle->attrs->count : 0 ;
        if(handle->dims != NULL)
        {
***************
*** 167,184 ****
                int ii ;
  
!               *ndimsp = handle->dims->count ;
!               *xtendimp = -1 ;
  
!               dp = (NC_dim**)handle->dims->values ;
!               for(ii = 0 ; ii < handle->dims->count ; ii++, dp++)
!               {
!                       if((*dp)->size == NC_UNLIMITED)
                        {
!                               *xtendimp = ii ;
                        }
                }
        } else {
!               *ndimsp = 0 ;
!               *xtendimp = -1 ;
        }
  
--- 169,191 ----
                int ii ;
  
!               if(ndimsp != NULL)
!                       *ndimsp = handle->dims->count ;
!               if(xtendimp != NULL) {
!                       *xtendimp = -1 ;
  
!                       dp = (NC_dim**)handle->dims->values ;
!                       for(ii = 0 ; ii < handle->dims->count ; ii++, dp++)
                        {
!                               if((*dp)->size == NC_UNLIMITED)
!                               {
!                                       *xtendimp = ii ;
!                               }
                        }
                }
        } else {
!               if(ndimsp != NULL)
!                       *ndimsp = 0 ;
!               if(xtendimp != NULL)
!                       *xtendimp = -1 ;
        }
  
diff -c2 -r ../netcdf-2.01/src/dim.c ./src/dim.c
*** ../netcdf-2.01/src/dim.c    Thu Oct 24 19:21:51 1991
--- ./src/dim.c Mon Dec 23 05:00:29 1991
***************
*** 3,7 ****
   *      See netcdf/README file for copying and redistribution conditions.
   */
! /*    $Id: dim.c,v 1.26 1991/09/16 21:13:46 steve Exp $ */
  
  #include      <string.h>
--- 3,7 ----
   *      See netcdf/README file for copying and redistribution conditions.
   */
! /*    $Id: dim.c,v 1.27 1991/11/25 23:26:16 davis Exp $ */
  
  #include      <string.h>
***************
*** 183,190 ****
                name[(*dp)->name->count] = 0 ;
        }
!       if((*dp)->size == NC_UNLIMITED)
!               *sizep = handle->numrecs ;
!       else
!               *sizep = (*dp)->size ;  
        return(dimid) ;
  }
--- 183,193 ----
                name[(*dp)->name->count] = 0 ;
        }
!       if(sizep != 0)
!       {
!               if((*dp)->size == NC_UNLIMITED)
!                       *sizep = handle->numrecs ;
!               else
!                       *sizep = (*dp)->size ;  
!       }
        return(dimid) ;
  }
diff -c2 -r ../netcdf-2.01/src/file.c ./src/file.c
*** ../netcdf-2.01/src/file.c   Wed Oct 30 22:18:39 1991
--- ./src/file.c        Mon Dec 23 12:33:40 1991
***************
*** 3,7 ****
   *      See netcdf/README file for copying and redistribution conditions.
   */
! /*    $Id: file.c,v 1.54 1991/10/31 01:07:28 davis Exp $ */
  
  #if defined(unix) && !defined(i386)
--- 3,7 ----
   *      See netcdf/README file for copying and redistribution conditions.
   */
! /*    $Id: file.c,v 1.55 1991/12/23 17:41:17 russ Exp $ */
  
  #if defined(unix) && !defined(i386)
***************
*** 11,15 ****
  #endif
  
! #ifdef MSDOS
  #include      <fcntl.h>       /* O_BINARY */
  #endif
--- 11,15 ----
  #endif
  
! #if defined(MSDOS) || defined(__MSDOS__)
  #include      <fcntl.h>       /* O_BINARY */
  #endif
diff -c2 -r ../netcdf-2.01/src/local_nc.h ./src/local_nc.h
*** ../netcdf-2.01/src/local_nc.h       Thu Oct 24 19:21:55 1991
--- ./src/local_nc.h    Mon Dec 23 12:33:40 1991
***************
*** 8,12 ****
  /*SUPPRESS 592*/
  static char rcsrev[] = 
!       "$Id: local_nc.h,v 1.28 1991/09/16 21:16:58 steve Exp $" ;
  #endif        /* lint */
  
--- 8,12 ----
  /*SUPPRESS 592*/
  static char rcsrev[] = 
!       "$Id: local_nc.h,v 1.29 1991/12/23 17:06:04 russ Exp $" ;
  #endif        /* lint */
  
***************
*** 55,58 ****
--- 55,62 ----
  #define NO_MEM_FUNCTS
  #define USE_doprnt_FOR_vfprintf /* error.c: kludge for ze ancienne regieme */
+ #endif
+ 
+ #ifdef __MSDOS__                    /* Borland C Supports this macro  */
+ #define MSDOS                       /* THE OFFICAL ANSI MACRO FOR DOS */
  #endif
  
Binary files ../netcdf-2.01/src/test_cdf.sav and ./src/test_cdf.sav differ
diff -c2 -r ../netcdf-2.01/src/var.c ./src/var.c
*** ../netcdf-2.01/src/var.c    Thu Oct 24 19:21:59 1991
--- ./src/var.c Mon Dec 23 05:00:37 1991
***************
*** 3,7 ****
   *      See netcdf/README file for copying and redistribution conditions.
   */
! /*    $Id: var.c,v 1.41 1991/09/16 21:06:16 steve Exp $ */
  
  #include      <string.h>
--- 3,7 ----
   *      See netcdf/README file for copying and redistribution conditions.
   */
! /*    $Id: var.c,v 1.42 1991/11/25 23:26:16 davis Exp $ */
  
  #include      <string.h>
***************
*** 420,434 ****
        }
  
!       *typep = vp->type ;
!       *ndimsp = vp->assoc->count ;
!       for(ii = 0 ; ii < *ndimsp ; ii++)
        {
!               dims[ii] = vp->assoc->values[ii] ;
        }
!       if( vp->attrs != NULL)
        {
!               *nattrsp = vp->attrs->count ;
!       } else {
!               *nattrsp = 0 ;
        }
  
--- 420,444 ----
        }
  
!       if(typep != 0)
!               *typep = vp->type ;
!       if(ndimsp != 0)
        {
!               *ndimsp = vp->assoc->count ;
!               if(dims != 0)
!               {
!                       for(ii = 0 ; ii < *ndimsp ; ii++)
!                       {
!                               dims[ii] = vp->assoc->values[ii] ;
!                       }
!               }
        }
!       if(nattrsp != 0)
        {
!               if( vp->attrs != NULL)
!               {
!                       *nattrsp = vp->attrs->count ;
!               } else {
!                       *nattrsp = 0 ;
!               }
        }
  
diff -c2 -r ../netcdf-2.01/src/version.c ./src/version.c
*** ../netcdf-2.01/src/version.c        Thu Oct 24 19:21:59 1991
--- ./src/version.c     Mon Dec 23 05:00:38 1991
***************
*** 1,3 ****
  #ifndef lint
!     static char       VersionID[]     = "$Id: version.c,v 1.11 1991/09/16 
21:06:31 steve Exp $";
  #endif
--- 1,3 ----
  #ifndef lint
!     static char       VersionID[]     = "$Id: version.c,v 2.2 1991/12/05 
23:58:56 davis Exp $";
  #endif


  • 1991 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: