~uhh-ssd/+junk/humidity_readout

« back to all changes in this revision

Viewing changes to plplot/plplot-5.9.9/bindings/f77/global_defines.sed

  • Committer: Joachim Erfle
  • Date: 2013-07-24 13:53:41 UTC
  • Revision ID: joachim.erfle@desy.de-20130724135341-1qojpp701zsn009p
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# sed script specifically designed to parse the #define statements in
 
2
# bindings/swig-support/plplotcapi.i into a file that can be used for
 
3
# global variable definitions for f77.
 
4
 
 
5
# Insert text at the start:
 
6
1 i\
 
7
c     Do not edit this generated file.  Instead, check its consistency\
 
8
c     with the #defines in bindings/swig-support/plplotcapi.i using the\
 
9
c     (Unix) target "check_f77_parameters".  If that target reports an\
 
10
c     inconsistency (via a cmp message) between the generated\
 
11
c     plplot_parameters.fm4_compare file in the build tree and\
 
12
c     plplot_parameters.fm4 in the source tree, then copy\
 
13
c     plplot_parameters.fm4_compare on top of plplot_parameters.fm4 and\
 
14
c     check in that result.\
 
15
 
 
16
# Drop every line that is not a #define
 
17
/^#define/! d
 
18
 
 
19
# Drop specific #defines from the file that are not available
 
20
# because of specific #if statements.
 
21
/^#define ZEROW/ d
 
22
/^#define ONEW/ d
 
23
/OBJECT_DATA/ d
 
24
/^#define pltr_img/ d
 
25
 
 
26
# Translate trailing comment identifier into fortran 95 trailing comment.
 
27
/^#define/ s?//?!?
 
28
# Transform octal constants to Fortran (BOZ) form.
 
29
/^#define/ s? 0\([0-9][0-9]*\)? o'\1'?
 
30
# Transform hexadecimal constants to Fortran (BOZ) form.
 
31
/^#define/ s? 0[xX]\([0-9a-fA-F][0-9a-fA-F]*\)? z'\1'?
 
32
# Handle special case of z'80000000' which generates integer overflow
 
33
# for gfortran (and probably other Fortran 95 compilers).
 
34
/^#define/ s? z'80000000'? ishft(1,31)?
 
35
 
 
36
# Parse what is left while preserving trailing comments.  Watch out
 
37
# for parentheses around value as well.
 
38
# Treat PL_NOTSET as a floating value and append special parameter lines for
 
39
# PI and TWOPI in this case as well.
 
40
 
 
41
# N.B. These double-precision results are transformed later to single precision
 
42
# for the (uncommon) case where PLplot is a single-precision library.
 
43
/^#define/ s?^#define *\(PL_NOTSET\)[ (]*\([^ ]*\)[ )]*\(.*\)$?      real*8 \1 \3\n      parameter (\1 = \2.0d0)\n      real*8 PI\n      parameter (PI = 3.1415926535897932384d0)\n      real*8 TWOPI\n      parameter (TWOPI = 2.0d0*PI)?
 
44
 
 
45
/^#define/ s?^#define *\([^ ]*\)[ (]*\([^ ]*\)[ )]*\(.*\)$?      integer*4 \1 \3\n      parameter (\1 = \2)?