An input.
More...
#include <stdbool.h>
#include <stddef.h>
Go to the source code of this file.
An input.
Copyright (C) 2019-2023 kaoru https://www.tetengo.org/
◆ tetengo_lattice_customInput_context()
const void * tetengo_lattice_customInput_context |
( |
const tetengo_lattice_input_t * |
p_custom_input | ) |
|
Returns the context of a custom input.
- Parameters
-
p_custom_input | A pointer to a custom input. |
- Returns
- A pointer to the context. Or NULL when p_custom_input is NULL or is not a custom input.
◆ tetengo_lattice_customInput_setContext()
bool tetengo_lattice_customInput_setContext |
( |
tetengo_lattice_input_t * |
p_custom_input, |
|
|
void * |
p_context |
|
) |
| |
Sets a context of a custom input.
- Parameters
-
p_custom_input | A pointer to a custom input. |
p_context | A pointer to a context. |
- Return values
-
true | When the context is set. |
false | Otherwise. |
◆ tetengo_lattice_input_append()
bool tetengo_lattice_input_append |
( |
tetengo_lattice_input_t * |
p_input, |
|
|
tetengo_lattice_input_t * |
p_another |
|
) |
| |
Appends another input.
The ownership of the input pointed by p_another is transferred into this input. There is no need to destroy the input p_another after calling this function.
- Parameters
-
p_input | A pointer to an input. |
p_another | A pointer to another input. |
- Return values
-
true | When p_another is appended to this input. |
false | Otherwise. |
◆ tetengo_lattice_input_clone()
tetengo_lattice_input_t * tetengo_lattice_input_clone |
( |
const tetengo_lattice_input_t * |
p_input | ) |
|
Clone the input.
- Parameters
-
p_input | A pointer to an input. |
- Returns
- A unique pointer to a clone. Or NULL when p_input is NULL.
◆ tetengo_lattice_input_createCustomInput()
Creates a custom input.
- Parameters
-
p_definition | A pointer to a definition. |
- Returns
- A pointer to a custom input. Or NULL when p_definition NULL
◆ tetengo_lattice_input_createStringInput()
tetengo_lattice_input_t * tetengo_lattice_input_createStringInput |
( |
const char * |
value | ) |
|
Creates a string input.
- Parameters
-
- Returns
- A pointer to an string input. Or NULL when value is NULL.
◆ tetengo_lattice_input_createSubrange()
tetengo_lattice_input_t * tetengo_lattice_input_createSubrange |
( |
const tetengo_lattice_input_t * |
p_input, |
|
|
size_t |
offset, |
|
|
size_t |
length |
|
) |
| |
Creates a subrange.
- Parameters
-
p_input | A pointer to an input. |
offset | An offset. |
length | A length. |
- Returns
- A pointer to a subrange. Or NULL when p_input is NULL, or offset and/or length are out of the range of the input.
◆ tetengo_lattice_input_destroy()
void tetengo_lattice_input_destroy |
( |
const tetengo_lattice_input_t * |
p_input | ) |
|
Destroys an input.
- Parameters
-
p_input | A pointer to an input. |
◆ tetengo_lattice_input_equal()
bool tetengo_lattice_input_equal |
( |
const tetengo_lattice_input_t * |
p_one, |
|
|
const tetengo_lattice_input_t * |
p_another |
|
) |
| |
Returns true if one input is equal to another.
- Parameters
-
p_one | A pointer to one input. |
p_another | A pointer to another input. |
- Return values
-
true | When one input is equal to another. |
false | Otherwise. |
◆ tetengo_lattice_input_hashValue()
size_t tetengo_lattice_input_hashValue |
( |
const tetengo_lattice_input_t * |
p_input | ) |
|
Returns the hash value.
- Parameters
-
p_input | A pointer to an input. |
- Returns
- The hash value. Or (size_t)-1 when p_input is NULL.
◆ tetengo_lattice_input_length()
size_t tetengo_lattice_input_length |
( |
const tetengo_lattice_input_t * |
p_input | ) |
|
Returns the length.
- Parameters
-
p_input | A pointer to an input. |
- Returns
- The length. Or (size_t)-1 when p_input is NULL.
◆ tetengo_lattice_stringInput_setValue()
bool tetengo_lattice_stringInput_setValue |
( |
tetengo_lattice_input_t * |
p_string_input, |
|
|
const char * |
value |
|
) |
| |
Sets a value of a string input.
- Parameters
-
p_string_input | A pointer to a string input. |
value | A value. |
- Return values
-
true | When the value is set. |
false | Otherwise. |
◆ tetengo_lattice_stringInput_value()
const char * tetengo_lattice_stringInput_value |
( |
const tetengo_lattice_input_t * |
p_string_input | ) |
|
Returns the value of a string input.
- Parameters
-
p_string_input | A pointer to a string input. |
- Returns
- The value. Or NULL when p_string_input is NULL or is not a string input.