#include "fftypes.h"
Go to the source code of this file.
Typedefs | |
typedef ffstring | ffstring |
Our much beloved string data type. | |
Functions | |
ffint32 | ffstring_create (const ffchar *source, ffstring *target) |
Creates a new ffstring from a C-style string. | |
ffint32 | ffstring_delete (ffstring *target) |
Deletes an ffstring. | |
ffint32 | ffstring_copy (const ffstring *source, ffstring *target) |
Creates a copy of an ffstring. | |
ffint32 | ffstring_move_and_delete (ffstring *source, ffstring *target) |
ffint32 | ffstring_dfe (ffstring *target, ffuint32 count) |
Deletes count characters from the end of the target string. | |
ffint32 | ffstring_rfe (ffstring *target, ffuint32 count, ffchar *append) |
Replaces the last count characters from the end of the target string with the C-style string append. | |
ffint32 | ffstring_rfe_ff (ffstring *target, ffuint32 count, const ffstring *append) |
Replaces the last count characters from the end of the target string with the ffstring append. | |
ffint32 | ffstring_append (ffstring *target, ffchar *append) |
Append a C-style string to the target ffstring. | |
ffint32 | ffstring_append_ff (ffstring *target, const ffstring *append) |
Append a ffstring to the target ffstring. | |
ffint32 | ffstring_instcount () |
Returns the current number of ffstring instances. | |
ffint32 | ffstring_tail (const ffstring *source, ffint32 count, ffstring *target) |
Creates a new ffstring from at most count characters (not including the terminating null byte) from the head of the source ffstring. | |
ffint32 | ffstring_tolower (ffstring *target) |
Converts a ffstring to lowercase. | |
ffint32 | ffstring_lower (const ffstring *source, ffstring *target) |
Creates a lowercase copy of an ffstring. | |
ffint32 | ffstring_compare (const ffstring *left, const ffchar *right) |
Case-sensitively compares an ffstring to a C-style string using strcmp(3). | |
ffint32 | ffstring_compare_ci (const ffstring *left, const ffchar *right) |
Case-insensitively compares an ffstring to a C-style string using tolower(3) and strcmp(3). | |
ffint32 | ffstring_compare_ff (const ffstring *left, const ffstring *right) |
Case-sensitively compares an ffstring to another using strcmp(3). | |
ffint32 | ffstring_compare_ff_ci (const ffstring *left, const ffstring *right) |
Case-insensitively compares an ffstring to another string using tolower(3) and strcmp(3). | |
ffint32 | ffstring_compare_tail (const ffstring *left, ffuint32 count, const ffchar *right) |
Case-sensitively compares the specified number of last characters of the given ffstring to a C-style string. | |
ffint32 | ffstring_compare_tail_ci (const ffstring *left, ffuint32 count, const ffchar *right) |
Case-insensitively compares the specified number of last characters of the given ffstring to a C-style string. | |
ffint32 | ffstring_compare_tail_ff (const ffstring *left, ffuint32 count, const ffstring *right) |
Case-sensitively compares the specified number of last characters of the given ffstring to another ffstring. | |
ffint32 | ffstring_compare_tail_ff_ci (const ffstring *left, ffuint32 count, const ffstring *right) |
Case-insensitively compares the specified number of last characters of the given ffstring to another ffstring. | |
ffchar | ffstring_last (const ffstring *source) |
Returns the last character of the given ffstring. | |
ffint32 | ffstring_compare_last (const ffstring *left, const ffchar right) |
Case-sensitively compares the last character of the given ffstring to a given character. | |
ffint32 | ffstring_compare_last_ci (const ffstring *left, const ffchar right) |
Case-insensitively compares the last character of the given ffstring to a given character. | |
ffbool | ffstring_equals (const ffstring *left, const ffchar *right) |
Checks if the given ffstring and C-style string are the same. | |
ffbool | ffstring_equals_ci (const ffstring *left, const ffchar *right) |
Case-insensitively checks if the given ffstring and C-style string are the same. | |
ffbool | ffstring_equals_ff (const ffstring *left, const ffstring *right) |
Checks if the two given ffstrings are the same. | |
ffbool | ffstring_equals_ff_ci (const ffstring *left, const ffstring *right) |
Case-insensitively checks if the two given ffstrings are the same. | |
ffbool | ffstring_tail_equals (const ffstring *left, const ffint32 count, const ffchar *right) |
Checks if the tail of the given ffstring is the same as the given C-style string. | |
ffbool | ffstring_tail_equals_ci (const ffstring *left, const ffint32 count, const ffchar *right) |
Case-insensitively checks if the tail of the given ffstring is the same as the given C-style string. | |
ffbool | ffstring_tail_equals_ff (const ffstring *left, const ffint32 count, const ffstring *right) |
Checks if the tail of the given ffstring equals the other given ffstring. | |
ffbool | ffstring_tail_equals_ff_ci (const ffstring *left, const ffint32 count, const ffstring *right) |
Case-insensitively checks if the tail of the given ffstring equals the other given ffstring. | |
ffbool | ffstring_last_equals (const ffstring *left, ffchar right) |
Checks if the last character of the given string matches the given character. | |
ffbool | ffstring_last_equals_ci (const ffstring *left, ffchar right) |
Case-insensitively checks if the last character of the given string matches the given character. | |
ffint32 | ffstring_decinst () |
Decreases the ffstring instance counter. |
A general rule for argument order: If we're creating a new ffstring, the source comes before the target. If we're just operating on an existing one, the target comes first.
Definition in file ffstring.h.
|
Our much beloved string data type.
|
|
Append a C-style string to the target ffstring. If the process fails, the target ffstring remains unchanged.
|
|
Append a ffstring to the target ffstring.
Definition at line 181 of file ffstring.c. References ffstring_append(). |
|
Case-sensitively compares an ffstring to a C-style string using strcmp(3).
Definition at line 221 of file ffstring.c. Referenced by ffpriv_ie_list_get(), ffpriv_ss_genitive(), ffstring_compare_tail(), and ffstring_equals(). |
|
Case-insensitively compares an ffstring to a C-style string using tolower(3) and strcmp(3).
Definition at line 226 of file ffstring.c. Referenced by ffpriv_genitive_stem(), ffstring_compare_tail_ci(), and ffstring_equals_ci(). |
|
Case-sensitively compares an ffstring to another using strcmp(3).
Definition at line 231 of file ffstring.c. Referenced by ffstring_compare_tail_ff(), ffstring_equals_ff(), and main(). |
|
Case-insensitively compares an ffstring to another string using tolower(3) and strcmp(3).
Definition at line 236 of file ffstring.c. Referenced by ffstring_compare_tail_ff_ci(), ffstring_equals_ff_ci(), and main(). |
|
Case-sensitively compares the last character of the given ffstring to a given character.
Definition at line 307 of file ffstring.c. References ffstring_last(). Referenced by ffstring_last_equals(). |
|
Case-insensitively compares the last character of the given ffstring to a given character.
Definition at line 322 of file ffstring.c. References ffstring_last(). Referenced by ffstring_last_equals_ci(). |
|
Case-sensitively compares the specified number of last characters of the given ffstring to a C-style string.
Definition at line 251 of file ffstring.c. References ffstring_compare(), ffstring_delete(), and ffstring_tail(). Referenced by ffpriv_genitive_plural(), and ffstring_tail_equals(). |
|
Case-insensitively compares the specified number of last characters of the given ffstring to a C-style string.
Definition at line 263 of file ffstring.c. References ffstring_compare_ci(), ffstring_delete(), and ffstring_tail(). Referenced by ffpriv_genitive_stem(), and ffstring_tail_equals_ci(). |
|
Case-sensitively compares the specified number of last characters of the given ffstring to another ffstring.
Definition at line 275 of file ffstring.c. References ffstring_compare_ff(), ffstring_delete(), and ffstring_tail(). Referenced by ffstring_tail_equals_ff(). |
|
Case-insensitively compares the specified number of last characters of the given ffstring to another ffstring.
Definition at line 287 of file ffstring.c. References ffstring_compare_ff_ci(), ffstring_delete(), and ffstring_tail(). Referenced by ffstring_tail_equals_ff_ci(). |
|
Creates a copy of an ffstring. The caller should take care of disposing of it.
Definition at line 71 of file ffstring.c. References ffstring_create(). Referenced by ffpriv_essive_stem(), ffpriv_general_illative(), ffpriv_partitive_plural(), ffpriv_plural_stem(), ffstring_move_and_delete(), ffword_copy(), and main(). |
|
Creates a new ffstring from a C-style string.
Definition at line 42 of file ffstring.c. References _ffstring_instance_counter. Referenced by ffpriv_ie_list_get(), ffpriv_ss_genitive(), ffstring_copy(), ffstring_lower(), ffstring_tail(), ffword_create(), and main(). |
|
Decreases the ffstring instance counter. This function is meant to be used when an ffstring struct ceases to exist but the real string data (ffstring.str) remains. USE WITH CAUTION!
Definition at line 241 of file ffstring.c. References _ffstring_instance_counter. Referenced by ffword_finalize(). |
|
Deletes an ffstring.
Definition at line 61 of file ffstring.c. References _ffstring_instance_counter. Referenced by ffpriv_consonant_gradation(), ffpriv_essive_stem(), ffpriv_general_illative(), ffpriv_ie_list_get(), ffpriv_partitive_plural(), ffpriv_plural_stem(), ffpriv_ss_genitive(), ffstring_compare_tail(), ffstring_compare_tail_ci(), ffstring_compare_tail_ff(), ffstring_compare_tail_ff_ci(), ffstring_move_and_delete(), ffword_delete(), ffword_swap_delete(), and main(). |
|
Deletes count characters from the end of the target string. count must smaller or equal to current length or an error is returned. The original data remains unchanged if an error occures. (DFE == Delete From End)
Definition at line 88 of file ffstring.c. Referenced by ffpriv_genitive_plural(), and main(). |
|
Checks if the given ffstring and C-style string are the same.
Definition at line 338 of file ffstring.c. References ffstring_compare(). Referenced by ffpriv_ie_list_get(), and ffpriv_ss_genitive(). |
|
Case-insensitively checks if the given ffstring and C-style string are the same.
Definition at line 343 of file ffstring.c. References ffstring_compare_ci(). |
|
Checks if the two given ffstrings are the same.
Definition at line 348 of file ffstring.c. References ffstring_compare_ff(). |
|
Case-insensitively checks if the two given ffstrings are the same.
Definition at line 353 of file ffstring.c. References ffstring_compare_ff_ci(). |
|
Returns the current number of ffstring instances.
Definition at line 191 of file ffstring.c. References _ffstring_instance_counter. Referenced by main(). |
|
Returns the last character of the given ffstring.
Definition at line 299 of file ffstring.c. Referenced by ffpriv_essive_stem(), ffpriv_general_illative(), ffpriv_genitive_stem(), ffpriv_partitive_plural(), ffpriv_partitive_singular(), ffpriv_plural_stem(), ffstring_compare_last(), and ffstring_compare_last_ci(). |
|
Checks if the last character of the given string matches the given character.
Definition at line 378 of file ffstring.c. References ffstring_compare_last(). Referenced by ffpriv_genitive_plural(), and ffpriv_partitive_stem(). |
|
Case-insensitively checks if the last character of the given string matches the given character.
Definition at line 383 of file ffstring.c. References ffstring_compare_last_ci(). Referenced by ffpriv_essive_stem(), ffpriv_genitive_stem(), and ffpriv_plural_stem(). |
|
Creates a lowercase copy of an ffstring. The caller has to take care of disposing of the new ffstring.
Definition at line 213 of file ffstring.c. References ffstring_create(), and ffstring_tolower(). Referenced by main(). |
|
Definition at line 76 of file ffstring.c. References ffstring_copy(), and ffstring_delete(). Referenced by ffpriv_essive_stem(). |
|
Replaces the last count characters from the end of the target string with the C-style string append. (RFE == Replace From End)
|
|
Replaces the last count characters from the end of the target string with the ffstring append. (RFE == Replace From End)
Definition at line 155 of file ffstring.c. References ffstring_rfe(). Referenced by ffpriv_consonant_gradation(). |
|
Creates a new ffstring from at most count characters (not including the terminating null byte) from the head of the source ffstring. The caller should take care of disposing of the new ffstring.
Definition at line 196 of file ffstring.c. References ffstring_create(). Referenced by ffpriv_consonant_gradation(), ffstring_compare_tail(), ffstring_compare_tail_ci(), ffstring_compare_tail_ff(), ffstring_compare_tail_ff_ci(), and main(). |
|
Checks if the tail of the given ffstring is the same as the given C-style string.
Definition at line 358 of file ffstring.c. References ffstring_compare_tail(). Referenced by ffpriv_plural_stem(). |
|
Case-insensitively checks if the tail of the given ffstring is the same as the given C-style string.
Definition at line 363 of file ffstring.c. References ffstring_compare_tail_ci(). Referenced by ffpriv_essive_stem(), ffpriv_genitive_stem(), ffpriv_partitive_singular(), ffpriv_partitive_stem(), and ffpriv_plural_stem(). |
|
Checks if the tail of the given ffstring equals the other given ffstring.
Definition at line 368 of file ffstring.c. References ffstring_compare_tail_ff(). |
|
Case-insensitively checks if the tail of the given ffstring equals the other given ffstring.
Definition at line 373 of file ffstring.c. References ffstring_compare_tail_ff_ci(). |
|
Converts a ffstring to lowercase.
Definition at line 205 of file ffstring.c. Referenced by ffstring_lower(), and main(). |