libnczarr/zattr.c
int
ncz_create_fillvalue(NC_VAR_INFO_T* var)
{
    int stat = NC_NOERR;
    int i;
    NC_ATT_INFO_T* fv = NULL;

    /* Have the var's attributes been read? */
    if(!var->atts_read) goto done; /* above my pay grade */

    /* Is FillValue warranted? */
    if(!var->no_fill && var->fill_value != NULL) {
        /* Make sure _FillValue does not exist */
	for(i=0;i<ncindexsize(var->att);i++) {
	    fv = (NC_ATT_INFO_T*)ncindexith(var->att,i);
	    if(strcmp(fv->hdr.name,_FillValue)==0) break;
	    fv = NULL;
        }
	if(fv == NULL) {
	    /* Create it */
	    if((stat = ncz_makeattr((NC_OBJ*)var,var->att,_FillValue,var->type_info->hdr.id,1,var->fill_value,&fv)))
	    goto done;
	}
    }
done:
    return THROW(stat);
}
/* If we do not have a _FillValue, then go ahead and create it */
If we do not have a _FillValue, then go ahead and create it
If we do not have a _FillValue then go ahead and create it
int
ncz_create_fillvalue(NC_VAR_INFO_T* var)
{
    int stat = NC_NOERR;
    int i;
    NC_ATT_INFO_T* fv = NULL;
    if(!var->atts_read) goto done; 
    if(!var->no_fill && var->fill_value != NULL) {
	for(i=0;i<ncindexsize(var->att);i++) {
	    fv = (NC_ATT_INFO_T*)ncindexith(var->att,i);
	    if(strcmp(fv->hdr.name,_FillValue)==0) break;
	    fv = NULL;
        }
	if(fv == NULL) {
	    if((stat = ncz_makeattr((NC_OBJ*)var,var->att,_FillValue,var->type_info->hdr.id,1,var->fill_value,&fv)))
	    goto done;
	}
    }
done:
    return THROW(stat);
}
int ncz_create_fillvalue ( NC_VAR_INFO_T * var ) { int stat = NC_NOERR ; int i ; NC_ATT_INFO_T * fv = NULL ; if ( ! var -> atts_read ) goto done ; if ( ! var -> no_fill && var -> fill_value != NULL ) { for ( i = 0 ; i < ncindexsize ( var -> att ) ; i ++ ) { fv = ( NC_ATT_INFO_T * ) ncindexith ( var -> att , i ) ; if ( strcmp ( fv -> hdr . name , _FillValue ) == 0 ) break ; fv = NULL ; } if ( fv == NULL ) { if ( ( stat = ncz_makeattr ( ( NC_OBJ * ) var , var -> att , _FillValue , var -> type_info -> hdr . id , 1 , var -> fill_value , & fv ) ) ) goto done ; } } done : return THROW ( stat ) ; }
If we do not have a _FillValue, then go ahead and create it
If we do not have a _FillValue then go ahead and create it
/* Have the var's attributes been read? */ /* above my pay grade */ /* Is FillValue warranted? */ /* Make sure _FillValue does not exist */ /* Create it */