Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v9 / share / swig / 1.3.26 / python / pyvoid.swg
CommitLineData
920dae64
AT
1/* ------------------------------------------------------------
2 * Void * - Accepts any kind of pointer
3 * ------------------------------------------------------------ */
4
5/* in */
6
7%typemap(in) void * {
8 if ((SWIG_ConvertPtr($input,SWIG_reinterpret_cast(&$1,void **),0,SWIG_POINTER_EXCEPTION|$disown))== -1) {
9 SWIG_arg_fail($argnum);SWIG_fail;
10 }
11}
12
13%typemap(in) void * const& ($*ltype temp) {
14 SWIG_ConvertPtr($input,(void **)&temp,0,SWIG_POINTER_EXCEPTION|$disown);
15 if (SWIG_arg_fail($argnum)) SWIG_fail;
16 $1 = &temp;
17}
18
19
20/* out */
21
22%typemap(out) void "Py_INCREF(Py_None); $result = Py_None;";
23
24/* varin */
25
26%typemap(varin) void * {
27 void * temp;
28 if ((SWIG_ConvertPtr($input, SWIG_static_cast(&temp,void **), 0,
29 SWIG_POINTER_EXCEPTION | SWIG_POINTER_DISOWN)) == -1) {
30 SWIG_append_errmsg("C/C++ variable '$name'");
31 return 1;
32 }
33 $1 = ($1_ltype) temp;
34}
35
36/* varout */
37
38%typemap(varout) void "Py_INCREF(Py_None); $result = Py_None;";
39
40/* directorout */
41
42%typemap(directorout) void * {
43 if (!$input || (SWIG_ConvertPtr($input,(void **)(&$result),
44 0, SWIG_POINTER_EXCEPTION | $disown )) == -1)
45 Swig::DirectorTypeMismatchException::raise("Pointer conversion failed.");
46}
47
48
49
50/* typecheck */
51
52%typecheck(SWIG_TYPECHECK_VOIDPTR) void *
53{
54 void *ptr;
55 if (SWIG_ConvertPtr($input, &ptr, 0, 0) == -1) {
56 $1 = 0;
57 PyErr_Clear();
58 } else {
59 $1 = 1;
60 }
61}