Skip to content

Commit cbfc303

Browse files
committed
Deploying to gh-pages from @ 8b19f6c 🚀
1 parent e19e6c7 commit cbfc303

File tree

10 files changed

+23
-26
lines changed

10 files changed

+23
-26
lines changed

.doctrees/environment.pickle

114 Bytes
Binary file not shown.

_sources/developer-guides/bindings/writing-a-vapi-manually/05-00-fundamentals-of-binding-a-c-function/05-01-out-and-reference-parameters-and-return-values.rst.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ Returning structs is rather different. Because struct's memory is allocated by t
5151

5252
.. code-block:: vala
5353
54-
public struct Foo { }
54+
public struct Foo { /* … */ }
5555
public Foo get_foo (int x);
5656
public void get_foo2 (int x, out Foo f);
57-
57+
5858
.. code-block:: c
5959
6060
void get_foo(int x, foo *ret);
@@ -73,4 +73,3 @@ To return a struct directly, the question mark operator will box it, and make it
7373
int make_foo(int y, foo **f);
7474
7575
The ownership rules in :doc:`05-02-ownership` apply.
76-

_sources/developer-guides/bindings/writing-a-vapi-manually/06-00-adding-vala-friendly-semantics/06-03-collections.rst.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ For container-like instances, Vala provides syntactic sugar to convert certain o
7777

7878
.. code-block:: vala
7979
80-
x in a → a.contains (x)
81-
a[x, y] → a.get (x, y)
82-
a[x, y] = z → a.set (x, y, z);
83-
foreach (var x in a) { … } → var x; var i = a.iterator (); while ((x = i.next_value ()) != null) {...}
84-
foreach (var x in a) { … } → var i = a.iterator (); while (i.next ()) { var x = i.get (); }
80+
x in a // → a.contains (x)
81+
a[x, y] // → a.get (x, y)
82+
a[x, y] = z // → a.set (x, y, z);
83+
foreach (var x in a) { /* … */ } // → var x; var i = a.iterator (); while ((x = i.next_value ()) != null) { /* … */ }
84+
foreach (var x in a) { /* … */ } // → var i = a.iterator (); while (i.next ()) { var x = i.get (); /* … */ }
8585
8686
If appropriate, providing methods that match these prototypes will allow use of the sugar.
8787

@@ -90,4 +90,3 @@ If appropriate, providing methods that match these prototypes will allow use of
9090
Iterators require an intermediate object to be the holder of the iteration state. That class must implement a next_value function that returns the next value or null if iteration is to stop or it may have a next method with signature ``bool next ()`` that moves to the next element and returns true if there is one and a method ``T get ()`` to retrieve the current value of the iterator. It is rare for a C program to have the interface needed to do this.
9191

9292
Use your best judgement in deciding whether or not to use these conventions. This is modifying the interface, but it does tend to make the resulting interface easier to use.
93-

_sources/tutorials/programming-language/main/04-00-advanced-features/04-08-asynchronous-methods.rst.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ example:
4141
4242
async void display_jpeg(string fnam) {
4343
// Load JPEG in a background thread and display it when loaded
44-
[...]
44+
// [...]
4545
}
4646
4747
@@ -52,7 +52,7 @@ or:
5252
async int fetch_webpage(string url, out string text) throws IOError {
5353
// Fetch a webpage asynchronously and when ready return the
5454
// HTTP status code and put the page contents in 'text'
55-
[...]
55+
// [...]
5656
text = result;
5757
return status;
5858
}
@@ -115,7 +115,7 @@ other code to use to resume the method's execution:
115115
.. code-block:: vala
116116
117117
SourceFunc callback = fetch_webpage.callback;
118-
[... store 'callback' somewhere ...]
118+
/* … store 'callback' somewhere … */
119119
yield;
120120
121121
Some code elsewhere must now call the stored ``SourceFunc`` in order for
@@ -169,4 +169,3 @@ Examples
169169
--------
170170

171171
See `Async Method Samples <https://wiki.gnome.org/Projects/Vala/AsyncSamples>`_ for examples of different ways that async may be used.
172-

developer-guides/bindings/writing-a-vapi-manually/05-00-fundamentals-of-binding-a-c-function/05-01-out-and-reference-parameters-and-return-values.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,9 @@ <h1><span class="section-number">5.1. </span>Out and Reference Parameters and Re
520520
</div>
521521
<p>Note that when you think of an “out array” what you may actually want is just a buffer. If the caller allocates the memory, you want a buffer, not an out array.</p>
522522
<p>Returning structs is rather different. Because struct’s memory is allocated by the caller, an out parameter for a struct is indistinguishable from a regular pointer. Moreover, returning a struct actually means including a hidden out parameter.</p>
523-
<div class="highlight-vala notranslate"><div class="highlight"><pre><span></span>public struct Foo { … }
524-
public Foo get_foo (int x);
525-
public void get_foo2 (int x, out Foo f);
523+
<div class="highlight-vala notranslate"><div class="highlight"><pre><span></span><span class="kd">public</span><span class="w"> </span><span class="kd">struct</span><span class="w"> </span><span class="nc">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="cm">/* … */</span><span class="w"> </span><span class="p">}</span>
524+
<span class="kd">public</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="n">get_foo</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">x</span><span class="p">);</span>
525+
<span class="kd">public</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="n">get_foo2</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="k">out</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="n">f</span><span class="p">);</span>
526526
</pre></div>
527527
</div>
528528
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span><span class="w"> </span><span class="nf">get_foo</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">foo</span><span class="w"> </span><span class="o">*</span><span class="n">ret</span><span class="p">);</span>

developer-guides/bindings/writing-a-vapi-manually/06-00-adding-vala-friendly-semantics/06-03-collections.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -539,11 +539,11 @@ <h1><span class="section-number">6.3. </span>Collections<a class="headerlink" hr
539539
</pre></div>
540540
</div>
541541
<p>For container-like instances, Vala provides syntactic sugar to convert certain operations into method calls:</p>
542-
<div class="highlight-vala notranslate"><div class="highlight"><pre><span></span>x in a → a.contains (x)
543-
a[x, y] → a.get (x, y)
544-
a[x, y] = z → a.set (x, y, z);
545-
foreach (var x in a) { … } → var x; var i = a.iterator (); while ((x = i.next_value ()) != null) {...}
546-
foreach (var x in a) { … } → var i = a.iterator (); while (i.next ()) { var x = i.get (); … }
542+
<div class="highlight-vala notranslate"><div class="highlight"><pre><span></span><span class="n">x</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="c1">// → a.contains (x)</span>
543+
<span class="n">a</span><span class="p">[</span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">y</span><span class="p">]</span><span class="w"> </span><span class="c1">// → a.get (x, y)</span>
544+
<span class="n">a</span><span class="p">[</span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">y</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">z</span><span class="w"> </span><span class="c1">// → a.set (x, y, z);</span>
545+
<span class="k">foreach</span><span class="w"> </span><span class="p">(</span><span class="kd">var</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="n">a</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="cm">/* … */</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="c1">// → var x; var i = a.iterator (); while ((x = i.next_value ()) != null) { /* … */ }</span>
546+
<span class="k">foreach</span><span class="w"> </span><span class="p">(</span><span class="kd">var</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="n">a</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="cm">/* … */</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="c1">// → var i = a.iterator (); while (i.next ()) { var x = i.get (); /* … */ }</span>
547547
</pre></div>
548548
</div>
549549
<p>If appropriate, providing methods that match these prototypes will allow use of the sugar.</p>

tutorials/programming-language/main/04-00-advanced-features/04-08-asynchronous-methods.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -520,15 +520,15 @@ <h1><span class="section-number">4.8. </span>Asynchronous Methods<a class="heade
520520
example:</p>
521521
<div class="highlight-vala notranslate"><div class="highlight"><pre><span></span><span class="n">async</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="n">display_jpeg</span><span class="p">(</span><span class="kt">string</span><span class="w"> </span><span class="n">fnam</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
522522
<span class="w"> </span><span class="c1">// Load JPEG in a background thread and display it when loaded</span>
523-
<span class="w"> </span><span class="p">[...]</span>
523+
<span class="w"> </span><span class="c1">// [...]</span>
524524
<span class="p">}</span>
525525
</pre></div>
526526
</div>
527527
<p>or:</p>
528528
<div class="highlight-vala notranslate"><div class="highlight"><pre><span></span><span class="n">async</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">fetch_webpage</span><span class="p">(</span><span class="kt">string</span><span class="w"> </span><span class="n">url</span><span class="p">,</span><span class="w"> </span><span class="k">out</span><span class="w"> </span><span class="kt">string</span><span class="w"> </span><span class="n">text</span><span class="p">)</span><span class="w"> </span><span class="kd">throws</span><span class="w"> </span><span class="n">IOError</span><span class="w"> </span><span class="p">{</span>
529529
<span class="w"> </span><span class="c1">// Fetch a webpage asynchronously and when ready return the</span>
530530
<span class="w"> </span><span class="c1">// HTTP status code and put the page contents in &#39;text&#39;</span>
531-
<span class="w"> </span><span class="p">[...]</span>
531+
<span class="w"> </span><span class="c1">// [...]</span>
532532
<span class="w"> </span><span class="n">text</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">result</span><span class="p">;</span>
533533
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">status</span><span class="p">;</span>
534534
<span class="p">}</span>
@@ -579,9 +579,9 @@ <h1><span class="section-number">4.8. </span>Asynchronous Methods<a class="heade
579579
</div>
580580
<p>This form gives up control, and stores the callback details for some
581581
other code to use to resume the method’s execution:</p>
582-
<div class="highlight-vala notranslate"><div class="highlight"><pre><span></span>SourceFunc callback = fetch_webpage.callback;
583-
[... store &#39;callback&#39; somewhere ...]
584-
yield;
582+
<div class="highlight-vala notranslate"><div class="highlight"><pre><span></span><span class="n">SourceFunc</span><span class="w"> </span><span class="n">callback</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">fetch_webpage</span><span class="p">.</span><span class="n">callback</span><span class="p">;</span>
583+
<span class="cm">/* … store &#39;callback&#39; somewhere … */</span>
584+
<span class="k">yield</span><span class="p">;</span>
585585
</pre></div>
586586
</div>
587587
<p>Some code elsewhere must now call the stored <code class="docutils literal notranslate"><span class="pre">SourceFunc</span></code> in order for

0 commit comments

Comments
 (0)