#include "win32.h"#include <stdlib.h>#include <stdarg.h>#include <string.h>#include <unistd.h>#include <errno.h>#include <dlfcn.h>#include "configfile.h"#include "commands.h"#include "debug.h"#include "dynstuff.h"#include "events.h"#include "objects.h"#include "plugins.h"#include "userlist.h"#include "stuff.h"#include "vars.h"#include "themes.h"#include "xmalloc.h"#include "dynstuff_inline.h"#include "queries.h"| #define __DECLARE_QUERIES_STUFF |
| #define ID_AND_QUERY_EXTERNAL |
"Here, we have two possibilites.\n" \ "\t1/ You are lazy moron, who doesn't rebuilt core but use plugin with this enum...\n" \ "\t2/ You are ekg2 hacker who use query_id(\"your_own_query_name\") to get new query id and use this id with " \ "query_connect_id()... but unfortunetly it won't work cause of 1st possibility, sorry.\n"
| DYNSTUFF_LIST_DECLARE_SORTED_NF | ( | plugins | , | |
| plugin_t | , | |||
| plugin_register_compare | , | |||
| static | __DYNSTUFF_LIST_ADD_SORTED, | |||
| __DYNSTUFF_LIST_UNLINK | ||||
| ) |
| int ekg2_dlclose | ( | void * | plugin | ) |
Close handler to dynamic loaded library.
Support POSIX dlclose() and FreeLibrary() [WINDOWS]
| plugin | - Handler to loaded library. |
| int ekg2_dlinit | ( | ) |
| static void* ekg2_dlopen | ( | const char * | name | ) | [static] |
Load dynamic library file from name
Support POSIX dlopen() and LoadLibraryA() [WINDOWS]
| name | - Full path of library to load. |
| static void* ekg2_dlsym | ( | void * | plugin, | |
| char * | name | |||
| ) | [static] |
Get symbol with name from loaded dynamic library.
Support POSIX dlsym() and GetProcAddress() [WINDOWS]
| plugin | - Pointer to the loaded library. | |
| name | - Name of symbol to lookup. |
| int have_plugin_of_class | ( | plugin_class_t | pclass | ) |
Check if we have loaded plugin from pclass
| pclass |
| static LIST_FREE_ITEM | ( | query_external_free_data | , | |
| list_t | ||||
| ) | [static] |
| static LIST_FREE_ITEM | ( | watch_free_data | , | |
| watch_t * | ||||
| ) | [static] |
| int plugin_abi_version | ( | int | plugin_abi_ver, | |
| const char * | plugin_name | |||
| ) |
| plugin_t* plugin_find | ( | const char * | name | ) |
Find plugin by name
| name | - name of plugin_t |
| plugin_t* plugin_find_uid | ( | const char * | uid | ) |
Find PLUGIN_PROTOCOL plugin which can handle uid
| int plugin_load | ( | const char * | name, | |
| int | prio, | |||
| int | quiet | |||
| ) |
| int plugin_register | ( | plugin_t * | p, | |
| int | prio | |||
| ) |
| int plugin_unload | ( | plugin_t * | p | ) |
| int plugin_unregister | ( | plugin_t * | p | ) |
| int plugin_var_add | ( | plugin_t * | pl, | |
| const char * | name, | |||
| int | type, | |||
| const char * | value, | |||
| int | secret, | |||
| plugin_notify_func_t * | notify | |||
| ) |
| int plugin_var_find | ( | plugin_t * | pl, | |
| const char * | name | |||
| ) |
it looks for given variable name in given plugin
| pl | - plugin | |
| name | - variable name |
returns sequence number+1 of variable if found, else 0
| void queries_reconnect | ( | ) |
Reconnect (resort) all queries, e.g. after plugin prio change.
| query_t* query_connect | ( | plugin_t * | plugin, | |
| const char * | name, | |||
| query_handler_func_t * | handler, | |||
| void * | data | |||
| ) |
| static query_t* query_connect_common | ( | plugin_t * | plugin, | |
| const int | id, | |||
| query_handler_func_t * | handler, | |||
| void * | data | |||
| ) | [static] |
| query_t* query_connect_id | ( | plugin_t * | plugin, | |
| const int | id, | |||
| query_handler_func_t * | handler, | |||
| void * | data | |||
| ) |
| int query_emit | ( | plugin_t * | plugin, | |
| const char * | name, | |||
| ... | ||||
| ) |
| static int query_emit_common | ( | query_t * | q, | |
| va_list | ap | |||
| ) | [static] |
| int query_emit_id | ( | plugin_t * | plugin, | |
| const int | id, | |||
| ... | ||||
| ) |
| void query_external_free | ( | ) |
Free memory allocated by query_id() for not-known-in-core-query-names
| int query_free | ( | query_t * | q | ) |
| static int query_id | ( | const char * | name | ) | [static] |
Get unique query id, for passed name
| name |
| const char* query_name | ( | const int | id | ) |
Get name of query, by passed id
| struct query_def* query_struct | ( | const int | id | ) | [read] |
Get struct of query, by passed id
| watch_t* watch_add | ( | plugin_t * | plugin, | |
| int | fd, | |||
| watch_type_t | type, | |||
| watcher_handler_func_t * | handler, | |||
| void * | data | |||
| ) |
Create new watch_t and add it on the beginning of watches list.
| plugin | - plugin | |
| fd | - fd to watch data for. | |
| type | - type of watch. | |
| handler | - handler of watch. | |
| data | - data which be passed to handler. |
| watch_t* watch_add_session | ( | session_t * | session, | |
| int | fd, | |||
| watch_type_t | type, | |||
| watcher_session_handler_func_t * | handler | |||
| ) |
Create new session watch_t and add it on the beginning of watches list.
| session | - session | |
| fd | - fd to watch data for | |
| type | - type of watch. | |
| handler | - handler of watch. |
| watch_t* watch_find | ( | plugin_t * | plugin, | |
| int | fd, | |||
| watch_type_t | type | |||
| ) |
| void watch_free | ( | watch_t * | w | ) |
| void watch_handle | ( | watch_t * | w | ) |
Handler for watches with type: WATCH_READ or WATCH_WRITE
Mark watch with w->removed = -1, to indicate that watch is in use. And it shouldn't be executed again. [If watch can or even must be executed twice from ekg_loop() than you must change w->removed by yourself.]
If handler of watch return -1 or watch was removed inside function [by watch_remove() or watch_free()]. Than it'll be removed.
ELSE Update w->started field to current time.
| w | - watch_t to handler |
| void watch_handle_line | ( | watch_t * | w | ) |
| int watch_handle_write | ( | watch_t * | w | ) |
| int watch_remove | ( | plugin_t * | plugin, | |
| int | fd, | |||
| watch_type_t | type | |||
| ) |
| int watch_write | ( | watch_t * | w, | |
| const char * | format, | |||
| ... | ||||
| ) |
| int watch_write_data | ( | watch_t * | w, | |
| const char * | buf, | |||
| int | len | |||
| ) |
1.7.1