57 lines
2.3 KiB
C
57 lines
2.3 KiB
C
|
|
// retoor <retoor@molodetz.nl>
|
||
|
|
|
||
|
|
#include "tool.h"
|
||
|
|
#include <stdlib.h>
|
||
|
|
|
||
|
|
extern tool_t *tool_terminal_create(void);
|
||
|
|
extern tool_t *tool_terminal_interactive_create(void);
|
||
|
|
extern tool_t *tool_read_file_create(void);
|
||
|
|
extern tool_t *tool_write_file_create(void);
|
||
|
|
extern tool_t *tool_directory_glob_create(void);
|
||
|
|
extern tool_t *tool_mkdir_create(void);
|
||
|
|
extern tool_t *tool_chdir_create(void);
|
||
|
|
extern tool_t *tool_getpwd_create(void);
|
||
|
|
extern tool_t *tool_http_fetch_create(void);
|
||
|
|
extern tool_t *tool_web_search_create(void);
|
||
|
|
extern tool_t *tool_web_search_news_create(void);
|
||
|
|
extern tool_t *tool_db_get_create(void);
|
||
|
|
extern tool_t *tool_db_set_create(void);
|
||
|
|
extern tool_t *tool_db_query_create(void);
|
||
|
|
extern tool_t *tool_python_execute_create(void);
|
||
|
|
extern tool_t *tool_index_source_directory_create(void);
|
||
|
|
|
||
|
|
static tool_registry_t *global_registry = NULL;
|
||
|
|
|
||
|
|
tool_registry_t *tools_get_registry(void) {
|
||
|
|
if (global_registry) return global_registry;
|
||
|
|
|
||
|
|
global_registry = tool_registry_create();
|
||
|
|
if (!global_registry) return NULL;
|
||
|
|
|
||
|
|
tool_registry_register(global_registry, tool_terminal_create());
|
||
|
|
tool_registry_register(global_registry, tool_terminal_interactive_create());
|
||
|
|
tool_registry_register(global_registry, tool_read_file_create());
|
||
|
|
tool_registry_register(global_registry, tool_write_file_create());
|
||
|
|
tool_registry_register(global_registry, tool_directory_glob_create());
|
||
|
|
tool_registry_register(global_registry, tool_mkdir_create());
|
||
|
|
tool_registry_register(global_registry, tool_chdir_create());
|
||
|
|
tool_registry_register(global_registry, tool_getpwd_create());
|
||
|
|
tool_registry_register(global_registry, tool_http_fetch_create());
|
||
|
|
tool_registry_register(global_registry, tool_web_search_create());
|
||
|
|
tool_registry_register(global_registry, tool_web_search_news_create());
|
||
|
|
tool_registry_register(global_registry, tool_db_get_create());
|
||
|
|
tool_registry_register(global_registry, tool_db_set_create());
|
||
|
|
tool_registry_register(global_registry, tool_db_query_create());
|
||
|
|
tool_registry_register(global_registry, tool_python_execute_create());
|
||
|
|
tool_registry_register(global_registry, tool_index_source_directory_create());
|
||
|
|
|
||
|
|
return global_registry;
|
||
|
|
}
|
||
|
|
|
||
|
|
void tools_registry_shutdown(void) {
|
||
|
|
if (global_registry) {
|
||
|
|
tool_registry_destroy(global_registry);
|
||
|
|
global_registry = NULL;
|
||
|
|
}
|
||
|
|
}
|