4 * This file contains two functions :
6 * void _swig_make_hex(char *_c, void *_ptr, char *type)
7 * char *_swig_get_hex(char *_c, void **ptr, char *type)
9 * These are used to convert pointers to and from pointer strings
10 * and to perform type checking.
12 * You can remap these functions by making a file called "swigptr.cfg" in
13 * your the same directory as the interface file you are wrapping.
15 * IMPORTANT !!! the function _swig_get_hex returns a non-null char pointer
16 * in the event of a type error (this is used to generate an error message).
17 * If a type is successfully parsed, a NULL pointer is returned.
20 * Revision 1.1 2002/04/29 19:56:50 RD
21 * Since I have made several changes to SWIG over the years to accomodate
22 * special cases and other things in wxPython, and since I plan on making
23 * several more, I've decided to put the SWIG sources in wxPython's CVS
24 * instead of relying on maintaining patches. This effectivly becomes a
25 * fork of an obsolete version of SWIG, :-( but since SWIG 1.3 still
26 * doesn't have some things I rely on in 1.1, not to mention that my
27 * custom patches would all have to be redone, I felt that this is the
28 * easier road to take.
30 * Revision 1.1.1.1 1999/02/28 02:00:53 beazley
33 * Revision 1.5 1996/08/01 16:28:56 dmb
34 * Took out unused "dt" variable.
36 * Revision 1.4 1996/07/23 14:38:42 dmb
37 * Minor change to handling of NULL pointers.
39 * Revision 1.3 1996/07/17 15:26:08 dmb
40 * Made a minor bug fix so pointers of form _0_Type could be used
41 * (as described in the manual). Disable by compiling with -DNO_ZERO.
43 * Revision 1.2 1996/06/10 23:42:10 beazley
44 * Added const qualifier.
46 # Revision 1.1 1996/05/22 17:17:47 beazley
52 _swig_make_hex (char *_c, const void *_ptr, char *type)
54 static char _hex[16] =
55 {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
56 'a', 'b', 'c', 'd', 'e', 'f'};
58 char _result[128], *_r;
60 _p = (unsigned long) _ptr;
81 /* A forward reference; */
83 static char ***swig_ptr_derived = 0;
86 _swig_get_hex (char *_c, void **ptr, char *_t)
99 if ((*_c >= '0') && (*_c <= '9'))
100 _p = (_p << 4) + (*_c - '0');
101 else if ((*_c >= 'a') && (*_c <= 'f'))
102 _p = (_p << 4) + ((*_c - 'a') + 10);
118 /* Have a type mismatch, we're going to have to do some
121 if (swig_ptr_derived)
123 while (swig_ptr_derived[i])
125 eq = swig_ptr_derived[i];
127 if (strncmp (_t, eq[0], strlen (eq[0])) == 0)
129 /* Found derived type list for this. */
134 sprintf (temp_type, "%s%s", eq[j], _t + n);
135 if (strcmp (_c, temp_type) == 0)
163 if (strcmp (_c, "NULL") == 0)