## swig-cvs

 [Swig-cvs] SF.net SVN: swig:[11314] branches/gsoc2009-ashishs99 From: - 2009-06-24 18:10:16 ```Revision: 11314 http://swig.svn.sourceforge.net/swig/?rev=11314&view=rev Author: ashishs99 Date: 2009-06-24 18:10:10 +0000 (Wed, 24 Jun 2009) Log Message: ----------- support code for objective-c module Added Paths: ----------- branches/gsoc2009-ashishs99/Examples/objectivec/ branches/gsoc2009-ashishs99/Examples/objectivec/simple/ branches/gsoc2009-ashishs99/Examples/objectivec/simple/example.c branches/gsoc2009-ashishs99/Examples/objectivec/simple/example.i branches/gsoc2009-ashishs99/Lib/objectivec/ branches/gsoc2009-ashishs99/Lib/objectivec/objectivec.swg branches/gsoc2009-ashishs99/Source/Modules/objectivec.cxx Added: branches/gsoc2009-ashishs99/Examples/objectivec/simple/example.c =================================================================== --- branches/gsoc2009-ashishs99/Examples/objectivec/simple/example.c (rev 0) +++ branches/gsoc2009-ashishs99/Examples/objectivec/simple/example.c 2009-06-24 18:10:10 UTC (rev 11314) @@ -0,0 +1,18 @@ +/* File : example.c */ + +/* A global variable */ +double Foo = 3.0; + +/* Compute the greatest common divisor of positive integers */ +int gcd(int x, int y) { + int g; + g = y; + while (x > 0) { + g = x; + x = y % x; + y = g; + } + return g; +} + + Added: branches/gsoc2009-ashishs99/Examples/objectivec/simple/example.i =================================================================== --- branches/gsoc2009-ashishs99/Examples/objectivec/simple/example.i (rev 0) +++ branches/gsoc2009-ashishs99/Examples/objectivec/simple/example.i 2009-06-24 18:10:10 UTC (rev 11314) @@ -0,0 +1,7 @@ +/* File : example.i */ +%module example + +%inline %{ +extern int gcd(int x, int y); +extern double Foo; +%} Added: branches/gsoc2009-ashishs99/Source/Modules/objectivec.cxx =================================================================== --- branches/gsoc2009-ashishs99/Source/Modules/objectivec.cxx (rev 0) +++ branches/gsoc2009-ashishs99/Source/Modules/objectivec.cxx 2009-06-24 18:10:10 UTC (rev 11314) @@ -0,0 +1,96 @@ +/* + * objectivec.cxx + * Module file for Objective C support + */ + +#include "swigmod.h" + +class ObjectiveC : public Language { +protected: + File *f_runtime; + File *f_header; + File *f_wrappers; + File *f_init; +public: + virtual void main(int argc, char *argv[]); + virtual int top(Node *n); + virtual int functionWrapper(Node *n); +}; + +void ObjectiveC::main(int argc, char *argv[]) { + printf("Objective C Module.\n"); + /* Set language-specific subdirectory in SWIG library */ + SWIG_library_directory("objectivec"); + + /* Set language-specific preprocessing symbol */ + Preprocessor_define("SWIGOBJECTIVEC 1", 0); + + /* Set language-specific configuration file */ + SWIG_config_file("objectivec.swg"); + + /* Set typemap language (historical) */ + SWIG_typemap_lang("objectivec"); +} + +int ObjectiveC::top(Node *n) { + printf("Generating code\n"); + /* Get the module name */ + String *module = Getattr(n,"name"); + + /* Get the output file name */ + String *outfile = Getattr(n,"outfile"); + + /* Initialize I/O */ + f_runtime = NewFile(outfile, "w", SWIG_output_files()); + if (!f_runtime) { + FileErrorDisplay(outfile); + SWIG_exit(EXIT_FAILURE); + } + f_init = NewString(""); + f_header = NewString(""); + f_wrappers = NewString(""); + + /* Register file targets with the SWIG file handler */ + Swig_register_filebyname("header", f_header); + Swig_register_filebyname("wrapper", f_wrappers); + Swig_register_filebyname("runtime", f_runtime); + Swig_register_filebyname("init", f_init); + + /* Output module initialization code */ + + /* Emit code for children */ + Language::top(n); + + /* Write all to the file */ + Dump(f_header, f_runtime); + Dump(f_wrappers, f_runtime); + Wrapper_pretty_print(f_init, f_runtime); + + /* Cleanup files */ + Delete(f_header); + Delete(f_wrappers); + Delete(f_init); + Close(f_runtime); + Delete(f_runtime); + + return SWIG_OK; +} + +int ObjectiveC::functionWrapper(Node *n) { + /* Get some useful attributes of this function */ + String *name = Getattr(n,"sym:name"); + SwigType *type = Getattr(n,"type"); + ParmList *parms = Getattr(n,"parms"); + String *parmstr= ParmList_str_defaultargs(parms); // to string + String *func = SwigType_str(type, NewStringf("%s(%s)", name, parmstr)); + String *action = Getattr(n,"wrap:action"); + + Printf(f_wrappers,"functionWrapper : %s\n", func); + Printf(f_wrappers," action : %s\n", action); + return SWIG_OK; +} + + +extern "C" Language* swig_objectivec() { + return new ObjectiveC(); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Swig-cvs] SF.net SVN: swig:[11363] branches/gsoc2009-ashishs99 From: - 2009-07-05 04:30:34 ```Revision: 11363 http://swig.svn.sourceforge.net/swig/?rev=11363&view=rev Author: ashishs99 Date: 2009-07-05 04:30:31 +0000 (Sun, 05 Jul 2009) Log Message: ----------- Basic support for generating low level accessors (including typemaps for primitive types). Added Paths: ----------- branches/gsoc2009-ashishs99/Lib/objc/ branches/gsoc2009-ashishs99/Lib/objc/objc.swg branches/gsoc2009-ashishs99/Lib/objc/objchead.swg branches/gsoc2009-ashishs99/Source/Modules/objc.cxx Added: branches/gsoc2009-ashishs99/Lib/objc/objc.swg =================================================================== --- branches/gsoc2009-ashishs99/Lib/objc/objc.swg (rev 0) +++ branches/gsoc2009-ashishs99/Lib/objc/objc.swg 2009-07-05 04:30:31 UTC (rev 11363) @@ -0,0 +1,87 @@ +/* ----------------------------------------------------------------------------- + * See the LICENSE file for information on copyright, usage and redistribution + * of SWIG, and the README file for authors - http://www.swig.org/release.html. + * + * objc.swg + * + * Objective-C typemaps + * ----------------------------------------------------------------------------- */ + +%include + + +/* Following are the ObjCpptype typemaps which contain the Objective-C++ types used in the intermediary C code */ +/* Primitive types */ +%typemap(ObjCpptype) bool, const bool & "BOOL" +%typemap(ObjCpptype) char, const char & "char" +%typemap(ObjCpptype) signed char, const signed char & "signed char" +%typemap(ObjCpptype) unsigned char, const unsigned char & "unsigned char" +%typemap(ObjCpptype) short, const short & "short" +%typemap(ObjCpptype) unsigned short, const unsigned short & "unsigned short" +%typemap(ObjCpptype) int, const int & "int" +%typemap(ObjCpptype) unsigned int, const unsigned int & "unsigned int" +%typemap(ObjCpptype) long, const long & "long" +%typemap(ObjCpptype) unsigned long, const unsigned long & "unsigned long" +%typemap(ObjCpptype) long long, const long long & "long lon" +%typemap(ObjCpptype) unsigned long long, const unsigned long long & "unsigned long long" +%typemap(ObjCpptype) float, const float & "float" +%typemap(ObjCpptype) double, const double & "double" +%typemap(ObjCpptype) void "void" + +%typemap(ObjCpptype) char * "NSString *" +%typemap(ObjCpptype) SWIGTYPE * "void *" + + +/* Following are the "in" typemaps for Objective-C to C conversions */ +/* Primitive types */ +%typemap(in) char, + signed char, + unsigned char, + short, + unsigned short, + int, + unsigned int, + long, + unsigned long, + long long, + unsigned long long, + float, + double +%{ \$1 = (\$1_ltype)\$input; %} + +%typemap(in) bool +%{ \$1 = \$input ? true : false; %} + +%typemap(in) char * +%{ \$1 = [\$input cStringUsingEncoding: NSStringEncodingConversionAllowLossy]; /*this is not proper for now*/ %} + +%typemap(in) SWIGTYPE * +%{ \$1 = (\$1_ltype)\$input; %} + + +/* Following are the "out" typemaps for C to Objective-C conversions */ +/* Primitive types */ + +%typemap(out) bool +%{ \$result = (BOOL)\$1; %} + +%typemap(out) char, + signed char, + unsigned char, + short, + unsigned short, + int, + unsigned int, + long, + unsigned long, + long long, + unsigned long long, + float, + double +%{ \$result = \$1; %} + +%typemap(out) SWIGTYPE * %{ \$result = (void *)\$1; %} + +%typemap(out) char * %{ \$result = [NSString stringWithCString: \$1]; %} + +%typemap(out, null="") void "" Added: branches/gsoc2009-ashishs99/Lib/objc/objchead.swg =================================================================== --- branches/gsoc2009-ashishs99/Lib/objc/objchead.swg (rev 0) +++ branches/gsoc2009-ashishs99/Lib/objc/objchead.swg 2009-07-05 04:30:31 UTC (rev 11363) @@ -0,0 +1,14 @@ +/* ----------------------------------------------------------------------------- + * See the LICENSE file for information on copyright, usage and redistribution + * of SWIG, and the README file for authors - http://www.swig.org/release.html. + * + * objc.swg + * + * Objective-C support code + * ----------------------------------------------------------------------------- */ + +%insert(runtime) %{ +#include +#include +%} + Added: branches/gsoc2009-ashishs99/Source/Modules/objc.cxx =================================================================== --- branches/gsoc2009-ashishs99/Source/Modules/objc.cxx (rev 0) +++ branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2009-07-05 04:30:31 UTC (rev 11363) @@ -0,0 +1,312 @@ +/* + * OBJC.cxx + * Module file for Objective C support + */ + +#include "swigmod.h" + +class OBJC : public Language { +protected: + static const char *usage; + const String *empty_string; + File *f_ll_h; + File *f_ll_mm; + File *f_runtime; + File *f_header; + File *f_wrappers; + File *f_init; + String *objcpp_h_code; + + bool proxy_flag; // Flag for generating proxy classes + bool native_function_flag; // Flag for when wrapping a native function + +public: + OBJC(): empty_string(NewString("")), + f_ll_h(NULL), + f_ll_mm(NULL), + f_runtime(NULL), + f_header(NULL), + f_wrappers(NULL), + f_init(NULL), + native_function_flag(false), + objcpp_h_code(NULL) {} + + virtual void main(int argc, char *argv[]) { + SWIG_library_directory("objc"); + + // Look for certain command line options + for (int i = 1; i < argc; i++) { + if (argv[i]) { + if ((strcmp(argv[i], "-noproxy") == 0)) { + Swig_mark_arg(i); + proxy_flag = false; + } else if (strcmp(argv[i], "-help") == 0) { + Printf(stdout, "%s\n", usage); + } + } + } + + // Add a symbol to the parser for conditional compilation + Preprocessor_define("SWIGOBJC 1", 0); + + // Add typemap definitions + SWIG_typemap_lang("objc"); + SWIG_config_file("objc.swg"); + + allow_overloading(); + } + + virtual int top(Node *n) { + + // Get the module name + String *modulename = Getattr(n,"name"); + + // Initialize all of the output files + String *file_mm = NewStringf("%sWrapper.mm", modulename); + f_ll_mm = NewFile(file_mm, "w", SWIG_output_files()); + if (!f_ll_mm) { + FileErrorDisplay(f_ll_mm); + SWIG_exit(EXIT_FAILURE); + } + + String *file_h = NewStringf("%sWrapper.h", modulename); + f_ll_h = NewFile(file_h, "w", SWIG_output_files()); + if (!f_ll_h) { + FileErrorDisplay(f_ll_h); + SWIG_exit(EXIT_FAILURE); + } + + f_runtime = NewString(""); + f_init = NewString(""); + f_header = NewString(""); + f_wrappers = NewString(""); + + // Register file targets with the SWIG file handler + Swig_register_filebyname("header", f_header); + Swig_register_filebyname("wrapper", f_wrappers); + Swig_register_filebyname("runtime", f_runtime); + Swig_register_filebyname("init", f_init); + + // Initialize members + objcpp_h_code = NewString(""); + + // Generate low level accessors + Swig_banner(f_ll_h); + + Printf(f_runtime, "\n"); + Printf(f_runtime, "#define SWIGOBJC\n"); + Printf(f_runtime, "\n"); + + Swig_name_register((char *) "wrapper", (char *) "ObjCPP_%f"); + + Printf(f_ll_h, "\n#ifdef __cplusplus\n"); + Printf(f_ll_h, "extern \"C\" {\n"); + Printf(f_ll_h, "#endif\n\n"); + + Printf(f_wrappers, "#include \"%s\"\n\n", file_h); + Printf(f_wrappers, "extern \"C\" {\n"); + + // Emit code for children + Language::top(n); + + Printv(f_ll_h, objcpp_h_code, NIL); + Printf(f_ll_h, "\n#ifdef __cplusplus\n"); + Printf(f_ll_h, "}\n"); + Printf(f_ll_h, "#endif\n"); + + Printf(f_wrappers, "}\n"); + + // Write all to the files + Dump(f_header, f_ll_mm); + Dump(f_wrappers, f_ll_mm); + Wrapper_pretty_print(f_init, f_ll_mm); + + // Cleanup strings + Delete(file_h); + Delete(objcpp_h_code); + objcpp_h_code = NULL; + + // Cleanup files + Delete(f_header); + Delete(f_wrappers); + Delete(f_init); + Delete(f_runtime); + Close(f_ll_mm); + Delete(f_ll_mm); + Close(f_ll_h); + Delete(f_ll_h); + return SWIG_OK; + } + + virtual int nativeWrapper(Node *n) { + String *wrapname = Getattr(n, "wrap:name"); + + if (!addSymbol(wrapname, n)) + return SWIG_ERROR; + + if (Getattr(n, "type")) { + Swig_save("nativeWrapper", n, "name", NIL); + Setattr(n, "name", wrapname); + native_function_flag = true; + functionWrapper(n); + Swig_restore(n); + native_function_flag = false; + } else { + Printf(stderr, "%s : Line %d. No return type for %%native method %s.\n", input_file, line_number, Getattr(n, "wrap:name")); + } + + return SWIG_OK; + } + + virtual int functionWrapper(Node *n) { + String *symname = Getattr(n, "sym:name"); + SwigType *t = Getattr(n,"type"); + ParmList *l = Getattr(n,"parms"); + + String *objcpp_return_type = NewString(""); + String *tm; + Parm *p; + int i; + int num_arguments = 0; + int num_required = 0; + bool is_void_return; + + Wrapper *f = NewWrapper(); + String *wname = Swig_name_wrapper(symname); + + Swig_typemap_attach_parms("ObjCpptype", l, f); + + if ((tm = Swig_typemap_lookup("ObjCpptype", n, "", 0))) { + Printf(objcpp_return_type, "%s", tm); + } else { + // Display warning + } + + is_void_return = (Cmp(objcpp_return_type, "void") == 0); + if (!is_void_return) + Wrapper_add_localv(f, "objcresult", objcpp_return_type, "objcresult", NIL); + + Printv(f->def, objcpp_return_type," ", wname, "(", NIL); + Printv(objcpp_h_code, objcpp_return_type, " ", wname, "(", NIL); + + // Emit all of the local variables for holding arguments. + emit_parameter_variables(l, f); + + // Attach the standard typemaps + emit_attach_parmmaps(l, f); + + // Parameter overloading + Setattr(n, "wrap:parms", l); + Setattr(n, "wrap:name", wname); + + // Get number of required and total arguments + num_arguments = emit_num_arguments(l); + num_required = emit_num_required(l); + int gencomma = 0; + + // Now walk the function parameter list and generate code to get arguments + for (i = 0, p = l; i < num_arguments; i++) { + + while (checkAttribute(p, "tmap:in:numinputs", "0")) { + p = Getattr(p, "tmap:in:next"); + } + + SwigType *pt = Getattr(p, "type"); + String *ln = Getattr(p, "lname"); + String *objcpp_param_type = NewString(""); + String *arg = NewString(""); + + Printf(arg, "objc%s", ln); + + // Get the ctype types of the parameter + if ((tm = Getattr(p, "tmap:ObjCpptype"))) { + Printv(objcpp_param_type, tm, NIL); + } else { + // Display warning + } + + // Add parameter to the objcpp function + Printv(f->def, gencomma ? ", " : "", objcpp_param_type, " ", arg, NIL); + Printv(objcpp_h_code, gencomma ? ", " : "", objcpp_param_type, " ", arg, NIL); + + gencomma = 1; + + // Get typemap for this argument + if ((tm = Getattr(p, "tmap:in"))) { + Replaceall(tm, "\$source", arg); /* deprecated */ + Replaceall(tm, "\$target", ln); /* deprecated */ + Replaceall(tm, "\$arg", arg); /* deprecated? */ + Replaceall(tm, "\$input", arg); + Setattr(p, "emit:input", arg); + Printf(f->code, "%s\n", tm); + p = Getattr(p, "tmap:in:next"); + } else { + Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(pt, 0)); + p = nextSibling(p); + } + Delete(objcpp_param_type); + Delete(arg); + } + + // Now write code to make the function call + if (!native_function_flag) { + String *actioncode = emit_action(n); + + // Return value if necessary + if ((tm = Swig_typemap_lookup_out("out", n, "result", f, actioncode))) { + Replaceall(tm, "\$source", "result"); /* deprecated */ + Replaceall(tm, "\$target", "objcresult"); /* deprecated */ + Replaceall(tm, "\$result", "objcresult"); + if (GetFlag(n, "feature:new")) + Replaceall(tm, "\$owner", "1"); + else + Replaceall(tm, "\$owner", "0"); + Printf(f->code, "%s", tm); + if (Len(tm)) + Printf(f->code, "\n"); + } else { + Swig_warning(WARN_TYPEMAP_OUT_UNDEF, input_file, line_number, "Unable to use return type %s in function %s.\n", SwigType_str(t, 0), Getattr(n, "name")); + } + emit_return_variable(n, t, f); + } + + Printf(objcpp_h_code, ");\n"); + Printf(f->def, ") {"); + + if (!is_void_return) + Printv(f->code, " return objcresult;\n", NIL); + Printf(f->code, "}\n"); + + // Dump the function out + Wrapper_print(f,f_wrappers); + + // Tidy up + Delete(objcpp_return_type); + Delete(wname); + DelWrapper(f); + + return SWIG_OK; + } +}; + +/* ----------------------------------------------------------------------------- + * swig_objc() - Instantiate module + * ----------------------------------------------------------------------------- */ + +static Language *new_swig_objc() { + return new OBJC(); +} + +extern "C" Language* swig_objc() { + return new_swig_objc(); +} + +/* ----------------------------------------------------------------------------- + * Static member variables + * ----------------------------------------------------------------------------- */ + +const char *OBJC::usage = (char *) "\ +Objective-C Options (available with -objc)\n\ +-noproxy - Generate the low-level functional interface instead\n\ +of proxy classes\n\ +\n"; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Swig-cvs] SF.net SVN: swig:[11387] branches/gsoc2009-ashishs99 From: - 2009-07-12 00:47:38 ```Revision: 11387 http://swig.svn.sourceforge.net/swig/?rev=11387&view=rev Author: ashishs99 Date: 2009-07-12 00:47:34 +0000 (Sun, 12 Jul 2009) Log Message: ----------- Support for generating basic proxy code. Modified Paths: -------------- branches/gsoc2009-ashishs99/Lib/objc/objc.swg branches/gsoc2009-ashishs99/Source/Modules/objc.cxx Modified: branches/gsoc2009-ashishs99/Lib/objc/objc.swg =================================================================== --- branches/gsoc2009-ashishs99/Lib/objc/objc.swg 2009-07-11 20:14:35 UTC (rev 11386) +++ branches/gsoc2009-ashishs99/Lib/objc/objc.swg 2009-07-12 00:47:34 UTC (rev 11387) @@ -10,7 +10,7 @@ %include -/* Following are the ocpptype typemaps which contain the Objective-C or C++ types used in the intermediary code */ +/* Following are the ocpptype typemaps which contain the Objective-C or C++ types used in the intermediary C code */ // Primitive types %typemap(ocpptype) bool, const bool & "BOOL" %typemap(ocpptype) char, const char & "char" @@ -127,14 +127,14 @@ %typemap(objctype) void "void" // Pointers, references and arrays -%typemap(ocpptype) char *, char *&, char[ANY], char[] "NSString *" -%typemap(ocpptype) SWIGTYPE "\$objcclassname *" -%typemap(ocpptype) SWIGTYPE [] "NSMutableArray *" //TBD -%typemap(ocpptype) SWIGTYPE * "\$objcclassname *" -%typemap(ocpptype) SWIGTYPE & "\$objcclassname *" +%typemap(objctype) char *, char *&, char[ANY], char[] "NSString *" +%typemap(objctype) SWIGTYPE "\$objcclassname *" +%typemap(objctype) SWIGTYPE [] "NSMutableArray *" //TBD +%typemap(objctype) SWIGTYPE * "\$objcclassname *" +%typemap(objctype) SWIGTYPE & "\$objcclassname *" // Pointer to a class member -%typemap(ocpptype) SWIGTYPE (CLASS::*) "" //TBD +%typemap(objctype) SWIGTYPE (CLASS::*) "" //TBD @@ -300,4 +300,26 @@ void *cMemberPtr = \$imcall; \$objcclassname ret = (cPtr == NULL) ? NIL : [[[\$objcclassname] initWithCptr: cMemberPtr] autorelease]; return ret; -} \ No newline at end of file +} + + +/* Objective-C specific directives */ +#define %objcconst(flag) %feature("objc:const","flag") +#define %objcconstvalue(value) %feature("objc:constvalue",value) +#define %objcenum(wrapapproach) %feature("objc:enum","wrapapproach") +#define %objcmethodmodifiers %feature("objc:methodmodifiers") +#define %objcnothrowexception %feature("except") +#define %objcattributes %feature("objc:attributes") + +%pragma(objc) imclassclassmodifiers="class" +%pragma(objc) moduleclassmodifiers="public class" + +%pragma(objc) moduleimports=%{ +using System; +using System.Runtime.InteropServices; +%} + +%pragma(objc) imclassimports=%{ +using System; +using System.Runtime.InteropServices; +%} Modified: branches/gsoc2009-ashishs99/Source/Modules/objc.cxx =================================================================== --- branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2009-07-11 20:14:35 UTC (rev 11386) +++ branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2009-07-12 00:47:34 UTC (rev 11387) @@ -34,7 +34,6 @@ String *variable_name; // Name of a variable being wrapped String *proxy_class_decl; String *proxy_class_def; - String *proxy_class_code; public: OBJC():empty_string(NewString("")), @@ -50,8 +49,7 @@ static_flag(false), variable_wrapper_flag(false), proxy_flag(true), - proxy_class_name(NULL), variable_name(NULL), proxy_class_def(NULL), proxy_class_decl(NULL), proxy_class_code(NULL), - ocpp_h_code(NULL), proxy_h_code(NULL), proxy_m_code(NULL) { + proxy_class_name(NULL), variable_name(NULL), proxy_class_def(NULL), proxy_class_decl(NULL), ocpp_h_code(NULL), proxy_h_code(NULL), proxy_m_code(NULL) { } virtual void main(int argc, char *argv[]) { SWIG_library_directory("objc"); @@ -125,10 +123,49 @@ ocpp_h_code = NewString(""); proxy_h_code = NewString(""); proxy_m_code = NewString(""); + proxy_class_decl = NewString(""); + proxy_class_def = NewString(""); // Emit code for children Language::top(n); + + // Generate proxy code + if (proxy_flag) { + String *file_proxy_h = NewStringf("%sProxy.h", modulename); + f_proxy_h = NewFile(file_proxy_h, "w", SWIG_output_files()); + if (!f_proxy_h) { + FileErrorDisplay(f_proxy_h); + SWIG_exit(EXIT_FAILURE); + } + + String *file_proxy_m = NewStringf("%sProxy.m", modulename); + f_proxy_m = NewFile(file_proxy_m, "w", SWIG_output_files()); + if (!f_proxy_m) { + FileErrorDisplay(f_proxy_m); + SWIG_exit(EXIT_FAILURE); + } + + emitBanner(f_proxy_h); + Printf(f_proxy_m, "#include \"%s\"\n\n", file_h); + Printf(f_proxy_m, "#include \"%s\"\n\n", file_proxy_h); + Printv(f_proxy_h, proxy_h_code, NIL); + Printv(f_proxy_m, proxy_m_code, NIL); + + Delete(file_proxy_h); + file_proxy_h = NULL; + Delete(file_proxy_m); + file_proxy_m = NULL; + + Delete(proxy_h_code); + proxy_h_code = NULL; + Delete(proxy_h_code); + proxy_h_code = NULL; + Close(f_proxy_m); + Delete(f_proxy_m); + Close(f_proxy_h); + Delete(f_proxy_h); + } // Generate low level accessors { Printf(f_wrappers, "}\n"); @@ -173,43 +210,6 @@ Delete(f_ocpp_h); } - // Generate proxy code - if (proxy_flag) { - String *file_proxy_h = NewStringf("%sProxy.h", modulename); - f_proxy_h = NewFile(file_proxy_h, "w", SWIG_output_files()); - if (!f_proxy_h) { - FileErrorDisplay(f_proxy_h); - SWIG_exit(EXIT_FAILURE); - } - - String *file_proxy_m = NewStringf("%sProxy.m", modulename); - f_proxy_m = NewFile(file_proxy_m, "w", SWIG_output_files()); - if (!f_proxy_m) { - FileErrorDisplay(f_proxy_m); - SWIG_exit(EXIT_FAILURE); - } - - emitBanner(f_proxy_h); - Printf(f_proxy_m, "#include \"%s\"\n\n", file_h); - Printf(f_proxy_m, "#include \"%s\"\n\n", file_proxy_h); - Printv(f_proxy_h, proxy_h_code, NIL); - Printv(f_proxy_m, proxy_m_code, NIL); - - Delete(file_proxy_h); - file_proxy_h = NULL; - Delete(file_proxy_m); - file_proxy_m = NULL; - - Delete(proxy_h_code); - proxy_h_code = NULL; - Delete(proxy_h_code); - proxy_h_code = NULL; - Close(f_proxy_m); - Delete(f_proxy_m); - Close(f_proxy_h); - Delete(f_proxy_h); - } - return SWIG_OK; } @@ -281,6 +281,7 @@ void proxyFunctionHandler(Node *n) { SwigType *t = Getattr(n, "type"); ParmList *l = Getattr(n, "parms"); + String *ocpp_function_name = Getattr(n, "ocppfuncname"); String *proxy_function_name = Getattr(n, "proxyfuncname"); String *tm; Parm *p; @@ -329,13 +330,14 @@ if (objcattributes) Printf(function_decl, " %s\n", objcattributes); - if (static_flag) { + if (static_flag) Printf(function_decl, "+ "); - } + else + Printf(function_decl, "- "); - Printf(function_decl, "(%s) %s:", return_type, proxy_function_name); + Printf(function_decl, "(%s) %s", return_type, proxy_function_name); - Printv(imcall, "\$imfuncname(", NIL); + Printv(imcall, "\$ocppfuncname(", NIL); if (!static_flag) Printf(imcall, "swigCPtr"); @@ -401,8 +403,8 @@ } Printf(imcall, ")"); - Printv(function_def, function_decl, "{", NIL); - Printf(function_decl, ";"); + Printv(function_def, function_decl, NIL); + Printf(function_decl, ";\n"); // Transform return type used in low level accessor to type used in Objective-C proxy function if ((tm = Swig_typemap_lookup("objcout", n, "", 0))) { @@ -410,6 +412,7 @@ Replaceall(tm, "\$owner", "true"); else Replaceall(tm, "\$owner", "false"); + Replaceall(imcall, "\$ocppfuncname", ocpp_function_name); Replaceall(tm, "\$imcall", imcall); } else { Swig_warning(WARN_NONE, input_file, line_number, "No objcout typemap defined for %s\n", SwigType_str(t, 0)); @@ -655,10 +658,6 @@ * ----------------------------------------------------------------------------- */ String *getOverloadedName(Node *n) { - - /* A Objective-C HandleRef is used for all classes in the SWIG intermediary class. - * The intermediary class methods are thus mangled when overloaded to give - * a unique name. */ String *overloaded_name = NewStringf("%s", Getattr(n, "sym:name")); if (Getattr(n, "sym:overloaded")) { @@ -668,23 +667,204 @@ return overloaded_name; } + /* ---------------------------------------------------------------------- + * memberfunctionHandler() + * ---------------------------------------------------------------------- */ + virtual int memberfunctionHandler(Node *n) { + Language::memberfunctionHandler(n); + + if (proxy_flag) { + String *overloaded_name = getOverloadedName(n); + String *wname = Swig_name_wrapper(overloaded_name); + Setattr(n, "proxyfuncname", Getattr(n, "sym:name")); + Setattr(n, "ocppfuncname", wname); + proxyFunctionHandler(n); + Delete(overloaded_name); + } + return SWIG_OK; + } + + /* ---------------------------------------------------------------------- + * staticmemberfunctionHandler() + * ---------------------------------------------------------------------- */ + + virtual int staticmemberfunctionHandler(Node *n) { + + static_flag = true; + Language::staticmemberfunctionHandler(n); + + if (proxy_flag) { + String *overloaded_name = getOverloadedName(n); + String *wname = Swig_name_wrapper(overloaded_name); + Setattr(n, "proxyfuncname", Getattr(n, "sym:name")); + Setattr(n, "ocppfuncname", wname); + proxyFunctionHandler(n); + Delete(overloaded_name); + } + static_flag = false; + + return SWIG_OK; + } + /* ----------------------------------------------------------------------------- - * emitProxyClassDeclaration() + * globalfunctionHandler() * ----------------------------------------------------------------------------- */ + virtual int globalfunctionHandler(Node *n) { + Language::globalfunctionHandler(n); - void emitProxyClassDeclaration(Node *n) { + if (proxy_flag) { + String *overloaded_name = getOverloadedName(n); + String *wname = Swig_name_wrapper(overloaded_name); + Setattr(n, "proxyfuncname", Getattr(n, "sym:name")); + Setattr(n, "ocppfuncname", wname); + proxyFunctionHandler(n); + Delete(overloaded_name); + } + return SWIG_OK; } /* ----------------------------------------------------------------------------- - * emitProxyClassDefinition() + * getProxyName() + * + * Test to see if a type corresponds to something wrapped with a proxy class + * Return NULL if not otherwise the proxy class name * ----------------------------------------------------------------------------- */ - void emitProxyClassDefinition(Node *n) { + String *getProxyName(SwigType *t) { + if (proxy_flag) { + Node *n = classLookup(t); + if (n) { + return Getattr(n, "sym:name"); + } + } + return NULL; } /* ----------------------------------------------------------------------------- + * typemapLookup() + * ----------------------------------------------------------------------------- */ + + const String *typemapLookup(const String *op, String *type, int warning, Node *typemap_attributes = NULL) { + String *tm = NULL; + const String *code = NULL; + + if ((tm = Swig_typemap_search(op, type, NULL, NULL))) { + code = Getattr(tm, "code"); + if (typemap_attributes) + Swig_typemap_attach_kwargs(tm, op, typemap_attributes); + } + + if (!code) { + code = empty_string; + if (warning != WARN_NONE) + Swig_warning(warning, input_file, line_number, "No %s typemap defined for %s\n", op, type); + } + + return code ? code : empty_string; + } + + /* ----------------------------------------------------------------------------- + * proxyClassHandler() + * ----------------------------------------------------------------------------- */ + + void proxyClassHandler(Node *n) { + String *c_classname = SwigType_namestr(Getattr(n, "name")); + String *c_baseclass = NULL; + String *baseclass = NULL; + String *c_baseclassname = NULL; + String *typemap_lookup_type = Getattr(n, "classtypeobj"); + + // Inheritance from pure Objective-C classes + Node *attributes = NewHash(); + const String *pure_baseclass = typemapLookup("objcbase", typemap_lookup_type, WARN_NONE, attributes); + bool purebase_replace = GetFlag(attributes, "tmap:objcbase:replace") ? true : false; + bool purebase_notderived = GetFlag(attributes, "tmap:objcbase:notderived") ? true : false; + Delete(attributes); + + // C++ inheritance + if (!purebase_replace) { + List *baselist = Getattr(n, "bases"); + if (baselist) { + Iterator base = First(baselist); + while (base.item && GetFlag(base.item, "feature:ignore")) { + base = Next(base); + } + if (base.item) { + c_baseclassname = Getattr(base.item, "name"); + baseclass = Copy(getProxyName(c_baseclassname)); + if (baseclass) + c_baseclass = SwigType_namestr(Getattr(base.item, "name")); + base = Next(base); + /* Warn about multiple inheritance for additional base class(es) */ + while (base.item) { + if (GetFlag(base.item, "feature:ignore")) { + base = Next(base); + continue; + } + String *proxyclassname = SwigType_str(Getattr(n, "classtypeobj"), 0); + String *baseclassname = SwigType_str(Getattr(base.item, "name"), 0); + Swig_warning(WARN_NONE, input_file, line_number, + "Warning for %s proxy: Base %s ignored. Multiple inheritance is not supported in Objective-C.\n", proxyclassname, baseclassname); + base = Next(base); + } + } + } + } + + bool derived = baseclass && getProxyName(c_baseclassname); + if (derived && purebase_notderived) + pure_baseclass = empty_string; + const String *wanted_base = baseclass ? baseclass : pure_baseclass; + + if (purebase_replace) { + wanted_base = pure_baseclass; + derived = false; + Delete(baseclass); + baseclass = NULL; + if (purebase_notderived) + Swig_error(input_file, line_number, "The objcbase typemap for proxy %s must contain just one of the 'replace' or 'notderived' attributes.\n", + typemap_lookup_type); + } else if (Len(pure_baseclass) > 0 && Len(baseclass) > 0) { + Swig_warning(WARN_NONE, input_file, line_number, + "Warning for %s proxy: Base %s ignored. Multiple inheritance is not supported in Objective-C. " + "Perhaps you need one of the 'replace' or 'notderived' attributes in the objcbase typemap?\n", typemap_lookup_type, pure_baseclass); + } + // Pure Objective-C interfaces + const String *pure_interfaces = typemapLookup(derived ? "objcinterfaces_derived" : "objcinterfaces", typemap_lookup_type, WARN_NONE); + // Start writing the proxy class + Printv(proxy_class_def, typemapLookup("objcimports", typemap_lookup_type, WARN_NONE), // Import statements + "\n", NIL); + + // Class attributes + const String *objcattributes = typemapLookup("objcattributes", typemap_lookup_type, WARN_NONE); + if (objcattributes && *Char(objcattributes)) + Printf(proxy_class_def, "%s\n", objcattributes); + + Printv(proxy_class_decl, typemapLookup("objcclassinterface", typemap_lookup_type, WARN_NONE), // Class modifiers + " \$objcclassname", // Class name and base class + (*Char(wanted_base) || *Char(pure_interfaces)) ? " : " : "", wanted_base, (*Char(wanted_base) && *Char(pure_interfaces)) ? // Interfaces + ", " : "", pure_interfaces, derived ? typemapLookup("objcbody_derived", typemap_lookup_type, WARN_NONE) : // main body of class + typemapLookup("objcbody", typemap_lookup_type, WARN_NONE), // main body of class + "\n", NIL); + + Printv(proxy_class_def, typemapLookup("objcclassimplementation", typemap_lookup_type, WARN_NONE), // Class modifiers + " \$objcclassname", NIL); + + // Emit extra user code + Printv(proxy_class_def, typemapLookup("objccode", typemap_lookup_type, WARN_NONE), // extra Objective-C code + "\n", NIL); + + // Substitute various strings into the above template + Replaceall(proxy_class_decl, "\$objcclassname", proxy_class_name); + Replaceall(proxy_class_def, "\$objcclassname", proxy_class_name); + + Delete(baseclass); + } + + + /* ----------------------------------------------------------------------------- * classHandler() * ----------------------------------------------------------------------------- */ @@ -693,17 +873,19 @@ proxy_class_name = NewString(Getattr(n, "sym:name")); if (!addSymbol(proxy_class_name, n)) return SWIG_ERROR; + + Clear(proxy_class_def); + Clear(proxy_class_decl); + proxyClassHandler(n); + Printv(proxy_h_code, proxy_class_decl, NIL); + Printv(proxy_m_code, proxy_class_def, NIL); } Language::classHandler(n); if (proxy_flag) { - emitProxyClassDeclaration(n); - Printv(f_proxy_h, proxy_class_decl, proxy_class_code, NIL); - - emitProxyClassDefinition(n); - Printv(f_proxy_m, proxy_class_def, proxy_class_code, NIL); - + Printv(proxy_h_code, "\n@...", NIL); + Printv(proxy_m_code, "\n@...", NIL); Delete(proxy_class_name); proxy_class_name = NULL; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Swig-cvs] SF.net SVN: swig:[11416] branches/gsoc2009-ashishs99 From: - 2009-07-17 18:51:21 ```Revision: 11416 http://swig.svn.sourceforge.net/swig/?rev=11416&view=rev Author: ashishs99 Date: 2009-07-17 18:51:14 +0000 (Fri, 17 Jul 2009) Log Message: ----------- some fixes for proxy code generation for global functions and classes. Modified Paths: -------------- branches/gsoc2009-ashishs99/Lib/objc/objc.swg branches/gsoc2009-ashishs99/Source/Modules/objc.cxx Modified: branches/gsoc2009-ashishs99/Lib/objc/objc.swg =================================================================== --- branches/gsoc2009-ashishs99/Lib/objc/objc.swg 2009-07-17 16:21:54 UTC (rev 11415) +++ branches/gsoc2009-ashishs99/Lib/objc/objc.swg 2009-07-17 18:51:14 UTC (rev 11416) @@ -233,7 +233,48 @@ %typemap(objcinterfaces) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" %typemap(objcinterfaces_derived) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" +// Proxy classes (base classes, ie, not derived classes) +%typemap(objcinterface) SWIGTYPE %{ +{ + void *swigCPtr; +} +- (void*)getCptr; +- (id)initWithCptr: (void*) cptr; +%} +%typemap(objcbody) SWIGTYPE %{ +- (void*)getCptr { + return swigCPtr; +} + +- (id)initWithCptr: (void*) cptr{ + if(self = [super init]) { + swigCPtr = cptr; + } + return self; +} +%} + + +// Derived proxy classes +%typemap(objcinterface_derived) SWIGTYPE "" + +%typemap(objcbody_derived) SWIGTYPE %{ + -(void*)getCptr { + return swigCPtr; +} + +-(id)initWithCptr: (void*) cptr{ + if(self = [super init]) { + swigCPtr = cptr; + } + return self; +} +%} + + + + /* Following are the typemaps used for Objective-C setter and getters for global variables */ // Primitive types %typemap(objcvarin) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) %{ @@ -277,12 +318,13 @@ void *cPtr = \$imcall; \$objcclassname ret = (cPtr == NULL) ? NIL : [[[\$objcclassname] initWithCptr: cPtr] autorelease]; return ret; - } +} + %typemap(objcvarout) SWIGTYPE & { //TBD void *cPtr = \$imcall; \$objcclassname ret = (cPtr == NULL) ? NIL : [[[\$objcclassname] initWithCptr: cPtr] autorelease]; return ret; - } +} // TBD: below we need to see if this \$objcclassname is Class pointer or some other pointer // Also see the memory management part @@ -310,16 +352,3 @@ #define %objcmethodmodifiers %feature("objc:methodmodifiers") #define %objcnothrowexception %feature("except") #define %objcattributes %feature("objc:attributes") - -%pragma(objc) imclassclassmodifiers="class" -%pragma(objc) moduleclassmodifiers="public class" - -%pragma(objc) moduleimports=%{ -using System; -using System.Runtime.InteropServices; -%} - -%pragma(objc) imclassimports=%{ -using System; -using System.Runtime.InteropServices; -%} Modified: branches/gsoc2009-ashishs99/Source/Modules/objc.cxx =================================================================== --- branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2009-07-17 16:21:54 UTC (rev 11415) +++ branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2009-07-17 18:51:14 UTC (rev 11416) @@ -205,6 +205,11 @@ Delete(swig_types_hash); swig_types_hash = NULL; + Delete(proxy_class_def); + proxy_class_def = NULL; + Delete(proxy_class_decl); + proxy_class_decl = NULL; + Delete(f_header); Delete(f_wrappers); Delete(f_init); @@ -275,13 +280,13 @@ * * Substitute \$objcclassname with the proxy class name for classes/structs/unions that SWIG knows about. * Also substitutes enums with enum name. - * Otherwise use the \$descriptor name for the C# class name. Note that the \$&objcclassname substitution + * Otherwise use the \$descriptor name for the Objective-C class name. Note that the \$&objcclassname substitution * is the same as a \$&descriptor substitution, ie one pointer added to descriptor name. * Inputs: * pt - parameter type - * tm - cstype typemap + * tm - objctype typemap * Outputs: - * tm - cstype typemap with \$objcclassname substitution + * tm - objctype typemap with \$objcclassname substitution * Return: * substitution_performed - flag indicating if a substitution was performed * ----------------------------------------------------------------------------- */ @@ -351,7 +356,6 @@ * n - Node * p - parameter node * arg_num - parameter argument number - * setter - set this flag when wrapping variables * Return: * arg - a unique parameter name * ----------------------------------------------------------------------------- */ @@ -939,10 +943,12 @@ if (proxy_flag) { String *overloaded_name = getOverloadedName(n); - String *wname = Swig_name_wrapper(overloaded_name); + String *imfunctname = Swig_name_member(proxy_class_name, overloaded_name); + String *ocppfunctname = NewStringf("ObjCPP_%s", imfunctname); Setattr(n, "proxyfuncname", Getattr(n, "sym:name")); - Setattr(n, "ocppfuncname", wname); + Setattr(n, "ocppfuncname", ocppfunctname); proxyClassFunctionHandler(n); + Delete(imfunctname); Delete(overloaded_name); } return SWIG_OK; @@ -959,12 +965,15 @@ if (proxy_flag) { String *overloaded_name = getOverloadedName(n); - String *wname = Swig_name_wrapper(overloaded_name); + String *imfunctname = Swig_name_member(proxy_class_name, overloaded_name); + String *ocppfunctname = NewStringf("ObjCPP_%s", imfunctname); Setattr(n, "proxyfuncname", Getattr(n, "sym:name")); - Setattr(n, "ocppfuncname", wname); + Setattr(n, "ocppfuncname", ocppfunctname); proxyClassFunctionHandler(n); + Delete(imfunctname); Delete(overloaded_name); } + static_flag = false; return SWIG_OK; @@ -978,12 +987,13 @@ if (proxy_flag) { String *overloaded_name = getOverloadedName(n); - String *wname = Swig_name_wrapper(overloaded_name); + String *intermediary_function_name = Swig_name_wrapper(overloaded_name); Setattr(n, "proxyfuncname", Getattr(n, "sym:name")); - Setattr(n, "ocppfuncname", wname); + Setattr(n, "ocppfuncname", intermediary_function_name); proxyGlobalFunctionHandler(n); Delete(overloaded_name); } + return SWIG_OK; } @@ -1033,7 +1043,6 @@ * ----------------------------------------------------------------------------- */ void proxyClassHandler(Node *n) { - String *c_classname = SwigType_namestr(Getattr(n, "name")); String *c_baseclass = NULL; String *baseclass = NULL; String *c_baseclassname = NULL; @@ -1078,7 +1087,7 @@ bool derived = baseclass && getProxyName(c_baseclassname); if (derived && purebase_notderived) - pure_baseclass = empty_string; + pure_baseclass = "NSObject"; const String *wanted_base = baseclass ? baseclass : pure_baseclass; if (purebase_replace) { @@ -1108,12 +1117,14 @@ Printv(proxy_class_decl, typemapLookup("objcclassinterface", typemap_lookup_type, WARN_NONE), // Class modifiers " \$objcclassname", // Class name and base class (*Char(wanted_base) || *Char(pure_interfaces)) ? " : " : "", wanted_base, (*Char(wanted_base) && *Char(pure_interfaces)) ? // Interfaces - ", " : "", pure_interfaces, derived ? typemapLookup("objcbody_derived", typemap_lookup_type, WARN_NONE) : // main body of class - typemapLookup("objcbody", typemap_lookup_type, WARN_NONE), // main body of class + ", " : "", pure_interfaces, derived ? typemapLookup("objcinterface_derived", typemap_lookup_type, WARN_NONE) : // main body of class + typemapLookup("objcinterface", typemap_lookup_type, WARN_NONE), // main body of class "\n", NIL); Printv(proxy_class_def, typemapLookup("objcclassimplementation", typemap_lookup_type, WARN_NONE), // Class modifiers - " \$objcclassname", NIL); + " \$objcclassname", derived ? typemapLookup("objcbody_derived", typemap_lookup_type, WARN_NONE) : // main body of class + typemapLookup("objcbody", typemap_lookup_type, WARN_NONE), // main body of class + "\n", NIL); // Emit extra user code Printv(proxy_class_def, typemapLookup("objccode", typemap_lookup_type, WARN_NONE), // extra Objective-C code This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Swig-cvs] SF.net SVN: swig:[11437] branches/gsoc2009-ashishs99 From: - 2009-07-22 22:57:00 ```Revision: 11437 http://swig.svn.sourceforge.net/swig/?rev=11437&view=rev Author: ashishs99 Date: 2009-07-22 22:56:53 +0000 (Wed, 22 Jul 2009) Log Message: ----------- constructor and destructor handling [yet to finalize the memory management part]. Modified Paths: -------------- branches/gsoc2009-ashishs99/Lib/objc/objc.swg branches/gsoc2009-ashishs99/Source/Modules/objc.cxx Modified: branches/gsoc2009-ashishs99/Lib/objc/objc.swg =================================================================== --- branches/gsoc2009-ashishs99/Lib/objc/objc.swg 2009-07-22 22:11:04 UTC (rev 11436) +++ branches/gsoc2009-ashishs99/Lib/objc/objc.swg 2009-07-22 22:56:53 UTC (rev 11437) @@ -225,7 +225,7 @@ /* Following are the typemaps used for the generation of proxy and type wrapper class code */ -%typemap(objcbase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" +%typemap(objcbase,notderived="") SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "NSObject" %typemap(objcclassinterface) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "@interface" %typemap(objcclassimplementation) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "@implementation" %typemap(objccode) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" @@ -257,7 +257,9 @@ // Derived proxy classes -%typemap(objcinterface_derived) SWIGTYPE "" +%typemap(objcinterface_derived) SWIGTYPE %{ +- (id)initWithCptr: (void*) cptr; +%} %typemap(objcbody_derived) SWIGTYPE %{ -(void*)getCptr { @@ -344,7 +346,36 @@ return ret; } +/* + * Objective-C constructor and destructor typemaps: + * + * The objcconstruct typemap is inserted when a proxy class's constructor is generated. + * This typemap allows control over what code is executed in the constructor as + * well as specifying who owns the underlying C/C++ object. Normally, Objective-C has + * ownership and the underlying C/C++ object is deallocated when the Objective-C object + * is deallocated (swigCMemOwn is true.) If swigCMemOwn is false, C/C++ is + * ultimately responsible for deallocating the underlying object's memory. + * + */ +%typemap(objcconstruct) SWIGTYPE { + if(self = [super init]) { + swigCPtr = \$imcall; + } + return self; +} + +%typemap(objcdestruct, methodname="dealloc") SWIGTYPE { + if (swigCPtr != 0) { + if (swigCMemOwn) { + swigCMemOwn = false; + \$imcall; + } + swigCPtr = 0; + } + [super dealloc]; +} + /* Objective-C specific directives */ #define %objcconst(flag) %feature("objc:const","flag") #define %objcconstvalue(value) %feature("objc:constvalue",value) Modified: branches/gsoc2009-ashishs99/Source/Modules/objc.cxx =================================================================== --- branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2009-07-22 22:11:04 UTC (rev 11436) +++ branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2009-07-22 22:56:53 UTC (rev 11437) @@ -38,6 +38,7 @@ String *variable_name; // Name of a variable being wrapped String *proxy_class_decl; String *proxy_class_def; + String *destructor_call; //C++ destructor call if any public: OBJC():empty_string(NewString("")), @@ -57,7 +58,8 @@ wrapping_member_flag(false), global_variable_flag(false), proxy_flag(true), - proxy_class_name(NULL), variable_name(NULL), proxy_class_def(NULL), proxy_class_decl(NULL), ocpp_h_code(NULL), proxy_h_code(NULL), proxy_m_code(NULL) { + proxy_class_name(NULL), + destructor_call(NULL), variable_name(NULL), proxy_class_def(NULL), proxy_class_decl(NULL), ocpp_h_code(NULL), proxy_h_code(NULL), proxy_m_code(NULL) { } virtual void main(int argc, char *argv[]) { SWIG_library_directory("objc"); @@ -659,7 +661,7 @@ } /* Ignore the 'this' argument for variable wrappers */ - if (!(variable_wrapper_flag && i == 0)) { + if (!(variable_wrapper_flag && i == 0) || static_flag) { SwigType *pt = Getattr(p, "type"); String *param_type = NewString(""); if (setter_flag) @@ -689,11 +691,13 @@ } /* Add parameter to proxy function */ - if (i == 0) + if (gencomma >= 2) + Printf(function_decl, " %s: ", arg); + else Printf(function_decl, ":"); - else - Printf(function_decl, " %s: ", arg); + gencomma = 2; + Printf(function_decl, " (%s)%s", param_type, arg); Delete(arg); @@ -987,6 +991,147 @@ } /* ---------------------------------------------------------------------- + * constructorHandler() + * ---------------------------------------------------------------------- */ + + virtual int constructorHandler(Node *n) { + ParmList *l = Getattr(n, "parms"); + String *tm; + Parm *p; + int i; + String *function_decl = NewString(""); + String *function_def = NewString(""); + String *ocpp_return_type = NewString(""); + + Language::constructorHandler(n); + + // Wrappers not wanted for some methods where the parameters cannot be overloaded in Objective-C + if (Getattr(n, "overload:ignore")) + return SWIG_OK; + + if (proxy_flag) { + String *overloaded_name = getOverloadedName(n); + String *mangled_overname = Swig_name_construct(overloaded_name); + String *imcall = NewString(""); + + tm = Getattr(n, "tmap:ocpptype"); // typemaps were attached earlier to the node + Printf(ocpp_return_type, "%s", tm); + + Printf(function_decl, "- (id)init"); + + Printv(imcall, mangled_overname, "(", NIL); + + /* Attach the non-standard typemaps to the parameter list */ + Swig_typemap_attach_parms("in", l, NULL); + Swig_typemap_attach_parms("ocpptype", l, NULL); + Swig_typemap_attach_parms("objctype", l, NULL); + Swig_typemap_attach_parms("objcin", l, NULL); + + emit_mark_varargs(l); + + int gencomma = 0; + + /* Output each parameter */ + for (i = 0, p = l; p; i++) { + + /* Ignored varargs */ + if (checkAttribute(p, "varargs:ignore", "1")) { + p = nextSibling(p); + continue; + } + + /* Ignored parameters */ + if (checkAttribute(p, "tmap:in:numinputs", "0")) { + p = Getattr(p, "tmap:in:next"); + continue; + } + + SwigType *pt = Getattr(p, "type"); + String *param_type = NewString(""); + + /* Get the Objective-C parameter type */ + if ((tm = Getattr(p, "tmap:objctype"))) { + substituteClassname(pt, tm); + Printf(param_type, "%s", tm); + } else { + Swig_warning(WARN_NONE, input_file, line_number, "No objctype typemap defined for %s\n", SwigType_str(pt, 0)); + } + + if (gencomma) + Printf(imcall, ", "); + + String *arg = makeParameterName(n, p, i, false); + + // Use typemaps to transform type used in Objective-C wrapper function (in proxy class) to type used in intermediary code + if ((tm = Getattr(p, "tmap:objcin"))) { + substituteClassname(pt, tm); + Replaceall(tm, "\$objcinput", arg); + Printv(imcall, tm, NIL); + } else { + Swig_warning(WARN_NONE, input_file, line_number, "No objcin typemap defined for %s\n", SwigType_str(pt, 0)); + } + + /* Add parameter to proxy function */ + if (gencomma >= 2) + Printf(function_decl, " %s: ", arg); + else { + String *func_name = NewString("With"); + Putc(toupper((int) *Char(arg)), func_name); + Printf(func_name, "%s", Char(arg) + 1); + Printf(function_decl, "%s:", func_name); + Delete(func_name); + } + + gencomma = 2; + + Printf(function_decl, " (%s)%s", param_type, arg); + Delete(arg); + Delete(param_type); + p = Getattr(p, "tmap:in:next"); + } + + Printf(imcall, ")"); + Printv(function_def, function_decl, NIL); + Printf(function_decl, ";"); + + /* Insert the objcconstruct typemap, doing the replacement for \$directorconnect, as needed */ + Hash *attributes = NewHash(); + String *construct_tm = Copy(typemapLookup("objcconstruct", Getattr(n, "name"), + WARN_NONE, attributes)); + if (construct_tm) { + Printv(function_def, " ", construct_tm, "\n", NIL); + } + + Replaceall(function_def, "\$imcall", imcall); + + Printv(proxy_class_decl, function_decl, NIL); + Printv(proxy_class_def, function_def, NIL); + + Delete(ocpp_return_type); + Delete(construct_tm); + Delete(attributes); + Delete(overloaded_name); + Delete(imcall); + } + + return SWIG_OK; + } + + /* ---------------------------------------------------------------------- + * destructorHandler() + * ---------------------------------------------------------------------- */ + + virtual int destructorHandler(Node *n) { + Language::destructorHandler(n); + String *symname = Getattr(n, "sym:name"); + + if (proxy_flag) { + Printv(destructor_call, Swig_name_destroy(symname), "(swigCPtr)", NIL); + } + return SWIG_OK; + } + + /* ---------------------------------------------------------------------- * membervariableHandler() * ---------------------------------------------------------------------- */ @@ -1200,7 +1345,7 @@ bool derived = baseclass && getProxyName(c_baseclassname); if (derived && purebase_notderived) - pure_baseclass = "NSObject"; + pure_baseclass = ""; const String *wanted_base = baseclass ? baseclass : pure_baseclass; if (purebase_replace) { @@ -1219,8 +1364,8 @@ // Pure Objective-C interfaces const String *pure_interfaces = typemapLookup(derived ? "objcinterfaces_derived" : "objcinterfaces", typemap_lookup_type, WARN_NONE); // Start writing the proxy class - Printv(proxy_class_def, typemapLookup("objcimports", typemap_lookup_type, WARN_NONE), // Import statements - "\n", NIL); + Printv(proxy_class_decl, typemapLookup("objcimports", typemap_lookup_type, WARN_NONE), // Import statements + "\n", NIL); // This would be needed when we decide upon a separate file for each class. // Class attributes const String *objcattributes = typemapLookup("objcattributes", typemap_lookup_type, WARN_NONE); @@ -1232,16 +1377,37 @@ (*Char(wanted_base) || *Char(pure_interfaces)) ? " : " : "", wanted_base, (*Char(wanted_base) && *Char(pure_interfaces)) ? // Interfaces ", " : "", pure_interfaces, derived ? typemapLookup("objcinterface_derived", typemap_lookup_type, WARN_NONE) : // main body of class typemapLookup("objcinterface", typemap_lookup_type, WARN_NONE), // main body of class - "\n", NIL); + NIL); Printv(proxy_class_def, typemapLookup("objcclassimplementation", typemap_lookup_type, WARN_NONE), // Class modifiers " \$objcclassname", derived ? typemapLookup("objcbody_derived", typemap_lookup_type, WARN_NONE) : // main body of class typemapLookup("objcbody", typemap_lookup_type, WARN_NONE), // main body of class "\n", NIL); + // C++ destructor is wrapped by the dealloc method + // Note that the method name is specified in a typemap attribute called methodname + String *destruct = NewString(""); + const String *tm = NULL; + attributes = NewHash(); + String *destruct_methodname = NewString("dealloc"); + tm = typemapLookup("objcdestruct", typemap_lookup_type, WARN_NONE, attributes); + + // Emit the dealloc method + if (tm) { + // dealloc method + Printv(destruct, tm, NIL); + if (*Char(destructor_call)) + Replaceall(destruct, "\$imcall", destructor_call); + else + Replaceall(destruct, "\$imcall", "throw new MethodAccessException(\"C++ destructor does not have public access\")"); + if (*Char(destruct)) { + Printv(proxy_class_decl, "- (void)", destruct_methodname, "();", "\n", NIL); + Printv(proxy_class_def, "- (void)", destruct_methodname, "() ", destruct, "\n\n", NIL); + } + } // Emit extra user code Printv(proxy_class_def, typemapLookup("objccode", typemap_lookup_type, WARN_NONE), // extra Objective-C code - "\n", NIL); + NIL); // Substitute various strings into the above template Replaceall(proxy_class_decl, "\$objcclassname", proxy_class_name); @@ -1263,18 +1429,30 @@ Clear(proxy_class_def); Clear(proxy_class_decl); + + destructor_call = NewString(""); + proxyClassHandler(n); Printv(proxy_h_code, proxy_class_decl, NIL); Printv(proxy_m_code, proxy_class_def, NIL); + + Clear(proxy_class_def); + Clear(proxy_class_decl); } Language::classHandler(n); if (proxy_flag) { - Printv(proxy_h_code, "@end\n\n", NIL); - Printv(proxy_m_code, "@end\n\n", NIL); + Printv(proxy_h_code, proxy_class_decl, NIL); + Printv(proxy_m_code, proxy_class_def, NIL); + + Printv(proxy_h_code, "\n@...\n\n", NIL); + Printv(proxy_m_code, "\n@...\n\n", NIL); + Delete(proxy_class_name); proxy_class_name = NULL; + Delete(destructor_call); + destructor_call = NULL; } return SWIG_OK; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Swig-cvs] SF.net SVN: swig:[11499] branches/gsoc2009-ashishs99 From: - 2009-08-04 17:42:33 ```Revision: 11499 http://swig.svn.sourceforge.net/swig/?rev=11499&view=rev Author: ashishs99 Date: 2009-08-04 17:42:24 +0000 (Tue, 04 Aug 2009) Log Message: ----------- Fixed some issues and added exception handling support. Modified Paths: -------------- branches/gsoc2009-ashishs99/Lib/objc/objc.swg branches/gsoc2009-ashishs99/Source/Modules/objc.cxx Modified: branches/gsoc2009-ashishs99/Lib/objc/objc.swg =================================================================== --- branches/gsoc2009-ashishs99/Lib/objc/objc.swg 2009-08-04 15:37:32 UTC (rev 11498) +++ branches/gsoc2009-ashishs99/Lib/objc/objc.swg 2009-08-04 17:42:24 UTC (rev 11499) @@ -383,3 +383,27 @@ #define %objcmethodmodifiers %feature("objc:methodmodifiers") #define %objcnothrowexception %feature("except") #define %objcattributes %feature("objc:attributes") + + +/* Exception handling */ + +%typemap(throws) int, + long, + short, + unsigned int, + unsigned long, + unsigned short +%{ NString* aFormat = [NSString stringWithString:@"The value is %d"]; + [NSException raise:@"\$1_type exception" format: aFormat, \$1] %} + +%typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE *, SWIGTYPE [], SWIGTYPE [ANY] +%{ NString* aFormat = [NSString stringWithString:@"The value is %d"]; + [NSException raise:@"\$1_type exception" format: aFormat, \$1] %} + +%typemap(throws) char * +%{ NString* aFormat = [NSString stringWithString:@"%s"]; + [NSException raise:@"\$1_type exception" format: aFormat, \$1] %} + +// Default enum handling +%include + Modified: branches/gsoc2009-ashishs99/Source/Modules/objc.cxx =================================================================== --- branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2009-08-04 15:37:32 UTC (rev 11498) +++ branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2009-08-04 17:42:24 UTC (rev 11499) @@ -4,6 +4,7 @@ */ #include "swigmod.h" +#include // for INT_MAX #include "cparse.h" #include @@ -127,15 +128,17 @@ Swig_register_filebyname("runtime", f_runtime); Swig_register_filebyname("init", f_init); + Printf(f_runtime, "\n#define SWIGOBJC\n"); Printf(f_runtime, "\n"); - Printf(f_runtime, "#define SWIGOBJC\n"); - Printf(f_runtime, "\n"); Swig_name_register((char *) "wrapper", (char *) "ObjCPP_%f"); Printf(f_wrappers, "#include \"%s\"\n\n", file_h); + + Printf(f_wrappers, "\n#ifdef __cplusplus\n"); Printf(f_wrappers, "extern \"C\" {\n"); - + Printf(f_wrappers, "#endif\n\n"); + // Initialize members ocpp_h_code = NewString(""); proxy_h_code = NewString(""); @@ -151,15 +154,15 @@ // Generate proxy code if (proxy_flag) { - String *file_proxy_h = NewStringf("%sProxy.h", modulename); - f_proxy_h = NewFile(file_proxy_h, "w", SWIG_output_files()); + String *proxy_h = NewStringf("%sProxy.h", modulename); + f_proxy_h = NewFile(proxy_h, "w", SWIG_output_files()); if (!f_proxy_h) { FileErrorDisplay(f_proxy_h); SWIG_exit(EXIT_FAILURE); } - String *file_proxy_m = NewStringf("%sProxy.m", modulename); - f_proxy_m = NewFile(file_proxy_m, "w", SWIG_output_files()); + String *proxy_m = NewStringf("%sProxy.m", modulename); + f_proxy_m = NewFile(proxy_m, "w", SWIG_output_files()); if (!f_proxy_m) { FileErrorDisplay(f_proxy_m); SWIG_exit(EXIT_FAILURE); @@ -167,14 +170,14 @@ emitBanner(f_proxy_h); Printf(f_proxy_m, "#include \"%s\"\n\n", file_h); - Printf(f_proxy_m, "#include \"%s\"\n\n", file_proxy_h); + Printf(f_proxy_m, "#include \"%s\"\n\n", proxy_h); Printv(f_proxy_h, proxy_global_constants_code, proxy_h_code, NIL); Printv(f_proxy_m, proxy_m_code, NIL); - Delete(file_proxy_h); - file_proxy_h = NULL; - Delete(file_proxy_m); - file_proxy_m = NULL; + Delete(proxy_h); + proxy_h = NULL; + Delete(proxy_m); + proxy_m = NULL; Delete(proxy_h_code); proxy_h_code = NULL; @@ -187,7 +190,10 @@ } // Generate low level accessors { - Printf(f_wrappers, "}\n"); + Printf(f_wrappers, "#ifdef __cplusplus\n"); + Printf(f_wrappers, "}\n"); + Printf(f_wrappers, "#endif\n"); + f_ocpp_h = NewFile(file_h, "w", SWIG_output_files()); if (!f_ocpp_h) { FileErrorDisplay(f_ocpp_h); @@ -208,10 +214,12 @@ Printf(f_ocpp_h, "}\n"); Printf(f_ocpp_h, "#endif\n"); - Dump(f_header, f_ocpp_mm); - Dump(f_wrappers, f_ocpp_mm); - Wrapper_pretty_print(f_init, f_ocpp_mm); + Dump(f_header, f_runtime); + Dump(f_wrappers, f_runtime); + Wrapper_pretty_print(f_init, f_runtime); + Dump(f_runtime, f_ocpp_mm); + Delete(file_h); file_h = NULL; Delete(file_mm); @@ -275,17 +283,7 @@ if (n) { String *symname = Getattr(n, "sym:name"); if (symname) { - // Add in class scope when referencing enum if not a global enum - String *scopename_prefix = Swig_scopename_prefix(Getattr(n, "name")); - String *proxyname = 0; - if (scopename_prefix) { - proxyname = getProxyName(scopename_prefix); - } - if (proxyname) - enum_name = NewStringf("%s.%s", proxyname, symname); - else - enum_name = NewStringf("%s", symname); - Delete(scopename_prefix); + enum_name = NewStringf("%s", symname); } } @@ -586,6 +584,7 @@ // Use typemaps to transform type used in Objective-C proxy function to the one used in intermediate code. if ((tm = Getattr(p, "tmap:objcin"))) { + addThrows(n, "tmap:objcin", p); substituteClassname(pt, tm); Replaceall(tm, "\$objcinput", arg); Printv(imcall, tm, NIL); @@ -612,6 +611,7 @@ // Transform return type used in low level accessor to type used in Objective-C proxy function if ((tm = Swig_typemap_lookup("objcout", n, "", 0))) { + addThrows(n, "tmap:objcout", n); if (GetFlag(n, "feature:new")) Replaceall(tm, "\$owner", "true"); else @@ -753,6 +753,7 @@ } // Use typemaps to transform type used in Objective-C proxy function to type used in low level ocpp accessor if ((tm = Getattr(p, "tmap:objcin"))) { + addThrows(n, "tmap:objcin", p); substituteClassname(pt, tm); Replaceall(tm, "\$objcinput", arg); Printv(imcall, tm, NIL); @@ -782,6 +783,7 @@ // Transform return type used in low level accessor to type used in Objective-C proxy function if ((tm = Swig_typemap_lookup("objcout", n, "", 0))) { + addThrows(n, "tmap:objcout", n); if (GetFlag(n, "feature:new")) Replaceall(tm, "\$owner", "true"); else @@ -902,6 +904,7 @@ // Get typemap for this argument if ((tm = Getattr(p, "tmap:in"))) { + addThrows(n, "tmap:in", p); Replaceall(tm, "\$source", arg); /* deprecated */ Replaceall(tm, "\$target", ln); /* deprecated */ Replaceall(tm, "\$arg", arg); /* deprecated? */ @@ -920,6 +923,7 @@ /* Insert constraint checking code */ for (p = l; p;) { if ((tm = Getattr(p, "tmap:check"))) { + addThrows(n, "tmap:check", p); Replaceall(tm, "\$target", Getattr(p, "lname")); /* deprecated */ Replaceall(tm, "\$arg", Getattr(p, "emit:input")); /* deprecated? */ Replaceall(tm, "\$input", Getattr(p, "emit:input")); @@ -933,6 +937,7 @@ /* Insert cleanup code */ for (p = l; p;) { if ((tm = Getattr(p, "tmap:freearg"))) { + addThrows(n, "tmap:freearg", p); Replaceall(tm, "\$source", Getattr(p, "emit:input")); /* deprecated */ Replaceall(tm, "\$arg", Getattr(p, "emit:input")); /* deprecated? */ Replaceall(tm, "\$input", Getattr(p, "emit:input")); @@ -946,6 +951,7 @@ /* Insert argument output code */ for (p = l; p;) { if ((tm = Getattr(p, "tmap:argout"))) { + addThrows(n, "tmap:argout", p); Replaceall(tm, "\$source", Getattr(p, "emit:input")); /* deprecated */ Replaceall(tm, "\$target", Getattr(p, "lname")); /* deprecated */ Replaceall(tm, "\$arg", Getattr(p, "emit:input")); /* deprecated? */ @@ -958,12 +964,27 @@ } } + // Get any Objective-C exception classes in the throws typemap + ParmList *throw_parm_list = NULL; + if ((throw_parm_list = Getattr(n, "throws"))) { + Swig_typemap_attach_parms("throws", throw_parm_list, f); + for (p = throw_parm_list; p; p = nextSibling(p)) { + if ((tm = Getattr(p, "tmap:throws"))) { + addThrows(n, "tmap:throws", p); + } + } + } + // Now write code to make the low level function call if (!native_function_flag) { String *actioncode = emit_action(n); + + // Handle exception classes specified in the "except" feature's "throws" attribute + addThrows(n, "feature:except", n); // Return value if necessary if ((tm = Swig_typemap_lookup_out("out", n, "result", f, actioncode))) { + addThrows(n, "tmap:out", n); Replaceall(tm, "\$source", "result"); /* deprecated */ Replaceall(tm, "\$target", "oresult"); /* deprecated */ Replaceall(tm, "\$result", "oresult"); @@ -989,6 +1010,7 @@ /* Look to see if there is any newfree cleanup code */ if (GetFlag(n, "feature:new")) { if ((tm = Swig_typemap_lookup("newfree", n, "result", 0))) { + addThrows(n, "tmap:newfree", n); Replaceall(tm, "\$source", "result"); /* deprecated */ Printf(f->code, "%s\n", tm); } @@ -997,6 +1019,7 @@ /* See if there is any return cleanup code */ if (!native_function_flag) { if ((tm = Swig_typemap_lookup("ret", n, "result", 0))) { + addThrows(n, "tmap:ret", n); Replaceall(tm, "\$source", "result"); /* deprecated */ Printf(f->code, "%s\n", tm); } @@ -1021,6 +1044,11 @@ Wrapper_print(f, f_wrappers); } + if (!is_void_return) + Replaceall(f->code, "\$null", "0"); + else + Replaceall(f->code, "\$null", ""); + if (!(proxy_flag && is_wrapping_class()) && !enum_constant_flag) { Setattr(n, "ocppfuncname", wname); proxyGlobalFunctionHandler(n); @@ -1134,6 +1162,7 @@ // Use typemaps to transform type used in Objective-C wrapper function (in proxy class) to type used in intermediary code if ((tm = Getattr(p, "tmap:objcin"))) { + addThrows(n, "tmap:objcin", p); substituteClassname(pt, tm); Replaceall(tm, "\$objcinput", arg); Printv(imcall, tm, NIL); @@ -1342,46 +1371,37 @@ enum_code = NewString(""); String *symname = Getattr(n, "sym:name"); - String *constants_code = (proxy_flag && is_wrapping_class())? proxy_global_constants_code : proxy_global_constants_code; + String *constants_code = (proxy_flag && is_wrapping_class())? proxy_class_constants_code : proxy_global_constants_code; EnumFeature enum_feature = decodeEnumFeature(n); String *typemap_lookup_type = Getattr(n, "name"); if ((enum_feature != SimpleEnum) && symname && typemap_lookup_type) { - // Cop-paste the C/C++ enum as an Objective-C enum + // Copy-paste the C/C++ enum as an Objective-C enum Printf(enum_code, "enum %s {", symname); } else { // Wrap C++ enum with integers - just indicate start of enum with a comment, no comment for anonymous enums of any sort if (symname && !Getattr(n, "unnamedinstance")) - Printf(constants_code, " // %s \n", symname); + Printf(constants_code, "\n // %s \n", symname); } // Emit each enum item Language::enumDeclaration(n); - Replaceall(enum_code, "\$objcclassname", symname); - - // Substitute \$enumvalues - intended usage is for typesafe enums - if (Getattr(n, "enumvalues")) - Replaceall(enum_code, "\$enumvalues", Getattr(n, "enumvalues")); - else - Replaceall(enum_code, "\$enumvalues", ""); - - if ((enum_feature != SimpleEnum) && symname && typemap_lookup_type) { + Replaceall(enum_code, "\$objcclassname", symname); // Copy-paste the C/C++ enum as a proper Objective-C enum // Finish the enum declaration Printf(enum_code, "};\n\n"); } else { // Wrap C++ enum with simple constant Printf(enum_code, "\n"); - if (proxy_flag && is_wrapping_class()) { - Printv(proxy_global_constants_code, enum_code, NIL); // for now writing everything globally - } else { + } + if (proxy_flag && is_wrapping_class()) + Printv(proxy_class_constants_code, enum_code, NIL); + else Printv(proxy_global_constants_code, enum_code, NIL); - } - } - + Delete(enum_code); enum_code = NULL; } @@ -1409,13 +1429,14 @@ tmpValue = NewString(value); else tmpValue = NewString(name); + // Note that this is used in enumValue() amongst other places Setattr(n, "value", tmpValue); { EnumFeature enum_feature = decodeEnumFeature(parentNode(n)); + // The %objcconst feature determines how the constant value is obtained - int const_feature_flag = GetFlag(n, "feature:objc:const"); if ((enum_feature != SimpleEnum) && Getattr(parentNode(n), "sym:name") && !Getattr(parentNode(n), "unnamedinstance")) { @@ -1423,12 +1444,12 @@ // Emit the enum item. if (!Getattr(n, "_last")) // Only the first enum item has this attribute set Printf(enum_code, ",\n"); + Printf(enum_code, " %s", symname); // Check for the %objcconstvalue feature String *value = Getattr(n, "feature:objc:constvalue"); - - // Note that the enum value must be a true constant and cannot be set from a PINVOKE call, thus no support for %objcconst(0) + // Note that the enum value must be a true constant and cannot be set from an intermediatory call, thus no support for %objcconst(0) value = value ? value : Getattr(n, "enumvalue"); if (value) { Printf(enum_code, " = %s", value); @@ -1725,7 +1746,7 @@ if (*Char(destructor_call)) Replaceall(destruct, "\$imcall", destructor_call); else - Replaceall(destruct, "\$imcall", "throw new MethodAccessException(\"C++ destructor does not have public access\")"); + Replaceall(destruct, "\$imcall", "throw new UnsupportedOperationException(\"C++ destructor does not have public access\")"); if (*Char(destruct)) { Printv(proxy_class_decl, "- (void)", destruct_methodname, "();", "\n", NIL); Printv(proxy_class_def, "- (void)", destruct_methodname, "() ", destruct, "\n\n", NIL); @@ -1792,6 +1813,72 @@ return SWIG_OK; } + /* ----------------------------------------------------------------------------- + * addThrows() + * + * Adds exception classes to a throws list. The throws list is the list of classes + * that will form the Objective-C throws clause. Mainly for checked exceptions. + * ----------------------------------------------------------------------------- */ + + void addThrows(Node *n, const String *attribute, Node *parameter) { + // Get the comma separated exception classes for the throws clause - held in typemap/feature's "throws" attribute + String *throws_attribute = NewStringf("%s:throws", attribute); + String *throws = Getattr(parameter, throws_attribute); + + if (throws && Len(throws) > 0) { + String *throws_list = Getattr(n, "objc:throwslist"); + if (!throws_list) { + throws_list = NewList(); + Setattr(n, "objc:throwslist", throws_list); + } + // Put the exception classes in the throws clause into a temporary List + List *temp_classes_list = Split(throws, ',', INT_MAX); + + // Add the exception classes to the node throws list, but don't duplicate if already in list + if (temp_classes_list && Len(temp_classes_list) > 0) { + for (Iterator cls = First(temp_classes_list); cls.item; cls = Next(cls)) { + String *exception_class = NewString(cls.item); + Replaceall(exception_class, " ", ""); // remove spaces + Replaceall(exception_class, "\t", ""); // remove tabs + if (Len(exception_class) > 0) { + // \$objcclassname substitution + SwigType *pt = Getattr(parameter, "type"); + substituteClassname(pt, exception_class); + + // Don't duplicate the Objective-C exception class in the throws clause + bool found_flag = false; + for (Iterator item = First(throws_list); item.item; item = Next(item)) { + if (Strcmp(item.item, exception_class) == 0) + found_flag = true; + } + if (!found_flag) + Append(throws_list, exception_class); + } + Delete(exception_class); + } + } + Delete(temp_classes_list); + } + Delete(throws_attribute); + } + + /* ----------------------------------------------------------------------------- + * generateThrowsClause() + * + * Generates throws clause for checked exception + * ----------------------------------------------------------------------------- */ + + void generateThrowsClause(Node *n, String *code) { + // Add the throws clause into code + List *throws_list = Getattr(n, "objc:throwslist"); + if (throws_list) { + Iterator cls = First(throws_list); + Printf(code, " throws %s", cls.item); + while ((cls = Next(cls)).item) + Printf(code, ", %s", cls.item); + } + } + }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Swig-cvs] SF.net SVN: swig:[11560] branches/gsoc2009-ashishs99 From: - 2009-08-14 07:30:00 ```Revision: 11560 http://swig.svn.sourceforge.net/swig/?rev=11560&view=rev Author: ashishs99 Date: 2009-08-14 07:29:51 +0000 (Fri, 14 Aug 2009) Log Message: ----------- Changes for objc test-suite. Modified Paths: -------------- branches/gsoc2009-ashishs99/Examples/Makefile.in branches/gsoc2009-ashishs99/Makefile.in branches/gsoc2009-ashishs99/configure.in Modified: branches/gsoc2009-ashishs99/Examples/Makefile.in =================================================================== --- branches/gsoc2009-ashishs99/Examples/Makefile.in 2009-08-14 04:22:03 UTC (rev 11559) +++ branches/gsoc2009-ashishs99/Examples/Makefile.in 2009-08-14 07:29:51 UTC (rev 11560) @@ -986,6 +986,49 @@ rm -f *.@...@ *@CSHARPSO@ ################################################################## +##### OBJC ###### +################################################################## +OBJC_INCLUDE=@OBJCINC@ + +# Extra Objective-C specific dynamic linking options +OBJC_DLNK=@OBJCDYNAMICLINKING@ +OBJC_LIBPREFIX=@OBJCLIBRARYPREFIX@ +OBJCLDSHARED=@OBJCLDSHARED@ +OBJCCXXSHARED=@OBJCCXXSHARED@ +OBJCSO=@OBJCSO@ +OBJCCFLAGS=@OBJCCFLAGS@ +MMSRCS= *Wrapper.mm +IOBJS = *Wrapper.o + +# ---------------------------------------------------------------- +# Build an Objective-C dynamically loadable module (C) +# ---------------------------------------------------------------- + +objc: \$(SRCS) + \$(SWIG) -objc \$(SWIGOPT) \$(INTERFACEPATH) + \$(CC) -c \$(CCSHARED) \$(CFLAGS) \$(OBJCCFLAGS) \$(SRCS) \$(MMSRCS) \$(INCLUDES) \$(OBJC_INCLUDE) + \$(OBJCLDSHARED) \$(CFLAGS) \$(OBJS) \$(IOBJS) \$(OBJC_DLNK) \$(LIBS) -o \$(OBJC_LIBPREFIX)\$(TARGET)\$(OBJCSO) + +# ---------------------------------------------------------------- +# Build an Objective-C dynamically loadable module (C++) +# ---------------------------------------------------------------- + +objc_cpp: \$(SRCS) + \$(SWIG) -objc -c++ \$(SWIGOPT) \$(INTERFACEPATH) + \$(CXX) -c \$(CCSHARED) \$(CFLAGS) \$(OBJCCFLAGS) \$(SRCS) \$(MMSRCS) \$(INCLUDES) \$(OBJC_INCLUDE) + \$(OBJCCXXSHARED) \$(CFLAGS) \$(OBJS) \$(IOBJS) \$(OBJC_DLNK) \$(LIBS) \$(CPP_DLLIBS) -o \$(OBJC_LIBPREFIX)\$(TARGET)\$(OBJCSO) + +# ----------------------------------------------------------------- +# Cleaning the Objective-C examples +# ----------------------------------------------------------------- + +objc_clean: + rm -f *Wrapper* *~ .~* *.o `find . -name \*.m | grep -v runme.m` + rm -f core @EXTRA_CLEAN@ + rm -f *.@...@ *@OBJCSO@ + + +################################################################## ##### LUA ###### ################################################################## Modified: branches/gsoc2009-ashishs99/Makefile.in =================================================================== --- branches/gsoc2009-ashishs99/Makefile.in 2009-08-14 04:22:03 UTC (rev 11559) +++ branches/gsoc2009-ashishs99/Makefile.in 2009-08-14 07:29:51 UTC (rev 11560) @@ -63,6 +63,7 @@ skip-mzscheme = test -n "@SKIP_MZSCHEME@" skip-ruby = test -n "@SKIP_RUBY@" skip-php = test -n "@SKIP_PHP@" +skip-objc = test -n "@SKIP_OBJC@" skip-ocaml = test -n "@SKIP_OCAML@" skip-octave = test -n "@SKIP_OCTAVE@" skip-pike = test -n "@SKIP_PIKE@" @@ -101,6 +102,7 @@ @\$(skip-guile) || ./\$(TARGET) -guile -help @\$(skip-mzscheme) || ./\$(TARGET) -mzscheme -help @\$(skip-ruby) || ./\$(TARGET) -ruby -help + @\$(skip-objc) || ./\$(TARGET) -objc -help @\$(skip-ocaml) || ./\$(TARGET) -ocaml -help @\$(skip-octave) || ./\$(TARGET) -octave -help @\$(skip-php) || ./\$(TARGET) -php -help @@ -123,6 +125,7 @@ check-guile-examples \ check-mzscheme-examples \ check-ruby-examples \ + check-objc-examples \ check-ocaml-examples \ check-octave-examples \ check-php-examples \ @@ -144,6 +147,7 @@ guile_examples :=\$(shell sed '/^\#/d' \$(srcdir)/Examples/guile/check.list) mzscheme_examples :=\$(shell sed '/^\#/d' \$(srcdir)/Examples/mzscheme/check.list) ruby_examples :=\$(shell sed '/^\#/d' \$(srcdir)/Examples/ruby/check.list) +objc_examples :=\$(shell sed '/^\#/d' \$(srcdir)/Examples/objc/check.list) ocaml_examples :=\$(shell sed '/^\#/d' \$(srcdir)/Examples/ocaml/check.list) octave_examples :=\$(shell sed '/^\#/d' \$(srcdir)/Examples/octave/check.list) php_examples :=\$(shell sed '/^\#/d' \$(srcdir)/Examples/php/check.list) @@ -196,6 +200,7 @@ check-guile-gifplot \ check-mzscheme-gifplot \ check-ruby-gifplot \ +# check-objc-gifplot \ check-ocaml-gifplot \ check-octave-gifplot \ check-php-gifplot \ @@ -238,6 +243,7 @@ check-guile-test-suite \ check-mzscheme-test-suite \ check-ruby-test-suite \ + check-objc-test-suite \ check-ocaml-test-suite \ check-octave-test-suite \ check-php-test-suite \ @@ -289,6 +295,7 @@ all-guile-test-suite \ all-mzscheme-test-suite \ all-ruby-test-suite \ + all-objc-test-suite \ all-ocaml-test-suite \ all-octave-test-suite \ all-php-test-suite \ @@ -316,6 +323,7 @@ broken-guile-test-suite \ broken-mzscheme-test-suite \ broken-ruby-test-suite \ + broken-objc-test-suite \ broken-ocaml-test-suite \ broken-octave-test-suite \ broken-php-test-suite \ @@ -441,8 +449,8 @@ @echo "Installing \$(DESTDIR)\$(BIN_DIR)/`echo \$(TARGET_NOEXE) | sed '\$(transform)'`@EXEEXT@" @\$(INSTALL_PROGRAM) \$(TARGET) \$(DESTDIR)\$(BIN_DIR)/`echo \$(TARGET_NOEXE) | sed '\$(transform)'`@EXEEXT@ -lib-languages = gcj typemaps tcl perl5 python guile java mzscheme ruby php ocaml octave \ - pike chicken csharp objc modula3 allegrocl clisp lua cffi uffi r +lib-languages = gcj typemaps tcl perl5 python guile java mzscheme ruby php objc ocaml octave \ + pike chicken csharp modula3 allegrocl clisp lua cffi uffi r lib-modules = std Modified: branches/gsoc2009-ashishs99/configure.in =================================================================== --- branches/gsoc2009-ashishs99/configure.in 2009-08-14 04:22:03 UTC (rev 11559) +++ branches/gsoc2009-ashishs99/configure.in 2009-08-14 07:29:51 UTC (rev 11560) @@ -916,6 +916,121 @@ AC_SUBST(OCTAVECCFLAGS) #---------------------------------------------------------------- +# Look for Objective-C +#---------------------------------------------------------------- + +AC_ARG_WITH(objc, AS_HELP_STRING([--without-objc], [Disable OBJC]), [with_objc="\$withval"], [with_objc=yes]) +AC_ARG_WITH(objc-compiler, [ --with-objc-compiler=path Set location of OBJC compiler],[OBJCBIN="\$withval"], [OBJCBIN=]) + +# First, check for "--without-objc" or "--with-objc=no". +if test x"\${with_objc}" = xno -o x"\${with_alllang}" = xno ; then +AC_MSG_NOTICE([Disabling OBJC]) +OBJC= +else + +if test -z "\$OBJCBIN" ; then + case \$host in + *-*-darwin*) + AC_CHECK_PROGS(OBJC, gcc);; + *-*-cygwin* | *-*-mingw* | *-*-linux*) + AC_CHECK_PROGS(OBJC, gcc) + if test -n "\$OBJC" && test "\$OBJC" = "gcc" ; then + AC_MSG_CHECKING(whether gcc is the Apple gcc compiler) + gcc 2>/dev/null | grep "Apple" > /dev/null || OBJC ="" + if test -z "\$OBJC" ; then + AC_MSG_RESULT(no) + AC_CHECK_PROGS(OBJC, gcc) + else + AC_MSG_RESULT(yes) + fi + fi + ;; + *);; + esac +else + OBJC="\$OBJCBIN" +fi + +OBJCPP = '\$OBJC' + +# the following looks for COCOA or GNUStep framework. TODO: have to be proper +if test "\${opsys}" = darwin; then + COCOA=yes +elif test -f /etc/GNUstep/GNUstep.conf; then + GNUSTEP=yes + GNUSTEP_SYSTEM_HEADERS="\$(source /etc/GNUstep/GNUstep.conf; echo \$GNUSTEP_SYSTEM_HEADERS)" + GNUSTEP_SYSTEM_LIBRARIES="\$(source /etc/GNUstep/GNUstep.conf; echo \$GNUSTEP_SYSTEM_LIBRARIES)" + CPPFLAGS="\$CPPFLAGS -I\${GNUSTEP_SYSTEM_HEADERS}" + CFLAGS="\$CFLAGS -I\${GNUSTEP_SYSTEM_HEADERS}" + REAL_CFLAGS="\$REAL_CFLAGS -I\${GNUSTEP_SYSTEM_HEADERS}" + LDFLAGS="\$LDFLAGS -L\${GNUSTEP_SYSTEM_LIBRARIES}" +fi + + +AC_MSG_CHECKING(for objc include file NSObject.h) +AC_ARG_WITH(objcincl, [ --with-objcincl=path Set location of Objective-C include directory], [OBJCINCDIR="\$withval"], [OBJCINCDIR=]) + +if test -z "\$OBJCINCDIR"; then + OBJCINCDIR= + + # Add in default directory for Objective-C headers on Windows for Cygwin, Linux and MacOSX + case \$host in + *-*-cygwin* | *-*-mingw* | *_*_linux*) OBJCINCDIR="\$OBJCINCDIR";; + *-*-darwin*) OBJCINCDIR="\$OBJCINCDIR";; + *);; + esac +fi + +for d in \$OBJCINCDIR ; do + if test -r "\$d/NSObject.h" ; then + AC_MSG_RESULT(\$d) + OBJCINCDIR =\$d + OBJCINC=-I\"\$d\" + break + fi +done + +if test "\$OBJCINC" = "" ; then + AC_MSG_RESULT(not found) +fi + +case \$host in +*-*-darwin*) + OBJCDYNAMICLINKING="-dynamiclib" + OBJCCFLAGS="" + ;; +*) + OBJCDYNAMICLINKING="" + OBJCCFLAGS="" + ;; +esac + +case \$host in +*-*-darwin*) + OBJCSO=\$SO + OBJCLDSHARED='\$(CC)' + OBJCCXXSHARED='\$(CXX)' + ;; +*) + OBJCSO=\$SO + OBJCLDSHARED='\$(LDSHARED)' + OBJCCXXSHARED='\$(CXXSHARED)' + ;; +esac + +fi + +AC_SUBST(OBJC) +AC_SUBST(OBJCPP) +AC_SUBST(OBJCINC) +AC_SUBST(OBJCDYNAMICLINKING) +AC_SUBST(OBJCLIBRARYPREFIX) +AC_SUBST(OBJCSO) +AC_SUBST(OBJCLDSHARED) +AC_SUBST(OBJCCXXSHARED) +AC_SUBST(OBJCCFLAGS) + +#---------------------------------------------------------------- # Look for java #---------------------------------------------------------------- @@ -2032,6 +2147,11 @@ fi AC_SUBST(SKIP_PHP) +SKIP_OBJC= +if test -z "\$OBJC"; then + SKIP_OBJC="1" +fi +AC_SUBST(SKIP_OBJC) SKIP_OCAML= if test -z "\$OCAMLBIN" || test -z "\$OCAMLINC" ; then @@ -2169,6 +2289,7 @@ Examples/test-suite/guile/Makefile \ Examples/test-suite/guilescm/Makefile \ Examples/test-suite/java/Makefile \ + Examples/test-suite/objc/Makefile \ Examples/test-suite/mzscheme/Makefile \ Examples/test-suite/ocaml/Makefile \ Examples/test-suite/octave/Makefile \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Swig-cvs] SF.net SVN: swig:[11612] branches/gsoc2009-ashishs99 From: - 2009-08-17 07:49:45 ```Revision: 11612 http://swig.svn.sourceforge.net/swig/?rev=11612&view=rev Author: ashishs99 Date: 2009-08-17 07:49:35 +0000 (Mon, 17 Aug 2009) Log Message: ----------- Some fixes. Modified Paths: -------------- branches/gsoc2009-ashishs99/Examples/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/objc/Makefile branches/gsoc2009-ashishs99/Examples/test-suite/objc/Makefile.in branches/gsoc2009-ashishs99/configure.in Modified: branches/gsoc2009-ashishs99/Examples/Makefile.in =================================================================== --- branches/gsoc2009-ashishs99/Examples/Makefile.in 2009-08-17 05:24:17 UTC (rev 11611) +++ branches/gsoc2009-ashishs99/Examples/Makefile.in 2009-08-17 07:49:35 UTC (rev 11612) @@ -988,17 +988,17 @@ ################################################################## ##### OBJC ###### ################################################################## -OBJC_INCLUDE=@OBJCINC@ - -# Extra Objective-C specific dynamic linking options +OBJC=@OBJC@ +OBJCPP=@OBJCPP@ +OBJCINC=@OBJCINC@ OBJC_DLNK=@OBJCDYNAMICLINKING@ -OBJC_LIBPREFIX=@OBJCLIBRARYPREFIX@ +OBJC_LIBPREFIX = @OBJCLIBRARYPREFIX@ +OBJCCFLAGS=@OBJCCFLAGS@ +OBJCSO=@OBJCSO@ OBJCLDSHARED=@OBJCLDSHARED@ OBJCCXXSHARED=@OBJCCXXSHARED@ -OBJCSO=@OBJCSO@ -OBJCCFLAGS=@OBJCCFLAGS@ -MMSRCS= *Wrapper.mm -IOBJS = *Wrapper.o +OBJCPPOBJS=*Wrapper.o +OBJCPPSRCS=*.mm # ---------------------------------------------------------------- # Build an Objective-C dynamically loadable module (C) @@ -1006,8 +1006,8 @@ objc: \$(SRCS) \$(SWIG) -objc \$(SWIGOPT) \$(INTERFACEPATH) - \$(CC) -c \$(CCSHARED) \$(CFLAGS) \$(OBJCCFLAGS) \$(SRCS) \$(MMSRCS) \$(INCLUDES) \$(OBJC_INCLUDE) - \$(OBJCLDSHARED) \$(CFLAGS) \$(OBJS) \$(IOBJS) \$(OBJC_DLNK) \$(LIBS) -o \$(OBJC_LIBPREFIX)\$(TARGET)\$(OBJCSO) + \$(CC) -c \$(CCSHARED) \$(CFLAGS) \$(OBJCCFLAGS) \$(SRCS) \$(OBJCPPSRCS) \$(OBJCINC) + \$(OBJCLDSHARED) \$(CFLAGS) \$(OBJS) \$(OBJCPPOBJS) \$(OBJC_DLNK) \$(LIBS) -o \$(OBJC_LIBPREFIX)\$(TARGET)\$(OBJCSO) # ---------------------------------------------------------------- # Build an Objective-C dynamically loadable module (C++) @@ -1015,9 +1015,19 @@ objc_cpp: \$(SRCS) \$(SWIG) -objc -c++ \$(SWIGOPT) \$(INTERFACEPATH) - \$(CXX) -c \$(CCSHARED) \$(CFLAGS) \$(OBJCCFLAGS) \$(SRCS) \$(MMSRCS) \$(INCLUDES) \$(OBJC_INCLUDE) - \$(OBJCCXXSHARED) \$(CFLAGS) \$(OBJS) \$(IOBJS) \$(OBJC_DLNK) \$(LIBS) \$(CPP_DLLIBS) -o \$(OBJC_LIBPREFIX)\$(TARGET)\$(OBJCSO) + \$(CXX) -c \$(CCSHARED) \$(CFLAGS) \$(OBJCCFLAGS) \$(SRCS) \$(CXXSRCS) \$(OBJCPPSRCS) \$(OBJCINC) + \$(OBJCCXXSHARED) \$(CFLAGS) \$(OBJS) \$(OBJCPPOBJS) \$(OBJC_DLNK) \$(LIBS) \$(CPP_DLLIBS) -o \$(OBJC_LIBPREFIX)\$(TARGET)\$(OBJCSO) +# ---------------------------------------------------------------- +# Compile Objective-C(++) files +# ---------------------------------------------------------------- + +objc_compile: \$(SRCS) + \$(COMPILETOOL) \$(OBJC) \$(OBJCFLAGS) \$(OBJC_LIBPREFIX)\$(TARGET)\$(OBJCSO) \$(OBJCSRCS) \$(OBJCINC) + +objcpp_compile: \$(SRCS) + \$(COMPILETOOL) \$(OBJCPP) \$(OBJCPPFLAGS) \$(OBJC_LIBPREFIX)\$(TARGET)\$(OBJCSO) \$(OBJCPPSRCS) \$(OBJCINC) + # ----------------------------------------------------------------- # Cleaning the Objective-C examples # ----------------------------------------------------------------- Modified: branches/gsoc2009-ashishs99/Examples/test-suite/objc/Makefile =================================================================== --- branches/gsoc2009-ashishs99/Examples/test-suite/objc/Makefile 2009-08-17 05:24:17 UTC (rev 11611) +++ branches/gsoc2009-ashishs99/Examples/test-suite/objc/Makefile 2009-08-17 07:49:35 UTC (rev 11612) @@ -48,9 +48,22 @@ # Compiles Objective-C files then runs the testcase. A testcase is only run if # a file is found which has _runme.m appended after the testcase name. -run_testcase = +run_testcase = \ + if [ -f \$(srcdir)/\$(SCRIPTPREFIX)\$*\$(SCRIPTSUFFIX) ]; then ( \ + \$(MAKE) -f \$*/\$(top_builddir)/\$(EXAMPLES)/Makefile \ + TARGET=\$* \ + OBJCFLAGS='-L. -framework Foundation -o \$*_runme' \ + OBJCSRCS='`\$(srcdir)/\$(SCRIPTPREFIX)\$*\$(SCRIPTSUFFIX)` \ + \$*/*.m' objc_compile && \ + \$(RUNTOOL)\$*_runme; ) \ + else ( \ + cd \$* && \ + \$(MAKE) -f \$(top_builddir)/\$(EXAMPLES)/Makefile \ + TARGET=\$* \ + OBJCFLAGS='-dynamiclib -L. -framework Foundation' \ + OBJCSRCS='*.m' objc_compile; ); \ + fi; - # Clean: remove testcase directories %.clean: @if [ -d \$* ]; then \ Modified: branches/gsoc2009-ashishs99/Examples/test-suite/objc/Makefile.in =================================================================== --- branches/gsoc2009-ashishs99/Examples/test-suite/objc/Makefile.in 2009-08-17 05:24:17 UTC (rev 11611) +++ branches/gsoc2009-ashishs99/Examples/test-suite/objc/Makefile.in 2009-08-17 07:49:35 UTC (rev 11612) @@ -48,9 +48,22 @@ # Compiles Objective-C files then runs the testcase. A testcase is only run if # a file is found which has _runme.m appended after the testcase name. -run_testcase = +run_testcase = \ + if [ -f \$(srcdir)/\$(SCRIPTPREFIX)\$*\$(SCRIPTSUFFIX) ]; then ( \ + \$(MAKE) -f \$*/\$(top_builddir)/\$(EXAMPLES)/Makefile \ + TARGET=\$* \ + OBJCFLAGS='-L. -framework Foundation -o \$*_runme' \ + OBJCSRCS='`\$(srcdir)/\$(SCRIPTPREFIX)\$*\$(SCRIPTSUFFIX)` \ + \$*/*.m' objc_compile && \ + \$(RUNTOOL)\$*_runme; ) \ + else ( \ + cd \$* && \ + \$(MAKE) -f \$(top_builddir)/\$(EXAMPLES)/Makefile \ + TARGET=\$* \ + OBJCFLAGS='-dynamiclib -L. -framework Foundation' \ + OBJCSRCS='*.m' objc_compile; ); \ + fi; - # Clean: remove testcase directories %.clean: @if [ -d \$* ]; then \ Modified: branches/gsoc2009-ashishs99/configure.in =================================================================== --- branches/gsoc2009-ashishs99/configure.in 2009-08-17 05:24:17 UTC (rev 11611) +++ branches/gsoc2009-ashishs99/configure.in 2009-08-17 07:49:35 UTC (rev 11612) @@ -3,7 +3,7 @@ dnl Tools/config directory in .m4 files. AC_INIT([swig],[1.3.40],[http://www.swig.org]) -AC_PREREQ(2.58) +AC_PREREQ(2.60) AC_CONFIG_SRCDIR([Source/Swig/swig.h]) AC_CONFIG_AUX_DIR([Tools/config]) AC_CONFIG_HEADERS([Source/Include/swigconfig.h]) @@ -920,57 +920,42 @@ #---------------------------------------------------------------- AC_ARG_WITH(objc, AS_HELP_STRING([--without-objc], [Disable OBJC]), [with_objc="\$withval"], [with_objc=yes]) -AC_ARG_WITH(objc-compiler, [ --with-objc-compiler=path Set location of Objective-C compiler],[OBJCCOMPILER="\$withval"], [OBJCCOMPILER=]) +AC_ARG_WITH(objc-compiler, [ --with-objc-compiler=path Set location of Objective-C compiler],[OBJC="\$withval"], [OBJC=]) # First, check for "--without-objc" or "--with-objc=no". if test x"\${with_objc}" = xno -o x"\${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling Objective-C]) -OBJCCOMPILER= +OBJC= +OBJCPP= else -if test -z "\$OBJCCOMPILER" ; then - case \$host in - *-*-darwin*) - AC_CHECK_PROGS(OBJCCOMPILER, gcc);; - *-*-cygwin* | *-*-mingw*);; - *-*-linux*) - AC_CHECK_PROGS(OBJCCOMPILER, gcc) - if test -n "\$OBJCCOMPILER" && test "\$OBJCCOMPILER" = "gcc" ; then - AC_MSG_CHECKING(whether gcc is the Apple gcc compiler) - gcc 2>/dev/null | grep "Apple" > /dev/null || OBJCCOMPILER ="" - if test -z "\$OBJCCOMPILER" ; then - AC_MSG_RESULT(no) - AC_CHECK_PROGS(OBJCCOMPILER, gcc) - else - AC_MSG_RESULT(yes) - fi - fi - ;; - *);; - esac -else - OBJCCOMPILER="\$OBJCCOMPILER" +# set Objective-C compiler +if test -z "\$OBJC" ; then + AC_MSG_CHECKING(Objective-C(++) compiler) + AC_PROG_OBJC() + AC_PROG_OBJCPP() fi -AC_MSG_CHECKING(for include file Foundation.h) +# check for include files +AC_MSG_CHECKING(for include file Foundation/Foundation.h) AC_ARG_WITH(objcincl, [ --with-objcincl=path Set location of Objective-C include directory], [OBJCINCDIR="\$withval"], [OBJCINCDIR=]) if test -z "\$OBJCINCDIR"; then - OBJCINCDIR="/usr/include /usr/local/include" + OBJCINCDIR="/usr/include/ /usr/local/include/" # Add in default directory for Objective-C headers on Windows for Cygwin(TODO for now), Linux and MacOSX case \$host in *-*-cygwin* | *-*-mingw*) OBJCINCDIR="\$OBJCINCDIR";; - *_*_linux*) OBJCINCDIR="usr/lib/GNUstep/System/Library/Headers \$OBJCINCDIR";; + *-*-linux*) OBJCINCDIR="usr/lib/GNUstep/System/Library/Headers \$OBJCINCDIR";; *-*-darwin*) OBJCINCDIR="/System/Library/Frameworks/Foundation.framework/Headers \$OBJCINCDIR";; *);; esac fi for d in \$OBJCINCDIR ; do - if test -r "\$d/Foundation.h" ; then + if test -r "\$d/Foundation/Foundation.h" ; then AC_MSG_RESULT(\$d) - OBJCINCDIR =\$d + OBJCINCDIR=\$d OBJCINC=-I\"\$d\" break fi @@ -980,16 +965,18 @@ AC_MSG_RESULT(not found) fi + +# check for objc and/or GNUStep libraries AC_ARG_WITH(objclib,[ --with-objclib =path Set location of Objective-C library directory],[ OBJCLIB="-L\$withval"], [OBJCLIB=]) AC_MSG_CHECKING(for Objective-C library) if test -z "\$OBJCLIB"; then -dirs="/usr/lib/GNUstep/System/Library/Libraries/ /usr/lib" +dirs="/usr/lib/GNUstep/System/Library/Libraries/ /usr/lib/" for i in \$dirs ; do if test -r \$i/libobjc.a; then AC_MSG_RESULT(\$i) - OBJCLIB ="-L\$i -lobjc" + OBJCLIB="-L\$i -lobjc" break fi done @@ -1000,7 +987,7 @@ for i in \$dirs ; do if test -r \$i/libgnu-step-base.a; then AC_MSG_RESULT(\$i) - OBJCLIB ="-L\$i -lgnustep-base \$OBJCLIB" + OBJCLIB="-L\$i -lgnustep-base \$OBJCLIB" break fi done @@ -1011,13 +998,14 @@ fi +# linking options case \$host in *-*-darwin*) OBJCDYNAMICLINKING="-dynamiclib -framework Foundation" OBJCCFLAGS="" ;; *-*-linux*) - OBJCDYNAMICLINKING="" + OBJCDYNAMICLINKING="\$OBJCLIB" OBJCCFLAGS="" ;; *) @@ -1026,9 +1014,17 @@ ;; esac +# OBJCLIBRARYPREFIX case \$host in +*-*-cygwin* | *-*-mingw*) OBJCLIBRARYPREFIX="";; +*) OBJCLIBRARYPREFIX="lib";; +esac + + +# library output +case \$host in *-*-darwin*) - OBJCSO=\$SO + OBJCSO=".dylib" OBJCLDSHARED='\$(CC)' OBJCCXXSHARED='\$(CXX)' ;; @@ -1041,14 +1037,15 @@ fi -AC_SUBST(OBJCCOMPILER) +AC_SUBST(OBJC) +AC_SUBST(OBJCPP) AC_SUBST(OBJCINC) AC_SUBST(OBJCDYNAMICLINKING) AC_SUBST(OBJCLIBRARYPREFIX) +AC_SUBST(OBJCCFLAGS) AC_SUBST(OBJCSO) AC_SUBST(OBJCLDSHARED) AC_SUBST(OBJCCXXSHARED) -AC_SUBST(OBJCCFLAGS) #---------------------------------------------------------------- # Look for java @@ -2168,7 +2165,7 @@ AC_SUBST(SKIP_PHP) SKIP_OBJC= -if test -z "\$OBJCCOMPILER"; then +if test -z "\$OBJC"; then SKIP_OBJC="1" fi AC_SUBST(SKIP_OBJC) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Swig-cvs] SF.net SVN: swig:[11664] branches/gsoc2009-ashishs99 From: - 2009-08-22 08:52:54 ```Revision: 11664 http://swig.svn.sourceforge.net/swig/?rev=11664&view=rev Author: ashishs99 Date: 2009-08-22 08:52:45 +0000 (Sat, 22 Aug 2009) Log Message: ----------- Few fixes. Modified Paths: -------------- branches/gsoc2009-ashishs99/Lib/objc/objc.swg branches/gsoc2009-ashishs99/Source/Modules/objc.cxx Modified: branches/gsoc2009-ashishs99/Lib/objc/objc.swg =================================================================== --- branches/gsoc2009-ashishs99/Lib/objc/objc.swg 2009-08-21 00:25:11 UTC (rev 11663) +++ branches/gsoc2009-ashishs99/Lib/objc/objc.swg 2009-08-22 08:52:45 UTC (rev 11664) @@ -58,9 +58,26 @@ %typemap(in) bool %{ \$1 = \$input ? true : false; %} + // Pointer, references and arrays -%typemap(in) char *, char *& -%{ \$1 = [\$input cStringUsingEncoding: [NSString defaultCStringEncoding]]; %} +%typemap(in, noblock=1) char * { + \$1 = 0; + if (\$input) { + \$1 = [\$input cStringUsingEncoding: [NSString defaultCStringEncoding]]; + if (!\$1) return \$null; + } +} + +%typemap(in, noblock=1) char *& (\$*1_ltype temp = 0) { + \$1 = 0; + if (\$input) { + temp = (\$*1_ltype)[\$input cStringUsingEncoding: [NSString defaultCStringEncoding]];; + if (!temp) return \$null; + } + \$1 = &temp; +} + + %typemap(in) char[ANY] %{ \$1 = [\$input cStringUsingEncoding: [NSString defaultCStringEncoding]]; %} %typemap(in) char[] @@ -75,7 +92,51 @@ %typemap(in) SWIGTYPE %{ \$1 = (\$1_ltype)\$input; %} //TBD +%typemap(in) const bool & (\$*1_ltype temp) +%{ temp = \$input ? true : false; + \$1 = &temp; %} +%typemap(in) const char & (\$*1_ltype temp), + const signed char & (\$*1_ltype temp), + const unsigned char & (\$*1_ltype temp), + const short & (\$*1_ltype temp), + const unsigned short & (\$*1_ltype temp), + const int & (\$*1_ltype temp), + const unsigned int & (\$*1_ltype temp), + const long & (\$*1_ltype temp), + const unsigned long & (\$*1_ltype temp), + const long long & (\$*1_ltype temp), + const float & (\$*1_ltype temp), + const double & (\$*1_ltype temp) +%{ temp = (\$*1_ltype)\$input; + \$1 = &temp; %} + + +/* Default handling. Object passed by value. Convert to a pointer */ +%typemap(in) SWIGTYPE (\$&1_type argp) +%{ argp = *(\$&1_ltype*)&\$input; + if (!argp) { + [NSException raise:@"Attempt to dereference null \$1_type"]; + return \$null; + } + \$1 = *argp; %} + +%typemap(in) SWIGTYPE *, SWIGTYPE (CLASS::*) %{ \$1 = *(\$&1_ltype)&\$input; %} +%typemap(in) SWIGTYPE & %{ \$1 = *(\$&1_ltype)&\$input; + if (!\$1) { + [NSException raise:@"\$1_type reference is null"]; + return \$null; + } %} +%typemap(in) SWIGTYPE *& (\$*1_ltype temp = 0) +%{ temp = *(\$1_ltype)&\$input; + \$1 = &temp; %} + + +/* Default array handling */ +%typemap(in) SWIGTYPE [] %{ \$1 = *(\$&1_ltype)&\$input; %} + + + /* Following are the "out" typemaps for C to Objective-C conversions */ // Primitive types %typemap(out) bool @@ -94,18 +155,41 @@ float, double %{ \$result = \$1; %} -%typemap(out, null="") void "" +%typemap(out) void "" // Pointers, references and arrays -%typemap(out) char * %{ \$result = [NSString stringWithCString: \$1]; %} //TBD -%typemap(out) SWIGTYPE * %{ \$result = (void *)\$1; %} -%typemap(out) SWIGTYPE & %{ \$result = (void *)\$1; %} +%typemap(out, noblock=1) char * %{ if (\$1) \$result = [NSString stringWithCString: \$1]; %} //TBD +%typemap(out, noblock=1) char *& %{ if (*\$1) \$result = [NSString stringWithCString: *\$1]; %} +%typemap(out, noblock=1) char[ANY], char[] %{ if (\$1) \$result = [NSString stringWithCString: \$1]; %} + + + %typemap(out) SWIGTYPE [] %{ \$result = (void *)\$1; %} -%typemap(out) SWIGTYPE %{ \$result = (void *)\$1; %} +%typemap(out) SWIGTYPE +#ifdef __cplusplus +%{ *(\$&1_ltype*)&\$result = new \$1_ltype((const \$1_ltype &)\$1); %} +#else +{ + \$&1_ltype \$1ptr = (\$&1_ltype) malloc(sizeof(\$1_ltype)); + memmove(\$1ptr, &\$1, sizeof(\$1_type)); + *(\$&1_ltype*)&\$result = \$1ptr; +} +#endif +%typemap(out) SWIGTYPE *, SWIGTYPE (CLASS::*) +%{ *(\$&1_ltype)&\$result = \$1; %} +%typemap(out) SWIGTYPE & +%{ *(\$&1_ltype)&\$result = \$1; %} +%typemap(out) SWIGTYPE [] %{ *(\$&1_ltype)&\$result = \$1; %} + +%typemap(out) SWIGTYPE *& +%{ *(\$1_ltype)&\$result = *\$1; %} + + + /* Following are the objctype typemaps which contain the Objective-C types used in the proxy code */ // Primitive types %typemap(objctype) bool, const bool & "BOOL" Modified: branches/gsoc2009-ashishs99/Source/Modules/objc.cxx =================================================================== --- branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2009-08-21 00:25:11 UTC (rev 11663) +++ branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2009-08-22 08:52:45 UTC (rev 11664) @@ -169,7 +169,7 @@ } emitBanner(f_proxy_h); - Printf(f_proxy_h, "\n#import \n"); + Printf(f_proxy_h, "\n#import \n\n"); Printf(f_proxy_m, "#include \"%s\"\n\n", file_h); Printf(f_proxy_m, "#include \"%s\"\n\n", proxy_h); Printv(f_proxy_h, proxy_global_constants_code, proxy_h_code, NIL); @@ -216,12 +216,12 @@ Printf(f_ocpp_h, "}\n"); Printf(f_ocpp_h, "#endif\n"); - - // Output a Objective-C type wrapper class for each SWIG type - for (Iterator swig_type = First(swig_types_hash); swig_type.key; swig_type = Next(swig_type)) { - emitTypeWrapperClass(swig_type.key, swig_type.item); - } - + + // Output a Objective-C type wrapper class for each SWIG type + for (Iterator swig_type = First(swig_types_hash); swig_type.key; swig_type = Next(swig_type)) { + emitTypeWrapperClass(swig_type.key, swig_type.item); + } + Dump(f_header, f_runtime); Dump(f_wrappers, f_runtime); Wrapper_pretty_print(f_init, f_runtime); @@ -281,84 +281,7 @@ return SWIG_OK; } - /* ----------------------------------------------------------------------------- - * getEnumName() - * ----------------------------------------------------------------------------- */ - String *getEnumName(SwigType *t) { - Node *enum_name = NULL; - Node *n = enumLookup(t); - if (n) { - String *symname = Getattr(n, "sym:name"); - if (symname) { - enum_name = NewStringf("%s", symname); - } - } - - return enum_name; - } - - /*---------------------------------------------------------------------- - * decodeEnumFeature() - * Decode the possible enum features, which are one of: - * %objcenum(simple) - * %objcenum(proper) - *--------------------------------------------------------------------*/ - - EnumFeature decodeEnumFeature(Node *n) { - EnumFeature enum_feature = SimpleEnum; - String *feature = Getattr(n, "feature:objc:enum"); - if (feature) { - if (Cmp(feature, "simple") == 0) - enum_feature = SimpleEnum; - else if (Cmp(feature, "proper") == 0) - enum_feature = ProperEnum; - } - return enum_feature; - } - - - /* ----------------------------------------------------------------------- - * enumValue() - * This method will return a string with an enum value to use in Objective-C generated - * code. If the %objcconst feature is not used, the string will contain the intermediary - * method call to obtain the enum value. The intermediary methods to obtain - * the enum value will be generated. Otherwise the C/C++ enum value will be used if there - * is one and hopefully it will compile as Objective-C code - e.g. 20 as in: enum E{e=20}; - * The %objcconstvalue feature overrides all other ways to generate the constant value. - * The caller must delete memory allocated for the returned string. - * ------------------------------------------------------------------------ */ - - String *enumValue(Node *n) { - String *symname = Getattr(n, "sym:name"); - - // Check for the %objcconstvalue feature - String *value = Getattr(n, "feature:objc:constvalue"); - - if (!value) { - // The %objcconst feature determines how the constant value is obtained - int const_feature_flag = GetFlag(n, "feature:objc:const"); - - if (const_feature_flag) { - // Use the C syntax to make a true Objective-C constant and hope that it compiles as Objective-C code - value = Getattr(n, "enumvalue") ? Copy(Getattr(n, "enumvalue")) : Copy(Getattr(n, "enumvalueex")); - } else { - // Get the enumvalue from a PINVOKE call - if (!getCurrentClass() || !cparse_cplusplus || !proxy_flag) { - // Strange hack to change the name - Setattr(n, "name", Getattr(n, "value")); /* for wrapping of enums in a namespace when emit_action is used */ - constantWrapper(n); - value = NewStringf("%s()", Swig_name_get(symname)); - } else { - memberconstantHandler(n); - value = NewStringf("%s()", Swig_name_get(Swig_name_member(proxy_class_name, symname))); - } - } - } - return value; - } - - /* ----------------------------------------------------------------------------- * substituteClassname() * @@ -517,7 +440,6 @@ String *objctypeout = Getattr(n, "tmap:objctype:out"); // the type in the objctype typemap's out attribute overrides the type in the typemap if (objctypeout) tm = objctypeout; - substituteClassname(t, tm); Printf(return_type, "%s", tm); } else { Swig_warning(WARN_NONE, input_file, line_number, "No objctype typemap defined for %s\n", SwigType_str(t, 0)); @@ -539,27 +461,15 @@ } /* Start generating the proxy function */ - const String *outattributes = Getattr(n, "tmap:objctype:outattributes"); - if (outattributes) - Printf(function_decl, " %s\n", outattributes); - const String *objcattributes = Getattr(n, "feature:objc:attributes"); - if (objcattributes) - Printf(function_decl, " %s\n", objcattributes); - - if (static_flag) - Printf(function_decl, "static "); - Printf(function_decl, "%s %s(", return_type, func_name); - Printv(imcall, "\$ocppfuncname(", NIL); emit_mark_varargs(l); - int gencomma = !static_flag; + int gencomma = 1; - /* Output each parameter */ + /* Output each parameter, this essentially completes the function name for objective-c function */ for (i = 0, p = l; p; i++) { - /* Ignored varargs */ if (checkAttribute(p, "varargs:ignore", "1")) { p = nextSibling(p); @@ -581,15 +491,19 @@ /* Get the Objective-C parameter type */ if ((tm = Getattr(p, "tmap:objctype"))) { - substituteClassname(t, tm); + substituteClassname(pt, tm); const String *inattributes = Getattr(p, "tmap:objctype:inattributes"); Printf(param_type, "%s%s", inattributes ? inattributes : empty_string, tm); } else { Swig_warning(WARN_NONE, input_file, line_number, "No objctype typemap defined for %s\n", SwigType_str(pt, 0)); } - String *arg = makeParameterName(n, p, i, true); + String *arg = makeParameterName(n, p, i, setter_flag); + if (gencomma > 1) { + Printf(imcall, ", "); + } + // Use typemaps to transform type used in Objective-C proxy function to the one used in intermediate code. if ((tm = Getattr(p, "tmap:objcin"))) { addThrows(n, "tmap:objcin", p); @@ -646,7 +560,7 @@ * proxyClassFunctionHandler() * * Function called for creating an Objective-C proxy function around a c++ function - * Used for static and non-static C++ class function and C global functions. + * Used for static and non-static C++ class functions. * C++ class static functions map to Objective-C "+" functions. * C++ class non-static functions map to Objective-C "-" functions. * ----------------------------------------------------------------------------- */ @@ -687,10 +601,14 @@ /* Get return types */ if ((tm = Swig_typemap_lookup("objctype", n, "", 0))) { - String *objctypeout = Getattr(n, "tmap:objctype:out"); // the type in the objctype typemap's out attribute overrides the type in the typemap - if (objctypeout) - tm = objctypeout; + // Note that in the case of polymorphic (covariant) return types, the method's return type is changed to be the base of the C++ return type + SwigType *covariant = Getattr(n, "covariant"); + substituteClassname(covariant ? covariant : t, tm); Printf(return_type, "%s", tm); + if (covariant) + Swig_warning(WARN_NONE, input_file, line_number, + "Covariant return types not supported in Objective-C. Proxy method will return %s.\n", SwigType_str(covariant, 0)); + } else { Swig_warning(WARN_NONE, input_file, line_number, "No objctype typemap defined for %s\n", SwigType_str(t, 0)); } @@ -717,9 +635,24 @@ Printv(imcall, "\$ocppfuncname(", NIL); - if (!static_flag) + if (!static_flag) { Printf(imcall, "swigCPtr"); + String *this_type = Copy(getClassType()); + String *name = NewString("self"); + String *qualifier = Getattr(n, "qualifier"); + if (qualifier) + SwigType_push(this_type, qualifier); + SwigType_add_pointer(this_type); + Parm *this_parm = NewParm(this_type, name); + Swig_typemap_attach_parms("ocpptype", this_parm, NULL); + Swig_typemap_attach_parms("objctype", this_parm, NULL); + Delete(this_parm); + Delete(name); + Delete(this_type); + + } + emit_mark_varargs(l); int gencomma = !static_flag; @@ -1364,10 +1297,88 @@ return SWIG_OK; } + /* ----------------------------------------------------------------------------- + * getEnumName() + * ----------------------------------------------------------------------------- */ + + String *getEnumName(SwigType *t) { + Node *enum_name = NULL; + Node *n = enumLookup(t); + if (n) { + String *symname = Getattr(n, "sym:name"); + if (symname) { + enum_name = NewStringf("%s", symname); + } + } + + return enum_name; + } + + /*---------------------------------------------------------------------- + * decodeEnumFeature() + * Decode the possible enum features, which are one of: + * %objcenum(simple) + * %objcenum(proper) + *--------------------------------------------------------------------*/ + + EnumFeature decodeEnumFeature(Node *n) { + EnumFeature enum_feature = SimpleEnum; + String *feature = Getattr(n, "feature:objc:enum"); + if (feature) { + if (Cmp(feature, "simple") == 0) + enum_feature = SimpleEnum; + else if (Cmp(feature, "proper") == 0) + enum_feature = ProperEnum; + } + return enum_feature; + } + + + /* ----------------------------------------------------------------------- + * enumValue() + * This method will return a string with an enum value to use in Objective-C generated + * code. If the %objcconst feature is not used, the string will contain the intermediary + * method call to obtain the enum value. The intermediary methods to obtain + * the enum value will be generated. Otherwise the C/C++ enum value will be used if there + * is one and hopefully it will compile as Objective-C code - e.g. 20 as in: enum E{e=20}; + * The %objcconstvalue feature overrides all other ways to generate the constant value. + * The caller must delete memory allocated for the returned string. + * ------------------------------------------------------------------------ */ + + String *enumValue(Node *n) { + String *symname = Getattr(n, "sym:name"); + + // Check for the %objcconstvalue feature + String *value = Getattr(n, "feature:objc:constvalue"); + + if (!value) { + // The %objcconst feature determines how the constant value is obtained + int const_feature_flag = GetFlag(n, "feature:objc:const"); + + if (const_feature_flag) { + // Use the C syntax to make a true Objective-C constant and hope that it compiles as Objective-C code + value = Getattr(n, "enumvalue") ? Copy(Getattr(n, "enumvalue")) : Copy(Getattr(n, "enumvalueex")); + } else { + // Get the enumvalue from an intermediate call + if (!getCurrentClass() || !cparse_cplusplus || !proxy_flag) { + // Strange hack to change the name + Setattr(n, "name", Getattr(n, "value")); /* for wrapping of enums in a namespace when emit_action is used */ + constantWrapper(n); + value = NewStringf("%s()", Swig_name_get(symname)); + } else { + memberconstantHandler(n); + value = NewStringf("%s()", Swig_name_get(Swig_name_member(proxy_class_name, symname))); + } + } + } + return value; + } + + /* ---------------------------------------------------------------------- * enumDeclaration() * - * C/C++ enums can be mapped in one of 4 ways, depending on the objc:enum feature specified: + * C/C++ enums can be mapped in one of 2 ways, depending on the objc:enum feature specified: * 1) Simple enums - simple constant within the proxy (Class or global) * 2) Proper enums - proper Objective-C/C enum. This is just copy-paste of the enum declaration. * Anonymous enums always default to 1) @@ -1381,13 +1392,19 @@ enum_code = NewString(""); String *symname = Getattr(n, "sym:name"); - String *constants_code = (proxy_flag && is_wrapping_class())? proxy_class_constants_code : proxy_global_constants_code; + + // Note: Really enums on Objective-C are just C #defines with some extra type safety so it actually makes sense + // to keep enums globally and let the clients of the header file use them as #defines ofcourse using enum names for + // enum type variable declarations. + // So writing enums to proxy_global_constants_code always. + + String *constants_code = (proxy_flag && is_wrapping_class())? proxy_global_constants_code : proxy_global_constants_code; EnumFeature enum_feature = decodeEnumFeature(n); String *typemap_lookup_type = Getattr(n, "name"); if ((enum_feature != SimpleEnum) && symname && typemap_lookup_type) { // Copy-paste the C/C++ enum as an Objective-C enum - Printf(enum_code, "enum %s {", symname); + Printf(enum_code, "typedef enum %s {", symname); } else { // Wrap C++ enum with integers - just indicate start of enum with a comment, no comment for anonymous enums of any sort @@ -1399,16 +1416,17 @@ Language::enumDeclaration(n); if ((enum_feature != SimpleEnum) && symname && typemap_lookup_type) { - Replaceall(enum_code, "\$objcclassname", symname); // Copy-paste the C/C++ enum as a proper Objective-C enum // Finish the enum declaration - Printf(enum_code, "};\n\n"); + Printv(enum_code, "}", symname, ";\n\n", NIL); + Replaceall(enum_code, "\$objcclassname", symname); + } else { // Wrap C++ enum with simple constant Printf(enum_code, "\n"); } if (proxy_flag && is_wrapping_class()) - Printv(proxy_class_constants_code, enum_code, NIL); + Printv(proxy_global_constants_code, enum_code, NIL); else Printv(proxy_global_constants_code, enum_code, NIL); @@ -1601,7 +1619,7 @@ Printv(proxy_h_code, proxy_global_constants_code, NIL); } else { Printv(proxy_global_constants_code, constants_code, NIL); - Printv(proxy_h_code, proxy_global_constants_code, NIL); + //Printv(proxy_h_code, proxy_global_constants_code, NIL); } } // Cleanup @@ -1629,75 +1647,74 @@ return NULL; } - /* ----------------------------------------------------------------------------- + /* ----------------------------------------------------------------------------- * emitTypeWrapperClass() * ----------------------------------------------------------------------------- */ - + void emitTypeWrapperClass(String *classname, SwigType *type) { - - String *swigtypeh = NewString(""); - String *swigtypem = NewString(""); - String *fileh = NewStringf("%s%s.h", SWIG_output_directory(), classname); + + String *swigtypeh = NewString(""); + String *swigtypem = NewString(""); + String *fileh = NewStringf("%s%s.h", SWIG_output_directory(), classname); String *filem = NewStringf("%s%s.m", SWIG_output_directory(), classname); File *fh_swigtype = NewFile(fileh, "w", SWIG_output_files()); - File *fm_swigtype = NewFile(filem, "w", SWIG_output_files()); + File *fm_swigtype = NewFile(filem, "w", SWIG_output_files()); if (!fh_swigtype) { FileErrorDisplay(fileh); SWIG_exit(EXIT_FAILURE); - } - - if (!fm_swigtype) { + } + + if (!fm_swigtype) { FileErrorDisplay(filem); SWIG_exit(EXIT_FAILURE); } - // Start writing out the type wrapper class file emitBanner(fh_swigtype); - + // Pure Objective-C baseclass and interfaces const String *pure_baseclass = typemapLookup("objcbase", type, WARN_NONE); const String *pure_interfaces = typemapLookup("objcinterfaces", type, WARN_NONE); - - Printf(swigtypeh, "#include \\n\n", fileh); - Printv(swigtypeh, typemapLookup("objcimports", type, WARN_NONE), // Import statements - "\n", typemapLookup("objcclassinterface", type, WARN_NONE), // Class modifiers - " \$objcclassname", // Class name and base class - *Char(pure_baseclass) ? " : " : "", pure_baseclass, *Char(pure_interfaces) ? // Interfaces - ", " : "", pure_interfaces, typemapLookup("objcinterface", type, WARN_NONE), // main body of class - typemapLookup("objccode", type, WARN_NONE), // extra Objective-C code - "@end\n", "\n", NIL); - - Printf(swigtypem, "#include \"%s\"\n\n", fileh); - + Printf(swigtypeh, "#include \n\n", fileh); + + Printv(swigtypeh, typemapLookup("objcimports", type, WARN_NONE), // Import statements + "\n", typemapLookup("objcclassinterface", type, WARN_NONE), // Class modifiers + " \$objcclassname", // Class name and base class + *Char(pure_baseclass) ? " : " : "", pure_baseclass, *Char(pure_interfaces) ? // Interfaces + ", " : "", pure_interfaces, typemapLookup("objcinterface", type, WARN_NONE), // main body of class + typemapLookup("objccode", type, WARN_NONE), // extra Objective-C code + "@end\n", "\n", NIL); + + Printf(swigtypem, "#include \"%s\"\n\n", fileh); + Printv(swigtypem, typemapLookup("objcimports", type, WARN_NONE), // Import statements - typemapLookup("objcclassimplementation", type, WARN_NONE), // Class modifiers - " \$objcclassname", typemapLookup("objcbody", type, WARN_NONE), // main body of class - typemapLookup("objccode", type, WARN_NONE), // extra Objective-C code - "@end\n", "\n", NIL); - - + typemapLookup("objcclassimplementation", type, WARN_NONE), // Class modifiers + " \$objcclassname", typemapLookup("objcbody", type, WARN_NONE), // main body of class + typemapLookup("objccode", type, WARN_NONE), // extra Objective-C code + "@end\n", "\n", NIL); + + Replaceall(swigtypeh, "\$objcclassname", classname); - Replaceall(swigtypem, "\$objcclassname", classname); + Replaceall(swigtypem, "\$objcclassname", classname); Printv(fh_swigtype, swigtypeh, NIL); - Printv(fm_swigtype, swigtypem, NIL); + Printv(fm_swigtype, swigtypem, NIL); Close(fh_swigtype); Delete(swigtypeh); - - Close(fm_swigtype); + + Close(fm_swigtype); Delete(swigtypem); - Delete(fileh); + Delete(fileh); fileh = NULL; - - Delete(filem); + + Delete(filem); filem = NULL; } - + /* ----------------------------------------------------------------------------- * typemapLookup() * ----------------------------------------------------------------------------- */ @@ -1789,8 +1806,8 @@ // Pure Objective-C interfaces const String *pure_interfaces = typemapLookup(derived ? "objcinterfaces_derived" : "objcinterfaces", typemap_lookup_type, WARN_NONE); // Start writing the proxy class - //Printv(proxy_class_decl, typemapLookup("objcimports", typemap_lookup_type, WARN_NONE), // Import statements - // "\n", NIL); // This would be needed when we decide upon a separate file for each class. + //Printv(proxy_class_decl, typemapLookup("objcimports", typemap_lookup_type, WARN_NONE), // Import statements + // "\n", NIL); // This would be needed when we decide upon a separate file for each class. // Class attributes const String *objcattributes = typemapLookup("objcattributes", typemap_lookup_type, WARN_NONE); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Swig-cvs] SF.net SVN: swig:[11667] branches/gsoc2009-ashishs99 From: - 2009-08-23 03:01:51 ```Revision: 11667 http://swig.svn.sourceforge.net/swig/?rev=11667&view=rev Author: ashishs99 Date: 2009-08-23 03:01:39 +0000 (Sun, 23 Aug 2009) Log Message: ----------- Fixes for issues. Modified Paths: -------------- branches/gsoc2009-ashishs99/Examples/objc/native/Makefile branches/gsoc2009-ashishs99/Examples/objc/native/example.i branches/gsoc2009-ashishs99/Examples/objc/variables/Makefile branches/gsoc2009-ashishs99/Examples/objc/variables/example.c branches/gsoc2009-ashishs99/Examples/objc/variables/example.h branches/gsoc2009-ashishs99/Examples/objc/variables/example.i branches/gsoc2009-ashishs99/Lib/objc/objc.swg branches/gsoc2009-ashishs99/Source/Modules/objc.cxx Modified: branches/gsoc2009-ashishs99/Examples/objc/native/Makefile =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/native/Makefile 2009-08-22 08:53:21 UTC (rev 11666) +++ branches/gsoc2009-ashishs99/Examples/objc/native/Makefile 2009-08-23 03:01:39 UTC (rev 11667) @@ -12,12 +12,12 @@ all:: objc objc:: - \$(MAKE) -f \$(TOP)/Makefile SRCS='\$(SRCS)' SWIG='\$(SWIG)' \ - SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc - \$(MAKE) -f \$(TOP)/Makefile OBJCPPSRCS='\$(OBJCPPSRCS)' OBJPPCFLAGS='(OBJCPPFLAGS)' objcpp_compile - \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='(OBJCFLAGS)' objc_compile + \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCPPSRCS='\$(OBJCPPSRCS)' SWIG='\$(SWIG)' \ + SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc_cpp + \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='\$(OBJCFLAGS)' TARGET='\$(TARGET)' objc_compile clean:: \$(MAKE) -f \$(TOP)/Makefile objc_clean check: all + Modified: branches/gsoc2009-ashishs99/Examples/objc/native/example.i =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/native/example.i 2009-08-22 08:53:21 UTC (rev 11666) +++ branches/gsoc2009-ashishs99/Examples/objc/native/example.i 2009-08-23 03:01:39 UTC (rev 11667) @@ -7,18 +7,18 @@ typedef struct point { int x; int y; -} Point; +} _Point; -Point *point_create(int x, int y) { - Point *p = (Point *) malloc(sizeof(Point)); +_Point *point_create(int x, int y) { + _Point *p = (_Point *) malloc(sizeof(_Point)); p->x = x; p->y = y; return p; } -static char *point_toString(char *format, Point *p) { +static char *point_toString(char *format, _Point *p) { static char buf[80]; sprintf(buf, format, p->x, p->y); @@ -27,30 +27,30 @@ } /* this function will be wrapped by SWIG */ -char *point_toString1(Point *p) { +char *point_toString1(_Point *p) { return point_toString("(%d,%d)", p); } /* this one we wrapped manually*/ -JNIEXPORT jstring JNICALL Java_exampleJNI_point_1toString2(JNIEnv *jenv, jclass jcls, jlong jpoint) { - Point * p; +/*JNIEXPORT jstring JNICALL Java_exampleJNI_point_1toString2(JNIEnv *jenv, jclass jcls, jlong jpoint) { + _Point * p; jstring result; (void)jcls; - p = *(Point **)&jpoint; + p = *(_Point **)&jpoint; result = (*jenv)->NewStringUTF(jenv, point_toString("[%d,%d]", p)); return result; -} +}*/ %} -Point *point_create(int x, int y); -char *point_toString1(Point *p); +_Point *point_create(int x, int y); +char *point_toString1(_Point *p); -/* give access to free() for memory cleanup of the malloc'd Point */ +/* give access to free() for memory cleanup of the malloc'd _Point */ extern void free(void *memblock); -%native(point_toString2) char *point_toString2(Point *p); +%native(point_toString2) char *point_toString2(_Point *p); Modified: branches/gsoc2009-ashishs99/Examples/objc/variables/Makefile =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/variables/Makefile 2009-08-22 08:53:21 UTC (rev 11666) +++ branches/gsoc2009-ashishs99/Examples/objc/variables/Makefile 2009-08-23 03:01:39 UTC (rev 11667) @@ -12,11 +12,12 @@ all:: objc objc:: - \$(MAKE) -f \$(TOP)/Makefile SRCS='\$(SRCS)' SWIG='\$(SWIG)' \ - SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc - \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='(OBJCFLAGS)' objc_compile + \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCPPSRCS='\$(OBJCPPSRCS)' SWIG='\$(SWIG)' \ + SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc_cpp + \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='\$(OBJCFLAGS)' TARGET='\$(TARGET)' objc_compile clean:: \$(MAKE) -f \$(TOP)/Makefile objc_clean check: all + Modified: branches/gsoc2009-ashishs99/Examples/objc/variables/example.c =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/variables/example.c 2009-08-22 08:53:21 UTC (rev 11666) +++ branches/gsoc2009-ashishs99/Examples/objc/variables/example.c 2009-08-23 03:01:39 UTC (rev 11667) @@ -30,8 +30,8 @@ /* Global variables involving a structure */ -Point *ptptr = 0; -Point pt = { 10, 20 }; +_Point *ptptr = 0; +_Point pt = { 10, 20 }; /* A variable that we will make read-only in the interface */ int status = 1; @@ -67,16 +67,16 @@ return ip; } -/* A function to create a point */ +/* A function to create a _Point */ -Point *new_Point(int x, int y) { - Point *p = (Point *) malloc(sizeof(Point)); +_Point *new_Point(int x, int y) { + _Point *p = (_Point *) malloc(sizeof(_Point)); p->x = x; p->y = y; return p; } -char * Point_print(Point *p) { +char * Point_print(_Point *p) { static char buffer[256]; if (p) { sprintf(buffer,"(%d,%d)", p->x,p->y); Modified: branches/gsoc2009-ashishs99/Examples/objc/variables/example.h =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/variables/example.h 2009-08-22 08:53:21 UTC (rev 11666) +++ branches/gsoc2009-ashishs99/Examples/objc/variables/example.h 2009-08-23 03:01:39 UTC (rev 11667) @@ -2,5 +2,5 @@ typedef struct { int x,y; -} Point; +} _Point; Modified: branches/gsoc2009-ashishs99/Examples/objc/variables/example.i =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/variables/example.i 2009-08-22 08:53:21 UTC (rev 11666) +++ branches/gsoc2009-ashishs99/Examples/objc/variables/example.i 2009-08-23 03:01:39 UTC (rev 11667) @@ -18,12 +18,11 @@ extern float fvar; extern double dvar; extern char *strvar; -extern const char cstrvar[]; extern int *iptrvar; extern char name[256]; -extern Point *ptptr; -extern Point pt; +extern _Point *ptptr; +extern _Point pt; %} @@ -42,8 +41,8 @@ %inline %{ extern void print_vars(); extern int *new_int(int value); -extern Point *new_Point(int x, int y); -extern char *Point_print(Point *p); +extern _Point *new_Point(int x, int y); +extern char *Point_print(_Point *p); extern void pt_print(); %} Modified: branches/gsoc2009-ashishs99/Lib/objc/objc.swg =================================================================== --- branches/gsoc2009-ashishs99/Lib/objc/objc.swg 2009-08-22 08:53:21 UTC (rev 11666) +++ branches/gsoc2009-ashishs99/Lib/objc/objc.swg 2009-08-23 03:01:39 UTC (rev 11667) @@ -63,15 +63,29 @@ %typemap(in, noblock=1) char * { \$1 = 0; if (\$input) { - \$1 = [\$input cStringUsingEncoding: [NSString defaultCStringEncoding]]; - if (!\$1) return \$null; - } + int length = [\$input length]; + int bufferSize = sizeof(char) * (length + 1); + char *buffer = (char*)malloc(bufferSize); + memset(buffer, 0, bufferSize); + int i = 0; + for (; i < length; ++i) + buffer[i] = [\$input characterAtIndex: i]; + \$1 = buffer; + } + if (!\$1) return \$null; } %typemap(in, noblock=1) char *& (\$*1_ltype temp = 0) { \$1 = 0; if (\$input) { - temp = (\$*1_ltype)[\$input cStringUsingEncoding: [NSString defaultCStringEncoding]];; + int length = [\$input length]; + int bufferSize = sizeof(char) * (length + 1); + char *buffer = (char*)malloc(bufferSize); + memset(buffer, 0, bufferSize); + int i = 0; + for (; i < length; ++i) + buffer[i] = [\$input characterAtIndex: i]; + temp = (\$*1_ltype)buffer; if (!temp) return \$null; } \$1 = &temp; @@ -79,9 +93,36 @@ %typemap(in) char[ANY] -%{ \$1 = [\$input cStringUsingEncoding: [NSString defaultCStringEncoding]]; %} +%{ + \$1 = 0; + if (\$input) { + int length = [\$input length]; + int bufferSize = sizeof(char) * (length + 1); + char *buffer = (char*)malloc(bufferSize); + memset(buffer, 0, bufferSize); + int i = 0; + for (; i < length; ++i) + buffer[i] = [\$input characterAtIndex: i]; + \$1 = buffer; + } + if (!\$1) return \$null; +%} + %typemap(in) char[] -%{ \$1 = [\$input cStringUsingEncoding: [NSString defaultCStringEncoding]]; %} +%{ + \$1 = 0; + if (\$input) { + int length = [\$input length]; + int bufferSize = sizeof(char) * (length + 1); + char *buffer = (char*)malloc(bufferSize); + memset(buffer, 0, bufferSize); + int i = 0; + for (; i < length; ++i) + buffer[i] = [\$input characterAtIndex: i]; + \$1 = buffer; + } + if (!\$1) return \$null; +%} %typemap(in) SWIGTYPE * %{ \$1 = (\$1_ltype)\$input; %} @@ -116,16 +157,18 @@ %typemap(in) SWIGTYPE (\$&1_type argp) %{ argp = *(\$&1_ltype*)&\$input; if (!argp) { - [NSException raise:@"Attempt to dereference null \$1_type"]; - return \$null; + NSException* anException = [NSException exceptionWithName:@"NullPointerException" + reason:@"Attempt to dereference null \$1_type" + userInfo:nil]; } \$1 = *argp; %} %typemap(in) SWIGTYPE *, SWIGTYPE (CLASS::*) %{ \$1 = *(\$&1_ltype)&\$input; %} %typemap(in) SWIGTYPE & %{ \$1 = *(\$&1_ltype)&\$input; if (!\$1) { - [NSException raise:@"\$1_type reference is null"]; - return \$null; + NSException* anException = [NSException exceptionWithName:@"NullPointerException" + reason:@"Attempt to dereference null \$1_type" + userInfo:nil]; } %} %typemap(in) SWIGTYPE *& (\$*1_ltype temp = 0) %{ temp = *(\$1_ltype)&\$input; @@ -169,24 +212,24 @@ %typemap(out) SWIGTYPE #ifdef __cplusplus -%{ *(\$&1_ltype*)&\$result = new \$1_ltype((const \$1_ltype &)\$1); %} +%{ \$result = (void*)new \$1_ltype((const \$1_ltype &)\$1); %} #else { \$&1_ltype \$1ptr = (\$&1_ltype) malloc(sizeof(\$1_ltype)); memmove(\$1ptr, &\$1, sizeof(\$1_type)); - *(\$&1_ltype*)&\$result = \$1ptr; + \$result = \$1ptr; } #endif %typemap(out) SWIGTYPE *, SWIGTYPE (CLASS::*) -%{ *(\$&1_ltype)&\$result = \$1; %} +%{ \$result = \$1; %} %typemap(out) SWIGTYPE & -%{ *(\$&1_ltype)&\$result = \$1; %} +%{ \$result = \$1; %} -%typemap(out) SWIGTYPE [] %{ *(\$&1_ltype)&\$result = \$1; %} +%typemap(out) SWIGTYPE [] %{ \$result = \$1; %} %typemap(out) SWIGTYPE *& -%{ *(\$1_ltype)&\$result = *\$1; %} +%{ \$result = *\$1; %} @@ -280,14 +323,14 @@ %typemap(objcout) void { \$imcall; } -%typemap(objcout) SWIGTYPE { //TBD +%typemap(objcout) SWIGTYPE { void *cPtr = \$imcall; - \$objcclassname ret = (cPtr == NULL) ? NIL : [[[\$objcclassname] initWithCptr: cPtr] autorelease]; + \$objcclassname* ret = (cPtr == NULL) ? nil : [[[\$objcclassname alloc] initWithCptr: cPtr] autorelease]; return ret; } %typemap(objcout) SWIGTYPE & { //TBD void *cPtr = \$imcall; - \$objcclassname ret = (cPtr == NULL) ? NIL : [[[\$objcclassname] initWithCptr: cPtr] autorelease]; + \$objcclassname* ret = (cPtr == NULL) ? nil : [[[\$objcclassname alloc] initWithCptr: cPtr] autorelease]; return ret; } @@ -295,17 +338,17 @@ // Also see the memory management part %typemap(objcout) SWIGTYPE * { void *cPtr = \$imcall; - \$objcclassname ret = (cPtr == NULL) ? NIL : [[[\$objcclassname] initWithCptr: cPtr] autorelease]; + \$objcclassname* ret = (cPtr == NULL) ? nil : [[[\$objcclassname alloc] initWithCptr: cPtr] autorelease]; return ret; } %typemap(objcout) SWIGTYPE [] { void *cPtr = \$imcall; - \$objcclassname ret = (cPtr == NULL) ? NIL : [[[\$objcclassname] initWithCptr: cPtr] autorelease]; + \$objcclassname* ret = (cPtr == NULL) ? nil : [[[\$objcclassname alloc] initWithCptr: cPtr] autorelease]; return ret; } %typemap(objcout) SWIGTYPE (CLASS::*) { void *cMemberPtr = \$imcall; - \$objcclassname ret = (cPtr == NULL) ? NIL : [[[\$objcclassname] initWithCptr: cMemberPtr] autorelease]; + \$objcclassname* ret = (cPtr == NULL) ? nil : [[[\$objcclassname alloc] initWithCptr: cMemberPtr] autorelease]; return ret; } @@ -433,15 +476,15 @@ \$imcall; %} -%typemap(objcvarout) SWIGTYPE { //TBD +%typemap(objcvarout) SWIGTYPE { void *cPtr = \$imcall; - \$objcclassname ret = (cPtr == NULL) ? NIL : [[[\$objcclassname] initWithCptr: cPtr] autorelease]; + \$objcclassname* ret = (cPtr == NULL) ? nil : [[[\$objcclassname alloc] initWithCptr: cPtr] autorelease]; return ret; } -%typemap(objcvarout) SWIGTYPE & { //TBD +%typemap(objcvarout) SWIGTYPE & { void *cPtr = \$imcall; - \$objcclassname ret = (cPtr == NULL) ? NIL : [[[\$objcclassname] initWithCptr: cPtr] autorelease]; + \$objcclassname* ret = (cPtr == NULL) ? nil : [[[\$objcclassname alloc] initWithCptr: cPtr] autorelease]; return ret; } @@ -449,17 +492,17 @@ // Also see the memory management part %typemap(objcvarout) SWIGTYPE * { void *cPtr = \$imcall; - \$objcclassname ret = (cPtr == NULL) ? NIL : [[[\$objcclassname] initWithCptr: cPtr] autorelease]; + \$objcclassname* ret = (cPtr == NULL) ? nil : [[[\$objcclassname alloc] initWithCptr: cPtr] autorelease]; return ret; } %typemap(objcvarout) SWIGTYPE [] { void *cPtr = \$imcall; - \$objcclassname ret = (cPtr == NULL) ? NIL : [[[\$objcclassname] initWithCptr: cPtr] autorelease]; + \$objcclassname* ret = (cPtr == NULL) ? nil : [[[\$objcclassname alloc] initWithCptr: cPtr] autorelease]; return ret; } %typemap(objcvarout) SWIGTYPE (CLASS::*) { void *cMemberPtr = \$imcall; - \$objcclassname ret = (cPtr == NULL) ? NIL : [[[\$objcclassname] initWithCptr: cMemberPtr] autorelease]; + \$objcclassname* ret = (cPtr == NULL) ? nil : [[[\$objcclassname alloc] initWithCptr: cMemberPtr] autorelease]; return ret; } Modified: branches/gsoc2009-ashishs99/Source/Modules/objc.cxx =================================================================== --- branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2009-08-22 08:53:21 UTC (rev 11666) +++ branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2009-08-23 03:01:39 UTC (rev 11667) @@ -35,6 +35,8 @@ String *ocpp_h_code; // Code for Objective-C++ header String *proxy_h_code; // Code for Objective-C proxy header String *proxy_m_code; // Code for Objective-C proxy implementation + String *swigtypes_h_code; // Code for Objective-C typewrapper classes header + String *swigtypes_m_code; // Code for Objective-C typewrapper classes implementation String *proxy_class_name; // Name of the proxy class String *variable_name; // Name of a variable being wrapped @@ -67,7 +69,7 @@ proxy_flag(true), proxy_class_name(NULL), destructor_call(NULL), proxy_class_constants_code(NULL), enum_code(NULL), proxy_global_constants_code(NULL), variable_name(NULL), proxy_class_def(NULL), - proxy_class_decl(NULL), ocpp_h_code(NULL), proxy_h_code(NULL), proxy_m_code(NULL) { + proxy_class_decl(NULL), ocpp_h_code(NULL), proxy_h_code(NULL), proxy_m_code(NULL), swigtypes_h_code(NULL), swigtypes_m_code(NULL) { } virtual void main(int argc, char *argv[]) { SWIG_library_directory("objc"); @@ -133,7 +135,7 @@ Swig_name_register((char *) "wrapper", (char *) "ObjCPP_%f"); - Printf(f_wrappers, "#include \"%s\"\n\n", file_h); + Printf(f_wrappers, "#import \"%s\"\n\n", file_h); Printf(f_wrappers, "\n#ifdef __cplusplus\n"); Printf(f_wrappers, "extern \"C\" {\n"); @@ -143,6 +145,8 @@ ocpp_h_code = NewString(""); proxy_h_code = NewString(""); proxy_m_code = NewString(""); + swigtypes_h_code = NewString(""); + swigtypes_m_code = NewString(""); proxy_class_decl = NewString(""); proxy_class_def = NewString(""); swig_types_hash = NewHash(); @@ -154,6 +158,12 @@ // Generate proxy code if (proxy_flag) { + + // Output a Objective-C type wrapper class for each SWIG type + for (Iterator swig_type = First(swig_types_hash); swig_type.key; swig_type = Next(swig_type)) { + emitTypeWrapperClass(swig_type.key, swig_type.item); + } + String *proxy_h = NewStringf("%sProxy.h", modulename); f_proxy_h = NewFile(proxy_h, "w", SWIG_output_files()); if (!f_proxy_h) { @@ -170,10 +180,10 @@ emitBanner(f_proxy_h); Printf(f_proxy_h, "\n#import \n\n"); - Printf(f_proxy_m, "#include \"%s\"\n\n", file_h); - Printf(f_proxy_m, "#include \"%s\"\n\n", proxy_h); - Printv(f_proxy_h, proxy_global_constants_code, proxy_h_code, NIL); - Printv(f_proxy_m, proxy_m_code, NIL); + Printf(f_proxy_m, "#import \"%s\"\n\n", file_h); + Printf(f_proxy_m, "#import \"%s\"\n\n", proxy_h); + Printv(f_proxy_h, proxy_global_constants_code, swigtypes_h_code, proxy_h_code, NIL); + Printv(f_proxy_m, swigtypes_m_code, proxy_m_code, NIL); Delete(proxy_h); proxy_h = NULL; @@ -182,8 +192,9 @@ Delete(proxy_h_code); proxy_h_code = NULL; - Delete(proxy_h_code); - proxy_h_code = NULL; + Delete(proxy_m_code); + proxy_m_code = NULL; + Close(f_proxy_m); Delete(f_proxy_m); Close(f_proxy_h); @@ -216,12 +227,6 @@ Printf(f_ocpp_h, "}\n"); Printf(f_ocpp_h, "#endif\n"); - - // Output a Objective-C type wrapper class for each SWIG type - for (Iterator swig_type = First(swig_types_hash); swig_type.key; swig_type = Next(swig_type)) { - emitTypeWrapperClass(swig_type.key, swig_type.item); - } - Dump(f_header, f_runtime); Dump(f_wrappers, f_runtime); Wrapper_pretty_print(f_init, f_runtime); @@ -235,6 +240,11 @@ Delete(ocpp_h_code); ocpp_h_code = NULL; + Delete(swigtypes_h_code); + swigtypes_h_code = NULL; + Delete(swigtypes_m_code); + swigtypes_m_code = NULL; + Delete(swig_types_hash); swig_types_hash = NULL; Delete(proxy_class_def); @@ -409,6 +419,8 @@ String *tm; Parm *p; Parm *last_parm = 0; + int num_arguments = 0; + int num_required = 0; int i; String *imcall = NewString(""); String *return_type = NewString(""); @@ -431,15 +443,12 @@ } /* Attach the non-standard typemaps to the parameter list */ - Swig_typemap_attach_parms("in", l, NULL); Swig_typemap_attach_parms("objctype", l, NULL); Swig_typemap_attach_parms("objcin", l, NULL); /* Get return types */ if ((tm = Swig_typemap_lookup("objctype", n, "", 0))) { - String *objctypeout = Getattr(n, "tmap:objctype:out"); // the type in the objctype typemap's out attribute overrides the type in the typemap - if (objctypeout) - tm = objctypeout; + substituteClassname(t, tm); Printf(return_type, "%s", tm); } else { Swig_warning(WARN_NONE, input_file, line_number, "No objctype typemap defined for %s\n", SwigType_str(t, 0)); @@ -464,65 +473,55 @@ Printf(function_decl, "%s %s(", return_type, func_name); Printv(imcall, "\$ocppfuncname(", NIL); - emit_mark_varargs(l); + /* Get number of required and total arguments */ + num_arguments = emit_num_arguments(l); + num_required = emit_num_required(l); - int gencomma = 1; + bool global_or_member_variable = global_variable_flag || (wrapping_member_flag && !enum_constant_flag); + int gencomma = 0; - /* Output each parameter, this essentially completes the function name for objective-c function */ - for (i = 0, p = l; p; i++) { - /* Ignored varargs */ - if (checkAttribute(p, "varargs:ignore", "1")) { - p = nextSibling(p); - continue; - } + /* Output each parameter */ + for (i = 0, p = l; i < num_arguments; i++) { /* Ignored parameters */ - if (checkAttribute(p, "tmap:in:numinputs", "0")) { + while (checkAttribute(p, "tmap:in:numinputs", "0")) { p = Getattr(p, "tmap:in:next"); - continue; } - /* Ignore the 'this' argument for variable wrappers */ - if (!(variable_wrapper_flag && i == 0)) { - SwigType *pt = Getattr(p, "type"); - String *param_type = NewString(""); - if (setter_flag) - last_parm = p; + SwigType *pt = Getattr(p, "type"); + String *param_type = NewString(""); - /* Get the Objective-C parameter type */ - if ((tm = Getattr(p, "tmap:objctype"))) { - substituteClassname(pt, tm); - const String *inattributes = Getattr(p, "tmap:objctype:inattributes"); - Printf(param_type, "%s%s", inattributes ? inattributes : empty_string, tm); - } else { - Swig_warning(WARN_NONE, input_file, line_number, "No objctype typemap defined for %s\n", SwigType_str(pt, 0)); - } + /* Get the Objective-C parameter type */ + if ((tm = Getattr(p, "tmap:objctype"))) { + substituteClassname(pt, tm); + Printf(param_type, "%s", tm); + } else { + Swig_warning(WARN_NONE, input_file, line_number, "No objctype typemap defined for %s\n", SwigType_str(pt, 0)); + } - String *arg = makeParameterName(n, p, i, setter_flag); + if (gencomma) + Printf(imcall, ", "); - if (gencomma > 1) { - Printf(imcall, ", "); - } + String *arg = makeParameterName(n, p, i, global_or_member_variable); - // Use typemaps to transform type used in Objective-C proxy function to the one used in intermediate code. - if ((tm = Getattr(p, "tmap:objcin"))) { - addThrows(n, "tmap:objcin", p); - substituteClassname(pt, tm); - Replaceall(tm, "\$objcinput", arg); - Printv(imcall, tm, NIL); - } else { - Swig_warning(WARN_NONE, input_file, line_number, "No objcin typemap defined for %s\n", SwigType_str(pt, 0)); - } + // Use typemaps to transform type used in Objective-C proxy function to the one used in intermediate code. + if ((tm = Getattr(p, "tmap:objcin"))) { + addThrows(n, "tmap:objcin", p); + substituteClassname(pt, tm); + Replaceall(tm, "\$objcinput", arg); + Printv(imcall, tm, NIL); + } else { + Swig_warning(WARN_NONE, input_file, line_number, "No objcin typemap defined for %s\n", SwigType_str(pt, 0)); + } - /* Add parameter to proxy function */ - if (gencomma >= 2) - Printf(function_decl, ", "); - gencomma = 2; - Printf(function_decl, "%s %s", param_type, arg); + /* Add parameter to proxy function */ + if (gencomma >= 2) + Printf(function_decl, ", "); + gencomma = 2; + Printf(function_decl, "%s %s", param_type, arg); - Delete(arg); - Delete(param_type); - } + Delete(arg); + Delete(param_type); p = Getattr(p, "tmap:in:next"); } @@ -1653,32 +1652,11 @@ void emitTypeWrapperClass(String *classname, SwigType *type) { - String *swigtypeh = NewString(""); - String *swigtypem = NewString(""); - String *fileh = NewStringf("%s%s.h", SWIG_output_directory(), classname); - String *filem = NewStringf("%s%s.m", SWIG_output_directory(), classname); - File *fh_swigtype = NewFile(fileh, "w", SWIG_output_files()); - File *fm_swigtype = NewFile(filem, "w", SWIG_output_files()); - - if (!fh_swigtype) { - FileErrorDisplay(fileh); - SWIG_exit(EXIT_FAILURE); - } - - if (!fm_swigtype) { - FileErrorDisplay(filem); - SWIG_exit(EXIT_FAILURE); - } - // Start writing out the type wrapper class file - emitBanner(fh_swigtype); - // Pure Objective-C baseclass and interfaces const String *pure_baseclass = typemapLookup("objcbase", type, WARN_NONE); const String *pure_interfaces = typemapLookup("objcinterfaces", type, WARN_NONE); - Printf(swigtypeh, "#include \n\n", fileh); - - Printv(swigtypeh, typemapLookup("objcimports", type, WARN_NONE), // Import statements + Printv(swigtypes_h_code, typemapLookup("objcimports", type, WARN_NONE), // Import statements "\n", typemapLookup("objcclassinterface", type, WARN_NONE), // Class modifiers " \$objcclassname", // Class name and base class *Char(pure_baseclass) ? " : " : "", pure_baseclass, *Char(pure_interfaces) ? // Interfaces @@ -1686,32 +1664,14 @@ typemapLookup("objccode", type, WARN_NONE), // extra Objective-C code "@end\n", "\n", NIL); - Printf(swigtypem, "#include \"%s\"\n\n", fileh); - - Printv(swigtypem, typemapLookup("objcimports", type, WARN_NONE), // Import statements + Printv(swigtypes_m_code, typemapLookup("objcimports", type, WARN_NONE), // Import statements typemapLookup("objcclassimplementation", type, WARN_NONE), // Class modifiers " \$objcclassname", typemapLookup("objcbody", type, WARN_NONE), // main body of class typemapLookup("objccode", type, WARN_NONE), // extra Objective-C code "@end\n", "\n", NIL); - - Replaceall(swigtypeh, "\$objcclassname", classname); - Replaceall(swigtypem, "\$objcclassname", classname); - - Printv(fh_swigtype, swigtypeh, NIL); - Printv(fm_swigtype, swigtypem, NIL); - - Close(fh_swigtype); - Delete(swigtypeh); - - Close(fm_swigtype); - Delete(swigtypem); - - Delete(fileh); - fileh = NULL; - - Delete(filem); - filem = NULL; + Replaceall(swigtypes_h_code, "\$objcclassname", classname); + Replaceall(swigtypes_m_code, "\$objcclassname", classname); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Swig-cvs] SF.net SVN: swig:[11669] branches/gsoc2009-ashishs99 From: - 2009-08-23 07:10:59 ```Revision: 11669 http://swig.svn.sourceforge.net/swig/?rev=11669&view=rev Author: ashishs99 Date: 2009-08-23 07:10:53 +0000 (Sun, 23 Aug 2009) Log Message: ----------- Fixed some issues. Modified Paths: -------------- branches/gsoc2009-ashishs99/Examples/objc/constants/Makefile branches/gsoc2009-ashishs99/Examples/objc/constants/example.i branches/gsoc2009-ashishs99/Examples/objc/funcptr/Makefile branches/gsoc2009-ashishs99/Lib/objc/objc.swg branches/gsoc2009-ashishs99/Source/Modules/objc.cxx Modified: branches/gsoc2009-ashishs99/Examples/objc/constants/Makefile =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/constants/Makefile 2009-08-23 03:04:51 UTC (rev 11668) +++ branches/gsoc2009-ashishs99/Examples/objc/constants/Makefile 2009-08-23 07:10:53 UTC (rev 11669) @@ -1,6 +1,6 @@ TOP = ../.. SWIG = \$(TOP)/../preinst-swig -CXXSRCS = +CXXSRCS = TARGET = example INTERFACE = example.i SWIGOPT = Modified: branches/gsoc2009-ashishs99/Examples/objc/constants/example.i =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/constants/example.i 2009-08-23 03:04:51 UTC (rev 11668) +++ branches/gsoc2009-ashishs99/Examples/objc/constants/example.i 2009-08-23 07:10:53 UTC (rev 11669) @@ -1,7 +1,7 @@ /* File : example.i */ %module example -/* Force the generated Objective-C code to use the C constant values rather than making a method call */ +/* Force the generated Java code to use the C constant values rather than making an intermediate call */ %objcconst(1); /* A few preprocessor macros */ Modified: branches/gsoc2009-ashishs99/Examples/objc/funcptr/Makefile =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/funcptr/Makefile 2009-08-23 03:04:51 UTC (rev 11668) +++ branches/gsoc2009-ashishs99/Examples/objc/funcptr/Makefile 2009-08-23 07:10:53 UTC (rev 11669) @@ -12,12 +12,12 @@ all:: objc objc:: - \$(MAKE) -f \$(TOP)/Makefile SRCS='\$(SRCS)' SWIG='\$(SWIG)' \ - SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc - \$(MAKE) -f \$(TOP)/Makefile OBJCPPSRCS='\$(OBJCPPSRCS)' OBJPPCFLAGS='(OBJCPPFLAGS)' objcpp_compile - \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='(OBJCFLAGS)' objc_compile + \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCPPSRCS='\$(OBJCPPSRCS)' SWIG='\$(SWIG)' \ + SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc_cpp + \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='\$(OBJCFLAGS)' TARGET='\$(TARGET)' objc_compile clean:: \$(MAKE) -f \$(TOP)/Makefile objc_clean check: all + Modified: branches/gsoc2009-ashishs99/Lib/objc/objc.swg =================================================================== --- branches/gsoc2009-ashishs99/Lib/objc/objc.swg 2009-08-23 03:04:51 UTC (rev 11668) +++ branches/gsoc2009-ashishs99/Lib/objc/objc.swg 2009-08-23 07:10:53 UTC (rev 11669) @@ -160,16 +160,20 @@ NSException* anException = [NSException exceptionWithName:@"NullPointerException" reason:@"Attempt to dereference null \$1_type" userInfo:nil]; + @throw anException; } \$1 = *argp; %} %typemap(in) SWIGTYPE *, SWIGTYPE (CLASS::*) %{ \$1 = *(\$&1_ltype)&\$input; %} + %typemap(in) SWIGTYPE & %{ \$1 = *(\$&1_ltype)&\$input; if (!\$1) { NSException* anException = [NSException exceptionWithName:@"NullPointerException" reason:@"Attempt to dereference null \$1_type" userInfo:nil]; + @throw anException; } %} + %typemap(in) SWIGTYPE *& (\$*1_ltype temp = 0) %{ temp = *(\$1_ltype)&\$input; \$1 = &temp; %} @@ -217,19 +221,19 @@ { \$&1_ltype \$1ptr = (\$&1_ltype) malloc(sizeof(\$1_ltype)); memmove(\$1ptr, &\$1, sizeof(\$1_type)); - \$result = \$1ptr; + \$result = (void*)\$1ptr; } #endif %typemap(out) SWIGTYPE *, SWIGTYPE (CLASS::*) -%{ \$result = \$1; %} +%{ \$result = (void*)\$1; %} %typemap(out) SWIGTYPE & -%{ \$result = \$1; %} +%{ \$result = (void*)\$1; %} %typemap(out) SWIGTYPE [] %{ \$result = \$1; %} %typemap(out) SWIGTYPE *& -%{ \$result = *\$1; %} +%{ \$result = (void*)*\$1; %} @@ -253,13 +257,13 @@ // Pointers, references and arrays %typemap(objctype) char *, char *&, char[ANY], char[] "NSString *" -%typemap(objctype) SWIGTYPE "\$objcclassname *" -%typemap(objctype) SWIGTYPE [] "NSMutableArray *" //TBD -%typemap(objctype) SWIGTYPE * "\$objcclassname *" -%typemap(objctype) SWIGTYPE & "\$objcclassname *" +%typemap(objctype) SWIGTYPE "\$objcclassname*" +%typemap(objctype) SWIGTYPE [] "NSMutableArray*" //TBD +%typemap(objctype) SWIGTYPE * "\$objcclassname*" +%typemap(objctype) SWIGTYPE & "\$objcclassname*" // Pointer to a class member -%typemap(objctype) SWIGTYPE (CLASS::*) "\$objcclassname" +%typemap(objctype) SWIGTYPE (CLASS::*) "\$objcclassname*" Modified: branches/gsoc2009-ashishs99/Source/Modules/objc.cxx =================================================================== --- branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2009-08-23 03:04:51 UTC (rev 11668) +++ branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2009-08-23 07:10:53 UTC (rev 11669) @@ -94,7 +94,7 @@ // Set config file SWIG_config_file("objc.swg"); - allow_overloading(); + allow_overloading(false); } @@ -182,7 +182,7 @@ Printf(f_proxy_h, "\n#import \n\n"); Printf(f_proxy_m, "#import \"%s\"\n\n", file_h); Printf(f_proxy_m, "#import \"%s\"\n\n", proxy_h); - Printv(f_proxy_h, proxy_global_constants_code, swigtypes_h_code, proxy_h_code, NIL); + Printv(f_proxy_h, swigtypes_h_code, proxy_global_constants_code, "\n", proxy_h_code, NIL); Printv(f_proxy_m, swigtypes_m_code, proxy_m_code, NIL); Delete(proxy_h); @@ -404,7 +404,303 @@ return arg; } + /* ----------------------------------------------------------------------------- + * functionWrapper() + * ----------------------------------------------------------------------------- */ + virtual int functionWrapper(Node *n) { + String *symname = Getattr(n, "sym:name"); + SwigType *t = Getattr(n, "type"); + ParmList *l = Getattr(n, "parms"); + + String *cleanup = NewString(""); + String *outarg = NewString(""); + String *ocpp_return_type = NewString(""); + String *tm; + Parm *p; + int i; + int num_arguments = 0; + int num_required = 0; + bool is_void_return; + String *overloaded_name = getOverloadedName(n); + + if (!Getattr(n, "sym:overloaded")) { + if (!addSymbol(Getattr(n, "sym:name"), n)) + return SWIG_ERROR; + } + + Wrapper *f = NewWrapper(); + String *wname = Swig_name_wrapper(overloaded_name); + + Swig_typemap_attach_parms("ocpptype", l, f); + + /* Get return types */ + if ((tm = Swig_typemap_lookup("ocpptype", n, "", 0))) { + String *ocpptypeout = Getattr(n, "tmap:ocpptype:out"); // the type in the ocpptype typemap's out attribute overrides the type in the typemap + if (ocpptypeout) + tm = ocpptypeout; + Printf(ocpp_return_type, "%s", tm); + } else { + Swig_warning(WARN_NONE, input_file, line_number, "No ocpptype typemap defined for %s\n", SwigType_str(t, 0)); + } + + is_void_return = (Cmp(ocpp_return_type, "void") == 0); + if (!is_void_return) + Wrapper_add_localv(f, "oresult", ocpp_return_type, "oresult", NIL); + + Printv(f->def, ocpp_return_type, " ", wname, "(", NIL); + Printv(ocpp_h_code, ocpp_return_type, " ", wname, "(", NIL); + + // Emit all of the local variables for holding arguments. + emit_parameter_variables(l, f); + + // Attach the standard typemaps + emit_attach_parmmaps(l, f); + + // Parameter overloading + Setattr(n, "wrap:parms", l); + Setattr(n, "wrap:name", wname); + + // Wrappers not wanted for some methods where the parameters cannot be overloaded in Objective-C + if (Getattr(n, "sym:overloaded")) { + // Emit warnings for the few cases that can't be overloaded in Objective-C and give up on generating wrapper + Swig_overload_check(n); + if (Getattr(n, "overload:ignore")) + return SWIG_OK; + } + // Get number of required and total arguments + num_arguments = emit_num_arguments(l); + num_required = emit_num_required(l); + int gencomma = 0; + + // Now walk the function parameter list and generate code to get arguments + for (i = 0, p = l; i < num_arguments; i++) { + + while (checkAttribute(p, "tmap:in:numinputs", "0")) { + p = Getattr(p, "tmap:in:next"); + } + + SwigType *pt = Getattr(p, "type"); + String *ln = Getattr(p, "lname"); + String *ocpp_param_type = NewString(""); + String *arg = NewString(""); + + Printf(arg, "o%s", ln); + + if ((tm = Getattr(p, "tmap:ocpptype"))) { + const String *inattributes = Getattr(p, "tmap:ocpptype:inattributes"); + Printf(ocpp_param_type, "%s%s", inattributes ? inattributes : empty_string, tm); + } else { + Swig_warning(WARN_NONE, input_file, line_number, "No ocpptype typemap defined for %s\n", SwigType_str(pt, 0)); + } + + // Add parameter to the objcpp function + Printv(f->def, gencomma ? ", " : "", ocpp_param_type, " ", arg, NIL); + Printv(ocpp_h_code, gencomma ? ", " : "", ocpp_param_type, " ", arg, NIL); + + gencomma = 1; + + // Get typemap for this argument + if ((tm = Getattr(p, "tmap:in"))) { + addThrows(n, "tmap:in", p); + Replaceall(tm, "\$source", arg); /* deprecated */ + Replaceall(tm, "\$target", ln); /* deprecated */ + Replaceall(tm, "\$arg", arg); /* deprecated? */ + Replaceall(tm, "\$input", arg); + Setattr(p, "emit:input", arg); + Printf(f->code, "%s\n", tm); + p = Getattr(p, "tmap:in:next"); + } else { + Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(pt, 0)); + p = nextSibling(p); + } + Delete(ocpp_param_type); + Delete(arg); + } + + /* Insert constraint checking code */ + for (p = l; p;) { + if ((tm = Getattr(p, "tmap:check"))) { + addThrows(n, "tmap:check", p); + Replaceall(tm, "\$target", Getattr(p, "lname")); /* deprecated */ + Replaceall(tm, "\$arg", Getattr(p, "emit:input")); /* deprecated? */ + Replaceall(tm, "\$input", Getattr(p, "emit:input")); + Printv(f->code, tm, "\n", NIL); + p = Getattr(p, "tmap:check:next"); + } else { + p = nextSibling(p); + } + } + + /* Insert cleanup code */ + for (p = l; p;) { + if ((tm = Getattr(p, "tmap:freearg"))) { + addThrows(n, "tmap:freearg", p); + Replaceall(tm, "\$source", Getattr(p, "emit:input")); /* deprecated */ + Replaceall(tm, "\$arg", Getattr(p, "emit:input")); /* deprecated? */ + Replaceall(tm, "\$input", Getattr(p, "emit:input")); + Printv(cleanup, tm, "\n", NIL); + p = Getattr(p, "tmap:freearg:next"); + } else { + p = nextSibling(p); + } + } + + /* Insert argument output code */ + for (p = l; p;) { + if ((tm = Getattr(p, "tmap:argout"))) { + addThrows(n, "tmap:argout", p); + Replaceall(tm, "\$source", Getattr(p, "emit:input")); /* deprecated */ + Replaceall(tm, "\$target", Getattr(p, "lname")); /* deprecated */ + Replaceall(tm, "\$arg", Getattr(p, "emit:input")); /* deprecated? */ + Replaceall(tm, "\$result", "jresult"); + Replaceall(tm, "\$input", Getattr(p, "emit:input")); + Printv(outarg, tm, "\n", NIL); + p = Getattr(p, "tmap:argout:next"); + } else { + p = nextSibling(p); + } + } + + // Get any Objective-C exception classes in the throws typemap + ParmList *throw_parm_list = NULL; + if ((throw_parm_list = Getattr(n, "throws"))) { + Swig_typemap_attach_parms("throws", throw_parm_list, f); + for (p = throw_parm_list; p; p = nextSibling(p)) { + if ((tm = Getattr(p, "tmap:throws"))) { + addThrows(n, "tmap:throws", p); + } + } + } + // Now write code to make the low level function call + if (!native_function_flag) { + if (Cmp(nodeType(n), "constant") == 0) { + // Wrapping a constant hack + Swig_save("functionWrapper", n, "wrap:action", NIL); + + // below based on Swig_VargetToFunction() + SwigType *ty = Swig_wrapped_var_type(Getattr(n, "type"), use_naturalvar_mode(n)); + Setattr(n, "wrap:action", NewStringf("result = (%s) %s;", SwigType_lstr(ty, 0), Getattr(n, "value"))); + } + + String *actioncode = emit_action(n); + + // Handle exception classes specified in the "except" feature's "throws" attribute + addThrows(n, "feature:except", n); + + if (Cmp(nodeType(n), "constant") == 0) + Swig_restore(n); + + // Return value if necessary + if ((tm = Swig_typemap_lookup_out("out", n, "result", f, actioncode))) { + addThrows(n, "tmap:out", n); + Replaceall(tm, "\$source", "result"); /* deprecated */ + Replaceall(tm, "\$target", "oresult"); /* deprecated */ + Replaceall(tm, "\$result", "oresult"); + if (GetFlag(n, "feature:new")) + Replaceall(tm, "\$owner", "1"); + else + Replaceall(tm, "\$owner", "0"); + Printf(f->code, "%s", tm); + if (Len(tm)) + Printf(f->code, "\n"); + } else { + Swig_warning(WARN_TYPEMAP_OUT_UNDEF, input_file, line_number, "Unable to use return type %s in function %s.\n", SwigType_str(t, 0), Getattr(n, "name")); + } + emit_return_variable(n, t, f); + } + + /* Output argument output code */ + Printv(f->code, outarg, NIL); + + /* Output cleanup code */ + Printv(f->code, cleanup, NIL); + + /* Look to see if there is any newfree cleanup code */ + if (GetFlag(n, "feature:new")) { + if ((tm = Swig_typemap_lookup("newfree", n, "result", 0))) { + addThrows(n, "tmap:newfree", n); + Replaceall(tm, "\$source", "result"); /* deprecated */ + Printf(f->code, "%s\n", tm); + } + } + + /* See if there is any return cleanup code */ + if (!native_function_flag) { + if ((tm = Swig_typemap_lookup("ret", n, "result", 0))) { + addThrows(n, "tmap:ret", n); + Replaceall(tm, "\$source", "result"); /* deprecated */ + Printf(f->code, "%s\n", tm); + } + } + // Finish the ocpp header code and wrapper function definition + Printf(ocpp_h_code, ");\n"); + Printf(f->def, ") {"); + + if (!is_void_return) + Printv(f->code, " return oresult;\n", NIL); + + Printf(f->code, "}\n"); + + // Substitute the cleanup code + Replaceall(f->code, "\$cleanup", cleanup); + + // Substitute the function name + Replaceall(f->code, "\$symname", symname); + + /* Contract macro modification */ + Replaceall(f->code, "SWIG_contract_assert(", "SWIG_contract_assert(\$null, "); + + if (!is_void_return) + Replaceall(f->code, "\$null", "0"); + else + Replaceall(f->code, "\$null", ""); + + // Dump the function out + if (!native_function_flag) { + Wrapper_print(f, f_wrappers); + } + + if (!(proxy_flag && is_wrapping_class()) && !enum_constant_flag) { + Setattr(n, "ocppfuncname", wname); + proxyGlobalFunctionHandler(n); + } + + /* + * Generate the proxy class getters/setters for public member variables. + * Not for enums and constants. + */ + if (proxy_flag && wrapping_member_flag && !enum_constant_flag) { + // Capitalize the first letter in the variable to create getter/setter function name + bool getter_flag = Cmp(symname, Swig_name_set(Swig_name_member(proxy_class_name, variable_name))) != 0; + + String *getter_setter_name = NewString(""); + if (!getter_flag) + Printf(getter_setter_name, "set"); + else + Printf(getter_setter_name, "get"); + Putc(toupper((int) *Char(variable_name)), getter_setter_name); + Printf(getter_setter_name, "%s", Char(variable_name) + 1); + + String *ocppfunctname = NewStringf("ObjCPP_%s", symname); + + Setattr(n, "proxyfuncname", getter_setter_name); + Setattr(n, "ocppfuncname", ocppfunctname); + + proxyClassFunctionHandler(n); + Delete(getter_setter_name); + Delete(ocppfunctname); + } + // Tidy up + Delete(ocpp_return_type); + Delete(wname); + Delete(overloaded_name); + DelWrapper(f); + + return SWIG_OK; + } + + /* ----------------------------------------------------------------------------- * proxyGlobalFunctionHandler() * @@ -745,291 +1041,6 @@ Delete(imcall); } - - /* ----------------------------------------------------------------------------- - * functionWrapper() - * ----------------------------------------------------------------------------- */ - - virtual int functionWrapper(Node *n) { - String *symname = Getattr(n, "sym:name"); - SwigType *t = Getattr(n, "type"); - ParmList *l = Getattr(n, "parms"); - - String *cleanup = NewString(""); - String *outarg = NewString(""); - String *ocpp_return_type = NewString(""); - String *tm; - Parm *p; - int i; - int num_arguments = 0; - int num_required = 0; - bool is_void_return; - String *overloaded_name = getOverloadedName(n); - - if (!Getattr(n, "sym:overloaded")) { - if (!addSymbol(Getattr(n, "sym:name"), n)) - return SWIG_ERROR; - } - - Wrapper *f = NewWrapper(); - String *wname = Swig_name_wrapper(overloaded_name); - - Swig_typemap_attach_parms("ocpptype", l, f); - - /* Get return types */ - if ((tm = Swig_typemap_lookup("ocpptype", n, "", 0))) { - String *ocpptypeout = Getattr(n, "tmap:ocpptype:out"); // the type in the ocpptype typemap's out attribute overrides the type in the typemap - if (ocpptypeout) - tm = ocpptypeout; - Printf(ocpp_return_type, "%s", tm); - } else { - Swig_warning(WARN_NONE, input_file, line_number, "No ocpptype typemap defined for %s\n", SwigType_str(t, 0)); - } - - is_void_return = (Cmp(ocpp_return_type, "void") == 0); - if (!is_void_return) - Wrapper_add_localv(f, "oresult", ocpp_return_type, "oresult", NIL); - - Printv(f->def, ocpp_return_type, " ", wname, "(", NIL); - Printv(ocpp_h_code, ocpp_return_type, " ", wname, "(", NIL); - - // Emit all of the local variables for holding arguments. - emit_parameter_variables(l, f); - - // Attach the standard typemaps - emit_attach_parmmaps(l, f); - - // Parameter overloading - Setattr(n, "wrap:parms", l); - Setattr(n, "wrap:name", wname); - - // Wrappers not wanted for some methods where the parameters cannot be overloaded in Objective-C - if (Getattr(n, "sym:overloaded")) { - // Emit warnings for the few cases that can't be overloaded in Objective-C and give up on generating wrapper - Swig_overload_check(n); - if (Getattr(n, "overload:ignore")) - return SWIG_OK; - } - // Get number of required and total arguments - num_arguments = emit_num_arguments(l); - num_required = emit_num_required(l); - int gencomma = 0; - - // Now walk the function parameter list and generate code to get arguments - for (i = 0, p = l; i < num_arguments; i++) { - - while (checkAttribute(p, "tmap:in:numinputs", "0")) { - p = Getattr(p, "tmap:in:next"); - } - - SwigType *pt = Getattr(p, "type"); - String *ln = Getattr(p, "lname"); - String *ocpp_param_type = NewString(""); - String *arg = NewString(""); - - Printf(arg, "o%s", ln); - - if ((tm = Getattr(p, "tmap:ocpptype"))) { - const String *inattributes = Getattr(p, "tmap:ocpptype:inattributes"); - Printf(ocpp_param_type, "%s%s", inattributes ? inattributes : empty_string, tm); - } else { - Swig_warning(WARN_NONE, input_file, line_number, "No ocpptype typemap defined for %s\n", SwigType_str(pt, 0)); - } - - // Add parameter to the objcpp function - Printv(f->def, gencomma ? ", " : "", ocpp_param_type, " ", arg, NIL); - Printv(ocpp_h_code, gencomma ? ", " : "", ocpp_param_type, " ", arg, NIL); - - gencomma = 1; - - // Get typemap for this argument - if ((tm = Getattr(p, "tmap:in"))) { - addThrows(n, "tmap:in", p); - Replaceall(tm, "\$source", arg); /* deprecated */ - Replaceall(tm, "\$target", ln); /* deprecated */ - Replaceall(tm, "\$arg", arg); /* deprecated? */ - Replaceall(tm, "\$input", arg); - Setattr(p, "emit:input", arg); - Printf(f->code, "%s\n", tm); - p = Getattr(p, "tmap:in:next"); - } else { - Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(pt, 0)); - p = nextSibling(p); - } - Delete(ocpp_param_type); - Delete(arg); - } - - /* Insert constraint checking code */ - for (p = l; p;) { - if ((tm = Getattr(p, "tmap:check"))) { - addThrows(n, "tmap:check", p); - Replaceall(tm, "\$target", Getattr(p, "lname")); /* deprecated */ - Replaceall(tm, "\$arg", Getattr(p, "emit:input")); /* deprecated? */ - Replaceall(tm, "\$input", Getattr(p, "emit:input")); - Printv(f->code, tm, "\n", NIL); - p = Getattr(p, "tmap:check:next"); - } else { - p = nextSibling(p); - } - } - - /* Insert cleanup code */ - for (p = l; p;) { - if ((tm = Getattr(p, "tmap:freearg"))) { - addThrows(n, "tmap:freearg", p); - Replaceall(tm, "\$source", Getattr(p, "emit:input")); /* deprecated */ - Replaceall(tm, "\$arg", Getattr(p, "emit:input")); /* deprecated? */ - Replaceall(tm, "\$input", Getattr(p, "emit:input")); - Printv(cleanup, tm, "\n", NIL); - p = Getattr(p, "tmap:freearg:next"); - } else { - p = nextSibling(p); - } - } - - /* Insert argument output code */ - for (p = l; p;) { - if ((tm = Getattr(p, "tmap:argout"))) { - addThrows(n, "tmap:argout", p); - Replaceall(tm, "\$source", Getattr(p, "emit:input")); /* deprecated */ - Replaceall(tm, "\$target", Getattr(p, "lname")); /* deprecated */ - Replaceall(tm, "\$arg", Getattr(p, "emit:input")); /* deprecated? */ - Replaceall(tm, "\$result", "jresult"); - Replaceall(tm, "\$input", Getattr(p, "emit:input")); - Printv(outarg, tm, "\n", NIL); - p = Getattr(p, "tmap:argout:next"); - } else { - p = nextSibling(p); - } - } - - // Get any Objective-C exception classes in the throws typemap - ParmList *throw_parm_list = NULL; - if ((throw_parm_list = Getattr(n, "throws"))) { - Swig_typemap_attach_parms("throws", throw_parm_list, f); - for (p = throw_parm_list; p; p = nextSibling(p)) { - if ((tm = Getattr(p, "tmap:throws"))) { - addThrows(n, "tmap:throws", p); - } - } - } - // Now write code to make the low level function call - if (!native_function_flag) { - String *actioncode = emit_action(n); - - // Handle exception classes specified in the "except" feature's "throws" attribute - addThrows(n, "feature:except", n); - - // Return value if necessary - if ((tm = Swig_typemap_lookup_out("out", n, "result", f, actioncode))) { - addThrows(n, "tmap:out", n); - Replaceall(tm, "\$source", "result"); /* deprecated */ - Replaceall(tm, "\$target", "oresult"); /* deprecated */ - Replaceall(tm, "\$result", "oresult"); - if (GetFlag(n, "feature:new")) - Replaceall(tm, "\$owner", "1"); - else - Replaceall(tm, "\$owner", "0"); - Printf(f->code, "%s", tm); - if (Len(tm)) - Printf(f->code, "\n"); - } else { - Swig_warning(WARN_TYPEMAP_OUT_UNDEF, input_file, line_number, "Unable to use return type %s in function %s.\n", SwigType_str(t, 0), Getattr(n, "name")); - } - emit_return_variable(n, t, f); - } - - /* Output argument output code */ - Printv(f->code, outarg, NIL); - - /* Output cleanup code */ - Printv(f->code, cleanup, NIL); - - /* Look to see if there is any newfree cleanup code */ - if (GetFlag(n, "feature:new")) { - if ((tm = Swig_typemap_lookup("newfree", n, "result", 0))) { - addThrows(n, "tmap:newfree", n); - Replaceall(tm, "\$source", "result"); /* deprecated */ - Printf(f->code, "%s\n", tm); - } - } - - /* See if there is any return cleanup code */ - if (!native_function_flag) { - if ((tm = Swig_typemap_lookup("ret", n, "result", 0))) { - addThrows(n, "tmap:ret", n); - Replaceall(tm, "\$source", "result"); /* deprecated */ - Printf(f->code, "%s\n", tm); - } - } - // Finish the ocpp header code and wrapper function definition - Printf(ocpp_h_code, ");\n"); - Printf(f->def, ") {"); - - if (!is_void_return) - Printv(f->code, " return oresult;\n", NIL); - - Printf(f->code, "}\n"); - - // Substitute the cleanup code - Replaceall(f->code, "\$cleanup", cleanup); - - // Substitute the function name - Replaceall(f->code, "\$symname", symname); - - /* Contract macro modification */ - Replaceall(f->code, "SWIG_contract_assert(", "SWIG_contract_assert(\$null, "); - - if (!is_void_return) - Replaceall(f->code, "\$null", "0"); - else - Replaceall(f->code, "\$null", ""); - - // Dump the function out - if (!native_function_flag) { - Wrapper_print(f, f_wrappers); - } - - if (!(proxy_flag && is_wrapping_class()) && !enum_constant_flag) { - Setattr(n, "ocppfuncname", wname); - proxyGlobalFunctionHandler(n); - } - - /* - * Generate the proxy class getters/setters for public member variables. - * Not for enums and constants. - */ - if (proxy_flag && wrapping_member_flag && !enum_constant_flag) { - // Capitalize the first letter in the variable to create getter/setter function name - bool getter_flag = Cmp(symname, Swig_name_set(Swig_name_member(proxy_class_name, variable_name))) != 0; - - String *getter_setter_name = NewString(""); - if (!getter_flag) - Printf(getter_setter_name, "set"); - else - Printf(getter_setter_name, "get"); - Putc(toupper((int) *Char(variable_name)), getter_setter_name); - Printf(getter_setter_name, "%s", Char(variable_name) + 1); - - String *ocppfunctname = NewStringf("ObjCPP_%s", symname); - - Setattr(n, "proxyfuncname", getter_setter_name); - Setattr(n, "ocppfuncname", ocppfunctname); - - proxyClassFunctionHandler(n); - Delete(getter_setter_name); - Delete(ocppfunctname); - } - // Tidy up - Delete(ocpp_return_type); - Delete(wname); - Delete(overloaded_name); - DelWrapper(f); - - return SWIG_OK; - } - /* ---------------------------------------------------------------------- * constructorHandler() * ---------------------------------------------------------------------- */ @@ -1554,15 +1565,13 @@ bool classname_substituted_flag = false; if ((tm = Swig_typemap_lookup("objctype", n, "", 0))) { - String *objctypeout = Getattr(n, "tmap:objctype:out"); // the type in the objctype typemap's out attribute overrides the type in the typemap - if (objctypeout) - tm = objctypeout; classname_substituted_flag = substituteClassname(t, tm); Printf(return_type, "%s", tm); } else { Swig_warning(WARN_NONE, input_file, line_number, "No objctype typemap defined for %s\n", SwigType_str(t, 0)); } + // Add the stripped quotes back in String *new_value = NewString(""); Swig_save("constantWrapper", n, "value", NIL); @@ -1579,7 +1588,7 @@ Printf(constants_code, " %s\n", outattributes); const String *itemname = (proxy_flag && wrapping_member_flag) ? variable_name : symname; - Printf(constants_code, " %s %s %s = ", (const_feature_flag ? "const" : "static"), return_type, itemname); + Printf(constants_code, "%s %s %s = ", (const_feature_flag ? "const" : "static"), return_type, itemname); // Check for the %objcconstvalue feature String *value = Getattr(n, "feature:objc:constvalue"); @@ -1595,7 +1604,7 @@ Printf(constants_code, "(%s)%s();\n", return_type, Swig_name_get(symname)); } else { // This handles function pointers using the %constant directive - Printf(constants_code, "new %s(%s(), false);\n", return_type, Swig_name_get(symname)); + Printf(constants_code, "[[[%s alloc] initWithCptr: &%s()] autorelease];\n", return_type, Swig_name_get(symname)); } } else Printf(constants_code, "%s();\n", Swig_name_get(symname)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Swig-cvs] SF.net SVN: swig:[11700] branches/gsoc2009-ashishs99 From: - 2009-10-16 19:20:01 ```Revision: 11700 http://swig.svn.sourceforge.net/swig/?rev=11700&view=rev Author: ashishs99 Date: 2009-10-16 19:19:49 +0000 (Fri, 16 Oct 2009) Log Message: ----------- Merged trunk changes r11207:r11696 into this branch Modified Paths: -------------- branches/gsoc2009-ashishs99/ANNOUNCE branches/gsoc2009-ashishs99/CCache/Makefile.in branches/gsoc2009-ashishs99/CHANGES branches/gsoc2009-ashishs99/CHANGES.current branches/gsoc2009-ashishs99/Doc/Manual/Allegrocl.html branches/gsoc2009-ashishs99/Doc/Manual/Arguments.html branches/gsoc2009-ashishs99/Doc/Manual/CSharp.html branches/gsoc2009-ashishs99/Doc/Manual/Contents.html branches/gsoc2009-ashishs99/Doc/Manual/Extending.html branches/gsoc2009-ashishs99/Doc/Manual/Guile.html branches/gsoc2009-ashishs99/Doc/Manual/Java.html branches/gsoc2009-ashishs99/Doc/Manual/Library.html branches/gsoc2009-ashishs99/Doc/Manual/Modules.html branches/gsoc2009-ashishs99/Doc/Manual/Ocaml.html branches/gsoc2009-ashishs99/Doc/Manual/Perl5.html branches/gsoc2009-ashishs99/Doc/Manual/Php.html branches/gsoc2009-ashishs99/Doc/Manual/Python.html branches/gsoc2009-ashishs99/Doc/Manual/Ruby.html branches/gsoc2009-ashishs99/Doc/Manual/SWIG.html branches/gsoc2009-ashishs99/Doc/Manual/SWIGPlus.html branches/gsoc2009-ashishs99/Doc/Manual/Sections.html branches/gsoc2009-ashishs99/Doc/Manual/Tcl.html branches/gsoc2009-ashishs99/Doc/Manual/Typemaps.html branches/gsoc2009-ashishs99/Doc/Manual/Windows.html branches/gsoc2009-ashishs99/Examples/Makefile.in branches/gsoc2009-ashishs99/Examples/java/pointer/index.html branches/gsoc2009-ashishs99/Examples/perl5/pointer/index.html branches/gsoc2009-ashishs99/Examples/php/check.list branches/gsoc2009-ashishs99/Examples/php/class/Makefile branches/gsoc2009-ashishs99/Examples/php/class/runme.php branches/gsoc2009-ashishs99/Examples/php/reference/Makefile branches/gsoc2009-ashishs99/Examples/php/reference/example.cxx branches/gsoc2009-ashishs99/Examples/php/reference/example.h branches/gsoc2009-ashishs99/Examples/php/reference/example.i branches/gsoc2009-ashishs99/Examples/php/reference/runme.php branches/gsoc2009-ashishs99/Examples/python/callback/example.h branches/gsoc2009-ashishs99/Examples/python/callback/runme.py branches/gsoc2009-ashishs99/Examples/python/pointer/index.html branches/gsoc2009-ashishs99/Examples/ruby/pointer/index.html branches/gsoc2009-ashishs99/Examples/tcl/pointer/index.html branches/gsoc2009-ashishs99/Examples/test-suite/allegrocl/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/cffi/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/char_strings.i branches/gsoc2009-ashishs99/Examples/test-suite/chicken/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/clisp/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/common.mk branches/gsoc2009-ashishs99/Examples/test-suite/constant_pointers.i branches/gsoc2009-ashishs99/Examples/test-suite/constructor_copy.i branches/gsoc2009-ashishs99/Examples/test-suite/csharp/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/csharp/char_strings_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/csharp_attributes_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/enum_thorough_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/enum_thorough_simple_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/enum_thorough_typesafe_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/li_std_vector_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/overload_template_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp_attributes.i branches/gsoc2009-ashishs99/Examples/test-suite/csharp_prepost.i branches/gsoc2009-ashishs99/Examples/test-suite/default_args.i branches/gsoc2009-ashishs99/Examples/test-suite/director_detect.i branches/gsoc2009-ashishs99/Examples/test-suite/director_protected.i branches/gsoc2009-ashishs99/Examples/test-suite/director_stl.i branches/gsoc2009-ashishs99/Examples/test-suite/director_using.i branches/gsoc2009-ashishs99/Examples/test-suite/enum_thorough.i branches/gsoc2009-ashishs99/Examples/test-suite/enum_thorough_typesafe.i branches/gsoc2009-ashishs99/Examples/test-suite/enums.i branches/gsoc2009-ashishs99/Examples/test-suite/guile/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/guilescm/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/java/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/java/char_strings_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/enum_thorough_proper_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/enum_thorough_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/enum_thorough_simple_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/enum_thorough_typeunsafe_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/java_jnitypes_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/java_throws_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/overload_template_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/template_methods_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java_jnitypes.i branches/gsoc2009-ashishs99/Examples/test-suite/java_throws.i branches/gsoc2009-ashishs99/Examples/test-suite/lextype.i branches/gsoc2009-ashishs99/Examples/test-suite/li_cdata.i branches/gsoc2009-ashishs99/Examples/test-suite/li_factory.i branches/gsoc2009-ashishs99/Examples/test-suite/li_math.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_map.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_vector.i branches/gsoc2009-ashishs99/Examples/test-suite/lua/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/lua/overload_template_fast_runme.lua branches/gsoc2009-ashishs99/Examples/test-suite/lua/overload_template_runme.lua branches/gsoc2009-ashishs99/Examples/test-suite/mzscheme/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/name_warnings.i branches/gsoc2009-ashishs99/Examples/test-suite/nested_comment.i branches/gsoc2009-ashishs99/Examples/test-suite/ocaml/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/octave/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/octave/empty_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/octave/exception_order_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/octave/imports_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/octave/li_std_map_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/octave/li_std_vector_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/octave/multi_import_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/octave/overload_template_fast_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/octave/overload_template_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/octave/wrapmacro_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/operator_overload_break.i branches/gsoc2009-ashishs99/Examples/test-suite/overload_template.i branches/gsoc2009-ashishs99/Examples/test-suite/perl5/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/perl5/enum_thorough_runme.pl branches/gsoc2009-ashishs99/Examples/test-suite/perl5/wrapmacro_runme.pl branches/gsoc2009-ashishs99/Examples/test-suite/php/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/php/add_link_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/arrayptr_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/arrays_global_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/arrays_global_twodim_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/arrays_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/arrays_scope_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/casts_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/class_ignore_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/conversion_namespace_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/conversion_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/cpp_static_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/enum_scope_template_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/evil_diamond_ns_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/evil_diamond_prop_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/evil_diamond_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/extend_template_ns_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/extend_template_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/grouping_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/ignore_parameter_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/li_carrays_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/li_std_string_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/rename_scope_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/smart_pointer_rename_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/sym_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/template_arg_typename_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/tests.php branches/gsoc2009-ashishs99/Examples/test-suite/php/valuewrapper_base_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php_namewarn_rename.i branches/gsoc2009-ashishs99/Examples/test-suite/pike/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/python/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/python/director_exception_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/li_std_map_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/overload_template_fast_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/overload_template_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/template_typedef_import_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/wrapmacro_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/r/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/rename_scope.i branches/gsoc2009-ashishs99/Examples/test-suite/ruby/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/ruby/li_std_map_runme.rb branches/gsoc2009-ashishs99/Examples/test-suite/ruby/li_std_vector_runme.rb branches/gsoc2009-ashishs99/Examples/test-suite/ruby/overload_template_runme.rb branches/gsoc2009-ashishs99/Examples/test-suite/ruby/primitive_types_runme.rb branches/gsoc2009-ashishs99/Examples/test-suite/tcl/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/template_default.i branches/gsoc2009-ashishs99/Examples/test-suite/template_default2.i branches/gsoc2009-ashishs99/Examples/test-suite/template_default_qualify.i branches/gsoc2009-ashishs99/Examples/test-suite/template_enum_ns_inherit.i branches/gsoc2009-ashishs99/Examples/test-suite/template_enum_typedef.i branches/gsoc2009-ashishs99/Examples/test-suite/template_methods.i branches/gsoc2009-ashishs99/Examples/test-suite/template_ns4.i branches/gsoc2009-ashishs99/Examples/test-suite/throw_exception.i branches/gsoc2009-ashishs99/Examples/test-suite/typemap_out_optimal.i branches/gsoc2009-ashishs99/Examples/test-suite/typemap_subst.i branches/gsoc2009-ashishs99/Examples/test-suite/uffi/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/valuewrapper_base.i branches/gsoc2009-ashishs99/Examples/test-suite/wrapmacro.i branches/gsoc2009-ashishs99/Lib/allkw.swg branches/gsoc2009-ashishs99/Lib/cdata.i branches/gsoc2009-ashishs99/Lib/csharp/csharp.swg branches/gsoc2009-ashishs99/Lib/csharp/csharphead.swg branches/gsoc2009-ashishs99/Lib/csharp/std_map.i branches/gsoc2009-ashishs99/Lib/csharp/std_vector.i branches/gsoc2009-ashishs99/Lib/exception.i branches/gsoc2009-ashishs99/Lib/intrusive_ptr.i branches/gsoc2009-ashishs99/Lib/java/javahead.swg branches/gsoc2009-ashishs99/Lib/lua/luarun.swg branches/gsoc2009-ashishs99/Lib/octave/octrun.swg branches/gsoc2009-ashishs99/Lib/octave/octruntime.swg branches/gsoc2009-ashishs99/Lib/octave/octtypemaps.swg branches/gsoc2009-ashishs99/Lib/perl5/noembed.h branches/gsoc2009-ashishs99/Lib/perl5/perlrun.swg branches/gsoc2009-ashishs99/Lib/perl5/reference.i branches/gsoc2009-ashishs99/Lib/php/php.swg branches/gsoc2009-ashishs99/Lib/php/phpkw.swg branches/gsoc2009-ashishs99/Lib/php/phprun.swg branches/gsoc2009-ashishs99/Lib/php/std_string.i branches/gsoc2009-ashishs99/Lib/php/std_vector.i branches/gsoc2009-ashishs99/Lib/php/utils.i branches/gsoc2009-ashishs99/Lib/python/director.swg branches/gsoc2009-ashishs99/Lib/python/pyrun.swg branches/gsoc2009-ashishs99/Lib/python/std_map.i branches/gsoc2009-ashishs99/Lib/ruby/director.swg branches/gsoc2009-ashishs99/Lib/ruby/rubycontainer.swg branches/gsoc2009-ashishs99/Lib/ruby/rubyhead.swg branches/gsoc2009-ashishs99/Lib/ruby/rubyprimtypes.swg branches/gsoc2009-ashishs99/Lib/swig.swg branches/gsoc2009-ashishs99/Lib/tcl/std_vector.i branches/gsoc2009-ashishs99/Lib/tcl/tclinit.swg branches/gsoc2009-ashishs99/Lib/tcl/typemaps.i branches/gsoc2009-ashishs99/Lib/typemaps/cdata.swg branches/gsoc2009-ashishs99/Lib/typemaps/fragments.swg branches/gsoc2009-ashishs99/Lib/typemaps/swigmacros.swg branches/gsoc2009-ashishs99/Makefile.in branches/gsoc2009-ashishs99/README branches/gsoc2009-ashishs99/Source/CParse/cscanner.c branches/gsoc2009-ashishs99/Source/CParse/parser.y branches/gsoc2009-ashishs99/Source/Include/swigwarn.h branches/gsoc2009-ashishs99/Source/Makefile.am branches/gsoc2009-ashishs99/Source/Modules/allegrocl.cxx branches/gsoc2009-ashishs99/Source/Modules/allocate.cxx branches/gsoc2009-ashishs99/Source/Modules/cffi.cxx branches/gsoc2009-ashishs99/Source/Modules/clisp.cxx branches/gsoc2009-ashishs99/Source/Modules/csharp.cxx branches/gsoc2009-ashishs99/Source/Modules/emit.cxx branches/gsoc2009-ashishs99/Source/Modules/java.cxx branches/gsoc2009-ashishs99/Source/Modules/lang.cxx branches/gsoc2009-ashishs99/Source/Modules/modula3.cxx branches/gsoc2009-ashishs99/Source/Modules/ocaml.cxx branches/gsoc2009-ashishs99/Source/Modules/octave.cxx branches/gsoc2009-ashishs99/Source/Modules/overload.cxx branches/gsoc2009-ashishs99/Source/Modules/perl5.cxx branches/gsoc2009-ashishs99/Source/Modules/php.cxx branches/gsoc2009-ashishs99/Source/Modules/python.cxx branches/gsoc2009-ashishs99/Source/Modules/r.cxx branches/gsoc2009-ashishs99/Source/Modules/ruby.cxx branches/gsoc2009-ashishs99/Source/Modules/swigmod.h branches/gsoc2009-ashishs99/Source/Modules/tcl8.cxx branches/gsoc2009-ashishs99/Source/Modules/typepass.cxx branches/gsoc2009-ashishs99/Source/Modules/uffi.cxx branches/gsoc2009-ashishs99/Source/Preprocessor/cpp.c branches/gsoc2009-ashishs99/Source/Swig/cwrap.c branches/gsoc2009-ashishs99/Source/Swig/naming.c branches/gsoc2009-ashishs99/Source/Swig/scanner.c branches/gsoc2009-ashishs99/Source/Swig/swig.h branches/gsoc2009-ashishs99/Source/Swig/swigscan.h branches/gsoc2009-ashishs99/Source/Swig/typemap.c branches/gsoc2009-ashishs99/Tools/mkrelease.py branches/gsoc2009-ashishs99/configure.in Added Paths: ----------- branches/gsoc2009-ashishs99/Examples/php/callback/ branches/gsoc2009-ashishs99/Examples/php/callback/Makefile branches/gsoc2009-ashishs99/Examples/php/callback/example.cxx branches/gsoc2009-ashishs99/Examples/php/callback/example.h branches/gsoc2009-ashishs99/Examples/php/callback/example.i branches/gsoc2009-ashishs99/Examples/php/callback/index.html branches/gsoc2009-ashishs99/Examples/php/callback/runme.php branches/gsoc2009-ashishs99/Examples/php/extend/ branches/gsoc2009-ashishs99/Examples/php/extend/Makefile branches/gsoc2009-ashishs99/Examples/php/extend/example.cxx branches/gsoc2009-ashishs99/Examples/php/extend/example.h branches/gsoc2009-ashishs99/Examples/php/extend/example.i branches/gsoc2009-ashishs99/Examples/php/extend/index.html branches/gsoc2009-ashishs99/Examples/php/extend/runme.php branches/gsoc2009-ashishs99/Examples/test-suite/catches.i branches/gsoc2009-ashishs99/Examples/test-suite/csharp/catches_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/exception_order_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/li_std_map_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/preproc_constants_c_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/preproc_constants_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/special_variable_macros_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/java/memberin_extend_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/special_variable_macros_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/wallkw_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/li_reference.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_combinations.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_multimap.i branches/gsoc2009-ashishs99/Examples/test-suite/memberin_extend.i branches/gsoc2009-ashishs99/Examples/test-suite/perl5/li_reference_runme.pl branches/gsoc2009-ashishs99/Examples/test-suite/php/char_strings_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/director_abstract_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/director_basic_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/director_classic_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/director_default_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/director_detect_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/director_enum_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/director_exception_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/director_extend_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/director_finalizer_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/director_frob_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/director_nested_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/director_profile_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/director_protected_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/director_stl_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/director_string_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/director_thread_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/director_unroll_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/import_nomodule_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/li_factory_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/newobject1_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/overload_rename_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/pointer_reference_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/prefix_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/primitive_ref_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/prefix.i branches/gsoc2009-ashishs99/Examples/test-suite/preproc_constants.i branches/gsoc2009-ashishs99/Examples/test-suite/preproc_constants_c.i branches/gsoc2009-ashishs99/Examples/test-suite/python/li_cdata_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/special_variable_macros_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/ruby/li_std_multimap_runme.rb branches/gsoc2009-ashishs99/Examples/test-suite/special_variable_macros.i branches/gsoc2009-ashishs99/Examples/test-suite/wallkw.i branches/gsoc2009-ashishs99/Lib/php/director.swg branches/gsoc2009-ashishs99/Lib/php/factory.i Removed Paths: ------------- branches/gsoc2009-ashishs99/Examples/php/callback/Makefile branches/gsoc2009-ashishs99/Examples/php/callback/example.cxx branches/gsoc2009-ashishs99/Examples/php/callback/example.h branches/gsoc2009-ashishs99/Examples/php/callback/example.i branches/gsoc2009-ashishs99/Examples/php/callback/index.html branches/gsoc2009-ashishs99/Examples/php/callback/runme.php branches/gsoc2009-ashishs99/Examples/php/extend/Makefile branches/gsoc2009-ashishs99/Examples/php/extend/example.cxx branches/gsoc2009-ashishs99/Examples/php/extend/example.h branches/gsoc2009-ashishs99/Examples/php/extend/example.i branches/gsoc2009-ashishs99/Examples/php/extend/index.html branches/gsoc2009-ashishs99/Examples/php/extend/runme.php branches/gsoc2009-ashishs99/Examples/test-suite/octave/director_exception_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/octave/director_finalizer_runme.m Property Changed: ---------------- branches/gsoc2009-ashishs99/ branches/gsoc2009-ashishs99/CCache/ branches/gsoc2009-ashishs99/CCache/web/ branches/gsoc2009-ashishs99/Examples/GIFPlot/Php/ branches/gsoc2009-ashishs99/Examples/php/class/runme.php branches/gsoc2009-ashishs99/Examples/php/constants/runme.php branches/gsoc2009-ashishs99/Examples/php/cpointer/runme.php branches/gsoc2009-ashishs99/Examples/php/disown/runme.php branches/gsoc2009-ashishs99/Examples/php/enum/runme.php branches/gsoc2009-ashishs99/Examples/php/funcptr/runme.php branches/gsoc2009-ashishs99/Examples/php/overloading/runme.php branches/gsoc2009-ashishs99/Examples/php/pointer/runme.php branches/gsoc2009-ashishs99/Examples/php/pragmas/runme.php branches/gsoc2009-ashishs99/Examples/php/proxy/runme.php branches/gsoc2009-ashishs99/Examples/php/reference/runme.php branches/gsoc2009-ashishs99/Examples/php/simple/runme.php branches/gsoc2009-ashishs99/Examples/php/sync/runme.php branches/gsoc2009-ashishs99/Examples/php/value/runme.php branches/gsoc2009-ashishs99/Examples/php/variables/runme.php branches/gsoc2009-ashishs99/Examples/test-suite/chicken/chicken_ext_test_runme.ss branches/gsoc2009-ashishs99/Examples/test-suite/chicken_ext_test.i branches/gsoc2009-ashishs99/Examples/test-suite/guilescm/guilescm_ext_test_runme.scm branches/gsoc2009-ashishs99/Examples/test-suite/guilescm_ext_test.i branches/gsoc2009-ashishs99/Examples/test-suite/implicittest.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_functors.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_list.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_pair_extra.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_pair_lang_object.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_queue.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_stack.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_string_extra.i branches/gsoc2009-ashishs99/Examples/test-suite/octave/li_std_pair_extra_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/octave/li_std_string_extra_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/octave/octave_cell_deref_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/octave_cell_deref.i branches/gsoc2009-ashishs99/Examples/test-suite/php/abstract_inherit_ok_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/abstract_inherit_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/add_link_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/argout_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/arrayptr_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/arrays_global_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/arrays_global_twodim_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/arrays_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/arrays_scope_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/casts_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/class_ignore_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/conversion_namespace_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/conversion_ns_template_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/conversion_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/cpp_static_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/enum_scope_template_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/evil_diamond_ns_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/evil_diamond_prop_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/evil_diamond_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/extend_template_ns_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/extend_template_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/grouping_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/ignore_parameter_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/li_carrays_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/li_std_string_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/rename_scope_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/skel.php branches/gsoc2009-ashishs99/Examples/test-suite/php/smart_pointer_rename_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/sym_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/template_arg_typename_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/template_construct_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/tests.php branches/gsoc2009-ashishs99/Examples/test-suite/php/typedef_reference_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/typemap_ns_using_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/using1_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/using2_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/valuewrapper_base_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php_namewarn_rename.i branches/gsoc2009-ashishs99/Examples/test-suite/python/li_std_pair_extra_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/li_std_string_extra_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/r/r_copy_struct_runme.R branches/gsoc2009-ashishs99/Examples/test-suite/r/r_double_delete_runme.R branches/gsoc2009-ashishs99/Examples/test-suite/r/r_legacy_runme.R branches/gsoc2009-ashishs99/Examples/test-suite/r_copy_struct.i branches/gsoc2009-ashishs99/Examples/test-suite/r_double_delete.i branches/gsoc2009-ashishs99/Examples/test-suite/r_legacy.i branches/gsoc2009-ashishs99/Examples/test-suite/ruby/ruby_keywords_runme.rb branches/gsoc2009-ashishs99/Examples/test-suite/ruby/ruby_li_std_speed_runme.rb branches/gsoc2009-ashishs99/Examples/test-suite/ruby/ruby_naming_runme.rb branches/gsoc2009-ashishs99/Examples/test-suite/ruby/ruby_track_objects_directors_runme.rb branches/gsoc2009-ashishs99/Examples/test-suite/ruby/ruby_track_objects_runme.rb branches/gsoc2009-ashishs99/Examples/test-suite/ruby_keywords.i branches/gsoc2009-ashishs99/Examples/test-suite/ruby_li_std_speed.i branches/gsoc2009-ashishs99/Examples/test-suite/ruby_naming.i branches/gsoc2009-ashishs99/Examples/test-suite/ruby_track_objects.i branches/gsoc2009-ashishs99/Examples/test-suite/ruby_track_objects_directors.i branches/gsoc2009-ashishs99/Examples/test-suite/simple_array.i branches/gsoc2009-ashishs99/Examples/test-suite/stl_new.i branches/gsoc2009-ashishs99/Examples/test-suite/union_parameter.i branches/gsoc2009-ashishs99/Source/Swig/swigfile.h branches/gsoc2009-ashishs99/Source/Swig/swigopt.h branches/gsoc2009-ashishs99/Source/Swig/swigparm.h branches/gsoc2009-ashishs99/Source/Swig/swigscan.h branches/gsoc2009-ashishs99/Source/Swig/swigtree.h branches/gsoc2009-ashishs99/Source/Swig/swigwrap.h Property changes on: branches/gsoc2009-ashishs99 ___________________________________________________________________ Modified: svn:mergeinfo - /branches/swig-2.0:11085-11086,11088-11089 + /branches/swig-2.0:11085-11086,11088-11089 /trunk:11208-11696 Modified: branches/gsoc2009-ashishs99/ANNOUNCE =================================================================== --- branches/gsoc2009-ashishs99/ANNOUNCE 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/ANNOUNCE 2009-10-16 19:19:49 UTC (rev 11700) @@ -1,10 +1,10 @@ -*** ANNOUNCE: SWIG 1.3.40 (in progress) *** +*** ANNOUNCE: SWIG 1.3.41 (in progress) *** http://www.swig.org -We're pleased to announce SWIG-1.3.40, the latest installment in the -SWIG development effort. SWIG-1.3.40 includes a number of bug fixes +We're pleased to announce SWIG-1.3.41, the latest installment in the +SWIG development effort. SWIG-1.3.41 includes a number of bug fixes and enhancements. What is SWIG? @@ -24,11 +24,11 @@ ------------- The release is available for download on Sourceforge at - http://prdownloads.sourceforge.net/swig/swig-1.3.40.tar.gz + http://prdownloads.sourceforge.net/swig/swig-1.3.41.tar.gz A Windows version is also available at - http://prdownloads.sourceforge.net/swig/swigwin-1.3.40.zip + http://prdownloads.sourceforge.net/swig/swigwin-1.3.41.zip Please report problems with this release to the swig-dev mailing list, details at http://www.swig.org/mail.html. Property changes on: branches/gsoc2009-ashishs99/CCache ___________________________________________________________________ Modified: svn:ignore - Makefile ccache *gz config.h config.log config.status tca.log tca.map + Makefile autom4te.cache ccache-swig ccache-swig.1 ccache-swig.exe ccache_swig_config.h *gz configure config.h config.h.in config.log config.status tca.log tca.map Modified: branches/gsoc2009-ashishs99/CCache/Makefile.in =================================================================== --- branches/gsoc2009-ashishs99/CCache/Makefile.in 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/CCache/Makefile.in 2009-10-16 19:19:49 UTC (rev 11700) @@ -37,7 +37,6 @@ -yodl2man -o \$(PACKAGE_NAME).1 ccache.yo web/ccache-man.html: ccache.yo - mkdir -p man yodl2html -o web/ccache-man.html ccache.yo install: \$(PACKAGE_NAME)\$(EXEEXT) \$(PACKAGE_NAME).1 @@ -53,7 +52,7 @@ clean: /bin/rm -f \$(OBJS) *~ \$(PACKAGE_NAME)\$(EXEEXT) -clean-docs: +distclean-docs: rm -f \$(PACKAGE_NAME).1 web/ccache-man.html check : test @@ -63,8 +62,8 @@ check: test -distclean: clean - /bin/rm -f Makefile config.h config.sub config.log build-stamp config.status configure config.h +distclean: clean distclean-docs + /bin/rm -f Makefile config.h config.sub config.log build-stamp config.status configure config.h.in ccache_swig_config.h # FIXME: To fix this, test.sh needs to be able to take ccache from the # installed prefix, not from the source dir. Property changes on: branches/gsoc2009-ashishs99/CCache/web ___________________________________________________________________ Added: svn:ignore + ccache-man.html Modified: branches/gsoc2009-ashishs99/CHANGES =================================================================== --- branches/gsoc2009-ashishs99/CHANGES 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/CHANGES 2009-10-16 19:19:49 UTC (rev 11700) @@ -2,6 +2,264 @@ See CHANGES.current for current version. +Version 1.3.40 (18 August 2009) +=============================== + +2009-08-17: olly + [Perl] Add "#undef do_exec" to our clean up of Perl global + namespace pollution. + +2009-08-17: olly + [PHP] Fix to wrap a resource returned by __get() in a PHP object (SF#2549217). + +2009-08-17: wsfulton + Fix #2797485 After doing a 'make clean', install fails if yodl2man or yodl2html + is not available. + +2009-08-16: wsfulton + [Octave] Caught exceptions display the type of the C++ exception instead of the + generic "c++-side threw an exception" message. + +2009-08-16: wsfulton + [Java] When %catches is used, fix so that any classes specified in the "throws" + attribute of the "throws" typemap are generated into the Java method's throws clause. + +2009-08-16: wsfulton + [C#] Fix exception handling when %catches is used, reported by Juan Manuel Alvarez. + +2009-08-15: wsfulton + Fix %template seg fault on some cases of overloading the templated method. + Bug reported by Jan Kupec. + +2009-08-15: wsfulton + [Ruby] Add numerous missing wrapped methods for std::vector specialization + as reported by Youssef Jones. + +2009-08-14: wsfulton + [Perl] Add SWIG_ConvertPtrAndOwn() method into the runtime for smart pointer + memory ownership control. shared_ptr support still to be added. Patch from + David Fletcher. + +2009-08-14: olly + [PHP] PHP5 now wraps static member variables as documented. + +2009-08-14: olly + [PHP] Update the PHP "class" example to work with PHP5 and use + modern wrapping features. + +2009-08-13: wsfulton + [PHP] std::vector wrappers overhaul. They no longer require the + specialize_std_vector() macro. Added wrappers for capacity() and reserve(). + +2009-08-13: wsfulton + [PHP] Add const reference typemaps. const reference primitive types are + now passed by value rather than pointer like the other target languages. + Fixes SF#2524029. + +2009-08-08: wsfulton + [Python] More user friendly AttributeError is raised when there are + no constructors generated for the proxy class in the event that the + class is abstract - the error message is now + "No constructor defined - class is abstract" whereas if there are no + public constructors for any other reason and the class is not abstract, + the message remains + "No constructor defined". + [tcl] Similarly for tcl when using -itcl. + +2009-08-04: olly + [PHP] Fix generated code to work with PHP 5.3. + +2009-08-04: vmiklos + [PHP] Various mathematical functions (which would conflict + with the built-in PHP ones) are now automatically handled by + adding a 'c_' prefix. + +2009-08-03: wsfulton + [C#] The std::vector implementation is improved and now uses \$typemap such + that the proxy class for T no longer has to be specified in some macros + for correct C# compilation; the following macros are deprecated, where + CSTYPE was the C# type for the C++ class CTYPE: + + SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(CSTYPE, CTYPE) + usage should be removed altogether + + SWIG_STD_VECTOR_SPECIALIZE(CSTYPE, CTYPE) + should be replaced with: + SWIG_STD_VECTOR_ENHANCED(CTYPE) + + Some more details in csharp/std_vector.i + + *** POTENTIAL INCOMPATIBILITY *** + +2009-07-31: olly + [Python] Fix indentation so that we give a useful error if the + module can't be loaded. Patch from Gaetan Lehmann in SF#2829853. + +2009-07-29: wsfulton + Add \$typemap(method, typelist) special variable macro. This allows + the contents of a typemap to be inserted within another typemap. + Fully documented in Typemaps.html. + +2009-07-29: vmiklos + [PHP] Static member variables are now prefixed with the + class name. This allows static member variables with the + same name in different classes. + +2009-07-29: olly + [Python] Add missing locks to std::map wrappers. Patch from + Paul Hampson in SF#2813836. + +2009-07-29: olly + [PHP] Fix memory leak in PHP OUTPUT typemaps. Reported by Hitoshi + Amano in SF#2826322. + +2009-07-29: olly + [PHP] Fix memory leak in PHP resource destructor for classes + without a destructor and non-class types. Patch from Hitoshi Amano + in SF#2825303. + +2009-07-28: olly + [PHP] Update warnings about clashes between identifiers and PHP + keywords and automatic renaming to work with the PHP5 class + wrappers. Fixes SF#1613679. + +2009-07-28: vmiklos + [PHP] If a member function is not public but it has a base + which is public, then now a warning is issued and the member + function will be public, as PHP requires this. + +2009-07-21: vmiklos + [PHP] Director support added. + +2009-07-15: olly + [Perl] Don't specify Perl prototype "()" for a constructor with a + different name to the class, as such constructors can still take + parameters. + +2009-07-12: xavier98 + [Octave] Add support for Octave 3.2 API + +2009-07-05: olly + [PHP] Update the list of PHP keywords - "cfunction" is no longer a + keyword in PHP5 and PHP 5.3 added "goto", "namespace", "__DIR__", + and "__NAMESPACE__". + +2009-07-03: olly + [Tcl] To complement USE_TCL_STUBS, add support for USE_TK_STUBS + and SWIG_TCL_STUBS_VERSION. Document all three in the Tcl chapter + of the manual. Based on patch from SF#2810380 by Christian + Gollwitzer. + +2009-07-02: vmiklos + [PHP] Added factory.i for PHP, see the li_factory testcase + for more info on how to use it. + +2009-07-02: wsfulton + Fix -Wallkw option as reported by Solomon Gibbs. + +2009-07-02: wsfulton + Fix syntax error when a nested struct contains a comment containing a * followed + eventually by a /. Regression from 1.3.37, reported by Solomon Gibbs. + +2009-07-01: vmiklos + [PHP] Unknown properties are no longer ignored in proxy + classes. + +2009-07-01: vmiklos + [PHP] Fixed %newobject behaviour, previously any method + marked with %newobject was handled as a constructor. + +2009-06-30: olly + [Ruby] Undefine close and connect macros defined by Ruby API + headers as we don't need them and they can clash with C++ methods + being wrapped. Patch from Vit Ondruch in SF#2814430. + +2009-06-26: olly + [Ruby] Fix to handle FIXNUM values greater than MAXINT passed for a + double parameter. + +2009-06-24: wsfulton + Fix wrapping methods with default arguments and the compactdefaultargs feature + where a class is passed by value and is assigned a default value. The SwigValueWrapper + template workaround for a missing default constructor is no longer used as the code + generated does not call the default constructor. + +2009-06-16: wsfulton + [Java,C#] Fix enum marshalling when %ignore is used on one of the enum items. + Incorrect enum values were being passed to the C++ layer or compilation errors resulted. + +2009-06-02: talby + [Perl] Resolved reference.i overload support problem + identified by John Potowsky. + +2009-05-26: wsfulton + [C#] Improved std::map wrappers based on patch from Yuval Baror. The C# proxy + now implements System.Collections.Generic.IDictionary<>. + + These std:map wrappers have a non-backwards compatible overhaul to make them + like a .NET IDictionary. Some method names have changed as following: + set -> setitem (use this[] property now) + get -> getitem (use this[] property now) + has_key -> ContainsKey + del -> Remove + clear -> Clear + + The following macros used for std::map wrappers are deprecated and will no longer work: + specialize_std_map_on_key + specialize_std_map_on_value + specialize_std_map_on_both + + *** POTENTIAL INCOMPATIBILITY *** + +2009-05-20: vmiklos + [PHP] Add the 'thisown' member to classes. The usage of it + is the same as the Python thisown one: it's 1 by default and + you can set it to 0 if you want to prevent freeing it. (For + example to prevent a double free.) + +2009-05-14: bhy + [Python] Fix the wrong pointer value returned by SwigPyObject_repr(). + +2009-05-13: mutandiz (Mikel Bancroft) + [allegrocl] Minor tweak when wrapping in -nocwrap mode. + +2009-05-11: wsfulton + [C#] Improved std::vector wrappers on the C# proxy side from Yuval Baror. These + implement IList<> instead of IEnumerable<> where possible. + +2009-04-29: wsfulton + [Java, C#] Add the 'notderived' attribute to the javabase and csbase typemaps. + When this attribute is set, the typemap will not apply to classes that are derived + from a C++ base class, eg + %typemap(csbase, notderived="1") SWIGTYPE "CommonBase" + +2009-04-29: olly + [Python] Don't attempt to acquire the GIL in situations where we + know that it will already be locked. This avoids some dead-locks + with mod_python (due to mod_python bugs which are apparently + unlikely to ever be fixed), and results in smaller wrappers which + run a little faster (in tests with Xapian on x86-64 Ubuntu 9.04, + the stripped wrapper library was 11% smaller and ran 2.7% faster). + +2009-04-21: wsfulton + [C#] Fix #2753469 - bool &OUTPUT and bool *OUTPUT typemaps initialisation. + +2009-04-09: wsfulton + Fix #2746858 - C macro expression using floating point numbers + +2009-03-30: olly + [PHP] The default out typemap for char[ANY] now returns the string up to a + zero byte, or the end of the array if there is no zero byte. This + is the same as Python does, and seems more generally useful than + the previous behaviour of returning the whole contents of the array + including any zero bytes. If you want the old behaviour, you can provide + your own typemap to do this: + + %typemap(out) char [ANY] + %{ + RETVAL_STRINGL(\$1, \$1_dim0, 1); + %} + Version 1.3.39 (21 March 2009) ============================== Modified: branches/gsoc2009-ashishs99/CHANGES.current =================================================================== --- branches/gsoc2009-ashishs99/CHANGES.current 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/CHANGES.current 2009-10-16 19:19:49 UTC (rev 11700) @@ -1,35 +1,29 @@ -Version 1.3.40 (in progress) +Version 1.3.41 (in progress) ============================ -2009-04-29: wsfulton - [Java, C#] Add the 'notderived' attribute to the javabase and csbase typemaps. - When this attribute is set, the typemap will not apply to classes that are derived - from a C++ base class, eg - %typemap(csbase, notderived="1") SWIGTYPE "CommonBase" +2009-09-14: wsfulton + [C#] Add %csattributes for adding C# attributes to enum values, see docs for example. -2009-04-29: olly - [Python] Don't attempt to acquire the GIL in situations where we - know that it will already be locked. This avoids some dead-locks - with mod_python (due to mod_python bugs which are apparently - unlikely to ever be fixed), and results in smaller wrappers which - run a little faster (in tests with Xapian on x86-64 Ubuntu 9.04, - the stripped wrapper library was 11% smaller and ran 2.7% faster). +2009-09-11: wsfulton + Fix memmove regression in cdata.i as reported by Adriaan Renting. -2009-04-21: wsfulton - [C#] Fix #2753469 - bool &OUTPUT and bool *OUTPUT typemaps initialisation. +2009-09-07: wsfulton + Fix constant expressions containing <= or >=. -2009-04-09: wsfulton - Fix #2746858 - C macro expression using floating point numbers +2009-09-02: wsfulton + The following operators in constant expressions now result in type bool for C++ + wrappers and remain as type int for C wrappers, as per each standard: -2009-03-30: olly - [PHP] The default out typemap for char[ANY] now returns the string up to a - zero byte, or the end of the array if there is no zero byte. This - is the same as Python does, and seems more generally useful than - the previous behaviour of returning the whole contents of the array - including any zero bytes. If you want the old behaviour, you can provide - your own typemap to do this: + && || == != < > <= >= (Actually the last 4 are still broken). For example: - %typemap(out) char [ANY] - %{ - RETVAL_STRINGL(\$1, \$1_dim0, 1); - %} + #define A 10 + #define B 10 + #define A_EQ_B A == B // now wrapped as type bool for C++ + #define A_AND_B A && B // now wrapped as type bool for C++ + +2009-09-02: wsfulton + Fix #2845746. true and false are now recognised keywords (only when wrapping C++). + Constants such as the following are now wrapped (as type bool): + #define FOO true + #define BAR FOO && false + Modified: branches/gsoc2009-ashishs99/Doc/Manual/Allegrocl.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Allegrocl.html 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/Allegrocl.html 2009-10-16 19:19:49 UTC (rev 11700) @@ -14,7 +14,7 @@
• Basics @@ -138,7 +138,7 @@

17.1 Basics

-

17.1.1 Running Swig

+

17.1.1 Running SWIG

Modified: branches/gsoc2009-ashishs99/Doc/Manual/Arguments.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Arguments.html 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/Arguments.html 2009-10-16 19:19:49 UTC (rev 11700) @@ -30,8 +30,6 @@ -Disclaimer: This chapter is under construction. -

In Chapter 3, SWIG's treatment of basic datatypes and pointers was described. In particular, primitive types such as int and @@ -351,7 +349,7 @@

%module example -%include typemaps.i +%include "typemaps.i"  ...  %{  extern void negate(double *);  Modified: branches/gsoc2009-ashishs99/Doc/Manual/CSharp.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/CSharp.html	2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/CSharp.html	2009-10-16 19:19:49 UTC (rev 11700) @@ -55,7 +55,7 @@  PInvoke is part of the ECMA/ISO C# specification.  It is also better suited for robust production environments due to the Managed C++ flaw called the  Mixed DLL Loading Problem. -Swig C# works equally well on non-Microsoft operating systems such as Linux, Solaris and Apple Mac using +SWIG C# works equally well on non-Microsoft operating systems such as Linux, Solaris and Apple Mac using  Mono; and Portable.NET;.

@@ -99,6 +99,7 @@ ... }
+Note that by default, the generated C# classes have no namespace and the module name is unrelated to namespaces. The module name is just like in Java and is merely used to name some of the generated classes.
• @@ -131,7 +132,7 @@ C# doesn't support the notion of throws clauses. Therefore there is no 'throws' typemap attribute support for adding exception classes to a throws clause. Likewise there is no need for an equivalent to %javaexception. -In fact, throwing C# exceptions works quite differently, see C# Exceptions> below. +In fact, throwing C# exceptions works quite differently, see C# Exceptions below.
• @@ -212,7 +213,7 @@ The 'cshin' attribute should contain the parameter type and name whenever a constructor helper function is generated due to the 'pre' or 'post' attributes. The 'terminator' attribute normally just contains a closing brace for when the 'pre' attribute contains an opening brace, such as when a C# using or fixed block is started. Note that 'pre', 'post', 'terminator' and 'cshin' attributes are not used for marshalling the property set. -Please see the Date marshalling example and Date marshalling of properties example for further understanding of these "csin" applicable attributes. +Please see the Date marshalling example and Date marshalling of properties example for further understanding of these "csin" applicable attributes.

• @@ -248,7 +249,9 @@

Support for type attributes. The 'imtype' and 'cstype' typemaps can have an optional inattributes and outattributes typemap attribute. -There are C# attributes and typemap attributes, don't get confused!! +The 'imtype' typemap can also have an optional directorinattributes and directoroutattributes +typemap attribute which attaches to director delegates, an implementation detail of directors, see directors implementation. +Note that there are C# attributes and typemap attributes, don't get confused between the two!! The C# attributes specified in these typemap attributes are generated wherever the type is used in the C# wrappers. These can be used to specify any C# attribute associated with a C/C++ type, but are more typically used for the C# MarshalAs attribute. For example: @@ -292,11 +295,16 @@ the attribute features and typemaps covered next. Note that all these different C# attributes can be combined so that a method has more than one attribute.

+ +

+The directorinattributes and directoroutattributes typemap attribute are attached to the delegates in the director class, for example, the SwigDelegateBase_0 +

+
• -Support for attaching C# attributes to wrapped methods and variables. +Support for attaching C# attributes to wrapped methods, variables and enum values. This is done using the %csattributes feature, see %feature directives. Note that C# attributes are attached to proxy classes and enums using the csattributes typemap. For example, imagine we have a custom attribute class, ThreadSafeAttribute, for labelling thread safety. @@ -343,6 +351,38 @@ Note that the type used for the property is specified in the 'cstype' typemap. If the 'out' attribute exists in this typemap, then the type used is from the 'out' attribute.

+ +

+An example for attaching attributes to the enum and enum values is shown below. +

+ +
+
+%typemap(csattributes) Couleur "[System.ComponentModel.Description(\"Colours\")]" +%csattributes Rouge "[System.ComponentModel.Description(\"Red\")]" +%csattributes Vert "[System.ComponentModel.Description(\"Green\")]" +%inline %{ +  enum Couleur { Rouge, Orange, Vert }; +%} +
+
+ +

+which will result in the following C# enum: +

+ +
+
+[System.ComponentModel.Description("Colours")] +public enum Couleur { +  [System.ComponentModel.Description("Red")] +  Rouge, +  Orange, +  [System.ComponentModel.Description("Green")] +  Vert +} +
+
• Modified: branches/gsoc2009-ashishs99/Doc/Manual/Contents.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Contents.html 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/Contents.html 2009-10-16 19:19:49 UTC (rev 11700) @@ -337,13 +337,13 @@
• Typemap specifications -
• Pattern matching rules +
• Pattern matching rules
• Common typemap methods
@@ -1501,6 +1517,7 @@ +
• Tcl/Tk Stubs @@ -1564,7 +1581,7 @@
• Writing a Language Module
• Execution model -
• Starting out +
• Starting out
• Command line options
• Configuration and preprocessing
• Entry point to code generation @@ -1573,7 +1590,11 @@
• Configuration files
• Runtime support
• Standard library files -
• Examples and test cases +
• User examples +
• Test driven development and the test-suite +
• Documentation
• Prerequisites for adding a new language module to the SWIG distribution
• Coding style guidelines Modified: branches/gsoc2009-ashishs99/Doc/Manual/Extending.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Extending.html 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/Extending.html 2009-10-16 19:19:49 UTC (rev 11700) @@ -48,7 +48,7 @@
• Writing a Language Module
• Execution model -
• Starting out +
• Starting out
• Command line options
• Configuration and preprocessing
• Entry point to code generation @@ -57,7 +57,11 @@
• Configuration files
• Runtime support
• Standard library files -
• Examples and test cases +
• User examples +
• Test driven development and the test-suite +
• Documentation
• Prerequisites for adding a new language module to the SWIG distribution
• Coding style guidelines @@ -1025,7 +1029,7 @@

-int Len(String_or_char *s) +int Len(const String_or_char *s)

@@ -1033,7 +1037,7 @@

-char *Char(String_or_char *s) +char *Char(const String_or_char *s)

@@ -1041,7 +1045,7 @@

-void Append(String *s, String_or_char *t) +void Append(String *s, const String_or_char *t)

@@ -1049,7 +1053,7 @@

-void Insert(String *s, int pos, String_or_char *t) +void Insert(String *s, int pos, const String_or_char *t)

@@ -1162,7 +1166,7 @@

-Object *Getattr(Hash *h, String_or_char *key) +Object *Getattr(Hash *h, const String_or_char *key)

@@ -1171,7 +1175,7 @@

-int Setattr(Hash *h, String_or_char *key, Object_or_char *val) +int Setattr(Hash *h, const String_or_char *key, const Object_or_char *val)

@@ -1185,7 +1189,7 @@

-int Delattr(Hash *h, String_or_char *key) +int Delattr(Hash *h, const String_or_char *key)

@@ -1249,7 +1253,7 @@

-int *Setitem(List *x, int n, Object_or_char *val) +int *Setitem(List *x, int n, const Object_or_char *val)

@@ -1271,7 +1275,7 @@

-void Append(List *x, Object_or_char *t) +void Append(List *x, const Object_or_char *t)

@@ -1281,7 +1285,7 @@

-void Insert(String *s, int pos, Object_or_char *t) +void Insert(String *s, int pos, const Object_or_char *t)

@@ -1479,13 +1483,14 @@

-File *NewFile(const char *filename, const char *mode) +File *NewFile(const char *filename, const char *mode, List *newfiles)

Create a File object using the fopen() library call. This file differs from FILE * in that it can be placed in the standard -SWIG containers (lists, hashes, etc.). +SWIG containers (lists, hashes, etc.). The filename is added to the +newfiles list if newfiles is non-zero and the file was created successfully.

@@ -1922,7 +1927,7 @@

@@ -1962,7 +1967,7 @@

@@ -1971,7 +1976,7 @@

@@ -2292,7 +2297,7 @@

-String *SwigType_str(SwigType *ty, String_or_char *id = 0) +String *SwigType_str(SwigType *ty, const String_or_char *id = 0)

@@ -2303,7 +2308,7 @@

-String *SwigType_lstr(SwigType *ty, String_or_char *id = 0) +String *SwigType_lstr(SwigType *ty, const String_or_char *id = 0)

@@ -2312,7 +2317,7 @@

-String *SwigType_lcaststr(SwigType *ty, String_or_char *id = 0) +String *SwigType_lcaststr(SwigType *ty, const String_or_char *id = 0)

@@ -2323,7 +2328,7 @@

-String *SwigType_rcaststr(SwigType *ty, String_or_char *id = 0) +String *SwigType_rcaststr(SwigType *ty, const String_or_char *id = 0)

@@ -2470,7 +2475,7 @@ different methods of the Language that must be defined by your module.

-

35.10.2 Starting out

+

35.10.2 Starting out

@@ -2776,6 +2781,7 @@ class PYTHON : public Language { protected: /* General DOH objects used for holding the strings */ + File *f_begin; File *f_runtime; File *f_header; File *f_wrappers; @@ -2791,22 +2797,25 @@ ... /* Initialize I/O */ - f_runtime = NewFile(outfile, "w"); - if (!f_runtime) { + f_begin = NewFile(outfile, "w", SWIG_output_files()); + if (!f_begin) { FileErrorDisplay(outfile); SWIG_exit(EXIT_FAILURE); } + f_runtime = NewString(""); f_init = NewString(""); f_header = NewString(""); f_wrappers = NewString(""); /* Register file targets with the SWIG file handler */ + Swig_register_filebyname("begin", f_begin); Swig_register_filebyname("header", f_header); Swig_register_filebyname("wrapper", f_wrappers); Swig_register_filebyname("runtime", f_runtime); Swig_register_filebyname("init", f_init); /* Output module initialization code */ + Swig_banner(f_begin); ... /* Emit code for children */ @@ -2814,16 +2823,18 @@ ... /* Write all to the file */ - Dump(f_header, f_runtime); - Dump(f_wrappers, f_runtime); - Wrapper_pretty_print(f_init, f_runtime); + Dump(f_runtime, f_begin); + Dump(f_header, f_begin); + Dump(f_wrappers, f_begin); + Wrapper_pretty_print(f_init, f_begin); /* Cleanup files */ + Delete(f_runtime); Delete(f_header); Delete(f_wrappers); Delete(f_init); - Close(f_runtime); - Delete(f_runtime); + Close(f_begin); + Delete(f_begin); return SWIG_OK; } @@ -3046,7 +3057,7 @@

-At the time of this writing, SWIG supports nearly a dozen languages, +At the time of this writing, SWIG supports nearly twenty languages, which means that for continued sanity in maintaining the configuration files, the language modules need to follow some conventions. These are outlined here along with the admission that, yes it is ok to violate @@ -3218,7 +3229,7 @@ Please copy these and modify for any new language.

-

35.10.11 Examples and test cases

+

35.10.11 User examples

@@ -3247,10 +3258,229 @@ files.

-

35.10.12 Documentation

+

35.10.12 Test driven development and the test-suite

+A test driven development approach is central to the improvement and development of SWIG. +Most modifications to SWIG are accompanied by additional regression tests and checking all +tests to ensure that no regressions have been introduced. +

+ +

+The regression testing is carried out by the SWIG test-suite. +The test-suite consists of numerous testcase interface files in the Examples/test-suite directory +as well as target language specific runtime tests in the Examples/test-suite/[lang] directory. +When a testcase is run, it will execute the following steps for each testcase: +

+ +
+
1. Execute SWIG passing it the testcase interface file.
2. +
3. Compile the resulting generated C/C++ code with either the C or C++ compiler into object files.
4. +
5. Link the object files into a dynamic library (dll/shared object).
6. +
7. Compile any generated and any runtime test target language code with the target language compiler, if the target language supports compilation. This step thus does not apply to the interpreted languages.
8. +
9. Execute a runtime test if one exists.
10. +
+ +

+For example, the ret_by_value testcase consists of two components. +The first component is the Examples/test-suite/ret_by_value.i interface file. +The name of the SWIG module must always be the name of the testcase, so the ret_by_value.i interface file thus begins with: +

+ +
+
+%module ret_by_value +
+
+ +

+The testcase code will then follow the module declaration, +usually within a %inline %{ ... %} section for the majority of the tests. +

+ +

+The second component is the optional runtime tests. +Any runtime tests are named using the following convention: [testcase]_runme.[ext], +where [testcase] is the testcase name and [ext] is the normal extension for the target language file. +In this case, the Java and Python target languages implement a runtime test, so their files are respectively, +Examples/test-suite/java/ret_by_value_runme.java and +Examples/test-suite/python/ret_by_value_runme.py. +

+ +

+The goal of the test-suite is to test as much as possible in a silent manner. +This way any SWIG or compiler errors or warnings are easily visible. +Should there be any warnings, changes must be made to either fix them (preferably) or suppress them. +Compilation or runtime errors result in a testcase failure and will be immediately visible. +It is therefore essential that the runtime tests are written in a manner that displays nothing to stdout/stderr on success +but error/exception out with an error message on stderr on failure. +

+ +

35.10.12.1 Running the test-suite

+ + +

+In order for the test-suite to work for a particular target language, the language must be correctly detected +and configured during the configure stage so that the correct Makefiles are generated. +Most development occurs on Linux, so usually it is a matter of installing the development packages for the target language +and simply configuring as outlined earlier. +

+ +

+If when running the test-suite commands that follow, you get a message that the test was skipped, it indicates that the +configure stage is missing information in order to compile and run everything for that language. +

+ +

+The test-suite can be run in a number of ways. +The first group of commands are for running multiple testcases in one run and should be executed in the top level directory. +To run the entire test-suite (can take a long time): +

+ +
+make -k check-test-suite +
+ +

+To run the test-suite just for target language [lang], replace [lang] with one of csharp, java, perl5, python, ruby, tcl etc: +

+ +
+make check-[lang]-test-suite +
+ +

+Note that if a runtime test is available, a message "(with run test)" is displayed when run. For example: +

+ +
+\$ make check-python-test-suite +checking python test-suite +checking testcase argcargvtest (with run test) under python +checking testcase python_autodoc under python +checking testcase python_append (with run test) under python +checking testcase callback (with run test) under python +
+ +

+The files generated on a previous run can be deleted using the clean targets, either the whole test-suite or for a particular language: +

+ +
+make clean-test-suite +make clean-[lang]-test-suite +
+ +

+The test-suite can be run in a partialcheck mode where just SWIG is executed, that is, the compile, +link and running of the testcases is not performed. +Note that the partialcheck does not require the target language to be correctly configured and detected and unlike the other test-suite make targets, is never skipped. Once again, either all the languages can be executed or just a chosen language: +

+ +
+make partialcheck-test-suite +make partialcheck-[lang]-test-suite +
+ +

+If your computer has more than one CPU, you are strongly advised to use parallel make to speed up the execution speed. +This can be done with any of the make targets that execute more than one testcase. +For example, a dual core processor can efficiently use 2 parallel jobs: +

+ +
+make -j2 check-test-suite +make -j2 check-python-test-suite +make -j2 partialcheck-java-test-suite +
+ +

+The second group of commands are for running individual testcases and should be executed in the appropriate +target language directory, Examples/test-suite/[lang]. +Testcases can contain either C or C++ code and when one is written, a decision must be made as to which of these input +languages is to be used. +Replace [testcase] in the commands below with the name of the testcase. +

+ +

+For a C language testcase, add the testcase under the C_TEST_CASES list in Examples/test-suite/common.mk and +execute individually as: +

+
+make -s [testcase].ctest +
+ +

+For a C++ language testcase, add the testcase under the CPP_TEST_CASES list in Examples/test-suite/common.mk and +execute individually as: +

+
+make -s [testcase].cpptest +
+ +

+A third category of tests are C++ language testcases testing multiple modules (the %import directive). +These require more than one shared library (dll/shared object) to be built and so are separated out from the normal C++ testcases. +Add the testcase under the MULTI_CPP_TEST_CASES list in Examples/test-suite/common.mk and +execute individually as: +

+
+make -s [testcase].multicpptest +
+ +

+To delete the generated files, execute: +

+
+make -s [testcase].clean +
+ +

+If you would like to see the exact commands being executed, drop the -s option: +

+
+make [testcase].ctest +make [testcase].cpptest +make [testcase].multicpptest +
+ +

+Some real examples of each: +

+
+make -s ret_by_value.clean +make -s ret_by_value.ctest +make -s bools.cpptest +make -s imports.multicpptest +
+ +

+Advanced usage of the test-suite facilitates running tools on some of the five stages. +The make variables SWIGTOOL and RUNTOOL are used to specify a tool to respectively, invoke SWIG +and the execution of the runtime test. +You are advised to view the Examples/test-suite/common.mk file for details but for a short summary, +the classic usage is to use Valgrind; for memory checking. +For example, checking for memory leaks when running the runtime test in the target language interpreter: +

+ +
+make ret_by_value.ctest RUNTOOL="valgrind --leak-check=full" +
+ +

+This will probably make more sense if you look at the output of the above as it will show the exact commands being executed. +SWIG can be analyzed for bad memory accesses using: +

+ +
+make ret_by_value.ctest SWIGTOOL="valgrind --tool=memcheck --trace-children=yes" +
+ +

35.10.13 Documentation

+ + +

Don't forget to write end-user documentation for your language module. Currently, each language module has a dedicated chapter You shouldn't rehash things that are already covered in sufficient @@ -3279,7 +3509,7 @@ if available.

-

35.10.13 Prerequisites for adding a new language module to the SWIG distribution

+

35.10.14 Prerequisites for adding a new language module to the SWIG distribution

@@ -3336,7 +3566,7 @@ the existing tests.

-

35.10.14 Coding style guidelines

+

35.10.15 Coding style guidelines

Modified: branches/gsoc2009-ashishs99/Doc/Manual/Guile.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Guile.html 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/Guile.html 2009-10-16 19:19:49 UTC (rev 11700) @@ -814,7 +814,7 @@ Module-primitive.scm (with primitive replaced with whatever is given with the -primsuffix argument. The code to load the .so library should be located in the %scheme directive, which will then be added to the scmstub file. -Swig will automatically generate the line (use-modules (Package Module-primitive)) +SWIG will automatically generate the line (use-modules (Package Module-primitive)) into the GOOPS guile-module. So if Module-primitive.scm is on the autoload path for guile, the %goops directive can be empty. Otherwise, the %goops directive should contain whatever code is needed to load the Module-primitive.scm file into guile.

@@ -848,7 +848,7 @@
• Module Linkage: This is very similar to passive linkage with a scmstub file. -Swig will also automatically generate the line (use-modules +SWIG will also automatically generate the line (use-modules (Package Module-primitive)) into the GOOPS guile-module. Again the %goops directive should contain whatever code is needed to get that module loaded into guile.

Modified: branches/gsoc2009-ashishs99/Doc/Manual/Java.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Java.html 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/Java.html 2009-10-16 19:19:49 UTC (rev 11700) @@ -254,6 +254,12 @@

+The module name, specified with %module, determines the name of various generated classes as discussed later. +Note that the module name does not define a Java package and by default, the generated Java classes do not have a Java package. +The -package option described below can specify a Java package name to use. +

+ +

The following sections have further practical examples and details on how you might go about compiling and using the generated files.

@@ -441,6 +447,19 @@

This error usually indicates that you forgot to include some object files or libraries in the linking of the native library file. Make sure you compile both the SWIG wrapper file and the code you are wrapping into the native library file. +If you forget to compile and link in the SWIG wrapper file into your native library file, you will get a message similar to the following: +

+ +
+\$ java runme +Exception in thread "main" java.lang.UnsatisfiedLinkError: exampleJNI.gcd(II)I +	at exampleJNI.gcd(Native Method) +	at example.gcd(example.java:12) +	at runme.main(runme.java:18) +
+ +

+where gcd is the missing JNI function that SWIG generated into the wrapper file. Also make sure you pass all of the required libraries to the linker. The java -verbose:jni commandline switch is also a great way to get more information on unresolved symbols. One last piece of advice is to beware of the common faux pas of having more than one native library version in your path. Modified: branches/gsoc2009-ashishs99/Doc/Manual/Library.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Library.html 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/Library.html 2009-10-16 19:19:49 UTC (rev 11700) @@ -667,7 +667,7 @@

-char *cdata(void *ptr, int nbytes) +const char *cdata(void *ptr, size_t nbytes)

@@ -676,7 +676,7 @@

-void memmove(void *ptr, char *s) +void memmove(void *ptr, const char *s)

Modified: branches/gsoc2009-ashishs99/Doc/Manual/Modules.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Modules.html 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/Modules.html 2009-10-16 19:19:49 UTC (rev 11700) @@ -10,6 +10,7 @@

+
• Modules Introduction
• Basics
• The SWIG runtime code

15.1 Modules Introduction

+ +

+Each invocation of SWIG requires a module name to be specified. +The module name is used to name the resulting target language extension module. +Exactly what this means and and what the name is used for +depends on the target language, for example the name can define +a target language namespace or merely be a useful name for naming files or helper classes. +Essentially, a module comprises target language wrappers for a chosen collection of global variables/functions, structs/classes and other C/C++ types. +

+ +

+The module name can be supplied in one of two ways. +The first is to specify it with the special %module +directive. This directive must appear at the beginning of the interface file. +The general form of this directive is: +

+ +
+%module(option1="value1",option2="value2",...) modulename +
+ +

+where the modulename is mandatory and the options add one or more optional additional features. +Typically no options are specified, for example: +

+ +
+%module mymodule +
+ +

+The second way to specify the module name is with the -module command line option, for example -module mymodule. +If the module name is supplied on the command line, it overrides the name specified by the +%module directive. +

+ +

When first working with SWIG, users commonly start by creating a single module. That is, you might define a single SWIG interface that wraps some set of C/C++ code. You then compile all of the generated -wrapper code into a module and use it. For large applications, however, +wrapper code together and use it. For large applications, however, this approach is problematic---the size of the generated wrapper code can be rather large. Moreover, it is probably easier to manage the target language interface when it is broken up into smaller pieces. @@ -34,10 +73,11 @@

This chapter describes the problem of using SWIG in programs -where you want to create a collection of modules. +where you want to create a collection of modules. +Each module in the collection is created via separate invocations of SWIG.

-

15.1 Basics

+

15.2 Basics

@@ -135,7 +175,7 @@ issue, read on.

-

15.2 The SWIG runtime code

+

15.3 The SWIG runtime code

@@ -201,7 +241,7 @@ is empty. Only modules compiled with the same pair will share type information.

-

+

As described in The run-time type checker, @@ -238,7 +278,7 @@ access.

-

15.4 A word of caution about static libraries

+

15.5 A word of caution about static libraries

@@ -249,7 +289,7 @@ behavior. When working with dynamically loadable modules, you should try to work exclusively with shared libraries.

-

15.5 References

+

15.6 References

@@ -257,7 +297,7 @@ an outside reference. John Levine's "Linkers and Loaders" is highly recommended.

-

15.6 Reducing the wrapper file size

+

15.7 Reducing the wrapper file size

Modified: branches/gsoc2009-ashishs99/Doc/Manual/Ocaml.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Ocaml.html 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/Ocaml.html 2009-10-16 19:19:49 UTC (rev 11700) @@ -634,13 +634,13 @@ #include "example.h" %} -%include stl.i +%include <stl.i> namespace std { %template(StringVector) std::vector < string >; }; -%include example.h +%include "example.h"

• This example is in Examples/ocaml/stl
Modified: branches/gsoc2009-ashishs99/Doc/Manual/Perl5.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Perl5.html 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/Perl5.html 2009-10-16 19:19:49 UTC (rev 11700) @@ -40,7 +40,7 @@
• Modules and packages
• Input and output parameters -
• Exception handling +
• Exception handling
• Remapping datatypes with typemaps
• Typemap Examples
-
• Converting a Perl5 array to a char ** -
• Return values +
• Converting a Perl5 array to a char ** +
• Return values
• Returning values from arguments
• Accessing array structure members
• Turning Perl references into C pointers @@ -112,7 +112,7 @@

-To build a Perl5 module, run Swig using the -perl option as +To build a Perl5 module, run SWIG using the -perl option as follows :

@@ -264,7 +264,7 @@ %} // Include code for rebuilding Perl -%include perlmain.i +%include <perlmain.i>

@@ -815,7 +815,7 @@

-Constants are wrapped as read-only Perl variables. For example: +By default, constants are wrapped as read-only Perl variables. For example:

@@ -838,6 +838,19 @@
+

+Alternatively, if you use swig's -const option, constants are wrapped +such that the leading \$ isn't required (by using a constant subroutine), which +usually gives a more natural Perl interface, for example: +

+ +
+
+use example; +print example::FOO,"\n"; +
+
+

28.4.4 Pointers

@@ -879,7 +892,7 @@

-To create a NULL pointer, you should pass the undef value to +To create a NULL pointer, you should pass the undef value to a function.

@@ -889,7 +902,7 @@ and \$b are two references that point to the same C object. In general, \$a and \$b will be different--since they are different references. Thus, it is a mistake to check the equality -of \$a and \$b to check the equality of two C +of \$a and \$b to check the equality of two C pointers. The correct method to check equality of C pointers is to dereference them as follows :

@@ -1543,7 +1556,7 @@
%module example -%include typemaps.i +%include "typemaps.i"    void add(int x, int y, int *REFERENCE);
@@ -1567,7 +1580,7 @@ Note: The REFERENCE feature is only currently supported for numeric types (integers and floating point).

-

28.6 Exception handling

+

28.6 Exception handling

@@ -2107,7 +2120,7 @@ the SWIG library.

-

28.8.1 Converting a Perl5 array to a char **

+

28.8.1 Converting a Perl5 array to a char **

@@ -2160,7 +2173,7 @@ }; myav = av_make(len,svs); free(svs); - \$result = newRV((SV*)myav); + \$result = newRV_noinc((SV*)myav); sv_2mortal(\$result); argvi++; } @@ -2199,7 +2212,7 @@

-

28.8.2 Return values

+

28.8.2 Return values

@@ -2714,7 +2727,7 @@ frequently when constructing objects like linked lists and trees). When C takes possession of an object, you can change Perl's ownership by simply deleting the object from the %OWNER hash. This is -done using the DISOWN method. +done using the DISOWN method.

Modified: branches/gsoc2009-ashishs99/Doc/Manual/Php.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Php.html	2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/Php.html	2009-10-16 19:19:49 UTC (rev 11700) @@ -32,17 +32,23 @@
• PHP Pragmas, Startup and Shutdown code +
• Cross language polymorphism + +

-Caution: This chapter (and module!) is still under construction -

- -

SWIG supports generating wrappers for PHP5. Support for PHP4 has been removed as of SWIG 1.3.37. The PHP developers are no longer making new PHP4 releases, and won't even be patching critical security issues after 2008-08-08, so it @@ -95,7 +101,7 @@

-Swig can generate PHP extensions from C++ libraries as well when +SWIG can generate PHP extensions from C++ libraries as well when given the -c++ option. The support for C++ is discussed in more detail in section 27.2.6.

@@ -479,7 +485,7 @@
%module example -%include cpointer.i +%include "cpointer.i"  %pointer_functions(int,intp)    void add( int *in1, int *in2, int *result); @@ -513,7 +519,7 @@
%module example -%include typemaps.i +%include "typemaps.i"    void add( int *INPUT, int *INPUT, int *OUTPUT);   @@ -545,7 +551,7 @@
%module example -%include phppointers.i +%include "phppointers.i"    void add( int *REF, int *REF, int *REF);   @@ -782,12 +788,6 @@

-Note: Currently pragmas for PHP need to be specified using -%pragma(php) but also apply for PHP5! This is just a historical -oddity because SWIG's PHP support predates PHP5. -

- -

To place PHP code in the generated "example.php" file one can use the code pragma. The code is inserted after loading the shared object. @@ -872,5 +872,381 @@ into the request init and shutdown code respectively.

+

29.3 Cross language polymorphism

+ + +

+Proxy classes provide a more natural, object-oriented way to access +extension classes. As described above, each proxy instance has an +associated C++ instance, and method calls to the proxy are passed to the +C++ instance transparently via C wrapper functions. +

+ +

+This arrangement is asymmetric in the sense that no corresponding +mechanism exists to pass method calls down the inheritance chain from +C++ to PHP. In particular, if a C++ class has been extended in PHP +(by extending the proxy class), these extensions will not be visible +from C++ code. Virtual method calls from C++ are thus not able access +the lowest implementation in the inheritance chain. +

+ +

+Changes have been made to SWIG 1.3.18 to address this problem and make +the relationship between C++ classes and proxy classes more symmetric. +To achieve this goal, new classes called directors are introduced at the +bottom of the C++ inheritance chain. Support for generating PHP classes +has been added in SWIG 1.3.40. The job of the directors is to route +method calls correctly, either to C++ implementations higher in the +inheritance chain or to PHP implementations lower in the inheritance +chain. The upshot is that C++ classes can be extended in PHP and from +C++ these extensions look exactly like native C++ classes. Neither C++ +code nor PHP code needs to know where a particular method is +implemented: the combination of proxy classes, director classes, and C +wrapper functions takes care of all the cross-language method routing +transparently. +

+ +

29.3.1 Enabling directors

+ + +

+The director feature is disabled by default. To use directors you +must make two changes to the interface file. First, add the "directors" +option to the %module directive, like this: +

+ +
+
+%module(directors="1") modulename +
+
+ +

+Without this option no director code will be generated. Second, you +must use the %feature("director") directive to tell SWIG which classes +and methods should get directors. The %feature directive can be applied +globally, to specific classes, and to specific methods, like this: +

+ +
+
+// generate directors for all classes that have virtual methods +%feature("director");          + +// generate directors for all virtual methods in class Foo +%feature("director") Foo;       + +// generate a director for just Foo::bar() +%feature("director") Foo::bar;  +
+
+ +

+You can use the %feature("nodirector") directive to turn off +directors for specific classes or methods. So for example, +

+ +
+
+%feature("director") Foo; +%feature("nodirector") Foo::bar; +
+
+ +

+will generate directors for all virtual methods of class Foo except +bar(). +

+ +

+Directors can also be generated implicitly through inheritance. +In the following, class Bar will get a director class that handles +the methods one() and two() (but not three()): +

+ +
+
+%feature("director") Foo; +class Foo { +public: +    Foo(int foo); +    virtual void one(); +    virtual void two(); +}; + +class Bar: public Foo { +public: +    virtual void three(); +}; +
+
+ +

+then at the PHP side you can define +

+ +
+
+require("mymodule.php"); + +class MyFoo extends Foo { +  function one() { +     print "one from php\n"; +  } +} +
+
+ + +

29.3.2 Director classes

+ + + + + +

+For each class that has directors enabled, SWIG generates a new class +that derives from both the class in question and a special +Swig::Director class. These new classes, referred to as director +classes, can be loosely thought of as the C++ equivalent of the PHP +proxy classes. The director classes store a pointer to their underlying +PHP object. Indeed, this is quite similar to the "_cPtr" and "thisown" +members of the PHP proxy classes. +

+ +

+For simplicity let's ignore the Swig::Director class and refer to the +original C++ class as the director's base class. By default, a director +class extends all virtual methods in the inheritance chain of its base +class (see the preceding section for how to modify this behavior). +Thus all virtual method calls, whether they originate in C++ or in +PHP via proxy classes, eventually end up in at the implementation in the +director class. The job of the director methods is to route these method +calls to the appropriate place in the inheritance chain. By "appropriate +place" we mean the method that would have been called if the C++ base +class and its extensions in PHP were seamlessly integrated. That +seamless integration is exactly what the director classes provide, +transparently skipping over all the messy extension API glue that binds +the two languages together. +

+ +

+In reality, the "appropriate place" is one of only two possibilities: +C++ or PHP. Once this decision is made, the rest is fairly easy. If the +correct implementation is in C++, then the lowest implementation of the +method in the C++ inheritance chain is called explicitly. If the correct +implementation is in PHP, the Zend API is used to call the method of the +underlying PHP object (after which the usual virtual method resolution +in PHP automatically finds the right implementation). +

+ +

+Now how does the director decide which language should handle the method call? +The basic rule is to handle the method in PHP, unless there's a good +reason not to. The reason for this is simple: PHP has the most +"extended" implementation of the method. This assertion is guaranteed, +since at a minimum the PHP proxy class implements the method. If the +method in question has been extended by a class derived from the proxy +class, that extended implementation will execute exactly as it should. +If not, the proxy class will route the method call into a C wrapper +function, expecting that the method will be resolved in C++. The wrapper +will call the virtual method of the C++ instance, and since the director +extends this the call will end up right back in the director method. Now +comes the "good reason not to" part. If the director method were to blindly +call the PHP method again, it would get stuck in an infinite loop. We avoid this +situation by adding special code to the C wrapper function that tells +the director method to not do this. The C wrapper function compares the +called and the declaring class name of the given method. If these are +not the same, then the C wrapper function tells the director to resolve +the method by calling up the C++ inheritance chain, preventing an +infinite loop. +

+ +

+One more point needs to be made about the relationship between director +classes and proxy classes. When a proxy class instance is created in +PHP, SWIG creates an instance of the original C++ class and assigns it +to ->_cPtr. This is exactly what happens without directors +and is true even if directors are enabled for the particular class in +question. When a class derived from a proxy class is created, +however, SWIG then creates an instance of the corresponding C++ director +class. The reason for this difference is that user-defined subclasses +may override or extend methods of the original class, so the director +class is needed to route calls to these methods correctly. For +unmodified proxy classes, all methods are ultimately implemented in C++ +so there is no need for the extra overhead involved with routing the +calls through PHP. +

+ +

29.3.3 Ownership and object destruction

+ + +

+Memory management issues are slightly more complicated with directors +than for proxy classes alone. PHP instances hold a pointer to the +associated C++ director object, and the director in turn holds a pointer +back to the PHP object. By default, proxy classes own their C++ director +object and take care of deleting it when they are garbage collected. +

+ +

+This relationship can be reversed by calling the special +->thisown property of the proxy class. After setting this +property to 0, the director class no longer destroys the PHP +object. Assuming no outstanding references to the PHP object remain, +the PHP object will be destroyed at the same time. This is a good thing, +since directors and proxies refer to each other and so must be created +and destroyed together. Destroying one without destroying the other will +likely cause your program to segfault. +

+ +

+Here is an example: +

+ +
+
+class Foo { +public: +    ... +}; +class FooContainer { +public: +    void addFoo(Foo *); +    ... +}; +
+
+ +
+ +
+
+\$c = new FooContainer(); +\$a = new Foo(); +\$a->thisown = 0; +\$c->addFoo(\$a); +
+
+ +

+In this example, we are assuming that FooContainer will take care of +deleting all the Foo pointers it contains at some point. +

+ +

29.3.4 Exception unrolling

+ + +

+With directors routing method calls to PHP, and proxies routing them +to C++, the handling of exceptions is an important concern. By default, the +directors ignore exceptions that occur during method calls that are +resolved in PHP. To handle such exceptions correctly, it is necessary +to temporarily translate them into C++ exceptions. This can be done with +the %feature("director:except") directive. The following code should +suffice in most cases: +

+ +
+
+%feature("director:except") { +    if (\$error == FAILURE) { +        throw Swig::DirectorMethodException(); +    } +} +
+
+ +

+This code will check the PHP error state after each method call from a +director into PHP, and throw a C++ exception if an error occurred. This +exception can be caught in C++ to implement an error handler. +Currently no information about the PHP error is stored in the +Swig::DirectorMethodException object, but this will likely change in the +future. +

+ +

+It may be the case that a method call originates in PHP, travels up to +C++ through a proxy class, and then back into PHP via a director method. +If an exception occurs in PHP at this point, it would be nice for that +exception to find its way back to the original caller. This can be done +by combining a normal %exception directive with the +director:except handler shown above. Here is an example of a +suitable exception handler: +

+ +
+
+%exception { +    try { \$action } +    catch (Swig::DirectorException &e) { SWIG_fail; } +} +
+
+ +

+The class Swig::DirectorException used in this example is actually a +base class of Swig::DirectorMethodException, so it will trap this +exception. Because the PHP error state is still set when +Swig::DirectorMethodException is thrown, PHP will register the exception +as soon as the C wrapper function returns. +

+ +

+ + +

+Enabling directors for a class will generate a new director method for +every virtual method in the class' inheritance chain. This alone can +generate a lot of code bloat for large hierarchies. Method arguments +that require complex conversions to and from target language types can +result in large director methods. For this reason it is recommended that +you selectively enable directors only for specific classes that are +likely to be extended in PHP and used in C++. +

+ +

+Compared to classes that do not use directors, the call routing in the +director methods does add some overhead. In particular, at least one +dynamic cast and one extra function call occurs per method call from +PHP. Relative to the speed of PHP execution this is probably completely +negligible. For worst case routing, a method call that ultimately +resolves in C++ may take one extra detour through PHP in order to ensure +that the method does not have an extended PHP implementation. This could +result in a noticeable overhead in some cases. +

+ +

+Although directors make it natural to mix native C++ objects with PHP +objects (as director objects) via a common base class pointer, one +should be aware of the obvious fact that method calls to PHP objects +will be much slower than calls to C++ objects. This situation can be +optimized by selectively enabling director methods (using the %feature +directive) for only those methods that are likely to be extended in PHP. +

+ +

29.3.6 Typemaps

+ + +

+Typemaps for input and output of most of the basic types from director +classes have been written. These are roughly the reverse of the usual +input and output typemaps used by the wrapper code. The typemap +operation names are 'directorin', 'directorout', and 'directorargout'. +The director code does not currently use any of the other kinds of +typemaps. It is not clear at this point which kinds are appropriate and +need to be supported. +

+ + +

29.3.7 Miscellaneous

+ + +

Director typemaps for STL classes are mostly in place, and hence you +should be able to use std::string, etc., as you would any other type. +

+ Modified: branches/gsoc2009-ashishs99/Doc/Manual/Python.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Python.html 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/Python.html 2009-10-16 19:19:49 UTC (rev 11700) @@ -339,7 +339,7 @@ setup.py is the tradition)
• build_ext -- telling distutils to build extensions
• --inplace -- this tells distutils to put the extension lib in the current dir. - Other wise, it will put it inside a build hierarchy, and you'd have to move it to use it. + Otherwise, it will put it inside a build hierarchy, and you'd have to move it to use it.

@@ -363,8 +363,8 @@

\$ swig -python example.i -\$ gcc -c -fPIC example.c -\$ gcc -c -fPIC example_wrap.c -I/usr/local/include/python2.0 +\$ gcc -O2 -fPIC -c example.c +\$ gcc -O2 -fPIC -c example_wrap.c -I/usr/local/include/python2.5  \$ gcc -shared example.o example_wrap.o -o _example.so
@@ -433,7 +433,7 @@ extern double My_variable; %} -%include embed.i // Include code for a static version of Python +%include "embed.i" // Include code for a static version of Python
• @@ -654,26 +654,19 @@
\$ swig -c++ -python example.i -\$ g++ -c example.cxx -\$ g++ -c example_wrap.cxx -I/usr/local/include/python2.0 +\$ g++ -O2 -fPIC -c example.cxx +\$ g++ -O2 -fPIC -c example_wrap.cxx -I/usr/local/include/python2.5  \$ g++ -shared example.o example_wrap.o -o _example.so

-On some platforms, you could also need to generate -position-independent code (PIC), by using a compiler option such as -fPIC. -Notably, the x86_64 (Opteron and EM64T) platform requires it, and when -using the GNU Compiler Suite, you will need to modify the previous example -as follows: +The -fPIC option tells GCC to generate position-independent code (PIC) +which is required for most architectures (it's not vital on x86, but +still a good idea as it allows code pages from the library to be shared between +processes). Other compilers may need a different option specified instead of +-fPIC.

-
-\$ swig -c++ -python example.i -\$ g++ -fPIC -c example.cxx -\$ g++ -fPIC -c example_wrap.cxx -I/usr/local/include/python2.0 -\$ g++ -shared example.o example_wrap.o -o _example.so -
-

In addition to this, you may need to include additional library files to make it work. For example, if you are using the Sun C++ compiler on @@ -683,7 +676,7 @@

\$ swig -c++ -python example.i  \$ CC -c example.cxx -\$ CC -c example_wrap.cxx -I/usr/local/include/python2.0 +\$ CC -c example_wrap.cxx -I/usr/local/include/python2.5  \$ CC -G example.o example_wrap.o -L/opt/SUNWspro/lib -o _example.so -lCrun
@@ -1144,7 +1137,7 @@
>>> print f -<Swig Object at _08a71808_p_FILE> +<Swig Object of type 'FILE *' at 0xb7d6f470>

@@ -1154,7 +1147,7 @@

-In older versions of Swig (1.3.22 or older), pointers were represented +In older versions of SWIG (1.3.22 or older), pointers were represented using a plain string object. If you have an old package that still requires that representation, or you just feel nostalgic, you can always retrieve it by casting the pointer object to a string: @@ -1178,7 +1171,7 @@

However, the inverse operation is not possible, i.e., you can't build -a Swig pointer object from a raw integer value. +a SWIG pointer object from a raw integer value.

Modified: branches/gsoc2009-ashishs99/Doc/Manual/Ruby.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Ruby.html 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/Ruby.html 2009-10-16 19:19:49 UTC (rev 11700) @@ -2393,7 +2393,7 @@ -%include std_set.i
+%include <std_set.i>
@@ -7097,7 +7097,7 @@ with Ruby objects. The following functions may prove to be useful. (These functions plus many more can be found in Programming Ruby, by David Thomas and Andrew Hunt.)

-

In addition, we list equivalent functions that Swig defines, which +

In addition, we list equivalent functions that SWIG defines, which provide a language neutral conversion (these functions are defined for each swig language supported).  If you are trying to create a swig file that will work under multiple languages, it is recommended you @@ -7123,7 +7123,7 @@

• RUBYSwigSWIG
- + Modified: branches/gsoc2009-ashishs99/Doc/Manual/SWIG.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/SWIG.html 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/SWIG.html 2009-10-16 19:19:49 UTC (rev 11700) @@ -174,13 +174,8 @@ ...

-The name of the module is supplied using the special %module -directive (or the -module command line option). This -directive must appear at the beginning of the file and is used to name -the resulting extension module (in addition, this name often defines -a namespace in the target language). If the module name is supplied on the -command line, it overrides the name specified with the -%module directive. +The module name is supplied using the special %module +directive. Modules are described further in the Modules Introduction section.

@@ -672,7 +667,6 @@ enum months {JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC}; %constant double BLAH = 42.37; -#define F_CONST (double) 5 // A floating pointer constant with cast #define PI_4 PI/4 #define FLAGS 0x04 | 0x08 | 0x40 @@ -711,8 +705,15 @@

defines a constant because PI was already defined as a constant and the value is known. +However, for the same conservative reasons even a constant with a simple cast will be ignored, such as

+
+
+#define F_CONST (double) 5            // A floating pointer constant with cast +
+
+

The use of constant expressions is allowed, but SWIG does not evaluate them. Rather, it passes them through to the output file and lets the C @@ -2361,7 +2362,7 @@ #include "vector.h" %} -%include vector.h // Just grab original C header file +%include "vector.h" // Just grab original C header file %extend Vector { // Attach these functions to struct Vector Vector(double x, double y, double z) { Vector *v; @@ -2387,6 +2388,10 @@

Note the usage of the \$self special variable. Its usage is identical to a C++ 'this' pointer and should be used whenever access to the struct instance is required. +Also note that C++ constructor and destructor syntax has been used to simulate a constructor and destructor, even for C code. +There is one subtle difference to a normal C++ constructor implementation though and that is although the constructor declaration +is as per a normal C++ constructor, the newly constructed object must be returned as if the constructor declaration +had a return value, a Vector * in this case.

@@ -2711,6 +2716,10 @@

+
• Begin section.
+A placeholder to put code at the beginning of the C/C++ wrapper file. +
• +
• Runtime code.
This code is internal to SWIG and is used to include type-checking and other support functions that are used by the rest of the module. @@ -2883,10 +2892,16 @@ SWIG's %include directive to process an entire C source/header file. -
• Make sure everything in the interface file uses ANSI C/C++syntax. +
• Make sure everything in the interface file uses ANSI C/C++ syntax.
• Make sure all necessary `typedef' declarations and -type-information is available in the interface file. +type-information is available in the interface file. +In particular, ensure that the type information is specified in the correct order as required by a C/C++ compiler. +Most importantly, define a type before it is used! A C compiler will tell you +if the full type information is not available if it is needed, whereas +SWIG will usually not warn or error out as it is designed to work without +full type information. However, if type information is not specified +correctly, the wrappers can be sub-optimal and even result in uncompileable C/C++ code.
• If your program has a main() function, you may need to rename it (read on). @@ -2945,16 +2960,21 @@

Of course, in this case, our header file is pretty simple so we could -have made an interface file like this as well:

+use a simpler approach and use an interface file like this:

+The main advantage of this approach is minimal maintenance of an interface file for when the header file changes in the future. +In more complex projects, an interface file containing numerous %include and #include statements like this is one of the most common approaches to interface file design due to lower maintenance overhead. +

5.7.3 Why use separate interface files?

Modified: branches/gsoc2009-ashishs99/Doc/Manual/SWIGPlus.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/SWIGPlus.html 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/SWIGPlus.html 2009-10-16 19:19:49 UTC (rev 11700) @@ -3471,7 +3471,7 @@

In this case, the default and conversion constructors have the same -name. Hence, Swig will overload them and define an unique visible +name. Hence, SWIG will overload them and define an unique visible constructor, that will dispatch the proper call depending on the argument type.

Modified: branches/gsoc2009-ashishs99/Doc/Manual/Sections.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Sections.html 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/Sections.html 2009-10-16 19:19:49 UTC (rev 11700) @@ -6,7 +6,7 @@

SWIG-1.3 Development Documentation

-Last update : SWIG-1.3.40 (in progress) +Last update : SWIG-1.3.41 (in progress)

Sections

Modified: branches/gsoc2009-ashishs99/Doc/Manual/Tcl.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Tcl.html 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/Tcl.html 2009-10-16 19:19:49 UTC (rev 11700) @@ -66,6 +66,7 @@ +
• Tcl/Tk Stubs
@@ -190,7 +191,7 @@ extern double My_variable; %} -%include tclsh.i // Include code for rebuilding tclsh +%include "tclsh.i" // Include code for rebuilding tclsh @@ -2822,7 +2823,7 @@ return i; } %} -%include tclsh.i +%include "tclsh.i" @@ -3409,5 +3410,27 @@ interesting things.

+

33.10 Tcl/Tk Stubs

+ + +

+For background information about the Tcl Stubs feature, see +http://www.tcl.tk/doc/howto/stubs.html;. +

+ +

+As of SWIG 1.3.10, the generated C/C++ wrapper will use the Tcl Stubs +feature if compiled with -DUSE_TCL_STUBS. +

+ +

+As of SWIG 1.3.40, the generated C/C++ wrapper will use the Tk Stubs +feature if compiled with -DUSE_TK_STUBS. Also, you can override +the minimum version to support which is passed to Tcl_InitStubs() +and Tk_InitStubs() with -DSWIG_TCL_STUBS_VERSION="8.3" +or the version being compiled with using +-DSWIG_TCL_STUBS_VERSION=TCL_VERSION. +

+ Modified: branches/gsoc2009-ashishs99/Doc/Manual/Typemaps.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Typemaps.html 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/Typemaps.html 2009-10-16 19:19:49 UTC (rev 11700) @@ -22,13 +22,13 @@
• Typemap specifications -
• Pattern matching rules +
• Pattern matching rules
• Common typemap methods
• "in" typemap @@ -69,7 +74,7 @@
• The run-time type checker
• More about %apply and %clear @@ -83,10 +88,6 @@ -

-Disclaimer: This chapter is under construction! -

-

10.1 Introduction

@@ -225,14 +226,17 @@ However, there is really not much to it. The first typemap (the "in" typemap) is used to convert a value from the target language to C. The second typemap (the "out" typemap) is used to convert in the other -direction. The content of each typemap is a small fragment of C code -that is inserted directly into the SWIG generated wrapper functions. Within -this code, a number of special variables prefixed with a \$ are expanded. These are -really just placeholders for C variables that are generated in the course +direction. The content of each typemap is a small fragment of code +that is inserted directly into the SWIG generated wrapper functions. +The code is usually C or C++ code which will be generated into the C/C++ wrapper functions. +Note that this isn't always the case as some target language modules allow target language +code within the typemaps which gets generated into target language specific files. +Within this code, a number of special variables prefixed with a \$ are expanded. These are +really just placeholders for C/C++ variables that are generated in the course of creating the wrapper function. In this case, \$input refers to an -input object that needs to be converted to C and \$result +input object that needs to be converted to C/C++ and \$result refers to an object that is going to be returned by a wrapper -function. \$1 refers to a C variable that has the same type as +function. \$1 refers to a C/C++ variable that has the same type as specified in the typemap declaration (an int in this example).

@@ -655,7 +659,7 @@ This section describes the behavior of the %typemap directive itself.

-

10.2.1 Defining a typemap

+

10.2.1 Defining a typemap

@@ -988,7 +992,7 @@ within a particular namespace. In this example, this is done using the class declaration class string.

-

10.3 Pattern matching rules

+

10.3 Pattern matching rules

@@ -1646,6 +1650,7 @@

Within all typemaps, the following special variables are expanded. +This is by no means a complete list as some target languages have additional special variables which are documented in the language specific chapters.

@@ -1892,6 +1897,86 @@ +

10.4.4 Special variable macros

+ + +

+Special variable macros are like macro functions in that they take one or more input arguments +which are used for the macro expansion. +They look like macro/function calls but use the special variable \$ prefix to the macro name. +Note that unlike normal macros, the expansion is not done by the preprocessor, +it is done during the SWIG parsing/compilation stages. +The following special variable macros are available across all language modules. +

+ +

10.4.4.1 \$descriptor(type)

+ + +

+This macro expands into the type descriptor structure for any C/C++ type specified in type. +It behaves like the \$1_descriptor special variable described above except that the type to expand is +taken from the macro argument rather than inferred from the typemap type. +For example, \$descriptor(std::vector<int> *) will expand into SWIGTYPE_p_std__vectorT_int_t. +This macro is mostly used in the scripting target languages and is demonstrated later in the Run-time type checker usage section. +

+ +

10.4.4.2 \$typemap(method, typepattern)

+ + +

+This macro uses the pattern matching rules described earlier to lookup and +then substitute the special variable macro with the code in the matched typemap. +The typemap to search for is specified by the arguments, where method is the typemap method name and +typepattern is a type pattern as per the %typemap specification in the Defining a typemap section. +

+ +

+The special variables within the matched typemap are expanded into those for the matched typemap type, +not the typemap within which the macro is called. +In practice, there is little use for this macro in the scripting target languages. +It is mostly used in the target languages that are statically typed as a way to obtain the target language type given the C/C++ type and more commonly only when the C++ type is a template parameter. +

+ +

+The example below is for C# only and uses some typemap method names documented in the C# chapter, but it shows some of the possible syntax variations. +

+ +
+
+%typemap(cstype) unsigned long    "uint" +%typemap(cstype) unsigned long bb "bool" +%typemap(cscode) BarClass %{ +  void foo(\$typemap(cstype, unsigned long aa) var1, +           \$typemap(cstype, unsigned long bb) var2, +           \$typemap(cstype, (unsigned long bb)) var3, +           \$typemap(cstype, unsigned long) var4) +  { +    // do something +  } +%} +
+
+ +

+The result is the following expansion +

+ +
+
+%typemap(cstype) unsigned long    "uint" +%typemap(cstype) unsigned long bb "bool" +%typemap(cscode) BarClass %{ +  void foo(uint var1, +           bool var2, +           bool var3, +           uint var4) +  { +    // do something +  } +%} +
+
+

10.5 Common typemap methods

@@ -2636,8 +2721,9 @@

The "out" typemap is the main typemap for return types. This typemap supports an optional attribute flag called "optimal", which is for reducing -temporary variables and the amount of generated code. -It only really makes a difference when returning objects by value and it cannot always be used, +temporary variables and the amount of generated code, thereby giving the compiler the opportunity to +use return value optimization for generating faster executing code. +It only really makes a difference when returning objects by value and has some limitations on usage, as explained later on.

@@ -2695,7 +2781,7 @@ Note that three objects are being created as well as an assignment. Wouldn't it be great if the XX::create() method was the only time a constructor was called? As the method returns by value, this is asking a lot and the code that SWIG generates by default -makes it impossible for the compiler to make this type of optimisation. +makes it impossible for the compiler to use return value optimisation (RVO). However, this is where the "optimal" attribute in the "out" typemap can help out. If the typemap code is kept the same and just the "optimal" attribute specified like this:

@@ -2754,7 +2840,7 @@

The major difference is the result temporary variable holding the value returned from XX::create() is no longer generated and instead the copy constructor call is made directly from the value returned by XX::create(). -With modern compiler optimisations turned on, the copy is not actually done, in fact the object is never created +With modern compilers implementing RVO, the copy is not actually done, in fact the object is never created on the stack in XX::create() at all, it is simply created directly on the heap. In the first instance, the \$1 special variable in the typemap is expanded into result. In the second instance, \$1 is expanded into XX::create() and this is essentially @@ -2762,7 +2848,7 @@

-This kind of optimisation is not turned on by default as it has a number of restrictions. +The "optimal" attribute optimisation is not turned on by default as it has a number of restrictions. Firstly, some code cannot be condensed into a simple call for passing into the copy constructor. One common occurrence is when %exception is used. Consider adding the following %exception to the example: @@ -3294,7 +3380,7 @@ structures are chained together in a circularly linked list.

-

10.10.2 Usage

+

10.10.2 Usage

This section covers how to use these functions from typemaps. To learn how to @@ -3334,8 +3420,8 @@

Occasionally, you might need to write a typemap that needs to convert -pointers of other types. To handle this, a special macro substitution -\$descriptor(type) can be used to generate the SWIG type +pointers of other types. To handle this, the special variable macro +\$descriptor(type) covered earlier can be used to generate the SWIG type descriptor name for any C datatype. For example:

@@ -3973,6 +4059,7 @@ for how to define typemaps of your own. Some of the language modules support additional typemaps and further information is available in the individual chapters for each target language. +There you may also find more hands-on practical examples.

Modified: branches/gsoc2009-ashishs99/Doc/Manual/Windows.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Windows.html 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Doc/Manual/Windows.html 2009-10-16 19:19:49 UTC (rev 11700) @@ -248,7 +248,7 @@
1. Download the following packages from the MinGW download page - or MinGW SourceForge download page. + or MinGW SourceForge download page. Note that at the time of writing, the majority of these are in the Current release list and some are in the Snapshot or Previous release list.
Property changes on: branches/gsoc2009-ashishs99/Examples/GIFPlot/Php ___________________________________________________________________ Deleted: svn:mergeinfo - /branches/swig-2.0/Examples/GIFPlot/Php:11085-11086,11088-11089 Modified: branches/gsoc2009-ashishs99/Examples/Makefile.in =================================================================== --- branches/gsoc2009-ashishs99/Examples/Makefile.in 2009-10-13 23:26:01 UTC (rev 11699) +++ branches/gsoc2009-ashishs99/Examples/Makefile.in 2009-10-16 19:19:49 UTC (rev 11700) @@ -318,7 +318,7 @@ rm -f *_wrap* *~ .~* mypython@...@ *.pyc rm -f core @EXTRA_CLEAN@ rm -f *.@...@ *@SO@ *@PYTHON_SO@ - if [ -f runme.py ]; then (rm -f runme3.py runme3.py.bak;) fi; + if [ -f runme.py ]; then rm -f runme3.py runme3.py.bak; fi ################################################################## @@ Diff output truncated at 100000 characters. @@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
•  [Swig-cvs] SF.net SVN: swig:[11707] branches/gsoc2009-ashishs99 From: - 2009-10-20 21:24:50 ```Revision: 11707 http://swig.svn.sourceforge.net/swig/?rev=11707&view=rev Author: ashishs99 Date: 2009-10-20 21:24:42 +0000 (Tue, 20 Oct 2009) Log Message: ----------- Minor Fixes Modified Paths: -------------- branches/gsoc2009-ashishs99/Examples/Makefile.in branches/gsoc2009-ashishs99/Examples/objc/constants/example.i branches/gsoc2009-ashishs99/Source/Modules/objc.cxx Removed Paths: ------------- branches/gsoc2009-ashishs99/Examples/objectivec/ branches/gsoc2009-ashishs99/Lib/objectivec/ Modified: branches/gsoc2009-ashishs99/Examples/Makefile.in =================================================================== --- branches/gsoc2009-ashishs99/Examples/Makefile.in 2009-10-20 20:54:19 UTC (rev 11706) +++ branches/gsoc2009-ashishs99/Examples/Makefile.in 2009-10-20 21:24:42 UTC (rev 11707) @@ -1034,7 +1034,7 @@ # ----------------------------------------------------------------- objc_clean: - rm -f *Wrapper* *Proxy* *~ .~* *.o `find . -name \*.m | grep -v runme.m` + rm -f *Wrapper* *Proxy* *~ .~* *.o a.out `find . -name \*.m | grep -v runme.m` rm -f core @EXTRA_CLEAN@ rm -f *.@...@ *@OBJCSO@ Modified: branches/gsoc2009-ashishs99/Examples/objc/constants/example.i =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/constants/example.i 2009-10-20 20:54:19 UTC (rev 11706) +++ branches/gsoc2009-ashishs99/Examples/objc/constants/example.i 2009-10-20 21:24:42 UTC (rev 11707) @@ -1,8 +1,8 @@ /* File : example.i */ %module example -/* Force the generated Java code to use the C constant values rather than making an intermediate call */ -%objcconst(1); +/* Force the generated Objective-C code to use the C constant values rather than making an intermediate call */ +%objcconst(0); /* A few preprocessor macros */ Modified: branches/gsoc2009-ashishs99/Source/Modules/objc.cxx =================================================================== --- branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2009-10-20 20:54:19 UTC (rev 11706) +++ branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2009-10-20 21:24:42 UTC (rev 11707) @@ -714,7 +714,6 @@ String *func_name = NULL; String *tm; Parm *p; - Parm *last_parm = 0; int num_arguments = 0; int num_required = 0; int i; @@ -1606,8 +1605,11 @@ // This handles function pointers using the %constant directive Printf(constants_code, "[[[%s alloc] initWithCptr: &%s()] autorelease];\n", return_type, Swig_name_get(symname)); } - } else - Printf(constants_code, "%s();\n", Swig_name_get(symname)); + } else { + String *ocppfunctname = NewStringf("ObjCPP_%s", symname); + Printf(constants_code, "%s();\n", Swig_name_get(ocppfunctname)); + Delete(ocppfunctname); + } // Each constant and enum value is wrapped with a separate function call SetFlag(n, "feature:immutable"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Swig-cvs] SF.net SVN: swig:[11749] branches/gsoc2009-ashishs99 From: - 2009-11-17 15:26:34 ```Revision: 11749 http://swig.svn.sourceforge.net/swig/?rev=11749&view=rev Author: ashishs99 Date: 2009-11-17 15:26:25 +0000 (Tue, 17 Nov 2009) Log Message: ----------- Fixed few issues with the examples Modified Paths: -------------- branches/gsoc2009-ashishs99/Examples/objc/check.list branches/gsoc2009-ashishs99/Examples/objc/native/example.i branches/gsoc2009-ashishs99/Examples/objc/pointer/Makefile branches/gsoc2009-ashishs99/Source/Modules/objc.cxx Modified: branches/gsoc2009-ashishs99/Examples/objc/check.list =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/check.list 2009-11-15 00:36:22 UTC (rev 11748) +++ branches/gsoc2009-ashishs99/Examples/objc/check.list 2009-11-17 15:26:25 UTC (rev 11749) @@ -1,11 +1,11 @@ # see top-level Makefile.in callback class -constants +#constants enum extend -funcptr -native +#funcptr +#native pointer reference simple Modified: branches/gsoc2009-ashishs99/Examples/objc/native/example.i =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/native/example.i 2009-11-15 00:36:22 UTC (rev 11748) +++ branches/gsoc2009-ashishs99/Examples/objc/native/example.i 2009-11-17 15:26:25 UTC (rev 11749) @@ -50,7 +50,4 @@ _Point *point_create(int x, int y); char *point_toString1(_Point *p); -/* give access to free() for memory cleanup of the malloc'd _Point */ -extern void free(void *memblock); - %native(point_toString2) char *point_toString2(_Point *p); Modified: branches/gsoc2009-ashishs99/Examples/objc/pointer/Makefile =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/pointer/Makefile 2009-11-15 00:36:22 UTC (rev 11748) +++ branches/gsoc2009-ashishs99/Examples/objc/pointer/Makefile 2009-11-17 15:26:25 UTC (rev 11749) @@ -12,12 +12,12 @@ all:: objc objc:: - \$(MAKE) -f \$(TOP)/Makefile SRCS='\$(SRCS)' SWIG='\$(SWIG)' \ - SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc - \$(MAKE) -f \$(TOP)/Makefile OBJCPPSRCS='\$(OBJCPPSRCS)' OBJPPCFLAGS='(OBJCPPFLAGS)' objcpp_compile - \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='(OBJCFLAGS)' objc_compile + \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCPPSRCS='\$(OBJCPPSRCS)' SWIG='\$(SWIG)' \ + SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc_cpp + \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='\$(OBJCFLAGS)' TARGET='\$(TARGET)' objc_compile clean:: \$(MAKE) -f \$(TOP)/Makefile objc_clean check: all + Modified: branches/gsoc2009-ashishs99/Source/Modules/objc.cxx =================================================================== --- branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2009-11-15 00:36:22 UTC (rev 11748) +++ branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2009-11-17 15:26:25 UTC (rev 11749) @@ -48,7 +48,8 @@ String *proxy_global_constants_code; enum EnumFeature { SimpleEnum, ProperEnum }; - + enum ConstFeature { CStyleConstants, ObjcStyleConstants, ObjcStyleWrapConstants }; + public: OBJC():empty_string(NewString("")), swig_types_hash(NULL), @@ -1349,6 +1350,27 @@ return enum_feature; } + /*---------------------------------------------------------------------- + * decodeConstantFeature() + * Decode the possible constant features, which are one of: + * %objcconst(cstyle) - default + * %objcconst(objcstyle) + * %objcconst(objcstylewrap) + *--------------------------------------------------------------------*/ + + ConstFeature decodeConstFeature(Node *n) { + ConstFeature const_feature = CStyleConstants; + String *feature = Getattr(n, "feature:objc:const"); + if (feature) { + if (Cmp(feature, "cstyle") == 0) + const_feature = CStyleConstants; + else if (Cmp(feature, "objcstyle") == 0) + const_feature = ObjcStyleConstants; + else if (Cmp(feature, "objcstylewrap") == 0) + const_feature = ObjcStyleWrapConstants; + } + return const_feature; + } /* ----------------------------------------------------------------------- * enumValue() @@ -1554,9 +1576,9 @@ bool is_enum_item = (Cmp(nodeType(n), "enumitem") == 0); - // The %objcconst feature determines how the constant value is obtained - int const_feature_flag = GetFlag(n, "feature:objc:const"); - + // The %objcconst feature determines how the contants are represented (C-Style or Objc-Style) and how the constant value is obtained + ConstFeature const_feature_flag = decodeConstFeature(n); + /* Adjust the enum type for the Swig_typemap_lookup. * We want the same objctype typemap for all the enum items so we use the enum type (parent node). */ if (is_enum_item) { @@ -1565,7 +1587,7 @@ } /* Attach the non-standard typemaps to the parameter list. */ - Swig_typemap_attach_parms("objctype", l, NULL); + Swig_typemap_attach_parms("objctype", l, NULL); /* Get Objective-C return types */ bool classname_substituted_flag = false; @@ -1578,32 +1600,54 @@ } - // Add the stripped quotes back in - String *new_value = NewString(""); - Swig_save("constantWrapper", n, "value", NIL); - if (SwigType_type(t) == T_STRING) { - Printf(new_value, "@\"%s\"", Copy(Getattr(n, "value"))); - Setattr(n, "value", new_value); - } else if (SwigType_type(t) == T_CHAR) { - Printf(new_value, "\'%s\'", Copy(Getattr(n, "value"))); //character pointer ?? - Setattr(n, "value", new_value); - } + const String *itemname = (proxy_flag && wrapping_member_flag) ? variable_name : symname; + + if(const_feature_flag == CStyleConstants) { + Printf(constants_code,"%s %s=", SwigType_str(t, 0), itemname); + } + else if(const_feature_flag == ObjcStyleConstants) { + Printf(constants_code, "%s %s %s= ", "const", return_type, itemname); + } + else { + Printf(constants_code, "%s %s %s= ", "static", return_type, itemname); + } + - const String *outattributes = Getattr(n, "tmap:objctype:outattributes"); - if (outattributes) - Printf(constants_code, " %s\n", outattributes); - const String *itemname = (proxy_flag && wrapping_member_flag) ? variable_name : symname; - - Printf(constants_code, "%s %s %s = ", (const_feature_flag ? "const" : "static"), return_type, itemname); - // Check for the %objcconstvalue feature String *value = Getattr(n, "feature:objc:constvalue"); if (value) { Printf(constants_code, "%s;\n", value); - } else if (!const_feature_flag) { - // Default enum and constant handling will work with any type of C constant and initialises the Objective-C variable from C through a method call. + + } else if (const_feature_flag == CStyleConstants) { + if (SwigType_type(t) == T_STRING) { + Printf(constants_code, "\"%s\";\n", Getattr(n, "value")); + } else if (SwigType_type(t) == T_CHAR) { + Printf(constants_code, "\'%s\';\n", Getattr(n, "value")); + } + else { + Printf(constants_code, "%s;\n", Getattr(n, "value")); + } + } else if (const_feature_flag == ObjcStyleConstants) { + // This constant handling will use the C syntax to make a true Objective-C constant and hope that it compiles as Objective-C code + // Add the stripped quotes back in + String *new_value = NewString(""); + Swig_save("constantWrapper", n, "value", NIL); + if (SwigType_type(t) == T_STRING) { + Printf(new_value, "@\"%s\"", Copy(Getattr(n, "value"))); + Setattr(n, "value", new_value); + } else if (SwigType_type(t) == T_CHAR) { + Printf(new_value, "\'%s\'", Copy(Getattr(n, "value"))); //character pointer in obj-c ?? + Setattr(n, "value", new_value); + } + + Printf(constants_code, "%s;\n", Getattr(n, "value")); + Delete(new_value); + } else { + + // This constant/enum handling will work with any type of C constant and initializes the Objective-C variable from C through a method call. + if (classname_substituted_flag) { if (SwigType_isenum(t)) { // This handles wrapping of inline initialised const enum static member variables (not when wrapping enum items - ignored later on) @@ -1617,17 +1661,13 @@ Printf(constants_code, "%s();\n", Swig_name_get(ocppfunctname)); Delete(ocppfunctname); } - // Each constant and enum value is wrapped with a separate function call SetFlag(n, "feature:immutable"); enum_constant_flag = true; variableWrapper(n); enum_constant_flag = false; - } else { - // Alternative constant handling will use the C syntax to make a true Objective-C constant and hope that it compiles as Objective-C code - Printf(constants_code, "%s;\n", Getattr(n, "value")); - } - + } + // Emit the generated code to appropriate place // Enums only emit the intermediate methods, so no proxy wrapper methods needed if (!is_enum_item) { @@ -1641,7 +1681,6 @@ } // Cleanup Swig_restore(n); - Delete(new_value); Delete(return_type); Delete(constants_code); return SWIG_OK; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Swig-cvs] SF.net SVN: swig:[11903] branches/gsoc2009-ashishs99 From: - 2010-03-06 00:15:43 ```Revision: 11903 http://swig.svn.sourceforge.net/swig/?rev=11903&view=rev Author: wsfulton Date: 2010-03-06 00:15:31 +0000 (Sat, 06 Mar 2010) Log Message: ----------- merge revisions 11872:11876 from trunk to gsoc2009-ashish99 branch - license changes Modified Paths: -------------- branches/gsoc2009-ashishs99/ANNOUNCE branches/gsoc2009-ashishs99/Doc/Manual/Sections.html branches/gsoc2009-ashishs99/Examples/guile/check.list branches/gsoc2009-ashishs99/Examples/lua/lua.c branches/gsoc2009-ashishs99/Examples/test-suite/csharp/li_std_map_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/li_std_queue.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_set.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_stack.i branches/gsoc2009-ashishs99/Examples/test-suite/ruby/ruby_li_std_speed_runme.rb branches/gsoc2009-ashishs99/Examples/test-suite/ruby_li_std_speed.i branches/gsoc2009-ashishs99/Lib/allegrocl/allegrocl.swg branches/gsoc2009-ashishs99/Lib/allegrocl/longlongs.i branches/gsoc2009-ashishs99/Lib/allegrocl/std_list.i branches/gsoc2009-ashishs99/Lib/allegrocl/std_string.i branches/gsoc2009-ashishs99/Lib/attribute.i branches/gsoc2009-ashishs99/Lib/carrays.i branches/gsoc2009-ashishs99/Lib/cdata.i branches/gsoc2009-ashishs99/Lib/chicken/chicken.swg branches/gsoc2009-ashishs99/Lib/chicken/chickenrun.swg branches/gsoc2009-ashishs99/Lib/chicken/multi-generic.scm branches/gsoc2009-ashishs99/Lib/chicken/std_string.i branches/gsoc2009-ashishs99/Lib/chicken/typemaps.i branches/gsoc2009-ashishs99/Lib/clisp/clisp.swg branches/gsoc2009-ashishs99/Lib/cmalloc.i branches/gsoc2009-ashishs99/Lib/constraints.i branches/gsoc2009-ashishs99/Lib/cpointer.i branches/gsoc2009-ashishs99/Lib/csharp/arrays_csharp.i branches/gsoc2009-ashishs99/Lib/csharp/csharp.swg branches/gsoc2009-ashishs99/Lib/csharp/csharphead.swg branches/gsoc2009-ashishs99/Lib/csharp/director.swg branches/gsoc2009-ashishs99/Lib/csharp/enums.swg branches/gsoc2009-ashishs99/Lib/csharp/enumsimple.swg branches/gsoc2009-ashishs99/Lib/csharp/enumtypesafe.swg branches/gsoc2009-ashishs99/Lib/csharp/std_except.i branches/gsoc2009-ashishs99/Lib/csharp/std_map.i branches/gsoc2009-ashishs99/Lib/csharp/std_pair.i branches/gsoc2009-ashishs99/Lib/csharp/std_string.i branches/gsoc2009-ashishs99/Lib/csharp/std_vector.i branches/gsoc2009-ashishs99/Lib/csharp/std_wstring.i branches/gsoc2009-ashishs99/Lib/csharp/stl.i branches/gsoc2009-ashishs99/Lib/csharp/typemaps.i branches/gsoc2009-ashishs99/Lib/csharp/wchar.i branches/gsoc2009-ashishs99/Lib/cstring.i branches/gsoc2009-ashishs99/Lib/cwstring.i branches/gsoc2009-ashishs99/Lib/exception.i branches/gsoc2009-ashishs99/Lib/gcj/cni.swg branches/gsoc2009-ashishs99/Lib/guile/common.scm branches/gsoc2009-ashishs99/Lib/guile/cplusplus.i branches/gsoc2009-ashishs99/Lib/guile/guile.i branches/gsoc2009-ashishs99/Lib/guile/guile_gh.swg branches/gsoc2009-ashishs99/Lib/guile/guile_gh_run.swg branches/gsoc2009-ashishs99/Lib/guile/guile_scm.swg branches/gsoc2009-ashishs99/Lib/guile/guile_scm_run.swg branches/gsoc2009-ashishs99/Lib/guile/guilemain.i branches/gsoc2009-ashishs99/Lib/guile/interpreter.i branches/gsoc2009-ashishs99/Lib/guile/list-vector.i branches/gsoc2009-ashishs99/Lib/guile/pointer-in-out.i branches/gsoc2009-ashishs99/Lib/guile/ports.i branches/gsoc2009-ashishs99/Lib/guile/std_common.i branches/gsoc2009-ashishs99/Lib/guile/std_map.i branches/gsoc2009-ashishs99/Lib/guile/std_pair.i branches/gsoc2009-ashishs99/Lib/guile/std_string.i branches/gsoc2009-ashishs99/Lib/guile/std_vector.i branches/gsoc2009-ashishs99/Lib/guile/stl.i branches/gsoc2009-ashishs99/Lib/guile/typemaps.i branches/gsoc2009-ashishs99/Lib/inttypes.i branches/gsoc2009-ashishs99/Lib/java/arrays_java.i branches/gsoc2009-ashishs99/Lib/java/director.swg branches/gsoc2009-ashishs99/Lib/java/enums.swg branches/gsoc2009-ashishs99/Lib/java/enumsimple.swg branches/gsoc2009-ashishs99/Lib/java/enumtypesafe.swg branches/gsoc2009-ashishs99/Lib/java/enumtypeunsafe.swg branches/gsoc2009-ashishs99/Lib/java/java.swg branches/gsoc2009-ashishs99/Lib/java/javahead.swg branches/gsoc2009-ashishs99/Lib/java/std_except.i branches/gsoc2009-ashishs99/Lib/java/std_map.i branches/gsoc2009-ashishs99/Lib/java/std_pair.i branches/gsoc2009-ashishs99/Lib/java/std_string.i branches/gsoc2009-ashishs99/Lib/java/std_vector.i branches/gsoc2009-ashishs99/Lib/java/std_wstring.i branches/gsoc2009-ashishs99/Lib/java/stl.i branches/gsoc2009-ashishs99/Lib/java/typemaps.i branches/gsoc2009-ashishs99/Lib/java/various.i branches/gsoc2009-ashishs99/Lib/lua/_std_common.i branches/gsoc2009-ashishs99/Lib/lua/lua.swg branches/gsoc2009-ashishs99/Lib/lua/lua_fnptr.i branches/gsoc2009-ashishs99/Lib/lua/luarun.swg branches/gsoc2009-ashishs99/Lib/lua/luaruntime.swg branches/gsoc2009-ashishs99/Lib/lua/luatypemaps.swg branches/gsoc2009-ashishs99/Lib/lua/std_except.i branches/gsoc2009-ashishs99/Lib/lua/std_map.i branches/gsoc2009-ashishs99/Lib/lua/std_pair.i branches/gsoc2009-ashishs99/Lib/lua/std_string.i branches/gsoc2009-ashishs99/Lib/lua/std_vector.i branches/gsoc2009-ashishs99/Lib/lua/stl.i branches/gsoc2009-ashishs99/Lib/lua/typemaps.i branches/gsoc2009-ashishs99/Lib/lua/wchar.i branches/gsoc2009-ashishs99/Lib/math.i branches/gsoc2009-ashishs99/Lib/modula3/modula3.swg branches/gsoc2009-ashishs99/Lib/modula3/modula3head.swg branches/gsoc2009-ashishs99/Lib/modula3/typemaps.i branches/gsoc2009-ashishs99/Lib/mzscheme/mzrun.swg branches/gsoc2009-ashishs99/Lib/mzscheme/mzscheme.swg branches/gsoc2009-ashishs99/Lib/mzscheme/std_common.i branches/gsoc2009-ashishs99/Lib/mzscheme/std_map.i branches/gsoc2009-ashishs99/Lib/mzscheme/std_pair.i branches/gsoc2009-ashishs99/Lib/mzscheme/std_string.i branches/gsoc2009-ashishs99/Lib/mzscheme/std_vector.i branches/gsoc2009-ashishs99/Lib/mzscheme/stl.i branches/gsoc2009-ashishs99/Lib/mzscheme/typemaps.i branches/gsoc2009-ashishs99/Lib/ocaml/cstring.i branches/gsoc2009-ashishs99/Lib/ocaml/director.swg branches/gsoc2009-ashishs99/Lib/ocaml/ocaml.i branches/gsoc2009-ashishs99/Lib/ocaml/ocamldec.swg branches/gsoc2009-ashishs99/Lib/ocaml/std_common.i branches/gsoc2009-ashishs99/Lib/ocaml/std_deque.i branches/gsoc2009-ashishs99/Lib/ocaml/std_list.i branches/gsoc2009-ashishs99/Lib/ocaml/std_map.i branches/gsoc2009-ashishs99/Lib/ocaml/std_pair.i branches/gsoc2009-ashishs99/Lib/ocaml/std_string.i branches/gsoc2009-ashishs99/Lib/ocaml/std_vector.i branches/gsoc2009-ashishs99/Lib/ocaml/stl.i branches/gsoc2009-ashishs99/Lib/ocaml/typecheck.i branches/gsoc2009-ashishs99/Lib/ocaml/typemaps.i branches/gsoc2009-ashishs99/Lib/octave/octcontainer.swg branches/gsoc2009-ashishs99/Lib/octave/octiterators.swg branches/gsoc2009-ashishs99/Lib/perl5/perlmain.i branches/gsoc2009-ashishs99/Lib/perl5/reference.i branches/gsoc2009-ashishs99/Lib/perl5/std_common.i branches/gsoc2009-ashishs99/Lib/perl5/std_list.i branches/gsoc2009-ashishs99/Lib/perl5/std_map.i branches/gsoc2009-ashishs99/Lib/perl5/std_pair.i branches/gsoc2009-ashishs99/Lib/perl5/std_vector.i branches/gsoc2009-ashishs99/Lib/perl5/stl.i branches/gsoc2009-ashishs99/Lib/perl5/typemaps.i branches/gsoc2009-ashishs99/Lib/php/const.i branches/gsoc2009-ashishs99/Lib/php/director.swg branches/gsoc2009-ashishs99/Lib/php/globalvar.i branches/gsoc2009-ashishs99/Lib/php/php.swg branches/gsoc2009-ashishs99/Lib/php/phpkw.swg branches/gsoc2009-ashishs99/Lib/php/phprun.swg branches/gsoc2009-ashishs99/Lib/php/std_common.i branches/gsoc2009-ashishs99/Lib/php/std_map.i branches/gsoc2009-ashishs99/Lib/php/std_pair.i branches/gsoc2009-ashishs99/Lib/php/std_string.i branches/gsoc2009-ashishs99/Lib/php/std_vector.i branches/gsoc2009-ashishs99/Lib/php/stl.i branches/gsoc2009-ashishs99/Lib/php/typemaps.i branches/gsoc2009-ashishs99/Lib/pike/pike.swg branches/gsoc2009-ashishs99/Lib/pike/pikerun.swg branches/gsoc2009-ashishs99/Lib/pike/std_string.i branches/gsoc2009-ashishs99/Lib/pointer.i branches/gsoc2009-ashishs99/Lib/python/ccomplex.i branches/gsoc2009-ashishs99/Lib/python/director.swg branches/gsoc2009-ashishs99/Lib/python/embed15.i branches/gsoc2009-ashishs99/Lib/python/file.i branches/gsoc2009-ashishs99/Lib/python/pycontainer.swg branches/gsoc2009-ashishs99/Lib/python/pyiterators.swg branches/gsoc2009-ashishs99/Lib/python/pyrun.swg branches/gsoc2009-ashishs99/Lib/python/typemaps.i branches/gsoc2009-ashishs99/Lib/ruby/director.swg branches/gsoc2009-ashishs99/Lib/ruby/rubyautodoc.swg branches/gsoc2009-ashishs99/Lib/ruby/rubycontainer.swg branches/gsoc2009-ashishs99/Lib/ruby/rubycontainer_extended.swg branches/gsoc2009-ashishs99/Lib/ruby/rubyiterators.swg branches/gsoc2009-ashishs99/Lib/ruby/rubyprimtypes.swg branches/gsoc2009-ashishs99/Lib/ruby/rubyrun.swg branches/gsoc2009-ashishs99/Lib/ruby/rubystdautodoc.swg branches/gsoc2009-ashishs99/Lib/ruby/rubytracking.swg branches/gsoc2009-ashishs99/Lib/ruby/rubywstrings.swg branches/gsoc2009-ashishs99/Lib/ruby/stl.i branches/gsoc2009-ashishs99/Lib/ruby/typemaps.i branches/gsoc2009-ashishs99/Lib/std/_std_deque.i branches/gsoc2009-ashishs99/Lib/std_except.i branches/gsoc2009-ashishs99/Lib/stdint.i branches/gsoc2009-ashishs99/Lib/stl.i branches/gsoc2009-ashishs99/Lib/swigarch.i branches/gsoc2009-ashishs99/Lib/swigrun.i branches/gsoc2009-ashishs99/Lib/tcl/mactkinit.c branches/gsoc2009-ashishs99/Lib/tcl/std_common.i branches/gsoc2009-ashishs99/Lib/tcl/std_pair.i branches/gsoc2009-ashishs99/Lib/tcl/std_vector.i branches/gsoc2009-ashishs99/Lib/tcl/stl.i branches/gsoc2009-ashishs99/Lib/tcl/tcl8.swg branches/gsoc2009-ashishs99/Lib/tcl/tclinterp.i branches/gsoc2009-ashishs99/Lib/tcl/tclopers.swg branches/gsoc2009-ashishs99/Lib/tcl/tclresult.i branches/gsoc2009-ashishs99/Lib/tcl/tclrun.swg branches/gsoc2009-ashishs99/Lib/tcl/tclsh.i branches/gsoc2009-ashishs99/Lib/tcl/tclwstrings.swg branches/gsoc2009-ashishs99/Lib/tcl/typemaps.i branches/gsoc2009-ashishs99/Lib/tcl/wish.i branches/gsoc2009-ashishs99/Lib/typemaps/attribute.swg branches/gsoc2009-ashishs99/Lib/typemaps/carrays.swg branches/gsoc2009-ashishs99/Lib/typemaps/cdata.swg branches/gsoc2009-ashishs99/Lib/typemaps/cmalloc.swg branches/gsoc2009-ashishs99/Lib/typemaps/cpointer.swg branches/gsoc2009-ashishs99/Lib/typemaps/cstrings.swg branches/gsoc2009-ashishs99/Lib/typemaps/exception.swg branches/gsoc2009-ashishs99/Lib/typemaps/ptrtypes.swg branches/gsoc2009-ashishs99/Lib/typemaps/swigtypemaps.swg branches/gsoc2009-ashishs99/Lib/typemaps/typemaps.swg branches/gsoc2009-ashishs99/Lib/uffi/uffi.swg branches/gsoc2009-ashishs99/Lib/wchar.i branches/gsoc2009-ashishs99/Lib/windows.i branches/gsoc2009-ashishs99/Makefile.in branches/gsoc2009-ashishs99/README branches/gsoc2009-ashishs99/Source/CParse/cparse.h branches/gsoc2009-ashishs99/Source/CParse/cscanner.c branches/gsoc2009-ashishs99/Source/CParse/parser.y branches/gsoc2009-ashishs99/Source/CParse/templ.c branches/gsoc2009-ashishs99/Source/CParse/util.c branches/gsoc2009-ashishs99/Source/DOH/base.c branches/gsoc2009-ashishs99/Source/DOH/doh.h branches/gsoc2009-ashishs99/Source/DOH/dohint.h branches/gsoc2009-ashishs99/Source/DOH/file.c branches/gsoc2009-ashishs99/Source/DOH/fio.c branches/gsoc2009-ashishs99/Source/DOH/hash.c branches/gsoc2009-ashishs99/Source/DOH/list.c branches/gsoc2009-ashishs99/Source/DOH/memory.c branches/gsoc2009-ashishs99/Source/DOH/string.c branches/gsoc2009-ashishs99/Source/DOH/void.c branches/gsoc2009-ashishs99/Source/Include/swigwarn.h branches/gsoc2009-ashishs99/Source/Modules/allegrocl.cxx branches/gsoc2009-ashishs99/Source/Modules/allocate.cxx branches/gsoc2009-ashishs99/Source/Modules/browser.cxx branches/gsoc2009-ashishs99/Source/Modules/cffi.cxx branches/gsoc2009-ashishs99/Source/Modules/chicken.cxx branches/gsoc2009-ashishs99/Source/Modules/clisp.cxx branches/gsoc2009-ashishs99/Source/Modules/contract.cxx branches/gsoc2009-ashishs99/Source/Modules/csharp.cxx branches/gsoc2009-ashishs99/Source/Modules/directors.cxx branches/gsoc2009-ashishs99/Source/Modules/emit.cxx branches/gsoc2009-ashishs99/Source/Modules/guile.cxx branches/gsoc2009-ashishs99/Source/Modules/java.cxx branches/gsoc2009-ashishs99/Source/Modules/lang.cxx branches/gsoc2009-ashishs99/Source/Modules/lua.cxx branches/gsoc2009-ashishs99/Source/Modules/main.cxx branches/gsoc2009-ashishs99/Source/Modules/modula3.cxx branches/gsoc2009-ashishs99/Source/Modules/module.cxx branches/gsoc2009-ashishs99/Source/Modules/mzscheme.cxx branches/gsoc2009-ashishs99/Source/Modules/ocaml.cxx branches/gsoc2009-ashishs99/Source/Modules/octave.cxx branches/gsoc2009-ashishs99/Source/Modules/overload.cxx branches/gsoc2009-ashishs99/Source/Modules/perl5.cxx branches/gsoc2009-ashishs99/Source/Modules/php.cxx branches/gsoc2009-ashishs99/Source/Modules/pike.cxx branches/gsoc2009-ashishs99/Source/Modules/python.cxx branches/gsoc2009-ashishs99/Source/Modules/r.cxx branches/gsoc2009-ashishs99/Source/Modules/ruby.cxx branches/gsoc2009-ashishs99/Source/Modules/s-exp.cxx branches/gsoc2009-ashishs99/Source/Modules/swigmain.cxx branches/gsoc2009-ashishs99/Source/Modules/swigmod.h branches/gsoc2009-ashishs99/Source/Modules/tcl8.cxx branches/gsoc2009-ashishs99/Source/Modules/typepass.cxx branches/gsoc2009-ashishs99/Source/Modules/uffi.cxx branches/gsoc2009-ashishs99/Source/Modules/utils.cxx branches/gsoc2009-ashishs99/Source/Modules/xml.cxx branches/gsoc2009-ashishs99/Source/Preprocessor/cpp.c branches/gsoc2009-ashishs99/Source/Preprocessor/expr.c branches/gsoc2009-ashishs99/Source/Preprocessor/preprocessor.h branches/gsoc2009-ashishs99/Source/Swig/cwrap.c branches/gsoc2009-ashishs99/Source/Swig/deprecate.c branches/gsoc2009-ashishs99/Source/Swig/error.c branches/gsoc2009-ashishs99/Source/Swig/fragment.c branches/gsoc2009-ashishs99/Source/Swig/getopt.c branches/gsoc2009-ashishs99/Source/Swig/include.c branches/gsoc2009-ashishs99/Source/Swig/misc.c branches/gsoc2009-ashishs99/Source/Swig/naming.c branches/gsoc2009-ashishs99/Source/Swig/parms.c branches/gsoc2009-ashishs99/Source/Swig/scanner.c branches/gsoc2009-ashishs99/Source/Swig/stype.c branches/gsoc2009-ashishs99/Source/Swig/swig.h branches/gsoc2009-ashishs99/Source/Swig/swigfile.h branches/gsoc2009-ashishs99/Source/Swig/swigopt.h branches/gsoc2009-ashishs99/Source/Swig/swigparm.h branches/gsoc2009-ashishs99/Source/Swig/swigscan.h branches/gsoc2009-ashishs99/Source/Swig/swigtree.h branches/gsoc2009-ashishs99/Source/Swig/swigwrap.h branches/gsoc2009-ashishs99/Source/Swig/symbol.c branches/gsoc2009-ashishs99/Source/Swig/tree.c branches/gsoc2009-ashishs99/Source/Swig/typemap.c branches/gsoc2009-ashishs99/Source/Swig/typeobj.c branches/gsoc2009-ashishs99/Source/Swig/typesys.c branches/gsoc2009-ashishs99/Source/Swig/wrapfunc.c branches/gsoc2009-ashishs99/configure.in Added Paths: ----------- branches/gsoc2009-ashishs99/COPYRIGHT branches/gsoc2009-ashishs99/LICENSE branches/gsoc2009-ashishs99/LICENSE-GPL branches/gsoc2009-ashishs99/LICENSE-UNIVERSITIES Removed Paths: ------------- branches/gsoc2009-ashishs99/Examples/GIFPlot/ branches/gsoc2009-ashishs99/Examples/chicken/zlib/ branches/gsoc2009-ashishs99/Examples/xml/example_gif.i branches/gsoc2009-ashishs99/LICENSE branches/gsoc2009-ashishs99/Lib/tcl/mactclinit.c Property Changed: ---------------- branches/gsoc2009-ashishs99/ branches/gsoc2009-ashishs99/Examples/php/extend/ branches/gsoc2009-ashishs99/Examples/test-suite/csharp/special_variable_macros_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/java/special_variable_macros_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/li_reference.i branches/gsoc2009-ashishs99/Examples/test-suite/perl5/li_reference_runme.pl branches/gsoc2009-ashishs99/Examples/test-suite/python/special_variable_macros_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/special_variable_macros.i Property changes on: branches/gsoc2009-ashishs99 ___________________________________________________________________ Modified: svn:mergeinfo - /branches/swig-2.0:11085-11086,11088-11089 /trunk:11208-11696 + /branches/swig-2.0:11085-11086,11088-11089 /trunk:11208-11696,11873-11876 Modified: branches/gsoc2009-ashishs99/ANNOUNCE =================================================================== --- branches/gsoc2009-ashishs99/ANNOUNCE 2010-03-06 00:11:40 UTC (rev 11902) +++ branches/gsoc2009-ashishs99/ANNOUNCE 2010-03-06 00:15:31 UTC (rev 11903) @@ -1,10 +1,10 @@ -*** ANNOUNCE: SWIG 1.3.41 (in progress) *** +*** ANNOUNCE: SWIG 2.0.0 (in progress) *** http://www.swig.org -We're pleased to announce SWIG-1.3.41, the latest installment in the -SWIG development effort. SWIG-1.3.41 includes a number of bug fixes +We're pleased to announce SWIG-2.0.0, the latest installment in the +SWIG development effort. SWIG-2.0.0 includes a number of bug fixes and enhancements. What is SWIG? @@ -24,11 +24,11 @@ ------------- The release is available for download on Sourceforge at - http://prdownloads.sourceforge.net/swig/swig-1.3.41.tar.gz + http://prdownloads.sourceforge.net/swig/swig-2.0.0.tar.gz A Windows version is also available at - http://prdownloads.sourceforge.net/swig/swigwin-1.3.41.zip + http://prdownloads.sourceforge.net/swig/swigwin-2.0.0.zip Please report problems with this release to the swig-dev mailing list, details at http://www.swig.org/mail.html. Copied: branches/gsoc2009-ashishs99/COPYRIGHT (from rev 11876, trunk/COPYRIGHT) =================================================================== --- branches/gsoc2009-ashishs99/COPYRIGHT (rev 0) +++ branches/gsoc2009-ashishs99/COPYRIGHT 2010-03-06 00:15:31 UTC (rev 11903) @@ -0,0 +1,63 @@ +SWIG Copyright and Authors +-------------------------- + +Copyright (c) 1995-2010 The SWIG Developers +Copyright (c) 2005-2006 Arizona Board of Regents (University of Arizona). +Copyright (c) 1998-2005 University of Chicago. +Copyright (c) 1995-1998 The University of Utah and the Regents of the University of California + +Portions also copyrighted by: + Network Applied Communication Laboratory, Inc + Information-technology Promotion Agency, Japan + +Active SWIG Developers: + William Fulton (wsf@...) (SWIG core, Java, C#, Windows, Cygwin) + Olly Betts (olly@...) (PHP) + Joseph Wang (joequant@...) (R) + Xavier Delacour (xavier.delacour@...) (Octave) + +Past SWIG developers and major contributors include: + Dave Beazley (dave-swig@...) (SWIG core, Python, Tcl, Perl) + Henning Thielemann (swig@...) (Modula3) + Matthias Köppe (mkoeppe@...) (Guile, MzScheme) + Luigi Ballabio (luigi.ballabio@...) (STL wrapping) + Mikel Bancroft (mikel@...) (Allegro CL) + Surendra Singhi (efuzzyone@...) (CLISP, CFFI) + Marcelo Matus (mmatus@...) (SWIG core, Python, UTL[python,perl,tcl,ruby]) + Art Yerkes (ayerkes@...) (Ocaml) + Lyle Johnson (lyle@...) (Ruby) + Charlie Savage (cfis@...) (Ruby) + Thien-Thi Nguyen (ttn@...) (build/test/misc) + Richard Palmer (richard@...) (PHP) + Sam Liddicott - Anonova Ltd (saml@...) (PHP) + Tim Hockin - Sun Microsystems (thockin@...) (PHP) + Kevin Ruland (PHP) + Shibukawa Yoshiki (Japanese Translation) + Jason Stewart (jason@...) (Perl5) + Loic Dachary (Perl5) + David Fletcher (Perl5) + Gary Holt (Perl5) + Masaki Fukushima (Ruby) + Scott Michel (scottm@...) (Java directors) + Tiger Feng (songyanf@...) (SWIG core) + Mark Rose (mrose@...) (Directors) + Jonah Beckford (beckford@...) (CHICKEN) + Ahmon Dancy (dancy@...) (Allegro CL) + Dirk Gerrits (Allegro CL) + Neil Cawse (C#) + Harco de Hilster (Java) + Alexey Dyachenko (dyachenko@...) (Tcl) + Bob Techentin (Tcl) + Martin Froehlich (Guile) + Marcio Luis Teixeira (Guile) + Duncan Temple Lang (R) + Miklos Vajna (PHP directors) + Mark Gossage (mark@...) (Lua) + Gonzalo Garramuno (ggarra@...) (Ruby, Ruby's UTL) + John Lenz (Guile, MzScheme updates, Chicken module, runtime system) + +Past contributors include: + James Michael DuPont, Clark McGrew, Dustin Mitchell, Ian Cooke, Catalin Dumitrescu, Baran + Kovuk, Oleg Tolmatcev, Tal Shalif, Lluis Padro, Chris Seatory, Igor Bely, Robin Dunn + (See CHANGES and CHANGES.current for a more complete list). + Modified: branches/gsoc2009-ashishs99/Doc/Manual/Sections.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Sections.html 2010-03-06 00:11:40 UTC (rev 11902) +++ branches/gsoc2009-ashishs99/Doc/Manual/Sections.html 2010-03-06 00:15:31 UTC (rev 11903) @@ -6,7 +6,7 @@

SWIG-1.3 Development Documentation

-Last update : SWIG-1.3.41 (in progress) +Last update : SWIG-2.0.0 (in progress)

Sections

 [Swig-cvs] SF.net SVN: swig:[11913] branches/gsoc2009-ashishs99 From: - 2010-03-06 12:04:47 ```Revision: 11913 http://swig.svn.sourceforge.net/swig/?rev=11913&view=rev Author: wsfulton Date: 2010-03-06 12:04:41 +0000 (Sat, 06 Mar 2010) Log Message: ----------- Add new GPL license headers to all source files in this branch Modified Paths: -------------- branches/gsoc2009-ashishs99/Lib/objc/enums.swg branches/gsoc2009-ashishs99/Lib/objc/objc.swg branches/gsoc2009-ashishs99/Lib/objc/objchead.swg branches/gsoc2009-ashishs99/Lib/objc/std_string.i branches/gsoc2009-ashishs99/Lib/objc/std_vector.i branches/gsoc2009-ashishs99/Source/Modules/objc.cxx branches/gsoc2009-ashishs99/Source/Swig/warn.c Modified: branches/gsoc2009-ashishs99/Lib/objc/enums.swg =================================================================== --- branches/gsoc2009-ashishs99/Lib/objc/enums.swg 2010-03-06 11:55:54 UTC (rev 11912) +++ branches/gsoc2009-ashishs99/Lib/objc/enums.swg 2010-03-06 12:04:41 UTC (rev 11913) @@ -1,7 +1,4 @@ /* ----------------------------------------------------------------------------- - * See the LICENSE file for information on copyright, usage and redistribution - * of SWIG, and the README file for authors - http://www.swig.org/release.html. - * * enums.swg * * Include this file in order for C/C++ enums to be wrapped by proper Objective-C enums. Modified: branches/gsoc2009-ashishs99/Lib/objc/objc.swg =================================================================== --- branches/gsoc2009-ashishs99/Lib/objc/objc.swg 2010-03-06 11:55:54 UTC (rev 11912) +++ branches/gsoc2009-ashishs99/Lib/objc/objc.swg 2010-03-06 12:04:41 UTC (rev 11913) @@ -1,7 +1,4 @@ /* ----------------------------------------------------------------------------- - * See the LICENSE file for information on copyright, usage and redistribution - * of SWIG, and the README file for authors - http://www.swig.org/release.html. - * * objc.swg * * Objective-C typemaps Modified: branches/gsoc2009-ashishs99/Lib/objc/objchead.swg =================================================================== --- branches/gsoc2009-ashishs99/Lib/objc/objchead.swg 2010-03-06 11:55:54 UTC (rev 11912) +++ branches/gsoc2009-ashishs99/Lib/objc/objchead.swg 2010-03-06 12:04:41 UTC (rev 11913) @@ -1,7 +1,4 @@ /* ----------------------------------------------------------------------------- - * See the LICENSE file for information on copyright, usage and redistribution - * of SWIG, and the README file for authors - http://www.swig.org/release.html. - * * objc.swg * * Objective-C support code Modified: branches/gsoc2009-ashishs99/Lib/objc/std_string.i =================================================================== --- branches/gsoc2009-ashishs99/Lib/objc/std_string.i 2010-03-06 11:55:54 UTC (rev 11912) +++ branches/gsoc2009-ashishs99/Lib/objc/std_string.i 2010-03-06 12:04:41 UTC (rev 11913) @@ -1,7 +1,4 @@ /* ----------------------------------------------------------------------------- - * See the LICENSE file for information on copyright, usage and redistribution - * of SWIG, and the README file for authors - http://www.swig.org/release.html. - * * std_string.i * * Typemaps for std::string and const std::string& Modified: branches/gsoc2009-ashishs99/Lib/objc/std_vector.i =================================================================== --- branches/gsoc2009-ashishs99/Lib/objc/std_vector.i 2010-03-06 11:55:54 UTC (rev 11912) +++ branches/gsoc2009-ashishs99/Lib/objc/std_vector.i 2010-03-06 12:04:41 UTC (rev 11913) @@ -1,7 +1,4 @@ /* ----------------------------------------------------------------------------- - * See the LICENSE file for information on copyright, usage and redistribution - * of SWIG, and the README file for authors - http://www.swig.org/release.html. - * * std_vector.i * ----------------------------------------------------------------------------- */ Modified: branches/gsoc2009-ashishs99/Source/Modules/objc.cxx =================================================================== --- branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2010-03-06 11:55:54 UTC (rev 11912) +++ branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2010-03-06 12:04:41 UTC (rev 11913) @@ -1,7 +1,15 @@ -/* - * OBJC.cxx - * Module file for Objective-C support - */ +/* ----------------------------------------------------------------------------- + * This file is part of SWIG, which is licensed as a whole under version 3 + * (or any later version) of the GNU General Public License. Some additional + * terms also apply to certain portions of SWIG. The full details of the SWIG + * license and copyrights can be found in the LICENSE and COPYRIGHT files + * included with the SWIG source code as distributed by the SWIG developers + * and at http://www.swig.org/legal.html. + * + * objc.cxx + * + * Module file for Objective-C support + * ----------------------------------------------------------------------------- */ #include "swigmod.h" #include // for INT_MAX Modified: branches/gsoc2009-ashishs99/Source/Swig/warn.c =================================================================== --- branches/gsoc2009-ashishs99/Source/Swig/warn.c 2010-03-06 11:55:54 UTC (rev 11912) +++ branches/gsoc2009-ashishs99/Source/Swig/warn.c 2010-03-06 12:04:41 UTC (rev 11913) @@ -1,6 +1,10 @@ -/* ----------------------------------------------------------------------------- - * See the LICENSE file for information on copyright, usage and redistribution - * of SWIG, and the README file for authors - http://www.swig.org/release.html. +/* ----------------------------------------------------------------------------- + * This file is part of SWIG, which is licensed as a whole under version 3 + * (or any later version) of the GNU General Public License. Some additional + * terms also apply to certain portions of SWIG. The full details of the SWIG + * license and copyrights can be found in the LICENSE and COPYRIGHT files + * included with the SWIG source code as distributed by the SWIG developers + * and at http://www.swig.org/legal.html. * * warn.c * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Swig-cvs] SF.net SVN: swig:[12106] branches/gsoc2009-ashishs99 From: - 2010-06-09 09:00:34 ```Revision: 12106 http://swig.svn.sourceforge.net/swig/?rev=12106&view=rev Author: ashishs99 Date: 2010-06-09 09:00:23 +0000 (Wed, 09 Jun 2010) Log Message: ----------- Fixed compilation issues on Linux using GNUstep. Also fixed makefiles for examples Modified Paths: -------------- branches/gsoc2009-ashishs99/Examples/Makefile.in branches/gsoc2009-ashishs99/Examples/objc/callback/Makefile branches/gsoc2009-ashishs99/Examples/objc/class/Makefile branches/gsoc2009-ashishs99/Examples/objc/class/runme.m branches/gsoc2009-ashishs99/Examples/objc/constants/Makefile branches/gsoc2009-ashishs99/Examples/objc/enum/Makefile branches/gsoc2009-ashishs99/Examples/objc/extend/Makefile branches/gsoc2009-ashishs99/Examples/objc/funcptr/Makefile branches/gsoc2009-ashishs99/Examples/objc/native/Makefile branches/gsoc2009-ashishs99/Examples/objc/native/example.i branches/gsoc2009-ashishs99/Examples/objc/pointer/Makefile branches/gsoc2009-ashishs99/Examples/objc/reference/Makefile branches/gsoc2009-ashishs99/Examples/objc/simple/Makefile branches/gsoc2009-ashishs99/Examples/objc/simple/runme.m branches/gsoc2009-ashishs99/Examples/objc/templates/Makefile branches/gsoc2009-ashishs99/Examples/objc/variables/Makefile branches/gsoc2009-ashishs99/Lib/objc/objc.swg branches/gsoc2009-ashishs99/Source/Modules/objc.cxx branches/gsoc2009-ashishs99/Source/Modules/swigmain.cxx branches/gsoc2009-ashishs99/configure.in Modified: branches/gsoc2009-ashishs99/Examples/Makefile.in =================================================================== --- branches/gsoc2009-ashishs99/Examples/Makefile.in 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/Examples/Makefile.in 2010-06-09 09:00:23 UTC (rev 12106) @@ -990,51 +990,49 @@ ##### OBJC ###### ################################################################## OBJC=@OBJC@ -OBJCPP=@OBJCPP@ -OBJCINC=@OBJCINC@ +OBJC_INCLUDE=@OBJCINC@ OBJC_DLNK=@OBJCDYNAMICLINKING@ OBJC_LIBPREFIX = @OBJCLIBRARYPREFIX@ OBJCCFLAGS=@OBJCCFLAGS@ OBJCSO=@OBJCSO@ OBJCLDSHARED=@OBJCLDSHARED@ OBJCCXXSHARED=@OBJCCXXSHARED@ -OBJCPPOBJS=*Wrapper.o -OBJCPPSRCS=*.mm +OBJS=*.o + # ---------------------------------------------------------------- -# Build an Objective-C dynamically loadable module (C) +# Build a Objective-C dynamically loadable module (C) # ---------------------------------------------------------------- objc: \$(SRCS) \$(SWIG) -objc \$(SWIGOPT) \$(INTERFACEPATH) - \$(CC) -c \$(CCSHARED) \$(CFLAGS) \$(OBJCCFLAGS) \$(SRCS) \$(OBJCPPSRCS) \$(OBJCINC) - \$(OBJCLDSHARED) \$(CFLAGS) \$(OBJS) \$(OBJCPPOBJS) \$(OBJC_DLNK) \$(LIBS) -o \$(OBJC_LIBPREFIX)\$(TARGET)\$(OBJCSO) + \$(CC) -c \$(CCSHARED) \$(CFLAGS) \$(SRCS) \$(INCLUDES) + \$(OBJC) -c \$(CCSHARED) \$(CFLAGS) \$(OBJCCFLAGS) \$(OBJCXXSRCS) \$(INCLUDES) \$(OBJC_INCLUDE) + \$(OBJCLDSHARED) \$(CFLAGS) \$(OBJCFLAGS) \$(OBJS) \$(OBJC_DLNK) \$(LIBS) -o \$(OBJC_LIBPREFIX)\$(TARGET)\$(OBJCSO) # ---------------------------------------------------------------- -# Build an Objective-C dynamically loadable module (C++) +# Build a Objective-C dynamically loadable module (C++) # ---------------------------------------------------------------- objc_cpp: \$(SRCS) \$(SWIG) -objc -c++ \$(SWIGOPT) \$(INTERFACEPATH) - \$(CXX) -c \$(CCSHARED) \$(CFLAGS) \$(OBJCCFLAGS) \$(SRCS) \$(CXXSRCS) \$(OBJCPPSRCS) \$(OBJCINC) - \$(OBJCCXXSHARED) \$(CFLAGS) \$(OBJS) \$(OBJCPPOBJS) \$(OBJC_DLNK) \$(LIBS) \$(CPP_DLLIBS) -o \$(OBJC_LIBPREFIX)\$(TARGET)\$(OBJCSO) + \$(CXX) -c \$(CCSHARED) \$(CFLAGS) \$(SRCS) \$(CXXSRCS) \$(INCLUDES) + \$(OBJC) -c \$(CCSHARED) \$(CFLAGS) \$(OBJCCFLAGS) \$(OBJCXXSRCS) \$(INCLUDES) \$(OBJC_INCLUDE) + \$(OBJCCXXSHARED) \$(CFLAGS) \$(OBJCFLAGS) \$(OBJS) \$(OBJC_DLNK) \$(LIBS) \$(CPP_DLLIBS) -o \$(OBJC_LIBPREFIX)\$(TARGET)\$(OBJCSO) # ---------------------------------------------------------------- -# Compile Objective-C(++) files +# Compile Objective-C & Objective-C++ files # ---------------------------------------------------------------- objc_compile: \$(SRCS) - \$(COMPILETOOL) \$(OBJC) \$(OBJCFLAGS) \$(OBJC_LIBPREFIX)\$(TARGET)\$(OBJCSO) \$(OBJCSRCS) \$(OBJCINC) + \$(COMPILETOOL) \$(OBJC) \$(OBJC_INCLUDE) \$(OBJCFLAGS) \$(OBJCSRCS) \$(OBJC_DLNK) -L. -l\$(TARGET) -objcpp_compile: \$(SRCS) - \$(COMPILETOOL) \$(OBJCPP) \$(OBJCPPFLAGS) \$(OBJC_LIBPREFIX)\$(TARGET)\$(OBJCSO) \$(OBJCPPSRCS) \$(OBJCINC) - # ----------------------------------------------------------------- # Cleaning the Objective-C examples # ----------------------------------------------------------------- objc_clean: - rm -f *Wrapper* *Proxy* *~ .~* *.o a.out `find . -name \*.m | grep -v runme.m` + rm -f *.o *Wrapper* *Proxy* a.out rm -f core @EXTRA_CLEAN@ rm -f *.@...@ *@OBJCSO@ Modified: branches/gsoc2009-ashishs99/Examples/objc/callback/Makefile =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/callback/Makefile 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/Examples/objc/callback/Makefile 2010-06-09 09:00:23 UTC (rev 12106) @@ -4,15 +4,14 @@ TARGET = example INTERFACE = example.i SWIGOPT = -OBJCSRCS= *.m -OBJCPPSRCS= *.mm -OBJCFLAGS= -framework Foundation -L. -OBJCPPFLAGS= +OBJCXXSRCS = *.mm *.m +OBJCSRCS = *.m +OBJCFLAGS = -fconstant-string-class=NSConstantString -all:: objc +all:: objc objc:: - \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCPPSRCS='\$(OBJCPPSRCS)' SWIG='\$(SWIG)' \ + \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCXXSRCS='\$(OBJCXXSRCS)' SWIG='\$(SWIG)' \ SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc_cpp \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='\$(OBJCFLAGS)' TARGET='\$(TARGET)' objc_compile Modified: branches/gsoc2009-ashishs99/Examples/objc/class/Makefile =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/class/Makefile 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/Examples/objc/class/Makefile 2010-06-09 09:00:23 UTC (rev 12106) @@ -4,15 +4,14 @@ TARGET = example INTERFACE = example.i SWIGOPT = -OBJCSRCS= *.m -OBJCPPSRCS= *.mm -OBJCFLAGS= -framework Foundation -L. -OBJCPPFLAGS= +OBJCXXSRCS = *.mm *.m +OBJCSRCS = *.m +OBJCFLAGS = -fconstant-string-class=NSConstantString -all:: objc +all:: objc objc:: - \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCPPSRCS='\$(OBJCPPSRCS)' SWIG='\$(SWIG)' \ + \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCXXSRCS='\$(OBJCXXSRCS)' SWIG='\$(SWIG)' \ SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc_cpp \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='\$(OBJCFLAGS)' TARGET='\$(TARGET)' objc_compile Modified: branches/gsoc2009-ashishs99/Examples/objc/class/runme.m =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/class/runme.m 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/Examples/objc/class/runme.m 2010-06-09 09:00:23 UTC (rev 12106) @@ -2,5 +2,16 @@ #import "exampleProxy.h" int main(int argc, char* argv[]) { - return 0; -} \ No newline at end of file + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + Circle *c = [[Circle alloc] initWithR: 2.0]; + NSLog(@"Area of circle is %f\n", [c area]); + [c move:4 dy:5]; + + Square *s = [[Square alloc] initWithW: 3.0]; + NSLog(@"Perimiter of the square is %f\n", [s perimeter]); + NSLog(@"Number of shapes created = %d", [Shape getNshapes]); + [c release]; + [s release]; + [pool release]; + return 0; +} Modified: branches/gsoc2009-ashishs99/Examples/objc/constants/Makefile =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/constants/Makefile 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/Examples/objc/constants/Makefile 2010-06-09 09:00:23 UTC (rev 12106) @@ -1,18 +1,17 @@ TOP = ../.. SWIG = \$(TOP)/../preinst-swig -CXXSRCS = +CXXSRCS = example.c TARGET = example INTERFACE = example.i SWIGOPT = -OBJCSRCS= *.m -OBJCPPSRCS= *.mm -OBJCFLAGS= -framework Foundation -L. -OBJCPPFLAGS= +OBJCXXSRCS = *.mm *.m +OBJCSRCS = *.m +OBJCFLAGS = -fconstant-string-class=NSConstantString -all:: objc +all:: objc objc:: - \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCPPSRCS='\$(OBJCPPSRCS)' SWIG='\$(SWIG)' \ + \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCXXSRCS='\$(OBJCXXSRCS)' SWIG='\$(SWIG)' \ SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc_cpp \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='\$(OBJCFLAGS)' TARGET='\$(TARGET)' objc_compile Modified: branches/gsoc2009-ashishs99/Examples/objc/enum/Makefile =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/enum/Makefile 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/Examples/objc/enum/Makefile 2010-06-09 09:00:23 UTC (rev 12106) @@ -4,15 +4,14 @@ TARGET = example INTERFACE = example.i SWIGOPT = -OBJCSRCS= *.m -OBJCPPSRCS= *.mm -OBJCFLAGS= -framework Foundation -L. -OBJCPPFLAGS= +OBJCXXSRCS = *.mm *.m +OBJCSRCS = *.m +OBJCFLAGS = -fconstant-string-class=NSConstantString -all:: objc +all:: objc objc:: - \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCPPSRCS='\$(OBJCPPSRCS)' SWIG='\$(SWIG)' \ + \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCXXSRCS='\$(OBJCXXSRCS)' SWIG='\$(SWIG)' \ SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc_cpp \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='\$(OBJCFLAGS)' TARGET='\$(TARGET)' objc_compile Modified: branches/gsoc2009-ashishs99/Examples/objc/extend/Makefile =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/extend/Makefile 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/Examples/objc/extend/Makefile 2010-06-09 09:00:23 UTC (rev 12106) @@ -4,15 +4,14 @@ TARGET = example INTERFACE = example.i SWIGOPT = -OBJCSRCS= *.m -OBJCPPSRCS= *.mm -OBJCFLAGS= -framework Foundation -L. -OBJCPPFLAGS= +OBJCXXSRCS = *.mm *.m +OBJCSRCS = *.m +OBJCFLAGS = -fconstant-string-class=NSConstantString -all:: objc +all:: objc objc:: - \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCPPSRCS='\$(OBJCPPSRCS)' SWIG='\$(SWIG)' \ + \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCXXSRCS='\$(OBJCXXSRCS)' SWIG='\$(SWIG)' \ SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc_cpp \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='\$(OBJCFLAGS)' TARGET='\$(TARGET)' objc_compile Modified: branches/gsoc2009-ashishs99/Examples/objc/funcptr/Makefile =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/funcptr/Makefile 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/Examples/objc/funcptr/Makefile 2010-06-09 09:00:23 UTC (rev 12106) @@ -1,18 +1,17 @@ TOP = ../.. SWIG = \$(TOP)/../preinst-swig -CXXSRCS = example.c +CXXSRCS = example.cxx TARGET = example INTERFACE = example.i SWIGOPT = -OBJCSRCS= *.m -OBJCPPSRCS= *.mm -OBJCFLAGS= -framework Foundation -L. -OBJCPPFLAGS= +OBJCXXSRCS = *.mm *.m +OBJCSRCS = *.m +OBJCFLAGS = -fconstant-string-class=NSConstantString -all:: objc +all:: objc objc:: - \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCPPSRCS='\$(OBJCPPSRCS)' SWIG='\$(SWIG)' \ + \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCXXSRCS='\$(OBJCXXSRCS)' SWIG='\$(SWIG)' \ SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc_cpp \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='\$(OBJCFLAGS)' TARGET='\$(TARGET)' objc_compile Modified: branches/gsoc2009-ashishs99/Examples/objc/native/Makefile =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/native/Makefile 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/Examples/objc/native/Makefile 2010-06-09 09:00:23 UTC (rev 12106) @@ -1,19 +1,18 @@ TOP = ../.. SWIG = \$(TOP)/../preinst-swig -CXXSRCS = TARGET = example INTERFACE = example.i SWIGOPT = -OBJCSRCS= *.m -OBJCPPSRCS= *.mm -OBJCFLAGS= -framework Foundation -L. -OBJCPPFLAGS= +SRCS = +OBJCXXSRCS = *.mm *.m +OBJCSRCS = *.m +OBJCFLAGS = -fconstant-string-class=NSConstantString -all:: objc +all:: objc objc:: - \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCPPSRCS='\$(OBJCPPSRCS)' SWIG='\$(SWIG)' \ - SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc_cpp + \$(MAKE) -f \$(TOP)/Makefile SRCS='\$(SRCS)' OBJCXXSRCS='\$(OBJCXXSRCS)' SWIG='\$(SWIG)' \ + SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='\$(OBJCFLAGS)' TARGET='\$(TARGET)' objc_compile clean:: Modified: branches/gsoc2009-ashishs99/Examples/objc/native/example.i =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/native/example.i 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/Examples/objc/native/example.i 2010-06-09 09:00:23 UTC (rev 12106) @@ -31,22 +31,8 @@ return point_toString("(%d,%d)", p); } -/* this one we wrapped manually*/ -/*JNIEXPORT jstring JNICALL Java_exampleJNI_point_1toString2(JNIEnv *jenv, jclass jcls, jlong jpoint) { - _Point * p; - jstring result; - - (void)jcls; - - p = *(_Point **)&jpoint; - - result = (*jenv)->NewStringUTF(jenv, point_toString("[%d,%d]", p)); - - return result; -}*/ %} - _Point *point_create(int x, int y); char *point_toString1(_Point *p); Modified: branches/gsoc2009-ashishs99/Examples/objc/pointer/Makefile =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/pointer/Makefile 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/Examples/objc/pointer/Makefile 2010-06-09 09:00:23 UTC (rev 12106) @@ -4,15 +4,14 @@ TARGET = example INTERFACE = example.i SWIGOPT = -OBJCSRCS= *.m -OBJCPPSRCS= *.mm -OBJCFLAGS= -framework Foundation -L. -OBJCPPFLAGS= +OBJCXXSRCS = *.mm *.m +OBJCSRCS = *.m +OBJCFLAGS = -fconstant-string-class=NSConstantString -all:: objc +all:: objc objc:: - \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCPPSRCS='\$(OBJCPPSRCS)' SWIG='\$(SWIG)' \ + \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCXXSRCS='\$(OBJCXXSRCS)' SWIG='\$(SWIG)' \ SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc_cpp \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='\$(OBJCFLAGS)' TARGET='\$(TARGET)' objc_compile Modified: branches/gsoc2009-ashishs99/Examples/objc/reference/Makefile =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/reference/Makefile 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/Examples/objc/reference/Makefile 2010-06-09 09:00:23 UTC (rev 12106) @@ -4,15 +4,14 @@ TARGET = example INTERFACE = example.i SWIGOPT = -OBJCSRCS= *.m -OBJCPPSRCS= *.mm -OBJCFLAGS= -framework Foundation -L. -OBJCPPFLAGS= +OBJCXXSRCS = *.mm *.m +OBJCSRCS = *.m +OBJCFLAGS = -fconstant-string-class=NSConstantString -all:: objc +all:: objc objc:: - \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCPPSRCS='\$(OBJCPPSRCS)' SWIG='\$(SWIG)' \ + \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCXXSRCS='\$(OBJCXXSRCS)' SWIG='\$(SWIG)' \ SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc_cpp \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='\$(OBJCFLAGS)' TARGET='\$(TARGET)' objc_compile Modified: branches/gsoc2009-ashishs99/Examples/objc/simple/Makefile =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/simple/Makefile 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/Examples/objc/simple/Makefile 2010-06-09 09:00:23 UTC (rev 12106) @@ -4,15 +4,14 @@ TARGET = example INTERFACE = example.i SWIGOPT = -OBJCSRCS= *.m -OBJCPPSRCS= *.mm -OBJCFLAGS= -framework Foundation -L. -OBJCPPFLAGS= +OBJCXXSRCS = *.mm *.m +OBJCSRCS = *.m +OBJCFLAGS = -fconstant-string-class=NSConstantString -all:: objc +all:: objc objc:: - \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCPPSRCS='\$(OBJCPPSRCS)' SWIG='\$(SWIG)' \ + \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCXXSRCS='\$(OBJCXXSRCS)' SWIG='\$(SWIG)' \ SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc_cpp \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='\$(OBJCFLAGS)' TARGET='\$(TARGET)' objc_compile Modified: branches/gsoc2009-ashishs99/Examples/objc/simple/runme.m =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/simple/runme.m 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/Examples/objc/simple/runme.m 2010-06-09 09:00:23 UTC (rev 12106) @@ -2,5 +2,6 @@ #import "exampleProxy.h" int main(int argc, char* argv[]) { - return 0; -} \ No newline at end of file + printf("result is %d\n", gcd(18,6)); + return 0; +} Modified: branches/gsoc2009-ashishs99/Examples/objc/templates/Makefile =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/templates/Makefile 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/Examples/objc/templates/Makefile 2010-06-09 09:00:23 UTC (rev 12106) @@ -1,18 +1,17 @@ TOP = ../.. SWIG = \$(TOP)/../preinst-swig -CXXSRCS = +CXXSRCS = example.cxx TARGET = example INTERFACE = example.i SWIGOPT = -OBJCSRCS= *.m -OBJCPPSRCS= *.mm -OBJCFLAGS= -framework Foundation -L. -OBJCPPFLAGS= +OBJCXXSRCS = *.mm *.m +OBJCSRCS = *.m +OBJCFLAGS = -fconstant-string-class=NSConstantString -all:: objc +all:: objc objc:: - \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCPPSRCS='\$(OBJCPPSRCS)' SWIG='\$(SWIG)' \ + \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCXXSRCS='\$(OBJCXXSRCS)' SWIG='\$(SWIG)' \ SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc_cpp \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='\$(OBJCFLAGS)' TARGET='\$(TARGET)' objc_compile Modified: branches/gsoc2009-ashishs99/Examples/objc/variables/Makefile =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/variables/Makefile 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/Examples/objc/variables/Makefile 2010-06-09 09:00:23 UTC (rev 12106) @@ -4,15 +4,14 @@ TARGET = example INTERFACE = example.i SWIGOPT = -OBJCSRCS= *.m -OBJCPPSRCS= *.mm -OBJCFLAGS= -framework Foundation -L. -OBJCPPFLAGS= +OBJCXXSRCS = *.mm *.m +OBJCSRCS = *.m +OBJCFLAGS = -fconstant-string-class=NSConstantString -all:: objc +all:: objc objc:: - \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCPPSRCS='\$(OBJCPPSRCS)' SWIG='\$(SWIG)' \ + \$(MAKE) -f \$(TOP)/Makefile CXXSRCS='\$(CXXSRCS)' OBJCXXSRCS='\$(OBJCXXSRCS)' SWIG='\$(SWIG)' \ SWIGOPT='\$(SWIGOPT)' TARGET='\$(TARGET)' INTERFACE='\$(INTERFACE)' objc_cpp \$(MAKE) -f \$(TOP)/Makefile OBJCSRCS='\$(OBJCSRCS)' OBJCFLAGS='\$(OBJCFLAGS)' TARGET='\$(TARGET)' objc_compile Modified: branches/gsoc2009-ashishs99/Lib/objc/objc.swg =================================================================== --- branches/gsoc2009-ashishs99/Lib/objc/objc.swg 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/Lib/objc/objc.swg 2010-06-09 09:00:23 UTC (rev 12106) @@ -7,33 +7,33 @@ %include -/* Following are the ocpptype typemaps which contain the Objective-C or C++ types used in the intermediary C code */ +/* Following are the objcimtype typemaps which contain the Objective-C or C++ types used in the intermediary code */ // Primitive types -%typemap(ocpptype) bool, const bool & "BOOL" -%typemap(ocpptype) char, const char & "char" -%typemap(ocpptype) signed char, const signed char & "signed char" -%typemap(ocpptype) unsigned char, const unsigned char & "unsigned char" -%typemap(ocpptype) short, const short & "short" -%typemap(ocpptype) unsigned short, const unsigned short & "unsigned short" -%typemap(ocpptype) int, const int & "int" -%typemap(ocpptype) unsigned int, const unsigned int & "unsigned int" -%typemap(ocpptype) long, const long & "long" -%typemap(ocpptype) unsigned long, const unsigned long & "unsigned long" -%typemap(ocpptype) long long, const long long & "long long" -%typemap(ocpptype) unsigned long long, const unsigned long long & "unsigned long long" -%typemap(ocpptype) float, const float & "float" -%typemap(ocpptype) double, const double & "double" -%typemap(ocpptype) void "void" +%typemap(objcimtype) bool, const bool & "BOOL" +%typemap(objcimtype) char, const char & "char" +%typemap(objcimtype) signed char, const signed char & "signed char" +%typemap(objcimtype) unsigned char, const unsigned char & "unsigned char" +%typemap(objcimtype) short, const short & "short" +%typemap(objcimtype) unsigned short, const unsigned short & "unsigned short" +%typemap(objcimtype) int, const int & "int" +%typemap(objcimtype) unsigned int, const unsigned int & "unsigned int" +%typemap(objcimtype) long, const long & "long" +%typemap(objcimtype) unsigned long, const unsigned long & "unsigned long" +%typemap(objcimtype) long long, const long long & "long long" +%typemap(objcimtype) unsigned long long, const unsigned long long & "unsigned long long" +%typemap(objcimtype) float, const float & "float" +%typemap(objcimtype) double, const double & "double" +%typemap(objcimtype) void "void" // Pointers, references and arrays -%typemap(ocpptype) char *, char *&, char[ANY], char[] "NSString *" -%typemap(ocpptype) SWIGTYPE "void *" -%typemap(ocpptype) SWIGTYPE [] "void *" -%typemap(ocpptype) SWIGTYPE * "void *" -%typemap(ocpptype) SWIGTYPE & "void *" +%typemap(objcimtype) char *, char *&, char[ANY], char[] "NSString *" +%typemap(objcimtype) SWIGTYPE "void *" +%typemap(objcimtype) SWIGTYPE [] "void *" +%typemap(objcimtype) SWIGTYPE * "void *" +%typemap(objcimtype) SWIGTYPE & "void *" // Pointer to a class member -%typemap(ocpptype) SWIGTYPE (CLASS::*) "void*" +%typemap(objcimtype) SWIGTYPE (CLASS::*) "void*" /* Following are the "in" typemaps for Objective-C/C++ to C conversions */ @@ -184,7 +184,7 @@ /* Following are the "out" typemaps for C to Objective-C conversions */ // Primitive types %typemap(out) bool -%{ \$result = \$1 ? YES : NO; %} +%{ \$result = \$1 ? YES : No; %} %typemap(out) char, signed char, unsigned char, @@ -514,7 +514,7 @@ * This typemap allows control over what code is executed in the constructor as * well as specifying who owns the underlying C/C++ object. Normally, Objective-C has * ownership and the underlying C/C++ object is deallocated when the Objective-C object - * is deallocated (swigCMemOwn is true.) If swigCMemOwn is false, C/C++ is + * is deallocated (swigCMemOwn is YES.) If swigCMemOwn is No, C/C++ is * ultimately responsible for deallocating the underlying object's memory. * */ @@ -529,7 +529,7 @@ %typemap(objcdestruct, methodname="dealloc") SWIGTYPE { if (swigCPtr != 0) { if (swigCMemOwn) { - swigCMemOwn = false; + swigCMemOwn = NO; \$imcall; } swigCPtr = 0; Modified: branches/gsoc2009-ashishs99/Source/Modules/objc.cxx =================================================================== --- branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/Source/Modules/objc.cxx 2010-06-09 09:00:23 UTC (rev 12106) @@ -23,8 +23,8 @@ const String *empty_string; Hash *swig_types_hash; - File *f_ocpp_h; - File *f_ocpp_mm; + File *f_objcimtype_h; + File *f_objcimtype_mm; File *f_runtime; File *f_header; File *f_wrappers; @@ -40,7 +40,7 @@ bool wrapping_member_flag; // Flag for when wrapping a member variable/enum/const bool global_variable_flag; // Flag for when wrapping a global variable - String *ocpp_h_code; // Code for Objective-C++ header + String *objcimtype_h_code; // Code for Objective-C++ header String *proxy_h_code; // Code for Objective-C proxy header String *proxy_m_code; // Code for Objective-C proxy implementation String *swigtypes_h_code; // Code for Objective-C typewrapper classes header @@ -61,8 +61,8 @@ public: OBJC():empty_string(NewString("")), swig_types_hash(NULL), - f_ocpp_h(NULL), - f_ocpp_mm(NULL), + f_objcimtype_h(NULL), + f_objcimtype_mm(NULL), f_runtime(NULL), f_header(NULL), f_wrappers(NULL), @@ -76,7 +76,7 @@ variable_wrapper_flag(false), wrapping_member_flag(false), global_variable_flag(false), - ocpp_h_code(NULL), + objcimtype_h_code(NULL), proxy_h_code(NULL), proxy_m_code(NULL), swigtypes_h_code(NULL), @@ -158,7 +158,7 @@ Printf(f_wrappers, "#endif\n\n"); // Initialize members - ocpp_h_code = NewString(""); + objcimtype_h_code = NewString(""); proxy_h_code = NewString(""); proxy_m_code = NewString(""); swigtypes_h_code = NewString(""); @@ -222,39 +222,39 @@ Printf(f_wrappers, "}\n"); Printf(f_wrappers, "#endif\n"); - f_ocpp_h = NewFile(file_h, "w", SWIG_output_files()); - if (!f_ocpp_h) { - FileErrorDisplay(f_ocpp_h); + f_objcimtype_h = NewFile(file_h, "w", SWIG_output_files()); + if (!f_objcimtype_h) { + FileErrorDisplay(f_objcimtype_h); SWIG_exit(EXIT_FAILURE); } - f_ocpp_mm = NewFile(file_mm, "w", SWIG_output_files()); - if (!f_ocpp_mm) { - FileErrorDisplay(f_ocpp_mm); + f_objcimtype_mm = NewFile(file_mm, "w", SWIG_output_files()); + if (!f_objcimtype_mm) { + FileErrorDisplay(f_objcimtype_mm); SWIG_exit(EXIT_FAILURE); } - Swig_banner(f_ocpp_h); - Printf(f_ocpp_h, "\n#import \n"); - Printf(f_ocpp_h, "\n#ifdef __cplusplus\n"); - Printf(f_ocpp_h, "extern \"C\" {\n"); - Printf(f_ocpp_h, "#endif\n\n"); - Printv(f_ocpp_h, ocpp_h_code, NIL); - Printf(f_ocpp_h, "\n#ifdef __cplusplus\n"); - Printf(f_ocpp_h, "}\n"); - Printf(f_ocpp_h, "#endif\n"); + Swig_banner(f_objcimtype_h); + Printf(f_objcimtype_h, "\n#import \n"); + Printf(f_objcimtype_h, "\n#ifdef __cplusplus\n"); + Printf(f_objcimtype_h, "extern \"C\" {\n"); + Printf(f_objcimtype_h, "#endif\n\n"); + Printv(f_objcimtype_h, objcimtype_h_code, NIL); + Printf(f_objcimtype_h, "\n#ifdef __cplusplus\n"); + Printf(f_objcimtype_h, "}\n"); + Printf(f_objcimtype_h, "#endif\n"); Dump(f_header, f_runtime); Dump(f_wrappers, f_runtime); Wrapper_pretty_print(f_init, f_runtime); - Dump(f_runtime, f_ocpp_mm); + Dump(f_runtime, f_objcimtype_mm); Delete(file_h); file_h = NULL; Delete(file_mm); file_mm = NULL; - Delete(ocpp_h_code); - ocpp_h_code = NULL; + Delete(objcimtype_h_code); + objcimtype_h_code = NULL; Delete(swigtypes_h_code); swigtypes_h_code = NULL; @@ -274,10 +274,10 @@ Delete(f_wrappers); Delete(f_init); Delete(f_runtime); - Close(f_ocpp_mm); - Delete(f_ocpp_mm); - Close(f_ocpp_h); - Delete(f_ocpp_h); + Close(f_objcimtype_mm); + Delete(f_objcimtype_mm); + Close(f_objcimtype_h); + Delete(f_objcimtype_h); } return SWIG_OK; @@ -431,7 +431,7 @@ String *cleanup = NewString(""); String *outarg = NewString(""); - String *ocpp_return_type = NewString(""); + String *objcim_return_type = NewString(""); String *tm; Parm *p; int i; @@ -448,24 +448,24 @@ Wrapper *f = NewWrapper(); String *wname = Swig_name_wrapper(overloaded_name); - Swig_typemap_attach_parms("ocpptype", l, f); + Swig_typemap_attach_parms("objcimtype", l, f); /* Get return types */ - if ((tm = Swig_typemap_lookup("ocpptype", n, "", 0))) { - String *ocpptypeout = Getattr(n, "tmap:ocpptype:out"); // the type in the ocpptype typemap's out attribute overrides the type in the typemap - if (ocpptypeout) - tm = ocpptypeout; - Printf(ocpp_return_type, "%s", tm); + if ((tm = Swig_typemap_lookup("objcimtype", n, "", 0))) { + String *objcimtypeout = Getattr(n, "tmap:objcimtype:out"); // the type in the objcimtype typemap's out attribute overrides the type in the typemap + if (objcimtypeout) + tm = objcimtypeout; + Printf(objcim_return_type, "%s", tm); } else { - Swig_warning(WARN_NONE, input_file, line_number, "No ocpptype typemap defined for %s\n", SwigType_str(t, 0)); + Swig_warning(WARN_NONE, input_file, line_number, "No objcimtype typemap defined for %s\n", SwigType_str(t, 0)); } - is_void_return = (Cmp(ocpp_return_type, "void") == 0); + is_void_return = (Cmp(objcim_return_type, "void") == 0); if (!is_void_return) - Wrapper_add_localv(f, "oresult", ocpp_return_type, "oresult", NIL); + Wrapper_add_localv(f, "oresult", objcim_return_type, "oresult", NIL); - Printv(f->def, ocpp_return_type, " ", wname, "(", NIL); - Printv(ocpp_h_code, ocpp_return_type, " ", wname, "(", NIL); + Printv(f->def, objcim_return_type, " ", wname, "(", NIL); + Printv(objcimtype_h_code, objcim_return_type, " ", wname, "(", NIL); // Emit all of the local variables for holding arguments. emit_parameter_variables(l, f); @@ -498,21 +498,21 @@ SwigType *pt = Getattr(p, "type"); String *ln = Getattr(p, "lname"); - String *ocpp_param_type = NewString(""); + String *objcim_param_type = NewString(""); String *arg = NewString(""); Printf(arg, "o%s", ln); - if ((tm = Getattr(p, "tmap:ocpptype"))) { - const String *inattributes = Getattr(p, "tmap:ocpptype:inattributes"); - Printf(ocpp_param_type, "%s%s", inattributes ? inattributes : empty_string, tm); + if ((tm = Getattr(p, "tmap:objcimtype"))) { + const String *inattributes = Getattr(p, "tmap:objcimtype:inattributes"); + Printf(objcim_param_type, "%s%s", inattributes ? inattributes : empty_string, tm); } else { - Swig_warning(WARN_NONE, input_file, line_number, "No ocpptype typemap defined for %s\n", SwigType_str(pt, 0)); + Swig_warning(WARN_NONE, input_file, line_number, "No objcimtype typemap defined for %s\n", SwigType_str(pt, 0)); } // Add parameter to the objcpp function - Printv(f->def, gencomma ? ", " : "", ocpp_param_type, " ", arg, NIL); - Printv(ocpp_h_code, gencomma ? ", " : "", ocpp_param_type, " ", arg, NIL); + Printv(f->def, gencomma ? ", " : "", objcim_param_type, " ", arg, NIL); + Printv(objcimtype_h_code, gencomma ? ", " : "", objcim_param_type, " ", arg, NIL); gencomma = 1; @@ -530,7 +530,7 @@ Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(pt, 0)); p = nextSibling(p); } - Delete(ocpp_param_type); + Delete(objcim_param_type); Delete(arg); } @@ -649,8 +649,8 @@ Printf(f->code, "%s\n", tm); } } - // Finish the ocpp header code and wrapper function definition - Printf(ocpp_h_code, ");\n"); + // Finish the objcimtype header code and wrapper function definition + Printf(objcimtype_h_code, ");\n"); Printf(f->def, ") {"); if (!is_void_return) @@ -678,7 +678,7 @@ } if (!(proxy_flag && is_wrapping_class()) && !enum_constant_flag) { - Setattr(n, "ocppfuncname", wname); + Setattr(n, "objcimfuncname", wname); proxyGlobalFunctionHandler(n); } @@ -688,7 +688,7 @@ */ if (proxy_flag && wrapping_member_flag && !enum_constant_flag) { // Capitalize the first letter in the variable to create getter/setter function name - bool getter_flag = Cmp(symname, Swig_name_set(Swig_name_member(proxy_class_name, variable_name))) != 0; + bool getter_flag = Cmp(symname, Swig_name_set(getNSpace(),Swig_name_member(0, proxy_class_name, variable_name))) != 0; String *getter_setter_name = NewString(""); if (!getter_flag) @@ -698,17 +698,17 @@ Putc(toupper((int) *Char(variable_name)), getter_setter_name); Printf(getter_setter_name, "%s", Char(variable_name) + 1); - String *ocppfunctname = NewStringf("ObjCPP_%s", symname); + String *objcimfunctname = NewStringf("ObjCPP_%s", symname); Setattr(n, "proxyfuncname", getter_setter_name); - Setattr(n, "ocppfuncname", ocppfunctname); + Setattr(n, "objcimfuncname", objcimfunctname); proxyClassFunctionHandler(n); Delete(getter_setter_name); - Delete(ocppfunctname); + Delete(objcimfunctname); } // Tidy up - Delete(ocpp_return_type); + Delete(objcim_return_type); Delete(wname); Delete(overloaded_name); DelWrapper(f); @@ -726,7 +726,7 @@ void proxyGlobalFunctionHandler(Node *n) { SwigType *t = Getattr(n, "type"); ParmList *l = Getattr(n, "parms"); - String *ocpp_function_name = Getattr(n, "ocppfuncname"); + String *objcim_function_name = Getattr(n, "objcimfuncname"); String *func_name = NULL; String *tm; Parm *p; @@ -769,7 +769,7 @@ if (proxy_flag && global_variable_flag) { // Capitalize the first letter in the variable to create a objcBean type getter/setter function name func_name = NewString(""); - setter_flag = (Cmp(Getattr(n, "sym:name"), Swig_name_set(variable_name)) == 0); + setter_flag = (Cmp(Getattr(n, "sym:name"), Swig_name_set(getNSpace(), variable_name)) == 0); if (setter_flag) Printf(func_name, "set"); else @@ -782,7 +782,7 @@ /* Start generating the proxy function */ Printf(function_decl, "%s %s(", return_type, func_name); - Printv(imcall, "\$ocppfuncname(", NIL); + Printv(imcall, "\$objcimfuncname(", NIL); /* Get number of required and total arguments */ num_arguments = emit_num_arguments(l); @@ -849,7 +849,7 @@ else Replaceall(tm, "\$owner", "false"); substituteClassname(t, tm); - Replaceall(imcall, "\$ocppfuncname", ocpp_function_name); + Replaceall(imcall, "\$objcimfuncname", objcim_function_name); Replaceall(tm, "\$imcall", imcall); } else { Swig_warning(WARN_NONE, input_file, line_number, "No objcout typemap defined for %s\n", SwigType_str(t, 0)); @@ -878,7 +878,7 @@ void proxyClassFunctionHandler(Node *n) { SwigType *t = Getattr(n, "type"); ParmList *l = Getattr(n, "parms"); - String *ocpp_function_name = Getattr(n, "ocppfuncname"); + String *objcim_function_name = Getattr(n, "objcimfuncname"); String *proxy_function_name = Getattr(n, "proxyfuncname"); String *tm; Parm *p; @@ -925,7 +925,7 @@ if (wrapping_member_flag && !enum_constant_flag) { // For wrapping member variables - setter_flag = (Cmp(Getattr(n, "sym:name"), Swig_name_set(Swig_name_member(proxy_class_name, variable_name))) == 0); + setter_flag = (Cmp(Getattr(n, "sym:name"), Swig_name_set(getNSpace(), Swig_name_member(getNSpace(),proxy_class_name, variable_name))) == 0); } /* Start generating the proxy function */ @@ -943,7 +943,7 @@ Printf(function_decl, "(%s)%s", return_type, proxy_function_name); - Printv(imcall, "\$ocppfuncname(", NIL); + Printv(imcall, "\$objcimfuncname(", NIL); if (!static_flag) { Printf(imcall, "swigCPtr"); @@ -953,8 +953,8 @@ if (qualifier) SwigType_push(this_type, qualifier); SwigType_add_pointer(this_type); - Parm *this_parm = NewParm(this_type, name); - Swig_typemap_attach_parms("ocpptype", this_parm, NULL); + Parm *this_parm = NewParm(this_type, name, n); + Swig_typemap_attach_parms("objcimtype", this_parm, NULL); Swig_typemap_attach_parms("objctype", this_parm, NULL); Delete(this_parm); @@ -1002,7 +1002,7 @@ if (gencomma) { Printf(imcall, ", "); } - // Use typemaps to transform type used in Objective-C proxy function to type used in low level ocpp accessor + // Use typemaps to transform type used in Objective-C proxy function to type used in low level objcimtype accessor if ((tm = Getattr(p, "tmap:objcin"))) { addThrows(n, "tmap:objcin", p); substituteClassname(pt, tm); @@ -1040,7 +1040,7 @@ else Replaceall(tm, "\$owner", "false"); substituteClassname(t, tm); - Replaceall(imcall, "\$ocppfuncname", ocpp_function_name); + Replaceall(imcall, "\$objcimfuncname", objcim_function_name); Replaceall(tm, "\$imcall", imcall); } else { Swig_warning(WARN_NONE, input_file, line_number, "No objcout typemap defined for %s\n", SwigType_str(t, 0)); @@ -1067,7 +1067,7 @@ int i; String *function_decl = NewString(""); String *function_def = NewString(""); - String *ocpp_return_type = NewString(""); + String *objcim_return_type = NewString(""); Language::constructorHandler(n); @@ -1077,11 +1077,11 @@ if (proxy_flag) { String *overloaded_name = getOverloadedName(n); - String *mangled_overname = Swig_name_construct(overloaded_name); + String *mangled_overname = Swig_name_construct(getNSpace(), overloaded_name); String *imcall = NewString(""); - tm = Getattr(n, "tmap:ocpptype"); // typemaps were attached earlier to the node - Printf(ocpp_return_type, "%s", tm); + tm = Getattr(n, "tmap:objcimtype"); // typemaps were attached earlier to the node + Printf(objcim_return_type, "%s", tm); Printf(function_decl, "- (id)init"); @@ -1089,7 +1089,7 @@ /* Attach the non-standard typemaps to the parameter list */ Swig_typemap_attach_parms("in", l, NULL); - Swig_typemap_attach_parms("ocpptype", l, NULL); + Swig_typemap_attach_parms("objcimtype", l, NULL); Swig_typemap_attach_parms("objctype", l, NULL); Swig_typemap_attach_parms("objcin", l, NULL); @@ -1174,7 +1174,7 @@ Printv(proxy_class_decl, function_decl, NIL); Printv(proxy_class_def, function_def, NIL); - Delete(ocpp_return_type); + Delete(objcim_return_type); Delete(construct_tm); Delete(attributes); Delete(overloaded_name); @@ -1193,7 +1193,7 @@ String *symname = Getattr(n, "sym:name"); if (proxy_flag) { - Printv(destructor_call, Swig_name_destroy(symname), "(swigCPtr)", NIL); + Printv(destructor_call, Swig_name_destroy(getNSpace(), symname), "(swigCPtr)", NIL); } return SWIG_OK; } @@ -1286,10 +1286,10 @@ if (proxy_flag) { String *overloaded_name = getOverloadedName(n); - String *imfunctname = Swig_name_member(proxy_class_name, overloaded_name); - String *ocppfunctname = NewStringf("ObjCPP_%s", imfunctname); + String *imfunctname = Swig_name_member(getNSpace(), proxy_class_name, overloaded_name); + String *objcimfunctname = NewStringf("ObjCPP_%s", imfunctname); Setattr(n, "proxyfuncname", Getattr(n, "sym:name")); - Setattr(n, "ocppfuncname", ocppfunctname); + Setattr(n, "objcimfuncname", objcimfunctname); proxyClassFunctionHandler(n); Delete(imfunctname); Delete(overloaded_name); @@ -1308,10 +1308,10 @@ if (proxy_flag) { String *overloaded_name = getOverloadedName(n); - String *imfunctname = Swig_name_member(proxy_class_name, overloaded_name); - String *ocppfunctname = NewStringf("ObjCPP_%s", imfunctname); + String *imfunctname = Swig_name_member(getNSpace(), proxy_class_name, overloaded_name); + String *objcimfunctname = NewStringf("ObjCPP_%s", imfunctname); Setattr(n, "proxyfuncname", Getattr(n, "sym:name")); - Setattr(n, "ocppfuncname", ocppfunctname); + Setattr(n, "objcimfuncname", objcimfunctname); proxyClassFunctionHandler(n); Delete(imfunctname); Delete(overloaded_name); @@ -1410,10 +1410,10 @@ // Strange hack to change the name Setattr(n, "name", Getattr(n, "value")); /* for wrapping of enums in a namespace when emit_action is used */ constantWrapper(n); - value = NewStringf("%s()", Swig_name_get(symname)); + value = NewStringf("%s()", Swig_name_get(getNSpace(),symname)); } else { memberconstantHandler(n); - value = NewStringf("%s()", Swig_name_get(Swig_name_member(proxy_class_name, symname))); + value = NewStringf("%s()", Swig_name_get(getNSpace(),Swig_name_member(getNSpace(), proxy_class_name, symname))); } } } @@ -1659,15 +1659,15 @@ if (classname_substituted_flag) { if (SwigType_isenum(t)) { // This handles wrapping of inline initialised const enum static member variables (not when wrapping enum items - ignored later on) - Printf(constants_code, "(%s)%s();\n", return_type, Swig_name_get(symname)); + Printf(constants_code, "(%s)%s();\n", return_type, Swig_name_get(getNSpace(), symname)); } else { // This handles function pointers using the %constant directive - Printf(constants_code, "[[[%s alloc] initWithCptr: &%s()] autorelease];\n", return_type, Swig_name_get(symname)); + Printf(constants_code, "[[[%s alloc] initWithCptr: &%s()] autorelease];\n", return_type, Swig_name_get(getNSpace(),symname)); } } else { - String *ocppfunctname = NewStringf("ObjCPP_%s", symname); - Printf(constants_code, "%s();\n", Swig_name_get(ocppfunctname)); - Delete(ocppfunctname); + String *objcimfunctname = NewStringf("ObjCPP_%s", symname); + Printf(constants_code, "%s();\n", Swig_name_get(getNSpace(), objcimfunctname)); + Delete(objcimfunctname); } // Each constant and enum value is wrapped with a separate function call SetFlag(n, "feature:immutable"); Modified: branches/gsoc2009-ashishs99/Source/Modules/swigmain.cxx =================================================================== --- branches/gsoc2009-ashishs99/Source/Modules/swigmain.cxx 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/Source/Modules/swigmain.cxx 2010-06-09 09:00:23 UTC (rev 12106) @@ -75,7 +75,7 @@ {"-lua", swig_lua, "Lua"}, {"-modula3", swig_modula3, "Modula 3"}, {"-mzscheme", swig_mzscheme, "Mzscheme"}, - {"-objc", swig_objc, "Objective-C"}, + {"-objc", swig_objc, "Objective C"}, {"-ocaml", swig_ocaml, "Ocaml"}, {"-octave", swig_octave, "Octave"}, {"-perl", swig_perl5, "Perl"}, Modified: branches/gsoc2009-ashishs99/configure.in =================================================================== --- branches/gsoc2009-ashishs99/configure.in 2010-06-08 06:02:56 UTC (rev 12105) +++ branches/gsoc2009-ashishs99/configure.in 2010-06-09 09:00:23 UTC (rev 12106) @@ -919,21 +919,21 @@ # Look for Objective-C #---------------------------------------------------------------- -AC_ARG_WITH(objc, AS_HELP_STRING([--without-objc], [Disable OBJC]), [with_objc="\$withval"], [with_objc=yes]) -AC_ARG_WITH(objc-compiler, [ --with-objc-compiler=path Set location of Objective-C compiler],[OBJC="\$withval"], [OBJC=]) +AC_ARG_WITH(objc, AS_HELP_STRING([--without-objc], [Disable Objective-C]), [with_objc="\$withval"], [with_objc=yes]) +AC_ARG_WITH(objc-compiler, [ --with-objc-compiler=path Set location of Objective-C compiler],[OBJCBIN="\$withval"], [OBJCBIN=]) # First, check for "--without-objc" or "--with-objc=no". if test x"\${with_objc}" = xno -o x"\${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling Objective-C]) OBJC= -OBJCPP= else # set Objective-C compiler -if test -z "\$OBJC" ; then - AC_MSG_CHECKING(Objective-C(++) compiler) +if test -z "\$OBJCBIN" ; then + AC_MSG_CHECKING(Objective-C compiler) AC_PROG_OBJC() - AC_PROG_OBJCPP() +else + OBJC="\$OBJCBIN" fi # check for include files @@ -945,7 +945,7 @@ # Add in default directory for Objective-C headers on Windows for Cygwin(TODO for now), Linux and MacOSX case \$host in - *-*-cygwin* | *-*-mingw*) OBJCINCDIR="\$OBJCINCDIR";; + *-*-cygwin* | *-*-mingw*) OBJCINCDIR="/usr/include/GNUstep /usr/lib/GNUstep/System/Library/Headers \$OBJCINCDIR";; *-*-linux*) OBJCINCDIR="/usr/include/GNUstep /usr/lib/GNUstep/System/Library/Headers \$OBJCINCDIR";; *-*-darwin*) OBJCINCDIR="/System/Library/Frameworks/Foundation.framework/Headers \$OBJCINCDIR";; *);; @@ -972,9 +972,9 @@ AC_MSG_CHECKING(for Objective-C library) if test -z "\$OBJCLIB"; then -dirs="/usr/lib/GNUstep/System/Library/Libraries/ /usr/lib/" +dirs="/usr/lib/ /usr/local/lib/ /usr/lib/GNUstep/Libraries/" for i in \$dirs ; do - if test -r \$i/libobjc.a; then + if test -r \$i/libobjc.so.2; then AC_MSG_RESULT(\$i) OBJCLIB="-L\$i -lobjc" break @@ -985,7 +985,7 @@ AC_MSG_RESULT(not found) else for i in \$dirs ; do - if test -r \$i/libgnu-step-base.a; then + if test -r \$i/*gnustep-base*; then AC_MSG_RESULT(\$i) OBJCLIB="-L\$i -lgnustep-base \$OBJCLIB" break @@ -1006,7 +1006,7 @@ ;; *-*-linux*) OBJCDYNAMICLINKING="\$OBJCLIB" - OBJCCFLAGS="" + OBJCCFLAGS="-fconstant-string-class=NSConstantString" #To avoid crytpic NXConstantString error with GNUStep...! ;; *) OBJCDYNAMICLINKING="" @@ -1037,12 +1037,11 @@ fi -AC_SUBST(OBJC) -AC_SUBST(OBJCPP) AC_SUBST(OBJCINC) AC_SUBST(OBJCDYNAMICLINKING) AC_SUBST(OBJCLIBRARYPREFIX) AC_SUBST(OBJCCFLAGS) +AC_SUBST(OBJC) AC_SUBST(OBJCSO) AC_SUBST(OBJCLDSHARED) AC_SUBST(OBJCCXXSHARED) @@ -2150,6 +2149,11 @@ fi AC_SUBST(SKIP_MZSCHEME) +SKIP_OBJC= +if test -z "\$OBJC" || test -z "\$OBJCINC" || test -z "\$OBJCLIB" ; then + SKIP_OBJC="1" +fi +AC_SUBST(SKIP_OBJC) SKIP_RUBY= if test -z "\$RUBY" || test -z "\$RUBYINCLUDE" || test -z "\$RUBYLIB" ; then @@ -2304,8 +2308,8 @@ Examples/test-suite/guile/Makefile \ Examples/test-suite/guilescm/Makefile \ Examples/test-suite/java/Makefile \ + Examples/test-suite/mzscheme/Makefile \ Examples/test-suite/objc/Makefile \ - Examples/test-suite/mzscheme/Makefile \ Examples/test-suite/ocaml/Makefile \ Examples/test-suite/octave/Makefile \ Examples/test-suite/perl5/Makefile \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Swig-cvs] SF.net SVN: swig:[12107] branches/gsoc2009-ashishs99 From: - 2010-06-09 13:12:43 ```Revision: 12107 http://swig.svn.sourceforge.net/swig/?rev=12107&view=rev Author: ashishs99 Date: 2010-06-09 13:12:33 +0000 (Wed, 09 Jun 2010) Log Message: ----------- Merged revisions 11696:12105 from trunk to this branch Modified Paths: -------------- branches/gsoc2009-ashishs99/ANNOUNCE branches/gsoc2009-ashishs99/CCache/Makefile.in branches/gsoc2009-ashishs99/CHANGES branches/gsoc2009-ashishs99/CHANGES.current branches/gsoc2009-ashishs99/COPYRIGHT branches/gsoc2009-ashishs99/Doc/Devel/cmdopt.html branches/gsoc2009-ashishs99/Doc/Devel/engineering.html branches/gsoc2009-ashishs99/Doc/Devel/internals.html branches/gsoc2009-ashishs99/Doc/Devel/scanner.html branches/gsoc2009-ashishs99/Doc/Devel/tree.html branches/gsoc2009-ashishs99/Doc/Manual/Allegrocl.html branches/gsoc2009-ashishs99/Doc/Manual/CSharp.html branches/gsoc2009-ashishs99/Doc/Manual/Chicken.html branches/gsoc2009-ashishs99/Doc/Manual/Contents.html branches/gsoc2009-ashishs99/Doc/Manual/Customization.html branches/gsoc2009-ashishs99/Doc/Manual/Extending.html branches/gsoc2009-ashishs99/Doc/Manual/Guile.html branches/gsoc2009-ashishs99/Doc/Manual/Introduction.html branches/gsoc2009-ashishs99/Doc/Manual/Java.html branches/gsoc2009-ashishs99/Doc/Manual/Library.html branches/gsoc2009-ashishs99/Doc/Manual/Lisp.html branches/gsoc2009-ashishs99/Doc/Manual/Lua.html branches/gsoc2009-ashishs99/Doc/Manual/Makefile branches/gsoc2009-ashishs99/Doc/Manual/Modula3.html branches/gsoc2009-ashishs99/Doc/Manual/Modules.html branches/gsoc2009-ashishs99/Doc/Manual/Mzscheme.html branches/gsoc2009-ashishs99/Doc/Manual/Octave.html branches/gsoc2009-ashishs99/Doc/Manual/Perl5.html branches/gsoc2009-ashishs99/Doc/Manual/Php.html branches/gsoc2009-ashishs99/Doc/Manual/Pike.html branches/gsoc2009-ashishs99/Doc/Manual/Preface.html branches/gsoc2009-ashishs99/Doc/Manual/Preprocessor.html branches/gsoc2009-ashishs99/Doc/Manual/Python.html branches/gsoc2009-ashishs99/Doc/Manual/R.html branches/gsoc2009-ashishs99/Doc/Manual/Ruby.html branches/gsoc2009-ashishs99/Doc/Manual/SWIG.html branches/gsoc2009-ashishs99/Doc/Manual/SWIGPlus.html branches/gsoc2009-ashishs99/Doc/Manual/Sections.html branches/gsoc2009-ashishs99/Doc/Manual/Tcl.html branches/gsoc2009-ashishs99/Doc/Manual/Typemaps.html branches/gsoc2009-ashishs99/Doc/Manual/Varargs.html branches/gsoc2009-ashishs99/Doc/Manual/Warnings.html branches/gsoc2009-ashishs99/Doc/Manual/Windows.html branches/gsoc2009-ashishs99/Doc/Manual/index.html branches/gsoc2009-ashishs99/Examples/Makefile.in branches/gsoc2009-ashishs99/Examples/README branches/gsoc2009-ashishs99/Examples/guile/README branches/gsoc2009-ashishs99/Examples/index.html branches/gsoc2009-ashishs99/Examples/perl5/index.html branches/gsoc2009-ashishs99/Examples/php/cpointer/runme.php branches/gsoc2009-ashishs99/Examples/php/disown/runme.php branches/gsoc2009-ashishs99/Examples/php/overloading/runme.php branches/gsoc2009-ashishs99/Examples/php/proxy/runme.php branches/gsoc2009-ashishs99/Examples/r/class/Makefile branches/gsoc2009-ashishs99/Examples/r/simple/Makefile branches/gsoc2009-ashishs99/Examples/ruby/multimap/example.i branches/gsoc2009-ashishs99/Examples/s-exp/uffi.lisp branches/gsoc2009-ashishs99/Examples/test-suite/char_strings.i branches/gsoc2009-ashishs99/Examples/test-suite/common.mk branches/gsoc2009-ashishs99/Examples/test-suite/constant_pointers.i branches/gsoc2009-ashishs99/Examples/test-suite/cpp_broken.i branches/gsoc2009-ashishs99/Examples/test-suite/cpp_enum.i branches/gsoc2009-ashishs99/Examples/test-suite/csharp/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/csharp/char_strings_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp_typemaps.i branches/gsoc2009-ashishs99/Examples/test-suite/derived_nested.i branches/gsoc2009-ashishs99/Examples/test-suite/director_enum.i branches/gsoc2009-ashishs99/Examples/test-suite/enums.i branches/gsoc2009-ashishs99/Examples/test-suite/extend_template.i branches/gsoc2009-ashishs99/Examples/test-suite/global_namespace.i branches/gsoc2009-ashishs99/Examples/test-suite/java/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/java/char_strings_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/java_director_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java_director.i branches/gsoc2009-ashishs99/Examples/test-suite/java_enums.i branches/gsoc2009-ashishs99/Examples/test-suite/java_pgcpp.i branches/gsoc2009-ashishs99/Examples/test-suite/java_typemaps_typewrapper.i branches/gsoc2009-ashishs99/Examples/test-suite/li_boost_intrusive_ptr.i branches/gsoc2009-ashishs99/Examples/test-suite/li_boost_shared_ptr.i branches/gsoc2009-ashishs99/Examples/test-suite/li_boost_shared_ptr_bits.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_combinations.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_vector.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_vector_extra.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_vector_ptr.i branches/gsoc2009-ashishs99/Examples/test-suite/memberin_extend.i branches/gsoc2009-ashishs99/Examples/test-suite/minherit.i branches/gsoc2009-ashishs99/Examples/test-suite/namespace_class.i branches/gsoc2009-ashishs99/Examples/test-suite/namespace_union.i branches/gsoc2009-ashishs99/Examples/test-suite/nested.i branches/gsoc2009-ashishs99/Examples/test-suite/nested_comment.i branches/gsoc2009-ashishs99/Examples/test-suite/nested_structs.i branches/gsoc2009-ashishs99/Examples/test-suite/octave/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/octave/enums_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/operator_overload.i branches/gsoc2009-ashishs99/Examples/test-suite/php/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/php/arrays_global_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/arrays_global_twodim_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/arrays_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/arrays_scope_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/cpp_static_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/enum_scope_template_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/ignore_parameter_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/li_carrays_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/primitive_ref_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php_namewarn_rename.i branches/gsoc2009-ashishs99/Examples/test-suite/pointer_reference.i branches/gsoc2009-ashishs99/Examples/test-suite/python/enums_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/li_boost_shared_ptr_bits_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/li_std_vector_extra_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/static_const_member.i branches/gsoc2009-ashishs99/Examples/test-suite/template_classes.i branches/gsoc2009-ashishs99/Examples/test-suite/union_scope.i branches/gsoc2009-ashishs99/Examples/test-suite/using_namespace.i branches/gsoc2009-ashishs99/Examples/test-suite/valuewrapper_const.i branches/gsoc2009-ashishs99/Lib/allegrocl/allegrocl.swg branches/gsoc2009-ashishs99/Lib/cffi/cffi.swg branches/gsoc2009-ashishs99/Lib/chicken/chicken.swg branches/gsoc2009-ashishs99/Lib/chicken/std_string.i branches/gsoc2009-ashishs99/Lib/csharp/boost_shared_ptr.i branches/gsoc2009-ashishs99/Lib/csharp/csharp.swg branches/gsoc2009-ashishs99/Lib/csharp/csharphead.swg branches/gsoc2009-ashishs99/Lib/csharp/std_map.i branches/gsoc2009-ashishs99/Lib/csharp/std_vector.i branches/gsoc2009-ashishs99/Lib/guile/std_map.i branches/gsoc2009-ashishs99/Lib/guile/std_string.i branches/gsoc2009-ashishs99/Lib/guile/std_vector.i branches/gsoc2009-ashishs99/Lib/guile/typemaps.i branches/gsoc2009-ashishs99/Lib/intrusive_ptr.i branches/gsoc2009-ashishs99/Lib/java/boost_intrusive_ptr.i branches/gsoc2009-ashishs99/Lib/java/boost_shared_ptr.i branches/gsoc2009-ashishs99/Lib/java/java.swg branches/gsoc2009-ashishs99/Lib/java/std_map.i branches/gsoc2009-ashishs99/Lib/lua/lua.swg branches/gsoc2009-ashishs99/Lib/lua/luarun.swg branches/gsoc2009-ashishs99/Lib/lua/luatypemaps.swg branches/gsoc2009-ashishs99/Lib/lua/typemaps.i branches/gsoc2009-ashishs99/Lib/lua/wchar.i branches/gsoc2009-ashishs99/Lib/modula3/modula3.swg branches/gsoc2009-ashishs99/Lib/mzscheme/std_map.i branches/gsoc2009-ashishs99/Lib/mzscheme/typemaps.i branches/gsoc2009-ashishs99/Lib/ocaml/director.swg branches/gsoc2009-ashishs99/Lib/ocaml/ocamlkw.swg branches/gsoc2009-ashishs99/Lib/ocaml/std_map.i branches/gsoc2009-ashishs99/Lib/ocaml/typemaps.i branches/gsoc2009-ashishs99/Lib/octave/boost_shared_ptr.i branches/gsoc2009-ashishs99/Lib/octave/octrun.swg branches/gsoc2009-ashishs99/Lib/octave/octruntime.swg branches/gsoc2009-ashishs99/Lib/octave/std_basic_string.i branches/gsoc2009-ashishs99/Lib/octave/std_map.i branches/gsoc2009-ashishs99/Lib/perl5/perltypemaps.swg branches/gsoc2009-ashishs99/Lib/perl5/std_map.i branches/gsoc2009-ashishs99/Lib/php/const.i branches/gsoc2009-ashishs99/Lib/php/director.swg branches/gsoc2009-ashishs99/Lib/php/globalvar.i branches/gsoc2009-ashishs99/Lib/php/php.swg branches/gsoc2009-ashishs99/Lib/php/phpinit.swg branches/gsoc2009-ashishs99/Lib/php/phpkw.swg branches/gsoc2009-ashishs99/Lib/php/phprun.swg branches/gsoc2009-ashishs99/Lib/php/std_map.i branches/gsoc2009-ashishs99/Lib/php/std_string.i branches/gsoc2009-ashishs99/Lib/php/typemaps.i branches/gsoc2009-ashishs99/Lib/php/utils.i branches/gsoc2009-ashishs99/Lib/pike/pike.swg branches/gsoc2009-ashishs99/Lib/python/argcargv.i branches/gsoc2009-ashishs99/Lib/python/boost_shared_ptr.i branches/gsoc2009-ashishs99/Lib/python/director.swg branches/gsoc2009-ashishs99/Lib/python/pydocs.swg branches/gsoc2009-ashishs99/Lib/python/pyinit.swg branches/gsoc2009-ashishs99/Lib/python/pytypemaps.swg branches/gsoc2009-ashishs99/Lib/r/r.swg branches/gsoc2009-ashishs99/Lib/r/rfragments.swg branches/gsoc2009-ashishs99/Lib/r/rtype.swg branches/gsoc2009-ashishs99/Lib/r/std_pair.i branches/gsoc2009-ashishs99/Lib/ruby/director.swg branches/gsoc2009-ashishs99/Lib/ruby/embed.i branches/gsoc2009-ashishs99/Lib/ruby/rubycontainer.swg branches/gsoc2009-ashishs99/Lib/ruby/rubycontainer_extended.swg branches/gsoc2009-ashishs99/Lib/ruby/rubyhead.swg branches/gsoc2009-ashishs99/Lib/ruby/rubyrun.swg branches/gsoc2009-ashishs99/Lib/ruby/std_map.i branches/gsoc2009-ashishs99/Lib/ruby/std_multimap.i branches/gsoc2009-ashishs99/Lib/ruby/std_pair.i branches/gsoc2009-ashishs99/Lib/ruby/std_set.i branches/gsoc2009-ashishs99/Lib/shared_ptr.i branches/gsoc2009-ashishs99/Lib/std/_std_deque.i branches/gsoc2009-ashishs99/Lib/std/std_vector.i branches/gsoc2009-ashishs99/Lib/swig.swg branches/gsoc2009-ashishs99/Lib/tcl/std_map.i branches/gsoc2009-ashishs99/Lib/tcl/tcltypemaps.swg branches/gsoc2009-ashishs99/Lib/typemaps/attribute.swg branches/gsoc2009-ashishs99/Lib/typemaps/cstrings.swg branches/gsoc2009-ashishs99/Lib/typemaps/fragments.swg branches/gsoc2009-ashishs99/Lib/typemaps/strings.swg branches/gsoc2009-ashishs99/Lib/typemaps/swigtype.swg branches/gsoc2009-ashishs99/Makefile.in branches/gsoc2009-ashishs99/README branches/gsoc2009-ashishs99/Source/CParse/cparse.h branches/gsoc2009-ashishs99/Source/CParse/cscanner.c branches/gsoc2009-ashishs99/Source/CParse/parser.y branches/gsoc2009-ashishs99/Source/CParse/templ.c branches/gsoc2009-ashishs99/Source/DOH/base.c branches/gsoc2009-ashishs99/Source/Include/swigwarn.h branches/gsoc2009-ashishs99/Source/Makefile.am branches/gsoc2009-ashishs99/Source/Modules/allegrocl.cxx branches/gsoc2009-ashishs99/Source/Modules/allocate.cxx branches/gsoc2009-ashishs99/Source/Modules/cffi.cxx branches/gsoc2009-ashishs99/Source/Modules/chicken.cxx branches/gsoc2009-ashishs99/Source/Modules/clisp.cxx branches/gsoc2009-ashishs99/Source/Modules/csharp.cxx branches/gsoc2009-ashishs99/Source/Modules/emit.cxx branches/gsoc2009-ashishs99/Source/Modules/guile.cxx branches/gsoc2009-ashishs99/Source/Modules/java.cxx branches/gsoc2009-ashishs99/Source/Modules/lang.cxx branches/gsoc2009-ashishs99/Source/Modules/lua.cxx branches/gsoc2009-ashishs99/Source/Modules/main.cxx branches/gsoc2009-ashishs99/Source/Modules/modula3.cxx branches/gsoc2009-ashishs99/Source/Modules/mzscheme.cxx branches/gsoc2009-ashishs99/Source/Modules/ocaml.cxx branches/gsoc2009-ashishs99/Source/Modules/octave.cxx branches/gsoc2009-ashishs99/Source/Modules/overload.cxx branches/gsoc2009-ashishs99/Source/Modules/perl5.cxx branches/gsoc2009-ashishs99/Source/Modules/php.cxx branches/gsoc2009-ashishs99/Source/Modules/pike.cxx branches/gsoc2009-ashishs99/Source/Modules/python.cxx branches/gsoc2009-ashishs99/Source/Modules/r.cxx branches/gsoc2009-ashishs99/Source/Modules/ruby.cxx branches/gsoc2009-ashishs99/Source/Modules/swigmain.cxx branches/gsoc2009-ashishs99/Source/Modules/swigmod.h branches/gsoc2009-ashishs99/Source/Modules/tcl8.cxx branches/gsoc2009-ashishs99/Source/Modules/typepass.cxx branches/gsoc2009-ashishs99/Source/Preprocessor/cpp.c branches/gsoc2009-ashishs99/Source/Preprocessor/preprocessor.h branches/gsoc2009-ashishs99/Source/Swig/cwrap.c branches/gsoc2009-ashishs99/Source/Swig/error.c branches/gsoc2009-ashishs99/Source/Swig/include.c branches/gsoc2009-ashishs99/Source/Swig/misc.c branches/gsoc2009-ashishs99/Source/Swig/naming.c branches/gsoc2009-ashishs99/Source/Swig/parms.c branches/gsoc2009-ashishs99/Source/Swig/scanner.c branches/gsoc2009-ashishs99/Source/Swig/stype.c branches/gsoc2009-ashishs99/Source/Swig/swig.h branches/gsoc2009-ashishs99/Source/Swig/swigfile.h branches/gsoc2009-ashishs99/Source/Swig/swigopt.h branches/gsoc2009-ashishs99/Source/Swig/swigparm.h branches/gsoc2009-ashishs99/Source/Swig/swigscan.h branches/gsoc2009-ashishs99/Source/Swig/swigtree.h branches/gsoc2009-ashishs99/Source/Swig/swigwrap.h branches/gsoc2009-ashishs99/Source/Swig/symbol.c branches/gsoc2009-ashishs99/Source/Swig/tree.c branches/gsoc2009-ashishs99/Source/Swig/typemap.c branches/gsoc2009-ashishs99/Source/Swig/typeobj.c branches/gsoc2009-ashishs99/Source/Swig/typesys.c branches/gsoc2009-ashishs99/Tools/mkdist.py branches/gsoc2009-ashishs99/Tools/mkrelease.py branches/gsoc2009-ashishs99/configure.in branches/gsoc2009-ashishs99/swig.spec.in Added Paths: ----------- branches/gsoc2009-ashishs99/Examples/test-suite/constant_expr.i branches/gsoc2009-ashishs99/Examples/test-suite/constructor_rename.i branches/gsoc2009-ashishs99/Examples/test-suite/csharp/li_boost_shared_ptr_bits_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/li_std_combinations_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/nspace_extend_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/nspace_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/enum_rename.i branches/gsoc2009-ashishs99/Examples/test-suite/expressions.i branches/gsoc2009-ashishs99/Examples/test-suite/extern_c.i branches/gsoc2009-ashishs99/Examples/test-suite/global_scope_types.i branches/gsoc2009-ashishs99/Examples/test-suite/java/li_boost_shared_ptr_bits_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/nested_class_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/nested_structs_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/nested_workaround_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/nspace_extend_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/nspace_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/template_nested_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/template_nested_typemaps_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/template_partial_specialization_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/template_partial_specialization_typedef_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/lua/char_strings_runme.lua branches/gsoc2009-ashishs99/Examples/test-suite/memberin_extend_c.i branches/gsoc2009-ashishs99/Examples/test-suite/nested_class.i branches/gsoc2009-ashishs99/Examples/test-suite/nested_workaround.i branches/gsoc2009-ashishs99/Examples/test-suite/nspace.i branches/gsoc2009-ashishs99/Examples/test-suite/nspace_extend.i branches/gsoc2009-ashishs99/Examples/test-suite/octave/octave_empty.c branches/gsoc2009-ashishs99/Examples/test-suite/php/exception_order_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/threads_exception_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/python/constructor_rename_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/extern_c_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/memberin_extend_c_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/nested_workaround_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/struct_initialization_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/threads_exception_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/typemap_delete_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/typemap_qualifier_strip_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/struct_initialization.i branches/gsoc2009-ashishs99/Examples/test-suite/struct_initialization_cpp.i branches/gsoc2009-ashishs99/Examples/test-suite/symbol_clash.i branches/gsoc2009-ashishs99/Examples/test-suite/template_nested.i branches/gsoc2009-ashishs99/Examples/test-suite/template_nested_typemaps.i branches/gsoc2009-ashishs99/Examples/test-suite/template_partial_specialization.i branches/gsoc2009-ashishs99/Examples/test-suite/template_partial_specialization_typedef.i branches/gsoc2009-ashishs99/Examples/test-suite/threads_exception.i branches/gsoc2009-ashishs99/Examples/test-suite/typemap_delete.i branches/gsoc2009-ashishs99/Examples/test-suite/typemap_global_scope.i branches/gsoc2009-ashishs99/Examples/test-suite/typemap_qualifier_strip.i branches/gsoc2009-ashishs99/Examples/test-suite/typemap_template.i branches/gsoc2009-ashishs99/Lib/csharp/std_shared_ptr.i branches/gsoc2009-ashishs99/Lib/java/std_shared_ptr.i branches/gsoc2009-ashishs99/Lib/python/std_shared_ptr.i branches/gsoc2009-ashishs99/Lib/r/std_map.i branches/gsoc2009-ashishs99/RELEASENOTES Removed Paths: ------------- branches/gsoc2009-ashishs99/Examples/php/reference/runme-proxy.php4 branches/gsoc2009-ashishs99/Examples/php/variables/runme.php4.old branches/gsoc2009-ashishs99/Examples/python/weave/ branches/gsoc2009-ashishs99/Examples/test-suite/octave/li_boost_shared_ptr_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/octave/li_std_map_runme.m branches/gsoc2009-ashishs99/FUTURE branches/gsoc2009-ashishs99/Misc/ branches/gsoc2009-ashishs99/NEW branches/gsoc2009-ashishs99/Tools/WAD/ branches/gsoc2009-ashishs99/Tools/swig.spec.1 Property Changed: ---------------- branches/gsoc2009-ashishs99/ branches/gsoc2009-ashishs99/Examples/php/extend/ branches/gsoc2009-ashishs99/Examples/test-suite/csharp/special_variable_macros_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/java/special_variable_macros_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/li_reference.i branches/gsoc2009-ashishs99/Examples/test-suite/perl5/li_reference_runme.pl branches/gsoc2009-ashishs99/Examples/test-suite/php/ branches/gsoc2009-ashishs99/Examples/test-suite/python/special_variable_macros_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/special_variable_macros.i branches/gsoc2009-ashishs99/LICENSE-GPL branches/gsoc2009-ashishs99/LICENSE-UNIVERSITIES Property changes on: branches/gsoc2009-ashishs99 ___________________________________________________________________ Modified: svn:mergeinfo - /branches/swig-2.0:11085-11086,11088-11089 /trunk:11208-11696,11873-11876 + /branches/swig-2.0:11085-11086,11088-11089 /trunk:11208-11696,11698-12106 Modified: branches/gsoc2009-ashishs99/ANNOUNCE =================================================================== --- branches/gsoc2009-ashishs99/ANNOUNCE 2010-06-09 09:00:23 UTC (rev 12106) +++ branches/gsoc2009-ashishs99/ANNOUNCE 2010-06-09 13:12:33 UTC (rev 12107) @@ -1,14 +1,11 @@ -*** ANNOUNCE: SWIG 2.0.0 (in progress) *** +*** ANNOUNCE: SWIG 2.0.1 (in progress) *** http://www.swig.org +We're pleased to announce SWIG-2.0.1, the latest SWIG release. -We're pleased to announce SWIG-2.0.0, the latest installment in the -SWIG development effort. SWIG-2.0.0 includes a number of bug fixes -and enhancements. - What is SWIG? -------------- +============= SWIG is a software development tool that reads C/C++ header files and generates the wrapper code needed to make C and C++ code accessible @@ -20,17 +17,17 @@ prototyping, testing, and user interface development for large C/C++ systems. -Availability: -------------- +Availability +============ The release is available for download on Sourceforge at - http://prdownloads.sourceforge.net/swig/swig-2.0.0.tar.gz + http://prdownloads.sourceforge.net/swig/swig-2.0.1.tar.gz A Windows version is also available at - http://prdownloads.sourceforge.net/swig/swigwin-2.0.0.zip + http://prdownloads.sourceforge.net/swig/swigwin-2.0.1.zip -Please report problems with this release to the swig-dev mailing list, +Please report problems with this release to the swig-devel mailing list, details at http://www.swig.org/mail.html. --- The SWIG Developers Modified: branches/gsoc2009-ashishs99/CCache/Makefile.in =================================================================== --- branches/gsoc2009-ashishs99/CCache/Makefile.in 2010-06-09 09:00:23 UTC (rev 12106) +++ branches/gsoc2009-ashishs99/CCache/Makefile.in 2010-06-09 13:12:33 UTC (rev 12107) @@ -40,8 +40,11 @@ yodl2html -o web/ccache-man.html ccache.yo install: \$(PACKAGE_NAME)\$(EXEEXT) \$(PACKAGE_NAME).1 + @echo "Installing \$(PACKAGE_NAME)" + @echo "Installing \$(DESTDIR)\${bindir}/`echo \$(PACKAGE_NAME) | sed '\$(transform)'`\$(EXEEXT)" \${INSTALLCMD} -d \$(DESTDIR)\${bindir} \${INSTALLCMD} -m 755 \$(PACKAGE_NAME)\$(EXEEXT) \$(DESTDIR)\${bindir}/`echo \$(PACKAGE_NAME) | sed '\$(transform)'`\$(EXEEXT) + @echo "Installing \$(DESTDIR)\${mandir}/man1/`echo \$(PACKAGE_NAME) | sed '\$(transform)'`.1" \${INSTALLCMD} -d \$(DESTDIR)\${mandir}/man1 \${INSTALLCMD} -m 644 \${srcdir}/\$(PACKAGE_NAME).1 \$(DESTDIR)\${mandir}/man1/`echo \$(PACKAGE_NAME) | sed '\$(transform)'`.1 @@ -52,9 +55,6 @@ clean: /bin/rm -f \$(OBJS) *~ \$(PACKAGE_NAME)\$(EXEEXT) -distclean-docs: - rm -f \$(PACKAGE_NAME).1 web/ccache-man.html - check : test test: test.sh @@ -62,9 +62,14 @@ check: test -distclean: clean distclean-docs - /bin/rm -f Makefile config.h config.sub config.log build-stamp config.status configure config.h.in ccache_swig_config.h +distclean: clean + /bin/rm -f Makefile config.h config.sub config.log build-stamp config.status ccache_swig_config.h + /bin/rm -rf autom4te.cache +maintainer-clean: distclean + /bin/rm -f \$(PACKAGE_NAME).1 web/ccache-man.html + + # FIXME: To fix this, test.sh needs to be able to take ccache from the # installed prefix, not from the source dir. installcheck: Modified: branches/gsoc2009-ashishs99/CHANGES =================================================================== --- branches/gsoc2009-ashishs99/CHANGES 2010-06-09 09:00:23 UTC (rev 12106) +++ branches/gsoc2009-ashishs99/CHANGES 2010-06-09 13:12:33 UTC (rev 12107) @@ -1,7 +1,669 @@ SWIG (Simplified Wrapper and Interface Generator) -See CHANGES.current for current version. +See the CHANGES.current file for changes in the current version. +See the RELEASENOTES file for a summary of changes in each release. +Version 2.0.0 (2 June 2010) +=========================== + +2010-06-02: wsfulton + [C#] Fix SWIG_STD_VECTOR_ENHANCED macro used in std::vector to work with + types containing commas, for example: + + SWIG_STD_VECTOR_ENHANCED(std::pair< double, std::string >) + +2010-06-01: wsfulton + Add in std_shared_ptr.i for wrapping std::shared_ptr. Requires the %shared_ptr + macro like in the boost_shared_ptr.i library. std::tr1::shared_ptr can also be + wrapped if the following macro is defined: + + #define SWIG_SHARED_PTR_SUBNAMESPACE tr1 + %include + + shared_ptr is also documented in Library.html now. + +2010-05-27: wsfulton + Add the ability for \$typemap special variable macros to call other \$typemap + special variable macros, for example: + + %typemap(cstype) CC "CC" + %typemap(cstype) BB "\$typemap(cstype, CC)" + %typemap(cstype) AA "\$typemap(cstype, BB)" + void hah(AA aa); + + This also fixes C# std::vector containers of shared_ptr and %shared_ptr. + + Also added diagnostics for \$typemap with -debug-tmsearch, for example, the + above displays additional diagnostic lines starting "Containing: ": + + example.i:34: Searching for a suitable 'cstype' typemap for: AA aa + Looking for: AA aa + Looking for: AA + Using: %typemap(cstype) AA + Containing: \$typemap(cstype, BB) + example.i:31: Searching for a suitable 'cstype' typemap for: BB + Looking for: BB + Using: %typemap(cstype) BB + Containing: \$typemap(cstype, CC) + example.i:29: Searching for a suitable 'cstype' typemap for: CC + Looking for: CC + Using: %typemap(cstype) CC + +2010-05-26: olly + Fix %attribute2ref not to produce a syntax error if the last + argument (AccessorMethod) is omitted. Patch from David Piepgras + in SF#2235756. + +2010-05-26: olly + [PHP] When using %throws or %catches, SWIG-generated PHP5 wrappers + now throw PHP Exception objects instead of giving a PHP error of + type E_ERROR. + + This change shouldn't cause incompatibility issues, since you can't + set an error handler for E_ERROR, so previously PHP would just exit + which also happens for unhandled exceptions. The benefit is you can + now catch them if you want to. + + Fixes SF#2545578 and SF#2955522. + +2010-05-25: olly + [PHP] Add missing directorin typemap for const std::string &. + Fixes SF#3006404 reported by t-Legiaw. + +2010-05-23: wsfulton + [C#] Fix #2957375 - SWIGStringHelper and SWIGExceptionHelper not always being + initialized before use in .NET 4 as the classes were not marked beforefieldinit. + A static constructor has been added to the intermediary class like this: + + %pragma(csharp) imclasscode=%{ + static \$imclassname() { + } + %} + + If you had added your own custom static constructor to the intermediary class in + the same way as above, you will have to modify your approach to use static variable + initialization or define SWIG_CSHARP_NO_IMCLASS_STATIC_CONSTRUCTOR - See csharphead.swg. + + *** POTENTIAL INCOMPATIBILITY *** + +2010-05-23: wsfulton + Fix #2408232. Improve shared_ptr and intrusive_ptr wrappers for classes in an + inheritance hierarchy. No special treatment is needed for derived classes. + The proxy class also no longer needs to be specified, it is automatically + deduced. The following macros are deprecated: + SWIG_SHARED_PTR(PROXYCLASS, TYPE) + SWIG_SHARED_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE) + and have been replaced by + %shared_ptr(TYPE) + Similarly for intrusive_ptr wrappers, the following macro is deprecated: + SWIG_INTRUSIVE_PTR(PROXYCLASS, TYPE) + SWIG_INTRUSIVE_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE) + and have been replaced by + %intrusive_ptr(TYPE) + +2010-05-21: olly + [PHP] Stop generating a bogus line of code in certain constructors. + This was mostly harmless, but caused a PHP notice to be issued, if + enabled (SF#2985684). + +2010-05-18: wsfulton + [Java] Fix member pointers on 64 bit platforms. + +2010-05-14: wsfulton + Fix wrapping of C++ enum boolean values reported by Torsten Landschoff: + typedef enum { PLAY = true, STOP = false } play_state; + +2010-05-14: olly + [PHP] Fix wrapping of global variables which was producing + uncompilable code in some cases. + +2010-05-12: drjoe + [R] Add two more changes from Wil Nolan. Get garbage + collection to work. Implement newfree + +2010-05-09: drjoe + Fix bug reported by Wil Nolan change creation of string so + that R 2.7.0+ can use char hashes + +2010-05-07: wsfulton + Apply patch #2955146 from Sergey Satskiy to fix expressions containing divide by + operator in constructor initialization lists. + +2010-05-05: wsfulton + [R] Memory leak fix handling const std::string & inputs, reported by Will Nolan. + +2010-05-01: wsfulton + Typemap matching enhancement for non-default typemaps. Previously all + qualifiers were stripped in one step, now they are stripped one at a time + starting with the left most qualifier. For example, int const*const + is first stripped to int *const then int *. + + *** POTENTIAL INCOMPATIBILITY *** + +2010-04-25: bhy + [Python] Fix #2985655 - broken constructor renaming. + +2010-04-14: wsfulton + Typemap fragments are now official and documented in Typemaps.html. + +2010-04-09: wsfulton + [Ruby] Fix #2048064 and #2408020. + Apply Ubuntu patch to fix Ruby and std::vector wrappers with -minherit. + https://bugs.launchpad.net/ubuntu/+source/swig1.3/+bug/522874 + +2010-04-09: wsfulton + [Mzscheme] Apply Ubuntu patch to fix std::map wrappers: + https://bugs.launchpad.net/ubuntu/+source/swig1.3/+bug/203876 + +2010-04-09: wsfulton + [Python] Apply patch #2952374 - fix directors and the -nortti option. + +2010-04-09: wsfulton + [Lua] Fix #2887254 and #2946032 - SWIG_Lua_typename using wrong stack index. + +2010-04-03: wsfulton + [Python] Fix exceptions being thrown with the -threads option based on patch from Arto Vuori. + Fixes bug #2818499. + +2010-04-03: wsfulton + Fix Makefile targets: distclean and maintainer-clean + +2010-04-02: wsfulton + [Lua] Fix char pointers, wchar_t pointers and char arrays so that nil can be passed as a + valid value. Bug reported by Gedalia Pasternak. + +2010-04-01: wsfulton + Numerous subtle typemap matching rule fixes when using the default type. The typemap + matching rules are to take a type and find the best default typemap (SWIGTYPE, SWIGTYPE* etc), + then look for the next best match by reducing the chosen default type. The type deduction + now follows C++ class template partial specialization matching rules. + + Below are the set of changes made showing the default type deduction + along with the old reduced type and the new version of the reduced type: + + SWIGTYPE const &[ANY] + new: SWIGTYPE const &[] + old: SWIGTYPE (&)[ANY] + + SWIGTYPE *const [ANY] + new: SWIGTYPE const [ANY] + old: SWIGTYPE *[ANY] + + SWIGTYPE const *const [ANY] + new: SWIGTYPE *const [ANY] + old: SWIGTYPE const *[ANY] + + SWIGTYPE const *const & + new: SWIGTYPE *const & + old: SWIGTYPE const *& + + SWIGTYPE *const * + new: SWIGTYPE const * + old: SWIGTYPE ** + + SWIGTYPE *const & + new: SWIGTYPE const & + old: SWIGTYPE *& + + Additionally, a const SWIGTYPE lookup is used now for any constant type. Some examples, where + T is some reduced type, eg int, struct Foo: + + T const + new: SWIGTYPE const + old: SWIGTYPE + + T *const + new: SWIGTYPE *const + old: SWIGTYPE * + + T const[] + new: SWIGTYPE const[] + old: SWIGTYPE[] + + enum T const + new: enum SWIGTYPE const + old: enum SWIGTYPE + + T (*const )[] + new: SWIGTYPE (*const )[] + old: SWIGTYPE (*)[] + + Reminder: the typemap matching rules can now be seen for any types being wrapped by using + either the -debug-tmsearch or -debug-tmused options. + + In practice this leads to some subtle matching rule changes and the majority of users + won't notice any changes, except in the prime area of motivation for this change: Improve + STL containers of const pointers and passing const pointers by reference. This is fixed + because many of the STL containers use a type 'T const&' as parameters and when T is + a const pointer, for example, 'K const*', then the full type is 'K const*const&'. This + means that the 'SWIGTYPE *const&' typemaps now match when T is either a non-const or + const pointer. Furthermore, some target languages incorrectly had 'SWIGTYPE *&' typemaps + when these should have been 'SWIGTYPE *const&'. These have been corrected (Java, C#, Lua, PHP). + + *** POTENTIAL INCOMPATIBILITY *** + +2010-03-13: wsfulton + [Java] Some very old deprecated pragma warnings are now errors. + +2010-03-13: wsfulton + Improve handling of file names and directories containing double/multiple path separators. + +2010-03-10: mutandiz (Mikel Bancroft) + [allegrocl] Use fully qualified symbol name of cl::identity in emit_defun(). + +2010-03-06: wsfulton + [Java] The intermediary JNI class modifiers are now public by default meaning these + intermediary low level functions are now accessible by default from outside any package + used. The proxy class pointer constructor and getCPtr() methods are also now public. + These are needed in order for the nspace option to work without any other mods. + The previous default of protected access can be restored using: + + SWIG_JAVABODY_METHODS(protected, protected, SWIGTYPE) + %pragma(java) jniclassclassmodifiers = "class" + +2010-03-06: wsfulton + [C#] Added the nspace feature for C#. Documentation for the nspace feature is now available. + +2010-03-04: wsfulton + Added the nspace feature. This adds some improved namespace support. Currently only Java + is supported for target languages, where C++ namespaces are automatically translated into + Java packages. The feature only applies to classes,struct,unions and enums declared within + a namespace. Methods and variables declared in namespaces still effectively have their + namespaces flattened. Example usage: + + %feature(nspace) Outer::Inner1::Color; + %feature(nspace) Outer::Inner2::Color; + + namespace Outer { + namespace Inner1 { + struct Color { + ... + }; + } + namespace Inner2 { + struct Color { + ... + }; + } + } + + For Java, the -package option is also required when using the nspace feature. Say + we use -package com.myco, the two classes can then be accessed as follows from Java: + + com.myco.Outer.Inner1.Color and com.myco.Outer.Inner2.Color. + +2010-02-27: wsfulton + [Python] Remove -dirvtable from the optimizations included by -O as it this option + currently leads to memory leaks as reported by Johan Blake. + +2010-02-27: wsfulton + License code changes: SWIG Source is GPL-v3 and library code license is now clearer + and is provided under a very permissive license. See http://www.swig.org/legal.html. + +2010-02-13: wsfulton + [Ruby] A few fixes for compiling under ruby-1.9.x including patch from 'Nibble'. + +2010-02-13: wsfulton + [Ruby] Apply patch from Patrick Bennett to fix RARRAY_LEN and RARRAY_PTR usage for Ruby 1.9.x + used in various STL wrappers. + +2010-02-13: wsfulton + [C#, Java] Fix incorrect multiply defined symbol name error when an enum item + and class name have the same name, as reported by Nathan Krieger. Example: + + class Vector {}; + namespace Text { + enum Preference { Vector }; + } + + This also fixes other incorrect corner case target language symbol name clashes. + +2010-02-11: wsfulton + Add the -debug-lsymbols option for displaying the target language layer symbols. + +2010-02-09: wsfulton + Fix -MM and -MMD options on Windows. They were not omitting files in the SWIG library as + they should be. + +2010-02-08: wsfulton + Fix #1807329 - When Makefile dependencies are being generated using the -M family of options + on Windows, the file paths have been corrected to use single backslashes rather than double + backslashes as path separators. + +2010-02-06: wsfulton + Fix #2918902 - language specific files not being generated in correct directory on + Windows when using forward slashes for -o, for example: + swig -python -c++ -o subdirectory/theinterface_wrap.cpp subdirectory/theinterface.i + +2010-02-05: wsfulton + Fix #2894405 - assertion when using -xmlout. + +2010-01-28: wsfulton + Fix typemap matching bug when a templated type has a typemap both specialized and not + specialized. For example: + + template struct XX { ... }; + %typemap(in) const XX & "..." + %typemap(in) const XX< int > & "..." + + resulted in the 2nd typemap being applied for all T in XX< T >. + +2010-01-22: wsfulton + Fix #2933129 - typemaps not being found when the unary scope operator (::) is used to denote + global scope, the typemap is now used in situations like this: + + struct X {}; + %typemap(in) const X & "..." + void m(const ::X &); + + and this: + + struct X {}; + %typemap(in) const ::X & "..." + void m(const X &); + +2010-01-20: wsfulton + Fix some unary scope operator (::) denoting global scope problems in the types generated + into the C++ layer. Previously the unary scope operator was dropped in the generated code + if the type had any sort of qualifier, for example when using pointers, references, like + ::foo*, ::foo&, bar< ::foo* >. + +2010-01-13: olly + [PHP] Add datetime to the list of PHP predefined classes (patch + from David Fletcher in SF#2931042). + +2010-01-11: wsfulton + Slight change to warning, error and diagnostic reporting. The warning number is no + longer shown within brackets. This is to help default parsing of warning messages by + other tools, vim on Unix in particular. + + Example original display using -Fstandard: + example.i:20: Warning(401): Nothing known about base class 'B'. Ignored. + New display: + example.i:20: Warning 401: Nothing known about base class 'B'. Ignored. + + Also subtle fix to -Fmicrosoft format adding in missing space. Example original display: + example.i(20): Warning(401): Nothing known about base class 'Base'. Ignored. + New display: + example.i(20) : Warning 401: Nothing known about base class 'Base'. Ignored. + +2010-01-10: wsfulton + Fix a few inconsistencies in reporting of file/line numberings including modifying + the overload warnings 509, 512, 516, 474, 475 to now be two line warnings. + +2010-01-10: wsfulton + Modify -debug-tags output to use standard file name/line reporting so that editors + can easily navigate to the appropriate lines. + Was typically: + . top . include . include (/usr/share/swig/temp/trunk/Lib/swig.swg:312) + . top . include . include . include (/usr/share/swig/temp/trunk/Lib/swigwarnings.swg:39) + now: + /usr/share/swig/temp/trunk/Lib/swig.swg:312: . top . include . include + /usr/share/swig/temp/trunk/Lib/swigwarnings.swg:39: . top . include . include . include + +2010-01-03: wsfulton + Fix missing file/line numbers for typemap warnings and in output from the + -debug-tmsearch/-debug-tmused options. + +2010-01-03: wsfulton + Add typemaps used debugging option (-debug-tmused). When used each line displays + the typemap used for each type for which code is being generated including the file + and line number related to the type. This is effectively a condensed form of the + -debug-tmsearch option. Documented in Typemaps.html. + +2009-12-23: wsfulton + Fix for %javaexception and directors so that all the appropriate throws clauses + are generated. Problem reported by Peter Greenwood. + +2009-12-20: wsfulton + Add -debug-tmsearch option for debugging the typemap pattern matching rules. + Documented in Typemaps.html. + +2009-12-12: wsfulton + [Octave] Remove the -api option and use the new OCTAVE_API_VERSION_NUMBER + macro provided in the octave headers for determining the api version instead. + +2009-12-04: olly + [Ruby] Improve support for Ruby 1.9 under GCC. Addresses part of + SF#2859614. + +2009-12-04: olly + Fix handling of modulo operator (%) in constant expressions + (SF#2818562). + +2009-12-04: olly + [PHP] "empty" is a reserved word in PHP, so rename empty() method + on STL classes to "is_empty()" (previously this was automatically + renamed to "c_empty()"). + *** POTENTIAL INCOMPATIBILITY *** + +2009-12-03: olly + [PHP] Add typemaps for long long and unsigned long long, and for + pointer to method. + +2009-12-02: olly + [PHP] Fix warning and rename of reserved class name to be case + insensitive. + +2009-12-01: wsfulton + Revert support for %extend and memberin typemaps added in swig-1.3.39. The + memberin typemaps are ignored again for member variables within a %extend block. + Documentation inconsistency reported by Torsten Landschoff. + +2009-11-29: wsfulton + [Java, C#] Fix generated quoting when using %javaconst(1)/%csconst(1) for + static const char member variables. + + %javaconst(1) A; + %csconst(1) A; + struct X { + static const char A = 'A'; + }; + +2009-11-26: wsfulton + [Java, C#] Fix %javaconst(1)/%csconst(1) for static const member variables to + use the actual constant value if it is specified, rather than the C++ code to + access the member. + + %javaconst(1) EN; + %csconst(1) EN; + struct X { + static const int EN = 2; + }; + +2009-11-23: wsfulton + C++ nested typedef classes can now be handled too, for example: + struct Outer { + typedef Foo { } FooTypedef1, FooTypedef2; + }; + +2009-11-18: wsfulton + The wrappers for C nested structs are now generated in the same order as declared + in the parsed code. + +2009-11-18: wsfulton + Fix #491476 - multiple declarations of nested structs, for example: + struct Outer { + struct { + int val; + } inner1, inner2, *inner3, inner4[1]; + } outer; + +2009-11-17: wsfulton + Fix parsing of enum declaration and initialization, for example: + + enum ABC { + a, + b, + c + } A = a, *pC = &C, array[3] = {a, b, c}; + +2009-11-17: wsfulton + Fix parsing of struct declaration and initialization, for example: + + struct S { + int x; + } instance = { 10 }; + +2009-11-15: wsfulton + Fix #1960977 - Syntax error parsing derived nested class declaration and member + variable instance. + +2009-11-14: wsfulton + Fix #2310483 - function pointer typedef within extern "C" block. + +2009-11-13: wsfulton + Fix usage of nested template classes within templated classes so that compileable code + is generated. + +2009-11-13: olly + [php] Fix place where class prefix (as specified with -prefix) + wasn't being used. Patch from gverbruggen in SF#2892647. + +2009-11-12: wsfulton + Fix usage of nested template classes so that compileable code is generated - the nested + template class is now treated like a normal nested classes, that is, as an opaque type + unless the nestedworkaround feature is used. + +2009-11-12: wsfulton + Replace SWIGWARN_PARSE_NESTED_CLASS with SWIGWARN_PARSE_NAMED_NESTED_CLASS and + SWIGWARN_PARSE_UNNAMED_NESTED_CLASS for named and unnamed nested classes respectively. + + Named nested class ignored warnings can now be suppressed by name using %warnfilter, eg: + + %warnfilter(SWIGWARN_PARSE_NAMED_NESTED_CLASS) Outer::Inner; + + but clearly unnamed nested classes cannot and the global suppression is still required, eg: + + #pragma SWIG nowarn=SWIGWARN_PARSE_UNNAMED_NESTED_CLASS + +2009-11-11: wsfulton + Added the nestedworkaround feature as a way to use the full functionality of a nested class + (C++ mode only). It removes the nested class from SWIG's type information so it is as if SWIG + had never parsed the nested class. The documented nested class workarounds using a global + fake class stopped working when SWIG treated the nested class as an opaque pointer, and + this feature reverts this behaviour. The documentation has been updated with details of how + to use and implement it, see the "Nested classes" section in SWIGPlus.html. + +2009-11-11: wsfulton + There were a number of C++ cases where nested classes/structs/unions were being handled + as if C code was being parsed which would oftentimes lead to uncompileable code as an + attempt was made to wrap the nested structs like it is documented for C code. Now all + nested structs/classes/unions are ignored in C++ mode, as was always documented. However, + there is an improvement as usage of nested structs/classes/unions is now always treated + as an opaque type by default, resulting in generated code that should always compile. + + *** POTENTIAL INCOMPATIBILITY *** + +2009-11-09: drjoe + Fix R for -fcompact and add std_map.i + +2009-11-08: wsfulton + Fix inconsistency for nested structs/unions/classes. Uncompileable code was being + generated when inner struct and union declarations were used as types within the + inner struct. The inner struct/union is now treated as a forward declaration making the + behaviour the same as an inner class. (C++ code), eg: + + struct Outer { + struct InnerStruct { int x; }; + InnerStruct* getInnerStruct(); + }; + +2009-11-08: wsfulton + Ignored nested class/struct warnings now display the name of the ignored class/struct. + +2009-11-07: wsfulton + Bug #1514681 - Fix nested template classes within a namespace generated uncompileable + code and introduced strange side effects to other wrapper code especially code + after the nested template class. Note that nested template classes are still ignored. + +2009-11-07: wsfulton + Add new debug options: + -debug-symtabs - Display symbol tables information + -debug-symbols - Display target language symbols in the symbol tables + -debug-csymbols - Display C symbols in the symbol tables + +2009-11-03: wsfulton + Fix some usage of unary scope operator (::) denoting global scope, for example: + + namespace AA { /* ... */ } + using namespace ::AA; + + and bug #1816802 - SwigValueWrapper should be used: + + struct CC { + CC(int); // no default constructor + }; + ::CC x(); + + and in template parameter specializations: + + struct S {}; + template struct X { void a() {}; }; + template <> struct X { void b() {}; }; + %template(MyTConcrete) X< ::S >; + + plus probably some other corner case usage of ::. + +2009-11-02: olly + [Python] Fix potential memory leak in initialisation code for the + generated module. + +2009-10-23: wsfulton + Fix seg fault when using a named nested template instantiation using %template(name) + within a class. A warning that these are not supported is now issued plus processing + continues as if no name was given. + +2009-10-20: wsfulton + [Python] Fix std::vector. This would previously compile, but not run correctly. + +2009-10-20: wsfulton + Fixed previously fairly poor template partial specialization and explicit + specialization support. Numerous bugs in this area have been fixed including: + + - Template argument deduction implemented for template type arguments, eg this now + works: + template class X {}; + template class X {}; + %template(X1) X; // Chooses T * specialization + + and more complex cases with multiple parameters and a mix of template argument + deduction and explicitly specialised parameters, eg: + template struct TwoParm { void a() {} }; + template struct TwoParm { void e() {} }; + %template(E) TwoParm; + + Note that the primary template must now be in scope, like in C++, when + an explicit or partial specialization is instantiated with %template. + + *** POTENTIAL INCOMPATIBILITY *** + +2009-09-14: wsfulton + [C#] Add %csattributes for adding C# attributes to enum values, see docs for example. + +2009-09-11: wsfulton + Fix memmove regression in cdata.i as reported by Adriaan Renting. + +2009-09-07: wsfulton + Fix constant expressions containing <= or >=. + +2009-09-02: wsfulton + The following operators in constant expressions now result in type bool for C++ + wrappers and remain as type int for C wrappers, as per each standard: + + && || == != < > <= >= (Actually the last 4 are still broken). For example: + + #define A 10 + #define B 10 + #define A_EQ_B A == B // now wrapped as type bool for C++ + #define A_AND_B A && B // now wrapped as type bool for C++ + +2009-09-02: wsfulton + Fix #2845746. true and false are now recognised keywords (only when wrapping C++). + Constants such as the following are now wrapped (as type bool): + #define FOO true + #define BAR FOO && false + Version 1.3.40 (18 August 2009) =============================== @@ -956,7 +1618,7 @@ 03/17/2008: olly Fix memory leak in SWIG's parser (based on patch from Russell - Bryant in SF#1914023).` + Bryant in SF#1914023). 03/12/2008: wsfulton Fix bug #1878285 - unnecessary cast for C struct creation wrappers. @@ -8256,7 +8918,7 @@ When needed, use %inlcude std_string.i // 'char' strings - %inlcude std_wstring.i // 'wchar_t; strings + %inlcude std_wstring.i // 'wchar_t' strings 04/10/2004: mmatus (Marcelo Matus) Modified: branches/gsoc2009-ashishs99/CHANGES.current =================================================================== --- branches/gsoc2009-ashishs99/CHANGES.current 2010-06-09 09:00:23 UTC (rev 12106) +++ branches/gsoc2009-ashishs99/CHANGES.current 2010-06-09 13:12:33 UTC (rev 12107) @@ -1,29 +1,10 @@ -Version 1.3.41 (in progress) -============================ +This file contains the changes for the current release. +See the CHANGES file for changes in older releases. +See the RELEASENOTES file for a summary of changes in each release. -2009-09-14: wsfulton - [C#] Add %csattributes for adding C# attributes to enum values, see docs for example. +Version 2.0.1 (in progress) +=========================== -2009-09-11: wsfulton - Fix memmove regression in cdata.i as reported by Adriaan Renting. - -2009-09-07: wsfulton - Fix constant expressions containing <= or >=. - -2009-09-02: wsfulton - The following operators in constant expressions now result in type bool for C++ - wrappers and remain as type int for C wrappers, as per each standard: - - && || == != < > <= >= (Actually the last 4 are still broken). For example: - - #define A 10 - #define B 10 - #define A_EQ_B A == B // now wrapped as type bool for C++ - #define A_AND_B A && B // now wrapped as type bool for C++ - -2009-09-02: wsfulton - Fix #2845746. true and false are now recognised keywords (only when wrapping C++). - Constants such as the following are now wrapped (as type bool): - #define FOO true - #define BAR FOO && false - +2010-06-03: wsfulton + Fix uncompileable code when %rename results in two enum items + with the same name. Reported by Vadim Zeitlin. Modified: branches/gsoc2009-ashishs99/COPYRIGHT =================================================================== --- branches/gsoc2009-ashishs99/COPYRIGHT 2010-06-09 09:00:23 UTC (rev 12106) +++ branches/gsoc2009-ashishs99/COPYRIGHT 2010-06-09 13:12:33 UTC (rev 12107) @@ -29,7 +29,7 @@ Charlie Savage (cfis@...) (Ruby) Thien-Thi Nguyen (ttn@...) (build/test/misc) Richard Palmer (richard@...) (PHP) - Sam Liddicott - Anonova Ltd (saml@...) (PHP) + Sam Liddicott - Ananova Ltd (saml@...) (PHP) Tim Hockin - Sun Microsystems (thockin@...) (PHP) Kevin Ruland (PHP) Shibukawa Yoshiki (Japanese Translation) @@ -58,6 +58,42 @@ Past contributors include: James Michael DuPont, Clark McGrew, Dustin Mitchell, Ian Cooke, Catalin Dumitrescu, Baran - Kovuk, Oleg Tolmatcev, Tal Shalif, Lluis Padro, Chris Seatory, Igor Bely, Robin Dunn - (See CHANGES and CHANGES.current for a more complete list). + Kovuk, Oleg Tolmatcev, Tal Shalif, Lluis Padro, Chris Seatory, Igor Bely, Robin Dunn, + Edward Zimmermann, David Ascher, Dominique Dumont, Pier Giorgio Esposito, Hasan Baran Kovuk, + Klaus Wiederänders + (See CHANGES and CHANGES.current and the bug tracker for a more complete list). +Past students: + Songyan Feng (Chicago). + Xinghua Shi (Chicago). + Jing Cao (Chicago). + Aquinas Hobor (Chicago). + +Historically, the following people contributed to early versions of SWIG. +Peter Lomdahl, Brad Holian, Shujia Zhou, Niels Jensen, and Tim Germann +at Los Alamos National Laboratory were the first users. Patrick +Tullmann at the University of Utah suggested the idea of automatic +documentation generation. John Schmidt and Kurtis Bleeker at the +University of Utah tested out the early versions. Chris Johnson +supported SWIG's developed at the University of Utah. John Buckman, +Larry Virden, and Tom Schwaller provided valuable input on the first +releases and improving the portability of SWIG. David Fletcher and +Gary Holt have provided a great deal of input on improving SWIG's +Perl5 implementation. Kevin Butler contributed the first Windows NT +port. + +Early bug reports and patches: +Adam Hupp, Arthur Smyles, Brad Clements, Brett Williams, Buck Hodges, +Burkhard Kloss, Chia-Liang Kao, Craig Files, Dennis Marsa, Dieter Baron, +Drake Diedrich, Fleur Diana Dragan, Gary Pennington, Geoffrey Hort, Gerald Williams, +Greg Anderson, Greg Kochanski, Greg Troxel, Henry Rowley, Irina Kotlova, +Israel Taller, James Bailey, Jim Fulton, Joel Reed, Jon Travis, +Junio Hamano, Justin Heyes-Jones, Karl Forner, Keith Davidson, +Krzysztof Kozminski, Larry Virden, Luke J Crook, Magnus Ljung, Marc Zonzon, +Mark Howson, Micahel Scharf, Michel Sanner, Mike Romberg, Mike Simons, +Mike Weiblen, Paul Brannan, Ram Bhamidipaty, Reinhard Fobbe, Rich Wales, +Richard Salz, Roy Lecates, Rudy Albachten, Scott Drummonds +Scott Michel, Shaun Lowry, Steve Galser, Tarn Weisner Burton, +Thomas Weidner, Tony Seward, Uwe Steinmann, Vadim Chugunov, Wyss Clemens, +Zhong Ren. + Modified: branches/gsoc2009-ashishs99/Doc/Devel/cmdopt.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Devel/cmdopt.html 2010-06-09 09:00:23 UTC (rev 12106) +++ branches/gsoc2009-ashishs99/Doc/Devel/cmdopt.html 2010-06-09 13:12:33 UTC (rev 12107) @@ -36,7 +36,7 @@

Argument Marking

-As command line options are are processed by language modules, the following functions are used +As command line options are processed by language modules, the following functions are used to mark the arguments as used:

Modified: branches/gsoc2009-ashishs99/Doc/Devel/engineering.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Devel/engineering.html 2010-06-09 09:00:23 UTC (rev 12106) +++ branches/gsoc2009-ashishs99/Doc/Devel/engineering.html 2010-06-09 13:12:33 UTC (rev 12107) @@ -119,22 +119,25 @@ creating two files that differ in case-only.

-Each file should include a short abstract, author information, copyright information, and +Each file should include a short abstract, license information and a SVN revision tag like this:

/* ----------------------------------------------------------------------------- - * See the LICENSE file for information on copyright, usage and redistribution - * of SWIG, and the README file for authors - http://www.swig.org/release.html. + * This file is part of SWIG, which is licensed as a whole under version 3  + * (or any later version) of the GNU General Public License. Some additional + * terms also apply to certain portions of SWIG. The full details of the SWIG + * license and copyrights can be found in the LICENSE and COPYRIGHT files + * included with the SWIG source code as distributed by the SWIG developers + * and at http://www.swig.org/legal.html.   * - * cwrap.c + * xxx.c   * - * This file defines a variety of wrapping rules for C/C++ handling including - * the naming of local variables, calling conventions, and so forth. + * This file defines ...   * ----------------------------------------------------------------------------- */   -char cvsroot_cwrap_c[] = "\$Id\$"; +static char cvs[] = "\$Id\$";    #include "swig.h"    Modified: branches/gsoc2009-ashishs99/Doc/Devel/internals.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Devel/internals.html	2010-06-09 09:00:23 UTC (rev 12106) +++ branches/gsoc2009-ashishs99/Doc/Devel/internals.html	2010-06-09 13:12:33 UTC (rev 12107) @@ -42,11 +42,9 @@
• 3. Types and Typemaps
• 4. Parsing -
• 5. Difference Between SWIG 1.1 and SWIG 1.3 -
• 6. Plans for SWIG 2.0 -
• 7. C/C++ Wrapper Support Functions -
• 8. Symbol Naming Guidelines for Generated C/C++ Code -
• 9. Debugging SWIG +
• 5. C/C++ Wrapper Support Functions +
• 6. Symbol Naming Guidelines for Generated C/C++ Code +
• 7. Debugging SWIG @@ -76,9 +74,8 @@
• Examples This subdir tree contains examples of using SWIG w/ different scripting languages, including makefiles. Typically, there are the -"simple" and "matrix" examples, w/ some languages offering additional -examples. The GIFPlot example has its own set of per-language -subdirectories. See the README more index.html file in each directory +"simple" and "class" examples, w/ some languages offering additional +examples. See the README more index.html file in each directory for more info. [FIXME: Ref SWIG user manual.]
SourceSWIG source code is in this subdir tree. Directories marked w/ "(*)" -are used in building the swig executable. +The C and C++ source code for the swig executable is in this +subdir tree.
DOH (*)
DOH C library providing memory allocation, file access and generic - containers. Result: libdoh.a
Experiment[TODO]
Include (*)
Include Configuration .h files
LParseParser (lex / yacc) files and support [why not (*)?!]
CParseParser (lex / yacc) files and support
Modules[TODO]
Modules1.1 (*) Language-specific callbacks that does actual code generation (each - language has a .cxx and a .h file). Result: libmodules11.a
Preprocessor (*)SWIG-specialized C/C++ preprocessor. Result: libcpp.a
PreprocessorSWIG-specialized C/C++ preprocessor.
SWIG1.1 (*)Parts of SWIG that are not language-specific, including option - processing and the type-mapping system. Result: libswig11.a. - Note: This directory is currently being phased out.
SWIG1.3[TODO] [funny, nothing here is presently used for swig-1.3]. - This directory might turn into a compatibility interface between - SWIG1.3 and the SWIG1.1 modules.
Swig (*)This directory contains the new ANSI C core of the system +
SwigThis directory contains the ANSI C core of the system and contains generic functions related to types, file handling, scanning, and so forth.
ToolsLibtool support and the mkdist.py script.The mkdist.py script and other tools.
Win
@@ -97,55 +94,35 @@ - - + + containers. - - - - - + - - + + - - - - + language has a .cxx and a .h file). - - + + - - - - - - - - - - + @@ -154,7 +131,7 @@ - + @@ -173,14 +150,14 @@
-

18.6.5 Turning wrapped classes into partial classes

+

18.6.5 Turning wrapped classes into partial classes

@@ -2355,7 +2361,7 @@ The following example is an alternative approach to adding managed code to the generated proxy class.

-

18.6.6 Extending proxy classes with additional C# code

+

18.6.6 Extending proxy classes with additional C# code

Modified: branches/gsoc2009-ashishs99/Doc/Manual/Chicken.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Chicken.html 2010-06-09 09:00:23 UTC (rev 12106) +++ branches/gsoc2009-ashishs99/Doc/Manual/Chicken.html 2010-06-09 13:12:33 UTC (rev 12107) @@ -35,7 +35,7 @@

• Typemaps
• Pointers
• Unsupported features and known problems
• STL/C++ Library
• Utility Libraries
• Typemap specifications @@ -346,10 +350,11 @@
• Pattern matching rules
• Code generation rules -
• Typemaps for multiple languages +
• Typemaps for multiple target languages
• Optimal code generation when returning by value
• Multi-argument typemaps -
• The run-time type checker +
• Typemap fragments +
• The run-time type checker +
• More about %apply and %clear -
• Reducing wrapper code size
• Passing data between typemaps
• C++ "this" pointer
• Where to go for more information? @@ -406,7 +415,7 @@ @@ -496,7 +505,7 @@
• Modules Introduction
• Basics
• The SWIG runtime code -
• A word of caution about static libraries
• References
• Reducing the wrapper file size @@ -619,35 +628,35 @@ @@ -681,7 +690,7 @@
• Typemaps
• Pointers
• Unsupported features and known problems
•  [Swig-cvs] SF.net SVN: swig:[12118] branches/gsoc2009-ashishs99 From: - 2010-06-11 15:47:23 ```Revision: 12118 http://swig.svn.sourceforge.net/swig/?rev=12118&view=rev Author: ashishs99 Date: 2010-06-11 15:47:17 +0000 (Fri, 11 Jun 2010) Log Message: ----------- Code to run enum example Modified Paths: -------------- branches/gsoc2009-ashishs99/Examples/objc/enum/runme.m branches/gsoc2009-ashishs99/Lib/objc/enums.swg Modified: branches/gsoc2009-ashishs99/Examples/objc/enum/runme.m =================================================================== --- branches/gsoc2009-ashishs99/Examples/objc/enum/runme.m 2010-06-11 06:36:51 UTC (rev 12117) +++ branches/gsoc2009-ashishs99/Examples/objc/enum/runme.m 2010-06-11 15:47:17 UTC (rev 12118) @@ -2,5 +2,29 @@ #import "exampleProxy.h" int main(int argc, char* argv[]) { + // Print out the value of some enums + NSLog(@"*** color ***"); + NSLog(@"color::RED =%d", RED); + NSLog(@"color::BLUE =%d", BLUE); + NSLog(@"color::GREEN =%d", GREEN); + + NSLog(@"\n*** Foo::speed ***"); + NSLog(@"speed::IMPULSE =%d", IMPULSE); + NSLog(@"speed::WARP =%d", WARP); + NSLog(@"speed::LUDICROUS =%d", LUDICROUS); + + NSLog(@"\nTesting use of enums with functions\n"); + + enum_test(RED, IMPULSE); + enum_test(BLUE, WARP); + enum_test(GREEN, LUDICROUS); + + NSLog(@"\nTesting use of enum with class method" ); + Foo* f = [[Foo alloc] init]; + + [f enum_test:IMPULSE]; + [f enum_test:WARP]; + [f enum_test:LUDICROUS]; + [f release]; return 0; -} \ No newline at end of file +} Modified: branches/gsoc2009-ashishs99/Lib/objc/enums.swg =================================================================== --- branches/gsoc2009-ashishs99/Lib/objc/enums.swg 2010-06-11 06:36:51 UTC (rev 12117) +++ branches/gsoc2009-ashishs99/Lib/objc/enums.swg 2010-06-11 15:47:17 UTC (rev 12118) @@ -6,7 +6,7 @@ * ----------------------------------------------------------------------------- */ // const enum SWIGTYPE & typemaps -%typemap(ocpptype) const enum SWIGTYPE & "int" +%typemap(objcimtype) const enum SWIGTYPE & "int" %typemap(objctype) const enum SWIGTYPE & "\$*objcclassname" %typemap(in) const enum SWIGTYPE & (\$*1_ltype temp) @@ -20,7 +20,7 @@ } // enum SWIGTYPE typemaps -%typemap(ocpptype) enum SWIGTYPE "int" +%typemap(objcimtype) enum SWIGTYPE "int" %typemap(objctype) enum SWIGTYPE "\$objcclassname" %typemap(in) enum SWIGTYPE %{ \$1 = (\$1_ltype)\$input; %} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Swig-cvs] SF.net SVN: swig:[12709] branches/gsoc2009-ashishs99 From: - 2011-05-23 22:53:29 ```Revision: 12709 http://swig.svn.sourceforge.net/swig/?rev=12709&view=rev Author: ashishs99 Date: 2011-05-23 22:53:10 +0000 (Mon, 23 May 2011) Log Message: ----------- Merged trunk changes r12708:r12684 into this branch Modified Paths: -------------- branches/gsoc2009-ashishs99/ANNOUNCE branches/gsoc2009-ashishs99/CHANGES branches/gsoc2009-ashishs99/CHANGES.current branches/gsoc2009-ashishs99/COPYRIGHT branches/gsoc2009-ashishs99/Doc/Devel/index.html branches/gsoc2009-ashishs99/Doc/Devel/internals.html branches/gsoc2009-ashishs99/Doc/Devel/tree.html branches/gsoc2009-ashishs99/Doc/Manual/Arguments.html branches/gsoc2009-ashishs99/Doc/Manual/CSharp.html branches/gsoc2009-ashishs99/Doc/Manual/Contents.html branches/gsoc2009-ashishs99/Doc/Manual/Customization.html branches/gsoc2009-ashishs99/Doc/Manual/Extending.html branches/gsoc2009-ashishs99/Doc/Manual/Guile.html branches/gsoc2009-ashishs99/Doc/Manual/Introduction.html branches/gsoc2009-ashishs99/Doc/Manual/Java.html branches/gsoc2009-ashishs99/Doc/Manual/Library.html branches/gsoc2009-ashishs99/Doc/Manual/Lisp.html branches/gsoc2009-ashishs99/Doc/Manual/Lua.html branches/gsoc2009-ashishs99/Doc/Manual/Makefile branches/gsoc2009-ashishs99/Doc/Manual/Modula3.html branches/gsoc2009-ashishs99/Doc/Manual/Modules.html branches/gsoc2009-ashishs99/Doc/Manual/Mzscheme.html branches/gsoc2009-ashishs99/Doc/Manual/Ocaml.html branches/gsoc2009-ashishs99/Doc/Manual/Octave.html branches/gsoc2009-ashishs99/Doc/Manual/Perl5.html branches/gsoc2009-ashishs99/Doc/Manual/Php.html branches/gsoc2009-ashishs99/Doc/Manual/Pike.html branches/gsoc2009-ashishs99/Doc/Manual/Python.html branches/gsoc2009-ashishs99/Doc/Manual/Ruby.html branches/gsoc2009-ashishs99/Doc/Manual/SWIG.html branches/gsoc2009-ashishs99/Doc/Manual/SWIGPlus.html branches/gsoc2009-ashishs99/Doc/Manual/Sections.html branches/gsoc2009-ashishs99/Doc/Manual/Tcl.html branches/gsoc2009-ashishs99/Doc/Manual/Typemaps.html branches/gsoc2009-ashishs99/Doc/Manual/Varargs.html branches/gsoc2009-ashishs99/Doc/Manual/Warnings.html branches/gsoc2009-ashishs99/Doc/Manual/chapters branches/gsoc2009-ashishs99/Doc/Manual/makechap.py branches/gsoc2009-ashishs99/Doc/Manual/maketoc.py branches/gsoc2009-ashishs99/Examples/Makefile.in branches/gsoc2009-ashishs99/Examples/ocaml/argout_ref/example.i branches/gsoc2009-ashishs99/Examples/ocaml/shapes/example.c branches/gsoc2009-ashishs99/Examples/ocaml/shapes/example.h branches/gsoc2009-ashishs99/Examples/ocaml/std_string/README branches/gsoc2009-ashishs99/Examples/ocaml/strings_test/example.h branches/gsoc2009-ashishs99/Examples/php/cpointer/runme.php branches/gsoc2009-ashishs99/Examples/php/overloading/runme.php branches/gsoc2009-ashishs99/Examples/test-suite/abstract_virtual.i branches/gsoc2009-ashishs99/Examples/test-suite/array_typedef_memberin.i branches/gsoc2009-ashishs99/Examples/test-suite/common.mk branches/gsoc2009-ashishs99/Examples/test-suite/constant_pointers.i branches/gsoc2009-ashishs99/Examples/test-suite/contract.i branches/gsoc2009-ashishs99/Examples/test-suite/cpp_basic.i branches/gsoc2009-ashishs99/Examples/test-suite/csharp/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/csharp/csharp_prepost_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/director_protected_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/enum_thorough_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/enum_thorough_simple_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/enum_thorough_typesafe_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/li_boost_shared_ptr_bits_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/li_std_map_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/nspace_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/pointer_reference_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp_attributes.i branches/gsoc2009-ashishs99/Examples/test-suite/csharp_prepost.i branches/gsoc2009-ashishs99/Examples/test-suite/csharp_typemaps.i branches/gsoc2009-ashishs99/Examples/test-suite/default_constructor.i branches/gsoc2009-ashishs99/Examples/test-suite/director_classes.i branches/gsoc2009-ashishs99/Examples/test-suite/director_extend.i branches/gsoc2009-ashishs99/Examples/test-suite/director_finalizer.i branches/gsoc2009-ashishs99/Examples/test-suite/director_protected.i branches/gsoc2009-ashishs99/Examples/test-suite/director_using.i branches/gsoc2009-ashishs99/Examples/test-suite/dynamic_cast.i branches/gsoc2009-ashishs99/Examples/test-suite/enum_rename.i branches/gsoc2009-ashishs99/Examples/test-suite/enum_thorough.i branches/gsoc2009-ashishs99/Examples/test-suite/enums.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/make.sh branches/gsoc2009-ashishs99/Examples/test-suite/evil_diamond.i branches/gsoc2009-ashishs99/Examples/test-suite/evil_diamond_ns.i branches/gsoc2009-ashishs99/Examples/test-suite/evil_diamond_prop.i branches/gsoc2009-ashishs99/Examples/test-suite/exception_order.i branches/gsoc2009-ashishs99/Examples/test-suite/global_namespace.i branches/gsoc2009-ashishs99/Examples/test-suite/global_ns_arg.i branches/gsoc2009-ashishs99/Examples/test-suite/guilescm/ext_test_external.cxx branches/gsoc2009-ashishs99/Examples/test-suite/import_nomodule.i branches/gsoc2009-ashishs99/Examples/test-suite/inherit_target_language.i branches/gsoc2009-ashishs99/Examples/test-suite/java/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/java/director_protected_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/enum_thorough_proper_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/enum_thorough_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/enum_thorough_simple_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/enum_thorough_typeunsafe_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/global_namespace_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/li_boost_shared_ptr_bits_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/nspace_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/pointer_reference_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/rname_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/wallkw_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/keyword_rename.i branches/gsoc2009-ashishs99/Examples/test-suite/li_boost_shared_ptr.i branches/gsoc2009-ashishs99/Examples/test-suite/li_boost_shared_ptr_bits.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_combinations.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_map.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_stream.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_wstream.i branches/gsoc2009-ashishs99/Examples/test-suite/lua/pointer_reference_runme.lua branches/gsoc2009-ashishs99/Examples/test-suite/member_pointer.i branches/gsoc2009-ashishs99/Examples/test-suite/minherit.i branches/gsoc2009-ashishs99/Examples/test-suite/minherit2.i branches/gsoc2009-ashishs99/Examples/test-suite/mixed_types.i branches/gsoc2009-ashishs99/Examples/test-suite/multiple_inheritance.i branches/gsoc2009-ashishs99/Examples/test-suite/name_warnings.i branches/gsoc2009-ashishs99/Examples/test-suite/namespace_class.i branches/gsoc2009-ashishs99/Examples/test-suite/namespace_spaces.i branches/gsoc2009-ashishs99/Examples/test-suite/namespace_typemap.i branches/gsoc2009-ashishs99/Examples/test-suite/nested_class.i branches/gsoc2009-ashishs99/Examples/test-suite/nspace.i branches/gsoc2009-ashishs99/Examples/test-suite/nspace_extend.i branches/gsoc2009-ashishs99/Examples/test-suite/null_pointer.i branches/gsoc2009-ashishs99/Examples/test-suite/octave/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/octave/exception_order_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/octave/global_ns_arg_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/operator_overload.i branches/gsoc2009-ashishs99/Examples/test-suite/operator_overload_break.i branches/gsoc2009-ashishs99/Examples/test-suite/operbool.i branches/gsoc2009-ashishs99/Examples/test-suite/overload_extend.i branches/gsoc2009-ashishs99/Examples/test-suite/overload_simple.i branches/gsoc2009-ashishs99/Examples/test-suite/perl5/default_args_runme.pl branches/gsoc2009-ashishs99/Examples/test-suite/perl5/li_std_string_runme.pl branches/gsoc2009-ashishs99/Examples/test-suite/perl5/overload_simple_runme.pl branches/gsoc2009-ashishs99/Examples/test-suite/perl5/primitive_types_runme.pl branches/gsoc2009-ashishs99/Examples/test-suite/php/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/php/director_protected_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/php/pointer_reference_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/pointer_reference.i branches/gsoc2009-ashishs99/Examples/test-suite/preproc.i branches/gsoc2009-ashishs99/Examples/test-suite/primitive_types.i branches/gsoc2009-ashishs99/Examples/test-suite/pure_virtual.i branches/gsoc2009-ashishs99/Examples/test-suite/python/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/python/argcargvtest_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/default_constructor_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/director_exception_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/director_protected_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/exception_order_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/global_ns_arg_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/grouping_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/li_boost_shared_ptr_bits_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/li_std_set_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/li_std_string_extra_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/li_std_wstring_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/member_pointer_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/primitive_types_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/python_abstractbase_runme3.py branches/gsoc2009-ashishs99/Examples/test-suite/python/python_nondynamic_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/threads_exception_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/varargs_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/r/unittest.R branches/gsoc2009-ashishs99/Examples/test-suite/rename_camel.i branches/gsoc2009-ashishs99/Examples/test-suite/restrict_cplusplus.i branches/gsoc2009-ashishs99/Examples/test-suite/return_const_value.i branches/gsoc2009-ashishs99/Examples/test-suite/rname.i branches/gsoc2009-ashishs99/Examples/test-suite/samename.i branches/gsoc2009-ashishs99/Examples/test-suite/smart_pointer_member.i branches/gsoc2009-ashishs99/Examples/test-suite/smart_pointer_not.i branches/gsoc2009-ashishs99/Examples/test-suite/smart_pointer_templatemethods.i branches/gsoc2009-ashishs99/Examples/test-suite/special_variable_macros.i branches/gsoc2009-ashishs99/Examples/test-suite/static_const_member.i branches/gsoc2009-ashishs99/Examples/test-suite/tcl/imports_runme.tcl branches/gsoc2009-ashishs99/Examples/test-suite/template_enum.i branches/gsoc2009-ashishs99/Examples/test-suite/template_inherit_abstract.i branches/gsoc2009-ashishs99/Examples/test-suite/template_methods.i branches/gsoc2009-ashishs99/Examples/test-suite/template_specialization_enum.i branches/gsoc2009-ashishs99/Examples/test-suite/typedef_mptr.i branches/gsoc2009-ashishs99/Examples/test-suite/typemap_namespace.i branches/gsoc2009-ashishs99/Examples/test-suite/typemap_out_optimal.i branches/gsoc2009-ashishs99/Examples/test-suite/typemap_subst.i branches/gsoc2009-ashishs99/Examples/test-suite/union_parameter.i branches/gsoc2009-ashishs99/Examples/test-suite/using_composition.i branches/gsoc2009-ashishs99/Examples/test-suite/using_extend.i branches/gsoc2009-ashishs99/Examples/test-suite/using_namespace.i branches/gsoc2009-ashishs99/Examples/test-suite/using_protected.i branches/gsoc2009-ashishs99/Examples/test-suite/varargs.i branches/gsoc2009-ashishs99/Examples/test-suite/virtual_poly.i branches/gsoc2009-ashishs99/Examples/test-suite/wallkw.i branches/gsoc2009-ashishs99/Examples/test-suite/wrapmacro.i branches/gsoc2009-ashishs99/LICENSE-UNIVERSITIES branches/gsoc2009-ashishs99/Lib/allkw.swg branches/gsoc2009-ashishs99/Lib/chicken/chicken.swg branches/gsoc2009-ashishs99/Lib/csharp/std_map.i branches/gsoc2009-ashishs99/Lib/csharp/typemaps.i branches/gsoc2009-ashishs99/Lib/csharp/wchar.i branches/gsoc2009-ashishs99/Lib/exception.i branches/gsoc2009-ashishs99/Lib/guile/typemaps.i branches/gsoc2009-ashishs99/Lib/java/java.swg branches/gsoc2009-ashishs99/Lib/java/typemaps.i branches/gsoc2009-ashishs99/Lib/lua/lua.swg branches/gsoc2009-ashishs99/Lib/lua/luatypemaps.swg branches/gsoc2009-ashishs99/Lib/lua/typemaps.i branches/gsoc2009-ashishs99/Lib/ocaml/std_string.i branches/gsoc2009-ashishs99/Lib/ocaml/swigp4.ml.in branches/gsoc2009-ashishs99/Lib/ocaml/typemaps.i branches/gsoc2009-ashishs99/Lib/octave/octcomplex.swg branches/gsoc2009-ashishs99/Lib/octave/octcontainer.swg branches/gsoc2009-ashishs99/Lib/octave/octrun.swg branches/gsoc2009-ashishs99/Lib/octave/octruntime.swg branches/gsoc2009-ashishs99/Lib/octave/octtypemaps.swg branches/gsoc2009-ashishs99/Lib/perl5/noembed.h branches/gsoc2009-ashishs99/Lib/perl5/perlprimtypes.swg branches/gsoc2009-ashishs99/Lib/perl5/perlrun.swg branches/gsoc2009-ashishs99/Lib/perl5/reference.i branches/gsoc2009-ashishs99/Lib/php/director.swg branches/gsoc2009-ashishs99/Lib/php/globalvar.i branches/gsoc2009-ashishs99/Lib/php/php.swg branches/gsoc2009-ashishs99/Lib/php/phpinit.swg branches/gsoc2009-ashishs99/Lib/php/phprun.swg branches/gsoc2009-ashishs99/Lib/php/typemaps.i branches/gsoc2009-ashishs99/Lib/pike/pike.swg branches/gsoc2009-ashishs99/Lib/python/boost_shared_ptr.i branches/gsoc2009-ashishs99/Lib/python/carrays.i branches/gsoc2009-ashishs99/Lib/python/director.swg branches/gsoc2009-ashishs99/Lib/python/pyapi.swg branches/gsoc2009-ashishs99/Lib/python/pyclasses.swg branches/gsoc2009-ashishs99/Lib/python/pycontainer.swg branches/gsoc2009-ashishs99/Lib/python/pyhead.swg branches/gsoc2009-ashishs99/Lib/python/pyinit.swg branches/gsoc2009-ashishs99/Lib/python/pyiterators.swg branches/gsoc2009-ashishs99/Lib/python/pyopers.swg branches/gsoc2009-ashishs99/Lib/python/pyrun.swg branches/gsoc2009-ashishs99/Lib/python/pyruntime.swg branches/gsoc2009-ashishs99/Lib/python/pystdcommon.swg branches/gsoc2009-ashishs99/Lib/python/pystrings.swg branches/gsoc2009-ashishs99/Lib/python/pythonkw.swg branches/gsoc2009-ashishs99/Lib/python/pytypemaps.swg branches/gsoc2009-ashishs99/Lib/python/pywstrings.swg branches/gsoc2009-ashishs99/Lib/python/std_map.i branches/gsoc2009-ashishs99/Lib/python/std_multimap.i branches/gsoc2009-ashishs99/Lib/python/std_pair.i branches/gsoc2009-ashishs99/Lib/r/rfragments.swg branches/gsoc2009-ashishs99/Lib/ruby/rubyclasses.swg branches/gsoc2009-ashishs99/Lib/ruby/rubycontainer.swg branches/gsoc2009-ashishs99/Lib/ruby/rubyerrors.swg branches/gsoc2009-ashishs99/Lib/ruby/rubyiterators.swg branches/gsoc2009-ashishs99/Lib/ruby/rubystdcommon.swg branches/gsoc2009-ashishs99/Lib/ruby/rubystdfunctors.swg branches/gsoc2009-ashishs99/Lib/ruby/timeval.i branches/gsoc2009-ashishs99/Lib/std/std_common.i branches/gsoc2009-ashishs99/Lib/std/std_container.i branches/gsoc2009-ashishs99/Lib/std_except.i branches/gsoc2009-ashishs99/Lib/swig.swg branches/gsoc2009-ashishs99/Lib/swigrun.swg branches/gsoc2009-ashishs99/Lib/tcl/tclapi.swg branches/gsoc2009-ashishs99/Lib/tcl/tclinit.swg branches/gsoc2009-ashishs99/Lib/tcl/tclrun.swg branches/gsoc2009-ashishs99/Lib/typemaps/std_strings.swg branches/gsoc2009-ashishs99/Lib/typemaps/strings.swg branches/gsoc2009-ashishs99/Lib/typemaps/swigtype.swg branches/gsoc2009-ashishs99/Makefile.in branches/gsoc2009-ashishs99/README branches/gsoc2009-ashishs99/RELEASENOTES branches/gsoc2009-ashishs99/Source/CParse/cscanner.c branches/gsoc2009-ashishs99/Source/CParse/parser.y branches/gsoc2009-ashishs99/Source/DOH/base.c branches/gsoc2009-ashishs99/Source/DOH/doh.h branches/gsoc2009-ashishs99/Source/DOH/dohint.h branches/gsoc2009-ashishs99/Source/DOH/file.c branches/gsoc2009-ashishs99/Source/DOH/hash.c branches/gsoc2009-ashishs99/Source/DOH/list.c branches/gsoc2009-ashishs99/Source/DOH/string.c branches/gsoc2009-ashishs99/Source/Include/swigwarn.h branches/gsoc2009-ashishs99/Source/Makefile.am branches/gsoc2009-ashishs99/Source/Modules/allegrocl.cxx branches/gsoc2009-ashishs99/Source/Modules/allocate.cxx branches/gsoc2009-ashishs99/Source/Modules/cffi.cxx branches/gsoc2009-ashishs99/Source/Modules/chicken.cxx branches/gsoc2009-ashishs99/Source/Modules/clisp.cxx branches/gsoc2009-ashishs99/Source/Modules/csharp.cxx branches/gsoc2009-ashishs99/Source/Modules/emit.cxx branches/gsoc2009-ashishs99/Source/Modules/guile.cxx branches/gsoc2009-ashishs99/Source/Modules/java.cxx branches/gsoc2009-ashishs99/Source/Modules/lang.cxx branches/gsoc2009-ashishs99/Source/Modules/lua.cxx branches/gsoc2009-ashishs99/Source/Modules/main.cxx branches/gsoc2009-ashishs99/Source/Modules/modula3.cxx branches/gsoc2009-ashishs99/Source/Modules/mzscheme.cxx branches/gsoc2009-ashishs99/Source/Modules/ocaml.cxx branches/gsoc2009-ashishs99/Source/Modules/octave.cxx branches/gsoc2009-ashishs99/Source/Modules/overload.cxx branches/gsoc2009-ashishs99/Source/Modules/perl5.cxx branches/gsoc2009-ashishs99/Source/Modules/php.cxx branches/gsoc2009-ashishs99/Source/Modules/pike.cxx branches/gsoc2009-ashishs99/Source/Modules/python.cxx branches/gsoc2009-ashishs99/Source/Modules/r.cxx branches/gsoc2009-ashishs99/Source/Modules/ruby.cxx branches/gsoc2009-ashishs99/Source/Modules/swigmain.cxx branches/gsoc2009-ashishs99/Source/Modules/swigmod.h branches/gsoc2009-ashishs99/Source/Modules/tcl8.cxx branches/gsoc2009-ashishs99/Source/Modules/typepass.cxx branches/gsoc2009-ashishs99/Source/Modules/uffi.cxx branches/gsoc2009-ashishs99/Source/Modules/utils.cxx branches/gsoc2009-ashishs99/Source/Preprocessor/cpp.c branches/gsoc2009-ashishs99/Source/Swig/cwrap.c branches/gsoc2009-ashishs99/Source/Swig/deprecate.c branches/gsoc2009-ashishs99/Source/Swig/error.c branches/gsoc2009-ashishs99/Source/Swig/include.c branches/gsoc2009-ashishs99/Source/Swig/misc.c branches/gsoc2009-ashishs99/Source/Swig/naming.c branches/gsoc2009-ashishs99/Source/Swig/scanner.c branches/gsoc2009-ashishs99/Source/Swig/stype.c branches/gsoc2009-ashishs99/Source/Swig/swig.h branches/gsoc2009-ashishs99/Source/Swig/swigscan.h branches/gsoc2009-ashishs99/Source/Swig/symbol.c branches/gsoc2009-ashishs99/Source/Swig/tree.c branches/gsoc2009-ashishs99/Source/Swig/typemap.c branches/gsoc2009-ashishs99/Source/Swig/typeobj.c branches/gsoc2009-ashishs99/Source/Swig/typesys.c branches/gsoc2009-ashishs99/Tools/mkrelease.py branches/gsoc2009-ashishs99/Tools/mkwindows.sh branches/gsoc2009-ashishs99/configure.in Added Paths: ----------- branches/gsoc2009-ashishs99/Doc/Manual/D.html branches/gsoc2009-ashishs99/Doc/Manual/Go.html branches/gsoc2009-ashishs99/Doc/Manual/linkchecker.config branches/gsoc2009-ashishs99/Examples/d/ branches/gsoc2009-ashishs99/Examples/d/callback/ branches/gsoc2009-ashishs99/Examples/d/callback/Makefile branches/gsoc2009-ashishs99/Examples/d/callback/d1/ branches/gsoc2009-ashishs99/Examples/d/callback/d1/runme.d branches/gsoc2009-ashishs99/Examples/d/callback/d2/ branches/gsoc2009-ashishs99/Examples/d/callback/d2/runme.d branches/gsoc2009-ashishs99/Examples/d/callback/example.cxx branches/gsoc2009-ashishs99/Examples/d/callback/example.h branches/gsoc2009-ashishs99/Examples/d/callback/example.i branches/gsoc2009-ashishs99/Examples/d/check.list branches/gsoc2009-ashishs99/Examples/d/class/ branches/gsoc2009-ashishs99/Examples/d/class/Makefile branches/gsoc2009-ashishs99/Examples/d/class/d1/ branches/gsoc2009-ashishs99/Examples/d/class/d1/runme.d branches/gsoc2009-ashishs99/Examples/d/class/d2/ branches/gsoc2009-ashishs99/Examples/d/class/d2/runme.d branches/gsoc2009-ashishs99/Examples/d/class/example.cxx branches/gsoc2009-ashishs99/Examples/d/class/example.h branches/gsoc2009-ashishs99/Examples/d/class/example.i branches/gsoc2009-ashishs99/Examples/d/constants/ branches/gsoc2009-ashishs99/Examples/d/constants/Makefile branches/gsoc2009-ashishs99/Examples/d/constants/d1/ branches/gsoc2009-ashishs99/Examples/d/constants/d1/runme.d branches/gsoc2009-ashishs99/Examples/d/constants/d2/ branches/gsoc2009-ashishs99/Examples/d/constants/d2/runme.d branches/gsoc2009-ashishs99/Examples/d/constants/example.d branches/gsoc2009-ashishs99/Examples/d/constants/example.i branches/gsoc2009-ashishs99/Examples/d/enum/ branches/gsoc2009-ashishs99/Examples/d/enum/Makefile branches/gsoc2009-ashishs99/Examples/d/enum/d1/ branches/gsoc2009-ashishs99/Examples/d/enum/d1/runme.d branches/gsoc2009-ashishs99/Examples/d/enum/d2/ branches/gsoc2009-ashishs99/Examples/d/enum/d2/runme.d branches/gsoc2009-ashishs99/Examples/d/enum/example.cxx branches/gsoc2009-ashishs99/Examples/d/enum/example.h branches/gsoc2009-ashishs99/Examples/d/enum/example.i branches/gsoc2009-ashishs99/Examples/d/extend/ branches/gsoc2009-ashishs99/Examples/d/extend/Makefile branches/gsoc2009-ashishs99/Examples/d/extend/d1/ branches/gsoc2009-ashishs99/Examples/d/extend/d1/runme.d branches/gsoc2009-ashishs99/Examples/d/extend/d2/ branches/gsoc2009-ashishs99/Examples/d/extend/d2/runme.d branches/gsoc2009-ashishs99/Examples/d/extend/example.cxx branches/gsoc2009-ashishs99/Examples/d/extend/example.h branches/gsoc2009-ashishs99/Examples/d/extend/example.i branches/gsoc2009-ashishs99/Examples/d/funcptr/ branches/gsoc2009-ashishs99/Examples/d/funcptr/Makefile branches/gsoc2009-ashishs99/Examples/d/funcptr/d1/ branches/gsoc2009-ashishs99/Examples/d/funcptr/d1/runme.d branches/gsoc2009-ashishs99/Examples/d/funcptr/d2/ branches/gsoc2009-ashishs99/Examples/d/funcptr/d2/runme.d branches/gsoc2009-ashishs99/Examples/d/funcptr/example.c branches/gsoc2009-ashishs99/Examples/d/funcptr/example.h branches/gsoc2009-ashishs99/Examples/d/funcptr/example.i branches/gsoc2009-ashishs99/Examples/d/simple/ branches/gsoc2009-ashishs99/Examples/d/simple/Makefile branches/gsoc2009-ashishs99/Examples/d/simple/d1/ branches/gsoc2009-ashishs99/Examples/d/simple/d1/runme.d branches/gsoc2009-ashishs99/Examples/d/simple/d2/ branches/gsoc2009-ashishs99/Examples/d/simple/d2/runme.d branches/gsoc2009-ashishs99/Examples/d/simple/example.c branches/gsoc2009-ashishs99/Examples/d/simple/example.i branches/gsoc2009-ashishs99/Examples/d/variables/ branches/gsoc2009-ashishs99/Examples/d/variables/Makefile branches/gsoc2009-ashishs99/Examples/d/variables/d1/ branches/gsoc2009-ashishs99/Examples/d/variables/d1/runme.d branches/gsoc2009-ashishs99/Examples/d/variables/d2/ branches/gsoc2009-ashishs99/Examples/d/variables/d2/runme.d branches/gsoc2009-ashishs99/Examples/d/variables/example.c branches/gsoc2009-ashishs99/Examples/d/variables/example.h branches/gsoc2009-ashishs99/Examples/d/variables/example.i branches/gsoc2009-ashishs99/Examples/go/ branches/gsoc2009-ashishs99/Examples/go/callback/ branches/gsoc2009-ashishs99/Examples/go/callback/Makefile branches/gsoc2009-ashishs99/Examples/go/callback/example.cxx branches/gsoc2009-ashishs99/Examples/go/callback/example.h branches/gsoc2009-ashishs99/Examples/go/callback/example.i branches/gsoc2009-ashishs99/Examples/go/callback/index.html branches/gsoc2009-ashishs99/Examples/go/callback/runme.go branches/gsoc2009-ashishs99/Examples/go/check.list branches/gsoc2009-ashishs99/Examples/go/class/ branches/gsoc2009-ashishs99/Examples/go/class/Makefile branches/gsoc2009-ashishs99/Examples/go/class/example.cxx branches/gsoc2009-ashishs99/Examples/go/class/example.h branches/gsoc2009-ashishs99/Examples/go/class/example.i branches/gsoc2009-ashishs99/Examples/go/class/index.html branches/gsoc2009-ashishs99/Examples/go/class/runme.go branches/gsoc2009-ashishs99/Examples/go/constants/ branches/gsoc2009-ashishs99/Examples/go/constants/Makefile branches/gsoc2009-ashishs99/Examples/go/constants/example.i branches/gsoc2009-ashishs99/Examples/go/constants/index.html branches/gsoc2009-ashishs99/Examples/go/constants/runme.go branches/gsoc2009-ashishs99/Examples/go/enum/ branches/gsoc2009-ashishs99/Examples/go/enum/Makefile branches/gsoc2009-ashishs99/Examples/go/enum/example.cxx branches/gsoc2009-ashishs99/Examples/go/enum/example.h branches/gsoc2009-ashishs99/Examples/go/enum/example.i branches/gsoc2009-ashishs99/Examples/go/enum/index.html branches/gsoc2009-ashishs99/Examples/go/enum/runme.go branches/gsoc2009-ashishs99/Examples/go/extend/ branches/gsoc2009-ashishs99/Examples/go/extend/Makefile branches/gsoc2009-ashishs99/Examples/go/extend/example.cxx branches/gsoc2009-ashishs99/Examples/go/extend/example.h branches/gsoc2009-ashishs99/Examples/go/extend/example.i branches/gsoc2009-ashishs99/Examples/go/extend/index.html branches/gsoc2009-ashishs99/Examples/go/extend/runme.go branches/gsoc2009-ashishs99/Examples/go/funcptr/ branches/gsoc2009-ashishs99/Examples/go/funcptr/Makefile branches/gsoc2009-ashishs99/Examples/go/funcptr/example.c branches/gsoc2009-ashishs99/Examples/go/funcptr/example.h branches/gsoc2009-ashishs99/Examples/go/funcptr/example.i branches/gsoc2009-ashishs99/Examples/go/funcptr/index.html branches/gsoc2009-ashishs99/Examples/go/funcptr/runme.go branches/gsoc2009-ashishs99/Examples/go/index.html branches/gsoc2009-ashishs99/Examples/go/multimap/ branches/gsoc2009-ashishs99/Examples/go/multimap/Makefile branches/gsoc2009-ashishs99/Examples/go/multimap/example.c branches/gsoc2009-ashishs99/Examples/go/multimap/example.i branches/gsoc2009-ashishs99/Examples/go/multimap/runme.go branches/gsoc2009-ashishs99/Examples/go/pointer/ branches/gsoc2009-ashishs99/Examples/go/pointer/Makefile branches/gsoc2009-ashishs99/Examples/go/pointer/example.c branches/gsoc2009-ashishs99/Examples/go/pointer/example.i branches/gsoc2009-ashishs99/Examples/go/pointer/index.html branches/gsoc2009-ashishs99/Examples/go/pointer/runme.go branches/gsoc2009-ashishs99/Examples/go/reference/ branches/gsoc2009-ashishs99/Examples/go/reference/Makefile branches/gsoc2009-ashishs99/Examples/go/reference/example.cxx branches/gsoc2009-ashishs99/Examples/go/reference/example.h branches/gsoc2009-ashishs99/Examples/go/reference/example.i branches/gsoc2009-ashishs99/Examples/go/reference/index.html branches/gsoc2009-ashishs99/Examples/go/reference/runme.go branches/gsoc2009-ashishs99/Examples/go/simple/ branches/gsoc2009-ashishs99/Examples/go/simple/Makefile branches/gsoc2009-ashishs99/Examples/go/simple/example.c branches/gsoc2009-ashishs99/Examples/go/simple/example.i branches/gsoc2009-ashishs99/Examples/go/simple/index.html branches/gsoc2009-ashishs99/Examples/go/simple/runme.go branches/gsoc2009-ashishs99/Examples/go/template/ branches/gsoc2009-ashishs99/Examples/go/template/Makefile branches/gsoc2009-ashishs99/Examples/go/template/example.h branches/gsoc2009-ashishs99/Examples/go/template/example.i branches/gsoc2009-ashishs99/Examples/go/template/index.html branches/gsoc2009-ashishs99/Examples/go/template/runme.go branches/gsoc2009-ashishs99/Examples/go/variables/ branches/gsoc2009-ashishs99/Examples/go/variables/Makefile branches/gsoc2009-ashishs99/Examples/go/variables/example.c branches/gsoc2009-ashishs99/Examples/go/variables/example.h branches/gsoc2009-ashishs99/Examples/go/variables/example.i branches/gsoc2009-ashishs99/Examples/go/variables/index.html branches/gsoc2009-ashishs99/Examples/go/variables/runme.go branches/gsoc2009-ashishs99/Examples/python/performance/ branches/gsoc2009-ashishs99/Examples/python/performance/Makefile branches/gsoc2009-ashishs99/Examples/python/performance/constructor/ branches/gsoc2009-ashishs99/Examples/python/performance/constructor/Makefile branches/gsoc2009-ashishs99/Examples/python/performance/constructor/Simple.i branches/gsoc2009-ashishs99/Examples/python/performance/constructor/runme.py branches/gsoc2009-ashishs99/Examples/python/performance/func/ branches/gsoc2009-ashishs99/Examples/python/performance/func/Makefile branches/gsoc2009-ashishs99/Examples/python/performance/func/Simple.i branches/gsoc2009-ashishs99/Examples/python/performance/func/runme.py branches/gsoc2009-ashishs99/Examples/python/performance/harness.py branches/gsoc2009-ashishs99/Examples/python/performance/hierarchy/ branches/gsoc2009-ashishs99/Examples/python/performance/hierarchy/Makefile branches/gsoc2009-ashishs99/Examples/python/performance/hierarchy/Simple.i branches/gsoc2009-ashishs99/Examples/python/performance/hierarchy/runme.py branches/gsoc2009-ashishs99/Examples/python/performance/hierarchy_operator/ branches/gsoc2009-ashishs99/Examples/python/performance/hierarchy_operator/Makefile branches/gsoc2009-ashishs99/Examples/python/performance/hierarchy_operator/Simple.i branches/gsoc2009-ashishs99/Examples/python/performance/hierarchy_operator/runme.py branches/gsoc2009-ashishs99/Examples/python/performance/operator/ branches/gsoc2009-ashishs99/Examples/python/performance/operator/Makefile branches/gsoc2009-ashishs99/Examples/python/performance/operator/Simple.i branches/gsoc2009-ashishs99/Examples/python/performance/operator/runme.py branches/gsoc2009-ashishs99/Examples/test-suite/char_binary.i branches/gsoc2009-ashishs99/Examples/test-suite/csharp/director_alternating_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/friends_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/rename_pcre_encoder_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/rename_pcre_enum_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/rename_simple_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/d/ branches/gsoc2009-ashishs99/Examples/test-suite/d/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/d/README branches/gsoc2009-ashishs99/Examples/test-suite/d/aggregate_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/aggregate_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/allprotected_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/allprotected_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/apply_strings_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/apply_strings_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/bools_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/bools_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/catches_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/catches_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/char_strings_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/char_strings_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/constover_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/constover_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/d_nativepointers_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/d_nativepointers_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/default_args_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/default_args_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/default_constructor_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/default_constructor_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_alternating_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_alternating_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_basic_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_basic_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_classes_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_classes_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_classic_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_classic_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_ignore_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_ignore_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_primitives_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_primitives_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_protected_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_protected_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_string_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_string_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/enum_thorough_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/enum_thorough_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/inherit_target_language_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/inherit_target_language_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_attribute_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_attribute_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_boost_shared_ptr_bits_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_boost_shared_ptr_bits_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_boost_shared_ptr_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_boost_shared_ptr_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_std_except_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_std_except_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_std_string_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_std_string_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_std_vector_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_std_vector_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_typemaps_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_typemaps_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/long_long_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/long_long_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/member_pointer_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/member_pointer_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/nspace_extend_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/nspace_extend_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/nspace_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/nspace_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/operator_overload_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/operator_overload_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/overload_complicated_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/overload_complicated_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/overload_template_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/overload_template_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/pointer_reference_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/pointer_reference_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/preproc_constants_c_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/preproc_constants_c_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/preproc_constants_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/preproc_constants_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/sizet_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/sizet_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/sneaky1_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/sneaky1_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/special_variable_macros_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/special_variable_macros_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/threads_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/threads_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/throw_exception_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/throw_exception_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/typemap_namespace_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/typemap_namespace_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/typemap_out_optimal_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/typemap_out_optimal_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/varargs_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/varargs_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/virtual_poly_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/virtual_poly_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d_exception_name.i branches/gsoc2009-ashishs99/Examples/test-suite/d_nativepointers.i branches/gsoc2009-ashishs99/Examples/test-suite/default_arg_values.i branches/gsoc2009-ashishs99/Examples/test-suite/director_alternating.i branches/gsoc2009-ashishs99/Examples/test-suite/director_keywords.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/cpp_inherit.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/cpp_macro_locator.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/cpp_overload_const.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/cpp_recursive_typedef.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/cpp_shared_ptr.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/expected.log branches/gsoc2009-ashishs99/Examples/test-suite/errors/pp_constant.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/pp_deprecated.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/pp_illegal_argument.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/pp_macro_defined_unterminated.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/pp_macro_expansion.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/pp_macro_expansion_multiline.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/pp_macro_inline_unterminated.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/pp_macro_missing_expression.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/pp_macro_unexpected_tokens.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/pp_pragma.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/pp_variable_args.i branches/gsoc2009-ashishs99/Examples/test-suite/funcptr_cpp.i branches/gsoc2009-ashishs99/Examples/test-suite/go/ branches/gsoc2009-ashishs99/Examples/test-suite/go/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/go/abstract_access_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/abstract_typedef2_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/abstract_typedef_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/abstract_virtual_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/array_member_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/arrays_global_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/char_binary_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/class_ignore_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/class_scope_weird_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/compactdefaultargs_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/constover_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/constructor_copy_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/contract_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/cpp_enum_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/cpp_namespace_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/cpp_static_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/default_args_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/default_constructor_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_abstract_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_alternating_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_basic_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_classic_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_default_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_detect_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_enum_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_exception_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_extend_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_finalizer_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_frob_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_nested_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_profile_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_protected_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_string_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_thread_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_unroll_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/disown_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/dynamic_cast_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/empty_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/enum_template_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/enums_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/exception_order_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/extend_placement_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/extend_template_ns_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/extend_template_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/extend_variable_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/extern_c_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/friends_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/fvirtual_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/global_ns_arg_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/grouping_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/import_nomodule_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/imports_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/inctest_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/inherit_missing_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/input_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/keyword_rename_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/li_attribute_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/li_carrays_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/li_cdata_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/li_cmalloc_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/li_cpointer_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/li_std_map_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/li_std_vector_ptr_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/member_pointer_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/memberin_extend_c_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/minherit_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/mod_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/multi_import_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/namespace_class_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/namespace_typemap_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/namespace_virtual_method_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/naturalvar_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/nested_workaround_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_complicated_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_copy_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_extend_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_extendc_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_rename_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_simple_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_subtype_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_template_fast_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_template_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/preproc_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/primitive_ref_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/profiletest_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/refcount_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/reference_global_vars_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/rename_scope_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/rename_simple_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/rename_strip_encoder_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/ret_by_value_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/return_const_value_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/smart_pointer_extend_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/smart_pointer_member_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/smart_pointer_multi_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/smart_pointer_multi_typedef_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/smart_pointer_overload_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/smart_pointer_rename_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/smart_pointer_simple_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/smart_pointer_templatevariables_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/smart_pointer_typedef_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/sneaky1_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/special_variable_macros_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/static_const_member_2_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/struct_initialization_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/struct_rename_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/struct_value_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_default_arg_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_extend1_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_extend2_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_inherit_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_ns4_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_ns_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_opaque_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_ref_type_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_rename_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_static_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_tbase_template_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_type_namespace_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_typedef_cplx3_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_typedef_cplx4_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_typedef_import_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/threads_exception_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/typedef_class_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/typedef_inherit_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/typedef_scope_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/typemap_namespace_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/typemap_ns_using_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/typemap_out_optimal_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/typename_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/unions_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/using1_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/using2_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/using_composition_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/using_extend_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/using_inherit_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/using_private_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/using_protected_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/varargs_overload_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/varargs_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/virtual_derivation_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/virtual_poly_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/voidtest_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/wrapmacro_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/immutable_values.i branches/gsoc2009-ashishs99/Examples/test-suite/import_stl.list branches/gsoc2009-ashishs99/Examples/test-suite/import_stl_a.i branches/gsoc2009-ashishs99/Examples/test-suite/import_stl_b.i branches/gsoc2009-ashishs99/Examples/test-suite/java/char_binary_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/friends_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/preproc_line_file_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/rename_pcre_encoder_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/rename_pcre_enum_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/smart_pointer_const_overload_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/typemap_arrays_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/li_std_map_member.i branches/gsoc2009-ashishs99/Examples/test-suite/li_typemaps_apply.i branches/gsoc2009-ashishs99/Examples/test-suite/member_funcptr_galore.i branches/gsoc2009-ashishs99/Examples/test-suite/octave/preproc_constants_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/octave/samename_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/operator_pointer_ref.i branches/gsoc2009-ashishs99/Examples/test-suite/overload_return_type.i branches/gsoc2009-ashishs99/Examples/test-suite/perl5/char_binary_runme.pl branches/gsoc2009-ashishs99/Examples/test-suite/php/overload_return_type_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/preproc_defined.i branches/gsoc2009-ashishs99/Examples/test-suite/preproc_include.i branches/gsoc2009-ashishs99/Examples/test-suite/preproc_include_a.h branches/gsoc2009-ashishs99/Examples/test-suite/preproc_include_b.h branches/gsoc2009-ashishs99/Examples/test-suite/preproc_include_c.h branches/gsoc2009-ashishs99/Examples/test-suite/preproc_include_d withspace.h branches/gsoc2009-ashishs99/Examples/test-suite/preproc_include_e withspace.h branches/gsoc2009-ashishs99/Examples/test-suite/preproc_include_f withspace.h branches/gsoc2009-ashishs99/Examples/test-suite/preproc_include_g.h branches/gsoc2009-ashishs99/Examples/test-suite/preproc_line_file.i branches/gsoc2009-ashishs99/Examples/test-suite/python/char_binary_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/default_arg_values_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/director_alternating_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/funcptr_cpp_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/global_namespace_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/import_stl_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/li_std_map_member_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/pointer_reference_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/preproc_defined_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/preproc_include_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/python_richcompare_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/python_varargs_typemap_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/rename_pcre_encoder_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/smart_pointer_const_overload_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/typemap_arrays_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/varargs_overload_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python_richcompare.i branches/gsoc2009-ashishs99/Examples/test-suite/python_varargs_typemap.i branches/gsoc2009-ashishs99/Examples/test-suite/r/rename_simple_runme.R branches/gsoc2009-ashishs99/Examples/test-suite/rename_pcre_encoder.i branches/gsoc2009-ashishs99/Examples/test-suite/rename_pcre_enum.i branches/gsoc2009-ashishs99/Examples/test-suite/rename_simple.i branches/gsoc2009-ashishs99/Examples/test-suite/smart_pointer_const_overload.i branches/gsoc2009-ashishs99/Examples/test-suite/smart_pointer_template_const_overload.i branches/gsoc2009-ashishs99/Examples/test-suite/tcl/null_pointer_runme.tcl branches/gsoc2009-ashishs99/Examples/test-suite/template_basic.i branches/gsoc2009-ashishs99/Examples/test-suite/typemap_arrays.i branches/gsoc2009-ashishs99/Examples/test-suite/using_namespace_loop.i branches/gsoc2009-ashishs99/Examples/test-suite/varargs_overload.i branches/gsoc2009-ashishs99/Lib/d/ branches/gsoc2009-ashishs99/Lib/d/boost_shared_ptr.i branches/gsoc2009-ashishs99/Lib/d/carrays.i branches/gsoc2009-ashishs99/Lib/d/cpointer.i branches/gsoc2009-ashishs99/Lib/d/d.swg branches/gsoc2009-ashishs99/Lib/d/dclassgen.swg branches/gsoc2009-ashishs99/Lib/d/ddirectives.swg branches/gsoc2009-ashishs99/Lib/d/denums.swg branches/gsoc2009-ashishs99/Lib/d/dexception.swg branches/gsoc2009-ashishs99/Lib/d/dhead.swg branches/gsoc2009-ashishs99/Lib/d/director.swg branches/gsoc2009-ashishs99/Lib/d/dkw.swg branches/gsoc2009-ashishs99/Lib/d/dmemberfunctionpointers.swg branches/gsoc2009-ashishs99/Lib/d/doperators.swg branches/gsoc2009-ashishs99/Lib/d/dprimitives.swg branches/gsoc2009-ashishs99/Lib/d/dstrings.swg branches/gsoc2009-ashishs99/Lib/d/dswigtype.swg branches/gsoc2009-ashishs99/Lib/d/dvoid.swg branches/gsoc2009-ashishs99/Lib/d/std_common.i branches/gsoc2009-ashishs99/Lib/d/std_deque.i branches/gsoc2009-ashishs99/Lib/d/std_except.i branches/gsoc2009-ashishs99/Lib/d/std_map.i branches/gsoc2009-ashishs99/Lib/d/std_pair.i branches/gsoc2009-ashishs99/Lib/d/std_shared_ptr.i branches/gsoc2009-ashishs99/Lib/d/std_string.i branches/gsoc2009-ashishs99/Lib/d/std_vector.i branches/gsoc2009-ashishs99/Lib/d/stl.i branches/gsoc2009-ashishs99/Lib/d/typemaps.i branches/gsoc2009-ashishs99/Lib/d/wrapperloader.swg branches/gsoc2009-ashishs99/Lib/go/ branches/gsoc2009-ashishs99/Lib/go/cdata.i branches/gsoc2009-ashishs99/Lib/go/exception.i branches/gsoc2009-ashishs99/Lib/go/go.swg branches/gsoc2009-ashishs99/Lib/go/gokw.swg branches/gsoc2009-ashishs99/Lib/go/goruntime.swg branches/gsoc2009-ashishs99/Lib/go/std_common.i branches/gsoc2009-ashishs99/Lib/go/std_deque.i branches/gsoc2009-ashishs99/Lib/go/std_except.i branches/gsoc2009-ashishs99/Lib/go/std_map.i branches/gsoc2009-ashishs99/Lib/go/std_pair.i branches/gsoc2009-ashishs99/Lib/go/std_string.i branches/gsoc2009-ashishs99/Lib/go/std_vector.i branches/gsoc2009-ashishs99/Lib/go/stl.i branches/gsoc2009-ashishs99/Lib/go/typemaps.i branches/gsoc2009-ashishs99/Lib/python/builtin.swg branches/gsoc2009-ashishs99/Source/Modules/d.cxx branches/gsoc2009-ashishs99/Source/Modules/go.cxx branches/gsoc2009-ashishs99/Tools/config/ax_boost_base.m4 branches/gsoc2009-ashishs99/Tools/config/ax_compare_version.m4 branches/gsoc2009-ashishs99/Tools/config/ax_path_generic.m4 branches/gsoc2009-ashishs99/Tools/pcre-build.sh branches/gsoc2009-ashishs99/Tools/swig.gdb Removed Paths: ------------- branches/gsoc2009-ashishs99/Examples/d/callback/ branches/gsoc2009-ashishs99/Examples/d/callback/Makefile branches/gsoc2009-ashishs99/Examples/d/callback/d1/ branches/gsoc2009-ashishs99/Examples/d/callback/d1/runme.d branches/gsoc2009-ashishs99/Examples/d/callback/d2/ branches/gsoc2009-ashishs99/Examples/d/callback/d2/runme.d branches/gsoc2009-ashishs99/Examples/d/callback/example.cxx branches/gsoc2009-ashishs99/Examples/d/callback/example.h branches/gsoc2009-ashishs99/Examples/d/callback/example.i branches/gsoc2009-ashishs99/Examples/d/check.list branches/gsoc2009-ashishs99/Examples/d/class/ branches/gsoc2009-ashishs99/Examples/d/class/Makefile branches/gsoc2009-ashishs99/Examples/d/class/d1/ branches/gsoc2009-ashishs99/Examples/d/class/d1/runme.d branches/gsoc2009-ashishs99/Examples/d/class/d2/ branches/gsoc2009-ashishs99/Examples/d/class/d2/runme.d branches/gsoc2009-ashishs99/Examples/d/class/example.cxx branches/gsoc2009-ashishs99/Examples/d/class/example.h branches/gsoc2009-ashishs99/Examples/d/class/example.i branches/gsoc2009-ashishs99/Examples/d/constants/ branches/gsoc2009-ashishs99/Examples/d/constants/Makefile branches/gsoc2009-ashishs99/Examples/d/constants/d1/ branches/gsoc2009-ashishs99/Examples/d/constants/d1/runme.d branches/gsoc2009-ashishs99/Examples/d/constants/d2/ branches/gsoc2009-ashishs99/Examples/d/constants/d2/runme.d branches/gsoc2009-ashishs99/Examples/d/constants/example.d branches/gsoc2009-ashishs99/Examples/d/constants/example.i branches/gsoc2009-ashishs99/Examples/d/enum/ branches/gsoc2009-ashishs99/Examples/d/enum/Makefile branches/gsoc2009-ashishs99/Examples/d/enum/d1/ branches/gsoc2009-ashishs99/Examples/d/enum/d1/runme.d branches/gsoc2009-ashishs99/Examples/d/enum/d2/ branches/gsoc2009-ashishs99/Examples/d/enum/d2/runme.d branches/gsoc2009-ashishs99/Examples/d/enum/example.cxx branches/gsoc2009-ashishs99/Examples/d/enum/example.h branches/gsoc2009-ashishs99/Examples/d/enum/example.i branches/gsoc2009-ashishs99/Examples/d/extend/ branches/gsoc2009-ashishs99/Examples/d/extend/Makefile branches/gsoc2009-ashishs99/Examples/d/extend/d1/ branches/gsoc2009-ashishs99/Examples/d/extend/d1/runme.d branches/gsoc2009-ashishs99/Examples/d/extend/d2/ branches/gsoc2009-ashishs99/Examples/d/extend/d2/runme.d branches/gsoc2009-ashishs99/Examples/d/extend/example.cxx branches/gsoc2009-ashishs99/Examples/d/extend/example.h branches/gsoc2009-ashishs99/Examples/d/extend/example.i branches/gsoc2009-ashishs99/Examples/d/funcptr/ branches/gsoc2009-ashishs99/Examples/d/funcptr/Makefile branches/gsoc2009-ashishs99/Examples/d/funcptr/d1/ branches/gsoc2009-ashishs99/Examples/d/funcptr/d1/runme.d branches/gsoc2009-ashishs99/Examples/d/funcptr/d2/ branches/gsoc2009-ashishs99/Examples/d/funcptr/d2/runme.d branches/gsoc2009-ashishs99/Examples/d/funcptr/example.c branches/gsoc2009-ashishs99/Examples/d/funcptr/example.h branches/gsoc2009-ashishs99/Examples/d/funcptr/example.i branches/gsoc2009-ashishs99/Examples/d/simple/ branches/gsoc2009-ashishs99/Examples/d/simple/Makefile branches/gsoc2009-ashishs99/Examples/d/simple/d1/ branches/gsoc2009-ashishs99/Examples/d/simple/d1/runme.d branches/gsoc2009-ashishs99/Examples/d/simple/d2/ branches/gsoc2009-ashishs99/Examples/d/simple/d2/runme.d branches/gsoc2009-ashishs99/Examples/d/simple/example.c branches/gsoc2009-ashishs99/Examples/d/simple/example.i branches/gsoc2009-ashishs99/Examples/d/variables/ branches/gsoc2009-ashishs99/Examples/d/variables/Makefile branches/gsoc2009-ashishs99/Examples/d/variables/d1/ branches/gsoc2009-ashishs99/Examples/d/variables/d1/runme.d branches/gsoc2009-ashishs99/Examples/d/variables/d2/ branches/gsoc2009-ashishs99/Examples/d/variables/d2/runme.d branches/gsoc2009-ashishs99/Examples/d/variables/example.c branches/gsoc2009-ashishs99/Examples/d/variables/example.h branches/gsoc2009-ashishs99/Examples/d/variables/example.i branches/gsoc2009-ashishs99/Examples/go/callback/ branches/gsoc2009-ashishs99/Examples/go/callback/Makefile branches/gsoc2009-ashishs99/Examples/go/callback/example.cxx branches/gsoc2009-ashishs99/Examples/go/callback/example.h branches/gsoc2009-ashishs99/Examples/go/callback/example.i branches/gsoc2009-ashishs99/Examples/go/callback/index.html branches/gsoc2009-ashishs99/Examples/go/callback/runme.go branches/gsoc2009-ashishs99/Examples/go/check.list branches/gsoc2009-ashishs99/Examples/go/class/ branches/gsoc2009-ashishs99/Examples/go/class/Makefile branches/gsoc2009-ashishs99/Examples/go/class/example.cxx branches/gsoc2009-ashishs99/Examples/go/class/example.h branches/gsoc2009-ashishs99/Examples/go/class/example.i branches/gsoc2009-ashishs99/Examples/go/class/index.html branches/gsoc2009-ashishs99/Examples/go/class/runme.go branches/gsoc2009-ashishs99/Examples/go/constants/ branches/gsoc2009-ashishs99/Examples/go/constants/Makefile branches/gsoc2009-ashishs99/Examples/go/constants/example.i branches/gsoc2009-ashishs99/Examples/go/constants/index.html branches/gsoc2009-ashishs99/Examples/go/constants/runme.go branches/gsoc2009-ashishs99/Examples/go/enum/ branches/gsoc2009-ashishs99/Examples/go/enum/Makefile branches/gsoc2009-ashishs99/Examples/go/enum/example.cxx branches/gsoc2009-ashishs99/Examples/go/enum/example.h branches/gsoc2009-ashishs99/Examples/go/enum/example.i branches/gsoc2009-ashishs99/Examples/go/enum/index.html branches/gsoc2009-ashishs99/Examples/go/enum/runme.go branches/gsoc2009-ashishs99/Examples/go/extend/ branches/gsoc2009-ashishs99/Examples/go/extend/Makefile branches/gsoc2009-ashishs99/Examples/go/extend/example.cxx branches/gsoc2009-ashishs99/Examples/go/extend/example.h branches/gsoc2009-ashishs99/Examples/go/extend/example.i branches/gsoc2009-ashishs99/Examples/go/extend/index.html branches/gsoc2009-ashishs99/Examples/go/extend/runme.go branches/gsoc2009-ashishs99/Examples/go/funcptr/ branches/gsoc2009-ashishs99/Examples/go/funcptr/Makefile branches/gsoc2009-ashishs99/Examples/go/funcptr/example.c branches/gsoc2009-ashishs99/Examples/go/funcptr/example.h branches/gsoc2009-ashishs99/Examples/go/funcptr/example.i branches/gsoc2009-ashishs99/Examples/go/funcptr/index.html branches/gsoc2009-ashishs99/Examples/go/funcptr/runme.go branches/gsoc2009-ashishs99/Examples/go/index.html branches/gsoc2009-ashishs99/Examples/go/multimap/ branches/gsoc2009-ashishs99/Examples/go/multimap/Makefile branches/gsoc2009-ashishs99/Examples/go/multimap/example.c branches/gsoc2009-ashishs99/Examples/go/multimap/example.i branches/gsoc2009-ashishs99/Examples/go/multimap/runme.go branches/gsoc2009-ashishs99/Examples/go/pointer/ branches/gsoc2009-ashishs99/Examples/go/pointer/Makefile branches/gsoc2009-ashishs99/Examples/go/pointer/example.c branches/gsoc2009-ashishs99/Examples/go/pointer/example.i branches/gsoc2009-ashishs99/Examples/go/pointer/index.html branches/gsoc2009-ashishs99/Examples/go/pointer/runme.go branches/gsoc2009-ashishs99/Examples/go/reference/ branches/gsoc2009-ashishs99/Examples/go/reference/Makefile branches/gsoc2009-ashishs99/Examples/go/reference/example.cxx branches/gsoc2009-ashishs99/Examples/go/reference/example.h branches/gsoc2009-ashishs99/Examples/go/reference/example.i branches/gsoc2009-ashishs99/Examples/go/reference/index.html branches/gsoc2009-ashishs99/Examples/go/reference/runme.go branches/gsoc2009-ashishs99/Examples/go/simple/ branches/gsoc2009-ashishs99/Examples/go/simple/Makefile branches/gsoc2009-ashishs99/Examples/go/simple/example.c branches/gsoc2009-ashishs99/Examples/go/simple/example.i branches/gsoc2009-ashishs99/Examples/go/simple/index.html branches/gsoc2009-ashishs99/Examples/go/simple/runme.go branches/gsoc2009-ashishs99/Examples/go/template/ branches/gsoc2009-ashishs99/Examples/go/template/Makefile branches/gsoc2009-ashishs99/Examples/go/template/example.h branches/gsoc2009-ashishs99/Examples/go/template/example.i branches/gsoc2009-ashishs99/Examples/go/template/index.html branches/gsoc2009-ashishs99/Examples/go/template/runme.go branches/gsoc2009-ashishs99/Examples/go/variables/ branches/gsoc2009-ashishs99/Examples/go/variables/Makefile branches/gsoc2009-ashishs99/Examples/go/variables/example.c branches/gsoc2009-ashishs99/Examples/go/variables/example.h branches/gsoc2009-ashishs99/Examples/go/variables/example.i branches/gsoc2009-ashishs99/Examples/go/variables/index.html branches/gsoc2009-ashishs99/Examples/go/variables/runme.go branches/gsoc2009-ashishs99/Examples/python/performance/Makefile branches/gsoc2009-ashishs99/Examples/python/performance/constructor/ branches/gsoc2009-ashishs99/Examples/python/performance/constructor/Makefile branches/gsoc2009-ashishs99/Examples/python/performance/constructor/Simple.i branches/gsoc2009-ashishs99/Examples/python/performance/constructor/runme.py branches/gsoc2009-ashishs99/Examples/python/performance/func/ branches/gsoc2009-ashishs99/Examples/python/performance/func/Makefile branches/gsoc2009-ashishs99/Examples/python/performance/func/Simple.i branches/gsoc2009-ashishs99/Examples/python/performance/func/runme.py branches/gsoc2009-ashishs99/Examples/python/performance/harness.py branches/gsoc2009-ashishs99/Examples/python/performance/hierarchy/ branches/gsoc2009-ashishs99/Examples/python/performance/hierarchy/Makefile branches/gsoc2009-ashishs99/Examples/python/performance/hierarchy/Simple.i branches/gsoc2009-ashishs99/Examples/python/performance/hierarchy/runme.py branches/gsoc2009-ashishs99/Examples/python/performance/hierarchy_operator/ branches/gsoc2009-ashishs99/Examples/python/performance/hierarchy_operator/Makefile branches/gsoc2009-ashishs99/Examples/python/performance/hierarchy_operator/Simple.i branches/gsoc2009-ashishs99/Examples/python/performance/hierarchy_operator/runme.py branches/gsoc2009-ashishs99/Examples/python/performance/operator/ branches/gsoc2009-ashishs99/Examples/python/performance/operator/Makefile branches/gsoc2009-ashishs99/Examples/python/performance/operator/Simple.i branches/gsoc2009-ashishs99/Examples/python/performance/operator/runme.py branches/gsoc2009-ashishs99/Examples/test-suite/d/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/d/README branches/gsoc2009-ashishs99/Examples/test-suite/d/aggregate_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/aggregate_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/allprotected_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/allprotected_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/apply_strings_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/apply_strings_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/bools_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/bools_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/catches_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/catches_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/char_strings_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/char_strings_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/constover_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/constover_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/d_nativepointers_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/d_nativepointers_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/default_args_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/default_args_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/default_constructor_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/default_constructor_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_alternating_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_alternating_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_basic_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_basic_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_classes_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_classes_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_classic_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_classic_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_ignore_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_ignore_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_primitives_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_primitives_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_protected_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_protected_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_string_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_string_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/enum_thorough_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/enum_thorough_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/inherit_target_language_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/inherit_target_language_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_attribute_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_attribute_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_boost_shared_ptr_bits_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_boost_shared_ptr_bits_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_boost_shared_ptr_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_boost_shared_ptr_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_std_except_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_std_except_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_std_string_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_std_string_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_std_vector_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_std_vector_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_typemaps_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_typemaps_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/long_long_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/long_long_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/member_pointer_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/member_pointer_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/nspace_extend_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/nspace_extend_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/nspace_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/nspace_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/operator_overload_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/operator_overload_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/overload_complicated_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/overload_complicated_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/overload_template_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/overload_template_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/pointer_reference_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/pointer_reference_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/preproc_constants_c_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/preproc_constants_c_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/preproc_constants_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/preproc_constants_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/sizet_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/sizet_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/sneaky1_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/sneaky1_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/special_variable_macros_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/special_variable_macros_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/threads_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/threads_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/throw_exception_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/throw_exception_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/typemap_namespace_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/typemap_namespace_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/typemap_out_optimal_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/typemap_out_optimal_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/varargs_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/varargs_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/virtual_poly_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/virtual_poly_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/go/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/go/abstract_access_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/abstract_typedef2_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/abstract_typedef_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/abstract_virtual_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/array_member_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/arrays_global_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/char_binary_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/class_ignore_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/class_scope_weird_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/compactdefaultargs_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/constover_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/constructor_copy_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/contract_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/cpp_enum_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/cpp_namespace_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/cpp_static_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/default_args_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/default_constructor_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_abstract_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_alternating_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_basic_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_classic_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_default_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_detect_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_enum_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_exception_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_extend_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_finalizer_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_frob_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_nested_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_profile_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_protected_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_string_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_thread_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/director_unroll_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/disown_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/dynamic_cast_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/empty_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/enum_template_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/enums_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/exception_order_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/extend_placement_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/extend_template_ns_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/extend_template_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/extend_variable_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/extern_c_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/friends_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/fvirtual_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/global_ns_arg_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/grouping_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/import_nomodule_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/imports_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/inctest_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/inherit_missing_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/input_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/keyword_rename_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/li_attribute_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/li_carrays_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/li_cdata_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/li_cmalloc_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/li_cpointer_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/li_std_map_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/li_std_vector_ptr_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/member_pointer_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/memberin_extend_c_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/minherit_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/mod_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/multi_import_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/namespace_class_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/namespace_typemap_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/namespace_virtual_method_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/naturalvar_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/nested_workaround_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_complicated_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_copy_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_extend_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_extendc_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_rename_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_simple_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_subtype_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_template_fast_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_template_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/preproc_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/primitive_ref_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/profiletest_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/refcount_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/reference_global_vars_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/rename_scope_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/rename_simple_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/rename_strip_encoder_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/ret_by_value_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/return_const_value_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/smart_pointer_extend_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/smart_pointer_member_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/smart_pointer_multi_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/smart_pointer_multi_typedef_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/smart_pointer_overload_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/smart_pointer_rename_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/smart_pointer_simple_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/smart_pointer_templatevariables_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/smart_pointer_typedef_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/sneaky1_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/special_variable_macros_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/static_const_member_2_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/struct_initialization_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/struct_rename_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/struct_value_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_default_arg_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_extend1_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_extend2_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_inherit_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_ns4_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_ns_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_opaque_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_ref_type_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_rename_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_static_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_tbase_template_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_type_namespace_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_typedef_cplx3_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_typedef_cplx4_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_typedef_import_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/threads_exception_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/typedef_class_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/typedef_inherit_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/typedef_scope_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/typemap_namespace_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/typemap_ns_using_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/typemap_out_optimal_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/typename_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/unions_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/using1_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/using2_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/using_composition_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/using_extend_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/using_inherit_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/using_private_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/using_protected_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/varargs_overload_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/varargs_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/virtual_derivation_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/virtual_poly_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/voidtest_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/wrapmacro_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/immutable.i branches/gsoc2009-ashishs99/Examples/test-suite/octave/primitive_types_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/samename_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/template.i branches/gsoc2009-ashishs99/Lib/d/boost_shared_ptr.i branches/gsoc2009-ashishs99/Lib/d/carrays.i branches/gsoc2009-ashishs99/Lib/d/cpointer.i branches/gsoc2009-ashishs99/Lib/d/d.swg branches/gsoc2009-ashishs99/Lib/d/dclassgen.swg branches/gsoc2009-ashishs99/Lib/d/ddirectives.swg branches/gsoc2009-ashishs99/Lib/d/denums.swg branches/gsoc2009-ashishs99/Lib/d/dexception.swg branches/gsoc2009-ashishs99/Lib/d/dhead.swg branches/gsoc2009-ashishs99/Lib/d/director.swg branches/gsoc2009-ashishs99/Lib/d/dkw.swg branches/gsoc2009-ashishs99/Lib/d/dmemberfunctionpointers.swg branches/gsoc2009-ashishs99/Lib/d/doperators.swg branches/gsoc2009-ashishs99/Lib/d/dprimitives.swg branches/gsoc2009-ashishs99/Lib/d/dstrings.swg branches/gsoc2009-ashishs99/Lib/d/dswigtype.swg branches/gsoc2009-ashishs99/Lib/d/dvoid.swg branches/gsoc2009-ashishs99/Lib/d/std_common.i branches/gsoc2009-ashishs99/Lib/d/std_deque.i branches/gsoc2009-ashishs99/Lib/d/std_except.i branches/gsoc2009-ashishs99/Lib/d/std_map.i branches/gsoc2009-ashishs99/Lib/d/std_pair.i branches/gsoc2009-ashishs99/Lib/d/std_shared_ptr.i branches/gsoc2009-ashishs99/Lib/d/std_string.i branches/gsoc2009-ashishs99/Lib/d/std_vector.i branches/gsoc2009-ashishs99/Lib/d/stl.i branches/gsoc2009-ashishs99/Lib/d/typemaps.i branches/gsoc2009-ashishs99/Lib/d/wrapperloader.swg branches/gsoc2009-ashishs99/Lib/go/cdata.i branches/gsoc2009-ashishs99/Lib/go/exception.i branches/gsoc2009-ashishs99/Lib/go/go.swg branches/gsoc2009-ashishs99/Lib/go/gokw.swg branches/gsoc2009-ashishs99/Lib/go/goruntime.swg branches/gsoc2009-ashishs99/Lib/go/std_common.i branches/gsoc2009-ashishs99/Lib/go/std_deque.i branches/gsoc2009-ashishs99/Lib/go/std_except.i branches/gsoc2009-ashishs99/Lib/go/std_map.i branches/gsoc2009-ashishs99/Lib/go/std_pair.i branches/gsoc2009-ashishs99/Lib/go/std_string.i branches/gsoc2009-ashishs99/Lib/go/std_vector.i branches/gsoc2009-ashishs99/Lib/go/stl.i branches/gsoc2009-ashishs99/Lib/go/typemaps.i Property Changed: ---------------- branches/gsoc2009-ashishs99/ branches/gsoc2009-ashishs99/Examples/php/extend/ branches/gsoc2009-ashishs99/Examples/test-suite/csharp/special_variable_macros_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/java/special_variable_macros_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/li_reference.i branches/gsoc2009-ashishs99/Examples/test-suite/perl5/li_reference_runme.pl branches/gsoc2009-ashishs99/Examples/test-suite/python/ branches/gsoc2009-ashishs99/Examples/test-suite/python/iadd_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/overload_complicated_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/special_variable_macros_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/threads_exception_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/typemap_delete_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/special_variable_macros.i branches/gsoc2009-ashishs99/Examples/test-suite/threads_exception.i branches/gsoc2009-ashishs99/Examples/test-suite/typemap_delete.i branches/gsoc2009-ashishs99/LICENSE-GPL branches/gsoc2009-ashishs99/LICENSE-UNIVERSITIES Property changes on: branches/gsoc2009-ashishs99 ___________________________________________________________________ Modified: svn:mergeinfo - /branches/swig-2.0:11085-11086,11088-11089 /trunk:11208-11696,11698-12106 + /branches/swig-2.0:11085-11086,11088-11089 /branches/szager-python-builtin:12331-12595 /trunk:11208-11696,11698-12106,12108-12708 Modified: branches/gsoc2009-ashishs99/ANNOUNCE =================================================================== --- branches/gsoc2009-ashishs99/ANNOUNCE 2011-05-23 12:48:02 UTC (rev 12708) +++ branches/gsoc2009-ashishs99/ANNOUNCE 2011-05-23 22:53:10 UTC (rev 12709) @@ -1,8 +1,8 @@ -*** ANNOUNCE: SWIG 2.0.1 (in progress) *** +*** ANNOUNCE: SWIG 2.0.5 (in progress) *** http://www.swig.org -We're pleased to announce SWIG-2.0.1, the latest SWIG release. +We're pleased to announce SWIG-2.0.5, the latest SWIG release. What is SWIG? ============= @@ -10,22 +10,22 @@ SWIG is a software development tool that reads C/C++ header files and generates the wrapper code needed to make C and C++ code accessible from other languages including Perl, Python, Tcl, Ruby, PHP, Java, -Scheme (Guile, MzScheme, CHICKEN), Ocaml, Lua, Pike, C#, Modula-3, Octave, R, -Common Lisp (CLISP, Allegro CL, CFFI, UFFI). SWIG can also export its parse -tree in the form of XML and Lisp s-expressions. Major applications of -SWIG include generation of scripting language extension modules, rapid -prototyping, testing, and user interface development for large C/C++ -systems. +Scheme (Guile, MzScheme, CHICKEN), D, Ocaml, Lua, Pike, C#, Modula-3, +Octave, R, Common Lisp (CLISP, Allegro CL, CFFI, UFFI). SWIG can also +export its parse tree in the form of XML and Lisp s-expressions. Major +applications of SWIG include generation of scripting language extension +modules, rapid prototyping, testing, and user interface development for +large C/C++ systems. Availability ============ The release is available for download on Sourceforge at - http://prdownloads.sourceforge.net/swig/swig-2.0.1.tar.gz + http://prdownloads.sourceforge.net/swig/swig-2.0.5.tar.gz A Windows version is also available at - http://prdownloads.sourceforge.net/swig/swigwin-2.0.1.zip + http://prdownloads.sourceforge.net/swig/swigwin-2.0.5.zip Please report problems with this release to the swig-devel mailing list, details at http://www.swig.org/mail.html. Modified: branches/gsoc2009-ashishs99/CHANGES =================================================================== --- branches/gsoc2009-ashishs99/CHANGES 2011-05-23 12:48:02 UTC (rev 12708) +++ branches/gsoc2009-ashishs99/CHANGES 2011-05-23 22:53:10 UTC (rev 12709) @@ -3,6 +3,546 @@ See the CHANGES.current file for changes in the current version. See the RELEASENOTES file for a summary of changes in each release. +Version 2.0.4 (21 May 2011) +=========================== +2011-05-19: wsfulton + [Guile] Patch #3191625 fixing overloading of integer types. + +2011-05-19: wsfulton + [Perl] Patch #3260265 fixing overloading of non-primitive types and integers in + Perl 5.12 and later. + +2011-05-19: wsfulton + [Ruby] Fix %import where one of the imported files %include one of the STL include + files such as std_vector.i. + +2011-05-17: wsfulton + [Java] Apply #3289851 from Alan Harder to fix memory leak in directors when checking + for pending exceptions. + +2011-05-17: wsfulton + [Tcl] Apply #3300072 from Christian Delbaere to fix multiple module loading not + always sharing variables across modules. + +2011-05-16: xavier98 + [octave] Fix an incompatibility with never versions of Octave. Case on Octave + API >= 40 to handle rename of Octave_map to octave_map. + [octave] Add support for y.__rop__(x) operators when x.__op__(y) doesn't exist. + [octave] Allow global operators to be defined by SWIG-wrapped functions. + [octave] Fix several bugs around module namespaces; add -global, -noglobal, + -globals command line options to the module. + +2011-05-14: wsfulton + %varargs when used with a numeric argument used to create an additional argument + which was intended to provide a guaranteed sentinel value. This never worked and now + the additional argument is not generated. + +2011-05-13: wsfulton + [python] Additional fixes for python3.2 support. + +2011-05-07: szager + [python] Fixed PyGetSetDescr for python3.2. + +2011-05-05: wsfulton + [Lua, Python, Tcl] C/C++ prototypes shown in error message when calling an overloaded + method with incorrect arguments improved to show always show fully qualified name + and if a const method. + + Also fixed other Lua error messages in generated code which weren't consistently + using the fully qualified C++ name - requested by Gedalia Pasternak. + +2011-04-29: szager + Bug 2635919: Convenience method to convert std::map to a python dict. + +2011-04-29: szager + [Python] Fixed bug 2811549: return non-const iterators from STL + methods begin(), end(), rbegin(), rend(). + +2011-04-25: szager + [Python] Fixed bug 1498929: Access to member fields in map elements + +2011-04-23: klickverbot + [D] nspace: Correctly generate identifiers for base classes when + not in split proxy mode. + +2011-04-13: szager + Fixed bug 3286333: infinite recursion with mutual 'using namespace' clauses. + +2011-04-12: szager + Fixed bug 1163440: vararg typemaps. + +2011-04-12: szager + Fixed bug #3285386: parse error from 'operator T*&()'. Added operator_pointer_ref + test case to demonstrate. + +2011-04-11: szager + [Python] Fixed PyVarObject_HEAD_INIT to eliminate VC++ compiler errors about + static initialization of struct members with pointers. + +2011-04-11: wsfulton + [Tcl] Apply patch #3284326 from Colin McDonald to fix some compiler warnings. + +2011-04-11: szager + [Python] Fixed PyVarObject_HEAD_INIT to eliminate VC++ compiler errors about + static initialization of struct members with pointers. + +2011-04-10: klickverbot + [D] Fixed wrapping of enums that are type char, for example: + enum { X = 'X'; } (this was already in 2.0.3 for C# and Java) + +2011-04-10: klickverbot + [D] nspace: Fixed referencing types in the root namespace when + not in split proxy mode. + +2011-04-09: szager + [Python] Applied patch #1932484: migrate PyCObject to PyCapsule. + +2011-04-09: szager + [Python] Added preprocessor guards for python functions PyUnicode_AsWideChar and + PySlice_GetIndices, which changed signatures in python3.2. + +2011-04-07: wsfulton + Fix wrapping of const array typedefs which were generating uncompileable code as + reported by Karl Wette. + +2011-04-03: szager + [Python] Fixed the behavior of %pythonnondynamic to conform to the spec in Lib/pyuserdir.swg. + +2011-04-03: szager + [Python] Merged in the szager-python-builtin branch, adding the -builtin feature + for python. The -builtin option may provide a significant performance gain + in python wrappers. For full details and limitations, refer to Doc/Manual/Python.html. + A small test suite designed to demonstrate the performance gain is in + Examples/python/performance. + +2011-04-01: wsfulton + Add in missing wrappers for friend functions for some target languages, mostly + the non-scripting languages like Java and C#. + +Version 2.0.3 (29 March 2011) +============================= + +2011-03-29: wsfulton + [R] Apply patch #3239076 from Marie White fixing strings for R >= 2.7.0 + +2011-03-29: wsfulton + [Tcl] Apply patch #3248280 from Christian Delbaere which adds better error messages when + the incorrect number or type of arguments are passed to overloaded methods. + +2011-03-29: wsfulton + [Tcl] Apply patch #3224663 from Christian Delbaere. + 1. Fix when function returns a NULL value, a "NULL" command will be created in the Tcl interpreter + and calling this command will cause a segmentation fault. + + 2. Previous implementation searches for class methods using a linear search causing performance issues + in wrappers for classes with many member functions. The patch adds a method hash table to classes and + changes method name lookup to use the hash table instead of doing a linear search. + +2011-03-26: wsfulton + [C#, Java] SF bug #3195112 - fix wrapping of enums that are type char, for example: + enum { X = 'X'; } + +2011-03-21: vadz + Allow setting PCRE_CFLAGS and PCRE_LIBS during configuration to override the values returned by + pcre-config, e.g. to allow using a static version of PCRE library. + +2011-03-17: wsfulton + [UTL] Add missing headers in generated STL wrappers to fix compilation with gcc-4.6. + +2011-03-17: wsfulton + Fix regression introduced in swig-2.0.2 where filenames with spaces were not found + when used with %include and %import. Reported by Shane Liesegang. + +2011-03-15: wsfulton + [UTL] Fix overloading when using const char[], problem reported by David Maxwell. + Similarly for char[ANY] and const char[ANY]. + +2011-03-15: wsfulton + [C#] Apply patch #3212624 fixing std::map Keys property. + +2011-03-14: olly + [PHP] Fix handling of overloaded methods/functions where some + return void and others don't - whether this worked or not depended + on the order they were encountered in (SF#3208299). + +2011-03-13: klickverbot + [D] Extended support for C++ namespaces (nspace feature). + +2011-03-12: olly + [PHP] Fix sharing of type information between multiple SWIG-wrapped + modules (SF#3202463). + +2011-03-09: wsfulton + [Python] Fix SF #3194294 - corner case bug when 'NULL' is used as the default value + for a primitive type parameter in a method declaration. + +2011-03-07: olly + [PHP] Don't use zend_error_noreturn() for cases where the function + returns void - now this issue can only matter if you have a function + or method which is directed and returns non-void. + +2011-03-06: olly + [PHP] Add casts to the typemaps for long long and unsigned long + long to avoid issues when they are used with shorter types via + %apply. + +2011-03-02: wsfulton + Templated smart pointers overloaded with both const and non const operator-> generated uncompilable + code when the pointee was a class with either public member variables or static methods. + Regression in 2.0.x reported as working in 1.3.40 by xantares on swig-user mailing list. + +Version 2.0.2 (20 February 2011) +================================ + +2011-02-19: wsfulton + [PHP] Add missing INPUT, OUTPUT and INOUT typemaps in the typemaps.i library + for primitive reference types as well as signed char * and bool *. + +2011-02-19: olly + [PHP] Address bug in PHP on some platforms/architectures which + results in zend_error_noreturn() not being available using + SWIG_ZEND_ERROR_NORETURN which defaults to zend_error_noreturn but + can be overridden when building the module by passing + -DSWIG_ZEND_ERROR_NORETURN=zend_error to the compiler. This may + result in compiler warnings, but should at least allow a module + to be built on those platforms/architectures (SF#3166423). + +2011-02-18: wsfulton + Fix #3184549 - vararg functions and function overloading when using the -fastdispatch option. + +2011-02-18: olly + [PHP] An overloaded method which can return an object or a + primitive type no longer causes SWIG to segfault. Reported by Paul + Colby in SF#3168531. + +2011-02-18: olly + [PHP] Fix invalid erase during iteration of std::map in generated + director code. Reported by Cory Bennett in SF#3175820. + +2011-02-17: wsfulton + Preprocessing now warns if extra tokens appear after #else and #end. + +2011-02-16: wsfulton + Fix #1653092 Preprocessor does not error out when #elif is missing an expression. + This and other cases of missing preprocessor expressions now result in an error. + +2011-02-14: wsfulton + [Ocaml] Apply patch #3151788 from Joel Reymont. Brings Ocaml support up to date + (ver 3.11 and 3.12), including std::string. + +2011-02-13: wsfulton + [Ruby] Apply patch #3176274 from James Masters - typecheck typemap for time_t. + +2011-02-13: wsfulton + Apply patch #3171793 from szager - protected director methods failing when -fvirtual is used. + +2011-02-13: wsfulton + Fix #1927852 - #include directives don't preprocess the file passed to it. The fix is for + #include with -importall or -includeall, %include and %import, for example: + #define FILENAME "abc.h" + %include FILENAME + +2011-02-12: wsfulton + Fix #1940536, overactive preprocessor which was expanding defined(...) outside of #if and #elif + preprocessor directives. + +2011-02-05: wsfulton + [MzScheme] SF #2942899 Add user supplied documentation to help getting started with MzScheme. + Update chapter name to MzScheme/Racket accounting for the rename of MzScheme to Racket. + +2011-02-05: wsfulton + [C#] SF #3085906 - Possible fix running test-suite on Mac OSX. + +2011-02-05: wsfulton + SF #3173367 Better information during configure about Boost prerequisite for running + the test-suite. + +2011-02-05: wsfulton + SF #3127633 Fix infinite loop in recursive typedef resolution. + +2011-02-04: wsfulton + [R] SF #3168676 Fix %rename not working for member variables and methods. + +2011-02-04: wsfulton + [clisp] SF #3148200 Fix segfault parsing nested unions. + +2011-02-01: wsfulton + [C#] Directors - a call to a method being defined in the base class, not + overridden in a subclass, but again overridden in a class derived from + the first subclass was not being dispatched correctly to the most derived class. + See director_alternating.i for an example. + +2011-02-01: wsfulton + [C#, Java] Any 'using' statements in the protected section of a class were previously + ignored with director protected (dirprot) mode. + +2011-01-30: wsfulton + Fix overloading with const pointer reference (SWIGTYPE *const&) parameters for a + number of scripting languages. + +2011-01-17: wsfulton + New warning for smart pointers if only some of the classes in the inheritance + chain are marked as smart pointer, eg, %shared_ptr should be used for all classes + in an inheritance hierarchy, so this new warning highlights code where this is + not the case. + + example.i:12: Warning 520: Base class 'A' of 'B' is not similarly marked as a smart pointer. + example.i:16: Warning 520: Derived class 'C' of 'B' is not similarly marked as a smart pointer. + +2011-01-14: wsfulton + Added some missing multi-argument typemaps: (char *STRING, size_t LENGTH) and + (char *STRING, int LENGTH). Documentation for this updated. Java patch from + Volker Grabsch. + +2011-01-11: iant + Require Go version 7077 or later. + +2010-12-30: klickverbot + [C#, D, Java] Check for collision of parameter names with target + language keywords when generating the director glue code. + + The situation in which the generated could would previously be + invalid is illustrated in the new 'director_keywords' test case. + +2010-12-23: wsfulton + [C#] Fix \$csinput special variable not being expanded for csvarin typemaps + when used for global variables. Reported by Vadim Zeitlin. + +2010-12-14: wsfulton + Fix \$basemangle expansion in array typemaps. For example if type is int *[3], + \$basemangle expands to _p_int. + +2010-12-07: iant + Check that we are using a sufficiently new version of the + 6g or 8g Go compiler during configure time. If not, disable Go. + Minimum version is now 6707. + + *** POTENTIAL INCOMPATIBILITY *** + +2010-12-06: wsfulton + Fix #3127394 - use of network paths on Windows/MSys. + +2010-11-18: klickverbot + [D] Added the D language module. + +2010-11-12: vadz + Fix handling of multiple regex-using %renames attached to the same + declaration. For example, now + + %rename("%(regex/^Set(.*)/put\\1/)s") ""; + %rename("%(regex/^Get(.*)/get\\1/)s") ""; + + works as expected whereas before only the last anonymous rename was + taken into account. + +2010-10-17: drjoe + [R] Fix failure in overloaded functions which was breaking + QuantLib-SWIG + +2010-10-14: olly + [PHP] Allow compilation on non-conforming Microsoft C++ compilers + which don't accept: return function_returning_void(); + Reported by Frank Vanden Berghen on the SWIG mailing list. + +2010-10-12: wsfulton + Fix unary scope operator (::) (global scope) regression introduced in 2.0.0, reported by + Ben Walker. The mangled symbol names were incorrect, sometimes resulting in types being + incorrectly treated as opaque types. + + Also fixes #2958781 and some other type problems due to better typedef resolution, eg + std::vector::value_type didn't resolve to T * when it should have. The mangled type + was incorrectly SWIGTYPE_std__vectorT_Test_p_std__allocatorT_Test_p_t_t__value_type and now + it is correctly SWIGTYPE_p_Test. + +Version 2.0.1 (4 October 2010) +============================== + +2010-10-03: wsfulton + Apply patch #3066958 from Mikael Johansson to fix default smart pointer + handling when the smart pointer contains both a const and non-const operator->. + +2010-10-01: wsfulton + Add -pcreversion option to display PCRE version information. + +2010-10-01: olly + [Ruby] Avoid segfault when a method node has no parentNode + (SF#3034054). + +2010-10-01: olly + [Python] Allow reinitialisation to work with an embedded Python + interpreter (patch from Jim Carroll in SF#3075178). + +2010-09-28: wsfulton + [C#] Apply patch from Tomas Dirvanauskas for std::map wrappers to avoid + throwing exceptions with normal usage of iterators. + +2010-09-27: olly + [Python] Improve error message given when a parameter of the wrong + type is passed to an overloaded method (SF#3027355). + +2010-09-25: wsfulton + Apply SF patch #3075150 - Java directors using static variables in + named namespace. + +2010-09-24: wsfulton + More file and line error/warning reporting fixes where SWIG macros + are used within {} braces (where the preprocessor expands macros), + for example macros within %inline {...} and %fragment(...) {...} + and nested structs. + +2010-09-18: wsfulton + More file and line error/warning reporting fixes for various inherited + class problems. + +2010-09-15: wsfulton + A much improved debugging of SWIG source experience is now available and + documented in the "Debugging SWIG" section in the Doc/Devel/internals.html + file, including a swig.dbg support file for the gdb debugger. + +2010-09-11: wsfulton + Fix incorrect line number reporting in errors/warnings when a macro + definition ends with '/' and it is not the end of a C comment. + +2010-09-11: wsfulton + Fix incorrect line number reporting in errors/warnings after parsing + macro invocations with parameters given over more than one line. + +2010-09-10: wsfulton + Remove extraneous extra line in preprocessed output after including files + which would sometimes lead to error/warning messages two lines after the + end of the file. + +2010-09-10: wsfulton + Fix #2149523 - Incorrect line number reporting in errors after parsing macros + containing C++ comments. + +2010-09-08: olly + [PHP] Fix handling of OUTPUT typemaps (Patch from Ryan in SF#3058394). + +2010-09-03: wsfulton + Fix erroneous line numbers in error messages for macro expansions, for example, + the error message now points to instantiation of the macro, ie the last line here: + + #define MACRO2(a, b) + + #define MACRO1(NAME) MACRO2(NAME,2,3) + + MACRO1(abc) + +2010-09-02: wsfulton + Fix line numbers in error and warning messages for preprocessor messages within + %inline, for example: + + %inline %{ + #define FOOBAR 1 + #define FOOBAR "hi" + %} + +2010-09-02: wsfulton + Fix line numbers in error and warning messages which were cumulatively one + less than they should have been after parsing each %include/%import - bug + introduced in swig-1.3.32. Also fix line numbers in error and warning messages + when new line characters appear between the %include / %import statement and + the filename. + +2010-08-30: wsfulton + Fix line number and file name reporting for some macro preprocessor warnings. + The line number of the macro argument has been corrected and the line number + of the start of the macro instead of one past the end of the macro is used. + Some examples: + file.h:11: Error: Illegal macro argument name '..' + file.h:19: Error: Macro 'DUPLICATE' redefined, + file.h:15: Error: previous definition of 'DUPLICATE'. + file.h:25: Error: Variable-length macro argument must be last parameter + file.h:32: Error: Illegal character in macro argument name + file.i:37: Error: Macro 'SIT' expects 2 arguments + +2010-08-26: wsfulton + Fix __LINE__ and __FILE__ expansion reported by Camille Gillot. Mostly this + did not work at all. Also fixes SF #2822822. + +2010-08-17: wsfulton + [Perl] Fix corner case marshalling of doubles - errno was not being correctly + set before calling strtod - patch from Justin Vallon - SF Bug #3038936. + +2010-08-17: wsfulton + Fix make distclean when some of the more obscure languages are detected by + configure - fixes from Torsten Landschoff. + +2010-07-28: wsfulton + Restore configuring out of source for the test-suite since it broke in 1.3.37. + As previously, if running 'make check-test-suite' out of source, it needs to be + done by invoking configure with a relative path. Invoking configure with an + absolute path will not work. Running the full 'make check' still needs to be + done in the source tree. + +2010-07-16: wsfulton + Fix wrapping of function pointers and member function pointers when the function + returns by reference. + +2010-07-13: vadz + Removed support for the old experimental "rxspencer" encoder and + "[not]rxsmatch" in %rename (see the 01/16/2006 entry). The new and + officially supported "regex" encoder and "[not]regexmatch" checks + should be used instead (see the two previous entries). Please + replace "%(rxspencer:[pat][subst])s" with "%(regex:/pat/subst/)s" + when upgrading. Notice that you will also need to replace the back- + references of form "@1" with the more standard "\\1" and may need to + adjust your regular expressions syntax as the new regex encoder uses + Perl-compatible syntax and not (extended) POSIX syntax as the old one. + + *** POTENTIAL INCOMPATIBILITY *** + +2010-07-13: vadz + Add "regexmatch", "regextarget" and "notregexmatch" which can be + used to apply %rename directives to the declarations matching the + specified regular expression only. The first two can be used + interchangeably, both of the %renames below do the same thing: + + %rename("\$ignore", regexmatch\$name="Old\$") ""; + %rename("\$ignore", regextarget=1) "Old\$"; + + (namely ignore the declarations having "Old" suffix). + + "notregexmatch" restricts the match to only the declarations which + do not match the regular expression, e.g. here is how to rename to + lower case versions all declarations except those consisting from + capital letters only: + + %rename("\$(lowercase)s", notregexmatch\$name="^[A-Z]+\$") ""; + +2010-07-13: vadz + Add the new "regex" encoder that can be used in %rename, e.g. + + %rename("regex:/(\\w+)_(.*)/\\2/") ""; + + to remove any alphabetical prefix from all identifiers. The syntax + of the regular expressions is Perl-like and PCRE library + (http://www.pcre.org/) is used to implement this feature but notice + that backslashes need to be escaped as usual inside C strings. + + Original patch from Torsten Landschoff. + +2010-07-08: wsfulton + Fix #3024875 - shared_ptr of classes with non-public destructors. This also fixes + the "unref" feature when used on classes with non-public destructors. + +2010-06-17: ianlancetaylor + [Go] Add the Go language module. + +2010-06-10: wsfulton + [Lua] Fix SWIG_lua_isnilstring multiply defined when using multiple + modules and wrapping strings. Patch from 'Number Cruncher'. + +2010-06-10: olly + [PHP] Fix directors to correctly call a method with has a + different name in PHP to C++ (we were always using the C++ name + in this case). + +2010-06-03: wsfulton + Fix uncompileable code when %rename results in two enum items + with the same name. Reported by Vadim Zeitlin. + Version 2.0.0 (2 June 2010) =========================== Modified: branches/gsoc2009-ashishs99/CHANGES.current =================================================================== --- branches/gsoc2009-ashishs99/CHANGES.current 2011-05-23 12:48:02 UTC (rev 12708) +++ branches/gsoc2009-ashishs99/CHANGES.current 2011-05-23 22:53:10 UTC (rev 12709) @@ -1,10 +1,6 @@ -This file contains the changes for the current release. +Below are the changes for the current release. See the CHANGES file for changes in older releases. See the RELEASENOTES file for a summary of changes in each release. -Version 2.0.1 (in progress) +Version 2.0.5 (in progress) =========================== - -2010-06-03: wsfulton - Fix uncompileable code when %rename results in two enum items - with the same name. Reported by Vadim Zeitlin. Modified: branches/gsoc2009-ashishs99/COPYRIGHT =================================================================== --- branches/gsoc2009-ashishs99/COPYRIGHT 2011-05-23 12:48:02 UTC (rev 12708) +++ branches/gsoc2009-ashishs99/COPYRIGHT 2011-05-23 22:53:10 UTC (rev 12709) @@ -1,7 +1,7 @@ SWIG Copyright and Authors -------------------------- -Copyright (c) 1995-2010 The SWIG Developers +Copyright (c) 1995-2011 The SWIG Developers Copyright (c) 2005-2006 Arizona Board of Regents (University of Arizona). Copyright (c) 1998-2005 University of Chicago. Copyright (c) 1995-1998 The University of Utah and the Regents of the University of California @@ -15,6 +15,7 @@ Olly Betts (olly@...) (PHP) Joseph Wang (joequant@...) (R) Xavier Delacour (xavier.delacour@...) (Octave) + David Nadlinger (code@...) (D) Past SWIG developers and major contributors include: Dave Beazley (dave-swig@...) (SWIG core, Python, Tcl, Perl) @@ -42,7 +43,7 @@ Tiger Feng (songyanf@...) (SWIG core) Mark Rose (mrose@...) (Directors) Jonah Beckford (beckford@...) (CHICKEN) - Ahmon Dancy (dancy@...) (Allegro CL) + Ahmon Dancy (dancy@...) (Allegro CL) Dirk Gerrits (Allegro CL) Neil Cawse (C#) Harco de Hilster (Java) @@ -55,6 +56,9 @@ Mark Gossage (mark@...) (Lua) Gonzalo Garramuno (ggarra@...) (Ruby, Ruby's UTL) John Lenz (Guile, MzScheme updates, Chicken module, runtime system) + Ian Lance Taylor (Go) + Vadim Zeitlin (PCRE) + Stefan Zager (szager@...) (Python) Past contributors include: James Michael DuPont, Clark McGrew, Dustin Mitchell, Ian Cooke, Catalin Dumitrescu, Baran @@ -65,7 +69,7 @@ Past students: Songyan Feng (Chicago). - Xinghua Shi (Chicago). + Xinghua Shi (Chicago). Jing Cao (Chicago). Aquinas Hobor (Chicago). @@ -95,5 +99,5 @@ Richard Salz, Roy Lecates, Rudy Albachten, Scott Drummonds Scott Michel, Shaun Lowry, Steve Galser, Tarn Weisner Burton, Thomas Weidner, Tony Seward, Uwe Steinmann, Vadim Chugunov, Wyss Clemens, -Zhong Ren. +Zhong Ren. Modified: branches/gsoc2009-ashishs99/Doc/Devel/index.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Devel/index.html 2011-05-23 12:48:02 UTC (rev 12708) +++ branches/gsoc2009-ashishs99/Doc/Devel/index.html 2011-05-23 22:53:10 UTC (rev 12709) @@ -21,6 +21,7 @@
• Parameter and Parameter list handling functions
• Generic C/C++ Scanner interface
• Wrapper objects. +
• SWIG Runtime.
Modified: branches/gsoc2009-ashishs99/Doc/Devel/internals.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Devel/internals.html 2011-05-23 12:48:02 UTC (rev 12708) +++ branches/gsoc2009-ashishs99/Doc/Devel/internals.html 2011-05-23 22:53:10 UTC (rev 12709) @@ -7,11 +7,6 @@

SWIG Internals Manual

-Thien-Thi Nguyen
- -

-David M. Beazley
-

@@ -45,7 +40,10 @@
• 5. C/C++ Wrapper Support Functions
• 6. Symbol Naming Guidelines for Generated C/C++ Code
• 7. Debugging SWIG + +

1. Introduction

@@ -1015,17 +1013,141 @@

7. Debugging SWIG

-Warning. Debugging SWIG is for the very patient. +

+The DOH types used in the SWIG source code are all typedefined to void. +Consequently, it is impossible for debuggers to automatically extract any information about DOH objects. +The easiest approach to debugging and viewing the contents of DOH objects is to make a call into one of the family of SWIG print functions from the debugger. +The "Debugging Functions" section in SWIG Parse Tree Handling lists them. +It is sometimes easier to debug by placing a few calls to these functions in code of interest and recompile, especially if your debugger cannot easily make calls into functions within a debugged binary. +

-The DOH types are all typedefined to void. -Consequently, it is impossible for debuggers to extract any information about DOH objects. -Most debuggers will be able to display useful variable information when an object is cast to the appropriate type. -Below are some tips for displaying some of the DOH objects. -Be sure to compile with compiler optimisations turned off before attempting the casts shown in a debugger window else they are unlikely to work. -Even displaying the underlying string in a String* doesn't work straight off in all debuggers due to the multiple definition of String as a struct and a void.

+The SWIG distribution comes with some additional support for the gdb debugger in the Tools/swig.gdb file. +Follow the instructions in this file for 'installing'. +This support file provides an easy way to call into some of the family of SWIG print functions via additional user-defined gdb commands. +Some usage of the swigprint and locswigprint user-defined commands are demonstrated below. +

+

+More often than not, a parse tree node needs to be examined. +The session below displays the node n in one of the Java language module wrapper functions. +The swigprint method is used to show the symbol name (symname - a DOH String type) and the node (n - a DOH Hash type). +

+
+
+Breakpoint 1, JAVA::functionWrapper (this=0x97ea5f0, n=0xb7d2afc8) at Modules/java.cxx:799 +799	    String *symname = Getattr(n, "sym:name"); +(gdb) next +800	    SwigType *t = Getattr(n, "type"); +(gdb) swigprint symname +Shape_x_set +(gdb) swigprint n +Hash(0xb7d2afc8) { +  'membervariableHandler:view' : variableHandler,  +  'feature:except' : 0,  +  'name' : x,  +  'ismember' : 1,  +  'sym:symtab' : Hash(0xb7d2aca8) {......},  +  'nodeType' : cdecl,  +  'nextSibling' : Hash(0xb7d2af98) {.............},  +  'kind' : variable,  +  'variableHandler:feature:immutable' : <Object 'VoidObj' at 0xb7cfa008>,  +  'sym:name' : Shape_x_set,  +  'view' : membervariableHandler,  +  'membervariableHandler:sym:name' : x,  +  'membervariableHandler:type' : double,  +  'membervariableHandler:parms' : <Object 'VoidObj' at 0xb7cfa008>,  +  'parentNode' : Hash(0xb7d2abc8) {..............................},  +  'feature:java:enum' : typesafe,  +  'access' : public,  +  'parms' : Hash(0xb7cb9408) {......},  +  'wrap:action' : if (arg1) (arg1)->x = arg2;,  +  'type' : void,  +  'memberset' : 1,  +  'sym:overname' : __SWIG_0,  +  'membervariableHandler:name' : x,  +} +
+
+ +

+Note that all the attributes in the Hash are shown, including the 'sym:name' attribute which was assigned to the symname variable. +

+ +

+Hash types can be shown either expanded or collapsed. +When a Hash is shown expanded, all the attributes are displayed along with their values, otherwise a '.' replaces each attribute when collapsed. +Therefore a count of the dots provides the number of attributes within an unexpanded Hash. +Below shows the 'parms' Hash being displayed with the default Hash expansion of 1, then with 2 provided as the second argument to swigprint to expand to two Hash levels in order to view the contents of the collapsed 'nextSibling' Hash. +

+ +
+
+(gdb) swigprint 0xb7cb9408 +Hash(0xb7cb9408) { +  'name' : self,  +  'type' : p.Shape,  +  'self' : 1,  +  'nextSibling' : Hash(0xb7cb9498) {...},  +  'hidden' : 1,  +  'nodeType' : parm,  +} +(gdb) swigprint 0xb7cb9408 2 +Hash(0xb7cb9408) { +  'name' : self,  +  'type' : p.Shape,  +  'self' : 1,  +  'nextSibling' : Hash(0xb7cb9498) { +    'name' : x,  +    'type' : double,  +    'nodeType' : parm,  +  },  +  'hidden' : 1,  +  'nodeType' : parm,  +} +
+
+ +

+The same Hash can also be displayed with file and line location information via the locswigprint command. +

+ +
+
+(gdb) locswigprint 0xb7cb9408 +example.h:11: [Hash(0xb7cb9408) { +Hash(0xb7cb9408) { +  'name' : self,  +  'type' : p.Shape,  +  'self' : 1,  +  'nextSibling' : Hash(0xb7cb9498) {...},  +  'hidden' : 1,  +  'nodeType' : parm,  +}] +
+
+ +

+Tip: Commands in gdb can be shortened with whatever makes them unique and can be command completed with the tab key. +Thus swigprint can usually be shortened to sw and locswigprint to loc. +The help for each command can also be obtained within the debugging session, for example, 'help swigprint'. +

+ +

+The sub-section below gives pointers for debugging DOH objects using casts and provides an insight into why it can be hard to debug SWIG without the family of print functions. +

+ + +

7.1 Debugging DOH Types The Hard Way

+ +The DOH types used in SWIG are all typedefined to void and hence the lack of type information for inspecting types within a debugger. +Most debuggers will however be able to display useful variable information when an object is cast to the appropriate type. +Getting at the underlying C string within DOH types is cumbersome, but possible with appropriate casts. +The casts below can be used in a debugger windows, but be sure to compile with compiler optimisations turned off before attempting the casts else they are unlikely to work. +Even displaying the underlying string in a String * doesn't work straight off in all debuggers due to the multiple definitions of String as a struct and a void. +

+ Below are a list of common SWIG types. With each is the cast that can be used in the debugger to extract the underlying type information and the underlying char * string. @@ -1033,36 +1155,30 @@

• String *s;
• +(struct String *)((DohBase *)s)->data
-(struct String *)((DohBase *)s)->data -
The underlying char * string can be displayed with
-(*(struct String *)(((DohBase *)s)->data)).str +(*(struct String *)(((DohBase *)s)->data)).str

• SwigType *t;
• +(struct String *)((DohBase *)t)->data
-(struct String *)((DohBase *)t)->data -
The underlying char * string can be displayed with
-(*(struct String *)(((DohBase *)t)->data)).str +(*(struct String *)(((DohBase *)t)->data)).str

• const_String_or_char_ptr sc;
• Either
-(*(struct String *)(((DohBase *)sc)->data)).str +(*(struct String *)(((DohBase *)sc)->data)).str
or
-(char *)sc +(char *)sc
will work depending on whether the underlying type is really a String * or char *. -

-Please also read the Debugging Functions section in SWIG Parse Tree Handling for the Swig_print_node(), Swig_print_tree() and Swig_print_tags() functions for displaying node contents. It is often easier to place a few calls to these functions in code of interest and recompile than use the debugger. -

-
Copyright (C) 1999-2010 SWIG Development Team. Modified: branches/gsoc2009-ashishs99/Doc/Devel/tree.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Devel/tree.html 2011-05-23 12:48:02 UTC (rev 12708) +++ branches/gsoc2009-ashishs99/Doc/Devel/tree.html 2011-05-23 22:53:10 UTC (rev 12709) @@ -6,13 +6,6 @@

SWIG Parse Tree Handling

- -

-David M. Beazley
-dave-swig@...
-December, 2006
- -

Introduction

@@ -210,9 +203,35 @@

Debugging Functions

-The following functions are used to help debug SWIG parse trees. +

+The following functions can be used to help debug any SWIG DOH object. +

+void Swig_print(DOH *object, int count = -1) + +
+Prints to stdout a string representation of any DOH type. +The number of nested Hash types to expand is set by count (default is 1 if count<0). See Swig_set_max_hash_expand() to change default. +
+
+
+ +void Swig_print_with_location(DOH *object, int count = -1) + +
+Prints to stdout a string representation of any DOH type, within [] brackets +for Hash and List types, prefixed by line and file information. +The number of nested Hash types to expand is set by count (default is 1 if count<0). See Swig_set_max_hash_expand() to change default. +
+
+
+ +

+The following functions can be used to help debug SWIG parse trees. +

+ +

void Swig_print_tags(Node *node, String_or_char *prefix)

Modified: branches/gsoc2009-ashishs99/Doc/Manual/Arguments.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Arguments.html 2011-05-23 12:48:02 UTC (rev 12708) +++ branches/gsoc2009-ashishs99/Doc/Manual/Arguments.html 2011-05-23 22:53:10 UTC (rev 12709) @@ -81,7 +81,7 @@ %include "typemaps.i" %apply double *OUTPUT { double *result }; -%inlne %{ +%inline %{ extern void add(double a, double b, double *result); %} Modified: branches/gsoc2009-ashishs99/Doc/Manual/CSharp.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/CSharp.html 2011-05-23 12:48:02 UTC (rev 12708) +++ branches/gsoc2009-ashishs99/Doc/Manual/CSharp.html 2011-05-23 22:53:10 UTC (rev 12709) @@ -38,6 +38,7 @@
• A date example demonstrating marshalling of C# properties
• Turning wrapped classes into partial classes
• Extending proxy classes with additional C# code +
• Underlying type for enums @@ -56,7 +57,7 @@ It is also better suited for robust production environments due to the Managed C++ flaw called the Mixed DLL Loading Problem. SWIG C# works equally well on non-Microsoft operating systems such as Linux, Solaris and Apple Mac using -Mono; and Portable.NET;. +Mono; and Portable.NET;.

@@ -574,7 +575,8 @@

[DllImport("example", EntryPoint="CSharp_myArrayCopy")]  public static extern void myArrayCopy([In, MarshalAs(UnmanagedType.LPArray)]int[] jarg1,  -                                      [Out, MarshalAs(UnmanagedType.LPArray)]int[] jarg2, int jarg3); +                                      [Out, MarshalAs(UnmanagedType.LPArray)]int[] jarg2, +                                       int jarg3);
@@ -623,7 +625,8 @@
[DllImport("example", EntryPoint="CSharp_myArraySwap")]    public static extern void myArraySwap([In, Out, MarshalAs(UnmanagedType.LPArray)]int[] jarg1,  -                                        [In, Out, MarshalAs(UnmanagedType.LPArray)]int[] jarg2, int jarg3); +                                        [In, Out, MarshalAs(UnmanagedType.LPArray)]int[] jarg2, +                                         int jarg3);
@@ -695,7 +698,8 @@ fixed ( int *swig_ptrTo_sourceArray = sourceArray ) { fixed ( int *swig_ptrTo_targetArray = targetArray ) { { - examplePINVOKE.myArrayCopy((IntPtr)swig_ptrTo_sourceArray, (IntPtr)swig_ptrTo_targetArray, nitems); + examplePINVOKE.myArrayCopy((IntPtr)swig_ptrTo_sourceArray, (IntPtr)swig_ptrTo_targetArray, + nitems); } } } @@ -2108,7 +2112,8 @@ try { examplePINVOKE.addYears(CDate.getCPtr(temppDate), years); } finally { - pDate = new System.DateTime(temppDate.getYear(), temppDate.getMonth(), temppDate.getDay(), 0, 0, 0); + pDate = new System.DateTime(temppDate.getYear(), temppDate.getMonth(), temppDate.getDay(), + 0, 0, 0); } } ... @@ -2125,13 +2130,13 @@
%typemap(csin, -         pre="    using (CDate temp\$csinput = new CDate(\$csinput.Year, \$csinput.Month, \$csinput.Day)) {", -         post="      \$csinput = new System.DateTime(temp\$csinput.getYear()," -              " temp\$csinput.getMonth(), temp\$csinput.getDay(), 0, 0, 0);",  -         terminator="    } // terminate temp\$csinput using block", -         cshin="ref \$csinput" -        ) CDate * -         "\$csclassname.getCPtr(temp\$csinput)" +  pre="    using (CDate temp\$csinput = new CDate(\$csinput.Year, \$csinput.Month, \$csinput.Day)) {", +  post="      \$csinput = new System.DateTime(temp\$csinput.getYear()," +       " temp\$csinput.getMonth(), temp\$csinput.getDay(), 0, 0, 0);",  +  terminator="    } // terminate temp\$csinput using block", +  cshin="ref \$csinput" + ) CDate * +  "\$csclassname.getCPtr(temp\$csinput)"    void subtractYears(CDate *pDate, int years) {    *pDate = CDate(pDate->getYear() - years, pDate->getMonth(), pDate->getDay()); @@ -2151,7 +2156,8 @@      try {        examplePINVOKE.subtractYears(CDate.getCPtr(temppDate), years);      } finally { -      pDate = new System.DateTime(temppDate.getYear(), temppDate.getMonth(), temppDate.getDay(), 0, 0, 0); +      pDate = new System.DateTime(temppDate.getYear(), temppDate.getMonth(), temppDate.getDay(), +                                  0, 0, 0);      }      } // terminate temppDate using block    } @@ -2400,6 +2406,38 @@
+

18.6.7 Underlying type for enums

+ + +

+C# enums use int as the underlying type for each enum item. +If you wish to change the underlying type to something else, then use the csbase typemap. +For example when your C++ code uses a value larget than int, this is necessary as the C# compiler will not compile values which are too large to fit into an int. +Here is an example: +

+ +
+
+%typemap(csbase) BigNumbers "uint" +%inline %{ +  enum BigNumbers { big=0x80000000, bigger }; +%} +
+
+ +

+The generated enum will then use the given underlying type and compile correctly: +

+ +
+
+public enum BigNumbers : uint { +  big = 0x80000000, +  bigger +} +
+
+ Modified: branches/gsoc2009-ashishs99/Doc/Manual/Contents.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Contents.html 2011-05-23 12:48:02 UTC (rev 12708) +++ branches/gsoc2009-ashishs99/Doc/Manual/Contents.html 2011-05-23 22:53:10 UTC (rev 12709) @@ -5,7 +5,7 @@ SWIG Users Manual -

SWIG Users Manual

+

SWIG Users Manual

@@ -152,6 +152,11 @@

• Arrays
• Renaming and ignoring declarations +
• Default/optional arguments
• Pointers to functions and callbacks @@ -489,7 +494,7 @@
• C/C++ Parser (300-399)
• Types and typemaps (400-499)
• Code generation (500-599) -
• Language module specific (800-899) +
• Language module specific (700-899)
• User defined (900-999)
• History @@ -657,6 +662,7 @@
• A date example demonstrating marshalling of C# properties
• Turning wrapped classes into partial classes
• Extending proxy classes with additional C# code +
• Underlying type for enums @@ -700,11 +706,74 @@ -

20 SWIG and Guile

+

20 SWIG and D

+ + +

21 SWIG and Go

+ + + + + +

22 SWIG and Guile

+ + + -

21 SWIG and Java

+

23 SWIG and Java

@@ -832,6 +901,7 @@
• Simple pointers
• Wrapping C arrays with Java arrays
• Unbounded C Arrays +
• Binary data vs Strings
• Overriding new and delete to allocate from Java heap
• Java typemaps @@ -877,7 +947,7 @@ -

22 SWIG and Common Lisp

+

24 SWIG and Common Lisp

@@ -900,7 +970,7 @@
-

23 SWIG and Lua

+

25 SWIG and Lua

@@ -957,7 +1027,7 @@
-

24 SWIG and Modula-3

+

26 SWIG and Modula-3

@@ -995,17 +1065,19 @@
-

25 SWIG and MzScheme

+

27 SWIG and MzScheme/Racket

-

26 SWIG and Ocaml

+

28 SWIG and Ocaml

@@ -1056,7 +1128,7 @@
-

27 SWIG and Octave

+

29 SWIG and Octave

@@ -1091,7 +1163,7 @@
-

28 SWIG and Perl5

+

30 SWIG and Perl5

@@ -1158,7 +1230,7 @@
-

29 SWIG and PHP

+

31 SWIG and PHP

@@ -1198,7 +1270,7 @@
-

30 SWIG and Pike

+

32 SWIG and Pike

@@ -1222,7 +1294,7 @@
-

31 SWIG and Python

+

33 SWIG and Python

@@ -1260,6 +1332,11 @@
• Further details on the Python class interface @@ -1325,11 +1402,27 @@ -

32 SWIG and Ruby

+

34 SWIG and R

+ + +

35 SWIG and Ruby

+ + +
+
-

33 SWIG and Tcl

+

36 SWIG and Tcl

@@ -1525,27 +1618,11 @@
-

34 SWIG and R

+

37 Extending SWIG to support new languages

- - -

35 Extending SWIG to support new languages

- - -
-
• Introduction
• Prerequisites
• The Big Picture Modified: branches/gsoc2009-ashishs99/Doc/Manual/Customization.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Customization.html 2011-05-23 12:48:02 UTC (rev 12708) +++ branches/gsoc2009-ashishs99/Doc/Manual/Customization.html 2011-05-23 22:53:10 UTC (rev 12709) @@ -83,7 +83,7 @@

When defined, the code enclosed in braces is inserted directly into the low-level wrapper functions. The special variable \$action is one of a few -%exception special variable +%exception special variables supported and gets replaced with the actual operation to be performed (a function call, method invocation, attribute access, etc.). An exception handler remains in effect until it is explicitly deleted. This is done by using either %exception Copied: branches/gsoc2009-ashishs99/Doc/Manual/D.html (from rev 12683, trunk/Doc/Manual/D.html) =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/D.html (rev 0) +++ branches/gsoc2009-ashishs99/Doc/Manual/D.html 2011-05-23 22:53:10 UTC (rev 12709) @@ -0,0 +1,454 @@ + + + +SWIG and D + + + + +

20 SWIG and D

+ + + + + + +

20.1 Introduction

+ + +

From the D Programming Language web site: »D is a systems programming language. Its focus is on combining the power and high performance of C and C++ with the programmer productivity of modern languages like Ruby and Python. [...] The D language is statically typed and compiles directly to machine code.« As such, it is not very surprising that D is able to directly interface with C libraries. Why would a SWIG module for D be needed then in the first place?

+ +

Well, besides the obvious downside that the C header files have to be manually converted to D modules for this to work, there is one major inconvenience with this approach: D code usually is on a higher abstraction level than C, and many of the features that make D interesting are simply not available when dealing with C libraries, requiring you e.g. to manually convert strings between pointers to \0-terminated char arrays and D char arrays, making the algorithms from the D2 standard library unusable with C arrays and data structures, and so on.

+ +

While these issues can be worked around relatively easy by hand-coding a thin wrapper layer around the C library in question, there is another issue where writing wrapper code per hand is not feasible: C++ libraries. D did not support interfacing to C++ in version 1 at all, and even if extern(C++) has been added to D2, the support is still very limited, and a custom wrapper layer is still required in many cases.

+ +

To help addressing these issues, the SWIG C# module has been forked to support D. Is has evolved quite a lot since then, but there are still many similarities, so if you do not find what you are looking for on this page, it might be worth having a look at the chapter on C# (and also on Java, since the C# module was in turn forked from it).

+ + +

20.2 Command line invocation

+ + +

To activate the D module, pass the -d option to SWIG at the command line. The same standard command line switches as with any other language module are available, plus the following D specific ones:

+ +
+
-d2
+
+

By default, SWIG generates code for D1/Tango. Use the -d2 flag to target D2/Phobos instead.

+
+ +
-splitproxy
+
+

By default, SWIG generates two D modules: the proxy module, named like the source module (either specified via the %module directive or via the module command line switch), which contains all the proxy classes, functions, enums, etc., and the intermediary module (named like the proxy module, but suffixed with _im), which contains all the extern(C) function declarations and other private parts only used internally by the proxy module.

+

If the split proxy mode is enabled by passing this switch at the command line, all proxy classes and enums are emitted to their own D module instead. The main proxy module only contains free functions and constants in this case.

+
+ +
-package <pkg>
+
+

By default, the proxy D modules and the intermediary D module are written to the root package. Using this option, you can specify another target package instead.

+
+ +
-wrapperlibrary <wl>
+
+

The code SWIG generates to dynamically load the C/C++ wrapper layer looks for a library called \$module_wrap by default. With this switch, you can override the name of the file the wrapper code loads at runtime (the lib prefix and the suffix for shared libraries are appended automatically, depending on the OS).

+

This might especially be useful if you want to invoke SWIG several times on separate modules, but compile the resulting code into a single shared library.

+
+
+ + +

20.3 Typemaps

+ + +

20.3.1 C# <-> D name comparison

+ + +

If you already know the SWIG C# module, you might find the following name comparison table useful:

+ +
+ ctype                  <->  ctype + imtype                 <->  imtype + cstype                 <->  dtype + csin                   <->  din + csout                  <->  dout + csdirectorin           <->  ddirectorin + csdirectorout          <->  ddirectorout + csinterfaces           <->  dinterfaces + csinterfaces_derived   <->  dinterfaces_derived + csbase                 <->  dbase + csclassmodifiers       <->  dclassmodifiers + cscode                 <->  dcode + csimports              <->  dimports + csbody                 <->  dbody + csfinalize             <->  ddestructor + csdestruct             <->  ddispose + csdestruct_derived     <->  ddispose_derived +
+ + +

20.3.2 ctype, imtype, dtype

+ + +

Mapping of types between the C/C++ library, the C/C++ library wrapper exposing the C functions, the D wrapper module importing these functions and the D proxy code.

+ +

The ctype typemap is used to determine the types to use in the C wrapper functions. The types from the imtype typemap are used in the extern(C) declarations of these functions in the intermediary D module. The dtype typemap contains the D types used in the D proxy module/class.

+ + +

20.3.3 in, out, directorin, directorout

+ + +

Used for converting between the types for C/C++ and D when generating the code for the wrapper functions (on the C++ side).

+ +

The code from the in typemap is used to convert arguments to the C wrapper function to the type used in the wrapped code (ctype->original C++ type), the out typemap is utilized to convert values from the wrapped code to wrapper function return types (original C++ type->ctype).

+ +

The directorin typemap is used to convert parameters to the type used in the D director callback function, its return value is processed by directorout (see below).

+ + +

20.3.4 din, dout, ddirectorin, ddirectorout

+ + +

Typemaps for code generation in D proxy and type wrapper classes.

+ +

The din typemap is used for converting function parameter types from the type used in the proxy module or class to the type used in the intermediary D module (the \$dinput macro is replaced). To inject further parameter processing code before or after the call to the intermediary layer, the pre, post and terminator attributes can be used (please refer to the C# date marshalling example for more information on these).

+ +

The dout typemap is used for converting function return values from the return type used in the intermediary D module to the type returned by the proxy function. The \$excode special variable in dout typemaps is replaced by the excode typemap attribute code if the method can throw any exceptions from unmanaged code, otherwise by nothing (the \$imcall and \$owner macros are replaced).

+ +

The code from the ddirectorin and ddirectorout typemaps is used for conversion in director callback functions. Arguments are converted to the type used in the proxy class method they are calling by using the code from ddirectorin, the proxy class method return value is converted to the type the C++ code expects via the ddirectorout typemap (the \$dcall and \$winput macros are replaced).

+ +

The full chain of type conversions when a director callback is invoked looks like this:

+ +
+      type              CPPClass::method(type a) +        ↑                       ↓ +   <directorout>          <directorin> +        ↑                       ↓ +      ctype             methodCallback(ctype a)           C++ + ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +      imtype            methodCallback(imtype a)           D +        ↑                       ↓ +  <ddirectorout>          <ddirectorin> +        ↑                       ↓ +      dtype             DClass.method(dtype a)
+ + +

20.3.5 typecheck typemaps

+ + +

Because, unlike many scripting languages supported by SWIG, D does not need any dynamic dispatch helper to access an overloaded function, the purpose of these is merely to issue a warning for overloaded C++ functions that cannot be overloaded in D (as more than one C++ type maps to a single D type).

+ + +

20.3.6 Code injection typemaps

+ + +

These typemaps are used for generating the skeleton of proxy classes for C++ types.

+ +

By overriding dbase, dinterfaces or dinterfaces_derived, the inheritance chain of the generated proxy class for a type can be modified. dclassmodifiers allows you to add any custom modifiers around the class keyword.

+ +

Using dcode and dimports, you can specify additional D code which will be emitted into the class body respectively the imports section of the D module the class is written to.

+ +

dconstructor, ddestructor, ddispose and ddispose_derived are used to generate the class constructor, destructor and dispose() method, respectively. The auxiliary code for handling the pointer to the C++ object is stored in dbody and dbody_derived. You can override them for specific types.

+ + +

20.3.7 Special variable macros

+ + +

The standard SWIG special variables are available for use within typemaps as described in the Typemaps documentation, for example \$1, \$input, \$result etc.

+ +

When generating D wrappers, a few additional macros are available:

+
+
\$dclassname (C#: \$csclassname)
+
+

This special variable works similar to \$n_type in that it returns the name of a type - it expands to the D proxy class name of the type being wrapped. If the type does not have an associated proxy class, it expands to the type wrapper class name, for example, SWIGTYPE_p_p_SomeCppClass is generated when wrapping SomeCppClass **.

+

There are two other variants available, \$&dclassname and \$*dclassname. The former adds a level of indirection, while the latter removes one. For instance, when wrapping Foo **, \$*dclassname would be replaced by the proxy class name corresponding to Foo *.

+
+ +
\$dclazzname (C#: \$csclazzname)
+
+

This special variable expands the fully qualified C++ class into the package name, if used by the nspace feature, and the proxy class name, mangled for use as a function name. For example, Namespace1::Namespace2::Klass is expanded into Namespace1_Namespace2_Klass_.

+

This special variable might be useful for calling certain functions in the wrapper layer (e.g. upcast wrappers) which are mangled like this.

+
+ +
\$null
+

In code inserted into the generated C/C++ wrapper functions, this variable is replaced by either 0 or nothing at all, depending on whether the function has a return value or not. It can be used to bail out early e.g. in case of errors (return \$null;).

+ +
\$dinput (C#: \$csinput)
+
+

This variable is used in din typemaps and is replaced by the expression which is to be passed to C/C++.

+

For example, this input

+
+%typemap(din) SomeClass * "SomeClass.getCPointer(\$dinput)" + +%inline %{ +  class SomeClass {}; +  void foo(SomeClass *arg); +%}
+

leads to the following D proxy code being generated:

+
+void foo(SomeClass arg) { +  example_im.foo(SomeClass.getCPointer(arg)); +}
+ +
\$imcall and \$owner (C#: \$imcall)
+
+

These variables are used in dout typemaps. \$imcall contains the call to the intermediary module which provides the value to be used, and \$owner signals if the caller is responsible for managing the object lifetime (that is, if the called method is a constructor or has been marked via %newobject).

+

Consider the following example:

+
+%typemap(dout) SomeClass * { +  return new SomeClass(\$imcall, \$owner); +} + +%inline %{ +  class SomeClass; +  SomeClass *foo(); + +  %newobject bar(); +  SomeClass *bar(); +%}
+

The code generated for foo() and bar() looks like this:

+
+SomeClass foo() { +  return new SomeClass(example_im.foo(), false); +} + +SomeClass bar() { +  return new SomeClass(example_im.bar(), true); +} +
+
+ +
\$dcall and \$winput (C#: \$cscall, \$iminput)
+

These variables are used in the director-specific typemaps ddirectorin and ddirectorout. They are more or less the reverse of the \$imcall and \$dinput macros: \$dcall contains the invocation of the D proxy method of which the return value is to be passed back to C++, \$winput contains the parameter value from C++.

+ +
\$excode
+

This variable is used in dout and dconstructor typemaps and is filled with the contents of the excode typemap attribute if an exception could be thrown from the C++ side. See the C# documentation for details.

+ +
\$dbaseclass
+

Currently for internal use only, it contains the D name of the C++ base class (if any) inside proxy classes.

+ +
\$directorconnect
+
+

This macro is only valid inside the dconstructor typemap and contains the value of the dconstructor typemap attribute if the currently wrapped class has directors enabled.

+

This is how the default dconstructor typemap looks like (you usually do not want to specify a custom one):

+
+%typemap(dconstructor, excode=SWIGEXCODE, +         directorconnect="\n  swigDirectorConnect();") SWIGTYPE { +  this(\$imcall, true);\$excode\$directorconnect +} +
+
+ +
\$importtype(SomeDType)
+
+

This macro is used in the dimports typemap if a dependency on another D type generated by SWIG is added by a custom typemap.

+

Consider the following code snippet:

+
+%typemap(dinterfaces) SomeClass "AnInterface, AnotherInterface"; +
+

This causes SWIG to add AnInterface and AnotherInterface to the base class list of SomeClass:

+
+class SomeClass : AnInterface, AnotherInterface { +  ... +} +
+

For this to work, AnInterface and AnotherInterface have to be in scope. If SWIG is not in split proxy mode, this is already the case, but it it is, they have to be added to the import list via the dimports typemap. Additionally, the import statement depends on the package SWIG is configured to emit the modules to.

+

The \$importtype macro helps you to elegantly solve this problem:

+
+%typemap(dimports) RemoteMpe %{ +\$importtype(AnInterface) +\$importtype(AnotherInterface) +%} +
+

If SWIG is in split proxy mode, it expands to an import statement for the specified type, to nothing if not.

+
+ +
\$module
+

Expands to the name of the main proxy D module.

+ +
\$imdmodule
+

Contains the fully qualified name of the intermediary D module.

+
+ + +

20.4 %features

+ + +

The D module defines a number of directives which modify the SWIG features set globally or for a specific declaration:

+ + +
+
%dmanifestconst and %dconstvalue(value)
+
+

Out of the box, SWIG generates accessor methods for C #defines and C++ constants. The %dmanifestconst directive enables wrapping these constants as D manifest constants (const in D1, enum in D2).

+

For this to work, the C/C++ code for the constant value must directly compile as D code, though. If this is not the case, you can manually override the expression written to the D proxy module using the %dconstvalue directive, passing the new value as parameter.

+

For enums, again %dconstvalue can be used to override the value of an enum item if the initializer should not compile in D.

+
+ +
%dmethodmodifiers
+
+

This directive can be used to override the modifiers for a proxy function. For instance, you could make a public C++ member function private in D like this:

+
+%dmethodmodifiers A::foo "private"; + +%inline %{ +struct A { +  void foo(); +}; +%} +
+
+
+ + +

20.5 Pragmas

+ + +

There are a few SWIG pragmas specific to the D module, which you can use to influence the D code SWIG generates:

+ +
+
%pragma(d) imdmodulecode
+

The passed text (D code) is copied verbatim to the intermediary D module. For example, it can be (and is, internally) used to emit additional private helper code for the use by proxy typemaps.

+ +
%pragma(d) imdmoduleimports
+

Additional code to be emitted to the imports section of the intermediary D module (the \$importtype macro can be used here). You probably want to use this in conjunction with the imdmodulecode pragma.

+ +
%pragma(d) proxydmodulecode
+

Just like proxydmodulecode, the argument is copied to the proxy D module (if SWIG is in split proxy mode and/or the nspace feature is used, it is emitted to the main proxy D module only).

+ +
%pragma(d) globalproxyimports
+
+

The D module currently does not support specifying dependencies on external modules (e.g. from the standard library) for the D typemaps. To add the import statements to the proxy modules (resp. to all proxy modules if in split proxy mode), you can use the globalproxyimports directive.

+

For example:

+
+%typemap(din) char[] "(\$dinput ? tango.stdc.stringz.toStringz(\$dinput) : null)" +%pragma(d) globalproxyimports = "static import tango.stdc.stringz;"; +
+
+ +
+
+

The D code for loading the wrapper library (it is copied to the intermediary D module). The \$wrapperloaderbindcode variable is replaced by the list of commands for binding the functions from the wrapper library to the symbols in the intermediary D module.

+

Each time this pragma is specified, the previous value is overwritten.

+
+ +
+
+

The D command to use for binding the wrapper functions from the C/C++ library to the symbols in the intermediary D module. The \$function variable contains the name of the D function in the wrap module, the \$symbol variable is replaced by the name of the symbol in the library.

+

Each time this pragma is specified, the previous value is overwritten.

+
+
+ + +

20.6 D Exceptions

+ + +

Out of the box, C++ exceptions are fundamentally incompatible to their equivalent in the D world and cannot simply be propagated to a calling D method. There is, however, an easy way to solve this problem: Just catch the exception in the C/C++ wrapper layer, pass the contents to D, and make the wrapper code rethrow the exception in the D world.

+ +

The implementation details of this are a bit crude, but the SWIG D module automatically takes care of this, as long as it is able to detect that an exception could potentially be thrown (e.g. because the C++ method has a throw(...) exception specification).

+ +

As this feature is implemented in exactly the same way it is for C#, please see the C# documentation for a more detailed explanation.

+ + +

20.7 D Directors

+ + +

When the directors feature is activated, SWIG generates extra code on both the C++ and the D side to enable cross-language polymorphism. Essentially, this means that if you subclass a proxy class in D, C++ code can access any overridden virtual methods just as if you created a derived class in C++.

+ +

There is no D specific documentation yet, but the way the feature is implemented is very similar to how it is done in Java and C#. +

+ + +

20.8 Other features

+ + +

20.8.1 Extended namespace support (nspace)

+ + +

By default, SWIG flattens all C++ namespaces into a single target language namespace, but as for Java and C#, the nspace feature is supported for D. If it is active, C++ namespaces are mapped to D packages/modules. Note, however, that like for the other languages, free variables and functions are not supported yet; currently, they are all allows written to the main proxy D module.

+ + +

20.8.2 Native pointer support

+ + +

Contrary to many of the scripting languages supported by SWIG, D fully supports C-style pointers. The D module thus includes a custom mechanism to wrap C pointers directly as D pointers where applicable, that is, if the type that is pointed to is represented the same in C and D (on the bit-level), dubbed a »primtive type« below.

+ +

Central to this custom pointer handling scheme are two typemap attributes: the cprimitive attribute on the dtype typemap and the nativepointer attribute on all the typemaps which influence the D side of the code (dtype, din, dout, ...). When a D typemap is looked up, the following happens behind the scenes:

+ +

First, the matching typemap is determined by the usual typemap lookup rules. Then, it is checked if the result has the nativepointer attribute set. If it is present, it means that its value should replace the typemap value if and only if the actual type the typemap is looked up for is a primitive type, a pointer to a primitive type (through an arbitrary level of indirections), or a function pointer with only primitive types in its signature.

+ +

To determine if a type should be considered primitive, the cprimitive attribute on its dtype attribute is used. For example, the dtype typemap for float has cprimitive="1", so the code from the nativepointer attribute is taken into account e.g. for float ** or the function pointer float (*)(float *).

+ + +

+ + +

The D module comes with basic operator overloading support for both D1 and D2. There are, however, a few limitations arising from conceptual differences between C++ and D:

+ +

The first key difference is that C++ supports free functions as operators (along with argument-dependent lookup), while D requires operators to be member functions of the class they are operating on. SWIG can only automatically generate wrapping code for member function operators; if you want to use operators defined as free functions in D, you need to handle them manually.

+ +

Another set of differences between C++ and D concerns individual operators. For example, there are quite a few operators which are overloadable in C++, but not in D, for example && and ||, but also !, and prefix increment/decrement operators in D1; resp. their postfix pendants in D2.

; + +

There are also some cases where the operators can be translated to D, but the differences in the implementation details are big enough that a rather involved scheme would be required for automatic wrapping them, which has not been implemented yet. This affects, for example, the array subscript operator, [], in combination with assignments - while operator [] in C++ simply returns a reference which is then written to, D resorts to a separate opIndexAssign method -, or implicit casting (which was introduced in D2 via alias this). Despite the lack of automatic support, manually handling these cases should be perfectly possible.

+ + +

20.8.4 Running the test-suite

+ + +

As with any other language, the SWIG test-suite can be built for D using the *-d-test-suite targets of the top-level Makefile. By default, D1 is targeted, to build it with D2, use the optional D_VERSION variable, e.g. make check-d-test-suite D_VERSION=2.

+ +

Note: If you want to use GDC on Linux or another platform which requires you to link libdl for dynamically loading the shared library, you might have to add -ldl manually to the d_compile target in Examples/Makefile, because GDC does not currently honor the pragma(lib,...) statement.

+ + +

20.9 D Typemap examples

+ + +

There are no D-specific typemap examples yet. However, with the above name comparison table, you should be able to get an idea what can be done by looking at the corresponding C# section.

+ + + +

20.10 Work in progress and planned features

+ + +

There are a couple of features which are not implemented yet, but would be very useful and might be added in the near future:

+ +
+
• Static linking: Currently, the C wrapper code is compiled into a dynamic library, out of which the symbol addresses are looked up at runtime by the D part. If statically linking the different languages into one binary was supported, a tool-chain capable of performing IPO at link time could inline the wrapping code, effectively reducing the overhead for simple calls to zero.
• +
• C array handling: Many data structures in some C/C++ libraries contain array containing of a pointer to the first element and the element count. Currently, one must manually writing wrapper code to be able to access these from D. It should be possible to add a set of SWIG macros to semi-automatically generate conversion code.
• +
+ +

Some generated code might also be a bit rough around the edges, particularly in the following areas:

+ +
+
• Memory management: Although the currently generated wrapper code works fine with regard to the GC for the test-suite, there might be issues coming up in real-world multi-threaded usage.
• +
• D2 support: Originally, the module has been developed for the use with D1, D2/Phobos support has been added in later. The basic features should work equally well for both, but there could be issues concerning const-correctness etc.
• +
+ + + + + Modified: branches/gsoc2009-ashishs99/Doc/Manual/Extending.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Extending.html 2011-05-23 12:48:02 UTC (rev 12708) +++ branches/gsoc2009-ashishs99/Doc/Manual/Extending.html 2011-05-23 22:53:10 UTC (rev 12709) @@ -6,7 +6,7 @@ -

35 Extending SWIG to support new languages

+

37 Extending SWIG to support new languages

@@ -75,7 +75,7 @@ -

35.1 Introduction

+

37.1 Introduction

@@ -91,7 +91,7 @@ you should probably look at one of SWIG's existing modules.

-

35.2 Prerequisites

+

37.2 Prerequisites

@@ -121,7 +121,7 @@ wrapper code are driven by C++ datatypes.

-

35.3 The Big Picture

+

37.3 The Big Picture

@@ -158,7 +158,7 @@ based on pattern matching and interact heavily with the underlying type system.

-

35.4 Execution Model

+

37.4 Execution Model

@@ -203,7 +203,7 @@ The next few sections briefly describe some of these stages.

-

35.4.1 Preprocessing

+

37.4.1 Preprocessing

@@ -284,7 +284,7 @@ construction of the wrapper code.

-

35.4.2 Parsing

+

37.4.2 Parsing

@@ -385,7 +385,7 @@ arguments).

-

35.4.3 Parse Trees

+

37.4.3 Parse Trees

@@ -640,7 +640,7 @@

-

35.4.4 Attribute namespaces

+

37.4.4 Attribute namespaces

@@ -659,7 +659,7 @@ perl:foo.

-

35.4.5 Symbol Tables

+

37.4.5 Symbol Tables

@@ -750,7 +750,7 @@

-

35.4.6 The %feature directive

+

37.4.6 The %feature directive

@@ -806,7 +806,7 @@ stored without any modifications.

-

35.4.7 Code Generation

+

37.4.7 Code Generation

@@ -928,7 +928,7 @@ The role of these functions is described shortly.

-

35.4.8 SWIG and XML

+

37.4.8 SWIG and XML

@@ -941,7 +941,7 @@ your mind as a model.

-

35.5 Primitive Data Structures

+

37.5 Primitive Data Structures

@@ -987,7 +987,7 @@ -

35.5.1 Strings

+

37.5.1 Strings

@@ -1128,7 +1128,7 @@ -

35.5.2 Hashes

+

37.5.2 Hashes

@@ -1205,7 +1205,7 @@ -

35.5.3 Lists

+

37.5.3 Lists

@@ -1294,7 +1294,7 @@ and is used to create a String object. -

35.5.4 Common operations

+

37.5.4 Common operations

The following operations are applicable to all datatypes. @@ -1349,7 +1349,7 @@ Gets the line number associated with x. -

35.5.5 Iterating over Lists and Hashes

+

37.5.5 Iterating over Lists and Hashes

To iterate over the elements of a list or a hash table, the following functions are used: @@ -1394,7 +1394,7 @@ -

35.5.6 I/O

+

37.5.6 I/O

Special I/O functions are used for all internal I/O. These operations @@ -1531,7 +1531,7 @@ -

35.6 Navigating and manipulating parse trees

+

37.6 Navigating and manipulating parse trees

Parse trees are built as collections of hash tables. Each node is a hash table in which @@ -1665,7 +1665,7 @@ the parent so that sibling nodes are unaffected. -

35.7 Working with attributes

+

37.7 Working with attributes

@@ -1782,7 +1782,7 @@ function. -

35.8 Type system

+

37.8 Type system

@@ -1791,7 +1791,7 @@ type theory is impossible here. However, let's cover the highlights.

-

35.8.1 String encoding of types

+

37.8.1 String encoding of types

@@ -1892,7 +1892,7 @@ string concatenation.

-

35.8.2 Type construction

+

37.8.2 Type construction

@@ -2061,7 +2061,7 @@ ty is unmodified. -

35.8.3 Type tests

+

37.8.3 Type tests

@@ -2148,7 +2148,7 @@ Checks if ty is a templatized type. -

35.8.4 Typedef and inheritance

+

37.8.4 Typedef and inheritance

@@ -2250,7 +2250,7 @@ will consist only of primitive typenames. -

35.8.5 Lvalues

+

37.8.5 Lvalues

@@ -2287,7 +2287,7 @@ -

35.8.6 Output functions

+

37.8.6 Output functions

@@ -2349,7 +2349,7 @@ that appear in wrappers (e.g., SWIGTYPE_p_double). -

35.9 Parameters

+

37.9 Parameters

@@ -2448,7 +2448,7 @@ Returns the number of required (non-optional) arguments in p. -

35.10 Writing a Language Module

+

37.10 Writing a Language Module

@@ -2463,7 +2463,7 @@ this to other languages.

-

35.10.1 Execution model

+

37.10.1 Execution model

@@ -2473,7 +2473,7 @@ different methods of the Language that must be defined by your module.

-

35.10.2 Starting out

+

37.10.2 Starting out

@@ -2581,7 +2581,7 @@ messages from your new module should appear.

-

35.10.3 Command line options

+

37.10.3 Command line options

@@ -2640,7 +2640,7 @@ unrecognized command line option error.

-

35.10.4 Configuration and preprocessing

+

37.10.4 Configuration and preprocessing

@@ -2689,7 +2689,7 @@ python.swg.

-

35.10.5 Entry point to code generation

+

37.10.5 Entry point to code generation

@@ -2747,22 +2747,23 @@ -

35.10.6 Module I/O and wrapper skeleton

+

37.10.6 Module I/O and wrapper skeleton

-Within SWIG wrappers, there are four main sections. These are (in order) +Within SWIG wrappers, there are five main sections. These are (in order)

-
• runtime: This section has most of the common SWIG runtime code -
• header: This section holds declarations and inclusions from the .i file -
• wrapper: This section holds all the wrappering code +
• begin: This section is a placeholder for users to put code at the beginning of the C/C++ wrapper file. +
• runtime: This section has most of the common SWIG runtime code. +
• header: This section holds declarations and inclusions from the .i file. +
• wrapper: This section holds all the wrappering code.
• init: This section holds the module initalisation function -(the entry point for the interpreter) +(the entry point for the interpreter).

Different parts of the SWIG code will fill different sections, @@ -2895,7 +2896,7 @@ -

35.10.7 Low-level code generators

+

37.10.7 Low-level code generators

@@ -3049,7 +3050,7 @@

-

35.10.8 Configuration files

+

37.10.8 Configuration files

@@ -3193,7 +3194,7 @@ -

35.10.9 Runtime support

+

37.10.9 Runtime support

@@ -3202,7 +3203,7 @@ the SWIG files that implement those functions.

-

35.10.10 Standard library files

+

37.10.10 Standard library files

@@ -3221,7 +3222,7 @@ Please copy these and modify for any new language.

-

35.10.11 User examples

+

37.10.11 User examples

@@ -3250,7 +3251,7 @@ files.

-

35.10.12 Test driven development and the test-suite

+

37.10.12 Test driven development and the test-suite

@@ -3309,7 +3310,7 @@ but error/exception out with an error message on stderr on failure.

-

35.10.12.1 Running the test-suite

+

37.10.12.1 Running the test-suite

@@ -3477,10 +3478,28 @@ make ret_by_value.ctest RUNTOOL="gdb --args" -

35.10.13 Documentation

+

+SWIG reads the SWIG_FEATURES environment variable to obtain options in addition to those passed on the command line. +This is particularly useful as the entire test-suite or a particular testcase can be run customized by using additional +arguments, for example the -O optimization flag can be added in, as shown below for the bash shell: +

+
+env SWIG_FEATURES=-O make check-python-test-suite +

+The syntax for setting environment variables varies from one shell to the next, but it also works as shown in the example below, where some typemap debugging is added in: +

+ +
+make ret_by_value.ctest SWIG_FEATURES="-debug-tmsearch" +
+ +

37.10.13 Documentation

+ + +

Don't forget to write end-user documentation for your language module. Currently, each language module has a dedicated chapter You shouldn't rehash things that are already covered in sufficient @@ -3509,7 +3528,7 @@ if available. -

35.10.14 Prerequisites for adding a new language module to the SWIG distribution

+

37.10.14 Prerequisites for adding a new language module to the SWIG distribution

@@ -3566,7 +3585,7 @@ the existing tests.

-

35.10.15 Coding style guidelines

+

37.10.15 Coding style guidelines

@@ -3590,7 +3609,7 @@ should be avoided as unlike the SWIG developers, users will never have consistent tab settings.

@@ Diff output truncated at 100000 characters. @@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
•  [Swig-cvs] SF.net SVN: swig:[12957] branches/gsoc2009-ashishs99 From: - 2012-03-26 18:52:55 ```Revision: 12957 http://swig.svn.sourceforge.net/swig/?rev=12957&view=rev Author: ashishs99 Date: 2012-03-26 18:52:47 +0000 (Mon, 26 Mar 2012) Log Message: ----------- BUG: Fixed the wrong compiler arguments passed to objc examples Modified Paths: -------------- branches/gsoc2009-ashishs99/Examples/Makefile.in branches/gsoc2009-ashishs99/configure.in Modified: branches/gsoc2009-ashishs99/Examples/Makefile.in =================================================================== --- branches/gsoc2009-ashishs99/Examples/Makefile.in 2012-03-26 15:46:32 UTC (rev 12956) +++ branches/gsoc2009-ashishs99/Examples/Makefile.in 2012-03-26 18:52:47 UTC (rev 12957) @@ -997,6 +997,7 @@ OBJC=@OBJC@ OBJC_INCLUDE=@OBJCINC@ OBJC_DLNK=@OBJCDYNAMICLINKING@ +OBJC_LIBS=@OBJCLIBS@ OBJC_LIBPREFIX = @OBJCLIBRARYPREFIX@ OBJCCFLAGS=@OBJCCFLAGS@ OBJCSO=@OBJCSO@ @@ -1013,7 +1014,7 @@ \$(SWIG) -objc \$(SWIGOPT) \$(INTERFACEPATH) \$(CC) -c \$(CCSHARED) \$(CFLAGS) \$(SRCS) \$(INCLUDES) \$(OBJC) -c \$(CCSHARED) \$(CFLAGS) \$(OBJCCFLAGS) \$(OBJCXXSRCS) \$(INCLUDES) \$(OBJC_INCLUDE) - \$(OBJCLDSHARED) \$(CFLAGS) \$(OBJCFLAGS) \$(OBJS) \$(OBJC_DLNK) \$(LIBS) -o \$(OBJC_LIBPREFIX)\$(TARGET)\$(OBJCSO) + \$(OBJCLDSHARED) \$(CFLAGS) \$(OBJCFLAGS) \$(OBJS) \$(OBJC_DLNK) \$(OBJC_LIBS) \$(LIBS) -o \$(OBJC_LIBPREFIX)\$(TARGET)\$(OBJCSO) # ---------------------------------------------------------------- # Build a Objective-C dynamically loadable module (C++) @@ -1023,14 +1024,14 @@ \$(SWIG) -objc -c++ \$(SWIGOPT) \$(INTERFACEPATH) \$(CXX) -c \$(CCSHARED) \$(CFLAGS) \$(SRCS) \$(CXXSRCS) \$(INCLUDES) \$(OBJC) -c \$(CCSHARED) \$(CFLAGS) \$(OBJCCFLAGS) \$(OBJCXXSRCS) \$(INCLUDES) \$(OBJC_INCLUDE) - \$(OBJCCXXSHARED) \$(CFLAGS) \$(OBJCFLAGS) \$(OBJS) \$(OBJC_DLNK) \$(LIBS) \$(CPP_DLLIBS) -o \$(OBJC_LIBPREFIX)\$(TARGET)\$(OBJCSO) + \$(OBJCCXXSHARED) \$(CFLAGS) \$(OBJCFLAGS) \$(OBJS) \$(OBJC_DLNK) \$(OBJC_LIBS) \$(LIBS) \$(CPP_DLLIBS) -o \$(OBJC_LIBPREFIX)\$(TARGET)\$(OBJCSO) # ---------------------------------------------------------------- # Compile Objective-C & Objective-C++ files # ---------------------------------------------------------------- objc_compile: \$(SRCS) - \$(COMPILETOOL) \$(OBJC) \$(OBJC_INCLUDE) \$(OBJCFLAGS) \$(OBJCSRCS) \$(OBJC_DLNK) -L. -l\$(TARGET) + \$(COMPILETOOL) \$(OBJC) \$(OBJC_INCLUDE) \$(OBJCFLAGS) \$(OBJCSRCS) \$(OBJC_LIBS) -L. -l\$(TARGET) # ----------------------------------------------------------------- # Cleaning the Objective-C examples Modified: branches/gsoc2009-ashishs99/configure.in =================================================================== --- branches/gsoc2009-ashishs99/configure.in 2012-03-26 15:46:32 UTC (rev 12956) +++ branches/gsoc2009-ashishs99/configure.in 2012-03-26 18:52:47 UTC (rev 12957) @@ -1046,16 +1046,19 @@ # linking options case \$host in *-*-darwin*) - OBJCDYNAMICLINKING="-dynamiclib -framework Foundation" + OBJCDYNAMICLINKING="-dynamiclib" + OBJCLIBS="-framework Foundation" OBJCCFLAGS="" ;; *-*-linux*) OBJCDYNAMICLINKING="\$OBJCLIB" + OBJCLIBS="\$OBJCLIB" OBJCCFLAGS="-fconstant-string-class=NSConstantString" #To avoid crytpic NXConstantString error with GNUStep...! ;; *) OBJCDYNAMICLINKING="" OBJCCFLAGS="" + OBJCLIBS="" ;; esac @@ -1084,6 +1087,7 @@ AC_SUBST(OBJCINC) AC_SUBST(OBJCDYNAMICLINKING) +AC_SUBST(OBJCLIBS) AC_SUBST(OBJCLIBRARYPREFIX) AC_SUBST(OBJCCFLAGS) AC_SUBST(OBJC) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Swig-cvs] SF.net SVN: swig:[13056] branches/gsoc2009-ashishs99 From: - 2012-05-09 18:52:11 ```Revision: 13056 http://swig.svn.sourceforge.net/swig/?rev=13056&view=rev Author: ashishs99 Date: 2012-05-09 18:51:58 +0000 (Wed, 09 May 2012) Log Message: ----------- Merged trunk revisions 12684:13025 to gsoc2009-ashishs99 Modified Paths: -------------- branches/gsoc2009-ashishs99/ANNOUNCE branches/gsoc2009-ashishs99/CHANGES branches/gsoc2009-ashishs99/CHANGES.current branches/gsoc2009-ashishs99/COPYRIGHT branches/gsoc2009-ashishs99/Doc/Manual/CSharp.html branches/gsoc2009-ashishs99/Doc/Manual/Chicken.html branches/gsoc2009-ashishs99/Doc/Manual/Contents.html branches/gsoc2009-ashishs99/Doc/Manual/Customization.html branches/gsoc2009-ashishs99/Doc/Manual/D.html branches/gsoc2009-ashishs99/Doc/Manual/Extending.html branches/gsoc2009-ashishs99/Doc/Manual/Go.html branches/gsoc2009-ashishs99/Doc/Manual/Guile.html branches/gsoc2009-ashishs99/Doc/Manual/Java.html branches/gsoc2009-ashishs99/Doc/Manual/Library.html branches/gsoc2009-ashishs99/Doc/Manual/Lisp.html branches/gsoc2009-ashishs99/Doc/Manual/Lua.html branches/gsoc2009-ashishs99/Doc/Manual/Modula3.html branches/gsoc2009-ashishs99/Doc/Manual/Mzscheme.html branches/gsoc2009-ashishs99/Doc/Manual/Ocaml.html branches/gsoc2009-ashishs99/Doc/Manual/Octave.html branches/gsoc2009-ashishs99/Doc/Manual/Perl5.html branches/gsoc2009-ashishs99/Doc/Manual/Php.html branches/gsoc2009-ashishs99/Doc/Manual/Pike.html branches/gsoc2009-ashishs99/Doc/Manual/Preprocessor.html branches/gsoc2009-ashishs99/Doc/Manual/Python.html branches/gsoc2009-ashishs99/Doc/Manual/R.html branches/gsoc2009-ashishs99/Doc/Manual/Ruby.html branches/gsoc2009-ashishs99/Doc/Manual/SWIG.html branches/gsoc2009-ashishs99/Doc/Manual/SWIGPlus.html branches/gsoc2009-ashishs99/Doc/Manual/Sections.html branches/gsoc2009-ashishs99/Doc/Manual/Tcl.html branches/gsoc2009-ashishs99/Doc/Manual/Typemaps.html branches/gsoc2009-ashishs99/Doc/Manual/Warnings.html branches/gsoc2009-ashishs99/Doc/Manual/Windows.html branches/gsoc2009-ashishs99/Doc/Manual/chapters branches/gsoc2009-ashishs99/Examples/Makefile.in branches/gsoc2009-ashishs99/Examples/csharp/callback/example-cs.csproj branches/gsoc2009-ashishs99/Examples/csharp/callback/example-vc.vcproj branches/gsoc2009-ashishs99/Examples/csharp/callback/example.sln branches/gsoc2009-ashishs99/Examples/csharp/class/example-cs.csproj branches/gsoc2009-ashishs99/Examples/csharp/class/example-vc.vcproj branches/gsoc2009-ashishs99/Examples/csharp/class/example.sln branches/gsoc2009-ashishs99/Examples/csharp/enum/example-cs.csproj branches/gsoc2009-ashishs99/Examples/csharp/enum/example-vc.vcproj branches/gsoc2009-ashishs99/Examples/csharp/enum/example.sln branches/gsoc2009-ashishs99/Examples/csharp/extend/example-cs.csproj branches/gsoc2009-ashishs99/Examples/csharp/extend/example-vc.vcproj branches/gsoc2009-ashishs99/Examples/csharp/extend/example.sln branches/gsoc2009-ashishs99/Examples/csharp/funcptr/example-cs.csproj branches/gsoc2009-ashishs99/Examples/csharp/funcptr/example-vc.vcproj branches/gsoc2009-ashishs99/Examples/csharp/funcptr/example.sln branches/gsoc2009-ashishs99/Examples/csharp/reference/example-cs.csproj branches/gsoc2009-ashishs99/Examples/csharp/reference/example-vc.vcproj branches/gsoc2009-ashishs99/Examples/csharp/reference/example.sln branches/gsoc2009-ashishs99/Examples/csharp/simple/example-cs.csproj branches/gsoc2009-ashishs99/Examples/csharp/simple/example-vc.vcproj branches/gsoc2009-ashishs99/Examples/csharp/simple/example.sln branches/gsoc2009-ashishs99/Examples/csharp/template/example-cs.csproj branches/gsoc2009-ashishs99/Examples/csharp/template/example-vc.vcproj branches/gsoc2009-ashishs99/Examples/csharp/template/example.sln branches/gsoc2009-ashishs99/Examples/csharp/variables/example-cs.csproj branches/gsoc2009-ashishs99/Examples/csharp/variables/example-vc.vcproj branches/gsoc2009-ashishs99/Examples/csharp/variables/example.sln branches/gsoc2009-ashishs99/Examples/d/variables/d2/runme.d branches/gsoc2009-ashishs99/Examples/go/extend/runme.go branches/gsoc2009-ashishs99/Examples/octave/callback/Makefile branches/gsoc2009-ashishs99/Examples/octave/check.list branches/gsoc2009-ashishs99/Examples/octave/class/Makefile branches/gsoc2009-ashishs99/Examples/octave/constants/Makefile branches/gsoc2009-ashishs99/Examples/octave/contract/Makefile branches/gsoc2009-ashishs99/Examples/octave/enum/Makefile branches/gsoc2009-ashishs99/Examples/octave/extend/Makefile branches/gsoc2009-ashishs99/Examples/octave/funcptr/Makefile branches/gsoc2009-ashishs99/Examples/octave/funcptr2/Makefile branches/gsoc2009-ashishs99/Examples/octave/functor/Makefile branches/gsoc2009-ashishs99/Examples/octave/operator/Makefile branches/gsoc2009-ashishs99/Examples/octave/operator/example.h branches/gsoc2009-ashishs99/Examples/octave/operator/example.i branches/gsoc2009-ashishs99/Examples/octave/operator/runme.m branches/gsoc2009-ashishs99/Examples/octave/pointer/Makefile branches/gsoc2009-ashishs99/Examples/octave/reference/Makefile branches/gsoc2009-ashishs99/Examples/octave/simple/Makefile branches/gsoc2009-ashishs99/Examples/octave/template/Makefile branches/gsoc2009-ashishs99/Examples/octave/variables/Makefile branches/gsoc2009-ashishs99/Examples/test-suite/common.mk branches/gsoc2009-ashishs99/Examples/test-suite/cpp_typedef.i branches/gsoc2009-ashishs99/Examples/test-suite/csharp/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/d/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/d/allprotected_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/d_nativepointers_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/d_nativepointers_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/director_ignore_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_boost_shared_ptr_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/li_std_vector_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/preproc_constants_c_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/preproc_constants_c_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/d/preproc_constants_runme.1.d branches/gsoc2009-ashishs99/Examples/test-suite/d/preproc_constants_runme.2.d branches/gsoc2009-ashishs99/Examples/test-suite/director_basic.i branches/gsoc2009-ashishs99/Examples/test-suite/disown.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/expected.log branches/gsoc2009-ashishs99/Examples/test-suite/errors/make.sh branches/gsoc2009-ashishs99/Examples/test-suite/funcptr_cpp.i branches/gsoc2009-ashishs99/Examples/test-suite/go/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/go/director_basic_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_template_fast_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/overload_template_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/template_default_arg_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/go/virtual_poly_runme.go branches/gsoc2009-ashishs99/Examples/test-suite/java/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/java/java_lib_arrays_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/java_lib_various_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/template_default_class_parms_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java_lib_arrays.i branches/gsoc2009-ashishs99/Examples/test-suite/li_boost_intrusive_ptr.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_vector.i branches/gsoc2009-ashishs99/Examples/test-suite/lua/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/lua/abstract_access_runme.lua branches/gsoc2009-ashishs99/Examples/test-suite/lua/cpp_basic_runme.lua branches/gsoc2009-ashishs99/Examples/test-suite/lua/disown_runme.lua branches/gsoc2009-ashishs99/Examples/test-suite/lua/enums_runme.lua branches/gsoc2009-ashishs99/Examples/test-suite/lua/exception_order_runme.lua branches/gsoc2009-ashishs99/Examples/test-suite/lua/import_nomodule_runme.lua branches/gsoc2009-ashishs99/Examples/test-suite/lua/li_carrays_runme.lua branches/gsoc2009-ashishs99/Examples/test-suite/lua/li_std_string_runme.lua branches/gsoc2009-ashishs99/Examples/test-suite/lua/li_typemaps_runme.lua branches/gsoc2009-ashishs99/Examples/test-suite/lua/operator_overload_runme.lua branches/gsoc2009-ashishs99/Examples/test-suite/nspace.i branches/gsoc2009-ashishs99/Examples/test-suite/nspace_extend.i branches/gsoc2009-ashishs99/Examples/test-suite/octave/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/operator_pointer_ref.i branches/gsoc2009-ashishs99/Examples/test-suite/preproc_constants.i branches/gsoc2009-ashishs99/Examples/test-suite/preproc_include.i branches/gsoc2009-ashishs99/Examples/test-suite/python/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/python/refcount_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/threads_exception_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/typename_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/r/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/refcount.i branches/gsoc2009-ashishs99/Examples/test-suite/ruby/Makefile.in branches/gsoc2009-ashishs99/Examples/test-suite/special_variable_macros.i branches/gsoc2009-ashishs99/Examples/test-suite/special_variables.i branches/gsoc2009-ashishs99/Examples/test-suite/template_typemaps.i branches/gsoc2009-ashishs99/Examples/test-suite/typedef_class.i branches/gsoc2009-ashishs99/Examples/test-suite/typedef_struct.i branches/gsoc2009-ashishs99/Examples/test-suite/typemap_template.i branches/gsoc2009-ashishs99/Examples/test-suite/typemap_various.i branches/gsoc2009-ashishs99/Lib/allegrocl/allegrocl.swg branches/gsoc2009-ashishs99/Lib/allegrocl/longlongs.i branches/gsoc2009-ashishs99/Lib/allegrocl/std_string.i branches/gsoc2009-ashishs99/Lib/carrays.i branches/gsoc2009-ashishs99/Lib/cpointer.i branches/gsoc2009-ashishs99/Lib/csharp/boost_shared_ptr.i branches/gsoc2009-ashishs99/Lib/csharp/csharp.swg branches/gsoc2009-ashishs99/Lib/csharp/enums.swg branches/gsoc2009-ashishs99/Lib/csharp/enumsimple.swg branches/gsoc2009-ashishs99/Lib/csharp/enumtypesafe.swg branches/gsoc2009-ashishs99/Lib/d/carrays.i branches/gsoc2009-ashishs99/Lib/d/denums.swg branches/gsoc2009-ashishs99/Lib/d/dhead.swg branches/gsoc2009-ashishs99/Lib/d/dkw.swg branches/gsoc2009-ashishs99/Lib/d/dprimitives.swg branches/gsoc2009-ashishs99/Lib/d/typemaps.i branches/gsoc2009-ashishs99/Lib/d/wrapperloader.swg branches/gsoc2009-ashishs99/Lib/go/go.swg branches/gsoc2009-ashishs99/Lib/go/goruntime.swg branches/gsoc2009-ashishs99/Lib/go/std_string.i branches/gsoc2009-ashishs99/Lib/guile/typemaps.i branches/gsoc2009-ashishs99/Lib/java/arrays_java.i branches/gsoc2009-ashishs99/Lib/java/boost_intrusive_ptr.i branches/gsoc2009-ashishs99/Lib/java/boost_shared_ptr.i branches/gsoc2009-ashishs99/Lib/java/director.swg branches/gsoc2009-ashishs99/Lib/java/enums.swg branches/gsoc2009-ashishs99/Lib/java/enumsimple.swg branches/gsoc2009-ashishs99/Lib/java/enumtypesafe.swg branches/gsoc2009-ashishs99/Lib/java/enumtypeunsafe.swg branches/gsoc2009-ashishs99/Lib/java/java.swg branches/gsoc2009-ashishs99/Lib/java/various.i branches/gsoc2009-ashishs99/Lib/lua/lua.swg branches/gsoc2009-ashishs99/Lib/lua/luarun.swg branches/gsoc2009-ashishs99/Lib/lua/luaruntime.swg branches/gsoc2009-ashishs99/Lib/lua/luatypemaps.swg branches/gsoc2009-ashishs99/Lib/lua/std_string.i branches/gsoc2009-ashishs99/Lib/lua/typemaps.i branches/gsoc2009-ashishs99/Lib/lua/wchar.i branches/gsoc2009-ashishs99/Lib/ocaml/typemaps.i branches/gsoc2009-ashishs99/Lib/octave/octcontainer.swg branches/gsoc2009-ashishs99/Lib/octave/octiterators.swg branches/gsoc2009-ashishs99/Lib/octave/octrun.swg branches/gsoc2009-ashishs99/Lib/octave/octruntime.swg branches/gsoc2009-ashishs99/Lib/octave/std_common.i branches/gsoc2009-ashishs99/Lib/perl5/perlerrors.swg branches/gsoc2009-ashishs99/Lib/perl5/perlinit.swg branches/gsoc2009-ashishs99/Lib/perl5/perlprimtypes.swg branches/gsoc2009-ashishs99/Lib/perl5/perlrun.swg branches/gsoc2009-ashishs99/Lib/perl5/perltypemaps.swg branches/gsoc2009-ashishs99/Lib/php/director.swg branches/gsoc2009-ashishs99/Lib/php/php.swg branches/gsoc2009-ashishs99/Lib/php/phpkw.swg branches/gsoc2009-ashishs99/Lib/php/phprun.swg branches/gsoc2009-ashishs99/Lib/php/std_string.i branches/gsoc2009-ashishs99/Lib/pike/std_string.i branches/gsoc2009-ashishs99/Lib/python/builtin.swg branches/gsoc2009-ashishs99/Lib/python/carrays.i branches/gsoc2009-ashishs99/Lib/python/director.swg branches/gsoc2009-ashishs99/Lib/python/pycontainer.swg branches/gsoc2009-ashishs99/Lib/python/pydocs.swg branches/gsoc2009-ashishs99/Lib/python/pyiterators.swg branches/gsoc2009-ashishs99/Lib/python/pyopers.swg branches/gsoc2009-ashishs99/Lib/python/pyprimtypes.swg branches/gsoc2009-ashishs99/Lib/python/pyrun.swg branches/gsoc2009-ashishs99/Lib/python/pythonkw.swg branches/gsoc2009-ashishs99/Lib/python/std_common.i branches/gsoc2009-ashishs99/Lib/python/std_map.i branches/gsoc2009-ashishs99/Lib/r/r.swg branches/gsoc2009-ashishs99/Lib/r/rcontainer.swg branches/gsoc2009-ashishs99/Lib/r/rrun.swg branches/gsoc2009-ashishs99/Lib/r/rstdcommon.swg branches/gsoc2009-ashishs99/Lib/r/rtype.swg branches/gsoc2009-ashishs99/Lib/r/std_common.i branches/gsoc2009-ashishs99/Lib/r/std_vector.i branches/gsoc2009-ashishs99/Lib/ruby/rubycontainer.swg branches/gsoc2009-ashishs99/Lib/ruby/rubyiterators.swg branches/gsoc2009-ashishs99/Lib/ruby/rubyrun.swg branches/gsoc2009-ashishs99/Lib/ruby/rubyuserdir.swg branches/gsoc2009-ashishs99/Lib/ruby/std_common.i branches/gsoc2009-ashishs99/Lib/ruby/std_set.i branches/gsoc2009-ashishs99/Lib/std/std_common.i branches/gsoc2009-ashishs99/Lib/std/std_vector.i branches/gsoc2009-ashishs99/Lib/swig.swg branches/gsoc2009-ashishs99/Lib/tcl/tclinit.swg branches/gsoc2009-ashishs99/Lib/tcl/tclrun.swg branches/gsoc2009-ashishs99/Lib/tcl/tcltypemaps.swg branches/gsoc2009-ashishs99/Lib/typemaps/carrays.swg branches/gsoc2009-ashishs99/Lib/typemaps/cpointer.swg branches/gsoc2009-ashishs99/Lib/typemaps/fragments.swg branches/gsoc2009-ashishs99/Lib/typemaps/primtypes.swg branches/gsoc2009-ashishs99/Lib/typemaps/ptrtypes.swg branches/gsoc2009-ashishs99/Lib/typemaps/strings.swg branches/gsoc2009-ashishs99/Lib/typemaps/swigobject.swg branches/gsoc2009-ashishs99/Lib/typemaps/swigtype.swg branches/gsoc2009-ashishs99/Lib/typemaps/valtypes.swg branches/gsoc2009-ashishs99/Lib/typemaps/void.swg branches/gsoc2009-ashishs99/Makefile.in branches/gsoc2009-ashishs99/README branches/gsoc2009-ashishs99/RELEASENOTES branches/gsoc2009-ashishs99/Source/CParse/cscanner.c branches/gsoc2009-ashishs99/Source/CParse/parser.y branches/gsoc2009-ashishs99/Source/DOH/base.c branches/gsoc2009-ashishs99/Source/DOH/doh.h branches/gsoc2009-ashishs99/Source/DOH/string.c branches/gsoc2009-ashishs99/Source/Include/swigwarn.h branches/gsoc2009-ashishs99/Source/Modules/allegrocl.cxx branches/gsoc2009-ashishs99/Source/Modules/allocate.cxx branches/gsoc2009-ashishs99/Source/Modules/cffi.cxx branches/gsoc2009-ashishs99/Source/Modules/chicken.cxx branches/gsoc2009-ashishs99/Source/Modules/contract.cxx branches/gsoc2009-ashishs99/Source/Modules/csharp.cxx branches/gsoc2009-ashishs99/Source/Modules/d.cxx branches/gsoc2009-ashishs99/Source/Modules/directors.cxx branches/gsoc2009-ashishs99/Source/Modules/emit.cxx branches/gsoc2009-ashishs99/Source/Modules/go.cxx branches/gsoc2009-ashishs99/Source/Modules/guile.cxx branches/gsoc2009-ashishs99/Source/Modules/java.cxx branches/gsoc2009-ashishs99/Source/Modules/lang.cxx branches/gsoc2009-ashishs99/Source/Modules/lua.cxx branches/gsoc2009-ashishs99/Source/Modules/main.cxx branches/gsoc2009-ashishs99/Source/Modules/modula3.cxx branches/gsoc2009-ashishs99/Source/Modules/mzscheme.cxx branches/gsoc2009-ashishs99/Source/Modules/ocaml.cxx branches/gsoc2009-ashishs99/Source/Modules/octave.cxx branches/gsoc2009-ashishs99/Source/Modules/perl5.cxx branches/gsoc2009-ashishs99/Source/Modules/php.cxx branches/gsoc2009-ashishs99/Source/Modules/pike.cxx branches/gsoc2009-ashishs99/Source/Modules/python.cxx branches/gsoc2009-ashishs99/Source/Modules/r.cxx branches/gsoc2009-ashishs99/Source/Modules/ruby.cxx branches/gsoc2009-ashishs99/Source/Modules/swigmod.h branches/gsoc2009-ashishs99/Source/Modules/tcl8.cxx branches/gsoc2009-ashishs99/Source/Modules/typepass.cxx branches/gsoc2009-ashishs99/Source/Modules/uffi.cxx branches/gsoc2009-ashishs99/Source/Modules/xml.cxx branches/gsoc2009-ashishs99/Source/Preprocessor/cpp.c branches/gsoc2009-ashishs99/Source/Preprocessor/expr.c branches/gsoc2009-ashishs99/Source/Swig/cwrap.c branches/gsoc2009-ashishs99/Source/Swig/fragment.c branches/gsoc2009-ashishs99/Source/Swig/include.c branches/gsoc2009-ashishs99/Source/Swig/misc.c branches/gsoc2009-ashishs99/Source/Swig/naming.c branches/gsoc2009-ashishs99/Source/Swig/stype.c branches/gsoc2009-ashishs99/Source/Swig/swig.h branches/gsoc2009-ashishs99/Source/Swig/swigfile.h branches/gsoc2009-ashishs99/Source/Swig/symbol.c branches/gsoc2009-ashishs99/Source/Swig/typemap.c branches/gsoc2009-ashishs99/Source/Swig/typeobj.c branches/gsoc2009-ashishs99/Source/Swig/typesys.c branches/gsoc2009-ashishs99/TODO branches/gsoc2009-ashishs99/Tools/config/ac_compare_version.m4 branches/gsoc2009-ashishs99/Tools/config/ax_path_generic.m4 branches/gsoc2009-ashishs99/Tools/pcre-build.sh branches/gsoc2009-ashishs99/configure.in Added Paths: ----------- branches/gsoc2009-ashishs99/Doc/Manual/Android.html branches/gsoc2009-ashishs99/Doc/Manual/android-class.png branches/gsoc2009-ashishs99/Doc/Manual/android-simple.png branches/gsoc2009-ashishs99/Examples/android/ branches/gsoc2009-ashishs99/Examples/android/check.list branches/gsoc2009-ashishs99/Examples/android/class/ branches/gsoc2009-ashishs99/Examples/android/class/AndroidManifest.xml branches/gsoc2009-ashishs99/Examples/android/class/Makefile branches/gsoc2009-ashishs99/Examples/android/class/ant.properties branches/gsoc2009-ashishs99/Examples/android/class/build.xml branches/gsoc2009-ashishs99/Examples/android/class/jni/ branches/gsoc2009-ashishs99/Examples/android/class/jni/Android.mk branches/gsoc2009-ashishs99/Examples/android/class/jni/example.cpp branches/gsoc2009-ashishs99/Examples/android/class/jni/example.h branches/gsoc2009-ashishs99/Examples/android/class/jni/example.i branches/gsoc2009-ashishs99/Examples/android/class/local.properties branches/gsoc2009-ashishs99/Examples/android/class/proguard.cfg branches/gsoc2009-ashishs99/Examples/android/class/project.properties branches/gsoc2009-ashishs99/Examples/android/class/res/ branches/gsoc2009-ashishs99/Examples/android/class/res/layout/ branches/gsoc2009-ashishs99/Examples/android/class/res/layout/main.xml branches/gsoc2009-ashishs99/Examples/android/class/res/values/ branches/gsoc2009-ashishs99/Examples/android/class/res/values/strings.xml branches/gsoc2009-ashishs99/Examples/android/class/src/ branches/gsoc2009-ashishs99/Examples/android/class/src/org/ branches/gsoc2009-ashishs99/Examples/android/class/src/org/swig/ branches/gsoc2009-ashishs99/Examples/android/class/src/org/swig/classexample/ branches/gsoc2009-ashishs99/Examples/android/class/src/org/swig/classexample/SwigClass.java branches/gsoc2009-ashishs99/Examples/android/simple/ branches/gsoc2009-ashishs99/Examples/android/simple/AndroidManifest.xml branches/gsoc2009-ashishs99/Examples/android/simple/Makefile branches/gsoc2009-ashishs99/Examples/android/simple/ant.properties branches/gsoc2009-ashishs99/Examples/android/simple/build.xml branches/gsoc2009-ashishs99/Examples/android/simple/jni/ branches/gsoc2009-ashishs99/Examples/android/simple/jni/Android.mk branches/gsoc2009-ashishs99/Examples/android/simple/jni/example.c branches/gsoc2009-ashishs99/Examples/android/simple/jni/example.i branches/gsoc2009-ashishs99/Examples/android/simple/libs/ branches/gsoc2009-ashishs99/Examples/android/simple/local.properties branches/gsoc2009-ashishs99/Examples/android/simple/proguard.cfg branches/gsoc2009-ashishs99/Examples/android/simple/project.properties branches/gsoc2009-ashishs99/Examples/android/simple/res/ branches/gsoc2009-ashishs99/Examples/android/simple/res/layout/ branches/gsoc2009-ashishs99/Examples/android/simple/res/layout/main.xml branches/gsoc2009-ashishs99/Examples/android/simple/res/values/ branches/gsoc2009-ashishs99/Examples/android/simple/res/values/strings.xml branches/gsoc2009-ashishs99/Examples/android/simple/src/ branches/gsoc2009-ashishs99/Examples/android/simple/src/org/ branches/gsoc2009-ashishs99/Examples/android/simple/src/org/swig/ branches/gsoc2009-ashishs99/Examples/android/simple/src/org/swig/simple/ branches/gsoc2009-ashishs99/Examples/android/simple/src/org/swig/simple/SwigSimple.java branches/gsoc2009-ashishs99/Examples/octave/module_load/ branches/gsoc2009-ashishs99/Examples/octave/module_load/Makefile branches/gsoc2009-ashishs99/Examples/octave/module_load/example.c branches/gsoc2009-ashishs99/Examples/octave/module_load/example.h branches/gsoc2009-ashishs99/Examples/octave/module_load/example.i branches/gsoc2009-ashishs99/Examples/octave/module_load/runme_args.m branches/gsoc2009-ashishs99/Examples/octave/module_load/runme_gl_func.m branches/gsoc2009-ashishs99/Examples/octave/module_load/runme_gl_func_base.m branches/gsoc2009-ashishs99/Examples/octave/module_load/runme_nogl_func.m branches/gsoc2009-ashishs99/Examples/octave/module_load/runme_nogl_func_base.m branches/gsoc2009-ashishs99/Examples/test-suite/autodoc.i branches/gsoc2009-ashishs99/Examples/test-suite/class_forward.i branches/gsoc2009-ashishs99/Examples/test-suite/csharp/director_nspace_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/csharp/li_std_vector_enum_runme.cs branches/gsoc2009-ashishs99/Examples/test-suite/director_binary_string.i branches/gsoc2009-ashishs99/Examples/test-suite/director_nspace.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/cpp_extend_destructors.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/cpp_no_return_type.i branches/gsoc2009-ashishs99/Examples/test-suite/errors/swig_typemap_warn.i branches/gsoc2009-ashishs99/Examples/test-suite/extend_constructor_destructor.i branches/gsoc2009-ashishs99/Examples/test-suite/extend_typedef_class.i branches/gsoc2009-ashishs99/Examples/test-suite/java/director_binary_string_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/director_nspace_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/extend_constructor_destructor_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/extend_typedef_class_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/li_boost_shared_ptr_template_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/li_std_vector_enum_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/template_default_class_parms_typedef_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/java/template_typedef_inherit_runme.java branches/gsoc2009-ashishs99/Examples/test-suite/kwargs_feature.i branches/gsoc2009-ashishs99/Examples/test-suite/li_boost_shared_ptr_template.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_containers_int.i branches/gsoc2009-ashishs99/Examples/test-suite/li_std_vector_enum.i branches/gsoc2009-ashishs99/Examples/test-suite/lua/li_factory_runme.lua branches/gsoc2009-ashishs99/Examples/test-suite/lua/lua_no_module_global_runme.lua branches/gsoc2009-ashishs99/Examples/test-suite/lua_no_module_global.i branches/gsoc2009-ashishs99/Examples/test-suite/octave/li_std_vector_enum_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/octave/octave_dim_runme.m branches/gsoc2009-ashishs99/Examples/test-suite/octave_dim.i branches/gsoc2009-ashishs99/Examples/test-suite/overload_method.i branches/gsoc2009-ashishs99/Examples/test-suite/php/virtual_vs_nonvirtual_base_runme.php branches/gsoc2009-ashishs99/Examples/test-suite/preproc_include_h1.i branches/gsoc2009-ashishs99/Examples/test-suite/preproc_include_h2.i branches/gsoc2009-ashishs99/Examples/test-suite/preproc_include_h3.i branches/gsoc2009-ashishs99/Examples/test-suite/python/autodoc_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/kwargs_feature_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/li_boost_shared_ptr_template_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/li_std_containers_int_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/li_std_vector_enum_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/li_std_vector_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/template_typemaps_typedef2_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python/template_typemaps_typedef_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python_director.i branches/gsoc2009-ashishs99/Examples/test-suite/r/overload_method_runme.R branches/gsoc2009-ashishs99/Examples/test-suite/r_overload_array.i branches/gsoc2009-ashishs99/Examples/test-suite/redefined_not.i branches/gsoc2009-ashishs99/Examples/test-suite/ruby/li_std_vector_enum_runme.rb branches/gsoc2009-ashishs99/Examples/test-suite/template_default_class_parms_typedef.i branches/gsoc2009-ashishs99/Examples/test-suite/template_typedef_class_template.i branches/gsoc2009-ashishs99/Examples/test-suite/template_typedef_inherit.i branches/gsoc2009-ashishs99/Examples/test-suite/template_typemaps_typedef.i branches/gsoc2009-ashishs99/Examples/test-suite/template_typemaps_typedef2.i branches/gsoc2009-ashishs99/Examples/test-suite/typemap_manyargs.i branches/gsoc2009-ashishs99/Examples/test-suite/virtual_vs_nonvirtual_base.i branches/gsoc2009-ashishs99/Lib/csharp/boost_intrusive_ptr.i branches/gsoc2009-ashishs99/Lib/go/std_list.i branches/gsoc2009-ashishs99/Lib/lua/factory.i branches/gsoc2009-ashishs99/Lib/octave/std_list.i branches/gsoc2009-ashishs99/Lib/r/std_list.i Removed Paths: ------------- branches/gsoc2009-ashishs99/Doc/Manual/ch11.1.png branches/gsoc2009-ashishs99/Doc/Manual/ch11.2.png branches/gsoc2009-ashishs99/Doc/Manual/ch11.3.png branches/gsoc2009-ashishs99/Doc/Manual/ch12.1.png branches/gsoc2009-ashishs99/Doc/Manual/ch9.table.2.png branches/gsoc2009-ashishs99/Examples/android/check.list branches/gsoc2009-ashishs99/Examples/android/class/ branches/gsoc2009-ashishs99/Examples/android/class/AndroidManifest.xml branches/gsoc2009-ashishs99/Examples/android/class/Makefile branches/gsoc2009-ashishs99/Examples/android/class/ant.properties branches/gsoc2009-ashishs99/Examples/android/class/build.xml branches/gsoc2009-ashishs99/Examples/android/class/jni/ branches/gsoc2009-ashishs99/Examples/android/class/jni/Android.mk branches/gsoc2009-ashishs99/Examples/android/class/jni/example.cpp branches/gsoc2009-ashishs99/Examples/android/class/jni/example.h branches/gsoc2009-ashishs99/Examples/android/class/jni/example.i branches/gsoc2009-ashishs99/Examples/android/class/local.properties branches/gsoc2009-ashishs99/Examples/android/class/proguard.cfg branches/gsoc2009-ashishs99/Examples/android/class/project.properties branches/gsoc2009-ashishs99/Examples/android/class/res/ branches/gsoc2009-ashishs99/Examples/android/class/res/layout/ branches/gsoc2009-ashishs99/Examples/android/class/res/layout/main.xml branches/gsoc2009-ashishs99/Examples/android/class/res/values/ branches/gsoc2009-ashishs99/Examples/android/class/res/values/strings.xml branches/gsoc2009-ashishs99/Examples/android/class/src/ branches/gsoc2009-ashishs99/Examples/android/class/src/org/ branches/gsoc2009-ashishs99/Examples/android/class/src/org/swig/ branches/gsoc2009-ashishs99/Examples/android/class/src/org/swig/classexample/ branches/gsoc2009-ashishs99/Examples/android/class/src/org/swig/classexample/SwigClass.java branches/gsoc2009-ashishs99/Examples/android/simple/ branches/gsoc2009-ashishs99/Examples/android/simple/AndroidManifest.xml branches/gsoc2009-ashishs99/Examples/android/simple/Makefile branches/gsoc2009-ashishs99/Examples/android/simple/ant.properties branches/gsoc2009-ashishs99/Examples/android/simple/build.xml branches/gsoc2009-ashishs99/Examples/android/simple/jni/ branches/gsoc2009-ashishs99/Examples/android/simple/jni/Android.mk branches/gsoc2009-ashishs99/Examples/android/simple/jni/example.c branches/gsoc2009-ashishs99/Examples/android/simple/jni/example.i branches/gsoc2009-ashishs99/Examples/android/simple/libs/ branches/gsoc2009-ashishs99/Examples/android/simple/local.properties branches/gsoc2009-ashishs99/Examples/android/simple/proguard.cfg branches/gsoc2009-ashishs99/Examples/android/simple/project.properties branches/gsoc2009-ashishs99/Examples/android/simple/res/ branches/gsoc2009-ashishs99/Examples/android/simple/res/layout/ branches/gsoc2009-ashishs99/Examples/android/simple/res/layout/main.xml branches/gsoc2009-ashishs99/Examples/android/simple/res/values/ branches/gsoc2009-ashishs99/Examples/android/simple/res/values/strings.xml branches/gsoc2009-ashishs99/Examples/android/simple/src/ branches/gsoc2009-ashishs99/Examples/android/simple/src/org/ branches/gsoc2009-ashishs99/Examples/android/simple/src/org/swig/ branches/gsoc2009-ashishs99/Examples/android/simple/src/org/swig/simple/ branches/gsoc2009-ashishs99/Examples/android/simple/src/org/swig/simple/SwigSimple.java branches/gsoc2009-ashishs99/Examples/octave/module_load/Makefile branches/gsoc2009-ashishs99/Examples/octave/module_load/example.c branches/gsoc2009-ashishs99/Examples/octave/module_load/example.h branches/gsoc2009-ashishs99/Examples/octave/module_load/example.i branches/gsoc2009-ashishs99/Examples/octave/module_load/runme_args.m branches/gsoc2009-ashishs99/Examples/octave/module_load/runme_gl_func.m branches/gsoc2009-ashishs99/Examples/octave/module_load/runme_gl_func_base.m branches/gsoc2009-ashishs99/Examples/octave/module_load/runme_nogl_func.m branches/gsoc2009-ashishs99/Examples/octave/module_load/runme_nogl_func_base.m branches/gsoc2009-ashishs99/Examples/test-suite/d_exception_name.i branches/gsoc2009-ashishs99/Examples/test-suite/perl5/Test/ branches/gsoc2009-ashishs99/Examples/test-suite/python/python_kwargs_runme.py branches/gsoc2009-ashishs99/Examples/test-suite/python_autodoc.i branches/gsoc2009-ashishs99/Examples/test-suite/python_kwargs.i Property Changed: ---------------- branches/gsoc2009-ashishs99/ branches/gsoc2009-ashishs99/Examples/csharp/callback/example-cs.csproj branches/gsoc2009-ashishs99/Examples/csharp/callback/example-vc.vcproj branches/gsoc2009-ashishs99/Examples/csharp/callback/example.sln branches/gsoc2009-ashishs99/Examples/csharp/class/example-cs.csproj branches/gsoc2009-ashishs99/Examples/csharp/class/example-vc.vcproj branches/gsoc2009-ashishs99/Examples/csharp/class/example.sln branches/gsoc2009-ashishs99/Examples/csharp/enum/example-cs.csproj branches/gsoc2009-ashishs99/Examples/csharp/enum/example-vc.vcproj branches/gsoc2009-ashishs99/Examples/csharp/enum/example.sln branches/gsoc2009-ashishs99/Examples/csharp/extend/example-cs.csproj branches/gsoc2009-ashishs99/Examples/csharp/extend/example-vc.vcproj branches/gsoc2009-ashishs99/Examples/csharp/extend/example.sln branches/gsoc2009-ashishs99/Examples/csharp/funcptr/example-cs.csproj branches/gsoc2009-ashishs99/Examples/csharp/funcptr/example-vc.vcproj branches/gsoc2009-ashishs99/Examples/csharp/funcptr/example.sln branches/gsoc2009-ashishs99/Examples/csharp/reference/example-cs.csproj branches/gsoc2009-ashishs99/Examples/csharp/reference/example-vc.vcproj branches/gsoc2009-ashishs99/Examples/csharp/reference/example.sln branches/gsoc2009-ashishs99/Examples/csharp/simple/example-cs.csproj branches/gsoc2009-ashishs99/Examples/csharp/simple/example-vc.vcproj branches/gsoc2009-ashishs99/Examples/csharp/simple/example.sln branches/gsoc2009-ashishs99/Examples/csharp/template/example-cs.csproj branches/gsoc2009-ashishs99/Examples/csharp/template/example-vc.vcproj branches/gsoc2009-ashishs99/Examples/csharp/template/example.sln branches/gsoc2009-ashishs99/Examples/csharp/variables/example-cs.csproj branches/gsoc2009-ashishs99/Examples/csharp/variables/example-vc.vcproj branches/gsoc2009-ashishs99/Examples/csharp/variables/example.sln branches/gsoc2009-ashishs99/Examples/r/class/example.dsp branches/gsoc2009-ashishs99/Examples/test-suite/go/ branches/gsoc2009-ashishs99/configure.in Property changes on: branches/gsoc2009-ashishs99 ___________________________________________________________________ Modified: svn:mergeinfo - /branches/swig-2.0:11085-11086,11088-11089 /branches/szager-python-builtin:12331-12595 /trunk:11208-11696,11698-12106,12108-12708 + /branches/swig-2.0:11085-11086,11088-11089 /branches/szager-python-builtin:12331-12595 /trunk:11208-11696,11698-12106,12108-13025 Modified: branches/gsoc2009-ashishs99/ANNOUNCE =================================================================== --- branches/gsoc2009-ashishs99/ANNOUNCE 2012-05-09 16:45:07 UTC (rev 13055) +++ branches/gsoc2009-ashishs99/ANNOUNCE 2012-05-09 18:51:58 UTC (rev 13056) @@ -1,8 +1,8 @@ -*** ANNOUNCE: SWIG 2.0.5 (in progress) *** +*** ANNOUNCE: SWIG 2.0.6 (30 April 2012) *** http://www.swig.org -We're pleased to announce SWIG-2.0.5, the latest SWIG release. +We're pleased to announce SWIG-2.0.6, the latest SWIG release. What is SWIG? ============= @@ -21,11 +21,11 @@ ============ The release is available for download on Sourceforge at - http://prdownloads.sourceforge.net/swig/swig-2.0.5.tar.gz + http://prdownloads.sourceforge.net/swig/swig-2.0.6.tar.gz A Windows version is also available at - http://prdownloads.sourceforge.net/swig/swigwin-2.0.5.zip + http://prdownloads.sourceforge.net/swig/swigwin-2.0.6.zip Please report problems with this release to the swig-devel mailing list, details at http://www.swig.org/mail.html. Modified: branches/gsoc2009-ashishs99/CHANGES =================================================================== --- branches/gsoc2009-ashishs99/CHANGES 2012-05-09 16:45:07 UTC (rev 13055) +++ branches/gsoc2009-ashishs99/CHANGES 2012-05-09 18:51:58 UTC (rev 13056) @@ -3,8 +3,449 @@ See the CHANGES.current file for changes in the current version. See the RELEASENOTES file for a summary of changes in each release. +Version 2.0.5 (19 April 2012) +============================= + +2012-04-14: wsfulton + [Lua] Apply patch #3517435 from Miles Bader - prefer to use Lua_pushglobaltable + +2012-04-14: wsfulton + [Ruby] Apply patch #3517769 from Robin Stocker to fix compile error on MacRuby using RSTRING_PTR. + +2012-04-13: wsfulton + Apply patch #3511009 from Leif Middelschulte for slightly optimised char * variable wrappers. + +2012-04-13: wsfulton + [Lua] Apply #3219676 from Shane Liesegang which adds: + - support for %factory + - a __tostring method + - a __disown method + +2012-04-13: wsfulton + [Xml] Apply #3513569 which adds a catchlist to the xml output. + +2012-04-05: olly + [Lua] Add support for Lua 5.2 (patch SF#3514593 from Miles Bader) + +2012-03-26: xavier98 + [octave] Apply patch #3425993 from jgillis: add extra logic to the octave_swig_type::dims(void) method: it checks if the user has defined a __dims__ method and uses this in stead of returning (1,1) + [octave] Apply patch #3424833 from jgillis: make is_object return true for swig types + +2012-03-24: wsfulton + [D] Apply #3502431 to fix duplicate symbols in multiple modules. + +2012-03-21: wsfulton + Fix #3494791 - %\$isglobal for %rename matching. + +2012-03-20: wsfulton + Fix #3487706 and #3391906 - missing stddef.h include for ptrdiff_t when using %import + for STL containers and compiling with g++-4.6. An include of stddef.h is now only + generated when SWIG generates STL helper templates which require ptrdiff_t. If you + were previously relying on "#include " always being generated when using a + %include of an STL header, you may now need to add this in manually. + +2012-03-16: wsfulton + Apply patch #3392264 from Sebastien Bine to parse (unsigned) long long types in enum value assignment. + +2012-03-16: wsfulton + Apply patch #3505530 from Karl Wette to allow custom allocators in STL string classes for the UTL languages. + +2012-03-13: wsfulton + Apply patch #3468362 from Karl Wette to fix %include inside %define. + +2012-03-13: wsfulton + [Python, Ruby, Octave, R] Fix #3475492 - iterating through std::vector wrappers of enumerations. + +2012-02-27: xavier98 (patches from Karl Wette) + [Octave] Use -globals . to load global variables in module namespace + [Octave] Comment declaration of unimplemented function swig_register_director + [Octave] Fix OCTAVE_PATH in octave Makefiles + [Octave] Add support for std::list - fix li_std_containers_int test + [Octave] Fix imports test + +2012-02-16: wsfulton + [Java] Make generated support functions in arrays_java.i static so that generated code + from multiple instances of SWIG can be compiled and linked together - problem reported by + Evan Krause. + +2012-01-24: wsfulton + Fix crash with bad regex - bug #3474250. + +2012-01-24: wsfulton + [Python] Add Python stepped slicing support to the STL wrappers (std::vector, std::list). + Assigning to a slice, reading a slice and deleting a slice with steps now work. + For example: + + %template(vector_i) std::vector + + vi = vector_i(range(10)) + print list(vi) + vi[1:4:2] = [111, 333] + print list(vi) + del vi[3:10:3] + print list(vi) + print list(vi[::-1]) + + gives (same behaviour as native Python sequences such as list): + + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + [0, 111, 2, 333, 4, 5, 6, 7, 8, 9] + [0, 111, 2, 4, 5, 7, 8] + [8, 7, 5, 4, 2, 111, 0] + +2012-01-23: klickverbot + [D] Correctly annotate function pointers with C linkage. + [D] Exception and Error have become blessed names; removed d_exception_name test case. + +2012-01-20: wsfulton + [Python] Fix some indexing bugs in Python STL wrappers when the index is negative, eg: + + %template(vector_i) std::vector + + iv=vector_i([0,1,2,3,4,5]) + iv[-7:] + + now returns [0, 1, 2, 3, 4, 5] instead of [5]. + + vv[7:9] = [22,33] + + now returns [0, 1, 2, 3, 4, 5, 22, 33] instead of "index out range" error. + + Also fix some segfaults when replacing ranges, eg when il is a std::list wrapper: + + il[0:2] = [11] + +2012-01-17: wsfulton + [Go] Fix forward class declaration within a class when used as a base. + +2012-01-07: wsfulton + [C#] Add support for %nspace when using directors. + +2012-01-06: wsfulton + [Java] Patch #3452560 from Brant Kyser - add support for %nspace when using directors. + +2011-12-21: wsfulton + The 'directorin' typemap now accepts \$1, \$2 etc expansions instead of having to use workarounds - + \$1_name, \$2_name etc. + +2011-12-20: wsfulton + [Java] Add (char *STRING, size_t LENGTH) director typemaps. + +2011-12-20: wsfulton + [C#, Go, Java, D] Add support for the 'directorargout' typemap. + +2011-12-20: wsfulton + [Ocaml, Octave, PHP, Python, Ruby] Correct special variables in 'directorargout' typemap. + This change will break any 'directorargout' typemaps you may have written. Please change: + \$result to \$1 + \$input to \$result + + Also fix the named 'directorargout' DIRECTOROUT typemaps for these languages which didn't + previously compile and add in \$1, \$2 etc expansion. + + *** POTENTIAL INCOMPATIBILITY *** + +2011-12-10: talby + [perl5] SWIG_error() now gets decorated with perl source file/line number. + [perl5] error handling now conforms to public XS api (fixes perl v5.14 issue). + +2011-12-10: wsfulton + [Android/Java] Fix directors to compile on Android. + + Added documentation and examples for Android. + +2011-12-08: vadz + Bug fix: Handle methods renamed or ignored in the base class correctly in the derived classes + (they could be sometimes mysteriously not renamed or ignored there before). + +2011-12-03: klickverbot + [D] Fix exception glue code for newer DMD 2 versions. + [D] Do not default to 32 bit glue code for DMD anymore. + [D] Use stdc.config.c_long/c_ulong to represent C long types. + +2011-12-01: szager + [python] Fixed bug 3447426: memory leak in vector.__getitem__. + +2011-11-30: wsfulton + [R] Remove C++ comments from generated C code. + +2011-11-27: olly + [Python] Fix some warnings when compiling generated wrappers with + certain GCC warning options (Debian bug #650246). + +2011-11-28: wsfulton + Fix #3433541 %typemap(in, numinputs=0) with 10+ arguments. + +2011-11-28: olly + [Perl] Fix warnings when compiling generated wrappers with certain + GCC warning options (Debian bug #436711). + +2011-11-28: olly + [PHP] Update keyword list to include keywords added in PHP releases up to 5.3. + +2011-11-25: wsfulton + [C#] Provide an easy way to override the default visibility for the proxy class pointer + constructors and getCPtr() method. The visibility is 'internal' by default and if multiple + SWIG modules are being used and compiled into different assemblies, then they need to be + 'public' in order to use the constructor or getCPtr() method from a different assembly. + Use the following macros to change the visibilities in the proxy and type wrapper class: + + SWIG_CSBODY_PROXY(public, public, SWIGTYPE) + SWIG_CSBODY_TYPEWRAPPER(public, public, public, SWIGTYPE) + + [Java] Provide an easy way to override the default visibility for the proxy class pointer + constructors and getCPtr() method. The visibility is 'protected' by default and if multiple + SWIG modules are being used and compiled into different packages, then they need to be + 'public' in order to use the constructor or getCPtr() method from a different package. + Use the following macros to change the visibilities in the proxy and type wrapper class: + + SWIG_JAVABODY_PROXY(public, public, SWIGTYPE) + SWIG_JAVABODY_TYPEWRAPPER(public, public, public, SWIGTYPE) + + The default for Java has changed from public to protected for the proxy classes. Use the + SWIG_JAVABODY_PROXY macro above to restore to the previous visibilities. + + *** POTENTIAL INCOMPATIBILITY *** + +2011-11-22: szager + [python] Bug 3440044: #ifdef out SWIG_Python_NonDynamicSetAttr if -builtin + isn't being used, to avoid unnecessary binary incompatibilities between + python installations. + +2011-11-17: wsfulton + Bug fix: Remove root directory from directory search list in Windows. + +2011-11-13: wsfulton + [Ruby] Apply patch #3421876 from Robin Stocker to fix #3416818 - same class name in + different namespaces confusion when using multiple modules. + +2011-11-11: wsfulton + Fix pcre-build.sh to work with non-compressed tarballs - problem reported by Adrian Blakely. + +2011-11-03: wsfulton + Expand special variables in typemap warnings, eg: + + %typemap(in, warning="1000:Test warning for 'in' typemap for \$1_type \$1_name") int "..." + +2011-11-01: wsfulton + Fix named output typemaps not being used when the symbol uses a qualifier and contains + a number, eg: + + %typemap(out) double ABC::m1 "..." + +2011-10-24: talby + [perl5] SF bug #3423119 - overload dispatch stack corruption fix. Better, but more research + is needed on a stable path for tail calls in XS. + + Also, fix for large long longs in 32 bit perl. + +2011-10-13: xavier98 + [octave] Allow Octave modules to be re-loaded after a "clear all". + +2011-09-19: wsfulton + Fix regression introduced in swig-2.0.1 reported by Teemu Ikonone leading to uncompilable code + when using typedef and function pointer references, for example: + + typedef int FN(const int &a, int b); + void *typedef_call1(FN *& precallback, FN * postcallback); + +2011-09-14: wsfulton + [Lua] Patch #3408012 from Raman Gopalan - add support for embedded Lua (eLua) + including options for targeting Lua Tiny RAM (LTR). + +2011-09-14: wsfulton + [C#] Add boost_intrusive_ptr.i library contribution from patch #3401571. + +2011-09-13: wsfulton + Add warnings for badly named destructors, eg: + + struct KStruct { + ~NOT_KStruct() {} + }; + + cpp_extend_destructors.i:92: Warning 521: Illegal destructor name ~NOT_KStruct. Ignored. + +2011-09-13: wsfulton + Fix %extend and destructors for templates. The destructor in %extend was not always wrapped, + for example: + + %extend FooT { + ~FooT() { delete \$self; } // was not wrapped as expected + }; + template class FooT {}; + %template(FooTi) FooT; + +2011-09-13: wsfulton + Fix special variables such as "\$decl" and "\$fulldecl" in destructors to include the ~ character. + +2011-09-10: talby + [perl5] SF bug #1481958 - Improve range checking for integer types. + Enhance li_typemaps_runme.pl + +2011-09-08: wsfulton + Fix %extend on typedef classes in a namespace using the typedef name, for example: + namespace Space { + %extend CStruct { + ... + } + typedef struct tagCStruct { ... } CStruct; + } + +2011-08-31: xavier98 + [octave] patches from Karl Wette: improvements to module loading behavior; + added example of friend operator to operator example; fixed octave panic/crash in 3.0.5; + documentation improvements + +2011-08-30: szager + [python] Bug 3400486, fix error signalling for built-in constructors. + +2011-08-26: wsfulton + [Go] Fix file/line number display for "gotype" when using typemap debugging options + -tmsearch and -tmused. + +2011-08-26: wsfulton + [C#, D] Fix %callback which was generating uncompileable code. + +2011-08-25: wsfulton + Fix constructors in named typedef class declarations as reported by Gregory Bronner: + + typedef struct A { + A(){} // Constructor which was not accepted by SWIG + B(){} // NOT a constructor --illegal, but was accepted by SWIG + } B; + + For C code, the fix now results in the use of 'struct A *' instead of just 'B *' in + the generated code when wrapping members in A, but ultimately this does not matter, as + they are the same thing. + +2011-08-23: wsfulton + Fix %newobject when used in conjunction with %feature("ref") as reported by Jan Becker. The + code from the "ref" feature was not always being generated for the function specified by %newobject. + Documentation for "ref" and "unref" moved from Python to the C++ chapter. + +2011-08-22: szager + [python] Fixed memory leak with --builtin option (bug 3385089). + +2011-08-22: wsfulton + [Lua] SF patch #3394339 from Torsten Landschoff - new option -nomoduleglobal to disable installing + the module table into the global namespace. Require call also returns the module table instead + of a string. + +2011-08-09: xavier98 + Fix bug 3387394; Octave patches for 3.4.0 compatibility, etc. (from Karl Wette) + +2011-08-04: wsfulton + Add in \$symname expansion for director methods. + +2011-07-29: olly + [PHP] Don't generate "return \$r;" in cases where \$r hasn't been set. + This was basically harmless, except it generated a PHP E_NOTICE if + the calling code had enabled them. + +2011-07-26: wsfulton + Fix scoping of forward class declarations nested within a class (for C++). Previously the symbol + was incorrectly put into the outer namespace, eg + + namespace std { + template struct map { + class iterator; + } + } + + iterator was scoped as std::iterator, but now it is correctly std::map::iterator; + + Also fixed is %template and template parameters that are a typedef when the template contains + default template parameters, eg: + + namespace Std { + template struct Map { + typedef Key key_type; + typedef T mapped_type; + } + } + tyepdef double DOUBLE; + %typemap(MM) Std::Map; + + All symbols within Map will be resolved correctly, eg key_type and mapped_type no matter if the + wrapped code uses Std::Map or std::Map or Std::Map + + Also fixes bug #3378145 - regression introduced in 2.0.4 - %template using traits. + +2011-07-20 szager + [python] Fix closure for tp_call slot. + +2011-07-16: wsfulton + [python] Fix director typemap using PyObject *. + +2011-07-13: szager + [python] SF patch #3365908 - Add all template parameters to map support code in std_map.i + +2011-07-13: szager + [python] Fix for bug 3324753: %rename member variables with -builtin. + +2011-07-01: wsfulton + Fix some scope and symbol lookup problems when template default parameters are being + used with typedef. For example: + + template struct Foo { + typedef XX X; + typedef TT T; + }; + template struct UsesFoo { + void x(typename Foo::T, typename Foo::X); + }; + + Also fixes use of std::vector::size_type for Python as reported by Aubrey Barnard. + +2011-06-23: olly + [PHP] Fix director code to work when PHP is built with ZTS enabled, + which is the standard configuration on Microsoft Windows. + +2011-06-21: mutandiz + [allegrocl] + - various small tweaks and bug fixes. + - Avoid name conflicts between smart pointer wrappers and the wrappers for + the actual class. + - Fix default typemaps for C bindings, which were incorrectly attempting to + call non-existent destructors on user-defined types. + - New feature, feature:aclmixins, for adding superclass to the foreign class + wrappers. + - Improve longlong typemaps. + +2011-06-19: wsfulton + Fix incorrect typemaps being used for a symbol within a templated type, eg: + A::value_type would incorrectly use a typemap for type A. + +2011-06-18: olly + [Tcl] Fix variable declarations in middle of blocks which isn't + permitted in C90 (issue probably introduced in 2.0.3 by patch #3224663). + Reported by Paul Obermeier in SF#3288586. + +2011-06-17: wsfulton + [Java] SF #3312505 - slightly easier to wrap char[] or char[ANY] with a Java byte[] + using arrays_java.i. + +2011-06-13: wsfulton + [Ruby, Octave] SF #3310528 Autodoc fixes similar to those described below for Python. + +2011-06-10: wsfulton + [Python] Few subtle bugfixes in autodoc documentation generation, + - Unnamed argument names fix for autodoc levels > 0. + - Display of template types fixed for autodoc levels > 1. + - Fix SF #3310528 - display of typedef structs for autodoc levels > 1. + - Add missing type for self for autodoc levels 1 and 3. + - autodoc levels 2 and 3 documented. + - Minor tweaks to autodoc style to conform with PEP8. + +2011-05-30: olly + [PHP] Fix handling of directors when -prefix is used. + +2011-05-24: olly + [PHP] Fix handling of methods of classes with a virtual base class (SF#3124665). + Version 2.0.4 (21 May 2011) =========================== + 2011-05-19: wsfulton [Guile] Patch #3191625 fixing overloading of integer types. Modified: branches/gsoc2009-ashishs99/CHANGES.current =================================================================== --- branches/gsoc2009-ashishs99/CHANGES.current 2012-05-09 16:45:07 UTC (rev 13055) +++ branches/gsoc2009-ashishs99/CHANGES.current 2012-05-09 18:51:58 UTC (rev 13056) @@ -2,5 +2,16 @@ See the CHANGES file for changes in older releases. See the RELEASENOTES file for a summary of changes in each release. -Version 2.0.5 (in progress) -=========================== +Version 2.0.6 (30 April 2012) +============================= + +2012-04-25: wsfulton + [Lua] Fix uninitialised variable in SWIGTYPE **OUTPUT typemaps as reported by Jim Anderson. + +2012-04-28: wsfulton + [Python] Fix compilation errors when wrapping STL containers on Mac OSX and possibly other systems. + +2012-04-28: wsfulton + [Java] Patch 3521811 from Leo Davis - char **STRING_ARRAY typemaps fixed to handle + null pointers. + Modified: branches/gsoc2009-ashishs99/COPYRIGHT =================================================================== --- branches/gsoc2009-ashishs99/COPYRIGHT 2012-05-09 16:45:07 UTC (rev 13055) +++ branches/gsoc2009-ashishs99/COPYRIGHT 2012-05-09 18:51:58 UTC (rev 13056) @@ -54,6 +54,7 @@ Duncan Temple Lang (R) Miklos Vajna (PHP directors) Mark Gossage (mark@...) (Lua) + Raman Gopalan (ramangopalan@...) (eLua) Gonzalo Garramuno (ggarra@...) (Ruby, Ruby's UTL) John Lenz (Guile, MzScheme updates, Chicken module, runtime system) Ian Lance Taylor (Go) Copied: branches/gsoc2009-ashishs99/Doc/Manual/Android.html (from rev 13025, trunk/Doc/Manual/Android.html) =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Android.html (rev 0) +++ branches/gsoc2009-ashishs99/Doc/Manual/Android.html 2012-05-09 18:51:58 UTC (rev 13056) @@ -0,0 +1,749 @@ + + + +SWIG and Android + + + +

18 SWIG and Android

+ + + + + + +

+This chapter describes SWIG's support of Android. +

+ + + +

18.1 Overview

+ + +

+The Android chapter is fairly short as support for Android is the same as for Java, where the Java Native Interface (JNI) is +used to call from Android Java into C or C++ compiled code. +Everything in the Java chapter applies to generating code for access from Android Java code. +This chapter contains a few Android specific notes and examples. +

+ +

18.2 Android examples

+ + +

18.2.1 Examples introduction

+ + +

+The examples require the the Android SDK and Android NDK which can be installed as per instructions in the links. +The Eclipse version is not required for these examples as just the command line tools are used (shown for Linux as the host, but Windows will be very similar, if not identical in most places). +Add the SDK tools and NDK tools to your path and create a directory somewhere for your Android projects (adjust PATH as necessary to where you installed the tools): +

+ +
+
+\$ export PATH=\$HOME/android/android-sdk-linux_x86/tools:\$HOME/android/android-sdk-linux_x86/platform-tools:\$HOME/android/android-ndk-r6b:\$PATH +\$ mkdir AndroidApps  +\$ cd AnrdoidApps +
+
+ +

+The examples use a target id of 1. This might need changing depending on your setup. +After installation of the Android SDK, the available target ids can be viewed by running the command below. +Please adjust the id to suit your target device. +

+ +
+
+\$ android list targets +
+
+ +

+The following examples are shipped with SWIG under the Examples/android directory and include a Makefile to build and install each example. +

+ +

18.2.2 Simple C example

+ + +

+This simple C example shows how to call a C function as well as read and modify a global variable. +First we'll create and build a pure Java Android app. Afterwards the JNI code will be generated by SWIG and built into the app. +First create and build an app called SwigSimple in a subdirectory called simple using the commands below. +Adjust the --target id as mentioned earlier in the Examples introduction. +Managing Projects from the Command Line on the Android developer's site is a useful reference for these steps. +

+ +
+
+\$ android create project --target 1 --name SwigSimple --path ./simple --activity SwigSimple --package org.swig.simple +\$ cd simple +\$ ant debug +
+
+ +

+Modify src/org/swig/simple/SwigSimple.java from the default to: +

+ +
+
+package org.swig.simple; + +import android.app.Activity; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.TextView; +import android.widget.ScrollView; +import android.text.method.ScrollingMovementMethod; + +public class SwigSimple extends Activity +{ +    TextView outputText = null; +    ScrollView scroller = null; + +    /** Called when the activity is first created. */ +    @Override +    public void onCreate(Bundle savedInstanceState) +    { +        super.onCreate(savedInstanceState); +        setContentView(R.layout.main); + +        outputText = (TextView)findViewById(R.id.OutputText); +        outputText.setText("Press 'Run' to start...\n"); +        outputText.setMovementMethod(new ScrollingMovementMethod()); + +        scroller = (ScrollView)findViewById(R.id.Scroller); +    } + +    public void onRunButtonClick(View view) +    { +      outputText.append("Started...\n"); +      nativeCall(); +      outputText.append("Finished!\n"); +       +      // Ensure scroll to end of text +      scroller.post(new Runnable() { +        public void run() { +          scroller.fullScroll(ScrollView.FOCUS_DOWN); +        } +      }); +    } + +    /** Calls into C/C++ code */ +    public void nativeCall() +    { +        // TODO +    } +} +
+
+ +

+The above simply adds a Run button and scrollable text view as the GUI aspects of the program. +The associated resources need to be created, modify res/layout/main.xml as follows: +

+ +
+
+<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"; +    android:orientation="vertical" +    android:layout_width="fill_parent" +    android:layout_height="fill_parent" +    > +<Button +    android:id="@+id/RunButton"   +    android:layout_width="wrap_content"   +    android:layout_height="wrap_content"   +    android:text="Run..."   +    android:onClick="onRunButtonClick" +    /> +<ScrollView +    android:id="@+id/Scroller" +    android:layout_width="fill_parent" +    android:layout_height="fill_parent" +    > +<TextView +    android:id="@+id/OutputText" +    android:layout_width="wrap_content" +    android:layout_height="wrap_content" +    /> +</ScrollView> +</LinearLayout> +
+
+ +

+Rebuild the project with your changes: +

+ +
+
+\$ ant debug +
+
+ +

+Although there are no native function calls in the code, yet, you may want to check that this simple pure +Java app runs before adding in the native calls. +First, set up your Android device for hardware debugging, see Using hardware devices on the Android developer's site. +When complete your device should be listed in those attached, something like: +

+ +
+
+\$ adb devices +List of devices attached  +A32-6DBE0001-9FF80000-015D62C3-02018028	device +
+
+ +

+This means you are now ready to install the application... +

+ +
+
+\$ adb install bin/SwigSimple-debug.apk  +95 KB/s (4834 bytes in 0.049s) +	pkg: /data/local/tmp/SwigSimple-debug.apk +Success +
+
+ +

+The newly installed 'SwigSimple' app will be amongst all your other applications on the home screen. Run the app and it will show a Run button text box below it. +Press the Run button to see the simple text output. +

+ +

+The application can be uninstalled like any other application and in fact must be uninstalled before installing an updated version. Uninstalling is quite easy too from your host computer: +

+ +
+
+\$ adb uninstall org.swig.simple +Success +
+
+ +

+Now that you have a pure Java Android app working, let's add some JNI code generated from SWIG. +

+ +

+First create a jni subdirectory and then create some C source code in jni/example.c: +

+ +
+
+/* File : example.c */ + +/* A global variable */ +double Foo = 3.0; + +/* Compute the greatest common divisor of positive integers */ +int gcd(int x, int y) { +  int g; +  g = y; +  while (x > 0) { +    g = x; +    x = y % x; +    y = g; +  } +  return g; +} +
+
+ +

+Create a SWIG interface file for this C code, jni/example.i: +

+ +
+
+/* File : example.i */ +%module example + +%inline %{ +extern int    gcd(int x, int y); +extern double Foo; +%} +
+
+ +

+Invoke SWIG as follows: +

+ +
+
+\$ swig -java -package org.swig.simple -outdir src/org/swig/simple -o jni/example_wrap.c jni/example.i +
+
+ +

+SWIG generates the following files: +

+
+
• src/org/swig/simple/exampleJNI.java
• +
• src/org/swig/simple/example.java
• +
• jni/example_wrap.c
• +
+ +

+Next we need to create a standard Android NDK build system file jni/Android.mk: +

+ +
+
+# File: Android.mk +LOCAL_PATH := \$(call my-dir) + +include \$(CLEAR_VARS) + +LOCAL_MODULE    := example +LOCAL_SRC_FILES := example_wrap.c example.c + +include \$(BUILD_SHARED_LIBRARY) +
+
+ +

+See the Android NDK documentation for more on the NDK build system and getting started with the NDK. +A simple invocation of ndk-build will compile the .c files and generate a shared object/system library. Output will be similar to: +

+ +
+
+\$ ndk-build +Compile thumb  : example <= example_wrap.c +Compile thumb  : example <= example.c +SharedLibrary  : libexample.so +Install        : libexample.so => libs/armeabi/libexample.so +
+
+ +

+Now that the C JNI layer has been built, we can write Java code to call into the this layer. +Modify the nativeCall method in src/org/swig/simple/SwigSimple.java to call the JNI code as follows and add the static constructor to load the system library containing the compiled JNI C code: +

+ +
+
+    /** Calls into C/C++ code */ +    public void nativeCall() +    { +      // Call our gcd() function +       +      int x = 42; +      int y = 105; +      int g = example.gcd(x,y); +      outputText.append("The greatest common divisor of " + x + " and " + y + " is " + g + "\n"); + +      // Manipulate the Foo global variable + +      // Output its current value +      double foo = example.getFoo(); +      outputText.append("Foo = " + foo + "\n"); + +      // Change its value +      example.setFoo(3.1415926); + +      // See if the change took effect +      outputText.append("Foo = " + example.getFoo() + "\n"); + +      // Restore value +      example.setFoo(foo); +    } + +    /** static constructor */ +    static { +        System.loadLibrary("example"); +    } +
+
+ +

+Compile the Java code as usual, uninstall the old version of the app if still installed and re-install the new app: +

+ +
+
+\$ ant debug +\$ adb uninstall org.swig.simple +\$ adb install bin/SwigSimple-debug.apk  +
+
+ +

+Run the app again and this time you will see the output pictured below, showing the result of calls into the C code: +

+ +
+ + +

18.2.3 C++ class example

+ + +

+The steps for calling C++ code are almost identical to those in the previous C code example. +All the steps required to compile and use a simple hierarchy of classes for shapes are shown in this example. +

+ +

+First create an Android project called SwigClass in a subdirectory called class. +The steps below create and build a the JNI C++ app. +Adjust the --target id as mentioned earlier in the Examples introduction. +

+ +
+
+\$ android create project --target 1 --name SwigClass --path ./class --activity SwigClass --package org.swig.classexample +\$ cd class +
+
+ +

+Now create a jni subdirectory and then create a C++ header file jni/example.h which defines our +hierarchy of shape classes: +

+ +
+
+/* File : example.h */ + +class Shape { +public: +  Shape() { +    nshapes++; +  } +  virtual ~Shape() { +    nshapes--; +  }; +  double  x, y;    +  void    move(double dx, double dy); +  virtual double area(void) = 0; +  virtual double perimeter(void) = 0; +  static  int nshapes; +}; + +class Circle : public Shape { +private: +  double radius; +public: +  Circle(double r) : radius(r) { }; +  virtual double area(void); +  virtual double perimeter(void); +}; + +class Square : public Shape { +private: +  double width; +public: +  Square(double w) : width(w) { }; +  virtual double area(void); +  virtual double perimeter(void); +}; +
+
+ +

+and create the implementation in the jni/example.cpp file: +

+ +
+
+/* File : example.cpp */ + +#include "example.h" +#define M_PI 3.14159265358979323846 + +/* Move the shape to a new location */ +void Shape::move(double dx, double dy) { +  x += dx; +  y += dy; +} + +int Shape::nshapes = 0; + +double Circle::area(void) { +  return M_PI*radius*radius; +} + +double Circle::perimeter(void) { +  return 2*M_PI*radius; +} + +double Square::area(void) { +  return width*width; +} + +double Square::perimeter(void) { +  return 4*width; +} +
+
+ +

+Create a SWIG interface file for this C++ code in jni/example.i: +

+ +
+
+/* File : example.i */ +%module example + +%{ +#include "example.h" +%} + +/* Let's just grab the original header file here */ +%include "example.h" +
+
+ +

+Invoke SWIG as follows, note that the -c++ option is required for C++ code: +

+ +
+
+\$ swig -c++ -java -package org.swig.classexample -outdir src/org/swig/classexample -o jni/example_wrap.cpp jni/example.i +
+
+ +

+SWIG generates the following files: +

+
+
• src/org/swig/classexample/Square.java
• +
• src/org/swig/classexample/exampleJNI.java
• +
• src/org/swig/classexample/example.java
• +
• src/org/swig/classexample/Circle.java
• +
• src/org/swig/classexample/Shape.java
• +
• jni/example_wrap.cpp
• +
+ +

+Next we need to create an Android NDK build system file for compiling the C++ code jni/Android.mk. +The -frtti compiler flag isn't strictly needed for this example, but is needed for any code that uses C++ RTTI: +

+ +
+
+# File: Android.mk +LOCAL_PATH := \$(call my-dir) + +include \$(CLEAR_VARS) + +LOCAL_MODULE    := example +LOCAL_SRC_FILES := example_wrap.cpp example.cpp +LOCAL_CFLAGS    := -frtti + +include \$(BUILD_SHARED_LIBRARY) +
+
+ + +

+A simple invocation of ndk-build will compile the .cpp files and generate a shared object/system library. Output will be similar to: +

+ +
+
+\$ ndk-build +Compile++ thumb  : example <= example_wrap.cpp +Compile++ thumb  : example <= example.cpp +StaticLibrary  : libstdc++.a +SharedLibrary  : libexample.so +Install        : libexample.so => libs/armeabi/libexample.so +
+
+ +

+Now that the C JNI layer has been built, we can write Java code to call into this layer. +Modify src/org/swig/classexample/SwigClass.java from the default to: +

+ +
+
+package org.swig.classexample; + +import android.app.Activity; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.TextView; +import android.widget.ScrollView; +import android.text.method.ScrollingMovementMethod; + +public class SwigClass extends Activity +{ +    TextView outputText = null; +    ScrollView scroller = null; + +    /** Called when the activity is first created. */ +    @Override +    public void onCreate(Bundle savedInstanceState) +    { +        super.onCreate(savedInstanceState); +        setContentView(R.layout.main); + +        outputText = (TextView)findViewById(R.id.OutputText); +        outputText.setText("Press 'Run' to start...\n"); +        outputText.setMovementMethod(new ScrollingMovementMethod()); + +        scroller = (ScrollView)findViewById(R.id.Scroller); +    } + +    public void onRunButtonClick(View view) +    { +      outputText.append("Started...\n"); +      nativeCall(); +      outputText.append("Finished!\n"); +       +      // Ensure scroll to end of text +      scroller.post(new Runnable() { +        public void run() { +          scroller.fullScroll(ScrollView.FOCUS_DOWN); +        } +      }); +    } + +    /** Calls into C/C++ code */ +    public void nativeCall() +    { +      // ----- Object creation ----- + +      outputText.append( "Creating some objects:\n" ); +      Circle c = new Circle(10); +      outputText.append( "    Created circle " + c + "\n"); +      Square s = new Square(10); +      outputText.append( "    Created square " + s + "\n"); + +      // ----- Access a static member ----- + +      outputText.append( "\nA total of " + Shape.getNshapes() + " shapes were created\n" ); + +      // ----- Member data access ----- + +      // Notice how we can do this using functions specific to +      // the 'Circle' class. +      c.setX(20); +      c.setY(30); + +      // Now use the same functions in the base class +      Shape shape = s; +      shape.setX(-10); +      shape.setY(5); + +      outputText.append( "\nHere is their current position:\n" ); +      outputText.append( "    Circle = (" + c.getX() + " " + c.getY() + ")\n" ); +      outputText.append( "    Square = (" + s.getX() + " " + s.getY() + ")\n" ); + +      // ----- Call some methods ----- + +      outputText.append( "\nHere are some properties of the shapes:\n" ); +      Shape[] shapes = {c,s}; +      for (int i=0; i<shapes.length; i++) +      { +        outputText.append( "   " + shapes[i].toString() + "\n" ); +        outputText.append( "        area      = " + shapes[i].area() + "\n" ); +        outputText.append( "        perimeter = " + shapes[i].perimeter() + "\n" ); +      } + +      // Notice how the area() and perimeter() functions really +      // invoke the appropriate virtual method on each object. + +      // ----- Delete everything ----- + +      outputText.append( "\nGuess I'll clean up now\n" ); + +      // Note: this invokes the virtual destructor +      // You could leave this to the garbage collector +      c.delete(); +      s.delete(); + +      outputText.append( Shape.getNshapes() + " shapes remain\n" ); +      outputText.append( "Goodbye\n" ); +    } + +    /** static constructor */ +    static { +        System.loadLibrary("example"); +    } +} +
+
+ +

+Note the static constructor and the interesting JNI code is in the nativeCall method. +The remaining code deals with the GUI aspects which are identical to the previous C simple example. Modify res/layout/main.xml to contain the xml for the 'Run' button and scrollable text view: +

+ +
+
+<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"; +    android:orientation="vertical" +    android:layout_width="fill_parent" +    android:layout_height="fill_parent" +    > +<Button +    android:id="@+id/RunButton"   +    android:layout_width="wrap_content"   +    android:layout_height="wrap_content"   +    android:text="Run..."   +    android:onClick="onRunButtonClick" +    /> +<ScrollView +    android:id="@+id/Scroller" +    android:layout_width="fill_parent" +    android:layout_height="fill_parent" +    > +<TextView +    android:id="@+id/OutputText" +    android:layout_width="wrap_content" +    android:layout_height="wrap_content" +    /> +</ScrollView> +</LinearLayout> +
+
+ + +

+Compile the Java code as usual, uninstall the old version of the app if installed and re-install the new app: +

+ +
+
+\$ ant debug +\$ adb uninstall org.swig.classexample +\$ adb install bin/SwigClass-debug.apk  +
+
+ +

+Run the app to see the result of calling the C++ code from Java: +

+ +
+ + + + Modified: branches/gsoc2009-ashishs99/Doc/Manual/CSharp.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/CSharp.html 2012-05-09 16:45:07 UTC (rev 13055) +++ branches/gsoc2009-ashishs99/Doc/Manual/CSharp.html 2012-05-09 18:51:58 UTC (rev 13056) @@ -5,12 +5,13 @@ -

18 SWIG and C#

+

19 SWIG and C#

• Introduction
• Differences to the Java module +
• Void pointers
• C# Arrays +
• Multiples modules
• C# Typemap examples
• Memory management when returning references to member variables @@ -46,7 +48,7 @@ -

18.1 Introduction

+

19.1 Introduction

@@ -66,7 +68,7 @@ Monodoc, available from the Mono project, has a very useful section titled Interop with native libraries.

-

18.2 Differences to the Java module

+

19.2 Differences to the Java module

@@ -170,6 +172,14 @@

• +

Typemap macros:

+
+SWIG_JAVABODY_PROXY         -> SWIG_CSBODY_PROXY +SWIG_JAVABODY_TYPEWRAPPER   -> SWIG_CSBODY_TYPEWRAPPER +
+
• + +

@@ -455,10 +465,28 @@  Cygwin; or MinGW; environment for automatic configuration of the example makefiles.  Any one of the three C# compilers (Portable.NET, Mono or Microsoft) can be detected from within a Cygwin or Mingw environment if installed in your path.    -

18.3 C# Arrays

+

19.3 Void pointers

+By default SWIG treats void * as any other pointer and hence marshalls it as a type wrapper class called SWIGTYPE_p_void. +If you want to marshall with the .NET System.IntPtr type instead, there is a simple set of named typemaps called +void *VOID_INT_PTR that can be used. +They can be applied like any other named typemaps: +

+ + +
+
+%apply void *VOID_INT_PTR { void * } +void * f(void *v); +
+
+ +

19.4 C# Arrays

+ + +

There are various ways to pass arrays from C# to C/C++. The default wrapping treats arrays as pointers and as such simple type wrapper classes are generated, eg SWIGTYPE_p_int when wrapping the C type int [] or int *. @@ -467,7 +495,7 @@ pinned arrays.

-

18.3.1 The SWIG C arrays library

+

19.4.1 The SWIG C arrays library

@@ -504,7 +532,7 @@

-

18.3.2 Managed arrays using P/Invoke default array marshalling

+

19.4.2 Managed arrays using P/Invoke default array marshalling

@@ -618,7 +646,7 @@

-and intermediate class method +and intermediary class method

@@ -631,7 +659,7 @@
-

18.3.3 Managed arrays using pinning

+

19.4.3 Managed arrays using pinning

@@ -713,7 +741,7 @@

-Also the intermediate class method looks a little different from the default marshalling +Also the intermediary class method looks a little different from the default marshalling example - the method is expecting an IntPtr as the parameter type.

@@ -726,7 +754,7 @@ -

18.4 C# Exceptions

+

19.5 C# Exceptions

@@ -823,7 +851,7 @@

-

18.4.1 C# exception example using "check" typemap

+

19.5.1 C# exception example using "check" typemap

@@ -1005,7 +1033,7 @@ Actually it will issue this warning for any function beginning with SWIG_CSharpSetPendingException.

-

18.4.2 C# exception example using %exception

+

19.5.2 C# exception example using %exception

@@ -1070,7 +1098,7 @@ -

18.4.3 C# exception example using exception specifications

+

19.5.3 C# exception example using exception specifications

@@ -1127,7 +1155,7 @@ Multiple catch handlers are generated should there be more than one exception specifications declared.

-

18.4.4 Custom C# ApplicationException example

+

19.5.4 Custom C# ApplicationException example

@@ -1261,7 +1289,7 @@ -

18.5 C# Directors

+

19.6 C# Directors

@@ -1274,7 +1302,7 @@ However, the Java directors section should also be read in order to gain more insight into directors.

-

18.5.1 Directors example

+

19.6.1 Directors example

@@ -1395,7 +1423,7 @@ -

18.5.2 Directors implementation

+

19.6.2 Directors implementation

@@ -1581,7 +1609,7 @@ -

18.5.3 Director caveats

+

19.6.3 Director caveats

@@ -1629,15 +1657,50 @@ should pass the call on to CSharpDefaults.DefaultMethod(int)using the C++ default value, as shown above.

-

18.6 C# Typemap examples

+

19.7 Multiples modules

+

+When using multiple modules it is is possible to compile each SWIG generated wrapper +into a different assembly. +However, by default the generated code may not compile if +generated classes in one assembly use generated classes in another assembly. +The visibility of the +getCPtr() and pointer constructor generated from the csbody typemaps needs changing. +The default visibility is internal but it needs to be public for access from a different assembly. +Just changing 'internal' to 'public' in the typemap achieves this. +Two macros are available in csharp.swg to make this easier and using them is the preferred approach +over simply copying the typemaps and modifying as this is forward compatible with any changes in +the csbody typemap in future versions of SWIG. +The macros are for the proxy and typewrapper classes and can respectively be used to +to make the method and constructor public: +

+ +
+
+  SWIG_CSBODY_PROXY(public, public, SWIGTYPE) +  SWIG_CSBODY_TYPEWRAPPER(public, public, public, SWIGTYPE) +
+
+ +

+Alternatively, instead of exposing these as public, consider +using the [assembly:InternalsVisibleTo("Name")] attribute available in the .NET framework when you +know which assemblies these can be exposed to. +Another approach would be to make these public, but also to hide them from intellisense by using +the [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] attribute +if you don't want users to easily stumble upon these so called 'internal workings' of the wrappers. +

+ +

19.8 C# Typemap examples

+ + This section includes a few examples of typemaps. For more examples, you might look at the files "csharp.swg" and "typemaps.i" in the SWIG library. -

18.6.1 Memory management when returning references to member variables

+

19.8.1 Memory management when returning references to member variables

@@ -1761,7 +1824,7 @@ Note the addReference call.

-

18.6.2 Memory management for objects passed to the C++ layer

+

19.8.2 Memory management for objects passed to the C++ layer

@@ -1880,7 +1943,7 @@ -

18.6.3 Date marshalling using the csin typemap and associated attributes

+

19.8.3 Date marshalling using the csin typemap and associated attributes

@@ -2166,7 +2229,7 @@ -

18.6.4 A date example demonstrating marshalling of C# properties

+

19.8.4 A date example demonstrating marshalling of C# properties

@@ -2267,7 +2330,7 @@ -

18.6.5 Turning wrapped classes into partial classes

+

19.8.5 Turning wrapped classes into partial classes

@@ -2367,7 +2430,7 @@ The following example is an alternative approach to adding managed code to the generated proxy class.

-

18.6.6 Extending proxy classes with additional C# code

+

19.8.6 Extending proxy classes with additional C# code

@@ -2406,7 +2469,7 @@ -

18.6.7 Underlying type for enums

+

19.8.7 Underlying type for enums

Modified: branches/gsoc2009-ashishs99/Doc/Manual/Chicken.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Chicken.html 2012-05-09 16:45:07 UTC (rev 13055) +++ branches/gsoc2009-ashishs99/Doc/Manual/Chicken.html 2012-05-09 18:51:58 UTC (rev 13056) @@ -8,7 +8,7 @@ -

19 SWIG and Chicken

+

20 SWIG and Chicken

@@ -72,7 +72,7 @@

-

19.1 Preliminaries

+

20.1 Preliminaries

@@ -89,7 +89,7 @@ directory for the basic steps to run SWIG CHICKEN.

-

19.1.1 Running SWIG in C mode

+

20.1.1 Running SWIG in C mode

-

19.1.2 Running SWIG in C++ mode

+

20.1.2 Running SWIG in C++ mode

-

19.2 Code Generation

+

20.2 Code Generation

-

19.2.1 Naming Conventions

+

20.2.1 Naming Conventions

@@ -170,7 +170,7 @@ %rename SWIG directive in the SWIG interface file.

-

19.2.2 Modules

+

20.2.2 Modules

@@ -192,7 +192,7 @@ (uses modulename)) CHICKEN Scheme form.

-

19.2.3 Constants and Variables

+

20.2.3 Constants and Variables

@@ -229,7 +229,7 @@ for info on how to apply the %feature.

-

19.2.4 Functions

+

20.2.4 Functions

@@ -248,7 +248,7 @@ parameters). The return values can then be accessed with (call-with-values).

-

19.2.5 Exceptions

+

20.2.5 Exceptions

The SWIG chicken module has support for exceptions thrown from @@ -290,7 +290,7 @@

-

19.3 TinyCLOS

+

20.3 TinyCLOS

@@ -333,7 +333,7 @@

-

+

@@ -354,7 +354,7 @@

-

19.4.1 Static binary or shared library linked at compile time

+

20.4.1 Static binary or shared library linked at compile time

We can easily use csc to build a static binary.

@@ -395,7 +395,7 @@ be run with csi.

-

19.4.2 Building chicken extension libraries

+

20.4.2 Building chicken extension libraries

Building a shared library like in the above section only works if the library @@ -453,7 +453,7 @@

See the Examples/chicken/egg directory in the SWIG source for an example that builds two eggs, one using the first method and one using the second method.

-

19.4.3 Linking multiple SWIG modules with TinyCLOS

+

20.4.3 Linking multiple SWIG modules with TinyCLOS

Linking together multiple modules that share type information using the %import @@ -477,7 +477,7 @@ To create an extension library or an egg, just create a module_load.scm file that (declare (uses ...)) all the modules.

-

19.5 Typemaps

+

20.5 Typemaps

@@ -486,7 +486,7 @@ Lib/chicken/chicken.swg.

-

19.6 Pointers

+

20.6 Pointers

@@ -519,7 +519,7 @@ type. flags is either zero or SWIG_POINTER_DISOWN (see below).

-

19.6.1 Garbage collection

+

20.6.1 Garbage collection

If the owner flag passed to SWIG_NewPointerObj is 1, NewPointerObj will add a @@ -550,7 +550,7 @@ must be called manually.

-

19.7 Unsupported features and known problems

+

20.7 Unsupported features and known problems

-

19.7.1 TinyCLOS problems with Chicken version <= 1.92

+

20.7.1 TinyCLOS problems with Chicken version <= 1.92

In Chicken versions equal to or below 1.92, TinyCLOS has a limitation such that generic methods do not properly work on methods Modified: branches/gsoc2009-ashishs99/Doc/Manual/Contents.html =================================================================== --- branches/gsoc2009-ashishs99/Doc/Manual/Contents.html 2012-05-09 16:45:07 UTC (rev 13055) +++ branches/gsoc2009-ashishs99/Doc/Manual/Contents.html 2012-05-09 18:51:58 UTC (rev 13056) @@ -156,6 +156,7 @@

• Simple renaming of specific identifiers
• Limiting global renaming rules +
• Ignoring everything then wrapping a few selected symbols
• Default/optional arguments
• Pointers to functions and callbacks @@ -242,6 +243,7 @@
• Exception handling with %catches
• Pointers to Members
• Smart pointers and operator->() +
• C++ reference counted objects - ref/unref feature
• Using declarations and inheritance
• Nested classes
• A brief rant about const-correctness @@ -261,8 +263,11 @@
• Macro Expansion
• SWIG Macros
• C99 and GNU Extensions +
• Preprocessing and delimiters +
• Preprocessor and Typemaps
• Viewing preprocessor output
• The #error and #warning directives @@ -396,6 +401,7 @@
• Typemaps for multiple target languages
• Optimal code generation when returning by value
• Multi-argument typemaps +
• Typemap warnings
• Typemap fragments -

22 SWIG and Guile

+

23 SWIG and Guile

@@ -804,7 +830,7 @@
-

23 SWIG and Java

+

24 SWIG and Java

@@ -942,12 +968,12 @@
• Performance concerns and hints
• Debugging -
• Examples +
• Java Examples -

24 SWIG and Common Lisp

+

25 SWIG and Common Lisp

@@ -970,7 +996,7 @@
-

25 SWIG and Lua

+

26 SWIG and Lua

@@ -978,6 +1004,7 @@
• Preliminaries
• Running SWIG -
• Typemaps +
• Typemaps -
• Writing typemaps +
• Writing typemaps -
• Customization of your Bindings +
• Customization of your Bindings -
• Details on the Lua binding +
• Details on the Lua binding -

26 SWIG and Modula-3

+

27 SWIG and Modula-3

@@ -1065,7 +1093,7 @@
-

27 SWIG and MzScheme/Racket

+

28 SWIG and MzScheme/Racket

@@ -1077,7 +1105,7 @@
-

28 SWIG and Ocaml

+

29 SWIG and Ocaml

@@ -1128,7 +1156,7 @@
-

29 SWIG and Octave

+

30 SWIG and Octave

@@ -1136,6 +1164,7 @@
• Preliminaries
• Running SWIG @@ -1163,7 +1192,7 @@ -

30 SWIG and Perl5

+

31 SWIG and Perl5

@@ -1230,7 +1259,7 @@
-

31 SWIG and PHP

+

32 SWIG and PHP

@@ -1270,7 +1299,7 @@
-

32 SWIG and Pike

+

33 SWIG and Pike

@@ -1294,7 +1323,7 @@
-

33 SWIG and Python

+

34 SWIG and Python

@@ -1327,7 +1356,7 @@
• C++ namespaces
• C++ templates
• C++ Smart Pointers -
• C++ Reference Counted Objects (ref/unref) +
• C++ reference counted objects
• Further details on the Python class interface