1 /* csharpzxid.i  -  SWIG interface file for C# extension for libzxid
2  * Copyright (c) 2008 Symlabs (symlabs@symlabs.com), All Rights Reserved.
3  * Author: Sampo Kellomaki (sampo@iki.fi)
4  * This is confidential unpublished proprietary source code of the author.
5  * NO WARRANTY, not even implied warranties. Contains trade secrets.
6  * Distribution prohibited unless authorized in writing.
7  * Licensed under Apache License 2.0, see file COPYING.
8  * $Id: csharpzxid.i,v 1.3 2008-08-07 13:06:59 sampo Exp $
9  * 7.5.2008, created --Sampo
10  */
11 %module "zxid"
12 %{
13 
14 #include "errmac.h"
15 #include "zx.h"
16 #include "zxid.h"
17 #include "saml2.h"
18 
19 #include "c/zx-const.h"
20 #include "c/zx-data.h"
21 #include "c/zx-ns.h"
22 #include "c/zxidvers.h"
23 
24 %}
25 
26 
27 %typemap (in) (int len, char* s) %{
28   // The following jstring casts could probably be avoided with proper use of typemaps
29   $1 = (*jenv)->GetStringUTFLength(jenv, (jstring)$input);
30   $2 = (char*)(*jenv)->GetStringUTFChars(jenv, (jstring)$input, 0);
31   // *** Whether we can free, or not, the obtained string depends
32   //     on whether the zxid API will take reference to the string.
33 %}
34 %typemap (freearg) (int len, char* s) "(*jenv)->ReleaseStringUTFChars(jenv, (jstring)$input, $2);"
35 
36 
37 //%typemap (out) struct zx_str* {
38 //  ZVAL_STRINGL($result, $1->s, $1->len, 1);
39 //  /* Do not free underlying zx_str because they are usually returned by reference. */
40 //}
41 
42 %include "zx.h"
43 %include "zxid.h"
44 %include "saml2.h"
45 %include "wsf.h"
46 %include "c/zxidvers.h"
47 %include "c/zx-ns.h"
48 
49 /* EOF */
50