summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/Makefile.in3
-rw-r--r--Build/source/texk/web2c/luatexdir/ChangeLog18
-rw-r--r--Build/source/texk/web2c/luatexdir/am/luafontforge.am3
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writecff.c4
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writetype2.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/lang/texlang.c26
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c5
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.h2
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex-api.h3
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/filename.c10
10 files changed, 43 insertions, 33 deletions
diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in
index 28356f6e671..ac34737d8f1 100644
--- a/Build/source/texk/web2c/Makefile.in
+++ b/Build/source/texk/web2c/Makefile.in
@@ -1906,7 +1906,8 @@ libff_a_SOURCES = \
luatexdir/luafontloader/fontforge/inc/ustring.h \
luatexdir/luafontloader/fontforge/inc/utype.h \
luatexdir/luafontloader/src/ffdummies.c \
- luatexdir/luafontloader/src/luafflib.c
+ luatexdir/luafontloader/src/luafflib.c \
+ luatexdir/luafontloader/src/luafflib.h
libluatex_a_DEPENDENCIES = libff.a
libluatex_a_CPPFLAGS = $(ZLIB_INCLUDES) $(LIBPNG_INCLUDES) \
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog
index f6e62d6af5c..c822b1e3167 100644
--- a/Build/source/texk/web2c/luatexdir/ChangeLog
+++ b/Build/source/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,21 @@
+2010-01-27 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * luafontloader/src/luafflib.h: New file with prototypes used
+ by libluatex.
+ * luafontloader/src/luafflib.c: #include "luafflib.h".
+ * font/writecff.c, font/writetype2.c: Remove the extern decls
+ and #include <luafontloader/src/luafflib.h>.
+ * font/writecff.c (writetype1w): Change tfm_size integer=>int.
+ * am/luafontforge.am: Add the new file.
+
+ * luatex-api.h: Add prototype for utf8_idpb(), renamed
+ lua_utf8_idpb to avoid name conflicts with fontforge library.
+ * lang/texlang.c: Declare utf8_idpb() as non-static.
+ * tex/filename.c: Remove prototype for utf8_idpb().
+
+ * tex/filename.c (scan_file_name): Don't assume a null byte
+ after string created by utf8_idpb().
+
2010-01-26 Peter Breitenlohner <peb@mppmu.mpg.de>
* font/writettf.c: Remove extern charsetstr[].
diff --git a/Build/source/texk/web2c/luatexdir/am/luafontforge.am b/Build/source/texk/web2c/luatexdir/am/luafontforge.am
index 8cf02189eda..bfd3b8e5512 100644
--- a/Build/source/texk/web2c/luatexdir/am/luafontforge.am
+++ b/Build/source/texk/web2c/luatexdir/am/luafontforge.am
@@ -121,7 +121,8 @@ libff_a_SOURCES = \
luatexdir/luafontloader/fontforge/inc/ustring.h \
luatexdir/luafontloader/fontforge/inc/utype.h \
luatexdir/luafontloader/src/ffdummies.c \
- luatexdir/luafontloader/src/luafflib.c
+ luatexdir/luafontloader/src/luafflib.c \
+ luatexdir/luafontloader/src/luafflib.h
EXTRA_DIST += \
luatexdir/luafontloader/ChangeLog \
diff --git a/Build/source/texk/web2c/luatexdir/font/writecff.c b/Build/source/texk/web2c/luatexdir/font/writecff.c
index 98b8a8bc9d5..82b52d96d7c 100644
--- a/Build/source/texk/web2c/luatexdir/font/writecff.c
+++ b/Build/source/texk/web2c/luatexdir/font/writecff.c
@@ -3389,7 +3389,7 @@ void write_cid_cff(cff_font * cffont, fd_entry * fd)
* I have defined a utility function in luafflib.c that does exactly that.
* If it works out ok, I will clean up this code.
*/
-extern int ff_createcff(char *, unsigned char **, integer *); /* libs/luafontforge/src/luafflib.c */
+#include <luafontloader/src/luafflib.h>
void writetype1w(fd_entry * fd)
{
@@ -3398,7 +3398,7 @@ void writetype1w(fd_entry * fd)
FILE *fp;
ff_entry *ff;
unsigned char *tfm_buffer = NULL;
- integer tfm_size = 0;
+ int tfm_size = 0;
ff = check_ff_exist(fd->fm->ff_name, 0);
diff --git a/Build/source/texk/web2c/luatexdir/font/writetype2.c b/Build/source/texk/web2c/luatexdir/font/writetype2.c
index 2b5a9894875..4d187b59a83 100644
--- a/Build/source/texk/web2c/luatexdir/font/writetype2.c
+++ b/Build/source/texk/web2c/luatexdir/font/writetype2.c
@@ -269,7 +269,7 @@ static unsigned long ttc_read_offset(sfnt * sfont, int ttc_idx)
return offset;
}
-extern int ff_get_ttc_index(char *ffname, char *psname); /* libs/luafontforge/src/luafflib.c */
+#include <luafontloader/src/luafflib.h>
void make_tt_subset(fd_entry * fd, unsigned char *buffer, integer buflen)
{
diff --git a/Build/source/texk/web2c/luatexdir/lang/texlang.c b/Build/source/texk/web2c/luatexdir/lang/texlang.c
index c315e4e05d8..5a17b2c34b6 100644
--- a/Build/source/texk/web2c/luatexdir/lang/texlang.c
+++ b/Build/source/texk/web2c/luatexdir/lang/texlang.c
@@ -29,23 +29,13 @@
static const char _svn_version[] =
"$Id: texlang.c 2596 2009-06-25 09:26:59Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lang/texlang.c $";
-/* functions from the fontforge unicode library */
+/* functions copied from the fontforge unicode library */
-#if 0
-extern unsigned int *utf82u_strcpy(unsigned int *ubuf, const char *utf8buf);
-extern unsigned int u_strlen(unsigned int *ubuf);
-extern char *utf8_idpb(char *w, unsigned int i);
-#else
-
-typedef unsigned int unichar_t;
-typedef unsigned char uint8;
-typedef unsigned int uint32;
-
-static unichar_t *utf82u_strcpy(unichar_t * ubuf, const char *utf8buf)
+static unsigned int *utf82u_strcpy(unsigned int * ubuf, const char *utf8buf)
{
int len = strlen(utf8buf) + 1;
- unichar_t *upt = ubuf, *uend = ubuf + len - 1;
- const uint8 *pt = (const uint8 *) utf8buf, *end = pt + strlen(utf8buf);
+ unsigned int *upt = ubuf, *uend = ubuf + len - 1;
+ const unsigned char *pt = (const unsigned char *) utf8buf, *end = pt + strlen(utf8buf);
int w, w2;
while (pt < end && *pt != '\0' && upt < uend) {
@@ -70,7 +60,7 @@ static unichar_t *utf82u_strcpy(unichar_t * ubuf, const char *utf8buf)
return (ubuf);
}
-static char *utf8_idpb(char *utf8_text, uint32 ch)
+char *utf8_idpb(char *utf8_text, unsigned int ch)
{
/* Increment and deposit character */
if (ch >= 17 * 65536)
@@ -86,7 +76,7 @@ static char *utf8_idpb(char *utf8_text, uint32 ch)
*utf8_text++ = 0x80 | ((ch >> 6) & 0x3f);
*utf8_text++ = 0x80 | (ch & 0x3f);
} else {
- uint32 val = ch - 0x10000;
+ unsigned int val = ch - 0x10000;
int u = ((val & 0xf0000) >> 16) + 1, z = (val & 0x0f000) >> 12, y =
(val & 0x00fc0) >> 6, x = val & 0x0003f;
*utf8_text++ = 0xf0 | (u >> 2);
@@ -97,7 +87,7 @@ static char *utf8_idpb(char *utf8_text, uint32 ch)
return (utf8_text);
}
-static int u_strlen(register unichar_t * str)
+static int u_strlen(register unsigned int * str)
{
register int len = 0;
while (*str++ != '\0')
@@ -105,8 +95,6 @@ static int u_strlen(register unichar_t * str)
return (len);
}
-#endif
-
#define noVERBOSE
#define MAX_TEX_LANGUAGES 32768
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c b/Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c
index 845dc784f0e..8462ae9b2e5 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c
@@ -2270,7 +2270,8 @@ static void ff_do_cff (SplineFont *sf, char *filename, unsigned char **buf, int
}
-/* exported for writecff.c */
+
+#include "luafflib.h"
int ff_createcff (char *file, unsigned char **buf, int *bufsiz) {
SplineFont *sf;
@@ -2300,7 +2301,7 @@ int ff_get_ttc_index(char *ffname, char*psname) {
int openflags = 1;
int index = 0;
- sf = ReadSplineFontInfo((char *)ffname,openflags);
+ sf = ReadSplineFontInfo(ffname,openflags);
if (sf==NULL) {
perror("font loading failed unexpectedly\n");
exit(EXIT_FAILURE);
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.h b/Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.h
new file mode 100644
index 00000000000..37dbe570cf6
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.h
@@ -0,0 +1,2 @@
+extern int ff_createcff (char *file, unsigned char **buf, int *bufsiz);
+extern int ff_get_ttc_index(char *ffname, char*psname);
diff --git a/Build/source/texk/web2c/luatexdir/luatex-api.h b/Build/source/texk/web2c/luatexdir/luatex-api.h
index 57d1504c329..89bbf1230c1 100644
--- a/Build/source/texk/web2c/luatexdir/luatex-api.h
+++ b/Build/source/texk/web2c/luatexdir/luatex-api.h
@@ -138,3 +138,6 @@ extern unsigned int luabytecode_bytes;
extern int luastate_bytes;
extern int callback_count;
extern int saved_callback_count;
+
+#define utf8_idpb lua_utf8_idpb /* avoid name conflict with fontforge library */
+extern char *utf8_idpb(char *utf8_text, unsigned int ch);
diff --git a/Build/source/texk/web2c/luatexdir/tex/filename.c b/Build/source/texk/web2c/luatexdir/tex/filename.c
index 271c8417fec..f6b9746e976 100644
--- a/Build/source/texk/web2c/luatexdir/tex/filename.c
+++ b/Build/source/texk/web2c/luatexdir/tex/filename.c
@@ -26,10 +26,6 @@
static const char _svn_version[] =
"$Id: filename.c 2448 2009-06-08 07:43:50Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.6/source/texk/web2c/luatexdir/tex/filename.c $";
-/* for use by |scan_file_name|, it comes from fontforge's Unicode library */
-
-extern char *utf8_idpb(char *w, unsigned int i);
-
#define wake_up_terminal() ;
#define clear_terminal() ;
@@ -167,10 +163,10 @@ void scan_file_name(void)
break;
if (cur_chr > 127) {
unsigned char *bytes;
- unsigned char thebytes[5] = { 0 };
- utf8_idpb((char *) thebytes, cur_chr);
+ unsigned char thebytes[4];
+ unsigned char *end = (unsigned char *)utf8_idpb((char *) thebytes, cur_chr);
bytes = thebytes;
- while (*bytes) {
+ while (bytes<end) {
if (!more_name(*bytes))
break;
bytes++;