Doxygen Source Code Documentation
dumplib.h File Reference
Go to the source code of this file.
Data Structures | |
| struct | vnode |
Defines | |
| #define | NO_NETCDF_2 |
| #define | EXIT_SUCCESS 0 |
| #define | EXIT_FAILURE 1 |
| #define | FLT_DIGITS 7 |
| #define | DBL_DIGITS 15 |
Typedefs | |
| typedef vnode | vnode |
Functions | |
| void | error (const char *fmt,...) |
| void | set_indent (int indent) |
| void | set_max_len (int len) |
| void | lput (const char *string) |
| void | set_formats (int flt_digs, int dbl_digs) |
| char * | get_fmt (int ncid, int varid, nc_type type) |
| vnode * | newvlist (void) |
| void | varadd (vnode *vlist, int varid) |
| int | varmember (const vnode *vlist, int varid) |
Variables | |
| char * | progname |
| int | float_precision_specified |
| int | double_precision_specified |
| char | float_var_fmt [] |
| char | double_var_fmt [] |
| char | float_att_fmt [] |
| char | double_att_fmt [] |
Define Documentation
|
|
Definition at line 22 of file dumplib.h. Referenced by main(), set_precision(), and set_sigdigs(). |
|
|
|
|
|
|
|
|
Definition at line 21 of file dumplib.h. Referenced by main(), set_precision(), and set_sigdigs(). |
|
|
|
Typedef Documentation
|
|
|
Function Documentation
|
||||||||||||
|
Definition at line 33 of file dumplib.c. References args. Referenced by crop_image(), do_ncdump(), find_background(), find_color_or_error(), frame_argument(), get_fmt(), get_input_stream(), gifread_error(), input_stream(), main(), make_lvars(), merge_frame_interval(), name_path(), new_viewer(), newvnode(), output_information(), pipe_color_transformer(), pr_att(), pr_att_vals(), read_colormap_file(), read_text_colormap(), set_precision(), set_sigdigs(), type_name(), vardata(), and write_stream().
00034 {
00035 va_list args ;
00036
00037 (void) fprintf(stderr,"%s: ", progname);
00038 va_start(args, fmt) ;
00039 (void) vfprintf(stderr,fmt,args) ;
00040 va_end(args) ;
00041
00042 (void) fprintf(stderr, "\n") ;
00043 (void) fflush(stderr); /* to ensure log files are current */
00044 exit(EXIT_FAILURE);
00045 }
|
|
||||||||||||||||
|
Definition at line 130 of file dumplib.c. References double_precision_specified, double_var_fmt, error(), float_precision_specified, float_var_fmt, and has_c_format_att(). Referenced by vardata().
00135 {
00136 char *c_format_att;
00137
00138 /* float or double precision specified with -p option overrides any
00139 C_format attribute value, so check for that first. */
00140
00141 if (float_precision_specified && type == NC_FLOAT)
00142 return float_var_fmt;
00143
00144 if (double_precision_specified && type == NC_DOUBLE)
00145 return double_var_fmt;
00146
00147 /* If C_format attribute exists, return it */
00148 c_format_att = has_c_format_att(ncid, varid);
00149 if (c_format_att)
00150 return c_format_att;
00151
00152 /* Otherwise return sensible default. */
00153 switch (type) {
00154 case NC_BYTE:
00155 return "%d";
00156 case NC_CHAR:
00157 return "%s";
00158 case NC_SHORT:
00159 return "%d";
00160 case NC_INT:
00161 return "%d";
00162 case NC_FLOAT:
00163 return float_var_fmt;
00164 case NC_DOUBLE:
00165 return double_var_fmt;
00166 default:
00167 error("pr_vals: bad type");
00168 }
00169
00170 return 0;
00171 }
|
|
|
Definition at line 67 of file dumplib.c. References linep, LINEPIND, and max_line_len. Referenced by lastdelim2(), pr_bvals(), pr_dvals(), pr_fvals(), pr_ivals(), pr_svals(), and pr_tvals().
|
|
|
Definition at line 190 of file dumplib.c. References newvnode(). Referenced by do_ncdump().
|
|
||||||||||||
|
Definition at line 82 of file dumplib.c. References double_att_fmt, double_var_fmt, float_att_fmt, and float_var_fmt. Referenced by main(), set_precision(), and set_sigdigs().
00083 {
00084 (void) sprintf(float_var_fmt, "%%.%dg", float_digits);
00085 (void) sprintf(double_var_fmt, "%%.%dg", double_digits);
00086 (void) sprintf(float_att_fmt, "%%#.%dgf", float_digits);
00087 (void) sprintf(double_att_fmt, "%%#.%dg", double_digits);
00088 }
|
|
|
Definition at line 53 of file dumplib.c. References linep. Referenced by vardata().
00054 {
00055 linep = in;
00056 }
|
|
|
Definition at line 60 of file dumplib.c. References max_line_len. Referenced by main().
00061 {
00062 max_line_len = len-2;
00063 }
|
|
||||||||||||
|
Definition at line 202 of file dumplib.c. References newvnode(). Referenced by do_ncdump().
|
|
||||||||||||
|
Definition at line 213 of file dumplib.c. References vnode::id, and vnode::next. Referenced by do_ncdump().
|
Variable Documentation
|
|
Definition at line 29 of file dumplib.h. Referenced by set_formats(). |
|
|
Definition at line 25 of file dumplib.h. Referenced by get_fmt(). |
|
|
Definition at line 27 of file dumplib.h. Referenced by get_fmt(), and set_formats(). |
|
|
Definition at line 28 of file dumplib.h. Referenced by set_formats(). |
|
|
Definition at line 24 of file dumplib.h. Referenced by get_fmt(). |
|
|
Definition at line 26 of file dumplib.h. Referenced by get_fmt(), and set_formats(). |
|
|
|