mirror of
https://github.com/0intro/conterm
synced 2024-11-24 22:59:36 +03:00
setmalloctag
This commit is contained in:
parent
1125f094ce
commit
083b5a0e40
@ -464,6 +464,7 @@ enum{
|
||||
Qrandom,
|
||||
Qreboot,
|
||||
Qsecstore,
|
||||
Qshowfile,
|
||||
Qsnarf,
|
||||
Qswap,
|
||||
Qsysname,
|
||||
@ -497,6 +498,7 @@ static Dirtab consdir[]={
|
||||
"random", {Qrandom}, 0, 0444,
|
||||
"reboot", {Qreboot}, 0, 0664,
|
||||
"secstore", {Qsecstore}, 0, 0666,
|
||||
"showfile", {Qshowfile}, 0, 0220,
|
||||
"snarf", {Qsnarf}, 0, 0666,
|
||||
"swap", {Qswap}, 0, 0664,
|
||||
"sysname", {Qsysname}, 0, 0664,
|
||||
@ -915,6 +917,9 @@ conswrite(Chan *c, void *va, long n, vlong off)
|
||||
memmove(secstorebuf+offset, va, n);
|
||||
return n;
|
||||
|
||||
case Qshowfile:
|
||||
return showfilewrite(a, n);
|
||||
|
||||
case Qsnarf:
|
||||
if(offset >= SnarfSize || offset+n >= SnarfSize)
|
||||
error(Etoobig);
|
||||
|
@ -305,10 +305,11 @@ void segclock(ulong);
|
||||
void segpage(Segment*, Page*);
|
||||
void setkernur(Ureg*, Proc*);
|
||||
int setlabel(Label*);
|
||||
void setmalloctag(void*, ulong);
|
||||
void setmalloctag(void*, uintptr);
|
||||
void setrealloctag(void*, ulong);
|
||||
void setregisters(Ureg*, char*, char*, int);
|
||||
void setswapchan(Chan*);
|
||||
long showfilewrite(char*, int);
|
||||
char* skipslash(char*);
|
||||
void sleep(Rendez*, int(*)(void*), void*);
|
||||
void* smalloc(ulong);
|
||||
|
@ -213,3 +213,9 @@ ticks(void)
|
||||
return (t.tv_sec-sec0)*1000+(t.tv_usec-usec0+500)/1000;
|
||||
}
|
||||
|
||||
long
|
||||
showfilewrite(char *a, int n)
|
||||
{
|
||||
error("not implemented");
|
||||
return -1;
|
||||
}
|
||||
|
24
kern/win32.c
24
kern/win32.c
@ -444,3 +444,27 @@ oserrstr(void)
|
||||
{
|
||||
osrerrstr(up->errstr, ERRMAX);
|
||||
}
|
||||
|
||||
long
|
||||
showfilewrite(char *a, int n)
|
||||
{
|
||||
Rune *action, *arg, *cmd;
|
||||
static Rune Lopen[] = { 'o', 'p', 'e', 'n', 0 };
|
||||
|
||||
cmd = runesmprint("%.*s", n, a);
|
||||
if(cmd == nil)
|
||||
error("out of memory");
|
||||
if(cmd[runestrlen(cmd)-1] == '\n')
|
||||
cmd[runestrlen(cmd)] = 0;
|
||||
p = runestrchr(cmd, ' ');
|
||||
if(p){
|
||||
action = cmd;
|
||||
*p++ = 0;
|
||||
arg = p;
|
||||
}else{
|
||||
action = Lopen;
|
||||
arg = cmd;
|
||||
}
|
||||
ShellExecute(0, 0, action, arg, 0, SW_SHOWNORMAL);
|
||||
return n;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user