summaryrefslogtreecommitdiffstatshomepage
path: root/unix
diff options
context:
space:
mode:
Diffstat (limited to 'unix')
-rw-r--r--unix/ffi.c16
-rw-r--r--unix/file.c6
-rw-r--r--unix/main.c28
-rw-r--r--unix/socket.c18
-rw-r--r--unix/time.c6
5 files changed, 37 insertions, 37 deletions
diff --git a/unix/ffi.c b/unix/ffi.c
index 9a4c03572f..71fb0b66ab 100644
--- a/unix/ffi.c
+++ b/unix/ffi.c
@@ -128,10 +128,10 @@ STATIC mp_obj_t ffimod_func(uint n_args, const mp_obj_t *args) {
o->func = sym;
o->rettype = *rettype;
- mp_obj_t iterable = rt_getiter(args[3]);
+ mp_obj_t iterable = mp_getiter(args[3]);
mp_obj_t item;
int i = 0;
- while ((item = rt_iternext(iterable)) != MP_OBJ_NULL) {
+ while ((item = mp_iternext(iterable)) != MP_OBJ_NULL) {
o->params[i++] = get_ffi_type(item);
}
@@ -149,7 +149,7 @@ STATIC void call_py_func(ffi_cif *cif, void *ret, void** args, mp_obj_t func) {
for (int i = 0; i < cif->nargs; i++) {
pyargs[i] = mp_obj_new_int(*(int*)args[i]);
}
- mp_obj_t res = rt_call_function_n_kw(func, cif->nargs, 0, pyargs);
+ mp_obj_t res = mp_call_function_n_kw(func, cif->nargs, 0, pyargs);
*(ffi_arg*)ret = mp_obj_int_get(res);
}
@@ -165,10 +165,10 @@ STATIC mp_obj_t mod_ffi_callback(mp_obj_t rettype_in, mp_obj_t func_in, mp_obj_t
o->rettype = *rettype;
- mp_obj_t iterable = rt_getiter(paramtypes_in);
+ mp_obj_t iterable = mp_getiter(paramtypes_in);
mp_obj_t item;
int i = 0;
- while ((item = rt_iternext(iterable)) != MP_OBJ_NULL) {
+ while ((item = mp_iternext(iterable)) != MP_OBJ_NULL) {
o->params[i++] = get_ffi_type(item);
}
@@ -348,8 +348,8 @@ MP_DEFINE_CONST_FUN_OBJ_2(mod_ffi_as_bytearray_obj, mod_ffi_as_bytearray);
void ffi_init() {
mp_obj_t m = mp_obj_new_module(QSTR_FROM_STR_STATIC("ffi"));
- rt_store_attr(m, MP_QSTR_open, (mp_obj_t)&mod_ffi_open_obj);
- rt_store_attr(m, QSTR_FROM_STR_STATIC("callback"), (mp_obj_t)&mod_ffi_callback_obj);
+ mp_store_attr(m, MP_QSTR_open, (mp_obj_t)&mod_ffi_open_obj);
+ mp_store_attr(m, QSTR_FROM_STR_STATIC("callback"), (mp_obj_t)&mod_ffi_callback_obj);
// there would be as_bytes, but bytes currently is value, not reference type!
- rt_store_attr(m, QSTR_FROM_STR_STATIC("as_bytearray"), (mp_obj_t)&mod_ffi_as_bytearray_obj);
+ mp_store_attr(m, QSTR_FROM_STR_STATIC("as_bytearray"), (mp_obj_t)&mod_ffi_as_bytearray_obj);
}
diff --git a/unix/file.c b/unix/file.c
index f037b6f7ea..948ec44051 100644
--- a/unix/file.c
+++ b/unix/file.c
@@ -140,7 +140,7 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_open_obj, 1, 2, mp_builtin_open);
void file_init() {
mp_obj_t m_sys = mp_obj_new_module(MP_QSTR_sys);
- rt_store_attr(m_sys, MP_QSTR_stdin, fdfile_new(STDIN_FILENO));
- rt_store_attr(m_sys, MP_QSTR_stdout, fdfile_new(STDOUT_FILENO));
- rt_store_attr(m_sys, MP_QSTR_stderr, fdfile_new(STDERR_FILENO));
+ mp_store_attr(m_sys, MP_QSTR_stdin, fdfile_new(STDIN_FILENO));
+ mp_store_attr(m_sys, MP_QSTR_stdout, fdfile_new(STDOUT_FILENO));
+ mp_store_attr(m_sys, MP_QSTR_stderr, fdfile_new(STDERR_FILENO));
}
diff --git a/unix/main.c b/unix/main.c
index 6b25988759..ffbdbb7e79 100644
--- a/unix/main.c
+++ b/unix/main.c
@@ -85,7 +85,7 @@ static void execute_from_lexer(mp_lexer_t *lex, mp_parse_input_kind_t input_kind
// execute it
nlr_buf_t nlr;
if (nlr_push(&nlr) == 0) {
- rt_call_function_0(module_fun);
+ mp_call_function_0(module_fun);
nlr_pop();
} else {
// uncaught exception
@@ -278,7 +278,7 @@ int main(int argc, char **argv) {
#endif
qstr_init();
- rt_init();
+ mp_init();
char *home = getenv("HOME");
char *path = getenv("MICROPYPATH");
@@ -292,9 +292,9 @@ int main(int argc, char **argv) {
p++;
}
}
- sys_path = mp_obj_new_list(path_num, NULL);
+ mp_sys_path = mp_obj_new_list(path_num, NULL);
mp_obj_t *path_items;
- mp_obj_list_get(sys_path, &path_num, &path_items);
+ mp_obj_list_get(mp_sys_path, &path_num, &path_items);
path_items[0] = MP_OBJ_NEW_QSTR(MP_QSTR_);
char *p = path;
for (int i = 1; i < path_num; i++) {
@@ -315,15 +315,15 @@ int main(int argc, char **argv) {
}
mp_obj_t m_sys = mp_obj_new_module(MP_QSTR_sys);
- rt_store_attr(m_sys, MP_QSTR_path, sys_path);
+ mp_store_attr(m_sys, MP_QSTR_path, mp_sys_path);
mp_obj_t py_argv = mp_obj_new_list(0, NULL);
- rt_store_attr(m_sys, MP_QSTR_argv, py_argv);
+ mp_store_attr(m_sys, MP_QSTR_argv, py_argv);
- rt_store_name(qstr_from_str("test"), test_obj_new(42));
- rt_store_name(qstr_from_str("mem_info"), rt_make_function_n(0, mem_info));
- rt_store_name(qstr_from_str("qstr_info"), rt_make_function_n(0, qstr_info));
+ mp_store_name(qstr_from_str("test"), test_obj_new(42));
+ mp_store_name(qstr_from_str("mem_info"), mp_make_function_n(0, mem_info));
+ mp_store_name(qstr_from_str("qstr_info"), mp_make_function_n(0, qstr_info));
#if MICROPY_ENABLE_GC
- rt_store_name(qstr_from_str("gc"), (mp_obj_t)&pyb_gc_obj);
+ mp_store_name(qstr_from_str("gc"), (mp_obj_t)&pyb_gc_obj);
#endif
file_init();
@@ -344,8 +344,8 @@ int main(int argc, char **argv) {
// test_obj.attr = 42
mp_obj_t test_class_type, test_class_instance;
test_class_type = mp_obj_new_type(QSTR_FROM_STR_STATIC("TestClass"), mp_const_empty_tuple, mp_obj_new_dict(0));
- rt_store_name(QSTR_FROM_STR_STATIC("test_obj"), test_class_instance = rt_call_function_0(test_class_type));
- rt_store_attr(test_class_instance, QSTR_FROM_STR_STATIC("attr"), mp_obj_new_int(42));
+ mp_store_name(QSTR_FROM_STR_STATIC("test_obj"), test_class_instance = mp_call_function_0(test_class_type));
+ mp_store_attr(test_class_instance, QSTR_FROM_STR_STATIC("attr"), mp_obj_new_int(42));
/*
printf("bytes:\n");
@@ -378,7 +378,7 @@ int main(int argc, char **argv) {
free(basedir);
}
for (int i = a; i < argc; i++) {
- rt_list_append(py_argv, MP_OBJ_NEW_QSTR(qstr_from_str(argv[i])));
+ mp_list_append(py_argv, MP_OBJ_NEW_QSTR(qstr_from_str(argv[i])));
}
do_file(argv[a]);
executed = true;
@@ -390,7 +390,7 @@ int main(int argc, char **argv) {
do_repl();
}
- rt_deinit();
+ mp_deinit();
//printf("total bytes = %d\n", m_get_total_bytes_allocated());
return 0;
diff --git a/unix/socket.c b/unix/socket.c
index 04c1d10c73..ee74ea0845 100644
--- a/unix/socket.c
+++ b/unix/socket.c
@@ -314,7 +314,7 @@ static mp_obj_t mod_socket_getaddrinfo(uint n_args, const mp_obj_t *args) {
}
assert(addr);
- mp_obj_t list = rt_build_list(0, NULL);
+ mp_obj_t list = mp_build_list(0, NULL);
for (; addr; addr = addr->ai_next) {
mp_obj_tuple_t *t = mp_obj_new_tuple(5, NULL);
t->items[0] = MP_OBJ_NEW_SMALL_INT((machine_int_t)addr->ai_family);
@@ -328,7 +328,7 @@ static mp_obj_t mod_socket_getaddrinfo(uint n_args, const mp_obj_t *args) {
t->items[3] = mp_const_none;
}
t->items[4] = mp_obj_new_bytearray(addr->ai_addrlen, addr->ai_addr);
- rt_list_append(list, t);
+ mp_list_append(list, t);
}
return list;
}
@@ -366,15 +366,15 @@ static const struct sym_entry {
void microsocket_init() {
mp_obj_t m = mp_obj_new_module(MP_QSTR_microsocket);
- rt_store_attr(m, MP_QSTR_socket, (mp_obj_t)&microsocket_type);
+ mp_store_attr(m, MP_QSTR_socket, (mp_obj_t)&microsocket_type);
#if MICROPY_SOCKET_EXTRA
- rt_store_attr(m, MP_QSTR_sockaddr_in, (mp_obj_t)&sockaddr_in_type);
- rt_store_attr(m, MP_QSTR_htons, (mp_obj_t)&mod_socket_htons_obj);
- rt_store_attr(m, MP_QSTR_inet_aton, (mp_obj_t)&mod_socket_inet_aton_obj);
- rt_store_attr(m, MP_QSTR_gethostbyname, (mp_obj_t)&mod_socket_gethostbyname_obj);
+ mp_store_attr(m, MP_QSTR_sockaddr_in, (mp_obj_t)&sockaddr_in_type);
+ mp_store_attr(m, MP_QSTR_htons, (mp_obj_t)&mod_socket_htons_obj);
+ mp_store_attr(m, MP_QSTR_inet_aton, (mp_obj_t)&mod_socket_inet_aton_obj);
+ mp_store_attr(m, MP_QSTR_gethostbyname, (mp_obj_t)&mod_socket_gethostbyname_obj);
#endif
- rt_store_attr(m, MP_QSTR_getaddrinfo, (mp_obj_t)&mod_socket_getaddrinfo_obj);
+ mp_store_attr(m, MP_QSTR_getaddrinfo, (mp_obj_t)&mod_socket_getaddrinfo_obj);
for (const struct sym_entry *p = constants; p->sym != NULL; p++) {
- rt_store_attr(m, QSTR_FROM_STR_STATIC(p->sym), MP_OBJ_NEW_SMALL_INT((machine_int_t)p->val));
+ mp_store_attr(m, QSTR_FROM_STR_STATIC(p->sym), MP_OBJ_NEW_SMALL_INT((machine_int_t)p->val));
}
}
diff --git a/unix/time.c b/unix/time.c
index 7d25b3dd56..fb52133580 100644
--- a/unix/time.c
+++ b/unix/time.c
@@ -43,7 +43,7 @@ static MP_DEFINE_CONST_FUN_OBJ_1(mod_time_sleep_obj, mod_time_sleep);
void time_init() {
mp_obj_t m = mp_obj_new_module(QSTR_FROM_STR_STATIC("time"));
- rt_store_attr(m, QSTR_FROM_STR_STATIC("time"), (mp_obj_t)&mod_time_time_obj);
- rt_store_attr(m, QSTR_FROM_STR_STATIC("clock"), (mp_obj_t)&mod_time_clock_obj);
- rt_store_attr(m, QSTR_FROM_STR_STATIC("sleep"), (mp_obj_t)&mod_time_sleep_obj);
+ mp_store_attr(m, QSTR_FROM_STR_STATIC("time"), (mp_obj_t)&mod_time_time_obj);
+ mp_store_attr(m, QSTR_FROM_STR_STATIC("clock"), (mp_obj_t)&mod_time_clock_obj);
+ mp_store_attr(m, QSTR_FROM_STR_STATIC("sleep"), (mp_obj_t)&mod_time_sleep_obj);
}