summaryrefslogtreecommitdiff
path: root/src/core/wee-command.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-06-26 18:15:42 +0200
committerSebastien Helleu <flashcode@flashtux.org>2011-06-26 18:15:42 +0200
commit19bc95b96189de5a645adbe7b3487d5de1b835e7 (patch)
treeb68d3d98d3d643bc02fba218db7f7ed6cd07ea2c /src/core/wee-command.c
parent2a630031fd3c868733e3038c3e19ad4b53a8d8ce (diff)
downloadweechat-19bc95b96189de5a645adbe7b3487d5de1b835e7.zip
core: many improvements on hdata
New features: - add optional hdata name for variables in hdata - add plugin API functions: hdata_get_var_hdata - use hashtable to store hdata (created by WeeChat and plugins) - free hdata and infolists created by plugin on plugin unload - free all hdata on exit - add "free" option to command /debug hdata - remove hdata for hooks
Diffstat (limited to 'src/core/wee-command.c')
-rw-r--r--src/core/wee-command.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index 85a8ec15e..a47450d84 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -40,6 +40,7 @@
#include "wee-config-file.h"
#include "wee-debug.h"
#include "wee-hashtable.h"
+#include "wee-hdata.h"
#include "wee-hook.h"
#include "wee-input.h"
#include "wee-list.h"
@@ -1154,7 +1155,10 @@ COMMAND_CALLBACK(debug)
}
else if (string_strcasecmp (argv[1], "hdata") == 0)
{
- debug_hdata ();
+ if ((argc > 2) && (string_strcasecmp (argv[2], "free") == 0))
+ hdata_free_all ();
+ else
+ debug_hdata ();
}
else if (string_strcasecmp (argv[1], "infolists") == 0)
{
@@ -4846,8 +4850,8 @@ command_init ()
N_("list"
" || set <plugin> <level>"
" || dump [<plugin>]"
- " || buffer|color|hdata|infolists|memory|tags|term"
- "|windows"),
+ " || buffer|color|infolists|memory|tags|term|windows"
+ " || hdata [free]"),
N_(" list: list plugins with debug levels\n"
" set: set debug level for plugin\n"
" plugin: name of plugin (\"core\" for WeeChat core)\n"
@@ -4857,7 +4861,8 @@ command_init ()
" buffer: dump buffer content with hexadecimal values "
"in log file\n"
" color: display infos about current color pairs\n"
- " hdata: display infos about hdata\n"
+ " hdata: display infos about hdata (with free: remove "
+ "all hdata in memory)\n"
"infolists: display infos about infolists\n"
" memory: display infos about memory usage\n"
" tags: display tags for lines\n"
@@ -4868,7 +4873,7 @@ command_init ()
" || dump %(plugins_names)|core"
" || buffer"
" || color"
- " || hdata"
+ " || hdata free"
" || infolists"
" || memory"
" || tags"