1 /* phpzxid.i - SWIG interface file for PHP extension for libzxid 2 * Copyright (c) 2006-2011 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: phpzxid.i,v 1.8 2009-11-29 12:23:06 sampo Exp $ 9 * 31.8.2006, created --Sampo 10 * 31.1.2011, upgraded for php-5.3 support --Sampo 11 */ 12 %module "zxid" 13 %include "phppointers.i" 14 %include "typemaps.i" 15 %apply int *REF {int *res_len}; 16 17 %wrapper %{ 18 #define zend_error_noreturn zend_error 19 %} 20 21 %{ 22 23 #include "errmac.h" 24 #include "zx.h" 25 #include "zxid.h" 26 #include "saml2.h" 27 28 #include "c/zx-const.h" 29 #include "c/zx-data.h" 30 #include "c/zx-ns.h" 31 #include "c/zxidvers.h" 32 33 %} 34 35 %typemap (in) (int len, char* s) { 36 $1 = Z_STRLEN_PP($input); 37 $2 = Z_STRVAL_PP($input); 38 } 39 40 //%typemap (in) struct zx_str* { 41 // $1 = zx_str_dup_len_str(c/* *** where from ctx? */, Z_STRLEN_PP($input), Z_STRVAL_PP($input)); 42 //} 43 44 %typemap (out) struct zx_str* { 45 if ($1) 46 ZVAL_STRINGL($result, $1->s, $1->len, 1); 47 /* Do not free underlying zx_str because they are usually returned by reference. */ 48 } 49 50 %include "zx.h" 51 %include "zxid.h" 52 %include "saml2.h" 53 54 /* EOF */ 55