Skip to content

Commit 70e3eff

Browse files
committed
Deploying to gh-pages from @ 0c90591 🚀
1 parent affd711 commit 70e3eff

File tree

5 files changed

+37
-45
lines changed

5 files changed

+37
-45
lines changed

_sources/index.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Dylan-curl
22
==========
33

4-
Curl library wrapper for the Opendylan language.
4+
Curl library wrapper for the Dylan language.
55

66
.. toctree::
77
:maxdepth: 2

_sources/introduction.rst.txt

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Introduction
33

44
``dylan-curl`` is a wrapper around the popular libcurl library,
55
providing a way to interact with network resources from within Open
6-
Dylan programs. This wrapper try to simplify the complexities of
6+
Dylan programs. This wrapper tries to simplify the complexities of
77
libcurl, offering a Dylan-friendly API while maintaining the core
88
capabilities of the underlying C library.
99

@@ -20,8 +20,8 @@ Dylan Integration:
2020
handling into Dylan's exception mechanism for cleaner and more
2121
reliable error management.
2222

23-
Howto convert a libcurl program
24-
-------------------------------
23+
How to convert a libcurl program
24+
--------------------------------
2525

2626
When converting a libcurl-based C program to the Open Dylan wrapper, a
2727
few conventions streamline the process. Below are the main conventions
@@ -44,7 +44,7 @@ wrapper, you create an object of the :class:`<curl-easy>` class.
4444
}
4545
4646
.. code-block:: dylan
47-
:caption: Opendylan example
47+
:caption: Dylan example
4848
4949
let curl = make(<curl-easy>);
5050
@@ -59,7 +59,7 @@ In libcurl, parameters are configured using `curl_easy_setopt
5959
<https://curl.se/libcurl/c/curl_easy_setopt.html>`_, where a constant
6060
representing the option name is paired with its value. In the Open
6161
Dylan wrapper, options are set directly using property syntax, such as
62-
`curl.curl-option-name := value`. If an error occurs while setting a
62+
``curl.curl-option-name := value`. If an error occurs while setting a
6363
parameter, a :class:`<curl-option-error>` exception is raised.
6464
6565
.. code-block:: c
@@ -74,7 +74,7 @@ parameter, a :class:`<curl-option-error>` exception is raised.
7474
}
7575
7676
In libcurl, each parameter should be validated after calling the
77-
`curl_easy_setopt` function, although this step is often omitted in
77+
``curl_easy_setopt`` function, although this step is often omitted in
7878
examples for simplicity. The libcurl documentation cautions: *"A
7979
real-world application will, of course, properly check every return
8080
value and exit correctly at the first serious error."*
@@ -85,7 +85,7 @@ handled either immediately at the point of the operation or deferred
8585
to another method for centralized error handling.
8686

8787
.. code-block:: dylan
88-
:caption: In Opendylan errors can be captured in a block somewhere.
88+
:caption: In Dylan errors can be captured in a block somewhere.
8989
9090
let curl = make(<curl-easy>);
9191
curl.curl-url := "https://example.com";
@@ -121,20 +121,16 @@ In Opendylan :function:`curl-perform` raises a
121121

122122
.. code-block:: dylan
123123
124-
curl-easy-perform(curl);
125-
126-
...
127-
128124
block ()
129-
...
125+
curl-easy-perform(curl);
130126
exception (err :: <curl-perform-error>)
131127
... show error or retry?
132128
end block;
133129
134130
Retrieving Information
135131
^^^^^^^^^^^^^^^^^^^^^^
136132

137-
In libcurl, retrieving information is done with `curl_easy_getinfo`,
133+
In libcurl, retrieving information is done with ``curl_easy_getinfo`,
138134
passing a constant for the type of information. In the Open Dylan
139135
wrapper, you access the information directly using property syntax.
140136

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@
264264
<article role="main" id="furo-main-content">
265265
<section id="dylan-curl">
266266
<h1>Dylan-curl<a class="headerlink" href="#dylan-curl" title="Link to this heading"></a></h1>
267-
<p>Curl library wrapper for the Opendylan language.</p>
267+
<p>Curl library wrapper for the Dylan language.</p>
268268
<div class="toctree-wrapper compound">
269269
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
270270
<ul>
@@ -274,7 +274,7 @@ <h1>Dylan-curl<a class="headerlink" href="#dylan-curl" title="Link to this headi
274274
</ul>
275275
</li>
276276
<li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a><ul>
277-
<li class="toctree-l2"><a class="reference internal" href="introduction.html#howto-convert-a-libcurl-program">Howto convert a libcurl program</a></li>
277+
<li class="toctree-l2"><a class="reference internal" href="introduction.html#how-to-convert-a-libcurl-program">How to convert a libcurl program</a></li>
278278
</ul>
279279
</li>
280280
<li class="toctree-l1"><a class="reference internal" href="curl_global.html">Curl global</a><ul>

introduction.html

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266
<h1>Introduction<a class="headerlink" href="#introduction" title="Link to this heading"></a></h1>
267267
<p><code class="docutils literal notranslate"><span class="pre">dylan-curl</span></code> is a wrapper around the popular libcurl library,
268268
providing a way to interact with network resources from within Open
269-
Dylan programs. This wrapper try to simplify the complexities of
269+
Dylan programs. This wrapper tries to simplify the complexities of
270270
libcurl, offering a Dylan-friendly API while maintaining the core
271271
capabilities of the underlying C library.</p>
272272
<p><strong>Key Features</strong></p>
@@ -281,17 +281,17 @@ <h1>Introduction<a class="headerlink" href="#introduction" title="Link to this h
281281
reliable error management.</p>
282282
</dd>
283283
</dl>
284-
<section id="howto-convert-a-libcurl-program">
285-
<h2>Howto convert a libcurl program<a class="headerlink" href="#howto-convert-a-libcurl-program" title="Link to this heading"></a></h2>
284+
<section id="how-to-convert-a-libcurl-program">
285+
<h2>How to convert a libcurl program<a class="headerlink" href="#how-to-convert-a-libcurl-program" title="Link to this heading"></a></h2>
286286
<p>When converting a libcurl-based C program to the Open Dylan wrapper, a
287287
few conventions streamline the process. Below are the main conventions
288288
and their corresponding Open Dylan equivalents.</p>
289289
<section id="creating-a-curl-handle">
290290
<h3>Creating a CURL Handle<a class="headerlink" href="#creating-a-curl-handle" title="Link to this heading"></a></h3>
291291
<p>In libcurl, you create a handle using <a class="reference external" href="https://curl.se/libcurl/c/curl_easy_init.html">curl_easy_init</a>. In the Open Dylan
292292
wrapper, you create an object of the <code class="xref py py-class docutils literal notranslate"><span class="pre">&lt;curl-easy&gt;</span></code> class.</p>
293-
<div class="literal-block-wrapper docutils container" id="id3">
294-
<div class="code-block-caption"><span class="caption-text">C example</span><a class="headerlink" href="#id3" title="Link to this code"></a></div>
293+
<div class="literal-block-wrapper docutils container" id="id7">
294+
<div class="code-block-caption"><span class="caption-text">C example</span><a class="headerlink" href="#id7" title="Link to this code"></a></div>
295295
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">CURL</span><span class="w"> </span><span class="o">*</span><span class="n">curl</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">curl_easy_init</span><span class="p">();</span>
296296
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">curl</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
297297
<span class="w"> </span><span class="p">...</span>
@@ -300,8 +300,8 @@ <h3>Creating a CURL Handle<a class="headerlink" href="#creating-a-curl-handle" t
300300
</pre></div>
301301
</div>
302302
</div>
303-
<div class="literal-block-wrapper docutils container" id="id4">
304-
<div class="code-block-caption"><span class="caption-text">Opendylan example</span><a class="headerlink" href="#id4" title="Link to this code"></a></div>
303+
<div class="literal-block-wrapper docutils container" id="id8">
304+
<div class="code-block-caption"><span class="caption-text">Dylan example</span><a class="headerlink" href="#id8" title="Link to this code"></a></div>
305305
<div class="highlight-dylan notranslate"><div class="highlight"><pre><span></span><span class="k">let</span><span class="w"> </span><span class="n">curl</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">make</span><span class="p">(</span><span class="nc">&lt;curl-easy&gt;</span><span class="p">);</span>
306306
</pre></div>
307307
</div>
@@ -315,10 +315,10 @@ <h3>Setting Parameters<a class="headerlink" href="#setting-parameters" title="Li
315315
<p>In libcurl, parameters are configured using <a class="reference external" href="https://curl.se/libcurl/c/curl_easy_setopt.html">curl_easy_setopt</a>, where a constant
316316
representing the option name is paired with its value. In the Open
317317
Dylan wrapper, options are set directly using property syntax, such as
318-
<cite>curl.curl-option-name := value</cite>. If an error occurs while setting a
318+
<a href="#id1"><span class="problematic" id="id2">``</span></a>curl.curl-option-name := value`. If an error occurs while setting a
319319
parameter, a <code class="xref py py-class docutils literal notranslate"><span class="pre">&lt;curl-option-error&gt;</span></code> exception is raised.</p>
320-
<div class="literal-block-wrapper docutils container" id="id5">
321-
<div class="code-block-caption"><span class="caption-text">Example showing the error checking, usually hidden in examples.</span><a class="headerlink" href="#id5" title="Link to this code"></a></div>
320+
<div class="literal-block-wrapper docutils container" id="id9">
321+
<div class="code-block-caption"><span class="caption-text">Example showing the error checking, usually hidden in examples.</span><a class="headerlink" href="#id9" title="Link to this code"></a></div>
322322
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">CURLCODE</span><span class="w"> </span><span class="n">code</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">curl_easy_setopt</span><span class="p">(</span><span class="n">curl</span><span class="p">,</span><span class="w"> </span><span class="n">CURLOPT_URL</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;https://example.com&quot;</span><span class="p">);</span>
323323
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">code</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">CURLE_OK</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
324324
<span class="w"> </span><span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span>
@@ -330,16 +330,16 @@ <h3>Setting Parameters<a class="headerlink" href="#setting-parameters" title="Li
330330
</div>
331331
</div>
332332
<p>In libcurl, each parameter should be validated after calling the
333-
<cite>curl_easy_setopt</cite> function, although this step is often omitted in
333+
<code class="docutils literal notranslate"><span class="pre">curl_easy_setopt</span></code> function, although this step is often omitted in
334334
examples for simplicity. The libcurl documentation cautions: <em>“A
335335
real-world application will, of course, properly check every return
336336
value and exit correctly at the first serious error.”</em></p>
337337
<p>In Open Dylan, whenever an option is set, the result is automatically
338338
checked. If an error occurs, an exception is raised, allowing it to be
339339
handled either immediately at the point of the operation or deferred
340340
to another method for centralized error handling.</p>
341-
<div class="literal-block-wrapper docutils container" id="id6">
342-
<div class="code-block-caption"><span class="caption-text">In Opendylan errors can be captured in a block somewhere.</span><a class="headerlink" href="#id6" title="Link to this code"></a></div>
341+
<div class="literal-block-wrapper docutils container" id="id10">
342+
<div class="code-block-caption"><span class="caption-text">In Dylan errors can be captured in a block somewhere.</span><a class="headerlink" href="#id10" title="Link to this code"></a></div>
343343
<div class="highlight-dylan notranslate"><div class="highlight"><pre><span></span><span class="k">let</span><span class="w"> </span><span class="n">curl</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">make</span><span class="p">(</span><span class="nc">&lt;curl-easy&gt;</span><span class="p">);</span>
344344
<span class="n">curl</span><span class="p">.</span><span class="n">curl-url</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="s">&quot;https://example.com&quot;</span><span class="p">;</span>
345345

@@ -359,8 +359,8 @@ <h3>Setting Parameters<a class="headerlink" href="#setting-parameters" title="Li
359359
<h3>Performing the Request<a class="headerlink" href="#performing-the-request" title="Link to this heading"></a></h3>
360360
<p>In libcurl, the request is executed using <cite>curl_easy_perform</cite>. The
361361
Open Dylan equivalent is the method <code class="xref py py-meth docutils literal notranslate"><span class="pre">curl-easy-perform()</span></code>.</p>
362-
<div class="literal-block-wrapper docutils container" id="id7">
363-
<div class="code-block-caption"><span class="caption-text">C Example</span><a class="headerlink" href="#id7" title="Link to this code"></a></div>
362+
<div class="literal-block-wrapper docutils container" id="id11">
363+
<div class="code-block-caption"><span class="caption-text">C Example</span><a class="headerlink" href="#id11" title="Link to this code"></a></div>
364364
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="n">CURLcode</span><span class="w"> </span><span class="n">res</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">curl_easy_perform</span><span class="p">(</span><span class="n">curl</span><span class="p">);</span>
365365

366366
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">res</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">CURLE_OK</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
@@ -371,14 +371,10 @@ <h3>Performing the Request<a class="headerlink" href="#performing-the-request" t
371371
</pre></div>
372372
</div>
373373
</div>
374-
<p>In Opendylan <a href="#id1"><span class="problematic" id="id2">:function:`curl-perform`</span></a> raises a
374+
<p>In Opendylan <a href="#id3"><span class="problematic" id="id4">:function:`curl-perform`</span></a> raises a
375375
<code class="xref py py-class docutils literal notranslate"><span class="pre">&lt;curl-perform-error&gt;</span></code>.</p>
376-
<div class="highlight-dylan notranslate"><div class="highlight"><pre><span></span><span class="n">curl-easy-perform</span><span class="p">(</span><span class="n">curl</span><span class="p">);</span>
377-
378-
<span class="p">...</span>
379-
380-
<span class="nb">block</span><span class="w"> </span><span class="p">()</span>
381-
<span class="w"> </span><span class="p">...</span>
376+
<div class="highlight-dylan notranslate"><div class="highlight"><pre><span></span><span class="nb">block</span><span class="w"> </span><span class="p">()</span>
377+
<span class="w"> </span><span class="n">curl-easy-perform</span><span class="p">(</span><span class="n">curl</span><span class="p">);</span>
382378
<span class="nb">exception</span><span class="w"> </span><span class="p">(</span><span class="n">err</span><span class="w"> </span><span class="p">::</span><span class="w"> </span><span class="nc">&lt;curl-perform-error&gt;</span><span class="p">)</span>
383379
<span class="w"> </span><span class="p">...</span><span class="w"> </span><span class="n">show</span><span class="w"> </span><span class="nb">error</span><span class="w"> </span><span class="n">or</span><span class="w"> </span><span class="n">retry?</span>
384380
<span class="k">end</span><span class="w"> </span><span class="nb">block</span><span class="p">;</span>
@@ -387,11 +383,11 @@ <h3>Performing the Request<a class="headerlink" href="#performing-the-request" t
387383
</section>
388384
<section id="retrieving-information">
389385
<h3>Retrieving Information<a class="headerlink" href="#retrieving-information" title="Link to this heading"></a></h3>
390-
<p>In libcurl, retrieving information is done with <cite>curl_easy_getinfo</cite>,
386+
<p>In libcurl, retrieving information is done with <a href="#id5"><span class="problematic" id="id6">``</span></a>curl_easy_getinfo`,
391387
passing a constant for the type of information. In the Open Dylan
392388
wrapper, you access the information directly using property syntax.</p>
393-
<div class="literal-block-wrapper docutils container" id="id8">
394-
<div class="code-block-caption"><span class="caption-text">C example getting the total time of previous transfer</span><a class="headerlink" href="#id8" title="Link to this code"></a></div>
389+
<div class="literal-block-wrapper docutils container" id="id12">
390+
<div class="code-block-caption"><span class="caption-text">C example getting the total time of previous transfer</span><a class="headerlink" href="#id12" title="Link to this code"></a></div>
395391
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">double</span><span class="w"> </span><span class="n">total_time</span><span class="p">;</span>
396392
<span class="n">CURLCODE</span><span class="w"> </span><span class="n">res</span><span class="p">;</span>
397393

@@ -414,8 +410,8 @@ <h3>Retrieving Information<a class="headerlink" href="#retrieving-information" t
414410
</pre></div>
415411
</div>
416412
</div>
417-
<div class="literal-block-wrapper docutils container" id="id9">
418-
<div class="code-block-caption"><span class="caption-text">Dylan Example</span><a class="headerlink" href="#id9" title="Link to this code"></a></div>
413+
<div class="literal-block-wrapper docutils container" id="id13">
414+
<div class="code-block-caption"><span class="caption-text">Dylan Example</span><a class="headerlink" href="#id13" title="Link to this code"></a></div>
419415
<div class="highlight-dylan notranslate"><div class="highlight"><pre><span></span><span class="nb">block</span><span class="w"> </span><span class="p">()</span>
420416
<span class="w"> </span><span class="k">let</span><span class="w"> </span><span class="n">curl</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">make</span><span class="p">(</span><span class="nc">&lt;curl-easy&gt;</span><span class="p">);</span>
421417
<span class="w"> </span><span class="n">curl</span><span class="p">.</span><span class="n">curl-url</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="s">&quot;https://example.com/&quot;</span><span class="p">;</span>
@@ -491,7 +487,7 @@ <h3>Retrieving Information<a class="headerlink" href="#retrieving-information" t
491487
<div class="toc-tree">
492488
<ul>
493489
<li><a class="reference internal" href="#">Introduction</a><ul>
494-
<li><a class="reference internal" href="#howto-convert-a-libcurl-program">Howto convert a libcurl program</a><ul>
490+
<li><a class="reference internal" href="#how-to-convert-a-libcurl-program">How to convert a libcurl program</a><ul>
495491
<li><a class="reference internal" href="#creating-a-curl-handle">Creating a CURL Handle</a></li>
496492
<li><a class="reference internal" href="#setting-parameters">Setting Parameters</a></li>
497493
<li><a class="reference internal" href="#performing-the-request">Performing the Request</a></li>

0 commit comments

Comments
 (0)