File: scilab_consts.i

package info (click to toggle)
renderdoc 1.27%2Bdfsg-1
  • links: PTS, VCS
  • area: non-free
  • in suites: sid
  • size: 107,796 kB
  • sloc: cpp: 763,519; ansic: 326,847; python: 26,946; xml: 23,189; java: 11,382; cs: 7,181; makefile: 6,707; yacc: 5,682; ruby: 4,648; perl: 3,461; sh: 2,381; php: 2,119; lisp: 1,835; javascript: 1,525; tcl: 1,068; ml: 747
file content (52 lines) | stat: -rw-r--r-- 1,224 bytes parent folder | download | duplicates (10)
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
49
50
51
52
%module scilab_consts

/* Default mode: constants are wrapped as getter functions */
%scilabconst(0);

#define ICONST0   42
#define FCONST0   2.1828
#define CCONST0   'x'
#define CCONST0_2 '\n'
#define SCONST0   "Hello World"
#define SCONST0_2 "\"Hello World\""

/* Constants with type */
#define UNSIGNED0 0x5FFFU
#define LONG0 0x3FFF0000L
#define ULONG0 0x5FF0000UL

/* Expressions should work too */
#define EXPR0 ICONST0 + 3*FCONST0

/* This shouldn't do anything, bar is not defined */
#define BAR0 bar

/* SWIG directive %constant produces constants too */
%constant int iconst0 = 37;
%constant double fconst0 = 42.2;


/* Alternative mode: constants are wrapped as variables */
%scilabconst(1);

#define ICONST1   42
#define FCONST1   2.1828
#define CCONST1   'x'
#define CCONST1_2 '\n'
#define SCONST1   "Hello World"
#define SCONST1_2 "\"Hello World\""

/* Constants with type */
#define UNSIGNED1 0x5FFFU
#define LONG1 0x3FFF0000L
#define ULONG1 0x5FF0000UL

/* Expressions should work too */
#define EXPR1 ICONST1 + 3*FCONST1

/* This shouldn't do anything, bar is not defined */
#define BAR1 bar

/* SWIG directive %constant produces constants too */
%constant int iconst1 = 37;
%constant double fconst1 = 42.2;