123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- /*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
- #include <u.h>
- #include <libc.h>
- #include <bio.h>
- #include <ctype.h>
- enum
- {
- Unbsp = 0x00A0,
- Uprivate = 0xF000,
- Uempty, /* \& */
- Uamp, /* raw & */
- Ult, /* raw < */
- Ugt, /* raw > */
- Utick, /* raw ' */
- Ubtick, /* raw ` */
- Uminus, /* raw - */
- Uspace, /* raw space */
- Upl, /* symbol + */
- Ueq, /* symbol = */
- Umi, /* symbol - */
- Uformatted, /* start diverted output */
- Uunformatted, /* end diverted output */
- UPI = 720, /* units per inch */
- UPX = 10, /* units per pixel */
-
- /* special input modes */
- CopyMode = 1<<1,
- ExpandMode = 1<<2,
- ArgMode = 1<<3,
- HtmlMode = 1<<4,
-
- MaxLine = 1024,
- };
- Rune* L(char*);
- void addesc(Rune, int (*)(void), int);
- void addraw(Rune*, void(*)(Rune*));
- void addreq(Rune*, void(*)(int, Rune**), int);
- void af(Rune*, Rune*);
- void as(Rune*, Rune*);
- void br(void);
- void closehtml(void);
- Rune* copyarg(void);
- void delraw(Rune*);
- void delreq(Rune*);
- void ds(Rune*, Rune*);
- int dv(int);
- int e_nop(void);
- int e_warn(void);
- void* emalloc(uint);
- void* erealloc(void*, uint);
- Rune* erunesmprint(char*, ...);
- Rune* erunestrdup(Rune*);
- char* esmprint(char*, ...);
- char* estrdup(char*);
- int eval(Rune*);
- int evalscale(Rune*, int);
- Rune* getname(void);
- int getnext(void);
- Rune* getds(Rune*);
- Rune* _getnr(Rune*);
- int getnr(Rune*);
- int getnrr(Rune*);
- int getrune(void);
- Rune* getqarg(void);
- Rune* getline(void);
- void hideihtml(void);
- void html(Rune*, Rune*);
- void htmlinit(void);
- void ihtml(Rune*, Rune*);
- void inputnotify(void(*)(void));
- void itrap(void);
- void itrapset(void);
- int linefmt(Fmt*);
- void nr(Rune*, int);
- void _nr(Rune*, Rune*);
- void out(Rune*);
- void (*outcb)(Rune);
- void outhtml(Rune*);
- void outrune(Rune);
- void outtrap(void);
- int popinput(void);
- void printds(int);
- int pushinputfile(Rune*);
- void pushinputstring(Rune*);
- int pushstdin(void);
- int queueinputfile(Rune*);
- int queuestdin(void);
- void r_nop(int, Rune**);
- void r_warn(int, Rune**);
- Rune *readline(int);
- void reitag(void);
- void renraw(Rune*, Rune*);
- void renreq(Rune*, Rune*);
- void run(void);
- void runinput(void);
- int runmacro(int, int, Rune**);
- void runmacro1(Rune*);
- Rune* rune2html(Rune);
- void setlinenumber(Rune*, int);
- void showihtml(void);
- void sp(int);
- void t1init(void);
- void t2init(void);
- void t3init(void);
- void t4init(void);
- void t5init(void);
- void t6init(void);
- void t7init(void);
- void t8init(void);
- void t9init(void);
- void t10init(void);
- void t11init(void);
- void t12init(void);
- void t13init(void);
- void t14init(void);
- void t15init(void);
- void t16init(void);
- void t17init(void);
- void t18init(void);
- void t19init(void);
- void t20init(void);
- Rune troff2rune(Rune*);
- void unfont(void);
- void ungetnext(Rune);
- void ungetrune(Rune);
- void unitag(void);
- void warn(char*, ...);
- extern int backslash;
- extern int bol;
- extern Biobuf bout;
- extern int broke;
- extern int dot;
- extern int inputmode;
- extern int inrequest;
- extern int tick;
- extern int utf8;
- extern int verbose;
- extern int linepos;
- #define runemalloc(n) (Rune*)emalloc((n)*sizeof(Rune))
- #define runerealloc(r, n) (Rune*)erealloc(r, (n)*sizeof(Rune))
- #define runemove(a, b, n) memmove(a, b, (n)*sizeof(Rune))
- #pragma varargck type "L" void
|