ref: bc06169420581a3cb32582974411bc4fdec81b32
dir: /x.c/
#include <u.h>
#include <libc.h>
#include <thread.h>
#include "st.h"
#include "win.h"
#include "config.h"
char *opt_io;
char *opt_line;
char **opt_cmd;
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
/* 8 normal colors */
"black",
"red3",
"green3",
"yellow3",
"blue2",
"magenta3",
"cyan3",
"gray90",
/* 8 bright colors */
"gray50",
"red",
"green",
"yellow",
"#5c5cff",
"magenta",
"cyan",
"white",
[255] = 0,
/* more colors can be added after 255 to use with DefaultXX */
"#cccccc",
"#555555",
"gray90", /* default foreground colour */
"black", /* default background colour */
};
unsigned int defaultfg = 258;
unsigned int defaultbg = 259;
unsigned int defaultcs = 256;
static unsigned int defaultrcs = 257;
static unsigned int cols = 80;
static unsigned int rows = 24;
static unsigned int defaultattr = 11;
void
xbell(void)
{
}
void
xclipcopy(void)
{
}
void
xdrawcursor(int, int, Glyph, int, int, Glyph)
{
}
void
xdrawline(Line, int, int, int)
{
}
void
xfinishdraw(void)
{
}
void
xloadcols(void)
{
}
int
xsetcolorname(int, const char *)
{
return 0;
}
int
xgetcolor(int, unsigned char *, unsigned char *, unsigned char *)
{
return 0;
}
void
xseticontitle(char *)
{
}
void
xsettitle(char *)
{
}
int
xsetcursor(int)
{
return 0;
}
void
xsetmode(int, unsigned int)
{
}
void
xsetpointermotion(int)
{
}
void
xsetsel(char *)
{
}
int
xstartdraw(void)
{
return 0;
}
void
xximspot(int, int)
{
}
void
run(void)
{
}
void
xinit(int cols, int rows)
{
USED(cols);
USED(rows);
}
void
usage(void)
{
sysfatal("vt: bad usage\n");
}
void
threadmain(int argc, char **argv)
{
ARGBEGIN {
case 'a':
allowaltscreen = 0;
break;
case 'e':
if (argc > 0)
--argc, ++argv;
goto run;
case 'o':
opt_io = EARGF(usage());
break;
case 'l':
opt_line = EARGF(usage());
break;
default:
usage();
} ARGEND;
run:
if (argc > 0) /* eat all remaining arguments */
opt_cmd = argv;
cols = MAX(cols, 1);
rows = MAX(rows, 1);
tnew(cols, rows);
xinit(cols, rows);
selinit();
run();
}