summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonsykkel <jonrevold@gmail.com>2021-07-08 04:13:53 +0200
committerjonsykkel <jonrevold@gmail.com>2021-07-08 04:13:53 +0200
commitf505f9eece2e97c626b1c402793b2cfe642ce13f (patch)
tree973b21356136e3a88dffdd51f2ed98065e0f3c82
parenta031752ff600a1cc1d601597890188173528bf5a (diff)
downloadokeshell-master.tar.gz
-rw-r--r--src/input/imap.c10
-rw-r--r--src/input/input.c6
-rw-r--r--src/shell/default.h2
-rw-r--r--src/shell/var.c18
4 files changed, 18 insertions, 18 deletions
diff --git a/src/input/imap.c b/src/input/imap.c
index f55599f..1c7b5d6 100644
--- a/src/input/imap.c
+++ b/src/input/imap.c
@@ -144,7 +144,7 @@ int imap_bind(imap_t *map,uint32_t code,uint32_t mod,char const *cmd){
bind_c = bl->bind_c;
if(!bind){
- bind = oke_malloc(sizeof(keybind_t)*1);
+ bind = mem_malloc(sizeof(keybind_t)*1);
JMPC(!bind,RC_ALLOC,ret);
keybind_set(&bind[0],mod,cmd);
@@ -167,7 +167,7 @@ int imap_bind(imap_t *map,uint32_t code,uint32_t mod,char const *cmd){
}
bind_c++;
- bind = oke_realloc(bind,sizeof(keybind_t)*bind_c);
+ bind = mem_realloc(bind,sizeof(keybind_t)*bind_c);
JMPC(!bind,RC_ALLOC,ret);
memmove(&bind[x+1],&bind[x],sizeof(keybind_t)*(bl->bind_c-x));
@@ -218,7 +218,7 @@ int imap_unbind(imap_t *map,uint32_t code,uint32_t mod){
if(bind_c){
memmove(&bind[x],&bind[x+1],sizeof(keybind_t)*(bind_c-x));
- bind = oke_realloc(bind,sizeof(keybind_t)*bind_c);
+ bind = mem_realloc(bind,sizeof(keybind_t)*bind_c);
if(bind){
bl->bind = bind;
}
@@ -228,7 +228,7 @@ int imap_unbind(imap_t *map,uint32_t code,uint32_t mod){
}
}else{
- oke_free(bl->bind);
+ mem_free(bl->bind);
bl->bind = 0;
bl->bind_active = (size_t)-1;
}
@@ -245,7 +245,7 @@ ret:
void imap_unbindall(imap_t *map){
for(size_t x = 0;x < KEYCODE_MAX;x++){
keybindlist_t *bl = &map->bindlist[x];
- oke_free(bl->bind);
+ mem_free(bl->bind);
keybindlist_init(bl);
}
}
diff --git a/src/input/input.c b/src/input/input.c
index a1d06c6..2e001b1 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -48,7 +48,7 @@ int input_init(input_map_t const *map,size_t imap_cnt,char const *ids_default){
memset(in->key_buf,0x00,sizeof(in->key_buf));
- in->imap = oke_malloc(sizeof(imap_t)*imap_cnt);
+ in->imap = mem_malloc(sizeof(imap_t)*imap_cnt);
JMPC(!in->imap,RC_ALLOC,ret);
for(size_t x = 0;x < imap_cnt;x++){
@@ -65,7 +65,7 @@ int input_init(input_map_t const *map,size_t imap_cnt,char const *ids_default){
inited = 1;
goto ret;
free_map:
- oke_free(in->imap);
+ mem_free(in->imap);
ret:
return rc;
}
@@ -79,7 +79,7 @@ void input_exit(void){
for(size_t x = 0;x < in->imap_cnt;x++){
imap_free(&in->imap[x]);
}
- oke_free(in->imap);
+ mem_free(in->imap);
in->imap = 0;
}
diff --git a/src/shell/default.h b/src/shell/default.h
index 3e56f9f..cd35294 100644
--- a/src/shell/default.h
+++ b/src/shell/default.h
@@ -117,7 +117,7 @@ static void _cmd_exec(char const *const *arg,size_t arg_cnt){
}
shell_exec(data,silent ? SHELL_SILENT : 0);
- oke_free(data);
+ mem_free(data);
}
static void _cmd_default(char const *const *arg,size_t arg_cnt){
diff --git a/src/shell/var.c b/src/shell/var.c
index c2b70f3..18c90d8 100644
--- a/src/shell/var.c
+++ b/src/shell/var.c
@@ -154,14 +154,14 @@ int var_def(unsigned type,char const *sym,char const *def,char const *min,char c
var.data = 0;
var.s.def_mut = 0;
- var.name_mut = oke_malloc(SHELL_SYMBOL_BUFSIZE);
+ var.name_mut = mem_malloc(SHELL_SYMBOL_BUFSIZE);
JMPC(!var.name_mut,RC_ALLOC,free_crap);
strzcpy(var.name_mut,sym,SHELL_SYMBOL_BUFSIZE);
var.desc = "user defined variable";
var.func = 0;
var.type = type;
var.flags = VAR_USER;
- var.data = oke_malloc(uservar_typesize(type));
+ var.data = mem_malloc(uservar_typesize(type));
JMPC(!var.data,RC_ALLOC,free_crap);
switch(type){
@@ -243,7 +243,7 @@ int var_def(unsigned type,char const *sym,char const *def,char const *min,char c
JMP(RC_INVALID,free_crap);
}
- var.s.def_mut = oke_malloc(def_len+1);
+ var.s.def_mut = mem_malloc(def_len+1);
JMPC(!var.s.def_mut,RC_ALLOC,free_crap);
strcpy(var.s.def_mut,def ? def : VAR_STRING_DEF);
strcpy(var.data,var.s.def);
@@ -283,10 +283,10 @@ int var_def(unsigned type,char const *sym,char const *def,char const *min,char c
goto ret;
free_crap:
if(type == SHELL_STRING){
- oke_free(var.s.def_mut);
+ mem_free(var.s.def_mut);
}
- oke_free(var.data);
- oke_free(var.name_mut);
+ mem_free(var.data);
+ mem_free(var.name_mut);
if(rc == RC_ALLOC) alloc_error();
ret:
return rc;
@@ -301,10 +301,10 @@ int var_undef(char const *sym){
return RC_FAILURE;
}
- oke_free(var->name_mut);
- oke_free(var->data);
+ mem_free(var->name_mut);
+ mem_free(var->data);
if(var->type == SHELL_STRING){
- oke_free(var->s.def_mut);
+ mem_free(var->s.def_mut);
}
arr_del(&sh->var,index);