mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-02-17 16:50:18 +08:00
Turned search back on in developer documentation. Applied part of fix for [NCF-340] in putget.m4
This commit is contained in:
parent
219a873f8d
commit
7aa22d275b
@ -1508,7 +1508,7 @@ MATHJAX_CODEFILE =
|
|||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||||
|
|
||||||
SEARCHENGINE = NO
|
SEARCHENGINE = YES
|
||||||
|
|
||||||
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
|
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
|
||||||
# implemented using a web server instead of a web client using Javascript. There
|
# implemented using a web server instead of a web client using Javascript. There
|
||||||
|
@ -55,10 +55,10 @@ void
|
|||||||
arrayp(const char *label, size_t count, const size_t *array)
|
arrayp(const char *label, size_t count, const size_t *array)
|
||||||
{
|
{
|
||||||
(void) fprintf(stderr, "%s", label);
|
(void) fprintf(stderr, "%s", label);
|
||||||
(void) fputc('\t',stderr);
|
(void) fputc('\t',stderr);
|
||||||
for(; count > 0; count--, array++)
|
for(; count > 0; count--, array++)
|
||||||
(void) fprintf(stderr," %lu", (unsigned long)*array);
|
(void) fprintf(stderr," %lu", (unsigned long)*array);
|
||||||
(void) fputc('\n',stderr);
|
(void) fputc('\n',stderr);
|
||||||
}
|
}
|
||||||
#endif /* ODEBUG */
|
#endif /* ODEBUG */
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ arrayp(const char *label, size_t count, const size_t *array)
|
|||||||
/*
|
/*
|
||||||
* This is tunable parameter.
|
* This is tunable parameter.
|
||||||
* It essentially controls the tradeoff between the number of times
|
* It essentially controls the tradeoff between the number of times
|
||||||
* memcpy() gets called to copy the external data to fill
|
* memcpy() gets called to copy the external data to fill
|
||||||
* a large buffer vs the number of times its called to
|
* a large buffer vs the number of times its called to
|
||||||
* prepare the external data.
|
* prepare the external data.
|
||||||
*/
|
*/
|
||||||
@ -129,7 +129,7 @@ NCFILL(double, double, X_SIZEOF_DOUBLE, NC_FILL_DOUBLE)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fill the external space for variable 'varp' values at 'recno' with
|
* Fill the external space for variable 'varp' values at 'recno' with
|
||||||
* the appropriate value. If 'varp' is not a record variable, fill the
|
* the appropriate value. If 'varp' is not a record variable, fill the
|
||||||
* whole thing. For the special case when 'varp' is the only record
|
* whole thing. For the special case when 'varp' is the only record
|
||||||
@ -180,12 +180,12 @@ fill_NC_var(NC3_INFO* ncp, const NC_var *varp, size_t varsize, size_t recno)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* use the default */
|
/* use the default */
|
||||||
|
|
||||||
assert(xsz % X_ALIGN == 0);
|
assert(xsz % X_ALIGN == 0);
|
||||||
assert(xsz <= sizeof(xfillp));
|
assert(xsz <= sizeof(xfillp));
|
||||||
|
|
||||||
xp = xfillp;
|
xp = xfillp;
|
||||||
|
|
||||||
switch(varp->type){
|
switch(varp->type){
|
||||||
case NC_BYTE :
|
case NC_BYTE :
|
||||||
status = NC_fill_schar(&xp, nelems);
|
status = NC_fill_schar(&xp, nelems);
|
||||||
@ -202,7 +202,7 @@ fill_NC_var(NC3_INFO* ncp, const NC_var *varp, size_t varsize, size_t recno)
|
|||||||
case NC_FLOAT :
|
case NC_FLOAT :
|
||||||
status = NC_fill_float(&xp, nelems);
|
status = NC_fill_float(&xp, nelems);
|
||||||
break;
|
break;
|
||||||
case NC_DOUBLE :
|
case NC_DOUBLE :
|
||||||
status = NC_fill_double(&xp, nelems);
|
status = NC_fill_double(&xp, nelems);
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
@ -212,7 +212,7 @@ fill_NC_var(NC3_INFO* ncp, const NC_var *varp, size_t varsize, size_t recno)
|
|||||||
}
|
}
|
||||||
if(status != NC_NOERR)
|
if(status != NC_NOERR)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
assert(xp == xfillp + xsz);
|
assert(xp == xfillp + xsz);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,7 +239,7 @@ fill_NC_var(NC3_INFO* ncp, const NC_var *varp, size_t varsize, size_t recno)
|
|||||||
size_t ii;
|
size_t ii;
|
||||||
|
|
||||||
status = ncio_get(ncp->nciop, offset, chunksz,
|
status = ncio_get(ncp->nciop, offset, chunksz,
|
||||||
RGN_WRITE, &xp);
|
RGN_WRITE, &xp);
|
||||||
if(status != NC_NOERR)
|
if(status != NC_NOERR)
|
||||||
{
|
{
|
||||||
return status;
|
return status;
|
||||||
@ -339,7 +339,7 @@ NCtouchlast(NC3_INFO* ncp, const NC_var *const *varpp, size_t recno)
|
|||||||
{
|
{
|
||||||
int status = NC_NOERR;
|
int status = NC_NOERR;
|
||||||
const NC_var *varp = NULL;
|
const NC_var *varp = NULL;
|
||||||
|
|
||||||
{
|
{
|
||||||
size_t ii = 0;
|
size_t ii = 0;
|
||||||
for(; ii < ncp->vars.nelems; ii++, varpp++)
|
for(; ii < ncp->vars.nelems; ii++, varpp++)
|
||||||
@ -361,7 +361,7 @@ NCtouchlast(NC3_INFO* ncp, const NC_var *const *varpp, size_t recno)
|
|||||||
|
|
||||||
|
|
||||||
status = ncio_get(ncp->nciop, offset, varp->xsz,
|
status = ncio_get(ncp->nciop, offset, varp->xsz,
|
||||||
RGN_WRITE, &xp);
|
RGN_WRITE, &xp);
|
||||||
if(status != NC_NOERR)
|
if(status != NC_NOERR)
|
||||||
return status;
|
return status;
|
||||||
(void)memset(xp, 0, varp->xsz);
|
(void)memset(xp, 0, varp->xsz);
|
||||||
@ -401,7 +401,7 @@ NCvnrecs(NC3_INFO* ncp, size_t numrecs)
|
|||||||
#endif
|
#endif
|
||||||
/* work-around for non-unique tickets */
|
/* work-around for non-unique tickets */
|
||||||
if (nowserving > myticket && nowserving < myticket + numpe ) {
|
if (nowserving > myticket && nowserving < myticket + numpe ) {
|
||||||
/* get a new ticket ... you've been bypassed */
|
/* get a new ticket ... you've been bypassed */
|
||||||
/* and handle the unlikely wrap-around effect */
|
/* and handle the unlikely wrap-around effect */
|
||||||
myticket = shmem_short_finc(
|
myticket = shmem_short_finc(
|
||||||
(shmem_t *) ncp->lock + LOCKNUMREC_LOCK,
|
(shmem_t *) ncp->lock + LOCKNUMREC_LOCK,
|
||||||
@ -436,9 +436,9 @@ NCvnrecs(NC3_INFO* ncp, size_t numrecs)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Treat two cases differently:
|
/* Treat two cases differently:
|
||||||
- exactly one record variable (no padding)
|
- exactly one record variable (no padding)
|
||||||
- multiple record variables (each record padded
|
- multiple record variables (each record padded
|
||||||
to 4-byte alignment)
|
to 4-byte alignment)
|
||||||
*/
|
*/
|
||||||
NC_var **vpp = (NC_var **)ncp->vars.value;
|
NC_var **vpp = (NC_var **)ncp->vars.value;
|
||||||
@ -446,7 +446,7 @@ NCvnrecs(NC3_INFO* ncp, size_t numrecs)
|
|||||||
NC_var *recvarp = NULL; /* last record var */
|
NC_var *recvarp = NULL; /* last record var */
|
||||||
int numrecvars = 0;
|
int numrecvars = 0;
|
||||||
size_t cur_nrecs;
|
size_t cur_nrecs;
|
||||||
|
|
||||||
/* determine how many record variables */
|
/* determine how many record variables */
|
||||||
for( /*NADA*/; vpp < end; vpp++) {
|
for( /*NADA*/; vpp < end; vpp++) {
|
||||||
if(IS_RECVAR(*vpp)) {
|
if(IS_RECVAR(*vpp)) {
|
||||||
@ -454,7 +454,7 @@ NCvnrecs(NC3_INFO* ncp, size_t numrecs)
|
|||||||
numrecvars++;
|
numrecvars++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numrecvars != 1) { /* usual case */
|
if (numrecvars != 1) { /* usual case */
|
||||||
/* Fill each record out to numrecs */
|
/* Fill each record out to numrecs */
|
||||||
while((cur_nrecs = NC_get_numrecs(ncp)) < numrecs)
|
while((cur_nrecs = NC_get_numrecs(ncp)) < numrecs)
|
||||||
@ -485,7 +485,7 @@ NCvnrecs(NC3_INFO* ncp, size_t numrecs)
|
|||||||
}
|
}
|
||||||
if(status != NC_NOERR)
|
if(status != NC_NOERR)
|
||||||
goto common_return;
|
goto common_return;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -505,7 +505,7 @@ common_return:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check whether 'coord' values are valid for the variable.
|
* Check whether 'coord' values are valid for the variable.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
@ -543,7 +543,7 @@ NCcoordck(NC3_INFO* ncp, const NC_var *varp, const size_t *coord)
|
|||||||
ip = coord;
|
ip = coord;
|
||||||
up = varp->shape;
|
up = varp->shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CDEBUG
|
#ifdef CDEBUG
|
||||||
fprintf(stderr," NCcoordck: coord %ld, count %d, ip %ld\n",
|
fprintf(stderr," NCcoordck: coord %ld, count %d, ip %ld\n",
|
||||||
coord, varp->ndims, ip );
|
coord, varp->ndims, ip );
|
||||||
@ -566,7 +566,7 @@ fprintf(stderr," NCcoordck: ip %p, *ip %ld, up %p, *up %lu\n",
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check whether 'edges' are valid for the variable and 'start'
|
* Check whether 'edges' are valid for the variable and 'start'
|
||||||
*/
|
*/
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
@ -600,7 +600,7 @@ NCedgeck(const NC3_INFO* ncp, const NC_var *varp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Translate the (variable, coord) pair into a seek index
|
* Translate the (variable, coord) pair into a seek index
|
||||||
*/
|
*/
|
||||||
static off_t
|
static off_t
|
||||||
@ -624,7 +624,7 @@ NC_varoffset(const NC3_INFO* ncp, const NC_var *varp, const size_t *coord)
|
|||||||
off_t *up = varp->dsizes +1;
|
off_t *up = varp->dsizes +1;
|
||||||
const size_t *ip = coord;
|
const size_t *ip = coord;
|
||||||
const off_t *const end = varp->dsizes + varp->ndims;
|
const off_t *const end = varp->dsizes + varp->ndims;
|
||||||
|
|
||||||
if(IS_RECVAR(varp))
|
if(IS_RECVAR(varp))
|
||||||
up++, ip++;
|
up++, ip++;
|
||||||
|
|
||||||
@ -632,10 +632,10 @@ NC_varoffset(const NC3_INFO* ncp, const NC_var *varp, const size_t *coord)
|
|||||||
lcoord += (off_t)(*up) * (off_t)(*ip);
|
lcoord += (off_t)(*up) * (off_t)(*ip);
|
||||||
|
|
||||||
lcoord *= varp->xsz;
|
lcoord *= varp->xsz;
|
||||||
|
|
||||||
if(IS_RECVAR(varp))
|
if(IS_RECVAR(varp))
|
||||||
lcoord += (off_t)(*coord) * ncp->recsize;
|
lcoord += (off_t)(*coord) * ncp->recsize;
|
||||||
|
|
||||||
lcoord += varp->begin;
|
lcoord += varp->begin;
|
||||||
return lcoord;
|
return lcoord;
|
||||||
}
|
}
|
||||||
@ -672,10 +672,10 @@ putNCvx_$1_$2(NC3_INFO* ncp, const NC_var *varp,
|
|||||||
size_t nput = ncx_howmany(varp->type, extent);
|
size_t nput = ncx_howmany(varp->type, extent);
|
||||||
|
|
||||||
int lstatus = ncio_get(ncp->nciop, offset, extent,
|
int lstatus = ncio_get(ncp->nciop, offset, extent,
|
||||||
RGN_WRITE, &xp);
|
RGN_WRITE, &xp);
|
||||||
if(lstatus != NC_NOERR)
|
if(lstatus != NC_NOERR)
|
||||||
return lstatus;
|
return lstatus;
|
||||||
|
|
||||||
lstatus = ncx_putn_$1_$2(&xp, nput, value);
|
lstatus = ncx_putn_$1_$2(&xp, nput, value);
|
||||||
if(lstatus != NC_NOERR && status == NC_NOERR)
|
if(lstatus != NC_NOERR && status == NC_NOERR)
|
||||||
{
|
{
|
||||||
@ -684,7 +684,7 @@ putNCvx_$1_$2(NC3_INFO* ncp, const NC_var *varp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
(void) ncio_rel(ncp->nciop, offset,
|
(void) ncio_rel(ncp->nciop, offset,
|
||||||
RGN_MODIFIED);
|
RGN_MODIFIED);
|
||||||
|
|
||||||
remaining -= extent;
|
remaining -= extent;
|
||||||
if(remaining == 0)
|
if(remaining == 0)
|
||||||
@ -782,12 +782,12 @@ getNCvx_$1_$2(const NC3_INFO* ncp, const NC_var *varp,
|
|||||||
0, (void **)&xp); /* cast away const */
|
0, (void **)&xp); /* cast away const */
|
||||||
if(lstatus != NC_NOERR)
|
if(lstatus != NC_NOERR)
|
||||||
return lstatus;
|
return lstatus;
|
||||||
|
|
||||||
lstatus = ncx_getn_$1_$2(&xp, nget, value);
|
lstatus = ncx_getn_$1_$2(&xp, nget, value);
|
||||||
if(lstatus != NC_NOERR && status == NC_NOERR)
|
if(lstatus != NC_NOERR && status == NC_NOERR)
|
||||||
status = lstatus;
|
status = lstatus;
|
||||||
|
|
||||||
(void) ncio_rel(ncp->nciop, offset, 0);
|
(void) ncio_rel(ncp->nciop, offset, 0);
|
||||||
|
|
||||||
remaining -= extent;
|
remaining -= extent;
|
||||||
if(remaining == 0)
|
if(remaining == 0)
|
||||||
@ -921,7 +921,7 @@ NCiocount(const NC3_INFO* const ncp, const NC_var *const varp,
|
|||||||
* If there is only one dimension and and it is a "record dimension",
|
* If there is only one dimension and and it is a "record dimension",
|
||||||
* edp is &edges[1] (out of bounds) and we will return 0;
|
* edp is &edges[1] (out of bounds) and we will return 0;
|
||||||
*/
|
*/
|
||||||
assert(shp >= varp->shape + varp->ndims -1
|
assert(shp >= varp->shape + varp->ndims -1
|
||||||
|| *(edp +1) == *(shp +1));
|
|| *(edp +1) == *(shp +1));
|
||||||
|
|
||||||
/* now accumulate max count for a single io operation */
|
/* now accumulate max count for a single io operation */
|
||||||
@ -963,7 +963,7 @@ set_upper(size_t *upp, /* modified on return */
|
|||||||
* For some ii,
|
* For some ii,
|
||||||
* upp == &upper[ii]
|
* upp == &upper[ii]
|
||||||
* cdp == &coord[ii]
|
* cdp == &coord[ii]
|
||||||
*
|
*
|
||||||
* Running this routine increments *cdp.
|
* Running this routine increments *cdp.
|
||||||
*
|
*
|
||||||
* If after the increment, *cdp is equal to *upp
|
* If after the increment, *cdp is equal to *upp
|
||||||
@ -971,7 +971,7 @@ set_upper(size_t *upp, /* modified on return */
|
|||||||
* *cdp is "zeroed" to the starting value and
|
* *cdp is "zeroed" to the starting value and
|
||||||
* we need to "carry", eg, increment one place to
|
* we need to "carry", eg, increment one place to
|
||||||
* the left.
|
* the left.
|
||||||
*
|
*
|
||||||
* TODO: Some architectures hate recursion?
|
* TODO: Some architectures hate recursion?
|
||||||
* Reimplement non-recursively.
|
* Reimplement non-recursively.
|
||||||
*/
|
*/
|
||||||
@ -984,7 +984,7 @@ odo1(const size_t *const start, const size_t *const upper,
|
|||||||
assert(coord <= cdp && cdp <= coord + NC_MAX_VAR_DIMS);
|
assert(coord <= cdp && cdp <= coord + NC_MAX_VAR_DIMS);
|
||||||
assert(upper <= upp && upp <= upper + NC_MAX_VAR_DIMS);
|
assert(upper <= upp && upp <= upper + NC_MAX_VAR_DIMS);
|
||||||
assert(upp - upper == cdp - coord);
|
assert(upp - upper == cdp - coord);
|
||||||
|
|
||||||
assert(*cdp <= *upp);
|
assert(*cdp <= *upp);
|
||||||
|
|
||||||
(*cdp)++;
|
(*cdp)++;
|
||||||
@ -1324,7 +1324,7 @@ NC3_get_vara(int ncid, int varid,
|
|||||||
const size_t* edges = edges0; /* so we can modify for special cases */
|
const size_t* edges = edges0; /* so we can modify for special cases */
|
||||||
size_t modedges[NC_MAX_VAR_DIMS];
|
size_t modedges[NC_MAX_VAR_DIMS];
|
||||||
|
|
||||||
status = NC_check_id(ncid, &nc);
|
status = NC_check_id(ncid, &nc);
|
||||||
if(status != NC_NOERR)
|
if(status != NC_NOERR)
|
||||||
return status;
|
return status;
|
||||||
nc3 = NC3_DATA(nc);
|
nc3 = NC3_DATA(nc);
|
||||||
@ -1340,7 +1340,7 @@ NC3_get_vara(int ncid, int varid,
|
|||||||
|
|
||||||
if(memtype == NC_CHAR && varp->type != NC_CHAR)
|
if(memtype == NC_CHAR && varp->type != NC_CHAR)
|
||||||
return NC_ECHAR;
|
return NC_ECHAR;
|
||||||
else if(memtype != NC_CHAR && varp->type == NC_CHAR)
|
else if(memtype != NC_CHAR && varp->type == NC_CHAR)
|
||||||
return NC_ECHAR;
|
return NC_ECHAR;
|
||||||
|
|
||||||
/* If edges is NULL, then this was called from nc_get_var() */
|
/* If edges is NULL, then this was called from nc_get_var() */
|
||||||
@ -1451,7 +1451,7 @@ NC3_put_vara(int ncid, int varid,
|
|||||||
const size_t* edges = edges0; /* so we can modify for special cases */
|
const size_t* edges = edges0; /* so we can modify for special cases */
|
||||||
size_t modedges[NC_MAX_VAR_DIMS];
|
size_t modedges[NC_MAX_VAR_DIMS];
|
||||||
|
|
||||||
status = NC_check_id(ncid, &nc);
|
status = NC_check_id(ncid, &nc);
|
||||||
if(status != NC_NOERR)
|
if(status != NC_NOERR)
|
||||||
return status;
|
return status;
|
||||||
nc3 = NC3_DATA(nc);
|
nc3 = NC3_DATA(nc);
|
||||||
@ -1462,15 +1462,16 @@ NC3_put_vara(int ncid, int varid,
|
|||||||
if(NC_indef(nc3))
|
if(NC_indef(nc3))
|
||||||
return NC_EINDEFINE;
|
return NC_EINDEFINE;
|
||||||
|
|
||||||
varp = NC_lookupvar(nc3, varid);
|
status = NC_lookupvar(nc3, varid, &varp);
|
||||||
if(varp == NULL)
|
if(status != NC_NOERROR)
|
||||||
return NC_ENOTVAR; /* TODO: lost NC_EGLOBAL */
|
return status; /*invalid varid */
|
||||||
|
|
||||||
|
|
||||||
if(memtype == NC_NAT) memtype=varp->type;
|
if(memtype == NC_NAT) memtype=varp->type;
|
||||||
|
|
||||||
if(memtype == NC_CHAR && varp->type != NC_CHAR)
|
if(memtype == NC_CHAR && varp->type != NC_CHAR)
|
||||||
return NC_ECHAR;
|
return NC_ECHAR;
|
||||||
else if(memtype != NC_CHAR && varp->type == NC_CHAR)
|
else if(memtype != NC_CHAR && varp->type == NC_CHAR)
|
||||||
return NC_ECHAR;
|
return NC_ECHAR;
|
||||||
|
|
||||||
/* Get the size of the memtype */
|
/* Get the size of the memtype */
|
||||||
|
Loading…
Reference in New Issue
Block a user