1 /* GNUPLOT - misc.h */
2 
3 /*[
4  * Copyright 1999, 2004   Thomas Williams, Colin Kelley
5  *
6  * Permission to use, copy, and distribute this software and its
7  * documentation for any purpose with or without fee is hereby granted,
8  * provided that the above copyright notice appear in all copies and
9  * that both that copyright notice and this permission notice appear
10  * in supporting documentation.
11  *
12  * Permission to modify the software is granted, but not the right to
13  * distribute the complete modified source code.  Modifications are to
14  * be distributed as patches to the released version.  Permission to
15  * distribute binaries produced by compiling modified sources is granted,
16  * provided you
17  *   1. distribute the corresponding source modifications from the
18  *    released version in the form of a patch file along with the binaries,
19  *   2. add special version identification to distinguish your version
20  *    in addition to the base release version number,
21  *   3. provide your name and address as the primary contact for the
22  *    support of your modified version, and
23  *   4. retain our contact information in regard to use of the base
24  *    software.
25  * Permission to distribute the released version of the source code along
26  * with corresponding source modifications in the form of a patch file is
27  * granted with same provisions 2 through 4 for binary distributions.
28  *
29  * This software is provided "as is" without express or implied warranty
30  * to the extent permitted by applicable law.
31 ]*/
32 
33 #ifndef GNUPLOT_MISC_H
34 # define GNUPLOT_MISC_H
35 
36 #include "syscfg.h"
37 #include "gp_types.h"
38 #include "stdfn.h"
39 
40 #include "graphics.h"
41 #include "graph3d.h"
42 #include "term_api.h"
43 
44 
45 /* Variables of misc.c needed by other modules: */
46 
47 /* Used by postscript terminal if a font file is found by loadpath_fopen() */
48 extern char *loadpath_fontname;
49 
50 /* these two are global so that plot.c can load them on program entry */
51 extern char *call_args[10];
52 extern int call_argc;
53 
54 /* Prototypes from file "misc.c" */
55 
56 const char *expand_call_arg(int c);
57 void load_file(FILE *fp, char *name, int calltype);
58 FILE *lf_top(void);
59 TBOOLEAN lf_pop(void);
60 void lf_push(FILE *fp, char *name, char *cmdline);
61 void load_file_error(void);
62 FILE *loadpath_fopen(const char *, const char *);
63 void push_terminal(int is_interactive);
64 void pop_terminal(void);
65 
66 /* moved here, from setshow */
67 enum PLOT_STYLE get_style(void);
68 void get_filledcurves_style_options(filledcurves_opts *);
69 void filledcurves_options_tofile(filledcurves_opts *, FILE *);
70 int lp_parse(struct lp_style_type *lp, lp_class destination_class, TBOOLEAN allow_point);
71 
72 void arrow_parse(struct arrow_style_type *, TBOOLEAN);
73 void arrow_use_properties(struct arrow_style_type *arrow, int tag);
74 
75 void parse_fillstyle(struct fill_style_type *fs);
76 void parse_colorspec(struct t_colorspec *tc, int option);
77 long parse_color_name(void);
78 TBOOLEAN need_fill_border(struct fill_style_type *fillstyle);
79 
80 void get_image_options(t_image *image);
81 
82 int parse_dashtype(struct t_dashtype *dt);
83 
84 /* State information for load_file(), to recover from errors
85  * and properly handle recursive load_file calls
86  */
87 typedef struct lf_state_struct {
88     /* new recursion level: */
89     FILE *fp;			/* file pointer for load file */
90     char *name;			/* name of file */
91     char *cmdline;              /* content of command string for do_string() */
92     /* last recursion level: */
93     TBOOLEAN interactive;	/* value of interactive flag on entry */
94     int inline_num;		/* inline_num on entry */
95     int depth;			/* recursion depth */
96     int if_depth;		/* used by _old_ if/else syntax */
97     TBOOLEAN if_open_for_else;	/* used by _new_ if/else syntax */
98     TBOOLEAN if_condition;	/* used by both old and new if/else syntax */
99     char *input_line;		/* Input line text to restore */
100     struct lexical_unit *tokens;/* Input line tokens to restore */
101     int num_tokens;		/* How big is the above ? */
102     int c_token;		/* Which one were we on ? */
103     struct lf_state_struct *prev;			/* defines a stack */
104     int call_argc;		/* This saves the _caller's_ argc */
105     char *call_args[10];	/* ARG0 through ARG9 from "call" command */
106     struct value argv[10];	/* content of global ARGV[] array */
107 }  LFS;
108 extern LFS *lf_head;
109 
110 #endif /* GNUPLOT_MISC_H */
111