removed USE_DISPATCH and most uses of nc3 from libsrc4

This commit is contained in:
Dennis Heimbigner 2010-07-30 19:20:22 +00:00
parent c9a566a42c
commit c5cb1104b7
23 changed files with 121 additions and 277 deletions

View File

@ -65,11 +65,8 @@ LIBSRC4_DIR = libsrc4
NC_TEST4 = nc_test4
endif
# Is the user building dispatch?
if USE_DISPATCH
DISPATCHDIR = libdispatch
ASSEMBLEDIR = liblib
endif
endif # BUILD_C
@ -217,3 +214,13 @@ install-data-hook:
@echo '+-------------------------------------------------------------+'
@echo ''
# Define the set of subdirs that
# contain sources for visual studio
VSTUDIODIRS=include $(DISPATCHDIR) $(LIBSRC_DIR) ${ASSEMBLEDIR}
.PHONY: visualstudio
visualstudio:
sh ${abs_top_srcdir}/visualbuild start
for dir in $(VSTUDIODIRS); do $(MAKE) -C $$dir visualstudio ; done
sh ${abs_top_srcdir}/visualbuild build

View File

@ -1255,16 +1255,6 @@ if test "x$enable_logging" = xyes; then
AC_DEFINE([LOGGING], 1, [If true, turn on logging.])
fi
AC_MSG_CHECKING([if API dispatch is enabled])
AC_ARG_ENABLE([dispatch],
[AS_HELP_STRING([--enable-dispatch],
[enable experimental dispatch support])])
test "x$enable_dispatch" = xno || enable_dispatch=yes
AC_MSG_RESULT($enable_dispatch)
if test "x$enable_dispatch" = xyes ; then
AC_DEFINE([USE_DISPATCH], [1], [if true, include experimental API dispatch code])
fi
# Automake conditionals need to be called, whether the answer is yes
# or no.
AM_CONDITIONAL(BUILD_PARALLEL, [test x$enable_parallel = xyes])
@ -1509,7 +1499,6 @@ AC_MSG_NOTICE(CFLAGS for External libraries: ${EXTERN_CFLAGS})
AC_MSG_NOTICE(LDFLAGS for External libraries: ${EXTERN_LDFLAGS})
##################################################
# Uncomment this to keep a copy of autoconf defines at this point, for
# debugging purposes.
# cp confdefs.h my_config.h

View File

@ -13,3 +13,7 @@ endif
noinst_HEADERS = nc_logging.h nc_tests.h
.PHONY: visualstudio
visualstudio:
sh ${top_srcdir}/visualbuild add ${abs_srcdir} "${include_HEADERS} ${noinst_HEADERS}"

View File

@ -324,18 +324,6 @@ AC_SEARCH_LIBS([floor], [m])
AC_MSG_NOTICE([generating header files and makefiles])
##################################################
# Include dispatch stuff from netcdf/configure.ac
AC_MSG_CHECKING([if API dispatch is enabled])
AC_ARG_ENABLE([dispatch],
[AS_HELP_STRING([--enable-dispatch],
[enable experimental dispatch support])])
test "x$enable_dispatch" = xno || enable_dispatch=yes
AC_MSG_RESULT($enable_dispatch)
if test "x$enable_dispatch" = xyes ; then
AC_DEFINE([USE_DISPATCH], [1], [if true, include experimental API dispatch code])
fi
AM_CONDITIONAL(USE_DISPATCH, [test x$enable_dispatch = xyes])
# The following flags are defined
# Define the -L flags and libs for external libraries

View File

@ -36,6 +36,7 @@ noinst_LTLIBRARIES += libnetcdf2.la
libnetcdf2_la_SOURCES = v2i.c
endif # BUILD_V2
.PHONY: visualstudio
visualstudio:
sh ${abs_top_srcdir}/visualbuild add ${abs_srcdir} "${libdispatch_la_SOURCES}"

View File

@ -50,4 +50,7 @@ endif #BUILD_F77
# We need at least one source file
libnetcdf_la_SOURCES = stub.c
.PHONY: visualstudio
visualstudio:
sh ${abs_top_srcdir}/visualbuild add ${abs_srcdir} "${libnetcdf_la_SOURCES}"

View File

@ -31,7 +31,7 @@ GFLAGS=-g3 -O0
#############################################
LIBS=${NCLIB} ${CURLLIB} ${ZLIB} ${OTHERLIBS} ${HDF5}
INCL=-I. -I.. ${OCINCL} ${NCINCL} ${CURLINCL}
INCL=-I. -I.. -I../include ${OCINCL} ${NCINCL} ${CURLINCL}
TESTLIBS=${LIBS}
TESTINCL=${INCL}

View File

@ -99,11 +99,11 @@ endif # BUILD_DAP
# Otherwise never invoked, but records how to do it.
# BTW: note that renaming is essential because otherwise
# autoconf will forcibly delete files of the name *.tab.*
#cetab.c cetab.h: ${top_srcdir}/oc/ce.y
# bison -d -t -p ce ${top_srcdir}/oc/ce.y
# rm -f cetab.c cetab.h
# mv ce.tab.c cetab.c
# mv ce.tab.h cetab.h
makece::
bison -d -t -p ce ce.y
rm -f cetab.c cetab.h
mv ce.tab.c cetab.c
mv ce.tab.h cetab.h
# One last thing
BUILT_SOURCES = .dodsrc

View File

@ -28,10 +28,14 @@ constraints:
;
/* %type NClist<NCprojection*> */
projections: projectionlist {$$=$1;}
projections:
projectionlist {$$=$1;}
;
/* %type NClist<NCselection*> */
selections: selectionlist {$$=$1;}
selections:
selectionlist {$$=$1;}
;
/* %type NClist<NCprojection*> */
projectionlist:

View File

@ -75,7 +75,7 @@
/* Copy the first part of user declarations. */
/* Line 189 of yacc.c */
#line 11 "../oc/ce.y"
#line 11 "ce.y"
#include "ceparselex.h"
/* Line 189 of yacc.c */
@ -427,12 +427,12 @@ static const yytype_int8 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] =
{
0, 24, 24, 25, 26, 31, 34, 38, 40, 46,
52, 54, 60, 62, 68, 70, 76, 81, 83, 85,
89, 93, 95, 101, 103, 105, 110, 115, 117, 122,
124, 129, 131, 136, 138, 143, 145, 147, 153, 154,
155, 156, 157, 158, 159, 164, 166, 170, 174, 183,
187, 191
0, 24, 24, 25, 26, 32, 37, 42, 44, 50,
56, 58, 64, 66, 72, 74, 80, 85, 87, 89,
93, 97, 99, 105, 107, 109, 114, 119, 121, 126,
128, 133, 135, 140, 142, 147, 149, 151, 157, 158,
159, 160, 161, 162, 163, 168, 170, 174, 178, 187,
191, 195
};
#endif
@ -1403,322 +1403,322 @@ yyreduce:
case 2:
/* Line 1464 of yacc.c */
#line 24 "../oc/ce.y"
#line 24 "ce.y"
{projections(parsestate,(yyvsp[(1) - (1)]));;}
break;
case 3:
/* Line 1464 of yacc.c */
#line 25 "../oc/ce.y"
#line 25 "ce.y"
{selections(parsestate,(yyvsp[(1) - (1)]));;}
break;
case 4:
/* Line 1464 of yacc.c */
#line 27 "../oc/ce.y"
#line 27 "ce.y"
{projections(parsestate,(yyvsp[(1) - (2)])); selections(parsestate,(yyvsp[(2) - (2)]));;}
break;
case 5:
/* Line 1464 of yacc.c */
#line 31 "../oc/ce.y"
#line 32 "ce.y"
{(yyval)=(yyvsp[(1) - (1)]);;}
break;
case 6:
/* Line 1464 of yacc.c */
#line 34 "../oc/ce.y"
#line 37 "ce.y"
{(yyval)=(yyvsp[(1) - (1)]);;}
break;
case 7:
/* Line 1464 of yacc.c */
#line 39 "../oc/ce.y"
#line 43 "ce.y"
{(yyval)=projectionlist(parsestate,null,(yyvsp[(1) - (1)]));;}
break;
case 8:
/* Line 1464 of yacc.c */
#line 41 "../oc/ce.y"
#line 45 "ce.y"
{(yyval)=projectionlist(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;}
break;
case 9:
/* Line 1464 of yacc.c */
#line 47 "../oc/ce.y"
#line 51 "ce.y"
{(yyval)=projection(parsestate,(yyvsp[(1) - (1)]));;}
break;
case 10:
/* Line 1464 of yacc.c */
#line 53 "../oc/ce.y"
#line 57 "ce.y"
{(yyval)=segmentlist(parsestate,null,(yyvsp[(1) - (1)]));;}
break;
case 11:
/* Line 1464 of yacc.c */
#line 55 "../oc/ce.y"
#line 59 "ce.y"
{(yyval)=segmentlist(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;}
break;
case 12:
/* Line 1464 of yacc.c */
#line 61 "../oc/ce.y"
#line 65 "ce.y"
{(yyval)=segment(parsestate,(yyvsp[(1) - (1)]),null);;}
break;
case 13:
/* Line 1464 of yacc.c */
#line 63 "../oc/ce.y"
#line 67 "ce.y"
{(yyval)=segment(parsestate,(yyvsp[(1) - (2)]),(yyvsp[(2) - (2)]));;}
break;
case 14:
/* Line 1464 of yacc.c */
#line 69 "../oc/ce.y"
#line 73 "ce.y"
{(yyval)=array_indices(parsestate,null,(yyvsp[(1) - (1)]));;}
break;
case 15:
/* Line 1464 of yacc.c */
#line 71 "../oc/ce.y"
#line 75 "ce.y"
{(yyval)=array_indices(parsestate,(yyvsp[(1) - (2)]),(yyvsp[(2) - (2)]));;}
break;
case 16:
/* Line 1464 of yacc.c */
#line 76 "../oc/ce.y"
#line 80 "ce.y"
{(yyval)=(yyvsp[(1) - (1)]);;}
break;
case 17:
/* Line 1464 of yacc.c */
#line 82 "../oc/ce.y"
#line 86 "ce.y"
{(yyval)=range(parsestate,(yyvsp[(1) - (1)]),null,null);;}
break;
case 18:
/* Line 1464 of yacc.c */
#line 84 "../oc/ce.y"
#line 88 "ce.y"
{(yyval)=range(parsestate,(yyvsp[(2) - (5)]),null,(yyvsp[(4) - (5)]));;}
break;
case 19:
/* Line 1464 of yacc.c */
#line 86 "../oc/ce.y"
#line 90 "ce.y"
{(yyval)=range(parsestate,(yyvsp[(2) - (7)]),(yyvsp[(4) - (7)]),(yyvsp[(6) - (7)]));;}
break;
case 20:
/* Line 1464 of yacc.c */
#line 89 "../oc/ce.y"
#line 93 "ce.y"
{(yyval)=(yyvsp[(2) - (3)]);;}
break;
case 21:
/* Line 1464 of yacc.c */
#line 94 "../oc/ce.y"
#line 98 "ce.y"
{(yyval)=selectionlist(parsestate,null,(yyvsp[(2) - (2)]));;}
break;
case 22:
/* Line 1464 of yacc.c */
#line 96 "../oc/ce.y"
#line 100 "ce.y"
{(yyval)=selectionlist(parsestate,(yyvsp[(1) - (2)]),(yyvsp[(2) - (2)]));;}
break;
case 23:
/* Line 1464 of yacc.c */
#line 102 "../oc/ce.y"
#line 106 "ce.y"
{(yyval)=sel_clause(parsestate,1,(yyvsp[(1) - (5)]),(yyvsp[(2) - (5)]),(yyvsp[(4) - (5)]));;}
break;
case 24:
/* Line 1464 of yacc.c */
#line 104 "../oc/ce.y"
#line 108 "ce.y"
{(yyval)=sel_clause(parsestate,2,(yyvsp[(1) - (3)]),(yyvsp[(2) - (3)]),(yyvsp[(3) - (3)]));;}
break;
case 26:
/* Line 1464 of yacc.c */
#line 111 "../oc/ce.y"
#line 115 "ce.y"
{(yyval)=(yyvsp[(1) - (1)]);;}
break;
case 27:
/* Line 1464 of yacc.c */
#line 116 "../oc/ce.y"
#line 120 "ce.y"
{(yyvsp[(1) - (1)])=selectionpath(parsestate,null,(yyvsp[(1) - (1)]));;}
break;
case 28:
/* Line 1464 of yacc.c */
#line 118 "../oc/ce.y"
#line 122 "ce.y"
{(yyval)=selectionpath(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;}
break;
case 29:
/* Line 1464 of yacc.c */
#line 123 "../oc/ce.y"
#line 127 "ce.y"
{(yyval)=function(parsestate,(yyvsp[(1) - (3)]),null);;}
break;
case 30:
/* Line 1464 of yacc.c */
#line 125 "../oc/ce.y"
#line 129 "ce.y"
{(yyval)=function(parsestate,(yyvsp[(1) - (4)]),(yyvsp[(3) - (4)]));;}
break;
case 31:
/* Line 1464 of yacc.c */
#line 130 "../oc/ce.y"
#line 134 "ce.y"
{(yyval)=arg_list(parsestate,null,(yyvsp[(1) - (1)]));;}
break;
case 32:
/* Line 1464 of yacc.c */
#line 132 "../oc/ce.y"
#line 136 "ce.y"
{(yyval)=arg_list(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;}
break;
case 33:
/* Line 1464 of yacc.c */
#line 137 "../oc/ce.y"
#line 141 "ce.y"
{(yyval)=value_list(parsestate,null,(yyvsp[(1) - (1)]));;}
break;
case 34:
/* Line 1464 of yacc.c */
#line 139 "../oc/ce.y"
#line 143 "ce.y"
{(yyval)=value_list(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;}
break;
case 35:
/* Line 1464 of yacc.c */
#line 144 "../oc/ce.y"
#line 148 "ce.y"
{(yyval)=value(parsestate,(yyvsp[(1) - (1)]),SCAN_WORD);;}
break;
case 36:
/* Line 1464 of yacc.c */
#line 146 "../oc/ce.y"
#line 150 "ce.y"
{(yyval)=value(parsestate,(yyvsp[(1) - (1)]),SCAN_NUMBERCONST);;}
break;
case 37:
/* Line 1464 of yacc.c */
#line 148 "../oc/ce.y"
#line 152 "ce.y"
{(yyval)=value(parsestate,(yyvsp[(1) - (1)]),SCAN_STRINGCONST);;}
break;
case 38:
/* Line 1464 of yacc.c */
#line 153 "../oc/ce.y"
#line 157 "ce.y"
{(yyval)=(Object)ST_EQ;;}
break;
case 39:
/* Line 1464 of yacc.c */
#line 154 "../oc/ce.y"
#line 158 "ce.y"
{(yyval)=(Object)ST_GT;;}
break;
case 40:
/* Line 1464 of yacc.c */
#line 155 "../oc/ce.y"
#line 159 "ce.y"
{(yyval)=(Object)ST_LT;;}
break;
case 41:
/* Line 1464 of yacc.c */
#line 156 "../oc/ce.y"
#line 160 "ce.y"
{(yyval)=(Object)ST_NEQ;;}
break;
case 42:
/* Line 1464 of yacc.c */
#line 157 "../oc/ce.y"
#line 161 "ce.y"
{(yyval)=(Object)ST_RE;;}
break;
case 43:
/* Line 1464 of yacc.c */
#line 158 "../oc/ce.y"
#line 162 "ce.y"
{(yyval)=(Object)ST_GE;;}
break;
case 44:
/* Line 1464 of yacc.c */
#line 159 "../oc/ce.y"
#line 163 "ce.y"
{(yyval)=(Object)ST_LE;;}
break;
case 45:
/* Line 1464 of yacc.c */
#line 165 "../oc/ce.y"
#line 169 "ce.y"
{(yyval)=arrayelement(parsestate,(yyvsp[(1) - (1)]),null);;}
break;
case 46:
/* Line 1464 of yacc.c */
#line 167 "../oc/ce.y"
#line 171 "ce.y"
{(yyval)=arrayelement(parsestate,(yyvsp[(1) - (2)]),(yyvsp[(2) - (2)]));;}
break;
case 47:
/* Line 1464 of yacc.c */
#line 171 "../oc/ce.y"
#line 175 "ce.y"
{(yyval) = (yyvsp[(1) - (1)]);;}
break;
case 48:
/* Line 1464 of yacc.c */
#line 175 "../oc/ce.y"
#line 179 "ce.y"
{ unsigned long tmp = 0;
if(sscanf((char*)(yyvsp[(1) - (1)]),"%lu",&tmp) != 1) {
yyerror(parsestate,"Index is not an integer");
@ -1730,21 +1730,21 @@ yyreduce:
case 49:
/* Line 1464 of yacc.c */
#line 184 "../oc/ce.y"
#line 188 "ce.y"
{(yyval) = (yyvsp[(1) - (1)]);;}
break;
case 50:
/* Line 1464 of yacc.c */
#line 188 "../oc/ce.y"
#line 192 "ce.y"
{(yyval) = (yyvsp[(1) - (1)]);;}
break;
case 51:
/* Line 1464 of yacc.c */
#line 192 "../oc/ce.y"
#line 196 "ce.y"
{(yyval) = (yyvsp[(1) - (1)]);;}
break;
@ -1963,6 +1963,6 @@ yyreturn:
/* Line 1684 of yacc.c */
#line 195 "../oc/ce.y"
#line 199 "ce.y"

View File

@ -62,4 +62,6 @@ EXTRA_DIST = attr.c ncx.c putget.c $(man_MANS) stub3.c
.m4.c:
m4 $(AM_M4FLAGS) $(M4FLAGS) $< >$@
.PHONY: visualstudio
visualstudio:
sh ${abs_top_srcdir}/visualbuild add ${abs_srcdir} "${libnetcdf3_la_SOURCES}"

View File

@ -12,9 +12,6 @@
#include <stdlib.h>
#include "netcdf.h"
#ifndef USE_DISPATCH
#include "rename.h"
#endif
#ifdef HAVE_STRERROR
#include <string.h> /* contains prototype for ansi libc function strerror() */

View File

@ -5,9 +5,6 @@
/* $Id: libvers.c,v 2.17 2010/05/26 21:43:33 dmh Exp $ */
#include <config.h>
#ifndef USE_DISPATCH
#include "rename.h"
#endif
/*
* A version string. This whole function is not needed in netCDF-4,

View File

@ -6,9 +6,6 @@
#include "config.h"
#include "nc.h"
#ifndef USE_DISPATCH
#include "rename.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@ -6,9 +6,6 @@
#include "config.h"
#include "nc.h"
#ifndef USE_DISPATCH
#include "rename.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

View File

@ -480,8 +480,7 @@ NC4_inq_att(int ncid, int varid, const char *name, nc_type *xtypep, size_t *lenp
#endif /* USE_PNETCDF */
/* Handle netcdf-3 files. */
if (!nc->nc4_info)
return nc3_inq_att(nc->int_ncid, varid, name, xtypep, lenp);
assert(nc->nc4_info);
/* Handle netcdf-4 files. */
return nc4_get_att(ncid, nc, varid, name, xtypep, NC_UBYTE, lenp, NULL, 0, NULL);
@ -506,8 +505,7 @@ NC4_inq_attid(int ncid, int varid, const char *name, int *attnump)
#endif /* USE_PNETCDF */
/* Handle netcdf-3 files. */
if (!nc->nc4_info)
return nc3_inq_attid(nc->int_ncid, varid, name, attnump);
assert(nc->nc4_info);
/* Handle netcdf-4 files. */
return nc4_get_att(ncid, nc, varid, name, NULL, NC_UBYTE,
@ -537,8 +535,7 @@ NC4_inq_attname(int ncid, int varid, int attnum, char *name)
#endif /* USE_PNETCDF */
/* Handle netcdf-3 files. */
if (!nc->nc4_info)
return nc3_inq_attname(nc->int_ncid, varid, attnum, name);
assert(nc->nc4_info);
/* Handle netcdf-4 files. */
if ((retval = nc4_find_nc_att(ncid, varid, NULL, attnum, &att)))
@ -587,8 +584,7 @@ NC4_rename_att(int ncid, int varid, const char *name,
#endif /* USE_PNETCDF */
/* Handle netcdf-3 files. */
if (!h5)
return nc3_rename_att(nc->int_ncid, varid, name, newname);
assert(h5);
/* If the file is read-only, return an error. */
if (h5->no_write)
@ -694,8 +690,7 @@ NC4_del_att(int ncid, int varid, const char *name)
#endif /* USE_PNETCDF */
/* Handle netcdf-3 files. */
if (!h5)
return nc3_del_att(nc->int_ncid, varid, name);
assert(h5);
assert(h5 && grp);
@ -825,41 +820,7 @@ nc4_put_att_tc(int ncid, int varid, const char *name, nc_type file_type,
#endif /* USE_PNETCDF */
/* Handle netcdf-3 files. */
if (!nc->nc4_info)
{
if (mem_type == NC_UBYTE)
mem_type = NC_BYTE;
switch(mem_type)
{
case NC_NAT:
return nc3_put_att(nc->int_ncid, varid, name, file_type,
len, op);
case NC_BYTE:
return nc3_put_att_schar(nc->int_ncid, varid, name,
file_type, len, op);
case NC_CHAR:
return nc3_put_att_text(nc->int_ncid, varid, name,
len, op);
case NC_SHORT:
return nc3_put_att_short(nc->int_ncid, varid, name,
file_type, len, op);
case NC_INT:
if (mem_type_is_long)
return nc3_put_att_long(nc->int_ncid, varid, name,
file_type, len, op);
else
return nc3_put_att_int(nc->int_ncid, varid, name,
file_type, len, op);
case NC_FLOAT:
return nc3_put_att_float(nc->int_ncid, varid, name,
file_type, len, op);
case NC_DOUBLE:
return nc3_put_att_double(nc->int_ncid, varid, name,
file_type, len, op);
default:
return NC_EBADTYPE;
}
}
assert(nc->nc4_info);
/* Otherwise, handle things the netcdf-4 way. */
return nc4_put_att(ncid, nc, varid, name, file_type, mem_type, len,
@ -912,35 +873,7 @@ nc4_get_att_tc(int ncid, int varid, const char *name, nc_type mem_type,
#endif /* USE_PNETCDF */
/* Handle netcdf-3 files. */
if (!nc->nc4_info)
{
/* NetCDF-3 doesn't know UBYTE from a hole in the ground. It
* only knows about BYTE. */
if (mem_type == NC_UBYTE)
mem_type = NC_BYTE;
switch(mem_type)
{
case NC_NAT:
return nc3_get_att(nc->int_ncid, varid, name, ip);
case NC_BYTE:
return nc3_get_att_schar(nc->int_ncid, varid, name, ip);
case NC_CHAR:
return nc3_get_att_text(nc->int_ncid, varid, name, ip);
case NC_SHORT:
return nc3_get_att_short(nc->int_ncid, varid, name, ip);
case NC_INT:
if (mem_type_is_long)
return nc3_get_att_long(nc->int_ncid, varid, name, ip);
else
return nc3_get_att_int(nc->int_ncid, varid, name, ip);
case NC_FLOAT:
return nc3_get_att_float(nc->int_ncid, varid, name, ip);
case NC_DOUBLE:
return nc3_get_att_double(nc->int_ncid, varid, name, ip);
default:
return NC_EBADTYPE;
}
}
assert(nc->nc4_info);
return nc4_get_att(ncid, nc, varid, name, NULL, mem_type,
NULL, NULL, mem_type_is_long, ip);

View File

@ -42,8 +42,7 @@ NC4_inq_unlimdim(int ncid, int *unlimdimidp)
#endif /* USE_PNETCDF */
/* Take care of netcdf-3 files. */
if (!h5)
return nc3_inq_unlimdim(nc->int_ncid, unlimdimidp);
assert(h5);
/* According to netcdf-3 manual, return -1 if there is no unlimited
dimension. */
@ -90,8 +89,7 @@ NC4_def_dim(int ncid, const char *name, size_t len, int *idp)
#endif /* USE_PNETCDF */
/* Take care of netcdf-3 files. */
if (!h5)
return nc3_def_dim(nc->int_ncid, name, len, idp);
assert(h5);
assert(h5 && nc && grp);
@ -180,8 +178,7 @@ NC4_inq_dimid(int ncid, const char *name, int *idp)
#endif /* USE_PNETCDF */
/* Handle netcdf-3 files. */
if (!h5)
return nc3_inq_dimid(nc->int_ncid, name, idp);
assert(h5);
assert(nc && grp);
@ -234,8 +231,7 @@ NC4_inq_dim(int ncid, int dimid, char *name, size_t *lenp)
#endif /* USE_PNETCDF */
/* Take care of netcdf-3 files. */
if (!h5)
return nc3_inq_dim(nc->int_ncid, dimid, name, lenp);
assert(h5);
assert(nc && grp);
@ -305,8 +301,7 @@ NC4_rename_dim(int ncid, int dimid, const char *name)
#endif /* USE_PNETCDF */
/* Handle netcdf-3 cases. */
if (!h5)
return nc3_rename_dim(nc->int_ncid, dimid, name);
assert(h5);
assert(h5 && grp);
/* Trying to write to a read-only file? No way, Jose! */
@ -385,18 +380,7 @@ NC4_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp)
return retval;
/* Get our dim info. */
if (!h5) /* netcdf-3 file */
{
if ((retval = nc3_inq_unlimdim(nc->int_ncid, &unlimid)))
return retval;
if (unlimid != -1)
{
num_unlim = 1;
if (unlimdimidsp)
unlimdimidsp[0] = unlimid;
}
}
else /* netcdf-4 file */
assert(h5);
{
for (dim=grp->dim; dim; dim=dim->next)
{

View File

@ -390,8 +390,7 @@ NC4_create(const char* path, int cmode, size_t initialsz, int basepe,
#endif /* USE_PNETCDF */
else
{
res = nc3__create_mp(path, cmode, initialsz, basepe,
chunksizehintp, &(nc_file->int_ncid));
assert(0);
}
/* Delete this file list entry if there was a failure. */
@ -2335,8 +2334,7 @@ NC4_open(const char *path, int mode, int basepe, size_t *chunksizehintp,
#endif /* USE_PNETCDF */
else /* netcdf */
{
res = nc3__open_mp(path, mode, basepe, chunksizehintp,
&(nc_file->int_ncid));
assert(0);
}
/* If it succeeds, pass back the new ncid. Otherwise, remove this
@ -2369,8 +2367,7 @@ NC4_set_fill(int ncid, int fillmode, int *old_modep)
return NC_EBADID;
/* Is this a netcdf-3 file? */
if (!nc->nc4_info)
return nc3_set_fill(nc->int_ncid, fillmode, old_modep);
assert(nc->nc4_info);
/* Trying to set fill on a read-only file? You sicken me! */
if (nc->nc4_info->no_write)
@ -2409,8 +2406,7 @@ NC4_redef(int ncid)
#endif /* USE_PNETCDF */
/* Handle netcdf-3 files. */
if (!nc->nc4_info)
return nc3_redef(nc->int_ncid);
assert(nc->nc4_info);
/* If we're already in define mode, return an error. */
if (nc->nc4_info->flags & NC_INDEF)
@ -2442,10 +2438,8 @@ NC4__enddef(int ncid, size_t h_minfree, size_t v_align,
return NC_EBADID;
/* Deal with netcdf-3 files one way, netcdf-4 another way. */
if (!nc->nc4_info)
return nc3__enddef(nc->int_ncid, h_minfree, v_align, v_minfree, r_align);
else
return NC4_enddef(ncid);
assert(nc->nc4_info);
return NC4_enddef(ncid);
}
/* Take the file out of define mode. This is called automatically for
@ -2465,8 +2459,7 @@ static int NC4_enddef(int ncid)
#endif /* USE_PNETCDF */
/* Take care of netcdf-3 files. */
if (!nc->nc4_info)
return nc3_enddef(nc->int_ncid);
assert(nc->nc4_info);
return nc4_enddef_netcdf4_file(nc->nc4_info);
}
@ -2539,8 +2532,7 @@ NC4_sync(int ncid)
#endif /* USE_PNETCDF */
/* Take care of netcdf-3 files. */
if (!nc->nc4_info)
return nc3_sync(nc->int_ncid);
assert(nc->nc4_info);
/* If we're in define mode, we can't sync. */
if (nc->nc4_info && nc->nc4_info->flags & NC_INDEF)
@ -2643,8 +2635,7 @@ NC4_abort(int ncid)
#endif /* USE_PNETCDF */
/* If this is a netcdf-3 file, let the netcdf-3 library handle it. */
if (!nc->nc4_info)
return nc3_abort(nc->int_ncid);
assert(nc->nc4_info);
/* If we're in define mode, but not redefing the file, delete it. */
if (nc->nc4_info->flags & NC_INDEF && !nc->nc4_info->redef)
@ -2690,12 +2681,7 @@ NC4_close(int ncid)
#endif /* USE_PNETCDF */
/* Call either the nc4 or nc3 close. */
if (!h5)
{
if ((retval = nc3_close(nc->int_ncid)))
return retval;
}
else
assert(h5);
{
nc = grp->file;
assert(nc);
@ -2748,8 +2734,7 @@ NC4_inq(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp)
#endif /* USE_PNETCDF */
/* Take care of netcdf-3 files. */
if (!h5)
return nc3_inq(nc->int_ncid, ndimsp, nvarsp, nattsp, unlimdimidp);
assert(h5);
/* Count the number of dims, vars, and global atts. */
assert(h5 && grp && nc);

View File

@ -15,9 +15,6 @@
#include "config.h"
#include "nc4internal.h"
#ifndef USE_DISPATCH
#include "rename4.h"
#endif
#include <H5DSpublic.h>
#include <math.h>

View File

@ -17,9 +17,6 @@ $Id: nc4internal.c,v 1.121 2010/05/26 21:43:35 dmh Exp $
#include "config.h"
#include "nc4internal.h"
#ifndef USE_DISPATCH
#include "rename4.h"
#endif
#include "nc.h" /* from libsrc */
#include <utf8proc.h>

View File

@ -1021,8 +1021,7 @@ NC4_inq_varid(int ncid, const char *name, int *varidp)
return retval;
/* Handle netcdf-3. */
if (!h5)
return nc3_inq_varid(nc->int_ncid, name, varidp);
assert(h5);
/* Normalize name. */
if ((retval = nc4_normalize_name(name, norm_name)))
@ -1066,8 +1065,7 @@ NC4_rename_var(int ncid, int varid, const char *name)
#endif /* USE_PNETCDF */
/* Take care of netcdf-3 files. */
if (!h5)
return nc3_rename_var(nc->int_ncid, varid, name);
assert(h5);
/* Is the new name too long? */
if (strlen(name) > NC_MAX_NAME)
@ -1376,33 +1374,7 @@ nc4_get_vara_tc(int ncid, int varid, nc_type mem_type, int mem_type_is_long,
#endif /* USE_PNETCDF */
/* Handle netCDF-3 cases. */
if (!nc->nc4_info)
{
switch(mem_type)
{
case NC_NAT:
return nc3_get_vara(nc->int_ncid, varid, startp, countp, ip);
case NC_BYTE:
return nc3_get_vara_schar(nc->int_ncid, varid, startp, countp, ip);
case NC_UBYTE:
return nc3_get_vara_uchar(nc->int_ncid, varid, startp, countp, ip);
case NC_CHAR:
return nc3_get_vara_text(nc->int_ncid, varid, startp, countp, ip);
case NC_SHORT:
return nc3_get_vara_short(nc->int_ncid, varid, startp, countp, ip);
case NC_INT:
if (mem_type_is_long)
return nc3_get_vara_long(nc->int_ncid, varid, startp, countp, ip);
else
return nc3_get_vara_int(nc->int_ncid, varid, startp, countp, ip);
case NC_FLOAT:
return nc3_get_vara_float(nc->int_ncid, varid, startp, countp, ip);
case NC_DOUBLE:
return nc3_get_vara_double(nc->int_ncid, varid, startp, countp, ip);
default:
return NC_EBADTYPE;
}
}
assert(nc->nc4_info);
/* Handle HDF4 cases. */
if (nc->nc4_info->hdf4)

View File

@ -51,13 +51,13 @@ main(int argc, char **argv)
if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
if (nc_close(ncid)) ERR;
#ifndef USE_DISPATCH
#ifdef FIX
/* Make sure bad mode causes failure in nc_open. */
if (nc_open(FILE_NAME, NC_CLASSIC_MODEL, &ncid) != NC_EINVAL) ERR;
#endif
if (nc_open(FILE_NAME, NC_MPIIO|NC_MPIPOSIX, &ncid) != NC_EINVAL) ERR;
#ifndef USE_DISPATCH
#ifdef FIX
/* Make sure bad mode causes failure for nc_create. */
if (nc_create(FILE_NAME, NC_WRITE, &ncid) != NC_EINVAL) ERR;
#endif

View File

@ -5995,12 +5995,10 @@ Assuming that the in-memory library does not require any
external libraries, then the Makefile.am will look something
like this.
@example
if USE_DISPATCH
NCM_SOURCES = ncmdispatch.c ncmdispatch.h ...
AM_CPPFLAGS += -I$(top_srcdir)/libsrc -I$(top_srcdir)/libdispatch
libnetcdfm_la_SOURCES = $(NCM_SOURCES)
noinst_LTLIBRARIES = libnetcdfm.la
endif #USE_DISPATCH
@end example
@unnumberedsec Step 6.
@ -6205,14 +6203,6 @@ create a number of stub definitions so that the library will
compile and load with the test cases. The file
libsrc/stub3.c shows a typical stub file.
@item
In order avoid adding massive numbers of #ifdef
USE_DISPATCH conditionals, I have duplicated certain files
in libsrc, libsrc4, libncdap3 and libncdap4. The files for
use with dispatch are prefixed with "d_". Thus for
libsrc4/nc4file.c, there is a corresponding
libsrc4/d_nc4file.c If you make changes to one file, you
should see if they need to also be made to the other file.
@end enumerate
@node Combined Index, , Internal Dispatch Table, Top