summaryrefslogtreecommitdiff
path: root/Build/source/texk/bibtexu/bibtex.h
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2013-03-19 08:15:26 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2013-03-19 08:15:26 +0000
commit151a7146c6cc3ef5413a600e6145037af4fa63f1 (patch)
tree5f981b664fb6b2f868dd632b1cd3947dcd55818c /Build/source/texk/bibtexu/bibtex.h
parent6da10d8e2ab5bd73ba2de9c53b957bb33366ee77 (diff)
bibtex8 and bibtexu: use identical C code
git-svn-id: svn://tug.org/texlive/trunk@29431 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/bibtexu/bibtex.h')
-rw-r--r--Build/source/texk/bibtexu/bibtex.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/Build/source/texk/bibtexu/bibtex.h b/Build/source/texk/bibtexu/bibtex.h
index 9c9b1854d10..c1c65d4fc09 100644
--- a/Build/source/texk/bibtexu/bibtex.h
+++ b/Build/source/texk/bibtexu/bibtex.h
@@ -99,11 +99,18 @@
* The BANNER string is defined here and should be changed whenever BibTeX
* is modified.
***************************************************************************/
-#ifdef SUPPORT_8BIT
+#ifdef UTF_8
# define BANNER "This is BibTeXu: a UTF-8 Big BibTeX version 0.99d"
-#else /* NOT SUPPORT_8BIT */
-# define BANNER "This is Big BibTeX version 0.99d"
-#endif /* SUPPORT_8BIT */
+# define PROGNAME "bibtexu"
+# define SUPPORT_8BIT
+#else
+# ifdef SUPPORT_8BIT
+# define BANNER "This is 8-bit Big BibTeX version 0.99d"
+# else
+# define BANNER "This is Big BibTeX version 0.99d"
+# endif
+# define PROGNAME "bibtex8"
+#endif
/***************************************************************************
@@ -1456,6 +1463,19 @@
/***************************************************************************
* WEB section number: N/A
* ~~~~~~~~~~~~~~~~~~~
+ * Define a macro to handle 1-, 2-, 3-, and 4-byte UTF-8 codes.
+ ***************************************************************************/
+#define DO_UTF8(ch, do_1, do_2, do_3, do_4) \
+ if (ch <= 0x7F) { do_1; } \
+ else if ((ch >= 0xC2) && (ch <= 0xDF)) { do_2; } \
+ else if ((ch >= 0xE0) && (ch <= 0xEF)) { do_3; } \
+ else if ((ch >= 0xF0) && (ch <= 0xF4)) { do_4; } \
+ else printf("this isn't a right UTF-8 char!\n")
+
+
+/***************************************************************************
+ * WEB section number: N/A
+ * ~~~~~~~~~~~~~~~~~~~
* Macros adapted from Kpathsea (lib.h) and Web2C (cpascal.h) to dynamically
* resize arrays.
***************************************************************************/