From ff52440341bcb8c61105ff144bfcb210315207e4 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 9 Jul 2021 19:58:37 +0200 Subject: treewide: consolidate typedef naming Ensure that all custom typedef and vector declaration type names end with a "_t" suffix. Signed-off-by: Jo-Philipp Wich --- lib/fs.c | 74 +++++++++++++++++++++++++++++++------------------------------- lib/math.c | 24 ++++++++++---------- lib/ubus.c | 22 +++++++++---------- lib/uci.c | 58 ++++++++++++++++++++++++------------------------ 4 files changed, 89 insertions(+), 89 deletions(-) (limited to 'lib') diff --git a/lib/fs.c b/lib/fs.c index 6f6c7cb..7d501a2 100644 --- a/lib/fs.c +++ b/lib/fs.c @@ -36,7 +36,7 @@ static uc_ressource_type_t *file_type, *proc_type, *dir_type; static int last_error = 0; static uc_value_t * -uc_fs_error(uc_vm *vm, size_t nargs) +uc_fs_error(uc_vm_t *vm, size_t nargs) { uc_value_t *errmsg; @@ -50,7 +50,7 @@ uc_fs_error(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_fs_read_common(uc_vm *vm, size_t nargs, const char *type) +uc_fs_read_common(uc_vm_t *vm, size_t nargs, const char *type) { uc_value_t *limit = uc_get_arg(0); uc_value_t *rv = NULL; @@ -142,7 +142,7 @@ uc_fs_read_common(uc_vm *vm, size_t nargs, const char *type) } static uc_value_t * -uc_fs_write_common(uc_vm *vm, size_t nargs, const char *type) +uc_fs_write_common(uc_vm_t *vm, size_t nargs, const char *type) { uc_value_t *data = uc_get_arg(0); size_t len, wsize; @@ -172,7 +172,7 @@ uc_fs_write_common(uc_vm *vm, size_t nargs, const char *type) static uc_value_t * -uc_fs_pclose(uc_vm *vm, size_t nargs) +uc_fs_pclose(uc_vm_t *vm, size_t nargs) { FILE **fp = uc_get_self("fs.proc"); int rc; @@ -196,19 +196,19 @@ uc_fs_pclose(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_fs_pread(uc_vm *vm, size_t nargs) +uc_fs_pread(uc_vm_t *vm, size_t nargs) { return uc_fs_read_common(vm, nargs, "fs.proc"); } static uc_value_t * -uc_fs_pwrite(uc_vm *vm, size_t nargs) +uc_fs_pwrite(uc_vm_t *vm, size_t nargs) { return uc_fs_write_common(vm, nargs, "fs.proc"); } static uc_value_t * -uc_fs_popen(uc_vm *vm, size_t nargs) +uc_fs_popen(uc_vm_t *vm, size_t nargs) { uc_value_t *comm = uc_get_arg(0); uc_value_t *mode = uc_get_arg(1); @@ -228,7 +228,7 @@ uc_fs_popen(uc_vm *vm, size_t nargs) static uc_value_t * -uc_fs_close(uc_vm *vm, size_t nargs) +uc_fs_close(uc_vm_t *vm, size_t nargs) { FILE **fp = uc_get_self("fs.file"); @@ -242,19 +242,19 @@ uc_fs_close(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_fs_read(uc_vm *vm, size_t nargs) +uc_fs_read(uc_vm_t *vm, size_t nargs) { return uc_fs_read_common(vm, nargs, "fs.file"); } static uc_value_t * -uc_fs_write(uc_vm *vm, size_t nargs) +uc_fs_write(uc_vm_t *vm, size_t nargs) { return uc_fs_write_common(vm, nargs, "fs.file"); } static uc_value_t * -uc_fs_seek(uc_vm *vm, size_t nargs) +uc_fs_seek(uc_vm_t *vm, size_t nargs) { uc_value_t *ofs = uc_get_arg(0); uc_value_t *how = uc_get_arg(1); @@ -289,7 +289,7 @@ uc_fs_seek(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_fs_tell(uc_vm *vm, size_t nargs) +uc_fs_tell(uc_vm_t *vm, size_t nargs) { long offset; @@ -307,7 +307,7 @@ uc_fs_tell(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_fs_open(uc_vm *vm, size_t nargs) +uc_fs_open(uc_vm_t *vm, size_t nargs) { uc_value_t *path = uc_get_arg(0); uc_value_t *mode = uc_get_arg(1); @@ -327,7 +327,7 @@ uc_fs_open(uc_vm *vm, size_t nargs) static uc_value_t * -uc_fs_readdir(uc_vm *vm, size_t nargs) +uc_fs_readdir(uc_vm_t *vm, size_t nargs) { DIR **dp = uc_get_self("fs.dir"); struct dirent *e; @@ -345,7 +345,7 @@ uc_fs_readdir(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_fs_telldir(uc_vm *vm, size_t nargs) +uc_fs_telldir(uc_vm_t *vm, size_t nargs) { DIR **dp = uc_get_self("fs.dir"); long position; @@ -362,7 +362,7 @@ uc_fs_telldir(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_fs_seekdir(uc_vm *vm, size_t nargs) +uc_fs_seekdir(uc_vm_t *vm, size_t nargs) { uc_value_t *ofs = uc_get_arg(0); DIR **dp = uc_get_self("fs.dir"); @@ -382,7 +382,7 @@ uc_fs_seekdir(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_fs_closedir(uc_vm *vm, size_t nargs) +uc_fs_closedir(uc_vm_t *vm, size_t nargs) { DIR **dp = uc_get_self("fs.dir"); @@ -396,7 +396,7 @@ uc_fs_closedir(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_fs_opendir(uc_vm *vm, size_t nargs) +uc_fs_opendir(uc_vm_t *vm, size_t nargs) { uc_value_t *path = uc_get_arg(0); DIR *dp; @@ -413,7 +413,7 @@ uc_fs_opendir(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_fs_readlink(uc_vm *vm, size_t nargs) +uc_fs_readlink(uc_vm_t *vm, size_t nargs) { uc_value_t *path = uc_get_arg(0); uc_value_t *res; @@ -453,7 +453,7 @@ uc_fs_readlink(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_fs_stat_common(uc_vm *vm, size_t nargs, bool use_lstat) +uc_fs_stat_common(uc_vm_t *vm, size_t nargs, bool use_lstat) { uc_value_t *path = uc_get_arg(0); uc_value_t *res, *o; @@ -537,19 +537,19 @@ uc_fs_stat_common(uc_vm *vm, size_t nargs, bool use_lstat) } static uc_value_t * -uc_fs_stat(uc_vm *vm, size_t nargs) +uc_fs_stat(uc_vm_t *vm, size_t nargs) { return uc_fs_stat_common(vm, nargs, false); } static uc_value_t * -uc_fs_lstat(uc_vm *vm, size_t nargs) +uc_fs_lstat(uc_vm_t *vm, size_t nargs) { return uc_fs_stat_common(vm, nargs, true); } static uc_value_t * -uc_fs_mkdir(uc_vm *vm, size_t nargs) +uc_fs_mkdir(uc_vm_t *vm, size_t nargs) { uc_value_t *path = uc_get_arg(0); uc_value_t *mode = uc_get_arg(1); @@ -565,7 +565,7 @@ uc_fs_mkdir(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_fs_rmdir(uc_vm *vm, size_t nargs) +uc_fs_rmdir(uc_vm_t *vm, size_t nargs) { uc_value_t *path = uc_get_arg(0); @@ -579,7 +579,7 @@ uc_fs_rmdir(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_fs_symlink(uc_vm *vm, size_t nargs) +uc_fs_symlink(uc_vm_t *vm, size_t nargs) { uc_value_t *dest = uc_get_arg(0); uc_value_t *path = uc_get_arg(1); @@ -595,7 +595,7 @@ uc_fs_symlink(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_fs_unlink(uc_vm *vm, size_t nargs) +uc_fs_unlink(uc_vm_t *vm, size_t nargs) { uc_value_t *path = uc_get_arg(0); @@ -609,7 +609,7 @@ uc_fs_unlink(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_fs_getcwd(uc_vm *vm, size_t nargs) +uc_fs_getcwd(uc_vm_t *vm, size_t nargs) { uc_value_t *res; char *buf = NULL, *tmp; @@ -645,7 +645,7 @@ uc_fs_getcwd(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_fs_chdir(uc_vm *vm, size_t nargs) +uc_fs_chdir(uc_vm_t *vm, size_t nargs) { uc_value_t *path = uc_get_arg(0); @@ -659,7 +659,7 @@ uc_fs_chdir(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_fs_chmod(uc_vm *vm, size_t nargs) +uc_fs_chmod(uc_vm_t *vm, size_t nargs) { uc_value_t *path = uc_get_arg(0); uc_value_t *mode = uc_get_arg(1); @@ -769,7 +769,7 @@ uc_fs_resolve_group(uc_value_t *v, gid_t *gid) } static uc_value_t * -uc_fs_chown(uc_vm *vm, size_t nargs) +uc_fs_chown(uc_vm_t *vm, size_t nargs) { uc_value_t *path = uc_get_arg(0); uc_value_t *user = uc_get_arg(1); @@ -791,7 +791,7 @@ uc_fs_chown(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_fs_rename(uc_vm *vm, size_t nargs) +uc_fs_rename(uc_vm_t *vm, size_t nargs) { uc_value_t *oldpath = uc_get_arg(0); uc_value_t *newpath = uc_get_arg(1); @@ -807,7 +807,7 @@ uc_fs_rename(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_fs_glob(uc_vm *vm, size_t nargs) +uc_fs_glob(uc_vm_t *vm, size_t nargs) { uc_value_t *pat, *arr; glob_t gl = { 0 }; @@ -835,14 +835,14 @@ uc_fs_glob(uc_vm *vm, size_t nargs) } -static const uc_cfunction_list proc_fns[] = { +static const uc_cfunction_list_t proc_fns[] = { { "read", uc_fs_pread }, { "write", uc_fs_pwrite }, { "close", uc_fs_pclose }, { "error", uc_fs_error }, }; -static const uc_cfunction_list file_fns[] = { +static const uc_cfunction_list_t file_fns[] = { { "read", uc_fs_read }, { "write", uc_fs_write }, { "seek", uc_fs_seek }, @@ -851,7 +851,7 @@ static const uc_cfunction_list file_fns[] = { { "error", uc_fs_error }, }; -static const uc_cfunction_list dir_fns[] = { +static const uc_cfunction_list_t dir_fns[] = { { "read", uc_fs_readdir }, { "seek", uc_fs_seekdir }, { "tell", uc_fs_telldir }, @@ -859,7 +859,7 @@ static const uc_cfunction_list dir_fns[] = { { "error", uc_fs_error }, }; -static const uc_cfunction_list global_fns[] = { +static const uc_cfunction_list_t global_fns[] = { { "error", uc_fs_error }, { "open", uc_fs_open }, { "opendir", uc_fs_opendir }, @@ -904,7 +904,7 @@ static void close_dir(void *ud) closedir(dp); } -void uc_module_init(uc_vm *vm, uc_value_t *scope) +void uc_module_init(uc_vm_t *vm, uc_value_t *scope) { uc_add_functions(scope, global_fns); diff --git a/lib/math.c b/lib/math.c index bc8efb6..5ba8d76 100644 --- a/lib/math.c +++ b/lib/math.c @@ -22,7 +22,7 @@ static bool srand_called = false; static uc_value_t * -uc_abs(uc_vm *vm, size_t nargs) +uc_abs(uc_vm_t *vm, size_t nargs) { uc_value_t *v = uc_get_arg(0); uc_type_t t; @@ -41,7 +41,7 @@ uc_abs(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_atan2(uc_vm *vm, size_t nargs) +uc_atan2(uc_vm_t *vm, size_t nargs) { double d1 = uc_to_double(uc_get_arg(0)); double d2 = uc_to_double(uc_get_arg(1)); @@ -53,7 +53,7 @@ uc_atan2(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_cos(uc_vm *vm, size_t nargs) +uc_cos(uc_vm_t *vm, size_t nargs) { double d = uc_to_double(uc_get_arg(0)); @@ -64,7 +64,7 @@ uc_cos(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_exp(uc_vm *vm, size_t nargs) +uc_exp(uc_vm_t *vm, size_t nargs) { double d = uc_to_double(uc_get_arg(0)); @@ -75,7 +75,7 @@ uc_exp(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_log(uc_vm *vm, size_t nargs) +uc_log(uc_vm_t *vm, size_t nargs) { double d = uc_to_double(uc_get_arg(0)); @@ -86,7 +86,7 @@ uc_log(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_sin(uc_vm *vm, size_t nargs) +uc_sin(uc_vm_t *vm, size_t nargs) { double d = uc_to_double(uc_get_arg(0)); @@ -97,7 +97,7 @@ uc_sin(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_sqrt(uc_vm *vm, size_t nargs) +uc_sqrt(uc_vm_t *vm, size_t nargs) { double d = uc_to_double(uc_get_arg(0)); @@ -108,7 +108,7 @@ uc_sqrt(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_pow(uc_vm *vm, size_t nargs) +uc_pow(uc_vm_t *vm, size_t nargs) { double x = uc_to_double(uc_get_arg(0)); double y = uc_to_double(uc_get_arg(1)); @@ -120,7 +120,7 @@ uc_pow(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_rand(uc_vm *vm, size_t nargs) +uc_rand(uc_vm_t *vm, size_t nargs) { struct timeval tv; @@ -135,7 +135,7 @@ uc_rand(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_srand(uc_vm *vm, size_t nargs) +uc_srand(uc_vm_t *vm, size_t nargs) { int64_t n = uc_to_int64(uc_get_arg(0)); @@ -145,7 +145,7 @@ uc_srand(uc_vm *vm, size_t nargs) return NULL; } -static const uc_cfunction_list math_fns[] = { +static const uc_cfunction_list_t math_fns[] = { { "abs", uc_abs }, { "atan2", uc_atan2 }, { "cos", uc_cos }, @@ -158,7 +158,7 @@ static const uc_cfunction_list math_fns[] = { { "srand", uc_srand }, }; -void uc_module_init(uc_vm *vm, uc_value_t *scope) +void uc_module_init(uc_vm_t *vm, uc_value_t *scope) { uc_add_functions(scope, math_fns); } diff --git a/lib/ubus.c b/lib/ubus.c index 933ef3a..d1b2c8c 100644 --- a/lib/ubus.c +++ b/lib/ubus.c @@ -33,7 +33,7 @@ typedef struct { } ubus_connection; static uc_value_t * -uc_ubus_error(uc_vm *vm, size_t nargs) +uc_ubus_error(uc_vm_t *vm, size_t nargs) { uc_value_t *errmsg; @@ -47,10 +47,10 @@ uc_ubus_error(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_blob_to_json(uc_vm *vm, struct blob_attr *attr, bool table, const char **name); +uc_blob_to_json(uc_vm_t *vm, struct blob_attr *attr, bool table, const char **name); static uc_value_t * -uc_blob_array_to_json(uc_vm *vm, struct blob_attr *attr, size_t len, bool table) +uc_blob_array_to_json(uc_vm_t *vm, struct blob_attr *attr, size_t len, bool table) { uc_value_t *o = table ? ucv_object_new(vm) : ucv_array_new(vm); uc_value_t *v; @@ -77,7 +77,7 @@ uc_blob_array_to_json(uc_vm *vm, struct blob_attr *attr, size_t len, bool table) } static uc_value_t * -uc_blob_to_json(uc_vm *vm, struct blob_attr *attr, bool table, const char **name) +uc_blob_to_json(uc_vm_t *vm, struct blob_attr *attr, bool table, const char **name) { void *data; int len; @@ -131,7 +131,7 @@ uc_blob_to_json(uc_vm *vm, struct blob_attr *attr, bool table, const char **name static uc_value_t * -uc_ubus_connect(uc_vm *vm, size_t nargs) +uc_ubus_connect(uc_vm_t *vm, size_t nargs) { uc_value_t *socket = uc_get_arg(0); uc_value_t *timeout = uc_get_arg(1); @@ -199,7 +199,7 @@ uc_ubus_objects_cb(struct ubus_context *c, struct ubus_object_data *o, void *p) } static uc_value_t * -uc_ubus_list(uc_vm *vm, size_t nargs) +uc_ubus_list(uc_vm_t *vm, size_t nargs) { ubus_connection **c = uc_get_self("ubus.connection"); uc_value_t *objname = uc_get_arg(0); @@ -237,7 +237,7 @@ uc_ubus_call_cb(struct ubus_request *req, int type, struct blob_attr *msg) } static uc_value_t * -uc_ubus_call(uc_vm *vm, size_t nargs) +uc_ubus_call(uc_vm_t *vm, size_t nargs) { ubus_connection **c = uc_get_self("ubus.connection"); uc_value_t *objname = uc_get_arg(0); @@ -282,7 +282,7 @@ uc_ubus_call(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_ubus_disconnect(uc_vm *vm, size_t nargs) +uc_ubus_disconnect(uc_vm_t *vm, size_t nargs) { ubus_connection **c = uc_get_self("ubus.connection"); @@ -296,12 +296,12 @@ uc_ubus_disconnect(uc_vm *vm, size_t nargs) } -static const uc_cfunction_list global_fns[] = { +static const uc_cfunction_list_t global_fns[] = { { "error", uc_ubus_error }, { "connect", uc_ubus_connect }, }; -static const uc_cfunction_list conn_fns[] = { +static const uc_cfunction_list_t conn_fns[] = { { "list", uc_ubus_list }, { "call", uc_ubus_call }, { "error", uc_ubus_error }, @@ -320,7 +320,7 @@ static void close_connection(void *ud) { free(conn); } -void uc_module_init(uc_vm *vm, uc_value_t *scope) +void uc_module_init(uc_vm_t *vm, uc_value_t *scope) { uc_add_functions(scope, global_fns); diff --git a/lib/uci.c b/lib/uci.c index 71a9c2d..89c5c92 100644 --- a/lib/uci.c +++ b/lib/uci.c @@ -31,7 +31,7 @@ enum pkg_cmd { }; static uc_value_t * -uc_uci_error(uc_vm *vm, size_t nargs) +uc_uci_error(uc_vm_t *vm, size_t nargs) { char buf[sizeof("Unknown error: -9223372036854775808")]; uc_value_t *errmsg; @@ -64,7 +64,7 @@ uc_uci_error(uc_vm *vm, size_t nargs) static uc_value_t * -uc_uci_cursor(uc_vm *vm, size_t nargs) +uc_uci_cursor(uc_vm_t *vm, size_t nargs) { uc_value_t *cdir = uc_get_arg(0); uc_value_t *sdir = uc_get_arg(1); @@ -99,7 +99,7 @@ uc_uci_cursor(uc_vm *vm, size_t nargs) static uc_value_t * -uc_uci_load(uc_vm *vm, size_t nargs) +uc_uci_load(uc_vm_t *vm, size_t nargs) { struct uci_context **c = uc_get_self("uci.cursor"); uc_value_t *conf = uc_get_arg(0); @@ -128,7 +128,7 @@ uc_uci_load(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_uci_unload(uc_vm *vm, size_t nargs) +uc_uci_unload(uc_vm_t *vm, size_t nargs) { struct uci_context **c = uc_get_self("uci.cursor"); uc_value_t *conf = uc_get_arg(0); @@ -181,7 +181,7 @@ lookup_ptr(struct uci_context *ctx, struct uci_ptr *ptr, bool extended) } static uc_value_t * -option_to_uval(uc_vm *vm, struct uci_option *o) +option_to_uval(uc_vm_t *vm, struct uci_option *o) { struct uci_element *e; uc_value_t *arr; @@ -205,7 +205,7 @@ option_to_uval(uc_vm *vm, struct uci_option *o) } static uc_value_t * -section_to_uval(uc_vm *vm, struct uci_section *s, int index) +section_to_uval(uc_vm_t *vm, struct uci_section *s, int index) { uc_value_t *so = ucv_object_new(vm); struct uci_element *e; @@ -230,7 +230,7 @@ section_to_uval(uc_vm *vm, struct uci_section *s, int index) } static uc_value_t * -package_to_uval(uc_vm *vm, struct uci_package *p) +package_to_uval(uc_vm_t *vm, struct uci_package *p) { uc_value_t *po = ucv_object_new(vm); uc_value_t *so; @@ -249,7 +249,7 @@ package_to_uval(uc_vm *vm, struct uci_package *p) } static uc_value_t * -uc_uci_get_any(uc_vm *vm, size_t nargs, bool all) +uc_uci_get_any(uc_vm_t *vm, size_t nargs, bool all) { struct uci_context **c = uc_get_self("uci.cursor"); uc_value_t *conf = uc_get_arg(0); @@ -309,19 +309,19 @@ uc_uci_get_any(uc_vm *vm, size_t nargs, bool all) } static uc_value_t * -uc_uci_get(uc_vm *vm, size_t nargs) +uc_uci_get(uc_vm_t *vm, size_t nargs) { return uc_uci_get_any(vm, nargs, false); } static uc_value_t * -uc_uci_get_all(uc_vm *vm, size_t nargs) +uc_uci_get_all(uc_vm_t *vm, size_t nargs) { return uc_uci_get_any(vm, nargs, true); } static uc_value_t * -uc_uci_get_first(uc_vm *vm, size_t nargs) +uc_uci_get_first(uc_vm_t *vm, size_t nargs) { struct uci_context **c = uc_get_self("uci.cursor"); uc_value_t *conf = uc_get_arg(0); @@ -379,7 +379,7 @@ uc_uci_get_first(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_uci_add(uc_vm *vm, size_t nargs) +uc_uci_add(uc_vm_t *vm, size_t nargs) { struct uci_context **c = uc_get_self("uci.cursor"); uc_value_t *conf = uc_get_arg(0); @@ -414,7 +414,7 @@ uc_uci_add(uc_vm *vm, size_t nargs) } static bool -uval_to_uci(uc_vm *vm, uc_value_t *val, const char **p, bool *is_list) +uval_to_uci(uc_vm_t *vm, uc_value_t *val, const char **p, bool *is_list) { uc_value_t *item; @@ -459,7 +459,7 @@ uval_to_uci(uc_vm *vm, uc_value_t *val, const char **p, bool *is_list) } static uc_value_t * -uc_uci_set(uc_vm *vm, size_t nargs) +uc_uci_set(uc_vm_t *vm, size_t nargs) { struct uci_context **c = uc_get_self("uci.cursor"); uc_value_t *conf = uc_get_arg(0); @@ -564,7 +564,7 @@ uc_uci_set(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_uci_delete(uc_vm *vm, size_t nargs) +uc_uci_delete(uc_vm_t *vm, size_t nargs) { struct uci_context **c = uc_get_self("uci.cursor"); uc_value_t *conf = uc_get_arg(0); @@ -599,7 +599,7 @@ uc_uci_delete(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_uci_rename(uc_vm *vm, size_t nargs) +uc_uci_rename(uc_vm_t *vm, size_t nargs) { struct uci_context **c = uc_get_self("uci.cursor"); uc_value_t *conf = uc_get_arg(0); @@ -659,7 +659,7 @@ uc_uci_rename(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_uci_reorder(uc_vm *vm, size_t nargs) +uc_uci_reorder(uc_vm_t *vm, size_t nargs) { struct uci_context **c = uc_get_self("uci.cursor"); uc_value_t *conf = uc_get_arg(0); @@ -699,7 +699,7 @@ uc_uci_reorder(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_uci_pkg_command(uc_vm *vm, size_t nargs, enum pkg_cmd cmd) +uc_uci_pkg_command(uc_vm_t *vm, size_t nargs, enum pkg_cmd cmd) { struct uci_context **c = uc_get_self("uci.cursor"); uc_value_t *conf = uc_get_arg(0); @@ -749,25 +749,25 @@ uc_uci_pkg_command(uc_vm *vm, size_t nargs, enum pkg_cmd cmd) } static uc_value_t * -uc_uci_save(uc_vm *vm, size_t nargs) +uc_uci_save(uc_vm_t *vm, size_t nargs) { return uc_uci_pkg_command(vm, nargs, CMD_SAVE); } static uc_value_t * -uc_uci_commit(uc_vm *vm, size_t nargs) +uc_uci_commit(uc_vm_t *vm, size_t nargs) { return uc_uci_pkg_command(vm, nargs, CMD_COMMIT); } static uc_value_t * -uc_uci_revert(uc_vm *vm, size_t nargs) +uc_uci_revert(uc_vm_t *vm, size_t nargs) { return uc_uci_pkg_command(vm, nargs, CMD_REVERT); } static uc_value_t * -change_to_uval(uc_vm *vm, struct uci_delta *d) +change_to_uval(uc_vm_t *vm, struct uci_delta *d) { const char *types[] = { [UCI_CMD_REORDER] = "order", @@ -806,7 +806,7 @@ change_to_uval(uc_vm *vm, struct uci_delta *d) } static uc_value_t * -changes_to_uval(uc_vm *vm, struct uci_context *ctx, const char *package) +changes_to_uval(uc_vm_t *vm, struct uci_context *ctx, const char *package) { uc_value_t *a = NULL, *c; struct uci_package *p = NULL; @@ -856,7 +856,7 @@ changes_to_uval(uc_vm *vm, struct uci_context *ctx, const char *package) } static uc_value_t * -uc_uci_changes(uc_vm *vm, size_t nargs) +uc_uci_changes(uc_vm_t *vm, size_t nargs) { struct uci_context **c = uc_get_self("uci.cursor"); uc_value_t *conf = uc_get_arg(0); @@ -890,7 +890,7 @@ uc_uci_changes(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_uci_foreach(uc_vm *vm, size_t nargs) +uc_uci_foreach(uc_vm_t *vm, size_t nargs) { struct uci_context **c = uc_get_self("uci.cursor"); uc_value_t *conf = uc_get_arg(0); @@ -952,7 +952,7 @@ uc_uci_foreach(uc_vm *vm, size_t nargs) } static uc_value_t * -uc_uci_configs(uc_vm *vm, size_t nargs) +uc_uci_configs(uc_vm_t *vm, size_t nargs) { struct uci_context **c = uc_get_self("uci.cursor"); uc_value_t *a; @@ -975,7 +975,7 @@ uc_uci_configs(uc_vm *vm, size_t nargs) } -static const uc_cfunction_list cursor_fns[] = { +static const uc_cfunction_list_t cursor_fns[] = { { "load", uc_uci_load }, { "unload", uc_uci_unload }, { "get", uc_uci_get }, @@ -995,7 +995,7 @@ static const uc_cfunction_list cursor_fns[] = { { "error", uc_uci_error }, }; -static const uc_cfunction_list global_fns[] = { +static const uc_cfunction_list_t global_fns[] = { { "error", uc_uci_error }, { "cursor", uc_uci_cursor }, }; @@ -1005,7 +1005,7 @@ static void close_uci(void *ud) { uci_free_context((struct uci_context *)ud); } -void uc_module_init(uc_vm *vm, uc_value_t *scope) +void uc_module_init(uc_vm_t *vm, uc_value_t *scope) { uc_add_functions(scope, global_fns); -- cgit v1.2.3