Ignore:
Timestamp:
02/27/08 07:13:31 (16 years ago)
Author:
Nicholas Riley
Message:

Jgraph: my changes - ANSIfication, few minor bug fixes; works on OS X 10.5 now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Jgraph/printline.c

    r419 r420  
    99#include <stdio.h>
    1010#include <assert.h> //by pzn@debian.org
     11#include <string.h>
    1112
    1213#define LINEWIDTHFACTOR 0.700
     
    2526static int Jgraph_comment;
    2627
    27 gsave()
     28void gsave(void)
    2829{
    2930  if (Jgraph_gsave_level == -100) {
     
    3536}
    3637
    37 grestore()
     38void grestore(void)
    3839{
    3940  Fontlist l;
     
    5051}
    5152
    52 setfont(f, s)
    53 char *f;
    54 float s;
     53void setfont(char *f, float s)
    5554{
    5655  Fontlist l;
     
    7776}
    7877 
    79 setfill( x, y, t, f, p, a)
    80 char t, p ;
    81 float x, y;
    82 float f[], a ;
     78void setfill(float x, float y, char t, float f[], char p, float a)
    8379{
    8480/*   fprintf(stderr, "Hello?  %c %f %c %f\n", t, f[0], p, a); */
     
    10298}
    10399
    104 setgray( t, f)
    105 char t ;
    106 float f[] ;
     100void setgray(char t, float f[])
    107101{
    108102    if ( t == 'g' )  {
     
    113107}
    114108
    115 printline(x1, y1,x2, y2, orientation)
    116 float x1, y1, x2, y2;
    117 char orientation;
     109void printline(float x1, float y1, float x2, float y2, char orientation)
    118110{
    119111  if (orientation == 'x')
     
    124116}
    125117
    126 print_ebar(x1, y1, x2, ms, orientation)
    127 float x1, y1, x2, ms;
    128 char orientation;
     118void print_ebar(float x1, float y1, float x2, float ms, char orientation)
    129119{
    130120  printline(x1, y1, x2, y1, orientation);
     
    132122}
    133123
    134 start_line(x1, y1, c)
    135 float x1, y1;
    136 Curve c;
     124void start_line(float x1, float y1, Curve c)
    137125{
    138126  setlinewidth(c->linethick);
     
    141129}
    142130
    143 cont_line(x1, y1)
    144 float x1, y1;
     131void cont_line(float x1, float y1)
    145132{
    146133  printf("  %f %f lineto\n", x1, y1);
    147134}
    148135
    149 end_line()
     136void end_line(void)
    150137{
    151138  printf("stroke\n");
     
    156143}
    157144
    158 bezier_control(x1, y1)
    159 float x1, y1;
     145void bezier_control(float x1, float y1)
    160146{
    161147  printf("  %f %f ", x1, y1);
    162148}
    163149
    164 bezier_end(x1, y1)
    165 float x1, y1;
     150void bezier_end(float x1, float y1)
    166151{
    167152  printf("  %f %f curveto\n", x1, y1);
     
    169154
    170155
    171 start_poly(x1, y1)
    172 float x1, y1;
     156void start_poly(float x1, float y1)
    173157{
    174158  printf(" newpath %f %f moveto", x1, y1);
    175159}
    176160
    177 cont_poly(x1, y1)
    178 float x1, y1;
     161void cont_poly(float x1, float y1)
    179162{
    180163  printf("  %f %f lineto\n", x1, y1);
    181164}
    182165
    183 end_poly(x, y, ftype, fill, pattern, parg)
    184 float x, y;
    185 char  ftype, pattern ;
    186 float fill[], parg;
     166void end_poly(float x, float y, char ftype, float fill[],
     167              char pattern, float parg)
    187168{
    188169  printf("closepath ");
     
    194175/* Ellipse at 0, 0 -- assumes that you've already translated to x, y */
    195176
    196 printellipse(x, y, radius1, radius2, ftype, fill, pattern, parg)
    197 char ftype, pattern;
    198 float x, y, radius1, radius2, fill[], parg;
     177void printellipse(float x, float y, float radius1, float radius2,
     178                  char ftype, float fill[], char pattern, float parg)
    199179{
    200180  printf("newpath %f %f JDE\n", radius1, radius2);
     
    204184}
    205185
    206 set_comment(c)
    207 int c;
     186void set_comment(int c)
    208187{
    209188  Jgraph_comment = c;
    210189}
    211190
    212 comment(s)
    213 char *s;
     191void comment(char *s)
    214192{
    215193  if (Jgraph_comment) printf("%% %s\n", s);
    216194}
    217195
    218 printline_c(x1, y1, x2, y2, g)
    219 float x1, y1, x2, y2;
    220 Graph g;
     196void printline_c(float x1, float y1, float x2, float y2, Graph g)
    221197{
    222198  printline(ctop(x1, g->x_axis), ctop(y1, g->y_axis),
     
    224200}
    225201
    226 print_label(l)
    227 Label l;
     202void print_label(Label l)
    228203{
    229204  int f, i, nlines;
    230205  float fnl;
    231206  char *s;
    232   unsigned char *s_7bit; // added by pzn@debian.org
     207  char *s_7bit; // added by pzn@debian.org
    233208
    234209  if (l->label == CNULL) return;
     
    317292}
    318293
    319 setlinewidth(size)
    320 float size;
     294void setlinewidth(float size)
    321295{
    322296  printf("%f setlinewidth ", size * LINEWIDTHFACTOR);
    323297}
    324298
    325 setlinestyle(style, glist)
    326 char style;
    327 Flist glist;
     299void setlinestyle(char style, Flist glist)
    328300{
    329301  Flist fl;
Note: See TracChangeset for help on using the changeset viewer.