File: private.hh

package info (click to toggle)
gri 2.4.2-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 4,540 kB
  • ctags: 1,966
  • sloc: cpp: 32,542; lisp: 3,243; perl: 806; makefile: 548; sh: 253
file content (240 lines) | stat: -rw-r--r-- 10,730 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
// Private definitions for gri. See also extern.hh

#if !defined(_private_)
#define		_private_

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <vector>		// part of STL
#include "gr.hh"
#include "gr_coll.hh"
#include "errors.hh"
#include "files.hh"
#include "GriTimer.hh"
#include "DataFile.hh"



#define         cmd_being_done_LEN       100	// cmd stack
#define		LineLength	       32768	// max length of line
#define		LineLength_1	       32767	// -1 + max length of line
#define		MAX_cmd_word		8192	// words/command
#define		MAX_nword		8192	// words/line
#define		_num_dstackMAX		  50	// length of dstack
#define		_imageBLANK		 255	// blank images with white

// Image storage.
typedef struct {
    int             ras_magic;	// magic number
    unsigned int    ras_width;	// width (pixels) of image
    unsigned int    ras_height;	// height (pixels) of image
    unsigned int    ras_depth;	// depth (1, 8, or 24 bits) of pixel
    unsigned int    ras_length;	// length (bytes) of image
    int             ras_type;	// type of file; see RT_* below
    int             ras_maptype;// type of colormap; see RMT_* below
    unsigned int    ras_maplength; // length (bytes) of following map
    unsigned char  *map;	   // map
    unsigned char  *image;	   // image
}               IMAGE;

// From Sun's /usr/include/rasterfile.h
#define	RAS_MAGIC	0x59a66a95
#define RT_STANDARD	1
#define RMT_NONE        0
#define RMT_EQUAL_RGB   1
#define RMT_RAW         2




bool            allocate_grid_storage(int nx, int ny);
bool            allocate_image_storage(int nx, int ny);
bool            allocate_imageMask_storage(int nx, int ny);
bool            allocate_xmatrix_storage(int n);
bool            allocate_ymatrix_storage(int n);
bool            assign_synonym(void);
bool            batch(void);
void            beep_terminal(void);
bool            blank_image(void);
bool            blank_imageMask(void);
int             block_level(void);
char           *block_source_file(void);
unsigned int    block_source_line(void);
unsigned int    block_offset_line(void);
void            bounding_box_display(const char *msg);
void            bounding_box_update(const rectangle& box);

bool locate_i_j(double xx, double yy, int *ii, int *jj);
#if defined(OLD_IMAGE_INTERPOLATION)
bool value_i_j(unsigned int ii, unsigned int jj, double xx, double yy, double *value);
#else
bool value_i_j(unsigned int ii, unsigned int jj, double xx, double yy, double *value);
#endif

bool            calculate_image_histogram(void);
void            check_psfile(void);
bool            chop_into_words(char *s, char **w, int *nw, int max);
bool            chop_into_data_words(char *s, char **w, int *nw, int max);
void            clear_eof_flag_on_data_file(void);
void            close_data_files();
int             cmd_being_done(void);
char           *complete_filename(const char *name);
bool            create_commands(const char *filename);
bool            create_color(const char *name, double r, double g, double b);
bool            create_new_command(FILE * fp, char *line);
bool            create_synonym(const char *name, const char *value);
bool            create_variable(const char *name, double value);
bool            create_x_scale(void);
bool            create_y_scale(void);
char           *cshell_name(const char *s);

int             data_file_index(const char *name);
bool            define_image_scales(double llx, double lly, double urx, double ury);
bool            delete_file(const char *filename);
bool            delete_syn(const char *name);
bool            delete_var(const char *name);
bool            demonstrate_command_usage(void);
void            display_cmd_being_done_stack();
void            display_cmd_stack(const char *s);
void            display_data_stack(const char *s);
void            display_unused_var(void);
void            display_unused_syn(void);
bool            do_command_line(void);
bool            draw_axes(int type, double loc, gr_axis_properties side, bool allow_offset);
bool            draw_axes_if_needed(void);
bool            draw_gri_logo(void);
char           *egetenv(const char *s);
void            end_up(void);
void            expand_blanks(char *cmdline);
int             ExtractQuote(char *sout, const char *s);
bool            extract_help(FILE * fp, char *line);
bool            extract_procedure(FILE * fp, char *line);
bool            extract_syntax(char *line);
char           *file_in_list(const char *name, bool show_nonlocal_files, bool show_local_files);
const char     *filename_sans_dir(const char *fullfilename);
bool            find_min_max(double *data, int num, double *min, double *max);
bool            find_min_max_v(void);
bool            find_min_max_x(void);
bool            find_min_max_y(void);
bool            find_min_max_z(void);
int             get_cmd_values(char **w, int nw, const char *key, int nobjects, double *objects);
bool            get_c_file_name(int old, const char *prompt, const char *name);
bool            get_command_line(void);
bool            getdnum(const char *string, double *number);
bool            get_flag(const char *name);
bool            getinum(const char *string, int *number);
bool            get_var(const char *name, double *value);
bool            get_syn(const char *name, char *value);
void            give_help(void);
void            gri_abort(void);
void            gri_exit(int code);
bool            grid_interp(double xx, double yy, double *value);
bool            grid_exists(void);
bool            gr_missing(double x);
bool            handle_if_block(void);
void            highpass_image(void);
void            histogram_stats(const double *x, unsigned int n, double *q1, double *q2, double *q3);
bool            ignoreCmd(void);
bool            image_exists(void);
bool            image_mapping_exists(void);
bool            image_range_exists(void);
bool            imageMask_exists(void);
bool            image_scales_defined(void);
double          image_to_value(int c);
bool            inside_box(double x, double y);
bool            is_create_new_command(const char *cmdline);
bool            is_punctuation(int c);
bool            is_syn(const char *name);
bool            is_system_command(const char *s);
bool            is_var(const char *w);
char            last_character(const char *s);
bool            look_up_color(const char *name, double *red, double *green, double *blue);
void            lowpass_image(void);
bool            massage_command_line(char *cmdline);
int             match_gri_syntax(const char *cmdline, int flag);
bool            mathCmd(void);
void            matrix_limits(double *min, double *max);
void            moment(double *data, int n, double *ave, double *adev, double *sdev, double *svar, double *skew, double *kurt);
void            more_file_to_terminal(const char *filename);
void            no_scales_error(void);
int             number_good_xyz(double x[], double y[], double f[], int n);
unsigned int    number_missing_cols(void);
int             parse_C_commandCmd(const char *s);
bool            perform_block(const char *s, const char *source_file, int source_line);
bool            perform_command_line(FILE * fp, bool is_which);
int             perform_gri_cmd(int cmd);
bool            perform_gri_program(void);
bool            perform_while_block(const char *buffer, const char *test, int lines);
void            pop_command_word_buffer(void);
void            pop_cmd_being_done_stack(void);
void            push_cmd_being_done_stack(int cmd);
bool            push_cmd_file(const char *fname, bool interactive, bool allow_warning, const char *status);
void            push_command_word_buffer(void);
bool            put_var(const char *name, double value, bool replace_existing);
bool            put_syn(const char *name, const char *value, bool replace_existing);
bool            pop_data_file(int file);
bool            push_data_file(const char *name, DataFile::type the_type, const char *status, bool delete_when_close);
bool            push_data_file_to_top(const char *name);
char           *pwd(void);
double          quantize(double x, int levels, double dx);
bool            quoted(const char *string);
bool            re_compare(const char *string, const char *pattern);
void            remove_comment(char *cmdline);
void            remove_esc_quotes(char *w);
void            remove_trailing_blanks(char *s);
bool            rpn_create_function(char *name, char **w, unsigned int nw);
bool            same_syntax(const char *cmdline, const char *syntax, int flag);
bool            same_word(const char *cp, const char *sp);
bool            scales_defined(void);
bool            set_environment(void);
bool            set_flagCmd(void);
void            set_eof_flag_on_data_file(void);
void            set_line_width_axis(void);
void            set_line_width_curve(void);
void            set_line_width_symbol(void);
void            set_ps_color(char path_or_text);
void            set_up_command_word_buffer(void);
bool            set_x_scale(void);
bool            set_y_scale(void);
bool            show_grid_maskCmd(void);
bool            show_next_lineCmd(void);
void            show_var_stack(void);
void            show_syn_stack();
int             skip_space(const char *s);
int             skip_nonspace(const char *s);
bool            skipping_through_if(void);
bool            start_up(int argc, char ** argv);
bool            stop_replay_if_error(void);
void            strcat_c(char *s, int c);
bool            string_is_blank(const char *s);
bool            substitute_rpn_expressions(const char *cmdline, char *cmdlinecopy);
bool            substitute_synonyms_cmdline(const char *s, char *sout, bool allow_math);
bool            substitute_synonyms(const char *s, char *sout, bool allow_math);
int             superuser(void);
void            swap(double& a, double& b);
bool            systemCmd(void);
char           *tilde_expand(const char *s);
bool            tracing(void);
bool            update_readfrom_file_name(void);
char           *unbackslash(const char *s);
unsigned char   value_to_image(double v);
void		vector_reverse(double *x, int n);
double          vector_min(double *x, unsigned n);
double          vector_max(double *x, unsigned n);

#if defined(VMS)
void
warning(va_dcl va_alist);
#else
void            warning(const char *string, ...);
#endif

bool            warn_if_slow(GriTimer *t, double fraction_done, const char *cmd);
int             what_line(void);
char           *what_file(void);
bool            well_ordered(double min, double max, double inc);
bool            word_is(int i, const char *word);
void            write_prompt(void);

#endif				// not _private_