summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2016-04-09 17:55:12 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2016-04-09 17:55:12 +0000
commit13d2f30a85b781127865fd52abe783ebd5a970d9 (patch)
tree36c01ecf687d6024ab0987174505ad4986a3da02 /src
parent6dff22f7ff5bfb785897b7301b321de070d29b18 (diff)
Add platform-independent internal UTF-8 header file.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11568 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Xutf8.h18
-rw-r--r--src/fl_utf8.cxx7
-rw-r--r--src/utf8_internal.h62
-rw-r--r--src/xutf8/case.c2
-rw-r--r--src/xutf8/is_right2left.c15
-rw-r--r--src/xutf8/is_spacing.c2
6 files changed, 68 insertions, 38 deletions
diff --git a/src/Xutf8.h b/src/Xutf8.h
index 8fe0ba0cb..050226500 100644
--- a/src/Xutf8.h
+++ b/src/Xutf8.h
@@ -156,24 +156,6 @@ XUtf8LookupString(
Status* status_return);
#endif
-unsigned short
-XUtf8IsNonSpacing(
- unsigned int ucs);
-
-unsigned short
-XUtf8IsRightToLeft(
- unsigned int ucs);
-
-
-int
-XUtf8Tolower(
- int ucs);
-
-int
-XUtf8Toupper(
- int ucs);
-
-
# ifdef __cplusplus
}
# endif
diff --git a/src/fl_utf8.cxx b/src/fl_utf8.cxx
index 7ae9f1f8f..b7d58eecd 100644
--- a/src/fl_utf8.cxx
+++ b/src/fl_utf8.cxx
@@ -23,15 +23,12 @@
#include <FL/filename.H>
#include <stdarg.h>
#include <FL/fl_utf8.h>
+#include "utf8_internal.h"
+
#include <string.h>
#include <stdlib.h>
#undef fl_open
-extern "C" {
- int XUtf8Tolower(int ucs); // in src/xutf8/case.c
- unsigned short XUtf8IsNonSpacing(unsigned int ucs); // in src/xutf8/is_spacing.c
-}
-
/** \addtogroup fl_unicode
@{
diff --git a/src/utf8_internal.h b/src/utf8_internal.h
new file mode 100644
index 000000000..6d5def687
--- /dev/null
+++ b/src/utf8_internal.h
@@ -0,0 +1,62 @@
+/*
+ * "$Id$"
+ *
+ * Internal UTF-8 header file for the Fast Light Tool Kit (FLTK).
+ *
+ * Copyright 1998-2016 by Bill Spitzak and others.
+ *
+ * This library is free software. Distribution and use rights are outlined in
+ * the file "COPYING" which should have been included with this file. If this
+ * file is missing or damaged, see the license at:
+ *
+ * http://www.fltk.org/COPYING.php
+ *
+ * Please report all bugs and problems on the following page:
+ *
+ * http://www.fltk.org/str.php
+ */
+
+/*
+ ----------------
+ Note to editors:
+ ----------------
+
+ This file may only contain common, platform-independent function
+ declarations used internally in FLTK. It may be #included everywhere
+ in source files in the library, but not in public header files.
+*/
+
+#ifndef _SRC__FL_UTF8_H
+#define _SRC__FL_UTF8_H
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+unsigned short
+XUtf8IsNonSpacing(
+ unsigned int ucs);
+
+unsigned short
+XUtf8IsRightToLeft(
+ unsigned int ucs);
+
+
+int
+XUtf8Tolower(
+ int ucs);
+
+int
+XUtf8Toupper(
+ int ucs);
+
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif /* _SRC__FL_UTF8_H */
+
+/*
+ * End of "$Id$".
+ */
diff --git a/src/xutf8/case.c b/src/xutf8/case.c
index de97348cf..e6589cc5b 100644
--- a/src/xutf8/case.c
+++ b/src/xutf8/case.c
@@ -19,7 +19,7 @@
* This file is required on all platforms for UTF-8 support
*/
-#include "../Xutf8.h"
+#include "../utf8_internal.h"
#include <stdlib.h>
/* include UCS tables */
diff --git a/src/xutf8/is_right2left.c b/src/xutf8/is_right2left.c
index e79a55f25..c36a0829b 100644
--- a/src/xutf8/is_right2left.c
+++ b/src/xutf8/is_right2left.c
@@ -14,22 +14,11 @@
* http://www.fltk.org/str.php
*/
-#if defined(WIN32) || defined(__APPLE__) /* PORTME: Fl_Screen_Driver - platform unicode */
-#elif defined(FL_PORTING)
-# pragma message "FL_PORTING: utf8 functionality"
-#else
-#endif
-
/*
- * This file is required on all platforms for utf8 support
+ * This file is required on all platforms for UTF-8 support
*/
-#if defined(WIN32) || defined(__APPLE__)
-#elif defined(FL_PORTING)
-# pragma message "FL_PORTING: do you want to include Xutf8.h? It's written for X11."
-#else
-# include "../Xutf8.h"
-#endif /* !defined(WIN32) && !defined(__APPLE__) */
+#include "../utf8_internal.h"
unsigned short
XUtf8IsRightToLeft(unsigned int ucs) {
diff --git a/src/xutf8/is_spacing.c b/src/xutf8/is_spacing.c
index 30229e72e..72e4df4e8 100644
--- a/src/xutf8/is_spacing.c
+++ b/src/xutf8/is_spacing.c
@@ -18,7 +18,7 @@
* This file is required on all platforms for UTF-8 support
*/
-#include "../Xutf8.h"
+#include "../utf8_internal.h"
/* include UCS tables */
#include "headers/spacing.h"