summaryrefslogtreecommitdiff
path: root/Build/source/texk/upmendex/mendex.h
diff options
context:
space:
mode:
authorTakuji Tanaka <KXD02663@nifty.ne.jp>2016-02-09 11:02:48 +0000
committerTakuji Tanaka <KXD02663@nifty.ne.jp>2016-02-09 11:02:48 +0000
commitadec059e95b8e5728d8fb2d8420c5e928812c282 (patch)
tree28d38c44042fea2befbccbdd71063c801518d298 /Build/source/texk/upmendex/mendex.h
parentb0bdd8cd0fed764f189d773b0b0f69d25415a8f5 (diff)
texk/upmendex: upmendex 0.50
git-svn-id: svn://tug.org/texlive/trunk@39638 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/upmendex/mendex.h')
-rw-r--r--Build/source/texk/upmendex/mendex.h103
1 files changed, 103 insertions, 0 deletions
diff --git a/Build/source/texk/upmendex/mendex.h b/Build/source/texk/upmendex/mendex.h
new file mode 100644
index 00000000000..b48b36319eb
--- /dev/null
+++ b/Build/source/texk/upmendex/mendex.h
@@ -0,0 +1,103 @@
+#include <c-auto.h>
+
+#include <kpathsea/config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <unicode/utypes.h>
+#include <unicode/ustring.h>
+#include <unicode/uchar.h>
+#include <unicode/ucol.h>
+
+struct page {
+ char *page;
+ char *enc;
+ char attr[3];
+};
+
+struct index {
+ int num;
+ char words;
+ UChar *dic[3];
+ UChar *org[3];
+ UChar *idx[3];
+ struct page *p;
+ int lnum;
+};
+
+#define INITIALLENGTH 10
+
+struct hanzi_index {
+ UChar idx[INITIALLENGTH];
+ UChar threshold[3];
+};
+
+/* convert.c */
+UChar *u_xstrdup (const UChar *string);
+void initkanatable(void);
+int convert(UChar *buff1, UChar *buff2);
+int pnumconv(char *page, int attr);
+int dicread(const char *filename);
+
+/* pageread.c */
+int lastpage(const char *filename);
+
+/* sort.c */
+void wsort(struct index *ind, int num);
+void pagesort(struct index *ind, int num);
+int is_alphanumeric(UChar *c);
+int is_latin(UChar *c);
+int is_numeric(UChar *c);
+int is_jpn_kana(UChar *c);
+int is_kor_hngl(UChar *c);
+int is_hanzi(UChar *c);
+int is_zhuyin(UChar *c);
+int is_cyrillic(UChar *c);
+int is_greek(UChar *c);
+int is_comb_diacritical_mark(UChar *c);
+int chkcontinue(struct page *p, int num);
+int ss_comp(UChar *s1, UChar *s2);
+
+#define CH_UNKNOWN 0
+#define CH_LATIN 1
+#define CH_CYRILLIC 2
+#define CH_GREEK 3
+#define CH_KANA 4
+#define CH_HANGUL 5
+#define CH_HANZI 6
+#define CH_SYMBOL 0x100
+#define CH_NUMERIC 0x101
+
+/* sort.c */
+int charset(UChar *c);
+
+/* styfile.c */
+void styread(const char *filename);
+void set_icu_attributes();
+
+/* fread.c */
+int idxread(char *filename, int start);
+int multibyte_to_widechar(UChar *wcstr, int32_t size, char *mbstr);
+int widechar_to_multibyte(char *mbstr, int32_t size, UChar *wcstr);
+
+/* fwrite.c */
+int fprintf2 (FILE *fp, const char *format, ...);
+void warn_printf(FILE *fp, const char *format, ...);
+void verb_printf(FILE *fp, const char *format, ...);
+
+struct index;
+void indwrite(char *filename, struct index *ind, int pagenum);
+
+#define multibytelen(a) ((a)<0xc2 ? 1 : ((a)<0xc2 ? -2 : ((a)<0xe0 ? 2 : ((a)<0xf0 ? 3 : ((a)<0xf5 ? 4 : -1)))))
+#define is_surrogate_pair(a) (U16_IS_LEAD(*(a)) && U16_IS_TRAIL(*(a+1)))
+
+#ifdef WIN32
+#undef fprintf
+#undef fputs
+#undef fopen
+#define fprintf fprintf2
+#define fputs win32_fputs
+#define fopen fsyscp_fopen
+#endif