示例#1
0
文件: exec.c 项目: cbforks/streem
static void
node_init(strm_state* state)
{
  strm_var_def(state, "stdin", strm_io_new(0, STRM_IO_READ));
  strm_var_def(state, "stdout", strm_io_new(1, STRM_IO_WRITE));
  strm_var_def(state, "stderr", strm_io_new(2, STRM_IO_WRITE));
  strm_var_def(state, "puts", strm_cfunc_value(exec_puts));
  strm_var_def(state, "+", strm_cfunc_value(exec_plus));
  strm_var_def(state, "-", strm_cfunc_value(exec_minus));
  strm_var_def(state, "*", strm_cfunc_value(exec_mult));
  strm_var_def(state, "/", strm_cfunc_value(exec_div));
  strm_var_def(state, "<", strm_cfunc_value(exec_lt));
  strm_var_def(state, "<=", strm_cfunc_value(exec_le));
  strm_var_def(state, ">", strm_cfunc_value(exec_gt));
  strm_var_def(state, ">=", strm_cfunc_value(exec_ge));
  strm_var_def(state, "==", strm_cfunc_value(exec_eq));
  strm_var_def(state, "!=", strm_cfunc_value(exec_neq));
  strm_var_def(state, "|", strm_cfunc_value(exec_bar));
  strm_var_def(state, "%", strm_cfunc_value(exec_mod));
  strm_var_def(state, "fread", strm_cfunc_value(exec_fread));
  strm_var_def(state, "fwrite", strm_cfunc_value(exec_fwrite));

  strm_array_init(state);
  strm_string_init(state);
  strm_iter_init(state);
  strm_socket_init(state);
  strm_csv_init(state);
  strm_kvs_init(state);
}
示例#2
0
void
strm_init(strm_state* state)
{
  strm_array_init(state);
  strm_string_init(state);
  strm_latch_init(state);
  strm_iter_init(state);
  strm_socket_init(state);
  strm_csv_init(state);
  strm_kvs_init(state);
  strm_time_init(state);
}