summaryrefslogtreecommitdiff
path: root/lib/mbsalign.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mbsalign.h')
-rw-r--r--lib/mbsalign.h33
1 files changed, 23 insertions, 10 deletions
diff --git a/lib/mbsalign.h b/lib/mbsalign.h
index e9340f92..72a6d69a 100644
--- a/lib/mbsalign.h
+++ b/lib/mbsalign.h
@@ -1,5 +1,5 @@
/* Align/Truncate a string in a given screen width
- Copyright (C) 2009-2012 Free Software Foundation, Inc.
+ Copyright (C) 2009-2013 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -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 whitespace. */
+ MBA_LSTRIP
- /* Don't truncate */
- MBA_PAD_ONLY = 0x0010,
+ /* Ensure no trailing whitespace. */
+ MBA_RSTRIP
#endif
};