home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / graphics-0.17 / graph / extern.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-03-11  |  3.5 KB  |  137 lines

  1. /* plot, unix plot file to graphics device translators.
  2.    Copyright (C) 1989 Free Software Foundation, Inc.
  3.  
  4.    plot is distributed in the hope that it will be useful, but WITHOUT
  5.    ANY WARRANTY.  No author or distributor accepts responsibility to
  6.    anyone for the consequences of using it or for whether it serves any
  7.    particular purpose or works at all, unless he says so in writing.
  8.    Refer to the GNU General Public License for full details.
  9.    
  10.    Everyone is granted permission to copy, modify and redistribute plot,
  11.    but only under the conditions described in the GNU General Public
  12.    License.  A copy of this license is supposed to have been given to you
  13.    along with plot so you can know your rights and responsibilities.  It
  14.    should be in a file named COPYING.  Among other things, the copyright
  15.    notice and this notice must be preserved on all copies.  */
  16.  
  17. #ifndef extern_h
  18. #define extern_h
  19. #include <stdio.h>
  20.  
  21. #ifdef __STDC__
  22. #define P__(a)    a
  23. #else
  24. #define P__(a)    ()
  25. #define    const
  26. #endif
  27.  
  28. #if    defined(__STDC__) || defined(HAVE_VOIDPTR)
  29. #define    VOIDPTR    void
  30. #else
  31. #define    VOIDPTR    char
  32. #endif
  33.  
  34. /* some machines do not define M_PI. */
  35. #ifndef M_PI
  36. #define M_PI 3.14159265358979323846264
  37. #endif
  38.  
  39. typedef struct
  40. {
  41.   float x, y;  /* location of the point in user coordinates */
  42.   char *string; /* a string containing the label for that point. */
  43.   short symbol; /* this is either a number indicating which
  44.          symbol is to be plotted at the point or an
  45.          ascii character to be plotted depending
  46.          on the range of values:
  47.               0-31 a symbol number, or
  48.               32-127 an ascii character. */
  49.   short linemode;
  50. } point_struct;
  51.  
  52. VOIDPTR *
  53.   do_malloc P__ ((int length));
  54.  
  55. VOIDPTR *
  56.   do_realloc P__ ((VOIDPTR *p, int length));
  57.  
  58. extern void
  59.   array_min P__ ((point_struct *p, int length, double *min_x, double *min_y));
  60.  
  61. extern void
  62.   array_max P__ ((point_struct *p, int length, double *max_x, double *max_y));
  63.  
  64. /* this is the type of data we will read from the input files. */
  65. typedef enum
  66. {
  67.  ASCII_DATA, INT_DATA, SHORT_INT_DATA, FLOAT_DATA, DOUBLE_DATA
  68.  } data_type;
  69.  
  70. /* this is the type of grid and or tick marks */
  71. typedef enum
  72. {
  73.   FULL_GRID, NO_GRID, TICKS_ALL_AROUND, TICKS_LEFT_AND_BELOW, AXES_AT_ORIGIN
  74.   } grid_type;
  75.  
  76. extern int
  77.   read_file P__(
  78.     (FILE *in_stream,
  79.      point_struct **p,
  80.      int *length,
  81.      int *no_of_points,
  82.      int auto_abscissa,
  83.      double x_start,
  84.      double delta_x,
  85.      data_type data_spec,
  86.      int symbol_index,
  87.      int transpose_axes,
  88.      char *default_label,
  89.      int linemode,        /* the line style for curves */
  90.      int m_break_flag        /* non-zero means break when x decreases. */
  91.      ));
  92.  
  93. int
  94.   write_plot P__(
  95.     (FILE *out_stream,
  96.      point_struct *p,
  97.      int length,
  98.      double x_min,
  99.      double x_max,
  100.      double spacing_x,
  101.      double y_min,
  102.      double y_max,
  103.      double spacing_y,
  104.      double width,
  105.      double height,
  106.      double up,
  107.      double right,
  108.      double symbol_size,
  109.      double tick_size,
  110.      grid_type grid_spec,
  111.      char *x_label,
  112.      char *y_label,
  113.      char *top_label,
  114.      double margin,
  115.      int log_axis,
  116.      int break_flag,        /* non-zero means break lines after labels. */
  117.      int round_to_next_tick,    /* round limits to the next tick mark */
  118.      int default_fontsize,    /* size in printers points */
  119.      int omit_labels        /* label both axes unless specified */
  120.      ));
  121.  
  122.  
  123. int
  124. read_number P__((FILE *stream,
  125.            data_type data_spec,
  126.            float *value
  127.            ));
  128.  
  129. #undef P__
  130.  
  131. extern const char    *progname;    /* Program name */
  132.  
  133. #define    X_AXIS    1
  134. #define Y_AXIS    2
  135.  
  136. #endif
  137.