|
|
@ -8,7 +8,7 @@
|
|
|
|
// In-memory representation of all active modules
|
|
|
|
// In-memory representation of all active modules
|
|
|
|
struct module *module_database[MODULE__MAX_MODULE_COUNT] = { NULL };
|
|
|
|
struct module *module_database[MODULE__MAX_MODULE_COUNT] = { NULL };
|
|
|
|
// First free in module
|
|
|
|
// First free in module
|
|
|
|
int module_database__free_offset = 0;
|
|
|
|
int module_database_free_offset = 0;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Given a name, find the associated module
|
|
|
|
* Given a name, find the associated module
|
|
|
@ -16,9 +16,9 @@ int module_database__free_offset = 0;
|
|
|
|
* @return module or NULL if no match found
|
|
|
|
* @return module or NULL if no match found
|
|
|
|
**/
|
|
|
|
**/
|
|
|
|
struct module *
|
|
|
|
struct module *
|
|
|
|
module_database__find_by_name(char *name)
|
|
|
|
module_database_find_by_name(char *name)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int f = module_database__free_offset;
|
|
|
|
int f = module_database_free_offset;
|
|
|
|
for (int i = 0; i < f; i++) {
|
|
|
|
for (int i = 0; i < f; i++) {
|
|
|
|
assert(module_database[i]);
|
|
|
|
assert(module_database[i]);
|
|
|
|
if (strcmp(module_database[i]->name, name) == 0) return module_database[i];
|
|
|
|
if (strcmp(module_database[i]->name, name) == 0) return module_database[i];
|
|
|
@ -32,9 +32,9 @@ module_database__find_by_name(char *name)
|
|
|
|
* @return module or NULL if no match found
|
|
|
|
* @return module or NULL if no match found
|
|
|
|
**/
|
|
|
|
**/
|
|
|
|
struct module *
|
|
|
|
struct module *
|
|
|
|
module_database__find_by_socket_descriptor(int socket_descriptor)
|
|
|
|
module_database_find_by_socket_descriptor(int socket_descriptor)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int f = module_database__free_offset;
|
|
|
|
int f = module_database_free_offset;
|
|
|
|
for (int i = 0; i < f; i++) {
|
|
|
|
for (int i = 0; i < f; i++) {
|
|
|
|
assert(module_database[i]);
|
|
|
|
assert(module_database[i]);
|
|
|
|
if (module_database[i]->socket_descriptor == socket_descriptor) return module_database[i];
|
|
|
|
if (module_database[i]->socket_descriptor == socket_descriptor) return module_database[i];
|
|
|
|