struct LineBreakPropertiesIndex
{
utf32_t end; /**< End coding point */
- struct LineBreakProperties *lbp;/**< Pointer to line breaking properties */
+ const struct LineBreakProperties *lbp;/**< Pointer to line breaking properties */
};
/**
* @return pointer to the language-specific line breaking
* properties array if found; \c NULL otherwise
*/
-static struct LineBreakProperties *get_lb_prop_lang(const char *lang)
+static const struct LineBreakProperties *get_lb_prop_lang(const char *lang)
{
- struct LineBreakPropertiesLang *lbplIter;
+ const struct LineBreakPropertiesLang *lbplIter;
if (lang != NULL)
{
for (lbplIter = lb_prop_lang_map; lbplIter->lang != NULL; ++lbplIter)
*/
static enum LineBreakClass get_char_lb_class(
utf32_t ch,
- struct LineBreakProperties *lbp)
+ const struct LineBreakProperties *lbp)
{
while (lbp->prop != LBP_Undefined && ch >= lbp->start)
{
*/
static enum LineBreakClass get_char_lb_class_lang(
utf32_t ch,
- struct LineBreakProperties *lbpLang)
+ const struct LineBreakProperties *lbpLang)
{
enum LineBreakClass lbcResult;
/**
* English-specifc data over the default Unicode rules.
*/
-static struct LineBreakProperties lb_prop_English[] = {
+static const struct LineBreakProperties lb_prop_English[] = {
{ 0x2018, 0x2018, LBP_OP }, /* Left single quotation mark: opening */
{ 0x201C, 0x201C, LBP_OP }, /* Left double quotation mark: opening */
{ 0x201D, 0x201D, LBP_CL }, /* Right double quotation mark: closing */
/**
* German-specifc data over the default Unicode rules.
*/
-static struct LineBreakProperties lb_prop_German[] = {
+static const struct LineBreakProperties lb_prop_German[] = {
{ 0x00AB, 0x00AB, LBP_CL }, /* Left double angle quotation mark: closing */
{ 0x00BB, 0x00BB, LBP_OP }, /* Right double angle quotation mark: opening */
{ 0x2018, 0x2018, LBP_CL }, /* Left single quotation mark: closing */
/**
* Spanish-specifc data over the default Unicode rules.
*/
-static struct LineBreakProperties lb_prop_Spanish[] = {
+static const struct LineBreakProperties lb_prop_Spanish[] = {
{ 0x00AB, 0x00AB, LBP_OP }, /* Left double angle quotation mark: opening */
{ 0x00BB, 0x00BB, LBP_CL }, /* Right double angle quotation mark: closing */
{ 0x2018, 0x2018, LBP_OP }, /* Left single quotation mark: opening */
/**
* French-specifc data over the default Unicode rules.
*/
-static struct LineBreakProperties lb_prop_French[] = {
+static const struct LineBreakProperties lb_prop_French[] = {
{ 0x00AB, 0x00AB, LBP_OP }, /* Left double angle quotation mark: opening */
{ 0x00BB, 0x00BB, LBP_CL }, /* Right double angle quotation mark: closing */
{ 0x2018, 0x2018, LBP_OP }, /* Left single quotation mark: opening */
/**
* Russian-specifc data over the default Unicode rules.
*/
-static struct LineBreakProperties lb_prop_Russian[] = {
+static const struct LineBreakProperties lb_prop_Russian[] = {
{ 0x00AB, 0x00AB, LBP_OP }, /* Left double angle quotation mark: opening */
{ 0x00BB, 0x00BB, LBP_CL }, /* Right double angle quotation mark: closing */
{ 0x201C, 0x201C, LBP_CL }, /* Left double quotation mark: closing */
/**
* Chinese-specifc data over the default Unicode rules.
*/
-static struct LineBreakProperties lb_prop_Chinese[] = {
+static const struct LineBreakProperties lb_prop_Chinese[] = {
{ 0x2018, 0x2018, LBP_OP }, /* Left single quotation mark: opening */
{ 0x2019, 0x2019, LBP_CL }, /* Right single quotation mark: closing */
{ 0x201C, 0x201C, LBP_OP }, /* Left double quotation mark: opening */
* file. If you want more flexibility, or do not need the data here,
* you may want to redefine \e lb_prop_lang_map in your C source file.
*/
-struct LineBreakPropertiesLang lb_prop_lang_map[] = {
+const struct LineBreakPropertiesLang lb_prop_lang_map[] = {
{ "en", 2, lb_prop_English },
{ "de", 2, lb_prop_German },
{ "es", 2, lb_prop_Spanish },
{
const char *lang; /**< Language name */
size_t namelen; /**< Length of name to match */
- struct LineBreakProperties *lbp; /**< Pointer to associated data */
+ const struct LineBreakProperties *lbp; /**< Pointer to associated data */
};
/**
struct LineBreakContext
{
const char *lang; /**< Language name */
- struct LineBreakProperties *lbpLang;/**< Pointer to LineBreakProperties */
+ const struct LineBreakProperties *lbpLang;/**< Pointer to LineBreakProperties */
enum LineBreakClass lbcCur; /**< Breaking class of current codepoint */
enum LineBreakClass lbcNew; /**< Breaking class of next codepoint */
enum LineBreakClass lbcLast; /**< Breaking class of last codepoint */
};
/* Declarations */
-extern struct LineBreakProperties lb_prop_default[];
-extern struct LineBreakPropertiesLang lb_prop_lang_map[];
+extern const struct LineBreakProperties lb_prop_default[];
+extern const struct LineBreakPropertiesLang lb_prop_lang_map[];
/* Function Prototype */
void lb_init_break_context(