cgul_char.h File Reference

cgul character support More...

#include "cgul_common.h"
#include "cgul_exception.h"
Include dependency graph for cgul_char.h:
This graph shows which files directly or indirectly include this file:

Functions

CGUL_BEGIN_C CGUL_EXPORT int cgul_char__strcmp (const char *s1, const char *s2)
 
CGUL_EXPORT int cgul_char__isspace (cgul_exception_t *cex, char c)
 

Detailed Description

This file defines the basic set of functions related to the char type.

Author
Paul Serice
See also
cgul_hchar
cgul_wchar

Function Documentation

§ cgul_char__strcmp()

CGUL_BEGIN_C CGUL_EXPORT int cgul_char__strcmp ( const char *  s1,
const char *  s2 
)

Perform a case-significant, 32-bit, string comparison of s1 and s2. Return -1, 0, or 1 if s1 is less than, equal to, or greater than s2 respectively.

For simplicity, this function compares strings stricly by the ordinal value of each character which should be sufficient, for example, when comparing strings when inserting them as keys into a cgul_rbtree; however, the comparison results are not likely to be the same as what strcoll() would return if used on the UTF-8 version of the strings.

Note
This function does not take a cgul_exception object as its first parameter in order to make it easier to use the function as the comparison function of cgul_rbtree objects.
Parameters
[in]s1left-hand side
[in]s2right-hand side
Returns
-1, 0, or 1 if s1 is less than, equal to, or greater than s2 respectively
See also
cgul_string__compare()

Referenced by cgul_char_cxx::strcmp().

§ cgul_char__isspace()

CGUL_EXPORT int cgul_char__isspace ( cgul_exception_t cex,
char  c 
)

Return whether the character c is considered to be white-space. To avoid locale dependencies, white-space is defined as any character from the following list: ' ', '\t', '\n', '\r', '\f', '\v'

Parameters
[in]cexc-style exception
[in]ccharacter
Returns
whether the character is white-space

Referenced by cgul_char_cxx::isspace().