Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a new keyword &proc so that access to the underlying function proc is always available #231

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/h/kdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,4 @@ KDef(version,K_VERSION)
KDef(window,K_WINDOW)
KDef(x,K_X)
KDef(y,K_Y)
KDef(proc,K_PROC)
1 change: 1 addition & 0 deletions src/icont/keyword.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,4 @@
#define K_WINDOW 65
#define K_X 66
#define K_Y 67
#define K_PROC 68
34 changes: 25 additions & 9 deletions src/runtime/keyword.r
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ keyword{4} allocated
MUTEX_LOCKID(MTX_TLS_CHAIN);
blktot = curpstate->blocktotal;
strtot = curpstate->stringtotal;
tstate = curpstate->tstate;
tstate = curpstate->tstate;
do {
blktot += tstate->blocktotal;
strtot += tstate->stringtotal;
Expand Down Expand Up @@ -464,15 +464,15 @@ keyword{1,*} features
#if NT
unsigned long long int l = physicalmemorysize();
#else /* NT */
unsigned long l = physicalmemorysize();
#endif /* NT */
unsigned long l = physicalmemorysize();
#endif /* NT */
if (l > 0) {
#if NT
#if NT
sprintf(s, "Physical memory: %llu bytes", l);
#else /* NT */
sprintf(s, "Physical memory: %lu bytes", l);
#endif /* NT */
suspend C_string s;
#endif /* NT */
suspend C_string s;
}
}

Expand Down Expand Up @@ -503,7 +503,7 @@ void get_arch(char *);
{
int value = GetSystemMetrics(SM_DIGITIZER);
if (value & NID_READY){ /* stack ready */
if (value & NID_MULTI_INPUT){ /* digitizer is multitouch */
if (value & NID_MULTI_INPUT){ /* digitizer is multitouch */
suspend C_string "Multitouch input";
}
else if (value & (NID_INTEGRATED_TOUCH|NID_EXTERNAL_TOUCH)){
Expand Down Expand Up @@ -841,7 +841,7 @@ keyword{3} storage
CURTSTATE();

suspend C_integer 0; /* static region */

MUTEX_LOCKID(MTX_STRHEAP);
allRegions = DiffPtrs(strfree,strbase);
for (rp = curstring->next; rp; rp = rp->next)
Expand All @@ -850,7 +850,7 @@ keyword{3} storage
allRegions += DiffPtrs(rp->free,rp->base);
MUTEX_UNLOCKID(MTX_STRHEAP);
suspend C_integer allRegions; /* string region */

MUTEX_LOCKID(MTX_BLKHEAP);
allRegions = DiffPtrs(blkfree,blkbase);
for (rp = curblock->next; rp; rp = rp->next)
Expand Down Expand Up @@ -1169,3 +1169,19 @@ constant '\
\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\
\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377'
end

"&proc - the function reference to proc"
keyword{1} proc
abstract {
return proc
}
body {
struct b_proc *prc;
struct descrip x;

StrLen(x) = 4;
StrLoc(x) = "proc";
prc = bi_strprc(&x, 0);
return proc(prc);
}
end
Loading