diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2015-01-14 13:45:55 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2015-01-14 13:45:55 +0000 |
commit | efa96eb76d4f1a6b14633ab653699352936fe3d1 (patch) | |
tree | 0b13e154013ab12d06cf0eadd4740d9fd9b79731 /Doc/Manual/Tcl.html | |
parent | 6d86fb173915867bd70d6780a174bce3c5b3c1df (diff) | |
parent | 4fed2e6690b1486952b0543b6bde28573eb0d132 (diff) | |
download | swig-coverity-scan.tar.gz |
Merge branch 'master' into coverity-scancoverity-scan
* master: (478 commits)
Use -rrbconfig rather than -rmkmf to load rbconfig
Add suggestion to check block delimiter
Add explanatory comment to pp_unknowndirective2.i
Fix PHP crash in director_finalizer
Add 3.0.4 release information
Fix typo
Note 1.8 as the oldest supported version
Fix PHP backend for default_args testcase
Update html
Python 3 default args fix
Revert introduction of python:defaultargs feature
Ruby: Replace Config::CONFIG with RbConfig::CONFIG in configure.ac
Add regression test for #217
[PHP] Fix segfault in director upcall check
Fix linux gcc warnings and strtol corrections
Tests for Python default arguments and %pythondefaultargs.
Python default arg improvements
[lua/luarun] change return type from int to void on functions not returning anything
Add note about delimiting blocks of Python code
Fix python default_args testcase for Python 3
Fix Python default argument handing broken since swig-3.0.3
Python default argument test cases from issue #294
Wording change for missing semicolon error
Handle "constexpr explicit" and "constexpr static"
Allow C++11 "explicit constexpr"
Improve errors for missing ; and unexpected )
Fix typo in old entry
Add test coverage for unterminated %{ ... %} block
When reporting an error for a construct which hasn't been terminated when the end of the file is reached, report it at the start line rather than "EOF" as then tools like editors and IDEs will take you to a generally more useful place for fixing the problem.
Improve error message for extraneous '%}'.
Add .gitignore for Examples/test-suite/errors/
Fix testcase name in expected output
Improve error message when an unknown SWIG directive is used
Update link to point to 3.0 docs
Fix links to the online 1.3 docs to instead be relative
Drop deprecated warnings for ancient options
Fix tab to space in HTML preformatted block
Provide -cppext as a general command line option
Split -help output into 4 chunks instead of 3
More on Go examples [skip ci]
Properly quote parameters in preinst-swig wrapper.
Fix typo
Bump version to 3.0.4
HTML tweaks
Add 3.0.3 release information
Minor tweaks to the changes file
%constant and structs support for Lua
Fix D examples when run 'in-source'
Fix D examples clean
Revert "Fix D examples clean"
Fix javascript clean
Let Octave 3.8 fail in Travis
Fix D examples clean
Fix javascript clean
Tidy up Javascript build system
Don't delete checked in files with 'make distclean'
Reduce scope of template_default_class_parms testcase
Fix abort using template default parameters
Test suite warning fixes
[Perl] tidy "warning: duplicate 'extern' declaration specifier" when building generated code under clang
Issue #282 perl5 archlib vs archlibexp
[Go] Changed link 'https://github.com/golang/go/tree/master/misc/swig' to 'https://golang.org/misc/swig' in the Go documentation.
[Go] Updated Go documentation (examples, runtime.SetFinalizer, object ownership).
Added auto-generated 'Examples/d/example.mk' to '.gitignore'.
Warning suppressions in tests
nested_scope test fixes for clang
Fix use of preprocessor null directive
Add testcase for nested inner class deriving from a templated base class and defined outside of the outer class.
Add in missing constant_directive.i test
Improve Python builtin and %constant structs
fixed python global object constants
Partial support for %constant and structs
Ignore E402 (import not on top of file) PEP8 error.
Add PEP8_FLAGS variable to the test suite Python makefile.
Fix templated constructors regression
Correctly detect Go1 during configure
Fix regression in introduced in merge of C++11 strongly typed enums support - Guile constants bad casts generated - Go non-public enum value wrappers assert failure
Document new C++11 strongly typed enumerations support.
Add more docs about _global_ prefix in typemap temporary variables
Add clarification on _global_ prefix.
Improve Javascript Webkit detection
Add c++11 strongly typed enums runtime test for Javascript
Add c++11 strongly typed enums runtime test for Octave
Add c++11 strongly typed enum support for Guile
Add c++11 strongly typed enum support for Go
Add c++11 strongly typed enum support for D
Add c++11 strongly typed enum support for Lua
Fix line endings in lua example
Add c++11 strongly typed enums runtime test for Tcl
Add c++11 strongly typed enum support for PHP
Add c++11 strongly typed enums runtime test for Ruby
Add c++11 strongly typed enums runtime test for Perl
Enhance C++11 strongly typed enums testcase
C++11 strongly typed enums runtime test for python
fix for nested template defined out of class (issue #265)
C++11 strongly typed enum support
Add Java runtime testcases for C++11 strongly typed enums
add director_nested_class to list of broken tests
Add C# support for wrapping C++11 strongly typed enums
Enhance strongly typed enums testcase
...
Conflicts:
.travis.yml
Diffstat (limited to 'Doc/Manual/Tcl.html')
-rw-r--r-- | Doc/Manual/Tcl.html | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/Doc/Manual/Tcl.html b/Doc/Manual/Tcl.html index 45eebbf5e..45218f303 100644 --- a/Doc/Manual/Tcl.html +++ b/Doc/Manual/Tcl.html @@ -6,7 +6,7 @@ </head> <body bgcolor="#ffffff"> -<H1><a name="Tcl"></a>38 SWIG and Tcl</H1> +<H1><a name="Tcl"></a>39 SWIG and Tcl</H1> <!-- INDEX --> <div class="sectiontoc"> <ul> @@ -83,7 +83,7 @@ Tcl 8.0 or a later release. Earlier releases of SWIG supported Tcl 7.x, but this is no longer supported. </p> -<H2><a name="Tcl_nn2"></a>38.1 Preliminaries</H2> +<H2><a name="Tcl_nn2"></a>39.1 Preliminaries</H2> <p> @@ -109,7 +109,7 @@ build a Tcl extension module. To finish building the module, you need to compile this file and link it with the rest of your program. </p> -<H3><a name="Tcl_nn3"></a>38.1.1 Getting the right header files</H3> +<H3><a name="Tcl_nn3"></a>39.1.1 Getting the right header files</H3> <p> @@ -127,7 +127,7 @@ this is the case, you should probably make a symbolic link so that <tt>tcl.h</tt header file. </p> -<H3><a name="Tcl_nn4"></a>38.1.2 Compiling a dynamic module</H3> +<H3><a name="Tcl_nn4"></a>39.1.2 Compiling a dynamic module</H3> <p> @@ -160,10 +160,10 @@ of the module. If the name of your SWIG module is "<tt>example</tt>", the name of the corresponding object file should be "<tt>example.so</tt>". The name of the module is specified using the <tt>%module</tt> directive or the -<tt> -module</tt> command line option. + <tt>-module</tt> command line option. </p> -<H3><a name="Tcl_nn5"></a>38.1.3 Static linking</H3> +<H3><a name="Tcl_nn5"></a>39.1.3 Static linking</H3> <p> @@ -229,7 +229,7 @@ minimal in most situations (and quite frankly not worth the extra hassle in the opinion of this author). </p> -<H3><a name="Tcl_nn6"></a>38.1.4 Using your module</H3> +<H3><a name="Tcl_nn6"></a>39.1.4 Using your module</H3> <p> @@ -357,7 +357,7 @@ to the default system configuration (this requires root access and you will need the man pages). </p> -<H3><a name="Tcl_nn7"></a>38.1.5 Compilation of C++ extensions</H3> +<H3><a name="Tcl_nn7"></a>39.1.5 Compilation of C++ extensions</H3> <p> @@ -440,7 +440,7 @@ erratic program behavior. If working with lots of software components, you might want to investigate using a more formal standard such as COM. </p> -<H3><a name="Tcl_nn8"></a>38.1.6 Compiling for 64-bit platforms</H3> +<H3><a name="Tcl_nn8"></a>39.1.6 Compiling for 64-bit platforms</H3> <p> @@ -467,7 +467,7 @@ also introduce problems on platforms that support more than one linking standard (e.g., -o32 and -n32 on Irix). </p> -<H3><a name="Tcl_nn9"></a>38.1.7 Setting a package prefix</H3> +<H3><a name="Tcl_nn9"></a>39.1.7 Setting a package prefix</H3> <p> @@ -486,7 +486,7 @@ option will append the prefix to the name when creating a command and call it "<tt>Foo_bar</tt>". </p> -<H3><a name="Tcl_nn10"></a>38.1.8 Using namespaces</H3> +<H3><a name="Tcl_nn10"></a>39.1.8 Using namespaces</H3> <p> @@ -504,11 +504,11 @@ name, but you can override it using the <tt>-prefix</tt> option. </p> <p> -When the<tt> -namespace</tt> option is used, objects in the module +When the <tt>-namespace</tt> option is used, objects in the module are always accessed with the namespace name such as <tt>Foo::bar</tt>. </p> -<H2><a name="Tcl_nn11"></a>38.2 Building Tcl/Tk Extensions under Windows 95/NT</H2> +<H2><a name="Tcl_nn11"></a>39.2 Building Tcl/Tk Extensions under Windows 95/NT</H2> <p> @@ -519,7 +519,7 @@ covers the process of using SWIG with Microsoft Visual C++. although the procedure may be similar with other compilers. </p> -<H3><a name="Tcl_nn12"></a>38.2.1 Running SWIG from Developer Studio</H3> +<H3><a name="Tcl_nn12"></a>39.2.1 Running SWIG from Developer Studio</H3> <p> @@ -577,7 +577,7 @@ MSDOS > tclsh80 % </pre></div> -<H3><a name="Tcl_nn13"></a>38.2.2 Using NMAKE</H3> +<H3><a name="Tcl_nn13"></a>39.2.2 Using NMAKE</H3> <p> @@ -640,7 +640,7 @@ to get you started. With a little practice, you'll be making lots of Tcl extensions. </p> -<H2><a name="Tcl_nn14"></a>38.3 A tour of basic C/C++ wrapping</H2> +<H2><a name="Tcl_nn14"></a>39.3 A tour of basic C/C++ wrapping</H2> <p> @@ -651,7 +651,7 @@ classes. This section briefly covers the essential aspects of this wrapping. </p> -<H3><a name="Tcl_nn15"></a>38.3.1 Modules</H3> +<H3><a name="Tcl_nn15"></a>39.3.1 Modules</H3> <p> @@ -685,7 +685,7 @@ To fix this, supply an extra argument to <tt>load</tt> like this: </pre> </div> -<H3><a name="Tcl_nn16"></a>38.3.2 Functions</H3> +<H3><a name="Tcl_nn16"></a>39.3.2 Functions</H3> <p> @@ -710,7 +710,7 @@ like you think it does: % </pre></div> -<H3><a name="Tcl_nn17"></a>38.3.3 Global variables</H3> +<H3><a name="Tcl_nn17"></a>39.3.3 Global variables</H3> <p> @@ -790,7 +790,7 @@ extern char *path; // Read-only (due to %immutable) </pre> </div> -<H3><a name="Tcl_nn18"></a>38.3.4 Constants and enums</H3> +<H3><a name="Tcl_nn18"></a>39.3.4 Constants and enums</H3> <p> @@ -874,7 +874,7 @@ When an identifier name is given, it is used to perform an implicit hash-table l conversion. This allows the <tt>global</tt> statement to be omitted. </p> -<H3><a name="Tcl_nn19"></a>38.3.5 Pointers</H3> +<H3><a name="Tcl_nn19"></a>39.3.5 Pointers</H3> <p> @@ -970,7 +970,7 @@ C-style cast may return a bogus result whereas as the C++-style cast will return <tt>None</tt> if the conversion can't be performed. </p> -<H3><a name="Tcl_nn20"></a>38.3.6 Structures</H3> +<H3><a name="Tcl_nn20"></a>39.3.6 Structures</H3> <p> @@ -1252,7 +1252,7 @@ Note: Tcl only destroys the underlying object if it has ownership. See the memory management section that appears shortly. </p> -<H3><a name="Tcl_nn21"></a>38.3.7 C++ classes</H3> +<H3><a name="Tcl_nn21"></a>39.3.7 C++ classes</H3> <p> @@ -1283,7 +1283,7 @@ you can use it in Tcl like this: % x insert Lager % x get 1 Stout -% puts [l cget -length] +% puts [x cget -length] 3 % </pre></div> @@ -1319,7 +1319,7 @@ In Tcl, the static member is accessed as follows: </pre> </div> -<H3><a name="Tcl_nn22"></a>38.3.8 C++ inheritance</H3> +<H3><a name="Tcl_nn22"></a>39.3.8 C++ inheritance</H3> <p> @@ -1368,7 +1368,7 @@ For instance: It is safe to use multiple inheritance with SWIG. </p> -<H3><a name="Tcl_nn23"></a>38.3.9 Pointers, references, values, and arrays</H3> +<H3><a name="Tcl_nn23"></a>39.3.9 Pointers, references, values, and arrays</H3> <p> @@ -1422,7 +1422,7 @@ to hold the result and a pointer is returned (Tcl will release this memory when the return value is garbage collected). </p> -<H3><a name="Tcl_nn24"></a>38.3.10 C++ overloaded functions</H3> +<H3><a name="Tcl_nn24"></a>39.3.10 C++ overloaded functions</H3> <p> @@ -1545,7 +1545,7 @@ first declaration takes precedence. Please refer to the "SWIG and C++" chapter for more information about overloading. </p> -<H3><a name="Tcl_nn25"></a>38.3.11 C++ operators</H3> +<H3><a name="Tcl_nn25"></a>39.3.11 C++ operators</H3> <p> @@ -1647,7 +1647,7 @@ There are ways to make this operator appear as part of the class using the <tt>% Keep reading. </p> -<H3><a name="Tcl_nn26"></a>38.3.12 C++ namespaces</H3> +<H3><a name="Tcl_nn26"></a>39.3.12 C++ namespaces</H3> <p> @@ -1711,7 +1711,7 @@ utilizes thousands of small deeply nested namespaces each with identical symbol names, well, then you get what you deserve. </p> -<H3><a name="Tcl_nn27"></a>38.3.13 C++ templates</H3> +<H3><a name="Tcl_nn27"></a>39.3.13 C++ templates</H3> <p> @@ -1763,7 +1763,7 @@ More details can be found in the <a href="SWIGPlus.html#SWIGPlus">SWIG and C++</ examples will appear later. </p> -<H3><a name="Tcl_nn28"></a>38.3.14 C++ Smart Pointers</H3> +<H3><a name="Tcl_nn28"></a>39.3.14 C++ Smart Pointers</H3> <p> @@ -1847,7 +1847,7 @@ simply use the <tt>__deref__()</tt> method. For example: </pre> </div> -<H2><a name="Tcl_nn29"></a>38.4 Further details on the Tcl class interface</H2> +<H2><a name="Tcl_nn29"></a>39.4 Further details on the Tcl class interface</H2> <p> @@ -1860,7 +1860,7 @@ of low-level details were omitted. This section provides a brief overview of how the proxy classes work. </p> -<H3><a name="Tcl_nn30"></a>38.4.1 Proxy classes</H3> +<H3><a name="Tcl_nn30"></a>39.4.1 Proxy classes</H3> <p> @@ -1925,7 +1925,7 @@ function. This allows objects to be encapsulated objects that look a lot like as shown in the last section. </p> -<H3><a name="Tcl_nn31"></a>38.4.2 Memory management</H3> +<H3><a name="Tcl_nn31"></a>39.4.2 Memory management</H3> <p> @@ -2113,7 +2113,7 @@ typemaps--an advanced topic discussed later. </p> -<H2><a name="Tcl_nn32"></a>38.5 Input and output parameters</H2> +<H2><a name="Tcl_nn32"></a>39.5 Input and output parameters</H2> <p> @@ -2301,7 +2301,7 @@ set c [lindex $dim 1] </pre> </div> -<H2><a name="Tcl_nn33"></a>38.6 Exception handling </H2> +<H2><a name="Tcl_nn33"></a>39.6 Exception handling </H2> <p> @@ -2365,7 +2365,7 @@ Tcl extension by specifying the following in an interface file : $action // Gets substituted by actual function call } catch (RangeError) { - Tcl_SetStringObj(tcl_result,"Array index out-of-bounds"); + Tcl_SetResult(interp, (char *)"Array index out-of-bounds", TCL_STATIC); return TCL_ERROR; } } @@ -2384,7 +2384,7 @@ exception handler to only apply to specific methods like this: $action } catch (RangeError) { - Tcl_SetStringObj(tcl_result,"Array index out-of-bounds"); + Tcl_SetResult(interp, (char *)"Array index out-of-bounds", TCL_STATIC); return TCL_ERROR; } } @@ -2394,7 +2394,7 @@ exception handler to only apply to specific methods like this: $action } catch (RangeError) { - Tcl_SetStringObj(tcl_result,"Array index out-of-bounds"); + Tcl_SetResult(interp, (char *)"Array index out-of-bounds", TCL_STATIC); return TCL_ERROR; } } @@ -2419,7 +2419,7 @@ For example: $action } catch (RangeError) { - Tcl_SetStringObj(tcl_result,"Array index out-of-bounds"); + Tcl_SetResult(interp, (char *)"Array index out-of-bounds", TCL_STATIC); return TCL_ERROR; } } @@ -2435,7 +2435,7 @@ Since SWIG's exception handling is user-definable, you are not limited to C++ ex See the chapter on "<a href="Customization.html#Customization">Customization Features</a>" for more examples. </p> -<H2><a name="Tcl_nn34"></a>38.7 Typemaps</H2> +<H2><a name="Tcl_nn34"></a>39.7 Typemaps</H2> <p> @@ -2452,7 +2452,7 @@ Typemaps are only used if you want to change some aspect of the primitive C-Tcl interface. </p> -<H3><a name="Tcl_nn35"></a>38.7.1 What is a typemap?</H3> +<H3><a name="Tcl_nn35"></a>39.7.1 What is a typemap?</H3> <p> @@ -2569,7 +2569,7 @@ parameter is omitted): </pre> </div> -<H3><a name="Tcl_nn36"></a>38.7.2 Tcl typemaps</H3> +<H3><a name="Tcl_nn36"></a>39.7.2 Tcl typemaps</H3> <p> @@ -2707,7 +2707,7 @@ Initialize an argument to a value before any conversions occur. Examples of these methods will appear shortly. </p> -<H3><a name="Tcl_nn37"></a>38.7.3 Typemap variables</H3> +<H3><a name="Tcl_nn37"></a>39.7.3 Typemap variables</H3> <p> @@ -2778,7 +2778,7 @@ properly assigned. The Tcl name of the wrapper function being created. </div> -<H3><a name="Tcl_nn38"></a>38.7.4 Converting a Tcl list to a char ** </H3> +<H3><a name="Tcl_nn38"></a>39.7.4 Converting a Tcl list to a char ** </H3> <p> @@ -2840,7 +2840,7 @@ argv[2] = Larry 3 </pre></div> -<H3><a name="Tcl_nn39"></a>38.7.5 Returning values in arguments</H3> +<H3><a name="Tcl_nn39"></a>39.7.5 Returning values in arguments</H3> <p> @@ -2882,7 +2882,7 @@ result, a Tcl function using these typemaps will work like this : % </pre></div> -<H3><a name="Tcl_nn40"></a>38.7.6 Useful functions</H3> +<H3><a name="Tcl_nn40"></a>39.7.6 Useful functions</H3> <p> @@ -2921,7 +2921,6 @@ int Tcl_GetDoubleFromObj(Tcl_Interp *, Tcl_Obj *o, double *dp); <div class="code"> <pre> Tcl_Obj *Tcl_NewStringObj(char *str, int len); -void Tcl_SetStringObj(Tcl_Obj *obj, char *str, int len); char *Tcl_GetStringFromObj(Tcl_Obj *obj, int *len); void Tcl_AppendToObj(Tcl_Obj *obj, char *str, int len); </pre> @@ -2959,7 +2958,7 @@ int Tcl_IsShared(Tcl_Obj *obj); </pre> </div> -<H3><a name="Tcl_nn41"></a>38.7.7 Standard typemaps</H3> +<H3><a name="Tcl_nn41"></a>39.7.7 Standard typemaps</H3> <p> @@ -3037,13 +3036,14 @@ work) <div class="code"> <pre> -%typemap(out) char * { - Tcl_SetStringObj($result,$1); +%typemap(out,noblock=1,fragment="SWIG_FromCharPtr") char *, const char * { + Tcl_SetObjResult(interp,SWIG_FromCharPtr((const char *)$1)); } + </pre> </div> -<H3><a name="Tcl_nn42"></a>38.7.8 Pointer handling</H3> +<H3><a name="Tcl_nn42"></a>39.7.8 Pointer handling</H3> <p> @@ -3119,7 +3119,7 @@ For example: </pre> </div> -<H2><a name="Tcl_nn43"></a>38.8 Turning a SWIG module into a Tcl Package.</H2> +<H2><a name="Tcl_nn43"></a>39.8 Turning a SWIG module into a Tcl Package.</H2> <p> @@ -3191,7 +3191,7 @@ As a final note, most SWIG examples do not yet use the to use the <tt>load</tt> command instead. </p> -<H2><a name="Tcl_nn44"></a>38.9 Building new kinds of Tcl interfaces (in Tcl)</H2> +<H2><a name="Tcl_nn44"></a>39.9 Building new kinds of Tcl interfaces (in Tcl)</H2> <p> @@ -3290,7 +3290,7 @@ danger of blowing something up (although it is easily accomplished with an out of bounds array access). </p> -<H3><a name="Tcl_nn45"></a>38.9.1 Proxy classes</H3> +<H3><a name="Tcl_nn45"></a>39.9.1 Proxy classes</H3> <p> @@ -3411,7 +3411,7 @@ short, but clever Tcl script can be combined with SWIG to do many interesting things. </p> -<H2><a name="Tcl_nn46"></a>38.10 Tcl/Tk Stubs</H2> +<H2><a name="Tcl_nn46"></a>39.10 Tcl/Tk Stubs</H2> <p> |