mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
Changed 'boolean' to 'boolen' to avoid a name conflict under windows.
This commit is contained in:
parent
f820e5e5ee
commit
18d507c00d
@ -27,7 +27,7 @@ main()
|
||||
hsize_t dims[1];
|
||||
|
||||
printf("\n*** Checking HDF5 variable functions.\n");
|
||||
printf("*** Checking HDF5 boolean variables...");
|
||||
printf("*** Checking HDF5 boolen variables...");
|
||||
|
||||
/* Open file and create group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
|
@ -204,13 +204,13 @@ fixed64_encode(uint64_t value, uint8_t *out)
|
||||
return 8;
|
||||
}
|
||||
|
||||
/* Pack a boolean as 0 or 1, even though the bool_t
|
||||
/* Pack a boolen as 0 or 1, even though the bool_t
|
||||
can really assume any integer value. */
|
||||
/* XXX: perhaps on some platforms "*out = !!value" would be
|
||||
a better impl, b/c that is idiotmatic c++ in some stl impls. */
|
||||
|
||||
size_t
|
||||
boolean_encode(bool_t value, uint8_t *out)
|
||||
boolen_encode(bool_t value, uint8_t *out)
|
||||
{
|
||||
*out = value ? 1 : 0;
|
||||
return 1;
|
||||
@ -324,7 +324,7 @@ fixed64_decode(const uint8_t* data)
|
||||
}
|
||||
|
||||
bool_t
|
||||
boolean_decode(const size_t len, const uint8_t* data)
|
||||
boolen_decode(const size_t len, const uint8_t* data)
|
||||
{
|
||||
int i;
|
||||
bool_t tf;
|
||||
|
@ -35,7 +35,7 @@ extern size_t sint32_encode(int32_t value, uint8_t *out);
|
||||
extern size_t sint64_encode(int64_t value, uint8_t *out);
|
||||
extern size_t fixed32_encode(uint32_t value, uint8_t *out);
|
||||
extern size_t fixed64_encode(uint64_t value, uint8_t *out);
|
||||
extern size_t boolean_encode(bool_t value, uint8_t* out);
|
||||
extern size_t boolen_encode(bool_t value, uint8_t* out);
|
||||
|
||||
/* Varint decodings; when in doubt use varint_decode */
|
||||
extern uint64_t varint_decode(const size_t, const uint8_t*, size_t*);
|
||||
@ -46,7 +46,7 @@ extern int64_t int64_decode(const size_t len, const uint8_t* data);
|
||||
/* Fixed size decodes; may need subsequent unzigzag */
|
||||
extern uint32_t fixed32_decode(const uint8_t*);
|
||||
extern uint64_t fixed64_decode(const uint8_t*);
|
||||
extern bool_t boolean_decode(const size_t len, const uint8_t*);
|
||||
extern bool_t boolen_decode(const size_t len, const uint8_t*);
|
||||
|
||||
extern size_t uint32_size(uint32_t v);
|
||||
extern size_t int32_size(int32_t v);
|
||||
|
@ -212,7 +212,7 @@ ast_read_primitive_data(ast_runtime* rt, const ast_sort sort, void* valuep)
|
||||
*((int64_t*)valuep) = unzigzag64(uint64_decode(len,buffer));
|
||||
break;
|
||||
case ast_bool:
|
||||
*((bool_t*)valuep) = boolean_decode(len,buffer);
|
||||
*((bool_t*)valuep) = boolen_decode(len,buffer);
|
||||
break;
|
||||
case ast_fixed32:
|
||||
*((uint32_t*)valuep) = fixed32_decode(buffer);
|
||||
@ -312,7 +312,7 @@ ast_write_primitive_data(ast_runtime* rt, const ast_sort sort,
|
||||
if(ast_write(rt,count,buffer) != count) {status = AST_EIO; ATHROW(status,done);}
|
||||
break;
|
||||
case ast_bool:
|
||||
count = boolean_encode(*(bool_t*)valuep,buffer);
|
||||
count = boolen_encode(*(bool_t*)valuep,buffer);
|
||||
if(ast_write(rt,count,buffer) != count) {status = AST_EIO; ATHROW(status,done);}
|
||||
break;
|
||||
case ast_enum:
|
||||
|
@ -455,7 +455,7 @@ idadd(idnode_t* vlist, int varid)
|
||||
/*
|
||||
* return true if id is member of list that vlist points to.
|
||||
*/
|
||||
boolean
|
||||
boolen
|
||||
idmember(const idnode_t* idlist, int id)
|
||||
{
|
||||
idnode_t *vp = idlist -> next;
|
||||
@ -470,7 +470,7 @@ idmember(const idnode_t* idlist, int id)
|
||||
* return true if group identified by grpid is member of group
|
||||
* list specified on command line by -g.
|
||||
*/
|
||||
boolean
|
||||
boolen
|
||||
group_wanted(int grpid)
|
||||
{
|
||||
/* If -g not specified, all groups are wanted */
|
||||
@ -593,25 +593,25 @@ get_typeinfo ( int typeid ) {
|
||||
/* } */
|
||||
|
||||
|
||||
boolean
|
||||
boolen
|
||||
ncbyte_val_equals(const nctype_t *this,
|
||||
const void *v1p, const void *v2p) {
|
||||
return ( *(signed char* )v1p == *(signed char* )v2p);
|
||||
}
|
||||
|
||||
boolean
|
||||
boolen
|
||||
ncchar_val_equals(const nctype_t *this,
|
||||
const void *v1p, const void *v2p) {
|
||||
return ( *(char* )v1p == *(char* )v2p);
|
||||
}
|
||||
|
||||
boolean
|
||||
boolen
|
||||
ncshort_val_equals(const nctype_t *this,
|
||||
const void *v1p, const void *v2p) {
|
||||
return ( *(short* )v1p == *(short* )v2p);
|
||||
}
|
||||
|
||||
boolean
|
||||
boolen
|
||||
ncint_val_equals(const nctype_t *this,
|
||||
const void *v1p, const void *v2p) {
|
||||
return ( *(int* )v1p == *(int* )v2p);
|
||||
@ -624,7 +624,7 @@ ncint_val_equals(const nctype_t *this,
|
||||
* except use floating epsilon to compare very close vals as equal
|
||||
* and handle IEEE NaNs and infinities.
|
||||
*/
|
||||
boolean
|
||||
boolen
|
||||
ncfloat_val_equals(const nctype_t *this,
|
||||
const void *v1p, const void *v2p) {
|
||||
float v1 = *(float* )v1p;
|
||||
@ -645,7 +645,7 @@ ncfloat_val_equals(const nctype_t *this,
|
||||
* except use floating epsilon to compare very close vals as equal
|
||||
* and handle IEEE NaNs and infinities.
|
||||
*/
|
||||
boolean
|
||||
boolen
|
||||
ncdouble_val_equals(const nctype_t *this,
|
||||
const void *v1p, const void *v2p) {
|
||||
double v1 = *(double* )v1p;
|
||||
@ -662,43 +662,43 @@ ncdouble_val_equals(const nctype_t *this,
|
||||
}
|
||||
|
||||
#ifdef USE_NETCDF4
|
||||
boolean
|
||||
boolen
|
||||
ncubyte_val_equals(const nctype_t *this,
|
||||
const void *v1p, const void *v2p) {
|
||||
return ( *(unsigned char* )v1p == *(unsigned char* )v2p);
|
||||
}
|
||||
|
||||
boolean
|
||||
boolen
|
||||
ncushort_val_equals(const nctype_t *this,
|
||||
const void *v1p, const void *v2p) {
|
||||
return ( *(unsigned short* )v1p == *(unsigned short* )v2p);
|
||||
}
|
||||
|
||||
boolean
|
||||
boolen
|
||||
ncuint_val_equals(const nctype_t *this,
|
||||
const void *v1p, const void *v2p) {
|
||||
return ( *(unsigned int* )v1p == *(unsigned int* )v2p);
|
||||
}
|
||||
|
||||
boolean
|
||||
boolen
|
||||
ncint64_val_equals(const nctype_t *this,
|
||||
const void *v1p, const void *v2p) {
|
||||
return ( *(long long* )v1p == *(long long* )v2p);
|
||||
}
|
||||
|
||||
boolean
|
||||
boolen
|
||||
ncuint64_val_equals(const nctype_t *this,
|
||||
const void *v1p, const void *v2p) {
|
||||
return ( *(unsigned long long* )v1p == *(unsigned long long* )v2p);
|
||||
}
|
||||
|
||||
boolean
|
||||
boolen
|
||||
ncstring_val_equals(const nctype_t *this,
|
||||
const void *v1p, const void *v2p) {
|
||||
return (strcmp(*((char **)v1p), *((char **)v2p)) == 0);
|
||||
}
|
||||
|
||||
boolean
|
||||
boolen
|
||||
ncopaque_val_equals(const nctype_t *this,
|
||||
const void *v1p, const void *v2p) {
|
||||
size_t nbytes = this->size;
|
||||
@ -712,7 +712,7 @@ ncopaque_val_equals(const nctype_t *this,
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean
|
||||
boolen
|
||||
ncvlen_val_equals(const nctype_t *this,
|
||||
const void *v1p, const void *v2p) {
|
||||
size_t v1len = ((nc_vlen_t *)v1p)->len;
|
||||
@ -740,7 +740,7 @@ ncvlen_val_equals(const nctype_t *this,
|
||||
|
||||
/* Determine if two compound values are equal, by testing eqaulity of
|
||||
* each member field. */
|
||||
boolean
|
||||
boolen
|
||||
nccomp_val_equals(const nctype_t *this,
|
||||
const void *v1p, const void *v2p) {
|
||||
int nfields = this->nfields;
|
||||
|
@ -70,10 +70,10 @@ extern idnode_t* newidlist ( void );
|
||||
extern void idadd ( idnode_t* idlist, int id );
|
||||
|
||||
/* Test if a variable id is in variable list */
|
||||
extern boolean idmember ( const idnode_t* idlist, int id );
|
||||
extern boolen idmember ( const idnode_t* idlist, int id );
|
||||
|
||||
/* Test if a group id is in group list */
|
||||
extern boolean group_wanted ( int grpid );
|
||||
extern boolen group_wanted ( int grpid );
|
||||
|
||||
/* Add type info to type list */
|
||||
extern void typeadd ( nctype_t *typep );
|
||||
|
@ -20,7 +20,7 @@ struct timeinfo_t;
|
||||
* Member function to determine if values for this type are equal,
|
||||
* used to compare with fill value.
|
||||
*/
|
||||
typedef boolean (*val_equals_func)(const struct nctype_t *this,
|
||||
typedef boolen (*val_equals_func)(const struct nctype_t *this,
|
||||
const void *v1p, const void *v2p);
|
||||
/*
|
||||
* Member function to convert value of this type to a string. Returns
|
||||
@ -72,11 +72,11 @@ typedef struct ncvar_t { /* variable */
|
||||
int ndims; /* number of dimensions (rank) */
|
||||
int *dims; /* dimension ids */
|
||||
int natts; /* number of attributes */
|
||||
boolean has_fillval; /* has a fill value defined? */
|
||||
boolen has_fillval; /* has a fill value defined? */
|
||||
void* fillvalp; /* pointer to the fill value, if any */
|
||||
boolean has_timeval; /* has date-time values, for -t output option */
|
||||
boolen has_timeval; /* has date-time values, for -t output option */
|
||||
struct timeinfo_t *timeinfo;/* if time values, units, calendar, and origin */
|
||||
boolean is_bnds_var; /* cell bounds variable, inherits timeinfo */
|
||||
boolen is_bnds_var; /* cell bounds variable, inherits timeinfo */
|
||||
const char *fmt; /* overriding variable-specific format for
|
||||
printing values or base values, if any */
|
||||
int locid; /* group id */
|
||||
|
@ -2323,8 +2323,8 @@ main(int argc, char *argv[])
|
||||
int i;
|
||||
int max_len = 80; /* default maximum line length */
|
||||
int nameopt = 0;
|
||||
boolean xml_out = false; /* if true, output NcML instead of CDL */
|
||||
boolean kind_out = false; /* if true, just output kind of netCDF file */
|
||||
boolen xml_out = false; /* if true, output NcML instead of CDL */
|
||||
boolen kind_out = false; /* if true, just output kind of netCDF file */
|
||||
|
||||
#if defined(WIN32) || defined(msdos) || defined(WIN64)
|
||||
putenv("PRINTF_EXPONENT_DIGITS=2"); /* Enforce unix/linux style exponent formatting. */
|
||||
|
@ -14,32 +14,32 @@ typedef struct { /* specification for how to format dump */
|
||||
char *name; /* name specified with -n or derived from
|
||||
* file name */
|
||||
|
||||
boolean header_only; /* if true, don't print any variable data */
|
||||
boolen header_only; /* if true, don't print any variable data */
|
||||
|
||||
boolean coord_vals; /* if true, print header and coordinate
|
||||
boolen coord_vals; /* if true, print header and coordinate
|
||||
* dimension values (values of variables
|
||||
* that are also dimensions), but no other
|
||||
* variable data */
|
||||
|
||||
boolean brief_data_cmnts; /* if true, put // comments in data section
|
||||
boolen brief_data_cmnts; /* if true, put // comments in data section
|
||||
* identifying variable and indices, useful
|
||||
* for navigating through large
|
||||
* multi-dimensional data lists. */
|
||||
|
||||
boolean full_data_cmnts; /* if true, put // comments in data section
|
||||
boolen full_data_cmnts; /* if true, put // comments in data section
|
||||
* identifying every value, useful for
|
||||
* navigating through large
|
||||
* multi-dimensional data lists. */
|
||||
|
||||
boolean string_times; /* if true, output date-time values as
|
||||
boolen string_times; /* if true, output date-time values as
|
||||
* human-readable strings. */
|
||||
|
||||
boolean iso_separator; /* if true, use 'T' separator between
|
||||
boolen iso_separator; /* if true, use 'T' separator between
|
||||
* date and time components of
|
||||
* human-readable strings, otherwise
|
||||
* use ' ' */
|
||||
|
||||
boolean special_atts; /* if true, output special attributes
|
||||
boolen special_atts; /* if true, output special attributes
|
||||
* for optimization characteristics:
|
||||
* _Compression, _Chunking,
|
||||
* _Endianness, _Format, _Checksum,
|
||||
@ -50,7 +50,7 @@ typedef struct { /* specification for how to format dump */
|
||||
* column major) or LANG_F (Fortran,
|
||||
* 1-based, row major) */
|
||||
|
||||
boolean with_cache; /* For DAP URLs, get data with client-side
|
||||
boolen with_cache; /* For DAP URLs, get data with client-side
|
||||
* caching when each variable is first accessed */
|
||||
|
||||
int nlvars; /* Number of variables specified with -v
|
||||
|
@ -95,7 +95,7 @@ calendar_type(int ncid, int varid) {
|
||||
return ctype;
|
||||
}
|
||||
|
||||
boolean
|
||||
boolen
|
||||
is_bounds_var(char *varname, int *pargrpidp, int *parvaridp) {
|
||||
bounds_node_t *bp = bounds_list.first;
|
||||
for(; bp; bp = bp->next) {
|
||||
@ -113,13 +113,13 @@ is_bounds_var(char *varname, int *pargrpidp, int *parvaridp) {
|
||||
* where
|
||||
* <time_unit>:
|
||||
*/
|
||||
boolean
|
||||
boolen
|
||||
is_valid_time_unit(const char *units) {
|
||||
char charunits[CD_MAX_RELUNITS];
|
||||
char basetime_1[CD_MAX_CHARTIME];
|
||||
char basetime_2[CD_MAX_CHARTIME];
|
||||
int nconv1, nconv2;
|
||||
boolean okunit = false;
|
||||
boolen okunit = false;
|
||||
|
||||
/* Allow ISO-8601 "T" date-time separator as well as blank separator */
|
||||
nconv1 = sscanf(units,"%s since %[^T]T%s", charunits, basetime_1, basetime_2);
|
||||
@ -158,7 +158,7 @@ is_valid_time_unit(const char *units) {
|
||||
}
|
||||
|
||||
/* Return true only if this is a "bounds" attribute */
|
||||
boolean
|
||||
boolen
|
||||
is_bounds_att(ncatt_t *attp) {
|
||||
if(attp->type == NC_CHAR && attp->valgp && STREQ((char *)attp->name, "bounds")) {
|
||||
return true;
|
||||
@ -176,7 +176,7 @@ is_bounds_att(ncatt_t *attp) {
|
||||
* other variables. att must be a variable "bounds" attribute. */
|
||||
void
|
||||
insert_bounds_info(int ncid, int varid, ncatt_t *attp) {
|
||||
static boolean uninitialized = true;
|
||||
static boolen uninitialized = true;
|
||||
if(uninitialized) {
|
||||
bounds_list.nbnds = 0;
|
||||
bounds_list.first = NULL;
|
||||
@ -277,8 +277,8 @@ print_att_times(
|
||||
)
|
||||
{
|
||||
nc_type type = att->type; /* local copy */
|
||||
boolean wrap;
|
||||
boolean first_item;
|
||||
boolen wrap;
|
||||
boolen first_item;
|
||||
|
||||
ncvar_t var; /* fake var structure for the att values; */
|
||||
/* will add only the minimum necessary info */
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0)
|
||||
|
||||
typedef int boolean;
|
||||
typedef int boolen;
|
||||
enum {false=0, true=1};
|
||||
|
||||
struct safebuf_t;
|
||||
|
@ -85,15 +85,15 @@ lput(const char *cp) {
|
||||
void
|
||||
lput2(
|
||||
const char *cp, /* string to print */
|
||||
boolean first_item, /* identify first item in list */
|
||||
boolean wrap /* line wrap control: true=enable,
|
||||
boolen first_item, /* identify first item in list */
|
||||
boolen wrap /* line wrap control: true=enable,
|
||||
* false=stay on same line */
|
||||
)
|
||||
{
|
||||
static int linep; /* current line position (number of */
|
||||
/* chars); saved between calls */
|
||||
int len_prefix = strlen (CDL_COMMENT_PREFIX);
|
||||
boolean make_newline;
|
||||
boolen make_newline;
|
||||
|
||||
size_t len1 = strlen(cp); /* length of input string */
|
||||
|
||||
@ -173,7 +173,7 @@ print_any_val(
|
||||
* print last delimiter in each line before annotation (, or ;)
|
||||
*/
|
||||
static void
|
||||
lastdelim (boolean more, boolean lastrow)
|
||||
lastdelim (boolen more, boolen lastrow)
|
||||
{
|
||||
if (more) {
|
||||
printf(", ");
|
||||
@ -190,7 +190,7 @@ lastdelim (boolean more, boolean lastrow)
|
||||
* print last delimiter in each line before annotation (, or ;)
|
||||
*/
|
||||
static void
|
||||
lastdelim2 (boolean more, boolean lastrow)
|
||||
lastdelim2 (boolen more, boolen lastrow)
|
||||
{
|
||||
if (more) {
|
||||
lput(", ");
|
||||
@ -277,9 +277,9 @@ static void
|
||||
pr_any_vals(
|
||||
const ncvar_t *vp, /* variable */
|
||||
size_t len, /* number of values to print */
|
||||
boolean more, /* true if more data for this row will
|
||||
boolen more, /* true if more data for this row will
|
||||
* follow, so add trailing comma */
|
||||
boolean lastrow, /* true if this is the last row for this
|
||||
boolen lastrow, /* true if this is the last row for this
|
||||
* variable, so terminate with ";" instead
|
||||
* of "," */
|
||||
const void *vals, /* pointer to block of values */
|
||||
@ -323,9 +323,9 @@ static void
|
||||
pr_tvals(
|
||||
const ncvar_t *vp, /* variable */
|
||||
size_t len, /* number of values to print */
|
||||
boolean more, /* true if more data for this row will
|
||||
boolen more, /* true if more data for this row will
|
||||
* follow, so add trailing comma */
|
||||
boolean lastrow, /* true if this is the last row for this
|
||||
boolen lastrow, /* true if this is the last row for this
|
||||
* variable, so terminate with ";" instead
|
||||
* of "," */
|
||||
const char *vals, /* pointer to block of values */
|
||||
@ -491,7 +491,7 @@ vardata(
|
||||
*/
|
||||
size_t corsav = 0;
|
||||
int left = (int)ncols;
|
||||
boolean lastrow;
|
||||
boolen lastrow;
|
||||
|
||||
if (vrank > 0) {
|
||||
corsav = cor[vrank-1];
|
||||
@ -529,7 +529,7 @@ vardata(
|
||||
set_indent(4 + indent_get());
|
||||
}
|
||||
}
|
||||
lastrow = (boolean)(ir == nrows-1);
|
||||
lastrow = (boolen)(ir == nrows-1);
|
||||
while (left > 0) {
|
||||
size_t toget = left < gulp ? left : gulp;
|
||||
if (vrank > 0)
|
||||
@ -568,7 +568,7 @@ vardata(
|
||||
* print last delimiter in each line before annotation (, or ;)
|
||||
*/
|
||||
static void
|
||||
lastdelim2x (boolean more, boolean lastrow)
|
||||
lastdelim2x (boolen more, boolen lastrow)
|
||||
{
|
||||
if (more) {
|
||||
lput(" ");
|
||||
@ -589,9 +589,9 @@ static void
|
||||
pr_tvalsx(
|
||||
const ncvar_t *vp, /* variable */
|
||||
size_t len, /* number of values to print */
|
||||
boolean more, /* true if more data for this row will
|
||||
boolen more, /* true if more data for this row will
|
||||
* follow, so add trailing comma */
|
||||
boolean lastrow, /* true if this is the last row for this
|
||||
boolen lastrow, /* true if this is the last row for this
|
||||
* variable, so terminate with ";" instead
|
||||
* of "," */
|
||||
const char *vals /* pointer to block of values */
|
||||
@ -655,9 +655,9 @@ static void
|
||||
pr_any_valsx(
|
||||
const ncvar_t *vp, /* variable */
|
||||
size_t len, /* number of values to print */
|
||||
boolean more, /* true if more data for this row will
|
||||
boolen more, /* true if more data for this row will
|
||||
* follow, so add trailing comma */
|
||||
boolean lastrow, /* true if this is the last row for this
|
||||
boolen lastrow, /* true if this is the last row for this
|
||||
* variable, so terminate with ";" instead
|
||||
* of "," */
|
||||
const void *vals /* pointer to block of values */
|
||||
@ -739,12 +739,12 @@ vardatax(
|
||||
*/
|
||||
size_t corsav;
|
||||
int left = (int)ncols;
|
||||
boolean lastrow;
|
||||
boolen lastrow;
|
||||
|
||||
if (vrank > 0) {
|
||||
corsav = cor[vrank-1];
|
||||
}
|
||||
lastrow = (boolean)(ir == nrows-1);
|
||||
lastrow = (boolen)(ir == nrows-1);
|
||||
while (left > 0) {
|
||||
size_t toget = left < gulp ? left : gulp;
|
||||
if (vrank > 0)
|
||||
|
@ -35,7 +35,7 @@ extern void set_max_len ( int len );
|
||||
extern void lput( const char *string );
|
||||
|
||||
/* like lput, but with options to support formatting with appended comments */
|
||||
extern void lput2( const char *string, boolean first, boolean wrap);
|
||||
extern void lput2( const char *string, boolen first, boolen wrap);
|
||||
|
||||
/* print values of an attribute */
|
||||
extern void pr_any_att_vals( const ncatt_t *attp, const void *vals );
|
||||
|
Loading…
Reference in New Issue
Block a user