tools/bufr_ls.c
/*
 A new handle is available from the current input file and can be processed here.
 The handle available in this function is in the set of messages satisfying the constraint
 of the -w option. They are not to be skipped.
 */
A new handle is available from the current input file and can be processed here.
The handle available in this function is in the set of messages satisfying the constraint
of the -w option. They are not to be skipped.
A new handle is available from the current input file and can be processed here . The handle available in this function is in the set of messages satisfying the constraint of the - w option . They are not to be skipped .
int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h)
{
    int err = 0;
    if (!options->skip) {
        if (options->set_values_count != 0)
            err = grib_set_values(h, options->set_values, options->set_values_count);
        if (err != GRIB_SUCCESS && options->fail)
            exit(err);
    }
    if (options->json_output) {
        if (options->current_infile && options->current_infile->name) {
            size_t len = strlen(options->current_infile->name);
            grib_set_string(h, "file", options->current_infile->name, &len);
        }
        if (!first_handle && options->handle_count > 1) {
            fprintf(stdout, ",\n");
        }
        if (options->json_output && first_handle) {
            fprintf(stdout, "{ \"messages\" : [ \n");
            first_handle = 0;
        }
    }
    return 0;
}
int grib_tool_new_handle_action ( grib_runtime_options * options , grib_handle * h ) { int err = 0 ; if ( ! options -> skip ) { if ( options -> set_values_count != 0 ) err = grib_set_values ( h , options -> set_values , options -> set_values_count ) ; if ( err != GRIB_SUCCESS && options -> fail ) exit ( err ) ; } if ( options -> json_output ) { if ( options -> current_infile && options -> current_infile -> name ) { size_t len = strlen ( options -> current_infile -> name ) ; grib_set_string ( h , " " , options -> current_infile -> name , & len ) ; } if ( ! first_handle && options -> handle_count > 1 ) { fprintf ( stdout , " \n " ) ; } if ( options -> json_output && first_handle ) { fprintf ( stdout , " \" \" \n " ) ; first_handle = 0 ; } } return 0 ; }
A new handle is available from the current input file and can be processed here.
A new handle is available from the current input file and can be processed here .