ncmpc  0.29
plugin.h
Go to the documentation of this file.
1 /* ncmpc (Ncurses MPD Client)
2  * (c) 2004-2017 The Music Player Daemon Project
3  * Project homepage: http://musicpd.org
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef PLUGIN_H
21 #define PLUGIN_H
22 
23 #include <glib.h>
24 #include <stdbool.h>
25 
29 struct plugin_list {
30  GPtrArray *plugins;
31 };
32 
45 typedef void (*plugin_callback_t)(const GString *result, const bool success,
46  const char *plugin_name, void *data);
47 
52 struct plugin_cycle;
53 
57 static inline void
58 plugin_list_init(struct plugin_list *list)
59 {
60  list->plugins = g_ptr_array_new();
61 }
62 
66 bool
67 plugin_list_load_directory(struct plugin_list *list, const char *path);
68 
73 void plugin_list_deinit(struct plugin_list *list);
74 
87 struct plugin_cycle *
88 plugin_run(struct plugin_list *list, const char *const*args,
89  plugin_callback_t callback, void *callback_data);
90 
96 void
97 plugin_stop(struct plugin_cycle *invocation);
98 
99 #endif
void(* plugin_callback_t)(const GString *result, const bool success, const char *plugin_name, void *data)
Definition: plugin.h:45
struct plugin_cycle * plugin_run(struct plugin_list *list, const char *const *args, plugin_callback_t callback, void *callback_data)
GPtrArray * plugins
Definition: plugin.h:30
bool plugin_list_load_directory(struct plugin_list *list, const char *path)
void plugin_stop(struct plugin_cycle *invocation)
void plugin_list_deinit(struct plugin_list *list)
Definition: plugin.h:29