scilab: rename swig_this(), swig_ptr() to SWIG_this(), SWIG_ptr()
This commit is contained in:
parent
89d9cdb1cd
commit
821118de9b
7 changed files with 21 additions and 21 deletions
|
|
@ -747,8 +747,8 @@ However, in some cases it can be useful, such as for testing or debugging.
|
|||
<p>
|
||||
SWIG comes with two pointer utility functions:
|
||||
<ul>
|
||||
<li><tt>swig_this()</tt>: returns the address value of a pointer</li>
|
||||
<li><tt>swig_ptr()</tt>: creates a pointer from an address value</li>
|
||||
<li><tt>SWIG_this()</tt>: returns the address value of a pointer</li>
|
||||
<li><tt>SWIG_ptr()</tt>: creates a pointer from an address value</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
|
|
@ -757,12 +757,12 @@ SWIG comes with two pointer utility functions:
|
|||
<div class="targetlang"><pre>
|
||||
--> f = fopen("junk", "w");
|
||||
--> fputs("Hello", f);
|
||||
--> addr = swig_this(f)
|
||||
--> addr = SWIG_this(f)
|
||||
ans =
|
||||
|
||||
8219088.
|
||||
|
||||
--> p = swig_ptr(addr);
|
||||
--> p = SWIG_ptr(addr);
|
||||
--> fputs(" World", p);
|
||||
--> fclose(f);
|
||||
</pre></div>
|
||||
|
|
@ -770,12 +770,12 @@ SWIG comes with two pointer utility functions:
|
|||
<H4><a name="Scilab_wrapping_pointers_null_pointers"></a>Null pointers</H4>
|
||||
|
||||
<p>By default, Scilab does not provide a way to test or create null pointers.
|
||||
But it is possible to have a null pointer by using the previous functions <tt>swig_this()</tt> and <tt>swig_ptr()</tt>, like this:
|
||||
But it is possible to have a null pointer by using the previous functions <tt>SWIG_this()</tt> and <tt>SWIG_ptr()</tt>, like this:
|
||||
</p>
|
||||
|
||||
<div class="targetlang"><pre>
|
||||
--> p = swig_ptr(0);
|
||||
--> swig_this(p) == 0
|
||||
--> p = SWIG_ptr(0);
|
||||
--> SWIG_this(p) == 0
|
||||
ans =
|
||||
|
||||
T
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
exec("swigtest.start", -1);
|
||||
|
||||
p = getnull();
|
||||
checkequal(swig_this(p), 0, "swig_this(p)");
|
||||
checkequal(SWIG_this(p), 0, "SWIG_this(p)");
|
||||
checkequal(func(p), %T, "func(p)");
|
||||
|
||||
exec("swigtest.quit", -1);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
exec("swigtest.start", -1);
|
||||
|
||||
NULL = swig_ptr(0);
|
||||
NULL = SWIG_ptr(0);
|
||||
p = new_Pop(NULL);
|
||||
p = new_Pop(NULL, %T);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,17 +2,17 @@ exec("swigtest.start", -1);
|
|||
|
||||
// Test on NULL
|
||||
null = getNull();
|
||||
checkequal(swig_this(null), 0, "swig_this(null)");
|
||||
checkequal(SWIG_this(null), 0, "SWIG_this(null)");
|
||||
|
||||
null = swig_ptr(0);
|
||||
null = SWIG_ptr(0);
|
||||
checkequal(isNull(null), %T, "func(null)");
|
||||
|
||||
// Test on variable
|
||||
expected_foo_addr = getFooAddress();
|
||||
foo_addr = swig_this(pfoo_get());
|
||||
checkequal(foo_addr, expected_foo_addr, "swig_this(pfoo_get())");
|
||||
foo_addr = SWIG_this(pfoo_get());
|
||||
checkequal(foo_addr, expected_foo_addr, "SWIG_this(pfoo_get())");
|
||||
|
||||
pfoo = swig_ptr(foo_addr);
|
||||
pfoo = SWIG_ptr(foo_addr);
|
||||
checkequal(equalFooPointer(pfoo), %T, "equalFooPointer(pfoo)");
|
||||
|
||||
exec("swigtest.quit", -1);
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@ Foo_memberfunc(f);
|
|||
Foo_staticmemberfunc();
|
||||
|
||||
v1 = vfunc1(f);
|
||||
checkequal(swig_this(v1), swig_this(f), "vfunc1(f) <> f");
|
||||
checkequal(SWIG_this(v1), SWIG_this(f), "vfunc1(f) <> f");
|
||||
|
||||
v2 = vfunc2(f);
|
||||
checkequal(swig_this(v2), swig_this(f), "vfunc2(f) <> f");
|
||||
checkequal(SWIG_this(v2), SWIG_this(f), "vfunc2(f) <> f");
|
||||
|
||||
v3 = vfunc3(v1);
|
||||
checkequal(swig_this(v3), swig_this(f), "vfunc3(f) <> f");
|
||||
checkequal(SWIG_this(v3), SWIG_this(f), "vfunc3(f) <> f");
|
||||
|
||||
Foo_memberfunc(v3);
|
||||
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ SWIG_Scilab_Raise(const int obj, const char *type, swig_type_info *descriptor) {
|
|||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
int swig_this(SWIG_GatewayParameters) {
|
||||
int SWIG_this(SWIG_GatewayParameters) {
|
||||
void *ptrValue = NULL;
|
||||
if (SwigScilabPtrToObject(pvApiCtx, 1, &ptrValue, NULL, 0, fname) == SWIG_OK) {
|
||||
SWIG_Scilab_SetOutputPosition(1);
|
||||
|
|
@ -284,7 +284,7 @@ int swig_this(SWIG_GatewayParameters) {
|
|||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
int swig_ptr(SWIG_GatewayParameters) {
|
||||
int SWIG_ptr(SWIG_GatewayParameters) {
|
||||
double dValue = 0;
|
||||
int *piAddr;
|
||||
SciErr sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
|
||||
|
|
|
|||
|
|
@ -750,8 +750,8 @@ public:
|
|||
* addHelperFunctions()
|
||||
* ----------------------------------------------------------------------- */
|
||||
void addHelperFunctions() {
|
||||
addFunctionToScilab("swig_this", "swig_this");
|
||||
addFunctionToScilab("swig_ptr", "swig_ptr");
|
||||
addFunctionToScilab("SWIG_this", "SWIG_this");
|
||||
addFunctionToScilab("SWIG_ptr", "SWIG_ptr");
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue