From dd6e7a9c9eba66e97be43edc3c340a53b27597c2 Mon Sep 17 00:00:00 2001 From: Marco Cetica Date: Mon, 12 Jan 2026 11:58:32 +0100 Subject: [PATCH] Updated documentation --- README.md | 2 +- docs/bigint.md | 4 ++-- docs/map.md | 6 +++--- docs/vector.md | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 678ffee..8f18ebe 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ the standard library. It currently features: - [**Vector**](/docs/vector.md): a growable, contiguous array of homogenous generic data types; - [**Map**](/docs/map.md): an associative array that handles generic heterogenous data types; -- [**BigInt**](/docs/bigint.md): a data type for arbitrary large integers. +- [**BigInt**](/docs/bigint.md): a data type for arbitrary large integers. ## Usage At its simplest, you can use this library as follows: diff --git a/docs/bigint.md b/docs/bigint.md index e51980a..38819a7 100644 --- a/docs/bigint.md +++ b/docs/bigint.md @@ -46,7 +46,7 @@ The `BigInt` data structure supports the following methods: - `bigint_result_t bigint_destroy(number)`: delete the big number; - `bigint_result_t bigint_printf(format, ...)`: `printf` wrapper that introduces the `%B` placeholder to print big numbers. It supports variadic parameters. -As you can see by the previous function signatures, methods that operate on the +As you can see from the previous function signatures, methods that operate on the `BigInt` data type return a custom type called `bigint_result_t` which is defined as follows: @@ -80,7 +80,7 @@ by setting the `status` field and by providing a descriptive message on the `mes field. If the operation was successful (that is, `status == BIGINT_OK`), you can either move on with the rest of the program or read the returned value from the sum data type. Of course, you can choose to ignore the return value (if you're brave enough :D) as -illustrated in the first part of the README. +illustrated on the first part of the README. The sum data type (i.e., the `value` union) defines four different variables. Each of them has an unique scope as described below: diff --git a/docs/map.md b/docs/map.md index f825bf8..a0c3eeb 100644 --- a/docs/map.md +++ b/docs/map.md @@ -5,7 +5,7 @@ aspects (internal design, memory layout, etc.) of the `Map` data structure. `Map` is an hash table that uses open addressing with linear probing for collision resolution and the [FNV-1a algorithm](https://en.wikipedia.org/wiki/Fowler–Noll–Vo_hash_function) as its hashing function. Resizing is performed automatically by doubling the capacity when the load factor exceeds 75%. Internally, -this data structure is represented by the following two structures: +this data structure is represented by the following two layouts: ```c typedef struct { @@ -46,7 +46,7 @@ The `Map` data structure supports the following methods: - `size_t map_size(map)`: returns map size (i.e., the number of elements); - `size_t map_capacity(map)`: returns map capacity (i.e., map total size). -As you can see by the previous function signatures, most methods that operate +As you can see from the previous function signatures, most methods that operate on the `Map` data type return a custom type called `map_result_t` which is defined as follows: @@ -73,4 +73,4 @@ Each method that returns such type indicates whether the operation was successfu the `status` field and by providing a descriptive message on the `message` field. If the operation was successful (that is, `status == MAP_OK`), you can either move on with the rest of the program or read the returned value from the sum data type. Of course, you can choose to ignore the return value (if you're brave enough :D) as illustrated -in the first part of the README. \ No newline at end of file +on the first part of the README. diff --git a/docs/vector.md b/docs/vector.md index cd24c0b..dd67d82 100644 --- a/docs/vector.md +++ b/docs/vector.md @@ -5,7 +5,7 @@ aspects (internal design, memory layout, etc.) of the `Vector` data structure. `Vector` is a dynamic array with generic data type support; this means that you can store any kind of homogenous value on this data structure. Resizing is performed automatically by increasing the capacity by 1.5 times when the array becomes full. Internally, this -data structure is represented by the following structure: +data structure is represented by the following layout: ```c typedef struct { @@ -39,7 +39,7 @@ At the time being, `Vector` supports the following methods: - `size_t vector_size(vector)`: return vector size (i.e., the number of elements); - `size_t vector_capacity(vector)`: return vector capacity (i.e., vector total size). -As you can see by the previous function signatures, most methods that operate +As you can see from the previous function signatures, most methods that operate on the `Vector` data type return a custom type called `vector_result_t` which is defined as follows: @@ -66,7 +66,7 @@ Each method that returns such type indicates whether the operation was successfu by setting the `status` field and by providing a descriptive message on the `message` field. If the operation was successful (that is, `status == VECTOR_OK`), you can either move on with the rest of the program or read the returned value from the sum data type. Of course, you can choose to -ignore the return value (if you're brave enough :D) as illustrated in the first part of the README. +ignore the return value (if you're brave enough :D) as illustrated on the first part of the README. ## Functional methods `Vector` provides three functional methods called `map`, `filter` and `reduce` which allow the caller to apply a computation to the vector,