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 241 242 243 244 245 246 247 248 249 250 251 252 253
|
#ifndef _JGRAPH_H
#define _JGRAPH_H
/*
* $Source: /tmp_mnt/n/fs/grad1/jsp/src/jgraph/RCS/jgraph.h,v $
* $Revision: 8.3 $
* $Date: 92/11/30 11:42:24 $
* $Author: jsp $
*/
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "list.h"
#include "prio_list.h"
#define PPI 120
#define FPPI 120.0
#define CPI 72.0
#define FCPI 72.0
#define CNULL ((char *)0)
#define GMNULL ((Point)0)
#define FSIG -10010.0
#define ISIG -11111111
#define HASH_SIZE 5.0
#define MHASH_SIZE 2.0
typedef int Boolean;
typedef struct point {
struct point *flink;
struct point *blink;
float x;
float y;
char e; /* 'x' for x_ebars, 'y' for y_ebars, 'p' for neither */
} *Point;
typedef struct flist {
struct flist *flink;
struct flist *blink;
float f;
} *Flist;
typedef struct label {
char *label;
float x;
float y;
float rotate;
char *font;
float fontsize;
char hj;
char vj;
float gray[3];
char graytype;
float linesep;
float xmin;
float xmax;
float ymin;
float ymax;
int nlines;
} *Label;
typedef struct curve {
struct curve *flink;
struct curve *blink;
int num;
Label l;
Label lmark;
Point pts;
Point yepts;
Point xepts;
int npts;
Point general_marks;
float marksize[2];
float fill[3];
float gray[3];
float afill[3];
float pfill[3];
float linethick;
float mrotate;
Flist gen_linetype;
char graytype ;
char filltype ;
char afilltype;
char pfilltype;
char pattern;
float parg;
char apattern;
float aparg;
char ppattern;
float pparg;
char marktype;
char linetype;
char *postscript;
char *eps;
int postfile;
int rarrow;
int larrow;
int rarrows;
int larrows;
int bezier;
int poly;
float asize[2];
int clip;
} *Curve;
typedef struct string {
struct string *flink;
struct string *blink;
int num;
Label s;
} *String;
typedef struct hash {
struct hash *flink;
struct hash *blink;
float loc;
float size;
int major;
} *Hash;
typedef struct deflt {
float rotate;
float fontsize;
Point general_marks;
float fill;
float linethick;
float marksize[2];
char *font;
char hj;
char vj;
char marktype;
} *Default;
typedef struct axis {
Label label;
Label hl;
float max;
float min;
float pmax;
float pmin;
float logmin;
float logfactor;
float size;
float psize;
float factor;
float hash_interval;
float hash_start;
float hash_scale;
float log_base;
float draw_hash_marks_at;
float draw_hash_labels_at;
float draw_at;
float gray[3];
char graytype;
float gr_gray[3];
char gr_graytype;
float mgr_gray[3];
char mgr_graytype;
char hash_format;
int grid_lines;
int mgrid_lines;
int draw_hash_labels;
int draw_axis_line;
int draw_hash_marks;
int draw_axis_label;
int auto_hash_labels;
int auto_hash_marks;
int minor_hashes;
int precision;
int start_given;
String hash_labels;
Hash hash_lines;
int is_x;
int is_lg;
} *Axis;
typedef struct legend {
float linelength;
float linebreak;
int anylines;
float midspace;
char type; /* 'n' = off, 'u' = userdefined (use Label), 'c' = custom */
Label l;
} *Legend;
typedef struct graph {
struct graph *flink;
struct graph *blink;
int num;
float xminval;
float yminval;
float xmaxval;
float ymaxval;
float x_translate;
float y_translate;
Axis x_axis;
Axis y_axis;
Curve curves;
Legend legend;
String strings;
Label title;
int clip;
int border;
Default def;
} *Graph;
typedef struct graphs {
struct graphs *flink;
struct graphs *blink;
Graph g;
float height;
float width;
int bb[4]; /* Bounding box */
char *preamble;
char *epilogue;
int prefile;
int epifile;
int page;
} *Graphs;
extern float ctop(float val, Axis axis);
extern float disttop(float val, Axis axis);
extern float intop(float val);
extern float ptoc(float p, Axis a);
extern float ptodist(float p, Axis a);
extern char *getlabel(void);
extern char *getmultiline(void);
/* Stuff defined in jgraph.c */
extern Curve new_line(Curve c, int num);
extern Curve new_curve(Curve c, int num);
extern Curve get_curve(Curve c, int num);
extern Graph new_graph(Graph gs, int num);
extern Graph get_graph(Graph g, int num);
extern String new_string(String s, int num);
extern String get_string(String s, int num);
extern Label new_label(void);
extern char *MARKTYPESTRS[];
extern char MARKTYPES[];
extern int NMARKTYPES;
extern int NORMALMARKTYPES;
extern char *PATTERNS[];
extern char PTYPES[];
extern int NPATTERNS;
#include "general.h"
#endif
|