~svn/ubuntu/raring/subversion/ppa

« back to all changes in this revision

Viewing changes to subversion/bindings/swig/NOTES

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:26:14 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205012614-qom4xfypgtsqc2xq
Tags: 1.2.3dfsg1-3ubuntu1
Merge with the final Debian release of 1.2.3dfsg1-3, bringing in
fixes to the clean target, better documentation of the libdb4.3
upgrade and build fixes to work with swig1.3_1.3.27.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
                                                                -*-text-*-
 
2
 
 
3
 
 
4
==> For instructions on how to get swig bindings working, read the
 
5
     INSTALL file in this directory.
 
6
 
 
7
 
 
8
SVN HEADER -> SWIG MODULE
 
9
-------------------------
 
10
 
 
11
Subversion has a bunch of include files, some which are interesting for
 
12
wrapping with language bindings, and others which are simple type
 
13
declarations and constants. Below is the table which maps each header
 
14
to its disposition:
 
15
 
 
16
INCLUDE           SWIG MODULE NAME
 
17
svn_auth.h        _core (some symbols)
 
18
svn_base64.h      (1)
 
19
svn_client.h      _client
 
20
svn_cmdline.h     (2)
 
21
svn_config.h      _core (some symbols)
 
22
svn_ctype.h       (1)
 
23
svn_dav.h         (2)
 
24
svn_delta.h       _delta
 
25
svn_error.h       (2)
 
26
svn_error_codes.h _core
 
27
svn_fs.h          _fs
 
28
svn_hash.h        (1)
 
29
svn_io.h          _core (only stream functions)
 
30
svn_md5.h         (1)
 
31
svn_opt.h         _core (some symbols)
 
32
svn_path.h        (1)
 
33
svn_pools.h       _core (only pool manipulation)
 
34
svn_props.h       _core (some symbols)
 
35
svn_quoprint.h    (1)
 
36
svn_ra.h          _ra
 
37
svn_ra_svn.h      (2)
 
38
svn_repos.h       _repos
 
39
svn_sorts.h       (1)
 
40
svn_string.h      (3)
 
41
svn_subst.h       (2)
 
42
svn_test.h        (2)
 
43
svn_time.h        _core (some symbols)
 
44
svn_types.h       (3)
 
45
svn_utf.h         (1)
 
46
svn_version.h     _core (some symbols)
 
47
svn_wc.h          _wc
 
48
svn_xml.h         (1)
 
49
 
 
50
apr*.h            (3)
 
51
 
 
52
(1) It is assumed that the binding languages will provide this
 
53
    functionality separately.
 
54
    ### HELP: Java does not provide base-64 natively.  Should we wrap
 
55
    ### SVN's with SWIG, or include a stand-alone ASF implementation
 
56
    ### (such as from Jakarta Commons Codec)?
 
57
 
 
58
(2) No significant/interesting functionality to export.
 
59
 
 
60
(3) A SWIG interface file exists, but only to export types used by other
 
61
    modules.  No binding module is actually constructed from this
 
62
    header.
 
63
 
 
64
 
 
65
NOTE: the bindings code is being developed using SWIG 1.3.19 or
 
66
later.  Earlier versions of SWIG will simply *not* work.
 
67
 
 
68
 
 
69
 
 
70
 
 
71
SWIG MODULES
 
72
------------
 
73
 
 
74
We will produce a number of modules/classes, expecting the binding
 
75
languages to organize these into a package, and present the Subversion
 
76
libraries' API in a manner familiar to programmers of a given
 
77
language.  For instance, the Python bindings are handled as follows:
 
78
 
 
79
svn.core
 
80
svn.client
 
81
svn.delta
 
82
svn.fs
 
83
svn.ra
 
84
svn.repos
 
85
svn.wc
 
86
 
 
87
 
 
88
 
 
89
 
 
90
THUNK EDITORS
 
91
-------------
 
92
 
 
93
"Thunk" is Windows programming term describing a "go between."  Our
 
94
SWIG bindings generally implement editors in C which delegate to the
 
95
language-specific extension API (e.g. its C API for Python, JNI for
 
96
Java, etc.).  This transitional object implements a Subversion editor
 
97
interface, allowing it to be passed between its native library code
 
98
and the runtime of the language which the bindings were written for.
 
99
 
 
100
 
 
101
 
 
102
 
 
103
SWIG INTERFACE FILE CODING NOTES
 
104
--------------------------------
 
105
 
 
106
Always place %{ #include "foo.h" ... %} sections above any code which
 
107
will actually cause SWIG to generate wrappers.  This is because those
 
108
wrappers may need declarations from the headers to be valid C.
 
109
Practically, this means that the %{ ... %} block should be above any
 
110
"%include *.h" statements (%includes of *.i files are fine, since they
 
111
should be self-sufficient).
 
112