2 * ====================================================================
3 * Copyright (c) 2000-2006 CollabNet. All rights reserved.
5 * This software is licensed as described in the file COPYING, which
6 * you should have received as part of this distribution. The terms
7 * are also available at http://subversion.tigris.org/license-1.html.
8 * If newer versions of this license are posted there, you may use a
9 * newer version instead, at your option.
11 * This software consists of voluntary contributions made by many
12 * individuals. For exact contribution history, see the revision
13 * history and logs, available at http://subversion.tigris.org/.
14 * ====================================================================
16 * svn_swigcompat.swg: Definitions providing compatibility with old
20 /* %append_output(obj) */
21 #if SWIG_VERSION <= 0x010327
23 %fragment("t_output_helper");
24 #define %append_output(obj) $result = t_output_helper($result, obj)
28 #define %append_output(obj) \
29 if (argvi >= items) EXTEND(sp,1); $result = obj; argvi++
33 %fragment("output_helper");
34 #define %append_output(obj) $result = output_helper($result, obj)
39 /* %set_constant(name, value) */
40 #if SWIG_VERSION <= 0x010327
42 %define %set_constant(name, value)
43 PyDict_SetItemString(d, name, value);
50 #if SWIG_VERSION == 0x010324
51 %typemap(varin) apr_pool_t * {
53 if (SWIG_ConvertPtr($input, (void **) &temp, $1_descriptor,0) < 0) {
54 croak("Type error in argument $argnum of $symname. Expected $1_mangle");
63 #if SWIG_VERSION <= 0x010327
64 /* Remove compiler warning (break strict-aliasing rules) */
65 %typemap(in) SWIGTYPE * (void *temp)
67 #if SWIG_VERSION <= 0x010325
68 SWIG_ConvertPtr($input, &temp, $1_descriptor, 1);
70 SWIG_ConvertPtr($input, &temp, $1_descriptor, $disown);
76 #if SWIG_VERSION <= 0x010324
78 %define OUTPUT_TYPEMAP(type, converter, convtype)
79 %typemap(in, numinputs=0) type *OUTPUT ($*1_ltype temp),
80 type &OUTPUT ($*1_ltype temp) "$1 = &temp;";
81 %typemap(argout, fragment="output_helper") type *OUTPUT, type &OUTPUT {
82 VALUE o = converter(convtype (*$1));
83 $result = output_helper($result, o);
87 OUTPUT_TYPEMAP(long, INT2NUM, (long));
88 OUTPUT_TYPEMAP(long long, LL2NUM, (apr_int64_t));
89 OUTPUT_TYPEMAP(unsigned long, UINT2NUM, (unsigned long));
90 OUTPUT_TYPEMAP(unsigned long long, ULL2NUM, (apr_uint64_t));