#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <ctype.h>
#include "ffstring.h"
#include "ffutil.h"
#include "ffconfig.h"
#include "fferror.h"
Go to the source code of this file.
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_dfe (ffstring *target, ffuint32 count) |
Deletes count characters from the end of the target string. | |
ffint32 | ffstring_rfe (ffstring *target, ffuint32 count, char *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, char *append) |
ffint32 | ffstring_append_ff (ffstring *target, const ffstring *source) |
Append a ffstring to the target ffstring. | |
ffint32 | ffstring_instcount (void) |
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_decinst (void) |
Decreases the ffstring instance counter. | |
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. | |
Variables | |
static ffint32 | _ffstring_instance_counter = 0 |
Definition in file ffstring.c.
|
|
Append a ffstring to the target ffstring.
Definition at line 158 of file ffstring.c. References ffstring_append(), and ffstring::str. |
|
Case-sensitively compares an ffstring to a C-style string using strcmp(3).
Definition at line 196 of file ffstring.c. References ffstring::str. 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 200 of file ffstring.c. References ffstring_create(), ffstring_delete(), ffutil_tolower(), and ffstring::str. Referenced by ffpriv_genitive_stem(), and ffstring_compare_tail_ci(). |
|
Case-sensitively compares an ffstring to another using strcmp(3).
Definition at line 219 of file ffstring.c. References ffstring::str. 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 223 of file ffstring.c. References ffstring_delete(), ffutil_tolower(), and ffstring::str. Referenced by ffstring_compare_tail_ff_ci(), and main(). |
|
Case-sensitively compares the last character of the given ffstring to a given character.
Definition at line 313 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 328 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 249 of file ffstring.c. References ffstring_compare(), ffstring_delete(), ffstring_tail(), and ffstring::len. Referenced by 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(), ffstring_tail(), and ffstring::len. 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 277 of file ffstring.c. References ffstring_compare_ff(), ffstring_delete(), ffstring_tail(), and ffstring::len. 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 291 of file ffstring.c. References ffstring_compare_ff_ci(), ffstring_delete(), ffstring_tail(), and ffstring::len. 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 70 of file ffstring.c. References ffstring_create(), and ffstring::str. Referenced by ffutil_tolower(), ffutil_toupper(), ffword_copy(), and main(). |
|
Creates a new ffstring from a C-style string.
Definition at line 44 of file ffstring.c. References _ffstring_instance_counter, FF_PRINTERROR, FFERR_MEM, ffstring::len, and ffstring::str. Referenced by ffpriv_ie_list_get(), ffpriv_ss_genitive(), ffstring_compare_ci(), 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 239 of file ffstring.c. References _ffstring_instance_counter, FF_PRINTERROR, and FFERR_MEM. Referenced by ffword_finalize(). |
|
Deletes an ffstring.
Definition at line 61 of file ffstring.c. References _ffstring_instance_counter, and ffstring::str. Referenced by ffpriv_consonant_gradation(), ffpriv_ie_list_get(), ffpriv_ss_genitive(), ffstring_compare_ci(), ffstring_compare_ff_ci(), ffstring_compare_tail(), ffstring_compare_tail_ci(), ffstring_compare_tail_ff(), ffstring_compare_tail_ff_ci(), 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 76 of file ffstring.c. References FF_PRINTERROR, FFERR_ARGUMENT, FFERR_MEM, ffstring::len, and ffstring::str. Referenced by main(). |
|
Checks if the given ffstring and C-style string are the same.
Definition at line 346 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 350 of file ffstring.c. References ffutil_ffchar_tolower(), ffstring::len, and ffstring::str. |
|
Checks if the two given ffstrings are the same.
Definition at line 365 of file ffstring.c. References ffstring_compare_ff(). |
|
Case-insensitively checks if the two given ffstrings are the same.
Definition at line 369 of file ffstring.c. References ffutil_ffchar_tolower(), ffstring::len, and ffstring::str. |
|
Returns the current number of ffstring instances.
Definition at line 167 of file ffstring.c. References _ffstring_instance_counter. Referenced by main(). |
|
Returns the last character of the given ffstring.
Definition at line 305 of file ffstring.c. References ffstring::len, and ffstring::str. Referenced by ffpriv_essive_stem(), ffpriv_general_illative(), ffpriv_genitive_plural(), ffpriv_genitive_stem(), ffpriv_partitive_plural(), ffpriv_partitive_singular(), ffpriv_partitive_stem(), 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 400 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 404 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 188 of file ffstring.c. References ffstring_create(), ffstring_tolower(), and ffstring::str. Referenced by main(). |
|
Definition at line 102 of file ffstring.c. References FF_PRINTERROR, FFERR_ARGUMENT, FFERR_MEM, ffstring::len, and ffstring::str. Referenced by ffpriv_consonant_gradation(), ffpriv_essive_stem(), ffpriv_genitive_plural(), ffpriv_genitive_stem(), ffpriv_partitive_plural(), ffpriv_partitive_stem(), ffpriv_plural_stem(), ffpriv_single_letter(), ffstring_rfe_ff(), and main(). |
|
Replaces the last count characters from the end of the target string with the ffstring append. (RFE == Replace From End)
Definition at line 135 of file ffstring.c. References ffstring_rfe(), and ffstring::str. 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 171 of file ffstring.c. References FF_PRINTERROR, FFERR_ARGUMENT, ffstring_create(), ffstring::len, and ffstring::str. 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 384 of file ffstring.c. References ffstring_compare_tail(). Referenced by ffpriv_genitive_plural(), and 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 388 of file ffstring.c. References ffstring_compare_tail_ci(). Referenced by ffpriv_consonant_gradation(), 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 392 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 396 of file ffstring.c. References ffstring_compare_tail_ff_ci(). |
|
Converts a ffstring to lowercase.
Definition at line 180 of file ffstring.c. References ffstring::len, and ffstring::str. Referenced by ffstring_lower(), and main(). |
|
Definition at line 42 of file ffstring.c. Referenced by ffstring_create(), ffstring_decinst(), ffstring_delete(), and ffstring_instcount(). |