ajout d'un plugin weechat en développement
This commit is contained in:
parent
249332c0e8
commit
dc2c462f7e
@ -28,6 +28,8 @@ int main(int argc, char * argv[])
|
||||
case '?':
|
||||
fprintf(stdout,"erreur : %s\n",optopt);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
// s'il reste des options
|
||||
|
25
C_Language/weechat_plugins/Makefile
Normal file
25
C_Language/weechat_plugins/Makefile
Normal file
@ -0,0 +1,25 @@
|
||||
# $@ : nom de la cible
|
||||
# $< : nom de la première dépendance
|
||||
# $^ : liste des dépendances
|
||||
# $? : liste des dépendances plus récentes que la cible
|
||||
# $* : nom du fichier sans suffixe
|
||||
|
||||
CC=gcc
|
||||
CFLAGS = -Wall -fPIC
|
||||
EXEC = currentsong
|
||||
|
||||
gcc -fPIC -Wall -c toto.c
|
||||
gcc -shared -fPIC -o libtoto.so toto.o
|
||||
|
||||
all: $(EXEC)
|
||||
|
||||
$(EXEC) : $(EXEC).o
|
||||
$(CC) -o lib$(EXEC).so -shared $<
|
||||
|
||||
%.o : %.c
|
||||
$(CC) -c $< $(OPTIONS)
|
||||
|
||||
clean:
|
||||
@rm -rf *.o *.out
|
||||
mrproper: clean
|
||||
@rm lib$(EXEC).so 2>/dev/null
|
46
C_Language/weechat_plugins/currentsong.c
Normal file
46
C_Language/weechat_plugins/currentsong.c
Normal file
@ -0,0 +1,46 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <weechat/weechat-plugin.h>
|
||||
|
||||
WEECHAT_PLUGIN_NAME("currentsong");
|
||||
WEECHAT_PLUGIN_DESCRIPTION("Affiche la musique en cours en utilisant mpc");
|
||||
WEECHAT_PLUGIN_AUTHOR("Karchnu <kane.root@gmail.com>");
|
||||
WEECHAT_PLUGIN_VERSION("0.1");
|
||||
WEECHAT_PLUGIN_LICENSE("GPL3");
|
||||
|
||||
struct t_weechat_plugin *weechat_plugin = NULL;
|
||||
|
||||
int cb_currentsong_plugin(void *data, struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol)
|
||||
{
|
||||
/* pour que le compilateur C soit content */
|
||||
(void) data;
|
||||
(void) buffer;
|
||||
(void) argv;
|
||||
|
||||
weechat_printf (buffer, "TEST DE PLUGIN LAWWWWWWWWWWWWWL");
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
int weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
{
|
||||
weechat_plugin = plugin;
|
||||
|
||||
weechat_hook_command ("currentsong",
|
||||
"Affiche la chanson que vous écoutez",
|
||||
"noargs",
|
||||
"no arguments",
|
||||
NULL,
|
||||
&cb_currentsong_plugin, NULL);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
int weechat_plugin_end (struct t_weechat_plugin *plugin)
|
||||
{
|
||||
/* pour que le compilateur C soit content */
|
||||
(void) plugin;
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
Loading…
Reference in New Issue
Block a user