File: runme.m

package info (click to toggle)
renderdoc 1.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 79,584 kB
  • sloc: cpp: 491,671; ansic: 285,823; python: 12,617; java: 11,345; cs: 7,181; makefile: 6,703; yacc: 5,682; ruby: 4,648; perl: 3,461; php: 2,119; sh: 2,068; lisp: 1,835; tcl: 1,068; ml: 747; xml: 137
file content (75 lines) | stat: -rw-r--r-- 2,445 bytes parent folder | download | duplicates (5)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
  crash_dumps_octave_core(0);
endif

swigexample

# Try to set the values of some global variables

swigexample.cvar.ivar   =  42;
swigexample.cvar.svar   = -31000;
swigexample.cvar.lvar   =  65537;
swigexample.cvar.uivar  =  123456;
swigexample.cvar.usvar  =  61000;
swigexample.cvar.ulvar  =  654321;
swigexample.cvar.scvar  =  -13;
swigexample.cvar.ucvar  =  251;
swigexample.cvar.cvar   =  "S";
swigexample.cvar.fvar   =  3.14159;
swigexample.cvar.dvar   =  2.1828;
swigexample.cvar.strvar =  "Hello World";
swigexample.cvar.iptrvar= swigexample.new_int(37);
swigexample.cvar.ptptr  = swigexample.new_Point(37,42);
swigexample.cvar.name   = "Bill";

# Now print out the values of the variables

printf("Variables (values printed from Octave)\n");

printf("ivar      = %i\n", swigexample.cvar.ivar);
printf("svar      = %i\n", swigexample.cvar.svar);
printf("lvar      = %i\n", swigexample.cvar.lvar);
printf("uivar     = %i\n", swigexample.cvar.uivar);
printf("usvar     = %i\n", swigexample.cvar.usvar);
printf("ulvar     = %i\n", swigexample.cvar.ulvar);
printf("scvar     = %i\n", swigexample.cvar.scvar);
printf("ucvar     = %i\n", swigexample.cvar.ucvar);
printf("fvar      = %i\n", swigexample.cvar.fvar);
printf("dvar      = %i\n", swigexample.cvar.dvar);
printf("cvar      = %s\n", swigexample.cvar.cvar);
printf("strvar    = %s\n", swigexample.cvar.strvar);
#printf("cstrvar   = %s\n", swigexample.cvar.cstrvar);
swigexample.cvar.iptrvar
printf("name      = %i\n", swigexample.cvar.name);
printf("ptptr     = %s\n", swigexample.Point_print(swigexample.cvar.ptptr));
#printf("pt        = %s\n", swigexample.cvar.Point_print(swigexample.cvar.pt));

printf("\nVariables (values printed from C)\n");

swigexample.print_vars();

printf("\nNow I'm going to try and modify some read only variables\n");

printf("     Tring to set 'path'\n");
try
    swigexample.cvar.path = "Whoa!";
    printf("Hey, what's going on?!?! This shouldn't work\n");
catch
    printf("Good.\n");
end_try_catch

printf("     Trying to set 'status'\n");
try
    swigexample.cvar.status = 0;
    printf("Hey, what's going on?!?! This shouldn't work\n");
catch
    printf("Good.\n");
end_try_catch


printf("\nI'm going to try and update a structure variable.\n");

swigexample.cvar.pt = swigexample.cvar.ptptr;

printf("The new value is %s\n", swigexample.Point_print(swigexample.cvar.pt));