mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-30 16:10:44 +08:00
Merge branch 'v4.5.0-release-branch' into netrc.dmh
This commit is contained in:
commit
67018ecabb
@ -757,6 +757,11 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4)
|
||||
|
||||
ENDIF(USE_HDF5 OR ENABLE_NETCDF_4)
|
||||
|
||||
# Option to turn on CDF5 support.
|
||||
OPTION(ENABLE_CDF5 "Enable CDF5 Support." OFF)
|
||||
IF(ENABLE_CDF5)
|
||||
SET(USE_CDF5 ON CACHE BOOL "")
|
||||
ENDIF(ENABLE_CDF5)
|
||||
|
||||
# Option to Build DAP2+DAP4 Clients
|
||||
OPTION(ENABLE_DAP "Enable DAP2 and DAP4 Client." ON)
|
||||
@ -805,6 +810,12 @@ IF(ENABLE_DAP)
|
||||
#include <curl/curl.h>
|
||||
int main() {int x = CURLOPT_CHUNK_BGN_FUNCTION;}" HAVE_CURLOPT_CHUNK_BGN_FUNCTION)
|
||||
|
||||
# Check to see if CURLINFO_HTTP_CODE is defined.
|
||||
# It showed up in curl 7.10.7.
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
#include <curl/curl.h>
|
||||
int main() {int x = CURLINFO_HTTP_CODE;}" HAVE_CURLINFO_HTTP_CODE)
|
||||
|
||||
ELSE()
|
||||
SET(ENABLE_DAP2 OFF)
|
||||
SET(ENABLE_DAP4 OFF)
|
||||
@ -1891,6 +1902,7 @@ is_enabled(USE_DISKLESS HAS_DISKLESS)
|
||||
is_enabled(USE_MMAP HAS_MMAP)
|
||||
is_enabled(JNA HAS_JNA)
|
||||
is_enabled(STATUS_RELAX_COORD_BOUND RELAX_COORD_BOUND)
|
||||
is_enabled(ENABLE_CDF5 HAS_CDF5)
|
||||
|
||||
# Generate file from template.
|
||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/libnetcdf.settings.in"
|
||||
|
@ -1,4 +1,4 @@
|
||||
Release Notes {#RELEASE_NOTES}
|
||||
qRelease Notes {#RELEASE_NOTES}
|
||||
=============
|
||||
|
||||
\brief Release notes file for the netcdf-c package.
|
||||
@ -7,6 +7,10 @@ This file contains a high-level description of this package's evolution. Release
|
||||
|
||||
## 4.5.0 - TBD
|
||||
|
||||
* [Bug] Corrected an issue where older versions of curl might fail. See [GitHub #487](https://github.com/Unidata/netcdf-c/issues/487) for more information.
|
||||
* [Enhancement] Added options to enable/disable `CDF5` support at configure time for autotools and cmake-based builds. The options are `--enable/disable-cdf5` and `ENABLE_CDF5`, respectively. See [Github #484](https://github.com/Unidata/netcdf-c/issues/484) for more information.
|
||||
* [Bug Fix] Corrected an issue when subsetting a netcdf3 file via `nccopy -v/-V`. See [Github #425](https://github.com/Unidata/netcdf-c/issues/425) and [Github #463](https://github.com/Unidata/netcdf-c/issues/463) for more information.
|
||||
* [Bug Fix] Corrected `--has-dap` and `--has-dap4` output for cmake-based builds. See [GitHub #473](https://github.com/Unidata/netcdf-c/pull/473) for more information.
|
||||
* [Bug Fix] Corrected an issue where `NC_64BIT_DATA` files were being read incorrectly by ncdump, despite the data having been written correctly. See [GitHub #457](https://github.com/Unidata/netcdf-c/issues/457) for more information.
|
||||
* [Bug Fix] Corrected a potential stack buffer overflow. See [GitHub #450](https://github.com/Unidata/netcdf-c/pull/450) for more information.
|
||||
|
||||
|
@ -107,6 +107,10 @@ are set when opening a binary file on Windows. */
|
||||
/* set this only when building a DLL under MinGW */
|
||||
#cmakedefine DLL_NETCDF 1
|
||||
|
||||
/* if true, enable CDF5 Support */
|
||||
#cmakedefine ENABLE_CDF5 1
|
||||
#cmakedefine USE_CDF5 1
|
||||
|
||||
/* if true, build DAP2 and DAP4 Client */
|
||||
#cmakedefine ENABLE_DAP 1
|
||||
|
||||
@ -147,6 +151,9 @@ are set when opening a binary file on Windows. */
|
||||
/* Is CURLINFO_RESPONSE_CODE defined */
|
||||
#cmakedefine HAVE_CURLINFO_RESPONSE_CODE 1
|
||||
|
||||
/* Is CURLINFO_HTTP_CODE defined */
|
||||
#cmakedefine HAVE_CURLINFO_HTTP_CODE 1
|
||||
|
||||
/* Is CURLOPT_CHUNK_BGN_FUNCTION defined */
|
||||
#cmakedefine HAVE_CURLOPT_CHUNK_BGN_FUNCTION 1
|
||||
|
||||
|
27
configure.ac
27
configure.ac
@ -441,6 +441,22 @@ AC_MSG_RESULT([$enable_dap_long_tests])
|
||||
|
||||
AM_CONDITIONAL(INTERNAL_OCLIB,[test "x" = "x"])
|
||||
|
||||
# Check whether we want to enable CDF5 support.
|
||||
AC_MSG_CHECKING([whether CDF5 support should be enabled (default off)])
|
||||
AC_ARG_ENABLE([cdf5],
|
||||
[AS_HELP_STRING([--enable-cdf5],
|
||||
[build with CDF5 support.])])
|
||||
test "x$enable_cdf5" = xyes || enable_cdf5=no
|
||||
AC_MSG_RESULT($enable_cdf5)
|
||||
|
||||
if test "x$enable_cdf5" = xyes; then
|
||||
AC_DEFINE([USE_CDF5], [1], [if true, enable CDF5 Support])
|
||||
AC_DEFINE([ENABLE_CDF5], [1], [if true, enable CDF5 Support])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(USE_CDF5, [test x$enable_cdf5 = xyes ])
|
||||
AM_CONDITIONAL(ENABLE_CDF5, [test x$enable_cdf5 = xyes ])
|
||||
|
||||
# Does the user want to do some extra tests?
|
||||
AC_MSG_CHECKING([whether netCDF extra tests should be run (developers only)])
|
||||
AC_ARG_ENABLE([extra-tests],
|
||||
@ -1000,11 +1016,15 @@ if test "x$enable_netcdf_4" = xyes; then
|
||||
fi
|
||||
|
||||
# The user may have built HDF5 with the SZLIB library.
|
||||
enable_szlib=no
|
||||
if test "x$ac_cv_func_H5Z_SZIP" = xyes; then
|
||||
AC_SEARCH_LIBS([SZ_Compress], [szip sz], [], [])
|
||||
enable_szlib=yes
|
||||
AC_SEARCH_LIBS([ SZ_Compress], [szip sz], [], [])
|
||||
AC_DEFINE([USE_SZIP], [1], [if true, compile in szip compression in netCDF-4 variables])
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if test "x$ac_cv_func_H5free_memory" = xyes; then
|
||||
AC_DEFINE([HDF5_HAS_H5FREE], [1], [if true, H5free_memory() will be used to free hdf5-allocated memory in nc4file.])
|
||||
fi
|
||||
@ -1249,7 +1269,7 @@ AM_CONDITIONAL(USE_DAP, [test "x$enable_dap" = xyes]) # Alias
|
||||
# Provide protocol specific flags
|
||||
AM_CONDITIONAL(ENABLE_DAP, [test "x$enable_dap" = xyes])
|
||||
AM_CONDITIONAL(ENABLE_DAP4, [test "x$enable_dap4" = xyes])
|
||||
|
||||
AM_CONDITIONAL(ENABLE_CDF5, [test "x$enable_cdf5" = xyes])
|
||||
AM_CONDITIONAL(ENABLE_DAP_REMOTE_TESTS, [test "x$enable_dap_remote_tests" = xyes])
|
||||
AM_CONDITIONAL(ENABLE_DAP_AUTH_TESTS, [test "x$enable_dap_auth_tests" = xyes])
|
||||
AM_CONDITIONAL(ENABLE_DAP_LONG_TESTS, [test "x$enable_dap_long_tests" = xyes])
|
||||
@ -1362,11 +1382,12 @@ AC_SUBST(HAS_DAP,[$enable_dap])
|
||||
AC_SUBST(HAS_DAP4,[$enable_dap4])
|
||||
AC_SUBST(HAS_NC2,[$nc_build_v2])
|
||||
AC_SUBST(HAS_NC4,[$enable_netcdf_4])
|
||||
AC_SUBST(HAS_CDF5,[$enable_cdf5])
|
||||
AC_SUBST(HAS_HDF4,[$enable_hdf4])
|
||||
AC_SUBST(HAS_PNETCDF,[$enable_pnetcdf])
|
||||
AC_SUBST(HAS_HDF5,[$enable_netcdf_4])
|
||||
AC_SUBST(HAS_LOGGING, [$enable_logging])
|
||||
AC_SUBST(HAS_SZLIB,[$ac_cv_func_H4Z_SZIP])
|
||||
AC_SUBST(HAS_SZLIB,[$enable_szlib])
|
||||
AC_SUBST(HAS_PARALLEL,[$enable_parallel])
|
||||
AC_SUBST(HAS_PARALLEL4,[$enable_parallel4])
|
||||
AC_SUBST(HAS_DISKLESS,[$enable_diskless])
|
||||
|
@ -25,11 +25,14 @@ It is strongly recommended that applicable conventions be followed unless there
|
||||
|
||||
<p>
|
||||
|
||||
> It is not necessary to define your own _FillValue attribute for a variable if the default fill value for the type of the variable is adequate. However, use of the default fill value for data type byte is not recommended. Note that if you change the value of this attribute, the changed value applies only to subsequent writes; previously written data are not changed.
|
||||
> If _FillValue is undefined, it is assumed that there are no unwritten data-values. Generic applications needing to write a value to represent undefined or missing values may use either `_FillValue` or `missing_value` for this purpose. It is legal (but not recommended) for the fill value to be within the valid range of the data.
|
||||
|
||||
<p>
|
||||
|
||||
> Generic applications often need to write a value to represent undefined or missing values. The fill value provides an appropriate value for this purpose because it is normally outside the valid range and therefore treated as missing when read by generic applications. It is legal (but not recommended) for the fill value to be within the valid range.
|
||||
> Generic applications often need to write a value to represent undefined or missing values. The fill value provides an appropriate value for this purpose because it is normally outside the valid range and therefore treated as missing when read by generic applications. It is legal (but not recommended) for the fill value to be within the valid range.
|
||||
|
||||
> **Note that if you change the value of this attribute, the changed value applies only to subsequent writes; previously written data are not changed.**
|
||||
|
||||
|
||||
`missing_value`
|
||||
|
||||
@ -183,4 +186,3 @@ Using the following API calls will fail.
|
||||
> The type of this attribute is NC_INT.
|
||||
|
||||
> This attribute is computed by using the HDF5 API to walk the file to look for attributes specific to netcdf-4. False negatives are possible for a small subset of netcdf-4 files, especially those not containing dimensions. False positives are only possible by deliberate modifications to an existing HDF5 file thru the HDF5 API. For files with the _NCProperties attribute, this attribute is redundant. For files created prior to the introduction of the _NCProperties attribute, this may be a useful indicator of the provenance of the file.
|
||||
|
||||
|
@ -22,9 +22,10 @@ The atomic external types supported by the netCDF interface are:
|
||||
- ::NC_UINT64 64-bit unsigned integer *
|
||||
- ::NC_FLOAT 32-bit floating point
|
||||
- ::NC_DOUBLE 64-bit floating point
|
||||
- ::NC_STRING variable length character string *
|
||||
- ::NC_STRING variable length character string +
|
||||
|
||||
\remark{* These types are available only for CDF5 (NC_CDF5) and netCDF-4 format (NC_NETCDF4) files. All the unsigned ints (except \ref NC_CHAR), the 64-bit ints, and string type are for CDF5 or netCDF-4 files only.}
|
||||
\remark * These types are available only for CDF5 (NC_CDF5) and netCDF-4 format (NC_NETCDF4) files. All the unsigned ints (except \ref NC_CHAR) and the 64-bit ints are for CDF5 or netCDF-4 files only.
|
||||
\remark + These types are available only for netCDF-4 (NC_NETCDF4) files.
|
||||
|
||||
These types were chosen to provide a reasonably wide range of
|
||||
trade-offs between data precision and number of bits required for each
|
||||
|
@ -9,6 +9,10 @@
|
||||
#define TIMEOUT 10 /*seconds*/
|
||||
#define BUFSIZE 8192 /*bytes*/
|
||||
|
||||
#ifndef HAVE_CURLINFO_RESPONSE_CODE
|
||||
#define CURLINFO_RESPONSE_CODE CURLINFO_HTTP_CODE
|
||||
#endif
|
||||
|
||||
static int ping(const char* url);
|
||||
|
||||
static char**
|
||||
|
@ -11,7 +11,9 @@ struct CURLFLAG curlopts[] = {
|
||||
{"CURLOPT_PROXYUSERPWD",CURLOPT_PROXYUSERPWD,10006,CF_STRING},
|
||||
{"CURLOPT_SSLCERT",CURLOPT_SSLCERT,10025,CF_STRING},
|
||||
{"CURLOPT_SSLKEY",CURLOPT_SSLKEY,10087,CF_STRING},
|
||||
#ifdef HAVE_CURLOPT_KEYPASSWD
|
||||
{"CURLOPT_SSLKEYPASSWD",CURLOPT_SSLKEYPASSWD,CURLOPT_KEYPASSWD,CF_STRING},
|
||||
#endif
|
||||
{"CURLOPT_SSL_VERIFYHOST",CURLOPT_SSL_VERIFYHOST,81,CF_LONG},
|
||||
{"CURLOPT_SSL_VERIFYPEER",CURLOPT_SSL_VERIFYPEER,64,CF_LONG},
|
||||
{"CURLOPT_TIMEOUT",CURLOPT_TIMEOUT,13,CF_LONG},
|
||||
|
@ -6,6 +6,14 @@
|
||||
#ifndef D4CURLFUNCTIONS_H
|
||||
#define D4CURLFUNCTIONS_H
|
||||
|
||||
/* Aliases to older names */
|
||||
#ifndef HAVE_CURLOPT_KEYPASSWD
|
||||
#define CURLOPT_KEYPASSWD CURLOPT_SSLKEYPASSWD
|
||||
#endif
|
||||
#ifndef HAVE_CURLINFO_RESPONSE_CODE
|
||||
#define CURLINFO_RESPONSE_CODE CURLINFO_HTTP_CODE
|
||||
#endif
|
||||
|
||||
enum CURLFLAGTYPE {CF_UNKNOWN=0,CF_OTHER=1,CF_STRING=2,CF_LONG=3};
|
||||
struct CURLFLAG {
|
||||
const char* name;
|
||||
|
@ -103,9 +103,11 @@ rcorder(NClist* rc)
|
||||
nclistpush(newrc,ti);
|
||||
}
|
||||
#ifdef D4DEBUG
|
||||
|
||||
storedump("reorder:",newrc);
|
||||
#endif
|
||||
return newrc;
|
||||
|
||||
}
|
||||
|
||||
/* Create a triple store from a file */
|
||||
@ -540,7 +542,9 @@ storedump(char* msg, NClist* triples)
|
||||
for(i=0;i<nclistlength(triples);i++) {
|
||||
NCD4triple* t = (NCD4triple*)nclistget(triples,i);
|
||||
fprintf(stderr,"\t%s\t%s\t%s\n",
|
||||
|
||||
((t->host == NULL || strlen(t->host)==0)?"--":t->host),t->key,t->value);
|
||||
|
||||
}
|
||||
fflush(stderr);
|
||||
}
|
||||
|
@ -104,10 +104,12 @@ NC_interpret_magic_number(char* magic, int* model, int* version, int use_paralle
|
||||
} else if(magic[3] == '\002') {
|
||||
*version = 2; /* netcdf classic version 2 */
|
||||
*model = NC_FORMATX_NC3;
|
||||
} else if(magic[3] == '\005') {
|
||||
*version = 5; /* cdf5 (including pnetcdf) file */
|
||||
#ifdef USE_CDF5
|
||||
} else if(magic[3] == '\005') {
|
||||
*version = 5; /* cdf5 (including pnetcdf) file */
|
||||
*model = NC_FORMATX_NC3;
|
||||
} else
|
||||
#endif
|
||||
} else
|
||||
{status = NC_ENOTNC; goto done;}
|
||||
} else
|
||||
{status = NC_ENOTNC; goto done;}
|
||||
@ -1720,11 +1722,13 @@ fprintf(stderr,"XXX: path0=%s path=%s\n",path0,path); fflush(stderr);
|
||||
model = NC_FORMATX_NC4;
|
||||
break;
|
||||
#endif
|
||||
#ifdef USE_CDF5
|
||||
case NC_FORMAT_CDF5:
|
||||
xcmode |= NC_64BIT_DATA;
|
||||
model = NC_FORMATX_NC3;
|
||||
break;
|
||||
case NC_FORMAT_64BIT_OFFSET:
|
||||
#endif
|
||||
case NC_FORMAT_64BIT_OFFSET:
|
||||
xcmode |= NC_64BIT_OFFSET;
|
||||
model = NC_FORMATX_NC3;
|
||||
break;
|
||||
|
@ -34,3 +34,4 @@ DAP4 Support: @HAS_DAP4@
|
||||
Diskless Support: @HAS_DISKLESS@
|
||||
MMap Support: @HAS_MMAP@
|
||||
JNA Support: @HAS_JNA@
|
||||
CDF5 Support: @HAS_CDF5@
|
||||
|
@ -95,9 +95,12 @@ err:
|
||||
int
|
||||
nc3_cktype(int mode, nc_type type)
|
||||
{
|
||||
#ifdef USE_CDF5
|
||||
if (mode & NC_CDF5) { /* CDF-5 format */
|
||||
if (type >= NC_BYTE && type < NC_STRING) return NC_NOERR;
|
||||
} else if (mode & NC_64BIT_OFFSET) { /* CDF-2 format */
|
||||
} else
|
||||
#endif
|
||||
if (mode & NC_64BIT_OFFSET) { /* CDF-2 format */
|
||||
if (type >= NC_BYTE && type <= NC_DOUBLE) return NC_NOERR;
|
||||
} else if ((mode & NC_64BIT_OFFSET) == 0) { /* CDF-1 format */
|
||||
if (type >= NC_BYTE && type <= NC_DOUBLE) return NC_NOERR;
|
||||
@ -1086,8 +1089,11 @@ nc_set_default_format(int format, int *old_formatp)
|
||||
format != NC_FORMAT_NETCDF4 && format != NC_FORMAT_NETCDF4_CLASSIC)
|
||||
return NC_EINVAL;
|
||||
#else
|
||||
if (format != NC_FORMAT_CLASSIC && format != NC_FORMAT_64BIT_OFFSET &&
|
||||
format != NC_FORMAT_CDF5)
|
||||
if (format != NC_FORMAT_CLASSIC && format != NC_FORMAT_64BIT_OFFSET
|
||||
#ifdef USE_CDF5
|
||||
&& format != NC_FORMAT_CDF5
|
||||
#endif
|
||||
)
|
||||
return NC_EINVAL;
|
||||
#endif
|
||||
default_create_format = format;
|
||||
@ -1582,9 +1588,12 @@ NC3_inq_format(int ncid, int *formatp)
|
||||
nc3 = NC3_DATA(nc);
|
||||
|
||||
/* only need to check for netCDF-3 variants, since this is never called for netCDF-4 files */
|
||||
#ifdef USE_CDF5
|
||||
if (fIsSet(nc3->flags, NC_64BIT_DATA))
|
||||
*formatp = NC_FORMAT_CDF5;
|
||||
else if (fIsSet(nc3->flags, NC_64BIT_OFFSET))
|
||||
else
|
||||
#endif
|
||||
if (fIsSet(nc3->flags, NC_64BIT_OFFSET))
|
||||
*formatp = NC_FORMAT_64BIT_OFFSET;
|
||||
else
|
||||
*formatp = NC_FORMAT_CLASSIC;
|
||||
|
@ -22,59 +22,71 @@ else
|
||||
has_dap2="yes"
|
||||
fi
|
||||
|
||||
has_dap4="@ENABLE_DAP4"
|
||||
has_dap4="@ENABLE_DAP4@"
|
||||
if [ -z $has_dap4 -o "$has_dap4" = "OFF" ]; then
|
||||
has_dap4="no"
|
||||
else
|
||||
has_dap4="yes"
|
||||
fi
|
||||
|
||||
has_nc2="@BUILD_V2@"
|
||||
|
||||
|
||||
if [ -z $has_nc2 -o "$has_nc2" = "OFF" ]; then
|
||||
if [ -z "$has_nc2" -o "$has_nc2" = "OFF" ]; then
|
||||
has_nc2="no"
|
||||
else
|
||||
has_nc2="yes"
|
||||
fi
|
||||
|
||||
has_nc4="@USE_NETCDF4@"
|
||||
if [ -z $has_nc4 ]; then
|
||||
if [ -z "$has_nc4" -o "$has_nc4" = "OFF" ]; then
|
||||
has_nc4="no"
|
||||
else
|
||||
has_nc4="yes"
|
||||
fi
|
||||
|
||||
has_logging="@ENABLE_LOGGING@"
|
||||
if [ -z $has_logging ]; then
|
||||
if [ -z "$has_logging" -o "$has_logging" = "OFF" ]; then
|
||||
has_logging="no"
|
||||
else
|
||||
has_logging="yes"
|
||||
fi
|
||||
|
||||
has_hdf4="@USE_HDF4@"
|
||||
if [ -z $has_hdf4 ]; then
|
||||
if [ -z "$has_hdf4" -o "$has_hdf4" = "OFF" ]; then
|
||||
has_hdf4="no"
|
||||
else
|
||||
has_hdf4="yes"
|
||||
fi
|
||||
|
||||
has_pnetcdf="@USE_PNETCDF@"
|
||||
if [ -z $has_pnetcdf ]; then
|
||||
if [ -z "$has_pnetcdf" -o "$has_pnetcdf" = "OFF" ]; then
|
||||
has_pnetcdf="no"
|
||||
else
|
||||
has_pnetcdf="yes"
|
||||
fi
|
||||
|
||||
has_hdf5="@USE_HDF5@"
|
||||
if [ -z $has_hdf5 -o "$has_hdf5" = "OFF" ]; then
|
||||
if [ -z "$has_hdf5" -o "$has_hdf5" = "OFF" ]; then
|
||||
has_hdf5="no"
|
||||
else
|
||||
has_hdf5="yes"
|
||||
fi
|
||||
|
||||
has_szlib="@USE_SZLIB@"
|
||||
if [ -z $has_szlib ]; then
|
||||
if [ -z "$has_szlib" -o "$has_szlib" = "OFF" ]; then
|
||||
has_szlib="no"
|
||||
else
|
||||
has_szlib="yes"
|
||||
fi
|
||||
|
||||
has_cdf5="@USE_CDF5@"
|
||||
if [ -z "has_cdf5" -o "$has_cdf5" = "OFF" ]; then
|
||||
has_cdf5="no"
|
||||
else
|
||||
has_cdf5="yes"
|
||||
fi
|
||||
|
||||
|
||||
version="@PACKAGE@ @VERSION@"
|
||||
|
||||
@ -128,7 +140,7 @@ Available values for OPTION include:
|
||||
--has-fortran whether Fortran API is installed
|
||||
--has-dap2 whether OPeNDAP (DAP2) is enabled in this build
|
||||
--has-dap4 whether DAP4 is enabled in this build
|
||||
--has-dap same as --has-dp (Deprecated)
|
||||
--has-dap same as --has-dap2 (Deprecated)
|
||||
--has-nc2 whether NetCDF-2 API is enabled
|
||||
--has-nc4 whether NetCDF-4/HDF-5 is enabled in this build
|
||||
--has-hdf5 whether HDF5 is used in build (always the same as --has-nc4)
|
||||
@ -136,6 +148,7 @@ Available values for OPTION include:
|
||||
--has-logging whether logging is enabled with --enable-logging.
|
||||
--has-pnetcdf whether parallel-netcdf (a.k.a. pnetcdf) was used in build
|
||||
--has-szlib whether szlib is included in build
|
||||
--has-cdf5 whether cdf5 support is included in build
|
||||
--libs library linking information for netcdf
|
||||
--prefix Install prefix
|
||||
--includedir Include directory
|
||||
@ -202,7 +215,7 @@ if [ -f "$nfconf" ]; then
|
||||
echo " --has-f03 -> $has_f03"
|
||||
echo
|
||||
fi
|
||||
echo " --has-dap -> $has_dap"
|
||||
echo " --has-dap -> $has_dap2"
|
||||
echo " --has-dap2 -> $has_dap2"
|
||||
echo " --has-dap4 -> $has_dap4"
|
||||
echo " --has-nc2 -> $has_nc2"
|
||||
@ -212,6 +225,7 @@ fi
|
||||
echo " --has-logging-> $has_logging"
|
||||
echo " --has-pnetcdf-> $has_pnetcdf"
|
||||
echo " --has-szlib -> $has_szlib"
|
||||
echo " --has-cdf5 -> $has_cdf5"
|
||||
echo
|
||||
echo " --prefix -> $prefix"
|
||||
echo " --includedir-> $includedir"
|
||||
@ -252,7 +266,7 @@ while test $# -gt 0; do
|
||||
;;
|
||||
|
||||
--has-dap)
|
||||
echo $has_dap2 $has_dap4
|
||||
echo $has_dap2
|
||||
;;
|
||||
|
||||
--has-dap2)
|
||||
@ -291,6 +305,10 @@ while test $# -gt 0; do
|
||||
echo $has_szlib
|
||||
;;
|
||||
|
||||
--has-cdf5)
|
||||
echo $has_cdf5
|
||||
;;
|
||||
|
||||
--libs)
|
||||
echo $libs
|
||||
;;
|
||||
|
12
nc-config.in
12
nc-config.in
@ -21,8 +21,12 @@ has_hdf4="@HAS_HDF4@"
|
||||
has_pnetcdf="@HAS_PNETCDF@"
|
||||
has_hdf5="@HAS_HDF5@"
|
||||
has_logging="@HAS_LOGGING@"
|
||||
has_cdf5="@HAS_CDF5@"
|
||||
has_szlib="@HAS_SZLIB@"
|
||||
version="@PACKAGE_NAME@ @PACKAGE_VERSION@"
|
||||
|
||||
|
||||
|
||||
has_fortran="no"
|
||||
has_f90="no"
|
||||
has_f03="no"
|
||||
@ -79,8 +83,9 @@ Available values for OPTION include:
|
||||
--has-logging whether logging is enabled with --enable-logging.
|
||||
--has-pnetcdf whether parallel-netcdf (a.k.a. pnetcdf) was used in build
|
||||
--has-szlib whether szlib is included in build
|
||||
--has-cdf5 whether cdf5 support is included in build
|
||||
--libs library linking information for netcdf
|
||||
--prefix Install prefix
|
||||
--prefix Install prefixx
|
||||
--includedir Include directory
|
||||
--libdir Library directory
|
||||
--version Library version
|
||||
@ -154,6 +159,7 @@ fi
|
||||
echo " --has-logging-> $has_logging"
|
||||
echo " --has-pnetcdf-> $has_pnetcdf"
|
||||
echo " --has-szlib -> $has_szlib"
|
||||
echo " --has-cdf5 -> $has_cdf5"
|
||||
echo
|
||||
echo " --prefix -> $prefix"
|
||||
echo " --includedir-> $includedir"
|
||||
@ -229,6 +235,10 @@ while test $# -gt 0; do
|
||||
echo $has_szlib
|
||||
;;
|
||||
|
||||
--has-cdf5)
|
||||
echo $has_cdf5
|
||||
;;
|
||||
|
||||
--libs)
|
||||
echo $libs
|
||||
;;
|
||||
|
@ -9,6 +9,8 @@ int numVars; /* number of variables */
|
||||
int numTypes; /* number of netCDF data types to test */
|
||||
|
||||
#include "tests.h"
|
||||
#include "config.h"
|
||||
|
||||
|
||||
/*
|
||||
* Test driver for netCDF-3 interface. This program performs tests against
|
||||
@ -130,14 +132,19 @@ main(int argc, char *argv[])
|
||||
fprintf(stderr, "\n\nSwitching to 64-bit offset format.\n");
|
||||
strcpy(testfile, "nc_test_64bit.nc");
|
||||
break;
|
||||
|
||||
case NC_FORMAT_CDF5:
|
||||
nc_set_default_format(NC_FORMAT_CDF5, NULL);
|
||||
#ifdef USE_CDF5
|
||||
nc_set_default_format(NC_FORMAT_CDF5, NULL);
|
||||
fprintf(stderr, "\n\nSwitching to 64-bit data format.\n");
|
||||
strcpy(testfile, "nc_test_cdf5.nc");
|
||||
numGatts = NGATTS;
|
||||
numVars = NVARS;
|
||||
numTypes = NTYPES;
|
||||
break;
|
||||
#else
|
||||
continue;
|
||||
#endif
|
||||
case NC_FORMAT_NETCDF4_CLASSIC:
|
||||
case NC_FORMAT_NETCDF4: /* actually it's _CLASSIC. */
|
||||
#ifdef USE_NETCDF4
|
||||
|
@ -33,6 +33,7 @@ dnl
|
||||
#endif
|
||||
|
||||
#include "tests.h"
|
||||
#include "config.h"
|
||||
#include "math.h"
|
||||
|
||||
define(`EXPECT_ERR',`error("expecting $1 but got %s",nc_err_code_name($2));')dnl
|
||||
@ -2405,8 +2406,11 @@ APIFunc(get_file_version)(char *path, int *version)
|
||||
|
||||
if (strncmp(magic, "CDF", MAGIC_NUM_LEN-1)==0) {
|
||||
if (magic[MAGIC_NUM_LEN-1] == NC_FORMAT_CLASSIC ||
|
||||
magic[MAGIC_NUM_LEN-1] == NC_FORMAT_64BIT_OFFSET ||
|
||||
magic[MAGIC_NUM_LEN-1] == NC_FORMAT_CDF5)
|
||||
magic[MAGIC_NUM_LEN-1] == NC_FORMAT_64BIT_OFFSET
|
||||
#ifdef USE_CDF5
|
||||
|| magic[MAGIC_NUM_LEN-1] == NC_FORMAT_CDF5
|
||||
#endif
|
||||
)
|
||||
*version = magic[MAGIC_NUM_LEN-1];
|
||||
else
|
||||
return NC_ENOTNC;
|
||||
@ -2449,8 +2453,8 @@ TestFunc(set_default_format)(void)
|
||||
ELSE_NOK
|
||||
|
||||
/* Cycle through available formats. */
|
||||
for(i=NC_FORMAT_CLASSIC; i<NC_FORMAT_64BIT_DATA; i++)
|
||||
{
|
||||
|
||||
for(i=NC_FORMAT_CLASSIC; i<NC_FORMAT_64BIT_DATA; i++) {
|
||||
if (i == NC_FORMAT_NETCDF4 || i == NC_FORMAT_NETCDF4_CLASSIC)
|
||||
continue; /* test classic formats only */
|
||||
if ((err = APIFunc(set_default_format)(i, NULL)))
|
||||
|
@ -54,8 +54,11 @@ static int file_create(const char *filename, int cmode, int *ncid)
|
||||
|
||||
#ifdef USE_PNETCDF
|
||||
if (default_format == NC_FORMAT_CLASSIC ||
|
||||
default_format == NC_FORMAT_64BIT_OFFSET ||
|
||||
default_format == NC_FORMAT_64BIT_DATA)
|
||||
default_format == NC_FORMAT_64BIT_OFFSET
|
||||
#ifdef USE_CDF5
|
||||
|| default_format == NC_FORMAT_64BIT_DATA
|
||||
#endif
|
||||
)
|
||||
err = nc_create_par(filename, cmode|NC_PNETCDF, MPI_COMM_WORLD, MPI_INFO_NULL, ncid);
|
||||
else
|
||||
#endif
|
||||
@ -522,11 +525,16 @@ main(int argc, char **argv)
|
||||
printf("Switching to 64-bit offset format.\n");
|
||||
strcpy(testfile, "tst_small_64bit.nc");
|
||||
break;
|
||||
#ifdef USE_CDF5
|
||||
case NC_FORMAT_CDF5:
|
||||
nc_set_default_format(NC_FORMAT_CDF5, NULL);
|
||||
printf("Switching to 64-bit data format.\n");
|
||||
strcpy(testfile, "tst_small_cdf5.nc");
|
||||
break;
|
||||
#else
|
||||
case NC_FORMAT_CDF5:
|
||||
continue;
|
||||
#endif
|
||||
#ifdef USE_NETCDF4
|
||||
case NC_FORMAT_NETCDF4_CLASSIC:
|
||||
nc_set_default_format(NC_FORMAT_NETCDF4_CLASSIC, NULL);
|
||||
|
@ -131,6 +131,7 @@ ENDIF()
|
||||
ENDIF(USE_NETCDF4)
|
||||
|
||||
add_sh_test(ncdump tst_nccopy3)
|
||||
add_sh_test(ncdump tst_nccopy3_subset)
|
||||
add_sh_test(ncdump tst_charfill)
|
||||
|
||||
add_sh_test(ncdump tst_formatx3)
|
||||
|
@ -43,7 +43,7 @@ check_PROGRAMS = rewrite-scalar ctest ctest64 ncdump tst_utf8 bom tst_dimsizes n
|
||||
|
||||
TESTS = tst_inttags.sh run_tests.sh tst_64bit.sh ctest ctest64 tst_output.sh \
|
||||
tst_lengths.sh tst_calendars.sh tst_utf8 run_utf8_tests.sh \
|
||||
tst_nccopy3.sh tst_charfill.sh tst_iter.sh tst_formatx3.sh tst_bom.sh \
|
||||
tst_nccopy3.sh tst_nccopy3_subset.sh tst_charfill.sh tst_iter.sh tst_formatx3.sh tst_bom.sh \
|
||||
tst_dimsizes.sh run_ncgen_tests.sh
|
||||
|
||||
if USE_NETCDF4
|
||||
@ -62,6 +62,10 @@ TESTS += tst_inmemory_nc4.sh
|
||||
endif
|
||||
endif
|
||||
|
||||
if USE_NETCDF4
|
||||
TESTS += tst_inttags4.sh
|
||||
endif
|
||||
|
||||
if USE_NETCDF4
|
||||
# NetCDF-4 has some extra tests.
|
||||
check_PROGRAMS += tst_create_files tst_h_rdc0 tst_group_data \
|
||||
@ -69,7 +73,7 @@ tst_enum_data tst_opaque_data tst_string_data tst_vlen_data tst_comp \
|
||||
tst_comp2 tst_nans tst_special_atts tst_unicode tst_fillbug tst_compress \
|
||||
tst_chunking tst_h_scalar tst_bug324
|
||||
|
||||
TESTS += tst_inttags4.sh tst_create_files tst_group_data tst_enum_data tst_opaque_data \
|
||||
TESTS += tst_create_files tst_group_data tst_enum_data tst_opaque_data \
|
||||
tst_string_data tst_vlen_data tst_comp tst_comp2 tst_nans \
|
||||
tst_special_atts tst_netcdf4.sh tst_h_rdc0 tst_unicode tst_fillbug \
|
||||
tst_fillbug.sh tst_netcdf4_4.sh tst_compress tst_nccopy4.sh \
|
||||
@ -110,7 +114,10 @@ endif
|
||||
|
||||
endif BUILD_TESTSETS
|
||||
|
||||
CLEANFILES = test0.nc test1.cdl test1.nc test2.cdl ctest1.cdl \
|
||||
CLEANFILES = test0.nc test1_ncdump.cdl test1_ncdump.nc test2_ncdump.cdl \
|
||||
test1.cdl test0_ncdump.nc ctest1.cdl \
|
||||
test1_cdf5.nc test1_cdf5.cdl test0_cdf5.nc test2_cdf5.nc test2_cdf5.cdl \
|
||||
test0_offset.nc test1_offset.nc test1_offset.cdl test2_offset.nc test2_offset.cdl \
|
||||
ctest0.nc ctest0_64.nc c1.cdl c1_4.cdl ctest1_64.cdl c0.nc c0_4.nc small.nc \
|
||||
small2.nc c0tmp.nc c1.ncml utf8.cdl utf8_64.cdl utf8.nc utf8_64.nc \
|
||||
tmp.cdl tst_vlen_data.nc tst_utf8.nc tst_special_atts.nc \
|
||||
@ -135,10 +142,10 @@ tst_dimsize_classic.nc tst_dimsize_64offset.nc tst_dimsize_64data.nc \
|
||||
nc4_fileinfo.nc hdf5_fileinfo.hdf \
|
||||
ref_hdf5_compat1.nc ref_hdf5_compat2.nc ref_hdf5_compat3.nc \
|
||||
ref_tst_compounds.nc ref_tst_dims.nc ref_tst_interops4.nc \
|
||||
ref_tst_xplatform2_1.nc ref_tst_xplatform2_2.nc
|
||||
ref_tst_xplatform2_1.nc ref_tst_xplatform2_2.nc nccopy3_subset_out.nc
|
||||
|
||||
# These files all have to be included with the distribution.
|
||||
EXTRA_DIST = run_tests.sh tst_64bit.sh tst_output.sh test0.cdl \
|
||||
EXTRA_DIST = run_tests.sh tst_64bit.sh tst_output.sh test0.cdl \
|
||||
ref_ctest1_nc4.cdl ref_ctest1_nc4c.cdl ref_tst_solar_1.cdl \
|
||||
ref_tst_solar_2.cdl tst_netcdf4.sh tst_netcdf4_4.sh ref_tst_small.cdl \
|
||||
tst_lengths.sh tst_ncml.cdl ref1.ncml ref_tst_group_data.cdl \
|
||||
@ -164,7 +171,7 @@ tst_formatx3.sh tst_formatx4.sh ref_tst_utf8_4.cdl \
|
||||
tst_inttags.sh tst_inttags4.sh \
|
||||
CMakeLists.txt XGetopt.c tst_bom.sh tst_inmemory_nc3.sh \
|
||||
tst_dimsizes.sh tst_inmemory_nc4.sh tst_fileinfo.sh run_ncgen_tests.sh \
|
||||
run_ncgen_nc4_tests.sh
|
||||
run_ncgen_nc4_tests.sh tst_nccopy3_subset.sh ref_nccopy3_subset.nc
|
||||
|
||||
# CDL files and Expected results
|
||||
SUBDIRS=cdl expected
|
||||
@ -177,7 +184,7 @@ CLEANFILES += results/*.nc results/*.dmp results/*.dmp2 tmp*.cdl \
|
||||
tst_c0_64.cdl tst_compound_datasize_test.cdl \
|
||||
tst_compound_datasize_test2.cdl tst_gattenum.nc \
|
||||
tst_ncf199.cdl tst_tst_gattenum.cdl tst_tst_usuffix.cdl \
|
||||
tst_usuffix.nc tst_bug324.nc
|
||||
tst_usuffix.nc tst_bug324.nc nccopy3_subset_out.nc
|
||||
|
||||
DISTCLEANFILES = results
|
||||
|
||||
|
163
ncdump/nccopy.c
163
ncdump/nccopy.c
@ -1,7 +1,7 @@
|
||||
/*********************************************************************
|
||||
* Copyright 2010, University Corporation for Atmospheric Research
|
||||
* See netcdf/README file for copying and redistribution conditions.
|
||||
* Thanks to Philippe Poilbarbe and Antonio S. Cofiño for
|
||||
* Thanks to Philippe Poilbarbe and Antonio S. Cofiño for
|
||||
* compression additions.
|
||||
* $Id: nccopy.c 400 2010-08-27 21:02:52Z russ $
|
||||
*********************************************************************/
|
||||
@ -241,14 +241,14 @@ inq_var_chunking_params(int igrp, int ivarid, int ogrp, int ovarid,
|
||||
/* Forward declaration, because copy_type, copy_vlen_type call each other */
|
||||
static int copy_type(int igrp, nc_type typeid, int ogrp);
|
||||
|
||||
/*
|
||||
/*
|
||||
* copy a user-defined variable length type in the group igrp to the
|
||||
* group ogrp
|
||||
*/
|
||||
static int
|
||||
copy_vlen_type(int igrp, nc_type itype, int ogrp)
|
||||
{
|
||||
int stat = NC_NOERR;
|
||||
int stat = NC_NOERR;
|
||||
nc_type ibasetype;
|
||||
nc_type obasetype; /* base type in target group */
|
||||
char name[NC_MAX_NAME];
|
||||
@ -275,13 +275,13 @@ copy_vlen_type(int igrp, nc_type itype, int ogrp)
|
||||
return stat;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* copy a user-defined opaque type in the group igrp to the group ogrp
|
||||
*/
|
||||
static int
|
||||
copy_opaque_type(int igrp, nc_type itype, int ogrp)
|
||||
{
|
||||
int stat = NC_NOERR;
|
||||
int stat = NC_NOERR;
|
||||
nc_type otype;
|
||||
char name[NC_MAX_NAME];
|
||||
size_t size;
|
||||
@ -292,13 +292,13 @@ copy_opaque_type(int igrp, nc_type itype, int ogrp)
|
||||
return stat;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* copy a user-defined enum type in the group igrp to the group ogrp
|
||||
*/
|
||||
static int
|
||||
copy_enum_type(int igrp, nc_type itype, int ogrp)
|
||||
{
|
||||
int stat = NC_NOERR;
|
||||
int stat = NC_NOERR;
|
||||
nc_type otype;
|
||||
nc_type basetype;
|
||||
size_t basesize;
|
||||
@ -317,13 +317,13 @@ copy_enum_type(int igrp, nc_type itype, int ogrp)
|
||||
return stat;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* copy a user-defined compound type in the group igrp to the group ogrp
|
||||
*/
|
||||
static int
|
||||
copy_compound_type(int igrp, nc_type itype, int ogrp)
|
||||
{
|
||||
int stat = NC_NOERR;
|
||||
int stat = NC_NOERR;
|
||||
char name[NC_MAX_NAME];
|
||||
size_t size;
|
||||
size_t nfields;
|
||||
@ -351,7 +351,7 @@ copy_compound_type(int igrp, nc_type itype, int ogrp)
|
||||
} else { /* field is array type */
|
||||
int *fdimsizes;
|
||||
fdimsizes = (int *) emalloc((fndims + 1) * sizeof(int));
|
||||
stat = nc_inq_compound_field(igrp, itype, fid, NULL, NULL, NULL,
|
||||
stat = nc_inq_compound_field(igrp, itype, fid, NULL, NULL, NULL,
|
||||
NULL, fdimsizes);
|
||||
NC_CHECK(nc_insert_array_compound(ogrp, otype, fname, foff, oftype, fndims, fdimsizes));
|
||||
free(fdimsizes);
|
||||
@ -361,13 +361,13 @@ copy_compound_type(int igrp, nc_type itype, int ogrp)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* copy a user-defined type in the group igrp to the group ogrp
|
||||
*/
|
||||
static int
|
||||
copy_type(int igrp, nc_type typeid, int ogrp)
|
||||
{
|
||||
int stat = NC_NOERR;
|
||||
int stat = NC_NOERR;
|
||||
nc_type type_class;
|
||||
|
||||
NC_CHECK(nc_inq_user_type(igrp, typeid, NULL, NULL, NULL, NULL, &type_class));
|
||||
@ -422,7 +422,7 @@ copy_groups(int iroot, int oroot)
|
||||
NC_CHECK(nc_inq_grpname_full(grpids[i], &len_name, grpname_full));
|
||||
/* Make sure, the parent group is also wanted (root group is always wanted) */
|
||||
NC_CHECK(nc_inq_parid(iroot, grpname_full, &iparid));
|
||||
if (!option_grpstruct && !group_wanted(iparid, option_nlgrps, option_grpids)
|
||||
if (!option_grpstruct && !group_wanted(iparid, option_nlgrps, option_grpids)
|
||||
&& iparid != iroot) {
|
||||
error("ERROR: trying to copy a group but not the parent: %s", grpname_full);
|
||||
}
|
||||
@ -439,17 +439,17 @@ copy_groups(int iroot, int oroot)
|
||||
}
|
||||
free(grpids);
|
||||
}
|
||||
return stat;
|
||||
return stat;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Copy the user-defined types in this group (igrp) and all its
|
||||
* subgroups, recursively, to corresponding group in output (ogrp)
|
||||
*/
|
||||
static int
|
||||
copy_types(int igrp, int ogrp)
|
||||
{
|
||||
int stat = NC_NOERR;
|
||||
int stat = NC_NOERR;
|
||||
int ntypes;
|
||||
nc_type *types = NULL;
|
||||
int numgrps;
|
||||
@ -501,7 +501,7 @@ copy_var_specials(int igrp, int varid, int ogrp, int o_varid)
|
||||
size_t *chunkp = (size_t *) emalloc(ndims * sizeof(size_t));
|
||||
int *dimids = (int *) emalloc(ndims * sizeof(int));
|
||||
int idim;
|
||||
/* size of a chunk: product of dimension chunksizes and size of value */
|
||||
/* size of a chunk: product of dimension chunksizes and size of value */
|
||||
size_t csprod = val_size(ogrp, o_varid);
|
||||
int is_unlimited = 0;
|
||||
NC_CHECK(nc_inq_var_chunking(igrp, varid, &contig, chunkp));
|
||||
@ -610,7 +610,7 @@ set_var_chunked(int ogrp, int o_varid)
|
||||
size_t dimlen;
|
||||
NC_CHECK(nc_inq_dimlen(ogrp, odimid, &dimlen));
|
||||
if( (chunksize > 0) || dimmap_ounlim(odimid)) {
|
||||
chunked = 1;
|
||||
chunked = 1;
|
||||
}
|
||||
if(dimlen > 0) { /* dimlen for unlimited dims is still 0 before copying data */
|
||||
varsize *= dimlen;
|
||||
@ -702,7 +702,7 @@ copy_dims(int igrp, int ogrp)
|
||||
int *unlimids;
|
||||
#else
|
||||
int unlimid;
|
||||
#endif /* USE_NETCDF4 */
|
||||
#endif /* USE_NETCDF4 */
|
||||
|
||||
NC_CHECK(nc_inq_ndims(igrp, &ndims));
|
||||
|
||||
@ -739,7 +739,7 @@ copy_dims(int igrp, int ogrp)
|
||||
if(idimid == unlimids[uld]) {
|
||||
i_is_unlim = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
idimid = dgrp;
|
||||
@ -751,7 +751,7 @@ copy_dims(int igrp, int ogrp)
|
||||
stat = nc_inq_dim(igrp, idimid, name, &length);
|
||||
if (stat == NC_EDIMSIZE && sizeof(size_t) < 8) {
|
||||
error("dimension \"%s\" requires 64-bit platform", name);
|
||||
}
|
||||
}
|
||||
NC_CHECK(stat);
|
||||
o_is_unlim = i_is_unlim;
|
||||
if(i_is_unlim && !option_fix_unlimdims) {
|
||||
@ -766,7 +766,7 @@ copy_dims(int igrp, int ogrp)
|
||||
#ifdef USE_NETCDF4
|
||||
free(dimids);
|
||||
free(unlimids);
|
||||
#endif /* USE_NETCDF4 */
|
||||
#endif /* USE_NETCDF4 */
|
||||
return stat;
|
||||
}
|
||||
|
||||
@ -781,7 +781,7 @@ copy_atts(int igrp, int ivar, int ogrp, int ovar)
|
||||
int stat = NC_NOERR;
|
||||
|
||||
NC_CHECK(nc_inq_varnatts(igrp, ivar, &natts));
|
||||
|
||||
|
||||
for(iatt = 0; iatt < natts; iatt++) {
|
||||
char name[NC_MAX_NAME];
|
||||
NC_CHECK(nc_inq_attname(igrp, ivar, iatt, name));
|
||||
@ -832,7 +832,7 @@ copy_var(int igrp, int varid, int ogrp)
|
||||
NC_CHECK(nc_def_var(ogrp, name, o_typeid, ndims, odimids, &o_varid));
|
||||
/* attach the variable attributes to the output variable */
|
||||
NC_CHECK(copy_atts(igrp, varid, ogrp, o_varid));
|
||||
#ifdef USE_NETCDF4
|
||||
#ifdef USE_NETCDF4
|
||||
{
|
||||
int inkind;
|
||||
int outkind;
|
||||
@ -879,7 +879,7 @@ copy_vars(int igrp, int ogrp)
|
||||
if(nc_inq_gvarid(igrp, option_lvars[iv], &varid) == NC_NOERR)
|
||||
idadd(vlist, varid);
|
||||
}
|
||||
|
||||
|
||||
NC_CHECK(nc_inq_nvars(igrp, &nvars));
|
||||
for (varid = 0; varid < nvars; varid++) {
|
||||
if (!option_varstruct && option_nlvars > 0 && ! idmember(vlist, varid))
|
||||
@ -894,7 +894,7 @@ copy_vars(int igrp, int ogrp)
|
||||
* group igrp in input to parent group ogrp in destination. Use
|
||||
* dimmap array to map input dimids to output dimids. */
|
||||
static int
|
||||
copy_schema(int igrp, int ogrp)
|
||||
copy_schema(int igrp, int ogrp)
|
||||
{
|
||||
int stat = NC_NOERR;
|
||||
int ogid; /* like igrp but in output file */
|
||||
@ -906,7 +906,7 @@ copy_schema(int igrp, int ogrp)
|
||||
NC_CHECK(copy_dims(igrp, ogid));
|
||||
NC_CHECK(copy_atts(igrp, NC_GLOBAL, ogid, NC_GLOBAL));
|
||||
NC_CHECK(copy_vars(igrp, ogid));
|
||||
#ifdef USE_NETCDF4
|
||||
#ifdef USE_NETCDF4
|
||||
{
|
||||
int numgrps;
|
||||
int *grpids;
|
||||
@ -915,7 +915,7 @@ copy_schema(int igrp, int ogrp)
|
||||
stat = nc_inq_grps(igrp, &numgrps, NULL);
|
||||
grpids = (int *)emalloc((numgrps + 1) * sizeof(int));
|
||||
NC_CHECK(nc_inq_grps(igrp, &numgrps, grpids));
|
||||
|
||||
|
||||
for(i = 0; i < numgrps; i++) {
|
||||
if (option_grpstruct || group_wanted(grpids[i], option_nlgrps, option_grpids)) {
|
||||
NC_CHECK(copy_schema(grpids[i], ogid));
|
||||
@ -924,7 +924,7 @@ copy_schema(int igrp, int ogrp)
|
||||
free(grpids);
|
||||
}
|
||||
#endif /* USE_NETCDF4 */
|
||||
return stat;
|
||||
return stat;
|
||||
}
|
||||
|
||||
/* Return number of values for a variable varid in a group igrp */
|
||||
@ -966,7 +966,7 @@ copy_var_data(int igrp, int varid, int ogrp) {
|
||||
size_t *count;
|
||||
nciter_t *iterp; /* opaque structure for iteration status */
|
||||
int do_realloc = 0;
|
||||
#ifdef USE_NETCDF4
|
||||
#ifdef USE_NETCDF4
|
||||
int okind;
|
||||
size_t chunksize;
|
||||
#endif
|
||||
@ -983,10 +983,10 @@ copy_var_data(int igrp, int varid, int ogrp) {
|
||||
option_copy_buffer_size = value_size;
|
||||
do_realloc = 1;
|
||||
}
|
||||
#ifdef USE_NETCDF4
|
||||
#ifdef USE_NETCDF4
|
||||
NC_CHECK(nc_inq_format(ogrp, &okind));
|
||||
if(okind == NC_FORMAT_NETCDF4 || okind == NC_FORMAT_NETCDF4_CLASSIC) {
|
||||
/* if this variable chunked, set variable chunk cache size */
|
||||
/* if this variable chunked, set variable chunk cache size */
|
||||
int contig = 1;
|
||||
NC_CHECK(nc_inq_var_chunking(ogrp, ovarid, &contig, NULL));
|
||||
if(contig == 0) { /* chunked */
|
||||
@ -997,16 +997,16 @@ copy_var_data(int igrp, int varid, int ogrp) {
|
||||
size_t chunkcache_size, chunkcache_nelems;
|
||||
float chunkcache_preemption;
|
||||
NC_CHECK(inq_var_chunking_params(igrp, varid, ogrp, ovarid,
|
||||
&chunkcache_size,
|
||||
&chunkcache_nelems,
|
||||
&chunkcache_size,
|
||||
&chunkcache_nelems,
|
||||
&chunkcache_preemption));
|
||||
NC_CHECK(nc_set_var_chunk_cache(ogrp, ovarid,
|
||||
chunkcache_size,
|
||||
chunkcache_nelems,
|
||||
chunkcache_preemption));
|
||||
} else {
|
||||
NC_CHECK(nc_set_var_chunk_cache(ogrp, ovarid,
|
||||
chunkcache_size,
|
||||
chunkcache_nelems,
|
||||
chunkcache_preemption));
|
||||
} else {
|
||||
/* by default, use same chunk cache for all chunked variables */
|
||||
NC_CHECK(nc_set_var_chunk_cache(ogrp, ovarid,
|
||||
NC_CHECK(nc_set_var_chunk_cache(ogrp, ovarid,
|
||||
option_chunk_cache_size,
|
||||
option_chunk_cache_nelems,
|
||||
COPY_CHUNKCACHE_PREEMPTION));
|
||||
@ -1098,11 +1098,11 @@ copy_data(int igrp, int ogrp)
|
||||
if(nc_inq_gvarid(igrp, option_lvars[iv], &varid) == NC_NOERR)
|
||||
idadd(vlist, varid);
|
||||
}
|
||||
|
||||
|
||||
/* get groupid in output corresponding to group igrp in input,
|
||||
* given parent group (or root group) ogrp in output */
|
||||
NC_CHECK(get_grpid(igrp, ogrp, &ogid));
|
||||
|
||||
|
||||
/* Copy data from this group */
|
||||
NC_CHECK(nc_inq_nvars(igrp, &nvars));
|
||||
|
||||
@ -1145,7 +1145,7 @@ count_dims(int ncid) {
|
||||
for(igrp = 0; igrp < numgrps; igrp++) {
|
||||
ndims += count_dims(grpids[igrp]);
|
||||
}
|
||||
free(grpids);
|
||||
free(grpids);
|
||||
}
|
||||
#endif /* USE_NETCDF4 */
|
||||
return ndims;
|
||||
@ -1200,20 +1200,36 @@ classify_vars(
|
||||
int **rvars) /* the array of record variable IDs, caller should free */
|
||||
{
|
||||
int varid;
|
||||
int varindex = 0;
|
||||
int nvars;
|
||||
NC_CHECK(nc_inq_nvars(ncid, &nvars));
|
||||
*nf = 0;
|
||||
*fvars = (int *) emalloc(nvars * sizeof(int));
|
||||
*nr = 0;
|
||||
*rvars = (int *) emalloc(nvars * sizeof(int));
|
||||
for (varid = 0; varid < nvars; varid++) {
|
||||
if (isrecvar(ncid, varid)) {
|
||||
(*rvars)[*nr] = varid;
|
||||
(*nr)++;
|
||||
} else {
|
||||
(*fvars)[*nf] = varid;
|
||||
(*nf)++;
|
||||
}
|
||||
|
||||
if(option_nlvars > 0) {
|
||||
for (varindex = 0; varindex < option_nlvars; varindex++) {
|
||||
nc_inq_varid(ncid,option_lvars[varindex],&varid);
|
||||
|
||||
if (isrecvar(ncid, varid)) {
|
||||
(*rvars)[*nr] = varid;
|
||||
(*nr)++;
|
||||
} else {
|
||||
(*fvars)[*nf] = varid;
|
||||
(*nf)++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (varid = 0; varid < nvars; varid++) {
|
||||
if (isrecvar(ncid, varid)) {
|
||||
(*rvars)[*nr] = varid;
|
||||
(*nr)++;
|
||||
} else {
|
||||
(*fvars)[*nf] = varid;
|
||||
(*nf)++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NC_NOERR;
|
||||
}
|
||||
@ -1242,7 +1258,7 @@ copy_rec_var_data(int ncid, /* input */
|
||||
size_t *start, /* start indices for record data */
|
||||
size_t *count, /* edge lengths for record data */
|
||||
void *buf /* buffer large enough to hold data */
|
||||
)
|
||||
)
|
||||
{
|
||||
NC_CHECK(nc_get_vara(ncid, varid, start, count, buf));
|
||||
NC_CHECK(nc_put_vara(ogrp, ovarid, start, count, buf));
|
||||
@ -1292,7 +1308,7 @@ copy_record_data(int ncid, int ogrp, size_t nrec_vars, int *rec_varids) {
|
||||
start[ivar][ii] = 0;
|
||||
count[ivar][ii] = dimlen;
|
||||
}
|
||||
start[ivar][0] = 0;
|
||||
start[ivar][0] = 0;
|
||||
count[ivar][0] = 1; /* 1 record */
|
||||
buf[ivar] = (void *) emalloc(nvals * value_size);
|
||||
NC_CHECK(nc_inq_varname(ncid, varid, varname));
|
||||
@ -1308,7 +1324,7 @@ copy_record_data(int ncid, int ogrp, size_t nrec_vars, int *rec_varids) {
|
||||
varid = rec_varids[ivar];
|
||||
ovarid = rec_ovarids[ivar];
|
||||
start[ivar][0] = irec;
|
||||
NC_CHECK(copy_rec_var_data(ncid, ogrp, irec, varid, ovarid,
|
||||
NC_CHECK(copy_rec_var_data(ncid, ogrp, irec, varid, ovarid,
|
||||
start[ivar], count[ivar], buf[ivar]));
|
||||
}
|
||||
}
|
||||
@ -1358,11 +1374,11 @@ copy(char* infile, char* outfile)
|
||||
|
||||
/* option_kind specifies which netCDF format for output, one of
|
||||
*
|
||||
* SAME_AS_INPUT, NC_FORMAT_CLASSIC, NC_FORMAT_64BIT,
|
||||
* NC_FORMAT_NETCDF4, NC_FORMAT_NETCDF4_CLASSIC
|
||||
* SAME_AS_INPUT, NC_FORMAT_CLASSIC, NC_FORMAT_64BIT,
|
||||
* NC_FORMAT_NETCDF4, NC_FORMAT_NETCDF4_CLASSIC
|
||||
*
|
||||
* However, if compression or shuffling was specified and kind was SAME_AS_INPUT,
|
||||
* option_kind is changed to NC_FORMAT_NETCDF4_CLASSIC, if input format is
|
||||
* option_kind is changed to NC_FORMAT_NETCDF4_CLASSIC, if input format is
|
||||
* NC_FORMAT_CLASSIC or NC_FORMAT_64BIT .
|
||||
*/
|
||||
outkind = option_kind;
|
||||
@ -1370,11 +1386,11 @@ copy(char* infile, char* outfile)
|
||||
outkind = inkind;
|
||||
/* Deduce output kind if netCDF-4 features requested */
|
||||
if (inkind == NC_FORMAT_CLASSIC || inkind == NC_FORMAT_64BIT_OFFSET
|
||||
|| inkind == NC_FORMAT_CDF5) {
|
||||
if (option_deflate_level > 0 ||
|
||||
option_shuffle_vars == NC_SHUFFLE ||
|
||||
option_chunkspec)
|
||||
{
|
||||
|| inkind == NC_FORMAT_CDF5) {
|
||||
if (option_deflate_level > 0 ||
|
||||
option_shuffle_vars == NC_SHUFFLE ||
|
||||
option_chunkspec)
|
||||
{
|
||||
outkind = NC_FORMAT_NETCDF4_CLASSIC;
|
||||
}
|
||||
}
|
||||
@ -1412,8 +1428,13 @@ copy(char* infile, char* outfile)
|
||||
create_mode |= NC_64BIT_OFFSET;
|
||||
break;
|
||||
case NC_FORMAT_CDF5:
|
||||
create_mode |= NC_64BIT_DATA;
|
||||
break;
|
||||
#ifdef USE_CDF5
|
||||
create_mode |= NC_64BIT_DATA;
|
||||
break;
|
||||
#else
|
||||
error("netCDF library built without CDF5 support, can't create CDF5 files");
|
||||
break;
|
||||
#endif
|
||||
#ifdef USE_NETCDF4
|
||||
case NC_FORMAT_NETCDF4:
|
||||
create_mode |= NC_NETCDF4;
|
||||
@ -1467,7 +1488,7 @@ copy(char* infile, char* outfile)
|
||||
NC_CHECK(classify_vars(ogrp, &nfixed_vars, &fixed_varids, &nrec_vars, &rec_varids));
|
||||
NC_CHECK(copy_fixed_size_data(igrp, ogrp, nfixed_vars, fixed_varids));
|
||||
NC_CHECK(copy_record_data(igrp, ogrp, nrec_vars, rec_varids));
|
||||
} else {
|
||||
} else {
|
||||
NC_CHECK(copy_data(igrp, ogrp)); /* recursive, to handle nested groups */
|
||||
}
|
||||
|
||||
@ -1476,7 +1497,7 @@ copy(char* infile, char* outfile)
|
||||
return stat;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* For non-negative numeric string with multiplier suffix K, M, G, T,
|
||||
* or P (or lower-case equivalent), return corresponding value
|
||||
* incorporating multiplier 1000, 1000000, 1.0d9, ... 1.0d15, or -1.0
|
||||
@ -1509,7 +1530,7 @@ double_with_suffix(char *str) {
|
||||
break;
|
||||
default:
|
||||
dval = -1.0; /* error, suffix multiplier must be K, M, G, or T */
|
||||
}
|
||||
}
|
||||
}
|
||||
return dval;
|
||||
}
|
||||
@ -1565,13 +1586,13 @@ main(int argc, char**argv)
|
||||
{"classic", NC_FORMAT_CLASSIC}, /* canonical format name */
|
||||
{"nc3", NC_FORMAT_CLASSIC}, /* short format name */
|
||||
{"1", NC_FORMAT_CLASSIC}, /* deprecated, use "-3" or "-k nc3" instead */
|
||||
|
||||
|
||||
/* NetCDF-3 64-bit offset format */
|
||||
{"64-bit offset", NC_FORMAT_64BIT_OFFSET}, /* canonical format name */
|
||||
{"nc6", NC_FORMAT_64BIT_OFFSET}, /* short format name */
|
||||
{"2", NC_FORMAT_64BIT_OFFSET}, /* deprecated, use "-6" or "-k nc6" instead */
|
||||
{"64-bit-offset", NC_FORMAT_64BIT_OFFSET}, /* deprecated alias */
|
||||
|
||||
|
||||
/* NetCDF-4 HDF5-based format */
|
||||
{"netCDF-4", NC_FORMAT_NETCDF4}, /* canonical format name */
|
||||
{"nc4", NC_FORMAT_NETCDF4}, /* short format name */
|
||||
@ -1611,7 +1632,7 @@ main(int argc, char**argv)
|
||||
|
||||
while ((c = getopt(argc, argv, "k:3467d:sum:c:h:e:rwxg:G:v:V:")) != -1) {
|
||||
switch(c) {
|
||||
case 'k': /* for specifying variant of netCDF format to be generated
|
||||
case 'k': /* for specifying variant of netCDF format to be generated
|
||||
Format names:
|
||||
"classic" or "nc3"
|
||||
"64-bit offset" or "nc6"
|
||||
@ -1724,7 +1745,7 @@ main(int argc, char**argv)
|
||||
make_lvars (optarg, &option_nlvars, &option_lvars);
|
||||
option_varstruct = false;
|
||||
break;
|
||||
default:
|
||||
default:
|
||||
usage();
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ variables:
|
||||
ubyte ub(d) ;
|
||||
ushort us(d) ;
|
||||
uint ui(d) ;
|
||||
int i64(d) ;
|
||||
int64 i64(d) ;
|
||||
uint64 ui64(d) ;
|
||||
|
||||
// global attributes:
|
||||
@ -18,7 +18,7 @@ data:
|
||||
|
||||
ui = 4294967294, 4294967294, 4294967294 ;
|
||||
|
||||
i64 = -1, -1, -1 ;
|
||||
i64 = 9223372036854775807, 9223372036854775807, 9223372036854775807 ;
|
||||
|
||||
ui64 = 18446744073709551615, 18446744073709551615, 18446744073709551615 ;
|
||||
}
|
||||
|
BIN
ncdump/ref_nccopy3_subset.nc
Normal file
BIN
ncdump/ref_nccopy3_subset.nc
Normal file
Binary file not shown.
@ -8,6 +8,19 @@ if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
||||
echo "*** Testing ncgen."
|
||||
set -e
|
||||
|
||||
# This shell script runs the ncdump tests.
|
||||
# get some config.h parameters
|
||||
if test -f ${top_builddir}/config.h ; then
|
||||
if fgrep -e '#define USE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
|
||||
CDF5=1
|
||||
else
|
||||
CDF5=0
|
||||
fi
|
||||
else
|
||||
echo "Cannot locate config.h"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#VALGRIND="valgrind -q --error-exitcode=2 --leak-check=full"
|
||||
|
||||
validateNC() {
|
||||
@ -37,11 +50,15 @@ echo "*** creating 64-bit offset file c0_64.nc from c0.cdl..."
|
||||
|
||||
validateNC c0 "c0_64" -k 64-bit-offset -b
|
||||
|
||||
echo "*** creating 64-bit offset file c5.nc from c5.cdl..."
|
||||
${NCGEN} -k 64-bit-data -b -o c5.nc $top_srcdir/ncgen/c5.cdl
|
||||
if [ ! -f c5.nc ]; then
|
||||
echo "Failure."
|
||||
exit 1
|
||||
if test "x$USE_CDF5" = x1 ; then
|
||||
|
||||
echo "*** creating 64-bit data file c5.nc from c5.cdl..."
|
||||
${NCGEN} -k 64-bit-data -b -o c5.nc $top_srcdir/ncgen/c5.cdl
|
||||
if [ ! -f c5.nc ]; then
|
||||
echo "Failure."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
echo "*** Test successful!"
|
||||
|
@ -15,16 +15,16 @@ echo "*** creating tst_small.cdl from tst_small.nc..."
|
||||
${NCDUMP} tst_small.nc > tst_small.cdl
|
||||
diff -b -w tst_small.cdl $srcdir/ref_tst_small.cdl
|
||||
|
||||
echo "*** creating test0.nc from test0.cdl..."
|
||||
${NCGEN} -b $srcdir/test0.cdl
|
||||
echo "*** creating test1.cdl from test0.nc..."
|
||||
${NCDUMP} -n test1 test0.nc > test1.cdl
|
||||
echo "*** creating test1.nc from test1.cdl..."
|
||||
${NCGEN} -b test1.cdl
|
||||
echo "*** creating test2.cdl from test1.nc..."
|
||||
${NCDUMP} test1.nc > test2.cdl
|
||||
echo "*** checking that test1.cdl and test2.cdl are the same..."
|
||||
diff -b -w test1.cdl test2.cdl
|
||||
echo "*** creating test0_ncdump.nc from test0.cdl..."
|
||||
${NCGEN} -o test0_ncdump.nc -b $srcdir/test0.cdl
|
||||
echo "*** creating test1_ncdump.cdl from test0_ncdump.nc..."
|
||||
${NCDUMP} -n test1_ncdump test0_ncdump.nc > test1_ncdump.cdl
|
||||
echo "*** creating test1_ncdump.nc from test1_ncdump.cdl..."
|
||||
${NCGEN} -b test1_ncdump.cdl
|
||||
echo "*** creating test2_ncdump.cdl from test1_ncdump.nc..."
|
||||
${NCDUMP} test1_ncdump.nc > test2_ncdump.cdl
|
||||
echo "*** checking that test1_ncdump.cdl and test2_ncdump.cdl are the same..."
|
||||
diff -b -w test1_ncdump.cdl test2_ncdump.cdl
|
||||
|
||||
echo "*** All tests of ncgen and ncdump using test0.cdl passed!"
|
||||
exit 0
|
||||
|
@ -1,37 +1,52 @@
|
||||
#!/bin/sh
|
||||
|
||||
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
||||
set -e
|
||||
|
||||
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
||||
. ../test_common.sh
|
||||
|
||||
# This shell script runs the ncdump tests.
|
||||
|
||||
# get some config.h parameters
|
||||
if test -f ${top_builddir}/config.h ; then
|
||||
if fgrep -e '#define USE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
|
||||
CDF5=1
|
||||
else
|
||||
CDF5=0
|
||||
fi
|
||||
else
|
||||
echo "Cannot locate config.h"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "*** Testing ncgen and ncdump with 64-bit offset format."
|
||||
set -e
|
||||
echo "*** creating test0.nc from test0.cdl..."
|
||||
${NCGEN} -b -k2 $srcdir/test0.cdl
|
||||
echo "*** creating test1.cdl from test0.nc..."
|
||||
${NCDUMP} -n test1 test0.nc > test1.cdl
|
||||
echo "*** creating test1.nc from test1.cdl..."
|
||||
${NCGEN} -b -k2 test1.cdl
|
||||
echo "*** creating test2.cdl from test1.nc..."
|
||||
${NCDUMP} test1.nc > test2.cdl
|
||||
cmp test1.cdl test2.cdl
|
||||
echo "*** creating test0_offset.nc from test0.cdl..."
|
||||
${NCGEN} -b -k2 -o test0_offset.nc $srcdir/test0.cdl
|
||||
echo "*** creating test1_offset.cdl from test0_offset.nc..."
|
||||
${NCDUMP} -n test1_offset test0_offset.nc > test1_offset.cdl
|
||||
echo "*** creating test1_offset.nc from test1_offset.cdl..."
|
||||
${NCGEN} -b -k2 -o test1_offset.nc test1_offset.cdl
|
||||
echo "*** creating test2_offset.cdl from test1.nc..."
|
||||
${NCDUMP} test1_offset.nc > test2_offset.cdl
|
||||
cmp test1_offset.cdl test2_offset.cdl
|
||||
echo "*** All ncgen and ncdump with 64-bit offset format tests passed!"
|
||||
|
||||
|
||||
if test "x$CDF5" = x1 ; then
|
||||
echo ""
|
||||
echo "*** Testing ncgen and ncdump with CDF5 format."
|
||||
set -e
|
||||
echo "*** creating test0.nc from test0.cdl..."
|
||||
${NCGEN} -b -k5 $srcdir/test0.cdl
|
||||
echo "*** creating test1.cdl from test0.nc..."
|
||||
${NCDUMP} -n test1 test0.nc > test1.cdl
|
||||
echo "*** creating test1.nc from test1.cdl..."
|
||||
${NCGEN} -b -k5 test1.cdl
|
||||
echo "*** creating test2.cdl from test1.nc..."
|
||||
${NCDUMP} test1.nc > test2.cdl
|
||||
cmp test1.cdl test2.cdl
|
||||
echo "*** creating test0_cdf5.nc from test0.cdl..."
|
||||
${NCGEN} -b -k5 -o test0_cdf5.nc $srcdir/test0.cdl
|
||||
echo "*** creating test1_cdf5.cdl from test0_cdf5.nc..."
|
||||
${NCDUMP} -n test1_cdf5 test0_cdf5.nc > test1_cdf5.cdl
|
||||
echo "*** creating test1_cdf5.nc from test1_cdf5.cdl..."
|
||||
${NCGEN} -b -k5 -o test1_cdf5.nc test1_cdf5.cdl
|
||||
echo "*** creating test2_cdf5.cdl from test1_cdf5.nc..."
|
||||
${NCDUMP} test1_cdf5.nc > test2_cdf5.cdl
|
||||
cmp test1_cdf5.cdl test2_cdf5.cdl
|
||||
echo "*** All ncgen and ncdump with CDF5 format tests passed!"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "config.h"
|
||||
#include <nc_tests.h>
|
||||
#include "err_macros.h"
|
||||
#include <stdio.h>
|
||||
@ -10,7 +11,10 @@
|
||||
|
||||
#define DIMMAXCLASSIC (NC_MAX_INT - 3)
|
||||
#define DIMMAX64OFFSET (NC_MAX_UINT - 3)
|
||||
|
||||
#ifdef USE_CDF5
|
||||
#define DIMMAX64DATA (NC_MAX_UINT64 - 3)
|
||||
#endif
|
||||
|
||||
/*
|
||||
Test that at least the meta-data works
|
||||
@ -62,6 +66,7 @@ main(int argc, char **argv)
|
||||
if(dimsize != DIMMAX64OFFSET) ERR;
|
||||
if ((stat=nc_close(ncid))) ERRSTAT(stat);
|
||||
|
||||
#ifdef USE_CDF5
|
||||
if(sizeof(size_t) == 8) {
|
||||
printf("\n*** Writing Max Dimension Size (%llu) For NC_64BIT_DATA\n",DIMMAX64DATA);
|
||||
if ((stat=nc_create(FILE64DATA, NC_CLOBBER | NC_64BIT_DATA, &ncid))) ERRSTAT(stat);
|
||||
@ -76,6 +81,7 @@ main(int argc, char **argv)
|
||||
if(dimsize != DIMMAX64DATA) ERR;
|
||||
if ((stat=nc_close(ncid))) ERRSTAT(stat);
|
||||
}
|
||||
#endif /* USE_CDF5 */
|
||||
|
||||
SUMMARIZE_ERR;
|
||||
FINAL_RESULTS;
|
||||
|
@ -1,8 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
||||
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
||||
. ../test_common.sh
|
||||
|
||||
# This shell script runs the ncdump tests.
|
||||
# get some config.h parameters
|
||||
if test -f ${top_builddir}/config.h ; then
|
||||
if fgrep -e '#define USE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
|
||||
USE_CDF5=1
|
||||
else
|
||||
USE_CDF5=0
|
||||
fi
|
||||
else
|
||||
echo "Cannot locate config.h"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# This shell script tests the output several previous tests.
|
||||
|
||||
ECODE=0
|
||||
@ -28,17 +41,20 @@ echo "*** Fail: extended format for a 64-bit classic file"
|
||||
ECODE=1
|
||||
fi
|
||||
|
||||
echo "Test extended format output for a 64-bit CDF-5 classic file"
|
||||
rm -f tmp
|
||||
${NCGEN} -k5 -b -o ./test.nc $srcdir/ref_tst_small.cdl
|
||||
${NCDUMP} -K test.nc >tmp
|
||||
if ! grep -F '64-bit data mode=00000020' <tmp ; then
|
||||
echo "*** Fail: extended format for a 64-bit CDF-5 classic file"
|
||||
ECODE=1
|
||||
|
||||
# Only do following test if USE_CDF5 is true.
|
||||
|
||||
if test "x$USE_CDF5" = x1 ; then
|
||||
echo "Test extended format output for a 64-bit CDF-5 classic file"
|
||||
rm -f tmp
|
||||
${NCGEN} -k5 -b -o ./test.nc $srcdir/ref_tst_small.cdl
|
||||
${NCDUMP} -K test.nc >tmp
|
||||
if ! grep -F '64-bit data mode=00000020' <tmp ; then
|
||||
echo "*** Fail: extended format for a 64-bit CDF-5 classic file"
|
||||
ECODE=1
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -f tmp test.nc
|
||||
|
||||
exit $ECODE
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
||||
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
||||
. ../test_common.sh
|
||||
|
||||
set -e
|
||||
@ -8,7 +8,7 @@ set -e
|
||||
echo "*** Test netcdf-4 integer constant suffixes"
|
||||
|
||||
echo "*** creating inttags4.nc from inttags4.cdl..."
|
||||
${NCGEN} -lb -o inttags4.nc $srcdir/inttags4.cdl
|
||||
${NCGEN} -lb -k nc4 -o inttags4.nc $srcdir/inttags4.cdl
|
||||
echo "*** creating tst_inttags4.cdl from inttags4.nc..."
|
||||
${NCDUMP} inttags4.nc > tst_inttags4.cdl
|
||||
echo "*** comparing tst_inttags4.cdl to ref_inttags4.nc..."
|
||||
|
@ -1,8 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
||||
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
||||
. ../test_common.sh
|
||||
|
||||
# get some config.h parameters
|
||||
if test -f ${top_builddir}/config.h ; then
|
||||
if fgrep -e '#define USE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
|
||||
HAVE_CDF5=1
|
||||
else
|
||||
HAVE_CDF5=0
|
||||
fi
|
||||
else
|
||||
echo "Cannot locate config.h"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# It is unreasonable to test actual lengths of files
|
||||
# (even netcdf-3 files).
|
||||
#However, the files created in this script are used in later ones
|
||||
@ -10,7 +22,7 @@ if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
||||
${NCGEN} -b ${srcdir}/small.cdl
|
||||
${NCGEN} -b ${srcdir}/small2.cdl
|
||||
|
||||
# This shell script tests lengths of small netcdf files and tests
|
||||
# This shell script tests lengths of small netcdf files and tests
|
||||
# that rewriting a numeric value doesn't change file length
|
||||
# $Id: tst_lengths.sh,v 1.10 2008/08/07 00:07:52 ed Exp $
|
||||
|
||||
@ -93,39 +105,44 @@ ${NCGEN} -b -k64-bit-offset -x ${srcdir}/small.cdl && ${execdir}/rewrite-scalar
|
||||
# exit 1
|
||||
#fi
|
||||
|
||||
echo "*** testing length of 64-bit data file"
|
||||
${NCGEN} -b -k64-bit-data ${srcdir}/small.cdl
|
||||
if test `wc -c < small.nc` != 104; then
|
||||
exit 1
|
||||
# The following tests only occur if we have CDF5.
|
||||
if test "x$HAVE_CDF5" = x1 ; then
|
||||
|
||||
echo "*** testing length of 64-bit data file"
|
||||
${NCGEN} -b -k64-bit-data ${srcdir}/small.cdl
|
||||
if test `wc -c < small.nc` != 104; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "*** testing length of 64-bit data file"
|
||||
${NCGEN} -b -5 ${srcdir}/small.cdl
|
||||
if test `wc -c < small.nc` != 104; then
|
||||
exit 1
|
||||
fi
|
||||
echo "*** testing length of 64-bit data file written with NOFILL"
|
||||
${NCGEN} -b -5 -x ${srcdir}/small.cdl
|
||||
#if test `wc -c < small.nc` != 104; then
|
||||
# exit 1
|
||||
#fi
|
||||
|
||||
echo "*** testing length of rewritten 64-bit data file"
|
||||
${NCGEN} -b -5 ${srcdir}/small.cdl && ${execdir}/rewrite-scalar small.nc t
|
||||
# Watch out, it appears that the CDF-5 files are being rounded up to next page size
|
||||
# So, we need to truncate them wrt nul's in order to check size.
|
||||
# Bad hack, but what else can I do?
|
||||
if test `${execdir}/nctrunc <small.nc |wc -c` != 104; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "*** testing length of rewritten 64-bit data file written with NOFILL"
|
||||
${NCGEN} -b -5 -x ${srcdir}/small.cdl && ${execdir}/rewrite-scalar small.nc t
|
||||
#if test `wc -c < small.nc` != 104; then
|
||||
# exit 1
|
||||
#fi
|
||||
|
||||
# End HAVE_CDF5 block.
|
||||
fi
|
||||
|
||||
echo "*** testing length of 64-bit data file"
|
||||
${NCGEN} -b -5 ${srcdir}/small.cdl
|
||||
if test `wc -c < small.nc` != 104; then
|
||||
exit 1
|
||||
fi
|
||||
echo "*** testing length of 64-bit data file written with NOFILL"
|
||||
${NCGEN} -b -5 -x ${srcdir}/small.cdl
|
||||
#if test `wc -c < small.nc` != 104; then
|
||||
# exit 1
|
||||
#fi
|
||||
|
||||
echo "*** testing length of rewritten 64-bit data file"
|
||||
${NCGEN} -b -5 ${srcdir}/small.cdl && ${execdir}/rewrite-scalar small.nc t
|
||||
# Watch out, it appears that the CDF-5 files are being rounded up to next page size
|
||||
# So, we need to truncate them wrt nul's in order to check size.
|
||||
# Bad hack, but what else can I do?
|
||||
if test `${execdir}/nctrunc <small.nc |wc -c` != 104; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "*** testing length of rewritten 64-bit data file written with NOFILL"
|
||||
${NCGEN} -b -5 -x ${srcdir}/small.cdl && ${execdir}/rewrite-scalar small.nc t
|
||||
#if test `wc -c < small.nc` != 104; then
|
||||
# exit 1
|
||||
#fi
|
||||
|
||||
|
||||
# test with only one record variable of type byte or short, which need
|
||||
# not be 4-byte aligned
|
||||
echo "*** testing length of one-record-variable classic file"
|
||||
@ -134,22 +151,28 @@ ${NCGEN} -b ${srcdir}/small2.cdl
|
||||
# exit 1
|
||||
#fi
|
||||
|
||||
echo "*** testing length of one-record-variable 64-bit data file"
|
||||
${NCGEN} -b -5 ${srcdir}/small2.cdl
|
||||
if test `wc -c < small2.nc` != 161; then
|
||||
exit 1
|
||||
fi
|
||||
# The following tests only occur if we have CDF5.
|
||||
if test "x$HAVE_CDF5" = x1 ; then
|
||||
|
||||
echo "*** testing length of one-record-variable 64-bit data file"
|
||||
${NCGEN} -b -5 ${srcdir}/small2.cdl
|
||||
if test `wc -c < small2.nc` != 161; then
|
||||
exit 1
|
||||
fi
|
||||
echo "*** testing length of one-record-variable 64-bit data file"
|
||||
${NCGEN} -b -5 ${srcdir}/small2.cdl
|
||||
if test `wc -c < small2.nc` != 161; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "*** testing length of one-record-variable 64-bit data file written with NOFILL"
|
||||
${NCGEN} -b -5 -x ${srcdir}/small2.cdl
|
||||
if test `wc -c < small2.nc` != 161; then
|
||||
exit 1
|
||||
echo "*** testing length of one-record-variable 64-bit data file"
|
||||
${NCGEN} -b -5 ${srcdir}/small2.cdl
|
||||
if test `wc -c < small2.nc` != 161; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "*** testing length of one-record-variable 64-bit data file written with NOFILL"
|
||||
${NCGEN} -b -5 -x ${srcdir}/small2.cdl
|
||||
if test `wc -c < small2.nc` != 161; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#end HAVE_CDF5 block
|
||||
fi
|
||||
|
||||
echo "*** testing length of one-record-variable classic file written with NOFILL"
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
||||
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
||||
. ../test_common.sh
|
||||
|
||||
# For a netCDF-3 build, test nccopy on netCDF files in this directory
|
||||
@ -8,9 +8,26 @@ if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
||||
set -e
|
||||
echo ""
|
||||
|
||||
TESTFILES='c0 c0tmp ctest0 ctest0_64 small small2 test0 test1
|
||||
# get some config.h parameters
|
||||
if test -f ${top_builddir}/config.h ; then
|
||||
if fgrep -e '#define USE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
|
||||
HAVE_CDF5=1
|
||||
else
|
||||
HAVE_CDF5=0
|
||||
fi
|
||||
else
|
||||
echo "Cannot locate config.h"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TESTFILES='c0 c0tmp ctest0 ctest0_64 test0_offset test1_offset
|
||||
tst_calendars tst_mslp tst_mslp_64 tst_ncml tst_small tst_utf8 utf8'
|
||||
|
||||
if test "x$HAVE_CDF5" = x1 ; then
|
||||
TESTFILES="$TESTFILES small small2"
|
||||
fi
|
||||
|
||||
|
||||
echo "*** Testing netCDF-3 features of nccopy on ncdump/*.nc files"
|
||||
for i in $TESTFILES ; do
|
||||
echo "*** Testing nccopy $i.nc copy_of_$i.nc ..."
|
||||
|
41
ncdump/tst_nccopy3_subset.sh
Executable file
41
ncdump/tst_nccopy3_subset.sh
Executable file
@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Added in support of https://github.com/Unidata/netcdf-c/gh425 and
|
||||
# https://github.com/Unidata/netcdf-c/gh469
|
||||
#
|
||||
# The output isn't validated, but the regression it is fixing fails on nccopy.
|
||||
#
|
||||
|
||||
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
||||
. ../test_common.sh
|
||||
|
||||
# For a netCDF-3 build, test nccopy on netCDF files in this directory
|
||||
|
||||
set -e
|
||||
echo ""
|
||||
|
||||
INFILE=${TOPSRCDIR}/ncdump/ref_nccopy3_subset.nc
|
||||
OUTFILE=nccopy3_subset_out.nc
|
||||
|
||||
echo "*** Testing netCDF-3 nccopy -v/-V flags on $IN"
|
||||
|
||||
echo "*** One Dimensional Tests"
|
||||
echo "*** Testing nccopy -v"
|
||||
|
||||
${NCCOPY} -v lat ${INFILE} ${OUTFILE}
|
||||
|
||||
echo "*** Testing nccopy -V"
|
||||
|
||||
${NCCOPY} -V lat ${INFILE} ${OUTFILE}
|
||||
|
||||
echo "*** Two Dimensional Tests"
|
||||
echo "*** Testing nccopy -v"
|
||||
|
||||
${NCCOPY} -v lat_2D_rct ${INFILE} ${OUTFILE}
|
||||
|
||||
echo "*** Testing nccopy -V"
|
||||
|
||||
${NCCOPY} -V lat_2D_rct ${INFILE} ${OUTFILE}
|
||||
|
||||
echo "nccopy passed!"
|
||||
exit 0
|
23
ncgen/main.c
23
ncgen/main.c
@ -498,6 +498,13 @@ main(
|
||||
|
||||
/* Compute the k_flag (1st pass) using rules in the man page (ncgen.1).*/
|
||||
|
||||
#ifndef USE_CDF5
|
||||
if(k_flag == NC_FORMAT_CDF5) {
|
||||
derror("Output format CDF5 requested, but netcdf was built without cdf5 support.");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef USE_NETCDF4
|
||||
if(enhanced_flag) {
|
||||
derror("CDL input is enhanced mode, but --disable-netcdf4 was specified during build");
|
||||
@ -506,7 +513,7 @@ main(
|
||||
#endif
|
||||
|
||||
if(l_flag == L_JAVA || l_flag == L_F77) {
|
||||
k_flag = 1;
|
||||
k_flag = NC_FORMAT_CLASSIC;
|
||||
if(enhanced_flag) {
|
||||
derror("Java or Fortran requires classic model CDL input");
|
||||
return 0;
|
||||
@ -517,12 +524,12 @@ main(
|
||||
k_flag = globalspecials._Format;
|
||||
|
||||
if(cdf5_flag && !enhanced_flag && k_flag == 0)
|
||||
k_flag = 5;
|
||||
k_flag = NC_FORMAT_64BIT_DATA;
|
||||
if(enhanced_flag && k_flag == 0)
|
||||
k_flag = 3;
|
||||
k_flag = NC_FORMAT_NETCDF4;
|
||||
|
||||
if(enhanced_flag && k_flag != 3) {
|
||||
if(enhanced_flag && k_flag != 3 && k_flag != 5) {
|
||||
if(enhanced_flag && k_flag != NC_FORMAT_NETCDF4) {
|
||||
if(enhanced_flag && k_flag != NC_FORMAT_NETCDF4 && k_flag != NC_FORMAT_64BIT_DATA) {
|
||||
derror("-k or _Format conflicts with enhanced CDL input");
|
||||
return 0;
|
||||
}
|
||||
@ -530,13 +537,13 @@ main(
|
||||
|
||||
if(specials_flag > 0 && k_flag == 0)
|
||||
#ifdef USE_NETCDF4
|
||||
k_flag = 3;
|
||||
k_flag = NC_FORMAT_NETCDF4;
|
||||
#else
|
||||
k_flag = 1;
|
||||
k_flag = NC_FORMAT_CLASSIC;
|
||||
#endif
|
||||
|
||||
if(k_flag == 0)
|
||||
k_flag = 1;
|
||||
k_flag = NC_FORMAT_CLASSIC;
|
||||
|
||||
/* Figure out usingclassic */
|
||||
switch (k_flag) {
|
||||
|
@ -1394,15 +1394,19 @@ datalistextend(Datalist* dl, NCConstant* con)
|
||||
dlappend(dl,con);
|
||||
}
|
||||
|
||||
/*
|
||||
Try to infer the file type from the
|
||||
kinds of constructs used in the cdl file.
|
||||
*/
|
||||
static void
|
||||
vercheck(int tid)
|
||||
{
|
||||
switch (tid) {
|
||||
case NC_UBYTE: markcdf5("netCDF4/5 type: UBYTE"); break;
|
||||
case NC_USHORT: markcdf5("netCDF4/5 type: USHORT"); break;
|
||||
case NC_UINT: markcdf5("netCDF4/5 type: UINT"); break;
|
||||
case NC_INT64: markcdf5("netCDF4/5 type: INT64"); break;
|
||||
case NC_UINT64: markcdf5("netCDF4/5 type: UINT64"); break;
|
||||
case NC_UBYTE: markcdf4("netCDF4/5 type: UBYTE"); break;
|
||||
case NC_USHORT: markcdf4("netCDF4/5 type: USHORT"); break;
|
||||
case NC_UINT: markcdf4("netCDF4/5 type: UINT"); break;
|
||||
case NC_INT64: markcdf4("netCDF4/5 type: INT64"); break;
|
||||
case NC_UINT64: markcdf4("netCDF4/5 type: UINT64"); break;
|
||||
case NC_STRING: markcdf4("netCDF4 type: STRING"); break;
|
||||
case NC_VLEN: markcdf4("netCDF4 type: VLEN"); break;
|
||||
case NC_OPAQUE: markcdf4("netCDF4 type: OPAQUE"); break;
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
#line 3 "ncgenl.c"
|
||||
#line 3 "lex.ncg.c"
|
||||
|
||||
#define YY_INT_ALIGNED short int
|
||||
|
||||
@ -1335,7 +1335,7 @@ ID ([A-Za-z_]|{UTF8})([A-Z.@#\[\]a-z_0-9+-]|{UTF8})*
|
||||
/* Note: this definition of string will work for utf8 as well,
|
||||
although it is a very relaxed definition
|
||||
*/
|
||||
#line 1339 "ncgenl.c"
|
||||
#line 1339 "lex.ncg.c"
|
||||
|
||||
#define INITIAL 0
|
||||
#define ST_C_COMMENT 1
|
||||
@ -1557,7 +1557,7 @@ YY_DECL
|
||||
{
|
||||
#line 217 "ncgen.l"
|
||||
|
||||
#line 1561 "ncgenl.c"
|
||||
#line 1561 "lex.ncg.c"
|
||||
|
||||
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
|
||||
{
|
||||
@ -2144,7 +2144,7 @@ YY_RULE_SETUP
|
||||
#line 570 "ncgen.l"
|
||||
ECHO;
|
||||
YY_BREAK
|
||||
#line 2148 "ncgenl.c"
|
||||
#line 2148 "lex.ncg.c"
|
||||
case YY_STATE_EOF(INITIAL):
|
||||
case YY_STATE_EOF(TEXT):
|
||||
yyterminate();
|
||||
|
258
ncgen/ncgeny.c
258
ncgen/ncgeny.c
@ -195,7 +195,7 @@ static void yyerror(fmt,va_alist) const char* fmt; va_dcl;
|
||||
extern int lex_init(void);
|
||||
|
||||
|
||||
#line 199 "ncgeny.c" /* yacc.c:339 */
|
||||
#line 199 "ncgen.tab.c" /* yacc.c:339 */
|
||||
|
||||
# ifndef YY_NULLPTR
|
||||
# if defined __cplusplus && 201103L <= __cplusplus
|
||||
@ -214,7 +214,7 @@ extern int lex_init(void);
|
||||
#endif
|
||||
|
||||
/* In a future release of Bison, this section will be replaced
|
||||
by #include "ncgeny.h". */
|
||||
by #include "ncgen.tab.h". */
|
||||
#ifndef YY_NCG_NCGEN_TAB_H_INCLUDED
|
||||
# define YY_NCG_NCGEN_TAB_H_INCLUDED
|
||||
/* Debug traces. */
|
||||
@ -298,7 +298,7 @@ int nctype; /* for tracking attribute list type*/
|
||||
Datalist* datalist;
|
||||
NCConstant constant;
|
||||
|
||||
#line 302 "ncgeny.c" /* yacc.c:355 */
|
||||
#line 302 "ncgen.tab.c" /* yacc.c:355 */
|
||||
};
|
||||
|
||||
typedef union YYSTYPE YYSTYPE;
|
||||
@ -315,7 +315,7 @@ int ncgparse (void);
|
||||
|
||||
/* Copy the second part of user declarations. */
|
||||
|
||||
#line 319 "ncgeny.c" /* yacc.c:358 */
|
||||
#line 319 "ncgen.tab.c" /* yacc.c:358 */
|
||||
|
||||
#ifdef short
|
||||
# undef short
|
||||
@ -1619,13 +1619,13 @@ yyreduce:
|
||||
case 2:
|
||||
#line 221 "ncgen.y" /* yacc.c:1646 */
|
||||
{if (error_count > 0) YYABORT;}
|
||||
#line 1623 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1623 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 3:
|
||||
#line 224 "ncgen.y" /* yacc.c:1646 */
|
||||
{createrootgroup(datasetname);}
|
||||
#line 1629 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1629 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 8:
|
||||
@ -1637,25 +1637,25 @@ yyreduce:
|
||||
yyerror("duplicate group declaration within parent group for %s",
|
||||
id->name);
|
||||
}
|
||||
#line 1641 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1641 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 9:
|
||||
#line 252 "ncgen.y" /* yacc.c:1646 */
|
||||
{listpop(groupstack);}
|
||||
#line 1647 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1647 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 12:
|
||||
#line 258 "ncgen.y" /* yacc.c:1646 */
|
||||
{}
|
||||
#line 1653 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1653 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 13:
|
||||
#line 260 "ncgen.y" /* yacc.c:1646 */
|
||||
{markcdf4("Type specification");}
|
||||
#line 1659 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1659 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 16:
|
||||
@ -1667,19 +1667,19 @@ yyreduce:
|
||||
(yyvsp[0].sym)->name);
|
||||
listpush(typdefs,(void*)(yyvsp[0].sym));
|
||||
}
|
||||
#line 1671 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1671 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 17:
|
||||
#line 275 "ncgen.y" /* yacc.c:1646 */
|
||||
{}
|
||||
#line 1677 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1677 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 18:
|
||||
#line 275 "ncgen.y" /* yacc.c:1646 */
|
||||
{}
|
||||
#line 1683 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1683 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 25:
|
||||
@ -1710,13 +1710,13 @@ yyreduce:
|
||||
}
|
||||
listsetlength(stack,stackbase);/* remove stack nodes*/
|
||||
}
|
||||
#line 1714 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1714 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 26:
|
||||
#line 318 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[0].sym));}
|
||||
#line 1720 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1720 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 27:
|
||||
@ -1735,7 +1735,7 @@ yyreduce:
|
||||
}
|
||||
listpush(stack,(void*)(yyvsp[0].sym));
|
||||
}
|
||||
#line 1739 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1739 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 28:
|
||||
@ -1746,7 +1746,7 @@ yyreduce:
|
||||
(yyvsp[-2].sym)->typ.econst=(yyvsp[0].constant);
|
||||
(yyval.sym)=(yyvsp[-2].sym);
|
||||
}
|
||||
#line 1750 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1750 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 29:
|
||||
@ -1760,7 +1760,7 @@ yyreduce:
|
||||
(yyvsp[0].sym)->typ.size=int32_val;
|
||||
(yyvsp[0].sym)->typ.alignment=nctypealignment(NC_OPAQUE);
|
||||
}
|
||||
#line 1764 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1764 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 30:
|
||||
@ -1776,7 +1776,7 @@ yyreduce:
|
||||
(yyvsp[0].sym)->typ.size=VLENSIZE;
|
||||
(yyvsp[0].sym)->typ.alignment=nctypealignment(NC_VLEN);
|
||||
}
|
||||
#line 1780 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1780 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 31:
|
||||
@ -1810,19 +1810,19 @@ yyreduce:
|
||||
}
|
||||
listsetlength(stack,stackbase);/* remove stack nodes*/
|
||||
}
|
||||
#line 1814 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1814 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 32:
|
||||
#line 404 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.mark)=(yyvsp[-1].mark);}
|
||||
#line 1820 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1820 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 33:
|
||||
#line 405 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.mark)=(yyvsp[-2].mark);}
|
||||
#line 1826 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1826 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 34:
|
||||
@ -1838,97 +1838,97 @@ yyreduce:
|
||||
f->typ.basetype = (yyvsp[-1].sym);
|
||||
}
|
||||
}
|
||||
#line 1842 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1842 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 35:
|
||||
#line 422 "ncgen.y" /* yacc.c:1646 */
|
||||
{ (yyval.sym) = primsymbols[NC_CHAR]; }
|
||||
#line 1848 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1848 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 36:
|
||||
#line 423 "ncgen.y" /* yacc.c:1646 */
|
||||
{ (yyval.sym) = primsymbols[NC_BYTE]; }
|
||||
#line 1854 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1854 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 37:
|
||||
#line 424 "ncgen.y" /* yacc.c:1646 */
|
||||
{ (yyval.sym) = primsymbols[NC_SHORT]; }
|
||||
#line 1860 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1860 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 38:
|
||||
#line 425 "ncgen.y" /* yacc.c:1646 */
|
||||
{ (yyval.sym) = primsymbols[NC_INT]; }
|
||||
#line 1866 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1866 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 39:
|
||||
#line 426 "ncgen.y" /* yacc.c:1646 */
|
||||
{ (yyval.sym) = primsymbols[NC_FLOAT]; }
|
||||
#line 1872 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1872 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 40:
|
||||
#line 427 "ncgen.y" /* yacc.c:1646 */
|
||||
{ (yyval.sym) = primsymbols[NC_DOUBLE]; }
|
||||
#line 1878 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1878 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 41:
|
||||
#line 428 "ncgen.y" /* yacc.c:1646 */
|
||||
{ vercheck(NC_UBYTE); (yyval.sym) = primsymbols[NC_UBYTE]; }
|
||||
#line 1884 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1884 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 42:
|
||||
#line 429 "ncgen.y" /* yacc.c:1646 */
|
||||
{ vercheck(NC_USHORT); (yyval.sym) = primsymbols[NC_USHORT]; }
|
||||
#line 1890 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1890 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 43:
|
||||
#line 430 "ncgen.y" /* yacc.c:1646 */
|
||||
{ vercheck(NC_UINT); (yyval.sym) = primsymbols[NC_UINT]; }
|
||||
#line 1896 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1896 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 44:
|
||||
#line 431 "ncgen.y" /* yacc.c:1646 */
|
||||
{ vercheck(NC_INT64); (yyval.sym) = primsymbols[NC_INT64]; }
|
||||
#line 1902 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1902 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 45:
|
||||
#line 432 "ncgen.y" /* yacc.c:1646 */
|
||||
{ vercheck(NC_UINT64); (yyval.sym) = primsymbols[NC_UINT64]; }
|
||||
#line 1908 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1908 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 47:
|
||||
#line 436 "ncgen.y" /* yacc.c:1646 */
|
||||
{}
|
||||
#line 1914 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1914 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 48:
|
||||
#line 437 "ncgen.y" /* yacc.c:1646 */
|
||||
{}
|
||||
#line 1920 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1920 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 51:
|
||||
#line 444 "ncgen.y" /* yacc.c:1646 */
|
||||
{}
|
||||
#line 1926 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1926 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 52:
|
||||
#line 444 "ncgen.y" /* yacc.c:1646 */
|
||||
{}
|
||||
#line 1932 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1932 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 55:
|
||||
@ -1939,7 +1939,7 @@ yyreduce:
|
||||
fprintf(stderr,"dimension: %s = %llu\n",(yyvsp[-2].sym)->name,(unsigned long long)(yyvsp[-2].sym)->dim.declsize);
|
||||
#endif
|
||||
}
|
||||
#line 1943 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1943 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 56:
|
||||
@ -1951,7 +1951,7 @@ fprintf(stderr,"dimension: %s = %llu\n",(yyvsp[-2].sym)->name,(unsigned long lon
|
||||
fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name);
|
||||
#endif
|
||||
}
|
||||
#line 1955 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1955 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 57:
|
||||
@ -1965,31 +1965,31 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name);
|
||||
(yyval.sym)=(yyvsp[0].sym);
|
||||
listpush(dimdefs,(void*)(yyvsp[0].sym));
|
||||
}
|
||||
#line 1969 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1969 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 59:
|
||||
#line 481 "ncgen.y" /* yacc.c:1646 */
|
||||
{}
|
||||
#line 1975 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1975 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 60:
|
||||
#line 482 "ncgen.y" /* yacc.c:1646 */
|
||||
{}
|
||||
#line 1981 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1981 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 63:
|
||||
#line 489 "ncgen.y" /* yacc.c:1646 */
|
||||
{}
|
||||
#line 1987 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1987 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 64:
|
||||
#line 489 "ncgen.y" /* yacc.c:1646 */
|
||||
{}
|
||||
#line 1993 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 1993 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 65:
|
||||
@ -2013,7 +2013,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name);
|
||||
}
|
||||
listsetlength(stack,stackbase);/* remove stack nodes*/
|
||||
}
|
||||
#line 2017 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2017 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 66:
|
||||
@ -2021,13 +2021,13 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name);
|
||||
{(yyval.mark)=listlength(stack);
|
||||
listpush(stack,(void*)(yyvsp[0].sym));
|
||||
}
|
||||
#line 2025 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2025 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 67:
|
||||
#line 518 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.mark)=(yyvsp[-2].mark); listpush(stack,(void*)(yyvsp[0].sym));}
|
||||
#line 2031 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2031 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 68:
|
||||
@ -2056,31 +2056,31 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name);
|
||||
(yyvsp[-1].sym)->objectclass=NC_VAR;
|
||||
listsetlength(stack,stackbase);/* remove stack nodes*/
|
||||
}
|
||||
#line 2060 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2060 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 69:
|
||||
#line 548 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.mark)=listlength(stack);}
|
||||
#line 2066 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2066 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 70:
|
||||
#line 549 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.mark)=(yyvsp[-1].mark);}
|
||||
#line 2072 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2072 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 71:
|
||||
#line 552 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[0].sym));}
|
||||
#line 2078 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2078 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 72:
|
||||
#line 554 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.mark)=(yyvsp[-2].mark); listpush(stack,(void*)(yyvsp[0].sym));}
|
||||
#line 2084 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2084 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 73:
|
||||
@ -2095,7 +2095,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name);
|
||||
}
|
||||
(yyval.sym)=dimsym;
|
||||
}
|
||||
#line 2099 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2099 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 74:
|
||||
@ -2103,13 +2103,13 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name);
|
||||
{(yyval.mark)=listlength(stack);
|
||||
listpush(stack,(void*)(yyvsp[0].sym));
|
||||
}
|
||||
#line 2107 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2107 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 75:
|
||||
#line 576 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.mark)=(yyvsp[-2].mark); listpush(stack,(void*)(yyvsp[0].sym));}
|
||||
#line 2113 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2113 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 76:
|
||||
@ -2140,31 +2140,31 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name);
|
||||
listsetlength(stack,stackbase);/* remove stack nodes*/
|
||||
(yyval.sym) = (yyvsp[-1].sym);
|
||||
}
|
||||
#line 2144 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2144 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 77:
|
||||
#line 609 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.mark)=listlength(stack);}
|
||||
#line 2150 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2150 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 78:
|
||||
#line 610 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.mark)=(yyvsp[-1].mark);}
|
||||
#line 2156 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2156 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 79:
|
||||
#line 614 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[0].sym));}
|
||||
#line 2162 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2162 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 80:
|
||||
#line 616 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.mark)=(yyvsp[-2].mark); listpush(stack,(void*)(yyvsp[0].sym));}
|
||||
#line 2168 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2168 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 81:
|
||||
@ -2178,7 +2178,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name);
|
||||
(yyval.sym)->dim.isconstant = 1;
|
||||
(yyval.sym)->dim.declsize = uint32_val;
|
||||
}
|
||||
#line 2182 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2182 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 82:
|
||||
@ -2196,7 +2196,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name);
|
||||
(yyval.sym)->dim.isconstant = 1;
|
||||
(yyval.sym)->dim.declsize = int32_val;
|
||||
}
|
||||
#line 2200 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2200 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 83:
|
||||
@ -2208,7 +2208,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name);
|
||||
}
|
||||
(yyval.sym)=vsym;
|
||||
}
|
||||
#line 2212 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2212 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 84:
|
||||
@ -2220,7 +2220,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name);
|
||||
}
|
||||
(yyval.sym)=tsym;
|
||||
}
|
||||
#line 2224 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2224 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 85:
|
||||
@ -2243,49 +2243,49 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name);
|
||||
}
|
||||
(yyval.sym)=tvsym;
|
||||
}
|
||||
#line 2247 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2247 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 86:
|
||||
#line 691 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.sym)=(yyvsp[0].sym);}
|
||||
#line 2253 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2253 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 87:
|
||||
#line 698 "ncgen.y" /* yacc.c:1646 */
|
||||
{}
|
||||
#line 2259 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2259 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 88:
|
||||
#line 698 "ncgen.y" /* yacc.c:1646 */
|
||||
{}
|
||||
#line 2265 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2265 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 89:
|
||||
#line 702 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.sym) = makespecial(_NCPROPS_FLAG,NULL,NULL,(void*)&(yyvsp[0].constant),ATTRGLOBAL);}
|
||||
#line 2271 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2271 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 90:
|
||||
#line 704 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.sym) = makespecial(_ISNETCDF4_FLAG,NULL,NULL,(void*)&(yyvsp[0].constant),ATTRGLOBAL);}
|
||||
#line 2277 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2277 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 91:
|
||||
#line 706 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.sym) = makespecial(_SUPERBLOCK_FLAG,NULL,NULL,(void*)&(yyvsp[0].constant),ATTRGLOBAL);}
|
||||
#line 2283 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2283 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 92:
|
||||
#line 708 "ncgen.y" /* yacc.c:1646 */
|
||||
{ (yyval.sym)=makeattribute((yyvsp[-2].sym),NULL,NULL,(yyvsp[0].datalist),ATTRGLOBAL);}
|
||||
#line 2289 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2289 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 93:
|
||||
@ -2298,7 +2298,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name);
|
||||
YYABORT;
|
||||
}
|
||||
}
|
||||
#line 2302 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2302 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 94:
|
||||
@ -2313,67 +2313,67 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name);
|
||||
YYABORT;
|
||||
}
|
||||
}
|
||||
#line 2317 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2317 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 95:
|
||||
#line 730 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.sym) = makespecial(_FILLVALUE_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].datalist),0);}
|
||||
#line 2323 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2323 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 96:
|
||||
#line 732 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.sym) = makespecial(_FILLVALUE_FLAG,(yyvsp[-4].sym),(yyvsp[-5].sym),(void*)(yyvsp[0].datalist),0);}
|
||||
#line 2329 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2329 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 97:
|
||||
#line 734 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.sym) = makespecial(_STORAGE_FLAG,(yyvsp[-4].sym),NULL,(void*)&(yyvsp[0].constant),1);}
|
||||
#line 2335 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2335 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 98:
|
||||
#line 736 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.sym) = makespecial(_CHUNKSIZES_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].datalist),0);}
|
||||
#line 2341 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2341 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 99:
|
||||
#line 738 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.sym) = makespecial(_FLETCHER32_FLAG,(yyvsp[-4].sym),NULL,(void*)&(yyvsp[0].constant),1);}
|
||||
#line 2347 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2347 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 100:
|
||||
#line 740 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.sym) = makespecial(_DEFLATE_FLAG,(yyvsp[-4].sym),NULL,(void*)&(yyvsp[0].constant),1);}
|
||||
#line 2353 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2353 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 101:
|
||||
#line 742 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.sym) = makespecial(_SHUFFLE_FLAG,(yyvsp[-4].sym),NULL,(void*)&(yyvsp[0].constant),1);}
|
||||
#line 2359 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2359 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 102:
|
||||
#line 744 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.sym) = makespecial(_ENDIAN_FLAG,(yyvsp[-4].sym),NULL,(void*)&(yyvsp[0].constant),1);}
|
||||
#line 2365 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2365 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 103:
|
||||
#line 746 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.sym) = makespecial(_NOFILL_FLAG,(yyvsp[-4].sym),NULL,(void*)&(yyvsp[0].constant),1);}
|
||||
#line 2371 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2371 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 104:
|
||||
#line 748 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.sym) = makespecial(_FORMAT_FLAG,NULL,NULL,(void*)&(yyvsp[0].constant),1);}
|
||||
#line 2377 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2377 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 105:
|
||||
@ -2384,7 +2384,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name);
|
||||
(yyvsp[0].sym)->is_prefixed=0;
|
||||
setpathcurrent((yyvsp[0].sym));
|
||||
}
|
||||
#line 2388 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2388 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 106:
|
||||
@ -2395,257 +2395,257 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name);
|
||||
(yyvsp[0].sym)->is_prefixed=1;
|
||||
/* path is set in ncgen.l*/
|
||||
}
|
||||
#line 2399 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2399 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 108:
|
||||
#line 769 "ncgen.y" /* yacc.c:1646 */
|
||||
{}
|
||||
#line 2405 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2405 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 109:
|
||||
#line 770 "ncgen.y" /* yacc.c:1646 */
|
||||
{}
|
||||
#line 2411 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2411 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 112:
|
||||
#line 778 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyvsp[-2].sym)->data = (yyvsp[0].datalist);}
|
||||
#line 2417 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2417 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 113:
|
||||
#line 781 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.datalist) = (yyvsp[0].datalist);}
|
||||
#line 2423 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2423 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 114:
|
||||
#line 782 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.datalist) = (yyvsp[0].datalist);}
|
||||
#line 2429 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2429 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 115:
|
||||
#line 786 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.datalist) = builddatalist(0);}
|
||||
#line 2435 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2435 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 116:
|
||||
#line 790 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.datalist) = builddatalist(0); datalistextend((yyval.datalist),&((yyvsp[0].constant)));}
|
||||
#line 2441 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2441 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 117:
|
||||
#line 792 "ncgen.y" /* yacc.c:1646 */
|
||||
{datalistextend((yyvsp[-2].datalist),&((yyvsp[0].constant))); (yyval.datalist)=(yyvsp[-2].datalist);}
|
||||
#line 2447 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2447 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 118:
|
||||
#line 796 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=(yyvsp[0].constant);}
|
||||
#line 2453 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2453 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 119:
|
||||
#line 797 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=builddatasublist((yyvsp[-1].datalist));}
|
||||
#line 2459 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2459 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 120:
|
||||
#line 801 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=(yyvsp[0].constant);}
|
||||
#line 2465 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2465 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 121:
|
||||
#line 802 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_OPAQUE);}
|
||||
#line 2471 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2471 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 122:
|
||||
#line 803 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_FILLVALUE);}
|
||||
#line 2477 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2477 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 123:
|
||||
#line 804 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_NIL);}
|
||||
#line 2483 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2483 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 124:
|
||||
#line 805 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=(yyvsp[0].constant);}
|
||||
#line 2489 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2489 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 126:
|
||||
#line 810 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant) = makeenumconstref((yyvsp[0].sym));}
|
||||
#line 2495 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2495 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 127:
|
||||
#line 814 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=evaluate((yyvsp[-3].sym),(yyvsp[-1].datalist));}
|
||||
#line 2501 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2501 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 128:
|
||||
#line 819 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.datalist) = builddatalist(0); datalistextend((yyval.datalist),&((yyvsp[0].constant)));}
|
||||
#line 2507 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2507 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 129:
|
||||
#line 821 "ncgen.y" /* yacc.c:1646 */
|
||||
{datalistextend((yyvsp[-2].datalist),&((yyvsp[0].constant))); (yyval.datalist)=(yyvsp[-2].datalist);}
|
||||
#line 2513 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2513 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 130:
|
||||
#line 825 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_CHAR);}
|
||||
#line 2519 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2519 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 131:
|
||||
#line 826 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_BYTE);}
|
||||
#line 2525 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2525 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 132:
|
||||
#line 827 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_SHORT);}
|
||||
#line 2531 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2531 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 133:
|
||||
#line 828 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_INT);}
|
||||
#line 2537 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2537 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 134:
|
||||
#line 829 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_INT64);}
|
||||
#line 2543 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2543 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 135:
|
||||
#line 830 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_UBYTE);}
|
||||
#line 2549 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2549 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 136:
|
||||
#line 831 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_USHORT);}
|
||||
#line 2555 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2555 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 137:
|
||||
#line 832 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_UINT);}
|
||||
#line 2561 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2561 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 138:
|
||||
#line 833 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_UINT64);}
|
||||
#line 2567 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2567 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 139:
|
||||
#line 834 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_FLOAT);}
|
||||
#line 2573 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2573 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 140:
|
||||
#line 835 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_DOUBLE);}
|
||||
#line 2579 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2579 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 141:
|
||||
#line 836 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_STRING);}
|
||||
#line 2585 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2585 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 142:
|
||||
#line 840 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.datalist) = builddatalist(0); datalistextend((yyval.datalist),&((yyvsp[0].constant)));}
|
||||
#line 2591 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2591 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 143:
|
||||
#line 841 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.datalist)=(yyvsp[-2].datalist); datalistextend((yyvsp[-2].datalist),&((yyvsp[0].constant)));}
|
||||
#line 2597 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2597 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 144:
|
||||
#line 846 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_INT);}
|
||||
#line 2603 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2603 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 145:
|
||||
#line 848 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_UINT);}
|
||||
#line 2609 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2609 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 146:
|
||||
#line 850 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_INT64);}
|
||||
#line 2615 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2615 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 147:
|
||||
#line 852 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_UINT64);}
|
||||
#line 2621 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2621 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 148:
|
||||
#line 856 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=makeconstdata(NC_STRING);}
|
||||
#line 2627 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2627 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 149:
|
||||
#line 860 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=(yyvsp[0].constant);}
|
||||
#line 2633 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2633 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 150:
|
||||
#line 861 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.constant)=(yyvsp[0].constant);}
|
||||
#line 2639 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2639 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
case 151:
|
||||
#line 867 "ncgen.y" /* yacc.c:1646 */
|
||||
{(yyval.sym)=(yyvsp[0].sym);}
|
||||
#line 2645 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2645 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
break;
|
||||
|
||||
|
||||
#line 2649 "ncgeny.c" /* yacc.c:1646 */
|
||||
#line 2649 "ncgen.tab.c" /* yacc.c:1646 */
|
||||
default: break;
|
||||
}
|
||||
/* User semantic actions sometimes alter yychar, and that requires
|
||||
|
@ -113,7 +113,7 @@ int nctype; /* for tracking attribute list type*/
|
||||
Datalist* datalist;
|
||||
NCConstant constant;
|
||||
|
||||
#line 117 "ncgeny.h" /* yacc.c:1909 */
|
||||
#line 117 "ncgen.tab.h" /* yacc.c:1909 */
|
||||
};
|
||||
|
||||
typedef union YYSTYPE YYSTYPE;
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "config.h"
|
||||
#include <curl/curl.h>
|
||||
#include "ocinternal.h"
|
||||
#include "occurlfunctions.h"
|
||||
#include "ocdebug.h"
|
||||
|
||||
static int nflags = 0;
|
||||
@ -22,7 +23,10 @@ static struct OCCURLFLAG oc_curlflags[] = {
|
||||
{"CURLOPT_ERRORBUFFER",CURLOPT_ERRORBUFFER,10010,CF_STRING},
|
||||
{"CURLOPT_FOLLOWLOCATION",CURLOPT_FOLLOWLOCATION,52,CF_LONG},
|
||||
{"CURLOPT_HTTPAUTH",CURLOPT_HTTPAUTH,1007,CF_LONG},
|
||||
#ifdef HAVE_CURLOPT_KEYPASSWD
|
||||
{"CURLOPT_KEYPASSWD",CURLOPT_KEYPASSWD,10026,CF_STRING},
|
||||
{"CURLOPT_SSLKEYPASSWD",CURLOPT_SSLKEYPASSWD,CURLOPT_KEYPASSWD,CF_STRING},
|
||||
#endif
|
||||
{"CURLOPT_MAXREDIRS",CURLOPT_MAXREDIRS,68,CF_LONG},
|
||||
{"CURLOPT_NETRC",CURLOPT_NETRC,51,CF_LONG},
|
||||
{"CURLOPT_NETRC_FILE",CURLOPT_NETRC_FILE,10118,CF_STRING},
|
||||
@ -32,7 +36,6 @@ static struct OCCURLFLAG oc_curlflags[] = {
|
||||
{"CURLOPT_PROXYUSERPWD",CURLOPT_PROXYUSERPWD,10006,CF_STRING},
|
||||
{"CURLOPT_SSLCERT",CURLOPT_SSLCERT,10025,CF_STRING},
|
||||
{"CURLOPT_SSLKEY",CURLOPT_SSLKEY,10087,CF_STRING},
|
||||
{"CURLOPT_SSLKEYPASSWD",CURLOPT_SSLKEYPASSWD,CURLOPT_KEYPASSWD,CF_STRING},
|
||||
{"CURLOPT_SSL_VERIFYHOST",CURLOPT_SSL_VERIFYHOST,81,CF_LONG},
|
||||
{"CURLOPT_SSL_VERIFYPEER",CURLOPT_SSL_VERIFYPEER,64,CF_LONG},
|
||||
{"CURLOPT_TIMEOUT",CURLOPT_TIMEOUT,13,CF_LONG},
|
||||
@ -43,205 +46,6 @@ static struct OCCURLFLAG oc_curlflags[] = {
|
||||
{NULL,0}
|
||||
};
|
||||
|
||||
#if 0
|
||||
static struct OCCURLFLAG oc_allcurlflags[] = {
|
||||
{"CURLOPT_ADDRESS_SCOPE",CURLOPT_ADDRESS_SCOPE,171,CF_UNKNOWN},
|
||||
{"CURLOPT_APPEND",CURLOPT_APPEND,50,CF_UNKNOWN},
|
||||
{"CURLOPT_AUTOREFERER",CURLOPT_AUTOREFERER,58,CF_UNKNOWN},
|
||||
{"CURLOPT_BUFFERSIZE",CURLOPT_BUFFERSIZE,98,CF_UNKNOWN},
|
||||
{"CURLOPT_CAINFO",CURLOPT_CAINFO,10065,CF_UNKNOWN},
|
||||
{"CURLOPT_CAPATH",CURLOPT_CAPATH,10097,CF_UNKNOWN},
|
||||
{"CURLOPT_CERTINFO",CURLOPT_CERTINFO,172,CF_UNKNOWN},
|
||||
{"CURLOPT_CHUNK_BGN_FUNCTION",CURLOPT_CHUNK_BGN_FUNCTION,20198,CF_UNKNOWN},
|
||||
{"CURLOPT_CHUNK_DATA",CURLOPT_CHUNK_DATA,10201,CF_UNKNOWN},
|
||||
{"CURLOPT_CHUNK_END_FUNCTION",CURLOPT_CHUNK_END_FUNCTION,20199,CF_UNKNOWN},
|
||||
{"CURLOPT_CLOSEPOLICY",CURLOPT_CLOSEPOLICY,72,CF_UNKNOWN},
|
||||
{"CURLOPT_CONNECT_ONLY",CURLOPT_CONNECT_ONLY,141,CF_UNKNOWN},
|
||||
{"CURLOPT_CONNECTTIMEOUT",CURLOPT_CONNECTTIMEOUT,78,CF_UNKNOWN},
|
||||
{"CURLOPT_CONNECTTIMEOUT_MS",CURLOPT_CONNECTTIMEOUT_MS,156,CF_UNKNOWN},
|
||||
{"CURLOPT_CONV_FROM_NETWORK_FUNCTION",CURLOPT_CONV_FROM_NETWORK_FUNCTION,20142,CF_UNKNOWN},
|
||||
{"CURLOPT_CONV_FROM_UTF8_FUNCTION",CURLOPT_CONV_FROM_UTF8_FUNCTION,20144,CF_UNKNOWN},
|
||||
{"CURLOPT_CONV_TO_NETWORK_FUNCTION",CURLOPT_CONV_TO_NETWORK_FUNCTION,20143,CF_UNKNOWN},
|
||||
{"CURLOPT_COOKIE",CURLOPT_COOKIE,10022,CF_UNKNOWN},
|
||||
{"CURLOPT_COOKIEFILE",CURLOPT_COOKIEFILE,10031,CF_UNKNOWN},
|
||||
{"CURLOPT_COOKIEJAR",CURLOPT_COOKIEJAR,10082,CF_UNKNOWN},
|
||||
{"CURLOPT_COOKIELIST",CURLOPT_COOKIELIST,10135,CF_UNKNOWN},
|
||||
{"CURLOPT_COOKIESESSION",CURLOPT_COOKIESESSION,96,CF_UNKNOWN},
|
||||
{"CURLOPT_COPYPOSTFIELDS",CURLOPT_COPYPOSTFIELDS,10165,CF_UNKNOWN},
|
||||
{"CURLOPT_CRLF",CURLOPT_CRLF,27,CF_UNKNOWN},
|
||||
{"CURLOPT_CRLFILE",CURLOPT_CRLFILE,10169,CF_UNKNOWN},
|
||||
{"CURLOPT_CUSTOMREQUEST",CURLOPT_CUSTOMREQUEST,10036,CF_UNKNOWN},
|
||||
{"CURLOPT_DEBUGDATA",CURLOPT_DEBUGDATA,10095,CF_UNKNOWN},
|
||||
{"CURLOPT_DEBUGFUNCTION",CURLOPT_DEBUGFUNCTION,20094,CF_UNKNOWN},
|
||||
{"CURLOPT_DIRLISTONLY",CURLOPT_DIRLISTONLY,48,CF_UNKNOWN},
|
||||
{"CURLOPT_DNS_CACHE_TIMEOUT",CURLOPT_DNS_CACHE_TIMEOUT,92,CF_UNKNOWN},
|
||||
{"CURLOPT_DNS_USE_GLOBAL_CACHE",CURLOPT_DNS_USE_GLOBAL_CACHE,91,CF_UNKNOWN},
|
||||
{"CURLOPT_EGDSOCKET",CURLOPT_EGDSOCKET,10077,CF_UNKNOWN},
|
||||
{"CURLOPT_ENCODING",CURLOPT_ENCODING,10102,CF_UNKNOWN},
|
||||
{"CURLOPT_ERRORBUFFER",CURLOPT_ERRORBUFFER,10010,CF_UNKNOWN},
|
||||
{"CURLOPT_FAILONERROR",CURLOPT_FAILONERROR,45,CF_UNKNOWN},
|
||||
{"CURLOPT_FILE",CURLOPT_FILE,10001,CF_UNKNOWN},
|
||||
{"CURLOPT_FILETIME",CURLOPT_FILETIME,69,CF_UNKNOWN},
|
||||
{"CURLOPT_FNMATCH_DATA",CURLOPT_FNMATCH_DATA,10202,CF_UNKNOWN},
|
||||
{"CURLOPT_FNMATCH_FUNCTION",CURLOPT_FNMATCH_FUNCTION,20200,CF_UNKNOWN},
|
||||
{"CURLOPT_FOLLOWLOCATION",CURLOPT_FOLLOWLOCATION,52,CF_UNKNOWN},
|
||||
{"CURLOPT_FORBID_REUSE",CURLOPT_FORBID_REUSE,75,CF_UNKNOWN},
|
||||
{"CURLOPT_FRESH_CONNECT",CURLOPT_FRESH_CONNECT,74,CF_UNKNOWN},
|
||||
{"CURLOPT_FTP_ACCOUNT",CURLOPT_FTP_ACCOUNT,10134,CF_UNKNOWN},
|
||||
{"CURLOPT_FTP_ALTERNATIVE_TO_USER",CURLOPT_FTP_ALTERNATIVE_TO_USER,10147,CF_UNKNOWN},
|
||||
{"CURLOPT_FTP_CREATE_MISSING_DIRS",CURLOPT_FTP_CREATE_MISSING_DIRS,110,CF_UNKNOWN},
|
||||
{"CURLOPT_FTP_FILEMETHOD",CURLOPT_FTP_FILEMETHOD,138,CF_UNKNOWN},
|
||||
{"CURLOPT_FTPPORT",CURLOPT_FTPPORT,10017,CF_UNKNOWN},
|
||||
{"CURLOPT_FTP_RESPONSE_TIMEOUT",CURLOPT_FTP_RESPONSE_TIMEOUT,112,CF_UNKNOWN},
|
||||
{"CURLOPT_FTP_SKIP_PASV_IP",CURLOPT_FTP_SKIP_PASV_IP,137,CF_UNKNOWN},
|
||||
{"CURLOPT_FTPSSLAUTH",CURLOPT_FTPSSLAUTH,129,CF_UNKNOWN},
|
||||
{"CURLOPT_FTP_SSL_CCC",CURLOPT_FTP_SSL_CCC,154,CF_UNKNOWN},
|
||||
{"CURLOPT_FTP_USE_EPRT",CURLOPT_FTP_USE_EPRT,106,CF_UNKNOWN},
|
||||
{"CURLOPT_FTP_USE_EPSV",CURLOPT_FTP_USE_EPSV,85,CF_UNKNOWN},
|
||||
{"CURLOPT_FTP_USE_PRET",CURLOPT_FTP_USE_PRET,188,CF_UNKNOWN},
|
||||
{"CURLOPT_GSSAPI_DELEGATION",CURLOPT_GSSAPI_DELEGATION,210,CF_UNKNOWN},
|
||||
{"CURLOPT_HEADER",CURLOPT_HEADER,42,CF_UNKNOWN},
|
||||
{"CURLOPT_HEADERFUNCTION",CURLOPT_HEADERFUNCTION,20079,CF_UNKNOWN},
|
||||
{"CURLOPT_HTTP200ALIASES",CURLOPT_HTTP200ALIASES,10104,CF_UNKNOWN},
|
||||
{"CURLOPT_HTTPAUTH",CURLOPT_HTTPAUTH,107,CF_UNKNOWN},
|
||||
{"CURLOPT_HTTP_CONTENT_DECODING",CURLOPT_HTTP_CONTENT_DECODING,158,CF_UNKNOWN},
|
||||
{"CURLOPT_HTTPGET",CURLOPT_HTTPGET,80,CF_UNKNOWN},
|
||||
{"CURLOPT_HTTPHEADER",CURLOPT_HTTPHEADER,10023,CF_UNKNOWN},
|
||||
{"CURLOPT_HTTPPOST",CURLOPT_HTTPPOST,10024,CF_UNKNOWN},
|
||||
{"CURLOPT_HTTPPROXYTUNNEL",CURLOPT_HTTPPROXYTUNNEL,61,CF_UNKNOWN},
|
||||
{"CURLOPT_HTTP_TRANSFER_DECODING",CURLOPT_HTTP_TRANSFER_DECODING,157,CF_UNKNOWN},
|
||||
{"CURLOPT_HTTP_VERSION",CURLOPT_HTTP_VERSION,84,CF_UNKNOWN},
|
||||
{"CURLOPT_IGNORE_CONTENT_LENGTH",CURLOPT_IGNORE_CONTENT_LENGTH,136,CF_UNKNOWN},
|
||||
{"CURLOPT_INFILE",CURLOPT_INFILE,10009,CF_UNKNOWN},
|
||||
{"CURLOPT_INFILESIZE",CURLOPT_INFILESIZE,14,CF_UNKNOWN},
|
||||
{"CURLOPT_INFILESIZE_LARGE",CURLOPT_INFILESIZE_LARGE,30115,CF_UNKNOWN},
|
||||
{"CURLOPT_INTERFACE",CURLOPT_INTERFACE,10062,CF_UNKNOWN},
|
||||
{"CURLOPT_INTERLEAVEDATA",CURLOPT_INTERLEAVEDATA,10195,CF_UNKNOWN},
|
||||
{"CURLOPT_INTERLEAVEFUNCTION",CURLOPT_INTERLEAVEFUNCTION,20196,CF_UNKNOWN},
|
||||
{"CURLOPT_IOCTLDATA",CURLOPT_IOCTLDATA,10131,CF_UNKNOWN},
|
||||
{"CURLOPT_IOCTLFUNCTION",CURLOPT_IOCTLFUNCTION,20130,CF_UNKNOWN},
|
||||
{"CURLOPT_IPRESOLVE",CURLOPT_IPRESOLVE,113,CF_UNKNOWN},
|
||||
{"CURLOPT_ISSUERCERT",CURLOPT_ISSUERCERT,10170,CF_UNKNOWN},
|
||||
{"CURLOPT_KEYPASSWD",CURLOPT_KEYPASSWD,10026,CF_UNKNOWN},
|
||||
{"CURLOPT_KRBLEVEL",CURLOPT_KRBLEVEL,10063,CF_UNKNOWN},
|
||||
{"CURLOPT_LOCALPORT",CURLOPT_LOCALPORT,139,CF_UNKNOWN},
|
||||
{"CURLOPT_LOCALPORTRANGE",CURLOPT_LOCALPORTRANGE,140,CF_UNKNOWN},
|
||||
{"CURLOPT_LOW_SPEED_LIMIT",CURLOPT_LOW_SPEED_LIMIT,19,CF_UNKNOWN},
|
||||
{"CURLOPT_LOW_SPEED_TIME",CURLOPT_LOW_SPEED_TIME,20,CF_UNKNOWN},
|
||||
{"CURLOPT_MAIL_FROM",CURLOPT_MAIL_FROM,10186,CF_UNKNOWN},
|
||||
{"CURLOPT_MAIL_RCPT",CURLOPT_MAIL_RCPT,10187,CF_UNKNOWN},
|
||||
{"CURLOPT_MAXCONNECTS",CURLOPT_MAXCONNECTS,71,CF_UNKNOWN},
|
||||
{"CURLOPT_MAXFILESIZE",CURLOPT_MAXFILESIZE,114,CF_UNKNOWN},
|
||||
{"CURLOPT_MAXFILESIZE_LARGE",CURLOPT_MAXFILESIZE_LARGE,30117,CF_UNKNOWN},
|
||||
{"CURLOPT_MAX_RECV_SPEED_LARGE",CURLOPT_MAX_RECV_SPEED_LARGE,30146,CF_UNKNOWN},
|
||||
{"CURLOPT_MAXREDIRS",CURLOPT_MAXREDIRS,68,CF_UNKNOWN},
|
||||
{"CURLOPT_MAX_SEND_SPEED_LARGE",CURLOPT_MAX_SEND_SPEED_LARGE,30145,CF_UNKNOWN},
|
||||
{"CURLOPT_NETRC",CURLOPT_NETRC,51,CF_UNKNOWN},
|
||||
{"CURLOPT_NETRC_FILE",CURLOPT_NETRC_FILE,10118,CF_UNKNOWN},
|
||||
{"CURLOPT_NEW_DIRECTORY_PERMS",CURLOPT_NEW_DIRECTORY_PERMS,160,CF_UNKNOWN},
|
||||
{"CURLOPT_NEW_FILE_PERMS",CURLOPT_NEW_FILE_PERMS,159,CF_UNKNOWN},
|
||||
{"CURLOPT_NOBODY",CURLOPT_NOBODY,44,CF_UNKNOWN},
|
||||
{"CURLOPT_NOPROGRESS",CURLOPT_NOPROGRESS,43,CF_UNKNOWN},
|
||||
{"CURLOPT_NOPROXY",CURLOPT_NOPROXY,10177,CF_UNKNOWN},
|
||||
{"CURLOPT_NOSIGNAL",CURLOPT_NOSIGNAL,99,CF_UNKNOWN},
|
||||
{"CURLOPT_OPENSOCKETDATA",CURLOPT_OPENSOCKETDATA,10164,CF_UNKNOWN},
|
||||
{"CURLOPT_OPENSOCKETFUNCTION",CURLOPT_OPENSOCKETFUNCTION,20163,CF_UNKNOWN},
|
||||
{"CURLOPT_PASSWORD",CURLOPT_PASSWORD,10174,CF_UNKNOWN},
|
||||
{"CURLOPT_PORT",CURLOPT_PORT,3,CF_UNKNOWN},
|
||||
{"CURLOPT_POST",CURLOPT_POST,47,CF_UNKNOWN},
|
||||
{"CURLOPT_POSTFIELDS",CURLOPT_POSTFIELDS,10015,CF_UNKNOWN},
|
||||
{"CURLOPT_POSTFIELDSIZE",CURLOPT_POSTFIELDSIZE,60,CF_UNKNOWN},
|
||||
{"CURLOPT_POSTFIELDSIZE_LARGE",CURLOPT_POSTFIELDSIZE_LARGE,30120,CF_UNKNOWN},
|
||||
{"CURLOPT_POSTQUOTE",CURLOPT_POSTQUOTE,10039,CF_UNKNOWN},
|
||||
{"CURLOPT_POSTREDIR",CURLOPT_POSTREDIR,161,CF_UNKNOWN},
|
||||
{"CURLOPT_PREQUOTE",CURLOPT_PREQUOTE,10093,CF_UNKNOWN},
|
||||
{"CURLOPT_PRIVATE",CURLOPT_PRIVATE,10103,CF_UNKNOWN},
|
||||
{"CURLOPT_PROGRESSDATA",CURLOPT_PROGRESSDATA,10057,CF_UNKNOWN},
|
||||
{"CURLOPT_PROGRESSFUNCTION",CURLOPT_PROGRESSFUNCTION,20056,CF_UNKNOWN},
|
||||
{"CURLOPT_PROTOCOLS",CURLOPT_PROTOCOLS,181,CF_UNKNOWN},
|
||||
{"CURLOPT_PROXY",CURLOPT_PROXY,10004,CF_UNKNOWN},
|
||||
{"CURLOPT_PROXYAUTH",CURLOPT_PROXYAUTH,111,CF_UNKNOWN},
|
||||
{"CURLOPT_PROXYPASSWORD",CURLOPT_PROXYPASSWORD,10176,CF_UNKNOWN},
|
||||
{"CURLOPT_PROXYPORT",CURLOPT_PROXYPORT,59,CF_UNKNOWN},
|
||||
{"CURLOPT_PROXY_TRANSFER_MODE",CURLOPT_PROXY_TRANSFER_MODE,166,CF_UNKNOWN},
|
||||
{"CURLOPT_PROXYTYPE",CURLOPT_PROXYTYPE,101,CF_UNKNOWN},
|
||||
{"CURLOPT_PROXYUSERNAME",CURLOPT_PROXYUSERNAME,10175,CF_UNKNOWN},
|
||||
{"CURLOPT_PROXYUSERPWD",CURLOPT_PROXYUSERPWD,10006,CF_UNKNOWN},
|
||||
{"CURLOPT_PUT",CURLOPT_PUT,54,CF_UNKNOWN},
|
||||
{"CURLOPT_QUOTE",CURLOPT_QUOTE,10028,CF_UNKNOWN},
|
||||
{"CURLOPT_RANDOM_FILE",CURLOPT_RANDOM_FILE,10076,CF_UNKNOWN},
|
||||
{"CURLOPT_RANGE",CURLOPT_RANGE,10007,CF_UNKNOWN},
|
||||
{"CURLOPT_READFUNCTION",CURLOPT_READFUNCTION,20012,CF_UNKNOWN},
|
||||
{"CURLOPT_REDIR_PROTOCOLS",CURLOPT_REDIR_PROTOCOLS,182,CF_UNKNOWN},
|
||||
{"CURLOPT_REFERER",CURLOPT_REFERER,10016,CF_UNKNOWN},
|
||||
{"CURLOPT_RESUME_FROM",CURLOPT_RESUME_FROM,21,CF_UNKNOWN},
|
||||
{"CURLOPT_RESUME_FROM_LARGE",CURLOPT_RESUME_FROM_LARGE,30116,CF_UNKNOWN},
|
||||
{"CURLOPT_RTSP_CLIENT_CSEQ",CURLOPT_RTSP_CLIENT_CSEQ,193,CF_UNKNOWN},
|
||||
{"CURLOPT_RTSP_REQUEST",CURLOPT_RTSP_REQUEST,189,CF_UNKNOWN},
|
||||
{"CURLOPT_RTSP_SERVER_CSEQ",CURLOPT_RTSP_SERVER_CSEQ,194,CF_UNKNOWN},
|
||||
{"CURLOPT_RTSP_SESSION_ID",CURLOPT_RTSP_SESSION_ID,10190,CF_UNKNOWN},
|
||||
{"CURLOPT_RTSP_STREAM_URI",CURLOPT_RTSP_STREAM_URI,10191,CF_UNKNOWN},
|
||||
{"CURLOPT_RTSP_TRANSPORT",CURLOPT_RTSP_TRANSPORT,10192,CF_UNKNOWN},
|
||||
{"CURLOPT_SEEKDATA",CURLOPT_SEEKDATA,10168,CF_UNKNOWN},
|
||||
{"CURLOPT_SEEKFUNCTION",CURLOPT_SEEKFUNCTION,20167,CF_UNKNOWN},
|
||||
{"CURLOPT_SHARE",CURLOPT_SHARE,10100,CF_UNKNOWN},
|
||||
{"CURLOPT_SOCKOPTDATA",CURLOPT_SOCKOPTDATA,10149,CF_UNKNOWN},
|
||||
{"CURLOPT_SOCKOPTFUNCTION",CURLOPT_SOCKOPTFUNCTION,20148,CF_UNKNOWN},
|
||||
{"CURLOPT_SOCKS5_GSSAPI_NEC",CURLOPT_SOCKS5_GSSAPI_NEC,180,CF_UNKNOWN},
|
||||
{"CURLOPT_SOCKS5_GSSAPI_SERVICE",CURLOPT_SOCKS5_GSSAPI_SERVICE,10179,CF_UNKNOWN},
|
||||
{"CURLOPT_SSH_AUTH_TYPES",CURLOPT_SSH_AUTH_TYPES,151,CF_UNKNOWN},
|
||||
{"CURLOPT_SSH_HOST_PUBLIC_KEY_MD5",CURLOPT_SSH_HOST_PUBLIC_KEY_MD5,10162,CF_UNKNOWN},
|
||||
{"CURLOPT_SSH_KEYDATA",CURLOPT_SSH_KEYDATA,10185,CF_UNKNOWN},
|
||||
{"CURLOPT_SSH_KEYFUNCTION",CURLOPT_SSH_KEYFUNCTION,20184,CF_UNKNOWN},
|
||||
{"CURLOPT_SSH_KNOWNHOSTS",CURLOPT_SSH_KNOWNHOSTS,10183,CF_UNKNOWN},
|
||||
{"CURLOPT_SSH_PRIVATE_KEYFILE",CURLOPT_SSH_PRIVATE_KEYFILE,10153,CF_UNKNOWN},
|
||||
{"CURLOPT_SSH_PUBLIC_KEYFILE",CURLOPT_SSH_PUBLIC_KEYFILE,10152,CF_UNKNOWN},
|
||||
{"CURLOPT_SSLCERT",CURLOPT_SSLCERT,10025,CF_UNKNOWN},
|
||||
{"CURLOPT_SSLCERTTYPE",CURLOPT_SSLCERTTYPE,10086,CF_UNKNOWN},
|
||||
{"CURLOPT_SSL_CIPHER_LIST",CURLOPT_SSL_CIPHER_LIST,10083,CF_UNKNOWN},
|
||||
{"CURLOPT_SSL_CTX_DATA",CURLOPT_SSL_CTX_DATA,10109,CF_UNKNOWN},
|
||||
{"CURLOPT_SSL_CTX_FUNCTION",CURLOPT_SSL_CTX_FUNCTION,20108,CF_UNKNOWN},
|
||||
{"CURLOPT_SSLENGINE",CURLOPT_SSLENGINE,10089,CF_UNKNOWN},
|
||||
{"CURLOPT_SSLENGINE_DEFAULT",CURLOPT_SSLENGINE_DEFAULT,90,CF_UNKNOWN},
|
||||
{"CURLOPT_SSLKEY",CURLOPT_SSLKEY,10087,CF_UNKNOWN},
|
||||
{"CURLOPT_SSLKEYTYPE",CURLOPT_SSLKEYTYPE,10088,CF_UNKNOWN},
|
||||
{"CURLOPT_SSL_SESSIONID_CACHE",CURLOPT_SSL_SESSIONID_CACHE,150,CF_UNKNOWN},
|
||||
{"CURLOPT_SSL_VERIFYHOST",CURLOPT_SSL_VERIFYHOST,81,CF_UNKNOWN},
|
||||
{"CURLOPT_SSL_VERIFYPEER",CURLOPT_SSL_VERIFYPEER,64,CF_UNKNOWN},
|
||||
{"CURLOPT_SSLVERSION",CURLOPT_SSLVERSION,32,CF_UNKNOWN},
|
||||
{"CURLOPT_STDERR",CURLOPT_STDERR,10037,CF_UNKNOWN},
|
||||
{"CURLOPT_TCP_NODELAY",CURLOPT_TCP_NODELAY,121,CF_UNKNOWN},
|
||||
{"CURLOPT_TELNETOPTIONS",CURLOPT_TELNETOPTIONS,10070,CF_UNKNOWN},
|
||||
{"CURLOPT_TFTP_BLKSIZE",CURLOPT_TFTP_BLKSIZE,178,CF_UNKNOWN},
|
||||
{"CURLOPT_TIMECONDITION",CURLOPT_TIMECONDITION,33,CF_UNKNOWN},
|
||||
{"CURLOPT_TIMEOUT",CURLOPT_TIMEOUT,13,CF_UNKNOWN},
|
||||
{"CURLOPT_TIMEOUT_MS",CURLOPT_TIMEOUT_MS,155,CF_UNKNOWN},
|
||||
{"CURLOPT_TIMEVALUE",CURLOPT_TIMEVALUE,34,CF_UNKNOWN},
|
||||
{"CURLOPT_TRANSFERTEXT",CURLOPT_TRANSFERTEXT,53,CF_UNKNOWN},
|
||||
{"CURLOPT_UNRESTRICTED_AUTH",CURLOPT_UNRESTRICTED_AUTH,105,CF_UNKNOWN},
|
||||
{"CURLOPT_UPLOAD",CURLOPT_UPLOAD,46,CF_UNKNOWN},
|
||||
{"CURLOPT_URL",CURLOPT_URL,10002,CF_UNKNOWN},
|
||||
{"CURLOPT_USERAGENT",CURLOPT_USERAGENT,10018,CF_UNKNOWN},
|
||||
{"CURLOPT_USERNAME",CURLOPT_USERNAME,10173,CF_UNKNOWN},
|
||||
{"CURLOPT_USERPWD",CURLOPT_USERPWD,10005,CF_UNKNOWN},
|
||||
{"CURLOPT_USE_SSL",CURLOPT_USE_SSL,119,CF_UNKNOWN},
|
||||
{"CURLOPT_VERBOSE",CURLOPT_VERBOSE,41,CF_UNKNOWN},
|
||||
{"CURLOPT_WILDCARDMATCH",CURLOPT_WILDCARDMATCH,197,CF_UNKNOWN},
|
||||
{"CURLOPT_WRITEFUNCTION",CURLOPT_WRITEFUNCTION,20011,CF_UNKNOWN},
|
||||
{"CURLOPT_WRITEHEADER",CURLOPT_WRITEHEADER,10029,CF_UNKNOWN},
|
||||
{"CURLOPT_WRITEINFO",CURLOPT_WRITEINFO,10040,CF_UNKNOWN},
|
||||
{NULL,0}
|
||||
};
|
||||
|
||||
struct OCCURLFLAG*
|
||||
occurlflagsall(void)
|
||||
{
|
||||
if(nflags == 0) initialize();
|
||||
return oc_allcurlflags;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static int touppercase(int c)
|
||||
{
|
||||
if(c >= 'a' && c <= 'z')
|
||||
|
@ -11,12 +11,6 @@
|
||||
/* Mnemonic */
|
||||
#define OPTARG void*
|
||||
|
||||
/* Condition on libcurl version */
|
||||
/* Set up an alias as needed */
|
||||
#ifndef HAVE_CURLOPT_KEYPASSWD
|
||||
#define CURLOPT_KEYPASSWD CURLOPT_SSLKEYPASSWD
|
||||
#endif
|
||||
|
||||
#define NETRCFILETAG "HTTP.NETRC"
|
||||
|
||||
#define CHECK(state,flag,value) {if(check(state,flag,(void*)value) != OC_NOERR) {goto done;}}
|
||||
|
@ -9,6 +9,15 @@
|
||||
#define _CURLFUNCTION_H_
|
||||
|
||||
|
||||
/* Condition on libcurl version */
|
||||
/* Set up an alias as needed */
|
||||
#ifndef HAVE_CURLOPT_KEYPASSWD
|
||||
#define CURLOPT_KEYPASSWD CURLOPT_SSLKEYPASSWD
|
||||
#endif
|
||||
#ifndef HAVE_CURLINFO_RESPONSE_CODE
|
||||
#define CURLINFO_RESPONSE_CODE CURLINFO_HTTP_CODE
|
||||
#endif
|
||||
|
||||
extern OCerror ocset_curlopt(OCstate* state, int flag, void* value);
|
||||
|
||||
struct OCCURLFLAG* occurlflagbyflag(int flag);
|
||||
|
@ -23,11 +23,7 @@ ocfetchhttpcode(CURL* curl)
|
||||
long httpcode = 200;
|
||||
CURLcode cstat = CURLE_OK;
|
||||
/* Extract the http code */
|
||||
#ifdef HAVE_CURLINFO_RESPONSE_CODE
|
||||
cstat = CURLERR(curl_easy_getinfo(curl,CURLINFO_RESPONSE_CODE,&httpcode));
|
||||
#else
|
||||
cstat = curl_easy_getinfo(curl,CURLINFO_HTTP_CODE,&httpcode);
|
||||
#endif
|
||||
if(cstat != CURLE_OK) httpcode = 0;
|
||||
return httpcode;
|
||||
}
|
||||
|
@ -608,7 +608,6 @@ ocset_curlproperties(OCstate* state)
|
||||
if(path == NULL) return OC_ENOMEM;
|
||||
occopycat(path,len,3,ocglobalstate.tempdir,"/","occookies");
|
||||
stat = ocmktmp(path,&name);
|
||||
fprintf(stderr,"%s => %s\n",state->uri->uri,name); fflush(stderr);
|
||||
free(path);
|
||||
state->curlflags.cookiejar = name;
|
||||
state->curlflags.createdflags |= COOKIECREATED;
|
||||
|
Loading…
Reference in New Issue
Block a user