1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-24 17:27:18 +00:00

Merge branch 'master' into ev

This commit is contained in:
Calvin Rose 2020-09-12 10:02:01 -05:00
commit d3182dce51
10 changed files with 31 additions and 24 deletions

View File

@ -2,7 +2,9 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## Unreleased - ??? ## Unreleased - ???
- Silence warnings in some compilers.
## 1.12.1 - 2020-09-07
- Make `zero?`, `one?`, `pos?`, and `neg?` polymorphic.
- Add C++ support to jpm and improve C++ interop in janet.h. - Add C++ support to jpm and improve C++ interop in janet.h.
- Add `%t` formatter to `printf`, `string/format`, and other formatter functions. - Add `%t` formatter to `printf`, `string/format`, and other formatter functions.
- Expose `janet_cfuns_prefix` in C API. - Expose `janet_cfuns_prefix` in C API.

View File

@ -157,7 +157,7 @@ build/janet.c: build/janet_boot src/boot/boot.janet
##### Amalgamation ##### ##### Amalgamation #####
######################## ########################
SONAME=libjanet.so.1.11 SONAME=libjanet.so.1.12
build/shell.c: src/mainclient/shell.c build/shell.c: src/mainclient/shell.c
cp $< $@ cp $< $@

View File

@ -102,6 +102,7 @@ exit /b 0
mkdir dist mkdir dist
janet.exe tools\gendoc.janet > dist\doc.html janet.exe tools\gendoc.janet > dist\doc.html
janet.exe tools\removecr.janet dist\doc.html janet.exe tools\removecr.janet dist\doc.html
janet.exe tools\removecr.janet build\janet.c
copy build\janet.c dist\janet.c copy build\janet.c dist\janet.c
copy src\mainclient\shell.c dist\shell.c copy src\mainclient\shell.c dist\shell.c

View File

@ -20,7 +20,7 @@
project('janet', 'c', project('janet', 'c',
default_options : ['c_std=c99', 'b_lundef=false', 'default_library=both'], default_options : ['c_std=c99', 'b_lundef=false', 'default_library=both'],
version : '1.11.4') version : '1.12.2')
# Global settings # Global settings
janet_path = join_paths(get_option('prefix'), get_option('libdir'), 'janet') janet_path = join_paths(get_option('prefix'), get_option('libdir'), 'janet')
@ -72,6 +72,7 @@ conf.set('JANET_STACK_MAX', get_option('stack_max'))
conf.set('JANET_NO_UMASK', not get_option('umask')) conf.set('JANET_NO_UMASK', not get_option('umask'))
conf.set('JANET_NO_REALPATH', not get_option('realpath')) conf.set('JANET_NO_REALPATH', not get_option('realpath'))
conf.set('JANET_NO_PROCESSES', not get_option('processes')) conf.set('JANET_NO_PROCESSES', not get_option('processes'))
conf.set('JANET_SIMPLE_GETLINE', get_option('simple_getline'))
if get_option('os_name') != '' if get_option('os_name') != ''
conf.set('JANET_OS_NAME', get_option('os_name')) conf.set('JANET_OS_NAME', get_option('os_name'))
endif endif

View File

@ -16,6 +16,7 @@ option('ev', type : 'boolean', value : true)
option('processes', type : 'boolean', value : true) option('processes', type : 'boolean', value : true)
option('umask', type : 'boolean', value : true) option('umask', type : 'boolean', value : true)
option('realpath', type : 'boolean', value : true) option('realpath', type : 'boolean', value : true)
option('simple_getline', type : 'boolean', value : false)
option('recursion_guard', type : 'integer', min : 10, max : 8000, value : 1024) option('recursion_guard', type : 'integer', min : 10, max : 8000, value : 1024)
option('max_proto_depth', type : 'integer', min : 10, max : 8000, value : 200) option('max_proto_depth', type : 'integer', min : 10, max : 8000, value : 200)

View File

@ -27,10 +27,10 @@
#define JANETCONF_H #define JANETCONF_H
#define JANET_VERSION_MAJOR 1 #define JANET_VERSION_MAJOR 1
#define JANET_VERSION_MINOR 11 #define JANET_VERSION_MINOR 12
#define JANET_VERSION_PATCH 4 #define JANET_VERSION_PATCH 1
#define JANET_VERSION_EXTRA "-dev" #define JANET_VERSION_EXTRA ""
#define JANET_VERSION "1.11.4-dev" #define JANET_VERSION "1.12.1"
/* #define JANET_BUILD "local" */ /* #define JANET_BUILD "local" */

View File

@ -344,16 +344,16 @@ static const JanetReg array_cfuns[] = {
{ {
"array/concat", cfun_array_concat, "array/concat", cfun_array_concat,
JDOC("(array/concat arr & parts)\n\n" JDOC("(array/concat arr & parts)\n\n"
"Concatenates a variadic number of arrays (and tuples) into the first argument " "Concatenates a variable number of arrays (and tuples) into the first argument "
"which must an array. If any of the parts are arrays or tuples, their elements will " "which must be an array. If any of the parts are arrays or tuples, their elements will "
"be inserted into the array. Otherwise, each part in parts will be appended to arr in order. " "be inserted into the array. Otherwise, each part in parts will be appended to arr in order. "
"Return the modified array arr.") "Return the modified array arr.")
}, },
{ {
"array/insert", cfun_array_insert, "array/insert", cfun_array_insert,
JDOC("(array/insert arr at & xs)\n\n" JDOC("(array/insert arr at & xs)\n\n"
"Insert all of xs into array arr at index at. at should be an integer " "Insert all xs into array arr at index at. at should be an integer between "
"0 and the length of the array. A negative value for at will index from " "0 and the length of the array. A negative value for at will index backwards from "
"the end of the array, such that inserting at -1 appends to the array. " "the end of the array, such that inserting at -1 appends to the array. "
"Returns the array.") "Returns the array.")
}, },

View File

@ -1567,6 +1567,18 @@ static const JanetReg os_cfuns[] = {
JDOC("(os/shell str)\n\n" JDOC("(os/shell str)\n\n"
"Pass a command string str directly to the system shell.") "Pass a command string str directly to the system shell.")
}, },
{
"os/proc-wait", os_proc_wait,
JDOC("(os/proc-wait proc)\n\n"
"Block until the subprocess completes. Returns the subprocess return code.")
},
{
"os/proc-kill", os_proc_kill,
JDOC("(os/proc-kill proc &opt wait)\n\n"
"Kill a subprocess by sending SIGKILL to it on posix systems, or by closing the process "
"handle on windows. If wait is truthy, will wait for the process to finsih and "
"returns the exit code. Otherwise, returns proc.")
},
#endif #endif
{ {
"os/setenv", os_setenv, "os/setenv", os_setenv,
@ -1652,18 +1664,6 @@ static const JanetReg os_cfuns[] = {
JDOC("(os/perm-int bytes)\n\n" JDOC("(os/perm-int bytes)\n\n"
"Parse a 9 character permission string and return an integer that can be used by chmod.") "Parse a 9 character permission string and return an integer that can be used by chmod.")
}, },
{
"os/proc-wait", os_proc_wait,
JDOC("(os/proc-wait proc)\n\n"
"Block until the subprocess completes. Returns the subprocess return code.")
},
{
"os/proc-kill", os_proc_kill,
JDOC("(os/proc-kill proc &opt wait)\n\n"
"Kill a subprocess by sending SIGKILL to it on posix systems, or by closing the process "
"handle on windows. If wait is truthy, will wait for the process to finsih and "
"returns the exit code. Otherwise, returns proc.")
},
#endif #endif
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };

View File

@ -454,7 +454,7 @@ static const char *janet_pretty_colors[] = {
"\x1B[36m", "\x1B[36m",
"\x1B[36m", "\x1B[36m",
"\x1B[36m", "\x1B[36m",
"\x1B[36m" "\x1B[36m",
"\x1B[35m", "\x1B[35m",
"\x1B[36m", "\x1B[36m",
"\x1B[36m", "\x1B[36m",

View File

@ -680,6 +680,8 @@ int janet_cryptorand(uint8_t *out, size_t n) {
arc4random_buf(out, n); arc4random_buf(out, n);
return 0; return 0;
#else #else
(void) n;
(void) out;
return -1; return -1;
#endif #endif
} }