1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 03:03:12 +02:00

Add of "modifier" hook, migration of charset plugin to new API, SIGHUP signal catched (reload all config files), better config files reloading

This commit is contained in:
Sebastien Helleu
2008-01-24 16:50:20 +01:00
parent 25c5bc6421
commit ed26a0389c
48 changed files with 2335 additions and 1113 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ gui_color_get_fg_bg (char *string, char **fg, char **bg)
{
pos_end_fg--;
}
*fg = strndup (string, pos_end_fg - string + 1);
*fg = string_strndup (string, pos_end_fg - string + 1);
}
else
*fg = strudp ("default");
+14 -3
View File
@@ -30,6 +30,7 @@
#include <signal.h>
#include "../../core/weechat.h"
#include "../../core/wee-command.h"
#include "../../core/wee-config.h"
#include "../../core/wee-hook.h"
#include "../../core/wee-string.h"
@@ -119,7 +120,7 @@ gui_main_init ()
}
/*
* gui_main_quit: quit weechat (signal received)
* gui_main_quit: quit WeeChat
*/
void
@@ -128,6 +129,16 @@ gui_main_quit ()
quit_weechat = 1;
}
/*
* gui_main_reload: reload WeeChat configuration
*/
void
gui_main_reload ()
{
command_reload (NULL, NULL, 0, NULL, NULL);
}
/*
* gui_main_loop: main loop for WeeChat with ncurses GUI
*/
@@ -147,8 +158,8 @@ gui_main_loop ()
/* catch SIGTERM signal: quit program */
util_catch_signal (SIGTERM, &gui_main_quit);
/* cach SIGHUP signal: reload configuration */
util_catch_signal (SIGHUP, &gui_main_quit);
/* catch SIGHUP signal: reload configuration */
util_catch_signal (SIGHUP, &gui_main_reload);
/* catch SIGWINCH signal: redraw screen */
util_catch_signal (SIGWINCH, &gui_window_refresh_screen_sigwinch);
-4
View File
@@ -24,10 +24,7 @@
#endif
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <signal.h>
#include <libgen.h>
#include "../../core/weechat.h"
#include "../../core/wee-config.h"
@@ -1334,7 +1331,6 @@ gui_window_refresh_screen_sigwinch ()
{
gui_window_refresh_needed = 1;
//gui_window_refresh_screen (0);
signal (SIGWINCH, &gui_window_refresh_screen_sigwinch);
}
/*
+2 -2
View File
@@ -710,8 +710,8 @@ gui_completion_build_list_template (struct t_gui_completion *completion,
{
if (pos_end > pos)
{
custom_completion = strndup (pos,
pos_end - pos);
custom_completion = string_strndup (pos,
pos_end - pos);
if (custom_completion)
{
gui_completion_custom (completion,
+2 -2
View File
@@ -405,7 +405,7 @@ gui_keyboard_new (char *key, char *command, t_gui_key_func *function, char *args
{
length = strlen (args);
if ((length > 1) && (args[length - 1] == '"'))
new_key->args = strndup (args + 1, length - 2);
new_key->args = string_strndup (args + 1, length - 2);
else
new_key->args = strdup (args);
}
@@ -544,7 +544,7 @@ gui_keyboard_bind (char *key, char *command)
{
ptr_args = strchr (command, ' ');
if (ptr_args)
command2 = strndup (command, ptr_args - command);
command2 = string_strndup (command, ptr_args - command);
else
command2 = strdup (command);
if (command2)