Numworks Epsilon  1.4.1
Graphing Calculator Operating System
runtime.h File Reference
#include "py/mpstate.h"

Go to the source code of this file.

Classes

union  _mp_arg_val_t
 
struct  _mp_arg_t
 
struct  _mp_call_args_t
 

Macros

#define mp_check_self(pred)   assert(pred)
 
#define mp_sys_path   (MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_sys_path_obj)))
 
#define mp_sys_argv   (MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_sys_argv_obj)))
 
#define mp_warning(...)
 

Typedefs

typedef union _mp_arg_val_t mp_arg_val_t
 
typedef struct _mp_arg_t mp_arg_t
 
typedef struct _mp_call_args_t mp_call_args_t
 

Enumerations

enum  mp_vm_return_kind_t { MP_VM_RETURN_NORMAL, MP_VM_RETURN_YIELD, MP_VM_RETURN_EXCEPTION }
 
enum  mp_arg_flag_t {
  MP_ARG_BOOL = 0x001, MP_ARG_INT = 0x002, MP_ARG_OBJ = 0x003, MP_ARG_KIND_MASK = 0x0ff,
  MP_ARG_REQUIRED = 0x100, MP_ARG_KW_ONLY = 0x200
}
 

Functions

void mp_init (void)
 
void mp_deinit (void)
 
void mp_handle_pending (void)
 
void mp_handle_pending_tail (mp_uint_t atomic_state)
 
int mp_print_mp_int (const mp_print_t *print, mp_obj_t x, int base, int base_char, int flags, char fill, int width, int prec)
 
void mp_arg_check_num (size_t n_args, size_t n_kw, size_t n_args_min, size_t n_args_max, bool takes_kw)
 
void mp_arg_parse_all (size_t n_pos, const mp_obj_t *pos, mp_map_t *kws, size_t n_allowed, const mp_arg_t *allowed, mp_arg_val_t *out_vals)
 
void mp_arg_parse_all_kw_array (size_t n_pos, size_t n_kw, const mp_obj_t *args, size_t n_allowed, const mp_arg_t *allowed, mp_arg_val_t *out_vals)
 
NORETURN void mp_arg_error_terse_mismatch (void)
 
NORETURN void mp_arg_error_unimpl_kw (void)
 
mp_obj_t mp_load_name (qstr qst)
 
mp_obj_t mp_load_global (qstr qst)
 
mp_obj_t mp_load_build_class (void)
 
void mp_store_name (qstr qst, mp_obj_t obj)
 
void mp_store_global (qstr qst, mp_obj_t obj)
 
void mp_delete_name (qstr qst)
 
void mp_delete_global (qstr qst)
 
mp_obj_t mp_unary_op (mp_unary_op_t op, mp_obj_t arg)
 
mp_obj_t mp_binary_op (mp_binary_op_t op, mp_obj_t lhs, mp_obj_t rhs)
 
mp_obj_t mp_call_function_0 (mp_obj_t fun)
 
mp_obj_t mp_call_function_1 (mp_obj_t fun, mp_obj_t arg)
 
mp_obj_t mp_call_function_2 (mp_obj_t fun, mp_obj_t arg1, mp_obj_t arg2)
 
mp_obj_t mp_call_function_n_kw (mp_obj_t fun, size_t n_args, size_t n_kw, const mp_obj_t *args)
 
mp_obj_t mp_call_method_n_kw (size_t n_args, size_t n_kw, const mp_obj_t *args)
 
mp_obj_t mp_call_method_n_kw_var (bool have_self, size_t n_args_n_kw, const mp_obj_t *args)
 
mp_obj_t mp_call_method_self_n_kw (mp_obj_t meth, mp_obj_t self, size_t n_args, size_t n_kw, const mp_obj_t *args)
 
void mp_call_function_1_protected (mp_obj_t fun, mp_obj_t arg)
 
void mp_call_function_2_protected (mp_obj_t fun, mp_obj_t arg1, mp_obj_t arg2)
 
void mp_unpack_sequence (mp_obj_t seq, size_t num, mp_obj_t *items)
 
void mp_unpack_ex (mp_obj_t seq, size_t num, mp_obj_t *items)
 
mp_obj_t mp_store_map (mp_obj_t map, mp_obj_t key, mp_obj_t value)
 
mp_obj_t mp_load_attr (mp_obj_t base, qstr attr)
 
void mp_convert_member_lookup (mp_obj_t obj, const mp_obj_type_t *type, mp_obj_t member, mp_obj_t *dest)
 
void mp_load_method (mp_obj_t base, qstr attr, mp_obj_t *dest)
 
void mp_load_method_maybe (mp_obj_t base, qstr attr, mp_obj_t *dest)
 
void mp_load_super_method (qstr attr, mp_obj_t *dest)
 
void mp_store_attr (mp_obj_t base, qstr attr, mp_obj_t val)
 
mp_obj_t mp_getiter (mp_obj_t o, mp_obj_iter_buf_t *iter_buf)
 
mp_obj_t mp_iternext_allow_raise (mp_obj_t o)
 
mp_obj_t mp_iternext (mp_obj_t o)
 
mp_vm_return_kind_t mp_resume (mp_obj_t self_in, mp_obj_t send_value, mp_obj_t throw_value, mp_obj_t *ret_val)
 
mp_obj_t mp_make_raise_obj (mp_obj_t o)
 
mp_obj_t mp_import_name (qstr name, mp_obj_t fromlist, mp_obj_t level)
 
mp_obj_t mp_import_from (mp_obj_t module, qstr name)
 
void mp_import_all (mp_obj_t module)
 
NORETURN void mp_raise_msg (const mp_obj_type_t *exc_type, const char *msg)
 
NORETURN void mp_raise_ValueError (const char *msg)
 
NORETURN void mp_raise_TypeError (const char *msg)
 
NORETURN void mp_raise_NotImplementedError (const char *msg)
 
NORETURN void mp_raise_OSError (int errno_)
 
NORETURN void mp_exc_recursion_depth (void)
 
mp_uint_t mp_convert_obj_to_native (mp_obj_t obj, mp_uint_t type)
 
mp_obj_t mp_convert_native_to_obj (mp_uint_t val, mp_uint_t type)
 
mp_obj_t mp_native_call_function_n_kw (mp_obj_t fun_in, size_t n_args_kw, const mp_obj_t *args)
 
void mp_native_raise (mp_obj_t o)
 

Variables

const byte mp_unary_op_method_name []
 
const byte mp_binary_op_method_name []
 

Macro Definition Documentation

◆ mp_check_self

#define mp_check_self (   pred)    assert(pred)

Definition at line 161 of file runtime.h.

◆ mp_sys_argv

#define mp_sys_argv   (MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_sys_argv_obj)))

Definition at line 172 of file runtime.h.

◆ mp_sys_path

#define mp_sys_path   (MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_sys_path_obj)))

Definition at line 171 of file runtime.h.

◆ mp_warning

#define mp_warning (   ...)

Definition at line 177 of file runtime.h.

Typedef Documentation

◆ mp_arg_t

typedef struct _mp_arg_t mp_arg_t

◆ mp_arg_val_t

typedef union _mp_arg_val_t mp_arg_val_t

◆ mp_call_args_t

Enumeration Type Documentation

◆ mp_arg_flag_t

Enumerator
MP_ARG_BOOL 
MP_ARG_INT 
MP_ARG_OBJ 
MP_ARG_KIND_MASK 
MP_ARG_REQUIRED 
MP_ARG_KW_ONLY 

Definition at line 37 of file runtime.h.

◆ mp_vm_return_kind_t

Enumerator
MP_VM_RETURN_NORMAL 
MP_VM_RETURN_YIELD 
MP_VM_RETURN_EXCEPTION 

Definition at line 31 of file runtime.h.

Function Documentation

◆ mp_arg_check_num()

void mp_arg_check_num ( size_t  n_args,
size_t  n_kw,
size_t  n_args_min,
size_t  n_args_max,
bool  takes_kw 
)

Definition at line 32 of file argcheck.c.

◆ mp_arg_error_terse_mismatch()

NORETURN void mp_arg_error_terse_mismatch ( void  )

Definition at line 136 of file argcheck.c.

◆ mp_arg_error_unimpl_kw()

NORETURN void mp_arg_error_unimpl_kw ( void  )

◆ mp_arg_parse_all()

void mp_arg_parse_all ( size_t  n_pos,
const mp_obj_t pos,
mp_map_t kws,
size_t  n_allowed,
const mp_arg_t allowed,
mp_arg_val_t out_vals 
)

Definition at line 74 of file argcheck.c.

◆ mp_arg_parse_all_kw_array()

void mp_arg_parse_all_kw_array ( size_t  n_pos,
size_t  n_kw,
const mp_obj_t args,
size_t  n_allowed,
const mp_arg_t allowed,
mp_arg_val_t out_vals 
)

Definition at line 130 of file argcheck.c.

◆ mp_binary_op()

mp_obj_t mp_binary_op ( mp_binary_op_t  op,
mp_obj_t  lhs,
mp_obj_t  rhs 
)

Definition at line 277 of file runtime.c.

◆ mp_call_function_0()

mp_obj_t mp_call_function_0 ( mp_obj_t  fun)

Definition at line 599 of file runtime.c.

◆ mp_call_function_1()

mp_obj_t mp_call_function_1 ( mp_obj_t  fun,
mp_obj_t  arg 
)

Definition at line 603 of file runtime.c.

◆ mp_call_function_1_protected()

void mp_call_function_1_protected ( mp_obj_t  fun,
mp_obj_t  arg 
)

Definition at line 30 of file runtime_utils.c.

◆ mp_call_function_2()

mp_obj_t mp_call_function_2 ( mp_obj_t  fun,
mp_obj_t  arg1,
mp_obj_t  arg2 
)

Definition at line 607 of file runtime.c.

◆ mp_call_function_2_protected()

void mp_call_function_2_protected ( mp_obj_t  fun,
mp_obj_t  arg1,
mp_obj_t  arg2 
)

Definition at line 40 of file runtime_utils.c.

◆ mp_call_function_n_kw()

mp_obj_t mp_call_function_n_kw ( mp_obj_t  fun,
size_t  n_args,
size_t  n_kw,
const mp_obj_t args 
)

Definition at line 615 of file runtime.c.

◆ mp_call_method_n_kw()

mp_obj_t mp_call_method_n_kw ( size_t  n_args,
size_t  n_kw,
const mp_obj_t args 
)

Definition at line 639 of file runtime.c.

◆ mp_call_method_n_kw_var()

mp_obj_t mp_call_method_n_kw_var ( bool  have_self,
size_t  n_args_n_kw,
const mp_obj_t args 
)

Definition at line 816 of file runtime.c.

◆ mp_call_method_self_n_kw()

mp_obj_t mp_call_method_self_n_kw ( mp_obj_t  meth,
mp_obj_t  self,
size_t  n_args,
size_t  n_kw,
const mp_obj_t args 
)

Definition at line 50 of file objboundmeth.c.

◆ mp_convert_member_lookup()

void mp_convert_member_lookup ( mp_obj_t  obj,
const mp_obj_type_t type,
mp_obj_t  member,
mp_obj_t dest 
)

Definition at line 992 of file runtime.c.

◆ mp_convert_native_to_obj()

mp_obj_t mp_convert_native_to_obj ( mp_uint_t  val,
mp_uint_t  type 
)

◆ mp_convert_obj_to_native()

mp_uint_t mp_convert_obj_to_native ( mp_obj_t  obj,
mp_uint_t  type 
)

◆ mp_deinit()

void mp_deinit ( void  )

Definition at line 130 of file runtime.c.

◆ mp_delete_global()

void mp_delete_global ( qstr  qst)

Definition at line 210 of file runtime.c.

◆ mp_delete_name()

void mp_delete_name ( qstr  qst)

Definition at line 199 of file runtime.c.

◆ mp_exc_recursion_depth()

NORETURN void mp_exc_recursion_depth ( void  )

◆ mp_getiter()

mp_obj_t mp_getiter ( mp_obj_t  o,
mp_obj_iter_buf_t iter_buf 
)

Definition at line 1120 of file runtime.c.

◆ mp_handle_pending()

void mp_handle_pending ( void  )

Definition at line 109 of file scheduler.c.

◆ mp_handle_pending_tail()

void mp_handle_pending_tail ( mp_uint_t  atomic_state)

◆ mp_import_all()

void mp_import_all ( mp_obj_t  module)

Definition at line 1380 of file runtime.c.

◆ mp_import_from()

mp_obj_t mp_import_from ( mp_obj_t  module,
qstr  name 
)

Definition at line 1336 of file runtime.c.

◆ mp_import_name()

mp_obj_t mp_import_name ( qstr  name,
mp_obj_t  fromlist,
mp_obj_t  level 
)

Definition at line 1321 of file runtime.c.

◆ mp_init()

void mp_init ( void  )

Definition at line 58 of file runtime.c.

◆ mp_iternext()

mp_obj_t mp_iternext ( mp_obj_t  o)

Definition at line 1186 of file runtime.c.

◆ mp_iternext_allow_raise()

mp_obj_t mp_iternext_allow_raise ( mp_obj_t  o)

Definition at line 1162 of file runtime.c.

◆ mp_load_attr()

mp_obj_t mp_load_attr ( mp_obj_t  base,
qstr  attr 
)

Definition at line 930 of file runtime.c.

◆ mp_load_build_class()

mp_obj_t mp_load_build_class ( void  )

Definition at line 180 of file runtime.c.

◆ mp_load_global()

mp_obj_t mp_load_global ( qstr  qst)

Definition at line 153 of file runtime.c.

◆ mp_load_method()

void mp_load_method ( mp_obj_t  base,
qstr  attr,
mp_obj_t dest 
)

Definition at line 1076 of file runtime.c.

◆ mp_load_method_maybe()

void mp_load_method_maybe ( mp_obj_t  base,
qstr  attr,
mp_obj_t dest 
)

Definition at line 1040 of file runtime.c.

◆ mp_load_name()

mp_obj_t mp_load_name ( qstr  qst)

Definition at line 140 of file runtime.c.

◆ mp_load_super_method()

void mp_load_super_method ( qstr  attr,
mp_obj_t dest 
)

Definition at line 1133 of file objtype.c.

◆ mp_make_raise_obj()

mp_obj_t mp_make_raise_obj ( mp_obj_t  o)

Definition at line 1304 of file runtime.c.

◆ mp_native_call_function_n_kw()

mp_obj_t mp_native_call_function_n_kw ( mp_obj_t  fun_in,
size_t  n_args_kw,
const mp_obj_t args 
)

◆ mp_native_raise()

void mp_native_raise ( mp_obj_t  o)

◆ mp_print_mp_int()

int mp_print_mp_int ( const mp_print_t print,
mp_obj_t  x,
int  base,
int  base_char,
int  flags,
char  fill,
int  width,
int  prec 
)

Definition at line 204 of file mpprint.c.

◆ mp_raise_msg()

NORETURN void mp_raise_msg ( const mp_obj_type_t exc_type,
const char *  msg 
)

Definition at line 1448 of file runtime.c.

◆ mp_raise_NotImplementedError()

NORETURN void mp_raise_NotImplementedError ( const char *  msg)

Definition at line 1468 of file runtime.c.

◆ mp_raise_OSError()

NORETURN void mp_raise_OSError ( int  errno_)

Definition at line 1464 of file runtime.c.

◆ mp_raise_TypeError()

NORETURN void mp_raise_TypeError ( const char *  msg)

Definition at line 1460 of file runtime.c.

◆ mp_raise_ValueError()

NORETURN void mp_raise_ValueError ( const char *  msg)

Definition at line 1456 of file runtime.c.

◆ mp_resume()

mp_vm_return_kind_t mp_resume ( mp_obj_t  self_in,
mp_obj_t  send_value,
mp_obj_t  throw_value,
mp_obj_t ret_val 
)

Definition at line 1221 of file runtime.c.

◆ mp_store_attr()

void mp_store_attr ( mp_obj_t  base,
qstr  attr,
mp_obj_t  val 
)

Definition at line 1100 of file runtime.c.

◆ mp_store_global()

void mp_store_global ( qstr  qst,
mp_obj_t  obj 
)

Definition at line 205 of file runtime.c.

◆ mp_store_map()

mp_obj_t mp_store_map ( mp_obj_t  map,
mp_obj_t  key,
mp_obj_t  value 
)

◆ mp_store_name()

void mp_store_name ( qstr  qst,
mp_obj_t  obj 
)

Definition at line 194 of file runtime.c.

◆ mp_unary_op()

mp_obj_t mp_unary_op ( mp_unary_op_t  op,
mp_obj_t  arg 
)

Definition at line 216 of file runtime.c.

◆ mp_unpack_ex()

void mp_unpack_ex ( mp_obj_t  seq,
size_t  num,
mp_obj_t items 
)

Definition at line 874 of file runtime.c.

◆ mp_unpack_sequence()

void mp_unpack_sequence ( mp_obj_t  seq,
size_t  num,
mp_obj_t items 
)

Definition at line 827 of file runtime.c.

Variable Documentation

◆ mp_binary_op_method_name

const byte mp_binary_op_method_name[]

Definition at line 416 of file objtype.c.

◆ mp_unary_op_method_name

const byte mp_unary_op_method_name[]

Definition at line 337 of file objtype.c.