~ubuntu-branches/debian/squeeze/glib2.0/squeeze

« back to all changes in this revision

Viewing changes to docs/reference/gobject/html/ch01s02.html

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2009-02-15 13:00:43 UTC
  • mfrom: (1.3.1 upstream) (69.1.10 intrepid)
  • Revision ID: james.westby@ubuntu.com-20090215130043-q47fbt3owmt42m2f
Tags: 2.18.4-2
* Release to unstable
* debian/rules:
- bump SHVER, since we are already forcing a 2.18.0 dependecy on the
  symbols introduced in the development versions
* debian/control.in:
- added Homepage and Vcs-* control fields

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
2
<html>
3
3
<head>
4
 
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
 
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
5
<title>Exporting a C API</title>
6
 
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
7
 
<link rel="start" href="index.html" title="GObject Reference Manual">
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
 
7
<link rel="home" href="index.html" title="GObject Reference Manual">
8
8
<link rel="up" href="chapter-intro.html" title="Background">
9
9
<link rel="prev" href="chapter-intro.html" title="Background">
10
10
<link rel="next" href="chapter-gtype.html" title="The GLib Dynamic Type System">
11
 
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
 
11
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
<link rel="preface" href="pr01.html" title="Introduction">
14
 
<link rel="part" href="pt01.html" title="Part&#160;I.&#160;Concepts">
 
14
<link rel="part" href="pt01.html" title="Part I. Concepts">
15
15
<link rel="chapter" href="chapter-intro.html" title="Background">
16
16
<link rel="chapter" href="chapter-gtype.html" title="The GLib Dynamic Type System">
17
17
<link rel="chapter" href="chapter-gobject.html" title="The GObject base class">
18
18
<link rel="chapter" href="chapter-signal.html" title="The GObject messaging system">
19
19
<link rel="reference" href="rn01.html" title="API Reference">
20
20
<link rel="reference" href="rn02.html" title="Tools Reference">
21
 
<link rel="part" href="pt02.html" title="Part&#160;IV.&#160;Tutorial">
 
21
<link rel="part" href="pt02.html" title="Part IV. Tutorial">
22
22
<link rel="chapter" href="howto-gobject.html" title="How to define and implement a new GObject">
23
23
<link rel="chapter" href="howto-interface.html" title="How to define and implement interfaces">
24
24
<link rel="chapter" href="howto-signals.html" title="How to create and use signals">
25
 
<link rel="part" href="pt03.html" title="Part&#160;V.&#160;Related Tools">
 
25
<link rel="part" href="pt03.html" title="Part V. Related Tools">
 
26
<link rel="chapter" href="tools-vala.html" title="Vala">
26
27
<link rel="chapter" href="tools-gob.html" title="GObject builder">
27
28
<link rel="chapter" href="tools-ginspector.html" title="Graphical inspection of GObjects">
28
29
<link rel="chapter" href="tools-refdb.html" title="Debugging reference count problems">
36
37
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
37
38
<link rel="index" href="ix08.html" title="Index of new symbols in 2.12">
38
39
<link rel="index" href="ix09.html" title="Index of new symbols in 2.14">
 
40
<link rel="index" href="ix10.html" title="Index of new symbols in 2.14">
39
41
</head>
40
42
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
41
43
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
47
49
</tr></table>
48
50
<div class="sect1" lang="en">
49
51
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
50
 
<a name="id2763033"></a>Exporting a C API</h2></div></div></div>
 
52
<a name="id2960730"></a>Exporting a C API</h2></div></div></div>
51
53
<p>
52
54
      C APIs are defined by a set of functions and global variables which are usually exported from a 
53
55
      binary. C functions have an arbitrary number of arguments and one return value. Each function is thus
117
119
        reads the original function signature.</p></li>
118
120
<li><p>The solution used by GLib is to use the GType library which holds at runtime a description of
119
121
        all the objects manipulated by the programmer. This so-called <span class="emphasis"><em>dynamic type</em></span>
120
 
        <sup>[<a name="id2761671" href="#ftn.id2761671" class="footnote">1</a>]</sup>
 
122
        <sup>[<a name="id2959595" href="#ftn.id2959595" class="footnote">1</a>]</sup>
121
123
        library is then used by special generic glue code to automatically convert function parameters and
122
124
        function calling conventions between different runtime domains.</p></li>
123
125
</ul></div>
126
128
      boundaries is written once: the figure below states this more clearly.
127
129
      </p>
128
130
<div class="figure">
129
 
<a name="id2761698"></a><p class="title"><b>Figure&#160;1.&#160;</b></p>
 
131
<a name="id2959621"></a><p class="title"><b>Figure 1. </b></p>
130
132
<div class="figure-contents"><div class="mediaobject" align="center"><img src="glue.png" align="middle"></div></div>
131
133
</div>
132
134
<p><br class="figure-break">
144
146
    </p>
145
147
<div class="footnotes">
146
148
<br><hr width="100" align="left">
147
 
<div class="footnote"><p><sup>[<a name="ftn.id2761671" href="#id2761671" class="para">1</a>] </sup>
 
149
<div class="footnote"><p><sup>[<a name="ftn.id2959595" href="#id2959595" class="para">1</a>] </sup>
148
150
            There are numerous different implementations of dynamic type systems: all C++ 
149
151
            compilers have one, Java and .NET have one too. A dynamic type system allows you
150
152
            to get information about every instantiated object at runtime. It can be implemented
155
157
          </p></div>
156
158
</div>
157
159
</div>
 
160
<div class="footer">
 
161
<hr>
 
162
          Generated by GTK-Doc V1.11</div>
158
163
</body>
159
164
</html>