1
/* C code produced by gperf version 2.7.1 (19981006 egcs) */
2
/* Command-line: gperf -C -t -k 2,3,4,$ Xcall.gperf */
4
/*------------------------------------------------------------------------
5
Graphic library for 2D and 3D plotting
6
Copyright (C) 1998 Chancelier Jean-Philippe
8
--------------------------------------------------------------------------*/
13
#include "../machine.h"
31
/*---------------------------------------------------------------
32
* The basic graphic driver is X11
33
* The name is X11 due to historical reasons
34
* but according to architecture X11 can be an Xwindow driver
35
* a driver for Macintosh
37
* Other drivers are Postscript Fig ( xfig ) and Rec ( Rec= X11 + Recording capabilities)
38
* xfig is only meaningfull when using Unix machine
39
* ----------------------------------------------------------------*/
41
static void C2F(all)();
43
static void C2F(vide)(v1, v2, v3, v4, v5, v6, v7, dv1, dv2, dv3, dv4)
56
typedef void (*func)();
57
typedef void (function)() ;
58
struct funreplace { char *name; func action[4]; };
60
#define TOTAL_KEYWORDS 40
61
#define MIN_WORD_LENGTH 4
62
#define MAX_WORD_LENGTH 9
63
#define MIN_HASH_VALUE 4
64
#define MAX_HASH_VALUE 141
65
/* maximum key range = 138, duplicates = 0 */
75
static const unsigned char asso_values[] =
77
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
78
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
79
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
80
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
81
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
82
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
83
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
84
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
85
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
86
142, 142, 142, 142, 142, 142, 142, 35, 142, 5,
87
15, 0, 25, 33, 20, 0, 142, 5, 10, 40,
88
42, 30, 0, 142, 0, 0, 0, 15, 142, 10,
89
10, 0, 142, 142, 142, 142, 142, 142, 142, 142,
90
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
91
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
92
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
93
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
94
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
95
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
96
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
97
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
98
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
99
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
100
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
101
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
102
142, 142, 142, 142, 142, 142
104
return len + asso_values[(unsigned char)str[3]] + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[1]] + asso_values[(unsigned char)str[len - 1]];
110
const struct funreplace *
111
xcall_in_word_set (str, len)
112
register const char *str;
113
register unsigned int len;
115
static const struct funreplace wordlist[] =
117
{""}, {""}, {""}, {""},
118
{"xset", {C2F(MissileGCset),C2F(scilabgcsetPos),C2F(scilabgcsetXfig),C2F(scilabgcsetGif)}},
120
{"xsetdr", {C2F(SetDriver),C2F(SetDriver),C2F(SetDriver),C2F(SetDriver)}},
121
{"xreplay", {Tape_Replay,Tape_Replay,Tape_Replay,Tape_Replay}},
123
{"xrect", {C2F(drawrectangle),C2F(drawrectanglePos),C2F(drawrectangleXfig),C2F(drawrectangleGif)}},
124
{"xrects", {C2F(drawrectangles),C2F(drawrectanglesPos),C2F(drawrectanglesXfig),C2F(drawrectanglesGif)}},
126
{"xreplaysc", {Tape_ReplayNewScale,Tape_ReplayNewScale,Tape_ReplayNewScale,Tape_ReplayNewScale}},
128
{"xselect", {C2F(xselgraphic),C2F(xselgraphicPos),C2F(xselgraphicXfig),C2F(xselgraphicGif)}},
129
{"xstringl", {C2F(boundingbox),C2F(boundingboxPos),C2F(boundingboxXfig),C2F(boundingboxGif),}},
131
{"xclear", {C2F(clearwindow),C2F(clearwindowPos),C2F(clearwindowXfig),C2F(clearwindowGif)}},
133
{"xclickany", {C2F(xclick_any),C2F(xclick_anyPos),C2F(xclick_anyXfig),C2F(xclick_anyGif)}},
135
{"xclick", {C2F(xclick),C2F(xclickPos),C2F(xclickXfig),C2F(xclickGif)}},
137
{"xreplaysh", {Tape_Replay_Show,Tape_Replay_Show,Tape_Replay_Show,Tape_Replay_Show}},
139
{"xfrect", {C2F(fillrectangle),C2F(fillrectanglePos),C2F(fillrectangleXfig),C2F(fillrectangleGif)}},
140
{""}, {""}, {""}, {""}, {""},
141
{"xget", {C2F(MissileGCget),C2F(scilabgcgetPos),C2F(scilabgcgetXfig),C2F(scilabgcgetGif)}},
142
{"xsegs", {C2F(drawsegments),C2F(drawsegmentsPos),C2F(drawsegmentsXfig),C2F(drawsegmentsGif)}},
143
{"xgetdr", {GetDriver1,GetDriver1,GetDriver1,GetDriver1}},
144
{"xstring", {C2F(displaystring),C2F(displaystringPos),C2F(displaystringXfig),C2F(displaystringGif)}},
145
{"xstart", {CleanPlots,CleanPlots,CleanPlots,CleanPlots}},
146
{"xgetmouse", {C2F(xgetmouse),C2F(xgetmousePos),C2F(xgetmouseXfig),C2F(xgetmouseGif)}},
148
{"xreplayna", {Tape_ReplayNewAngle,Tape_ReplayNewAngle,Tape_ReplayNewAngle,Tape_ReplayNewAngle}},
149
{"xarcs", {C2F(drawarcs),C2F(drawarcsPos),C2F(drawarcsXfig),C2F(drawarcsGif)}},
150
{"xpolys", {C2F(drawpolylines),C2F(drawpolylinesPos),C2F(drawpolylinesXfig),C2F(drawpolylinesGif)}},
151
{"xinit", {C2F(initgraphic),C2F(initgraphicPos),C2F(initgraphicXfig),C2F(initgraphicGif)}},
153
{"xarc", {C2F(drawarc),C2F(drawarcPos),C2F(drawarcXfig),C2F(drawarcGif)}},
154
{"xaxis", {C2F(drawaxis),C2F(drawaxisPos),C2F(drawaxisXfig),C2F(drawaxisGif)}},
155
{"xarrow", {C2F(drawarrows),C2F(drawarrowsPos),C2F(drawarrowsXfig),C2F(drawarrowsGif)}},
157
{"xclea", {C2F(cleararea),C2F(clearareaPos),C2F(clearareaXfig),C2F(clearareaGif)}},
158
{"xpause", {C2F(xpause),C2F(xpausePos),C2F(xpauseXfig),C2F(xpauseGif)}},
160
{"xlines", {C2F(drawpolyline),C2F(drawpolylinePos),C2F(drawpolylineXfig),C2F(drawpolylineGif)}},
161
{"xliness", {C2F(fillpolylines),C2F(fillpolylinesPos),C2F(fillpolylinesXfig),C2F(fillpolylinesGif)}},
162
{""}, {""}, {""}, {""}, {""}, {""},
163
{"xfarcs", {C2F(fillarcs),C2F(fillarcsPos),C2F(fillarcsXfig),C2F(fillarcsGif)}},
165
{"xfarc", {C2F(fillarc),C2F(fillarcPos),C2F(fillarcXfig),C2F(fillarcGif)}},
166
{"xlfont", {C2F(loadfamily),C2F(loadfamilyPos),C2F(loadfamilyXfig),C2F(loadfamilyGif)}},
168
{"xarea", {C2F(fillpolyline),C2F(fillpolylinePos),C2F(fillpolylineXfig),C2F(fillpolylineGif)}},
169
{"xend", {C2F(xend),C2F(xendPos),C2F(xendXfig),C2F(xendGif)}},
170
{""}, {""}, {""}, {""},
171
{"xmarks", {C2F(drawpolymark),C2F(drawpolymarkPos),C2F(drawpolymarkXfig),C2F(drawpolymarkGif)}},
172
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
174
{"xgfont", {C2F(queryfamily),C2F(queryfamilyPos),C2F(queryfamilyXfig),C2F(queryfamilyGif)}},
175
{""}, {""}, {""}, {""}, {""}, {""}, {""},
176
{"xinfo", {C2F(xinfo),C2F(vide),C2F(vide),C2F(vide)}},
177
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
178
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
180
{"xname", {C2F(setpopupname),C2F(vide),C2F(vide),C2F(vide)}},
181
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
182
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
183
{"xnum", {C2F(displaynumbers),C2F(displaynumbersPos),C2F(displaynumbersXfig),C2F(displaynumbersGif)}}
186
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
188
register int key = hash (str, len);
190
if (key <= MAX_HASH_VALUE && key >= 0)
192
register const char *s = wordlist[key].name;
194
if (*str == *s && !strcmp (str + 1, s + 1))
195
return &wordlist[key];
201
static char DriverName[]= "Rec";
202
static int DriverId = 0;
204
void C2F(SetDriver)(x0, v2, v3, v4, v5, v6, v7, dv1, dv2, dv3, dv4)
206
integer *v2,*v3,*v4,*v5,*v6,*v7;
207
double *dv1,*dv2,*dv3,*dv4;
212
/** special driver for windows : used when hdc is fixed elsewhere */
213
strcpy(DriverName,"Int"); /* internal : for Win32 */
218
strcpy(DriverName,"GIF");
224
strcpy(DriverName,"X11");
228
strcpy(DriverName,"Pos");
232
strcpy(DriverName,"Fig");
236
strcpy(DriverName,"Rec");
240
Scistring("\n Wrong driver name I'll use X11");
241
strcpy(DriverName,"X11");
247
void GetDriver1(str, v2, v3, v4, v5, v6, v7, dv1, dv2, dv3, dv4)
249
integer *v2,*v3,*v4,*v5,*v6,*v7;
250
double *dv1,*dv2,*dv3,*dv4;
252
strcpy(str,DriverName);
255
char GetDriver() {return(DriverName[0]);}
257
int GetDriverId() { return DriverId;}
259
/* The following function can be called by fortran so we
260
use the Sun C-fortran interface conventions
261
dr has 2 last extra parametres to deal with the size of
265
int C2F(dr)(x0,x1,x2,x3,x4,x5,x6,x7,dx1,dx2,dx3,dx4,lx0,lx1)
267
integer *x2,*x3,*x4,*x5,*x6,*x7;
269
double *dx1,*dx2,*dx3,*dx4;
272
if ( DriverId == 0 && DriverName[0] != 'I' )
275
C2F(all)(x0,x1,x2,x3,x4,x5,x6,x7,dx1,dx2,dx3,dx4);
280
C2F(all)(x0,x1,x2,x3,x4,x5,x6,x7,dx1,dx2,dx3,dx4);
283
C2F(all)(x0,x1,x2,x3,x4,x5,x6,x7,dx1,dx2,dx3,dx4);
288
static void C2F(all)(x0,x1,x2,x3,x4,x5,x6,x7,dx1,dx2,dx3,dx4)
290
integer *x2,*x3,*x4,*x5,*x6,*x7;
291
double *dx1,*dx2,*dx3,*dx4;
293
const struct funreplace *fr;
294
fr=xcall_in_word_set(x0,strlen(x0));
297
(*(fr->action[DriverId]))(x1,x2,x3,x4,x5,x6,x7,dx1,dx2,dx3,dx4);
301
sciprint("\n Unknow X operator <%s>\r\n",x0);
305
int C2F(foo_inttest)(x1)
308
sciprint("Value of x1 = <%d>\r\n",*x1);
312
/*----------------------------------END---------------------------*/