diff options
Diffstat (limited to 'gl/lib/mbsalign.h')
-rw-r--r-- | gl/lib/mbsalign.h | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/gl/lib/mbsalign.h b/gl/lib/mbsalign.h index e9340f926..25d529e48 100644 --- a/gl/lib/mbsalign.h +++ b/gl/lib/mbsalign.h @@ -21,20 +21,33 @@ typedef enum { MBS_ALIGN_LEFT, MBS_ALIGN_RIGHT, MBS_ALIGN_CENTER } mbs_align_t; enum { /* Use unibyte mode for invalid multibyte strings or when heap memory is exhausted. */ - MBA_UNIBYTE_FALLBACK = 0x0001 + MBA_UNIBYTE_FALLBACK = 0x0001, + + /* As an optimization, don't do multibyte processing + when we know no multibyte characters are present. */ + MBA_UNIBYTE_ONLY = 0x0002, + + /* Don't add leading padding. */ + MBA_NO_LEFT_PAD = 0x0004, + + /* Don't add trailing padding. */ + MBA_NO_RIGHT_PAD = 0x0008 #if 0 /* Other possible options. */ - /* Skip invalid multibyte chars rather than failing */ - MBA_IGNORE_INVALID = 0x0002, + /* Skip invalid multibyte chars rather than failing. */ + MBA_IGNORE_INVALID + + /* Align multibyte strings using "figure space" (\u2007). */ + MBA_USE_FIGURE_SPACE - /* Align multibyte strings using "figure space" (\u2007) */ - MBA_USE_FIGURE_SPACE = 0x0004, + /* Don't truncate. */ + MBA_NO_TRUNCATE - /* Don't add any padding */ - MBA_TRUNCATE_ONLY = 0x0008, + /* Ensure no leading whitepsace. */ + MBA_LSTRIP - /* Don't truncate */ - MBA_PAD_ONLY = 0x0010, + /* Ensure no trailing whitepsace. */ + MBA_RSTRIP #endif }; |