Added files
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@39 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
7ee1dec92d
commit
09bd3946db
37 changed files with 6653 additions and 0 deletions
56
SWIG/Lib/objc.i
Normal file
56
SWIG/Lib/objc.i
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
// SWIG Objective-C configuration file
|
||||
// Dave Beazley
|
||||
// Copyright (C) 1997
|
||||
|
||||
// This file provides support to Objective-C parsing and
|
||||
// should be included with just about any Objective-C module
|
||||
|
||||
// Base Object class
|
||||
|
||||
@interface Object { }
|
||||
|
||||
-(char *) name; // Get object name
|
||||
|
||||
@end
|
||||
|
||||
typedef Object *id; // Make 'id' behave like any other "Object"
|
||||
|
||||
// Typemaps to make *id work like kind of like a void pointer
|
||||
|
||||
%typemap(python,in) id {
|
||||
char *temp;
|
||||
if (!PyString_Check($source)) {
|
||||
PyErr_SetString(PyExc_TypeError,"Expecting an 'id' in argument $argnum of $name");
|
||||
return NULL;
|
||||
}
|
||||
temp = PyString_AsString($source);
|
||||
if (SWIG_GetPtr(temp, (void **) &$target, 0)) {
|
||||
PyErr_SetString(PyExc_TypeError,"Expecting an 'id' in argument $argnum of $name");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
%typemap(tcl,in) id {
|
||||
if (SWIG_GetPtr($source,(void **) &$target, 0)) {
|
||||
Tcl_SetResult(interp,"Expecting an 'id' in argument $argnum of $name",TCL_STATIC);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
%typemap(tcl8,in) id {
|
||||
if (SWIG_GetPointerObj(interp, $source, (void **) &$target, 0)) {
|
||||
Tcl_SetStringObj(result_obj, "Expecting an 'id' in argument $argnum of $name");
|
||||
}
|
||||
}
|
||||
|
||||
%typemap(perl5,in) id {
|
||||
if (SWIG_GetPtr($source, (void **) &$target, 0)) {
|
||||
croak("Expecting an 'id' in argument $argnum of $name");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue