PLplot  5.11.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
plstubs.h
Go to the documentation of this file.
1 // Maurice LeBrun
2 // IFS, University of Texas
3 //
4 // Header file for plplot Fortran interface stubs.
5 // THIS FILE IS NOT FOR INCLUSION BY USER CODES!!
6 //
7 // The contents of this file are in the public domain.
8 //
9 
10 #ifndef __PLSTUBS_H__
11 #define __PLSTUBS_H__
12 
13 #include "plplotP.h"
14 
15 //--------------------------------------------------------------------------
16 // Select name transformation based on system type.
17 //
18 // Define the STUB_LINKAGE flag to get proper C<->Fortran linkage on your
19 // system. This flag describes what the compiler does to Fortran routine
20 // names, which we must duplicate on the C stubs so that the Fortran
21 // routines may call them. You can often set STUB_LINKAGE by the
22 // construct -DSTUB_LINKAGE=<value> on the C compiler command line, but
23 // it is best to either rely on the default or explicitly handle your
24 // system below.
25 //
26 // Current choices for STUB_LINKAGE:
27 //
28 // STUB_LAU lower-case, append underscore
29 // STUB_L lower-case
30 // STUB_U upper-case
31 // STUB_FORTRAN use "fortran" keyword (MS-DOS convention)
32 //
33 // If no choice is made, the default is set to STUB_LAU. This should
34 // handle most generic Unix boxes not already accounted for.
35 //
36 // ** Namespace collision **
37 //
38 // If you use the STUB_L option, the C & Fortran namespaces will collide
39 // if the Fortran compiler does lower case folding (they usually do).
40 // The problem is then that the stub names and actual function names will
41 // be exactly the same, if we insist on the Fortran and C bindings to be
42 // similar. The solution is to give the externally callable C routines
43 // unique names, and provide macros to turn the documented entry names in
44 // to the real ones. This is a horrible kludge, but the alternatives are
45 // worse. Fortunately it has no effect on the user program, and you can
46 // forget that you ever read about it here.
47 //--------------------------------------------------------------------------
48 
49 #define STUB_LAU 1
50 #define STUB_L 2
51 #define STUB_U 3
52 #define STUB_FORTRAN 4
53 #define STUB_STDCALL 5
54 #define STUB_MINGW 6
55 #define STUB_IVF 7
56 
57 #ifndef STUB_LINKAGE
58 
59 #if defined ( SX ) // NEC Super-UX (SX-3)
60 #define STUB_LINKAGE STUB_LAU
61 #endif
62 
63 #if defined ( _IBMR2 ) && defined ( _AIX ) // AIX
64 #define STUB_LINKAGE STUB_L
65 #endif
66 
67 #ifdef __hpux // HP/UX
68 #define STUB_LINKAGE STUB_L
69 #endif
70 
71 #ifdef __mips // IRIX (SGI systems)
72 #define STUB_LINKAGE STUB_LAU
73 #endif
74 
75 #ifdef sun // Suns
76 #define STUB_LINKAGE STUB_LAU
77 #endif
78 
79 #ifdef CRAY // Cray/UNICOS
80 #define STUB_LINKAGE STUB_U
81 #endif
82 
83 #if defined ( __alpha ) && defined ( __osf__ ) // DEC Alpha AXP/OSF
84 #define STUB_LINKAGE STUB_LAU
85 #endif
86 
87 #ifdef __GO32__ // dos386/djgpp
88 #ifdef MSDOS
89 #undef MSDOS
90 #endif
91 #endif
92 
93 #ifdef WIN32 // MS-DOS based
94 #ifdef IVF // Intel Visual Fortran
95 #define STUB_LINKAGE STUB_IVF
96 #elif defined ( CVF )
97 #define STUB_LINKAGE STUB_U
98 #elif defined ( MSDOS )
99 #define STUB_LINKAGE STUB_FORTRAN
100 #elif defined ( _MSC_VER )
101 #define STUB_LINKAGE STUB_STDCALL
102 #elif defined ( __GNUC__ )
103 #define STUB_LINKAGE STUB_MINGW
104 #endif
105 #elif defined ( MSDOS ) // MS-DOS based
106 #define STUB_LINKAGE STUB_FORTRAN
107 #endif // Windows 32-bit
108 
109 #ifndef STUB_LINKAGE // The default
110 #define STUB_LINKAGE STUB_LAU
111 #endif
112 
113 #endif // ifndef STUB_LINKAGE
114 
115 //--------------------------------------------------------------------------
116 // Define name-translation macro.
117 // To use, define with x the upper case routine name, y the lower case.
118 // Should be adaptable to virtually any system.
119 //--------------------------------------------------------------------------
120 
121 #if STUB_LINKAGE == STUB_LAU
122 #define FNAME( x, y ) PLDLLIMPEXP_F95C y ## _
123 #define FNAME_( x, y ) y ## _
124 
125 #elif STUB_LINKAGE == STUB_L
126 #define FNAME( x, y ) y
127 #define FNAME_( x, y ) y
128 
129 #elif STUB_LINKAGE == STUB_U
130 #define FNAME( x, y ) PLDLLIMPEXP_F95C __stdcall x
131 #define FNAME_( x, y ) x
132 
133 #elif STUB_LINKAGE == STUB_FORTRAN
134 #define FNAME( x, y ) fortran x
135 #define FNAME_( x, y ) x
136 
137 #elif STUB_LINKAGE == STUB_STDCALL
138 #define FNAME( x, y ) PLDLLIMPEXP_F95C __stdcall x
139 #define FNAME_( x, y ) x
140 
141 #elif STUB_LINKAGE == STUB_MINGW
142 #define FNAME( x, y ) PLDLLIMPEXP_F95C y ## _
143 #define FNAME_( x, y ) y
144 
145 #elif STUB_LINKAGE == STUB_IVF
146 #define FNAME( x, y ) PLDLLIMPEXP_F95C x
147 #define FNAME_( x, y ) x
148 
149 #else
150 #error "Illegal setting for STUB_LINKAGE"
151 #endif
152 
153 //--------------------------------------------------------------------------
154 // Now to actually define the stub names.
155 // Each stub must have an entry here.
156 //--------------------------------------------------------------------------
157 
158 // N.B. By default the gfortran compiler appends second underscore to name if
159 // the original name contains any underscore at all. According to info
160 // gfortran, "This is done to ensure compatibility with code produced by many
161 // UNIX Fortran compilers." However, other fortran compilers do not have
162 // this default naming scheme so to avoid trouble I have #defined two
163 // variations of the embedded underscore names, one with and one without
164 // the extra trailing underscore.
165 //
166 
167 #define PL_SETCONTLABELFORMAT FNAME( PL_SETCONTLABELFORMAT, pl_setcontlabelformat )
168 #define PL_SETCONTLABELFORMATa FNAME( PL_SETCONTLABELFORMAT_, pl_setcontlabelformat_ )
169 #define PL_SETCONTLABELPARAM FNAME( PL_SETCONTLABELPARAM, pl_setcontlabelparam )
170 #define PL_SETCONTLABELPARAMa FNAME( PL_SETCONTLABELPARAM_, pl_setcontlabelparam_ )
171 #define PLABORT7 FNAME( PLABORT7, plabort7 )
172 #define PLADV FNAME( PLADV, pladv )
173 #define PLARC FNAME( PLARC, plarc )
174 #define PLAXES7 FNAME( PLAXES7, plaxes7 )
175 #define PLBIN FNAME( PLBINF95, plbinf95 )
176 #define PLBOP FNAME( PLBOP, plbop )
177 #define PLBOX37 FNAME( PLBOX37, plbox37 )
178 #define PLBOX7 FNAME( PLBOX7, plbox7 )
179 #define PLBTIME FNAME( PLBTIME, plbtime )
180 #define PLCALC_WORLD FNAME( PLCALC_WORLD, plcalc_world )
181 #define PLCALC_WORLDa FNAME( PLCALC_WORLD_, plcalc_world_ )
182 #define PLCLEAR FNAME( PLCLEAR, plclear )
183 #define PLCLR FNAME( PLCLR, plclr )
184 #define PLCOL0 FNAME( PLCOL0, plcol0 )
185 #define PLCOL1 FNAME( PLCOL1, plcol1 )
186 #define PLCOLORBAR_CNV_TEXT FNAME( PLCOLORBAR07_CNV_TEXT, plcolorbar07_cnv_text )
187 #define PLCOLORBAR FNAME( PLCOLORBAR07, plcolorbar07 )
188 #define PLCONFIGTIME FNAME( PLCONFIGTIME, plconfigtime )
189 #define PLCON07 FNAME( PLCON07, plcon07 )
190 #define PLCON17 FNAME( PLCON17, plcon17 )
191 #define PLCON27 FNAME( PLCON27, plcon27 )
192 #define PLCONT7 FNAME( PLCONT7, plcont7 )
193 #define PLCPSTRM FNAME( PLCPSTRMF95, plcpstrmf95 )
194 #define PLCTIME FNAME( PLCTIME, plctime )
195 #define PLEND FNAME( PLEND, plend )
196 #define PLEND1 FNAME( PLEND1, plend1 )
197 #define PLENV FNAME( PLENV, plenv )
198 #define PLENV0 FNAME( PLENV0, plenv0 )
199 #define PLEOP FNAME( PLEOP, pleop )
200 #define PLERRX FNAME( PLERRXF95, plerrxf95 )
201 #define PLERRY FNAME( PLERRYF95, plerryf95 )
202 #define PLFAMADV FNAME( PLFAMADV, plfamadv )
203 #define PLFILL FNAME( PLFILLF95, plfillf95 )
204 #define PLFILL3 FNAME( PLFILL3F95, plfill3f95 )
205 #define PLFLUSH FNAME( PLFLUSH, plflush )
206 #define PLFONT FNAME( PLFONT, plfont )
207 #define PLFONTLD FNAME( PLFONTLD, plfontld )
208 #define PLGCHR FNAME( PLGCHR, plgchr )
209 #define PLGCMAP1_RANGE FNAME( PLGCMAP1_RANGE, plgcmap1_range )
210 #define PLGCOL0 FNAME( PLGCOL0, plgcol0 )
211 #define PLGCOL0A FNAME( PLGCOL0A, plgcol0a )
212 #define PLGCOLBG FNAME( PLGCOLBG, plgcolbg )
213 #define PLGCOLBGA FNAME( PLGCOLBGA, plgcolbga )
214 #define PLGCOMPRESSION FNAME( PLGCOMPRESSION, plgcompression )
215 #define PLGDEV7 FNAME( PLGDEV7, plgdev7 )
216 #define PLGDIDEV FNAME( PLGDIDEV, plgdidev )
217 #define PLGDIORI FNAME( PLGDIORI, plgdiori )
218 #define PLGDIPLT FNAME( PLGDIPLT, plgdiplt )
219 #define PLGETCURSOR FNAME( PLGETCURSOR, plgetcursor )
220 #define PLGFAM FNAME( PLGFAM, plgfam )
221 #define PLGFCI FNAME( PLGFCI, plgfci )
222 #define PLGFNAM7 FNAME( PLGFNAM7, plgfnam7 )
223 #define PLGFONT FNAME( PLGFONT, plgfont )
224 #define PLGLEVEL FNAME( PLGLEVEL, plglevel )
225 #define PLGPAGE FNAME( PLGPAGE, plgpage )
226 #define PLGRA FNAME( PLGRA, plgra )
227 #define PLGRADIENT FNAME( PLGRADIENTF95, plgradientf95 )
228 #define PLGRIDDATA FNAME( PLGRIDDATAF95, plgriddataf95 )
229 #define PLGSPA FNAME( PLGSPA, plgspa )
230 #define PLGSTRM FNAME( PLGSTRM, plgstrm )
231 #define PLGVER7 FNAME( PLGVER7, plgver7 )
232 #define PLGVPD FNAME( PLGVPD, plgvpd )
233 #define PLGVPW FNAME( PLGVPW, plgvpw )
234 #define PLGXAX FNAME( PLGXAX, plgxax )
235 #define PLGYAX FNAME( PLGYAX, plgyax )
236 #define PLGZAX FNAME( PLGZAX, plgzax )
237 #define PLHIST FNAME( PLHISTF95, plhistf95 )
238 #define PLHLSRGB FNAME( PLHLSRGB, plhlsrgb )
239 #define PLIMAGE FNAME( PLIMAGEF95, plimagef95 )
240 #define PLIMAGEFR07 FNAME( PLIMAGEFR07, plimagefr07 )
241 #define PLIMAGEFR17 FNAME( PLIMAGEFR17, plimagefr17 )
242 #define PLIMAGEFR27 FNAME( PLIMAGEFR27, plimagefr27 )
243 #define PLIMAGEFR7 FNAME( PLIMAGEFR7, plimagefr7 )
244 #define PLINIT FNAME( PLINIT, plinit )
245 #define PLJOIN FNAME( PLJOIN, pljoin )
246 #define PLLAB7 FNAME( PLLAB7, pllab7 )
247 #define PLLEGEND_CNV_TEXT FNAME( PLLEGEND07_CNV_TEXT, pllegend07_cnv_text )
248 #define PLLEGEND FNAME( PLLEGEND07, pllegend07 )
249 #define PLLIGHTSOURCE FNAME( PLLIGHTSOURCE, pllightsource )
250 #define PLLINE FNAME( PLLINEF95, pllinef95 )
251 #define PLLINE3 FNAME( PLLINE3F95, plline3f95 )
252 #define PLLSTY FNAME( PLLSTY, pllsty )
253 #define PLMAP7 FNAME( PLMAP7, plmap7 )
254 #define PLMAPFILL7 FNAME( PLMAPFILL7, plmapfill7 )
255 #define PLMAPLINE7 FNAME( PLMAPLINE7, plmapline7 )
256 #define PLMAPSTRING7 FNAME( PLMAPSTRING7, plmapstring7 )
257 #define PLMAPTEX7 FNAME( PLMAPTEX7, plmaptex7 )
258 #define PLMERIDIANS7 FNAME( PLMERIDIANS7, plmeridians7 )
259 #define PLMESH FNAME( PLMESHF95, plmeshf95 )
260 #define PLMESHC FNAME( PLMESHCF95, plmeshcf95 )
261 #define PLMKSTRM FNAME( PLMKSTRM, plmkstrm )
262 #define PLMTEX7 FNAME( PLMTEX7, plmtex7 )
263 #define PLMTEX37 FNAME( PLMTEX37, plmtex37 )
264 #define PLOT3D FNAME( PLOT3DF95, plot3df95 )
265 #define PLOT3DC FNAME( PLOT3DCF95, plot3dcf95 )
266 
267 #if STUB_LINKAGE == STUB_STDCALL || STUB_LINKAGE == STUB_FORTRAN
268 #define CALL_PLOT3DC PLOT3DCF95
269 #elif STUB_LINKAGE == STUB_LAU
270 #define CALL_PLOT3DC plot3dcf95_
271 #else
272 #define CALL_PLOT3DC PLOT3DC
273 #endif
274 
275 #define PLPARSEOPTS7 FNAME( PLPARSEOPTS7, plparseopts7 )
276 #define PLPAT FNAME( PLPAT, plpat )
277 #define PLPATH FNAME( PLPATH, plpath )
278 #define PLPOIN FNAME( PLPOINF95, plpoinf95 )
279 #define PLPOIN3 FNAME( PLPOIN3F95, plpoin3f95 )
280 #define PLPOLY3 FNAME( PLPOLY3F95, plpoly3f95 )
281 #define PLPREC FNAME( PLPREC, plprec )
282 #define PLPSTY FNAME( PLPSTY, plpsty )
283 #define PLPTEX7 FNAME( PLPTEX7, plptex7 )
284 #define PLPTEX37 FNAME( PLPTEX37, plptex37 )
285 #define PLRANDD FNAME( PLRANDDF95, plranddf95 )
286 #define PLREPLOT FNAME( PLREPLOT, plreplot )
287 #define PLRGBHLS FNAME( PLRGBHLS, plrgbhls )
288 #define PLSCHR FNAME( PLSCHR, plschr )
289 #define PLSCMAP0 FNAME( PLSCMAP0F95, plscmap0f95 )
290 #define PLSCMAP0A FNAME( PLSCMAP0AF95, plscmap0af95 )
291 #define PLSCMAP0N FNAME( PLSCMAP0N, plscmap0n )
292 #define PLSCMAP1 FNAME( PLSCMAP1F95, plscmap1f95 )
293 #define PLSCMAP1A FNAME( PLSCMAP1AF95, plscmap1af95 )
294 #define PLSCMAP1L FNAME( PLSCMAP1LF95, plscmap1lf95 )
295 #define PLSCMAP1L2 FNAME( PLSCMAP1L2F95, plscmap1l2f95 )
296 #define PLSCMAP1LA FNAME( PLSCMAP1LAF95, plscmap1laf95 )
297 #define PLSCMAP1LA2 FNAME( PLSCMAP1LA2F95, plscmap1la2f95 )
298 #define PLSCMAP1N FNAME( PLSCMAP1N, plscmap1n )
299 #define PLSCMAP1_RANGE FNAME( PLSCMAP1_RANGE, plscmap1_range )
300 #define PLSCOL0 FNAME( PLSCOL0, plscol0 )
301 #define PLSCOL0A FNAME( PLSCOL0A, plscol0a )
302 #define PLSCOLBG FNAME( PLSCOLBG, plscolbg )
303 #define PLSCOLBGA FNAME( PLSCOLBGA, plscolbga )
304 #define PLSCOLOR FNAME( PLSCOLOR, plscolor )
305 #define PLSCOMPRESSION FNAME( PLSCOMPRESSION, plscompression )
306 #define PLSDEV7 FNAME( PLSDEV7, plsdev7 )
307 #define PLSDIDEV FNAME( PLSDIDEV, plsdidev )
308 #define PLSDIMAP FNAME( PLSDIMAP, plsdimap )
309 #define PLSDIORI FNAME( PLSDIORI, plsdiori )
310 #define PLSDIPLT FNAME( PLSDIPLT, plsdiplt )
311 #define PLSDIPLZ FNAME( PLSDIPLZ, plsdiplz )
312 #define PLSEED FNAME( PLSEED, plseed )
313 #define PLSESC FNAME( PLSESC, plsesc )
314 #define PLSETOPT7 FNAME( PLSETOPT7, plsetopt7 )
315 #define PLSFAM FNAME( PLSFAM, plsfam )
316 #define PLSFCI FNAME( PLSFCI, plsfci )
317 #define PLSFNAM7 FNAME( PLSFNAM7, plsfnam7 )
318 #define PLSFONT FNAME( PLSFONT, plsfont )
319 #define PLSHADE07 FNAME( PLSHADE07, plshade07 )
320 #define PLSHADE17 FNAME( PLSHADE17, plshade17 )
321 #define PLSHADE27 FNAME( PLSHADE27, plshade27 )
322 #define PLSHADE7 FNAME( PLSHADE7, plshade7 )
323 #define PLSHADES07 FNAME( PLSHADES07, plshades07 )
324 #define PLSHADES17 FNAME( PLSHADES17, plshades17 )
325 #define PLSHADES27 FNAME( PLSHADES27, plshades27 )
326 #define PLSHADES7 FNAME( PLSHADES7, plshades7 )
327 #define PLSLABELFUNC_ON FNAME( PLSLABELFUNC_ON, plslabelfunc_on )
328 #define PLSLABELFUNC_ONa FNAME( PLSLABELFUNC_ON_, plslabelfunc_on_ )
329 #define PLSLABELFUNC_OFF FNAME( PLSLABELFUNC_OFF, plslabelfunc_off )
330 #define PLSLABELFUNC_OFFa FNAME( PLSLABELFUNC_OFF_, plslabelfunc_off_ )
331 #define PLSLABELFUNC_NONE FNAME( PLSLABELFUNC_NONE, plslabelfunc_none )
332 #define PLSLABELFUNC_NONEa FNAME( PLSLABELFUNC_NONE_, plslabelfunc_none_ )
333 #define PLSMAJ FNAME( PLSMAJ, plsmaj )
334 #define PLSMEM FNAME( PLSMEM, plsmem )
335 #define PLSMEMA FNAME( PLSMEMA, plsmema )
336 #define PLSMIN FNAME( PLSMIN, plsmin )
337 #define PLSORI FNAME( PLSORI, plsori )
338 #define PLSPAGE FNAME( PLSPAGE, plspage )
339 #define PLSPAL07 FNAME( PLSPAL07, plspal07 )
340 #define PLSPAL17 FNAME( PLSPAL17, plspal17 )
341 #define PLSPAUSE FNAME( PLSPAUSEF95, plspausef95 )
342 #define PLSSTRM FNAME( PLSSTRM, plsstrm )
343 #define PLSSUB FNAME( PLSSUB, plssub )
344 #define PLSSYM FNAME( PLSSYM, plssym )
345 #define PLSTAR FNAME( PLSTAR, plstar )
346 #define PLSTART7 FNAME( PLSTART7, plstart7 )
347 #define PLSTRANSFORM1 FNAME( PLSTRANSFORM1, plstransform1 )
348 #define PLSTRANSFORM2 FNAME( PLSTRANSFORM2, plstransform2 )
349 #define PLSTRANSFORM3 FNAME( PLSTRANSFORM3, plstransform3 )
350 #define PLSTRING7 FNAME( PLSTRING7, plstring7 )
351 #define PLSTRING37 FNAME( PLSTRING37, plstring37 )
352 #define PLSTRIPA FNAME( PLSTRIPA, plstripa )
353 #define PLSTRIPC FNAME( PLSTRIPCF95, plstripcf95 )
354 #define PLSTRIPD FNAME( PLSTRIPD, plstripd )
355 #define PLSTYL FNAME( PLSTYL, plstyl )
356 #define PLSURF3D FNAME( PLSURF3DF95, plsurf3df95 )
357 #define PLSURF3DL FNAME( PLSURF3DLF95, plsurf3dlf95 )
358 #define PLSVECT1 FNAME( PLSVECT1F95, plsvect1f95 )
359 #define PLSVECT2 FNAME( PLSVECT2, plsvect2 )
360 #define PLSVPA FNAME( PLSVPA, plsvpa )
361 #define PLSXAX FNAME( PLSXAX, plsxax )
362 #define PLSYAX FNAME( PLSYAX, plsyax )
363 #define PLSYM FNAME( PLSYMF95, plsymf95 )
364 #define PLSZAX FNAME( PLSZAX, plszax )
365 #define PLTEXT FNAME( PLTEXT, pltext )
366 #define PLTIMEFMT7 FNAME( PLTIMEFMT7, pltimefmt7 )
367 #define PLVASP FNAME( PLVASP, plvasp )
368 #define PLVEC07 FNAME( PLVEC07, plvec07 )
369 #define PLVEC17 FNAME( PLVEC17, plvec17 )
370 #define PLVEC27 FNAME( PLVEC27, plvec27 )
371 #define PLVECT7 FNAME( PLVECT7, plvect7 )
372 #define PLVPAS FNAME( PLVPAS, plvpas )
373 #define PLVPOR FNAME( PLVPOR, plvpor )
374 #define PLVSTA FNAME( PLVSTA, plvsta )
375 #define PLW3D FNAME( PLW3D, plw3d )
376 #define PLWIDTH FNAME( PLWIDTH, plwidth )
377 #define PLWIND FNAME( PLWIND, plwind )
378 #define PLXORMOD FNAME( PLXORMODF95, plxormodf95 )
379 
380 #ifdef PL_DEPRECATE
381 #define PLRGB FNAME( PLRGB, plrgb )
382 #define PLRGB1 FNAME( PLRGB1, plrgb1 )
383 #define PLHLS FNAME( PLHLS, plhls )
384 #endif // PL_DEPRECATED
385 
386 #endif // __PLSTUBS_H__