Skip to content

Commit

Permalink
doc: Fix inaccuracies and typos
Browse files Browse the repository at this point in the history
Co-authored-by: @cgay
  • Loading branch information
fraya committed Jan 26, 2025
1 parent f44ad80 commit 7a78147
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion documentation/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Dylan-curl
==========

Curl library wrapper for the Opendylan language.
Curl library wrapper for the Dylan language.

.. toctree::
:maxdepth: 2
Expand Down
26 changes: 12 additions & 14 deletions documentation/source/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Introduction

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

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

Howto convert a libcurl program
-------------------------------
How to convert a libcurl program
--------------------------------

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

.. code-block:: dylan
:caption: In Opendylan errors can be captured in a block somewhere.
:caption: In Dylan errors can be captured in a block somewhere.
let curl = make(<curl-easy>);
curl.curl-url := "https://example.com";
Expand Down Expand Up @@ -120,21 +120,19 @@ In Opendylan :function:`curl-perform` raises a
:class:`<curl-perform-error>`.

.. code-block:: dylan
curl-easy-perform(curl);
...
:caption: Dylan example
block ()
...
curl-easy-perform(curl);
format-out("Request completed successfully.\n")
exception (err :: <curl-perform-error>)
... show error or retry?
format-err("Curl failed: %s\n", curl.curl-error-message)
end block;
Retrieving Information
^^^^^^^^^^^^^^^^^^^^^^

In libcurl, retrieving information is done with `curl_easy_getinfo`,
In libcurl, retrieving information is done with ``curl_easy_getinfo`,
passing a constant for the type of information. In the Open Dylan
wrapper, you access the information directly using property syntax.
Expand Down
2 changes: 1 addition & 1 deletion src/curl-easy.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ define class <curl-info-error> (<curl-error>) end;

///////////////////////////////////////////////////////////////////////////////
//
// Curl errors as exceptions
// Curl easy and methods/functions
//
///////////////////////////////////////////////////////////////////////////////

Expand Down

0 comments on commit 7a78147

Please sign in to comment.