about summary refs log tree commit diff stats
path: root/src/chrtrans
diff options
context:
space:
mode:
Diffstat (limited to 'src/chrtrans')
-rw-r--r--src/chrtrans/UCkd.h23
-rw-r--r--src/chrtrans/caselower.h12
-rw-r--r--src/chrtrans/entities.h20
-rw-r--r--src/chrtrans/jcuken_kb.h43
-rw-r--r--src/chrtrans/makeuctb.c297
-rw-r--r--src/chrtrans/rot13_kb.h43
-rw-r--r--src/chrtrans/yawerty_kb.h43
7 files changed, 240 insertions, 241 deletions
diff --git a/src/chrtrans/UCkd.h b/src/chrtrans/UCkd.h
index 8d92ec8b..f2de902f 100644
--- a/src/chrtrans/UCkd.h
+++ b/src/chrtrans/UCkd.h
@@ -10,34 +10,33 @@
 #define u16 unsigned short
 #endif /* u16 */
 
-
 #ifndef u8
 #define u8 unsigned char
 #endif /* u8 */
 
 typedef char scrnmap_t;
+
 #define		E_TABSZ		256
 
 struct unipair {
-	u16 unicode;
-	u16 fontpos;
+    u16 unicode;
+    u16 fontpos;
 };
 struct unipair_str {
-	u16 unicode;
-	const char * replace_str;
+    u16 unicode;
+    const char *replace_str;
 };
 struct unimapdesc {
-	u16 entry_ct;
-	struct unipair *entries;
+    u16 entry_ct;
+    struct unipair *entries;
 };
 struct unimapdesc_str {
-	u16 entry_ct;
-	struct unipair_str *entries;
-        int isdefault;
-        int trydefault;
+    u16 entry_ct;
+    struct unipair_str *entries;
+    int isdefault;
+    int trydefault;
 };
 
-
 #define UNI_DIRECT_BASE 0xF000	/* start of Direct Font Region */
 #define UNI_DIRECT_MASK 0x01FF	/* Direct Font Region bitmask */
 
diff --git a/src/chrtrans/caselower.h b/src/chrtrans/caselower.h
index 842d6af8..4953162c 100644
--- a/src/chrtrans/caselower.h
+++ b/src/chrtrans/caselower.h
@@ -3,16 +3,14 @@
 
   This table is generated from Unicode Character Database, Version 2.1.5
   available from ftp.unicode.org, and looks as natural way to get case mapping
-  equivalents for unicodes.  (well, too much characters the cost of 3 Kb only).
+  equivalents for unicodes.  (well, too much characters the cost of 3 Kb only). 
   Few words from the original README.txt quoted:
 
-
 UNICODE 2.1 CHARACTER DATABASE
 
 Copyright (c) 1991-1998 Unicode, Inc.
 All Rights reserved.
 
-
 CASE MAPPINGS
 
 The case mapping is an informative, default mapping. Certain languages, such
@@ -21,14 +19,15 @@ default mappings listed in the Unicode Character Database.
 
  */
 
-#include <UCkd.h> /* typedef u16 */
+#include <UCkd.h>		/* typedef u16 */
 
 typedef struct {
-	u16 upper;
-	u16 lower;
+    u16 upper;
+    u16 lower;
 } unipair;
 
 static const unipair unicode_to_lower_case[] =
+/* *INDENT-OFF* */
 {
   {0x0041, 0x0061},  /* LATIN CAPITAL LETTER A */
   {0x0042, 0x0062},  /* LATIN CAPITAL LETTER B */
@@ -736,3 +735,4 @@ static const unipair unicode_to_lower_case[] =
   {0xFF39, 0xFF59},  /* FULLWIDTH LATIN CAPITAL LETTER Y */
   {0xFF3A, 0xFF5A}   /* FULLWIDTH LATIN CAPITAL LETTER Z */
 };
+/* *INDENT-ON* */
diff --git a/src/chrtrans/entities.h b/src/chrtrans/entities.h
index 715b5a8c..f843be3b 100644
--- a/src/chrtrans/entities.h
+++ b/src/chrtrans/entities.h
@@ -7,13 +7,13 @@
  *     The only call to this structure is via HTMLGetEntityUCValue().
  *
 
-Unlike the numeric entities &#234 which may be for any Unicode character,
-the character references should be defined within HTML standards
-to get a compatibility between browsers.
+Unlike the numeric entities &#234 which may be for any Unicode character, the
+character references should be defined within HTML standards to get a
+compatibility between browsers.
+
+Now we have a choice:  use clean HTML4.0 entities list (and reject everithing
+others), or use a relaxed list with lots of synonyms and new symbols found at
 
-Now we have a choice: use clean HTML4.0 entities list
-(and reject everithing others), or use a relaxed list
-with lots of synonyms and new symbols found at
 ftp://ftp.unicode.org/MAPPINGS/VENDORS/MISC/SGML.TXT
 
 We hold both: #define ENTITIES_HTML40_ONLY for strict version,
@@ -21,15 +21,14 @@ otherwise relaxed.
 
  */
 
-#include <UCkd.h> /* typedef u16 */
+#include <UCkd.h>		/* typedef u16 */
 typedef struct {
-    char* name; /* sorted alphabetically (case-sensitive) */
+    char *name;			/* sorted alphabetically (case-sensitive) */
     u16 code;
 } UC_entity_info;
 
 static const UC_entity_info unicode_entities[] =
-
-
+/* *INDENT-OFF* */
 #ifdef ENTITIES_HTML40_ONLY
 /*********************************************************************
 
@@ -1409,3 +1408,4 @@ display them.
 };
 
 #endif /* not ENTITIES_HTML40_ONLY */
+/* *INDENT-ON* */
diff --git a/src/chrtrans/jcuken_kb.h b/src/chrtrans/jcuken_kb.h
index 8a45988e..5f42d26d 100644
--- a/src/chrtrans/jcuken_kb.h
+++ b/src/chrtrans/jcuken_kb.h
@@ -1,21 +1,22 @@
-static LYKbLayout_t kb_layout_jcuken[128] = {
-0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, /* 00..07 */ 
-0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, /* 08..0F */ 
-0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, /* 10..17 */ 
-0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, /* 18..1F */ 
- 
-0x0020, 0x0021, 0x042D, 0x002F, 0x0024, 0x003A, 0x002E, 0x044D, /* 20..27 */ 
-0x003F, 0x0025, 0x003B, 0x002B, 0x0431, 0x002D, 0x044E, 0x0451, /* 28..2F */ 
-0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, /* 30..37 */ 
-0x0038, 0x0039, 0x0416, 0x0436, 0x0411, 0x003D, 0x042E, 0x0401, /* 38..3F */ 
- 
-0x0022, 0x0424, 0x0418, 0x0421, 0x0412, 0x0423, 0x0410, 0x041F, /* 40..47 */ 
-0x0420, 0x0428, 0x041E, 0x041B, 0x0414, 0x042C, 0x0422, 0x0429, /* 48..4F */ 
-0x0417, 0x0419, 0x041A, 0x042B, 0x0415, 0x0413, 0x041C, 0x0426, /* 50..57 */ 
-0x0427, 0x041D, 0x042F, 0x0445, 0x005C, 0x044A, 0x002C, 0x005F, /* 58..5F */ 
- 
-0x0029, 0x0444, 0x0438, 0x0441, 0x0432, 0x0443, 0x0430, 0x043F, /* 60..67 */ 
-0x0440, 0x0448, 0x043E, 0x043B, 0x0434, 0x044C, 0x0442, 0x0449, /* 68..6F */ 
-0x0437, 0x0439, 0x043A, 0x044B, 0x0435, 0x0433, 0x043C, 0x0446, /* 70..77 */ 
-0x0447, 0x043D, 0x044F, 0x0425, 0x007C, 0x042A, 0x0028, 0x007F  /* 78..7F */ 
-}; 
+static LYKbLayout_t kb_layout_jcuken[128] =
+{
+    0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,	/* 00..07 */
+    0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,	/* 08..0F */
+    0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,	/* 10..17 */
+    0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,	/* 18..1F */
+
+    0x0020, 0x0021, 0x042D, 0x002F, 0x0024, 0x003A, 0x002E, 0x044D,	/* 20..27 */
+    0x003F, 0x0025, 0x003B, 0x002B, 0x0431, 0x002D, 0x044E, 0x0451,	/* 28..2F */
+    0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,	/* 30..37 */
+    0x0038, 0x0039, 0x0416, 0x0436, 0x0411, 0x003D, 0x042E, 0x0401,	/* 38..3F */
+
+    0x0022, 0x0424, 0x0418, 0x0421, 0x0412, 0x0423, 0x0410, 0x041F,	/* 40..47 */
+    0x0420, 0x0428, 0x041E, 0x041B, 0x0414, 0x042C, 0x0422, 0x0429,	/* 48..4F */
+    0x0417, 0x0419, 0x041A, 0x042B, 0x0415, 0x0413, 0x041C, 0x0426,	/* 50..57 */
+    0x0427, 0x041D, 0x042F, 0x0445, 0x005C, 0x044A, 0x002C, 0x005F,	/* 58..5F */
+
+    0x0029, 0x0444, 0x0438, 0x0441, 0x0432, 0x0443, 0x0430, 0x043F,	/* 60..67 */
+    0x0440, 0x0448, 0x043E, 0x043B, 0x0434, 0x044C, 0x0442, 0x0449,	/* 68..6F */
+    0x0437, 0x0439, 0x043A, 0x044B, 0x0435, 0x0433, 0x043C, 0x0446,	/* 70..77 */
+    0x0447, 0x043D, 0x044F, 0x0425, 0x007C, 0x042A, 0x0028, 0x007F	/* 78..7F */
+};
diff --git a/src/chrtrans/makeuctb.c b/src/chrtrans/makeuctb.c
index ce218d26..a71cf20c 100644
--- a/src/chrtrans/makeuctb.c
+++ b/src/chrtrans/makeuctb.c
@@ -47,8 +47,9 @@ static FILE *chdr = 0;
  * everything before leaving, since some old (and a few not-so-old) platforms
  * do not properly implement POSIX 'exit()'.
  */
-static void done (int code) GCC_NORETURN;
-static void done (int code)
+static void done(int code) GCC_NORETURN;
+
+static void done(int code)
 {
     if (chdr != 0) {
 	fflush(chdr);
@@ -58,9 +59,10 @@ static void done (int code)
     exit(code);
 }
 
-static void usage (void)
+static void usage(void)
 {
-    static const char *tbl[] = {
+    static const char *tbl[] =
+    {
 	"Usage: makeuctb [parameters]",
 	"",
 	"Utility to convert .tbl into .h files for Lynx compilation.",
@@ -72,6 +74,7 @@ static void usage (void)
 	"  4: charset display name"
     };
     unsigned n;
+
     for (n = 0; n < TABLESIZE(tbl); n++) {
 	fprintf(stderr, "%s\n", tbl[n]);
     };
@@ -79,39 +82,36 @@ static void usage (void)
 }
 
 #ifdef EXP_ASCII_CTYPES
-int ascii_tolower (int i)
+int ascii_tolower(int i)
 {
-    if ( 91 > i && i > 64 )
-	return (i+32);
+    if (91 > i && i > 64)
+	return (i + 32);
     else
 	return i;
 }
 #endif
 
 /* copied from HTString.c, not everybody has strncasecmp */
-int strncasecomp (
-	const char*	a,
-	const char *	b,
-	int		n)
+int strncasecomp(const char *a, const char *b, int n)
 {
     const char *p = a;
     const char *q = b;
 
-    for (p = a, q = b; ; p++, q++) {
+    for (p = a, q = b;; p++, q++) {
 	int diff;
-	if (p == (a+n))
-	    return 0;	/*   Match up to n characters */
+
+	if (p == (a + n))
+	    return 0;		/*   Match up to n characters */
 	if (!(*p && *q))
 	    return (*p - *q);
 	diff = TOLOWER(*p) - TOLOWER(*q);
 	if (diff)
 	    return diff;
     }
-    /*NOTREACHED*/
+    /*NOTREACHED */
 }
 
-static int getunicode (
-	char **	p0)
+static int getunicode(char **p0)
 {
     char *p = *p0;
 
@@ -125,10 +125,10 @@ static int getunicode (
 	       !isxdigit(UCH(p[3])) ||
 	       !isxdigit(UCH(p[4])) ||
 	       !isxdigit(UCH(p[5])) ||
-	        isxdigit(UCH(p[6]))) {
+	       isxdigit(UCH(p[6]))) {
 	return -1;
     }
-    *p0 = p+6;
+    *p0 = p + 6;
     return strtol((p + 2), 0, 16);
 }
 
@@ -138,31 +138,31 @@ static int getunicode (
 unicode unitable[MAX_FONTLEN][255];
 int unicount[MAX_FONTLEN];
 
-struct unimapdesc_str themap_str = {0, NULL, 0, 0};
+struct unimapdesc_str themap_str =
+{0, NULL, 0, 0};
 
 static char *tblname;
 static char *hdrname;
 
 static int RawOrEnc = 0;
-static int Raw_found = 0;		/* whether explicit R directive found */
+static int Raw_found = 0;	/* whether explicit R directive found */
 static int CodePage = 0;
-static int CodePage_found = 0;		/* whether explicit C directive found */
+static int CodePage_found = 0;	/* whether explicit C directive found */
 
 #define MAX_UNIPAIRS 2500
 
-static void addpair_str (
-	char *		str,
-	int		un)
+static void addpair_str(char *str, int un)
 {
-   int i = 0;
+    int i = 0;
 
     if (un <= 0xfffe) {
 	if (!themap_str.entry_ct) {
 	    /*
 	     *  Initialize the map for replacement strings.
 	     */
-	    themap_str.entries = (struct unipair_str *) malloc (MAX_UNIPAIRS
-				* sizeof (struct unipair_str));
+	    themap_str.entries = (struct unipair_str *) malloc(MAX_UNIPAIRS
+							       * sizeof(struct unipair_str));
+
 	    if (!themap_str.entries) {
 		fprintf(stderr,
 			"%s: Out of memory\n", tblname);
@@ -172,8 +172,8 @@ static void addpair_str (
 	    /*
 	     *  Check that it isn't a duplicate.
 	     */
-	    for (i = 0 ; i < themap_str.entry_ct; i++) {
-		if (themap_str.entries[i].unicode == un ) {
+	    for (i = 0; i < themap_str.entry_ct; i++) {
+		if (themap_str.entries[i].unicode == un) {
 		    themap_str.entries[i].replace_str = str;
 		    return;
 		}
@@ -183,7 +183,7 @@ static void addpair_str (
 	/*
 	 *  Add to list.
 	 */
-	if (themap_str.entry_ct > MAX_UNIPAIRS-1) {
+	if (themap_str.entry_ct > MAX_UNIPAIRS - 1) {
 	    fprintf(stderr,
 		    "ERROR: Only %d unicode replacement strings permitted!\n",
 		    MAX_UNIPAIRS);
@@ -196,24 +196,22 @@ static void addpair_str (
     /* otherwise: ignore */
 }
 
-static void addpair (
-	int	fp,
-	int	un)
+static void addpair(int fp, int un)
 {
     int i;
 
-    if (!Raw_found) {	/* enc not (yet) explicitly given with 'R' */
+    if (!Raw_found) {		/* enc not (yet) explicitly given with 'R' */
 	if (fp >= 128) {
 	    if (RawOrEnc != UCT_ENC_8BIT && RawOrEnc <= UCT_ENC_8859) {
 		if (fp < 160) {	/* cannot be 8859 */
 		    RawOrEnc = UCT_ENC_8BIT;
 		} else if (fp != 160 && fp != 173) {
-		    RawOrEnc = UCT_ENC_8859; /* hmmm.. more tests needed? */
+		    RawOrEnc = UCT_ENC_8859;	/* hmmm.. more tests needed? */
 		} else if (unicount[fp] == 0 && fp != un) {
 		    /* first unicode for fp doesn't map to itself */
 		    RawOrEnc = UCT_ENC_8BIT;
 		} else {
-		    RawOrEnc = UCT_ENC_8859; /* hmmm.. more tests needed? */
+		    RawOrEnc = UCT_ENC_8859;	/* hmmm.. more tests needed? */
 		}
 	    }
 	}
@@ -241,18 +239,17 @@ static void addpair (
     /* otherwise: ignore */
 }
 
-char this_MIMEcharset[UC_MAXLEN_MIMECSNAME +1];
-char this_LYNXcharset[UC_MAXLEN_LYNXCSNAME +1];
-char id_append[UC_MAXLEN_ID_APPEND +1] = "_";
+char this_MIMEcharset[UC_MAXLEN_MIMECSNAME + 1];
+char this_LYNXcharset[UC_MAXLEN_LYNXCSNAME + 1];
+char id_append[UC_MAXLEN_ID_APPEND + 1] = "_";
 int this_isDefaultMap = -1;
 int useDefaultMap = 1;
 int lowest_eight = 999;
 
-int main (
-	int	argc,
-	char **	argv)
+int main(int argc, char **argv)
 {
-    static char *first_ifdefs[] = {
+    static char *first_ifdefs[] =
+    {
 	"/*",
 	" * Compile-in this chunk of code unless we've turned it off specifically",
 	" * or in general (id=%s).",
@@ -282,7 +279,8 @@ int main (
 	"#define UC_CHARSET_SETUP%s /*nothing*/",
 	"#else"
     };
-    static char *last_ifdefs[] = {
+    static char *last_ifdefs[] =
+    {
 	"",
 	"#endif /* NO_CHARSET%s */",
 	"",
@@ -365,15 +363,15 @@ int main (
 
 	/*
 	 *  Syntax accepted:
-	 *	<fontpos>	<unicode> <unicode> ...
-	 *	<fontpos>	<unicode range> <unicode range> ...
-	 *	<fontpos>	idem
-	 *	<range>		idem
-	 *	<range>		<unicode range>
-	 *      <unicode>	:<replace>
-	 *      <unicode range>	:<replace>
-	 *      <unicode>	"<C replace>"
-	 *      <unicode range>	"<C replace>"
+	 *      <fontpos>       <unicode> <unicode> ...
+	 *      <fontpos>       <unicode range> <unicode range> ...
+	 *      <fontpos>       idem
+	 *      <range>         idem
+	 *      <range>         <unicode range>
+	 *      <unicode>       :<replace>
+	 *      <unicode range> :<replace>
+	 *      <unicode>       "<C replace>"
+	 *      <unicode range> "<C replace>"
 	 *
 	 *  where <range> ::= <fontpos>-<fontpos>
 	 *  and <unicode> ::= U+<h><h><h><h>
@@ -397,106 +395,106 @@ int main (
 	     *  Raw Unicode?  I.e. needs some special
 	     *  processing.  One digit code.
 	     */
-	    case 'R':
-		if (p[1] == 'a' || p[1] == 'A') {
-		    buffer[sizeof(buffer) - 1] = '\0';
-		    if (!strncasecomp(p, "RawOrEnc", 8)) {
-			p += 8;
-		    }
+	case 'R':
+	    if (p[1] == 'a' || p[1] == 'A') {
+		buffer[sizeof(buffer) - 1] = '\0';
+		if (!strncasecomp(p, "RawOrEnc", 8)) {
+		    p += 8;
 		}
+	    }
+	    p++;
+	    while (*p == ' ' || *p == '\t') {
 		p++;
-		while (*p == ' ' || *p == '\t') {
-		    p++;
-		}
-		RawOrEnc = strtol(p,0,10);
-		Raw_found = 1;
-		continue;
+	    }
+	    RawOrEnc = strtol(p, 0, 10);
+	    Raw_found = 1;
+	    continue;
 
 	    /*
 	     *  Is this the default table?
 	     */
-	    case 'D':
-		if (p[1] == 'e' || p[1] == 'E') {
-		    buffer[sizeof(buffer) - 1] = '\0';
-		    if (!strncasecomp(p, "Default", 7)) {
-			p += 7;
-		    }
+	case 'D':
+	    if (p[1] == 'e' || p[1] == 'E') {
+		buffer[sizeof(buffer) - 1] = '\0';
+		if (!strncasecomp(p, "Default", 7)) {
+		    p += 7;
 		}
+	    }
+	    p++;
+	    while (*p == ' ' || *p == '\t') {
 		p++;
-		while (*p == ' ' || *p == '\t') {
-		    p++;
-		}
-		this_isDefaultMap = (*p == '1' || TOLOWER(*p) == 'y');
-		continue;
+	    }
+	    this_isDefaultMap = (*p == '1' || TOLOWER(*p) == 'y');
+	    continue;
 
 	    /*
 	     *  Is this the default table?
 	     */
-	    case 'F':
-		if (p[1] == 'a' || p[1] == 'A') {
-		    buffer[sizeof(buffer) - 1] = '\0';
-		    if (!strncasecomp(p, "FallBack", 8)) {
-			p += 8;
-		    }
+	case 'F':
+	    if (p[1] == 'a' || p[1] == 'A') {
+		buffer[sizeof(buffer) - 1] = '\0';
+		if (!strncasecomp(p, "FallBack", 8)) {
+		    p += 8;
 		}
+	    }
+	    p++;
+	    while (*p == ' ' || *p == '\t') {
 		p++;
-		while (*p == ' ' || *p == '\t') {
-		    p++;
-		}
-		useDefaultMap = (*p == '1' || TOLOWER(*p) == 'y');
-		continue;
+	    }
+	    useDefaultMap = (*p == '1' || TOLOWER(*p) == 'y');
+	    continue;
 
-	    case 'M':
-		if (p[1] == 'i' || p[1] == 'I') {
-		    buffer[sizeof(buffer) - 1] = '\0';
-		    if (!strncasecomp(p, "MIMEName", 8)) {
-			p += 8;
-		    }
+	case 'M':
+	    if (p[1] == 'i' || p[1] == 'I') {
+		buffer[sizeof(buffer) - 1] = '\0';
+		if (!strncasecomp(p, "MIMEName", 8)) {
+		    p += 8;
 		}
+	    }
+	    p++;
+	    while (*p == ' ' || *p == '\t') {
 		p++;
-		while (*p == ' ' || *p == '\t') {
-		    p++;
-		}
-		sscanf(p,"%40s",this_MIMEcharset);
-		continue;
+	    }
+	    sscanf(p, "%40s", this_MIMEcharset);
+	    continue;
 
 	    /*
 	     *  Display charset name for options screen.
 	     */
-	    case 'O':
-		if (p[1] == 'p' || p[1] == 'P') {
-		    buffer[sizeof(buffer) - 1] = '\0';
-		    if (!strncasecomp(p, "OptionName", 10)) {
-			p += 10;
-		    }
+	case 'O':
+	    if (p[1] == 'p' || p[1] == 'P') {
+		buffer[sizeof(buffer) - 1] = '\0';
+		if (!strncasecomp(p, "OptionName", 10)) {
+		    p += 10;
 		}
+	    }
+	    p++;
+	    while (*p == ' ' || *p == '\t') {
 		p++;
-		while (*p == ' ' || *p == '\t') {
-		    p++;
-		}
-		for (i = 0; *p && i < UC_MAXLEN_LYNXCSNAME; p++, i++) {
-		    this_LYNXcharset[i] = *p;
-		}
-		this_LYNXcharset[i] = '\0';
-		continue;
+	    }
+	    for (i = 0; *p && i < UC_MAXLEN_LYNXCSNAME; p++, i++) {
+		this_LYNXcharset[i] = *p;
+	    }
+	    this_LYNXcharset[i] = '\0';
+	    continue;
 
 	    /*
 	     *  Codepage number.  Three or four digit code.
 	     */
-	    case 'C':
-		if (p[1] == 'o' || p[1] == 'O') {
-		    buffer[sizeof(buffer) - 1] = '\0';
-		    if (!strncasecomp(p, "CodePage", 8)) {
-			p += 8;
-		    }
+	case 'C':
+	    if (p[1] == 'o' || p[1] == 'O') {
+		buffer[sizeof(buffer) - 1] = '\0';
+		if (!strncasecomp(p, "CodePage", 8)) {
+		    p += 8;
 		}
+	    }
+	    p++;
+	    while (*p == ' ' || *p == '\t') {
 		p++;
-		while (*p == ' ' || *p == '\t') {
-		    p++;
-		}
-		CodePage = strtol(p,0,10);
-		CodePage_found = 1;
-		continue;
+	    }
+	    CodePage = strtol(p, 0, 10);
+	    CodePage_found = 1;
+	    continue;
 	}
 
 	if (*p == 'U') {
@@ -505,7 +503,7 @@ int main (
 		fprintf(stderr, "Bad input line: %s\n", buffer);
 		done(EX_DATAERR);
 		fprintf(stderr,
-    "%s: Bad Unicode range corresponding to font position range 0x%x-0x%x\n",
+			"%s: Bad Unicode range corresponding to font position range 0x%x-0x%x\n",
 			tblname, fp0, fp1);
 		done(EX_DATAERR);
 	    }
@@ -537,7 +535,7 @@ int main (
 		continue;
 	    }
 
-	    tbuf = (char *)malloc(4*strlen(p));
+	    tbuf = (char *) malloc(4 * strlen(p));
 
 	    if (!(p1 = tbuf)) {
 		fprintf(stderr, "%s: Out of memory\n", tblname);
@@ -550,6 +548,7 @@ int main (
 		 *  end of buffer.
 		 */
 		int escaped = 0;
+
 		for (ch = *(++p); (ch = *p) != '\0'; p++) {
 		    if (escaped) {
 			escaped = 0;
@@ -582,7 +581,7 @@ int main (
 	    }
 	    *p1 = '\0';
 	    for (i = un0; i <= un1; i++) {
-		addpair_str(tbuf,i);
+		addpair_str(tbuf, i);
 	    }
 	    continue;
 	}
@@ -637,7 +636,7 @@ int main (
 	    }
 	    if (!strncmp(p, "idem", 4)) {
 		for (i = fp0; i <= fp1; i++) {
-		    addpair(i,i);
+		    addpair(i, i);
 		}
 		p += 4;
 	    } else {
@@ -657,13 +656,13 @@ int main (
 		un1 = getunicode(&p);
 		if (un0 < 0 || un1 < 0) {
 		    fprintf(stderr,
-     "%s: Bad Unicode range corresponding to font position range 0x%x-0x%x\n",
+			    "%s: Bad Unicode range corresponding to font position range 0x%x-0x%x\n",
 			    tblname, fp0, fp1);
 		    done(EX_DATAERR);
 		}
 		if (un1 - un0 != fp1 - fp0) {
 		    fprintf(stderr,
-			"%s: Unicode range U+%x-U+%x not of the same length",
+			    "%s: Unicode range U+%x-U+%x not of the same length",
 			    tblname, un0, un1);
 		    fprintf(stderr,
 			    " as font position range 0x%x-0x%x\n",
@@ -671,7 +670,7 @@ int main (
 		    done(EX_DATAERR);
 		}
 		for (i = fp0; i <= fp1; i++) {
-		    addpair(i,un0-fp0+i);
+		    addpair(i, un0 - fp0 + i);
 		}
 	    }
 	} else {
@@ -684,7 +683,7 @@ int main (
 		p++;
 	    }
 	    if (!strncmp(p, "idem", 4)) {
-		addpair(fp0,fp0);
+		addpair(fp0, fp0);
 		p += 4;
 	    }
 	    while ((un0 = getunicode(&p)) >= 0) {
@@ -720,20 +719,19 @@ int main (
      */
     fclose(ctbl);
 
-
     /*
      *  Compute total size of Unicode list.
      */
     nuni = 0;
-    for (i = 0 ; i < fontlen ; i++) {
+    for (i = 0; i < fontlen; i++) {
 	nuni += unicount[i];
     }
 
     if (argc > 3) {
-	strncpy(this_MIMEcharset,argv[3],UC_MAXLEN_MIMECSNAME);
+	strncpy(this_MIMEcharset, argv[3], UC_MAXLEN_MIMECSNAME);
     } else if (this_MIMEcharset[0] == '\0') {
-	strncpy(this_MIMEcharset,tblname,UC_MAXLEN_MIMECSNAME);
-	if ((p = strchr(this_MIMEcharset,'.')) != 0) {
+	strncpy(this_MIMEcharset, tblname, UC_MAXLEN_MIMECSNAME);
+	if ((p = strchr(this_MIMEcharset, '.')) != 0) {
 	    *p = '\0';
 	}
     }
@@ -741,13 +739,13 @@ int main (
 	*p = TOLOWER(*p);
     }
     if (argc > 4) {
-	strncpy(this_LYNXcharset,argv[4],UC_MAXLEN_LYNXCSNAME);
+	strncpy(this_LYNXcharset, argv[4], UC_MAXLEN_LYNXCSNAME);
     } else if (this_LYNXcharset[0] == '\0') {
-	strncpy(this_LYNXcharset,this_MIMEcharset,UC_MAXLEN_LYNXCSNAME);
+	strncpy(this_LYNXcharset, this_MIMEcharset, UC_MAXLEN_LYNXCSNAME);
     }
 
     if (this_isDefaultMap == -1) {
-	this_isDefaultMap = !strncmp(this_MIMEcharset,"iso-8859-1", 10);
+	this_isDefaultMap = !strncmp(this_MIMEcharset, "iso-8859-1", 10);
     }
     fprintf(stderr,
 	    "makeuctb: %s: %stranslation map",
@@ -756,11 +754,11 @@ int main (
 	*id_append = '\0';
     } else {
 	for (i = 0, p = this_MIMEcharset;
-	     *p && (i < UC_MAXLEN_ID_APPEND-1);
+	     *p && (i < UC_MAXLEN_ID_APPEND - 1);
 	     p++, i++) {
-	    id_append[i+1] = isalnum(UCH(*p)) ? *p : '_';
+	    id_append[i + 1] = isalnum(UCH(*p)) ? *p : '_';
 	}
-	id_append[i+1] = '\0';
+	id_append[i + 1] = '\0';
     }
     fprintf(stderr, " (%s).\n", id_append);
 
@@ -852,23 +850,22 @@ static struct unipair_str repl_map%s[%d] = \n\
     if (themap_str.entry_ct) {
 	fprintf(chdr, "\n\
 static const struct unimapdesc_str dfont_replacedesc%s = {%d,repl_map%s,",
-id_append, themap_str.entry_ct, id_append);
+		id_append, themap_str.entry_ct, id_append);
     } else {
 	fprintf(chdr, "\n\
-static const struct unimapdesc_str dfont_replacedesc%s = {0,NULL,",id_append);
+static const struct unimapdesc_str dfont_replacedesc%s = {0,NULL,", id_append);
     }
     fprintf(chdr, "%d,%d};\n",
 	    this_isDefaultMap ? 1 : 0,
 	    (useDefaultMap && !this_isDefaultMap) ? 1 : 0
-    );
-
+	);
 
     fprintf(chdr, "#define UC_CHARSET_SETUP%s UC_Charset_Setup(\
 \"%s\",\\\n\"%s\",\\\n\
 dfont_unicount%s,dfont_unitable%s,%d,\\\n\
 dfont_replacedesc%s,%d,%d,%d)\n",
-id_append, this_MIMEcharset, this_LYNXcharset,
-id_append, id_append, nuni, id_append, lowest_eight, RawOrEnc, CodePage);
+	    id_append, this_MIMEcharset, this_LYNXcharset,
+	    id_append, id_append, nuni, id_append, lowest_eight, RawOrEnc, CodePage);
 
     for (n = 0; n < TABLESIZE(last_ifdefs); n++) {
 	fprintf(chdr, last_ifdefs[n], id_append);
diff --git a/src/chrtrans/rot13_kb.h b/src/chrtrans/rot13_kb.h
index e402fb88..1df5f321 100644
--- a/src/chrtrans/rot13_kb.h
+++ b/src/chrtrans/rot13_kb.h
@@ -1,21 +1,22 @@
-static LYKbLayout_t kb_layout_rot13[128] = {
-0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, /* 00..07 */ 
-0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, /* 08..0F */ 
-0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, /* 10..17 */ 
-0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, /* 18..1F */ 
- 
-0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, /* 20..27 */ 
-0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, /* 28..2F */ 
-0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, /* 30..37 */ 
-0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, /* 38..3F */ 
- 
-0x0000, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, /* 40..48 */  
-0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x0041, 0x0042, /* 40..4F */  
-0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, /* 50..58 */  
-0x004b, 0x004c, 0x004d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 50..5F */  
- 
-0x0000, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, /* 60..68 */  
-0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x0061, 0x0062, /* 60..6F */  
-0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, /* 70..78 */  
-0x006b, 0x006c, 0x006d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000  /* 70..7F */ 
-}; 
+static LYKbLayout_t kb_layout_rot13[128] =
+{
+    0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,	/* 00..07 */
+    0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,	/* 08..0F */
+    0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,	/* 10..17 */
+    0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,	/* 18..1F */
+
+    0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,	/* 20..27 */
+    0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,	/* 28..2F */
+    0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,	/* 30..37 */
+    0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,	/* 38..3F */
+
+    0x0000, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054,	/* 40..48 */
+    0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x0041, 0x0042,	/* 40..4F */
+    0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a,	/* 50..58 */
+    0x004b, 0x004c, 0x004d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,	/* 50..5F */
+
+    0x0000, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074,	/* 60..68 */
+    0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x0061, 0x0062,	/* 60..6F */
+    0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a,	/* 70..78 */
+    0x006b, 0x006c, 0x006d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000	/* 70..7F */
+};
diff --git a/src/chrtrans/yawerty_kb.h b/src/chrtrans/yawerty_kb.h
index d96eaa70..8301c818 100644
--- a/src/chrtrans/yawerty_kb.h
+++ b/src/chrtrans/yawerty_kb.h
@@ -1,21 +1,22 @@
-static LYKbLayout_t kb_layout_yawerty[128] = {
-0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, /* 00..07 */ 
-0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, /* 08..0F */ 
-0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, /* 10..17 */ 
-0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, /* 18..1F */ 
- 
-0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, /* 20..27 */ 
-0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, /* 28..2F */ 
-0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, /* 30..37 */ 
-0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, /* 38..3F */ 
- 
-0x042e, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, /* 40..47 */ 
-0x0425, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, /* 48..4F */ 
-0x041f, 0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, /* 50..57 */ 
-0x042c, 0x042b, 0x0417, 0x0448, 0x044d, 0x0449, 0x0447, 0x044a, /* 58..5F */ 
- 
-0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, /* 60..67 */ 
-0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, /* 68..6F */ 
-0x043f, 0x044f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, /* 70..77 */ 
-0x044c, 0x044b, 0x0437, 0x0428, 0x042d, 0x0429, 0x0427, 0x0000  /* 78..7F */ 
-};  
+static LYKbLayout_t kb_layout_yawerty[128] =
+{
+    0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,	/* 00..07 */
+    0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,	/* 08..0F */
+    0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,	/* 10..17 */
+    0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,	/* 18..1F */
+
+    0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,	/* 20..27 */
+    0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,	/* 28..2F */
+    0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,	/* 30..37 */
+    0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,	/* 38..3F */
+
+    0x042e, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413,	/* 40..47 */
+    0x0425, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e,	/* 48..4F */
+    0x041f, 0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412,	/* 50..57 */
+    0x042c, 0x042b, 0x0417, 0x0448, 0x044d, 0x0449, 0x0447, 0x044a,	/* 58..5F */
+
+    0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433,	/* 60..67 */
+    0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e,	/* 68..6F */
+    0x043f, 0x044f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432,	/* 70..77 */
+    0x044c, 0x044b, 0x0437, 0x0428, 0x042d, 0x0429, 0x0427, 0x0000	/* 78..7F */
+};