⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oed.c

📁 这是一个同样来自贝尔实验室的和UNIX有着渊源的操作系统, 其简洁的设计和实现易于我们学习和理解
💻 C
📖 第 1 页 / 共 3 页
字号:
#include <u.h>#include <libc.h>#include <bio.h>#include "dict.h"enum {	Buflen=1000,	Maxaux=5,};/* Possible tags */enum {	A,		/* author in quote (small caps) */	B,		/* bold */	Ba,		/* author inside bib */	Bch,		/* builtup chem component */	Bib,		/* surrounds word 'in' for bibliographic ref */	Bl,		/* bold */	Bo,		/* bond over */	Bu,		/* bond under */	Cb,		/* ? block of stuff (indent) */	Cf,		/* cross ref to another entry (italics) */	Chem,		/* chemistry formula */	Co,		/* over (preceding sum, integral, etc.) */	Col,		/* column of table (aux just may be r) */	Cu,		/* under (preceding sum, integral, etc.) */	Dat,		/* date */	Db,		/* def block? indent */	Dn,		/* denominator of fraction */	E,		/* main entry */	Ed,		/* editor's comments (in [...]) */	Etym,		/* etymology (in [...]) */	Fq,		/* frequency count (superscript) */	Form,		/* formula */	Fr,		/* fraction (contains <nu>, then <dn>) */	Gk,		/* greek (transliteration) */	Gr,		/* grammar? (e.g., around 'pa.' in 'pa. pple.') */	Hg,		/* headword group */	Hm,		/* homonym (superscript) */	Hw,		/* headword (bold) */	I,		/* italics */	Il,		/* italic list? */	In,		/* inferior (subscript) */	L,		/* row of col of table */	La,		/* status or usage label (italic) */	Lc,		/* chapter/verse sort of thing for works */	N,		/* note (smaller type) */	Nu,		/* numerator of fraction */	Ov,		/* needs overline */	P,		/* paragraph (indent) */	Ph,		/* pronunciation (transliteration) */	Pi,		/* pile (frac without line) */	Pqp,		/* subblock of quote */	Pr,		/* pronunciation (in (...)) */	Ps,		/* position (e.g., adv.) (italic) */	Pt,		/* part (in lc) */	Q,		/* quote in quote block */	Qd,		/* quote date (bold) */	Qig,		/* quote number (greek) */	Qla,		/* status or usage label in quote (italic) */	Qp,		/* quote block (small type, indent) */	Qsn,		/* quote number */	Qt,		/* quote words */	R,		/* roman type style */	Rx,		/* relative cross reference (e.g., next) */	S,		/* another form? (italic) */	S0,		/* sense (sometimes surrounds several sx's) */	S1,		/* sense (aux num: indented bold letter) */	S2,		/* sense (aux num: indented bold capital rom num) */	S3,		/* sense (aux num: indented number of asterisks) */	S4,		/* sense (aux num: indented bold number) */	S5,		/* sense (aux num: indented number of asterisks) */	S6,		/* subsense (aux num: bold letter) */	S7a,		/* subsense (aux num: letter) */	S7n,		/* subsense (aux num: roman numeral) */	Sc,		/* small caps */	Sgk,		/* subsense (aux num: transliterated greek) */	Sn,		/* sense of subdefinition (aux num: roman letter) */	Ss,		/* sans serif */	Ssb,		/* sans serif bold */	Ssi,		/* sans serif italic */	Su,		/* superior (superscript) */	Sub,		/* subdefinition */	Table,		/* table (aux cols=number of columns) */	Tt,		/* title? (italics) */	Vd,		/* numeric label for variant form */	Ve,		/* variant entry */	Vf,		/* variant form (light bold) */	Vfl,		/* list of vf's (starts with Also or Forms) */	W,		/* work (e.g., Beowulf) (italics) */	X,		/* cross reference to main word (small caps) */	Xd,		/* cross reference to quotation by date */	Xi,		/* internal cross reference ? (italic) */	Xid,		/* cross reference identifer, in quote ? */	Xs,		/* cross reference sense (lower number) */	Xr,		/* list of x's */	Ntag		/* end of tags */};/* Assoc tables must be sorted on first field */static Assoc tagtab[] = {	{"a",		A},	{"b",		B},	{"ba",		Ba},	{"bch",		Bch},	{"bib",		Bib},	{"bl",		Bl},	{"bo",		Bo},	{"bu",		Bu},	{"cb",		Cb},	{"cf",		Cf},	{"chem",	Chem},	{"co",		Co},	{"col",		Col},	{"cu",		Cu},	{"dat",		Dat},	{"db",		Db},	{"dn",		Dn},	{"e",		E},	{"ed",		Ed},	{"et",		Etym},	{"etym",	Etym},	{"form",	Form},	{"fq",		Fq},	{"fr",		Fr},	{"frac",	Fr},	{"gk",		Gk},	{"gr",		Gr},	{"hg",		Hg},	{"hm",		Hm},	{"hw",		Hw},	{"i",		I},	{"il",		Il},	{"in",		In},	{"l",		L},	{"la",		La},	{"lc",		Lc},	{"n",		N},	{"nu",		Nu},	{"ov",		Ov},	{"p",		P},	{"ph",		Ph},	{"pi",		Pi},	{"pqp",		Pqp},	{"pr",		Pr},	{"ps",		Ps},	{"pt",		Pt},	{"q",		Q},	{"qd",		Qd},	{"qig",		Qig},	{"qla",		Qla},	{"qp",		Qp},	{"qsn",		Qsn},	{"qt",		Qt},	{"r",		R},	{"rx",		Rx},	{"s",		S},	{"s0",		S0},	{"s1",		S1},	{"s2",		S2},	{"s3",		S3},	{"s4",		S4},	{"s5",		S5},	{"s6",		S6},	{"s7a",		S7a},	{"s7n",		S7n},	{"sc",		Sc},	{"sgk",		Sgk},	{"sn",		Sn},	{"ss",		Ss,},	{"ssb",		Ssb},	{"ssi",		Ssi},	{"su",		Su},	{"sub",		Sub},	{"table",	Table},	{"tt",		Tt},	{"vd",		Vd},	{"ve",		Ve},	{"vf",		Vf},	{"vfl",		Vfl},	{"w",		W},	{"x",		X},	{"xd",		Xd},	{"xi",		Xi},	{"xid",		Xid},	{"xr",		Xr},	{"xs",		Xs},};/* Possible tag auxilliary info */enum {	Cols,		/* number of columns in a table */	Num,		/* letter or number, for a sense */	St,		/* status (e.g., obs) */	Naux};static Assoc auxtab[] = {	{"cols",	Cols},	{"num",		Num},	{"st",		St}};static Assoc spectab[] = {	{"3on4",	L'¾'},	{"Aacu",	L'Á'},	{"Aang",	L'Å'},	{"Abarab",	L'Ā'},	{"Acirc",	L'Â'},	{"Ae",		L'Æ'},	{"Agrave",	L'À'},	{"Alpha",	L'Α'},	{"Amac",	L'Ā'},	{"Asg",		L'Ʒ'},		/* Unicyle. Cf "Sake" */	{"Auml",	L'Ä'},	{"Beta",	L'Β'},	{"Cced",	L'Ç'},	{"Chacek",	L'Č'},	{"Chi",		L'Χ'},	{"Chirho",	L'☧'},		/* Chi Rho U+2627 */	{"Csigma",	L'Ϛ'},	{"Delta",	L'Δ'},	{"Eacu",	L'É'},	{"Ecirc",	L'Ê'},	{"Edh",		L'Ð'},	{"Epsilon",	L'Ε'},	{"Eta",		L'Η'},	{"Gamma",	L'Γ'},	{"Iacu",	L'Í'},	{"Icirc",	L'Î'},	{"Imac",	L'Ī'},	{"Integ",	L'∫'},	{"Iota",	L'Ι'},	{"Kappa",	L'Κ'},	{"Koppa",	L'Ϟ'},	{"Lambda",	L'Λ'},	{"Lbar",	L'Ł'},	{"Mu",		L'Μ'},	{"Naira",	L'N'},		/* should have bar through */	{"Nplus",	L'N'},		/* should have plus above */	{"Ntilde",	L'Ñ'},	{"Nu",		L'Ν'},	{"Oacu",	L'Ó'},	{"Obar",	L'Ø'},	{"Ocirc",	L'Ô'},	{"Oe",		L'Œ'},	{"Omega",	L'Ω'},	{"Omicron",	L'Ο'},	{"Ouml",	L'Ö'},	{"Phi",		L'Φ'},	{"Pi",		L'Π'},	{"Psi",		L'Ψ'},	{"Rho",		L'Ρ'},	{"Sacu",	L'Ś'},	{"Sigma",	L'Σ'},	{"Summ",	L'∑'},	{"Tau",		L'Τ'},	{"Th",		L'Þ'},	{"Theta",	L'Θ'},	{"Tse",		L'Ц'},	{"Uacu",	L'Ú'},	{"Ucirc",	L'Û'},	{"Upsilon",	L'Υ'},	{"Uuml",	L'Ü'},	{"Wyn",		L'ƿ'},		/* wynn U+01BF */	{"Xi",		L'Ξ'},	{"Ygh",		L'Ʒ'},		/* Yogh	U+01B7 */	{"Zeta",	L'Ζ'},	{"Zh",		L'Ʒ'},		/* looks like Yogh. Cf "Sake" */	{"a",		L'a'},		/* ante */	{"aacu",	L'á'},	{"aang",	L'å'},	{"aasper",	MAAS},	{"abreve",	L'ă'},	{"acirc",	L'â'},	{"acu",		LACU},	{"ae",		L'æ'},	{"agrave",	L'à'},	{"ahook",	L'ą'},	{"alenis",	MALN},	{"alpha",	L'α'},	{"amac",	L'ā'},	{"amp",		L'&'},	{"and",		MAND},	{"ang",		LRNG},	{"angle",	L'∠'},	{"ankh",	L'☥'},		/* ankh U+2625 */	{"ante",	L'a'},		/* before (year) */	{"aonq",	MAOQ},	{"appreq",	L'≃'},	{"aquar",	L'♒'},	{"arDadfull",	L'ض'},		/* Dad U+0636 */	{"arHa",	L'ح'},		/* haa U+062D */	{"arTa",	L'ت'},		/* taa U+062A */	{"arain",	L'ع'},		/* ain U+0639 */	{"arainfull",	L'ع'},		/* ain U+0639 */	{"aralif",	L'ا'},		/* alef U+0627 */	{"arba",	L'ب'},		/* baa U+0628 */	{"arha",	L'ه'},		/* ha U+0647 */	{"aries",	L'♈'},	{"arnun",	L'ن'},		/* noon U+0646 */	{"arnunfull",	L'ن'},		/* noon U+0646 */	{"arpa",	L'ه'},		/* ha U+0647 */	{"arqoph",	L'ق'},		/* qaf U+0642 */	{"arshinfull",	L'ش'},		/* sheen U+0634 */	{"arta",	L'ت'},		/* taa U+062A */	{"artafull",	L'ت'},		/* taa U+062A */	{"artha",	L'ث'},		/* thaa U+062B */	{"arwaw",	L'و'},		/* waw U+0648 */	{"arya",	L'ي'},		/* ya U+064A */	{"aryafull",	L'ي'},		/* ya U+064A */	{"arzero",	L'٠'},		/* indic zero U+0660 */	{"asg",		L'ʒ'},		/* unicycle character. Cf "hallow" */	{"asper",	LASP},	{"assert",	L'⊢'},	{"astm",	L'⁂'},		/* asterism: should be upside down */	{"at",		L'@'},	{"atilde",	L'ã'},	{"auml",	L'ä'},	{"ayin",	L'ع'},		/* arabic ain U+0639 */	{"b1",		L'-'},		/* single bond */	{"b2",		L'='},		/* double bond */	{"b3",		L'≡'},		/* triple bond */	{"bbar",	L'ƀ'},		/* b with bar U+0180 */	{"beta",	L'β'},	{"bigobl",	L'/'},	{"blC",		L'C'},		/* should be black letter */	{"blJ",		L'J'},		/* should be black letter */	{"blU",		L'U'},		/* should be black letter */	{"blb",		L'b'},		/* should be black letter */	{"blozenge",	L'◊'},		/* U+25CA; should be black */	{"bly",		L'y'},		/* should be black letter */	{"bra",		MBRA},	{"brbl",	LBRB},	{"breve",	LBRV},	{"bslash",	L'\\'},	{"bsquare",	L'■'},		/* black square U+25A0 */	{"btril",	L'◀'},		/* U+25C0 */	{"btrir",	L'▶'},		/* U+25B6 */	{"c",		L'c'},		/* circa */	{"cab",		L'〉'},	{"cacu",	L'ć'},	{"canc",	L'♋'},	{"capr",	L'♑'},	{"caret",	L'^'},	{"cb",		L'}'},	{"cbigb",	L'}'},	{"cbigpren",	L')'},	{"cbigsb",	L']'},	{"cced",	L'ç'},	{"cdil",	LCED},	{"cdsb",	L'〛'},		/* ]] U+301b */	{"cent",	L'¢'},	{"chacek",	L'č'},	{"chi",		L'χ'},	{"circ",	LRNG},	{"circa",	L'c'},		/* about (year) */	{"circbl",	L'̥'},		/* ring below accent U+0325 */	{"circle",	L'○'},		/* U+25CB */	{"circledot",	L'⊙'},	{"click",	L'ʖ'},	{"club",	L'♣'},	{"comtime",	L'C'},	{"conj",	L'☌'},	{"cprt",	L'©'},	{"cq",		L'\''},	{"cqq",		L'”'},	{"cross",	L'✠'},		/* maltese cross U+2720 */	{"crotchet",	L'♩'},	{"csb",		L']'},	{"ctilde",	L'c'},		/* +tilde */	{"ctlig",	MLCT},	{"cyra",	L'а'},	{"cyre",	L'е'},	{"cyrhard",	L'ъ'},	{"cyrjat",	L'ѣ'},	{"cyrm",	L'м'},	{"cyrn",	L'н'},	{"cyrr",	L'р'},	{"cyrsoft",	L'ь'},	{"cyrt",	L'т'},	{"cyry",	L'ы'},	{"dag",		L'†'},	{"dbar",	L'đ'},	{"dblar",	L'⇋'},	{"dblgt",	L'≫'},	{"dbllt",	L'≪'},	{"dced",	L'd'},		/* +cedilla */	{"dd",		MDD},	{"ddag",	L'‡'},	{"ddd",		MDDD},	{"decr",	L'↓'},	{"deg",		L'°'},	{"dele",	L'd'},		/* should be dele */	{"delta",	L'δ'},	{"descnode",	L'☋'},		/* descending node U+260B */	{"diamond",	L'♢'},	{"digamma",	L'ϝ'},	{"div",		L'÷'},	{"dlessi",	L'ı'},	{"dlessj1",	L'j'},		/* should be dotless */	{"dlessj2",	L'j'},		/* should be dotless */	{"dlessj3",	L'j'},		/* should be dotless */	{"dollar",	L'$'},	{"dotab",	LDOT},	{"dotbl",	LDTB},	{"drachm",	L'ʒ'},	{"dubh",	L'-'},	{"eacu",	L'é'},	{"earth",	L'♁'},	{"easper",	MEAS},	{"ebreve",	L'ĕ'},	{"ecirc",	L'ê'},	{"edh",		L'ð'},	{"egrave",	L'è'},	{"ehacek",	L'ě'},	{"ehook",	L'ę'},	{"elem",	L'∊'},	{"elenis",	MELN},	{"em",		L'—'},	{"emac",	L'ē'},	{"emem",	MEMM},	{"en",		L'–'},	{"epsilon",	L'ε'},	{"equil",	L'⇋'},	{"ergo",	L'∴'},	{"es",		MES},	{"eszett",	L'ß'},	{"eta",		L'η'},	{"eth",		L'ð'},	{"euml",	L'ë'},	{"expon",	L'↑'},	{"fact",	L'!'},	{"fata",	L'ɑ'},	{"fatpara",	L'¶'},		/* should have fatter, filled in bowl */	{"female",	L'♀'},	{"ffilig",	MLFFI},	{"fflig",	MLFF},	{"ffllig",	MLFFL},	{"filig",	MLFI},	{"flat",	L'♭'},	{"fllig",	MLFL},	{"frE",		L'E'},		/* should be curly */	{"frL",		L'L'},		/* should be curly */	{"frR",		L'R'},		/* should be curly */	{"frakB",	L'B'},		/* should have fraktur style */	{"frakG",	L'G'},	{"frakH",	L'H'},	{"frakI",	L'I'},	{"frakM",	L'M'},	{"frakU",	L'U'},	{"frakX",	L'X'},	{"frakY",	L'Y'},	{"frakh",	L'h'},	{"frbl",	LFRB},	{"frown",	LFRN},	{"fs",		L' '},	{"fsigma",	L'ς'},	{"gAacu",	L'Á'},		/* should be Α+acute */	{"gaacu",	L'α'},		/* +acute */	{"gabreve",	L'α'},		/* +breve */	{"gafrown",	L'α'},		/* +frown */	{"gagrave",	L'α'},		/* +grave */	{"gamac",	L'α'},		/* +macron */	{"gamma",	L'γ'},	{"gauml",	L'α'},		/* +umlaut */	{"ge",		L'≧'},	{"geacu",	L'ε'},		/* +acute */	{"gegrave",	L'ε'},		/* +grave */	{"ghacu",	L'η'},		/* +acute */	{"ghfrown",	L'η'},		/* +frown */	{"ghgrave",	L'η'},		/* +grave */	{"ghmac",	L'η'},		/* +macron */	{"giacu",	L'ι'},		/* +acute */	{"gibreve",	L'ι'},		/* +breve */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -