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