fixed problems with missing elements in structures in accessor.class and

dumper.class
This commit is contained in:
Enrico Fucile 2014-08-04 14:45:47 +01:00
parent df0065a020
commit b6d7ea751f
182 changed files with 1166 additions and 230 deletions

View File

@ -58,6 +58,7 @@ libgrib_api_la_prototypes= \
grib_accessor_class_bits.c \
grib_accessor_class_bits_per_value.c \
grib_accessor_class_bufr_data.c \
grib_accessor_class_bufr_data_array.c \
grib_accessor_class_bufr_data_element.c \
grib_accessor_class_bufr_group.c \
grib_accessor_class_unpack_bufr_values.c \

View File

@ -6,11 +6,13 @@ static int pack_bytes(grib_accessor*,const unsigned char*, size_t *len);
static int pack_double(grib_accessor*, const double* val,size_t *len);
static int pack_long(grib_accessor*, const long* val,size_t *len);
static int pack_string(grib_accessor*, const char*, size_t *len);
static int pack_string_array(grib_accessor*, const char**, size_t *len);
static int pack_expression(grib_accessor*, grib_expression*);
static int unpack_bytes (grib_accessor*,unsigned char*, size_t *len);
static int unpack_double(grib_accessor*, double* val,size_t *len);
static int unpack_long(grib_accessor*, long* val,size_t *len);
static int unpack_string (grib_accessor*, char*, size_t *len);
static int unpack_string_array (grib_accessor*, char**, size_t *len);
static size_t string_length(grib_accessor*);
static long byte_count(grib_accessor*);
static long byte_offset(grib_accessor*);
@ -57,13 +59,15 @@ static grib_accessor_class _grib_accessor_class_NAME = {
&get_native_type, /* get native type */
&sub_section, /* get sub_section */
&pack_missing, /* grib_pack procedures long */
&is_missing, /* grib_pack procedures long */
&is_missing, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */
&unpack_double, /* grib_unpack procedures double */
&pack_string, /* grib_pack procedures string */
&unpack_string, /* grib_unpack procedures string */
&pack_string_array, /* grib_pack array procedures string */
&unpack_string_array, /* grib_unpack array procedures string */
&pack_bytes, /* grib_pack procedures bytes */
&unpack_bytes, /* grib_unpack procedures bytes */
&pack_expression, /* pack_expression */

View File

@ -37,14 +37,15 @@ or edit "action.class" and rerun ./make_class.pl
*/
static void init_class (grib_action_class*);
static void xref (grib_action* d, FILE* f,const char* path);
static int notify_change (grib_action* a, grib_accessor* observer,grib_accessor* observed);
static void init_class (grib_action_class*);
static void xref (grib_action* d, FILE* f,const char* path);
static int notify_change(grib_action* a, grib_accessor* observer,grib_accessor* observed);
static grib_action* reparse(grib_action* a,grib_accessor* acc,int *doit);
typedef struct grib_action_section {
grib_action act;
/* Members defined in section */
/* Members defined in section */
} grib_action_section;

View File

@ -5,6 +5,7 @@ static void dump_long (grib_dumper* d, grib_accessor* a,const char* commen
static void dump_bits (grib_dumper* d, grib_accessor* a,const char* comment);
static void dump_double (grib_dumper* d, grib_accessor* a,const char* comment);
static void dump_string (grib_dumper* d, grib_accessor* a,const char* comment);
static void dump_string_array (grib_dumper* d, grib_accessor* a,const char* comment);
static void dump_bytes (grib_dumper* d, grib_accessor* a,const char* comment);
static void dump_values (grib_dumper* d, grib_accessor* a);
static void dump_label (grib_dumper* d, grib_accessor* a,const char* comment);
@ -30,6 +31,7 @@ static grib_dumper_class _grib_dumper_class_NAME = {
&dump_long, /* dump long */
&dump_double, /* dump double */
&dump_string, /* dump string */
&dump_string_array, /* dump string array */
&dump_label, /* dump labels */
&dump_bytes, /* dump bytes */
&dump_bits, /* dump bits */

View File

@ -9,7 +9,7 @@ grib_errors.c : grib_errors.txt errors.pl
cmp ../python/grib_errors.h grib_errors.h.new || (cp grib_errors.h.new ../python/grib_errors.h)
proto:;-chmod +w grib_api_prototypes.h;mkptypes -A $(libgrib_api_a_prototypes) $(libgrib_api_extra_prototypes) > grib_api_prototypes.h
proto:;-chmod +w grib_api_prototypes.h;mkptypes -A $(libgrib_api_la_prototypes) $(libgrib_api_extra_prototypes) > grib_api_prototypes.h
test:all;(cd ../tests; make tests)
templates:

View File

@ -12,6 +12,7 @@ extern grib_accessor_class* grib_accessor_class_bits_per_value;
extern grib_accessor_class* grib_accessor_class_box;
extern grib_accessor_class* grib_accessor_class_budgdate;
extern grib_accessor_class* grib_accessor_class_bufr_data;
extern grib_accessor_class* grib_accessor_class_bufr_data_array;
extern grib_accessor_class* grib_accessor_class_bufr_data_element;
extern grib_accessor_class* grib_accessor_class_bufr_element;
extern grib_accessor_class* grib_accessor_class_bufr_group;
@ -90,6 +91,7 @@ extern grib_accessor_class* grib_accessor_class_g1p1p2;
extern grib_accessor_class* grib_accessor_class_g1param;
extern grib_accessor_class* grib_accessor_class_g1step_range;
extern grib_accessor_class* grib_accessor_class_g1verificationdate;
extern grib_accessor_class* grib_accessor_class_g2_chemical;
extern grib_accessor_class* grib_accessor_class_g2_eps;
extern grib_accessor_class* grib_accessor_class_g2_mars_labeling;
extern grib_accessor_class* grib_accessor_class_g2bitmap;
@ -162,7 +164,6 @@ extern grib_accessor_class* grib_accessor_class_section_padding;
extern grib_accessor_class* grib_accessor_class_section_pointer;
extern grib_accessor_class* grib_accessor_class_select_step_template;
extern grib_accessor_class* grib_accessor_class_sexagesimal2decimal;
extern grib_accessor_class* grib_accessor_class_g2_chemical;
extern grib_accessor_class* grib_accessor_class_signed;
extern grib_accessor_class* grib_accessor_class_signed_bits;
extern grib_accessor_class* grib_accessor_class_simple_packing_error;

View File

@ -67,7 +67,7 @@ static grib_accessor_class _grib_accessor_class_abstract_long_vector = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -66,7 +66,7 @@ static grib_accessor_class _grib_accessor_class_abstract_vector = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -67,7 +67,7 @@ static grib_accessor_class _grib_accessor_class_array = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -79,7 +79,7 @@ static grib_accessor_class _grib_accessor_class_ascii = {
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -67,7 +67,7 @@ static grib_accessor_class _grib_accessor_class_assert = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -69,7 +69,7 @@ static grib_accessor_class _grib_accessor_class_bit = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -80,7 +80,7 @@ static grib_accessor_class _grib_accessor_class_bitmap = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -88,7 +88,7 @@ static grib_accessor_class _grib_accessor_class_bits = {
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -70,7 +70,7 @@ static grib_accessor_class _grib_accessor_class_bits_per_value = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -63,7 +63,7 @@ static grib_accessor_class _grib_accessor_class_box = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -70,7 +70,7 @@ static grib_accessor_class _grib_accessor_class_budgdate = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -0,0 +1,889 @@
/*
* Copyright 2005-2014 ECMWF.
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
*
* In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
* virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
*/
#include "grib_api_internal.h"
/*
This is used by make_class.pl
START_CLASS_DEF
CLASS = accessor
SUPER = grib_accessor_class_gen
IMPLEMENTS = init
IMPLEMENTS = dump;destroy
IMPLEMENTS = next_offset
IMPLEMENTS = byte_count; value_count
IMPLEMENTS = byte_offset; unpack_double
IMPLEMENTS = get_native_type
IMPLEMENTS = update_size
IMPLEMENTS = compare
IMPLEMENTS = pack_long; unpack_double; pack_double
MEMBERS= const char* offsetSection4Name
MEMBERS= const char* offsetBeforeDataName
MEMBERS= const char* offsetEndSection4Name
MEMBERS= const char* section4LengthName
MEMBERS= const char* numberOfDataSubsetsName
MEMBERS= const char* subsetNumberName
MEMBERS= const char* expandedDescriptorsName
MEMBERS= const char* abbreviationName
MEMBERS= const char* typeName
MEMBERS= const char* nameName
MEMBERS= const char* unitName
MEMBERS= const char* referenceName
MEMBERS= const char* scaleName
MEMBERS= const char* widthName
MEMBERS= const char* codeFlags
MEMBERS= const char* bitmapNumberName
MEMBERS= const char* associatedBitmapNumberName
MEMBERS= const char* associatedBitmapIndexName
MEMBERS= const char* associatedInfoNumberName
MEMBERS= long* expandedDescriptors
MEMBERS= char** abbreviation
MEMBERS= char** type
MEMBERS= char** names
MEMBERS= char** units
MEMBERS= long* reference
MEMBERS= double* factor
MEMBERS= long* width
MEMBERS= long* bitmapNumber
MEMBERS= long* associatedBitmapNumber
MEMBERS= long* associatedBitmapIndex
MEMBERS= long* associatedInfoNumber
MEMBERS= long numberOfElements
MEMBERS= long numberOfDataSubsets
MEMBERS= size_t numberOfDescriptors
MEMBERS= int do_compute
END_CLASS_DEF
*/
/* START_CLASS_IMP */
/*
Don't edit anything between START_CLASS_IMP and END_CLASS_IMP
Instead edit values between START_CLASS_DEF and END_CLASS_DEF
or edit "accessor.class" and rerun ./make_class.pl
*/
static int get_native_type(grib_accessor*);
static int pack_double(grib_accessor*, const double* val,size_t *len);
static int pack_long(grib_accessor*, const long* val,size_t *len);
static int unpack_double(grib_accessor*, double* val,size_t *len);
static long byte_count(grib_accessor*);
static long byte_offset(grib_accessor*);
static long next_offset(grib_accessor*);
static int value_count(grib_accessor*,long*);
static void destroy(grib_context*,grib_accessor*);
static void dump(grib_accessor*, grib_dumper*);
static void init(grib_accessor*,const long, grib_arguments* );
static void init_class(grib_accessor_class*);
static void update_size(grib_accessor*,size_t);
static int compare(grib_accessor*, grib_accessor*);
typedef struct grib_accessor_bufr_data_array {
grib_accessor att;
/* Members defined in gen */
/* Members defined in bufr_data_array */
const char* offsetSection4Name;
const char* offsetBeforeDataName;
const char* offsetEndSection4Name;
const char* section4LengthName;
const char* numberOfDataSubsetsName;
const char* subsetNumberName;
const char* expandedDescriptorsName;
const char* abbreviationName;
const char* typeName;
const char* nameName;
const char* unitName;
const char* referenceName;
const char* scaleName;
const char* widthName;
const char* codeFlags;
const char* bitmapNumberName;
const char* associatedBitmapNumberName;
const char* associatedBitmapIndexName;
const char* associatedInfoNumberName;
long* expandedDescriptors;
char** abbreviation;
char** type;
char** names;
char** units;
long* reference;
double* factor;
long* width;
long* bitmapNumber;
long* associatedBitmapNumber;
long* associatedBitmapIndex;
long* associatedInfoNumber;
long numberOfElements;
long numberOfDataSubsets;
size_t numberOfDescriptors;
int do_compute;
} grib_accessor_bufr_data_array;
extern grib_accessor_class* grib_accessor_class_gen;
static grib_accessor_class _grib_accessor_class_bufr_data_array = {
&grib_accessor_class_gen, /* super */
"bufr_data_array", /* name */
sizeof(grib_accessor_bufr_data_array), /* size */
0, /* inited */
&init_class, /* init_class */
&init, /* init */
0, /* post_init */
&destroy, /* free mem */
&dump, /* describes himself */
&next_offset, /* get length of section */
0, /* get length of string */
&value_count, /* get number of values */
&byte_count, /* get number of bytes */
&byte_offset, /* get offset to bytes */
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */
&unpack_double, /* grib_unpack procedures double */
0, /* grib_pack procedures string */
0, /* grib_unpack procedures string */
0, /* grib_pack array procedures string */
0, /* grib_unpack array procedures string */
0, /* grib_pack procedures bytes */
0, /* grib_unpack procedures bytes */
0, /* pack_expression */
0, /* notify_change */
&update_size, /* update_size */
0, /* preferred_size */
0, /* resize */
0, /* nearest_smaller_value */
0, /* next accessor */
&compare, /* compare vs. another accessor */
0, /* unpack only ith value */
0, /* unpack a subarray */
0, /* clear */
};
grib_accessor_class* grib_accessor_class_bufr_data_array = &_grib_accessor_class_bufr_data_array;
static void init_class(grib_accessor_class* c)
{
c->string_length = (*(c->super))->string_length;
c->sub_section = (*(c->super))->sub_section;
c->pack_missing = (*(c->super))->pack_missing;
c->is_missing = (*(c->super))->is_missing;
c->unpack_long = (*(c->super))->unpack_long;
c->pack_string = (*(c->super))->pack_string;
c->unpack_string = (*(c->super))->unpack_string;
c->pack_string_array = (*(c->super))->pack_string_array;
c->unpack_string_array = (*(c->super))->unpack_string_array;
c->pack_bytes = (*(c->super))->pack_bytes;
c->unpack_bytes = (*(c->super))->unpack_bytes;
c->pack_expression = (*(c->super))->pack_expression;
c->notify_change = (*(c->super))->notify_change;
c->preferred_size = (*(c->super))->preferred_size;
c->resize = (*(c->super))->resize;
c->nearest_smaller_value = (*(c->super))->nearest_smaller_value;
c->next = (*(c->super))->next;
c->unpack_double_element = (*(c->super))->unpack_double_element;
c->unpack_double_subarray = (*(c->super))->unpack_double_subarray;
c->clear = (*(c->super))->clear;
}
/* END_CLASS_IMP */
typedef struct grib_accessor_constant {
grib_accessor att;
/* Members defined in gen */
/* Members defined in variable */
double dval;
char* cval;
int type;
/* Members defined in constant */
} grib_accessor_constant;
typedef struct grib_accessor_bufr_data_element {
grib_accessor att;
/* Members defined in gen */
/* Members defined in bufr_data_element */
int type;
size_t numberOfValues;
double* dvalues;
long* lvalues;
grib_sarray* svalues;
int isConstant;
} grib_accessor_bufr_data_element;
#define IS_QUALIFIER(a) (a==8 || a==1 || a==2)
#define NUMBER_OF_QUALIFIERS_PER_CATEGORY 256
#define NUMBER_OF_QUALIFIERS_CATEGORIES 3
static int number_of_qualifiers=NUMBER_OF_QUALIFIERS_PER_CATEGORY*NUMBER_OF_QUALIFIERS_CATEGORIES;
static inline int significanceQualifierIndex(int X,int Y) {
int a[]={-1,0,1,-1,-1,-1,-1,-1,2};
return Y+a[X]*NUMBER_OF_QUALIFIERS_PER_CATEGORY;
}
static long init_length(grib_accessor* a)
{
grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a;
long section4Length=0;
grib_handle* h=a->parent->h;
grib_get_long(h,self->section4LengthName,&section4Length);
return section4Length-4;
}
static int get_elements_and_decode(grib_accessor* a);
static void init(grib_accessor* a,const long v, grib_arguments* params)
{
grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a;
int n = 0;
a->sub_section = grib_section_create(a->parent->h,a);
self->offsetSection4Name = grib_arguments_get_name(a->parent->h,params,n++);
self->offsetBeforeDataName = grib_arguments_get_name(a->parent->h,params,n++);
self->offsetEndSection4Name = grib_arguments_get_name(a->parent->h,params,n++);
self->section4LengthName = grib_arguments_get_name(a->parent->h,params,n++);
self->numberOfDataSubsetsName = grib_arguments_get_name(a->parent->h,params,n++);
self->subsetNumberName = grib_arguments_get_name(a->parent->h,params,n++);
self->expandedDescriptorsName = grib_arguments_get_name(a->parent->h,params,n++);
self->abbreviationName = grib_arguments_get_name(a->parent->h,params,n++);
self->typeName = grib_arguments_get_name(a->parent->h,params,n++);
self->nameName = grib_arguments_get_name(a->parent->h,params,n++);
self->unitName = grib_arguments_get_name(a->parent->h,params,n++);
self->referenceName = grib_arguments_get_name(a->parent->h,params,n++);
self->scaleName = grib_arguments_get_name(a->parent->h,params,n++);
self->widthName = grib_arguments_get_name(a->parent->h,params,n++);
self->do_compute=1;
a->length = init_length(a);
/* Assert(a->length>=0); */
}
static void self_clear(grib_context* c,grib_accessor_bufr_data_array* self) {
int i=0;
for (i=0;i<self->numberOfDescriptors;i++) {
grib_context_free(c,self->abbreviation[i]);
grib_context_free(c,self->type[i]);
grib_context_free(c,self->names[i]);
grib_context_free(c,self->units[i]);
}
grib_context_free(c,self->expandedDescriptors);
grib_context_free(c,self->abbreviation);
grib_context_free(c,self->type);
grib_context_free(c,self->names);
grib_context_free(c,self->units);
grib_context_free(c,self->reference);
grib_context_free(c,self->width);
grib_context_free(c,self->bitmapNumber);
grib_context_free(c,self->associatedBitmapNumber);
grib_context_free(c,self->associatedBitmapIndex);
grib_context_free(c,self->associatedInfoNumber);
grib_context_free(c,self->factor);
}
static int get_native_type(grib_accessor* a){
return GRIB_TYPE_DOUBLE;
}
static long byte_count(grib_accessor* a){
return a->length;
}
static long byte_offset(grib_accessor* a){
return a->offset;
}
static long next_offset(grib_accessor* a){
return a->offset+a->length;
}
static void update_size(grib_accessor* a,size_t s)
{
grib_context_log(a->parent->h->context,GRIB_LOG_DEBUG,"updating size of %s old %ld new %ld",a->name,a->length,s);
a->length = s;
Assert(a->length>=0);
}
static int compare(grib_accessor* a, grib_accessor* b) {
return GRIB_NOT_IMPLEMENTED;
}
static int pack_long(grib_accessor* a, const long* val, size_t *len)
{
grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a;
self->do_compute=1;
return GRIB_NOT_IMPLEMENTED;
}
static int pack_double(grib_accessor* a, const double* val, size_t *len)
{
grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a;
self->do_compute=1;
return GRIB_NOT_IMPLEMENTED;
}
static int get_descriptors(grib_accessor* a) {
int err=0;
size_t size=0;
long* scale=0;
double* factor=0;
int i=0;
grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a;
grib_accessor* expandedDescriptors=0;
grib_handle* h=a->parent->h;
grib_context* c=a->parent->h->context;
expandedDescriptors=grib_find_accessor(a->parent->h,self->expandedDescriptorsName);
if (!expandedDescriptors) {
grib_context_log(a->parent->h->context,GRIB_LOG_ERROR,
"unable to find accessor %s",self->expandedDescriptorsName);
return GRIB_NOT_FOUND;
}
if (self->numberOfDescriptors) self_clear(c,self);
err=_grib_get_size(a->parent->h,expandedDescriptors,&(self->numberOfDescriptors));
if (err) return err;
self->expandedDescriptors=grib_context_malloc_clear(a->parent->h->context,sizeof(long)*self->numberOfDescriptors);
if (!self->expandedDescriptors) {
grib_context_log(a->parent->h->context,GRIB_LOG_FATAL,
"unable to allocate %ld bytes",(long)(self->numberOfDescriptors));
return GRIB_OUT_OF_MEMORY;
}
if( (err = grib_unpack_long(expandedDescriptors,self->expandedDescriptors,&(self->numberOfDescriptors)))
!= GRIB_SUCCESS)
return err;
size=self->numberOfDescriptors;
self->abbreviation=(char**)grib_context_malloc_clear(c,size*sizeof(char*));
err=grib_get_string_array(h,self->abbreviationName,self->abbreviation,&size);
self->type=(char**)grib_context_malloc_clear(c,size*sizeof(char*));
err=grib_get_string_array(h,self->typeName,self->type,&size);
self->names=(char**)grib_context_malloc_clear(c,size*sizeof(char*));
err=grib_get_string_array(h,self->nameName,self->names,&size);
self->units=(char**)grib_context_malloc_clear(c,size*sizeof(char*));
err=grib_get_string_array(h,self->unitName,self->units,&size);
self->reference=grib_context_malloc_clear(c,size*sizeof(long));
err=grib_get_long_array(h,self->referenceName,self->reference,&size);
scale=grib_context_malloc_clear(c,size*sizeof(long));
factor=grib_context_malloc_clear(c,size*sizeof(double));
err=grib_get_long_array(h,self->scaleName,scale,&size);
for (i=0;i<size;i++) {
if (scale[i]==GRIB_MISSING_LONG) {
grib_context_log(c,GRIB_LOG_FATAL,"Missing table entry for descriptor %ld",self->expandedDescriptors[i]);
return GRIB_MISSING_BUFR_ENTRY;
}
factor[i]=grib_power(-scale[i],10);
}
self->factor=factor;
grib_context_free(c,scale);
self->width=grib_context_malloc_clear(c,size*sizeof(long));
err=grib_get_long_array(h,self->widthName,self->width,&size);
self->bitmapNumber=grib_context_malloc_clear(c,size*sizeof(long));
err=grib_get_long_array(h,self->bitmapNumberName,self->bitmapNumber,&size);
self->associatedBitmapNumber=grib_context_malloc_clear(c,size*sizeof(long));
err=grib_get_long_array(h,self->associatedBitmapNumberName,self->associatedBitmapNumber,&size);
self->associatedBitmapIndex=grib_context_malloc_clear(c,size*sizeof(long));
err=grib_get_long_array(h,self->associatedBitmapIndexName,self->associatedBitmapIndex,&size);
self->associatedInfoNumber=grib_context_malloc_clear(c,size*sizeof(long));
err=grib_get_long_array(h,self->associatedInfoNumberName,self->associatedInfoNumber,&size);
err=grib_get_long(h,self->numberOfDataSubsetsName,&(self->numberOfDataSubsets));
return err;
}
static void push_units_accessor(grib_section* section,grib_accessor* a,long groupNumber,long i) {
char buf[1024]={0,};
grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a;
grib_accessor* gaUnits=0;
grib_action creatorUnits = {0, };
grib_context* c=a->parent->h->context;
if (self->units[i][0]=='C' && ( !strcmp(self->units[i],"CCITTIA5") ||
!strncmp(self->units[i],"COMMON",6)) )
return;
if (self->units[i][0]=='N' && !strcmp(self->units[i],"NUMERIC") )
return;
creatorUnits.op = "variable";
creatorUnits.name_space = "";
creatorUnits.set = 0;
creatorUnits.flags = GRIB_ACCESSOR_FLAG_DUMP;
sprintf(buf,"%sUnits",self->abbreviation[i]);
creatorUnits.name=buf;
gaUnits = grib_accessor_factory(section, &creatorUnits, 0, NULL);
gaUnits->bufr_group_number=groupNumber;
((grib_accessor_constant*)gaUnits)->type=GRIB_TYPE_STRING;
if ((self->units[i][0]=='C' && !strncmp(self->units[i],"CODE",4)) ||
( self->units[i][0]=='F' && !strncmp(self->units[i],"FLAG",4) ) ) {
sprintf(buf,"codetable %ld",self->expandedDescriptors[i]);
((grib_accessor_constant*)gaUnits)->cval=grib_context_strdup(c,buf);
} else {
((grib_accessor_constant*)gaUnits)->cval=grib_context_strdup(c,self->units[i]);
}
grib_push_accessor(gaUnits,section->block);
}
static long computeBitmapStartElement(grib_accessor_bufr_data_array* self,long length, grib_iarray* index) {
int i,startIndex;
int idx;
startIndex=index->n-1;
/* printf("======== BITMAP\n"); */
for (i=0;i<length;i++) {
idx=grib_iarray_get(index,startIndex);
if (self->expandedDescriptors[idx]/100000!=2) {
startIndex--;
/* printf("==> %d %.6ld %s\n",startIndex,self->expandedDescriptors[idx],self->abbreviation[idx]); */
}
}
startIndex++;
return startIndex;
}
static grib_section* find_section_of_associated_group(grib_section** groupNumberSection,
long* bitmapStartElement,grib_iarray* groupNumberIndex,long bitmapNumber) {
grib_section* section=0;
long indexOfGroupNumber=0;
long jj=bitmapStartElement[bitmapNumber];
indexOfGroupNumber=grib_iarray_get(groupNumberIndex,jj);
section=groupNumberSection[indexOfGroupNumber+1];
return section;
}
static inline void reset_qualifiers(grib_accessor* significanceQualifierGroup[]) {
int i;
for (i=0;i<number_of_qualifiers;i++)
significanceQualifierGroup[i]=0;
}
static inline void reset_deeper_qualifiers(grib_accessor* significanceQualifierGroup[],int* significanceQualifierDepth, int depth) {
int i;
for (i=0;i<number_of_qualifiers;i++) {
if (significanceQualifierDepth[i]>depth) {
significanceQualifierGroup[i]=0;
}
}
}
static int decode_elements(grib_accessor* a) {
int err=0;
grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a;
unsigned char* data =NULL;
int forceGroupClosure=0,forceOneLevelClosure=0;
long i=0,k=0,jj=0;
long pos=0;
long localReference=0,width,j;
long totalNumberOfValues,numberOfValuesPerElement;
double* dvalues;
grib_sarray* svalues = NULL;
size_t n,nn;
int *F,*X,*Y;
char* sval;
long lval = 0;
long groupNumber;
int numberOfElementsToRepeat=0,numberOfRepetitions=0;
int startRepetition=0;
int depth;
int bitmapIndex[10];
long bitmapLength[10]={0,};
long bitmapStartElement[10]={0,};
grib_section* section=0;
grib_section* sectionUp=0;
grib_section* groupSection=0;
grib_iarray* index=0;
grib_iarray* bitmap=0;
/* int count; */
long indexOfReferringElement;
long indexOfGroupNumber;
grib_accessor* gaGroup=0;
grib_action creatorGroup = {0, };
grib_iarray* groupNumberIndex=0;
grib_section* groupNumberSection[1000]={0,};
grib_accessor* significanceQualifierGroup[NUMBER_OF_QUALIFIERS_PER_CATEGORY*NUMBER_OF_QUALIFIERS_CATEGORIES]={0,};
int significanceQualifierDepth[NUMBER_OF_QUALIFIERS_PER_CATEGORY*NUMBER_OF_QUALIFIERS_CATEGORIES]={0,};
grib_handle* h=a->parent->h;
grib_context* c=h->context;
grib_accessor* ga=0;
grib_action creator = {0, };
creator.op = "bufr_data_element";
creator.name_space = "";
creator.flags = GRIB_ACCESSOR_FLAG_DUMP;
creator.set = 0;
creatorGroup.op = "bufr_group";
creatorGroup.name="groupNumber";
creatorGroup.name_space = "";
creatorGroup.flags = GRIB_ACCESSOR_FLAG_DUMP;
creatorGroup.set = 0;
data = (unsigned char*)h->buffer->data;
pos=a->offset*8;
for (i=0;i<10;i++) bitmapIndex[i]=-1;
err=get_descriptors(a);
if (err) return err;
index=grib_iarray_new(c,self->numberOfDescriptors,100);
groupNumberIndex=grib_iarray_new(c,self->numberOfDescriptors,100);
bitmap=grib_iarray_new(c,self->numberOfDescriptors,100);
totalNumberOfValues=self->numberOfDescriptors*self->numberOfDataSubsets;
numberOfValuesPerElement=self->numberOfDataSubsets;
F=grib_context_malloc_clear(c,sizeof(int)*self->numberOfDescriptors);
X=grib_context_malloc_clear(c,sizeof(int)*self->numberOfDescriptors);
Y=grib_context_malloc_clear(c,sizeof(int)*self->numberOfDescriptors);
for (i=0;i<self->numberOfDescriptors;i++) {
F[i]=self->expandedDescriptors[i]/100000;
X[i]=(self->expandedDescriptors[i]-F[i]*100000)/1000;
Y[i]=(self->expandedDescriptors[i]-F[i]*100000)%1000;
}
nn=0;
k=-1;
groupNumber=1;
gaGroup = grib_accessor_factory(a->sub_section, &creatorGroup, 0, NULL);
gaGroup->bufr_group_number=groupNumber;
gaGroup->sub_section=grib_section_create(a->parent->h,gaGroup);
section=gaGroup->sub_section;
sectionUp=a->sub_section;
((grib_accessor_constant*)gaGroup)->type=GRIB_TYPE_LONG;
((grib_accessor_constant*)gaGroup)->dval=groupNumber;
grib_push_accessor(gaGroup,a->sub_section->block);
forceGroupClosure=0;
indexOfGroupNumber=0;
depth=0;
/* count=1; */
/* printf("=================================\n"); */
for (i=0;i<self->numberOfDescriptors;i++) {
if (F[i]==0 && IS_QUALIFIER(X[i]) && self->associatedInfoNumber[i]==0) {
int idx=significanceQualifierIndex(X[i],Y[i]);
groupNumber++;
if (significanceQualifierGroup[idx]) {
groupSection=significanceQualifierGroup[idx]->parent;
depth=significanceQualifierDepth[idx];
reset_deeper_qualifiers(significanceQualifierGroup,significanceQualifierDepth,depth);
forceGroupClosure=0;
} else {
if (forceGroupClosure) {
groupSection=sectionUp;
forceGroupClosure=0;
forceOneLevelClosure=1;
depth=0;
} else {
groupSection=section;
depth++;
}
}
gaGroup = grib_accessor_factory(groupSection, &creatorGroup, 0, NULL);
a->parent->h->groups[groupNumber]=gaGroup;
gaGroup->sub_section=grib_section_create(a->parent->h,gaGroup);
gaGroup->bufr_group_number=groupNumber;
((grib_accessor_constant*)gaGroup)->type=GRIB_TYPE_LONG;
((grib_accessor_constant*)gaGroup)->dval=groupNumber;
grib_push_accessor(gaGroup,groupSection->block);
section=gaGroup->sub_section;
sectionUp=gaGroup->parent;
significanceQualifierGroup[idx]=gaGroup;
significanceQualifierDepth[idx]=depth;
}
if (F[i]==1) {
/* delayed replication */
if (! IS_QUALIFIER(X[i-1])) {
forceGroupClosure=1;
reset_qualifiers(significanceQualifierGroup);
}
numberOfElementsToRepeat=X[i];
nn=numberOfElementsToRepeat;
i++;
localReference=grib_decode_unsigned_long(data,&pos,self->width[i])+self->reference[i];
width=grib_decode_unsigned_long(data,&pos,6);
if (width) {
/* delayed replication number is not constant. NOT IMPLEMENTED */
Assert(0);
} else {
numberOfRepetitions=localReference*self->factor[i];
startRepetition=i;
}
if (self->bitmapNumber[i+1]) {
bitmapLength[self->bitmapNumber[i+1]]=numberOfRepetitions;
bitmapStartElement[self->bitmapNumber[i+1]]=computeBitmapStartElement(self,numberOfRepetitions,index);
}
grib_iarray_push(index,i);
grib_iarray_push(groupNumberIndex,groupNumber);
groupNumberSection[groupNumber]=section;
indexOfGroupNumber=0;
continue;
}
if (self->bitmapNumber[i]) {
/* bitmap extraction */
lval=grib_decode_unsigned_long(data,&pos,1);
width=grib_decode_unsigned_long(data,&pos,6);
if (width) {Assert(0);}
if(bitmapIndex[self->bitmapNumber[i]]==-1)
bitmapIndex[self->bitmapNumber[i]]=grib_iarray_get_used_size(bitmap);
grib_iarray_push(index,i);
grib_iarray_push(groupNumberIndex,groupNumber);
groupNumberSection[groupNumber]=section;
grib_iarray_push(bitmap,lval) ;
k=-1;
jj=0;
} else if (self->associatedBitmapNumber[i]) {
/* bitmap application */
char name[1024]={0,};
if (k==-1) {
k=bitmapIndex[self->associatedBitmapNumber[i]];
jj=bitmapStartElement[self->associatedBitmapNumber[i]];
} else {
k++;
}
indexOfReferringElement=grib_iarray_get(index,jj);
indexOfGroupNumber=grib_iarray_get(groupNumberIndex,jj);
sprintf(name,"%sOf-%s",self->abbreviation[i],self->abbreviation[indexOfReferringElement]);
jj++;
if (grib_iarray_get(bitmap,k)==0) {
creator.name = name;
ga = grib_accessor_factory(section, &creator, 0, NULL);
ga->bufr_group_number=indexOfGroupNumber;
((grib_accessor_bufr_data_element*)ga)->type=GRIB_TYPE_DOUBLE;
lval=grib_decode_unsigned_long(data,&pos,self->width[indexOfReferringElement]);
localReference=lval+self->reference[indexOfReferringElement];
width=grib_decode_unsigned_long(data,&pos,6);
if (width) {
((grib_accessor_bufr_data_element*)ga)->isConstant=0;
n=numberOfValuesPerElement;
} else {
((grib_accessor_bufr_data_element*)ga)->isConstant=1;
n=1;
}
dvalues=grib_context_malloc_clear(c,sizeof(double)*n);
if (((grib_accessor_bufr_data_element*)ga)->isConstant) {
if (!grib_is_all_bits_one(lval,self->width[indexOfReferringElement])) {
dvalues[0]=localReference*self->factor[indexOfReferringElement];
} else dvalues[0]=GRIB_MISSING_DOUBLE;
} else {
for (j=0;j<n;j++) {
lval=grib_decode_unsigned_long(data,&pos,width);
if (!grib_is_all_bits_one(lval,width)) {
dvalues[j]=(localReference+lval)*self->factor[indexOfReferringElement];
} else dvalues[j]=GRIB_MISSING_DOUBLE;
}
}
((grib_accessor_bufr_data_element*)ga)->type=GRIB_TYPE_DOUBLE;
((grib_accessor_bufr_data_element*)ga)->dvalues=dvalues;
((grib_accessor_bufr_data_element*)ga)->numberOfValues=numberOfValuesPerElement;
grib_iarray_push(index,i);
grib_iarray_push(groupNumberIndex,ga->bufr_group_number);
grib_push_accessor(ga,groupNumberSection[ga->bufr_group_number]->block);
} else {
i--;
continue;
}
} else {
if (*(self->type[i])=='s') {
svalues=grib_sarray_new(c,numberOfValuesPerElement,100);
sval=grib_context_malloc_clear(c,self->width[i]/8+1);
grib_decode_string(data,&pos,self->width[i]/8,sval);
grib_sarray_push(c,svalues,sval);
} else {
lval=grib_decode_unsigned_long(data,&pos,self->width[i]);
localReference=lval+self->reference[i];
}
width=grib_decode_unsigned_long(data,&pos,6);
creator.name = self->abbreviation[i];
ga = grib_accessor_factory(section, &creator, 0, NULL);
ga->bufr_group_number=groupNumber;
((grib_accessor_bufr_data_element*)ga)->numberOfValues=numberOfValuesPerElement;
if (width) {
((grib_accessor_bufr_data_element*)ga)->isConstant=0;
n=numberOfValuesPerElement;
} else {
((grib_accessor_bufr_data_element*)ga)->isConstant=1;
n=1;
}
if (*(self->type[i])=='s') {
/* string element */
if (!width) {
width=self->width[i];
n=1;
}
for (j=1;j<n;j++) {
sval=grib_context_malloc_clear(c,width/8+1);
grib_decode_string(data,&pos,width/8,sval);
grib_sarray_push(c,svalues,sval);
}
((grib_accessor_bufr_data_element*)ga)->type=GRIB_TYPE_STRING;
((grib_accessor_bufr_data_element*)ga)->svalues=svalues;
} else {
dvalues=grib_context_malloc_clear(c,sizeof(double)*n);
if (((grib_accessor_bufr_data_element*)ga)->isConstant) {
if (!grib_is_all_bits_one(lval,self->width[i])) {
dvalues[0]=localReference*self->factor[i];
} else dvalues[0]=GRIB_MISSING_DOUBLE;
} else {
for (j=0;j<n;j++) {
lval=grib_decode_unsigned_long(data,&pos,width);
if (!grib_is_all_bits_one(lval,width)) {
dvalues[j]=(localReference+lval)*self->factor[i];
} else dvalues[j]=GRIB_MISSING_DOUBLE;
}
}
((grib_accessor_bufr_data_element*)ga)->type=GRIB_TYPE_DOUBLE;
((grib_accessor_bufr_data_element*)ga)->dvalues=dvalues;
if (*(self->type[i])=='l')
((grib_accessor_bufr_data_element*)ga)->type=GRIB_TYPE_LONG;
}
grib_iarray_push(index,i);
grib_iarray_push(groupNumberIndex,groupNumber);
groupNumberSection[groupNumber]=section;
/* printf("==== %s %ld\n",ga->name,ga->bufr_group_number); */
if (self->associatedInfoNumber[i]) {
grib_section* sectionOfAssociatedGroup=find_section_of_associated_group(groupNumberSection,
bitmapStartElement,groupNumberIndex,self->associatedInfoNumber[i]);
if (!sectionOfAssociatedGroup) sectionOfAssociatedGroup=section;
push_units_accessor(sectionOfAssociatedGroup,a,sectionOfAssociatedGroup->block->first->bufr_group_number,i);
ga->bufr_group_number=sectionOfAssociatedGroup->block->first->bufr_group_number;
grib_push_accessor(ga,sectionOfAssociatedGroup->block);
} else {
push_units_accessor(section,a,groupNumber,i);
grib_push_accessor(ga,section->block);
}
k=-1;
jj=0;
}
/* delayed repetition check */
if (numberOfRepetitions) {
if (nn>1) {
nn--;
} else {
nn=numberOfElementsToRepeat;
numberOfRepetitions--;
if (numberOfRepetitions) i=startRepetition;
}
}
}
grib_iarray_delete(index);
grib_iarray_delete(bitmap);
grib_iarray_delete(groupNumberIndex);
grib_context_free(c,F);
grib_context_free(c,X);
grib_context_free(c,Y);
return err;
}
static void dump(grib_accessor* a, grib_dumper* dumper)
{
get_elements_and_decode(a);
a->parent->h->unpacked=1;
grib_dump_section(dumper,a,a->sub_section->block);
return;
}
static int value_count(grib_accessor* a,long* count)
{
int err=0;
grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a;
grib_handle* h=a->parent->h;
err=get_descriptors(a);
if (err) return err;
grib_get_long(h,self->numberOfDataSubsetsName,&(self->numberOfDataSubsets));
*count=self->numberOfElements*self->numberOfDataSubsets;
return err;
}
static int unpack_double(grib_accessor* a, double* val, size_t *len) {
int err=0;
err=get_elements_and_decode(a);
if (err) return err;
a->parent->h->unpacked=1;
if (!val) return GRIB_SUCCESS;
else return GRIB_NOT_IMPLEMENTED;
}
static int get_elements_and_decode(grib_accessor* a) {
grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a;
int err=0;
if (self->do_compute) {
err=decode_elements(a);
self->do_compute=0;
}
return err;
}
static void destroy(grib_context* c,grib_accessor* a) {
grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a;
self_clear(c,self);
grib_section_delete(c,a->sub_section);
}

View File

@ -63,7 +63,7 @@ static grib_accessor_class _grib_accessor_class_bytes = {
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -82,7 +82,7 @@ static grib_accessor_class _grib_accessor_class_change_scanning_direction = {
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -72,7 +72,7 @@ static grib_accessor_class _grib_accessor_class_codeflag = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -101,7 +101,7 @@ static grib_accessor_class _grib_accessor_class_codetable = {
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -69,7 +69,7 @@ static grib_accessor_class _grib_accessor_class_codetable_title = {
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -69,7 +69,7 @@ static grib_accessor_class _grib_accessor_class_codetable_units = {
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -81,7 +81,7 @@ static grib_accessor_class _grib_accessor_class_concept = {
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -72,7 +72,7 @@ static grib_accessor_class _grib_accessor_class_constant = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -65,7 +65,7 @@ static grib_accessor_class _grib_accessor_class_count_file = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -70,7 +70,7 @@ static grib_accessor_class _grib_accessor_class_count_missing = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -67,7 +67,7 @@ static grib_accessor_class _grib_accessor_class_count_total = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -121,7 +121,7 @@ static grib_accessor_class _grib_accessor_class_data_2order_packing = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -78,7 +78,7 @@ static grib_accessor_class _grib_accessor_class_data_2order_packing_count = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -81,7 +81,7 @@ static grib_accessor_class _grib_accessor_class_data_apply_bitmap = {
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -79,7 +79,7 @@ static grib_accessor_class _grib_accessor_class_data_apply_boustrophedonic = {
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -59,9 +59,9 @@ typedef struct grib_accessor_data_apply_boustrophedonic_bitmap {
const char* bitmap;
const char* missing_value;
const char* binary_scale_factor;
const char* numberOfRows;
const char* numberOfColumns;
const char* numberOfPoints;
const char* numberOfRows;
const char* numberOfColumns;
const char* numberOfPoints;
} grib_accessor_data_apply_boustrophedonic_bitmap;
extern grib_accessor_class* grib_accessor_class_gen;
@ -84,7 +84,7 @@ static grib_accessor_class _grib_accessor_class_data_apply_boustrophedonic_bitma
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */
@ -125,7 +125,7 @@ static void init_class(grib_accessor_class* c)
c->unpack_long = (*(c->super))->unpack_long;
c->pack_string = (*(c->super))->pack_string;
c->unpack_string = (*(c->super))->unpack_string;
c->pack_string_array = (*(c->super))->pack_string_array;
c->pack_string_array = (*(c->super))->pack_string_array;
c->unpack_string_array = (*(c->super))->unpack_string_array;
c->pack_bytes = (*(c->super))->pack_bytes;
c->unpack_bytes = (*(c->super))->unpack_bytes;

View File

@ -89,7 +89,7 @@ static grib_accessor_class _grib_accessor_class_data_apply_gdsnotpresent = {
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -103,7 +103,7 @@ static grib_accessor_class _grib_accessor_class_data_complex_packing = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -78,7 +78,7 @@ static grib_accessor_class _grib_accessor_class_data_constant_field = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -93,7 +93,7 @@ static grib_accessor_class _grib_accessor_class_data_dummy_field = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -100,7 +100,7 @@ static grib_accessor_class _grib_accessor_class_data_g1complex_packing = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -115,7 +115,7 @@ static grib_accessor_class _grib_accessor_class_data_g1second_order_constant_wid
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -136,7 +136,7 @@ static grib_accessor_class _grib_accessor_class_data_g1second_order_general_exte
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -115,7 +115,7 @@ static grib_accessor_class _grib_accessor_class_data_g1second_order_general_pack
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -115,7 +115,7 @@ static grib_accessor_class _grib_accessor_class_data_g1second_order_row_by_row_p
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -70,7 +70,7 @@ static grib_accessor_class _grib_accessor_class_data_g1secondary_bitmap = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -65,7 +65,7 @@ static grib_accessor_class _grib_accessor_class_data_g1shsimple_packing = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -88,7 +88,7 @@ static grib_accessor_class _grib_accessor_class_data_g1simple_packing = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -113,7 +113,7 @@ static grib_accessor_class _grib_accessor_class_data_g22order_packing = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -93,7 +93,7 @@ static grib_accessor_class _grib_accessor_class_data_g2complex_packing = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -70,7 +70,7 @@ static grib_accessor_class _grib_accessor_class_data_g2secondary_bitmap = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -71,7 +71,7 @@ static grib_accessor_class _grib_accessor_class_data_g2shsimple_packing = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -82,7 +82,7 @@ static grib_accessor_class _grib_accessor_class_data_g2simple_packing = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -97,7 +97,7 @@ static grib_accessor_class _grib_accessor_class_data_g2simple_packing_with_prepr
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -102,7 +102,7 @@ static grib_accessor_class _grib_accessor_class_data_jpeg2000_packing = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -94,7 +94,7 @@ static grib_accessor_class _grib_accessor_class_data_png_packing = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -83,7 +83,7 @@ static grib_accessor_class _grib_accessor_class_data_raw_packing = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -72,7 +72,7 @@ static grib_accessor_class _grib_accessor_class_data_secondary_bitmap = {
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -101,7 +101,7 @@ static grib_accessor_class _grib_accessor_class_data_sh_packed = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -101,7 +101,7 @@ static grib_accessor_class _grib_accessor_class_data_sh_unpacked = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -70,7 +70,7 @@ static grib_accessor_class _grib_accessor_class_data_shsimple_packing = {
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -98,7 +98,7 @@ static grib_accessor_class _grib_accessor_class_data_simple_packing = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -49,7 +49,7 @@ or edit "accessor.class" and rerun ./make_class.pl
static int pack_double(grib_accessor*, const double* val,size_t *len);
static int unpack_double(grib_accessor*, double* val,size_t *len);
static int value_count(grib_accessor*, long*);
static int value_count(grib_accessor*,long*);
static void init(grib_accessor*,const long, grib_arguments* );
static void init_class(grib_accessor_class*);
@ -95,13 +95,15 @@ static grib_accessor_class _grib_accessor_class_data_szip_packing = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */
&unpack_double, /* grib_unpack procedures double */
0, /* grib_pack procedures string */
0, /* grib_unpack procedures string */
0, /* grib_pack array procedures string */
0, /* grib_unpack array procedures string */
0, /* grib_pack procedures bytes */
0, /* grib_unpack procedures bytes */
0, /* pack_expression */
@ -136,6 +138,8 @@ static void init_class(grib_accessor_class* c)
c->unpack_long = (*(c->super))->unpack_long;
c->pack_string = (*(c->super))->pack_string;
c->unpack_string = (*(c->super))->unpack_string;
c->pack_string_array = (*(c->super))->pack_string_array;
c->unpack_string_array = (*(c->super))->unpack_string_array;
c->pack_bytes = (*(c->super))->pack_bytes;
c->unpack_bytes = (*(c->super))->unpack_bytes;
c->pack_expression = (*(c->super))->pack_expression;

View File

@ -74,7 +74,7 @@ static grib_accessor_class _grib_accessor_class_decimal_precision = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -69,7 +69,7 @@ static grib_accessor_class _grib_accessor_class_dirty = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -70,7 +70,7 @@ static grib_accessor_class _grib_accessor_class_divdouble = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -70,7 +70,7 @@ static grib_accessor_class _grib_accessor_class_double = {
&get_native_type, /* get native type */
0, /* get sub_section */
&pack_missing, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -72,7 +72,7 @@ static grib_accessor_class _grib_accessor_class_element = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -65,7 +65,7 @@ static grib_accessor_class _grib_accessor_class_evaluate = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -61,7 +61,7 @@ static grib_accessor_class _grib_accessor_class_forward = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -72,7 +72,7 @@ static grib_accessor_class _grib_accessor_class_from_scale_factor_scaled_value =
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
&is_missing, /* grib_pack procedures long */
&is_missing, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -68,7 +68,7 @@ static grib_accessor_class _grib_accessor_class_g1_half_byte_codeflag = {
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -77,7 +77,7 @@ static grib_accessor_class _grib_accessor_class_g1_increment = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -68,7 +68,7 @@ static grib_accessor_class _grib_accessor_class_g1_message_length = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -68,7 +68,7 @@ static grib_accessor_class _grib_accessor_class_g1_section4_length = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -76,7 +76,7 @@ static grib_accessor_class _grib_accessor_class_g1area = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -72,7 +72,7 @@ static grib_accessor_class _grib_accessor_class_g1bitmap = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -79,7 +79,7 @@ static grib_accessor_class _grib_accessor_class_g1date = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -70,7 +70,7 @@ static grib_accessor_class _grib_accessor_class_g1day_of_the_year_date = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -71,7 +71,7 @@ static grib_accessor_class _grib_accessor_class_g1end_of_interval_monthly = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -71,7 +71,7 @@ static grib_accessor_class _grib_accessor_class_g1fcperiod = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -75,7 +75,7 @@ static grib_accessor_class _grib_accessor_class_g1forecastmonth = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -71,7 +71,7 @@ static grib_accessor_class _grib_accessor_class_g1monthlydate = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -81,7 +81,7 @@ static grib_accessor_class _grib_accessor_class_g1number_of_coded_values_sh_comp
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -75,7 +75,7 @@ static grib_accessor_class _grib_accessor_class_g1number_of_coded_values_sh_simp
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -74,7 +74,7 @@ static grib_accessor_class _grib_accessor_class_g1p1p2 = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -67,7 +67,7 @@ static grib_accessor_class _grib_accessor_class_g1param = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -93,7 +93,7 @@ static grib_accessor_class _grib_accessor_class_g1step_range = {
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -70,7 +70,7 @@ static grib_accessor_class _grib_accessor_class_g1verificationdate = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -71,13 +71,15 @@ static grib_accessor_class _grib_accessor_class_g2_chemical = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */
0, /* grib_unpack procedures double */
0, /* grib_pack procedures string */
0, /* grib_unpack procedures string */
0, /* grib_pack array procedures string */
0, /* grib_unpack array procedures string */
0, /* grib_pack procedures bytes */
0, /* grib_unpack procedures bytes */
0, /* pack_expression */
@ -112,6 +114,8 @@ static void init_class(grib_accessor_class* c)
c->unpack_double = (*(c->super))->unpack_double;
c->pack_string = (*(c->super))->pack_string;
c->unpack_string = (*(c->super))->unpack_string;
c->pack_string_array = (*(c->super))->pack_string_array;
c->unpack_string_array = (*(c->super))->unpack_string_array;
c->pack_bytes = (*(c->super))->pack_bytes;
c->unpack_bytes = (*(c->super))->unpack_bytes;
c->pack_expression = (*(c->super))->pack_expression;

View File

@ -82,7 +82,7 @@ static grib_accessor_class _grib_accessor_class_g2_eps = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -93,7 +93,7 @@ static grib_accessor_class _grib_accessor_class_g2_mars_labeling = {
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -71,7 +71,7 @@ static grib_accessor_class _grib_accessor_class_g2bitmap = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -69,7 +69,7 @@ static grib_accessor_class _grib_accessor_class_g2bitmap_present = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -72,7 +72,7 @@ static grib_accessor_class _grib_accessor_class_g2date = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -104,7 +104,7 @@ static grib_accessor_class _grib_accessor_class_g2end_step = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -85,7 +85,7 @@ static grib_accessor_class _grib_accessor_class_g2grid = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -76,7 +76,7 @@ static grib_accessor_class _grib_accessor_class_g2latlon = {
0, /* get native type */
0, /* get sub_section */
&pack_missing, /* grib_pack procedures long */
&is_missing, /* grib_pack procedures long */
&is_missing, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -37,8 +37,8 @@ or edit "accessor.class" and rerun ./make_class.pl
*/
static int is_missing(grib_accessor*);
static int pack_long(grib_accessor*, const long* val,size_t *len);
static int pack_double(grib_accessor*, const double* val,size_t *len);
static int pack_long(grib_accessor*, const long* val,size_t *len);
static int unpack_double(grib_accessor*, double* val,size_t *len);
static int unpack_long(grib_accessor*, long* val,size_t *len);
static void dump(grib_accessor*, grib_dumper*);
@ -76,11 +76,11 @@ static grib_accessor_class _grib_accessor_class_g2level = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
&is_missing, /* grib_pack procedures long */
&is_missing, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */
&unpack_double, /* grib_unpack procedures double */
&pack_double, /* grib_pack procedures double */
&unpack_double, /* grib_unpack procedures double */
0, /* grib_pack procedures string */
0, /* grib_unpack procedures string */
0, /* grib_pack array procedures string */

View File

@ -69,7 +69,7 @@ static grib_accessor_class _grib_accessor_class_g2lon = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */

View File

@ -68,7 +68,7 @@ static grib_accessor_class _grib_accessor_class_g2step = {
0, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

View File

@ -78,7 +78,7 @@ static grib_accessor_class _grib_accessor_class_g2step_range = {
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
&pack_long, /* grib_pack procedures long */
&unpack_long, /* grib_unpack procedures long */
0, /* grib_pack procedures double */

Some files were not shown because too many files have changed in this diff Show More