pycurious/fix

view basic/test.i @ 1:1f54edaaab02

Added SWIG typemap example.
author James Brotchie <brotchie@gmail.com>
date Fri Dec 04 22:50:30 2009 +1000 (2 years ago)
parents
children
line source
1 %module test
2 %{
3 #include "test.h"
4 %}
6 /* Converts a PyFile instance to a stdio FILE* */
7 %typemap(in) FILE* {
8 if ( PyFile_Check($input) ){
9 $1 = PyFile_AsFile($input);
10 } else {
11 PyErr_SetString(PyExc_TypeError, "$1_name must be a file type.");
12 return NULL;
13 }
14 }
16 char *message(FILE *input);