File: scilab_consts.i

package info (click to toggle)
swig 4.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 42,876 kB
  • sloc: cpp: 61,013; ansic: 27,612; java: 14,670; python: 10,632; cs: 8,103; makefile: 6,287; yacc: 6,197; sh: 5,247; ruby: 5,172; perl: 3,541; php: 2,069; ml: 2,066; lisp: 1,894; javascript: 1,300; tcl: 1,091; xml: 115
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;