Skip to content

Commit

Permalink
Implement (os-arch) (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
da-liii authored Aug 4, 2024
1 parent 042c6d4 commit 3f9b335
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions goldfish/liii/os.scm
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@
(define (os-call command)
(g_os-call command))

(define (os-arch)
(g_os-arch))
) ; end of begin
) ; end of define-library
14 changes: 13 additions & 1 deletion src/goldfish.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ glue_scheme_process_context (s7_scheme* sc) {
}

// Glue for (liii os)
static s7_pointer
f_os_arch (s7_scheme* sc, s7_pointer args) {
return s7_make_string (sc, TB_ARCH_STRING);
}

static s7_pointer
f_os_call (s7_scheme* sc, s7_pointer args) {
const char* cmd_c= s7_string (s7_car (args));
Expand Down Expand Up @@ -154,10 +159,17 @@ f_os_call (s7_scheme* sc, s7_pointer args) {

inline void
glue_liii_os (s7_scheme* sc) {
s7_pointer cur_env = s7_curlet (sc);
s7_pointer cur_env= s7_curlet (sc);

const char* s_os_call= "g_os-call";
const char* d_os_call= "(g_os-call string) => int";
s7_define (sc, cur_env, s7_make_symbol (sc, s_os_call),
s7_make_typed_function (sc, s_os_call, f_os_call, 1, 0, false,
d_os_call, NULL));

const char* s_os_arch= "g_os-arch";
const char* d_os_arch= "(g_os-arch) => string";
s7_define (sc, cur_env, s7_make_symbol (sc, s_os_arch),
s7_make_typed_function (sc, s_os_arch, f_os_arch, 0, 0, false,
d_os_arch, NULL));
}

0 comments on commit 3f9b335

Please sign in to comment.