Merge branch 'master' of sheeple@office.stack-effects.com:factor
commit
1da97fe13e
|
@ -732,6 +732,8 @@ define-builtin
|
|||
{ "set-innermost-frame-quot" "kernel.private" }
|
||||
{ "call-clear" "kernel" }
|
||||
{ "(os-envs)" "system.private" }
|
||||
{ "set-os-env" "system" }
|
||||
{ "unset-os-env" "system" }
|
||||
{ "(set-os-envs)" "system.private" }
|
||||
{ "resize-byte-array" "byte-arrays" }
|
||||
{ "resize-bit-array" "bit-arrays" }
|
||||
|
|
|
@ -587,6 +587,10 @@ set-primitive-effect
|
|||
|
||||
\ (os-envs) { } { array } <effect> set-primitive-effect
|
||||
|
||||
\ set-os-env { string string } { } <effect> set-primitive-effect
|
||||
|
||||
\ unset-os-env { string } { } <effect> set-primitive-effect
|
||||
|
||||
\ (set-os-envs) { array } { } <effect> set-primitive-effect
|
||||
|
||||
\ do-primitive [ \ do-primitive no-effect ] "infer" set-word-prop
|
||||
|
|
|
@ -6,8 +6,7 @@ IN: db.postgresql.ffi
|
|||
|
||||
<< "postgresql" {
|
||||
{ [ os winnt? ] [ "libpq.dll" ] }
|
||||
{ [ os macosx? ] [ "/opt/local/lib/postgresql83/libpq.dylib" ] }
|
||||
! { [ os macosx? ] [ "libpq.dylib" ] }
|
||||
{ [ os macosx? ] [ "libpq.dylib" ] }
|
||||
{ [ os unix? ] [ "libpq.so" ] }
|
||||
} cond "cdecl" add-library >>
|
||||
|
||||
|
|
|
@ -29,6 +29,4 @@ DEFER: fake
|
|||
[ ] [ \ testing define-generic ] unit-test
|
||||
|
||||
[ t ] [ \ testing generic? ] unit-test
|
||||
|
||||
[ t ] [ \ testing "default-multi-method" word-prop method-body? ] unit-test
|
||||
] with-compilation-unit
|
||||
|
|
15
vm/os-unix.c
15
vm/os-unix.c
|
@ -103,6 +103,21 @@ DEFINE_PRIMITIVE(os_envs)
|
|||
dpush(result);
|
||||
}
|
||||
|
||||
DEFINE_PRIMITIVE(set_os_env)
|
||||
{
|
||||
char *key = unbox_char_string();
|
||||
REGISTER_C_STRING(key);
|
||||
char *value = unbox_char_string();
|
||||
UNREGISTER_C_STRING(key);
|
||||
setenv(key, value, 1);
|
||||
}
|
||||
|
||||
DEFINE_PRIMITIVE(unset_os_env)
|
||||
{
|
||||
char *key = unbox_char_string();
|
||||
unsetenv(key);
|
||||
}
|
||||
|
||||
DEFINE_PRIMITIVE(set_os_envs)
|
||||
{
|
||||
F_ARRAY *array = untag_array(dpop());
|
||||
|
|
|
@ -182,6 +182,8 @@ void *primitives[] = {
|
|||
primitive_set_innermost_stack_frame_quot,
|
||||
primitive_call_clear,
|
||||
primitive_os_envs,
|
||||
primitive_set_os_env,
|
||||
primitive_unset_os_env,
|
||||
primitive_set_os_envs,
|
||||
primitive_resize_byte_array,
|
||||
primitive_resize_bit_array,
|
||||
|
|
Loading…
Reference in New Issue