void sexp_exits (sexp ctx, sexp self, sexp_sint_t n, sexp msg) { exits(sexp_string_data(sexp_stringp(msg) ? msg : sexp_write_to_string(ctx, msg))); }
sexp sexp_9p_respond (sexp ctx, sexp self, sexp_sint_t n, sexp req, sexp err) { char *cerr = sexp_stringp(err) ? sexp_string_data(err) : nil; respond(sexp_cpointer_value(req), cerr); return SEXP_VOID; }
static sexp sexp_setenv (sexp ctx, sexp self, sexp_sint_t n, sexp name, sexp value) { sexp_assert_type(ctx, sexp_stringp, SEXP_STRING, name); sexp_assert_type(ctx, sexp_stringp, SEXP_STRING, value); return sexp_make_boolean(setenv(sexp_string_data(name), sexp_string_data(value), 1)); }
static sexp sexp_unsetenv (sexp ctx, sexp self, sexp_sint_t n, sexp name) { sexp_assert_type(ctx, sexp_stringp, SEXP_STRING, name); return sexp_make_boolean(unsetenv(sexp_string_data(name))); }
sexp sexp_string_to_utf8 (sexp ctx, sexp self, sexp str) { sexp res; sexp_assert_type(ctx, sexp_stringp, SEXP_STRING, str); res = sexp_c_string(ctx, sexp_string_data(str), sexp_string_size(str)); return sexp_string_to_bytes(ctx, res); }