stats: add threadmaybackground

This commit is contained in:
Russ Cox 2021-01-05 23:35:33 -05:00
parent ac487c754e
commit 7f6458b045
5 changed files with 49 additions and 40 deletions

View file

@ -238,11 +238,14 @@ rpc_attach(Client *c, char *label, char *winsize)
char *s;
NSArray *allDevices;
const NSWindowStyleMask Winstyle = NSWindowStyleMaskTitled
NSWindowStyleMask Winstyle = NSWindowStyleMaskTitled
| NSWindowStyleMaskClosable
| NSWindowStyleMaskMiniaturizable
| NSWindowStyleMaskResizable;
if(label == nil || *label == '\0')
Winstyle &= ~NSWindowStyleMaskTitled;
s = winsize;
sr = [[NSScreen mainScreen] frame];
r = [[NSScreen mainScreen] visibleFrame];

View file

@ -675,6 +675,12 @@ keyboardthread(void *v)
void machproc(void*);
void updateproc(void*);
int
threadmaybackground(void)
{
return 1;
}
void
threadmain(int argc, char *argv[])
{

View file

@ -3,41 +3,41 @@
static char linex[]="\n";
static char wordx[]=" \t\n";
struct cmdtab cmdtab[]={
struct Cmdtab cmdtab[]={
/* cmdc text regexp addr defcmd defaddr count token fn */
'\n', 0, 0, 0, 0, aDot, 0, 0, nl_cmd,
'a', 1, 0, 0, 0, aDot, 0, 0, a_cmd,
'b', 0, 0, 0, 0, aNo, 0, linex, b_cmd,
'B', 0, 0, 0, 0, aNo, 0, linex, b_cmd,
'c', 1, 0, 0, 0, aDot, 0, 0, c_cmd,
'd', 0, 0, 0, 0, aDot, 0, 0, d_cmd,
'D', 0, 0, 0, 0, aNo, 0, linex, D_cmd,
'e', 0, 0, 0, 0, aNo, 0, wordx, e_cmd,
'f', 0, 0, 0, 0, aNo, 0, wordx, f_cmd,
'g', 0, 1, 0, 'p', aDot, 0, 0, g_cmd,
'i', 1, 0, 0, 0, aDot, 0, 0, i_cmd,
'k', 0, 0, 0, 0, aDot, 0, 0, k_cmd,
'm', 0, 0, 1, 0, aDot, 0, 0, m_cmd,
'n', 0, 0, 0, 0, aNo, 0, 0, n_cmd,
'p', 0, 0, 0, 0, aDot, 0, 0, p_cmd,
'q', 0, 0, 0, 0, aNo, 0, 0, q_cmd,
'r', 0, 0, 0, 0, aDot, 0, wordx, e_cmd,
's', 0, 1, 0, 0, aDot, 1, 0, s_cmd,
't', 0, 0, 1, 0, aDot, 0, 0, m_cmd,
'u', 0, 0, 0, 0, aNo, 2, 0, u_cmd,
'v', 0, 1, 0, 'p', aDot, 0, 0, g_cmd,
'w', 0, 0, 0, 0, aAll, 0, wordx, w_cmd,
'x', 0, 1, 0, 'p', aDot, 0, 0, x_cmd,
'y', 0, 1, 0, 'p', aDot, 0, 0, x_cmd,
'X', 0, 1, 0, 'f', aNo, 0, 0, X_cmd,
'Y', 0, 1, 0, 'f', aNo, 0, 0, X_cmd,
'!', 0, 0, 0, 0, aNo, 0, linex, plan9_cmd,
'>', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd,
'<', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd,
'|', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd,
'=', 0, 0, 0, 0, aDot, 0, linex, eq_cmd,
'c'|0x100,0, 0, 0, 0, aNo, 0, wordx, cd_cmd,
0, 0, 0, 0, 0, 0, 0, 0
{'\n', 0, 0, 0, 0, aDot, 0, 0, nl_cmd},
{'a', 1, 0, 0, 0, aDot, 0, 0, a_cmd},
{'b', 0, 0, 0, 0, aNo, 0, linex, b_cmd},
{'B', 0, 0, 0, 0, aNo, 0, linex, b_cmd},
{'c', 1, 0, 0, 0, aDot, 0, 0, c_cmd},
{'d', 0, 0, 0, 0, aDot, 0, 0, d_cmd},
{'D', 0, 0, 0, 0, aNo, 0, linex, D_cmd},
{'e', 0, 0, 0, 0, aNo, 0, wordx, e_cmd},
{'f', 0, 0, 0, 0, aNo, 0, wordx, f_cmd},
{'g', 0, 1, 0, 'p', aDot, 0, 0, g_cmd},
{'i', 1, 0, 0, 0, aDot, 0, 0, i_cmd},
{'k', 0, 0, 0, 0, aDot, 0, 0, k_cmd},
{'m', 0, 0, 1, 0, aDot, 0, 0, m_cmd},
{'n', 0, 0, 0, 0, aNo, 0, 0, n_cmd},
{'p', 0, 0, 0, 0, aDot, 0, 0, p_cmd},
{'q', 0, 0, 0, 0, aNo, 0, 0, q_cmd},
{'r', 0, 0, 0, 0, aDot, 0, wordx, e_cmd},
{'s', 0, 1, 0, 0, aDot, 1, 0, s_cmd},
{'t', 0, 0, 1, 0, aDot, 0, 0, m_cmd},
{'u', 0, 0, 0, 0, aNo, 2, 0, u_cmd},
{'v', 0, 1, 0, 'p', aDot, 0, 0, g_cmd},
{'w', 0, 0, 0, 0, aAll, 0, wordx, w_cmd},
{'x', 0, 1, 0, 'p', aDot, 0, 0, x_cmd},
{'y', 0, 1, 0, 'p', aDot, 0, 0, x_cmd},
{'X', 0, 1, 0, 'f', aNo, 0, 0, X_cmd},
{'Y', 0, 1, 0, 'f', aNo, 0, 0, X_cmd},
{'!', 0, 0, 0, 0, aNo, 0, linex, plan9_cmd},
{'>', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd},
{'<', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd},
{'|', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd},
{'=', 0, 0, 0, 0, aDot, 0, linex, eq_cmd},
{'c'|0x100,0, 0, 0, 0, aNo, 0, wordx, cd_cmd},
{0, 0, 0, 0, 0, 0, 0, 0},
};
Cmd *parsecmd(int);
Addr *compoundaddr(void);
@ -402,7 +402,7 @@ Cmd *
parsecmd(int nest)
{
int i, c;
struct cmdtab *ct;
Cmdtab *ct;
Cmd *cp, *ncp;
Cmd cmd;

View file

@ -33,7 +33,8 @@ struct Cmd
#define ctext g.text
#define caddr g.addr
extern struct cmdtab{
typedef struct Cmdtab Cmdtab;
struct Cmdtab {
ushort cmdc; /* command character */
uchar text; /* takes a textual argument? */
uchar regexp; /* takes a regular expression? */
@ -43,7 +44,8 @@ extern struct cmdtab{
uchar count; /* takes a count e.g. s2/// */
char *token; /* takes text terminated by one of these */
int (*fn)(File*, Cmd*); /* function to call with parse tree */
}cmdtab[];
};
extern Cmdtab cmdtab[];
enum Defaddr{ /* default addresses */
aNo,

View file

@ -37,7 +37,6 @@ typedef struct Address Address;
typedef struct Block Block;
typedef struct Buffer Buffer;
typedef struct Disk Disk;
typedef struct Discdesc Discdesc;
typedef struct File File;
typedef struct List List;
typedef struct Range Range;
@ -342,7 +341,6 @@ void warn_S(Warn, String*);
int whichmenu(File*);
void writef(File*);
Posn writeio(File*);
Discdesc *Dstart(void);
extern Rune samname[]; /* compiler dependent */
extern Rune *left[];