add getrandom as function (similar to getentropy but with flags), hide...

add getrandom as function (similar to getentropy but with flags), hide progress spinner in C code of androidmain.fs
parent c52b874c
Pipeline #824 passed with stage
in 9 minutes and 3 seconds
......@@ -1219,7 +1219,9 @@ AC_FUNC_FNMATCH
test $ac_cv_func_fnmatch_works = yes || AC_LIBOBJ(fnmatch)
AC_CHECK_FUNCS(mmap sysconf getpagesize pselect pthread_setaffinity_np)
AC_CHECK_FUNC(getentropy,[GETENTROPY=true],[GETENTROPY=false])
AC_CHECK_FUNC(getrandom,[GETRANDOM=true],[GETRANDOM=false])
AC_SUBST(GETENTROPY)
AC_SUBST(GETRANDOM)
AM_PATH_LISPDIR
AX_GCC_BUILTIN(__builtin_clzl)
AX_GCC_BUILTIN(__builtin_bswap16)
......
......@@ -247,6 +247,7 @@ void startForth(jniargs * startargs)
char statepointer[2*sizeof(char*)+3]; // 0x+hex digits+trailing 0
char* patharg;
int retvalue;
int needhide=0;
int epipe[2];
JavaVM *vm=startargs->vm;
JNIEnv *env;
......@@ -270,6 +271,7 @@ void startForth(jniargs * startargs)
if(unpackFiles(gforth_gz, "gforth/current/sha256sum", sha256sum) &&
unpackFiles(dirbuf, "gforth/" ARCH "/gforth/current/sha256sum", sha256arch)) {
post("doneprog");
needhide=1;
}
unlink(gforth_gz); // remove temporary copy of gforth.gz
free(gforth_gz);
......@@ -306,7 +308,10 @@ void startForth(jniargs * startargs)
retvalue=gforth_start(argc, argv);
LOGI("Started, rval=%d\n", retvalue);
if(retvalue == -56) {
if(retvalue == -56) { // success is "quit"
if(needhide) {
post("hideprog");
}
gforth_setwinch();
gforth_bootmessage();
LOGI("starting gforth_quit\n");
......
......@@ -55,3 +55,4 @@ set-current
s" #include <@FFI_H_NAME@>" ;
@GETENTROPY@ constant getentropy?
@GETRANDOM@ constant getrandom?
......@@ -553,7 +553,7 @@ default-out op-vector !
:noname defers reload-textures term-textures ; is reload-textures
: term-init ( -- )
[IFDEF] clazz [ also jni ] ['] hideprog post-it [ previous ] [THEN]
\ [IFDEF] clazz [ also jni ] ['] hideprog post-it [ previous ] [THEN]
>screen-orientation
create-terminal-program to terminal-program
terminal-program terminal-init
......
......@@ -52,7 +52,7 @@ standard:field
: wrapper-xts ( xt@ !-table -- xt-does xt-opt xt-to ) { xt@ xt! }
:noname ]] vfield-int, [[ xt@ compile, postpone ; \ xt-does
:noname ]] >body vfield-comp, [[ xt@ ]]L compile, ; [[ \ xt-comp,
:noname ]] >body vfield-comp, [[ xt@ lit, ]] compile, ; [[ \ xt-comp,
xt! noname vfield-to: latestxt ;
: wrap+value: ( n2 xt-align xt@ !-table "name" -- ) rot { xt-align }
......
......@@ -70,6 +70,9 @@ c-library libc
getentropy? [IF]
c-function getentropy getentropy a n -- n ( buffer len -- n )
[THEN]
getrandom? [IF]
c-function getrandom getrandom a n u -- n ( buffer len flag -- n )
[THEN]
c-value environ environ -- a ( -- env )
end-c-library
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment