Compare commits

...

2 Commits

Author SHA1 Message Date
falsycat f2ef2aa6fc change the default idea for nf7core_init 2024-05-03 10:07:11 +09:00
falsycat 8f2e221d17 fix wrong field name 2024-05-03 10:06:47 +09:00
2 changed files with 8 additions and 7 deletions

View File

@ -17,8 +17,8 @@ struct nf7core_init_factory {
uv_loop_t* uv;
uv_idle_t idle;
const uint8_t* entity_name;
size_t entity_namelen;
const uint8_t* idea_name;
size_t idea_namelen;
void* data;
void (*on_created)(struct nf7core_init_factory*, struct nf7core_exec_entity*);
@ -32,7 +32,7 @@ static void factory_on_close_(uv_handle_t*);
static inline struct nf7core_init_factory* factory_new_(
struct nf7* nf7, const uint8_t* entity_name, size_t entity_namelen) {
struct nf7* nf7, const uint8_t* idea_name, size_t idea_namelen) {
struct nf7core_init_factory* this = nf7util_malloc_alloc(nf7->malloc, sizeof(*this));
if (nullptr == this) {
nf7util_log_error("failed to allocate the first factory");
@ -42,8 +42,8 @@ static inline struct nf7core_init_factory* factory_new_(
.nf7 = nf7,
.malloc = nf7->malloc,
.uv = nf7->uv,
.entity_name = entity_name,
.entity_namelen = entity_namelen,
.idea_name = idea_name,
.idea_namelen = idea_namelen,
};
uv_idle_init(this->uv, &this->idle);
@ -75,7 +75,7 @@ static inline void factory_on_idle_(uv_idle_t* idle) {
goto EXIT;
}
struct nf7core_exec_entity* entity = nf7core_exec_entity_new(exec, this->entity_name, this->entity_namelen);
struct nf7core_exec_entity* entity = nf7core_exec_entity_new(exec, this->idea_name, this->idea_namelen);
if (nullptr == entity) {
nf7util_log_error("failed to create new entity");
goto EXIT;

View File

@ -14,7 +14,8 @@
#include "core/init/factory.priv.h"
#define IDEA_NAME "luajit"
#define IDEA_NAME "nf7core_any"
static void del_(struct nf7_mod*);
static void start_(struct nf7core_init_factory*, struct nf7core_exec_entity*);