w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

mirb.c File Reference
#include <mruby.h>
#include <mruby/array.h>
#include <mruby/proc.h>
#include <mruby/compile.h>
#include <mruby/dump.h>
#include <mruby/string.h>
#include <mruby/variable.h>
#include <mruby/presym.h>
#include <stdlib.h>
#include <ctype.h>
#include <signal.h>
#include <setjmp.h>
Include dependency graph for mirb.c:

Go to the source code of this file.

Classes

struct  _args
 

Macros

#define MIRB_SIGSETJMP(env)   sigsetjmp(env, 1)
 
#define MIRB_SIGLONGJMP(env, val)   siglongjmp(env, val)
 
#define SIGJMP_BUF   sigjmp_buf
 

Functions

static void p (mrb_state *mrb, mrb_value obj, int prompt)
 
static mrb_bool is_code_block_open (struct mrb_parser_state *parser)
 
static void usage (const char *name)
 
static char * dup_arg_item (mrb_state *mrb, const char *item)
 
static int parse_args (mrb_state *mrb, int argc, char **argv, struct _args *args)
 
static void cleanup (mrb_state *mrb, struct _args *args)
 
static void print_hint (void)
 
static void print_cmdline (int code_block_open)
 
void mrb_codedump_all (mrb_state *, struct RProc *)
 
static int check_keyword (const char *buf, const char *word)
 
void ctrl_c_handler (int signo)
 
void decl_lv_underscore (mrb_state *mrb, mrbc_context *cxt)
 
int main (int argc, char **argv)
 

Variables

volatile sig_atomic_t input_canceled = 0
 

Macro Definition Documentation

◆ MIRB_SIGLONGJMP

#define MIRB_SIGLONGJMP (   env,
  val 
)    siglongjmp(env, val)

Definition at line 68 of file mirb.c.

◆ MIRB_SIGSETJMP

#define MIRB_SIGSETJMP (   env)    sigsetjmp(env, 1)

Definition at line 67 of file mirb.c.

◆ SIGJMP_BUF

#define SIGJMP_BUF   sigjmp_buf

Definition at line 69 of file mirb.c.

Function Documentation

◆ check_keyword()

static int check_keyword ( const char *  buf,
const char *  word 
)
static

Definition at line 385 of file mirb.c.

References buf, ISSPACE, len, p(), strlen(), and strncmp().

Referenced by main().

◆ cleanup()

static void cleanup ( mrb_state mrb,
struct _args args 
)
static

Definition at line 346 of file mirb.c.

References fclose, mrb_close(), and mrb_free().

Referenced by main().

◆ ctrl_c_handler()

void ctrl_c_handler ( int  signo)

Definition at line 411 of file mirb.c.

References input_canceled.

Referenced by main().

◆ decl_lv_underscore()

◆ dup_arg_item()

static char* dup_arg_item ( mrb_state mrb,
const char *  item 
)
static

Definition at line 264 of file mirb.c.

References buf, buflen, item, memcpy, mrb_malloc(), and strlen().

Referenced by parse_args().

◆ is_code_block_open()

static mrb_bool is_code_block_open ( struct mrb_parser_state parser)
static

◆ main()

int main ( int  argc,
char **  argv 
)

© 2016 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html

COPYRIGHT: Copyright (c) 1999-2003, International Business Machines Corporation and others. All Rights Reserved.

© 2016 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html

COPYRIGHT: Copyright (c) 1999-2002, International Business Machines Corporation and others. All Rights Reserved.

Definition at line 445 of file mirb.c.

References abort(), argc, ARGV, argv, mrb_state::c, char_index(), check_keyword(), mrb_context::ci, mrb_context::cibase, cleanup(), ctrl_c_handler(), mrb_parser_state::cxt, REnv::cxt, decl_lv_underscore(), e, mrb_callinfo::env, EOF, mrb_state::exc, EXIT_FAILURE, FALSE, fclose, fgets, FILE, fopen, fputs, getchar(), i, input_canceled, is_code_block_open(), last_char, line, MIRB_SIGSETJMP, mrb_parser_state::mrb, mrb_any_to_s(), mrb_ary_new_capa(), mrb_ary_push(), mrb_bool_value(), mrb_close(), mrb_codedump_all(), mrb_define_global_const, MRB_ENV_LEN, MRB_ENV_SET_LEN, mrb_env_unshare(), mrb_free(), mrb_gc_arena_restore(), mrb_gc_arena_save(), mrb_generate_code(), mrb_gv_set(), mrb_intern_lit, mrb_load_file_cxt(), mrb_locale_free, mrb_locale_from_utf8, mrb_obj_value(), mrb_open(), mrb_parser_free(), mrb_parser_new(), mrb_parser_parse(), mrb_respond_to(), mrb_str_new_cstr(), MRB_SYM, mrb_top_self(), mrb_utf8_free, mrb_utf8_from_locale, mrb_vm_ci_env(), mrb_vm_ci_env_set(), mrb_vm_run(), mrbc_cleanup_local_variables(), mrbc_context_free(), mrbc_context_new(), mrbc_filename(), n, NULL, p(), parse_args(), link_confs::parser, print_cmdline(), print_hint(), printf(), check-static-inits::result, signal(), mrb_callinfo::stack, fc-lang::stdout, strcpy(), strlen(), TRUE, mrb_callinfo::u, and usage().

◆ mrb_codedump_all()

void mrb_codedump_all ( mrb_state mrb,
struct RProc proc 
)

Definition at line 573 of file codedump.c.

References codedump_recur().

Referenced by main().

◆ p()

◆ parse_args()

static int parse_args ( mrb_state mrb,
int  argc,
char **  argv,
struct _args args 
)
static

◆ print_cmdline()

static void print_cmdline ( int  code_block_open)
static

Definition at line 370 of file mirb.c.

References fflush, printf(), and fc-lang::stdout.

Referenced by main().

◆ print_hint()

static void print_hint ( void  )
static

Definition at line 362 of file mirb.c.

References printf().

Referenced by main().

◆ usage()

static void usage ( const char *  name)
static

Definition at line 244 of file mirb.c.

References name, NULL, p(), and printf().

Referenced by main().

Variable Documentation

◆ input_canceled

volatile sig_atomic_t input_canceled = 0

Definition at line 409 of file mirb.c.

Referenced by ctrl_c_handler(), and main().