diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-11-01 19:16:32 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-11-01 19:16:32 +0100 |
commit | a0512eaf305d54661adec6893154161e5be01b2e (patch) | |
tree | 4485be9339b6d3c548affacf08bec6fc961c3535 | |
parent | dcb6ffdb2acab40702bc3519f74617d7846b5625 (diff) |
treewide: fix typo in exported function names and types
Fix instances of misspelled "resource".
This commit breaks the exported libucode ABI.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | include/ucode/lib.h | 10 | ||||
-rw-r--r-- | include/ucode/types.h | 18 | ||||
-rw-r--r-- | lib/fs.c | 14 | ||||
-rw-r--r-- | lib/struct.c | 4 | ||||
-rw-r--r-- | lib/ubus.c | 4 | ||||
-rw-r--r-- | lib/uci.c | 4 | ||||
-rw-r--r-- | types.c | 38 | ||||
-rw-r--r-- | vm.c | 6 |
8 files changed, 49 insertions, 49 deletions
diff --git a/include/ucode/lib.h b/include/ucode/lib.h index 1f30cba..a033dfd 100644 --- a/include/ucode/lib.h +++ b/include/ucode/lib.h @@ -39,7 +39,7 @@ bool uc_error_context_format(uc_stringbuf_t *buf, uc_source_t *src, uc_value_t * static inline void * _uc_fn_this(uc_vm_t *vm, const char *expected_type) { - return ucv_ressource_dataptr(vm->callframes.entries[vm->callframes.count - 1].ctx, expected_type); + return ucv_resource_dataptr(vm->callframes.entries[vm->callframes.count - 1].ctx, expected_type); } #define uc_fn_this(...) _uc_fn_this(vm, __VA_ARGS__) @@ -63,12 +63,12 @@ _uc_fn_arg(uc_vm_t *vm, size_t nargs, size_t n) /* ressource type helper */ static inline uc_value_t * -uc_ressource_new(uc_ressource_type_t *type, void *data) +uc_resource_new(uc_resource_type_t *type, void *data) { - return ucv_ressource_new(type, data); + return ucv_resource_new(type, data); } -static inline uc_ressource_type_t * +static inline uc_resource_type_t * _uc_type_declare(uc_vm_t *vm, const char *name, const uc_function_list_t *list, size_t len, void (*freefn)(void *)) { uc_value_t *proto = ucv_object_new(NULL); @@ -77,7 +77,7 @@ _uc_type_declare(uc_vm_t *vm, const char *name, const uc_function_list_t *list, ucv_object_add(proto, list[len].name, ucv_cfunction_new(list[len].name, list[len].func)); - return ucv_ressource_type_add(vm, name, proto, freefn); + return ucv_resource_type_add(vm, name, proto, freefn); } #define uc_type_declare(vm, name, functions, freefn) \ diff --git a/include/ucode/types.h b/include/ucode/types.h index 7473f22..ac7376b 100644 --- a/include/ucode/types.h +++ b/include/ucode/types.h @@ -188,15 +188,15 @@ typedef struct { const char *name; uc_value_t *proto; void (*free)(void *); -} uc_ressource_type_t; +} uc_resource_type_t; typedef struct { uc_value_t header; - uc_ressource_type_t *type; + uc_resource_type_t *type; void *data; -} uc_ressource_t; +} uc_resource_t; -uc_declare_vector(uc_ressource_types_t, uc_ressource_type_t *); +uc_declare_vector(uc_resource_types_t, uc_resource_type_t *); /* Parser definitions */ @@ -252,7 +252,7 @@ struct uc_vm { uc_value_t *globals; uc_source_t *sources; uc_weakref_t values; - uc_ressource_types_t restypes; + uc_resource_types_t restypes; union { uint32_t u32; int32_t s32; @@ -344,11 +344,11 @@ uc_value_t *ucv_cfunction_new(const char *, uc_cfn_ptr_t); uc_value_t *ucv_closure_new(uc_vm_t *, uc_function_t *, bool); -uc_ressource_type_t *ucv_ressource_type_add(uc_vm_t *, const char *, uc_value_t *, void (*)(void *)); -uc_ressource_type_t *ucv_ressource_type_lookup(uc_vm_t *, const char *); +uc_resource_type_t *ucv_resource_type_add(uc_vm_t *, const char *, uc_value_t *, void (*)(void *)); +uc_resource_type_t *ucv_resource_type_lookup(uc_vm_t *, const char *); -uc_value_t *ucv_ressource_new(uc_ressource_type_t *, void *); -void **ucv_ressource_dataptr(uc_value_t *, const char *); +uc_value_t *ucv_resource_new(uc_resource_type_t *, void *); +void **ucv_resource_dataptr(uc_value_t *, const char *); uc_value_t *ucv_regexp_new(const char *, bool, bool, bool, char **); @@ -31,7 +31,7 @@ #define err_return(err) do { last_error = err; return NULL; } while(0) //static const uc_ops *ops; -static uc_ressource_type_t *file_type, *proc_type, *dir_type; +static uc_resource_type_t *file_type, *proc_type, *dir_type; static int last_error = 0; @@ -223,7 +223,7 @@ uc_fs_popen(uc_vm_t *vm, size_t nargs) if (!fp) err_return(errno); - return uc_ressource_new(proc_type, fp); + return uc_resource_new(proc_type, fp); } @@ -322,7 +322,7 @@ uc_fs_open(uc_vm_t *vm, size_t nargs) if (!fp) err_return(errno); - return uc_ressource_new(file_type, fp); + return uc_resource_new(file_type, fp); } @@ -409,7 +409,7 @@ uc_fs_opendir(uc_vm_t *vm, size_t nargs) if (!dp) err_return(errno); - return uc_ressource_new(dir_type, dp); + return uc_resource_new(dir_type, dp); } static uc_value_t * @@ -912,7 +912,7 @@ void uc_module_init(uc_vm_t *vm, uc_value_t *scope) file_type = uc_type_declare(vm, "fs.file", file_fns, close_file); dir_type = uc_type_declare(vm, "fs.dir", dir_fns, close_dir); - ucv_object_add(scope, "stdin", uc_ressource_new(file_type, stdin)); - ucv_object_add(scope, "stdout", uc_ressource_new(file_type, stdout)); - ucv_object_add(scope, "stderr", uc_ressource_new(file_type, stderr)); + ucv_object_add(scope, "stdin", uc_resource_new(file_type, stdin)); + ucv_object_add(scope, "stdout", uc_resource_new(file_type, stdout)); + ucv_object_add(scope, "stderr", uc_resource_new(file_type, stderr)); } diff --git a/lib/struct.c b/lib/struct.c index 3a74bb2..32edb1b 100644 --- a/lib/struct.c +++ b/lib/struct.c @@ -70,7 +70,7 @@ #include "ucode/module.h" -static uc_ressource_type_t *struct_type; +static uc_resource_type_t *struct_type; typedef struct formatdef { char format; @@ -2529,7 +2529,7 @@ uc_struct_new(uc_vm_t *vm, size_t nargs) if (!state) return NULL; - return uc_ressource_new(struct_type, state); + return uc_resource_new(struct_type, state); } static void @@ -24,7 +24,7 @@ #define err_return(err) do { last_error = err; return NULL; } while(0) static enum ubus_msg_status last_error = 0; -static uc_ressource_type_t *conn_type; +static uc_resource_type_t *conn_type; typedef struct { int timeout; @@ -168,7 +168,7 @@ uc_ubus_connect(uc_vm_t *vm, size_t nargs) ubus_add_uloop(c->ctx); - return uc_ressource_new(conn_type, c); + return uc_resource_new(conn_type, c); } static void @@ -22,7 +22,7 @@ #define err_return(err) do { last_error = err; return NULL; } while(0) static int last_error = 0; -static uc_ressource_type_t *cursor_type; +static uc_resource_type_t *cursor_type; enum pkg_cmd { CMD_SAVE, @@ -94,7 +94,7 @@ uc_uci_cursor(uc_vm_t *vm, size_t nargs) err_return(rv); } - return uc_ressource_new(cursor_type, c); + return uc_resource_new(cursor_type, c); } @@ -182,8 +182,8 @@ ucv_gc_mark(uc_value_t *uv) void ucv_free(uc_value_t *uv, bool retain) { - uc_ressource_type_t *restype; - uc_ressource_t *ressource; + uc_resource_type_t *restype; + uc_resource_t *ressource; uc_function_t *function; uc_closure_t *closure; uc_upval_tref_t *upval; @@ -245,7 +245,7 @@ ucv_free(uc_value_t *uv, bool retain) break; case UC_RESSOURCE: - ressource = (uc_ressource_t *)uv; + ressource = (uc_resource_t *)uv; restype = ressource->type; if (restype && restype->free) @@ -949,12 +949,12 @@ ucv_closure_new(uc_vm_t *vm, uc_function_t *function, bool arrow_fn) } -uc_ressource_type_t * -ucv_ressource_type_add(uc_vm_t *vm, const char *name, uc_value_t *proto, void (*freefn)(void *)) +uc_resource_type_t * +ucv_resource_type_add(uc_vm_t *vm, const char *name, uc_value_t *proto, void (*freefn)(void *)) { - uc_ressource_type_t *type; + uc_resource_type_t *type; - type = ucv_ressource_type_lookup(vm, name); + type = ucv_resource_type_lookup(vm, name); if (type) { ucv_put(proto); @@ -973,8 +973,8 @@ ucv_ressource_type_add(uc_vm_t *vm, const char *name, uc_value_t *proto, void (* return type; } -uc_ressource_type_t * -ucv_ressource_type_lookup(uc_vm_t *vm, const char *name) +uc_resource_type_t * +ucv_resource_type_lookup(uc_vm_t *vm, const char *name) { size_t i; @@ -987,9 +987,9 @@ ucv_ressource_type_lookup(uc_vm_t *vm, const char *name) uc_value_t * -ucv_ressource_new(uc_ressource_type_t *type, void *data) +ucv_resource_new(uc_resource_type_t *type, void *data) { - uc_ressource_t *res; + uc_resource_t *res; res = xalloc(sizeof(*res)); res->header.type = UC_RESSOURCE; @@ -1001,9 +1001,9 @@ ucv_ressource_new(uc_ressource_type_t *type, void *data) } void ** -ucv_ressource_dataptr(uc_value_t *uv, const char *name) +ucv_resource_dataptr(uc_value_t *uv, const char *name) { - uc_ressource_t *res = (uc_ressource_t *)uv; + uc_resource_t *res = (uc_resource_t *)uv; if (ucv_type(uv) != UC_RESSOURCE) return NULL; @@ -1074,8 +1074,8 @@ ucv_upvalref_new(size_t slot) uc_value_t * ucv_prototype_get(uc_value_t *uv) { - uc_ressource_type_t *restype; - uc_ressource_t *ressource; + uc_resource_type_t *restype; + uc_resource_t *ressource; uc_object_t *object; uc_array_t *array; @@ -1091,7 +1091,7 @@ ucv_prototype_get(uc_value_t *uv) return object->proto; case UC_RESSOURCE: - ressource = (uc_ressource_t *)uv; + ressource = (uc_resource_t *)uv; restype = ressource->type; return restype ? restype->proto : NULL; @@ -1413,8 +1413,8 @@ void ucv_to_stringbuf_formatted(uc_vm_t *vm, uc_stringbuf_t *pb, uc_value_t *uv, size_t depth, char pad_char, size_t pad_size) { bool json = (pad_char != '\0'); - uc_ressource_type_t *restype; - uc_ressource_t *ressource; + uc_resource_type_t *restype; + uc_resource_t *ressource; uc_cfunction_t *cfunction; uc_function_t *function; uc_closure_t *closure; @@ -1615,7 +1615,7 @@ ucv_to_stringbuf_formatted(uc_vm_t *vm, uc_stringbuf_t *pb, uc_value_t *uv, size break; case UC_RESSOURCE: - ressource = (uc_ressource_t *)uv; + ressource = (uc_resource_t *)uv; restype = ressource->type; ucv_stringbuf_printf(pb, "%s<%s %p>%s", @@ -1828,7 +1828,7 @@ uc_vm_insn_next(uc_vm_t *vm, uc_vm_insn_t insn) uc_value_t *k = uc_vm_stack_pop(vm); uc_value_t *v = uc_vm_stack_pop(vm); void *end = (void *)~(uintptr_t)0; - uc_ressource_t *iterk; + uc_resource_t *iterk; struct lh_entry *curr; uint64_t n; @@ -1838,9 +1838,9 @@ uc_vm_insn_next(uc_vm_t *vm, uc_vm_insn_t insn) } if (k == NULL) - k = ucv_ressource_new(NULL, NULL); + k = ucv_resource_new(NULL, NULL); - iterk = (uc_ressource_t *)k; + iterk = (uc_resource_t *)k; switch (ucv_type(v)) { case UC_OBJECT: |