home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume8 / graph+ / part01 / graph.h < prev    next >
Encoding:
C/C++ Source or Header  |  1987-03-01  |  2.3 KB  |  107 lines

  1. /*
  2.  * Copyright (C) 1986   Alan Kent
  3.  *
  4.  * Permission is granted to freely distribute part or
  5.  * all of this code as long as it is not for profit
  6.  * and this message is retained in the code.
  7.  *
  8.  * No resposibility is taken for any damage or incorect
  9.  * results this program generates.
  10.  * 
  11.  */
  12.  
  13.  
  14. #define MAX_GRAPHS 30
  15.  
  16. typedef struct table_st {
  17.     int size;
  18.     double *data;
  19.     struct table_st *next;
  20. } table_st;
  21.  
  22. typedef struct tnode_st {
  23.     int operator;
  24.     struct tnode_st *left , *right;
  25.     struct table_st *table;
  26.     struct expr_list_st *expr_list;
  27.     struct attr_st *expr;
  28.     char *ident;
  29.     double value;
  30.     struct range_st *range;
  31.     struct int_st *interval;
  32.     int func;
  33.     struct parm_st *parm_list;
  34.     struct trow_st *const_table;
  35. } tnode_st;
  36.  
  37. typedef struct attr_st {
  38.     double value;
  39.     int node_type;
  40.     struct attr_st *left , *right;
  41.     char *ident;
  42.     struct parm_st *parm_list;
  43. } attr_st;
  44.  
  45. typedef struct expr_list_st {
  46.     struct attr_st *expr;
  47.     struct expr_list_st *next;
  48. } expr_list_st;
  49.  
  50. typedef struct range_st {
  51.     double min , max;
  52. } range_st;
  53.  
  54. typedef struct int_st {
  55. #define ISIZE    0
  56. #define INUMINT    1
  57.     int int_type;
  58.     double value;
  59. } int_st;
  60.  
  61. typedef struct graph_st {
  62.     int line_type;    /* NO,DOTTED,SOLID,LONGDASHED,SHORTDASHED,DOTDASHED */
  63.     int point_type;    /* A mask MSK_TRIANGLE etc */
  64. #define MSK_CIRCLE    0x01
  65. #define MSK_TRIANGLE    0x02
  66. #define MSK_SQUARE    0x04
  67. #define MSK_CROSS    0x08
  68. #define MSK_PLUS    0x10
  69.     int cumulative;    /* true/false */
  70.     char *label;
  71.     char *legend;    /* NULL means dont put in legend */
  72.     table_st *table;
  73. } graph_st;
  74.  
  75. typedef struct axis_st {
  76.     char *format;    /* printf format for numbering axis */
  77.     char *user_format;    /* user defined format */
  78.     char *label;
  79.     int scale;        /* AUTO,NO */
  80.     int frame;        /* FRAME,GRID,OUTLINE,NO */
  81.     int linear;        /* LOG,LINEAR */
  82.     int auto_tick_size;    /* true/false */
  83.     range_st range;
  84.     int_st *interval;
  85.     double tick_size;
  86.     double power_10;
  87. } axis_st;
  88.  
  89. typedef struct parm_st {
  90.     int parm_type;
  91.     char *ident;
  92.     tnode_st *tab_expr;
  93.     attr_st *expr;
  94.     struct parm_st *next;
  95. } parm_st;
  96.  
  97. typedef struct tcol_st {
  98.     struct attr_st *expr;
  99.     struct tcol_st *next;
  100. } tcol_st;
  101.  
  102. typedef struct trow_st {
  103.     struct tcol_st *cols;
  104.     struct trow_st *next;
  105. } trow_st;
  106.  
  107.