Scilab: wrap enums to Scilab variables (if %feature scilab:const")
This commit is contained in:
parent
2cf606c638
commit
ed135cb99c
4 changed files with 48 additions and 11 deletions
|
|
@ -1,6 +1,8 @@
|
|||
/* File : example.i */
|
||||
%module example
|
||||
|
||||
%scilabconst(1);
|
||||
|
||||
%{
|
||||
#include "example.h"
|
||||
%}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,19 @@
|
|||
lines(0);
|
||||
exec loader.sce;
|
||||
SWIG_Init();
|
||||
|
||||
// Print out the value of some enums
|
||||
printf("*** color ***\n");
|
||||
printf(" RED = %i\n", RED_get());
|
||||
printf(" BLUE = %i\n", BLUE_get());
|
||||
printf(" GREEN = %i\n", GREEN_get());
|
||||
printf(" RED = %i\n", RED);
|
||||
printf(" BLUE = %i\n", BLUE);
|
||||
printf(" GREEN = %i\n", GREEN);
|
||||
|
||||
|
||||
printf("\nTesting use of enums with functions\n");
|
||||
|
||||
enum_test(RED_get());
|
||||
enum_test(BLUE_get());
|
||||
enum_test(GREEN_get());
|
||||
enum_test(RED);
|
||||
enum_test(BLUE);
|
||||
enum_test(GREEN);
|
||||
enum_test(int32(1234));
|
||||
|
||||
exit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue