From b41bb8a30041b51c7c6e6bef5369330809461c34 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Mon, 14 Jun 2010 12:18:28 +0000 Subject: ptexenc: cleanup headers and DLL git-svn-id: svn://tug.org/texlive/trunk@18970 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/ptexenc/ChangeLog.TL | 10 +++++ Build/source/texk/ptexenc/Makefile.am | 10 ++--- Build/source/texk/ptexenc/Makefile.in | 10 ++--- Build/source/texk/ptexenc/ptexenc/kanjicnv.h | 22 +++++------ Build/source/texk/ptexenc/ptexenc/ptexenc.h | 54 ++++++++++++++++---------- Build/source/texk/ptexenc/ptexenc/unicode-jp.h | 6 +-- Build/source/texk/ptexenc/ptexenc/unicode.h | 10 ++--- 7 files changed, 73 insertions(+), 49 deletions(-) (limited to 'Build') diff --git a/Build/source/texk/ptexenc/ChangeLog.TL b/Build/source/texk/ptexenc/ChangeLog.TL index 8102354ced2..12da95ed77d 100644 --- a/Build/source/texk/ptexenc/ChangeLog.TL +++ b/Build/source/texk/ptexenc/ChangeLog.TL @@ -1,6 +1,16 @@ ChangeLog.TL: TeX Live (TL) changes for ptexenc =============================================== +2010-06-14 Peter Breitenlohner + + * Makefile.am (libptexenc_la_CPPFLAGS): Define MAKE_PTENC_DLL + instead of MAKE_KPSE_DLL. + (libptexenc_la_SOURCES, nobase_include_HEADERS): Do not install + kanjicnv.h, unicode-jp.h, and unicode.h. + * ptexenc/ptexenc.h: Define and use PTENCDLL instead of KPSEDLL. + * ptexenc/kanjicnv.h, ptexenc/unicode-jp.h, ptexenc/unicode.h: + Remove KPSEDLL, everything is internal to the library. + 2010-06-04 Karl Berry * configure.ac (ptexenc_lib_devel): no more dev. diff --git a/Build/source/texk/ptexenc/Makefile.am b/Build/source/texk/ptexenc/Makefile.am index 200653e4db0..7634cca9648 100644 --- a/Build/source/texk/ptexenc/Makefile.am +++ b/Build/source/texk/ptexenc/Makefile.am @@ -14,7 +14,7 @@ AM_CFLAGS = $(WARNING_CFLAGS) lib_LTLIBRARIES = libptexenc.la -libptexenc_la_CPPFLAGS = -DMAKE_KPSE_DLL +libptexenc_la_CPPFLAGS = -DMAKE_PTENC_DLL libptexenc_la_LDFLAGS = -version-info $(PTEXENC_LT_VERSINFO) @@ -24,6 +24,9 @@ libptexenc_la_SOURCES = \ jisx0208.h \ kanjicnv.c \ ptexenc.c \ + ptexenc/kanjicnv.h \ + ptexenc/unicode-jp.h \ + ptexenc/unicode.h \ unicode-jp.c \ unicode.c @@ -31,10 +34,7 @@ libptexenc_la_SOURCES = \ @KPATHSEA_RULE@ nobase_include_HEADERS = \ - ptexenc/kanjicnv.h \ - ptexenc/ptexenc.h \ - ptexenc/unicode-jp.h \ - ptexenc/unicode.h + ptexenc/ptexenc.h EXTRA_DIST = COPYRIGHT ChangeLog.TL diff --git a/Build/source/texk/ptexenc/Makefile.in b/Build/source/texk/ptexenc/Makefile.in index 140dc928eca..a4b7e9470ee 100644 --- a/Build/source/texk/ptexenc/Makefile.in +++ b/Build/source/texk/ptexenc/Makefile.in @@ -251,7 +251,7 @@ ACLOCAL_AMFLAGS = -I ../../m4 INCLUDES = $(KPATHSEA_INCLUDES) AM_CFLAGS = $(WARNING_CFLAGS) lib_LTLIBRARIES = libptexenc.la -libptexenc_la_CPPFLAGS = -DMAKE_KPSE_DLL +libptexenc_la_CPPFLAGS = -DMAKE_PTENC_DLL libptexenc_la_LDFLAGS = -version-info $(PTEXENC_LT_VERSINFO) # Note: jisx0208.h is a copy of ../../libs/gd/gd-2.0.35/jisx0208.h. @@ -260,14 +260,14 @@ libptexenc_la_SOURCES = \ jisx0208.h \ kanjicnv.c \ ptexenc.c \ + ptexenc/kanjicnv.h \ + ptexenc/unicode-jp.h \ + ptexenc/unicode.h \ unicode-jp.c \ unicode.c nobase_include_HEADERS = \ - ptexenc/kanjicnv.h \ - ptexenc/ptexenc.h \ - ptexenc/unicode-jp.h \ - ptexenc/unicode.h + ptexenc/ptexenc.h EXTRA_DIST = COPYRIGHT ChangeLog.TL all: all-am diff --git a/Build/source/texk/ptexenc/ptexenc/kanjicnv.h b/Build/source/texk/ptexenc/ptexenc/kanjicnv.h index 4893389a527..7eb71355f0e 100644 --- a/Build/source/texk/ptexenc/ptexenc/kanjicnv.h +++ b/Build/source/texk/ptexenc/ptexenc/kanjicnv.h @@ -11,25 +11,25 @@ #define LO(x) ( ((int)(x)) & 0xff) #define HILO(x,y) ((LO(x) << 8) | LO(y)) -extern KPSEDLL boolean isEUCkanji1(int c); -extern KPSEDLL boolean isEUCkanji2(int c); +extern boolean isEUCkanji1(int c); +extern boolean isEUCkanji2(int c); -extern KPSEDLL boolean isSJISkanji1(int c); -extern KPSEDLL boolean isSJISkanji2(int c); +extern boolean isSJISkanji1(int c); +extern boolean isSJISkanji2(int c); /* EUC <=> JIS X 0208 code conversion */ -extern KPSEDLL int EUCtoJIS(int); -extern KPSEDLL int JIStoEUC(int); +extern int EUCtoJIS(int); +extern int JIStoEUC(int); /* Shift JIS <=> JIS Kanji code conversion */ -extern KPSEDLL int SJIStoJIS(int); -extern KPSEDLL int JIStoSJIS(int); +extern int SJIStoJIS(int); +extern int JIStoSJIS(int); /* Shift JIS <=> EUC Kanji code conversion */ -extern KPSEDLL int SJIStoEUC(int); -extern KPSEDLL int EUCtoSJIS(int); +extern int SJIStoEUC(int); +extern int EUCtoSJIS(int); /* KUTEN => JIS kanji code conversion */ -extern KPSEDLL int KUTENtoJIS(int); +extern int KUTENtoJIS(int); #endif /* PTEXENC_KANJICNV_H */ diff --git a/Build/source/texk/ptexenc/ptexenc/ptexenc.h b/Build/source/texk/ptexenc/ptexenc/ptexenc.h index 3fc2fe2711e..a7148de549f 100644 --- a/Build/source/texk/ptexenc/ptexenc/ptexenc.h +++ b/Build/source/texk/ptexenc/ptexenc/ptexenc.h @@ -7,28 +7,42 @@ #include -extern KPSEDLL const char *ptexenc_version_string; +#if defined (WIN32) && !defined (__MINGW32__) && !defined (NO_PTENC_DLL) +#define PTENC_DLL 1 +#endif /* WIN32 && !__MINGW32__ && !NO_PTENC_DLL */ + +#if defined (PTENC_DLL) && (defined (WIN32) || defined (__CYGWIN__)) +#ifdef MAKE_PTENC_DLL +#define PTENCDLL __declspec(dllexport) +#else /* ! MAKE_PTENC_DLL */ +#define PTENCDLL __declspec(dllimport) +#endif +#else /* ! (PTENC_DLL && (WIN32 || __CYGWIN__)) */ +#define PTENCDLL +#endif + +extern PTENCDLL const char *ptexenc_version_string; #define KANJI_OPTS "{jis|euc|sjis|utf8}" /* get/set Kanji encoding by string */ -extern KPSEDLL const_string get_enc_string(void); -extern KPSEDLL int set_enc_string(const_string file, const_string inter); +extern PTENCDLL const_string get_enc_string(void); +extern PTENCDLL int set_enc_string(const_string file, const_string inter); #define getencstring get_enc_string #define setencstring set_enc_string /* decide if internal Kanji encode is SJIS or not */ -extern KPSEDLL boolean is_internalSJIS(void); +extern PTENCDLL boolean is_internalSJIS(void); #define isinternalSJIS is_internalSJIS /* check char range */ -extern KPSEDLL boolean iskanji1(int c); -extern KPSEDLL boolean iskanji2(int c); +extern PTENCDLL boolean iskanji1(int c); +extern PTENCDLL boolean iskanji2(int c); /* internal (EUC/SJIS) from/to buffer (EUC/SJIS/UTF-8) code conversion */ -extern KPSEDLL int multistrlen(string s, int len, int pos); -extern KPSEDLL long fromBUFF(string s, int len, int pos); -extern KPSEDLL long toBUFF(long inter); +extern PTENCDLL int multistrlen(string s, int len, int pos); +extern PTENCDLL long fromBUFF(string s, int len, int pos); +extern PTENCDLL long toBUFF(long inter); /* internal (EUC/SJIS) from/to DVI (JIS) code conversion */ #define fromDVI fromJIS @@ -36,23 +50,23 @@ extern KPSEDLL long toBUFF(long inter); /* JIS/EUC/SJIS/KUTN/UCS to internal (EUC/SJIS) code conversion */ /* (only for \euc primitive, etc.) */ -extern KPSEDLL long toJIS(long kcode); -extern KPSEDLL long fromJIS(long jis); -extern KPSEDLL long fromEUC(long euc); -extern KPSEDLL long fromSJIS(long sjis); -extern KPSEDLL long fromKUTEN(long kuten); +extern PTENCDLL long toJIS(long kcode); +extern PTENCDLL long fromJIS(long jis); +extern PTENCDLL long fromEUC(long euc); +extern PTENCDLL long fromSJIS(long sjis); +extern PTENCDLL long fromKUTEN(long kuten); /* fputs/putc with encoding conversion */ -extern KPSEDLL int putc2(int c, FILE *fp); -extern KPSEDLL int fputs2(const char *s, FILE *fp); +extern PTENCDLL int putc2(int c, FILE *fp); +extern PTENCDLL int fputs2(const char *s, FILE *fp); /* input line with encoding conversion */ -extern KPSEDLL long input_line2(FILE *fp, string buff, long pos, +extern PTENCDLL long input_line2(FILE *fp, string buff, long pos, const long buffsize, int *lastchar); /* open/close through nkf */ -extern KPSEDLL void nkf_disable(void); -extern KPSEDLL FILE *nkf_open(const char *path, const char *mode); -extern KPSEDLL int nkf_close(FILE *fp); +extern PTENCDLL void nkf_disable(void); +extern PTENCDLL FILE *nkf_open(const char *path, const char *mode); +extern PTENCDLL int nkf_close(FILE *fp); #endif /* PTEXENC_PTEXENC_H */ diff --git a/Build/source/texk/ptexenc/ptexenc/unicode-jp.h b/Build/source/texk/ptexenc/ptexenc/unicode-jp.h index 6d583ac53d5..ff1aa16beed 100644 --- a/Build/source/texk/ptexenc/ptexenc/unicode-jp.h +++ b/Build/source/texk/ptexenc/ptexenc/unicode-jp.h @@ -9,13 +9,13 @@ #include /* convert a JIS X 0208 char to UCS-2 */ -extern KPSEDLL int JIStoUCS2(int jis); +extern int JIStoUCS2(int jis); /* convert a UCS-2 char to JIS X 0208 */ -extern KPSEDLL int UCS2toJIS(int ucs2); +extern int UCS2toJIS(int ucs2); /* for U+3099 or U+309A */ -extern KPSEDLL int get_voiced_sound(int ucs2, boolean semi); +extern int get_voiced_sound(int ucs2, boolean semi); #define U_BOM 0xFEFF #define U_REPLACEMENT_CHARACTER 0xFFFD diff --git a/Build/source/texk/ptexenc/ptexenc/unicode.h b/Build/source/texk/ptexenc/ptexenc/unicode.h index b3e1d5ee83c..3451a97bd45 100644 --- a/Build/source/texk/ptexenc/ptexenc/unicode.h +++ b/Build/source/texk/ptexenc/ptexenc/unicode.h @@ -9,12 +9,12 @@ #include /* determine if UTF-8 character or not */ -extern KPSEDLL boolean isUTF8(int length, int nth, int c); +extern boolean isUTF8(int length, int nth, int c); -extern KPSEDLL int UTF8length(int first_byte); -extern KPSEDLL int UTF8Slength(string buff, int buff_len); -extern KPSEDLL long UTF8StoUCS(string s); -extern KPSEDLL long UCStoUTF8(long ucs); +extern int UTF8length(int first_byte); +extern int UTF8Slength(string buff, int buff_len); +extern long UTF8StoUCS(string s); +extern long UCStoUTF8(long ucs); #define LONG(a,b,c,d) ( ((long)(a)<<24) | ((long)(b)<<16) | ((c)<<8) | (d) ) #define BYTE1(x) (((x)>>24) & 0xff) -- cgit v1.2.3