Plan 9 from Bell Labs’s /usr/web/sources/extra/9hist/port/latin1.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


## diffname port/latin1.c 1991/1108
## diff -e /dev/null /n/bootesdump/1991/1108/sys/src/9/port/latin1.c
binary files /tmp/diff100000696286 /n/bootesdump/1991/1108/sys/src/9/port/latin1.c differ
## diffname port/latin1.c 1991/1125
## diff -e /n/bootesdump/1991/1108/sys/src/9/port/latin1.c /n/bootesdump/1991/1125/sys/src/9/port/latin1.c
binary files /n/bootesdump/1991/1108/sys/src/9/port/latin1.c /n/bootesdump/1991/1125/sys/src/9/port/latin1.c differ
## diffname port/latin1.c 1991/1211
## diff -e /n/bootesdump/1991/1125/sys/src/9/port/latin1.c /n/bootesdump/1991/1211/sys/src/9/port/latin1.c
binary files /n/bootesdump/1991/1125/sys/src/9/port/latin1.c /n/bootesdump/1991/1211/sys/src/9/port/latin1.c differ
## diffname port/latin1.c 1991/1225
## diff -e /n/bootesdump/1991/1211/sys/src/9/port/latin1.c /n/bootesdump/1991/1225/sys/src/9/port/latin1.c
binary files /n/bootesdump/1991/1211/sys/src/9/port/latin1.c /n/bootesdump/1991/1225/sys/src/9/port/latin1.c differ
## diffname port/latin1.c 1992/0219
## diff -e /n/bootesdump/1991/1225/sys/src/9/port/latin1.c /n/bootesdump/1992/0219/sys/src/9/port/latin1.c
binary files /n/bootesdump/1991/1225/sys/src/9/port/latin1.c /n/bootesdump/1992/0219/sys/src/9/port/latin1.c differ
## diffname port/latin1.c 1992/0222
## diff -e /n/bootesdump/1992/0219/sys/src/9/port/latin1.c /n/bootesdump/1992/0222/sys/src/9/port/latin1.c
binary files /n/bootesdump/1992/0219/sys/src/9/port/latin1.c /n/bootesdump/1992/0222/sys/src/9/port/latin1.c differ
## diffname port/latin1.c 1992/0226
## diff -e /n/bootesdump/1992/0222/sys/src/9/port/latin1.c /n/bootesdump/1992/0226/sys/src/9/port/latin1.c
binary files /n/bootesdump/1992/0222/sys/src/9/port/latin1.c /n/bootesdump/1992/0226/sys/src/9/port/latin1.c differ
## diffname port/latin1.c 1992/0413
## diff -e /n/bootesdump/1992/0226/sys/src/9/port/latin1.c /n/bootesdump/1992/0413/sys/src/9/port/latin1.c
binary files /n/bootesdump/1992/0226/sys/src/9/port/latin1.c /n/bootesdump/1992/0413/sys/src/9/port/latin1.c differ
## diffname port/latin1.c 1992/0821
## diff -e /n/bootesdump/1992/0413/sys/src/9/port/latin1.c /n/bootesdump/1992/0821/sys/src/9/port/latin1.c
binary files /n/bootesdump/1992/0413/sys/src/9/port/latin1.c /n/bootesdump/1992/0821/sys/src/9/port/latin1.c differ
## diffname port/latin1.c 1992/0906
## diff -e /n/bootesdump/1992/0821/sys/src/9/port/latin1.c /n/bootesdump/1992/0906/sys/src/9/port/latin1.c
binary files /n/bootesdump/1992/0821/sys/src/9/port/latin1.c /n/bootesdump/1992/0906/sys/src/9/port/latin1.c differ
## diffname port/latin1.c 1992/0907
## diff -e /n/bootesdump/1992/0906/sys/src/9/port/latin1.c /n/bootesdump/1992/0907/sys/src/9/port/latin1.c
34c
	L'º',	's','o',	/* super o, masculine ordinal */
.
## diffname port/latin1.c 1994/0503
## diff -e /n/bootesdump/1992/0907/sys/src/9/port/latin1.c /n/fornaxdump/1994/0503/sys/src/brazil/port/latin1.c
244a
}

/*
 * Given n characters k[0]..k[n-1], find the corresponding rune or return -1 for
 * failure, or something < -1 if n is too small.  In the latter case, the result
 * is minus the required n.
 */
long
latin1(uchar *k, int n)
{
	struct cvlist *l;
	int c;
	char* p;

	if(k[0] == 'X')
		if(n>=5)
			return unicode(k);
		else
			return -5;
	for(l=latintab; l->ld!=0; l++)
		if(k[0] == l->ld[0]){
			if(n == 1)
				return -2;
			if(l->ld[1] == 0)
				c = k[1];
			else if(l->ld[1] != k[1])
				continue;
			else if(n == 2)
				return -3;
			else
				c = k[2];
			for(p=l->si; *p!=0; p++)
				if(*p == c)
					return l->so[p - l->si];
			return -1;
		}
	return -1;
.
216,226d
214a
/*
 * Given 5 characters k[0]..k[4], find the rune or return -1 for failure.
 */
.
5,212c
	char	*ld;		/* must be seen before using this conversion */
	char	*si;		/* options for last input characters */
	Rune	*so;		/* the corresponding Rune for each si entry */
} latintab[] = {
	" ",  " i",		L"␣ı",
	"!~", "-=~",		L"≄≇≉",
	"!",  "!<=>?bmp",	L"¡≮≠≯‽⊄∉⊅",
	"\"*","IUiu",		L"ΪΫϊϋ",
	"\"", "AEIOUY\"aeiouy",	L"ÄËÏÖÜŸ¨äëïöüÿ",
	"$*", "fhk",		L"ϕϑϰ",
	"$",  "BEFHILMoRVaefglpv",	L"ℬℰℱℋℐℒℳℴℛƲɑℯƒℊℓ℘ʋ",
	"'\"","Uu",		L"Ǘǘ",
	"'",  "'ACEILNORSUYZacegilnorsuyz",
				L"´ÁĆÉÍĹŃÓŔŚÚÝŹáćéģíĺńóŕśúýź",
	"*",  "*ABCDEFGHIKLMNOPQRSTUWXYZabcdefghiklmnopqrstuwxyz",
		L"∗ΑΒΞΔΕΦΓΘΙΚΛΜΝΟΠΨΡΣΤΥΩΧΗΖαβξδεφγθικλμνοπψρστυωχηζ",
	"+",  "-O",		L"±⊕",
	",",  ",ACEGIKLNORSTUacegiklnorstu",
				L"¸ĄÇĘĢĮĶĻŅǪŖŞŢŲąçęģįķļņǫŗşţų",
	"-*", "l",		L"ƛ",
	"-",  "+-2:>DGHILOTZbdghiltuz~",
				L"∓­ƻ÷→ÐǤĦƗŁ⊖ŦƵƀðǥℏɨłŧʉƶ≂",
	".",  ".CEGILOZceglz",	L"·ĊĖĠİĿ⊙Żċėġŀż",
	"/",  "Oo",		L"Øø",
	"1",  "234568",		L"½⅓¼⅕⅙⅛",
	"2",  "-35",		L"ƻ⅔⅖",
	"3",  "458",		L"¾⅗⅜",
	"4",  "5",		L"⅘",
	"5",  "68",		L"⅚⅝",
	"7",  "8",		L"⅞",
	":",  "-=",		L"÷≔",
	"<!", "=~",		L"≨⋦",
	"<",  "-<=>~",		L"←«≤≶≲",
	"=",  ":<=>OV",		L"≕⋜≡⋝⊜⇒",
	">!", "=~",		L"≩⋧",
	">",  "<=>~",		L"≷≥»≳",
	"?",  "!?",		L"‽¿",
	"@@",  "'EKSTYZekstyz",	L"ьЕКСТЫЗекстыз",
	"@'",  "'",	L"ъ",
	"@C",  "Hh",	L"ЧЧ",
	"@E",  "Hh",	L"ЭЭ",
	"@K",  "Hh",	L"ХХ",
	"@S",  "CHch",	L"ЩШЩШ",
	"@T",  "Ss",	L"ЦЦ",
	"@Y",  "AEOUaeou",	L"ЯЕЁЮЯЕЁЮ",
	"@Z",  "Hh",	L"ЖЖ",
	"@c",  "h",	L"ч",
	"@e",  "h",	L"э",
	"@k",  "h",	L"х",
	"@s",  "ch",	L"щш",
	"@t",  "s",	L"ц",
	"@y",  "aeou",	L"яеёю",
	"@z",  "h",	L"ж",
	"@",  "ABDFGIJLMNOPRUVXabdfgijlmnopruvx",
				L"АБДФГИЙЛМНОПРУВХабдфгийлмнопрувх",
	"A",  "E",		L"Æ",
	"C",  "ACU",		L"⋂ℂ⋃",
	"Dv", "Zz",		L"DŽDž",
	"D",  "-e",		L"Ð∆",
	"G",  "-",		L"Ǥ",
	"H",  "-H",		L"Ħℍ",
	"I",  "-J",		L"ƗIJ",
	"L",  "&-Jj|",		L"⋀ŁLJLj⋁",
	"N",  "JNj",		L"NJℕNj",
	"O",  "*+-./=EIcoprx",	L"⊛⊕⊖⊙⊘⊜ŒƢ©⊚℗®⊗",
	"P",  "P",		L"ℙ",
	"Q",  "Q",		L"ℚ",
	"R",  "R",		L"ℝ",
	"S",  "S",		L"§",
	"T",  "-u",		L"Ŧ⊨",
	"V",  "=",		L"⇐",
	"Y",  "R",		L"Ʀ",
	"Z",  "-Z",		L"Ƶℤ",
	"^",  "ACEGHIJOSUWYaceghijosuwy",
				L"ÂĈÊĜĤÎĴÔŜÛŴŶâĉêĝĥîĵôŝûŵŷ",
	"_\"","AUau",		L"ǞǕǟǖ",
	"_.", "Aa",		L"Ǡǡ",
	"_,", "Oo",		L"Ǭǭ",
	"_",  "_AEIOUaeiou",	L"¯ĀĒĪŌŪāēīōū",
	"`\"","Uu",		L"Ǜǜ",
	"`",  "AEIOUaeiou",	L"ÀÈÌÒÙàèìòù",
	"a",  "ben",		L"↔æ∠",
	"b",  "()+-0123456789=bknpqru",
				L"₍₎₊₋₀₁₂₃₄₅₆₇₈₉₌♝♚♞♟♛♜•",
	"c",  "$Oagu",		L"¢©∩≅∪",
	"dv", "z",		L"dž",
	"d",  "-adegz",		L"ð↓‡°†ʣ",
	"e",  "ls",		L"⋯∅",
	"f",  "a",		L"∀",
	"g",  "$-r",		L"¤ǥ∇",
	"h",  "-v",		L"ℏƕ",
	"i",  "-bfjps",		L"ɨ⊆∞ij⊇∫",
	"l",  "\"$&'-jz|",	L"“£∧‘łlj⋄∨",
	"m",  "iou",		L"µ∈×",
	"n",  "jo",		L"nj¬",
	"o",  "AOUaeiu",	L"Å⊚Ůåœƣů",
	"p",  "Odgrt",		L"℗∂¶∏∝",
	"r",  "\"'O",		L"”’®",
	"s",  "()+-0123456789=abnoprstu",
				L"⁽⁾⁺⁻⁰¹²³⁴⁵⁶⁷⁸⁹⁼ª⊂ⁿº⊃√ß∍∑",
	"t",  "-efmsu",		L"ŧ∃∴™ς⊢",
	"u",  "-AEGIOUaegiou",	L"ʉĂĔĞĬŎŬ↑ĕğĭŏŭ",
	"v\"","Uu",		L"Ǚǚ",
	"v",  "ACDEGIKLNORSTUZacdegijklnorstuz",
				L"ǍČĎĚǦǏǨĽŇǑŘŠŤǓŽǎčďěǧǐǰǩľňǒřšťǔž",
	"w",  "bknpqr",		L"♗♔♘♙♕♖",
	"x",  "O",		L"⊗",
	"y",  "$",		L"¥",
	"z",  "-",		L"ƶ",
	"|",  "Pp|",		L"Þþ¦",
	"~!", "=",		L"≆",
	"~",  "-=AINOUainou~",	L"≃≅ÃĨÑÕŨãĩñõũ≈",
	0,	0,		0
.
3c
/*
 * The code makes two assumptions: strlen(ld) is 1 or 2; latintab[i].ld can be a
 * prefix of latintab[j].ld only when j<i.
 */
struct cvlist
.
1c
#include <u.h>
.
## diffname port/latin1.c 1996/1104
## diff -e /n/fornaxdump/1994/0503/sys/src/brazil/port/latin1.c /n/fornaxdump/1996/1104/sys/src/brazil/port/latin1.c
96c
	"e",  "lmns",		L"⋯—–∅",
.
## diffname port/latin1.c 1997/0308
## diff -e /n/fornaxdump/1996/1104/sys/src/brazil/port/latin1.c /n/emeliedump/1997/0308/sys/src/brazil/port/latin1.c
binary files /n/fornaxdump/1996/1104/sys/src/brazil/port/latin1.c /n/emeliedump/1997/0308/sys/src/brazil/port/latin1.c differ
## diffname port/latin1.c 1997/0327
## diff -e /n/emeliedump/1997/0308/sys/src/brazil/port/latin1.c /n/emeliedump/1997/0327/sys/src/brazil/port/latin1.c
binary files /n/emeliedump/1997/0308/sys/src/brazil/port/latin1.c /n/emeliedump/1997/0327/sys/src/brazil/port/latin1.c differ
## diffname port/latin1.c 1999/0819
## diff -e /n/emeliedump/1997/0327/sys/src/brazil/port/latin1.c /n/emeliedump/1999/0819/sys/src/brazil/port/latin1.c
39c
	":",  ")-=",		L"☺÷≔",
.
## diffname port/latin1.c 1999/1005
## diff -e /n/emeliedump/1999/0819/sys/src/brazil/port/latin1.c /n/emeliedump/1999/1005/sys/src/brazil/port/latin1.c
154c
latin1(Rune *k, int n)
.
128c
unicode(Rune *k)
.
## diffname port/latin1.c 2000/0314
## diff -e /n/emeliedump/1999/1005/sys/src/brazil/port/latin1.c /n/emeliedump/2000/0314/sys/src/9/port/latin1.c
13,120c
#include "../port/latin1.h"
.

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.