File: global_defines.sed

package info (click to toggle)
plplot 5.10.0%2Bdfsg2-0.4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 25,792 kB
  • ctags: 13,517
  • sloc: ansic: 83,001; xml: 27,081; ada: 18,878; cpp: 15,966; tcl: 11,651; python: 7,075; f90: 7,058; ml: 6,974; java: 6,665; perl: 5,029; sh: 2,208; makefile: 210; lisp: 75; sed: 25; fortran: 7
file content (48 lines) | stat: -rw-r--r-- 1,658 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# sed script specifically designed to parse the #define statements in
# bindings/swig-support/plplotcapi.i into a file that can be used for
# global variable definitions for tcl.

# Insert text at the start:
1 i\
// Do not edit this generated file.  Instead, check its consistency\
// with the #defines in bindings/swig-support/plplotcapi.i using the\
// (Unix) target "check_tcl_parameters".  If that target reports an\
// inconsistency (via a cmp message) between the generated\
// plplot_parameters.h_compare file in the build tree and\
// plplot_parameters.h in the source tree, then copy\
// plplot_parameters.h_compare on top of plplot_parameters.h and\
// check in that result.\
\
//  This file contains a function to set the various global variables\
//  used by PLplot\
\
static void set_plplot_parameters( Tcl_Interp *interp )\
{\
    Tcl_Eval( interp, "namespace eval ::PLPLOT { \\n\\

# Append text at the end:
$ a\
}" );\
}
# Drop every line that is not a #define
/^#define/! d

# Drop specific #defines from the file that are not available
# because of specific #if statements.
/OBJECT_DATA/ d
/^#define pltr_img/ d

# Translate trailing comment identifier into # trailing comment.
/^#define/ s?//?#?

# Parse what is left while preserving trailing comments.  Watch out
# for parentheses around value as well.  Use the expr syntax to
# convert all hexadecimal constants to integers.
/^#define/ s?^#define *\([^ ]*\)[ (]*\([^ ]*\)[ )]*\(.*\)$?\\n\\\n\3\\n\\\nvariable \1 [expr \2]\\n\\?

# Append extra constants not #defined in plplotcapi.i after PL_NOTSET
# is processed.
/PL_NOTSET/ a\
\\n\\\
\\n\\\
variable PL_PI 3.1415926535897932384\\n\\