Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

ffutil.c File Reference

Implements the utility functions (declared in ffutil.c). More...

#include <stdlib.h>
#include "fftypes.h"
#include "ffutil.h"

Go to the source code of this file.

Functions

ffbool ffpriv_is_vowel (const char letter)
 Determines whether the given letter is a (Finnish) vowel or not.
ffbool ffpriv_is_consonant (const char letter)
 Determines whether the given letter is a (Finnish) consonant or not.
ffcharffpriv_vowel_harmony (const ffstring *string, ffchar *back, ffchar *front)
 Returns the appropriate one, back or front, depending on whether the given string has back or front vowels.
ffuint32 ffutil_tolower (const ffstring *source, ffstring *target)
 Converts string to lower case.
ffuint32 ffutil_toupper (const ffstring *source, ffstring *target)
 Converts string to upper case.
ffchar ffutil_ffchar_tolower (ffchar c)
 Converts ffchar to lower case.

Variables

static const char * v_low = "aeiouyåäö"
static const char * v_upp = "AEIOUYÅÄÖ"
static const char * c_low = "bcdfghjklmnpqrstvwxz"
static const char * c_upp = "BCDFGHJKLMNPQRSTVWXZ"
static const ffuint32 v_len = 9
static const ffuint32 c_len = 20


Detailed Description

Implements the utility functions (declared in ffutil.c).

Definition in file ffutil.c.


Function Documentation

ffbool ffpriv_is_consonant const char  letter  ) 
 

Determines whether the given letter is a (Finnish) consonant or not.

Parameters:
letter The letter to check
Returns:
1 if the letter is a vowel, 0 if it's not.

Definition at line 60 of file ffutil.c.

References c_len, c_low, and c_upp.

Referenced by ffpriv_essive_stem(), ffpriv_partitive_plural(), and ffpriv_partitive_singular().

ffbool ffpriv_is_vowel const char  letter  ) 
 

Determines whether the given letter is a (Finnish) vowel or not.

Parameters:
letter The letter to check
Returns:
1 if the letter is a vowel, 0 if it's not.

Definition at line 41 of file ffutil.c.

References v_len, v_low, and v_upp.

Referenced by ffpriv_essive_stem(), ffpriv_general_illative(), ffpriv_genitive_plural(), ffpriv_genitive_stem(), ffpriv_partitive_plural(), ffpriv_partitive_stem(), and ffpriv_plural_stem().

ffchar* ffpriv_vowel_harmony const ffstring string,
ffchar back,
ffchar front
 

Returns the appropriate one, back or front, depending on whether the given string has back or front vowels.

Definition at line 79 of file ffutil.c.

Referenced by ffpriv_abessive_plural(), ffpriv_abessive_singular(), ffpriv_ablative_plural(), ffpriv_ablative_singular(), ffpriv_adessive_plural(), ffpriv_adessive_singular(), ffpriv_elative_plural(), ffpriv_elative_singular(), ffpriv_essive_plural(), ffpriv_essive_singular(), ffpriv_genitive_stem(), ffpriv_inessive_plural(), ffpriv_inessive_singular(), ffpriv_partitive_plural(), and ffpriv_partitive_singular().

ffchar ffutil_ffchar_tolower ffchar  c  ) 
 

Converts ffchar to lower case.

Supports a-z and åäö

Parameters:
c The ffchar to be converted
Returns:
Lower case character if possible

Definition at line 149 of file ffutil.c.

Referenced by ffstring_equals_ci(), and ffstring_equals_ff_ci().

ffuint32 ffutil_tolower const ffstring source,
ffstring target
 

Converts string to lower case.

Supports a-z and åäö.

Parameters:
source The source ffstring to be converted
target Initialized but empty ffstring
Returns:
0

Definition at line 93 of file ffutil.c.

References ffstring_copy(), and ffstring::str.

Referenced by ffstring_compare_ci(), and ffstring_compare_ff_ci().

ffuint32 ffutil_toupper const ffstring source,
ffstring target
 

Converts string to upper case.

Supports a-z and åäö.

Parameters:
source The source ffstring to be converted
target Initialized but empty ffstring
Returns:
0

Definition at line 121 of file ffutil.c.

References ffstring_copy(), and ffstring::str.


Variable Documentation

const ffuint32 c_len = 20 [static]
 

Definition at line 39 of file ffutil.c.

Referenced by ffpriv_is_consonant().

const char* c_low = "bcdfghjklmnpqrstvwxz" [static]
 

Definition at line 36 of file ffutil.c.

Referenced by ffpriv_is_consonant().

const char* c_upp = "BCDFGHJKLMNPQRSTVWXZ" [static]
 

Definition at line 37 of file ffutil.c.

Referenced by ffpriv_is_consonant().

const ffuint32 v_len = 9 [static]
 

Definition at line 38 of file ffutil.c.

Referenced by ffpriv_is_vowel().

const char* v_low = "aeiouyåäö" [static]
 

Definition at line 34 of file ffutil.c.

Referenced by ffpriv_is_vowel().

const char* v_upp = "AEIOUYÅÄÖ" [static]
 

Definition at line 35 of file ffutil.c.

Referenced by ffpriv_is_vowel().


Generated on Thu Jun 2 23:16:59 2005 for FinFlect by  doxygen 1.4.2