mirror of https://github.com/ecmwf/eccodes.git
ECC-1063: Apply consistent code style to source
This commit is contained in:
parent
c9ab23baf7
commit
1975eae139
108
src/eccodes.h
108
src/eccodes.h
|
@ -181,13 +181,13 @@ typedef struct grib_util_packing_spec codes_util_packing_spec;
|
||||||
typedef struct grib_util_grid_spec codes_util_grid_spec;
|
typedef struct grib_util_grid_spec codes_util_grid_spec;
|
||||||
|
|
||||||
|
|
||||||
codes_fieldset *codes_fieldset_new_from_files(codes_context *c, char *filenames[], int nfiles, char **keys, int nkeys, const char *where_string, const char *order_by_string, int *err);
|
codes_fieldset* codes_fieldset_new_from_files(codes_context* c, char* filenames[], int nfiles, char** keys, int nkeys, const char* where_string, const char* order_by_string, int* err);
|
||||||
|
|
||||||
void codes_fieldset_delete(codes_fieldset* set);
|
void codes_fieldset_delete(codes_fieldset* set);
|
||||||
void codes_fieldset_rewind(codes_fieldset* set);
|
void codes_fieldset_rewind(codes_fieldset* set);
|
||||||
int codes_fieldset_apply_order_by(codes_fieldset* set, const char* order_by_string);
|
int codes_fieldset_apply_order_by(codes_fieldset* set, const char* order_by_string);
|
||||||
codes_handle* codes_fieldset_next_handle(codes_fieldset* set, int* err);
|
codes_handle* codes_fieldset_next_handle(codes_fieldset* set, int* err);
|
||||||
int codes_fieldset_count(codes_fieldset *set);
|
int codes_fieldset_count(codes_fieldset* set);
|
||||||
int codes_values_check(codes_handle* h, codes_values* values, int count);
|
int codes_values_check(codes_handle* h, codes_values* values, int count);
|
||||||
|
|
||||||
/*! \defgroup codes_index The indexing feature
|
/*! \defgroup codes_index The indexing feature
|
||||||
|
@ -214,7 +214,7 @@ typedef struct grib_index codes_index;
|
||||||
* @param err : 0 if OK, integer value on error
|
* @param err : 0 if OK, integer value on error
|
||||||
* @return the newly created index
|
* @return the newly created index
|
||||||
*/
|
*/
|
||||||
codes_index* codes_index_new_from_file(codes_context* c, char* filename, const char* keys, int *err);
|
codes_index* codes_index_new_from_file(codes_context* c, char* filename, const char* keys, int* err);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new index based on a set of keys.
|
* Create a new index based on a set of keys.
|
||||||
|
@ -228,7 +228,7 @@ codes_index* codes_index_new_from_file(codes_context* c, char* filename, const c
|
||||||
* @param err : 0 if OK, integer value on error
|
* @param err : 0 if OK, integer value on error
|
||||||
* @return the newly created index
|
* @return the newly created index
|
||||||
*/
|
*/
|
||||||
codes_index* codes_index_new(codes_context* c, const char* keys, int *err);
|
codes_index* codes_index_new(codes_context* c, const char* keys, int* err);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indexes the file given in argument in the index given in argument.
|
* Indexes the file given in argument in the index given in argument.
|
||||||
|
@ -237,9 +237,9 @@ codes_index* codes_index_new(codes_context* c, const char* keys, int *err);
|
||||||
* @param filename : name of the file of messages to be indexed
|
* @param filename : name of the file of messages to be indexed
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_index_add_file(codes_index* index, const char *filename);
|
int codes_index_add_file(codes_index* index, const char* filename);
|
||||||
int codes_index_write(codes_index* index, const char *filename);
|
int codes_index_write(codes_index* index, const char* filename);
|
||||||
codes_index* codes_index_read(codes_context* c, const char* filename, int *err);
|
codes_index* codes_index_read(codes_context* c, const char* filename, int* err);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the number of distinct values of the key in argument contained in the index. The key must belong to the index.
|
* Get the number of distinct values of the key in argument contained in the index. The key must belong to the index.
|
||||||
|
@ -262,7 +262,7 @@ int codes_index_get_size(const codes_index* index, const char* key, size_t* size
|
||||||
* @param size : size of the values array
|
* @param size : size of the values array
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_index_get_long(const codes_index* index, const char* key, long* values, size_t *size);
|
int codes_index_get_long(const codes_index* index, const char* key, long* values, size_t* size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as double or when the native type of the key is double.
|
* Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as double or when the native type of the key is double.
|
||||||
|
@ -274,7 +274,7 @@ int codes_index_get_long(const codes_index* index, const char* key, long* values
|
||||||
* @param size : size of the values array
|
* @param size : size of the values array
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_index_get_double(const codes_index* index, const char* key, double* values, size_t *size);
|
int codes_index_get_double(const codes_index* index, const char* key, double* values, size_t* size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as string or when the native type of the key is string.
|
* Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as string or when the native type of the key is string.
|
||||||
|
@ -286,7 +286,7 @@ int codes_index_get_double(const codes_index* index, const char* key, double* va
|
||||||
* @param size : size of the values array
|
* @param size : size of the values array
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_index_get_string(const codes_index* index, const char* key, char** values, size_t *size);
|
int codes_index_get_string(const codes_index* index, const char* key, char** values, size_t* size);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -331,7 +331,7 @@ int codes_index_select_string(codes_index* index, const char* key, char* value);
|
||||||
* @param err : 0 if OK, integer value on error. CODES_END_OF_INDEX when no more handles are contained in the index.
|
* @param err : 0 if OK, integer value on error. CODES_END_OF_INDEX when no more handles are contained in the index.
|
||||||
* @return grib handle.
|
* @return grib handle.
|
||||||
*/
|
*/
|
||||||
codes_handle* codes_handle_new_from_index(codes_index* index, int *err);
|
codes_handle* codes_handle_new_from_index(codes_index* index, int* err);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the index.
|
* Delete the index.
|
||||||
|
@ -417,7 +417,7 @@ codes_handle* codes_bufr_handle_new_from_file(codes_context* c, FILE* f, int* er
|
||||||
*/
|
*/
|
||||||
int codes_write_message(const codes_handle* h, const char* file, const char* mode);
|
int codes_write_message(const codes_handle* h, const char* file, const char* mode);
|
||||||
|
|
||||||
codes_handle* codes_grib_util_sections_copy(codes_handle* hfrom, codes_handle* hto, int what, int *err);
|
codes_handle* codes_grib_util_sections_copy(codes_handle* hfrom, codes_handle* hto, int what, int* err);
|
||||||
codes_string_list* codes_grib_util_get_param_id(const char* mars_param);
|
codes_string_list* codes_grib_util_get_param_id(const char* mars_param);
|
||||||
codes_string_list* codes_grib_util_get_mars_param(const char* param_id);
|
codes_string_list* codes_grib_util_get_mars_param(const char* param_id);
|
||||||
|
|
||||||
|
@ -444,7 +444,7 @@ codes_handle* codes_handle_new_from_message(codes_context* c, const void* data,
|
||||||
* @return the new handle, NULL if the message is invalid or a problem is encountered
|
* @return the new handle, NULL if the message is invalid or a problem is encountered
|
||||||
*/
|
*/
|
||||||
codes_handle* codes_grib_handle_new_from_multi_message(codes_context* c, void** data,
|
codes_handle* codes_grib_handle_new_from_multi_message(codes_context* c, void** data,
|
||||||
size_t *data_len, int* error);
|
size_t* data_len, int* error);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a handle from a user message. The message is copied and will be freed with the handle
|
* Create a handle from a user message. The message is copied and will be freed with the handle
|
||||||
|
@ -552,7 +552,7 @@ int codes_grib_multi_handle_write(codes_multi_handle* mh, FILE* f);
|
||||||
* @param message_length : On exit, the message size in number of bytes
|
* @param message_length : On exit, the message size in number of bytes
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_get_message(const codes_handle* h, const void** message, size_t *message_length);
|
int codes_get_message(const codes_handle* h, const void** message, size_t* message_length);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -564,7 +564,7 @@ int codes_get_message(const codes_handle* h, const void** message, size_t *messa
|
||||||
* On exit, the actual message length in number of bytes
|
* On exit, the actual message length in number of bytes
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_get_message_copy(const codes_handle* h, void* message, size_t *message_length);
|
int codes_get_message_copy(const codes_handle* h, void* message, size_t* message_length);
|
||||||
/*! @} */
|
/*! @} */
|
||||||
|
|
||||||
/*! \defgroup iterators Iterating on latitude/longitude/values */
|
/*! \defgroup iterators Iterating on latitude/longitude/values */
|
||||||
|
@ -591,7 +591,7 @@ codes_iterator* codes_grib_iterator_new(const codes_handle* h, unsigned long fla
|
||||||
* @param values : returned array of data values
|
* @param values : returned array of data values
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_grib_get_data(const codes_handle *h, double *lats, double *lons, double *values);
|
int codes_grib_get_data(const codes_handle* h, double* lats, double* lons, double* values);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the next value from a geoiterator.
|
* Get the next value from a geoiterator.
|
||||||
|
@ -602,7 +602,7 @@ int codes_grib_get_data(const codes_handle *h, double *lats, double *lons, doubl
|
||||||
* @param value : on output value of the point
|
* @param value : on output value of the point
|
||||||
* @return positive value if successful, 0 if no more data are available
|
* @return positive value if successful, 0 if no more data are available
|
||||||
*/
|
*/
|
||||||
int codes_grib_iterator_next(codes_iterator *i, double* lat, double* lon, double* value);
|
int codes_grib_iterator_next(codes_iterator* i, double* lat, double* lon, double* value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the previous value from a geoiterator.
|
* Get the previous value from a geoiterator.
|
||||||
|
@ -613,7 +613,7 @@ int codes_grib_iterator_next(codes_iterator *i, double* lat, double* lon, double
|
||||||
* @param value : on output value of the point*
|
* @param value : on output value of the point*
|
||||||
* @return positive value if successful, 0 if no more data are available
|
* @return positive value if successful, 0 if no more data are available
|
||||||
*/
|
*/
|
||||||
int codes_grib_iterator_previous(codes_iterator *i, double* lat, double* lon, double* value);
|
int codes_grib_iterator_previous(codes_iterator* i, double* lat, double* lon, double* value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test procedure for values in a geoiterator.
|
* Test procedure for values in a geoiterator.
|
||||||
|
@ -621,7 +621,7 @@ int codes_grib_iterator_previous(codes_iterator *i, double* lat, double* lon, do
|
||||||
* @param i : the geoiterator
|
* @param i : the geoiterator
|
||||||
* @return boolean, 1 if the iterator still nave next values, 0 otherwise
|
* @return boolean, 1 if the iterator still nave next values, 0 otherwise
|
||||||
*/
|
*/
|
||||||
int codes_grib_iterator_has_next(codes_iterator *i);
|
int codes_grib_iterator_has_next(codes_iterator* i);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test procedure for values in a geoiterator.
|
* Test procedure for values in a geoiterator.
|
||||||
|
@ -629,7 +629,7 @@ int codes_grib_iterator_has_next(codes_iterator *i);
|
||||||
* @param i : the geoiterator
|
* @param i : the geoiterator
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_grib_iterator_reset(codes_iterator *i);
|
int codes_grib_iterator_reset(codes_iterator* i);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Frees the geoiterator from memory.
|
* Frees the geoiterator from memory.
|
||||||
|
@ -637,7 +637,7 @@ int codes_grib_iterator_reset(codes_iterator *i);
|
||||||
* @param i : the geoiterator
|
* @param i : the geoiterator
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_grib_iterator_delete(codes_iterator *i);
|
int codes_grib_iterator_delete(codes_iterator* i);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Create a new nearest neighbour object from a handle, using current geometry.
|
* \brief Create a new nearest neighbour object from a handle, using current geometry.
|
||||||
|
@ -669,9 +669,9 @@ codes_nearest* codes_grib_nearest_new(const codes_handle* h, int* error);
|
||||||
* @param len : size of the arrays
|
* @param len : size of the arrays
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_grib_nearest_find(codes_nearest *nearest, const codes_handle* h, double inlat, double inlon,
|
int codes_grib_nearest_find(codes_nearest* nearest, const codes_handle* h, double inlat, double inlon,
|
||||||
unsigned long flags, double* outlats, double* outlons,
|
unsigned long flags, double* outlats, double* outlons,
|
||||||
double* values, double* distances, int* indexes, size_t *len);
|
double* values, double* distances, int* indexes, size_t* len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Frees an nearest from memory
|
* Frees an nearest from memory
|
||||||
|
@ -679,7 +679,7 @@ int codes_grib_nearest_find(codes_nearest *nearest, const codes_handle* h, doubl
|
||||||
* @param nearest : the nearest
|
* @param nearest : the nearest
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_grib_nearest_delete(codes_nearest *nearest);
|
int codes_grib_nearest_delete(codes_nearest* nearest);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find the nearest point of a set of points whose latitudes and longitudes
|
* Find the nearest point of a set of points whose latitudes and longitudes
|
||||||
|
@ -733,7 +733,7 @@ int codes_get_offset(const codes_handle* h, const char* key, size_t* offset);
|
||||||
* @param size : the address of a size_t where the size will be set
|
* @param size : the address of a size_t where the size will be set
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_get_size(const codes_handle* h, const char* key, size_t *size);
|
int codes_get_size(const codes_handle* h, const char* key, size_t* size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the length of the string representation of the key, if several keys of the same name are present, the maximum length is returned
|
* Get the length of the string representation of the key, if several keys of the same name are present, the maximum length is returned
|
||||||
|
@ -743,7 +743,7 @@ int codes_get_size(const codes_handle* h, const char* key, size_t *size);
|
||||||
* @param length : the address of a size_t where the length will be set
|
* @param length : the address of a size_t where the length will be set
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_get_length(const codes_handle* h, const char* key, size_t *length);
|
int codes_get_length(const codes_handle* h, const char* key, size_t* length);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a long value from a key, if several keys of the same name are present, the last one is returned
|
* Get a long value from a key, if several keys of the same name are present, the last one is returned
|
||||||
|
@ -800,7 +800,7 @@ int codes_get_double_elements(const codes_handle* h, const char* key, int* i, lo
|
||||||
* @param length : the address of a size_t that contains allocated length of the string on input, and that contains the actual length of the string on output
|
* @param length : the address of a size_t that contains allocated length of the string on input, and that contains the actual length of the string on output
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_get_string(const codes_handle* h, const char* key, char* mesg, size_t *length);
|
int codes_get_string(const codes_handle* h, const char* key, char* mesg, size_t* length);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get string array values from a key. If several keys of the same name are present, the last one is returned
|
* Get string array values from a key. If several keys of the same name are present, the last one is returned
|
||||||
|
@ -812,7 +812,7 @@ int codes_get_string(const codes_handle* h, const char* key, char* mesg, size_t
|
||||||
* @param length : the address of a size_t that contains allocated length of the array on input, and that contains the actual length of the array on output
|
* @param length : the address of a size_t that contains allocated length of the array on input, and that contains the actual length of the array on output
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_get_string_array(const codes_handle* h, const char* key, char** vals, size_t *length);
|
int codes_get_string_array(const codes_handle* h, const char* key, char** vals, size_t* length);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get raw bytes values from a key. If several keys of the same name are present, the last one is returned
|
* Get raw bytes values from a key. If several keys of the same name are present, the last one is returned
|
||||||
|
@ -824,7 +824,7 @@ int codes_get_string_array(const codes_handle* h, const char* key, char** vals,
|
||||||
* @param length : the address of a size_t that contains allocated length of the byte array on input, and that contains the actual length of the byte array on output
|
* @param length : the address of a size_t that contains allocated length of the byte array on input, and that contains the actual length of the byte array on output
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_get_bytes(const codes_handle* h, const char* key, unsigned char* bytes, size_t *length);
|
int codes_get_bytes(const codes_handle* h, const char* key, unsigned char* bytes, size_t* length);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get double array values from a key. If several keys of the same name are present, the last one is returned
|
* Get double array values from a key. If several keys of the same name are present, the last one is returned
|
||||||
|
@ -836,7 +836,7 @@ int codes_get_bytes(const codes_handle* h, const char* key, unsigned char* bytes
|
||||||
* @param length : the address of a size_t that contains allocated length of the double array on input, and that contains the actual length of the double array on output
|
* @param length : the address of a size_t that contains allocated length of the double array on input, and that contains the actual length of the double array on output
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_get_double_array(const codes_handle* h, const char* key, double* vals, size_t *length);
|
int codes_get_double_array(const codes_handle* h, const char* key, double* vals, size_t* length);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get long array values from a key. If several keys of the same name are present, the last one is returned
|
* Get long array values from a key. If several keys of the same name are present, the last one is returned
|
||||||
|
@ -848,7 +848,7 @@ int codes_get_double_array(const codes_handle* h, const char* key, double* vals,
|
||||||
* @param length : the address of a size_t that contains allocated length of the long array on input, and that contains the actual length of the long array on output
|
* @param length : the address of a size_t that contains allocated length of the long array on input, and that contains the actual length of the long array on output
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_get_long_array(const codes_handle* h, const char* key, long* vals, size_t *length);
|
int codes_get_long_array(const codes_handle* h, const char* key, long* vals, size_t* length);
|
||||||
|
|
||||||
|
|
||||||
/* setting data */
|
/* setting data */
|
||||||
|
@ -895,7 +895,7 @@ int codes_set_double(codes_handle* h, const char* key, double val);
|
||||||
* @param length : the address of a size_t that contains the length of the string on input, and that contains the actual packed length of the string on output
|
* @param length : the address of a size_t that contains the length of the string on input, and that contains the actual packed length of the string on output
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_set_string(codes_handle* h, const char* key , const char* mesg, size_t *length);
|
int codes_set_string(codes_handle* h, const char* key, const char* mesg, size_t* length);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a bytes array from a key. If several keys of the same name are present, the last one is set
|
* Set a bytes array from a key. If several keys of the same name are present, the last one is set
|
||||||
|
@ -907,7 +907,7 @@ int codes_set_string(codes_handle* h, const char* key , const char* mesg, size_
|
||||||
* @param length : the address of a size_t that contains the length of the byte array on input, and that contains the actual packed length of the byte array on output
|
* @param length : the address of a size_t that contains the length of the byte array on input, and that contains the actual packed length of the byte array on output
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_set_bytes(codes_handle* h, const char* key, const unsigned char* bytes, size_t *length);
|
int codes_set_bytes(codes_handle* h, const char* key, const unsigned char* bytes, size_t* length);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a double array from a key. If several keys of the same name are present, the last one is set
|
* Set a double array from a key. If several keys of the same name are present, the last one is set
|
||||||
|
@ -950,7 +950,7 @@ int codes_set_long_array(codes_handle* h, const char* key, const long* vals, siz
|
||||||
* @param length : a size_t that contains the length of the array on input
|
* @param length : a size_t that contains the length of the array on input
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int codes_set_string_array(codes_handle *h, const char *key, const char **vals, size_t length);
|
int codes_set_string_array(codes_handle* h, const char* key, const char** vals, size_t length);
|
||||||
/*! @} */
|
/*! @} */
|
||||||
|
|
||||||
|
|
||||||
|
@ -1088,8 +1088,8 @@ void codes_grib_multi_support_off(codes_context* c);
|
||||||
*/
|
*/
|
||||||
void codes_grib_multi_support_reset_file(codes_context* c, FILE* f);
|
void codes_grib_multi_support_reset_file(codes_context* c, FILE* f);
|
||||||
|
|
||||||
char* codes_samples_path(const codes_context *c);
|
char* codes_samples_path(const codes_context* c);
|
||||||
char* codes_definition_path(const codes_context *c);
|
char* codes_definition_path(const codes_context* c);
|
||||||
/*! @} */
|
/*! @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1140,7 +1140,7 @@ codes_keys_iterator* codes_keys_iterator_new(codes_handle* h, unsigned long filt
|
||||||
* structure as the aim is to copy what is possible to be copied.
|
* structure as the aim is to copy what is possible to be copied.
|
||||||
* This will allow the user to add something to a message by creating a new message with additions or changes to the
|
* This will allow the user to add something to a message by creating a new message with additions or changes to the
|
||||||
* unexpandedDescriptors and copying what is possible to copy from the original message. */
|
* unexpandedDescriptors and copying what is possible to copy from the original message. */
|
||||||
char **codes_bufr_copy_data_return_copied_keys(codes_handle *hin, codes_handle *hout, size_t *nkeys, int *err);
|
char** codes_bufr_copy_data_return_copied_keys(codes_handle* hin, codes_handle* hout, size_t* nkeys, int* err);
|
||||||
int codes_bufr_copy_data(codes_handle* hin, codes_handle* hout);
|
int codes_bufr_copy_data(codes_handle* hin, codes_handle* hout);
|
||||||
|
|
||||||
|
|
||||||
|
@ -1148,14 +1148,14 @@ int codes_bufr_copy_data(codes_handle* hin, codes_handle* hout);
|
||||||
* @param kiter : valid codes_keys_iterator
|
* @param kiter : valid codes_keys_iterator
|
||||||
* @return 1 if next iterator exists, 0 if no more elements to iterate on
|
* @return 1 if next iterator exists, 0 if no more elements to iterate on
|
||||||
*/
|
*/
|
||||||
int codes_keys_iterator_next(codes_keys_iterator *kiter);
|
int codes_keys_iterator_next(codes_keys_iterator* kiter);
|
||||||
|
|
||||||
|
|
||||||
/*! get the key name from the keys iterator
|
/*! get the key name from the keys iterator
|
||||||
* @param kiter : valid codes_keys_iterator
|
* @param kiter : valid codes_keys_iterator
|
||||||
* @return key name
|
* @return key name
|
||||||
*/
|
*/
|
||||||
const char* codes_keys_iterator_get_name(const codes_keys_iterator *kiter);
|
const char* codes_keys_iterator_get_name(const codes_keys_iterator* kiter);
|
||||||
|
|
||||||
/*! Delete the keys iterator.
|
/*! Delete the keys iterator.
|
||||||
* @param kiter : valid codes_keys_iterator
|
* @param kiter : valid codes_keys_iterator
|
||||||
|
@ -1170,11 +1170,11 @@ int codes_keys_iterator_delete(codes_keys_iterator* kiter);
|
||||||
int codes_keys_iterator_rewind(codes_keys_iterator* kiter);
|
int codes_keys_iterator_rewind(codes_keys_iterator* kiter);
|
||||||
|
|
||||||
|
|
||||||
int codes_keys_iterator_set_flags(codes_keys_iterator *kiter, unsigned long flags);
|
int codes_keys_iterator_set_flags(codes_keys_iterator* kiter, unsigned long flags);
|
||||||
int codes_keys_iterator_get_long(const codes_keys_iterator *kiter, long *v, size_t *len);
|
int codes_keys_iterator_get_long(const codes_keys_iterator* kiter, long* v, size_t* len);
|
||||||
int codes_keys_iterator_get_double(const codes_keys_iterator *kiter, double *v, size_t *len);
|
int codes_keys_iterator_get_double(const codes_keys_iterator* kiter, double* v, size_t* len);
|
||||||
int codes_keys_iterator_get_string(const codes_keys_iterator *kiter, char *v, size_t *len);
|
int codes_keys_iterator_get_string(const codes_keys_iterator* kiter, char* v, size_t* len);
|
||||||
int codes_keys_iterator_get_bytes(const codes_keys_iterator *kiter, unsigned char *v, size_t *len);
|
int codes_keys_iterator_get_bytes(const codes_keys_iterator* kiter, unsigned char* v, size_t* len);
|
||||||
|
|
||||||
/* @} */
|
/* @} */
|
||||||
|
|
||||||
|
@ -1205,13 +1205,13 @@ int codes_set_missing(codes_handle* h, const char* key);
|
||||||
/* The truncation is the Gaussian number (or order) */
|
/* The truncation is the Gaussian number (or order) */
|
||||||
int codes_get_gaussian_latitudes(long truncation, double* latitudes);
|
int codes_get_gaussian_latitudes(long truncation, double* latitudes);
|
||||||
|
|
||||||
int codes_julian_to_datetime(double jd, long *year, long *month, long *day, long *hour, long *minute, long *second);
|
int codes_julian_to_datetime(double jd, long* year, long* month, long* day, long* hour, long* minute, long* second);
|
||||||
int codes_datetime_to_julian(long year, long month, long day, long hour, long minute, long second, double *jd);
|
int codes_datetime_to_julian(long year, long month, long day, long hour, long minute, long second, double* jd);
|
||||||
long codes_julian_to_date(long jdate);
|
long codes_julian_to_date(long jdate);
|
||||||
long codes_date_to_julian(long ddate);
|
long codes_date_to_julian(long ddate);
|
||||||
|
|
||||||
void codes_get_reduced_row(long pl, double lon_first, double lon_last, long* npoints, long* ilon_first, long* ilon_last);
|
void codes_get_reduced_row(long pl, double lon_first, double lon_last, long* npoints, long* ilon_first, long* ilon_last);
|
||||||
void codes_get_reduced_row_p(long pl, double lon_first, double lon_last, long *npoints, double *olon_first, double *olon_last);
|
void codes_get_reduced_row_p(long pl, double lon_first, double lon_last, long* npoints, double* olon_first, double* olon_last);
|
||||||
|
|
||||||
|
|
||||||
/* read products */
|
/* read products */
|
||||||
|
@ -1222,7 +1222,7 @@ int codes_check_message_header(const void* bytes, size_t length, ProductKind pro
|
||||||
int codes_check_message_footer(const void* bytes, size_t length, ProductKind product);
|
int codes_check_message_footer(const void* bytes, size_t length, ProductKind product);
|
||||||
|
|
||||||
codes_box* codes_box_new(codes_handle* h, int* error);
|
codes_box* codes_box_new(codes_handle* h, int* error);
|
||||||
codes_points* codes_box_get_points(codes_box *box, double north, double west, double south, double east, int *err);
|
codes_points* codes_box_get_points(codes_box* box, double north, double west, double south, double east, int* err);
|
||||||
int codes_points_get_values(codes_handle* h, codes_points* points, double* val);
|
int codes_points_get_values(codes_handle* h, codes_points* points, double* val);
|
||||||
|
|
||||||
/* --------------------------------------- */
|
/* --------------------------------------- */
|
||||||
|
@ -1254,13 +1254,13 @@ int codes_points_get_values(codes_handle* h, codes_points* points, double* val);
|
||||||
#define CODES_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR GRIB_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR
|
#define CODES_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR GRIB_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR
|
||||||
|
|
||||||
|
|
||||||
codes_handle *codes_grib_util_set_spec(codes_handle *h,
|
codes_handle* codes_grib_util_set_spec(codes_handle* h,
|
||||||
const codes_util_grid_spec *grid_spec,
|
const codes_util_grid_spec* grid_spec,
|
||||||
const codes_util_packing_spec *packing_spec, /* NULL for defaults (same as input) */
|
const codes_util_packing_spec* packing_spec, /* NULL for defaults (same as input) */
|
||||||
int flags,
|
int flags,
|
||||||
const double *data_values,
|
const double* data_values,
|
||||||
size_t data_values_count,
|
size_t data_values_count,
|
||||||
int *err);
|
int* err);
|
||||||
|
|
||||||
/* EXPERIMENTAL FEATURE
|
/* EXPERIMENTAL FEATURE
|
||||||
* Build an array of headers from input BUFR file.
|
* Build an array of headers from input BUFR file.
|
||||||
|
@ -1271,7 +1271,7 @@ codes_handle *codes_grib_util_set_spec(codes_handle *h,
|
||||||
* returns 0 if OK, integer value on error.
|
* returns 0 if OK, integer value on error.
|
||||||
*/
|
*/
|
||||||
int codes_bufr_extract_headers_malloc(codes_context* c, const char* filename, codes_bufr_header** result, int* num_messages, int strict_mode);
|
int codes_bufr_extract_headers_malloc(codes_context* c, const char* filename, codes_bufr_header** result, int* num_messages, int strict_mode);
|
||||||
int codes_bufr_header_get_string(codes_bufr_header* bh, const char* key, char *val, size_t *len);
|
int codes_bufr_header_get_string(codes_bufr_header* bh, const char* key, char* val, size_t* len);
|
||||||
|
|
||||||
/* --------------------------------------- */
|
/* --------------------------------------- */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -13,10 +13,10 @@
|
||||||
|
|
||||||
/* Microsoft Windows Visual Studio support */
|
/* Microsoft Windows Visual Studio support */
|
||||||
#if defined(_WIN32) && defined(_MSC_VER)
|
#if defined(_WIN32) && defined(_MSC_VER)
|
||||||
#define ECCODES_ON_WINDOWS
|
#define ECCODES_ON_WINDOWS
|
||||||
#ifndef YY_NO_UNISTD_H
|
#ifndef YY_NO_UNISTD_H
|
||||||
#define YY_NO_UNISTD_H
|
#define YY_NO_UNISTD_H
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1416,7 +1416,7 @@ static int encode_new_replication(grib_context* c, grib_accessor_bufr_data_array
|
||||||
if (self->compressedData) {
|
if (self->compressedData) {
|
||||||
grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + 6);
|
grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + 6);
|
||||||
grib_encode_unsigned_longb(buff->data, 0, pos, 6);
|
grib_encode_unsigned_longb(buff->data, 0, pos, 6);
|
||||||
};
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
311
src/grib_api.h
311
src/grib_api.h
|
@ -28,13 +28,21 @@
|
||||||
#endif
|
#endif
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#if defined( __GNUC__) || defined(__clang__)
|
#if defined(__GNUC__) || defined(__clang__)
|
||||||
#define ECCODES_DEPRECATED __attribute__((deprecated))
|
#define ECCODES_DEPRECATED __attribute__((deprecated))
|
||||||
#else
|
#else
|
||||||
#define ECCODES_DEPRECATED
|
#define ECCODES_DEPRECATED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef enum ProductKind {PRODUCT_ANY, PRODUCT_GRIB, PRODUCT_BUFR, PRODUCT_METAR, PRODUCT_GTS, PRODUCT_TAF} ProductKind;
|
typedef enum ProductKind
|
||||||
|
{
|
||||||
|
PRODUCT_ANY,
|
||||||
|
PRODUCT_GRIB,
|
||||||
|
PRODUCT_BUFR,
|
||||||
|
PRODUCT_METAR,
|
||||||
|
PRODUCT_GTS,
|
||||||
|
PRODUCT_TAF
|
||||||
|
} ProductKind;
|
||||||
|
|
||||||
#include "eccodes_version.h"
|
#include "eccodes_version.h"
|
||||||
|
|
||||||
|
@ -43,11 +51,11 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* sections */
|
/* sections */
|
||||||
#define GRIB_SECTION_PRODUCT (1<<0)
|
#define GRIB_SECTION_PRODUCT (1 << 0)
|
||||||
#define GRIB_SECTION_GRID (1<<1)
|
#define GRIB_SECTION_GRID (1 << 1)
|
||||||
#define GRIB_SECTION_LOCAL (1<<2)
|
#define GRIB_SECTION_LOCAL (1 << 2)
|
||||||
#define GRIB_SECTION_DATA (1<<3)
|
#define GRIB_SECTION_DATA (1 << 3)
|
||||||
#define GRIB_SECTION_BITMAP (1<<4)
|
#define GRIB_SECTION_BITMAP (1 << 4)
|
||||||
|
|
||||||
|
|
||||||
/* LOG MODES
|
/* LOG MODES
|
||||||
|
@ -89,25 +97,25 @@ Log mode for information for processing information
|
||||||
#define GRIB_MISSING_DOUBLE -1e+100
|
#define GRIB_MISSING_DOUBLE -1e+100
|
||||||
|
|
||||||
/*set spec flags*/
|
/*set spec flags*/
|
||||||
#define GRIB_UTIL_SET_SPEC_FLAGS_ONLY_PACKING (1<<0)
|
#define GRIB_UTIL_SET_SPEC_FLAGS_ONLY_PACKING (1 << 0)
|
||||||
|
|
||||||
/* Dump option flags*/
|
/* Dump option flags*/
|
||||||
#define GRIB_DUMP_FLAG_READ_ONLY (1<<0)
|
#define GRIB_DUMP_FLAG_READ_ONLY (1 << 0)
|
||||||
#define GRIB_DUMP_FLAG_DUMP_OK (1<<1)
|
#define GRIB_DUMP_FLAG_DUMP_OK (1 << 1)
|
||||||
#define GRIB_DUMP_FLAG_VALUES (1<<2)
|
#define GRIB_DUMP_FLAG_VALUES (1 << 2)
|
||||||
#define GRIB_DUMP_FLAG_CODED (1<<3)
|
#define GRIB_DUMP_FLAG_CODED (1 << 3)
|
||||||
#define GRIB_DUMP_FLAG_OCTECT (1<<4)
|
#define GRIB_DUMP_FLAG_OCTECT (1 << 4)
|
||||||
#define GRIB_DUMP_FLAG_ALIASES (1<<5)
|
#define GRIB_DUMP_FLAG_ALIASES (1 << 5)
|
||||||
#define GRIB_DUMP_FLAG_TYPE (1<<6)
|
#define GRIB_DUMP_FLAG_TYPE (1 << 6)
|
||||||
#define GRIB_DUMP_FLAG_HEXADECIMAL (1<<7)
|
#define GRIB_DUMP_FLAG_HEXADECIMAL (1 << 7)
|
||||||
#define GRIB_DUMP_FLAG_NO_DATA (1<<8)
|
#define GRIB_DUMP_FLAG_NO_DATA (1 << 8)
|
||||||
#define GRIB_DUMP_FLAG_ALL_DATA (1<<9)
|
#define GRIB_DUMP_FLAG_ALL_DATA (1 << 9)
|
||||||
#define GRIB_DUMP_FLAG_ALL_ATTRIBUTES (1<<10)
|
#define GRIB_DUMP_FLAG_ALL_ATTRIBUTES (1 << 10)
|
||||||
|
|
||||||
/* grib_nearest flags */
|
/* grib_nearest flags */
|
||||||
#define GRIB_NEAREST_SAME_GRID (1<<0)
|
#define GRIB_NEAREST_SAME_GRID (1 << 0)
|
||||||
#define GRIB_NEAREST_SAME_DATA (1<<1)
|
#define GRIB_NEAREST_SAME_DATA (1 << 1)
|
||||||
#define GRIB_NEAREST_SAME_POINT (1<<2)
|
#define GRIB_NEAREST_SAME_POINT (1 << 2)
|
||||||
|
|
||||||
/*! Iteration is carried out on all the keys available in the message
|
/*! Iteration is carried out on all the keys available in the message
|
||||||
\ingroup keys_iterator
|
\ingroup keys_iterator
|
||||||
|
@ -119,48 +127,49 @@ Log mode for information for processing information
|
||||||
\ingroup keys_iterator
|
\ingroup keys_iterator
|
||||||
\see grib_keys_iterator_new
|
\see grib_keys_iterator_new
|
||||||
*/
|
*/
|
||||||
#define GRIB_KEYS_ITERATOR_SKIP_READ_ONLY (1<<0)
|
#define GRIB_KEYS_ITERATOR_SKIP_READ_ONLY (1 << 0)
|
||||||
|
|
||||||
/*! optional keys are skipped by keys iterator.
|
/*! optional keys are skipped by keys iterator.
|
||||||
\ingroup keys_iterator
|
\ingroup keys_iterator
|
||||||
\see grib_keys_iterator_new */
|
\see grib_keys_iterator_new */
|
||||||
#define GRIB_KEYS_ITERATOR_SKIP_OPTIONAL (1<<1)
|
#define GRIB_KEYS_ITERATOR_SKIP_OPTIONAL (1 << 1)
|
||||||
|
|
||||||
/*! edition specific keys are skipped by keys iterator.
|
/*! edition specific keys are skipped by keys iterator.
|
||||||
\ingroup keys_iterator
|
\ingroup keys_iterator
|
||||||
\see grib_keys_iterator_new */
|
\see grib_keys_iterator_new */
|
||||||
#define GRIB_KEYS_ITERATOR_SKIP_EDITION_SPECIFIC (1<<2)
|
#define GRIB_KEYS_ITERATOR_SKIP_EDITION_SPECIFIC (1 << 2)
|
||||||
|
|
||||||
/*! coded keys are skipped by keys iterator.
|
/*! coded keys are skipped by keys iterator.
|
||||||
\ingroup keys_iterator
|
\ingroup keys_iterator
|
||||||
\see grib_keys_iterator_new */
|
\see grib_keys_iterator_new */
|
||||||
#define GRIB_KEYS_ITERATOR_SKIP_CODED (1<<3)
|
#define GRIB_KEYS_ITERATOR_SKIP_CODED (1 << 3)
|
||||||
|
|
||||||
/*! computed keys are skipped by keys iterator.
|
/*! computed keys are skipped by keys iterator.
|
||||||
\ingroup keys_iterator
|
\ingroup keys_iterator
|
||||||
\see grib_keys_iterator_new */
|
\see grib_keys_iterator_new */
|
||||||
#define GRIB_KEYS_ITERATOR_SKIP_COMPUTED (1<<4)
|
#define GRIB_KEYS_ITERATOR_SKIP_COMPUTED (1 << 4)
|
||||||
|
|
||||||
/*! duplicates of a key are skipped by keys iterator.
|
/*! duplicates of a key are skipped by keys iterator.
|
||||||
\ingroup keys_iterator
|
\ingroup keys_iterator
|
||||||
\see grib_keys_iterator_new */
|
\see grib_keys_iterator_new */
|
||||||
#define GRIB_KEYS_ITERATOR_SKIP_DUPLICATES (1<<5)
|
#define GRIB_KEYS_ITERATOR_SKIP_DUPLICATES (1 << 5)
|
||||||
|
|
||||||
/*! function keys are skipped by keys iterator.
|
/*! function keys are skipped by keys iterator.
|
||||||
\ingroup keys_iterator
|
\ingroup keys_iterator
|
||||||
\see grib_keys_iterator_new */
|
\see grib_keys_iterator_new */
|
||||||
#define GRIB_KEYS_ITERATOR_SKIP_FUNCTION (1<<6)
|
#define GRIB_KEYS_ITERATOR_SKIP_FUNCTION (1 << 6)
|
||||||
|
|
||||||
/*! only keys present in the dump
|
/*! only keys present in the dump
|
||||||
\ingroup keys_iterator
|
\ingroup keys_iterator
|
||||||
\see grib_keys_iterator_new */
|
\see grib_keys_iterator_new */
|
||||||
#define GRIB_KEYS_ITERATOR_DUMP_ONLY (1<<7)
|
#define GRIB_KEYS_ITERATOR_DUMP_ONLY (1 << 7)
|
||||||
|
|
||||||
typedef struct grib_key_value_list grib_key_value_list;
|
typedef struct grib_key_value_list grib_key_value_list;
|
||||||
|
|
||||||
typedef struct grib_values grib_values;
|
typedef struct grib_values grib_values;
|
||||||
|
|
||||||
struct grib_values {
|
struct grib_values
|
||||||
|
{
|
||||||
const char* name;
|
const char* name;
|
||||||
int type;
|
int type;
|
||||||
long long_value;
|
long long_value;
|
||||||
|
@ -170,7 +179,7 @@ struct grib_values {
|
||||||
int has_value;
|
int has_value;
|
||||||
int equal;
|
int equal;
|
||||||
grib_values* next;
|
grib_values* next;
|
||||||
} ;
|
};
|
||||||
|
|
||||||
|
|
||||||
/*! Grib handle, structure giving access to parsed message values by keys
|
/*! Grib handle, structure giving access to parsed message values by keys
|
||||||
|
@ -226,12 +235,12 @@ typedef struct bufr_descriptor bufr_descriptor;
|
||||||
typedef struct bufr_descriptors_array bufr_descriptors_array;
|
typedef struct bufr_descriptors_array bufr_descriptors_array;
|
||||||
typedef struct bufr_descriptors_map_list bufr_descriptors_map_list;
|
typedef struct bufr_descriptors_map_list bufr_descriptors_map_list;
|
||||||
|
|
||||||
grib_fieldset *grib_fieldset_new_from_files(grib_context *c, char *filenames[], int nfiles, char **keys, int nkeys, const char *where_string, const char *order_by_string, int *err);
|
grib_fieldset* grib_fieldset_new_from_files(grib_context* c, char* filenames[], int nfiles, char** keys, int nkeys, const char* where_string, const char* order_by_string, int* err);
|
||||||
void grib_fieldset_delete(grib_fieldset* set);
|
void grib_fieldset_delete(grib_fieldset* set);
|
||||||
void grib_fieldset_rewind(grib_fieldset* set);
|
void grib_fieldset_rewind(grib_fieldset* set);
|
||||||
int grib_fieldset_apply_order_by(grib_fieldset* set,const char* order_by_string);
|
int grib_fieldset_apply_order_by(grib_fieldset* set, const char* order_by_string);
|
||||||
grib_handle* grib_fieldset_next_handle(grib_fieldset* set,int* err);
|
grib_handle* grib_fieldset_next_handle(grib_fieldset* set, int* err);
|
||||||
int grib_fieldset_count(grib_fieldset *set);
|
int grib_fieldset_count(grib_fieldset* set);
|
||||||
int grib_values_check(grib_handle* h, grib_values* values, int count);
|
int grib_values_check(grib_handle* h, grib_values* values, int count);
|
||||||
|
|
||||||
/*! \defgroup grib_index The grib_index
|
/*! \defgroup grib_index The grib_index
|
||||||
|
@ -257,7 +266,7 @@ typedef struct grib_index grib_index;
|
||||||
* @return the newly created index
|
* @return the newly created index
|
||||||
*/
|
*/
|
||||||
grib_index* grib_index_new_from_file(grib_context* c,
|
grib_index* grib_index_new_from_file(grib_context* c,
|
||||||
char* filename,const char* keys,int *err);
|
char* filename, const char* keys, int* err);
|
||||||
/**
|
/**
|
||||||
* Create a new index based on a set of keys.
|
* Create a new index based on a set of keys.
|
||||||
*
|
*
|
||||||
|
@ -270,7 +279,7 @@ grib_index* grib_index_new_from_file(grib_context* c,
|
||||||
* @param err : 0 if OK, integer value on error
|
* @param err : 0 if OK, integer value on error
|
||||||
* @return the newly created index
|
* @return the newly created index
|
||||||
*/
|
*/
|
||||||
grib_index* grib_index_new(grib_context* c, const char* keys,int *err);
|
grib_index* grib_index_new(grib_context* c, const char* keys, int* err);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indexes the file given in argument in the index given in argument.
|
* Indexes the file given in argument in the index given in argument.
|
||||||
|
@ -279,9 +288,9 @@ grib_index* grib_index_new(grib_context* c, const char* keys,int *err);
|
||||||
* @param filename : name of the file of messages to be indexed
|
* @param filename : name of the file of messages to be indexed
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_index_add_file(grib_index *index, const char *filename);
|
int grib_index_add_file(grib_index* index, const char* filename);
|
||||||
int grib_index_write(grib_index *index, const char *filename);
|
int grib_index_write(grib_index* index, const char* filename);
|
||||||
grib_index* grib_index_read(grib_context* c,const char* filename,int *err);
|
grib_index* grib_index_read(grib_context* c, const char* filename, int* err);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the number of distinct values of the key in argument contained in the index. The key must belong to the index.
|
* Get the number of distinct values of the key in argument contained in the index. The key must belong to the index.
|
||||||
|
@ -292,7 +301,7 @@ grib_index* grib_index_read(grib_context* c,const char* filename,int *err);
|
||||||
* @param size : number of distinct values of the key in the index
|
* @param size : number of distinct values of the key in the index
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_index_get_size(const grib_index* index,const char* key,size_t* size);
|
int grib_index_get_size(const grib_index* index, const char* key, size_t* size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as long or when the native type of the key is long.
|
* Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as long or when the native type of the key is long.
|
||||||
|
@ -304,8 +313,8 @@ int grib_index_get_size(const grib_index* index,const char* key,size_t* size);
|
||||||
* @param size : size of the values array
|
* @param size : size of the values array
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_index_get_long(const grib_index* index,const char* key,
|
int grib_index_get_long(const grib_index* index, const char* key,
|
||||||
long* values,size_t *size);
|
long* values, size_t* size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as double or when the native type of the key is double.
|
* Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as double or when the native type of the key is double.
|
||||||
|
@ -317,8 +326,8 @@ int grib_index_get_long(const grib_index* index,const char* key,
|
||||||
* @param size : size of the values array
|
* @param size : size of the values array
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_index_get_double(const grib_index* index,const char* key,
|
int grib_index_get_double(const grib_index* index, const char* key,
|
||||||
double* values,size_t *size);
|
double* values, size_t* size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as string or when the native type of the key is string.
|
* Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as string or when the native type of the key is string.
|
||||||
|
@ -330,8 +339,8 @@ int grib_index_get_double(const grib_index* index,const char* key,
|
||||||
* @param size : size of the values array
|
* @param size : size of the values array
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_index_get_string(const grib_index* index,const char* key,
|
int grib_index_get_string(const grib_index* index, const char* key,
|
||||||
char** values,size_t *size);
|
char** values, size_t* size);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -343,7 +352,7 @@ int grib_index_get_string(const grib_index* index,const char* key,
|
||||||
* @param value : value of the key to select
|
* @param value : value of the key to select
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_index_select_long(grib_index* index,const char* key,long value);
|
int grib_index_select_long(grib_index* index, const char* key, long value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Select the message subset with key==value. The value is a double. The key must have been created with double type or have double as native type if the type was not explicitly defined in the index creation.
|
* Select the message subset with key==value. The value is a double. The key must have been created with double type or have double as native type if the type was not explicitly defined in the index creation.
|
||||||
|
@ -354,7 +363,7 @@ int grib_index_select_long(grib_index* index,const char* key,long value);
|
||||||
* @param value : value of the key to select
|
* @param value : value of the key to select
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_index_select_double(grib_index* index,const char* key,double value);
|
int grib_index_select_double(grib_index* index, const char* key, double value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Select the message subset with key==value. The value is a string. The key must have been created with string type or have string as native type if the type was not explicitly defined in the index creation.
|
* Select the message subset with key==value. The value is a string. The key must have been created with string type or have string as native type if the type was not explicitly defined in the index creation.
|
||||||
|
@ -365,7 +374,7 @@ int grib_index_select_double(grib_index* index,const char* key,double value);
|
||||||
* @param value : value of the key to select
|
* @param value : value of the key to select
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_index_select_string(grib_index* index,const char* key,char* value);
|
int grib_index_select_string(grib_index* index, const char* key, char* value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new handle from an index after having selected the key values.
|
* Create a new handle from an index after having selected the key values.
|
||||||
|
@ -376,7 +385,7 @@ int grib_index_select_string(grib_index* index,const char* key,char* value);
|
||||||
* @param err : 0 if OK, integer value on error. GRIB_END_OF_INDEX when no more handles are contained in the index.
|
* @param err : 0 if OK, integer value on error. GRIB_END_OF_INDEX when no more handles are contained in the index.
|
||||||
* @return grib handle.
|
* @return grib handle.
|
||||||
*/
|
*/
|
||||||
grib_handle* grib_handle_new_from_index(grib_index* index,int *err);
|
grib_handle* grib_handle_new_from_index(grib_index* index, int* err);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the index.
|
* Delete the index.
|
||||||
|
@ -399,7 +408,7 @@ The grib_handle is the structure giving access to parsed grib values by keys.
|
||||||
* @param n : the number of messages in the file
|
* @param n : the number of messages in the file
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_count_in_file(grib_context* c, FILE* f,int* n);
|
int grib_count_in_file(grib_context* c, FILE* f, int* n);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Counts the messages contained in a file.
|
* Counts the messages contained in a file.
|
||||||
|
@ -433,16 +442,17 @@ grib_handle* grib_handle_new_from_file(grib_context* c, FILE* f, int* error);
|
||||||
* @param mode : mode
|
* @param mode : mode
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_write_message(const grib_handle* h,const char* file,const char* mode);
|
int grib_write_message(const grib_handle* h, const char* file, const char* mode);
|
||||||
|
|
||||||
typedef struct grib_string_list grib_string_list;
|
typedef struct grib_string_list grib_string_list;
|
||||||
struct grib_string_list {
|
struct grib_string_list
|
||||||
|
{
|
||||||
char* value;
|
char* value;
|
||||||
int count;
|
int count;
|
||||||
grib_string_list* next;
|
grib_string_list* next;
|
||||||
};
|
};
|
||||||
|
|
||||||
grib_handle* grib_util_sections_copy(grib_handle* hfrom,grib_handle* hto,int what,int *err);
|
grib_handle* grib_util_sections_copy(grib_handle* hfrom, grib_handle* hto, int what, int* err);
|
||||||
grib_string_list* grib_util_get_param_id(const char* mars_param);
|
grib_string_list* grib_util_get_param_id(const char* mars_param);
|
||||||
grib_string_list* grib_util_get_mars_param(const char* param_id);
|
grib_string_list* grib_util_get_mars_param(const char* param_id);
|
||||||
|
|
||||||
|
@ -469,8 +479,8 @@ grib_handle* grib_handle_new_from_message(grib_context* c, const void* data, siz
|
||||||
* @param error : error code
|
* @param error : error code
|
||||||
* @return the new handle, NULL if the message is invalid or a problem is encountered
|
* @return the new handle, NULL if the message is invalid or a problem is encountered
|
||||||
*/
|
*/
|
||||||
grib_handle* grib_handle_new_from_multi_message(grib_context* c,void** data,
|
grib_handle* grib_handle_new_from_multi_message(grib_context* c, void** data,
|
||||||
size_t *data_len,int* error);
|
size_t* data_len, int* error);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a handle from a user message. The message is copied and will be freed with the handle
|
* Create a handle from a user message. The message is copied and will be freed with the handle
|
||||||
|
@ -491,8 +501,7 @@ grib_handle* grib_handle_new_from_message_copy(grib_context* c, const void* data
|
||||||
* @param sample_name : the name of the sample file (without the .tmpl extension)
|
* @param sample_name : the name of the sample file (without the .tmpl extension)
|
||||||
* @return the new handle, NULL if the resource is invalid or a problem is encountered
|
* @return the new handle, NULL if the resource is invalid or a problem is encountered
|
||||||
*/
|
*/
|
||||||
grib_handle* grib_handle_new_from_samples (grib_context* c, const char* sample_name);
|
grib_handle* grib_handle_new_from_samples(grib_context* c, const char* sample_name);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -502,7 +511,7 @@ grib_handle* grib_handle_new_from_samples (grib_context* c, const char* sample_n
|
||||||
* @param h : The handle to be cloned
|
* @param h : The handle to be cloned
|
||||||
* @return the new handle, NULL if the message is invalid or a problem is encountered
|
* @return the new handle, NULL if the message is invalid or a problem is encountered
|
||||||
*/
|
*/
|
||||||
grib_handle* grib_handle_clone(const grib_handle* h) ;
|
grib_handle* grib_handle_clone(const grib_handle* h);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Frees a handle, also frees the message if it is not a user message
|
* Frees a handle, also frees the message if it is not a user message
|
||||||
|
@ -519,7 +528,7 @@ int grib_handle_delete(grib_handle* h);
|
||||||
*
|
*
|
||||||
* @param c : the context from which the handle will be created (NULL for default context)
|
* @param c : the context from which the handle will be created (NULL for default context)
|
||||||
*/
|
*/
|
||||||
grib_multi_handle* grib_multi_handle_new (grib_context* c);
|
grib_multi_handle* grib_multi_handle_new(grib_context* c);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append the sections starting with start_section of the message pointed by h at
|
* Append the sections starting with start_section of the message pointed by h at
|
||||||
|
@ -532,7 +541,7 @@ grib_multi_handle* grib_multi_handle_new (grib_context* c);
|
||||||
* @param mh : The multi field handle on which the sections are appended.
|
* @param mh : The multi field handle on which the sections are appended.
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_multi_handle_append(grib_handle* h,int start_section,grib_multi_handle* mh);
|
int grib_multi_handle_append(grib_handle* h, int start_section, grib_multi_handle* mh);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete multi field handle.
|
* Delete multi field handle.
|
||||||
|
@ -551,7 +560,7 @@ int grib_multi_handle_delete(grib_multi_handle* mh);
|
||||||
* @param f : File on which the file handle is written.
|
* @param f : File on which the file handle is written.
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_multi_handle_write(grib_multi_handle* mh,FILE* f);
|
int grib_multi_handle_write(grib_multi_handle* mh, FILE* f);
|
||||||
|
|
||||||
/*! @} */
|
/*! @} */
|
||||||
|
|
||||||
|
@ -565,7 +574,7 @@ int grib_multi_handle_write(grib_multi_handle* mh,FILE* f);
|
||||||
* @param message_length : On exit, the message size in number of bytes
|
* @param message_length : On exit, the message size in number of bytes
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_get_message(const grib_handle* h ,const void** message, size_t *message_length);
|
int grib_get_message(const grib_handle* h, const void** message, size_t* message_length);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -577,7 +586,7 @@ int grib_get_message(const grib_handle* h ,const void** message, size_t *message
|
||||||
* On exit, the actual message length in number of bytes
|
* On exit, the actual message length in number of bytes
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_get_message_copy(const grib_handle* h, void* message,size_t *message_length);
|
int grib_get_message_copy(const grib_handle* h, void* message, size_t* message_length);
|
||||||
/*! @} */
|
/*! @} */
|
||||||
|
|
||||||
/*! \defgroup iterators Iterating on latitude/longitude/values */
|
/*! \defgroup iterators Iterating on latitude/longitude/values */
|
||||||
|
@ -604,7 +613,7 @@ grib_iterator* grib_iterator_new(const grib_handle* h, unsigned long flags, int*
|
||||||
* @param values : returned array of data values
|
* @param values : returned array of data values
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_get_data(const grib_handle *h, double *lats, double *lons, double *values);
|
int grib_get_data(const grib_handle* h, double* lats, double* lons, double* values);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the next value from a geoiterator.
|
* Get the next value from a geoiterator.
|
||||||
|
@ -615,7 +624,7 @@ int grib_get_data(const grib_handle *h, double *lats, double *lons, double *valu
|
||||||
* @param value : on output value of the point
|
* @param value : on output value of the point
|
||||||
* @return positive value if successful, 0 if no more data are available
|
* @return positive value if successful, 0 if no more data are available
|
||||||
*/
|
*/
|
||||||
int grib_iterator_next(grib_iterator *i, double* lat,double* lon,double* value);
|
int grib_iterator_next(grib_iterator* i, double* lat, double* lon, double* value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the previous value from a geoiterator.
|
* Get the previous value from a geoiterator.
|
||||||
|
@ -626,7 +635,7 @@ int grib_iterator_next(grib_iterator *i, double* lat,double* lon,double* value);
|
||||||
* @param value : on output value of the point*
|
* @param value : on output value of the point*
|
||||||
* @return positive value if successful, 0 if no more data are available
|
* @return positive value if successful, 0 if no more data are available
|
||||||
*/
|
*/
|
||||||
int grib_iterator_previous(grib_iterator *i, double* lat,double* lon,double* value);
|
int grib_iterator_previous(grib_iterator* i, double* lat, double* lon, double* value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test procedure for values in a geoiterator.
|
* Test procedure for values in a geoiterator.
|
||||||
|
@ -634,7 +643,7 @@ int grib_iterator_previous(grib_iterator *i, double* lat,double* lon,double* val
|
||||||
* @param i : the geoiterator
|
* @param i : the geoiterator
|
||||||
* @return boolean, 1 if the geoiterator still nave next values, 0 otherwise
|
* @return boolean, 1 if the geoiterator still nave next values, 0 otherwise
|
||||||
*/
|
*/
|
||||||
int grib_iterator_has_next(grib_iterator *i);
|
int grib_iterator_has_next(grib_iterator* i);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test procedure for values in a geoiterator.
|
* Test procedure for values in a geoiterator.
|
||||||
|
@ -642,7 +651,7 @@ int grib_iterator_has_next(grib_iterator *i);
|
||||||
* @param i : the geoiterator
|
* @param i : the geoiterator
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_iterator_reset(grib_iterator *i);
|
int grib_iterator_reset(grib_iterator* i);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Frees a geoiterator from memory
|
* Frees a geoiterator from memory
|
||||||
|
@ -650,7 +659,7 @@ int grib_iterator_reset(grib_iterator *i);
|
||||||
* @param i : the geoiterator
|
* @param i : the geoiterator
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_iterator_delete(grib_iterator *i);
|
int grib_iterator_delete(grib_iterator* i);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Create a new nearest neighbour object from a handle, using current geometry.
|
* \brief Create a new nearest neighbour object from a handle, using current geometry.
|
||||||
|
@ -692,7 +701,7 @@ int grib_nearest_find(grib_nearest* nearest, const grib_handle* h, double inlat,
|
||||||
* @param nearest : the nearest
|
* @param nearest : the nearest
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_nearest_delete(grib_nearest *nearest);
|
int grib_nearest_delete(grib_nearest* nearest);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find the nearest point of a set of points whose latitudes and longitudes
|
* Find the nearest point of a set of points whose latitudes and longitudes
|
||||||
|
@ -746,7 +755,7 @@ int grib_get_offset(const grib_handle* h, const char* key, size_t* offset);
|
||||||
* @param size : the address of a size_t where the size will be set
|
* @param size : the address of a size_t where the size will be set
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_get_size(const grib_handle* h, const char* key,size_t *size);
|
int grib_get_size(const grib_handle* h, const char* key, size_t* size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the length of the string representation of the key, if several keys of the same name are present, the maximum length is returned
|
* Get the length of the string representation of the key, if several keys of the same name are present, the maximum length is returned
|
||||||
|
@ -756,7 +765,7 @@ int grib_get_size(const grib_handle* h, const char* key,size_t *size);
|
||||||
* @param length : the address of a size_t where the length will be set
|
* @param length : the address of a size_t where the length will be set
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_get_length(const grib_handle* h, const char* key,size_t *length);
|
int grib_get_length(const grib_handle* h, const char* key, size_t* length);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a long value from a key, if several keys of the same name are present, the last one is returned
|
* Get a long value from a key, if several keys of the same name are present, the last one is returned
|
||||||
|
@ -813,7 +822,7 @@ int grib_get_double_elements(const grib_handle* h, const char* key, int* i, long
|
||||||
* @param length : the address of a size_t that contains allocated length of the string on input, and that contains the actual length of the string on output
|
* @param length : the address of a size_t that contains allocated length of the string on input, and that contains the actual length of the string on output
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_get_string(const grib_handle* h, const char* key, char* mesg, size_t *length);
|
int grib_get_string(const grib_handle* h, const char* key, char* mesg, size_t* length);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get string array values from a key. If several keys of the same name are present, the last one is returned
|
* Get string array values from a key. If several keys of the same name are present, the last one is returned
|
||||||
|
@ -825,7 +834,7 @@ int grib_get_string(const grib_handle* h, const char* key, char* mesg, size_t *l
|
||||||
* @param length : the address of a size_t that contains allocated length of the array on input, and that contains the actual length of the array on output
|
* @param length : the address of a size_t that contains allocated length of the array on input, and that contains the actual length of the array on output
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_get_string_array(const grib_handle* h, const char* key, char** vals, size_t *length);
|
int grib_get_string_array(const grib_handle* h, const char* key, char** vals, size_t* length);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get raw bytes values from a key. If several keys of the same name are present, the last one is returned
|
* Get raw bytes values from a key. If several keys of the same name are present, the last one is returned
|
||||||
|
@ -837,7 +846,7 @@ int grib_get_string_array(const grib_handle* h, const char* key, char** vals, si
|
||||||
* @param length : the address of a size_t that contains allocated length of the byte array on input, and that contains the actual length of the byte array on output
|
* @param length : the address of a size_t that contains allocated length of the byte array on input, and that contains the actual length of the byte array on output
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_get_bytes(const grib_handle* h, const char* key, unsigned char* bytes, size_t *length);
|
int grib_get_bytes(const grib_handle* h, const char* key, unsigned char* bytes, size_t* length);
|
||||||
/**
|
/**
|
||||||
* Get double array values from a key. If several keys of the same name are present, the last one is returned
|
* Get double array values from a key. If several keys of the same name are present, the last one is returned
|
||||||
* @see grib_set_double_array
|
* @see grib_set_double_array
|
||||||
|
@ -848,7 +857,7 @@ int grib_get_bytes(const grib_handle* h, const char* key, unsigned char* bytes,
|
||||||
* @param length : the address of a size_t that contains allocated length of the double array on input, and that contains the actual length of the double array on output
|
* @param length : the address of a size_t that contains allocated length of the double array on input, and that contains the actual length of the double array on output
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_get_double_array(const grib_handle* h, const char* key, double* vals, size_t *length);
|
int grib_get_double_array(const grib_handle* h, const char* key, double* vals, size_t* length);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get long array values from a key. If several keys of the same name are present, the last one is returned
|
* Get long array values from a key. If several keys of the same name are present, the last one is returned
|
||||||
|
@ -860,7 +869,7 @@ int grib_get_double_array(const grib_handle* h, const char* key, double* vals, s
|
||||||
* @param length : the address of a size_t that contains allocated length of the long array on input, and that contains the actual length of the long array on output
|
* @param length : the address of a size_t that contains allocated length of the long array on input, and that contains the actual length of the long array on output
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_get_long_array(const grib_handle* h, const char* key, long* vals, size_t *length);
|
int grib_get_long_array(const grib_handle* h, const char* key, long* vals, size_t* length);
|
||||||
|
|
||||||
|
|
||||||
/* setting data */
|
/* setting data */
|
||||||
|
@ -907,7 +916,7 @@ int grib_set_double(grib_handle* h, const char* key, double val);
|
||||||
* @param length : the address of a size_t that contains the length of the string on input, and that contains the actual packed length of the string on output
|
* @param length : the address of a size_t that contains the length of the string on input, and that contains the actual packed length of the string on output
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_set_string(grib_handle* h, const char* key, const char* mesg, size_t *length);
|
int grib_set_string(grib_handle* h, const char* key, const char* mesg, size_t* length);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a bytes array from a key. If several keys of the same name are present, the last one is set
|
* Set a bytes array from a key. If several keys of the same name are present, the last one is set
|
||||||
|
@ -919,7 +928,7 @@ int grib_set_string(grib_handle* h, const char* key, const char* mesg, size_t *l
|
||||||
* @param length : the address of a size_t that contains the length of the byte array on input, and that contains the actual packed length of the byte array on output
|
* @param length : the address of a size_t that contains the length of the byte array on input, and that contains the actual packed length of the byte array on output
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_set_bytes(grib_handle* h, const char* key, const unsigned char* bytes, size_t *length);
|
int grib_set_bytes(grib_handle* h, const char* key, const unsigned char* bytes, size_t* length);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a double array from a key. If several keys of the same name are present, the last one is set
|
* Set a double array from a key. If several keys of the same name are present, the last one is set
|
||||||
|
@ -931,7 +940,7 @@ int grib_set_bytes(grib_handle* h, const char* key, const unsigned char* bytes,
|
||||||
* @param length : a size_t that contains the length of the byte array on input
|
* @param length : a size_t that contains the length of the byte array on input
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_set_double_array(grib_handle* h, const char* key , const double* vals , size_t length);
|
int grib_set_double_array(grib_handle* h, const char* key, const double* vals, size_t length);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Same as grib_set_double_array but allows setting of READ-ONLY keys like codedValues.
|
* Same as grib_set_double_array but allows setting of READ-ONLY keys like codedValues.
|
||||||
|
@ -950,7 +959,7 @@ int grib_set_force_double_array(grib_handle* h, const char* key, const double* v
|
||||||
* @param length : a size_t that contains the length of the long array on input
|
* @param length : a size_t that contains the length of the long array on input
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_set_long_array(grib_handle* h, const char* key , const long* vals, size_t length);
|
int grib_set_long_array(grib_handle* h, const char* key, const long* vals, size_t length);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a string array from a key. If several keys of the same name are present, the last one is set
|
* Set a string array from a key. If several keys of the same name are present, the last one is set
|
||||||
|
@ -962,7 +971,7 @@ int grib_set_long_array(grib_handle* h, const char* key , const long* vals, siz
|
||||||
* @param length : a size_t that contains the length of the array on input
|
* @param length : a size_t that contains the length of the array on input
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
int grib_set_string_array(grib_handle* h, const char *key, const char **vals, size_t length);
|
int grib_set_string_array(grib_handle* h, const char* key, const char** vals, size_t length);
|
||||||
/*! @} */
|
/*! @} */
|
||||||
|
|
||||||
|
|
||||||
|
@ -975,7 +984,7 @@ int grib_set_string_array(grib_handle* h, const char *key, const char **vals, si
|
||||||
* @param option_flags : all the GRIB_DUMP_FLAG_x flags can be used
|
* @param option_flags : all the GRIB_DUMP_FLAG_x flags can be used
|
||||||
* @param arg : used to provide a format to output data (experimental)
|
* @param arg : used to provide a format to output data (experimental)
|
||||||
*/
|
*/
|
||||||
void grib_dump_content(const grib_handle* h,FILE* out,const char* mode, unsigned long option_flags,void* arg);
|
void grib_dump_content(const grib_handle* h, FILE* out, const char* mode, unsigned long option_flags, void* arg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print all keys from the parsed definition files available in a context
|
* Print all keys from the parsed definition files available in a context
|
||||||
|
@ -983,7 +992,7 @@ void grib_dump_content(const grib_handle* h,FILE* out,const char* mode, unsigned
|
||||||
* @param f : the File used to print the keys on
|
* @param f : the File used to print the keys on
|
||||||
* @param c : the context that contains the cached definition files to be printed
|
* @param c : the context that contains the cached definition files to be printed
|
||||||
*/
|
*/
|
||||||
void grib_dump_action_tree(grib_context* c, FILE* f) ;
|
void grib_dump_action_tree(grib_context* c, FILE* f);
|
||||||
|
|
||||||
/*! \defgroup context The context object
|
/*! \defgroup context The context object
|
||||||
The context is a long life configuration object of the grib_api.
|
The context is a long life configuration object of the grib_api.
|
||||||
|
@ -1046,7 +1055,7 @@ typedef void (*grib_print_proc)(const grib_context* c, void* descriptor, const
|
||||||
* @param stream : the stream
|
* @param stream : the stream
|
||||||
* @return size read
|
* @return size read
|
||||||
*/
|
*/
|
||||||
typedef size_t (*grib_data_read_proc)(const grib_context* c,void *ptr, size_t size, void *stream);
|
typedef size_t (*grib_data_read_proc)(const grib_context* c, void* ptr, size_t size, void* stream);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Grib data read write, format of a procedure referenced in the context that is used to write to a stream from a resource
|
* Grib data read write, format of a procedure referenced in the context that is used to write to a stream from a resource
|
||||||
|
@ -1057,7 +1066,7 @@ typedef size_t (*grib_data_read_proc)(const grib_context* c,void *ptr, size_t si
|
||||||
* @param stream : the stream
|
* @param stream : the stream
|
||||||
* @return size written
|
* @return size written
|
||||||
*/
|
*/
|
||||||
typedef size_t (*grib_data_write_proc)(const grib_context* c,const void *ptr, size_t size, void *stream);
|
typedef size_t (*grib_data_write_proc)(const grib_context* c, const void* ptr, size_t size, void* stream);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Grib data tell, format of a procedure referenced in the context that is used to tell the current position in a stream
|
* Grib data tell, format of a procedure referenced in the context that is used to tell the current position in a stream
|
||||||
|
@ -1066,7 +1075,7 @@ typedef size_t (*grib_data_write_proc)(const grib_context* c,const void *ptr, si
|
||||||
* @param stream : the stream
|
* @param stream : the stream
|
||||||
* @return the position in the stream
|
* @return the position in the stream
|
||||||
*/
|
*/
|
||||||
typedef off_t (*grib_data_tell_proc) (const grib_context* c, void *stream);
|
typedef off_t (*grib_data_tell_proc)(const grib_context* c, void* stream);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Grib data seek, format of a procedure referenced in the context that is used to seek the current position in a stream
|
* Grib data seek, format of a procedure referenced in the context that is used to seek the current position in a stream
|
||||||
|
@ -1079,7 +1088,7 @@ typedef off_t (*grib_data_tell_proc) (const grib_context* c, void *stream);
|
||||||
* @param stream : the stream
|
* @param stream : the stream
|
||||||
* @return 0 if OK, integer value on error
|
* @return 0 if OK, integer value on error
|
||||||
*/
|
*/
|
||||||
typedef off_t (*grib_data_seek_proc)(const grib_context* c, off_t offset, int whence, void *stream);
|
typedef off_t (*grib_data_seek_proc)(const grib_context* c, off_t offset, int whence, void* stream);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Grib data eof, format of a procedure referenced in the context that is used to test end of file
|
* Grib data eof, format of a procedure referenced in the context that is used to test end of file
|
||||||
|
@ -1088,7 +1097,7 @@ typedef off_t (*grib_data_seek_proc)(const grib_context* c, off_t offset, int w
|
||||||
* @param stream : the stream
|
* @param stream : the stream
|
||||||
* @return the position in the stream
|
* @return the position in the stream
|
||||||
*/
|
*/
|
||||||
typedef int (*grib_data_eof_proc) (const grib_context* c, void *stream);
|
typedef int (*grib_data_eof_proc)(const grib_context* c, void* stream);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the static default context
|
* Get the static default context
|
||||||
|
@ -1110,7 +1119,7 @@ void grib_context_delete(grib_context* c);
|
||||||
*
|
*
|
||||||
* @param c : the context
|
* @param c : the context
|
||||||
*/
|
*/
|
||||||
void grib_gts_header_on(grib_context* c) ;
|
void grib_gts_header_on(grib_context* c);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the GTS header mode off.
|
* Set the GTS header mode off.
|
||||||
|
@ -1229,8 +1238,8 @@ void grib_multi_support_off(grib_context* c);
|
||||||
*/
|
*/
|
||||||
void grib_multi_support_reset_file(grib_context* c, FILE* f);
|
void grib_multi_support_reset_file(grib_context* c, FILE* f);
|
||||||
|
|
||||||
char* grib_samples_path(const grib_context *c);
|
char* grib_samples_path(const grib_context* c);
|
||||||
char* grib_definition_path(const grib_context *c);
|
char* grib_definition_path(const grib_context* c);
|
||||||
/*! @} */
|
/*! @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1273,7 +1282,7 @@ attributes or by the namespace they belong to.
|
||||||
* @return keys iterator ready to iterate through keys according to filter_flags
|
* @return keys iterator ready to iterate through keys according to filter_flags
|
||||||
* and namespace
|
* and namespace
|
||||||
*/
|
*/
|
||||||
grib_keys_iterator* grib_keys_iterator_new(grib_handle* h,unsigned long filter_flags, const char* name_space);
|
grib_keys_iterator* grib_keys_iterator_new(grib_handle* h, unsigned long filter_flags, const char* name_space);
|
||||||
bufr_keys_iterator* codes_bufr_keys_iterator_new(grib_handle* h, unsigned long filter_flags);
|
bufr_keys_iterator* codes_bufr_keys_iterator_new(grib_handle* h, unsigned long filter_flags);
|
||||||
bufr_keys_iterator* codes_bufr_data_section_keys_iterator_new(grib_handle* h);
|
bufr_keys_iterator* codes_bufr_data_section_keys_iterator_new(grib_handle* h);
|
||||||
|
|
||||||
|
@ -1288,7 +1297,7 @@ int codes_bufr_keys_iterator_next(bufr_keys_iterator* kiter);
|
||||||
* @param kiter : valid grib_keys_iterator
|
* @param kiter : valid grib_keys_iterator
|
||||||
* @return key name
|
* @return key name
|
||||||
*/
|
*/
|
||||||
const char* grib_keys_iterator_get_name(const grib_keys_iterator *kiter);
|
const char* grib_keys_iterator_get_name(const grib_keys_iterator* kiter);
|
||||||
char* codes_bufr_keys_iterator_get_name(const bufr_keys_iterator* kiter);
|
char* codes_bufr_keys_iterator_get_name(const bufr_keys_iterator* kiter);
|
||||||
|
|
||||||
/*! Delete the iterator.
|
/*! Delete the iterator.
|
||||||
|
@ -1305,13 +1314,13 @@ int codes_bufr_keys_iterator_delete(bufr_keys_iterator* kiter);
|
||||||
int grib_keys_iterator_rewind(grib_keys_iterator* kiter);
|
int grib_keys_iterator_rewind(grib_keys_iterator* kiter);
|
||||||
int codes_bufr_keys_iterator_rewind(bufr_keys_iterator* kiter);
|
int codes_bufr_keys_iterator_rewind(bufr_keys_iterator* kiter);
|
||||||
|
|
||||||
int grib_keys_iterator_set_flags(grib_keys_iterator *kiter,unsigned long flags);
|
int grib_keys_iterator_set_flags(grib_keys_iterator* kiter, unsigned long flags);
|
||||||
|
|
||||||
int grib_keys_iterator_get_long(const grib_keys_iterator *kiter, long *v, size_t *len);
|
int grib_keys_iterator_get_long(const grib_keys_iterator* kiter, long* v, size_t* len);
|
||||||
int grib_keys_iterator_get_double(const grib_keys_iterator *kiter, double *v, size_t *len);
|
int grib_keys_iterator_get_double(const grib_keys_iterator* kiter, double* v, size_t* len);
|
||||||
int grib_keys_iterator_get_string(const grib_keys_iterator *kiter, char *v, size_t *len);
|
int grib_keys_iterator_get_string(const grib_keys_iterator* kiter, char* v, size_t* len);
|
||||||
int grib_keys_iterator_get_bytes(const grib_keys_iterator *kiter, unsigned char *v, size_t *len);
|
int grib_keys_iterator_get_bytes(const grib_keys_iterator* kiter, unsigned char* v, size_t* len);
|
||||||
int codes_copy_key(grib_handle* h1,grib_handle* h2,const char* key,int type);
|
int codes_copy_key(grib_handle* h1, grib_handle* h2, const char* key, int type);
|
||||||
|
|
||||||
/* @} */
|
/* @} */
|
||||||
|
|
||||||
|
@ -1326,49 +1335,50 @@ void grib_update_sections_lengths(grib_handle* h);
|
||||||
const char* grib_get_error_message(int code);
|
const char* grib_get_error_message(int code);
|
||||||
const char* grib_get_type_name(int type);
|
const char* grib_get_type_name(int type);
|
||||||
|
|
||||||
int grib_get_native_type(const grib_handle* h, const char* name,int* type);
|
int grib_get_native_type(const grib_handle* h, const char* name, int* type);
|
||||||
|
|
||||||
void grib_check(const char* call,const char* file,int line,int e,const char* msg);
|
void grib_check(const char* call, const char* file, int line, int e, const char* msg);
|
||||||
#define GRIB_CHECK(a,msg) grib_check(#a,__FILE__,__LINE__,a,msg)
|
#define GRIB_CHECK(a, msg) grib_check(#a, __FILE__, __LINE__, a, msg)
|
||||||
#define GRIB_CHECK_NOLINE(a,msg) grib_check(#a,0,0,a,msg)
|
#define GRIB_CHECK_NOLINE(a, msg) grib_check(#a, 0, 0, a, msg)
|
||||||
|
|
||||||
|
|
||||||
int grib_set_values(grib_handle* h,grib_values* grib_values , size_t arg_count);
|
int grib_set_values(grib_handle* h, grib_values* grib_values, size_t arg_count);
|
||||||
grib_handle* grib_handle_new_from_partial_message_copy(grib_context* c, const void* data, size_t size);
|
grib_handle* grib_handle_new_from_partial_message_copy(grib_context* c, const void* data, size_t size);
|
||||||
grib_handle* grib_handle_new_from_partial_message(grib_context* c, const void* data, size_t buflen);
|
grib_handle* grib_handle_new_from_partial_message(grib_context* c, const void* data, size_t buflen);
|
||||||
int grib_is_missing(const grib_handle* h, const char* key, int* err);
|
int grib_is_missing(const grib_handle* h, const char* key, int* err);
|
||||||
int grib_is_defined(const grib_handle* h, const char* key);
|
int grib_is_defined(const grib_handle* h, const char* key);
|
||||||
int grib_set_missing(grib_handle* h, const char* key);
|
int grib_set_missing(grib_handle* h, const char* key);
|
||||||
/* The truncation is the Gaussian number (or order) */
|
/* The truncation is the Gaussian number (or order) */
|
||||||
int grib_get_gaussian_latitudes(long truncation,double* latitudes);
|
int grib_get_gaussian_latitudes(long truncation, double* latitudes);
|
||||||
|
|
||||||
int grib_julian_to_datetime(double jd, long *year, long *month, long *day, long *hour, long *minute, long *second);
|
int grib_julian_to_datetime(double jd, long* year, long* month, long* day, long* hour, long* minute, long* second);
|
||||||
int grib_datetime_to_julian(long year, long month, long day, long hour, long minute, long second, double *jd);
|
int grib_datetime_to_julian(long year, long month, long day, long hour, long minute, long second, double* jd);
|
||||||
long grib_julian_to_date(long jdate);
|
long grib_julian_to_date(long jdate);
|
||||||
long grib_date_to_julian(long ddate);
|
long grib_date_to_julian(long ddate);
|
||||||
|
|
||||||
void grib_get_reduced_row(long pl,double lon_first,double lon_last,long* npoints,long* ilon_first, long* ilon_last);
|
void grib_get_reduced_row(long pl, double lon_first, double lon_last, long* npoints, long* ilon_first, long* ilon_last);
|
||||||
void grib_get_reduced_row_p(long pl, double lon_first, double lon_last, long *npoints, double *olon_first, double *olon_last);
|
void grib_get_reduced_row_p(long pl, double lon_first, double lon_last, long* npoints, double* olon_first, double* olon_last);
|
||||||
|
|
||||||
/* read products */
|
/* read products */
|
||||||
int wmo_read_any_from_file(FILE *f, void *buffer, size_t *len);
|
int wmo_read_any_from_file(FILE* f, void* buffer, size_t* len);
|
||||||
int wmo_read_grib_from_file(FILE* f,void* buffer,size_t* len);
|
int wmo_read_grib_from_file(FILE* f, void* buffer, size_t* len);
|
||||||
int wmo_read_bufr_from_file(FILE* f,void* buffer,size_t* len);
|
int wmo_read_bufr_from_file(FILE* f, void* buffer, size_t* len);
|
||||||
int wmo_read_gts_from_file(FILE* f,void* buffer,size_t* len);
|
int wmo_read_gts_from_file(FILE* f, void* buffer, size_t* len);
|
||||||
int wmo_read_any_from_stream(void *stream_data, long (*stream_proc )(void *, void *buffer, long len ), void *buffer, size_t *len);
|
int wmo_read_any_from_stream(void* stream_data, long (*stream_proc)(void*, void* buffer, long len), void* buffer, size_t* len);
|
||||||
|
|
||||||
/* These functions allocate memory for the result so the user is responsible for freeing it */
|
/* These functions allocate memory for the result so the user is responsible for freeing it */
|
||||||
void* wmo_read_any_from_stream_malloc(void* stream_data,long (*stream_proc)(void*,void* buffer,long len) ,size_t *size, int* err);
|
void* wmo_read_any_from_stream_malloc(void* stream_data, long (*stream_proc)(void*, void* buffer, long len), size_t* size, int* err);
|
||||||
void *wmo_read_any_from_file_malloc(FILE* f,int headers_only,size_t *size,off_t *offset,int* err);
|
void* wmo_read_any_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err);
|
||||||
void *wmo_read_gts_from_file_malloc(FILE* f,int headers_only,size_t *size,off_t *offset,int* err);
|
void* wmo_read_gts_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err);
|
||||||
void *wmo_read_bufr_from_file_malloc(FILE* f,int headers_only,size_t *size,off_t *offset,int* err);
|
void* wmo_read_bufr_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err);
|
||||||
void *wmo_read_grib_from_file_malloc(FILE* f,int headers_only,size_t *size,off_t *offset,int* err);
|
void* wmo_read_grib_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err);
|
||||||
|
|
||||||
int grib_read_any_from_file(grib_context *ctx, FILE *f, void *buffer, size_t *len);
|
int grib_read_any_from_file(grib_context* ctx, FILE* f, void* buffer, size_t* len);
|
||||||
int grib_get_message_offset(const grib_handle* h,off_t* offset);
|
int grib_get_message_offset(const grib_handle* h, off_t* offset);
|
||||||
int grib_get_message_size(const grib_handle* h,size_t* size);
|
int grib_get_message_size(const grib_handle* h, size_t* size);
|
||||||
|
|
||||||
struct grib_points {
|
struct grib_points
|
||||||
|
{
|
||||||
grib_context* context;
|
grib_context* context;
|
||||||
double* latitudes;
|
double* latitudes;
|
||||||
double* longitudes;
|
double* longitudes;
|
||||||
|
@ -1380,8 +1390,8 @@ struct grib_points {
|
||||||
size_t size;
|
size_t size;
|
||||||
};
|
};
|
||||||
|
|
||||||
grib_box* grib_box_new(grib_handle* h,int* error);
|
grib_box* grib_box_new(grib_handle* h, int* error);
|
||||||
grib_points* grib_box_get_points(grib_box *box,double north, double west,double south,double east, int *err);
|
grib_points* grib_box_get_points(grib_box* box, double north, double west, double south, double east, int* err);
|
||||||
int grib_points_get_values(grib_handle* h, grib_points* points, double* val);
|
int grib_points_get_values(grib_handle* h, grib_points* points, double* val);
|
||||||
|
|
||||||
|
|
||||||
|
@ -1402,8 +1412,8 @@ int grib_points_get_values(grib_handle* h, grib_points* points, double* val);
|
||||||
#define GRIB_UTIL_GRID_SPEC_UNSTRUCTURED 12
|
#define GRIB_UTIL_GRID_SPEC_UNSTRUCTURED 12
|
||||||
|
|
||||||
|
|
||||||
typedef struct grib_util_grid_spec {
|
typedef struct grib_util_grid_spec
|
||||||
|
{
|
||||||
int grid_type;
|
int grid_type;
|
||||||
|
|
||||||
/* Grid */
|
/* Grid */
|
||||||
|
@ -1436,7 +1446,7 @@ typedef struct grib_util_grid_spec {
|
||||||
double missingValue;
|
double missingValue;
|
||||||
|
|
||||||
/* pl list for reduced */
|
/* pl list for reduced */
|
||||||
const long *pl;
|
const long* pl;
|
||||||
long pl_size;
|
long pl_size;
|
||||||
|
|
||||||
/* Spherical harmonics */
|
/* Spherical harmonics */
|
||||||
|
@ -1449,8 +1459,8 @@ typedef struct grib_util_grid_spec {
|
||||||
|
|
||||||
} grib_util_grid_spec;
|
} grib_util_grid_spec;
|
||||||
|
|
||||||
typedef struct grib_util_grid_spec2 {
|
typedef struct grib_util_grid_spec2
|
||||||
|
{
|
||||||
int grid_type;
|
int grid_type;
|
||||||
const char* grid_name; /* e.g. N320 */
|
const char* grid_name; /* e.g. N320 */
|
||||||
|
|
||||||
|
@ -1485,7 +1495,7 @@ typedef struct grib_util_grid_spec2 {
|
||||||
double missingValue;
|
double missingValue;
|
||||||
|
|
||||||
/* pl list for reduced */
|
/* pl list for reduced */
|
||||||
const long *pl;
|
const long* pl;
|
||||||
long pl_size;
|
long pl_size;
|
||||||
|
|
||||||
/* Spherical harmonics */
|
/* Spherical harmonics */
|
||||||
|
@ -1516,8 +1526,8 @@ typedef struct grib_util_grid_spec2 {
|
||||||
#define GRIB_UTIL_ACCURACY_SAME_DECIMAL_SCALE_FACTOR_AS_INPUT 2
|
#define GRIB_UTIL_ACCURACY_SAME_DECIMAL_SCALE_FACTOR_AS_INPUT 2
|
||||||
#define GRIB_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR 3
|
#define GRIB_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR 3
|
||||||
|
|
||||||
typedef struct grib_util_packing_spec {
|
typedef struct grib_util_packing_spec
|
||||||
|
{
|
||||||
/* Packing options */
|
/* Packing options */
|
||||||
long packing_type;
|
long packing_type;
|
||||||
long packing;
|
long packing;
|
||||||
|
@ -1543,27 +1553,28 @@ typedef struct grib_util_packing_spec {
|
||||||
} grib_util_packing_spec;
|
} grib_util_packing_spec;
|
||||||
|
|
||||||
|
|
||||||
grib_handle *grib_util_set_spec(grib_handle *h,
|
grib_handle* grib_util_set_spec(grib_handle* h,
|
||||||
const grib_util_grid_spec *grid_spec,
|
const grib_util_grid_spec* grid_spec,
|
||||||
const grib_util_packing_spec *packing_spec, /* NULL for defaults (same as input) */
|
const grib_util_packing_spec* packing_spec, /* NULL for defaults (same as input) */
|
||||||
int flags,
|
int flags,
|
||||||
const double *data_values,
|
const double* data_values,
|
||||||
size_t data_values_count,
|
size_t data_values_count,
|
||||||
int *err);
|
int* err);
|
||||||
|
|
||||||
grib_handle *grib_util_set_spec2(grib_handle *h,
|
grib_handle* grib_util_set_spec2(grib_handle* h,
|
||||||
const grib_util_grid_spec2 *grid_spec,
|
const grib_util_grid_spec2* grid_spec,
|
||||||
const grib_util_packing_spec *packing_spec, /* NULL for defaults (same as input) */
|
const grib_util_packing_spec* packing_spec, /* NULL for defaults (same as input) */
|
||||||
int flags,
|
int flags,
|
||||||
const double *data_values,
|
const double* data_values,
|
||||||
size_t data_values_count,
|
size_t data_values_count,
|
||||||
int *err);
|
int* err);
|
||||||
|
|
||||||
int parse_keyval_string(const char *grib_tool, char *arg, int values_required, int default_type, grib_values values[], int *count);
|
int parse_keyval_string(const char* grib_tool, char* arg, int values_required, int default_type, grib_values values[], int* count);
|
||||||
grib_handle *grib_new_from_file(grib_context *c, FILE *f, int headers_only, int *error);
|
grib_handle* grib_new_from_file(grib_context* c, FILE* f, int headers_only, int* error);
|
||||||
|
|
||||||
/* EXPERIMENTAL */
|
/* EXPERIMENTAL */
|
||||||
typedef struct codes_bufr_header {
|
typedef struct codes_bufr_header
|
||||||
|
{
|
||||||
unsigned long message_offset;
|
unsigned long message_offset;
|
||||||
unsigned long message_size;
|
unsigned long message_size;
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -8,7 +8,6 @@
|
||||||
* virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
* virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int igglat_(long* KLAT, float *PGAUSS, long* KPR, long* KERR);
|
int igglat_(long* KLAT, float* PGAUSS, long* KPR, long* KERR);
|
||||||
void gribex_(long* KSEC0, long* KSEC1, long* KSEC2, double *PSEC2,long* KSEC3, double *PSEC3, long* KSEC4,
|
void gribex_(long* KSEC0, long* KSEC1, long* KSEC2, double* PSEC2, long* KSEC3, double* PSEC3, long* KSEC4,
|
||||||
double *PSEC4, long* KLENP, void* KGRIB, long* KLENG,long* KWORD, char* HOPER, long* KRET);
|
double* PSEC4, long* KLENP, void* KGRIB, long* KLENG, long* KWORD, char* HOPER, long* KRET);
|
||||||
|
|
||||||
|
|
|
@ -22,48 +22,42 @@ extern "C" {
|
||||||
* Method: gribGetNextHandle
|
* Method: gribGetNextHandle
|
||||||
* Signature: (J)Ljgribapi/GribHandle;
|
* Signature: (J)Ljgribapi/GribHandle;
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jobject JNICALL Java_jgribapi_GribFile_gribGetNextHandle
|
JNIEXPORT jobject JNICALL Java_jgribapi_GribFile_gribGetNextHandle(JNIEnv*, jobject, jlong);
|
||||||
(JNIEnv *, jobject, jlong);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribFile
|
* Class: jgribapi_GribFile
|
||||||
* Method: gribEOFReached
|
* Method: gribEOFReached
|
||||||
* Signature: (J)J
|
* Signature: (J)J
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_jgribapi_GribFile_gribEOFReached
|
JNIEXPORT jlong JNICALL Java_jgribapi_GribFile_gribEOFReached(JNIEnv*, jobject, jlong);
|
||||||
(JNIEnv *, jobject, jlong);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribFile
|
* Class: jgribapi_GribFile
|
||||||
* Method: gribGetGribFile
|
* Method: gribGetGribFile
|
||||||
* Signature: (Ljava/lang/String;)J
|
* Signature: (Ljava/lang/String;)J
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_jgribapi_GribFile_gribGetGribFile
|
JNIEXPORT jlong JNICALL Java_jgribapi_GribFile_gribGetGribFile(JNIEnv*, jobject, jstring);
|
||||||
(JNIEnv *, jobject, jstring);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribFile
|
* Class: jgribapi_GribFile
|
||||||
* Method: gribCloseFile
|
* Method: gribCloseFile
|
||||||
* Signature: (J)V
|
* Signature: (J)V
|
||||||
*/
|
*/
|
||||||
JNIEXPORT void JNICALL Java_jgribapi_GribFile_gribCloseFile
|
JNIEXPORT void JNICALL Java_jgribapi_GribFile_gribCloseFile(JNIEnv*, jobject, jlong);
|
||||||
(JNIEnv *, jobject, jlong);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribFile
|
* Class: jgribapi_GribFile
|
||||||
* Method: gribNewFile
|
* Method: gribNewFile
|
||||||
* Signature: (Ljava/lang/String;)J
|
* Signature: (Ljava/lang/String;)J
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_jgribapi_GribFile_gribNewFile
|
JNIEXPORT jlong JNICALL Java_jgribapi_GribFile_gribNewFile(JNIEnv*, jobject, jstring);
|
||||||
(JNIEnv *, jobject, jstring);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribFile
|
* Class: jgribapi_GribFile
|
||||||
* Method: gribWriteHandle
|
* Method: gribWriteHandle
|
||||||
* Signature: (JJ)V
|
* Signature: (JJ)V
|
||||||
*/
|
*/
|
||||||
JNIEXPORT void JNICALL Java_jgribapi_GribFile_gribWriteHandle
|
JNIEXPORT void JNICALL Java_jgribapi_GribFile_gribWriteHandle(JNIEnv*, jobject, jlong, jlong);
|
||||||
(JNIEnv *, jobject, jlong, jlong);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,152 +22,133 @@ extern "C" {
|
||||||
* Method: getIteratorID
|
* Method: getIteratorID
|
||||||
* Signature: (J)J
|
* Signature: (J)J
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_jgribapi_GribHandle_getIteratorID
|
JNIEXPORT jlong JNICALL Java_jgribapi_GribHandle_getIteratorID(JNIEnv*, jobject, jlong);
|
||||||
(JNIEnv *, jobject, jlong);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribHandle
|
* Class: jgribapi_GribHandle
|
||||||
* Method: gribGetString
|
* Method: gribGetString
|
||||||
* Signature: (JLjava/lang/String;)Ljava/lang/String;
|
* Signature: (JLjava/lang/String;)Ljava/lang/String;
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jstring JNICALL Java_jgribapi_GribHandle_gribGetString
|
JNIEXPORT jstring JNICALL Java_jgribapi_GribHandle_gribGetString(JNIEnv*, jobject, jlong, jstring);
|
||||||
(JNIEnv *, jobject, jlong, jstring);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribHandle
|
* Class: jgribapi_GribHandle
|
||||||
* Method: gribGetLong
|
* Method: gribGetLong
|
||||||
* Signature: (JLjava/lang/String;)J
|
* Signature: (JLjava/lang/String;)J
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_jgribapi_GribHandle_gribGetLong
|
JNIEXPORT jlong JNICALL Java_jgribapi_GribHandle_gribGetLong(JNIEnv*, jobject, jlong, jstring);
|
||||||
(JNIEnv *, jobject, jlong, jstring);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribHandle
|
* Class: jgribapi_GribHandle
|
||||||
* Method: gribGetDouble
|
* Method: gribGetDouble
|
||||||
* Signature: (JLjava/lang/String;)D
|
* Signature: (JLjava/lang/String;)D
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jdouble JNICALL Java_jgribapi_GribHandle_gribGetDouble
|
JNIEXPORT jdouble JNICALL Java_jgribapi_GribHandle_gribGetDouble(JNIEnv*, jobject, jlong, jstring);
|
||||||
(JNIEnv *, jobject, jlong, jstring);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribHandle
|
* Class: jgribapi_GribHandle
|
||||||
* Method: gribGetLongArray
|
* Method: gribGetLongArray
|
||||||
* Signature: (JLjava/lang/String;)[J
|
* Signature: (JLjava/lang/String;)[J
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jlongArray JNICALL Java_jgribapi_GribHandle_gribGetLongArray
|
JNIEXPORT jlongArray JNICALL Java_jgribapi_GribHandle_gribGetLongArray(JNIEnv*, jobject, jlong, jstring);
|
||||||
(JNIEnv *, jobject, jlong, jstring);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribHandle
|
* Class: jgribapi_GribHandle
|
||||||
* Method: gribGetDoubleArray
|
* Method: gribGetDoubleArray
|
||||||
* Signature: (JLjava/lang/String;)[D
|
* Signature: (JLjava/lang/String;)[D
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jdoubleArray JNICALL Java_jgribapi_GribHandle_gribGetDoubleArray
|
JNIEXPORT jdoubleArray JNICALL Java_jgribapi_GribHandle_gribGetDoubleArray(JNIEnv*, jobject, jlong, jstring);
|
||||||
(JNIEnv *, jobject, jlong, jstring);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribHandle
|
* Class: jgribapi_GribHandle
|
||||||
* Method: gribSetString
|
* Method: gribSetString
|
||||||
* Signature: (JLjava/lang/String;Ljava/lang/String;)I
|
* Signature: (JLjava/lang/String;Ljava/lang/String;)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetString
|
JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetString(JNIEnv*, jobject, jlong, jstring, jstring);
|
||||||
(JNIEnv *, jobject, jlong, jstring, jstring);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribHandle
|
* Class: jgribapi_GribHandle
|
||||||
* Method: gribCreateNext
|
* Method: gribCreateNext
|
||||||
* Signature: (J)Ljgribapi/GribKey;
|
* Signature: (J)Ljgribapi/GribKey;
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jobject JNICALL Java_jgribapi_GribHandle_gribCreateNext
|
JNIEXPORT jobject JNICALL Java_jgribapi_GribHandle_gribCreateNext(JNIEnv*, jobject, jlong);
|
||||||
(JNIEnv *, jobject, jlong);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribHandle
|
* Class: jgribapi_GribHandle
|
||||||
* Method: gribSetSearch
|
* Method: gribSetSearch
|
||||||
* Signature: (JLjava/lang/String;)J
|
* Signature: (JLjava/lang/String;)J
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_jgribapi_GribHandle_gribSetSearch
|
JNIEXPORT jlong JNICALL Java_jgribapi_GribHandle_gribSetSearch(JNIEnv*, jobject, jlong, jstring);
|
||||||
(JNIEnv *, jobject, jlong, jstring);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribHandle
|
* Class: jgribapi_GribHandle
|
||||||
* Method: gribSetLong
|
* Method: gribSetLong
|
||||||
* Signature: (JLjava/lang/String;J)I
|
* Signature: (JLjava/lang/String;J)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetLong
|
JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetLong(JNIEnv*, jobject, jlong, jstring, jlong);
|
||||||
(JNIEnv *, jobject, jlong, jstring, jlong);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribHandle
|
* Class: jgribapi_GribHandle
|
||||||
* Method: gribSetDouble
|
* Method: gribSetDouble
|
||||||
* Signature: (JLjava/lang/String;D)I
|
* Signature: (JLjava/lang/String;D)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetDouble
|
JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetDouble(JNIEnv*, jobject, jlong, jstring, jdouble);
|
||||||
(JNIEnv *, jobject, jlong, jstring, jdouble);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribHandle
|
* Class: jgribapi_GribHandle
|
||||||
* Method: gribSetLongArray
|
* Method: gribSetLongArray
|
||||||
* Signature: (JLjava/lang/String;[J)I
|
* Signature: (JLjava/lang/String;[J)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetLongArray
|
JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetLongArray(JNIEnv*, jobject, jlong, jstring, jlongArray);
|
||||||
(JNIEnv *, jobject, jlong, jstring, jlongArray);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribHandle
|
* Class: jgribapi_GribHandle
|
||||||
* Method: gribSetDoubleArray
|
* Method: gribSetDoubleArray
|
||||||
* Signature: (JLjava/lang/String;[D)I
|
* Signature: (JLjava/lang/String;[D)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetDoubleArray
|
JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetDoubleArray(JNIEnv*, jobject, jlong, jstring, jdoubleArray);
|
||||||
(JNIEnv *, jobject, jlong, jstring, jdoubleArray);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribHandle
|
* Class: jgribapi_GribHandle
|
||||||
* Method: gribGetXml
|
* Method: gribGetXml
|
||||||
* Signature: (J)Ljava/lang/String;
|
* Signature: (J)Ljava/lang/String;
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jstring JNICALL Java_jgribapi_GribHandle_gribGetXml__J
|
JNIEXPORT jstring JNICALL Java_jgribapi_GribHandle_gribGetXml__J(JNIEnv*, jobject, jlong);
|
||||||
(JNIEnv *, jobject, jlong);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribHandle
|
* Class: jgribapi_GribHandle
|
||||||
* Method: gribGetXml
|
* Method: gribGetXml
|
||||||
* Signature: (JLjava/lang/String;)Ljava/lang/String;
|
* Signature: (JLjava/lang/String;)Ljava/lang/String;
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jstring JNICALL Java_jgribapi_GribHandle_gribGetXml__JLjava_lang_String_2
|
JNIEXPORT jstring JNICALL Java_jgribapi_GribHandle_gribGetXml__JLjava_lang_String_2(JNIEnv*, jobject, jlong, jstring);
|
||||||
(JNIEnv *, jobject, jlong, jstring);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribHandle
|
* Class: jgribapi_GribHandle
|
||||||
* Method: gribGetAscii
|
* Method: gribGetAscii
|
||||||
* Signature: (JLjava/lang/String;)Ljava/lang/String;
|
* Signature: (JLjava/lang/String;)Ljava/lang/String;
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jstring JNICALL Java_jgribapi_GribHandle_gribGetAscii
|
JNIEXPORT jstring JNICALL Java_jgribapi_GribHandle_gribGetAscii(JNIEnv*, jobject, jlong, jstring);
|
||||||
(JNIEnv *, jobject, jlong, jstring);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribHandle
|
* Class: jgribapi_GribHandle
|
||||||
* Method: gribGetBytes
|
* Method: gribGetBytes
|
||||||
* Signature: (JLjava/lang/String;)[B
|
* Signature: (JLjava/lang/String;)[B
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jbyteArray JNICALL Java_jgribapi_GribHandle_gribGetBytes
|
JNIEXPORT jbyteArray JNICALL Java_jgribapi_GribHandle_gribGetBytes(JNIEnv*, jobject, jlong, jstring);
|
||||||
(JNIEnv *, jobject, jlong, jstring);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribHandle
|
* Class: jgribapi_GribHandle
|
||||||
* Method: gribDeleteHandle
|
* Method: gribDeleteHandle
|
||||||
* Signature: (J)I
|
* Signature: (J)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribDeleteHandle
|
JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribDeleteHandle(JNIEnv*, jobject, jlong);
|
||||||
(JNIEnv *, jobject, jlong);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribHandle
|
* Class: jgribapi_GribHandle
|
||||||
* Method: gribResetHandle
|
* Method: gribResetHandle
|
||||||
* Signature: (J)V
|
* Signature: (J)V
|
||||||
*/
|
*/
|
||||||
JNIEXPORT void JNICALL Java_jgribapi_GribHandle_gribResetHandle
|
JNIEXPORT void JNICALL Java_jgribapi_GribHandle_gribResetHandle(JNIEnv*, jobject, jlong);
|
||||||
(JNIEnv *, jobject, jlong);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,16 +22,14 @@ extern "C" {
|
||||||
* Method: gribIteratorGetNext
|
* Method: gribIteratorGetNext
|
||||||
* Signature: (J)Ljgribapi/GribPoint;
|
* Signature: (J)Ljgribapi/GribPoint;
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jobject JNICALL Java_jgribapi_GribIterator_gribIteratorGetNext
|
JNIEXPORT jobject JNICALL Java_jgribapi_GribIterator_gribIteratorGetNext(JNIEnv*, jobject, jlong);
|
||||||
(JNIEnv *, jobject, jlong);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: jgribapi_GribIterator
|
* Class: jgribapi_GribIterator
|
||||||
* Method: gribIteratorHasNext
|
* Method: gribIteratorHasNext
|
||||||
* Signature: (J)J
|
* Signature: (J)J
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jlong JNICALL Java_jgribapi_GribIterator_gribIteratorHasNext
|
JNIEXPORT jlong JNICALL Java_jgribapi_GribIterator_gribIteratorHasNext(JNIEnv*, jobject, jlong);
|
||||||
(JNIEnv *, jobject, jlong);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
typedef struct grib_md5_state {
|
typedef struct grib_md5_state
|
||||||
|
{
|
||||||
uint64_t size;
|
uint64_t size;
|
||||||
|
|
||||||
unsigned long words[64];
|
unsigned long words[64];
|
||||||
|
@ -31,6 +32,6 @@ typedef struct grib_md5_state {
|
||||||
|
|
||||||
void grib_md5_init(grib_md5_state* s);
|
void grib_md5_init(grib_md5_state* s);
|
||||||
void grib_md5_add(grib_md5_state* s, const void* data, size_t len);
|
void grib_md5_add(grib_md5_state* s, const void* data, size_t len);
|
||||||
void grib_md5_end(grib_md5_state* s, char *digest);
|
void grib_md5_end(grib_md5_state* s, char* digest);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue