mirror of
https://github.com/0intro/conterm
synced 2024-11-25 07:09:34 +03:00
setmalloctag
This commit is contained in:
parent
1125f094ce
commit
083b5a0e40
@ -464,6 +464,7 @@ enum{
|
|||||||
Qrandom,
|
Qrandom,
|
||||||
Qreboot,
|
Qreboot,
|
||||||
Qsecstore,
|
Qsecstore,
|
||||||
|
Qshowfile,
|
||||||
Qsnarf,
|
Qsnarf,
|
||||||
Qswap,
|
Qswap,
|
||||||
Qsysname,
|
Qsysname,
|
||||||
@ -497,6 +498,7 @@ static Dirtab consdir[]={
|
|||||||
"random", {Qrandom}, 0, 0444,
|
"random", {Qrandom}, 0, 0444,
|
||||||
"reboot", {Qreboot}, 0, 0664,
|
"reboot", {Qreboot}, 0, 0664,
|
||||||
"secstore", {Qsecstore}, 0, 0666,
|
"secstore", {Qsecstore}, 0, 0666,
|
||||||
|
"showfile", {Qshowfile}, 0, 0220,
|
||||||
"snarf", {Qsnarf}, 0, 0666,
|
"snarf", {Qsnarf}, 0, 0666,
|
||||||
"swap", {Qswap}, 0, 0664,
|
"swap", {Qswap}, 0, 0664,
|
||||||
"sysname", {Qsysname}, 0, 0664,
|
"sysname", {Qsysname}, 0, 0664,
|
||||||
@ -915,6 +917,9 @@ conswrite(Chan *c, void *va, long n, vlong off)
|
|||||||
memmove(secstorebuf+offset, va, n);
|
memmove(secstorebuf+offset, va, n);
|
||||||
return n;
|
return n;
|
||||||
|
|
||||||
|
case Qshowfile:
|
||||||
|
return showfilewrite(a, n);
|
||||||
|
|
||||||
case Qsnarf:
|
case Qsnarf:
|
||||||
if(offset >= SnarfSize || offset+n >= SnarfSize)
|
if(offset >= SnarfSize || offset+n >= SnarfSize)
|
||||||
error(Etoobig);
|
error(Etoobig);
|
||||||
|
@ -305,10 +305,11 @@ void segclock(ulong);
|
|||||||
void segpage(Segment*, Page*);
|
void segpage(Segment*, Page*);
|
||||||
void setkernur(Ureg*, Proc*);
|
void setkernur(Ureg*, Proc*);
|
||||||
int setlabel(Label*);
|
int setlabel(Label*);
|
||||||
void setmalloctag(void*, ulong);
|
void setmalloctag(void*, uintptr);
|
||||||
void setrealloctag(void*, ulong);
|
void setrealloctag(void*, ulong);
|
||||||
void setregisters(Ureg*, char*, char*, int);
|
void setregisters(Ureg*, char*, char*, int);
|
||||||
void setswapchan(Chan*);
|
void setswapchan(Chan*);
|
||||||
|
long showfilewrite(char*, int);
|
||||||
char* skipslash(char*);
|
char* skipslash(char*);
|
||||||
void sleep(Rendez*, int(*)(void*), void*);
|
void sleep(Rendez*, int(*)(void*), void*);
|
||||||
void* smalloc(ulong);
|
void* smalloc(ulong);
|
||||||
|
@ -213,3 +213,9 @@ ticks(void)
|
|||||||
return (t.tv_sec-sec0)*1000+(t.tv_usec-usec0+500)/1000;
|
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);
|
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