-
Notifications
You must be signed in to change notification settings - Fork 2
/
csharpzxid.i
49 lines (40 loc) · 1.48 KB
/
csharpzxid.i
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
/* csharpzxid.i - SWIG interface file for C# extension for libzxid
* Copyright (c) 2008 Symlabs ([email protected]), All Rights Reserved.
* Author: Sampo Kellomaki ([email protected])
* This is confidential unpublished proprietary source code of the author.
* NO WARRANTY, not even implied warranties. Contains trade secrets.
* Distribution prohibited unless authorized in writing.
* Licensed under Apache License 2.0, see file COPYING.
* $Id: csharpzxid.i,v 1.3 2008-08-07 13:06:59 sampo Exp $
* 7.5.2008, created --Sampo
*/
%module "zxid"
%{
#include "errmac.h"
#include "zx.h"
#include "zxid.h"
#include "saml2.h"
#include "c/zx-const.h"
#include "c/zx-data.h"
#include "c/zx-ns.h"
#include "c/zxidvers.h"
%}
%typemap (in) (int len, char* s) %{
// The following jstring casts could probably be avoided with proper use of typemaps
$1 = (*jenv)->GetStringUTFLength(jenv, (jstring)$input);
$2 = (char*)(*jenv)->GetStringUTFChars(jenv, (jstring)$input, 0);
// *** Whether we can free, or not, the obtained string depends
// on whether the zxid API will take reference to the string.
%}
%typemap (freearg) (int len, char* s) "(*jenv)->ReleaseStringUTFChars(jenv, (jstring)$input, $2);"
//%typemap (out) struct zx_str* {
// ZVAL_STRINGL($result, $1->s, $1->len, 1);
// /* Do not free underlying zx_str because they are usually returned by reference. */
//}
%include "zx.h"
%include "zxid.h"
%include "saml2.h"
%include "wsf.h"
%include "c/zxidvers.h"
%include "c/zx-ns.h"
/* EOF */