1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-18 09:04:47 +02:00

Compare commits

...

325 Commits

Author SHA1 Message Date
Sebastien Helleu 72d15555ac Version 0.2.0 2006-08-19 11:58:58 +00:00
Sebastien Helleu 904ed30e82 Added missing API plugin functions in doc: mkdir_home, get_irc_color, input_color, get_window_info, free_window_info, get_buffer_info, free_buffer_info, get_buffer_data, free_buffer_data. Removed /panel command for release. 2006-08-19 11:09:38 +00:00
Sebastien Helleu f782970158 Removed /panel command for release (command under development) 2006-08-19 00:49:22 +00:00
Sebastien Helleu ffd9a850c2 Fixed typos 2006-08-19 00:46:13 +00:00
Sebastien Helleu 3e53c517d0 Updated russian translations 2006-08-18 22:39:43 +00:00
Julien Louis 9d59722879 Sync debian packaging 2006-08-17 23:57:44 +00:00
Sebastien Helleu 6db6b35e40 Added 'C'lear option on IRC raw buffer 2006-08-17 23:24:40 +00:00
Sebastien Helleu aacbf82675 IRC raw buffer now uses join/part prefix with color to display messages 2006-08-17 23:13:32 +00:00
Sebastien Helleu e64138b70a Fixed bug with display of message 329 (channel creation date), now displayed after a /cycle 2006-08-17 23:08:41 +00:00
Sebastien Helleu 440214d098 Added send of "quit" message to server when using /disconnect 2006-08-17 16:12:52 +00:00
Sebastien Helleu 17fdaf83d3 Fixed bug with display of message 329 (channel creation date), now displayed only when joining a new channel 2006-08-17 13:59:27 +00:00
Sebastien Helleu 487d776b87 Added IRC command 329 (channel creation date) 2006-08-17 13:23:31 +00:00
Sebastien Helleu 9f88f68e3b Added missing IRC commands: 310, 326 2006-08-17 12:00:49 +00:00
Sebastien Helleu 5a0461ac69 Fixed "wallops" command when received, now displayed by WeeChat (bug #17441) 2006-08-17 09:47:44 +00:00
Sebastien Helleu 48deeb9e77 Updated hungarian translations 2006-08-16 20:18:40 +00:00
Sebastien Helleu f6fb874c88 Fixed /wallops command (now many words are correctly sent) 2006-08-10 14:14:19 +00:00
Sebastien Helleu 8c2876a77c Fixed command 348 (channel exception list, received by /mode #chan e) 2006-08-10 13:58:10 +00:00
Sebastien Helleu 3060525426 Fixed crash when purging DCC when a closed DCC chat has no more buffer 2006-08-09 22:07:34 +00:00
Sebastien Helleu 5a4515b759 Added DCC fast in doc 2006-08-09 22:06:53 +00:00
Sebastien Helleu 8babdca0dc Added release note about /upgrade and modes when upgrading to version 0.2.0 2006-08-09 11:21:34 +00:00
Sebastien Helleu 1d211a16da Added missing modes (channel & user), now all modes are allowed (bug #16606), added "%m" for completion with self nick (on current server) 2006-08-07 22:26:55 +00:00
Sebastien Helleu f8c913a77a Added missing translations 2006-08-05 22:00:26 +00:00
Sebastien Helleu 5c56f9ff33 Added missing translations 2006-08-05 20:20:13 +00:00
Sebastien Helleu 8361053576 Fixed typo 2006-08-05 20:10:10 +00:00
Sebastien Helleu 70d6af7a0e Added missing IRC command 338 2006-08-05 20:05:53 +00:00
Sebastien Helleu fb607cb4ab Fixed DCC restore after /upgrade (now order is saved) 2006-08-05 19:33:48 +00:00
Sebastien Helleu b2183ee3ed Fixed away after server disconnection (now away is set again when reconnecting) (bug #16359) 2006-08-05 18:44:55 +00:00
Emmanuel Bouthenot 22b80dec65 adding functions : get_buffer_info, get_window_info, get_buffer_data and print_server in scripts API 2006-08-05 14:23:38 +00:00
Sebastien Helleu 8ee907af02 Fixed DCC file connection problem (connection from receiver to sender) 2006-08-05 11:20:58 +00:00
Sebastien Helleu a5cd14add5 Improved DCC speed (up to x5 on LAN) by forking for DCC files and a new option "dcc_fast_send" (does not wait for ACK) (task #5758) 2006-08-03 19:50:52 +00:00
Sebastien Helleu 34ee7e4076 Fixed compilation problems under Irix 2006-07-30 23:25:12 +00:00
Sebastien Helleu b11f2b2c4b Fixed crash when purging DCC with high number of DCC (> window size) 2006-07-30 20:41:49 +00:00
Sebastien Helleu aff43aa355 Added question about $TERM value 2006-07-29 20:10:51 +00:00
Sebastien Helleu d861cb0fd3 Use of constants for min/max DCC blocksize 2006-07-27 21:05:15 +00:00
Sebastien Helleu c92ad8b195 Updated options/commands for doc 2006-07-27 16:11:42 +00:00
Sebastien Helleu 06cc936937 Fixed completion for command handlers (now empty completion_template means nick completion, "-" string means no completion at all) 2006-07-27 16:04:46 +00:00
Sebastien Helleu 451f623c98 Fixed nick alignment problem when look_nickmode is off 2006-07-27 11:11:22 +00:00
Sebastien Helleu 8df7ac464b Added generic function for incoming numeric IRC commands (bug #16611) 2006-07-25 18:06:39 +00:00
Sebastien Helleu 2f6a4140d6 Fixed crash when doing "/part something" on a server buffer (bug #17201) 2006-07-25 15:26:41 +00:00
Sebastien Helleu 9909adc0a4 Removed useless call to doupdate() 2006-07-23 21:30:37 +00:00
Sebastien Helleu 3eced7694b Splited weechat.c into weechat.c and util.c 2006-07-23 11:19:09 +00:00
Sebastien Helleu b7fc6747f6 Charsets are now checked when set by /charset command 2006-07-22 19:46:09 +00:00
Sebastien Helleu ff82fdffb7 Updated translations 2006-07-19 20:46:09 +00:00
Sebastien Helleu 480e40d6f8 Fixed typo 2006-07-19 13:27:48 +00:00
Sebastien Helleu 5699898d5b Added "look_save_on_exit" option (patch from Emanuele Giaquinta) 2006-07-18 16:55:19 +00:00
Sebastien Helleu a0e5c4567b Fixed crash on DCC buffer under Darwin 8 (bug #17115) 2006-07-16 16:44:58 +00:00
Sebastien Helleu 4c4f5ab012 added some panel functions, fixed refresh bugs when terminal is resized: too many refreshs, display bug with splited windows 2006-07-16 11:04:10 +00:00
Sebastien Helleu c308b2ec1f Fixed typo 2006-07-15 17:29:29 +00:00
Sebastien Helleu cc47e94422 Replaced weechat-html(-one).xsl by .xsl.in in EXTRA_DIST 2006-07-10 13:29:42 +00:00
Sebastien Helleu 70331a15b5 Added "-delete" argument for /topic completion 2006-07-09 21:35:13 +00:00
Sebastien Helleu 6cf207f23a Renamed weechat-html-one.xsl to weechat-html-one.xsl.in 2006-07-07 10:31:50 +00:00
Sebastien Helleu 7fae7c504a Renamed weechat-html.xsl to weechat-html.xsl.in 2006-07-07 10:31:31 +00:00
Sebastien Helleu 7f68da2c74 Added configure option for doc XSL prefix (bug #16991) 2006-07-07 10:29:01 +00:00
Sebastien Helleu ee68e1c944 Fixed typo in help for script plugin commands (/perl, /python, /ruby, /lua) 2006-07-04 07:45:39 +00:00
Sebastien Helleu ede2bf1374 Fixed typos 2006-07-01 11:59:06 +00:00
Sebastien Helleu 9563cf2b9d Fixed bug with spaces in script names (bug #16957) 2006-06-30 13:02:25 +00:00
Sebastien Helleu 2068aa5322 Replaced call to plugin_find_server_channel() by gui_buffer_search() in weechat_plugin_get_buffer_data() 2006-06-29 13:37:44 +00:00
Julien Louis 0221e4ab15 Sync with official debian package 2006-06-29 09:55:23 +00:00
Sebastien Helleu f50ed1f267 Updated translations 2006-06-28 21:51:21 +00:00
Julien Louis f46984357d Fix evaluation of ${datadir} with new (CVS) autoconf 2006-06-28 21:50:28 +00:00
Sebastien Helleu b38908ff67 Fixed random crash when "MODE #chan -l" is received 2006-06-28 21:19:02 +00:00
Sebastien Helleu eccf1ad92d File automatically updated 2006-06-28 21:18:34 +00:00
Sebastien Helleu f0541c5f12 Fixed bug in IRC parser (random crash with malformed IRC messages) 2006-06-28 17:53:01 +00:00
Sebastien Helleu 37edc90d7f Fixed refresh bug (too many refresh) when terminal is resized 2006-06-26 21:21:43 +00:00
Sebastien Helleu 055a2c6a64 Fixed crash with crash dump (nice isn't it?) 2006-06-26 18:42:16 +00:00
Sebastien Helleu c5f1a1af6c Case ignored for channel names in charset options (bug #16858) 2006-06-26 09:58:55 +00:00
Sebastien Helleu e5ba6dcb85 Fixed crash when setting look_one_server_buffer to ON (bug #16932) 2006-06-24 08:41:01 +00:00
Sebastien Helleu 636a6ca088 Added new functions in plugin/script API: get window info, get buffer info, get buffer content 2006-06-22 16:23:47 +00:00
Emmanuel Bouthenot 9680e67a9a do not check words made of punctuation and digits and fix a bug while saving aspell plugin configuration 2006-06-20 18:00:47 +00:00
Sebastien Helleu 2a22ebbf06 Added Makefile.am for czech quickstart guide 2006-06-20 13:36:29 +00:00
Sebastien Helleu f4f63412f8 Added czech quickstart guide 2006-06-20 08:28:21 +00:00
Sebastien Helleu cd47f4246e Fixed FIFO samples in scripts 2006-06-17 07:03:12 +00:00
Emmanuel Bouthenot 7e3db3dfa4 improve aspell checking, do not check nicks in chans, take care of punctuation in words 2006-06-16 16:06:25 +00:00
Sebastien Helleu dc7595c78e Fixed display bug with special char (bug #16732) 2006-06-16 13:20:11 +00:00
Emmanuel Bouthenot daa802a6a2 improvements in python scripts context management 2006-06-16 11:39:00 +00:00
Emmanuel Bouthenot 3e17a27c01 improve python sub-interpreters management 2006-06-15 22:24:12 +00:00
Sebastien Helleu 87d3725823 Added color encoding for some commands like /me 2006-06-15 13:06:36 +00:00
Emmanuel Bouthenot a38b9ecf79 add iconv/libiconv detection 2006-06-15 09:04:12 +00:00
Sebastien Helleu d8b775d2c4 Renamed plugins names (removed "lib" prefix in name) 2006-06-14 16:23:53 +00:00
Sebastien Helleu f6ff17ebb0 Added completion info for buffers in crash/debug dump 2006-06-14 15:43:33 +00:00
Emmanuel Bouthenot 98338e2e20 clean code, rename global vars and function to avoid possibles crashs 2006-06-13 21:05:41 +00:00
Emmanuel Bouthenot de3d072220 improve global vars uses in plugins 2006-06-13 19:48:32 +00:00
Emmanuel Bouthenot 130d9012f8 add some improvements 2006-06-11 12:48:05 +00:00
Emmanuel Bouthenot c7cab37e16 add missing source header weechat-aspell.h 2006-06-11 12:19:39 +00:00
Emmanuel Bouthenot 99e3f219af make aspell plugin compile with gcc-2.95 2006-06-11 11:20:18 +00:00
Emmanuel Bouthenot 935d8e9304 adding aspell plugin 2006-06-11 02:28:23 +00:00
Emmanuel Bouthenot b48fb5c0ec add get_irc_color function in plugins/scripts 2006-06-10 21:34:16 +00:00
Sebastien Helleu 08aa5570d8 Added error message when home is not a directory (bug #16772) 2006-06-10 19:29:23 +00:00
Sebastien Helleu 62059cb614 Added plugin API function to get IRC color number by name 2006-06-10 18:59:43 +00:00
Sebastien Helleu 4e434e4fb3 Added IRC colors list in plugin header, fixed get_info for channel info (now ok with pv/dcc chat) 2006-06-10 18:07:57 +00:00
Sebastien Helleu 3b2e2ad006 Fixed crash when closing DCC/raw buffer if 2 are open (bug #16808) 2006-06-10 17:35:11 +00:00
Sebastien Helleu cb329a3f33 Fixed crashes with DCC chat remove/purge on DCC view (bug #16775) 2006-06-10 16:42:22 +00:00
Sebastien Helleu 59795445c5 Fixed typos 2006-06-09 22:22:02 +00:00
Sebastien Helleu c1e68a4d24 Modified makefiles for Polish quickstart guide 2006-06-09 05:35:08 +00:00
Julien Louis 9f9c2c7147 Add quickstart Polish translation 2006-06-08 22:13:22 +00:00
Sebastien Helleu 507ae028c5 Fixed problem with bnc (now connected to server when receiving 001, not 004) (bug #16760) 2006-06-07 16:24:17 +00:00
Sebastien Helleu 5235fd119c Added Makefile.am for russian quickstart guide 2006-06-05 22:24:57 +00:00
Sebastien Helleu 0fbcc93e6c Renamed quickstart_guide_ru.txt to weechat_quickstart.ru.txt 2006-06-05 22:06:26 +00:00
Sebastien Helleu 78b4477644 Renamed quickstart_guide_ru.txt to weechat_quickstart.ru.txt 2006-06-05 21:23:38 +00:00
Emmanuel Bouthenot e5eedac4c3 fix a crash in plugin function get_config with config string values stored as int 2006-06-04 12:57:02 +00:00
Julien Louis 439cc20c3d Add russian translation of quickstart_guide 2006-06-03 21:31:06 +00:00
Sebastien Helleu 6460e337f2 Fixed typo 2006-06-01 17:48:56 +00:00
Sebastien Helleu 4af2f3a02d Revert back for plugin loaded, use of GLOBAL instead of LOCAL (problems with Perl DynaLoader) 2006-06-01 14:16:23 +00:00
Sebastien Helleu 7509710c33 Added quickstart guide to .spec for RPM build 2006-06-01 09:09:58 +00:00
Sebastien Helleu 39cc46b609 Added german quickstart guide 2006-05-31 22:10:13 +00:00
Sebastien Helleu 0c7f9f274d Fixed make clean in doc which was deleting weechat quickstart guide 2006-05-31 20:54:17 +00:00
Sebastien Helleu 16c7e4b61c Fixed plugins symbol problem (removed global flag when loading library) 2006-05-31 20:44:04 +00:00
Sebastien Helleu 1ac38c3458 Added quickstart guide 2006-05-31 09:37:11 +00:00
Sebastien Helleu ad624059ad Command /save now writes plugins options (~/.weechat/plugins.rc) 2006-05-29 23:03:53 +00:00
Sebastien Helleu 6599c52352 Fixed /perl command output when no keyboard handler is defined 2006-05-29 22:42:07 +00:00
Sebastien Helleu fe90f3d4e4 Fixed crash with "register" function in plugin scripts (bug #16701) 2006-05-29 22:36:29 +00:00
Sebastien Helleu 8b0ca6ac41 Fixed typo 2006-05-28 18:18:08 +00:00
Sebastien Helleu 7f0a3f795b Fixed random crash at exit (/quit or /upgrade) with splited windows 2006-05-25 19:12:31 +00:00
Sebastien Helleu 02c0b9fab3 Fixed typo 2006-05-25 18:11:46 +00:00
Sebastien Helleu 37b5e25f7f Fixed typos in handler samples 2006-05-25 16:41:10 +00:00
Sebastien Helleu 2e7e88f7fa Replaced tail by sed 2006-05-25 16:39:41 +00:00
Sebastien Helleu 5816e4526e Version 0.2.0-cvs 2006-05-25 00:12:33 +00:00
Sebastien Helleu d13e2328b1 Version 0.1.9 2006-05-24 22:57:33 +00:00
Sebastien Helleu 1838637f24 Fixed /squery command (message sent to server, now ok with # args > 2) 2006-05-24 21:39:39 +00:00
Sebastien Helleu 6beb0f1cb0 Fixed typo when weechat log file is locked 2006-05-22 14:35:23 +00:00
Sebastien Helleu b0260b6494 Fixed typos 2006-05-22 07:31:51 +00:00
Sebastien Helleu fe2bb8516b Fixed /alias command (now ok with an alias name: display content) 2006-05-21 15:10:36 +00:00
Sebastien Helleu 9eb6643f63 Replaced "window close" by "window merge" for default alias "wc" 2006-05-21 15:04:44 +00:00
Sebastien Helleu d2f855b7ee Changed default alias "wc" (now /window close instead of /part) 2006-05-21 14:59:34 +00:00
Sebastien Helleu 586e89b191 Fixed bug with keyboard on GNU/Hurd: use only one select(), waiting for better solution 2006-05-21 14:15:24 +00:00
Emmanuel Bouthenot f6bb78a3b2 make possible to disable flock support 2006-05-21 12:57:24 +00:00
Sebastien Helleu 1c9456f2a7 Added include of time.h 2006-05-21 10:41:15 +00:00
Emmanuel Bouthenot 545fa4c332 Fix some compile erros on OpenBSD and NetBSD 2006-05-20 18:48:13 +00:00
Sebastien Helleu ec9da8cc85 Improved lua plugin detection (bug #16574) 2006-05-20 14:43:49 +00:00
Sebastien Helleu 2322eb0625 Automatically rename log file when crashing, added backtrace to log file 2006-05-20 13:42:08 +00:00
Sebastien Helleu 0eea93bba3 Moved content of src/common/log.c to src/gui/gui-log.c, log.c is now used for WeeChat log file 2006-05-20 09:45:02 +00:00
Sebastien Helleu 1bc71392c4 Use of "which" to find path to executables with addr2line (for backtrace) 2006-05-20 09:43:30 +00:00
Emmanuel Bouthenot 94a5c72590 improve lua checking (libs) in configure 2006-05-19 23:04:06 +00:00
Sebastien Helleu 15f75d157c Added backtrace when WeeChat crashes 2006-05-19 22:49:24 +00:00
Julien Louis 7e802070ca Remove uneeded weechat-curses.links 2006-05-19 19:41:21 +00:00
Emmanuel Bouthenot c2dd7e4ffb check return value in weechat_ruby_exec() to be a valid value and fix crash when called function return nothing 2006-05-17 12:41:58 +00:00
Emmanuel Bouthenot 524fbba036 fix bug in end function calls for plugins/scripts 2006-05-17 09:59:19 +00:00
Emmanuel Bouthenot 87aa03b2cf fix number of args in end function call 2006-05-17 08:58:56 +00:00
Sebastien Helleu a47e4a9567 Updated translations 2006-05-16 13:57:02 +00:00
Sebastien Helleu 88fd88373d Added lock for log file (~/.weechat/weechat.log), only one WeeChat process can use this file (bug #16382) 2006-05-16 13:53:34 +00:00
Sebastien Helleu ed5f70aa6a Updated spanish translations 2006-05-16 08:53:33 +00:00
Sebastien Helleu 8659d94965 Updated translations 2006-05-15 20:24:06 +00:00
Sebastien Helleu 949c4f72e0 Added missing status bar refresh when connecting to server 2006-05-15 17:27:10 +00:00
Sebastien Helleu a4650a7f92 Fixed typos 2006-05-14 20:10:22 +00:00
Sebastien Helleu 127edfb0fe Fixed crash with ncurses color when too many colors defined in ncurses (bug #16556) 2006-05-14 12:42:46 +00:00
Sebastien Helleu 631eab3c66 Fixed 2 crashs: with malformed UTF-8 strings and with ncurses color when too many colors defined in ncurses 2006-05-14 11:06:16 +00:00
Sebastien Helleu 1418897108 Fixed typo 2006-05-14 09:25:55 +00:00
Sebastien Helleu f4ab9dcc33 Updated translations 2006-05-14 09:24:57 +00:00
Sebastien Helleu d88ad92c72 Added missing IRC commands (006, 007, 310, 379) 2006-05-14 08:45:55 +00:00
Sebastien Helleu 01aa8472c0 Added charset encoding for some command arguments (like /me, /msg, /query, ..) 2006-05-13 21:04:27 +00:00
Sebastien Helleu c1ce18e2f6 Updated doc 2006-05-13 17:57:50 +00:00
Sebastien Helleu bdaaa6182f Fixed typos in doc 2006-05-13 17:56:06 +00:00
Julien Louis c7a8d68f70 Sync debian packaging stuff with official packages 2006-05-13 08:45:19 +00:00
Sebastien Helleu 78ca78855e Added new key to find previous completion (shift-tab by default) 2006-05-13 00:06:18 +00:00
Sebastien Helleu 293bf5988b Removed unused prefix 2006-05-13 00:04:45 +00:00
Sebastien Helleu 65b4c157d1 Fixed savannah bugs URL 2006-05-12 15:56:09 +00:00
Sebastien Helleu e36b53bf74 Fixed "hostname" option for servers (now really used to set hostname/IP for choosing local interface (ipv4 or ipv6)) 2006-05-12 14:24:23 +00:00
Sebastien Helleu 59cddf7a40 Updated translations 2006-05-10 14:18:36 +00:00
Sebastien Helleu dce5e4fa18 Fixed bug with long outgoing IRC messages (> 512 bytes) (bug #16358) 2006-05-08 22:45:01 +00:00
Emmanuel Bouthenot 5d08d5e27c - fix a crash in ruby when a function return nothing (close bug #16552)
- add a warning when a function return nothing (python, ruby)
2006-05-08 20:22:42 +00:00
Sebastien Helleu 93e69f5b3e Fixed UTF-8 display bug with chars using more than one cell on screen (bug #16356) 2006-05-08 13:26:08 +00:00
Sebastien Helleu beb846884c Added date in doc 2006-05-08 00:44:07 +00:00
Sebastien Helleu 343e7fe59d Added contributors 2006-05-07 23:31:11 +00:00
Sebastien Helleu 057cffe9f0 Fixed display bug with DCC file size when > 1 Gb 2006-05-07 16:21:42 +00:00
Sebastien Helleu 86c2fb3031 Added russian translator name in doc 2006-05-07 14:01:19 +00:00
Sebastien Helleu b7ba64c744 Added some panel structures and functions 2006-05-07 11:40:19 +00:00
Sebastien Helleu 7d944ceca4 Fixed typo in setup option help 2006-05-07 11:35:35 +00:00
Sebastien Helleu 6172338bb7 Fixed refresh bug (deadlock in curses) when terminal is resized (bug #16542) 2006-05-07 11:31:11 +00:00
Emmanuel Bouthenot 27f45cdc6a update email and jabber address 2006-05-05 18:08:44 +00:00
Sebastien Helleu 9761177a2c Fixed nicklist sort bug 2006-05-05 12:59:16 +00:00
Sebastien Helleu 3352658af4 Added russian translations 2006-04-30 14:42:09 +00:00
Sebastien Helleu b314ee0f43 Added german doc 2006-04-30 12:35:58 +00:00
Sebastien Helleu 758f7f0103 Added colors in doc CSS 2006-04-25 17:09:18 +00:00
Sebastien Helleu b33e8c6482 Added IRC commands 290, 292, 437, 974 2006-04-23 16:01:01 +00:00
Sebastien Helleu 23f3622f2c Fixed bug #16369: fixed crash when multiple pv have same name: now it's forbidden and pv buffer is not renamed (when a nick changes) if another exists with same name 2006-04-23 09:22:53 +00:00
Sebastien Helleu 6021ee85cb Fixed bug #16416 (crash when purging old DCC chats) 2006-04-23 08:19:06 +00:00
Sebastien Helleu bcee678a56 Nick modes are now saved with /upgrade 2006-04-22 21:33:49 +00:00
Sebastien Helleu 40ffeb9e0c Splited GUI sources 2006-04-22 21:18:02 +00:00
Sebastien Helleu fb0e3a4e95 Splited gui-display.c into many sources 2006-04-22 21:09:59 +00:00
Sebastien Helleu daf2087164 Command /clear [-all] now clears hotlist 2006-04-21 13:02:50 +00:00
Sebastien Helleu a17a5337dc Removed known bugs, added URL to Savannah bugs page 2006-04-19 13:01:56 +00:00
Sebastien Helleu a56d65a7c0 Fixed crash after /upgrade if a line in history is empty 2006-04-19 12:35:30 +00:00
Sebastien Helleu 5af8e4f6e7 Fixed bug in logs with nick for names lines (nicks on channel when joining new channel) 2006-04-18 13:30:29 +00:00
Sebastien Helleu a065de071c Fixed typo in /window command help 2006-04-16 12:18:53 +00:00
Sebastien Helleu 22d8c1017b Fixed typo in /window command help 2006-04-16 11:56:34 +00:00
Sebastien Helleu 9481ec0c9c Changed default nick prefix/suffix 2006-04-16 10:27:48 +00:00
Sebastien Helleu f80489f469 Added option "look_align_size_max", nick alignment to right is now set by default with size 14 (max 20) 2006-04-16 09:46:23 +00:00
Sebastien Helleu 2fd53dcc37 Fixed many crashes with DCC chat 2006-04-15 16:47:43 +00:00
Sebastien Helleu b34bb801dc Added german translation 2006-04-14 07:21:47 +00:00
Sebastien Helleu 14fdcc5157 Fixed typos 2006-04-13 21:57:12 +00:00
Sebastien Helleu 0b523df418 Fixed typos in doc 2006-04-13 16:13:57 +00:00
Sebastien Helleu b81b747b96 Added more help for input prompt format 2006-04-13 12:04:14 +00:00
Sebastien Helleu 0da4487a11 Added --auto option, to remove wait for Return key (useful for automatic CVS build scripts) 2006-04-12 16:32:24 +00:00
Emmanuel Bouthenot f2258884d9 fix minor bug with ruby 1.9 and stdout/stderr redirections 2006-04-12 15:29:28 +00:00
Sebastien Helleu 1bee0ba0b2 Added new option to customize input prompt, added nick modes, fixed commands 332, 333 (/topic now ok when channel is not opened) 2006-04-12 13:34:33 +00:00
Sebastien Helleu 69730a21dd Removed charset conversion for commands (only allowed in text sent to channel/private) 2006-04-11 09:55:40 +00:00
Sebastien Helleu d6459aa638 Removed color encoding in commands (only allowed in text sent to channel/private) 2006-04-10 15:53:14 +00:00
Sebastien Helleu 58a1fc72db Added nick host in doc (for get_nick_info API function) 2006-04-09 08:51:21 +00:00
Emmanuel Bouthenot 1bc997b238 Fix possible minor bug in getting hostnames in plugins/scripts 2006-04-08 21:37:26 +00:00
Emmanuel Bouthenot 1f03444a6b Added hostnames associeted to nicks in plugins/scripts 2006-04-08 21:03:31 +00:00
Sebastien Helleu c525b231e4 Added hostnames associeted to nicks (available for /ban completion) 2006-04-08 18:38:00 +00:00
Emmanuel Bouthenot 6963ca7b65 make gcc-2.95 happy 2006-04-07 08:00:27 +00:00
Sebastien Helleu 99d86d64ab Added "+p" mode for channels, fixed mode display in status bar 2006-04-04 17:47:31 +00:00
Sebastien Helleu 94face39a6 Updated czech translations 2006-04-04 07:30:20 +00:00
Sebastien Helleu 2a34684bc1 Added alignment for local away message 2006-04-03 21:12:01 +00:00
Sebastien Helleu 5068f4d365 Added nick alignment in DCC chat, /query and /msg, fixed DCC chat bug when closing buffer 2006-04-03 16:01:10 +00:00
Sebastien Helleu 212ec7a76d Added nick alignment in private buffers 2006-04-03 09:35:08 +00:00
Sebastien Helleu 08b0272a9b Fixed typos in doc 2006-04-02 22:03:47 +00:00
Sebastien Helleu d01081241a Added nick alignment options 2006-04-02 21:53:41 +00:00
Sebastien Helleu 8ef6192b49 Fixed string explosion bug (should return 0 with empty string) 2006-04-02 11:37:22 +00:00
Sebastien Helleu f98d66a842 Fixed /buffer close bug with part message 2006-04-02 10:45:29 +00:00
Emmanuel Bouthenot 6175a89580 add regular expression support for /list command 2006-04-01 19:33:02 +00:00
Sebastien Helleu 23bfafed6a Fixed /names command: now displays result when not on a channel 2006-04-01 14:39:51 +00:00
Sebastien Helleu fccefcdf04 Fixed display but with input command line (when text is longer than window size) 2006-04-01 10:03:09 +00:00
Sebastien Helleu d86af240fa Fixed plugin command handler call when no argument is given 2006-04-01 07:43:51 +00:00
Sebastien Helleu c803419616 Fixed nicklist display bugs when on top or bottom of chat window, fixed refresh bug (too many refresh) when terminal is resized 2006-03-31 13:49:58 +00:00
Sebastien Helleu cc324abb75 Fixed bug with /alias and /unalias commands when alias begins with '/' 2006-03-30 17:08:23 +00:00
Sebastien Helleu 8c8a4104f0 Added nick completion for /userhost command 2006-03-30 15:20:28 +00:00
Sebastien Helleu 83bdd97916 Added keyboard handler to plugin API 2006-03-30 12:08:55 +00:00
Sebastien Helleu 56af0e3284 Improved script plugin loader 2006-03-26 09:46:30 +00:00
Sebastien Helleu 9abddbb7e9 Fixed bug with /set string value completion 2006-03-25 11:53:00 +00:00
Sebastien Helleu c0b6a23959 Fixed typo 2006-03-25 11:43:39 +00:00
Sebastien Helleu 173c7f7f2e Fixed typo 2006-03-25 11:32:31 +00:00
Sebastien Helleu eaa33bfb8e Added hostname/IP option for connection to server 2006-03-25 11:20:37 +00:00
Sebastien Helleu fcd3809326 Updated doc 2006-03-24 22:22:30 +00:00
Sebastien Helleu 8d4497a764 Fixed --disable-plugins option in configure script 2006-03-24 09:57:22 +00:00
Sebastien Helleu d9c032fee3 Added /setp command (set plugin options) 2006-03-24 09:38:54 +00:00
Sebastien Helleu 9fb1176b1b Completed /set command help 2006-03-21 14:17:29 +00:00
Sebastien Helleu 9ed873ed94 Fixed high CPU usage when running under a screen that has been killed 2006-03-21 13:27:51 +00:00
Sebastien Helleu 27fd4beca7 Aliases are executed before WeeChat/IRC commands, /builtin command added 2006-03-21 11:41:02 +00:00
Sebastien Helleu 6a55ee4f79 Immediately refresh nick (input window) during server connection process 2006-03-19 16:05:37 +00:00
Sebastien Helleu 4a13abcc9b Updated doc 2006-03-19 12:51:17 +00:00
Sebastien Helleu e499c1cb32 Added /cycle command, /part command does close buffer any more 2006-03-19 12:15:27 +00:00
Julien Louis 12b0742668 Sync Debian packaging stuff with official package 2006-03-18 12:07:14 +00:00
Sebastien Helleu 04e9677405 Fixed bug on ppc 2006-03-18 10:51:53 +00:00
Sebastien Helleu 3ff8d488e7 Version 0.1.9-cvs 2006-03-18 10:51:18 +00:00
Sebastien Helleu a4ee390737 Version 0.1.8 2006-03-18 09:46:07 +00:00
Sebastien Helleu 2b99338176 Version 0.1.8 2006-03-18 09:25:50 +00:00
Sebastien Helleu 1314c8e78e Version 0.1.8 2006-03-18 09:03:14 +00:00
Sebastien Helleu 0277a1eb62 Ruby changes forgotten in ChangeLog 2006-03-17 14:09:34 +00:00
Sebastien Helleu c4bafd3eef Fixed translations 2006-03-16 11:57:10 +00:00
Sebastien Helleu d006811b8e Fixed typos 2006-03-16 10:36:27 +00:00
Sebastien Helleu 2c894b89e7 Fixed /set command when internal server name contains one or many dots 2006-03-14 13:06:48 +00:00
Sebastien Helleu 02d4287ad0 Added missing IRC command "378" 2006-03-14 12:44:42 +00:00
Sebastien Helleu 7fa3dcbb2e Fixed plugin get_info bug when no server at all is opened 2006-03-14 12:43:02 +00:00
Sebastien Helleu 031fab21b0 Fixed display bug when top of buffer is displayed and first line is removed
(according to "history_max_lines" setting)
2006-03-11 07:33:54 +00:00
Sebastien Helleu ea06fca69c Fixed "+I" mode output 2006-03-10 23:19:11 +00:00
Sebastien Helleu 4181fa3f74 Fixed /mode command output 2006-03-10 22:44:21 +00:00
Julien Louis b9e247794e Fix typo in french translation 2006-03-10 20:11:41 +00:00
Sebastien Helleu d6e562ed7e Fixed completion for /away and /nick commands 2006-03-10 09:04:29 +00:00
Sebastien Helleu 227c05447f Improved alias completion (now uses target command for completion) 2006-03-08 15:31:26 +00:00
Sebastien Helleu 1005890db2 Fixed completion bug with commands in pv (nick completion, for example with /me) 2006-03-06 21:09:09 +00:00
Sebastien Helleu 8f714033ac Fixed chmod on home (now chmod is not executed when a directory is user's home) 2006-03-06 20:58:08 +00:00
Sebastien Helleu 1a510e1598 Added missing IRC command "487" 2006-03-04 23:20:41 +00:00
Sebastien Helleu 650805f204 Using new default value for DCC download dir (created at startup), fixed logs dir creation 2006-03-04 15:37:20 +00:00
Sebastien Helleu 919800c37c Added inactivity time, available for plugins via get_info("inactivity") 2006-03-04 14:27:14 +00:00
Sebastien Helleu 92db79989e Keys alt-{home|end} to scroll top/bottom, alt-{f11-f12} to scroll nicklist top/bottom 2006-03-03 10:40:43 +00:00
Sebastien Helleu 5d32ac0d57 Added special names for plugin message handlers: weechat_pv, weechat_highlight, weechat_ctcp, weechat_dcc 2006-03-02 21:54:33 +00:00
Sebastien Helleu bd1685a8fe Updated TODO 2006-03-02 21:54:00 +00:00
Sebastien Helleu 312ad619ae Fixed bug with dl library detection (for FreeBSD and maybe other systems) 2006-03-02 15:58:10 +00:00
Sebastien Helleu e4cc182105 Script plugins now load scripts in WeeChat system share directory 2006-02-28 21:11:34 +00:00
Sebastien Helleu 8c662f69f9 /msg command does not open any buffer any more 2006-02-28 15:59:33 +00:00
Sebastien Helleu 5c29def9d9 Fixed crash when using global history (when older entry is removed) 2006-02-26 11:27:43 +00:00
Sebastien Helleu c0a1673060 Added IRC raw data buffer 2006-02-22 11:58:11 +00:00
Emmanuel Bouthenot 3a79e32dbb fix minor bug and improve backtrace display on errors 2006-02-21 22:43:48 +00:00
Sebastien Helleu 349d9d1028 Fixed display bugs with /kill command 2006-02-21 10:23:35 +00:00
Sebastien Helleu 13ddcc3adc Added infobar_remove in C plugin API 2006-02-20 21:55:51 +00:00
Sebastien Helleu 9373a7a47e Added new plugin API function: remove_infobar 2006-02-20 17:01:18 +00:00
Sebastien Helleu e0c97562a5 Fixed bug in /lua command for timer handlers 2006-02-19 11:17:14 +00:00
Sebastien Helleu 3a213f38ec Added timer handler for plugins 2006-02-19 10:43:47 +00:00
Sebastien Helleu 484274d65f Plugin messages handlers now called when message is ignored; new behaviour for
messages ignored by a message handler: now WeeChat executes standard handler,
treating message as "ignored"
2006-02-18 13:35:06 +00:00
Sebastien Helleu 4f81254e40 Fixed message displayed when a command handler failed (now "failed" instead of
"command not found")
2006-02-18 12:50:55 +00:00
Sebastien Helleu da3f8ade08 Fixed Ruby function "log" (argument count) 2006-02-18 12:50:03 +00:00
Sebastien Helleu 271d1c905f Fixed scripts examples with server/channel/nick info 2006-02-17 15:00:00 +00:00
Sebastien Helleu ae0e17cfe2 Commands allowed when not connected to any server, fixed get_config: now needs exact option name to return value 2006-02-17 14:59:07 +00:00
Sebastien Helleu d69c634d2f Fixed typos 2006-02-17 14:58:01 +00:00
Emmanuel Bouthenot 14c9afb990 fix typo in parsing args for weechat_python_add_command_handler 2006-02-16 21:14:36 +00:00
Sebastien Helleu c491b39388 Updated doc, renamed functions in plugins API 2006-02-16 20:27:28 +00:00
Emmanuel Bouthenot 8855d39f44 make possible to log with plugins / scripts 2006-02-16 16:10:25 +00:00
Sebastien Helleu 91af3fe728 Updated translations 2006-02-16 10:19:07 +00:00
Emmanuel Bouthenot a62a002522 clean code while parsing commands in server_command and make possible to run many (irc or weechat) commands with alias 2006-02-16 09:51:08 +00:00
Sebastien Helleu f79653db8e Updated czech translations 2006-02-14 08:02:47 +00:00
Sebastien Helleu 0538215157 Updated doc for server_command setting 2006-02-12 22:12:05 +00:00
Emmanuel Bouthenot fa02f128ec make possible to run more than one command when connecting to server 2006-02-12 21:50:31 +00:00
Emmanuel Bouthenot 06ecdfdd35 fix some crash (unprotected code execution) and display some kind of backtrace when errors occurs 2006-02-12 01:33:36 +00:00
Emmanuel Bouthenot 00eef1c1bc clean some code 2006-02-12 01:31:35 +00:00
Sebastien Helleu e7fd1a0cb7 Auto-detect all components, and compile if found by default 2006-02-11 10:11:10 +00:00
Sebastien Helleu 321a8a65ad Added Lua 2006-02-11 10:10:26 +00:00
Sebastien Helleu e7f730387f Enable plugins compilation if Lua is enabled (like Perl/Python/Ruby) 2006-02-11 10:09:59 +00:00
Emmanuel Bouthenot e4eeaaf1dd clean code to avoid warning and errors when compiling with gcc-2.95 2006-02-10 12:44:10 +00:00
Sebastien Helleu 4c34ac5d8f Added Lua script plugin 2006-02-09 20:47:16 +00:00
Emmanuel Bouthenot 73990d8caa fix weechat_lua_remove_handler : now really use function args 2006-02-09 10:50:46 +00:00
Emmanuel Bouthenot d4e755a641 fix weechat_lua_add_message_handler : now really use function args 2006-02-09 10:33:48 +00:00
Sebastien Helleu 4a4daf6931 Added lua script plugin, new functions in plugins API 2006-02-08 21:37:17 +00:00
Emmanuel Bouthenot 8ddc5afb21 adding lua plugin/scripts support 2006-02-08 13:14:23 +00:00
Emmanuel Bouthenot a5cef6abde lua plugin/scripts support 2006-02-08 12:06:24 +00:00
Emmanuel Bouthenot 13a6d5b833 adding lua plugin/script 2006-02-08 11:49:04 +00:00
Sebastien Helleu 47b7b1d578 Added new API functions for scripts (list of servers, channels, nicks) 2006-02-08 11:13:49 +00:00
Sebastien Helleu c0a7e4445c Added hungarian translation (thanks to voroskoi) 2006-02-08 10:27:10 +00:00
Sebastien Helleu 80d6b1d952 Fixed XML typos 2006-02-07 21:10:11 +00:00
Sebastien Helleu 75eb47ee9e Added new plugins API functions (get_server_info, free_server_info, get_channel_info, free_channel_info, get_nick_info, free_nick_info) 2006-02-05 20:57:42 +00:00
Sebastien Helleu 6013e43292 Minor changes on server/channel/nick info API functions 2006-02-04 15:25:18 +00:00
Emmanuel Bouthenot 9150cff430 fix minor bugs while detecting lua 2006-02-03 08:31:15 +00:00
Sebastien Helleu 480974b8de Gtk GUI changes, now compile is ok 2006-02-03 00:36:03 +00:00
Emmanuel Bouthenot abeb5a2f48 Move previous GNU/hurd fix
Add lua script/plugin (detect libs and headers)
2006-02-03 00:29:38 +00:00
Emmanuel Bouthenot 4aac135244 fix a missing link in GNU/Hurd by force linking with pthread 2006-02-01 07:33:34 +00:00
Emmanuel Bouthenot f222a6ad7a extending plugins/scripts API by adding get_server_info, get_channel_info and get_nick_info 2006-01-31 13:54:27 +00:00
Sebastien Helleu fe5731dc84 Added options "look_open_near_server" and "look_nick_complete_first" (patch from Gwenn) 2006-01-30 20:42:53 +00:00
Sebastien Helleu 70ad116c0f Added options "look_open_near_server" and "look_nick_complete_first" (patch from Gwenn) 2006-01-30 20:22:40 +00:00
Sebastien Helleu 99a3434733 Fixed bug with elapsed time when away if computer clock was changed (displays 0 if elapsed time is negative) 2006-01-26 16:49:21 +00:00
Sebastien Helleu 0e91f0c208 Fixed bug with /upgrade when servers buffer (with one buffer for all servers) is moved to buffer # > 1 2006-01-26 13:57:27 +00:00
Sebastien Helleu 7711d548c0 Fixed typos 2006-01-26 11:18:59 +00:00
Sebastien Helleu a7479272f0 Fixed bug with "get_dcc_info" plugin interface function 2006-01-26 10:18:50 +00:00
Sebastien Helleu 2e1c6023d7 Fixed bug with option "irc_away_check_max_nicks" (now channels are refreshed when nicks count changed) 2006-01-26 10:04:57 +00:00
Sebastien Helleu 464fc8abdf Added new scroll keys for a few lines up/down (default: meta-pgup/pgdn) (patch from Pistos) 2006-01-25 17:52:11 +00:00
Sebastien Helleu 1e4c1a7073 Fixed compilation problem with debug messages 2006-01-25 17:09:24 +00:00
Sebastien Helleu 1607c44e75 Added new option "irc_away_check_max_nicks" to disable away check on channels with high number of nicks (patch from Gwenn) 2006-01-25 10:31:22 +00:00
Sebastien Helleu 364d774ded Added new command line argument for setting WeeChat homedir (-d or --dir) (patch from Gwenn) 2006-01-25 08:55:24 +00:00
Sebastien Helleu 6972b057d9 Fixed bug with charset in infobar highlights 2006-01-24 15:08:03 +00:00
Sebastien Helleu 8cd8410448 Fixed bugs: buffer detection in plugins/scripts commands, and /history command 2006-01-22 21:30:19 +00:00
Julien Louis 1cbdbffa40 Update debian packaging 2006-01-22 18:34:32 +00:00
Sebastien Helleu 3c16d49d2d Added some info for commands and options help 2006-01-21 21:26:24 +00:00
Sebastien Helleu 083ede73fd Added command line section in doc 2006-01-21 16:49:25 +00:00
Sebastien Helleu 5aeb7921fe Added option "irc_show_away_once", to show away message only once in pv 2006-01-21 11:56:58 +00:00
Sebastien Helleu e907b3b7a5 Version 0.1.8-cvs 2006-01-14 13:05:25 +00:00
326 changed files with 141838 additions and 36672 deletions
+878 -763
View File
File diff suppressed because it is too large Load Diff
+11 -7
View File
@@ -16,10 +16,10 @@ Developers:
* Scripts plugins
Kolter <kolter@free.fr>
Kolter <kolter@openics.org>
Web : http://kolter.free.fr
IRC : nick is "kolter" @ irc.freenode.net
Jabber: kolter@jabber.org
Jabber: kolter@im.openics.org
Debian packager:
@@ -33,11 +33,15 @@ Julien Louis <ptitlouis@sysif.net>
Contributors:
------------
Rudolf Polzer <rpolzer-rp@durchnull.de> (IRC: "divVerent")
Jiri Golembiovsky <golemj@gmail.com> (IRC: "GolemJ")
Jim Ramsay <i.am@jimramsay.com> (IRC: "lack")
Odin <odin@dtdm.org> (IRC: "[Odin]")
Pistos (IRC: "pistos")
Rudolf Polzer <rpolzer-rp@durchnull.de>, IRC: "divVerent"
Jiri Golembiovsky <golemj@gmail.com>, IRC: "GolemJ"
Jim Ramsay <i.am@jimramsay.com>, IRC: "lack"
Odin <odin@dtdm.org>, IRC: "Odin"
Pistos, IRC: "pistos"
Gwenn, IRC: "gwenn"
Voroskoi, IRC: "voroskoi"
Frank Zacharias
Pavel Shevchuk, IRC: "Stalwart"
=====
+2 -12
View File
@@ -1,15 +1,5 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
WeeChat known bugs, 2006-01-14
- display bugs with UTF-8 chars coded on more than 2 bytes
- divide long messages (> 512 bytes) into more messages so IRC server can
parse them correctly
- some refresh bugs with splited windows
- command name for /server can not contain spaces
- when many WeeChat are launched, log file is not properly written
(cleared by each WeeChat at startup)
- WeeChat may crash if too much nicks in nicklist when position is top
or bottom
- ./configure does not check that Gtk 2.0 libraries are installed
WeeChat known bugs:
please look at https://savannah.nongnu.org/bugs/?group=weechat
+151 -11
View File
@@ -1,8 +1,148 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2006-01-14
ChangeLog - 2006-08-19
Version 0.2.0 (2006-08-19):
* added 'C'lear option on IRC raw buffer
* IRC raw buffer now uses join/part prefix with color to display messages
* added send of "quit" message to server when using /disconnect
* fixed "wallops" command when received, now displayed by WeeChat (bug #17441)
* fixed /wallops command (now many words are correctly sent)
* fixed command 348 (channel exception list, received by /mode #chan e)
* added missing modes (channel & user), now all modes are allowed (bug #16606)
* added "%m" for completion with self nick (on current server)
* added missing IRC commands (310, 326, 329, 338)
* fixed DCC restore after /upgrade (order is now correctly saved)
* fixed away after server disconnection (now away is set again when
reconnecting) (bug #16359)
* fixed DCC file connection problem (connection from receiver to sender)
* improved DCC speed (up to x5 on LAN) by forking for DCC files and a
new option "dcc_fast_send" (does not wait for ACK) (task #5758)
* fixed crash when purging DCC with high number of DCC (> window size)
* fixed completion for command handlers (now empty completion_template
means nick completion, "-" string means no completion at all)
* fixed nick alignment problem when look_nickmode is off
* added generic function for incoming numeric IRC commands (bug #16611)
* fixed crash when doing "/part something" on a server buffer (bug #17201)
* charsets are now checked when set by /charset command
* added "look_save_on_exit" option (patch from Emanuele Giaquinta)
* fixed crash on DCC buffer under Darwin 8 (bug #17115)
* added configure option for doc XSL prefix (bug #16991)
* fixed bug with spaces in script names (bug #16957)
* fixed random crash when "MODE #chan -l" is received
* fixed bug in IRC parser (random crash with malformed IRC messages)
* fixed refresh bugs when terminal is resized: too many refreshs,
display bug with splited windows
* case ignored for channel names in charset options (bug #16858)
* fixed crash when setting look_one_server_buffer to ON (bug #16932)
* added new functions in plugin/script API: get window info,
get buffer info, get buffer content
* added polish, russian and czech quickstart guide
* fixed display bug with special char (bug #16732)
* added color encoding for some commands like /me
* renamed plugins names (removed "lib" prefix in name)
* fixed crash when closing DCC/raw buffer if 2 are open (bug #16808)
* fixed crashes with DCC chat remove/purge on DCC view (bug #16775)
* fixed bug with connection to bnc (bug #16760)
* command /save now writes plugins options (~/.weechat/plugins.rc)
* fixed crash with "register" function in plugin scripts (bug #16701)
* fixed random crash at exit (/quit or /upgrade) with splited windows
Version 0.1.9 (2006-05-25):
* fixed /squery command (message sent to server, now ok with # args > 2)
* fixed /alias command (with an alias name, display content)
* improved lua plugin detection (bug #16574)
* added backtrace when WeeChat crashes, log file automatically renamed
* added lock for log file (~/.weechat/weechat.log), only one WeeChat
process can use this file (bug #16382)
* fixed crash with malformed UTF-8 strings
* fixed crash with ncurses color when too many colors defined in ncurses
(bug #16556)
* added new key to find previous completion (shift-tab by default)
* fixed bug with long outgoing IRC messages (> 512 bytes) (bug #16358)
* fixed Ruby crash when handler does not return OK or KO (bug #16552)
* fixed UTF-8 display bug with chars using more than one cell on screen
(bug #16356)
* fixed display bug with DCC file size when > 1 Gb
* fixed refresh bug (deadlock in curses) when terminal is resized
(bug #16542)
* fixed nicklist sort bug
* added russian translations (thanks to Pavel Shevchuk)
* added german doc (thanks to Frank Zacharias)
* added missing IRC commands (006, 007, 290, 292, 310, 379, 437, 974)
* fixed crash when multiple pv have same name: now it's forbidden
and pv buffer is not renamed (when a nick changes) if another
exists with same name (bug #16369)
* command /clear [-all] now clears hotlist
* fixed crash after /upgrade if a line in history is empty (bug #16379)
* fixed many crashes with DCC chat (bug #16416)
* added new option to customize input prompt
* added nick modes
* fixed commands 332, 333 (/topic now ok when channel is not opened)
* removed color encoding and charset conversion for commands (only
allowed in text sent to channel/private)
* added hostnames associeted to nicks (available for /ban completion)
* added "+p" mode for channels, fixed mode display in status bar
* added nick alignment options
* fixed /names command: now displays result when not on a channel
* fixed refresh bug (too many refresh) when terminal is resized
* fixed nicklist display bugs when on top or bottom of chat window
* added keyboard handler to plugin API
* improved script plugin loader
* added hostname/IP option for connection to server
* fixed --disable-plugins option in configure script
* added /setp command (set plugin options)
* fixed high CPU usage when running under a screen that has been killed
* aliases are executed before WeeChat/IRC commands, /builtin command added
* added /cycle command, /part command does close buffer any more (use
/buffer close (or alias /close) to part and close buffer
Version 0.1.8 (2006-03-18):
* improved Ruby plugin
* fixed /set command when internal server name contains one or many dots
* fixed get_info plugin API function when no server at all is opened
* fixed display bug when top of buffer is displayed and first line is
removed (according to "history_max_lines" setting)
* fixed /mode command output
* improved alias completion (now uses target command for completion)
* fixed completion problem in private with nicks
* added missing IRC command (487)
* added inactivity time, available for plugins via get_info("inactivity")
* keys alt-{home|end} to scroll top/bottom, alt-{f11-f12} to scroll
nicklist top/bottom
* added special names for plugin message handlers: weechat_pv,
weechat_highlight, weechat_ctcp, weechat_dcc
* script plugins now load scripts in WeeChat system share directory
* /msg command does not open any buffer any more
* fixed crash when using global history (when older entry is removed)
* added IRC raw data buffer (new key: alt-J + alt-R)
* fixed display bug with /kill command
* added new plugins functions: add_timer_handler, remove_timer_handler,
remove_infobar
* plugin messages handlers now called when message is ignored (by /ignore)
* new behaviour for messages ignored by a message handler: now WeeChat
executes standard handler, treating message as "ignored"
* many commands allowed for aliases
* many commands allowed when connecting to server
* added Lua script plugin
* added functions in plugins API: get_server_info, free_server_info,
get_channel_info, free_channel_info, get_nick_info, free_nick_info
* added option "look_nick_complete_first" (patch from Gwenn)
* added option "look_open_near_server" (patch from Gwenn)
* fixed bug with /upgrade and servers buffer
* fixed bug with "get_dcc_info" plugin interface function
* added new scroll keys for a few lines up/down (default: meta-pgup/pgdn)
(patch from Pistos)
* added new option "irc_away_check_max_nicks" to disable away check on
channels with high number of nicks (patch from Gwenn)
* added new command line argument for setting WeeChat homedir (-d or --dir)
(patch from Gwenn)
* fixed bug with charset in infobar highlights
* fixed bug with buffer detection in plugins/scripts commands
* fixed bug with /history command
* added option "irc_show_away_once", to show away message only once in pv
* added partial hungarian translation
Version 0.1.7 (2006-01-14):
* fixed msg command (now allowed in private buffer with "*" as target)
@@ -22,7 +162,7 @@ Version 0.1.7 (2006-01-14):
* added server/channel arg to /buffer command for jumping to buffer
* fixed display bug in chat window when a message length equals to window
width
* added new keys for switching to other windows: alt-w followed by
* added new keys for switching to other windows: alt-W followed by
alt-{arrow}
* added new keys for scrolling to previous/next highlight: alt-P / alt-N
* added "read marker": an indicator for first unread line in a
@@ -97,7 +237,7 @@ Version 0.1.4 (2005-07-30):
* topic completion now decodes UTF-8 string
* fixed bug with IRC URL on command line (irc://)
* new keyboard management: keys are setup in config file, new command
/key was added and some new default keys were added, alt-k key is
/key was added and some new default keys were added, alt-K key is
used to grab key (useful for /key command)
* added seconds in infobar time (optional thanks to new setting)
* fixed some curses refreshs
@@ -123,14 +263,14 @@ Version 0.1.3 (2005-07-02):
* fixed plugins "print" and "prnt" functions: now ok for writing on server
buffers
* fixed color problem with new libcurses version
* fixed crash when using Alt-S or Alt-X on DCC buffer (Alt-D)
* fixed crash when using alt-S or alt-X on DCC buffer (alt-D)
* fixed startup crash when config file (~/.weechat/weechat.rc) is not found
* improved Perl/Python libs detection for ./configure script
Version 0.1.2 (2005-05-21):
* added Python plugin support, improved Perl interface (and now Perl/Python
libraries are checked by configure script)
* added nicklist scroll keys (Alt+{home/end/pgup/pgdn} or F11/F12)
* added nicklist scroll keys (alt+{home/end/pgup/pgdn} or F11/F12)
* added transfer rate for DCC files
* added "-all" option for /nick command
* buffers timestamp can now be changed (new option in config file)
@@ -199,8 +339,8 @@ Version 0.0.9 (2005-01-01):
* fixed display of nick mode changes
* new command "/buffer close" (close any server/channel/private buffer)
* /notice command fixed (and display when received from server)
* new keys: Ctrl+A (=home), Ctrl+E (=end), Ctrl+W (=Ctrl+Backspace),
Alt-S (switch to server buffer), Alt-X (switch to first channel of next
* new keys: ctrl+A (=home), ctrl+E (=end), ctrl+W (= ctrl+Backspace),
alt-S (switch to server buffer), alt-X (switch to first channel of next
server)
* added new config option: "server_command_delay" (delay in seconds after
startup command for each server)
@@ -217,15 +357,15 @@ Version 0.0.8 (2004-10-30):
to enable/disable this feature
* Fixed crash when resizing terminal to very small size
* "-MORE-" message is now erased when switching to another buffer
* DCC file receive ok (Alt-D for DCC view)
* DCC file receive ok (alt-D for DCC view)
* /query command now reopens private buffer if already opened
* added key for redrawing terminal (Ctrl-L)
* added key for clearing hotlist (Alt-R)
* added key for redrawing terminal (ctrl-L)
* added key for clearing hotlist (alt-R)
Version 0.0.7 (2004-08-08):
* new "col_status_delimiters" config option
* /buffer command added, buffers ordered by number, auto-jump to active
buffers (alt-a), jump to buffers by number (alt-number)
buffers (alt-A), jump to buffers by number (alt-number)
* /window command added, split terminal horizontally/vertically
* unique color for each nick (based on nickname)
* action messages are now considered as messages, not crappy joins/parts
+33 -7
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2006-01-14
WeeChat FAQ, 2006-08-19
=======================
Intended audience:
@@ -53,7 +53,7 @@ A: Because WeeChat is very light and has new features.
* many GUI (Curses, Gtk, wxWidgets, Qt)
* available in many languages
* nicklist available in all GUI
* extensible with scripts (Perl, Python, Ruby)
* extensible with plugins (C, Perl, Python, Ruby, Lua)
* horizontal and vertical window split
* infobar highlight
* FIFO pipe for remote control
@@ -75,7 +75,7 @@ A: For help you can type /help. For help about a command, type /help command.
2.3
================================================================================
Q: I don't see come chars with accents, what can I do?
Q: I don't see some chars with accents, what can I do?
A: You have to setup charset used for decoding (ISO and UTF), encoding, and
internal WeeChat charset.
@@ -95,33 +95,59 @@ A: Key bindings are customizable with /key command.
2.5
================================================================================
Q: How can I load Perl scripts?
Are Perl scripts compatible with X-chat or/and Irssi ?
Are Perl scripts compatible with other IRC clients ?
A: You can use /perl command to load scripts (default path is
~/.weechat/perl).
Note that scripts in ~/.weechat/perl/autoload are automatically loaded
when WeeChat is starting up.
Perl scripts are not compatible with other IRC clients.
2.6
================================================================================
Q: How can I load Python scripts?
Are Python scripts compatible with X-chat or/and Irssi ?
Are Python scripts compatible with other IRC clients ?
A: You can use /python command to load scripts (default path is
~/.weechat/python).
Note that scripts in ~/.weechat/python/autoload are automatically loaded
when WeeChat is starting up.
Python scripts are not compatible with other IRC clients.
2.7
================================================================================
Q: How can I load Ruby scripts?
Are Ruby scripts compatible with other IRC clients ?
A: You can use /ruby command to load scripts (default path is
~/.weechat/ruby).
Note that scripts in ~/.weechat/ruby/autoload are automatically loaded
when WeeChat is starting up.
Ruby scripts are not compatible with other IRC clients.
2.8
================================================================================
Q: How can I load Lua scripts?
Are Lua scripts compatible with other IRC clients ?
A: You can use /lua command to load scripts (default path is
~/.weechat/lua).
Note that scripts in ~/.weechat/lua/autoload are automatically loaded
when WeeChat is starting up.
Lua scripts are not compatible with other IRC clients.
2.9
================================================================================
Q: When I'm using weechat under screen, I have weird chars, when I switch
window for example, how to fix that?
A: This may be caused by bad value of TERM variable (look at echo $TERM).
For example, "xterm-color" displays such weird chars, use "xterm" which
is ok (like many other values).
3.1
@@ -130,7 +156,7 @@ Q: How should I report bugs?
A: There is 3 ways to report bugs:
1. you can join us on IRC: irc.freenode.net, channel #weechat
2. you can submit your bug at this url:
2. you can submit your bug at this URL:
http://savannah.nongnu.org/bugs/?func=addbug&group=weechat
3. you can mail your problem, look at support page for developer's mails:
http://weechat.flashtux.org/support.php
@@ -143,7 +169,7 @@ Q: How should I submit patches?
A: There is 3 ways to submit patches:
1. you can join us on IRC: irc.freenode.net, channel #weechat
2. you can submit your patch at this url:
2. you can submit your patch at this URL:
http://savannah.nongnu.org/patch/?func=addpatch&group=weechat
3. you can mail your patch, look at support page for developer's mails:
http://weechat.flashtux.org/support.php
+31 -5
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2006-01-14
WeeChat FAQ, 2006-08-19
=======================
Public concerné :
@@ -56,7 +56,7 @@ R: Parce que WeeChat est tr
* plusieurs interfaces (Curses, Gtk, wxWidgets, Qt)
* disponible en plusieurs langues
* liste des pseudos disponible dans toutes les interfaces
* extensible par des scripts (Perl, Python, Ruby)
* extensible par des extensions (C, Perl, Python, Ruby, Lua)
* découpage de la fenêtre horizontalement et verticalement
* highlight dans la barre d'infos
* tube FIFO pour contrôle à distance
@@ -100,33 +100,59 @@ R: Les raccourcis clavier sont modifiables avec la commande /key.
2.5
================================================================================
Q: Comment puis-je charger des scripts Perl ?
Les scripts Perl sont-ils compatibles avec X-chat et/ou Irssi ?
Les scripts Perl sont-ils compatibles avec d'autres clients IRC ?
R: La commande /perl permet de charger les scripts Perl (le chemin par défaut
est ~/.weechat/perl).
Notez que les scripts dans ~/.weechat/perl/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Perl ne sont pas compatibles avec d'autres clients IRC.
2.6
================================================================================
Q: Comment puis-je charger les scripts Python ?
Les scripts Python sont-ils compatibles avec X-chat et/ou Irssi ?
Les scripts Python sont-ils compatibles avec d'autres clients IRC ?
R: La commande /python permet de charger les scripts Python (le chemin par
défaut est ~/.weechat/python).
Notez que les scripts dans ~/.weechat/python/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Python ne sont pas compatibles avec d'autres clients IRC.
2.7
================================================================================
Q: Comment puis-je charger des scripts Ruby ?
Les scripts Ruby sont-ils compatibles avec d'autres clients IRC ?
R: La commande /ruby permet de charger les scripts Ruby (le chemin par
défaut est ~/.weechat/ruby).
Notez que les scripts dans ~/.weechat/ruby/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Ruby ne sont pas compatibles avec d'autres clients IRC.
2.8
================================================================================
Q: Comment puis-je charger des scripts Lua ?
Les scripts Lua sont-ils compatibles avec d'autres clients IRC ?
R: La commande /lua permet de charger les scripts Lua (le chemin par
défaut est ~/.weechat/lua).
Notez que les scripts dans ~/.weechat/lua/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Lua ne sont pas compatibles avec d'autres clients IRC.
2.9
================================================================================
Q: Quand j'utilise weechat sous screen, j'ai des caractères bizarres
notamment en changeant de fenêtre, comment corriger ça ?
R: Cela peut être du à la variable TERM qui n'a pas la bonne valeur
(regardez echo $TERM). Par exemple "xterm-color" provoque ce genre de
problèmes, utilisez "xterm" qui est ok (comme plein d'autres valeurs).
3.1
@@ -137,7 +163,7 @@ R: Il y a 3 mani
1. vous pouvez nous joindre sur IRC: irc.freenode.net, canal #weechat
2. vous pouvez soumettre votre bug à cette adresse :
http://savannah.nongnu.org/bugs/?func=addbug&group=weechat
3. vous pouvez envoyer votre problem par mail, consultez la page
3. vous pouvez envoyer votre problème par mail, consultez la page
support pour les mails des développeurs :
http://weechat.flashtux.org/support.php
(vous pouvez souscrire et envoyer à la liste de diffusion
+2 -6
View File
@@ -2,11 +2,7 @@ WeeChat - Installation instructions
===================================
1) Run './configure'
options: --enable-perl : enable Perl scripts
--disable-curses : do not build Curses interface
--enable-gtk : build Gtk+ interface (under development!)
--enable-qt : build Qt interface (not developed!)
--with-debug=X : X=1 for debug compilation, 2 for debug messages
(./configure --help so see options)
2) Run 'make'
@@ -14,4 +10,4 @@ WeeChat - Installation instructions
4) Enjoy ! :-)
See AUTHORS for support, feel free to contact us for any problem ;)
See AUTHORS for support, feel free to contact us for any problem.
+43
View File
@@ -1,6 +1,49 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
* FlashCode, 2006-08-19
Important release notes:
- if you upgraded with /upgrade in WeeChat, you should /disconnect and
then /reconnect on each server, to display properly channel/user modes
- if you're using plugins, you should remove some old plugins libraries
in WeeChat system library directory (commonly
/usr/local/lib/weechat/plugins): remove lib* files (like libperl.*,
libpython.*, ..) and keep only new libraries (perl.*, python.*, ..)
* FlashCode, 2006-05-25
WeeChat 0.1.9 released.
Important release notes:
- please close all DCC chat buffers before using /upgrade command,
otherwise you may experience problems with DCC chats.
- some changes in script API: now timer handlers functions takes exactly
0 (zero) argument (in version 0.1.8, two arguments were mandatory but
not used: server and args)
* FlashCode, 2006-03-18
WeeChat 0.1.8 released.
Important release notes:
- it is recommended for users of version 0.1.7 (or any older), to
replace values in setup file (~/.weechat/weechat.rc) :
- option: log_path: replace "~/.weechat/logs" by "%h/logs"
- option: plugins_path: replace "~/.weechat/plugins" by "%h/plugins"
"%h" is replaced by WeeChat home (default: ~/.weechat, may be overriden
by new command line arg --dir)
- after installing 0.1.8 (or with /upgrade), issue both commands (if you
didn't redefined these keys (alt-home/end):
/key unbind meta-meta2-1~
/key unbind meta-meta2-4~
then launch again WeeChat (or issue /upgrade).
Alt-home/end were used for nicklist scroll, they're now replaced by
Alt-F11/F12.
* FlashCode, 2006-01-14
WeeChat 0.1.7 released.
+3 -4
View File
@@ -12,10 +12,10 @@ Features
* IRC chat client with multi-server connection
* many GUI (curses, Gtk, Qt) (1)
* small, fast and very light
* customizable and extensible with plugins (scripts Perl, Python, Ruby) (2)
* customizable and extensible with plugins (C, Perl, Python, Ruby, Lua)
* compliant with RFC 1459,2810,2811,2812,2813
* developed from scratch
* multi-platform (GNU/Linux, *BSD, Mac OS X, QNX, Windows & other) (3)
* multi-platform (GNU/Linux, *BSD, Mac OS X, QNX, Windows & other) (2)
* 100% GPL & free
@@ -44,5 +44,4 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
---
(1) only Curses interface is available today
(2) only Perl and Python plugins are available today
(3) Windows is under construction
(2) Windows version is under construction
+2 -90
View File
@@ -1,93 +1,5 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
TODO - 2006-01-14
Legend:
# done
+ currently in development
- pending
? is this really necessary?
* General:
+ Windows version
# Solaris version
* Interface:
+ Gtk GUI
? Qt GUI
+ internationalization (traduce WeeChat in many languages)
- add dark colors (demi intensity)
# color for nicks (except own nick) when nick colors are disabled
# allow decode/encode charsets for servers or chan (not globally)
- understand incomplete commands if unambigous (for example: /he for /help is ok)
- interpret 'old-school' special chars in messages: *bold* _underline_ /italic/
- minimal width of nick in text area
- display number of highlights since last buffer read (pink square)
- add "*" on the side of message buffer when alt-j or other meta modifier is on
- completion with tab key for all words starting with "#" by opened chans names
- completion when input line is empty should add last nick that wrote to me
- open new channels near server (not at the end of buffers)
- add filename completion (for example with /dcc send)
* WeeChat commands
- be able to bind a key on more than one command
- be able to make an alias running more than one command
- host with "*" possible with /ignore command
- "/completion" command: do shortcuts (for example when we type "u"
in the text bar it send it to the server as "you")
- "/last": command to look for text in previous messages
# completion system for scripts arguments
# "/upgrade" command: reload WeeChat himself without disconnecting from server
- get help on config settings with /help option instead of /set option (since
many options can be displayed and help is not displayed in this case)
- "/cycle": do a /part then /join on current channel
- be able to save the current buffer with a single command
(/buffer dump /path/to/file), or to make it possible to write a script
that does so (see plugins)
- "/reconnect": reconnect to all servers, without waiting for auto-reconnect delay after disconnection
* IRC protocol:
# customizable CTCP version reply (possible by plugin script)
- complete "/list" command: add regexp search, display only channels that
match regexp
- when we're away, WeeChat should log all the lines begenning by our nick.
When we come back from our away it should print it to the current window
- "/notify" and "/unnotify" command to be warn by WeeChat when a given
nick/host connect to the given irc network
- display one time away message of remote user in private (optional)
- add max number of nicks for away check (do not check away nicks on channels with high number of nicks)
- add anti-flood mechanism, when pasting more than N lines
- add mask for /ban command, and ban types (host, nick)
* Configuration:
- be able to launch more than one command when connecting to server
- use ~/.weechat/dcc by default for DCC incoming files (and create
directory at startup if not found)
- add global username/realname, used if server values are not filled
- add command line arg (--dir ?) to choose weechat home dir
(~/.weechat by default)
- be able to set more than one server address for network
- save buffer numbers (order) to config file and restore them when
opened, or make it possible by script
* Plugins:
- allow print function to write on all buffers or all channels of a server
- Ruby plugin
- "/ruby load" and "/ruby unload" commands to (un)load Ruby scripts
- add "outgoing" message event so scripts can edit user-input text before
it is sent to the channel
- add a timer function so scripts can do things like timeouts, delayed
processing, etc.
- allow print function to write on all buffers or all channels of a server
- allow plugins to perform actions on "highlight" messages
- get_servers(), get_channels(server), get_nicks(server,channel)
- Lua plugin
- Tcl plugin
- Php plugin (maybe if possible)
? "fish" plugin (cf http://fish.sekure.us/)
- script plugins (perl, python, ruby, ..) should load scripts in system dir,
not only ~/.weechat/xxxx/autoload/
- allow plugins to get the contents of a specified (or at least the
"current") buffer.
WeeChat TODO:
please look at https://savannah.nongnu.org/task/?group=weechat
+9 -5
View File
@@ -3,14 +3,18 @@
# gettextize updates Makefile.am, configure.in
cp configure.in configure.in.old
cp Makefile.am Makefile.am.old
gettextize --copy --force --intl --no-changelog &&
if test "$1" = "--auto" ; then
grep -v 'read dummy < /dev/tty' $(which gettextize) | /bin/sh -s -- --copy --force --intl --no-changelog
else
gettextize --copy --force --intl --no-changelog
fi
mv Makefile.am.old Makefile.am
mv configure.in.old configure.in
libtoolize --automake --force --copy &&
aclocal &&
libtoolize --automake --force --copy
aclocal
# autoheader creates config.h.in needed by autoconf
autoheader &&
autoheader
# autoconf creates configure
autoconf &&
autoconf
# automake creates Makefile.in
automake --add-missing --copy --gnu
+513 -157
View File
@@ -19,10 +19,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT(WeeChat, 0.1.7, flashcode@flashtux.org)
AC_INIT(WeeChat, 0.2.0, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/common/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.1.7])
AM_INIT_AUTOMAKE([weechat], [0.2.0])
# Checks for programs
AC_PROG_CC
@@ -32,6 +32,7 @@ AM_PROG_LIBTOOL
# Add some flags for some OS
case "$host_os" in
freebsd* | openbsd*)
CFLAGS="$CFLAGS -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
;;
netbsd*)
@@ -46,7 +47,7 @@ solaris*)
esac
# Gettext
ALL_LINGUAS="fr es cs"
ALL_LINGUAS="fr es cs hu de ru"
AM_GNU_GETTEXT
# Checks for libraries
@@ -55,7 +56,12 @@ AC_CHECK_LIB(ncursesw, initscr, LIBNCURSESW_FOUND=1, LIBNCURSESW_FOUND=0)
# Checks for header files
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h libintl.h limits.h locale.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h sys/types.h unistd.h pwd.h errno.h])
AC_CHECK_HEADERS([arpa/inet.h libintl.h limits.h locale.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h sys/types.h unistd.h pwd.h errno.h regex.h wchar.h sys/file.h])
if echo "$host_os" | grep "^openbsd" 1>/dev/null 2>&1 ; then
AC_CHECK_HEADER(utf8/wchar.h, LDFLAGS="$LDFLAGS -lutf8", [AC_MSG_ERROR([
*** on OpenBSD systems, package libutf8 must be installed to compile WeeChat])])
fi
# Checks for typedefs, structures, and compiler characteristics
AC_HEADER_TIME
@@ -78,7 +84,7 @@ AC_MSG_RESULT($ac_cv_type_socklen_t)
# Checks for library functions.
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([gethostbyname gethostname getsockname gettimeofday inet_ntoa memset mkdir select setlocale socket strcasecmp strchr strdup strncasecmp strpbrk strrchr strstr uname])
AC_CHECK_FUNCS([gethostbyname gethostname getsockname gettimeofday inet_ntoa memset mkdir select setlocale socket strcasecmp strchr strdup strncasecmp strpbrk strrchr strstr uname regexec])
# Variables in config.h
@@ -89,31 +95,32 @@ AH_VERBATIM([PLUGINS], [#undef PLUGINS])
AH_VERBATIM([PLUGIN_PERL], [#undef PLUGIN_PERL])
AH_VERBATIM([PLUGIN_PYTHON], [#undef PLUGIN_PYTHON])
AH_VERBATIM([PLUGIN_RUBY], [#undef PLUGIN_RUBY])
AH_VERBATIM([PLUGIN_LUA], [#undef PLUGIN_LUA])
AH_VERBATIM([PLUGIN_ASPELL], [#undef PLUGIN_ASPELL])
AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS])
AH_VERBATIM([HAVE_FLOCK], [#undef HAVE_FLOCK])
AH_VERBATIM([DEBUG], [#undef DEBUG])
# Arguments for ./configure
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=compiled if found)],enable_ncurses=$enableval,enable_ncurses=yes)
AC_ARG_ENABLE(wxwidgets, [ --enable-wxwidgets Turn on WxWidgets interface (default=no wxwidgets)],enable_wxwidgets=$enableval,enable_wxwidgets=no)
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no Gtk+)],enable_gtk=$enableval,enable_gtk=no)
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no Qt)],enable_qt=$enableval,enable_qt=no)
AC_ARG_ENABLE(plugins, [ --disable-plugins Turn off plugins support (default=plugins enabled)],enable_plugins=$enableval,enable_plugins=yes)
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl script plugin (default=no Perl plugin)],enable_perl=$enableval,enable_perl=no)
AC_ARG_ENABLE(python, [ --enable-python Turn on Python script plugin (default=no Python plugin)],enable_python=$enableval,enable_python=no)
AC_ARG_ENABLE(ruby, [ --enable-ruby Turn on Ruby script plugin (default=no Ruby script)],enable_ruby=$enableval,enable_ruby=no)
AC_ARG_ENABLE(gnutls, [ --disable-gnutls Turn off gnutls support (default=compiled if found)],enable_gnutls=$enableval,enable_gnutls=yes)
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=1)],debug=$withval,debug=1)
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=compiled if found)],enable_ncurses=$enableval,enable_ncurses=yes)
AC_ARG_ENABLE(wxwidgets, [ --enable-wxwidgets Turn on WxWidgets interface (default=no wxwidgets)],enable_wxwidgets=$enableval,enable_wxwidgets=no)
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk interface (default=no Gtk)],enable_gtk=$enableval,enable_gtk=no)
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no Qt)],enable_qt=$enableval,enable_qt=no)
AC_ARG_ENABLE(plugins, [ --disable-plugins Turn off plugins support (default=plugins enabled)],enable_plugins=$enableval,enable_plugins=yes)
AC_ARG_ENABLE(perl, [ --disable-perl Turn off Perl script plugin (default=compiled if found)],enable_perl=$enableval,enable_perl=yes)
AC_ARG_ENABLE(python, [ --disable-python Turn off Python script plugin (default=compiled if found)],enable_python=$enableval,enable_python=yes)
AC_ARG_ENABLE(ruby, [ --disable-ruby Turn off Ruby script plugin (default=compiled if found)],enable_ruby=$enableval,enable_ruby=yes)
AC_ARG_ENABLE(lua, [ --disable-lua Turn off Lua script plugin (default=compiled if found)],enable_lua=$enableval,enable_lua=yes)
AC_ARG_WITH(lua-inc, [ --with-lua-inc=DIR, Lua include files are in DIR (default=autodetect)],lua_inc=$withval,lua_inc='')
AC_ARG_WITH(lua-lib, [ --with-lua-lib=DIR, Lua library files are in DIR (default=autodetect)],lua_lib=$withval,lua_lib='')
AC_ARG_WITH(lua-suffix, [ --with-lua-suffix=ARG Lua is suffixed with ARG (default=autodetect)],lua_suffix=$withval,lua_suffix='')
AC_ARG_ENABLE(aspell, [ --disable-aspell Turn off Aspell plugin (default=compiled if found)],enable_aspell=$enableval,enable_aspell=yes)
AC_ARG_ENABLE(gnutls, [ --disable-gnutls Turn off gnutls support (default=compiled if found)],enable_gnutls=$enableval,enable_gnutls=yes)
AC_ARG_WITH(doc_xsl_prefix, [ --with-doc-xsl-prefix=DIR Docbook html/chunk.xsl is in DIR (default=autodetect)],doc_xsl_prefix=$withval,doc_xsl_prefix='')
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=1)],debug=$withval,debug=1)
AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
AM_CONDITIONAL(GUI_WXWIDGETS, test "$enable_wxwidgets" = "yes")
AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes")
AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
AM_CONDITIONAL(PLUGINS, test "$enable_plugins" = "yes")
AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
not_found=""
# ------------------------------------------------------------------------------
# GUI
@@ -122,18 +129,21 @@ AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
if test "x$enable_ncurses" = "xyes" ; then
if test "$LIBNCURSESW_FOUND" = "0" ; then
if test "$LIBNCURSES_FOUND" = "0" ; then
AC_MSG_ERROR([
AC_MSG_WARN([
*** ncurses library not found!
*** Please install ncurses library or run ./configure with --disable-ncurses parameter.])
fi
AC_MSG_WARN([
*** WeeChat will be built without ncurses support.])
enable_ncurses="no"
not_found="$not_found ncurses"
else
AC_MSG_WARN([
*** ncursesw library not found! Falling back to "ncurses"
*** Be careful, UTF-8 display may not work properly if your locale is UTF-8.])
NCURSES_LIBS="-lncurses"
NCURSES_LIBS="-lncurses"
fi
else
NCURSES_LIBS="-lncursesw"
AC_CHECK_HEADERS(ncursesw/curses.h)
fi
AC_CHECK_HEADERS([ncurses.h ncursesw/curses.h])
AC_SUBST(NCURSES_LIBS)
fi
@@ -163,13 +173,55 @@ fi
#fi
if test "x$enable_gtk" = "xyes" ; then
#if test "$LIBGTK_FOUND" = "0" ; then
# AC_MSG_ERROR([Gtk+ library not found! Install Gtk+ (2.0 or higher) library or run ./configure without --enable-gtk parameter.])
#fi
GTK_CFLAGS=`pkg-config --cflags gtk+-2.0`
GTK_LIBS=`pkg-config --libs gtk+-2.0`
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
AM_PATH_GTK_2_0(2.4.0, LIBGTK_FOUND=1, LIBGTK_FOUND=0)
if test "$LIBGTK_FOUND" = "0" ; then
AC_MSG_WARN([
*** Gtk library not found!
*** WeeChat will be built without Gtk support.])
enable_gtk="no"
not_found="$not_found gtk"
else
GTK_CFLAGS=`pkg-config --cflags gtk+-2.0`
GTK_LIBS=`pkg-config --libs gtk+-2.0`
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
fi
fi
# ------------------------------------------------------------------------------
# iconv
# ------------------------------------------------------------------------------
iconv_found="no"
AC_CHECK_HEADER(iconv.h,ac_found_iconv_header="yes",ac_found_iconv_header="no")
if test "x$ac_found_iconv_header" = "xyes" ; then
AC_CHECK_LIB(iconv,iconv_open,ac_found_iconv_lib="yes",ac_found_iconv_lib="no")
if test "x$ac_found_iconv_lib" = "xyes" ; then
LIBS="$LIBS -liconv"
fi
AC_MSG_CHECKING(for iconv usability in programs)
AC_TRY_RUN([
#include <iconv.h>
int main(int argc, char **argv) {
iconv_t conv = iconv_open("ISO8859-1", "UTF-8");
if (conv != (iconv_t) -1) {
return 0;
}
return 1;
}],iconv_found="yes")
if test "x$iconv_found" = "xno" ; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
fi
fi
if test "x$iconv_found" = "xno" ; then
AC_MSG_ERROR([
*** Iconv headers and/or libraries couldn't be found in your system.
*** Try to install them with your software package manager.
*** WeeChat can't be built without Iconv support.])
fi
# ------------------------------------------------------------------------------
@@ -178,148 +230,331 @@ fi
PLUGINS_LIBS=
if test "x$enable_plugins" != "xyes" ; then
enable_plugins="no"
enable_perl="no"
enable_python="no"
enable_ruby="no"
enable_lua="no"
enable_aspell="no"
fi
# ---------------------------------- perl --------------------------------------
if test "x$enable_perl" = "xyes" ; then
enable_plugins="yes"
AC_PATH_PROGS(PERL, perl perl5)
if test -z $PERL ; then
AC_MSG_ERROR([
*** Perl must be installed on your system
*** but perl interpreter couldn't be found in path.
Please check that perl is in path, or install
it with your software package manager.])
fi
AC_MSG_CHECKING(for Perl headers files)
PERL_HEADER_TEST=`PT=perltest.c ; echo "#include <EXTERN.h>" > $PT; echo "#include <perl.h>" >> $PT; echo "#include <XSUB.h>" >> $PT ; echo "int main() { return 0; }" >> $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ccopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_HEADER_TEST" = "x0" ; then
PERL_CFLAGS=`$PERL -MExtUtils::Embed -e ccopts`
AC_MSG_WARN([
*** Perl must be installed on your system but perl interpreter couldn't be found in path.
*** Please check that perl is in path, or install it with your software package manager.
*** WeeChat will be built without Perl support.])
enable_perl="no"
not_found="$not_found perl"
else
AC_MSG_ERROR([
*** Perl headers couldn't be found in your system.
*** Try to install it with your software package manager.])
fi
AC_MSG_RESULT(found)
AC_MSG_CHECKING(for Perl library)
PERL_LIB_TEST=`PT=perltest.c ; echo "int main() { return 0; }" > $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ldopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_LIB_TEST" = "x0" ; then
PERL_LFLAGS=`$PERL -MExtUtils::Embed -e ldopts`
else
AC_MSG_ERROR([
AC_MSG_CHECKING(for Perl headers files)
PERL_HEADER_TEST=`PT=perltest.c ; echo "#include <EXTERN.h>" > $PT; echo "#include <perl.h>" >> $PT; echo "#include <XSUB.h>" >> $PT ; echo "int main() { return 0; }" >> $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ccopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_HEADER_TEST" = "x0" ; then
PERL_CFLAGS=`$PERL -MExtUtils::Embed -e ccopts`
AC_MSG_RESULT(found)
AC_MSG_CHECKING(for Perl library)
PERL_LIB_TEST=`PT=perltest.c ; echo "int main() { return 0; }" > $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ldopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_LIB_TEST" = "x0" ; then
PERL_LFLAGS=`$PERL -MExtUtils::Embed -e ldopts`
AC_MSG_RESULT(found)
else
AC_MSG_WARN([
*** Perl library couldn't be found in your system.
*** Try to install it with your software package manager.])
*** Try to install it with your software package manager.
*** WeeChat will be built without Perl support.])
enable_perl="no"
not_found="$not_found perl"
fi
else
AC_MSG_WARN([
*** Perl headers couldn't be found in your system.
*** Try to install it with your software package manager.
*** WeeChat will be built without Perl support.])
enable_perl="no"
not_found="$not_found perl"
fi
fi
AC_MSG_RESULT(found)
fi
if test "x$enable_perl" = "xyes" ; then
AC_SUBST(PERL_CFLAGS)
AC_SUBST(PERL_LFLAGS)
AC_DEFINE(PLUGIN_PERL)
fi
# --------------------------------- python -------------------------------------
if test "x$enable_python" = "xyes" ; then
enable_plugins="yes"
AC_PATH_PROGS(PYTHON, python python2.4 python2.3 python2.2)
if test -z $PYTHON ; then
AC_MSG_ERROR([
*** Python must be installed on your system
*** but python interpreter couldn't be found in path.
*** Please check that python is in path, or install
*** it with your software package manager.])
fi
PYTHON_SYSPREFIX=`$PYTHON -c 'import sys; print "%s" % sys.prefix'`
PYTHON_VERSION=`$PYTHON -c 'import sys ; print sys.version[[:3]]'`
PYTHON_INCLUDE=`$PYTHON -c "import distutils.sysconfig,string; print distutils.sysconfig.get_config_var('CONFINCLUDEPY')"`
AC_MSG_CHECKING(for Python header files)
if test -r "$PYTHON_INCLUDE/Python.h"; then
PYTHON_CFLAGS="-I$PYTHON_INCLUDE"
AC_MSG_WARN([
*** Python must be installed on your system but python interpreter couldn't be found in path.
*** Please check that python is in path, or install it with your software package manager.
*** WeeChat will be built without Python support.])
enable_python="no"
not_found="$not_found python"
else
AC_MSG_ERROR([
*** Python header files couldn't be found in your system.
*** Try to install them with your software package manager.])
fi
AC_MSG_RESULT(found)
PYTHON_LIB=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBPL')"`
PYTHON_LFLAGS="-lpython$PYTHON_VERSION "`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBS')+' '+distutils.sysconfig.get_config_var('SYSLIBS')+' '+distutils.sysconfig.get_config_var('LINKFORSHARED')"`
AC_MSG_CHECKING(for Python library)
if test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.so"; then
PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
elif test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.a"; then
PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
elif test -r "$PYTHON_SYSPREFIX/lib/libpython$PYTHON_VERSION.so"; then
PYTHON_LFLAGS="-L$PYTHON_SYSPREFIX/lib/ $PYTHON_LFLAGS"
else
AC_MSG_ERROR([
PYTHON_SYSPREFIX=`$PYTHON -c 'import sys; print "%s" % sys.prefix'`
PYTHON_VERSION=`$PYTHON -c 'import sys ; print sys.version[[:3]]'`
PYTHON_INCLUDE=`$PYTHON -c "import distutils.sysconfig,string; print distutils.sysconfig.get_config_var('CONFINCLUDEPY')"`
AC_MSG_CHECKING(for Python header files)
if test -r "$PYTHON_INCLUDE/Python.h"; then
PYTHON_CFLAGS="-I$PYTHON_INCLUDE"
AC_MSG_RESULT(found)
PYTHON_LIB=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBPL')"`
PYTHON_LFLAGS="-lpython$PYTHON_VERSION "`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBS')+' '+distutils.sysconfig.get_config_var('SYSLIBS')+' '+distutils.sysconfig.get_config_var('LINKFORSHARED')"`
AC_MSG_CHECKING(for Python library)
if test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.so"; then
PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
AC_MSG_RESULT(found)
elif test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.a"; then
PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
AC_MSG_RESULT(found)
elif test -r "$PYTHON_SYSPREFIX/lib/libpython$PYTHON_VERSION.so"; then
PYTHON_LFLAGS="-L$PYTHON_SYSPREFIX/lib/ $PYTHON_LFLAGS"
AC_MSG_RESULT(found)
else
AC_MSG_WARN([
*** Python library couldn't be found in your system.
*** Try to install it with your software package manager.])
*** Try to install it with your software package manager.
*** WeeChat will be built without Python support.])
enable_python="no"
not_found="$not_found python"
fi
else
AC_MSG_WARN([
*** Python header files couldn't be found in your system.
*** Try to install them with your software package manager.
*** WeeChat will be built without Python support.])
enable_python="no"
not_found="$not_found python"
fi
fi
AC_MSG_RESULT(found)
fi
if test "x$enable_python" = "xyes" ; then
AC_SUBST(PYTHON_CFLAGS)
AC_SUBST(PYTHON_LFLAGS)
AC_DEFINE(PLUGIN_PYTHON)
fi
# ---------------------------------- ruby --------------------------------------
if test "x$enable_ruby" = "xyes" ; then
enable_plugins="yes"
AC_PATH_PROGS(RUBY, ruby ruby1.8 ruby1.9)
if test -z $RUBY ; then
AC_MSG_ERROR([
*** Ruby must be installed on your system
*** but ruby interpreter couldn't be found in path.
*** Please check that ruby is in path, or install
*** it with your software package manager.])
fi
RUBY_INCLUDE=`$RUBY -rrbconfig -e "puts Config::CONFIG[['archdir']]"`
AC_MSG_CHECKING(for Ruby header files)
if test -r "$RUBY_INCLUDE/ruby.h"; then
RUBY_CFLAGS="-I$RUBY_INCLUDE"
AC_MSG_WARN([
*** Ruby must be installed on your system but ruby interpreter couldn't be found in path.
*** Please check that ruby is in path, or install it with your software package manager.
*** WeeChat will be built without Ruby support.])
enable_ruby="no"
not_found="$not_found ruby"
else
AC_MSG_ERROR([
RUBY_INCLUDE=`$RUBY -rrbconfig -e "puts Config::CONFIG[['archdir']]"`
AC_MSG_CHECKING(for Ruby header files)
if test -r "$RUBY_INCLUDE/ruby.h"; then
RUBY_CFLAGS="-I$RUBY_INCLUDE"
else
AC_MSG_WARN([
*** Ruby header files couldn't be found in your system.
*** Try to install them with your software package manager.])
*** Try to install them with your software package manager.
*** WeeChat will be built without Ruby support.])
enable_ruby="no"
not_found="$not_found ruby"
fi
AC_MSG_RESULT(found)
RUBY_LFLAGS=`$RUBY -rrbconfig -e "puts Config::CONFIG[['LIBRUBYARG_SHARED']]"`
fi
AC_MSG_RESULT(found)
RUBY_LFLAGS=`$RUBY -rrbconfig -e "puts Config::CONFIG[['LIBRUBYARG_SHARED']]"`
fi
if test "x$enable_ruby" = "xyes" ; then
AC_SUBST(RUBY_CFLAGS)
AC_SUBST(RUBY_LFLAGS)
AC_DEFINE(PLUGIN_RUBY)
fi
# ---------------------------------- lua --------------------------------------
if test "x$enable_lua" = "xyes" ; then
enable_plugins="yes"
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_CFLAGS="$CFLAGS"
ac_save_LDFLAGS="$LDFLAGS"
LUA_CFLAGS=""
LUA_LFLAGS=""
if test -n "$lua_inc"; then
CFLAGS="$CFLAGS -I$lua_inc"
CPPFLAGS="$CPPFLAGS -I$lua_inc"
fi
if test -n "$lua_lib"; then
LDFLAGS="$LDFLAGS -L$lua_lib"
fi
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
PKGCONFIG=""
AC_CHECK_PROGS(PKGCONFIG, pkg-config)
if test "x$PKGCONFIG" != "x"; then
AC_MSG_CHECKING(for Lua headers and librairies with pkg-config)
echo
for l in "$lua_suffix" "" "50" "5.0" "51" "5.1" ; do
pkgconfig_lua_found=`$PKGCONFIG --exists lua$l 2>/dev/null && $PKGCONFIG --exists lualib$l 2>/dev/null`
if test "x$?" = "x0" ; then
LUA_CFLAGS="$LUA_CFLAGS "`$PKGCONFIG --cflags lua$l`
LUA_CFLAGS="$LUA_CFLAGS "`$PKGCONFIG --cflags lualib$l`
LUA_LFLAGS="$LUA_LFLAGS "`$PKGCONFIG --libs lua$l`
LUA_LFLAGS="$LUA_LFLAGS "`$PKGCONFIG --libs lualib$l`
break
fi
done
fi
fi
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
LUACONFIG=""
AC_CHECK_PROGS(LUACONFIG, lua-config lua-config50 lua-config5.0 lua-config51 lua-config5.1)
if test "x$LUACONFIG" != "x" ; then
AC_MSG_CHECKING(for Lua headers and librairies with lua-config)
echo
LUA_CFLAGS=`$LUACONFIG --include`
LUA_LFLAGS=`$LUACONFIG --libs`
fi
fi
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
AC_MSG_CHECKING(for Lua headers and librairies)
echo
AC_CHECK_HEADER(lua.h,ac_found_lua_header="yes",ac_found_lua_header="no")
AC_CHECK_HEADER(lualib.h,ac_found_liblua_header="yes",ac_found_liblua_header="no")
if test "x$ac_found_lua_header" = "xyes" -a "x$ac_found_liblua_header" = "xyes"; then
LUA_CFLAGS="$CFLAGS"
fi
for l in "$lua_suffix" "" "50" "5.0" "51" "5.1" ; do
AC_CHECK_LIB(lua$l,lua_call,ac_found_lua_lib="yes",ac_found_lua_lib="no")
if test "x$ac_found_lua_lib" = "xyes" ; then
LUA_LFLAGS="$LDFLAGS -llua$l -lm"
ac2_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -llua$l -lm"
if echo "$host_os" | grep "^linux" 1>/dev/null 2>&1 ; then
LDFLAGS="$LDFLAGS -ldl"
fi
AC_CHECK_LIB(lualib$l,luaL_openlib,ac_found_liblua_lib="yes",ac_found_liblua_lib="no")
if test "x$ac_found_liblua_lib" = "xyes" ; then
LUA_LFLAGS="$LUA_LFLAGS -llualib$l"
if echo "$host_os" | grep "^linux" 1>/dev/null 2>&1 ; then
LUA_LFLAGS="$LUA_LFLAGS -ldl"
fi
fi
LDFLAGS="$ac2_save_LDFLAGS"
break
fi
done
fi
AC_MSG_CHECKING(for Lua compiling and linking)
LUA_TEST=`LT=luatest.c ; echo "#include <lua.h>" > $LT; echo "#include <lualib.h>" >> $LT; echo "int main() { luaopen_base((lua_State *)lua_open()); return 0; }" >> $LT ; $CC -Wall $LT -o $LT.out $LUA_CFLAGS $LUA_LFLAGS $CFLAGS $LDFLAGS 1>/dev/null 2>&1 ; echo $?; rm -f $LT $LT.out 1>/dev/null 2>&1`
if test "x$LUA_TEST" != "x0" ; then
AC_MSG_RESULT(no)
AC_MSG_WARN([
*** Lua (>=5.0) headers and/or librairies couldn't be found in your system.
*** Try to install liblua, liblualib and liblua-dev with your software package manager.
*** WeeChat will be built without Lua support.])
enable_lua="no"
not_found="$not_found lua"
else
AC_MSG_RESULT(yes)
fi
CFLAGS="$ac_save_CFLAGS"
CPPFLAGS="$ac_save_CPPFLAGS"
LDFLAGS="$ac_save_LDFLAGS"
fi
if test "x$enable_lua" = "xyes" ; then
AC_SUBST(LUA_CFLAGS)
AC_SUBST(LUA_LFLAGS)
AC_DEFINE(PLUGIN_LUA)
fi
# ------------------------------------------------------------------------------
# aspell
# ------------------------------------------------------------------------------
if test "x$enable_aspell" = "xyes" ; then
ASPELL_CFLAGS=""
ASPELL_LFLAGS=""
AC_CHECK_HEADER(aspell.h,ac_found_aspell_header="yes",ac_found_aspell_header="no")
AC_CHECK_LIB(aspell,new_aspell_speller,ac_found_aspell_lib="yes",ac_found_aspell_lib="no")
AC_MSG_CHECKING(for aspell headers and librairies)
if test "x$ac_found_aspell_header" = "xno" -o "x$ac_found_aspell_lib" = "xno" ; then
AC_MSG_RESULT(no)
AC_MSG_WARN([
*** Aspell headers and/or libraries couldn't be found in your system.
*** Try to install them with your software package manager.
*** WeeChat will be built without Aspell support.])
enable_aspell="no"
not_found="$not_found aspell"
else
AC_MSG_RESULT(yes)
ASPELL_LFLAGS="$ASPELL_LFLAGS -laspell"
fi
fi
if test "x$enable_aspell" = "xyes" ; then
AC_SUBST(ASPELL_CFLAGS)
AC_SUBST(ASPELL_LFLAGS)
AC_DEFINE(PLUGIN_ASPELL)
fi
# ------------------------------------------------------------------------------
# dynamic loader
# ------------------------------------------------------------------------------
if test "x$enable_plugins" = "xyes" ; then
AC_CHECK_FUNCS(dlopen, LIBDL_FOUND=yes, LIBDL_FOUND=no)
if test "$LIBDL_FOUND" != "yes"; then
AC_CHECK_LIB(dl, dlopen, LIBDL_FOUND=yes, LIBDL_FOUND=no)
if test "$LIBDL_FOUND" = "yes"; then
PLUGINS_LIBS="-ldl"
else
AC_MSG_ERROR([
*** "dl" library (dynamic library loader) couldn't be found in your system.
*** Try to install it with your software package manager or disable plugins.])
fi
AC_CHECK_LIB(dl, dlopen, [LIBDL_FOUND=yes; PLUGINS_LIBS=-ldl], LIBDL_FOUND=no)
fi
if test "$LIBDL_FOUND" = "yes"; then
AC_DEFINE(PLUGINS)
AC_SUBST(PLUGINS_LIBS)
else
AC_MSG_WARN([
*** "dl" library (dynamic library loader) couldn't be found in your system.
*** Try to install it with your software package manager or disable plugins.
*** WeeChat will be built without any plugin.])
enable_plugins="no"
enable_perl="no"
enable_python="no"
enable_ruby="no"
enable_lua="no"
enable_aspell="no"
not_found="$not_found plugins"
fi
AC_DEFINE(PLUGINS)
fi
AC_SUBST(PLUGINS_LIBS)
# ------------------------------------------------------------------------------
# gnutls
# ------------------------------------------------------------------------------
@@ -327,20 +562,90 @@ AC_SUBST(PLUGINS_LIBS)
if test "x$enable_gnutls" = "xyes" ; then
found_gnutls="no"
AM_PATH_LIBGNUTLS( 1.0.0, found_gnutls=yes, AC_MSG_WARN([[
*** libgnutls was not found. You may want to get it from
*** ftp://ftp.gnutls.org/pub/gnutls/
*** libgnutls was not found. You may want to get it from ftp://ftp.gnutls.org/pub/gnutls/
*** WeeChat will be built without GnuTLS support.]]))
if test "x$found_gnutls" = "xyes" ; then
GNUTLS_CFLAGS=`libgnutls-config --cflags`
GNUTLS_LFLAGS=`libgnutls-config --libs`
AC_SUBST(GNUTLS_CFLAGS)
AC_SUBST(GNUTLS_LFLAGS)
AC_DEFINE(HAVE_GNUTLS)
GNUTLS_CFLAGS=`libgnutls-config --cflags`
GNUTLS_LFLAGS=`libgnutls-config --libs`
AC_SUBST(GNUTLS_CFLAGS)
AC_SUBST(GNUTLS_LFLAGS)
AC_DEFINE(HAVE_GNUTLS)
else
enable_gnutls="no"
not_found="$not_found gnutls"
fi
fi
# ------------------------------------------------------------------------------
# flock
# ------------------------------------------------------------------------------
enable_flock="no"
AC_CACHE_CHECK([for flock() support], ac_have_flock, [
AC_TRY_COMPILE(
[ #include <sys/file.h>
],
[ flock(0, LOCK_SH); ],
[ ac_have_flock="yes" ],
[ ac_have_flock="no" ])])
if test "x$ac_have_flock" = "xyes"; then
enable_flock="yes"
AC_DEFINE(HAVE_FLOCK)
fi
# ------------------------------------------------------------------------------
# backtrace
# ------------------------------------------------------------------------------
enable_backtrace="no"
if test "x$debug" != "x0" ; then
AC_CACHE_CHECK([for execinfo.h and backtrace], ac_have_backtrace, [
AC_TRY_COMPILE(
[ #include <execinfo.h>
],
[ void *trace[128]; int n = backtrace(trace, 128); ],
[ ac_have_backtrace="yes" ],
[ ac_have_backtrace="no" ])])
if test "x$ac_have_backtrace" = "xyes"; then
enable_backtrace="yes"
AC_DEFINE(HAVE_BACKTRACE,1,[glibc backtrace function])
fi
fi
# ------------------------------------------------------------------------------
# documentation
# ------------------------------------------------------------------------------
AC_MSG_CHECKING(for html/chunk.xsl)
DOC_XSL_PREFIX=""
if test -n "$doc_xsl_prefix"; then
doc_xsl_prefix_path="$doc_xsl_prefix"
else
doc_xsl_prefix_path="/usr/share/xml/docbook/xsl-stylesheets-1.69"
doc_xsl_prefix_path="${doc_xsl_prefix_arr} /usr/share/xml/docbook/stylesheet/nwalsh"
fi
for p in $doc_xsl_prefix_path; do
if test -f ${p}/html/chunk.xsl; then
DOC_XSL_PREFIX="$p"
fi
done
if test "x$DOC_XSL_PREFIX" == "x"; then
AC_MSG_RESULT(no)
enable_doc="no"
AC_MSG_WARN([
*** Docbook XSL files not found
*** WeeChat will be built without documentation.
*** Try ./configure --with-doc-xsl-prefix=DIR if you have DIR/html/chunk.xsl file])
else
AC_MSG_RESULT($DOC_XSL_PREFIX)
AC_SUBST(DOC_XSL_PREFIX)
enable_doc="yes"
fi
# ------------------------------------------------------------------------------
# general vars
# ------------------------------------------------------------------------------
@@ -355,23 +660,33 @@ fi
AC_DEFINE_UNQUOTED(PREFIX, "${prefix}")
WEECHAT_LIBDIR=`eval echo ${libdir}/weechat`
WEECHAT_LIBDIR=`eval eval echo ${libdir}/weechat`
AC_DEFINE_UNQUOTED(WEECHAT_LIBDIR, "$WEECHAT_LIBDIR")
WEECHAT_SHAREDIR=`eval echo ${datadir}/weechat`
WEECHAT_SHAREDIR=`eval eval echo ${datadir}/weechat`
AC_DEFINE_UNQUOTED(WEECHAT_SHAREDIR, "$WEECHAT_SHAREDIR")
weechat_libdir=${libdir}/weechat
AC_SUBST(weechat_libdir)
COMMON_CFLAGS="-Wall -W"
AC_MSG_CHECKING([whether we have GNU assembler])
GAS=`as --version < /dev/null 2>/dev/null | grep GNU`
if test "$GAS"; then
COMMON_CFLAGS="${COMMON_CFLAGS} -pipe"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
CFLAGS=`echo $CFLAGS | sed s/-g//g`
if test "x$CFLAGS" = "x" ; then
CFLAGS="-O2"
fi
if test "x$debug" = "x1" || test "x$debug" = "x2" ; then
CFLAGS="-Wall -W $CFLAGS -pipe -g"
CFLAGS="$COMMON_CFLAGS $CFLAGS -g"
else
CFLAGS="-Wall -W $CFLAGS -pipe"
CFLAGS="$COMMON_CFLAGS $CFLAGS"
fi
if test "x$debug" = "x2" ; then
@@ -381,7 +696,7 @@ fi
LIBS="$LIBS $INTLLIBS"
case "$host_os" in
freebsd* | netbsd*)
freebsd*)
if test "x$enable_perl" = "xyes" -o "x$enable_python" = "xyes" ; then
CFLAGS="$CFLAGS -pthread"
fi
@@ -392,6 +707,17 @@ openbsd*)
CFLAGS="$CFLAGS -pthread"
fi
;;
netbsd*)
if test "x$enable_perl" = "xyes" -o "x$enable_python" = "xyes" ; then
CFLAGS="$CFLAGS -pthread"
fi
CFLAGS="$CFLAGS $CPPFLAGS"
;;
gnu*)
if test "x$enable_plugins" = "xyes" ; then
LDFLAGS="$LDFLAGS -lpthread"
fi
;;
*)
;;
esac
@@ -400,10 +726,27 @@ esac
# output Makefiles
# ------------------------------------------------------------------------------
AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
AM_CONDITIONAL(GUI_WXWIDGETS, test "$enable_wxwidgets" = "yes")
AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes")
AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
AM_CONDITIONAL(PLUGINS, test "$enable_plugins" = "yes")
AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
AM_CONDITIONAL(PLUGIN_LUA, test "$enable_lua" = "yes")
AM_CONDITIONAL(PLUGIN_ASPELL, test "$enable_aspell" = "yes")
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
AM_CONDITIONAL(HAVE_FLOCK, test "$enable_flock" = "yes")
AC_OUTPUT([Makefile
doc/Makefile
doc/fr/Makefile
doc/en/Makefile
doc/fr/Makefile
doc/de/Makefile
doc/ru/Makefile
doc/pl/Makefile
doc/cs/Makefile
src/Makefile
src/common/Makefile
src/irc/Makefile
@@ -412,6 +755,8 @@ AC_OUTPUT([Makefile
src/plugins/scripts/perl/Makefile
src/plugins/scripts/python/Makefile
src/plugins/scripts/ruby/Makefile
src/plugins/scripts/lua/Makefile
src/plugins/aspell/Makefile
src/gui/Makefile
src/gui/curses/Makefile
src/gui/wxwidgets/Makefile
@@ -424,7 +769,7 @@ AC_OUTPUT([Makefile
# end message
# ------------------------------------------------------------------------------
listgui=
listgui=""
if test "x$enable_ncurses" = "xyes" ; then
listgui="$listgui ncurses"
fi
@@ -432,7 +777,7 @@ if test "x$enable_wxwidgets" = "xyes"; then
listgui="$listgui WxWidgets"
fi
if test "x$enable_gtk" = "xyes" ; then
listgui="$listgui Gtk+"
listgui="$listgui Gtk"
fi
if test "x$enable_qt" = "xyes" ; then
listgui="$listgui Qt"
@@ -441,7 +786,13 @@ fi
if test "x$listgui" = "x" ; then
AC_MSG_ERROR([
*** No interface specified...
*** Please specify at least ncurses, WxWidgets, Gtk or Qt.])
*** Please enable at least ncurses, WxWidgets, Gtk or Qt.])
fi
if test "x$not_found" != "x" ; then
echo ""
echo "Following components were asked but not found, they will not be built:"
echo "$not_found"
fi
msg_debug_compiler="no"
@@ -454,14 +805,19 @@ if test "x$debug" = "x2" ; then
fi
echo ""
echo "Interfaces.................................... :$listgui"
echo "Build with GNUtls support..................... : $enable_gnutls"
echo "Build with Plugin support..................... : $enable_plugins"
echo " Perl plugin..................... : $enable_perl"
echo " Python plugin................... : $enable_python"
echo " Ruby plugin..................... : $enable_ruby"
echo "Compile with debug info....................... : $msg_debug_compiler"
echo "Print debugging messages...................... : $msg_debug_verbose"
echo "Interfaces........................ :$listgui"
echo "Build with GNUtls support......... : $enable_gnutls"
echo "Build with flock support.......... : $enable_flock"
echo "Build with Plugin support......... : $enable_plugins"
echo " Perl plugin......... : $enable_perl"
echo " Python plugin....... : $enable_python"
echo " Ruby plugin......... : $enable_ruby"
echo " Lua plugin.......... : $enable_lua"
echo " Aspell plugin....... : $enable_aspell"
echo "Compile with debug info........... : $msg_debug_compiler"
echo " Backtrace........... : $enable_backtrace"
echo "Build doc..........................: $enable_doc"
echo "Print debugging messages.......... : $msg_debug_verbose"
echo ""
eval echo "WeeChat will be installed in $bindir."
echo ""
+55
View File
@@ -1,3 +1,58 @@
weechat (0.1.9-3) unstable; urgency=low
* Remove gnutls Build-Depends introduced in the previous upload
(closes: #379765).
* Move xsltproc, docbook-xml, docbook-xsl to Build-Depends-Indep.
* Change icon format from png to xpm.
-- Julien Louis <ptitlouis@sysif.net> Tue, 25 Jul 2006 11:53:25 +0200
weechat (0.1.9-2) unstable; urgency=low
* Fix ${datadir} expansion in configure.in which caused some problem when
loading scripts from /usr/share/weechat.
* Add weechat-scripts to weechat-plugins Suggests.
* Apply patch from Andreas Metzler to make weechat binNMUable
(Closes: #379419).
* Build-Depends against libgnutls13-dev | libgnutls-dev.
-- Julien Louis <ptitlouis@sysif.net> Sun, 23 Jul 2006 17:28:34 +0200
weechat (0.1.9-1) unstable; urgency=low
* New upstream release
-- Julien Louis <ptitlouis@sysif.net> Thu, 25 May 2006 07:40:53 +0200
weechat (0.1.8-2) unstable; urgency=low
* Switch to cdbs
* update debhelper compatibility to 5
* update Build-Depends
* update debian/copyright
* Bump Standards-Version, no changes needed
-- Julien Louis <ptitlouis@sysif.net> Fri, 21 Apr 2006 22:39:00 +0200
weechat (0.1.8-1) unstable; urgency=low
* New upstream release
* Add liblualib50-dev and docbook-xml to Build-Depends
-- Julien Louis <ptitlouis@sysif.net> Sat, 18 Mar 2006 11:32:52 +0100
weechat (0.1.7-2) unstable; urgency=low
* force linking against libpthread on GNU/Hurd (Closes: #350487)
-- Julien Louis <ptitlouis@sysif.net> Sun, 5 Feb 2006 18:23:24 +0100
weechat (0.1.7-1) unstable; urgency=low
* New upstream release
-- Julien Louis <ptitlouis@sysif.net> Sat, 14 Jan 2006 14:14:29 +0100
weechat (0.1.6-2) unstable; urgency=low
* Apply path to fix segfault when removing server.
+1 -1
View File
@@ -1 +1 @@
4
5
+7 -5
View File
@@ -3,12 +3,13 @@ Section: net
Priority: optional
Maintainer: Sebastien Helleu <flashcode@flashtux.org>
Uploaders: Julien Louis <ptitlouis@sysif.net>
Build-Depends: debhelper (>> 4.0.0), libncursesw5-dev (>= 5.2.20020112a-7), ruby1.8-dev, libperl-dev, python-dev, libgnutls-dev, libtool, texinfo
Standards-Version: 3.6.2
Build-Depends-Indep: xsltproc, docbook-xsl, docbook-xml
Build-Depends: cdbs, debhelper (>= 5), libncursesw5-dev, ruby, ruby1.8-dev, libperl-dev, python-dev, liblualib50-dev, libgnutls-dev, libtool, dpkg-dev (>= 1.13.19)
Standards-Version: 3.7.2
Package: weechat
Architecture: all
Depends: weechat-common (= ${Source-Version}), weechat-curses (= ${Source-Version})
Depends: weechat-common (= ${source:Version}), weechat-curses (>= ${binary:Version})
Description: Fast, light and extensible IRC client
WeeChat (Wee Enhanced Environment for Chat) is a fast and light IRC client
for many operating systems. Everything can be done with a keyboard.
@@ -25,8 +26,8 @@ Description: Fast, light and extensible IRC client
Package: weechat-curses
Architecture: any
Depends: ${shlibs:Depends}, weechat-common (= ${Source-Version})
Recommends: weechat-plugins (= ${Source-Version})
Depends: ${shlibs:Depends}, weechat-common (= ${source:Version})
Recommends: weechat-plugins (= ${binary:Version})
Description: Fast, light and extensible IRC client
WeeChat (Wee Enhanced Environment for Chat) is a fast and light IRC client
for many operating systems. Everything can be done with a keyboard.
@@ -52,6 +53,7 @@ Description: Common files for WeeChat
Package: weechat-plugins
Architecture: any
Depends: ${shlibs:Depends}
Suggests: weechat-scripts
Description: Plugins for WeeChat
This package provides some plugins to enhance weechat with scripting languages
such as perl python or ruby.
+3 -1
View File
@@ -3,7 +3,9 @@ Sat, 21 May 2005 08:00:00 +0200.
It was downloaded from http://weechat.flashtux.org/download
Upstream Author: FlashCode <flashcode@flashtux.org>
Upstream Authors:
- FlashCode <flashcode@flashtux.org>
- kolter <kolter@free.fr>
Copyright:
+23 -74
View File
@@ -1,85 +1,34 @@
#!/usr/bin/make -f
# Sample debian/rules that uses cdbs. Originaly written by Robert Millan.
# This file is public domain.
#export DH_VERBOSE=1
DEB_AUTO_CLEANUP_RCS := yes
# Add here any variable or target overrides you need
DEB_CONFIGURE_USER_FLAGS := --with-debug=0
DEB_STRIP_EXCLUDE := libperl.a
DEB_DH_INSTALL_SOURCEDIR := $(CURDIR)/debian/tmp
DEB_INSTALL_DOCS_weechat-common := FAQ FAQ.fr
DEB_DH_MAKESHLIBS_ARGS_weechat-plugins := -n
DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
CFLAGS += -O0
else
CFLAGS += -O2
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
INSTALL_PROGRAM += -s
endif
configure: configure-stamp
configure-stamp:
dh_testdir
./configure --prefix=/usr --sysconfdir=/etc --mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info --enable-perl --enable-python --enable-ruby \
--with-debug=0
touch configure-stamp
ifeq ($(DEB_HOST_ARCH_OS),hurd)
DEB_CONFIGURE_SCRIPT_ENV += LDFLAGS="-lpthread"
endif
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/debhelper.mk
build: build-stamp
build-stamp: configure-stamp
dh_testdir
$(MAKE)
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
-$(MAKE) distclean
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
dh_install
# install -o root -g root -m 755 src/gui/curses/weechat-curses $(CURDIR)/debian/weechat-curses/usr/bin
# install -o root -g root -m 755 src/gui/gtk/weechat-gtk $(CURDIR)/debian/weechat-gtk/usr/bin
install -D -o root -g root -m 644 weechat_icon_32.png $(CURDIR)/debian/weechat-common/usr/share/pixmaps/weechat_icon_32.png
# Build architecture-independent files here.
binary-indep: build install
dh_testdir -pweechat-common -pweechat
dh_testroot -pweechat-common -pweechat
dh_installchangelogs ChangeLog -pweechat-common
dh_installdocs -pweechat-common
dh_installinfo -pweechat-common
dh_installexamples -pweechat-common
dh_compress -pweechat-common -pweechat
dh_link -pweechat usr/share/doc/weechat-common usr/share/doc/weechat
dh_fixperms -pweechat-common -pweechat
dh_installdeb -pweechat-common -pweechat
dh_shlibdeps -pweechat-common -pweechat
dh_gencontrol -pweechat-common -pweechat
dh_md5sums -pweechat-common -pweechat
dh_builddeb -pweechat-common -pweechat
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir -a -pweechat-curses -pweechat-plugins
dh_testroot -a -pweechat-curses -pweechat-plugins
dh_installchangelogs ChangeLog -pweechat-plugins
dh_installdocs -pweechat-plugins
dh_installman doc/weechat-curses.1 -pweechat-curses
dh_link -pweechat-curses usr/share/doc/weechat-common usr/share/doc/weechat-curses
dh_installmenu -pweechat-curses
dh_strip -a -pweechat-curses -pweechat-plugins --exclude=libperl.a
dh_compress -a -pweechat-curses -p weechat-plugins
dh_fixperms -a -pweechat-curses -pweechat-plugins
dh_installdeb -a -pweechat-curses -pweechat-plugins
dh_shlibdeps -a -pweechat-curses -pweechat-plugins
dh_gencontrol -a -pweechat-curses -pweechat-plugins
dh_md5sums -a -pweechat-curses -pweechat-plugins
dh_builddeb -a -pweechat-curses -pweechat-plugins
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
install/weechat-common::
install -D -o root -g root -m 644 debian/weechat.xpm $(CURDIR)/debian/weechat-common/usr/share/pixmaps/weechat.xpm
+2 -1
View File
@@ -1 +1,2 @@
debian/tmp/usr/share/locale/
usr/share/locale/
usr/share/doc/weechat/html usr/share/doc/weechat-common
+1 -1
View File
@@ -1 +1 @@
debian/tmp/usr/bin/weechat-curses
usr/bin/weechat-curses
-1
View File
@@ -1 +0,0 @@
usr/share/doc/weechat-common usr/share/doc/weechat-curses
+1
View File
@@ -0,0 +1 @@
doc/weechat-curses.1
+1 -1
View File
@@ -1,4 +1,4 @@
?package(weechat-curses):needs="text" section="Apps/Net" \
title="weechat-curses" \
icon="/usr/share/pixmaps/weechat_icon_32.png" \
icon="/usr/share/pixmaps/weechat.xpm" \
command="/usr/bin/weechat-curses"
+1 -1
View File
@@ -1 +1 @@
debian/tmp/usr/lib
usr/lib/weechat/plugins/*so*
+295
View File
@@ -0,0 +1,295 @@
/* XPM */
static char *weechat[] = {
/* columns rows colors chars-per-pixel */
"32 32 257 2",
" c #000000",
". c #0A0904",
"X c #080813",
"o c #080716",
"O c #110D08",
"+ c #150A15",
"@ c #1A0D1A",
"# c #19150C",
"$ c #151517",
"% c #1F1F32",
"& c #13132C",
"* c #260A26",
"= c #351935",
"- c #271927",
"; c #262608",
": c #322C0C",
"> c #36380B",
", c #353316",
"< c #232516",
"1 c #242224",
"2 c #292935",
"3 c #2D302D",
"4 c #2D3330",
"5 c #3B333B",
"6 c #1D1C4A",
"7 c #110F7B",
"8 c #0E0D65",
"9 c #221F60",
"0 c #282948",
"q c #292855",
"w c #333447",
"e c #383855",
"r c #2A2978",
"t c #302F70",
"y c #353465",
"u c #363574",
"i c #2A286E",
"p c #2E4110",
"a c #39410C",
"s c #3E4C11",
"d c #3F5220",
"f c #394041",
"g c #3E4753",
"h c #493F11",
"j c #4F1050",
"k c #4A0F4B",
"l c #572657",
"z c #4D374D",
"x c #403F6F",
"c c #640964",
"v c #641E64",
"b c #701770",
"n c #790A79",
"m c #683C68",
"M c #623662",
"N c #6B2B6B",
"B c #454A08",
"V c #484C15",
"C c #554B16",
"Z c #58560A",
"A c #595B0B",
"S c #545715",
"D c #4C5712",
"F c #4D5034",
"G c #504F24",
"H c #4E710E",
"J c #4D7C1C",
"K c #5B6713",
"L c #506B11",
"P c #546927",
"I c #506D2E",
"U c #665B14",
"Y c #696C0C",
"T c #68730D",
"R c #6F7010",
"E c #707128",
"W c #4D504D",
"Q c #46456A",
"! c #4C4C7B",
"~ c #434577",
"^ c #554C69",
"/ c #5B5A7D",
"( c #54547A",
") c #535964",
"_ c #567745",
"` c #4D6B57",
"' c #5D6C78",
"] c #587069",
"[ c #6A487C",
"{ c #6D576D",
"} c #645475",
"| c #76557A",
" . c #786678",
".. c #70707D",
"X. c #676768",
"o. c #3F3E82",
"O. c #2D2BAA",
"+. c #3D3BA4",
"@. c #3B39B9",
"#. c #484888",
"$. c #4A4C96",
"%. c #585885",
"&. c #595890",
"*. c #555494",
"=. c #4745A6",
"-. c #4947B5",
";. c #514FBB",
":. c #5A58BB",
">. c #5C5BAF",
",. c #755581",
"<. c #605FB6",
"1. c #6B6883",
"2. c #68679B",
"3. c #7A7497",
"4. c #76698F",
"5. c #6968A6",
"6. c #706FB5",
"7. c #7675BB",
"8. c #6E6DB6",
"9. c #4947C3",
"0. c #5351C2",
"q. c #5D5BC0",
"w. c #6B6ACC",
"e. c #6361C7",
"r. c #7170C6",
"t. c #7877D2",
"y. c #56840C",
"u. c #6A8814",
"i. c #63980B",
"p. c #748614",
"a. c #7F9C0D",
"s. c #749218",
"d. c #698F13",
"f. c #6C852A",
"g. c #798C35",
"h. c #76912B",
"j. c #76B505",
"k. c #70A50F",
"l. c #7EA525",
"z. c #678946",
"x. c #A57A5A",
"c. c #9A1E9A",
"v. c #861B86",
"b. c #912B92",
"n. c #8A298A",
"m. c #A030A0",
"M. c #864886",
"N. c #8F469E",
"B. c #975897",
"V. c #8A788A",
"C. c #936A93",
"Z. c #987599",
"A. c #866892",
"S. c #9470AB",
"D. c #A25FA2",
"F. c #B16FB1",
"G. c #B07FB1",
"H. c #B776B7",
"J. c #807FD0",
"K. c #A37AC2",
"L. c #87880B",
"P. c #888513",
"I. c #869A0A",
"U. c #8B9B14",
"Y. c #94970D",
"T. c #9B9C13",
"R. c #98961A",
"E. c #968D16",
"W. c #929D2F",
"Q. c #82A90B",
"!. c #8CAA06",
"~. c #82B30A",
"^. c #84B706",
"/. c #97A913",
"(. c #96B90A",
"). c #99B914",
"_. c #91AB10",
"`. c #A39A1C",
"'. c #A09A3D",
"]. c #A9AE05",
"[. c #A7AA16",
"{. c #A7B90B",
"}. c #ACB712",
"|. c #BDBA18",
" X c #B7B711",
".X c #B0B726",
"XX c #9A8B4B",
"oX c #9EC008",
"OX c #BCC40D",
"+X c #BCC90E",
"@X c #B1C707",
"#X c #AEC90C",
"$X c #C4AE2A",
"%X c #C4CB11",
"&X c #C8D809",
"*X c #CBD011",
"=X c #D1CF1A",
"-X c #D1D50E",
";X c #D7E803",
":X c #918197",
">X c #858494",
",X c #8987BA",
"<X c #928BBB",
"1X c #9B9BA8",
"2X c #9B98B8",
"3X c #8784A3",
"4X c #A787A8",
"5X c #AE9CAE",
"6X c #AC99B1",
"7X c #B988B9",
"8X c #BB92BC",
"9X c #B598B8",
"0X c #A0A0A7",
"qX c #A6A6B7",
"wX c #8382C6",
"eX c #8382D4",
"rX c #8D8CD4",
"tX c #9C8CC7",
"yX c #908FD9",
"uX c #9493C6",
"iX c #9A99DB",
"pX c #9493D3",
"aX c #A693C8",
"sX c #A09AD5",
"dX c #A8A5C9",
"fX c #A9A6D6",
"gX c #B7A8C7",
"hX c #B7B6DA",
"jX c #B5B1CE",
"kX c #B7B4E2",
"lX c #A9A8E2",
"zX c #C88EC8",
"xX c #C38BC3",
"cX c #C695C6",
"vX c #C2ADC2",
"bX c #C7A6C7",
"nX c #C4B5C4",
"mX c #C6B9D3",
"MX c #DDB9DD",
"NX c #D9B4D9",
"BX c #D3A4D4",
"VX c #C9C5CA",
"CX c #CAC9D7",
"ZX c #D4CBD4",
"AX c #D9C1D9",
"SX c #DACEDA",
"DX c #C4C3E4",
"FX c #CBC9E6",
"GX c #D8D7E6",
"HX c #E7CCE7",
"JX c #E9CFE9",
"KX c #EADBEA",
"LX c #E4DAE4",
"PX c #EDE2ED",
"IX c #EAEAF4",
"UX c #F0E1F0",
"YX c None",
/* pixels */
"YXYXYXYXYXYXYXYXYXSXLXIXUXCX YXYXYXYXVXLXPXPXZX. YXYXYXYXYX",
"YXYXYXYXYXYXYXnXKXUXUXKXJXSXnX YXnXKXPXPXPXKXSXnX YXYXYXYX",
"YXYXYXYXYXYX9XHXJXMX0XvX:X9XSX .HXJXAX5XvX>XvXAX. YXYXYXYX",
"YXYXYXYXYXYXMXMXkXx.. | 4XNXvX NXMXMXV. { 4XNXbX YXYXYX",
"YXYXYXYXYXBXBX8XZ. 4X8X8XZ. { BX8X4X G.7XcXZ. YXYXYX",
"YXYXYXYXLXcXcXC.z zXxX7X) X.G.G.C.z zXcX7X5 5 VX YXYX",
"YXYX1XIXGXBXCXC.+ H.H.F.6XIXIX8X| B.- F.H.8X5X0XCXCX YX",
"YXYX3 GXmX8XmXZ.M M.D.m | VXCXGX4X| B.M.B.D.m gXqX1XCXW YX",
"YXYX CXgXS.jXA.= + = 2XFXqXFXZ.| n.l @ = jX>X..GX$ YX",
"YXYX hXaXA.jX,.= + kXFXDXFX3.{ m l * w hXV.2XdX YX",
"YXYX hXdX,.fX[ v n.j b.kX2XDXhX1.4.v b.m.j S.tX3XkX1. YX",
"YXYX fXdX4.aX^ j v.c.N.fX) kXuX} <X= b c.c.G.tX1.kX% YXYX",
"YXYX <XfXuX<X[ k c c S.uX( fX,X' iXk c n b tX/ 3.uX YXYX",
"YXYX 2.iXrX2./ $ pX2.6.rX,XQ iX2 2 iXQ pX/ YXYX",
"YXYX e rXrX( %.e ( rX( 5.7.wXQ J.y 5.yX( yX& YXYXYX",
"YXYXYX t.eXQ 5.~ 7.7.2.% 2.eX&.2.&. J.6.8.5. YXYXYX",
"YXYXYX r.t.y 8.#.o 8.~ *. x t.r.~ 8. 0 t.! r.0 o $ F YXYXYX",
"YXYXYX <.w.~ >.#.d ] #.0 q w.w.y w.o #.e.$.<.. d I I YX",
"YXYXYX =.e.=.#.g z.I t X q ;.e.u :.y :.o.q.u < J y.d YX",
"YXYXYX y 0.0.r ] _ I 6 o -.0.-.=.0.;.t 0.o , I y.p YX",
"YXYXYXYX 9.9.i ' _ g X + +.9.9.@.;.i +.r y.k.i.y.H ",
"YXYXXXW.Q.] =.@.z.J 4 . V s.E o.@.@.-.' d.z.L ; s j.j.j.i.D ",
"YXXXW.Q.Q.f.) O.l.f.# D Q.u.u.o O.$.g.g.h.^.^.> s.oX~.~.u.s ",
"YX}.oXD a P w 9 ~.f.S T p.p.K ~ ).g q g j.(.. # k.a.K ",
".X#X{. . ; 7 0 _.!.V O I.U.C . oXg.6 8 4 Y.(. a /.).T ",
"+X#X(. 1 # T.{., #X{.C B +XI. I./.{. T #XoXA YX",
"&X+X}.Y P.%X[.P.+X@X. &X@XY Z ;X/.A T.OX}.+X; Y.}.[.B YXYX",
".X*XOX;X;X XZ T.*XL. =X%XP.; ;X%X*XT.> `.|., ].`. X: YXYX",
". Y.].T.A . C C ; $X-Xh P.].R O R : XE.P.O YXYX",
" E U C . YXYX",
"YX YX. # YXYXYX",
"YXYXYXYXYXYXYXYXYXYXYXYXYX YXYXYXYXYXYXYXYXYX YXYXYXYXYX"
};
+13 -2
View File
@@ -15,8 +15,19 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
SUBDIRS = fr en
SUBDIRS = . en fr de ru pl cs
man_MANS = weechat-curses.1
EXTRA_DIST = $(man_MANS) weechat-doc.css weechat-html-one.xsl weechat-html.xsl
EXTRA_DIST = $(man_MANS) weechat-doc.css weechat-html-one.xsl.in weechat-html.xsl.in
all-local: weechat-html.xsl weechat-html-one.xsl
weechat-html.xsl: weechat-html.xsl.in
sed -e 's,\@DOC_XSL_PREFIX\@,$(DOC_XSL_PREFIX),g' < weechat-html.xsl.in > weechat-html.xsl
weechat-html-one.xsl: weechat-html-one.xsl.in
sed -e 's,\@DOC_XSL_PREFIX\@,$(DOC_XSL_PREFIX),g' < weechat-html-one.xsl.in > weechat-html-one.xsl
clean-local:
-rm -f weechat-html.xsl weechat-html-one.xsl
+33 -13
View File
@@ -22,35 +22,52 @@
# with weechat-curses command
#
@all_lang = ("fr_FR", "en_US");
@all_lang = ("fr_FR", "en_US", "de_DE");
%all_encodings = ("fr_FR" => "iso-8859-1",
"en_US" => "iso-8859-1");
"en_US" => "iso-8859-1",
"de_DE" => "iso-8859-1");
%all_types = ("fr_FR" => "type",
"en_US" => "type",
"de_DE" => "Typ",
"es_ES" => "tipo");
%all_values = ("fr_FR" => "valeurs",
"en_US" => "values",
"de_DE" => "Werte",
"es_ES" => "valores");
%all_default = ("fr_FR" => "valeur par défaut",
"en_US" => "default values",
"en_US" => "default value",
"de_DE" => "Standardwert",
"es_ES" => "valor por defecto");
%all_desc = ("fr_FR" => "description",
"en_US" => "description",
"de_DE" => "Beschreibung",
"es_ES" => "descripción");
$warning_do_not_edit = "\n<!-- ********* WARNING! *********\n\n"
." This file is automatically built with a Perl script. DO NOT EDIT!\n"
."-->\n\n";
foreach $lng (@all_lang)
{
create_commands ($lng, $all_encodings{$lng},
"weechat-curses -w | tail +3", "weechat_commands");
"weechat-curses -w | sed 1,2d", "weechat_commands");
create_commands ($lng, $all_encodings{$lng},
"weechat-curses -i | tail +3", "irc_commands");
"weechat-curses -i | sed 1,2d", "irc_commands");
create_key_func ($lng, $all_encodings{$lng},
"weechat-curses -f | tail +3", "key_functions");
"weechat-curses -f | sed 1,2d", "key_functions");
create_config ($lng, $all_encodings{$lng},
"weechat-curses -c | tail +3", "config");
"weechat-curses -c | sed 1,2d", "config");
print "\n";
}
sub toxml
{
$_ = $_[0];
$_ =~ s/&/&amp;/g;
$_ =~ s/</&lt;/g;
$_ =~ s/>/&gt;/g;
return $_;
}
sub create_commands
{
$lang = $_[0];
@@ -61,6 +78,7 @@ sub create_commands
print "Creating $lang2/$file.xml ($lang)...\n";
open XML, ">$lang2/$file.xml" or die "Error: can't write file!";
print XML "<?xml version=\"1.0\" encoding=\"$encoding\"?>\n";
print XML $warning_do_not_edit;
$started = 0;
$ENV{"LANG"} = $lang;
@@ -70,13 +88,13 @@ sub create_commands
{
print XML "</programlisting>\n" if ($started == 1);
$started = 1;
print XML "<command>$1</command>\n";
print XML "<command>".toxml($1)."</command>\n";
print XML "<programlisting>";
}
else
{
chomp ($_);
print XML "$_\n";
print XML toxml($_)."\n";
}
}
print XML "</programlisting>\n";
@@ -94,6 +112,7 @@ sub create_key_func
print "Creating $lang2/$file.xml ($lang)...\n";
open XML, ">$lang2/$file.xml" or die "Error: can't write file!";
print XML "<?xml version=\"1.0\" encoding=\"$encoding\"?>\n";
print XML $warning_do_not_edit;
$ENV{"LANG"} = $lang;
foreach (`$command`)
@@ -120,6 +139,7 @@ sub create_config
print "Creating $lang2/$file.xml ($lang)...\n";
open XML, ">$lang2/$file.xml" or die "Error: can't write file!";
print XML "<?xml version=\"1.0\" encoding=\"$encoding\"?>\n";
print XML $warning_do_not_edit;
$type = "";
$values = "";
$default = "";
@@ -150,10 +170,10 @@ sub create_config
$_ = $1;
s/(.*)/\u$1/;
$desc = $_;
print XML " <entry>".$type."</entry>\n";
print XML " <entry>".$values."</entry>\n";
print XML " <entry>".$default."</entry>\n";
print XML " <entry>".$desc."</entry>\n";
print XML " <entry>".toxml($type)."</entry>\n";
print XML " <entry>".toxml($values)."</entry>\n";
print XML " <entry>".toxml($default)."</entry>\n";
print XML " <entry>".toxml($desc)."</entry>\n";
print XML "</row>\n";
}
}
+28
View File
@@ -0,0 +1,28 @@
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
LANGCODE = cs
QUICKSTART = weechat_quickstart.$(LANGCODE).txt
EXTRA_DIST = $(QUICKSTART)
docdir = $(datadir)/doc/$(PACKAGE)
# install docs
install-data-hook:
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
+104
View File
@@ -0,0 +1,104 @@
WeeChat (česká verze)
=========================
1. Spuštění weechat
Podle požadovaného GUI je třeba spustit:
- weechat-curses pro Curses GUI
- weechat-gtk pro GTK GUI (vyvíjí se)
- weechat-qt pro Qt GUI (není vyvíjeno)
- weechat-wxwidgets pro WxWidgets GUI (není vyvíjeno)
2. Online nápověda / možnosti
WeeChat má nápovědu pro všechny příkazy (/help příkaz)
Pro získání nápovědy k příkazu se používá /help příkaz
Pro nastavení voleb použijte /set volba = hodnota
Lze použít /set volba s částečným jménem (zobrazí všechny možnosti
obsahující písmena), nebo pouze s celým jménem volby bez hodnoty
(pro zobrazení dlouhé nápovědy k volbě).
Důležitá poznámka: nastavení je ukládáno při skončení WeeChat
(nebo pomocí příkazu /save). NEEDITUJTE kontiguracni soubor za
běhu WeeChat, protože do něj můŽe WeeChat kdykoliv zapsat
a není možné jej znovu načíst. Pro změnu jakýchkoliv voleb
použijte příkaz /set, WeeChat okamžitě použije nové nastavení.
3. Vytvoření serveru
Například irc.quakenet.org, port 6667:
/server quakenet irc.quakenet.org 6667
(pro kompletní nápovědu použijte /help server)
4. Nastavení vlastních voleb serveru
Přezdívky:
/set quakenet.server_nick1 = "mujeprezdivka"
/set quakenet.server_nick2 = "mujeprezdivka2"
/set quakenet.server_nick3 = "mujeprezdivka3"
Uživatelské jméno / skutečné jméno:
/set quakenet.server_username = "moje uživatelské jméno"
/set quakenet.server_realname = "moje skutečné jméno"
Automatické připojení k serveru:
/set quakenet.server_autoconnect = on
Ostatní volby:
Pro zobrazení voleb serveru a jejich hodnot použijte /set quakenet
Pro nastavení volby použijte /set quakenet.volba_serveru = hodnota
5. Připojení k serveru a automatické připojení ke kanálům
/connect quakenet
6. Příchod/odchod na/z kanálu
Příchod na kanál:
/join #kanál
Odchod z kanálu:
/part [ukončovací zpráva]
Odchod z kanálu a zavření bufferu:
/close [ukončovací zpráva]
(/close je alias na /buffer close)
7. Správa bufferů/oken
Buffery lze spravovat pomocí příkazu "/buffer" a okna pomocí
příkazu "/window".
Například pro rozdělení okna vertikálně na malé okno (1/3 šíčky)
a velké (2/3) použijte příkaz:
/window splitv 33
8. Klávesové zkratky
Podle Vaší klávesnice a/nebo potřeb si můžete změnit jakoukoliv
klávesu pomocí příkazu "/key".
Užitečná klávesa je meta-k (alt-k) pro nalezení klávesového kódu.
Například pro napojení meta-y (alt-y) na příkaz "/buffer close""
/key (stiskněte meta-k) (stiskněte meta-y) /buffer close
Dostanete řádek podobný tomuto:
/key meta-y /buffer close
9. Pluginy/skripty
Na některých distibucích jako Debian, jsou pluginy dostupné v samostatném
balíčku (jako weechat-plugins).
Pluginy jsou automatikcy načteny při nalezení.
Pro WeeChat je dostupných spousta pluginů/skriptů, více na:
http://weechat.flashtux.org/plugins.php
Pro načítání/rušení pluginů/skriptů se podívejde do dokumentace WeeChat.
10. Další dokumentace
Nyní můžete používat WeeChat a číst FAQ/dokumentaci v případě dalších dotazů:
http://weechat.flashtux.org/faq.php
http://weechat.flashtux.org/doc.php
Uživejte si WeeChat!
--
(c) 2006-05-31, napsal FlashCode <flashcode@flashtux.org>, přeložil GolemJ <golemj@gmail.com>
This document is part of WeeChat and is distributed under GPL licence.
Tento dokunet je součástí WeeChat a je distribuován pod licencí GPL.
+63
View File
@@ -0,0 +1,63 @@
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
LANGCODE = de
BOOK = weechat.$(LANGCODE)
BOOK_INCLUDE = weechat_commands.xml irc_commands.xml key_functions.xml config.xml
QUICKSTART = weechat_quickstart.$(LANGCODE).txt
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE) $(QUICKSTART)
docdir = $(datadir)/doc/$(PACKAGE)
all-local: html-stamp
# HTML output with chunks (many pages)
html: html-stamp
html-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html.xsl ../weechat-doc.css
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
mkdir -p html/
xsltproc -o html/ ../weechat-html.xsl $(BOOK).xml || true
cp ../weechat-doc.css html/
touch html-stamp
# HTML output, all in one page
html1: html1-stamp
html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.css
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
mkdir -p html1/
xsltproc -o html1/$(BOOK).html ../weechat-html-one.xsl $(BOOK).xml || true
cp ../weechat-doc.css html1/
touch html1-stamp
# install docs
install-data-hook:
$(mkinstalldirs) $(DESTDIR)$(docdir)/html/$(LANGCODE)/
$(INSTALL_DATA) html/* $(DESTDIR)$(docdir)/html/$(LANGCODE)/
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
# clean
clean-local:
-rm -f $(BOOK).html $(BOOK).pdf $(BOOK).txt date.xml
-rm -rf html/ html1/
-rm -f html-stamp html1-stamp
+1260
View File
File diff suppressed because it is too large Load Diff
+443
View File
@@ -0,0 +1,443 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<command>admin [Ziel]</command>
<programlisting>
Information über den Server-Administrator abfragen
Ziel: Server
</programlisting>
<command>ame Nachricht</command>
<programlisting>
Nachricht an alle Channels aller verbundenen Server schicken
zu sendende Nachricht
</programlisting>
<command>amsg Text</command>
<programlisting>
Nachricht an alle Channels aller verbundener Server schicken
Text: zu sendender Text
</programlisting>
<command>away [-all] [Nachricht]</command>
<programlisting>
Abwesenheitsnachricht ein/ausschalten
-all: Abwesenheitszustand auf allen Servern ändern
Nachricht: Abwesenheitsnachricht (bzw. keine, um den Abwesenheitszustand zu deaktivieren)
</programlisting>
<command>ban [Channel] [Nickname [Nickname ...]]</command>
<programlisting>
Nicknames oder Hosts sperren/verbannen
Channel: Channel für die Sperre
Nickname: zu sperrender User oder Host
</programlisting>
<command>ctcp Nickname Typ [Argumente]</command>
<programlisting>
CTCP-Nachricht verschicken
Nickname: User, an den die CTCP-Nachricht geschickt werden soll
Typ: Typ der CTCP-Nachricht (z.B. "version", "ping", ...)
Argumente: Argumente für CTCP
</programlisting>
<command>cycle [Channel[,Channel]] [Abschiedsnachricht]</command>
<programlisting>
einen Channel verlassen und wieder betreten
Channel: zu verlassender Channel
Abschiedsnachricht: Abschiedsnachricht (die den anderen Usern angezeigt wird)
</programlisting>
<command>dehalfop Nickname [Nickname]</command>
<programlisting>
Halb-Operatorstatus aberkennen
</programlisting>
<command>deop Nickname [Nickname]</command>
<programlisting>
Operatorstatus aberkennen
</programlisting>
<command>devoice Nickname [Nickname]</command>
<programlisting>
Voice wegnehmen
</programlisting>
<command>die</command>
<programlisting>
Server herunterfahren
</programlisting>
<command>halfop Nickname [Nickname]</command>
<programlisting>
Halb-Operatorstatus verleihen
</programlisting>
<command>info [Ziel]</command>
<programlisting>
Information über den Server abfragen
Ziel: Servername
</programlisting>
<command>invite Nickname Channel</command>
<programlisting>
jemanden in einen Channel einladen
Nickname: Chatname des Einzuladenden
Channel: Channel, in den er eingeladen werden soll
</programlisting>
<command>ison Nickname [Nickname ...]</command>
<programlisting>
überprüfen, ob jemand zur Zeit im IRC ist
Nickname: Nickname
</programlisting>
<command>join Channel[,Channel] [Passwort[,Passwort]]</command>
<programlisting>
einen Channel betreten
Channel: zu betretender Channel
Passwort: Channelpasswort (+k-Mode)
</programlisting>
<command>kick [Channel] Nickname [Kommentar]</command>
<programlisting>
einen User aus einem Channel herauskicken
Channel: Channel des Benutzers
Nickname: Nickname des Benutzers
Kommentar: Begründung für den Kick
</programlisting>
<command>kickban [Channel] Nickname [Kommentar]</command>
<programlisting>
kickt und verbannt jemanden von einem Channel
Channel: Channel des Benutzers
Nickname: Nickname des Benutzers
Kommentar: Begründung für den Kickban
</programlisting>
<command>kill Nickname Kommentar</command>
<programlisting>
Jemanden vom Server werfen
Nickname: Chatname
Kommentar: Begründung
</programlisting>
<command>links [[Server] Servermaske]</command>
<programlisting>
Alle dem antwortenden Server bekannten Servernamen auflisten
Server: dieser Server soll die Anfrage beantworten
Servermaske: die aufzulistenden Server sollen diesem Muster entsprechen
</programlisting>
<command>list [Channel[,Channel] [Server]]</command>
<programlisting>
Channels mit ihren Topics auflisten
Channel: aufzulistender Channel (reguläre Ausdrücke sind möglich)
Server: Servername
</programlisting>
<command>lusers [Maske [Ziel]]</command>
<programlisting>
Statistik über die Größe dieses IRC-Netzwerks abfragen
Maske: Nur Server, die diesem Muster entsprechen
Ziel: Server, der die Anfrage weiterleiten soll
</programlisting>
<command>me Nachricht</command>
<programlisting>
eine CTCP ACTION an den aktuellen Channel senden
zu sendende Nachricht
</programlisting>
<command>mode { Channel {[+|-]|o|p|s|i|t|n|b|v} [Limit] [User] [Bannmaske] } | {Nickname {[+|-]|i|w|s|o} }</command>
<programlisting>
Channel- oder Usermode ändern
Channelmodi:
Channel: zu ändernder Channel
o: gib/nimm Operatorstatus
p: privater Channel
s: geheimer Channel
i: geschlossener Channel (Zutritt nur mit Einladung)
t: nur Operatoren dürfen das Topic setzen
n: keine Channelnachrichten von außerhalb des Channels
m: moderierter Channel (schreiben nur mit Voice)
l: maximale Anzahl an Usern im Channel festlegen
b: Bannmaske für zu sperrende User (in nick!ident@host-Form)
e: lege Ausnahmemaske fest
v: gib/nimm Voice (d.h. Schreibrecht bei moderierten Channels)
k: Channelkey/Channelpasswort festlegen
Usermodi:
Nickname: zu ändernder Nickname
i: User als unsichtbar kennzeichnen
s: User empfängt Server-Nachrichten
w: User empfängt WALLOPS
o: User ist Channeloperator
</programlisting>
<command>motd [Ziel]</command>
<programlisting>
die "Nachricht von heute" abfragen
Ziel: Servername
</programlisting>
<command>msg Empfänger[,Empfänger] Text</command>
<programlisting>
Nachricht an Nick/Channel verschicken
Empfänger: Nick/Channel (darf eine Maske sein, '*' = aktueller Channel)
Text: zu sendender Text
</programlisting>
<command>names [Channel[,Channel]]</command>
<programlisting>
Nicknames in Channels auflisten
Channel: Channelname
</programlisting>
<command>nick [-all] Nickname</command>
<programlisting>
aktuellen Nickname wechseln
-all: Nickname auf allen verbundenen Servern ändern
Nickname: neuer Nickname
</programlisting>
<command>notice Nickname Text</command>
<programlisting>
NOTICE an einen User verschicken
Nickname: Empfänger der Nachricht
Text: zu sendender Text
</programlisting>
<command>op Nickname [Nickname]</command>
<programlisting>
Channeloperatorstatus verleihen
</programlisting>
<command>oper Benutzername Passwort</command>
<programlisting>
Serveroperatorprivilegien anfordern
Benutzername/Passwort: Account im IRC-Server
</programlisting>
<command>part [Channel[,Channel]] [Abschiedsnachricht]</command>
<programlisting>
einen Channel verlassen
Channel: zu verlassender Channel
Abschiedsnachricht: Abschiedsnachricht, die den anderen Usern angezeigt wird
</programlisting>
<command>ping Server1 [Server2]</command>
<programlisting>
Server anpingen
Server1: Anzupingender Server
Server2: Ping an diesen Server weiterleiten
</programlisting>
<command>pong Daemon [Daemon2]</command>
<programlisting>
auf Ping antworten
Daemon: Daemon, der auf die Ping-Nachricht geantwortet hat
Daemon2: Nachricht an diesen Daemon weiterleiten
</programlisting>
<command>query Nickname [Text]</command>
<programlisting>
private Nachricht an jemanden schicken
Nickname: Nickname für privaten Chat
Text: zu sendender Text
</programlisting>
<command>quit [Abschiedsnachricht]</command>
<programlisting>
alle Verbindungen trennen und Programm beenden
Abschiednachricht: anderen Usern zu zeigende Nachricht
</programlisting>
<command>quote Daten</command>
<programlisting>
Daten direkt an Server senden (siehe RFC 2812)
Daten: zu sendende Rohdaten
</programlisting>
<command>rehash</command>
<programlisting>
den Server dazu bringen, seine Konfigurationsdatei neu zu laden
</programlisting>
<command>restart</command>
<programlisting>
den Server dazu bringen, sich selbst neu zu starten
</programlisting>
<command>service Nickname reserviert Distribution Typ reserviert Info</command>
<programlisting>
einen neuen Service eintragen
Distribution: Sichtbarkeit des Services
Typ: für spätere Verwendung reserviert
</programlisting>
<command>servlist [Maske [Typ]]</command>
<programlisting>
zur Zeit verbundene Services auflisten
Maske: nur zutreffende Services auflisten
Typ: nur Services von diesem Typ auflisten
</programlisting>
<command>squery Service Text</command>
<programlisting>
Nachricht an einen Service senden
Service: Name des Service
Text: zu sendender Text
</programlisting>
<command>squit Server Kommentar</command>
<programlisting>
Serververbindungen trennen
Server: Servername
Kommentar: Trennungsgrund
</programlisting>
<command>stats [Anfrage [Server]]</command>
<programlisting>
Serverstatistik abfragen
Anfrage: c/h/i/k/l/m/o/y/u (siehe RFC1459)
Server: zu befragender Server
</programlisting>
<command>summon User [Ziel [Channel]]</command>
<programlisting>
Nutzer, die auf dem IRC-Server arbeiten, darum bitten, auf den IRC-Server zu kommen
User: Benutzername
Ziel: Servername
Channel: Channelname
</programlisting>
<command>time [Ziel]</command>
<programlisting>
Ortszeit des Servers abfragen
Ziel: der zu fragende Server
</programlisting>
<command>topic [Channel] [Topic]</command>
<programlisting>
Channeltopic abfragen/setzen
Channel: Channelname
Topic: neues Topic (oder "-delete" zum Entfernen des Topics)
</programlisting>
<command>trace [Ziel]</command>
<programlisting>
Route zum angegebenen Server ermitteln
Ziel: Server
</programlisting>
<command>unban [Channel] nickname [nickname ...]</command>
<programlisting>
Bann aufheben
Channel: Channel, in dem der Bann aufzuheben ist
Nickname: User, für den der Bann aufzuheben ist
</programlisting>
<command>userhost Nickname [Nickname ...]</command>
<programlisting>
liste von Nickname-Informationen ermitteln
Nickname: Nickname
</programlisting>
<command>users [Ziel]</command>
<programlisting>
auf dem Server eingeloggte User auflisten
Ziel: Server
</programlisting>
<command>version [Server | Nickname]</command>
<programlisting>
Versionsinformationen von Nickname oder Server ermitteln
Server: Servername
Nickname: Nickname
</programlisting>
<command>voice Nickname [Nickname]</command>
<programlisting>
Voice vergeben
</programlisting>
<command>wallops Text</command>
<programlisting>
Nachricht an alle User schicken, die den 'w'-Mode gesetzt haben
zu sendender Text
</programlisting>
<command>who [Maske ["o"]]</command>
<programlisting>
erweiterte Nicknameliste
Maske: nur Information über betreffende Nicknames abfragen
o: nur Operatoren ausgeben, die dem Filter entsprechen
</programlisting>
<command>whois [Server] Nickname[,Nickname]</command>
<programlisting>
Information über User abfragen
Server: Servername
Nickname: Nickname (oder eine Maske)
</programlisting>
<command>whowas Nickname [,Nickname [,Nickname ...]] [Anzahl [Ziel]]</command>
<programlisting>
Information über die Vergangenheit eines Nicknames erfragen
Nickname: abzufragende Nicknames
Anzahl: maximale Anzahl an Antworten (negative Zahl für eine vollständige Liste)
Ziel: zu suchende Hostmaske
</programlisting>
+191
View File
@@ -0,0 +1,191 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<row>
<entry><literal>return</literal></entry>
<entry>Zeile terminieren</entry>
</row>
<row>
<entry><literal>tab</literal></entry>
<entry>Wort vervollständigen</entry>
</row>
<row>
<entry><literal>tab_previous</literal></entry>
<entry>finde letzte Wortvervollständigung</entry>
</row>
<row>
<entry><literal>backspace</literal></entry>
<entry>vorheriges Zeichen löschen</entry>
</row>
<row>
<entry><literal>delete</literal></entry>
<entry>nächstes Zeichen löschen</entry>
</row>
<row>
<entry><literal>delete_end_line</literal></entry>
<entry>bis zum Zeilenende löschen</entry>
</row>
<row>
<entry><literal>delete_beginning_line</literal></entry>
<entry>bis zum Zeilenanfang löschen</entry>
</row>
<row>
<entry><literal>delete_line</literal></entry>
<entry>ganze Zeile löschen</entry>
</row>
<row>
<entry><literal>delete_previous_word</literal></entry>
<entry>vorheriges Wort löschen</entry>
</row>
<row>
<entry><literal>delete_next_word</literal></entry>
<entry>nächstes Wort löschen</entry>
</row>
<row>
<entry><literal>clipboard_paste</literal></entry>
<entry>einfügen</entry>
</row>
<row>
<entry><literal>transpose_chars</literal></entry>
<entry>Zeichen vertauschen</entry>
</row>
<row>
<entry><literal>home</literal></entry>
<entry>zum Zeilenanfang gehen</entry>
</row>
<row>
<entry><literal>end</literal></entry>
<entry>zum Zeilenende gehen</entry>
</row>
<row>
<entry><literal>left</literal></entry>
<entry>ein Zeichen nach links gehen</entry>
</row>
<row>
<entry><literal>previous_word</literal></entry>
<entry>ein Wort nach links gehen</entry>
</row>
<row>
<entry><literal>right</literal></entry>
<entry>ein Zeichen nach rechts gehen</entry>
</row>
<row>
<entry><literal>next_word</literal></entry>
<entry>ein Wort nach rechts gehen</entry>
</row>
<row>
<entry><literal>up</literal></entry>
<entry>vorherigen Befehl aus dem Verlauf abfragen</entry>
</row>
<row>
<entry><literal>up_global</literal></entry>
<entry>vorherigen Befehl aus dem globalen Verlauf abfragen</entry>
</row>
<row>
<entry><literal>down</literal></entry>
<entry>nächsten Befehl aus dem Verlauf abfragen</entry>
</row>
<row>
<entry><literal>down_global</literal></entry>
<entry>nächsten Befehl aus dem globalen Verlauf abfragen</entry>
</row>
<row>
<entry><literal>page_up</literal></entry>
<entry>eine Seite hochscrollen</entry>
</row>
<row>
<entry><literal>page_down</literal></entry>
<entry>eine Seite herunterscrollen</entry>
</row>
<row>
<entry><literal>scroll_up</literal></entry>
<entry>einige Zeilen hochscrollen</entry>
</row>
<row>
<entry><literal>scroll_down</literal></entry>
<entry>einige Zeilen herunterscrollen</entry>
</row>
<row>
<entry><literal>scroll_top</literal></entry>
<entry>nach ganz oben scrollen</entry>
</row>
<row>
<entry><literal>scroll_bottom</literal></entry>
<entry>nach ganz unten scrollen</entry>
</row>
<row>
<entry><literal>nick_beginning</literal></entry>
<entry>zum Anfang der Nicklist gehen</entry>
</row>
<row>
<entry><literal>nick_end</literal></entry>
<entry>zum Ende der Nicklist gehen</entry>
</row>
<row>
<entry><literal>nick_page_up</literal></entry>
<entry>Nickliste eine Seite hochscrollen</entry>
</row>
<row>
<entry><literal>nick_page_down</literal></entry>
<entry>Nickliste eine Seite herunterscrollen</entry>
</row>
<row>
<entry><literal>jump_smart</literal></entry>
<entry>zu nächstem aktiven Puffer springen</entry>
</row>
<row>
<entry><literal>jump_dcc</literal></entry>
<entry>zum DCC-Puffer springen</entry>
</row>
<row>
<entry><literal>jump_raw_data</literal></entry>
<entry>gehe zum IRC-Rohdaten-Puffer</entry>
</row>
<row>
<entry><literal>jump_last_buffer</literal></entry>
<entry>zum letzten Puffer springen</entry>
</row>
<row>
<entry><literal>jump_server</literal></entry>
<entry>zum Serverpuffer springen</entry>
</row>
<row>
<entry><literal>jump_next_server</literal></entry>
<entry>zum nächsten Server springen</entry>
</row>
<row>
<entry><literal>switch_server</literal></entry>
<entry>wechsel den aktiven Server im Server-Puffer</entry>
</row>
<row>
<entry><literal>scroll_previous_highlight</literal></entry>
<entry>scrolle zur vorherigen hervorhebung im Puffer</entry>
</row>
<row>
<entry><literal>scroll_next_highlight</literal></entry>
<entry>scrolle zur nächsten Hervorhebung im Puffer</entry>
</row>
<row>
<entry><literal>scroll_unread</literal></entry>
<entry>scrolle zur ersten, ungelesenen Zeile im Puffer</entry>
</row>
<row>
<entry><literal>hotlist_clear</literal></entry>
<entry>Hotlist leeren</entry>
</row>
<row>
<entry><literal>infobar_clear</literal></entry>
<entry>Infobar leeren</entry>
</row>
<row>
<entry><literal>refresh</literal></entry>
<entry>Bild neu aufbauen</entry>
</row>
<row>
<entry><literal>grab_key</literal></entry>
<entry>Tastencode ermitteln und einfügen</entry>
</row>
File diff suppressed because it is too large Load Diff
+235
View File
@@ -0,0 +1,235 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<command>alias [Aliasname [Befehl [Argumente]]]</command>
<programlisting>
einen Alias für einen Befehl anlegen
Aliasname: Name des Alias
Befehl: Befehlsname (WeeChat- oder IRC-Befehl ohne führenden '/', mehrere Befehle können durch Semikola getrennt werden)
Argumente: Argumente für den Befehl
</programlisting>
<command>buffer [Aktion [Argumente] | Nummer | [[Server] [Channel]]]</command>
<programlisting>
Puffer verwalten
Aktion: Pufferaktion:
move: Puffer in der Liste bewegen (kann auch relativ sein, wie -1)
close: Puffer schließen (eine Part-Message kann optional angegeben werden)
list: alle offenen Puffer auflisten (Standardaktion)
notify: Notify-Level für Puffer festlegen (0=nie, 1=bei hervorgehobenen Nachrichten, 2=1+persönliche Nachricht, 3=2+join/part)
Server
Channel: gehe zum Puffer mit Servernamen oder Channelnamen
Nummer: gehe zu Puffer mit dieser Nummer
</programlisting>
<command>builtin Befehl</command>
<programlisting>
starte eingebauten WeeChat/IRC-Befehl (ohne Plugin-Handler oder Aliase)
Befehl: auszuführender Befehl (falls nicht vorhanden wird automatisch ein '/' vorangestellt)
</programlisting>
<command>charset [(decode_iso | decode_utf | encode) Zeichensatz]</command>
<programlisting>
ändere Zeichensatz für den Server oder Channel
decode_iso: Zeichensatz um ISO zu decoden
decode_utf: Zeichensatz um UTF zu decoden
encode: der zum encoden benutzte Zeichensatz
Zeichensatz: Zeichensatz, der benutzt werden soll (zum Beispiel: ISO-8859-15, UTF-8,..)
</programlisting>
<command>clear [-all]</command>
<programlisting>
Fenster leeren
-all: alle Fenster leeren
</programlisting>
<command>connect [Servername]</command>
<programlisting>
mit einem Server verbinden
Servername: Zielserver
</programlisting>
<command>disconnect [Servername]</command>
<programlisting>
Serververbindung trennen
Servername: Name des zu trennenden Servers
</programlisting>
<command>dcc Aktion [Nickname [Datei]]</command>
<programlisting>
DCC (Filetransfer oder Chat) starten oder Chat beenden
Aktion: 'send' (Datei) oder 'chat' oder 'close' (Chat)
Nickname: Empfänger der Datei bzw. Chatpartner
Datei: zu versendende (lokal vorliegende) Datei
</programlisting>
<command>debug dump | windows</command>
<programlisting>
Debugging-Nachricht ausgeben
dump: Speicherabbild im WeeChat-Logfile ablegen (wie nach einem Programmabsturz)
windows: zeigt Fensterdaten an
</programlisting>
<command>help [Befehl]</command>
<programlisting>
Hilfe zu Befehlen abfragen
Befehl: Name eines WeeChat- oder IRC-Befehls
</programlisting>
<command>history [clear | Anzahl]</command>
<programlisting>
zeigt Befehlsverlauf des Puffers
clear: Löscht Verlauf
Anzahl: zeigt die gewünschte Anzahl an Verlaufseinträgen
</programlisting>
<command>ignore [Maske [[Typ | Befehl] [Channel [Server]]]]</command>
<programlisting>
IRC-Nachrichten und/oder Hosts ignorieren
Nummer: Nummer des zu entfernenden Eintrags (siehe Liste)
Maske: Nickname oder Hostmaske, die ignoriert werden soll
Typ: Typ der Nachrichten, die ignoriert werden sollen (action, ctcp, dcc, pv)
Befehl: IRC-Befehl
Channel: Channel, in dem ignoriert werden soll
Server: Server, auf dem ignoriert werden soll
Bei jedem Argument steht '*' für 'alle'.
Ohne Argumente listet /ignore alle definierten /ignore-Regeln auf.
</programlisting>
<command>key [Taste Funktion/Befehl] [unbind Taste] [functions] [reset -yes]</command>
<programlisting>
belegen/freigeben von Tasten
Taste: diese Taste mit einer internen Funktion oder einem Befehl, beginnend mit "/", belegen
unbind: Tastenbelegung aufheben
functions: interne Funktionen für Tastenbelegungen auflisten
reset: Standardbelegung wiederherstellen und entferne alle eigenen Belegungen (Vorsicht!)
</programlisting>
<command>plugin [load Dateiname] | [autoload] | [reload] | [unload]</command>
<programlisting>
auflisten/laden/entladen von Plugins
Dateiname: zu ladendes Plugin
Ohne Argumente werden alle geladenen Plugins aufgelistet.
</programlisting>
<command>server [Servername] | [Servername Hostname Port [-auto | -noauto] [-ipv6] [-ssl] [-pwd Passwort] [-nicks Nick1 Nick2 Nick3] [-username Benutzername] [-realname Name] [-command Befehl] [-autojoin Channel[,Channel]] ] | [del Servername]</command>
<programlisting>
Auflisten, Hinzufügen oder Entfernen von Servern
Servername: anzuzeigender Servername
Hostname: Name oder IP-Adresse des Servers
Port: Port des Servers
ipv6: IPv6 benutzen
ssl: SSL benutzen
Passwort: Serverpasswort
Nick1: erster Nickname
Nick2: zweiter Nickname
Nick3: dritter Nicname
Benutzername: Benutzername
Realname: voller Name des Benutzers
</programlisting>
<command>save [Datei]</command>
<programlisting>
Konfiguration abspeichern
Datei: Name der zu speichernden Konfigurationsdatei
</programlisting>
<command>set [Option [ = Wert]]</command>
<programlisting>
Konfigurationsparameter setzen
Option: Name einer Option (wenn der Name vorhanden ist, aber kein Wert, dann wird eine Hilfe zur Option ausgegeben
Wert: Wert der Option
Option kann Servername.server_xxx lauten, wobei "Servername" der interne Servername ist und "xxx" eine Option für diesen Server.
</programlisting>
<command>setp [Option [ = Wert]]</command>
<programlisting>
Konfigurationsparameter für Plugin setzen
Option: Name einer Plugin-Option
Wert: Wert für Option
Option wird wie folgt formatiert: Plugin.Option, z.B. perl.myscript.item1
</programlisting>
<command>unalias Aliasname</command>
<programlisting>
einen Alias entfernen
Aliasname: Name des zu löschenden Aliases
</programlisting>
<command>unignore [Nummer | [Maske [[Typ | Befehl] [Channel [Server]]]]</command>
<programlisting>
/ignore-Regel entfernen
Nummer: Nummer des zu entfernenden Eintrags (siehe Liste)
Maske: Nickname oder Hostmaske, die ignoriert werden soll
Typ: Typ der Nachrichten, die ignoriert werden sollen (action, ctcp, dcc, pv)
Befehl: IRC-Befehl
Channel: Channel, in dem ignoriert werden soll
Server: Server, auf dem ignoriert werden soll
Bei jedem Argument steht '*' für 'alle'.
Ohne Argumente listet /unignore alle definierten /ignore-Regeln auf.
</programlisting>
<command>upgrade</command>
<programlisting>
aktualisiert WeeChat ohne die Verbindung zum Server zu trennen
Dieser Befehl wird auf dem Weechat-Binary ausgeführt, daher sollte dieses kompiliert oder mit einem Paketmanager installiert sein, bevor der Befehl ausgeführt wird.
</programlisting>
<command>uptime [-o]</command>
<programlisting>
zeigt die Uptime von Weechat an
-o: sendet die Weechat-Uptime als IRC-Nachricht in den aktuellen Channel
</programlisting>
<command>window [list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv [pct] | resize pct | merge [all]]</command>
<programlisting>
Fenster verwalten
list: listet die geöffneten Fenster (Default, kann auch weggelassen werden)
-1: springt zum vorherigen Fenster
+1: springt zum nächsten Fenster
b#: springt zum nächsten Fenster, dass Puffer Nummer # anzeigt
up: wechselt zum Fenster über dem aktuellen
down: wechselt zum Fenster unter dem aktuellen
left: wechselt zum linken Fenster
right: wechselt zum rechten Fenster
splith: teilt das aktuelle Fenster horizontal
splitv: teilt das aktuelle Fenster vertikal
resize: verändert die Größe des aktuellen Fensters, die neue Größe ist &lt;pct&gt; Prozent des Elternfensters groß
merge: vereinigt Fenster miteinander (all = alle Fenster vereinigen)
Bei splith und splitv gibt pct die neue Größe des Fensters im verhältnis zur aktuellen Größe an. Zum Beispiel würde 25 bedeuten, dass das neue Fenster nur noch ein Viertel der Größe des alten Fensters hätte.
</programlisting>
+109
View File
@@ -0,0 +1,109 @@
WeeChat Schnellstarter (deutsche Version)
======================
1. Weechat starten
Entsprechend dem gewählten User-Interface müssen Du starten:
- weechat-curses für das Curses GUI
- weechat-gtk für das Gtk GUI (in Entwicklung)
- weechat-qt für das Qt GUI (in Planung)
- weechat-wxwidgets für das WxWidgets GUI (in Planung)
2. Online-Hilfe / Optionen
WeeChat hat eine eingebaute Hilfe für all Kommandos, tippe einfach /help
Um Hilfe zu einem Kommando zu bekommen, tippe /help Kommando
Um Optionen zu verändern, benutzt du /set Option = Wert
Du brauchst /set Option nur mit den Anfangsbuchstaben eingeben
(<tab> zeigt alle Optionen mit den gleichen Buchstaben) oder mit dem vollen
Namen ohne einen Wert, um eine ausführliche Hilfe zu bekommen.
Wichtig: die Einstellungen werden gespeichert, wenn WeeChat beendet wird
(oder mit dem Befehl /save). Verändere die Einstellungen nicht, wenn WeeChat
läuft, weil WeeChat diese Datei zu jeder Zeit überschreiben kann und
Änderungen verloren sind. Um irgendeine Einstellung zu verändern, verwendest du
das /set Kommando, WeeChat wird die neuen Einstellungen umgehend übernehmen.
3. Einen Server-Eintrag anlegen
Zum Beispiel für irc.quakenet.org, Port 6667:
/server quakenet irc.quakenet.org 6667
(/help Server für volle Hilfe zu diesem Kommando)
4. Eigene Server-Optionen setzen
Nickname:
/set quakenet.server_nick1 = "mynick"
/set quakenet.server_nick2 = "mynick2"
/set quakenet.server_nick3 = "mynick3"
Username/Klarname:
/set quakenet.server_username = "My username"
/set quakenet.server_realname = "My real name"
Automatische Server-Verbindung:
/set quakenet.server_autoconnect = on
Automatisches Betreten eines Channels:
/set quakenet.server_autojoin = "#chan1,#chan2"
Andere Optionen:
Du kannst die Server-Optionen und ihre Werte mit /set quakenet sehen
Um eine Option zu setzen, tippe /set quakenet.option = Wert
5. Verbinden zu einem Server und automatisch einen Channel betreten
/connect quakenet
6. Channels betreten/verlassen
Einen Channel betreten:
/join #channel
Einen Channel verlassen:
/part [Nachricht]
Einen Channel verlassen und den Buffer schliessen:
/close [Nachricht]
(/close ist ein Alias für /buffer close)
7. Buffer/Fenster Management
Du kannst die einzelnen Buffer mit /buffer und Fenster mit /window
verwalten.
Um zum Beispiel das Fenster in ein kleineres (1/3 breit) und ein
grosses (2/3 breit) zu teilen, nutzt du das folgende Kommando:
/window splitv 33
8. Tastenkombinationen
Entsprechend deiner Tastatur und/oder deinen Wünschen, kannst du jede Taste
mit "/key" neu zuordnen.
Eine nützliche Taste ist meta-k (alt-k), sie zeigt die Tastaturcodes an.
Um zum Beispiel meta-y (alt-y) dem Kommando "/buffer close" zuzuordnen:
/key (tippe meta-k) (tippe meta-y) /buffer close
Und du bekommst damit die Kommandozeile:
/key meta-y /buffer close
9. Plugins/Skripte
In einigen Distributionen, wie zum Beispiel Debian, sind Plugins in separaten
Paketen verfügbar (wie weechat-plugins). Plugins werden automatisch geladen,
wenn welche gefunden wurden.
Viele Plugins/Skripte für WeeChat sind zu finden auf:
http://weechat.flashtux.org/plugins.php
Bitte lies für das Laden/Entladen von Plugins oder Skripten die Dokumentation.
10. Mehr Dokumentation
Jetzt kannst du WeeChat starten und die FAQ/Dokumentation lesen, falls du weitere
Fragen hast:
http://weechat.flashtux.org/faq.php
http://weechat.flashtux.org/doc.php
Viel Spass mit WeeChat!
--
(c) 2006-05-31, written by FlashCode <flashcode@flashtux.org>
This document is part of WeeChat and is distributed under GPL licence.
+6 -2
View File
@@ -18,8 +18,9 @@
LANGCODE = en
BOOK = weechat.$(LANGCODE)
BOOK_INCLUDE = weechat_commands.xml irc_commands.xml key_functions.xml config.xml
QUICKSTART = weechat_quickstart.$(LANGCODE).txt
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE)
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE) $(QUICKSTART)
docdir = $(datadir)/doc/$(PACKAGE)
@@ -30,6 +31,7 @@ all-local: html-stamp
html: html-stamp
html-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html.xsl ../weechat-doc.css
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
mkdir -p html/
xsltproc -o html/ ../weechat-html.xsl $(BOOK).xml || true
cp ../weechat-doc.css html/
@@ -40,6 +42,7 @@ html-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html.xsl ../weechat-doc.css
html1: html1-stamp
html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.css
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
mkdir -p html1/
xsltproc -o html1/$(BOOK).html ../weechat-html-one.xsl $(BOOK).xml || true
cp ../weechat-doc.css html1/
@@ -50,10 +53,11 @@ html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.
install-data-hook:
$(mkinstalldirs) $(DESTDIR)$(docdir)/html/$(LANGCODE)/
$(INSTALL_DATA) html/* $(DESTDIR)$(docdir)/html/$(LANGCODE)/
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
# clean
clean-local:
-rm -f *.html *.pdf *.txt
-rm -f $(BOOK).html $(BOOK).pdf $(BOOK).txt date.xml
-rm -rf html/ html1/
-rm -f html-stamp html1-stamp
+290 -172
View File
File diff suppressed because it is too large Load Diff
+11 -6
View File
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<command>admin [target]</command>
<programlisting>
find information about the administrator of the server
@@ -45,13 +51,12 @@ send a CTCP message (Client-To-Client Protocol)
arguments: arguments for CTCP
</programlisting>
<command>dcc action [nickname [file]]</command>
<command>cycle [channel[,channel]] [part_message]</command>
<programlisting>
starts DCC (file or chat) or close chat
leave and rejoin a channel
action: 'send' (file) or 'chat' or 'close' (chat)
nickname: nickname to send file or chat
file: filename (on local host)
channel: channel name for cycle
part_message: part message (displayed to other users)
</programlisting>
<command>dehalfop [nickname [nickname]]</command>
@@ -147,7 +152,7 @@ server_mask: list of servers must match this mask
<programlisting>
list channels and their topic
channel: channel to list
channel: channel to list (a regexp is allowed)
server: server name
</programlisting>
+30
View File
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<row>
<entry><literal>return</literal></entry>
<entry>terminate line</entry>
@@ -7,6 +13,10 @@
<entry><literal>tab</literal></entry>
<entry>complete word</entry>
</row>
<row>
<entry><literal>tab_previous</literal></entry>
<entry>find previous completion for word</entry>
</row>
<row>
<entry><literal>backspace</literal></entry>
<entry>delete previous char</entry>
@@ -91,6 +101,22 @@
<entry><literal>page_down</literal></entry>
<entry>scroll one page down</entry>
</row>
<row>
<entry><literal>scroll_up</literal></entry>
<entry>scroll a few lines up</entry>
</row>
<row>
<entry><literal>scroll_down</literal></entry>
<entry>scroll a few lines down</entry>
</row>
<row>
<entry><literal>scroll_top</literal></entry>
<entry>scroll to top of buffer</entry>
</row>
<row>
<entry><literal>scroll_bottom</literal></entry>
<entry>scroll to bottom of buffer</entry>
</row>
<row>
<entry><literal>nick_beginning</literal></entry>
<entry>display beginning of nicklist</entry>
@@ -115,6 +141,10 @@
<entry><literal>jump_dcc</literal></entry>
<entry>jump to DCC buffer</entry>
</row>
<row>
<entry><literal>jump_raw_data</literal></entry>
<entry>jump to raw IRC data buffer</entry>
</row>
<row>
<entry><literal>jump_last_buffer</literal></entry>
<entry>jump to last buffer</entry>
+3606 -203
View File
File diff suppressed because it is too large Load Diff
+46 -9
View File
@@ -1,26 +1,40 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<command>alias [alias_name [command [arguments]]</command>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<command>alias [alias_name [command [arguments]]]</command>
<programlisting>
create an alias for a command
alias_name: name of alias
command: command name (WeeChat or IRC command, without first '/')
command: command name (WeeChat or IRC command, many commands can be separated by semicolons)
arguments: arguments for command
</programlisting>
<command>buffer [action | number | [[server] [channel]]]</command>
<command>buffer [action [args] | number | [[server] [channel]]]</command>
<programlisting>
manage buffers
action: action to do:
move: move buffer in the list (may be relative, for example -1)
close: close buffer (for channel: same as /part without part message)
list: list opened buffers (no parameter implies this list)
close: close buffer (optional arg is part message, for a channel)
list: list open buffers (no parameter implies this list)
notify: set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)
server
channel: jump to buffer by server and/or channel name
number: jump to buffer by number
</programlisting>
<command>builtin command</command>
<programlisting>
launch WeeChat/IRC builtin command (do not look at plugins handlers or aliases)
command: command to execute (a '/' is automatically added if not found at beginning of command)
</programlisting>
<command>charset [(decode_iso | decode_utf | encode) charset]</command>
<programlisting>
@@ -52,6 +66,15 @@ disconnect from a server
servername: server name to disconnect
</programlisting>
<command>dcc action [nickname [file]]</command>
<programlisting>
starts DCC (file or chat) or close chat
action: 'send' (file) or 'chat' or 'close' (chat)
nickname: nickname to send file or chat
file: filename (on local host)
</programlisting>
<command>debug dump | windows</command>
<programlisting>
@@ -135,10 +158,22 @@ file: filename for writing config
</programlisting>
<command>set [option [ = value]]</command>
<programlisting>
set config parameters
set config options
option: name of an option (if name is full and no value is given, then help is displayed on option)
value: value for option
value: value for option
Option may be: servername.server_xxx where "servername" is an internal server name and "xxx" an option for this server.
</programlisting>
<command>setp [option [ = value]]</command>
<programlisting>
set plugin config options
option: name of a plugin option
value: value for option
Option is format: plugin.option, example: perl.myscript.item1
</programlisting>
<command>unalias alias_name</command>
@@ -167,6 +202,8 @@ Without argument, /unignore command lists all defined ignore.
<programlisting>
upgrade WeeChat without disconnecting from servers
This command run again WeeChat binary, so it should have been compiled or installed with a package manager before running this command.
</programlisting>
<command>uptime [-o]</command>
<programlisting>
@@ -179,7 +216,7 @@ show WeeChat uptime
<programlisting>
manage windows
list: list opened windows (no parameter implies this list)
list: list open windows (no parameter implies this list)
-1: jump to previous window
+1: jump to next window
b#: jump to next window displaying buffer number #
@@ -189,7 +226,7 @@ manage windows
right: switch to window on the right
splith: split current window horizontally
splitv: split current window vertically
resize: resize window size, new size is pct%% of parent window
resize: resize window size, new size is &lt;pct&gt; pourcentage of parent window
merge: merge window with another (all = keep only one window)
For splith and splitv, pct is a pourcentage which represents size of new window, computed with current window as size reference. For example 25 means create a new window with size = current_size / 4
+107
View File
@@ -0,0 +1,107 @@
WeeChat quick start guide (english version)
=========================
1. Launch weechat
According to choosed GUI, you have to launch:
- weechat-curses for Curses GUI
- weechat-gtk for Gtk GUI (under development)
- weechat-qt for Qt GUI (not developed)
- weechat-wxwidgets for WxWidgets GUI (not developed)
2. Online help / options
WeeChat has help for all commands, just issue /help
To get help on a command, issue /help command
To set options, use /set option = value
You can use /set option with partial name (display all options
containg letters), or with only a full option name without value
(to see long help for option).
Important note: settings are saved when WeeChat ends (or with "/save"
command). Do NOT edit setup file while WeeChat is running, because WeeChat
may write this file at any time, and it's not possible to reload it.
To change any settings, use "/set" command, WeeChat immediately uses new
settings.
3. Create a server
For example irc.quakenet.org, port 6667:
/server quakenet irc.quakenet.org 6667
(/help server for full command help)
4. Set custom server options
Nicks:
/set quakenet.server_nick1 = "mynick"
/set quakenet.server_nick2 = "mynick2"
/set quakenet.server_nick3 = "mynick3"
Username/realname:
/set quakenet.server_username = "My username"
/set quakenet.server_realname = "My real name"
Auto-connect to server:
/set quakenet.server_autoconnect = on
Auto-join for some channels:
/set quakenet.server_autojoin = "#chan1,#chan2"
Other options:
You can see servers options and values with /set quakenet
To set an option, use /set quakenet.server_option = value
5. Connect to server and auto-join channels:
/connect quakenet
6. Join/part channels
Join a channel:
/join #channel
Part a channel:
/part [quit message]
Part a channel and close buffer:
/close [quit message]
(/close is an alias on /buffer close)
7. Buffer/window management
You can manage buffers with "/buffer" command and windows
with "/window" command.
For example, to split verticaly screen into a small window (1/3 width),
and a large (2/3), use command:
/window splitv 33
8. Key bindings
According to your keyboard and/or your needs, you can rebind any key
with "/key" command.
A useful key is meta-k (alt-k) to find key codes.
For example, to bind meta-y (alt-y) to command "/buffer close":
/key (press meta-k) (press meta-y) /buffer close
You'll have a command line like:
/key meta-y /buffer close
9. Plugins/scripts
On some distros like Debian, plugins are available via a separate package
(like weechat-plugins).
Plugins are automatically loaded when found.
Many plugins/scripts are available for WeeChat, please look at:
http://weechat.flashtux.org/plugins.php
Please look at WeeChat documentation to load/unload plugins or scripts.
10. More documentation
You can now use WeeChat and read FAQ/documentation for any other question:
http://weechat.flashtux.org/faq.php
http://weechat.flashtux.org/doc.php
Enjoy WeeChat!
--
(c) 2006-05-31, written by FlashCode <flashcode@flashtux.org>
This document is part of WeeChat and is distributed under GPL licence.
+6 -2
View File
@@ -18,8 +18,9 @@
LANGCODE = fr
BOOK = weechat.$(LANGCODE)
BOOK_INCLUDE = weechat_commands.xml irc_commands.xml key_functions.xml config.xml
QUICKSTART = weechat_quickstart.$(LANGCODE).txt
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE)
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE) $(QUICKSTART)
docdir = $(datadir)/doc/$(PACKAGE)
@@ -30,6 +31,7 @@ all-local: html-stamp
html: html-stamp
html-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html.xsl ../weechat-doc.css
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
mkdir -p html/
xsltproc -o html/ ../weechat-html.xsl $(BOOK).xml || true
cp ../weechat-doc.css html/
@@ -40,6 +42,7 @@ html-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html.xsl ../weechat-doc.css
html1: html1-stamp
html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.css
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
mkdir -p html1/
xsltproc -o html1/$(BOOK).html ../weechat-html-one.xsl $(BOOK).xml || true
cp ../weechat-doc.css html1/
@@ -50,10 +53,11 @@ html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.
install-data-hook:
$(mkinstalldirs) $(DESTDIR)$(docdir)/html/$(LANGCODE)/
$(INSTALL_DATA) html/* $(DESTDIR)$(docdir)/html/$(LANGCODE)/
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
# clean
clean-local:
-rm -f *.html *.pdf *.txt
-rm -f $(BOOK).html $(BOOK).pdf $(BOOK).txt date.xml
-rm -rf html/ html1/
-rm -f html-stamp html1-stamp
+129 -11
View File
@@ -1,4 +1,17 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<row>
<entry><option>look_save_on_exit</option></entry>
<entry>booléen</entry>
<entry>'on' ou 'off'</entry>
<entry>'on'</entry>
<entry>Sauvegarder la configuration en quittant</entry>
</row>
<row>
<entry><option>look_set_title</option></entry>
<entry>booléen</entry>
@@ -46,7 +59,7 @@
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>''</entry>
<entry>Jeu de caractères pour encoder les messages envoyés au serveur, exemples: UFT-8, ISO-8859-1 (si non renseigné, les messages ne sont pas convertis)</entry>
<entry>Jeu de caractères pour encoder les messages envoyés au serveur, exemples: UTF-8, ISO-8859-1 (si non renseigné, les messages ne sont pas convertis)</entry>
</row>
<row>
<entry><option>look_charset_internal</option></entry>
@@ -62,6 +75,20 @@
<entry>'off'</entry>
<entry>Utiliser le même tampon pour tous les serveurs</entry>
</row>
<row>
<entry><option>look_open_near_server</option></entry>
<entry>booléen</entry>
<entry>'on' ou 'off'</entry>
<entry>'off'</entry>
<entry>Ouvrir les nouveaux canaux/privés près du serveur</entry>
</row>
<row>
<entry><option>look_scroll_amount</option></entry>
<entry>entier</entry>
<entry>entre 1 et 2147483647</entry>
<entry>3</entry>
<entry>Nombre de lignes pour le défilement avec scroll_up et scroll_down</entry>
</row>
<row>
<entry><option>look_buffer_timestamp</option></entry>
<entry>chaîne</entry>
@@ -109,7 +136,7 @@
<entry>entier</entry>
<entry>entre 0 et 100</entry>
<entry>0</entry>
<entry>Taille maximum pour la fenêtre d'utilisateurs (largeur ou hauteur, selon look_nicklist_position (0 = pas de taille maximum; si min == max et > 0, alors la taille est fixe))</entry>
<entry>Taille maximum pour la fenêtre d'utilisateurs (largeur ou hauteur, selon look_nicklist_position (0 = pas de taille maximum; si min == max et &gt; 0, alors la taille est fixe))</entry>
</row>
<row>
<entry><option>look_no_nickname</option></entry>
@@ -132,6 +159,48 @@
<entry>'off'</entry>
<entry>Afficher un espace si le mode utilisateur n'est pas (half)op/voice</entry>
</row>
<row>
<entry><option>look_nick_prefix</option></entry>
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>''</entry>
<entry>Texte à afficher avant le pseudo dans la fenêtre de discussion</entry>
</row>
<row>
<entry><option>look_nick_suffix</option></entry>
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>' |'</entry>
<entry>Texte à afficher après le pseudo dans la fenêtre de discussion</entry>
</row>
<row>
<entry><option>look_align_nick</option></entry>
<entry>chaîne</entry>
<entry>'none', 'left', 'right'</entry>
<entry>'right'</entry>
<entry>Alignement des pseudos (taille fixe pour les pseudos dans la fenêtre de discussion (none, left, right))</entry>
</row>
<row>
<entry><option>look_align_other</option></entry>
<entry>booléen</entry>
<entry>'on' ou 'off'</entry>
<entry>'on'</entry>
<entry>Alignement pour les autres messages (ne commençant pas par un pseudo)</entry>
</row>
<row>
<entry><option>look_align_size</option></entry>
<entry>entier</entry>
<entry>entre 8 et 64</entry>
<entry>14</entry>
<entry>Taille pour l'alignement des pseudos et autres messages</entry>
</row>
<row>
<entry><option>look_align_size_max</option></entry>
<entry>entier</entry>
<entry>entre 8 et 64</entry>
<entry>20</entry>
<entry>Taille maximum pour l'alignement des pseudos et autres messages (doit être &gt;= à look_align_size)</entry>
</row>
<row>
<entry><option>look_nick_completor</option></entry>
<entry>chaîne</entry>
@@ -146,6 +215,13 @@
<entry>'[]-^'</entry>
<entry>Caractères à ignorer pour la complétion des pseudos</entry>
</row>
<row>
<entry><option>look_nick_complete_first</option></entry>
<entry>booléen</entry>
<entry>'on' ou 'off'</entry>
<entry>'off'</entry>
<entry>Compléter seulement avec le premier pseudo trouvé</entry>
</row>
<row>
<entry><option>look_infobar</option></entry>
<entry>booléen</entry>
@@ -216,6 +292,13 @@
<entry>' '</entry>
<entry>Utiliser un marqueur sur les serveurs/canaux pour montrer la première ligne non lue</entry>
</row>
<row>
<entry><option>look_input_format</option></entry>
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>'[%n(%m)] '</entry>
<entry>Format pour l'invite de la zone de saisie ('%c' est remplacé par le canal ou serveur, '%n' par le pseudo et '%m' par les modes du pseudo)</entry>
</row>
<row>
<entry><option>col_real_white</option></entry>
<entry>booléen</entry>
@@ -454,6 +537,13 @@
<entry>'default'</entry>
<entry>Couleur pour le texte saisi</entry>
</row>
<row>
<entry><option>col_input_server</option></entry>
<entry>couleur</entry>
<entry>couleur Curses ou Gtk</entry>
<entry>'brown'</entry>
<entry>Couleur pour le texte saisi (nom du serveur)</entry>
</row>
<row>
<entry><option>col_input_channel</option></entry>
<entry>couleur</entry>
@@ -738,8 +828,8 @@
<entry><option>log_path</option></entry>
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>'~/.weechat/logs/'</entry>
<entry>Chemin pour les conversations sauvegardées par WeeChat</entry>
<entry>'%h/logs/'</entry>
<entry>Chemin pour les conversations sauvegardées par WeeChat ('%h' sera remplacé par le répertoire de base WeeChat, par défaut: ~/.weechat)</entry>
</row>
<row>
<entry><option>log_timestamp</option></entry>
@@ -762,12 +852,19 @@
<entry>'off'</entry>
<entry>Affiche un message pour l'absence/le retour</entry>
</row>
<row>
<entry><option>irc_show_away_once</option></entry>
<entry>booléen</entry>
<entry>'on' ou 'off'</entry>
<entry>'on'</entry>
<entry>Voir le message d'absence distant une seule fois en privé</entry>
</row>
<row>
<entry><option>irc_default_msg_part</option></entry>
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>'WeeChat %v'</entry>
<entry>Message par défaut pour le part (quitte un canal)</entry>
<entry>Message par défaut pour le part (quitte un canal) ('%v' sera remplacé par la version de WeeChat dans la chaîne)</entry>
</row>
<row>
<entry><option>irc_default_msg_quit</option></entry>
@@ -788,7 +885,14 @@
<entry>entier</entry>
<entry>entre 0 et 2147483647</entry>
<entry>0</entry>
<entry>Intervalle entre deux vérifications des absences (en minutes, 0 = ne jemais vérifier)</entry>
<entry>Intervalle entre deux vérifications des absences (en minutes, 0 = ne jamais vérifier)</entry>
</row>
<row>
<entry><option>irc_away_check_max_nicks</option></entry>
<entry>entier</entry>
<entry>entre 0 et 2147483647</entry>
<entry>0</entry>
<entry>Ne pas vérifier les pseudos absents lorsqu'il y a un nombre important de pseudos (0 = pas de limite)</entry>
</row>
<row>
<entry><option>irc_lag_check</option></entry>
@@ -856,7 +960,7 @@
<row>
<entry><option>dcc_timeout</option></entry>
<entry>entier</entry>
<entry>entre 1 et 2147483647</entry>
<entry>entre 5 et 2147483647</entry>
<entry>300</entry>
<entry>Délai d'attente pour les requêtes dcc (en secondes)</entry>
</row>
@@ -867,6 +971,13 @@
<entry>65536</entry>
<entry>Taille de bloc pour les paquets dcc en octets (défaut: 65536)</entry>
</row>
<row>
<entry><option>dcc_fast_send</option></entry>
<entry>booléen</entry>
<entry>'on' ou 'off'</entry>
<entry>'on'</entry>
<entry>N'attend pas les accusés de réception lors de l'envoi de fichier</entry>
</row>
<row>
<entry><option>dcc_port_range</option></entry>
<entry>chaîne</entry>
@@ -885,7 +996,7 @@
<entry><option>dcc_download_path</option></entry>
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>'~'</entry>
<entry>'%h/dcc'</entry>
<entry>Chemin pour écrire les fichiers reçus par dcc (par défaut: répertoire de l'utilisateur)</entry>
</row>
<row>
@@ -969,8 +1080,8 @@
<entry><option>plugins_path</option></entry>
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>'~/.weechat/plugins'</entry>
<entry>Chemin de recherche des extensions</entry>
<entry>'%h/plugins'</entry>
<entry>Chemin de recherche des extensions ('%h' sera remplacé par le répertoire de base WeeChat, par défaut: ~/.weechat)</entry>
</row>
<row>
<entry><option>plugins_autoload</option></entry>
@@ -1084,12 +1195,19 @@
<entry>''</entry>
<entry>Nom réel pour le serveur IRC</entry>
</row>
<row>
<entry><option>server_hostname</option></entry>
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>''</entry>
<entry>Nom de machine/IP personnalisé pour le serveur (optionnel, si non renseigné, le nom de machine local est utilisé)</entry>
</row>
<row>
<entry><option>server_command</option></entry>
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>''</entry>
<entry>Commande à exécuter en premier lorsque connecté au serveur</entry>
<entry>Commande(s) à exécuter lorsque connecté au serveur (plusieurs commandes doivent être séparées par ';', utilisez '\;' pour un point-virgule)</entry>
</row>
<row>
<entry><option>server_command_delay</option></entry>
+13 -8
View File
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<command>admin [cible]</command>
<programlisting>
trouver les informations sur l'administrateur du serveur
@@ -45,13 +51,12 @@ envoyer un message CTCP (Client-To-Client Protocol)
arguments: arguments pour le CTCP
</programlisting>
<command>dcc action [pseudo [fichier]]</command>
<command>cycle [canal[,canal]] [message_de_fin]</command>
<programlisting>
démarre le DCC (fichier ou discussion) ou ferme une discussion
quitter et rejoindre un canal
action: 'send' (envoi de fichier) ou 'chat' (discussion) ou 'close' (fermeture discussion)
pseudo: pseudo pour envoyer le fichier ou discuter
fichier: nom du fichier (sur la machine locale)
canal: canal pour le cycle
message_de_fin: message de fin (affiché aux autres utilisateurs)
</programlisting>
<command>dehalfop [pseudo [pseudo]]</command>
@@ -143,11 +148,11 @@ lister tous les noms de serveurs connus du serveur qui r
masque_serveur: liste des serveurs correspondant au masque
</programlisting>
<command>list [canal[,canall] [serveur]]</command>
<command>list [canal[,canal] [serveur]]</command>
<programlisting>
lister les canaux et leur sujet
canal: canal à lister
canal: canal à lister (une expression régulière est acceptée)
serveur: nom du serveur
</programlisting>
@@ -242,7 +247,7 @@ obtenir le statut d'op
utilisateur/mot_de_passe: utilisé pour obtenir les privilèges sur le serveur IRC courant
</programlisting>
<command>part [canal[,canall] [message_de_fin]</command>
<command>part [canal[,canal]] [message_de_fin]</command>
<programlisting>
quitter un canal
+30
View File
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<row>
<entry><literal>return</literal></entry>
<entry>terminer la ligne</entry>
@@ -7,6 +13,10 @@
<entry><literal>tab</literal></entry>
<entry>compléter le mot</entry>
</row>
<row>
<entry><literal>tab_previous</literal></entry>
<entry>trouver le mot complété précédent</entry>
</row>
<row>
<entry><literal>backspace</literal></entry>
<entry>effacer le caractère précédent</entry>
@@ -91,6 +101,22 @@
<entry><literal>page_down</literal></entry>
<entry>faire défiler d'une page vers le bas</entry>
</row>
<row>
<entry><literal>scroll_up</literal></entry>
<entry>faire défiler de quelques lignes vers le haut</entry>
</row>
<row>
<entry><literal>scroll_down</literal></entry>
<entry>faire défiler de quelques lignes vers le bas</entry>
</row>
<row>
<entry><literal>scroll_top</literal></entry>
<entry>faire défiler jusqu'au début du tampon</entry>
</row>
<row>
<entry><literal>scroll_bottom</literal></entry>
<entry>faire défiler jusqu'à la fin du tampon</entry>
</row>
<row>
<entry><literal>nick_beginning</literal></entry>
<entry>afficher le début de la liste des pseudos</entry>
@@ -115,6 +141,10 @@
<entry><literal>jump_dcc</literal></entry>
<entry>sauter au tampon DCC</entry>
</row>
<row>
<entry><literal>jump_raw_data</literal></entry>
<entry>sauter au tampon IRC brut</entry>
</row>
<row>
<entry><literal>jump_last_buffer</literal></entry>
<entry>sauter au dernier tampon</entry>
+3648 -182
View File
File diff suppressed because it is too large Load Diff
+47 -10
View File
@@ -1,25 +1,39 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<command>alias [nom_alias [commande [paramètres]]</command>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<command>alias [nom_alias [commande [paramètres]]]</command>
<programlisting>
créer un alias pour une commande
nom_alias: nom de l'alias
commande: nom de la commande (commande WeeChat ou IRC, sans le premier '/')
commande: nom de la commande (commande WeeChat ou IRC, plusieurs commandes peuvent être séparées par des point-virgules)
paramètres: paramètres pour la commande
</programlisting>
<command>buffer [action | nombre | [[serveur] [canal]]]</command>
<command>buffer [action [args] | nombre | [[serveur] [canal]]]</command>
<programlisting>
gestion des tampons
action: action à effectuer:
move: déplacer le tampon dans la liste (peut être relatif, par exemple -1)
close: fermer le tampon (pour un canal: équivalent à /part sans message de fin)
move: déplace le tampon dans la liste (peut être relatif, par exemple -1)
close: ferme le tampon (le paramètre optionnel est le message de fin, pour un canal)
list: liste les tampons ouverts (pas de paramètre affiche cette liste)
notify: fixer le niveau de notification (0=jamais, 1=highlight, 2=1+msg, 3=2+join/part)
notify: fixe le niveau de notification (0=jamais, 1=highlight, 2=1+msg, 3=2+join/part)
serveur
canal: sauter au tampon par serveur et/ou nom de canal
nombre: sauter au tampon qui a ce numéro
canal: saute au tampon par serveur et/ou nom de canal
nombre: saute au tampon qui a ce numéro
</programlisting>
<command>builtin commande</command>
<programlisting>
lance une commande WeeChat/IRC interne (sans regarder les gestionnaires de commandes et les alias)
commande: commande à exécuter (un '/' est automatiquement ajouté s'il n'est pas trouvé au début de la commande)
</programlisting>
<command>charset [(decode_iso | decode_utf | encode) charset]</command>
@@ -52,6 +66,15 @@ se d
nom_serveur: nom du serveur pour se déconnecter
</programlisting>
<command>dcc action [pseudo [fichier]]</command>
<programlisting>
démarre le DCC (fichier ou discussion) ou ferme une discussion
action: 'send' (envoi de fichier) ou 'chat' (discussion) ou 'close' (fermeture discussion)
pseudo: pseudo pour envoyer le fichier ou discuter
fichier: nom du fichier (sur la machine locale)
</programlisting>
<command>debug dump | windows</command>
<programlisting>
@@ -135,11 +158,23 @@ fichier: fichier pour sauvegarder la configuration
</programlisting>
<command>set [option [ = valeur]]</command>
<programlisting>
modifier des paramètres de configuration
modifier des options de configuration
option: nom de l'option (si le nom est complet et qu'aucune valeur n'est donnée, alors l'aide sur l'option est affichée)
valeur: valeur pour l'option
L'option peut être: nomserveur.server_xxx où "nomserveur" est le nom interne d'un serveur et "xxx" une option pour ce serveur.
</programlisting>
<command>setp [option [ = valeur]]</command>
<programlisting>
modifier des options de configuration des extensions
option: nom d'une option d'extension
valeur: valeur pour l'option
L'option est au format: extension.option, par exemple: perl.monscript.variable1
</programlisting>
<command>unalias nom_alias</command>
<programlisting>
@@ -167,6 +202,8 @@ Sans param
<programlisting>
mettre à jour WeeChat sans se déconnecter des serveurs
Cette commande lance à nouveau le binaire WeeChat, il doit donc avoir été compilé ou installé via un gestionnaire de paquet avant de lancer cette commande.
</programlisting>
<command>uptime [-o]</command>
<programlisting>
@@ -189,7 +226,7 @@ gestion des fen
right: saute à la fenêtre à droite
splith: éclate la fenêtre en deux horizontalement
splitv: éclate la fenêtre en deux verticalement
resize: redimensionne une fenêtre, la nouvelle taille est pct%% de la fenêtre parent
resize: redimensionne une fenêtre, la nouvelle taille est &lt;pct&gt; pourcentage de la fenêtre parent
merge: fusionne la fenêtre avec une autre
Pour splith et splitv, pct est un pourcentage qui représente la taille de la nouvelle fenêtre, calculée par rapport à la taille de la fenêtre courante. Par exemple 25 signifie créer une fenêtre qui a pour taille: taille_courante / 4
+110
View File
@@ -0,0 +1,110 @@
Guide de démarrage rapide WeeChat (version française)
=================================
1. Démarrer weechat
Selon l'interface choisie, vous devez lancer :
- weechat-curses pour l'interface Curses
- weechat-gtk pour l'interface Gtk (en développement)
- weechat-qt pour l'interface Qt (non développée)
- weechat-wxwidgets pour l'interface WxWidgets (non développée)
2. Aide en ligne / options
WeeChat dispose d'aide pour toutes les commandes, tapez simplement /help
Pour avoir de l'aide sur une commande, tapez /help commande
Pour modifier des options, utilisez /set option = valeur
Vous pouvez utiliser /set avec un nom partiel d'option (affiche alors
les options contenant ces lettres), ou avec un nom complet d'option
sans valeur (pour voir l'aide complète de l'option).
Note importante: les options sont sauvées lorsque WeeChat quitte (ou avec
la commande "/save"). N'éditez PAS le fichier de configuration pendant que
WeeChat tourne, car WeeChat peut écrire ce fichier à tout moment, et il
n'est pas possible de le recharger.
Pour changer toute option, utilisez la commande "/set", WeeChat prend en
compte immédiatement les nouvelles valeurs.
3. Créer un serveur
Par exemple irc.quakenet.org, port 6667:
/server quakenet irc.quakenet.org 6667
(/help server pour l'aide complète sur la commande)
4. Définir les options du serveur
Pseudos :
/set quakenet.server_nick1 = "mynick"
/set quakenet.server_nick2 = "mynick2"
/set quakenet.server_nick3 = "mynick3"
Nom d'utilisateur/réel :
/set quakenet.server_username = "Mon nom d'utilisateur"
/set quakenet.server_realname = "Mon nom réel"
Connexion auto au serveur :
/set quakenet.server_autoconnect = on
Rejoindre automatiquement des canaux :
/set quakenet.server_autojoin = "#canal1,#canal2"
Autres options :
Vous pouvez voir les options du serveur et les valeurs avec /set quakenet
Pour modifier une option, utilisez /set quakenet.server_option = valeur
5. Se connecter au serveur et rejoindre les canaux :
/connect quakenet
6. Rejoindre/quittre les canaux
Joindre un canal :
/join #channel
Quitter un canal :
/part [message de fin]
Quitter un canal et fermer le tampon :
/close [message de fin]
(/close est un alias sur /buffer close)
7. Gérer les tampons/fenêtres
Vous pouvez gérer les tampons avec la commande "/buffer" et les fenêtres
avec la commande "/window".
Par exemple, pour découper verticalement l'écran en une petite fenêtre
(1/3 de la largeur) et une large (2/3 de la largeur), utilisez la commande
/window splitv 33
8. Gérer les raccourcis clavier
Selon votre clavier et vos besoins, vous pouvez associer n'importe quelle
touche à une commande avec la commande "/key".
Une touche utile est meta-k (alt-k) pour trouver le code des touches.
Par exemple, pour associer meta-y (alt-y) à la commande "/buffer close" :
/key (pressez meta-k) (pressez meta-y) /buffer close
Vous aurez une ligne de commande qui ressemble à ceci :
/key meta-y /buffer close
9. Extensions/scripts
Sur certaines distributions comme Debian, les extensions sont disponibles
via un paquet séparé (par exemple weechat-plugins).
Les extensions sont automatiquement chargées lorsqu'elles sont trouvées.
Plusieurs extensions/scripts sont disponibles pour WeeChat, voir ici :
http://weechat.flashtux.org/plugins.php
Merci de regarder la documentation WeeChat pour charger/décharget des
extensions ou des scripts.
10. Plus de documentation
Vous pouvez maintenant utiliser WeeChat et lire la FAQ/documentation pour
toute autre question :
http://weechat.flashtux.org/faq.php
http://weechat.flashtux.org/doc.php
Bon WeeChat !
--
(c) 2006-05-31, écrit par FlashCode <flashcode@flashtux.org>
Ce document fait partie de WeeChat et est distribué sous license GPL.
+28
View File
@@ -0,0 +1,28 @@
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
LANGCODE = pl
QUICKSTART = weechat_quickstart.$(LANGCODE).txt
EXTRA_DIST = $(QUICKSTART)
docdir = $(datadir)/doc/$(PACKAGE)
# install docs
install-data-hook:
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
+111
View File
@@ -0,0 +1,111 @@
Weechat szybki start (wersja polska)
1. Włączenie
Aby wybrać konkretny interfejs należy wpisać:
- weechat-curses dla interfejsu curses
- weechat-gtk dla interfejsu GTK (w fazie tworzenia)
- weechat-qt dla interfejsu QT (planowany)
- weechat-wxwidgets dla interfejsu WxWidgets (planowany)
2. Pomoc online / opcje
Weechat posiada polecenie pomocy, którego można użyć dla każdej dostępnej opcji, wystarczy wpisać /help
Aby otrzymać pomoc odnośnie komendy, wpisz /help <komenda>
Aby konfigurować opcje należy wpisać /set <opcja> = <wartość>
Możesz wpisać /set <opcja> z nie pełną nazwą opcji (pokaże to opcje zawierające wpisany ciąg znaków),
lub z całą nazwą opcji bez wartości (pokaże sie wtedy cała pomoc odnośnie opcji).
Uwaga: ustawienia są zapamiętywane podczas wyłączania WeeChata (albo po wpisaniu /save )
NIE EDYTUJ pliku konfiguracyjnego WeeChata podczas pracy programu, ponieważ WeeChat może nadpisać
ten plik w każdej chwili i nie będzie możliwości odzyskania ustawień.
Aby zmienić każde z ustawień, używaj komendy "/set", WeeChat po jej użyciu od razu zacznie korzystać z nowych
parametrów.
3. Dodawanie serwerów
Dla przykładu irc.quakenet.org, port 6667:
/server quakenet irc.quakenet.org 6667
(wpisz /help server dla pełnej pomocy)
4. Ustawianie własnych ustawień dotyczących serwera
Niki:
/set quakenet.server_nick1 = "mój-nick"
/set quakenet.server_nick2 = "mój-nick2"
/set quakenet.server_nick3 = "mój-nick3"
Imię użytkownika:
/set quakenet.server_username = "My username"
/set quakenet.server_realname = "My real name"
Automatyczne łączenie do serwera przy starcie WeeChata:
/set quakenet.server_autoconnect = on
Automatyczne wchodzenie na wybrane kanały po połączeniu sie do serwera:
/set quakenet.server_autojoin = "#kanał1,#kanał2"
Inne opcje:
Możesz zobaczyć inne opcje i ich właściwości po wpisaniu /set quakenet
Aby ustawić konkretną opcję wpisz /set quakenet.server_opcja = wartość
5. Łączenie do serwera i automatyczne wchodzenie na wybrane kanały:
/connect quakenet
6. Wchodzenie/wychodzenie na/z kanały/-ów
Wchodzenie na kanał:
/join #kanał
Wychodzenie z kanału:
/part {wiadomość przy wychodzeniu}
Wyjście z kanału i zamknięcie zakładki:
/close {wiadomość przy wychodzeniu}
("/close" to alias od "/bufer close")
7. Zarządzanie bufory/okna
Możesz zarządzać buforami przy pomocy polecenia "/buffer" i oknami "/windows"
Przykład:
-aby rozdzielić ekran w pionie na małe okno (1/3 szerokości),
i na duże (2/3), wpisz:
/window splthv 33
8. Przypisywanie funkcji do klawiszy:
W celu łatwiejszej pracy można przypisać dowolnym klawiszom wybrane funkcje/polecenia
przy pomocy komendy "/key"
Użyteczną może być funkcja meta-k (alt+k) która pozwala znaleźć przypisane klawiszom kody.
Przykład: aby zbindować (przypisać) meta-y (alt-y) do polecenia "/buffer close":
/key (naciśnij meta-k) (naciśnij meta-y) /buffer close
Otrzymujesz:
/key meta-y /buffer close
9. Wtyczki/skrypty
Na niektórych systemach operacyjnych, takich jak Debian, wtyczki są dostępne jako oddzielne paczki
(np. weechat-plugins)
Wtyczki są automatycznie ładowane przy starcie.
Dodatkowe skrypty i wtyczki do WeeChata dostępne są na:
http://weechat.flashtux.org/plugins.php
Zajrzyj do dokumentacji WeeChata, aby dowiedzieć sie jak ladować i wyładować wtyczki i skrypty:
http://weechat.flashtux.org/doc.php
10. Dokumentacja szczegółowa
Wiesz juz jak w podstawowy sposób używać WeeChata, aby dowiedzieć sie więcej poczytaj dokumentację.
http://weechat.flashtux.org/faq.php
http://weechat.flashtux.org/doc.php
Miłej pracy z WeeChatem!
--
(c) 2006-05-31, written by FlashCode <flashcode@flashtux.org>
Translated by dzik (znajdziecie mnie na irc.freenode.net)
This document is part of WeeChat and is distributed under GPL licence.
+28
View File
@@ -0,0 +1,28 @@
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
LANGCODE = ru
QUICKSTART = weechat_quickstart.$(LANGCODE).txt
EXTRA_DIST = $(QUICKSTART)
docdir = $(datadir)/doc/$(PACKAGE)
# install docs
install-data-hook:
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
+110
View File
@@ -0,0 +1,110 @@
Краткое руководство пользователя (русская версия)
================================
1. Запуск WeeChat
В зависимости от выбранного интерфейса вы должны запустить:
- weechat-curses для Curses интерфейса
- weechat-gtk для GTK интерфейса (в разработке)
- weechat-qt для Qt интерфейса (не разрабатывается)
- weechat-wxwidgets для WxWidgets интерфейса (не разрабатывается)
2. Справка / настройки
WeeChat содержит справку по всем командам, просто запустите /help
Для получения справки по команде наберите /help команда
Для настройки используйте /set параметр = значение
Вы можете использовать /set с частичным названием параметра
(выведет все параметры с указанной фразой) или с полным названием
(для получения подробной справки по параметру)
Внимание: настройки сохраняются при выходе из WeeChat (или командой
"/save"). НЕ РЕДАКТИРУЙТЕ файл конфигурации когда WeeChat запущен,
т.к. WeeChat может в любой момент перезаписать его. Возможности
перезагрузить файл конфигурации нет. Для изменения любых настроек
воспользуйтесь командой "/set", изменения вступят в силу
незамедлительно.
3. Создание сервера
Например, irc.quakenet.org, порт 6667:
/server quakenet irc.quakenet.org 6667
(/help server выведет подробную справку)
4. Настройка сервера
Ники:
/set quakenet.server_nick1 = "mynick"
/set quakenet.server_nick2 = "mynick2"
/set quakenet.server_nick3 = "mynick3"
Имя пользователя / реальное имя:
/set quakenet.server_username = "Имя пользователя"
/set quakenet.server_realname = "Реальное имя"
Автоматическое подключение к серверу:
/set quakenet.server_autoconnect = on
Автоматический заход на некоторые каналы:
/set quakenet.server_autojoin = "#chan1,#chan2"
Другие настройки:
Чтобы вывести все настройки сервера наберите /set quakenet
Для настройки наберите /set quakenet.параметр_сервера = значение
5. Подключение к серверу и автоматический заход на каналы:
/connect quakenet
6. Заход/покидание каналов
Зайти на канал:
/join #канал
Покинуть канал:
/part [прощальное сообщение]
Покинуть канал и закрыть буфер:
/close [прощальное сообщение]
(/close - это сокращение для /buffer close)
7. Управление буферами/окнами
Вы можете управлять буферами командой "/buffer" и окнами
командой "/window".
Например, чтобы разбить экран по вертикали на маленькое (треть
экрана) и большое (2/3 экрана) окна наберите:
/window splitv 33
8. Привязки клавиш
Вы можете переназначить любую клавишу в соответствии с вашими
пожеланиями командой "/key".
Полезна привязка meta-k (alt-k) для поиска нужных кодов клавиш.
Например, чтобы привязать meta-y (alt-y) к команде "/buffer close":
/key (нажмите meta-k) (нажмите meta-y) /buffer close
Вы получите команду:
/key meta-y /buffer close
9. Plugins/скрипты
В некоторых дистрибутивах pluginы доступны отдельным пакетом
(например, weechat-plugins).
Pluginы загружаются автоматически.
Для WeeChat доступны многочисленные pluginы и скрипты:
http://weechat.flashtux.org/plugins.php
Процесс загрузки и выгрузки pluginов и скриптов подробно описан в
документации.
10. Другая документация
Теперь вы можете пользоваться WeeChat и почитать ЧаВо и документацию
для поиска ответов на оставшиеся вопросы:
http://weechat.flashtux.org/faq.php
http://weechat.flashtux.org/doc.php
Наслаждайтесь WeeChat!
--
(c) 2006-05-31, автор - FlashCode <flashcode@flashtux.org>
(с) 2006-06-04, переводчик - Stalwart <stlwrt@gmail.com>
Этот документ является частью WeeChat и распространяется по лицензии GPL.
+5 -1
View File
@@ -1,4 +1,4 @@
.TH WEECHAT 1 "January 2006" "FlashCode"
.TH WEECHAT 1 "August 2006" "FlashCode"
.SH NAME
weechat-curses \- Wee Enhanced Environment for Chat (Curses version)
@@ -27,6 +27,10 @@ disable auto-connect to servers at startup
.br
display config file help (list of options)
.TP
.B \-d, \-\-dir <dir>
.br
set WeeChat home dir
.TP
.B \-f, \-\-key\-functions
.br
display internal functions for keys
+36
View File
@@ -12,6 +12,42 @@ table {
font-size: 12px;
}
a {
color: #000099;
}
a:visited {
color: #770077;
}
a:hover {
background-color: #FFCCCC;
}
.navheader {
background-color: #E8E8FF;
border: solid 1px #B5B5CC;
}
.navheader hr {
display: none;
}
.navfooter {
background-color: #E8E8FF;
border: solid 1px #B5B5CC;
}
.navfooter hr {
display: none;
}
.title {
background-color: #E5FFE5;
border: solid 1px #CCDDCC;
padding: 3px;
}
.informaltable table {
font-size: 11px;
font-family: Verdana;
@@ -2,7 +2,7 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/html/chunk.xsl"/>
<xsl:import href="@DOC_XSL_PREFIX@/html/docbook.xsl"/>
<xsl:output indent="yes"/>
@@ -2,7 +2,7 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/html/chunk.xsl"/>
<xsl:import href="@DOC_XSL_PREFIX@/html/chunk.xsl"/>
<xsl:output indent="yes"/>
+36 -4
View File
@@ -1,3 +1,4 @@
./src/irc/irc-mode.c
./src/irc/irc-nick.c
./src/irc/irc-server.c
./src/irc/irc-channel.c
@@ -14,14 +15,43 @@
./src/plugins/plugins-config.h
./src/plugins/plugins-interface.c
./src/plugins/weechat-plugin.h
./src/gui/curses/gui-input.c
./src/gui/curses/gui-display.c
./src/gui/gtk/gui-display.c
./src/gui/gtk/gui-input.c
./src/gui/curses/gui-curses-chat.c
./src/gui/curses/gui-curses-color.c
./src/gui/curses/gui-curses-infobar.c
./src/gui/curses/gui-curses-input.c
./src/gui/curses/gui-curses-keyboard.c
./src/gui/curses/gui-curses-main.c
./src/gui/curses/gui-curses-nicklist.c
./src/gui/curses/gui-curses-panel.c
./src/gui/curses/gui-curses-status.c
./src/gui/curses/gui-curses-window.c
./src/gui/curses/gui-curses.h
./src/gui/gtk/gui-gtk-chat.c
./src/gui/gtk/gui-gtk-color.c
./src/gui/gtk/gui-gtk-infobar.c
./src/gui/gtk/gui-gtk-input.c
./src/gui/gtk/gui-gtk-keyboard.c
./src/gui/gtk/gui-gtk-main.c
./src/gui/gtk/gui-gtk-nicklist.c
./src/gui/gtk/gui-gtk-panel.c
./src/gui/gtk/gui-gtk-status.c
./src/gui/gtk/gui-gtk-window.c
./src/gui/gtk/gui-gtk.h
./src/gui/gui-action.c
./src/gui/gui-buffer.c
./src/gui/gui-common.c
./src/gui/gui-keyboard.c
./src/gui/gui-log.c
./src/gui/gui-panel.c
./src/gui/gui-window.c
./src/gui/gui.h
./src/gui/gui-buffer.h
./src/gui/gui-color.h
./src/gui/gui-keyboard.h
./src/gui/gui-panel.h
./src/gui/gui-window.h
./src/common/backtrace.c
./src/common/backtrace.h
./src/common/command.c
./src/common/command.h
./src/common/completion.c
@@ -38,6 +68,8 @@
./src/common/session.h
./src/common/utf8.c
./src/common/utf8.h
./src/common/util.c
./src/common/util.h
./src/common/weechat.c
./src/common/weechat.h
./src/common/weeconfig.c
+1910 -1394
View File
File diff suppressed because it is too large Load Diff
+5787
View File
File diff suppressed because it is too large Load Diff
+1921 -1399
View File
File diff suppressed because it is too large Load Diff
+1942 -1401
View File
File diff suppressed because it is too large Load Diff
+5562
View File
File diff suppressed because it is too large Load Diff
+5751
View File
File diff suppressed because it is too large Load Diff
+1663 -1363
View File
File diff suppressed because it is too large Load Diff
+5 -1
View File
@@ -21,6 +21,8 @@ noinst_LIBRARIES = lib_weechat_main.a
lib_weechat_main_a_SOURCES = weechat.c \
weechat.h \
backtrace.c \
backtrace.h \
command.c \
command.h \
completion.c \
@@ -40,4 +42,6 @@ lib_weechat_main_a_SOURCES = weechat.c \
session.c \
session.h \
utf8.c \
utf8.h
utf8.h \
util.c \
util.h
+172
View File
@@ -0,0 +1,172 @@
/*
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* backtrace.c: display backtrace after a segfault */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#define __USE_GNU
#include <dlfcn.h>
#ifdef HAVE_BACKTRACE
#include <execinfo.h>
#endif
#include "weechat.h"
#include "backtrace.h"
#include "log.h"
/*
* weechat_backtrace_printf: display a backtrage line (on stderr and in WeeChat log)
*/
void
weechat_backtrace_printf (char *message, ...)
{
static char buffer[4096];
va_list argptr;
va_start (argptr, message);
vsnprintf (buffer, sizeof (buffer) - 1, message, argptr);
va_end (argptr);
fprintf (stderr, "%s", buffer);
weechat_log_printf ("%s", buffer);
}
/*
* weechat_backtrace_addr2line: display function name and line with a backtrace address
*/
void
weechat_backtrace_addr2line (int number, void *address, char *symbol)
{
#ifdef HAVE_BACKTRACE
int rc;
Dl_info info;
const void *addr;
FILE *output;
char cmd_line[1024];
char line[1024], *ptr_line, *pos;
char function_name[1024];
int file_line;
rc = dladdr (address, &info);
if ((rc == 0) || !info.dli_fname || !info.dli_fname[0])
{
weechat_backtrace_printf ("%03d %s\n", number, symbol);
return;
}
addr = address;
if (info.dli_fbase >= (const void *) 0x40000000)
addr = (const char *) addr - (unsigned int) info.dli_fbase;
snprintf (cmd_line, sizeof (cmd_line),
"addr2line --functions --demangle -e $(which %s) %p",
info.dli_fname, addr);
output = popen (cmd_line, "r");
if (!output)
{
weechat_backtrace_printf ("%03d %s\n", number, symbol);
return;
}
function_name[0] = '\0';
file_line = 0;
while (!feof (output))
{
ptr_line = fgets (line, sizeof (line) - 1, output);
if (ptr_line && ptr_line[0])
{
pos = strchr (ptr_line, '\n');
if (pos)
pos[0] = '\0';
if (strchr (ptr_line, ':'))
{
file_line = 1;
weechat_backtrace_printf ("%03d %s%s%s%s\n",
number,
ptr_line,
(function_name[0]) ? " [function " : "",
function_name,
(function_name[0]) ? "]" : "");
function_name[0] = '\0';
}
else
{
if (function_name[0])
weechat_backtrace_printf ("%03d %s",
number, function_name);
snprintf (function_name, sizeof (function_name),
"%s", ptr_line);
}
}
}
if (function_name[0])
weechat_backtrace_printf ("%03d %s\n",
number, function_name);
pclose (output);
#else
/* make gcc happy */
(void) number;
(void) address;
(void) symbol;
#endif
}
/*
* weechat_backtrace: display backtrace (called when a SIGSEGV is received)
*/
void
weechat_backtrace ()
{
#ifdef HAVE_BACKTRACE
void *trace[BACKTRACE_MAX];
int trace_size, i;
char **symbols;
#endif
weechat_backtrace_printf ("======= WeeChat backtrace =======\n");
weechat_backtrace_printf ("(written by %s, compiled on %s %s)\n",
PACKAGE_STRING, __DATE__, __TIME__);
#ifdef HAVE_BACKTRACE
trace_size = backtrace (trace, BACKTRACE_MAX);
symbols = backtrace_symbols (trace, trace_size);
for (i = 0; i < trace_size; i++)
{
weechat_backtrace_addr2line (i + 1, trace[i], symbols[i]);
}
#else
weechat_backtrace_printf (" No backtrace info (no debug info available "
"or no backtrace possible on your system).\n");
#endif
weechat_backtrace_printf ("======= End of backtrace =======\n");
}
+28
View File
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __WEECHAT_BACKTACE_H
#define __WEECHAT_BACKTACE_H 1
#define BACKTRACE_MAX 128
extern void weechat_backtrace ();
#endif /* backtrace.h */
+1447 -577
View File
File diff suppressed because it is too large Load Diff
+35 -24
View File
@@ -38,9 +38,11 @@ struct t_weechat_command
char *completion_template; /* template for completion */
/* NULL=no completion, ""=default (nick) */
int min_arg, max_arg; /* min & max number of arguments */
int (*cmd_function_args)(t_gui_window *, int, char **);
int conversion; /* = 1 if cmd args are converted (charset */
/* and color) before execution */
int (*cmd_function_args)(t_irc_server *, t_irc_channel *, int, char **);
/* function called when user enters cmd */
int (*cmd_function_1arg)(t_gui_window *, char *);
int (*cmd_function_1arg)(t_irc_server *, t_irc_channel *, char *);
/* function called when user enters cmd */
};
@@ -50,6 +52,7 @@ struct t_weechat_alias
{
char *alias_name;
char *alias_command;
int running;
t_weechat_alias *prev_alias;
t_weechat_alias *next_alias;
};
@@ -62,32 +65,40 @@ extern t_weelist *last_index_command;
extern void command_index_build ();
extern void command_index_free ();
extern t_weechat_alias *alias_search (char *);
extern t_weechat_alias *alias_new (char *, char *);
extern char *alias_get_final_command (t_weechat_alias *);
extern void alias_free_all ();
extern char **explode_string (char *, char *, int, int *);
extern void free_exploded_string (char **);
extern int exec_weechat_command (t_gui_window *, t_irc_server *, char *);
extern void user_command (t_gui_buffer *, t_irc_server *, char *);
extern int weechat_cmd_alias (t_gui_window *, char *);
extern int weechat_cmd_buffer (t_gui_window *, int, char **);
extern int weechat_cmd_charset (t_gui_window *, int, char **);
extern int weechat_cmd_clear (t_gui_window *, int, char **);
extern int weechat_cmd_connect (t_gui_window *, int, char **);
extern int weechat_cmd_debug (t_gui_window *, int, char **);
extern int weechat_cmd_disconnect (t_gui_window *, int, char **);
extern int weechat_cmd_help (t_gui_window *, int, char **);
extern int weechat_cmd_history (t_gui_window *, int, char **);
extern char **split_multi_command (char *, char);
extern void free_multi_command (char **);
extern int exec_weechat_command (t_irc_server *, t_irc_channel *, char *, int);
extern void user_command (t_irc_server *, t_irc_channel *, char *, int);
extern int weechat_cmd_alias (t_irc_server *, t_irc_channel *, char *);
extern int weechat_cmd_buffer (t_irc_server *, t_irc_channel *, char *);
extern int weechat_cmd_builtin (t_irc_server *, t_irc_channel *, char *);
extern int weechat_cmd_charset (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_clear (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_connect (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_dcc (t_irc_server *, t_irc_channel *, char *);
extern int weechat_cmd_debug (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_disconnect (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_help (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_history (t_irc_server *, t_irc_channel *, int, char **);
extern void weechat_cmd_ignore_display (char *, t_irc_ignore *);
extern int weechat_cmd_ignore (t_gui_window *, int, char **);
extern int weechat_cmd_key (t_gui_window *, char *);
extern int weechat_cmd_plugin (t_gui_window *, int, char **);
extern int weechat_cmd_save (t_gui_window *, int, char **);
extern int weechat_cmd_server (t_gui_window *, int, char **);
extern int weechat_cmd_set (t_gui_window *, char *);
extern int weechat_cmd_unalias (t_gui_window *, char *);
extern int weechat_cmd_unignore (t_gui_window *, int, char **);
extern int weechat_cmd_upgrade (t_gui_window *, int, char **);
extern int weechat_cmd_uptime (t_gui_window *, int, char **);
extern int weechat_cmd_window (t_gui_window *, int, char **);
extern int weechat_cmd_ignore (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_key (t_irc_server *, t_irc_channel *, char *);
extern int weechat_cmd_panel (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_plugin (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_save (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_server (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_set (t_irc_server *, t_irc_channel *, char *);
extern int weechat_cmd_setp (t_irc_server *, t_irc_channel *, char *);
extern int weechat_cmd_unalias (t_irc_server *, t_irc_channel *, char *);
extern int weechat_cmd_unignore (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_upgrade (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_uptime (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_window (t_irc_server *, t_irc_channel *, int, char **);
#endif /* command.h */
+357 -98
View File
@@ -30,7 +30,9 @@
#include "weechat.h"
#include "completion.h"
#include "command.h"
#include "log.h"
#include "utf8.h"
#include "util.h"
#include "weelist.h"
#include "weeconfig.h"
#include "../irc/irc.h"
@@ -53,12 +55,19 @@ completion_init (t_completion *completion, void *server, void *channel)
completion->base_command = NULL;
completion->base_command_arg = 0;
completion->arg_is_nick = 0;
completion->position = -1;
completion->base_word = NULL;
completion->base_word_pos = 0;
completion->position = -1;
completion->args = NULL;
completion->direction = 0;
completion->completion_list = NULL;
completion->last_completion = NULL;
completion->word_found = NULL;
completion->position_replace = 0;
completion->diff_size = 0;
completion->diff_length = 0;
}
/*
@@ -107,6 +116,8 @@ void
completion_get_command_infos (t_completion *completion,
char **template, int *max_arg)
{
t_weechat_alias *ptr_alias;
char *ptr_command;
int i;
#ifdef PLUGINS
t_weechat_plugin *ptr_plugin;
@@ -116,6 +127,16 @@ completion_get_command_infos (t_completion *completion,
*template = NULL;
*max_arg = MAX_ARGS;
ptr_alias = alias_search (completion->base_command);
if (ptr_alias)
{
ptr_command = alias_get_final_command (ptr_alias);
if (!ptr_command)
return;
}
else
ptr_command = completion->base_command;
#ifdef PLUGINS
/* look for plugin command handler */
for (ptr_plugin = weechat_plugins; ptr_plugin;
@@ -126,7 +147,7 @@ completion_get_command_infos (t_completion *completion,
{
if ((ptr_handler->type == HANDLER_COMMAND)
&& (ascii_strcasecmp (ptr_handler->command,
completion->base_command) == 0))
ptr_command) == 0))
{
*template = ptr_handler->completion_template;
*max_arg = MAX_ARGS;
@@ -140,7 +161,7 @@ completion_get_command_infos (t_completion *completion,
for (i = 0; weechat_commands[i].command_name; i++)
{
if (ascii_strcasecmp (weechat_commands[i].command_name,
completion->base_command) == 0)
ptr_command) == 0)
{
*template = weechat_commands[i].completion_template;
*max_arg = weechat_commands[i].max_arg;
@@ -153,7 +174,7 @@ completion_get_command_infos (t_completion *completion,
{
if ((irc_commands[i].cmd_function_args || irc_commands[i].cmd_function_1arg)
&& (ascii_strcasecmp (irc_commands[i].command_name,
completion->base_command) == 0))
ptr_command) == 0))
{
*template = irc_commands[i].completion_template;
*max_arg = irc_commands[i].max_arg;
@@ -164,6 +185,23 @@ completion_get_command_infos (t_completion *completion,
return;
}
/*
* completion_list_add: add a word to completion word list
*/
void
completion_list_add (t_completion *completion, char *word)
{
if (!completion->base_word || !completion->base_word[0]
|| (ascii_strncasecmp (completion->base_word, word,
strlen (completion->base_word)) == 0))
{
weelist_add (&completion->completion_list,
&completion->last_completion,
word);
}
}
/*
* completion_list_add_alias: add alias to completion list
*/
@@ -175,9 +213,7 @@ completion_list_add_alias (t_completion *completion)
for (ptr_alias = weechat_alias; ptr_alias; ptr_alias = ptr_alias->next_alias)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
ptr_alias->alias_name);
completion_list_add (completion, ptr_alias->alias_name);
}
}
@@ -192,9 +228,7 @@ completion_list_add_alias_cmd (t_completion *completion)
for (ptr_list = index_commands; ptr_list; ptr_list = ptr_list->next_weelist)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
ptr_list->data);
completion_list_add (completion, ptr_list->data);
}
}
@@ -206,9 +240,8 @@ void
completion_list_add_channel (t_completion *completion)
{
if (completion->channel)
weelist_add (&completion->completion_list,
&completion->last_completion,
((t_irc_channel *)(completion->channel))->name);
completion_list_add (completion,
((t_irc_channel *)(completion->channel))->name);
}
/*
@@ -225,9 +258,7 @@ completion_list_add_server_channels (t_completion *completion)
for (ptr_channel = ((t_irc_server *)(completion->server))->channels;
ptr_channel; ptr_channel = ptr_channel->next_channel)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
ptr_channel->name);
completion_list_add (completion, ptr_channel->name);
}
}
}
@@ -261,9 +292,7 @@ completion_list_add_plugin_cmd (t_completion *completion)
ptr_handler; ptr_handler = ptr_handler->next_handler)
{
if (ptr_handler->type == HANDLER_COMMAND)
weelist_add (&completion->completion_list,
&completion->last_completion,
ptr_handler->command);
completion_list_add (completion, ptr_handler->command);
}
}
#else
@@ -284,9 +313,7 @@ completion_list_add_irc_cmd_sent (t_completion *completion)
for (i = 0; irc_commands[i].command_name; i++)
{
if (irc_commands[i].cmd_function_args || irc_commands[i].cmd_function_1arg)
weelist_add (&completion->completion_list,
&completion->last_completion,
irc_commands[i].command_name);
completion_list_add (completion, irc_commands[i].command_name);
}
}
@@ -302,9 +329,7 @@ completion_list_add_irc_cmd_recv (t_completion *completion)
for (i = 0; irc_commands[i].command_name; i++)
{
if (irc_commands[i].recv_function)
weelist_add(&completion->completion_list,
&completion->last_completion,
irc_commands[i].command_name);
completion_list_add(completion, irc_commands[i].command_name);
}
}
@@ -319,9 +344,20 @@ completion_list_add_key_cmd (t_completion *completion)
for (i = 0; gui_key_functions[i].function_name; i++)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
gui_key_functions[i].function_name);
completion_list_add (completion, gui_key_functions[i].function_name);
}
}
/*
* completion_list_add_self_nick: add self nick on server to completion list
*/
void
completion_list_add_self_nick (t_completion *completion)
{
if (completion->server)
{
completion_list_add (completion, ((t_irc_server *)(completion->server))->nick);
}
}
@@ -341,16 +377,58 @@ completion_list_add_channel_nicks (t_completion *completion)
for (ptr_nick = ((t_irc_channel *)(completion->channel))->nicks;
ptr_nick; ptr_nick = ptr_nick->next_nick)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
ptr_nick->nick);
completion_list_add (completion, ptr_nick->nick);
}
}
if (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
if ((((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
|| (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_DCC_CHAT))
{
weelist_add (&completion->completion_list,
&completion->last_completion,
((t_irc_channel *)(completion->channel))->name);
completion_list_add (completion,
((t_irc_channel *)(completion->channel))->name);
}
completion->arg_is_nick = 1;
}
}
/*
* completion_list_add_channel_nicks_hosts: add channel nicks and hosts to completion list
*/
void
completion_list_add_channel_nicks_hosts (t_completion *completion)
{
t_irc_nick *ptr_nick;
char *buf;
int length;
if (completion->channel)
{
if (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_CHANNEL)
{
for (ptr_nick = ((t_irc_channel *)(completion->channel))->nicks;
ptr_nick; ptr_nick = ptr_nick->next_nick)
{
completion_list_add (completion, ptr_nick->nick);
if (ptr_nick->host)
{
length = strlen (ptr_nick->nick) + 1 +
strlen (ptr_nick->host) + 1;
buf = (char *) malloc (length);
if (buf)
{
snprintf (buf, length, "%s!%s",
ptr_nick->nick, ptr_nick->host);
completion_list_add (completion, buf);
free (buf);
}
}
}
}
if ((((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
|| (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE))
{
completion_list_add (completion,
((t_irc_channel *)(completion->channel))->name);
}
completion->arg_is_nick = 1;
}
@@ -374,9 +452,8 @@ completion_list_add_option (t_completion *completion)
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
weechat_options[i][j].option_name);
completion_list_add (completion,
weechat_options[i][j].option_name);
}
}
}
@@ -388,13 +465,32 @@ completion_list_add_option (t_completion *completion)
snprintf (option_name, sizeof (option_name), "%s.%s",
ptr_server->name,
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
weelist_add (&completion->completion_list,
&completion->last_completion,
option_name);
completion_list_add (completion, option_name);
}
}
}
/*
* completion_list_add_plugin_option: add plugin option to completion list
*/
void
completion_list_add_plugin_option (t_completion *completion)
{
#ifdef PLUGINS
t_plugin_option *ptr_option;
for (ptr_option = plugin_options; ptr_option;
ptr_option = ptr_option->next_option)
{
completion_list_add (completion, ptr_option->name);
}
#else
/* make gcc happy */
(void) completion;
#endif
}
/*
* completion_list_add_part: add part message to completion list
*/
@@ -403,9 +499,28 @@ void
completion_list_add_part (t_completion *completion)
{
if (cfg_irc_default_msg_part && cfg_irc_default_msg_part[0])
weelist_add (&completion->completion_list,
&completion->last_completion,
cfg_irc_default_msg_part);
completion_list_add (completion, cfg_irc_default_msg_part);
}
/*
* completion_list_add_plugin: add plugin name to completion list
*/
void
completion_list_add_plugin (t_completion *completion)
{
#ifdef PLUGINS
t_weechat_plugin *ptr_plugin;
for (ptr_plugin = weechat_plugins; ptr_plugin;
ptr_plugin = ptr_plugin->next_plugin)
{
completion_list_add (completion, ptr_plugin->name);
}
#else
/* make gcc happy */
(void) completion;
#endif
}
/*
@@ -416,9 +531,7 @@ void
completion_list_add_quit (t_completion *completion)
{
if (cfg_irc_default_msg_quit && cfg_irc_default_msg_quit[0])
weelist_add (&completion->completion_list,
&completion->last_completion,
cfg_irc_default_msg_quit);
completion_list_add (completion, cfg_irc_default_msg_quit);
}
/*
@@ -429,9 +542,8 @@ void
completion_list_add_server (t_completion *completion)
{
if (completion->server)
weelist_add (&completion->completion_list,
&completion->last_completion,
((t_irc_server *)(completion->server))->name);
completion_list_add (completion,
((t_irc_server *)(completion->server))->name);
}
/*
@@ -446,9 +558,7 @@ completion_list_add_servers (t_completion *completion)
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
ptr_server->name);
completion_list_add (completion, ptr_server->name);
}
}
@@ -474,9 +584,9 @@ completion_list_add_topic (t_completion *completion)
string2 = channel_iconv_decode ((t_irc_server *)(completion->server),
(t_irc_channel *)(completion->channel),
(string) ? string : ((t_irc_channel *)(completion->channel))->topic);
weelist_add (&completion->completion_list,
&completion->last_completion,
(string2) ? string2 : ((string) ? string : ((t_irc_channel *)(completion->channel))->topic));
completion_list_add (completion,
(string2) ? string2 : ((string) ?
string : ((t_irc_channel *)(completion->channel))->topic));
if (string)
free (string);
if (string2)
@@ -510,44 +620,34 @@ completion_list_add_option_value (t_completion *completion)
{
case OPTION_TYPE_BOOLEAN:
if (option_value && (*((int *)(option_value))))
weelist_add (&completion->completion_list,
&completion->last_completion,
"on");
completion_list_add (completion, "on");
else
weelist_add (&completion->completion_list,
&completion->last_completion,
"off");
completion_list_add (completion, "off");
break;
case OPTION_TYPE_INT:
snprintf (option_string, sizeof (option_string) - 1,
"%d", (option_value) ? *((int *)(option_value)) : option->default_int);
weelist_add (&completion->completion_list,
&completion->last_completion,
option_string);
completion_list_add (completion, option_string);
break;
case OPTION_TYPE_INT_WITH_STRING:
weelist_add (&completion->completion_list,
&completion->last_completion,
(option_value) ?
option->array_values[*((int *)(option_value))] :
option->array_values[option->default_int]);
completion_list_add (completion,
(option_value) ?
option->array_values[*((int *)(option_value))] :
option->array_values[option->default_int]);
break;
case OPTION_TYPE_COLOR:
weelist_add (&completion->completion_list,
&completion->last_completion,
(option_value) ?
gui_get_color_name (*((int *)(option_value))) :
option->default_string);
completion_list_add (completion,
(option_value) ?
gui_color_get_name (*((int *)(option_value))) :
option->default_string);
break;
case OPTION_TYPE_STRING:
snprintf (option_string, sizeof (option_string) - 1,
"\"%s\"",
(option_value) ?
((option_value) && (*((char **)(option_value)))) ?
*((char **)(option_value)) :
option->default_string);
weelist_add (&completion->completion_list,
&completion->last_completion,
option_string);
completion_list_add (completion, option_string);
break;
}
}
@@ -556,6 +656,36 @@ completion_list_add_option_value (t_completion *completion)
}
}
/*
* completion_list_add_plugin_option_value: add plugin option value to completion list
*/
void
completion_list_add_plugin_option_value (t_completion *completion)
{
#ifdef PLUGINS
char *pos;
t_plugin_option *ptr_option;
if (completion->args)
{
pos = strchr (completion->args, ' ');
if (pos)
pos[0] = '\0';
ptr_option = plugin_config_search_internal (completion->args);
if (ptr_option)
completion_list_add (completion, ptr_option->value);
if (pos)
pos[0] = ' ';
}
#else
/* make gcc happy */
(void) completion;
#endif
}
/*
* completion_list_add_weechat_cmd: add WeeChat commands to completion list
*/
@@ -567,9 +697,7 @@ completion_list_add_weechat_cmd (t_completion *completion)
for (i = 0; weechat_commands[i].command_name; i++)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
weechat_commands[i].command_name);
completion_list_add (completion, weechat_commands[i].command_name);
}
}
@@ -640,15 +768,27 @@ completion_build_list_template (t_completion *completion, char *template)
case 'k': /* key cmd/funtcions*/
completion_list_add_key_cmd (completion);
break;
case 'm': /* self nickname */
completion_list_add_self_nick (completion);
break;
case 'n': /* channel nicks */
completion_list_add_channel_nicks (completion);
break;
case 'N': /* channel nicks and hosts */
completion_list_add_channel_nicks_hosts (completion);
break;
case 'o': /* config option */
completion_list_add_option (completion);
break;
case 'O': /* plugin option */
completion_list_add_plugin_option (completion);
break;
case 'p': /* part message */
completion_list_add_part (completion);
break;
case 'P': /* plugin name */
completion_list_add_plugin (completion);
break;
case 'q': /* quit message */
completion_list_add_quit (completion);
break;
@@ -664,6 +804,9 @@ completion_build_list_template (t_completion *completion, char *template)
case 'v': /* value of config option */
completion_list_add_option_value (completion);
break;
case 'V': /* value of plugin option */
completion_list_add_plugin_option_value (completion);
break;
case 'w': /* WeeChat commands */
completion_list_add_weechat_cmd (completion);
break;
@@ -693,7 +836,8 @@ completion_build_list (t_completion *completion)
int max_arg, i;
completion_get_command_infos (completion, &template, &max_arg);
if (!template || (completion->base_command_arg > max_arg))
if (!template || (strcmp (template, "-") == 0) ||
(completion->base_command_arg > max_arg))
{
completion_stop (completion);
return;
@@ -848,7 +992,8 @@ completion_find_context (t_completion *completion, char *buffer, int size, int p
}
if (!completion->completion_list && completion->channel &&
(((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
((((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
|| (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_DCC_CHAT))
&& (completion->context == COMPLETION_NICK))
{
/* nick completion in private (only other nick and self) */
@@ -875,20 +1020,35 @@ completion_command (t_completion *completion)
length = strlen (completion->base_word) - 1;
word_found_seen = 0;
other_completion = 0;
for (ptr_weelist = index_commands; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist)
if (completion->direction < 0)
ptr_weelist = last_index_command;
else
ptr_weelist = index_commands;
while (ptr_weelist)
{
if (ascii_strncasecmp (ptr_weelist->data, completion->base_word + 1, length) == 0)
{
if ((!completion->word_found) || word_found_seen)
{
completion->word_found = ptr_weelist->data;
for (ptr_weelist2 = ptr_weelist->next_weelist; ptr_weelist2;
ptr_weelist2 = ptr_weelist2->next_weelist)
if (completion->direction < 0)
ptr_weelist2 = ptr_weelist->prev_weelist;
else
ptr_weelist2 = ptr_weelist->next_weelist;
while (ptr_weelist2)
{
if (ascii_strncasecmp (ptr_weelist2->data,
completion->base_word + 1, length) == 0)
completion->base_word + 1, length) == 0)
other_completion++;
if (completion->direction < 0)
ptr_weelist2 = ptr_weelist2->prev_weelist;
else
ptr_weelist2 = ptr_weelist2->next_weelist;
}
if (other_completion == 0)
completion->position = -1;
else
@@ -901,6 +1061,11 @@ completion_command (t_completion *completion)
if (completion->word_found &&
(ascii_strcasecmp (ptr_weelist->data, completion->word_found) == 0))
word_found_seen = 1;
if (completion->direction < 0)
ptr_weelist = ptr_weelist->prev_weelist;
else
ptr_weelist = ptr_weelist->next_weelist;
}
if (completion->word_found)
{
@@ -991,8 +1156,12 @@ completion_command_arg (t_completion *completion, int nick_completion)
length = strlen (completion->base_word);
word_found_seen = 0;
other_completion = 0;
for (ptr_weelist = completion->completion_list; ptr_weelist;
ptr_weelist = ptr_weelist->next_weelist)
if (completion->direction < 0)
ptr_weelist = completion->last_completion;
else
ptr_weelist = completion->completion_list;
while (ptr_weelist)
{
if ((nick_completion && (completion_nickncmp (completion->base_word, ptr_weelist->data, length) == 0))
|| ((!nick_completion) && (ascii_strncasecmp (completion->base_word, ptr_weelist->data, length) == 0)))
@@ -1000,15 +1169,26 @@ completion_command_arg (t_completion *completion, int nick_completion)
if ((!completion->word_found) || word_found_seen)
{
completion->word_found = ptr_weelist->data;
for (ptr_weelist2 = ptr_weelist->next_weelist; ptr_weelist2;
ptr_weelist2 = ptr_weelist2->next_weelist)
if (completion->direction < 0)
ptr_weelist2 = ptr_weelist->prev_weelist;
else
ptr_weelist2 = ptr_weelist->next_weelist;
while (ptr_weelist2)
{
if ((nick_completion
&& (completion_nickncmp (completion->base_word, ptr_weelist2->data, length) == 0))
|| ((!nick_completion)
&& (ascii_strncasecmp (completion->base_word, ptr_weelist2->data, length) == 0)))
other_completion++;
if (completion->direction < 0)
ptr_weelist2 = ptr_weelist2->prev_weelist;
else
ptr_weelist2 = ptr_weelist2->next_weelist;
}
if (other_completion == 0)
completion->position = -1;
else
@@ -1021,6 +1201,11 @@ completion_command_arg (t_completion *completion, int nick_completion)
if (completion->word_found &&
(ascii_strcasecmp (ptr_weelist->data, completion->word_found) == 0))
word_found_seen = 1;
if (completion->direction < 0)
ptr_weelist = ptr_weelist->prev_weelist;
else
ptr_weelist = ptr_weelist->next_weelist;
}
if (completion->word_found)
{
@@ -1042,8 +1227,18 @@ completion_nick (t_completion *completion)
if (!completion->channel)
return;
if (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
if ((((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
|| (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_DCC_CHAT))
{
if (!(completion->completion_list))
{
weelist_add (&completion->completion_list,
&completion->last_completion,
((t_irc_channel *)(completion->channel))->name);
weelist_add (&completion->completion_list,
&completion->last_completion,
((t_irc_server *)(completion->server))->nick);
}
completion_command_arg (completion, 1);
return;
}
@@ -1051,27 +1246,50 @@ completion_nick (t_completion *completion)
length = strlen (completion->base_word);
word_found_seen = 0;
other_completion = 0;
for (ptr_nick = ((t_irc_channel *)(completion->channel))->nicks;
ptr_nick; ptr_nick = ptr_nick->next_nick)
if (completion->direction < 0)
ptr_nick = ((t_irc_channel *)(completion->channel))->last_nick;
else
ptr_nick = ((t_irc_channel *)(completion->channel))->nicks;
while (ptr_nick)
{
if (completion_nickncmp (completion->base_word, ptr_nick->nick, length) == 0)
{
if ((!completion->word_found) || word_found_seen)
{
completion->word_found = ptr_nick->nick;
for (ptr_nick2 = ptr_nick->next_nick; ptr_nick2;
ptr_nick2 = ptr_nick2->next_nick)
if (cfg_look_nick_complete_first)
{
completion->position = -1;
return;
}
if (completion->direction < 0)
ptr_nick2 = ptr_nick->prev_nick;
else
ptr_nick2 = ptr_nick->next_nick;
while (ptr_nick2)
{
if (completion_nickncmp (completion->base_word,
ptr_nick2->nick,
length) == 0)
other_completion++;
if (completion->direction < 0)
ptr_nick2 = ptr_nick2->prev_nick;
else
ptr_nick2 = ptr_nick2->next_nick;
}
if (other_completion == 0)
completion->position = -1;
else
{
if (completion->position < 0)
completion->position = 0;
}
return;
}
other_completion++;
@@ -1079,6 +1297,11 @@ completion_nick (t_completion *completion)
if (completion->word_found &&
(ascii_strcasecmp (ptr_nick->nick, completion->word_found) == 0))
word_found_seen = 1;
if (completion->direction < 0)
ptr_nick = ptr_nick->prev_nick;
else
ptr_nick = ptr_nick->next_nick;
}
if (completion->word_found)
{
@@ -1092,10 +1315,13 @@ completion_nick (t_completion *completion)
*/
void
completion_search (t_completion *completion, char *buffer, int size, int pos)
completion_search (t_completion *completion, int direction,
char *buffer, int size, int pos)
{
char *old_word_found;
completion->direction = direction;
/* if new completion => look for base word */
if (pos != completion->position)
{
@@ -1149,3 +1375,36 @@ completion_search (t_completion *completion, char *buffer, int size, int pos)
}
}
}
/*
* completion_print_log: print completion list in log (usually for crash dump)
*/
void
completion_print_log (t_completion *completion)
{
weechat_log_printf ("[completion (addr:0x%X)]\n", completion);
weechat_log_printf (" server . . . . . . . . : 0x%X\n", completion->server);
weechat_log_printf (" channel. . . . . . . . : 0x%X\n", completion->channel);
weechat_log_printf (" context. . . . . . . . : %d\n", completion->context);
weechat_log_printf (" base_command . . . . . : '%s'\n", completion->base_command);
weechat_log_printf (" base_command_arg . . . : %d\n", completion->base_command_arg);
weechat_log_printf (" arg_is_nick. . . . . . : %d\n", completion->arg_is_nick);
weechat_log_printf (" base_word. . . . . . . : '%s'\n", completion->base_word);
weechat_log_printf (" base_word_pos. . . . . : %d\n", completion->base_word_pos);
weechat_log_printf (" position . . . . . . . : %d\n", completion->position);
weechat_log_printf (" args . . . . . . . . . : '%s'\n", completion->args);
weechat_log_printf (" direction. . . . . . . : %d\n", completion->direction);
weechat_log_printf (" completion_list. . . . : 0x%X\n", completion->completion_list);
weechat_log_printf (" last_completion. . . . : 0x%X\n", completion->last_completion);
weechat_log_printf (" word_found . . . . . . : '%s'\n", completion->word_found);
weechat_log_printf (" position_replace . . . : %d\n", completion->position_replace);
weechat_log_printf (" diff_size. . . . . . . : %d\n", completion->diff_size);
weechat_log_printf (" diff_length. . . . . . : %d\n", completion->diff_length);
if (completion->completion_list)
{
weechat_log_printf ("\n");
weelist_print_log (completion->completion_list,
"completion list element");
}
}
+3 -1
View File
@@ -43,6 +43,7 @@ struct t_completion
int base_word_pos; /* beggining of base word */
int position; /* position where Tab was pressed */
char *args; /* command line args (including base word) */
int direction; /* +1 = search next word, -1 = previous word */
/* for command argument completion */
t_weelist *completion_list; /* data list for completion */
@@ -57,6 +58,7 @@ struct t_completion
extern void completion_init (t_completion *, void *, void *);
extern void completion_free (t_completion *);
extern void completion_search (t_completion *, char *, int, int);
extern void completion_search (t_completion *, int, char *, int, int);
extern void completion_print_log (t_completion *);
#endif /* completion.h */
+14 -15
View File
@@ -34,6 +34,7 @@
#include "weechat.h"
#include "fifo.h"
#include "command.h"
#include "log.h"
#include "weeconfig.h"
#include "../gui/gui.h"
@@ -54,7 +55,7 @@ fifo_create ()
if (cfg_irc_fifo_pipe)
{
/* build FIFO filename: "~/.weechat/weechat_fifo_" + process PID */
/* build FIFO filename: "<weechat_home>/weechat_fifo_" + process PID */
if (!weechat_fifo_filename)
{
filename_length = strlen (weechat_home) + 64;
@@ -101,20 +102,26 @@ fifo_exec (char *text)
char *pos_msg, *pos;
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
t_gui_buffer *ptr_buffer;
pos = NULL;
ptr_server = NULL;
ptr_channel = NULL;
ptr_buffer = NULL;
/* look for server/channel at beginning of text */
/* text may be: "server,channel *text" or "server *text" or "*text" */
if (text[0] == '*')
{
pos_msg = text + 1;
ptr_buffer = (gui_current_window->buffer->has_input) ? gui_current_window->buffer : gui_buffers;
ptr_server = SERVER(ptr_buffer);
if (gui_current_window->buffer->has_input)
{
ptr_server = SERVER(gui_current_window->buffer);
ptr_channel = CHANNEL(gui_current_window->buffer);
}
else
{
ptr_server = SERVER(gui_buffers);
ptr_channel = NULL;
}
}
else
{
@@ -150,7 +157,7 @@ fifo_exec (char *text)
}
if (ptr_server && pos)
{
ptr_channel = channel_search (ptr_server, pos + 1);
ptr_channel = channel_search_any (ptr_server, pos + 1);
if (!ptr_channel)
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
@@ -163,15 +170,7 @@ fifo_exec (char *text)
}
}
if (!ptr_buffer)
{
if (ptr_channel)
ptr_buffer = ptr_channel->buffer;
else
ptr_buffer = gui_buffers;
}
user_command (ptr_buffer, ptr_server, pos_msg);
user_command (ptr_server, ptr_channel, pos_msg, 0);
}
/*
+11
View File
@@ -29,6 +29,7 @@
#include "weechat.h"
#include "history.h"
#include "util.h"
#include "weeconfig.h"
#include "../gui/gui.h"
@@ -73,6 +74,9 @@ void
history_buffer_add (void *buffer, char *string)
{
t_history *new_history, *ptr_history;
if (!string)
return;
if ( !((t_gui_buffer *)(buffer))->history
|| ( ((t_gui_buffer *)(buffer))->history
@@ -99,6 +103,8 @@ history_buffer_add (void *buffer, char *string)
&& (((t_gui_buffer *)(buffer))->num_history > cfg_history_max_commands))
{
ptr_history = ((t_gui_buffer *)buffer)->last_history->prev_history;
if (((t_gui_buffer *)buffer)->ptr_history == ((t_gui_buffer *)buffer)->last_history)
((t_gui_buffer *)buffer)->ptr_history = ptr_history;
((t_gui_buffer *)buffer)->last_history->prev_history->next_history = NULL;
if (((t_gui_buffer *)buffer)->last_history->text)
free (((t_gui_buffer *)buffer)->last_history->text);
@@ -119,6 +125,9 @@ history_global_add (char *string)
{
t_history *new_history, *ptr_history;
if (!string)
return;
if (!history_global
|| (history_global
&& ascii_strcasecmp (history_global->text, string) != 0))
@@ -144,6 +153,8 @@ history_global_add (char *string)
&& (num_history_global > cfg_history_max_commands))
{
ptr_history = history_global_last->prev_history;
if (history_global_ptr == history_global_last)
history_global_ptr = ptr_history;
history_global_last->prev_history->next_history = NULL;
if (history_global_last->text)
free (history_global_last->text);
+169 -122
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* log.c: log buffers to files */
/* log.c: WeeChat log file */
#ifdef HAVE_CONFIG_H
@@ -27,151 +27,198 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdarg.h>
#include <sys/file.h>
#include <sys/types.h>
#include <time.h>
#include "weechat.h"
#include "log.h"
#include "weeconfig.h"
#include "../gui/gui.h"
char *weechat_log_filename = NULL; /* log name (~/.weechat/weechat.log) */
FILE *weechat_log_file = NULL; /* WeeChat log file */
/*
* log_write_date: writes date to log file
* weechat_log_open: initialize log file
*/
int
weechat_log_open (char *filename, char *mode)
{
int filename_length;
/* exit if log already opened */
if (weechat_log_file)
return 0;
if (filename)
weechat_log_filename = strdup (filename);
else
{
filename_length = strlen (weechat_home) + 64;
weechat_log_filename =
(char *) malloc (filename_length * sizeof (char));
snprintf (weechat_log_filename, filename_length,
"%s/%s", weechat_home, WEECHAT_LOG_NAME);
}
weechat_log_file = fopen (weechat_log_filename, mode);
if (!weechat_log_file)
{
free (weechat_log_filename);
weechat_log_filename = NULL;
return 0;
}
#ifdef HAVE_FLOCK
if ((flock (fileno (weechat_log_file), LOCK_EX | LOCK_NB) != 0))
{
fclose (weechat_log_file);
weechat_log_file = NULL;
free (weechat_log_filename);
weechat_log_filename = NULL;
return 0;
}
#endif
return 1;
}
/*
* weechat_log_init: initialize log file
*/
void
log_write_date (t_gui_buffer *buffer)
weechat_log_init ()
{
static char buf_time[256];
if (!weechat_log_open (NULL, "w"))
{
fprintf (stderr,
_("%s unable to create/append to log file\n"
"If another WeeChat process is using this file, try to run WeeChat\n"
"with another home using \"--dir\" command line option.\n"),
WEECHAT_ERROR);
exit (1);
}
}
/*
* weechat_log_printf: write a message in WeeChat log (<weechat_home>/weechat.log)
*/
void
weechat_log_printf (char *message, ...)
{
static char buffer[4096];
char *ptr_buffer;
va_list argptr;
static time_t seconds;
struct tm *date_tmp;
if (buffer->log_file)
{
seconds = time (NULL);
date_tmp = localtime (&seconds);
if (date_tmp)
{
strftime (buf_time, sizeof (buf_time) - 1, cfg_log_timestamp, date_tmp);
fprintf (buffer->log_file, "%s ", buf_time);
fflush (buffer->log_file);
}
}
}
/*
* log_write_line: writes a line to log file
*/
void
log_write_line (t_gui_buffer *buffer, char *message)
{
char *msg_no_color;
if (buffer->log_file)
{
msg_no_color = (char *)gui_color_decode ((unsigned char *)message, 0);
log_write_date (buffer);
fprintf (buffer->log_file, "%s\n",
(msg_no_color) ? msg_no_color : message);
fflush (buffer->log_file);
if (msg_no_color)
free (msg_no_color);
}
}
/*
* log_write: writes a message to log file
*/
void
log_write (t_gui_buffer *buffer, char *message)
{
char *msg_no_color;
if (buffer->log_file)
{
msg_no_color = (char *)gui_color_decode ((unsigned char *)message, 0);
fprintf (buffer->log_file, "%s",
(msg_no_color) ? msg_no_color : message);
fflush (buffer->log_file);
if (msg_no_color)
free (msg_no_color);
}
}
/*
* log_start: starts a log
*/
void
log_start (t_gui_buffer *buffer)
{
int length;
char *ptr_home;
ptr_home = getenv ("HOME");
length = strlen (cfg_log_path) +
((cfg_log_path[0] == '~') ? strlen (ptr_home) : 0) +
64;
if (SERVER(buffer))
length += strlen (SERVER(buffer)->name);
if (CHANNEL(buffer))
length += strlen (CHANNEL(buffer)->name);
buffer->log_filename = (char *) malloc (length);
if (!buffer->log_filename)
{
weechat_log_printf (_("Not enough memory to write log file for a buffer\n"));
if (!weechat_log_file)
return;
}
if (cfg_log_path[0] == '~')
va_start (argptr, message);
vsnprintf (buffer, sizeof (buffer) - 1, message, argptr);
va_end (argptr);
/* keep only valid chars */
ptr_buffer = buffer;
while (ptr_buffer[0])
{
strcpy (buffer->log_filename, ptr_home);
strcat (buffer->log_filename, cfg_log_path + 1);
if ((ptr_buffer[0] != '\n')
&& (ptr_buffer[0] != '\r')
&& ((unsigned char)(ptr_buffer[0]) < 32))
ptr_buffer[0] = '.';
ptr_buffer++;
}
seconds = time (NULL);
date_tmp = localtime (&seconds);
if (date_tmp)
fprintf (weechat_log_file, "[%04d-%02d-%02d %02d:%02d:%02d] %s",
date_tmp->tm_year + 1900, date_tmp->tm_mon + 1, date_tmp->tm_mday,
date_tmp->tm_hour, date_tmp->tm_min, date_tmp->tm_sec,
buffer);
else
strcpy (buffer->log_filename, cfg_log_path);
if (buffer->log_filename[strlen (buffer->log_filename) - 1] != DIR_SEPARATOR_CHAR)
strcat (buffer->log_filename, DIR_SEPARATOR);
if (SERVER(buffer))
{
strcat (buffer->log_filename, SERVER(buffer)->name);
strcat (buffer->log_filename, ".");
}
if (CHANNEL(buffer))
{
strcat (buffer->log_filename, CHANNEL(buffer)->name);
strcat (buffer->log_filename, ".");
}
strcat (buffer->log_filename, "weechatlog");
buffer->log_file = fopen (buffer->log_filename, "a");
if (!buffer->log_file)
{
weechat_log_printf (_("Unable to write log file for a buffer\n"));
free (buffer->log_filename);
return;
}
log_write (buffer, _("**** Beginning of log "));
log_write_date (buffer);
log_write (buffer, "****\n");
fprintf (weechat_log_file, "%s", buffer);
fflush (weechat_log_file);
}
/*
* log_end: ends a log
* weechat_log_close: close log file
*/
void
log_end (t_gui_buffer *buffer)
weechat_log_close ()
{
if (buffer->log_file)
/* close log file */
if (weechat_log_file)
{
log_write (buffer, _("**** End of log "));
log_write_date (buffer);
log_write (buffer, "****\n");
fclose (buffer->log_file);
buffer->log_file = NULL;
#ifdef HAVE_FLOCK
flock (fileno (weechat_log_file), LOCK_UN);
#endif
fclose (weechat_log_file);
weechat_log_file = NULL;
}
/* free filename */
if (weechat_log_filename)
{
free (weechat_log_filename);
weechat_log_filename = NULL;
}
if (buffer->log_filename)
free (buffer->log_filename);
}
/*
* weechat_log_crash_rename: rename log file when crashing
*/
int
weechat_log_crash_rename ()
{
char *old_name, *new_name;
int length;
time_t time_now;
struct tm *local_time;
if (!weechat_log_filename)
return 0;
old_name = strdup (weechat_log_filename);
if (!old_name)
return 0;
weechat_log_close ();
length = strlen (weechat_home) + 128;
new_name = (char *) malloc (length);
if (new_name)
{
time_now = time (NULL);
local_time = localtime (&time_now);
snprintf (new_name, length,
"%s/weechat_crash_%04d%02d%02d_%d.log",
weechat_home,
local_time->tm_year + 1900,
local_time->tm_mon + 1,
local_time->tm_mday,
getpid());
if (rename (old_name, new_name) == 0)
{
fprintf (stderr, "*** Full crash dump was saved to %s file.\n",
new_name);
weechat_log_open (new_name, "a");
free (old_name);
free (new_name);
return 1;
}
free (new_name);
}
free (old_name);
weechat_log_open (NULL, "a");
return 0;
}
+6 -7
View File
@@ -21,13 +21,12 @@
#ifndef __WEECHAT_LOG_H
#define __WEECHAT_LOG_H 1
#include "../irc/irc.h"
#include "../gui/gui.h"
extern char *weechat_log_filename;
extern FILE *weechat_log_file;
extern void log_write_date (t_gui_buffer *);
extern void log_write_line (t_gui_buffer *, char *);
extern void log_write (t_gui_buffer *, char *);
extern void log_start (t_gui_buffer *);
extern void log_end (t_gui_buffer *);
extern void weechat_log_init ();
extern void weechat_log_close ();
extern void weechat_log_printf (char *, ...);
extern int weechat_log_crash_rename ();
#endif /* log.h */
+78 -18
View File
@@ -36,6 +36,7 @@
#include "weechat.h"
#include "session.h"
#include "log.h"
#include "../irc/irc.h"
#include "../gui/gui.h"
@@ -147,6 +148,7 @@ session_save_nick (FILE *file, t_irc_nick *nick)
rc = rc && (session_write_str (file, SESSION_NICK_NICK, nick->nick));
rc = rc && (session_write_int (file, SESSION_NICK_FLAGS, nick->flags));
rc = rc && (session_write_int (file, SESSION_NICK_COLOR, nick->color));
rc = rc && (session_write_str (file, SESSION_NICK_HOST, nick->host));
rc = rc && (session_write_id (file, SESSION_NICK_END));
return rc;
}
@@ -171,6 +173,10 @@ session_save_channel (FILE *file, t_irc_channel *channel)
rc = rc && (session_write_str (file, SESSION_CHAN_KEY, channel->key));
rc = rc && (session_write_int (file, SESSION_CHAN_NICKS_COUNT, channel->nicks_count));
rc = rc && (session_write_int (file, SESSION_CHAN_CHECKING_AWAY, channel->checking_away));
rc = rc && (session_write_str (file, SESSION_CHAN_AWAY_MESSAGE, channel->away_message));
rc = rc && (session_write_int (file, SESSION_CHAN_CYCLE, channel->cycle));
rc = rc && (session_write_int (file, SESSION_CHAN_CLOSE, channel->close));
rc = rc && (session_write_int (file, SESSION_CHAN_DISPLAY_CREATION_DATE, channel->display_creation_date));
rc = rc && (session_write_id (file, SESSION_CHAN_END));
if (!rc)
@@ -222,6 +228,7 @@ session_save_servers (FILE *file)
rc = rc && (session_write_str (file, SESSION_SERV_NICK3, ptr_server->nick3));
rc = rc && (session_write_str (file, SESSION_SERV_USERNAME, ptr_server->username));
rc = rc && (session_write_str (file, SESSION_SERV_REALNAME, ptr_server->realname));
rc = rc && (session_write_str (file, SESSION_SERV_HOSTNAME, ptr_server->hostname));
rc = rc && (session_write_str (file, SESSION_SERV_COMMAND, ptr_server->command));
rc = rc && (session_write_int (file, SESSION_SERV_COMMAND_DELAY, ptr_server->command_delay));
rc = rc && (session_write_str (file, SESSION_SERV_AUTOJOIN, ptr_server->autojoin));
@@ -248,9 +255,11 @@ session_save_servers (FILE *file)
#endif
rc = rc && (session_write_str (file, SESSION_SERV_UNTERMINATED_MESSAGE, ptr_server->unterminated_message));
rc = rc && (session_write_str (file, SESSION_SERV_NICK, ptr_server->nick));
rc = rc && (session_write_str (file, SESSION_SERV_NICK_MODES, ptr_server->nick_modes));
rc = rc && (session_write_buf (file, SESSION_SERV_RECONNECT_START, &(ptr_server->reconnect_start), sizeof (time_t)));
rc = rc && (session_write_int (file, SESSION_SERV_RECONNECT_JOIN, ptr_server->reconnect_join));
rc = rc && (session_write_int (file, SESSION_SERV_IS_AWAY, ptr_server->is_away));
rc = rc && (session_write_str (file, SESSION_SERV_AWAY_MESSAGE, ptr_server->away_message));
rc = rc && (session_write_buf (file, SESSION_SERV_AWAY_TIME, &(ptr_server->away_time), sizeof (time_t)));
rc = rc && (session_write_int (file, SESSION_SERV_LAG, ptr_server->lag));
rc = rc && (session_write_buf (file, SESSION_SERV_LAG_CHECK_TIME, &(ptr_server->lag_check_time), sizeof (struct timeval)));
@@ -285,8 +294,8 @@ session_save_dcc (FILE *file)
rc = 1;
for (ptr_dcc = dcc_list; ptr_dcc;
ptr_dcc = ptr_dcc->next_dcc)
for (ptr_dcc = last_dcc; ptr_dcc;
ptr_dcc = ptr_dcc->prev_dcc)
{
rc = rc && (session_write_id (file, SESSION_OBJ_DCC));
rc = rc && (session_write_str (file, SESSION_DCC_SERVER, (ptr_dcc->server) ? ptr_dcc->server->name : NULL));
@@ -313,6 +322,9 @@ session_save_dcc (FILE *file)
rc = rc && (session_write_buf (file, SESSION_DCC_LAST_ACTIVITY, &(ptr_dcc->last_activity), sizeof (time_t)));
rc = rc && (session_write_buf (file, SESSION_DCC_BYTES_PER_SEC, &(ptr_dcc->bytes_per_sec), sizeof (unsigned long)));
rc = rc && (session_write_buf (file, SESSION_DCC_ETA, &(ptr_dcc->eta), sizeof (unsigned long)));
rc = rc && (session_write_int (file, SESSION_DCC_CHILD_PID, ptr_dcc->child_pid));
rc = rc && (session_write_int (file, SESSION_DCC_CHILD_READ, ptr_dcc->child_read));
rc = rc && (session_write_int (file, SESSION_DCC_CHILD_WRITE, ptr_dcc->child_write));
rc = rc && (session_write_id (file, SESSION_DCC_END));
if (!rc)
@@ -361,7 +373,9 @@ session_save_line (FILE *file, t_gui_line *line)
rc = rc && (session_write_int (file, SESSION_LINE_WITH_MESSAGE, line->line_with_message));
rc = rc && (session_write_int (file, SESSION_LINE_WITH_HIGHLIGHT, line->line_with_highlight));
rc = rc && (session_write_str (file, SESSION_LINE_DATA, line->data));
rc = rc && (session_write_int (file, SESSION_LINE_OFS_AFTER_DATE, line->ofs_after_date));
rc = rc && (session_write_int (file, SESSION_LINE_OFS_AFTER_DATE, line->ofs_start_message));
rc = rc && (session_write_int (file, SESSION_LINE_OFS_START_MESSAGE, line->ofs_start_message));
rc = rc && (session_write_str (file, SESSION_LINE_NICK, line->nick));
rc = rc && (session_write_id (file, SESSION_LINE_END));
return rc;
}
@@ -385,7 +399,8 @@ session_save_buffers (FILE *file)
rc = rc && (session_write_id (file, SESSION_OBJ_BUFFER));
rc = rc && (session_write_str (file, SESSION_BUFF_SERVER, SERVER(ptr_buffer) ? SERVER(ptr_buffer)->name : NULL));
rc = rc && (session_write_str (file, SESSION_BUFF_CHANNEL, CHANNEL(ptr_buffer) ? CHANNEL(ptr_buffer)->name : NULL));
rc = rc && (session_write_int (file, SESSION_BUFF_DCC, ptr_buffer->dcc));
rc = rc && (session_write_int (file, SESSION_BUFF_TYPE, ptr_buffer->type));
rc = rc && (session_write_int (file, SESSION_BUFF_ALL_SERVERS, ptr_buffer->all_servers));
rc = rc && (session_write_id (file, SESSION_BUFF_END));
if (!rc)
@@ -464,7 +479,7 @@ session_crash (FILE *file, char *message, ...)
va_end (argptr);
fclose (file);
gui_end ();
gui_main_end ();
fprintf (stderr, "%s %s\n",
WEECHAT_ERROR, buffer);
fprintf (stderr,
@@ -473,10 +488,12 @@ session_crash (FILE *file, char *message, ...)
session_last_read_pos,
session_last_read_length);
fprintf (stderr,
_("Please send ~/.weechat/%s, ~/.weechat/%s and "
_("Please send %s/%s, %s/%s and "
"above messages to WeeChat developers for support.\n"
"Be careful, private info may be in these files.\n"),
weechat_home,
WEECHAT_LOG_NAME,
weechat_home,
WEECHAT_SESSION_NAME);
exit (EXIT_FAILURE);
}
@@ -852,6 +869,9 @@ session_load_server (FILE *file)
case SESSION_SERV_REALNAME:
rc = rc && (session_read_str (file, &(session_current_server->realname)));
break;
case SESSION_SERV_HOSTNAME:
rc = rc && (session_read_str (file, &(session_current_server->hostname)));
break;
case SESSION_SERV_COMMAND:
rc = rc && (session_read_str (file, &(session_current_server->command)));
break;
@@ -918,6 +938,9 @@ session_load_server (FILE *file)
case SESSION_SERV_NICK:
rc = rc && (session_read_str (file, &(session_current_server->nick)));
break;
case SESSION_SERV_NICK_MODES:
rc = rc && (session_read_str (file, &(session_current_server->nick_modes)));
break;
case SESSION_SERV_RECONNECT_START:
rc = rc && (session_read_buf (file, &(session_current_server->reconnect_start), sizeof (time_t)));
break;
@@ -927,6 +950,9 @@ session_load_server (FILE *file)
case SESSION_SERV_IS_AWAY:
rc = rc && (session_read_int (file, &(session_current_server->is_away)));
break;
case SESSION_SERV_AWAY_MESSAGE:
rc = rc && (session_read_str (file, &(session_current_server->away_message)));
break;
case SESSION_SERV_AWAY_TIME:
rc = rc && (session_read_buf (file, &(session_current_server->away_time), sizeof (time_t)));
break;
@@ -1038,6 +1064,18 @@ session_load_channel (FILE *file)
case SESSION_CHAN_CHECKING_AWAY:
rc = rc && (session_read_int (file, &(session_current_channel->checking_away)));
break;
case SESSION_CHAN_AWAY_MESSAGE:
rc = rc && (session_read_str (file, &(session_current_channel->away_message)));
break;
case SESSION_CHAN_CYCLE:
rc = rc && (session_read_int (file, &(session_current_channel->cycle)));
break;
case SESSION_CHAN_CLOSE:
rc = rc && (session_read_int (file, &(session_current_channel->close)));
break;
case SESSION_CHAN_DISPLAY_CREATION_DATE:
rc = rc && (session_read_int (file, &(session_current_channel->display_creation_date)));
break;
default:
weechat_log_printf (_("session: warning: ignoring value from "
"channel (object id: %d)\n"));
@@ -1105,6 +1143,9 @@ session_load_nick (FILE *file)
case SESSION_NICK_COLOR:
rc = rc && (session_read_int (file, &(nick->color)));
break;
case SESSION_NICK_HOST:
rc = rc && (session_read_str (file, &(nick->host)));
break;
default:
weechat_log_printf (_("session: warning: ignoring value from "
"nick (object id: %d)\n"));
@@ -1183,7 +1224,7 @@ session_load_dcc (FILE *file)
return 0;
if (string && string[0])
{
ptr_channel = channel_search (ptr_server, string);
ptr_channel = channel_search_any (ptr_server, string);
if (!ptr_channel)
{
session_crash (file, _("channel not found for DCC"));
@@ -1259,6 +1300,15 @@ session_load_dcc (FILE *file)
case SESSION_DCC_ETA:
rc = rc && (session_read_buf (file, &(dcc->eta), sizeof (unsigned long)));
break;
case SESSION_DCC_CHILD_PID:
rc = rc && (session_read_int (file, &(dcc->child_pid)));
break;
case SESSION_DCC_CHILD_READ:
rc = rc && (session_read_int (file, &(dcc->child_read)));
break;
case SESSION_DCC_CHILD_WRITE:
rc = rc && (session_read_int (file, &(dcc->child_write)));
break;
default:
weechat_log_printf (_("session: warning: ignoring value from "
"DCC (object id: %d)\n"));
@@ -1328,7 +1378,7 @@ session_load_buffer (FILE *file)
{
int object_id, rc;
char *server_name, *channel_name;
int dcc;
int buffer_type;
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
@@ -1348,18 +1398,18 @@ session_load_buffer (FILE *file)
return 0;
}
/* read dcc */
if (!session_read_object (file, SESSION_BUFF_DCC, SESSION_TYPE_INT, &dcc, 0))
/* read buffer type */
if (!session_read_object (file, SESSION_BUFF_TYPE, SESSION_TYPE_INT, &buffer_type, 0))
{
session_crash (file, _("dcc flag not found for buffer"));
session_crash (file, _("buffer type not found"));
return 0;
}
/* allocate buffer */
weechat_log_printf (_("session: loading buffer (server: %s, channel: %s, dcc: %d)\n"),
weechat_log_printf (_("session: loading buffer (server: %s, channel: %s, type: %d)\n"),
(server_name) ? server_name : "-",
(channel_name) ? channel_name : "-",
dcc);
buffer_type);
ptr_server = NULL;
ptr_channel = NULL;
if (server_name)
@@ -1374,7 +1424,7 @@ session_load_buffer (FILE *file)
if (channel_name)
{
ptr_channel = channel_search (ptr_server, channel_name);
ptr_channel = channel_search_any_without_buffer (ptr_server, channel_name);
if (!ptr_channel)
{
session_crash (file, _("channel not found for buffer"));
@@ -1382,7 +1432,8 @@ session_load_buffer (FILE *file)
}
}
session_current_buffer = gui_buffer_new (gui_windows, ptr_server, ptr_channel, dcc, 1);
session_current_buffer = gui_buffer_new (gui_windows, ptr_server,
ptr_channel, buffer_type, 1);
if (!session_current_buffer)
{
session_crash (file, _("can't create new buffer"));
@@ -1407,6 +1458,9 @@ session_load_buffer (FILE *file)
{
case SESSION_BUFF_END:
return 1;
case SESSION_BUFF_ALL_SERVERS:
rc = rc && (session_read_int (file, &(session_current_buffer->all_servers)));
break;
default:
weechat_log_printf (_("session: warning: ignoring value from "
"buffer (object id: %d)\n"));
@@ -1435,7 +1489,7 @@ session_load_line (FILE *file)
}
/* allocate line */
line = gui_line_new (session_current_buffer);
line = gui_buffer_line_new (session_current_buffer);
if (!line)
{
session_crash (file, _("can't create new line"));
@@ -1478,6 +1532,12 @@ session_load_line (FILE *file)
case SESSION_LINE_OFS_AFTER_DATE:
rc = rc && (session_read_int (file, &(line->ofs_after_date)));
break;
case SESSION_LINE_OFS_START_MESSAGE:
rc = rc && (session_read_int (file, &(line->ofs_start_message)));
break;
case SESSION_LINE_NICK:
rc = rc && (session_read_str (file, &(line->nick)));
break;
default:
weechat_log_printf (_("session: warning: ignoring value from "
"line (object id: %d)\n"));
@@ -1650,8 +1710,8 @@ session_load (char *filename)
ptr_server->buffer = gui_buffers;
}
gui_switch_to_buffer (gui_windows, gui_buffers);
gui_redraw_buffer (gui_current_window->buffer);
gui_window_switch_to_buffer (gui_windows, gui_buffers);
gui_window_redraw_buffer (gui_current_window->buffer);
fclose (file);
+20 -6
View File
@@ -88,7 +88,10 @@ enum t_session_server
SESSION_SERV_LAG_NEXT_CHECK,
SESSION_SERV_CHARSET_DECODE_ISO,
SESSION_SERV_CHARSET_DECODE_UTF,
SESSION_SERV_CHARSET_ENCODE
SESSION_SERV_CHARSET_ENCODE,
SESSION_SERV_HOSTNAME,
SESSION_SERV_NICK_MODES,
SESSION_SERV_AWAY_MESSAGE
};
enum t_session_channel
@@ -101,7 +104,11 @@ enum t_session_channel
SESSION_CHAN_LIMIT,
SESSION_CHAN_KEY,
SESSION_CHAN_NICKS_COUNT,
SESSION_CHAN_CHECKING_AWAY
SESSION_CHAN_CHECKING_AWAY,
SESSION_CHAN_AWAY_MESSAGE,
SESSION_CHAN_CYCLE,
SESSION_CHAN_CLOSE,
SESSION_CHAN_DISPLAY_CREATION_DATE
};
enum t_session_nick
@@ -109,7 +116,8 @@ enum t_session_nick
SESSION_NICK_END = 0,
SESSION_NICK_NICK,
SESSION_NICK_FLAGS,
SESSION_NICK_COLOR
SESSION_NICK_COLOR,
SESSION_NICK_HOST
};
enum t_session_dcc
@@ -138,7 +146,10 @@ enum t_session_dcc
SESSION_DCC_LAST_CHECK_POS,
SESSION_DCC_LAST_ACTIVITY,
SESSION_DCC_BYTES_PER_SEC,
SESSION_DCC_ETA
SESSION_DCC_ETA,
SESSION_DCC_CHILD_PID,
SESSION_DCC_CHILD_READ,
SESSION_DCC_CHILD_WRITE
};
enum t_session_history
@@ -152,7 +163,8 @@ enum t_session_buffer
SESSION_BUFF_END = 0,
SESSION_BUFF_SERVER,
SESSION_BUFF_CHANNEL,
SESSION_BUFF_DCC
SESSION_BUFF_TYPE,
SESSION_BUFF_ALL_SERVERS
};
enum t_session_line
@@ -164,7 +176,9 @@ enum t_session_line
SESSION_LINE_WITH_MESSAGE,
SESSION_LINE_WITH_HIGHLIGHT,
SESSION_LINE_DATA,
SESSION_LINE_OFS_AFTER_DATE
SESSION_LINE_OFS_AFTER_DATE,
SESSION_LINE_OFS_START_MESSAGE,
SESSION_LINE_NICK
};
enum t_session_uptime
+47 -7
View File
@@ -24,7 +24,15 @@
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#define __USE_XOPEN
#if defined(__OpenBSD__)
#include <utf8/wchar.h>
#else
#include <wchar.h>
#endif
#include "weechat.h"
#include "utf8.h"
@@ -62,7 +70,7 @@ utf8_init ()
int
utf8_is_valid (char *string)
{
while (string[0])
while (string && string[0])
{
/* UTF-8, 2 bytes, should be: 110vvvvv 10vvvvvv */
if (((unsigned char)(string[0]) & 0xE0) == 0xC0)
@@ -216,7 +224,7 @@ utf8_strlen (char *string)
return strlen (string);
length = 0;
while (string[0])
while (string && string[0])
{
string = utf8_next_char (string);
length++;
@@ -225,7 +233,7 @@ utf8_strlen (char *string)
}
/*
* utf8_strlen: return length of an UTF-8 string, for N bytes
* utf8_strnlen: return length of an UTF-8 string, for N bytes
*/
int
@@ -247,7 +255,7 @@ utf8_strnlen (char *string, int bytes)
start = string;
length = 0;
while (string[0] && (string - start < bytes))
while (string && string[0] && (string - start < bytes))
{
string = utf8_next_char (string);
length++;
@@ -255,6 +263,38 @@ utf8_strnlen (char *string, int bytes)
return length;
}
/*
* utf8_width_screen: return number of chars needed on screen to display UTF-8 string
*/
int
utf8_width_screen (char *string)
{
int length, num_char;
wchar_t *wstring;
if (!string)
return 0;
if (!local_utf8)
return strlen (string);
num_char = mbstowcs (NULL, string, 0) + 1;
wstring = (wchar_t *) malloc ((num_char + 1) * sizeof (wchar_t));
if (!wstring)
return utf8_strlen (string);
if (mbstowcs (wstring, string, num_char) == (size_t)(-1))
{
free (wstring);
return utf8_strlen (string);
}
length = wcswidth (wstring, num_char);
free (wstring);
return length;
}
/*
* utf8_add_offset: moves forward N chars in an UTF-8 string
*/
@@ -271,7 +311,7 @@ utf8_add_offset (char *string, int offset)
return string + offset;
count = 0;
while (string[0] && (count < offset))
while (string && string[0] && (count < offset))
{
string = utf8_next_char (string);
count++;
@@ -295,7 +335,7 @@ utf8_real_pos (char *string, int pos)
count = 0;
real_pos = 0;
while (string[0] && (count < pos))
while (string && string[0] && (count < pos))
{
next_char = utf8_next_char (string);
real_pos += (next_char - string);
@@ -321,7 +361,7 @@ utf8_pos (char *string, int real_pos)
count = 0;
limit = string + real_pos;
while (string[0] && (string < limit))
while (string && string[0] && (string < limit))
{
string = utf8_next_char (string);
count++;
+1
View File
@@ -30,6 +30,7 @@ extern char *utf8_next_char (char *);
extern int utf8_char_size (char *);
extern int utf8_strlen (char *);
extern int utf8_strnlen (char *, int);
extern int utf8_width_screen (char *);
extern char *utf8_add_offset (char *, int);
extern int utf8_real_pos (char *, int);
extern int utf8_pos (char *, int);
+322
View File
@@ -0,0 +1,322 @@
/*
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* util.c: some useful functions for WeeChat */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_ICONV
#include <iconv.h>
#endif
#include "weechat.h"
#include "weeconfig.h"
/*
* ascii_tolower: locale independant string conversion to lower case
*/
void
ascii_tolower (char *string)
{
while (string && string[0])
{
if ((string[0] >= 'A') && (string[0] <= 'Z'))
string[0] += ('a' - 'A');
string++;
}
}
/*
* ascii_toupper: locale independant string conversion to upper case
*/
void
ascii_toupper (char *string)
{
while (string && string[0])
{
if ((string[0] >= 'a') && (string[0] <= 'z'))
string[0] -= ('a' - 'A');
string++;
}
}
/*
* ascii_strcasecmp: locale and case independent string comparison
*/
int
ascii_strcasecmp (char *string1, char *string2)
{
int c1, c2;
if (!string1 || !string2)
return (string1) ? 1 : ((string2) ? -1 : 0);
while (string1[0] && string2[0])
{
c1 = (int)((unsigned char) string1[0]);
c2 = (int)((unsigned char) string2[0]);
if ((c1 >= 'A') && (c1 <= 'Z'))
c1 += ('a' - 'A');
if ((c2 >= 'A') && (c2 <= 'Z'))
c2 += ('a' - 'A');
if ((c1 - c2) != 0)
return c1 - c2;
string1++;
string2++;
}
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
}
/*
* ascii_strncasecmp: locale and case independent string comparison
* with max length
*/
int
ascii_strncasecmp (char *string1, char *string2, int max)
{
int c1, c2, count;
if (!string1 || !string2)
return (string1) ? 1 : ((string2) ? -1 : 0);
count = 0;
while ((count < max) && string1[0] && string2[0])
{
c1 = (int)((unsigned char) string1[0]);
c2 = (int)((unsigned char) string2[0]);
if ((c1 >= 'A') && (c1 <= 'Z'))
c1 += ('a' - 'A');
if ((c2 >= 'A') && (c2 <= 'Z'))
c2 += ('a' - 'A');
if ((c1 - c2) != 0)
return c1 - c2;
string1++;
string2++;
count++;
}
if (count >= max)
return 0;
else
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
}
/*
* ascii_strcasestr: locale and case independent string search
*/
char *
ascii_strcasestr (char *string, char *search)
{
int length_search;
length_search = strlen (search);
if (!string || !search || (length_search == 0))
return NULL;
while (string[0])
{
if (ascii_strncasecmp (string, search, length_search) == 0)
return string;
string++;
}
return NULL;
}
/*
* weechat_iconv: convert string to another charset
*/
char *
weechat_iconv (char *from_code, char *to_code, char *string)
{
char *outbuf;
#ifdef HAVE_ICONV
iconv_t cd;
char *inbuf;
ICONV_CONST char *ptr_inbuf;
char *ptr_outbuf;
size_t inbytesleft, outbytesleft;
if (from_code && from_code[0] && to_code && to_code[0]
&& (ascii_strcasecmp(from_code, to_code) != 0))
{
cd = iconv_open (to_code, from_code);
if (cd == (iconv_t)(-1))
outbuf = strdup (string);
else
{
inbuf = strdup (string);
ptr_inbuf = inbuf;
inbytesleft = strlen (inbuf);
outbytesleft = inbytesleft * 4;
outbuf = (char *) malloc (outbytesleft + 2);
ptr_outbuf = outbuf;
iconv (cd, &ptr_inbuf, &inbytesleft, &ptr_outbuf, &outbytesleft);
if (inbytesleft != 0)
{
free (outbuf);
outbuf = strdup (string);
}
else
ptr_outbuf[0] = '\0';
free (inbuf);
iconv_close (cd);
}
}
else
outbuf = strdup (string);
#else
/* make gcc happy */
(void) from_code;
(void) to_code;
outbuf = strdup (string);
#endif /* HAVE_ICONV */
return outbuf;
}
/*
* weechat_iconv_check: check a charset
* if a charset is NULL, internal charset is used
*/
int
weechat_iconv_check (char *from_code, char *to_code)
{
#ifdef HAVE_ICONV
iconv_t cd;
if (!from_code || !from_code[0])
from_code = (cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
cfg_look_charset_internal : local_charset;
if (!to_code || !to_code[0])
to_code = (cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
cfg_look_charset_internal : local_charset;
cd = iconv_open (to_code, from_code);
if (cd == (iconv_t)(-1))
return 0;
iconv_close (cd);
return 1;
#else
return 1;
#endif
}
/*
* weechat_strreplace: replace a string by new one in a string
* note: returned value has to be free() after use
*/
char *
weechat_strreplace (char *string, char *search, char *replace)
{
char *pos, *new_string;
int length1, length2, length_new, count;
if (!string || !search || !replace)
return NULL;
length1 = strlen (search);
length2 = strlen (replace);
/* count number of strings to replace */
count = 0;
pos = string;
while (pos && pos[0] && (pos = strstr (pos, search)))
{
count++;
pos += length1;
}
/* easy: no string to replace! */
if (count == 0)
return strdup (string);
/* compute needed memory for new string */
length_new = strlen (string) - (count * length1) + (count * length2) + 1;
/* allocate new string */
new_string = (char *)malloc (length_new * sizeof (char));
if (!new_string)
return strdup (string);
/* replace all occurences */
new_string[0] = '\0';
while (string && string[0])
{
pos = strstr (string, search);
if (pos)
{
strncat (new_string, string, pos - string);
strcat (new_string, replace);
pos += length1;
}
else
strcat (new_string, string);
string = pos;
}
return new_string;
}
/*
* get_timeval_diff: calculates difference between two times (return in milliseconds)
*/
long
get_timeval_diff (struct timeval *tv1, struct timeval *tv2)
{
long diff_sec, diff_usec;
diff_sec = tv2->tv_sec - tv1->tv_sec;
diff_usec = tv2->tv_usec - tv1->tv_usec;
if (diff_usec < 0)
{
diff_usec += 1000000;
diff_sec--;
}
return ((diff_usec / 1000) + (diff_sec * 1000));
}
+34
View File
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __WEECHAT_UTIL_H
#define __WEECHAT_UTIL_H 1
extern void ascii_tolower (char *);
extern void ascii_toupper (char *);
extern int ascii_strcasecmp (char *, char *);
extern int ascii_strncasecmp (char *, char *, int);
extern char *ascii_strcasestr (char *, char *);
extern char *weechat_iconv (char *, char *, char *);
extern int weechat_iconv_check (char *, char *);
extern char *weechat_strreplace (char *, char *, char *);
extern long get_timeval_diff (struct timeval *, struct timeval *);
#endif /* util.h */
+144 -289
View File
@@ -42,7 +42,6 @@
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <sys/stat.h>
#include <time.h>
@@ -52,20 +51,19 @@
#include <gnutls/gnutls.h>
#endif
#ifdef HAVE_ICONV
#include <iconv.h>
#endif
#ifdef HAVE_LANGINFO_CODESET
#include <langinfo.h>
#endif
#include "weechat.h"
#include "weeconfig.h"
#include "backtrace.h"
#include "command.h"
#include "fifo.h"
#include "utf8.h"
#include "log.h"
#include "session.h"
#include "utf8.h"
#include "util.h"
#include "weeconfig.h"
#include "../irc/irc.h"
#include "../gui/gui.h"
@@ -74,214 +72,24 @@
#endif
char *weechat_argv0 = NULL; /* WeeChat binary file name (argv[0]) */
char *weechat_session = NULL; /* WeeChat session file (for /upgrade command) */
time_t weechat_start_time; /* WeeChat start time (used by /uptime command) */
int quit_weechat; /* = 1 if quit request from user... why ? :'( */
int sigsegv = 0; /* SIGSEGV received? */
char *weechat_home = NULL; /* WeeChat home dir. (example: /home/toto/.weechat) */
FILE *weechat_log_file = NULL; /* WeeChat log file (~/.weechat/weechat.log) */
char *weechat_argv0 = NULL; /* WeeChat binary file name (argv[0]) */
char *weechat_session = NULL; /* WeeChat session file (for /upgrade cmd) */
time_t weechat_start_time; /* WeeChat start time (used by /uptime cmd) */
int quit_weechat; /* = 1 if quit request from user... why ? :'( */
int sigsegv = 0; /* SIGSEGV received? */
char *weechat_home = NULL; /* WeeChat home dir. (default: ~/.weechat) */
char *local_charset = NULL; /* local charset, for example: ISO-8859-1, UTF-8 */
char *local_charset = NULL; /* local charset, for ex.: ISO-8859-1, UTF-8 */
int server_cmd_line; /* at least one server on WeeChat command line */
int auto_connect; /* enabled by default, can by disabled on cmd line */
int auto_load_plugins; /* enabled by default, can by disabled on cmd line */
int server_cmd_line; /* at least 1 server on WeeChat command line */
int auto_connect; /* enabled by default (cmd option to disable) */
int auto_load_plugins; /* enabled by default (cmd option to disable) */
#ifdef HAVE_GNUTLS
gnutls_certificate_credentials gnutls_xcred; /* gnutls client credentials */
#endif
/*
* ascii_strcasecmp: locale and case independent string comparison
*/
int
ascii_strcasecmp (char *string1, char *string2)
{
int c1, c2;
if (!string1 || !string2)
return (string1) ? 1 : ((string2) ? -1 : 0);
while (string1[0] && string2[0])
{
c1 = (int)((unsigned char) string1[0]);
c2 = (int)((unsigned char) string2[0]);
if ((c1 >= 'A') && (c1 <= 'Z'))
c1 += ('a' - 'A');
if ((c2 >= 'A') && (c2 <= 'Z'))
c2 += ('a' - 'A');
if ((c1 - c2) != 0)
return c1 - c2;
string1++;
string2++;
}
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
}
/*
* ascii_strncasecmp: locale and case independent string comparison
* with max length
*/
int
ascii_strncasecmp (char *string1, char *string2, int max)
{
int c1, c2, count;
if (!string1 || !string2)
return (string1) ? 1 : ((string2) ? -1 : 0);
count = 0;
while ((count < max) && string1[0] && string2[0])
{
c1 = (int)((unsigned char) string1[0]);
c2 = (int)((unsigned char) string2[0]);
if ((c1 >= 'A') && (c1 <= 'Z'))
c1 += ('a' - 'A');
if ((c2 >= 'A') && (c2 <= 'Z'))
c2 += ('a' - 'A');
if ((c1 - c2) != 0)
return c1 - c2;
string1++;
string2++;
count++;
}
if (count >= max)
return 0;
else
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
}
/*
* weechat_log_printf: displays a message in WeeChat log (~/.weechat/weechat.log)
*/
void
weechat_log_printf (char *message, ...)
{
static char buffer[4096];
char *ptr_buffer;
va_list argptr;
static time_t seconds;
struct tm *date_tmp;
if (!weechat_log_file)
return;
va_start (argptr, message);
vsnprintf (buffer, sizeof (buffer) - 1, message, argptr);
va_end (argptr);
/* keep only valid chars */
ptr_buffer = buffer;
while (ptr_buffer[0])
{
if ((ptr_buffer[0] != '\n')
&& (ptr_buffer[0] != '\r')
&& ((unsigned char)(ptr_buffer[0]) < 32))
ptr_buffer[0] = '.';
ptr_buffer++;
}
seconds = time (NULL);
date_tmp = localtime (&seconds);
if (date_tmp)
fprintf (weechat_log_file, "[%04d-%02d-%02d %02d:%02d:%02d] %s",
date_tmp->tm_year + 1900, date_tmp->tm_mon + 1, date_tmp->tm_mday,
date_tmp->tm_hour, date_tmp->tm_min, date_tmp->tm_sec,
buffer);
else
fprintf (weechat_log_file, "%s", buffer);
fflush (weechat_log_file);
}
/*
* weechat_iconv: convert string to another charset
*/
char *
weechat_iconv (char *from_code, char *to_code, char *string)
{
char *outbuf;
#ifdef HAVE_ICONV
iconv_t cd;
char *inbuf;
ICONV_CONST char *ptr_inbuf;
char *ptr_outbuf;
size_t inbytesleft, outbytesleft;
if (from_code && from_code[0] && to_code && to_code[0]
&& (ascii_strcasecmp(from_code, to_code) != 0))
{
cd = iconv_open (to_code, from_code);
if (cd == (iconv_t)(-1))
outbuf = strdup (string);
else
{
inbuf = strdup (string);
ptr_inbuf = inbuf;
inbytesleft = strlen (inbuf);
outbytesleft = inbytesleft * 4;
outbuf = (char *) malloc (outbytesleft + 2);
ptr_outbuf = outbuf;
iconv (cd, &ptr_inbuf, &inbytesleft, &ptr_outbuf, &outbytesleft);
if (inbytesleft != 0)
{
free (outbuf);
outbuf = strdup (string);
}
else
ptr_outbuf[0] = '\0';
free (inbuf);
iconv_close (cd);
}
}
else
outbuf = strdup (string);
#else
/* make gcc happy */
(void) from_code;
(void) to_code;
outbuf = strdup (string);
#endif /* HAVE_ICONV */
return outbuf;
}
/*
* get_timeval_diff: calculates difference between two times (return in milliseconds)
*/
long
get_timeval_diff (struct timeval *tv1, struct timeval *tv2)
{
long diff_sec, diff_usec;
diff_sec = tv2->tv_sec - tv1->tv_sec;
diff_usec = tv2->tv_usec - tv1->tv_usec;
if (diff_usec < 0)
{
diff_usec += 1000000;
diff_sec--;
}
return ((diff_usec / 1000) + (diff_sec * 1000));
}
/*
* weechat_display_usage: display WeeChat usage
*/
@@ -300,6 +108,7 @@ weechat_display_usage (char *exec_name)
printf ("\n\n");
printf (_(" -a, --no-connect disable auto-connect to servers at startup\n"
" -c, --config display config file options\n"
" -d, --dir <path> set WeeChat home directory (default: ~/.weechat)\n"
" -f, --key-functions display WeeChat internal functions for keys\n"
" -h, --help this help\n"
" -i, --irc-commands display IRC commands\n"
@@ -320,7 +129,7 @@ weechat_display_config_options ()
{
int i, j, k;
printf (_("WeeChat configuration options (~/.weechat/weechat.rc):\n\n"));
printf (_("WeeChat configuration options (<weechat_home>/weechat.rc):\n\n"));
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
if (weechat_options[i])
@@ -477,10 +286,10 @@ weechat_display_keys ()
printf ("\n");
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
{
expanded_name = gui_key_get_expanded_name (ptr_key->key);
expanded_name = gui_keyboard_get_expanded_name (ptr_key->key);
printf ("* %s => %s\n",
(expanded_name) ? expanded_name : ptr_key->key,
(ptr_key->function) ? gui_key_function_search_by_ptr (ptr_key->function) : ptr_key->command);
(ptr_key->function) ? gui_keyboard_function_search_by_ptr (ptr_key->function) : ptr_key->command);
if (expanded_name)
free (expanded_name);
}
@@ -498,6 +307,7 @@ weechat_parse_args (int argc, char *argv[])
weechat_argv0 = strdup (argv[0]);
weechat_session = NULL;
weechat_home = NULL;
server_cmd_line = 0;
auto_connect = 1;
auto_load_plugins = 1;
@@ -513,6 +323,19 @@ weechat_parse_args (int argc, char *argv[])
weechat_display_config_options ();
weechat_shutdown (EXIT_SUCCESS, 0);
}
else if ((strcmp (argv[i], "-d") == 0)
|| (strcmp (argv[i], "--dir") == 0))
{
if (i + 1 < argc)
weechat_home = strdup (argv[++i]);
else
{
fprintf (stderr,
_("%s missing argument for --dir option\n"),
WEECHAT_ERROR);
weechat_shutdown (EXIT_FAILURE, 0);
}
}
else if ((strcmp (argv[i], "-f") == 0)
|| (strcmp (argv[i], "--key-functions") == 0))
{
@@ -586,8 +409,9 @@ weechat_parse_args (int argc, char *argv[])
server_tmp.ipv6, server_tmp.ssl,
server_tmp.password, server_tmp.nick1,
server_tmp.nick2, server_tmp.nick3,
NULL, NULL, NULL, 0, server_tmp.autojoin, 1, NULL,
NULL, NULL, NULL))
NULL, NULL, NULL, NULL, 0,
server_tmp.autojoin, 1, NULL, NULL,
NULL, NULL))
fprintf (stderr, _("%s unable to create server ('%s'), ignored\n"),
WEECHAT_WARNING, argv[i]);
server_destroy (&server_tmp);
@@ -626,56 +450,98 @@ weechat_create_dir (char *directory)
}
/*
* weechat_create_home_dirs: create WeeChat directories (if not found)
* weechat_create_home_dirs: create WeeChat directories
*/
void
weechat_create_home_dirs ()
{
char *ptr_home, *dir_name;
char *ptr_home;
int dir_length;
ptr_home = getenv ("HOME");
if (!ptr_home)
{
fprintf (stderr, _("%s unable to get HOME directory\n"),
WEECHAT_ERROR);
weechat_shutdown (EXIT_FAILURE, 0);
}
dir_length = strlen (ptr_home) + 10;
weechat_home =
(char *) malloc (dir_length * sizeof (char));
struct stat statinfo;
if (!weechat_home)
{
fprintf (stderr, _("%s not enough memory for home directory\n"),
WEECHAT_ERROR);
weechat_shutdown (EXIT_FAILURE, 0);
ptr_home = getenv ("HOME");
if (!ptr_home)
{
fprintf (stderr, _("%s unable to get HOME directory\n"),
WEECHAT_ERROR);
weechat_shutdown (EXIT_FAILURE, 0);
}
dir_length = strlen (ptr_home) + 10;
weechat_home =
(char *) malloc (dir_length * sizeof (char));
if (!weechat_home)
{
fprintf (stderr, _("%s not enough memory for home directory\n"),
WEECHAT_ERROR);
weechat_shutdown (EXIT_FAILURE, 0);
}
snprintf (weechat_home, dir_length, "%s%s.weechat", ptr_home,
DIR_SEPARATOR);
}
/* if home already exists, it has to be a directory */
if (stat (weechat_home, &statinfo) == 0)
{
if (!S_ISDIR (statinfo.st_mode))
{
fprintf (stderr, _("%s home (%s) is not a directory\n"),
WEECHAT_ERROR, weechat_home);
weechat_shutdown (EXIT_FAILURE, 0);
}
}
snprintf (weechat_home, dir_length, "%s%s.weechat", ptr_home,
DIR_SEPARATOR);
/* create home directory "~/.weechat" ; error is fatal */
/* create home directory; error is fatal */
if (!weechat_create_dir (weechat_home))
{
fprintf (stderr, _("%s unable to create ~/.weechat directory\n"),
WEECHAT_ERROR);
fprintf (stderr, _("%s unable to create \"%s\" directory\n"),
WEECHAT_ERROR, weechat_home);
weechat_shutdown (EXIT_FAILURE, 0);
}
}
/*
* weechat_create_config_dirs: create config directories (read from config file)
*/
void
weechat_create_config_dirs ()
{
char *dir1, *dir2;
dir_length = strlen (weechat_home) + 64;
dir_name = (char *) malloc (dir_length * sizeof (char));
/* create "~/.weechat/logs" */
snprintf (dir_name, dir_length, "%s%s%s", weechat_home, DIR_SEPARATOR,
"logs");
if (!weechat_create_dir (dir_name))
/* create logs directory" */
dir1 = weechat_strreplace (cfg_log_path, "~", getenv ("HOME"));
dir2 = weechat_strreplace (dir1, "%h", weechat_home);
if (weechat_create_dir (dir2))
{
fprintf (stderr, _("%s unable to create ~/.weechat/logs directory\n"),
WEECHAT_WARNING);
if (strcmp (dir2, getenv ("HOME")) != 0)
chmod (dir2, 0700);
}
chmod (dir_name, 0700);
else
fprintf (stderr, _("%s unable to create \"%s\" directory\n"),
WEECHAT_WARNING, dir2);
if (dir1)
free (dir1);
if (dir2)
free (dir2);
free (dir_name);
/* create DCC download directory */
dir1 = weechat_strreplace (cfg_dcc_download_path, "~", getenv ("HOME"));
dir2 = weechat_strreplace (dir1, "%h", weechat_home);
if (weechat_create_dir (dir2))
{
if (strcmp (dir2, getenv ("HOME")) != 0)
chmod (dir2, 0700);
}
else
fprintf (stderr, _("%s unable to create \"%s\" directory\n"),
WEECHAT_WARNING, dir2);
if (dir1)
free (dir1);
if (dir2)
free (dir2);
}
/*
@@ -700,27 +566,6 @@ weechat_init_vars ()
#endif
}
/*
* weechat_init_log: initialize log file
*/
void
weechat_init_log ()
{
int filename_length;
char *filename;
filename_length = strlen (weechat_home) + 64;
filename =
(char *) malloc (filename_length * sizeof (char));
snprintf (filename, filename_length, "%s/" WEECHAT_LOG_NAME, weechat_home);
if ((weechat_log_file = fopen (filename, "wt")) == NULL)
fprintf (stderr,
_("%s unable to create/append to log file (~/.weechat/%s)"),
WEECHAT_WARNING, WEECHAT_LOG_NAME);
free (filename);
}
/*
* weechat_config_read: read WeeChat config file
*/
@@ -806,8 +651,7 @@ weechat_shutdown (int return_code, int crash)
fifo_remove ();
if (weechat_home)
free (weechat_home);
if (weechat_log_file)
fclose (weechat_log_file);
weechat_log_close ();
if (local_charset)
free (local_charset);
alias_free_all ();
@@ -824,7 +668,7 @@ weechat_shutdown (int return_code, int crash)
}
/*
* weechat_dump writes dump to WeeChat log file
* weechat_dump: write dump to WeeChat log file
*/
void
@@ -833,7 +677,6 @@ weechat_dump (int crash)
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
t_irc_nick *ptr_nick;
t_irc_dcc *ptr_dcc;
t_gui_window *ptr_window;
t_gui_buffer *ptr_buffer;
@@ -880,11 +723,9 @@ weechat_dump (int crash)
}
}
weechat_log_printf ("\n");
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
dcc_print_log (ptr_dcc);
}
dcc_print_log ();
gui_panel_print_log ();
weechat_log_printf ("\n");
weechat_log_printf ("[windows/buffers]\n");
@@ -911,7 +752,7 @@ weechat_dump (int crash)
weechat_log_printf ("\n");
gui_buffer_print_log (ptr_buffer);
}
weechat_log_printf ("\n");
ignore_print_log ();
@@ -921,7 +762,7 @@ weechat_dump (int crash)
}
/*
* weechat_sigsegv: SIGSEGV handler: save crash log to ~/.weechat/weechat.log and exit
* weechat_sigsegv: SIGSEGV handler: save crash log to <weechat_home>/weechat.log and exit
*/
void
@@ -930,13 +771,25 @@ weechat_sigsegv ()
weechat_dump (1);
dcc_end ();
server_free_all ();
gui_end ();
gui_main_end ();
fprintf (stderr, "\n");
fprintf (stderr, "*** Very bad! WeeChat has crashed (SIGSEGV received)\n");
fprintf (stderr, "*** Full crash dump was saved to ~/.weechat/weechat.log file\n");
fprintf (stderr, "*** Please send this file to WeeChat developers.\n");
fprintf (stderr, "*** (be careful, private info may be in this file since\n");
fprintf (stderr, "*** part of chats are displayed, so remove lines if needed)\n\n");
fprintf (stderr, "*** Very bad! WeeChat is crashing (SIGSEGV received)\n");
if (!weechat_log_crash_rename ())
fprintf (stderr, "*** Full crash dump was saved to %s/weechat.log file.\n",
weechat_home);
fprintf (stderr, "***\n");
fprintf (stderr, "*** Please help WeeChat developers to fix this bug:\n");
fprintf (stderr, "*** 1. If you have a core file, please run: gdb weechat-curses core\n");
fprintf (stderr, "*** then issue \"bt\" command and send result to developers\n");
fprintf (stderr, "*** To enable core files with bash shell: ulimit -c 10000\n");
fprintf (stderr, "*** 2. Otherwise send backtrace (below) and weechat.log\n");
fprintf (stderr, "*** (be careful, private info may be in this file since\n");
fprintf (stderr, "*** part of chats are displayed, so remove lines if needed)\n\n");
weechat_backtrace ();
/* shutdown with error code */
weechat_shutdown (EXIT_FAILURE, 1);
}
@@ -961,20 +814,21 @@ main (int argc, char *argv[])
signal (SIGQUIT, SIG_IGN); /* ignore SIGQUIT signal */
signal (SIGPIPE, SIG_IGN); /* ignore SIGPIPE signal */
signal (SIGSEGV, weechat_sigsegv); /* crash dump when SIGSEGV received */
gui_pre_init (&argc, &argv); /* pre-initiliaze interface */
gui_main_pre_init (&argc, &argv); /* pre-initiliaze interface */
weechat_init_vars (); /* initialize some variables */
gui_key_init (); /* init keyb. (default key bindings)*/
gui_keyboard_init (); /* init keyb. (default key bindings)*/
weechat_parse_args (argc, argv); /* parse command line args */
weechat_create_home_dirs (); /* create WeeChat directories */
weechat_init_log (); /* init log file */
weechat_log_init (); /* init log file */
command_index_build (); /* build cmd index for completion */
weechat_config_read (); /* read configuration */
weechat_create_config_dirs (); /* create config directories */
utf8_init (); /* init UTF-8 in WeeChat */
gui_init (); /* init WeeChat interface */
weechat_welcome_message (); /* display WeeChat welcome message */
gui_main_init (); /* init WeeChat interface */
fifo_create (); /* FIFO pipe for remote control */
if (weechat_session)
session_load (weechat_session); /* load previous session if asked */
weechat_welcome_message (); /* display WeeChat welcome message */
#ifdef PLUGINS
plugin_init (auto_load_plugins); /* init plugin interface(s) */
#endif
@@ -988,11 +842,12 @@ main (int argc, char *argv[])
plugin_end (); /* end plugin interface(s) */
#endif
server_disconnect_all (); /* disconnect from all servers */
(void) config_write (NULL); /* save config file */
if (cfg_look_save_on_exit)
(void) config_write (NULL); /* save config file */
command_index_free (); /* free commands index */
dcc_end (); /* remove all DCC */
server_free_all (); /* free all servers */
gui_end (); /* shut down WeeChat GUI */
gui_main_end (); /* shut down WeeChat GUI */
weechat_shutdown (EXIT_SUCCESS, 0); /* quit WeeChat (oh no, why?) */
return EXIT_SUCCESS; /* make gcc happy (never executed) */
-6
View File
@@ -98,19 +98,13 @@ extern char *weechat_argv0;
extern time_t weechat_start_time;
extern int quit_weechat;
extern char *weechat_home;
extern FILE *weechat_log_file;
extern char *local_charset;
#ifdef HAVE_GNUTLS
extern gnutls_certificate_credentials gnutls_xcred;
#endif
extern int ascii_strcasecmp (char *, char *);
extern int ascii_strncasecmp (char *, char *, int);
extern void weechat_log_printf (char *, ...);
extern void weechat_dump (int);
extern char *weechat_iconv (char *, char *, char *);
extern long get_timeval_diff (struct timeval *, struct timeval *);
extern void weechat_shutdown (int, int);
#endif /* weechat.h */
+162 -52
View File
@@ -41,6 +41,7 @@
#include "fifo.h"
#include "log.h"
#include "utf8.h"
#include "util.h"
#include "../irc/irc.h"
#include "../gui/gui.h"
@@ -64,6 +65,7 @@ t_config_section config_sections[CONFIG_NUMBER_SECTIONS] =
/* config, look & feel section */
int cfg_look_save_on_exit;
int cfg_look_set_title;
int cfg_look_startup_logo;
int cfg_look_startup_version;
@@ -73,6 +75,8 @@ char *cfg_look_charset_decode_utf;
char *cfg_look_charset_encode;
char *cfg_look_charset_internal;
int cfg_look_one_server_buffer;
int cfg_look_scroll_amount;
int cfg_look_open_near_server;
char *cfg_look_buffer_timestamp;
int cfg_look_color_nicks_number;
int cfg_look_color_actions;
@@ -85,8 +89,17 @@ int cfg_look_nicklist_max_size;
int cfg_look_nickmode;
int cfg_look_nickmode_empty;
char *cfg_look_no_nickname;
char *cfg_look_completor;
char *cfg_look_nick_prefix;
char *cfg_look_nick_suffix;
int cfg_look_align_nick;
char *cfg_look_align_nick_values[] =
{ "none", "left", "right", NULL };
int cfg_look_align_other;
int cfg_look_align_size;
int cfg_look_align_size_max;
char *cfg_look_nick_completor;
char *cfg_look_nick_completion_ignore;
int cfg_look_nick_complete_first;
int cfg_look_infobar;
char *cfg_look_infobar_timestamp;
int cfg_look_infobar_seconds;
@@ -97,9 +110,14 @@ int cfg_look_hotlist_names_length;
int cfg_look_day_change;
char *cfg_look_day_change_timestamp;
char *cfg_look_read_marker;
char *cfg_look_input_format;
t_config_option weechat_options_look[] =
{ { "look_set_title", N_("set title for window (terminal for Curses GUI) with name and version"),
{ { "look_save_on_exit", N_("save config file on exit"),
N_("save config file on exit"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_save_on_exit, NULL, config_change_save_on_exit },
{ "look_set_title", N_("set title for window (terminal for Curses GUI) with name and version"),
N_("set title for window (terminal for Curses GUI) with name and version"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_set_title, NULL, config_change_title },
@@ -117,16 +135,16 @@ t_config_option weechat_options_look[] =
"the geekest IRC client!", NULL, NULL, &cfg_look_weechat_slogan, config_change_noop },
{ "look_charset_decode_iso", N_("ISO charset for decoding messages from server (used only if locale is UTF-8)"),
N_("ISO charset for decoding messages from server (used only if locale is UTF-8) "
"(if empty, messages are not converted if locale is UTF-8"),
"(if empty, messages are not converted if locale is UTF-8)"),
OPTION_TYPE_STRING, 0, 0, 0,
"ISO-8859-1", NULL, NULL, &cfg_look_charset_decode_iso, config_change_charset },
{ "look_charset_decode_utf", N_("UTF charset for decoding messages from server (used only if locale is not UTF-8)"),
N_("UTF charset for decoding messages from server (used only if locale is not UTF-8) "
"(if empty, messages are not converted if locale is not UTF-8"),
"(if empty, messages are not converted if locale is not UTF-8)"),
OPTION_TYPE_STRING, 0, 0, 0,
"UTF-8", NULL, NULL, &cfg_look_charset_decode_utf, config_change_charset },
{ "look_charset_encode", N_("charset for encoding messages sent to server"),
N_("charset for encoding messages sent to server, examples: UFT-8, ISO-8859-1 (if empty, messages are not converted)"),
N_("charset for encoding messages sent to server, examples: UTF-8, ISO-8859-1 (if empty, messages are not converted)"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &cfg_look_charset_encode, config_change_charset },
{ "look_charset_internal", N_("forces internal WeeChat charset (should be empty in most cases)"),
@@ -137,6 +155,14 @@ t_config_option weechat_options_look[] =
N_("use same buffer for all servers"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_look_one_server_buffer, NULL, config_change_one_server_buffer },
{ "look_open_near_server", N_("open new channels/privates near server"),
N_("open new channels/privates near server"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_look_open_near_server, NULL, config_change_noop },
{ "look_scroll_amount", N_("how many lines to scroll by with scroll_up and scroll_down"),
N_("how many lines to scroll by with scroll_up and scroll_down"),
OPTION_TYPE_INT, 1, INT_MAX, 3,
NULL, NULL, &cfg_look_scroll_amount, NULL, config_change_buffer_content },
{ "look_buffer_timestamp", N_("timestamp for buffers"),
N_("timestamp for buffers"),
OPTION_TYPE_STRING, 0, 0, 0,
@@ -179,14 +205,43 @@ t_config_option weechat_options_look[] =
N_("display space if nick mode is not (half)op/voice"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_look_nickmode_empty, NULL, config_change_buffers },
{ "look_nick_prefix", N_("text to display before nick in chat window"),
N_("text to display before nick in chat window"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &cfg_look_nick_prefix, config_change_noop },
{ "look_nick_suffix", N_("text to display after nick in chat window"),
N_("text to display after nick in chat window"),
OPTION_TYPE_STRING, 0, 0, 0,
" |", NULL, NULL, &cfg_look_nick_suffix, config_change_noop },
{ "look_align_nick", N_("nick alignment (fixed size for nicks in chat window)"),
N_("nick alignment (fixed size for nicks in chat window (none, left, right))"),
OPTION_TYPE_INT_WITH_STRING, 0, 0, 0,
"right", cfg_look_align_nick_values, &cfg_look_align_nick, NULL, config_change_noop },
{ "look_align_other", N_("alignment for other messages (not beginning with a nick)"),
N_("alignment for other messages (not beginning with a nick)"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_align_other, NULL, config_change_noop },
{ "look_align_size", N_("size for aligning nick and other messages"),
N_("size for aligning nick and other messages"),
OPTION_TYPE_INT, 8, 64, 14,
NULL, NULL, &cfg_look_align_size, NULL, config_change_noop },
{ "look_align_size_max", N_("max size for aligning nick and other messages"),
N_("max size for aligning nick and other messages (should be >= to "
"look_align_size)"),
OPTION_TYPE_INT, 8, 64, 20,
NULL, NULL, &cfg_look_align_size_max, NULL, config_change_noop },
{ "look_nick_completor", N_("the string inserted after nick completion"),
N_("the string inserted after nick completion"),
OPTION_TYPE_STRING, 0, 0, 0,
":", NULL, NULL, &cfg_look_completor, config_change_noop },
":", NULL, NULL, &cfg_look_nick_completor, config_change_noop },
{ "look_nick_completion_ignore", N_("chars ignored for nick completion"),
N_("chars ignored for nick completion"),
OPTION_TYPE_STRING, 0, 0, 0,
"[]-^", NULL, NULL, &cfg_look_nick_completion_ignore, config_change_noop },
{ "look_nick_complete_first", N_("complete only with first nick found"),
N_("complete only with first nick found"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_look_nick_complete_first, NULL, config_change_noop },
{ "look_infobar", N_("enable info bar"),
N_("enable info bar"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
@@ -228,7 +283,12 @@ t_config_option weechat_options_look[] =
{ "look_read_marker", N_("use a marker on servers/channels to show first unread line"),
N_("use a marker on servers/channels to show first unread line"),
OPTION_TYPE_STRING, 0, 0, 0,
" ", NULL, NULL, &cfg_look_read_marker, config_change_read_marker},
" ", NULL, NULL, &cfg_look_read_marker, config_change_read_marker },
{ "look_input_format", N_("format for input prompt"),
N_("format for input prompt ('%c' is replaced by channel or server, "
"'%n' by nick and '%m' by nick modes)"),
OPTION_TYPE_STRING, 0, 0, 0,
"[%n(%m)] ", NULL, NULL, &cfg_look_input_format, config_change_buffer_content },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
@@ -268,6 +328,7 @@ int cfg_col_infobar_delimiters;
int cfg_col_infobar_highlight;
int cfg_col_infobar_bg;
int cfg_col_input;
int cfg_col_input_server;
int cfg_col_input_channel;
int cfg_col_input_nick;
int cfg_col_input_delimiters;
@@ -442,6 +503,10 @@ t_config_option weechat_options_colors[] =
N_("color for input text"),
OPTION_TYPE_COLOR, 0, 0, 0,
"default", NULL, &cfg_col_input, NULL, &config_change_color },
{ "col_input_server", N_("color for input text (server name)"),
N_("color for input text (server name)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"brown", NULL, &cfg_col_input_server, NULL, &config_change_color },
{ "col_input_channel", N_("color for input text (channel name)"),
N_("color for input text (channel name)"),
OPTION_TYPE_COLOR, 0, 0, 0,
@@ -633,9 +698,10 @@ t_config_option weechat_options_log[] =
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_log_plugin_msg, NULL, &config_change_noop },
{ "log_path", N_("path for log files"),
N_("path for WeeChat log files"),
N_("path for WeeChat log files ('%h' will be replaced by WeeChat home, "
"~/.weechat by default)"),
OPTION_TYPE_STRING, 0, 0, 0,
"~/.weechat/logs/", NULL, NULL, &cfg_log_path, &config_change_noop },
"%h/logs/", NULL, NULL, &cfg_log_path, &config_change_noop },
{ "log_timestamp", N_("timestamp for log"),
N_("timestamp for log (see man strftime for date/time specifiers)"),
OPTION_TYPE_STRING, 0, 0, 0,
@@ -650,12 +716,14 @@ t_config_option weechat_options_log[] =
/* config, irc section */
int cfg_irc_display_away;
int cfg_irc_show_away_once;
char *cfg_irc_display_away_values[] =
{ "off", "local", "channel", NULL };
char *cfg_irc_default_msg_part;
char *cfg_irc_default_msg_quit;
int cfg_irc_notice_as_pv;
int cfg_irc_away_check;
int cfg_irc_away_check_max_nicks;
int cfg_irc_lag_check;
int cfg_irc_lag_min_show;
int cfg_irc_lag_disconnect;
@@ -669,8 +737,13 @@ t_config_option weechat_options_irc[] =
N_("display message when (un)marking as away"),
OPTION_TYPE_INT_WITH_STRING, 0, 0, 0,
"off", cfg_irc_display_away_values, &cfg_irc_display_away, NULL, &config_change_noop },
{ "irc_show_away_once", N_("show remote away message only once in private"),
N_("show remote away message only once in private"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_irc_show_away_once, NULL, &config_change_noop },
{ "irc_default_msg_part", N_("default part message (leaving channel)"),
N_("default part message (leaving channel)"),
N_("default part message (leaving channel) ('%v' will be replaced by "
"WeeChat version in string)"),
OPTION_TYPE_STRING, 0, 0, 0,
"WeeChat %v", NULL, NULL, &cfg_irc_default_msg_part, &config_change_noop },
{ "irc_default_msg_quit", N_("default quit message"),
@@ -685,6 +758,10 @@ t_config_option weechat_options_irc[] =
N_("interval between two checks for away (in minutes, 0 = never check)"),
OPTION_TYPE_INT, 0, INT_MAX, 0,
NULL, NULL, &cfg_irc_away_check, NULL, &config_change_away_check },
{ "irc_away_check_max_nicks", N_("max number of nicks for away check"),
N_("do not check away nicks on channels with high number of nicks (0 = unlimited)"),
OPTION_TYPE_INT, 0, INT_MAX, 0,
NULL, NULL, &cfg_irc_away_check_max_nicks, NULL, &config_change_away_check },
{ "irc_lag_check", N_("interval between two checks for lag"),
N_("interval between two checks for lag (in seconds)"),
OPTION_TYPE_INT, 30, INT_MAX, 60,
@@ -725,6 +802,7 @@ int cfg_dcc_auto_accept_files;
int cfg_dcc_auto_accept_chats;
int cfg_dcc_timeout;
int cfg_dcc_blocksize;
int cfg_dcc_fast_send;
char *cfg_dcc_port_range;
char *cfg_dcc_own_ip;
char *cfg_dcc_download_path;
@@ -744,12 +822,16 @@ t_config_option weechat_options_dcc[] =
NULL, NULL, &cfg_dcc_auto_accept_chats, NULL, &config_change_noop },
{ "dcc_timeout", N_("timeout for dcc request"),
N_("timeout for dcc request (in seconds)"),
OPTION_TYPE_INT, 1, INT_MAX, 300,
OPTION_TYPE_INT, 5, INT_MAX, 300,
NULL, NULL, &cfg_dcc_timeout, NULL, &config_change_noop },
{ "dcc_blocksize", N_("block size for dcc packets"),
N_("block size for dcc packets in bytes (default: 65536)"),
OPTION_TYPE_INT, 1024, 102400, 65536,
OPTION_TYPE_INT, DCC_MIN_BLOCKSIZE, DCC_MAX_BLOCKSIZE, 65536,
NULL, NULL, &cfg_dcc_blocksize, NULL, &config_change_noop },
{ "dcc_fast_send", N_("does not wait for ACK when sending file"),
N_("does not wait for ACK when sending file"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_dcc_fast_send, NULL, &config_change_noop },
{ "dcc_port_range", N_("allowed ports for outgoing dcc"),
N_("restricts outgoing dcc to use only ports in the given range "
"(useful for NAT) (syntax: a single port, ie. 5000 or a port "
@@ -764,7 +846,7 @@ t_config_option weechat_options_dcc[] =
{ "dcc_download_path", N_("path for incoming files with dcc"),
N_("path for writing incoming files with dcc (default: user home)"),
OPTION_TYPE_STRING, 0, 0, 0,
"~", NULL, NULL, &cfg_dcc_download_path, &config_change_noop },
"%h/dcc", NULL, NULL, &cfg_dcc_download_path, &config_change_noop },
{ "dcc_upload_path", N_("default path for sending files with dcc"),
N_("path for reading files when sending thru dcc (when no path is specified)"),
OPTION_TYPE_STRING, 0, 0, 0, "~",
@@ -836,9 +918,10 @@ char *cfg_plugins_extension;
t_config_option weechat_options_plugins[] =
{ { "plugins_path", N_("path for searching plugins"),
N_("path for searching plugins"),
N_("path for searching plugins ('%h' will be replaced by WeeChat home, "
"~/.weechat by default)"),
OPTION_TYPE_STRING, 0, 0, 0,
"~/.weechat/plugins", NULL, NULL, &cfg_plugins_path, &config_change_noop },
"%h/plugins", NULL, NULL, &cfg_plugins_path, &config_change_noop },
{ "plugins_autoload", N_("list of plugins to load automatically"),
N_("comma separated list of plugins to load automatically at startup, "
"\"*\" means all plugins found "
@@ -919,8 +1002,13 @@ t_config_option weechat_options_server[] =
N_("real name to use on IRC server"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &(cfg_server.realname), NULL },
{ "server_command", N_("first command to run when connected to server"),
N_("first command to run when connected to server"),
{ "server_hostname", N_("custom hostname/IP for server"),
N_("custom hostname/IP for server (optional, if empty local hostname is used)"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &(cfg_server.hostname), NULL },
{ "server_command", N_("command(s) to run when connected to server"),
N_("command(s) to run when connected to server (many commands should be "
"separated by ';', use '\\;' for a semicolon)"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &(cfg_server.command), NULL },
{ "server_command_delay", N_("delay (in seconds) after command was executed"),
@@ -1025,6 +1113,22 @@ config_change_noop ()
/* do nothing */
}
/*
* config_change_save_on_exit: called when "save_on_exit" flag is changed
*/
void
config_change_save_on_exit ()
{
if (!cfg_look_save_on_exit)
{
gui_printf (NULL, "\n");
gui_printf (NULL, _("%s you should now issue /save to write "
"\"save_on_exit\" option in config file.\n"),
WEECHAT_WARNING);
}
}
/*
* config_change_title: called when title is changed
*/
@@ -1033,9 +1137,9 @@ void
config_change_title ()
{
if (cfg_look_set_title)
gui_set_window_title ();
gui_window_set_title ();
else
gui_reset_window_title ();
gui_window_reset_title ();
}
/*
@@ -1045,8 +1149,8 @@ config_change_title ()
void
config_change_buffers ()
{
gui_switch_to_buffer (gui_current_window, gui_current_window->buffer);
gui_redraw_buffer (gui_current_window->buffer);
gui_window_switch_to_buffer (gui_current_window, gui_current_window->buffer);
gui_window_redraw_buffer (gui_current_window->buffer);
}
/*
@@ -1056,7 +1160,7 @@ config_change_buffers ()
void
config_change_buffer_content ()
{
gui_redraw_buffer (gui_current_window->buffer);
gui_window_redraw_buffer (gui_current_window->buffer);
}
/*
@@ -1069,7 +1173,7 @@ config_change_read_marker ()
t_gui_window *ptr_win;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
gui_redraw_buffer (ptr_win->buffer);
gui_window_redraw_buffer (ptr_win->buffer);
}
/*
@@ -1080,7 +1184,7 @@ void
config_change_charset ()
{
utf8_init ();
gui_redraw_buffer (gui_current_window->buffer);
gui_window_redraw_buffer (gui_current_window->buffer);
}
/*
@@ -1092,9 +1196,9 @@ void
config_change_one_server_buffer ()
{
if (cfg_look_one_server_buffer)
gui_merge_servers (gui_current_window);
gui_buffer_merge_servers (gui_current_window);
else
gui_split_server (gui_current_window);
gui_buffer_split_server (gui_current_window);
}
/*
@@ -1104,9 +1208,9 @@ config_change_one_server_buffer ()
void
config_change_color ()
{
gui_init_color_pairs ();
gui_rebuild_weechat_colors ();
gui_refresh_windows ();
gui_color_init_pairs ();
gui_color_rebuild_weechat ();
gui_window_refresh_windows ();
}
/*
@@ -1146,12 +1250,12 @@ config_change_nicks_colors ()
void
config_change_away_check ()
{
check_away = 0;
if (cfg_irc_away_check == 0)
{
/* reset away flag for all nicks/chans/servers */
server_remove_away ();
}
check_away = cfg_irc_away_check * 60;
}
/*
@@ -1205,23 +1309,23 @@ config_change_log ()
if (BUFFER_IS_SERVER(ptr_buffer))
{
if (cfg_log_auto_server && !ptr_buffer->log_file)
log_start (ptr_buffer);
gui_log_start (ptr_buffer);
else if (!cfg_log_auto_server && ptr_buffer->log_file)
log_end (ptr_buffer);
gui_log_end (ptr_buffer);
}
if (BUFFER_IS_CHANNEL(ptr_buffer))
{
if (cfg_log_auto_channel && !ptr_buffer->log_file)
log_start (ptr_buffer);
gui_log_start (ptr_buffer);
else if (!cfg_log_auto_channel && ptr_buffer->log_file)
log_end (ptr_buffer);
gui_log_end (ptr_buffer);
}
if (BUFFER_IS_PRIVATE(ptr_buffer))
{
if (cfg_log_auto_private && !ptr_buffer->log_file)
log_start (ptr_buffer);
gui_log_start (ptr_buffer);
else if (!cfg_log_auto_private && ptr_buffer->log_file)
log_end (ptr_buffer);
gui_log_end (ptr_buffer);
}
}
}
@@ -1261,7 +1365,7 @@ config_option_set_value (t_config_option *option, char *value)
*(option->ptr_int) = int_value;
break;
case OPTION_TYPE_COLOR:
if (!gui_assign_color (option->ptr_int, value))
if (!gui_color_assign (option->ptr_int, value))
return -1;
break;
case OPTION_TYPE_STRING:
@@ -1289,7 +1393,7 @@ config_option_list_remove (char **string, char *item)
name = (char *) malloc (strlen (item) + 2);
strcpy (name, item);
strcat (name, ":");
pos = strstr (*string, name);
pos = ascii_strcasestr (*string, name);
free (name);
if (pos)
{
@@ -1365,7 +1469,7 @@ config_option_list_get_value (char **string, char *item,
name = (char *) malloc (strlen (item) + 2);
strcpy (name, item);
strcat (name, ":");
pos = strstr (*string, name);
pos = ascii_strcasestr (*string, name);
free (name);
if (pos)
{
@@ -1418,6 +1522,8 @@ config_get_server_option_ptr (t_irc_server *server, char *option_name)
return (void *)(&server->username);
if (ascii_strcasecmp (option_name, "server_realname") == 0)
return (void *)(&server->realname);
if (ascii_strcasecmp (option_name, "server_hostname") == 0)
return (void *)(&server->hostname);
if (ascii_strcasecmp (option_name, "server_command") == 0)
return (void *)(&server->command);
if (ascii_strcasecmp (option_name, "server_command_delay") == 0)
@@ -1495,7 +1601,7 @@ config_set_server_value (t_irc_server *server, char *option_name,
*((int *)(ptr_data)) = int_value;
break;
case OPTION_TYPE_COLOR:
if (!gui_assign_color ((int *)ptr_data, value))
if (!gui_color_assign ((int *)ptr_data, value))
return -2;
break;
case OPTION_TYPE_STRING:
@@ -1658,7 +1764,8 @@ config_allocate_server (char *filename, int line_number)
cfg_server.port, cfg_server.ipv6, cfg_server.ssl,
cfg_server.password, cfg_server.nick1, cfg_server.nick2,
cfg_server.nick3, cfg_server.username, cfg_server.realname,
cfg_server.command, cfg_server.command_delay, cfg_server.autojoin,
cfg_server.hostname, cfg_server.command,
cfg_server.command_delay, cfg_server.autojoin,
cfg_server.autorejoin, cfg_server.notify_levels,
cfg_server.charset_decode_iso, cfg_server.charset_decode_utf,
cfg_server.charset_encode))
@@ -1712,7 +1819,7 @@ config_default_values ()
int_value;
break;
case OPTION_TYPE_COLOR:
if (!gui_assign_color (
if (!gui_color_assign (
weechat_options[i][j].ptr_int,
weechat_options[i][j].default_string))
gui_printf (NULL,
@@ -1884,12 +1991,12 @@ config_read ()
if (pos[0])
{
/* bind key (overwrite any binding with same key) */
gui_key_bind (line, pos);
gui_keyboard_bind (line, pos);
}
else
{
/* unbin key if no value given */
gui_key_unbind (line);
gui_keyboard_unbind (line);
}
}
else if (section == CONFIG_SECTION_ALIAS)
@@ -1940,7 +2047,7 @@ config_read ()
{
case OPTION_TYPE_BOOLEAN:
gui_printf (NULL,
_("%s %s, line %d: invalid value for"
_("%s %s, line %d: invalid value for "
"option '%s'\n"
"Expected: boolean value: "
"'off' or 'on'\n"),
@@ -2097,10 +2204,10 @@ config_create_default ()
fprintf (file, "\n[keys]\n");
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
{
expanded_name = gui_key_get_expanded_name (ptr_key->key);
expanded_name = gui_keyboard_get_expanded_name (ptr_key->key);
if (ptr_key->function)
{
function_name = gui_key_function_search_by_ptr (ptr_key->function);
function_name = gui_keyboard_function_search_by_ptr (ptr_key->function);
if (function_name)
fprintf (file, "%s = \"%s\"\n",
(expanded_name) ? expanded_name : ptr_key->key,
@@ -2137,7 +2244,7 @@ config_create_default ()
fprintf (file, "UB = \"unban\"\n");
fprintf (file, "UNIG = \"unignore\"\n");
fprintf (file, "W = \"who\"\n");
fprintf (file, "WC = \"part\"\n");
fprintf (file, "WC = \"window merge\"\n");
fprintf (file, "WI = \"whois\"\n");
fprintf (file, "WW = \"whowas\"\n");
@@ -2194,6 +2301,7 @@ config_create_default ()
fprintf (file, "server_realname = \"WeeChat default realname\"\n");
}
fprintf (file, "server_hostname = \"\"\n");
fprintf (file, "server_command = \"\"\n");
fprintf (file, "server_command_delay = 0\n");
fprintf (file, "server_autojoin = \"\"\n");
@@ -2296,7 +2404,7 @@ config_write (char *config_name)
fprintf (file, "%s = %s\n",
weechat_options[i][j].option_name,
(weechat_options[i][j].ptr_int) ?
gui_get_color_name (*weechat_options[i][j].ptr_int) :
gui_color_get_name (*weechat_options[i][j].ptr_int) :
weechat_options[i][j].default_string);
break;
case OPTION_TYPE_STRING:
@@ -2315,10 +2423,10 @@ config_write (char *config_name)
fprintf (file, "\n[keys]\n");
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
{
expanded_name = gui_key_get_expanded_name (ptr_key->key);
expanded_name = gui_keyboard_get_expanded_name (ptr_key->key);
if (ptr_key->function)
{
function_name = gui_key_function_search_by_ptr (ptr_key->function);
function_name = gui_keyboard_function_search_by_ptr (ptr_key->function);
if (function_name)
fprintf (file, "%s = \"%s\"\n",
(expanded_name) ? expanded_name : ptr_key->key,
@@ -2338,7 +2446,7 @@ config_write (char *config_name)
ptr_alias = ptr_alias->next_alias)
{
fprintf (file, "%s = \"%s\"\n",
ptr_alias->alias_name, ptr_alias->alias_command + 1);
ptr_alias->alias_name, ptr_alias->alias_command);
}
/* ignore section */
@@ -2380,6 +2488,8 @@ config_write (char *config_name)
fprintf (file, "server_nick3 = \"%s\"\n", ptr_server->nick3);
fprintf (file, "server_username = \"%s\"\n", ptr_server->username);
fprintf (file, "server_realname = \"%s\"\n", ptr_server->realname);
fprintf (file, "server_hostname = \"%s\"\n",
(ptr_server->hostname) ? ptr_server->hostname : "");
fprintf (file, "server_command = \"%s\"\n",
(ptr_server->command) ? ptr_server->command : "");
fprintf (file, "server_command_delay = %d\n", ptr_server->command_delay);
+21 -1
View File
@@ -54,6 +54,10 @@
#define CFG_LOOK_NICKLIST_TOP 2
#define CFG_LOOK_NICKLIST_BOTTOM 3
#define CFG_LOOK_ALIGN_NICK_NONE 0
#define CFG_LOOK_ALIGN_NICK_LEFT 1
#define CFG_LOOK_ALIGN_NICK_RIGHT 2
#define CFG_IRC_DISPLAY_AWAY_OFF 0
#define CFG_IRC_DISPLAY_AWAY_LOCAL 1
#define CFG_IRC_DISPLAY_AWAY_CHANNEL 2
@@ -83,6 +87,7 @@ struct t_config_option
void (*handler_change)();
};
extern int cfg_look_save_on_exit;
extern int cfg_look_set_title;
extern int cfg_look_startup_logo;
extern int cfg_look_startup_version;
@@ -92,6 +97,8 @@ extern char *cfg_look_charset_decode_utf;
extern char *cfg_look_charset_encode;
extern char *cfg_look_charset_internal;
extern int cfg_look_one_server_buffer;
extern int cfg_look_open_near_server;
extern int cfg_look_scroll_amount;
extern char *cfg_look_buffer_timestamp;
extern int cfg_look_color_nicks_number;
extern int cfg_look_color_actions;
@@ -102,8 +109,15 @@ extern int cfg_look_nicklist_max_size;
extern int cfg_look_nickmode;
extern int cfg_look_nickmode_empty;
extern char *cfg_look_no_nickname;
extern char *cfg_look_completor;
extern char *cfg_look_nick_prefix;
extern char *cfg_look_nick_suffix;
extern int cfg_look_align_nick;
extern int cfg_look_align_other;
extern int cfg_look_align_size;
extern int cfg_look_align_size_max;
extern char *cfg_look_nick_completor;
extern char *cfg_look_nick_completion_ignore;
extern int cfg_look_nick_complete_first;
extern int cfg_look_infobar;
extern char *cfg_look_infobar_timestamp;
extern int cfg_look_infobar_seconds;
@@ -114,6 +128,7 @@ extern int cfg_look_hotlist_names_length;
extern int cfg_look_day_change;
extern char *cfg_look_day_change_timestamp;
extern char *cfg_look_read_marker;
extern char *cfg_look_input_format;
extern int cfg_col_real_white;
extern int cfg_col_separator;
@@ -149,6 +164,7 @@ extern int cfg_col_infobar_delimiters;
extern int cfg_col_infobar_highlight;
extern int cfg_col_infobar_bg;
extern int cfg_col_input;
extern int cfg_col_input_server;
extern int cfg_col_input_channel;
extern int cfg_col_input_nick;
extern int cfg_col_input_delimiters;
@@ -187,10 +203,12 @@ extern char *cfg_log_timestamp;
extern int cfg_log_hide_nickserv_pwd;
extern int cfg_irc_display_away;
extern int cfg_irc_show_away_once;
extern char *cfg_irc_default_msg_part;
extern char *cfg_irc_default_msg_quit;
extern int cfg_irc_notice_as_pv;
extern int cfg_irc_away_check;
extern int cfg_irc_away_check_max_nicks;
extern int cfg_irc_lag_check;
extern int cfg_irc_lag_min_show;
extern int cfg_irc_lag_disconnect;
@@ -203,6 +221,7 @@ extern int cfg_dcc_auto_accept_files;
extern int cfg_dcc_auto_accept_chats;
extern int cfg_dcc_timeout;
extern int cfg_dcc_blocksize;
extern int cfg_dcc_fast_send;
extern char *cfg_dcc_port_range;
extern char *cfg_dcc_own_ip;
extern char *cfg_dcc_download_path;
@@ -229,6 +248,7 @@ extern t_config_option * weechat_options [CONFIG_NUMBER_SECTIONS];
extern char *config_get_section ();
extern void config_change_noop ();
extern void config_change_save_on_exit ();
extern void config_change_title ();
extern void config_change_buffers ();
extern void config_change_buffer_content ();
+21
View File
@@ -29,6 +29,8 @@
#include "weechat.h"
#include "weelist.h"
#include "log.h"
#include "util.h"
/*
@@ -163,3 +165,22 @@ weelist_remove (t_weelist **weelist, t_weelist **last_weelist, t_weelist *elemen
free (element);
*weelist = new_weelist;
}
/*
* weelist_print_log: print weelist in log (usually for crash dump)
*/
void
weelist_print_log (t_weelist *weelist, char *name)
{
t_weelist *ptr_weelist;
for (ptr_weelist = weelist; ptr_weelist;
ptr_weelist = ptr_weelist->next_weelist)
{
weechat_log_printf ("[%s (addr:0x%X)]\n", name, ptr_weelist);
weechat_log_printf (" data . . . . . . . . . : '%s'\n", ptr_weelist->data);
weechat_log_printf (" prev_weelist . . . . . : 0x%X\n", ptr_weelist->prev_weelist);
weechat_log_printf (" next_weelist . . . . . : 0x%X\n", ptr_weelist->next_weelist);
}
}
+4 -3
View File
@@ -30,8 +30,9 @@ struct t_weelist
t_weelist *next_weelist;
};
t_weelist *weelist_search (t_weelist *, char *);
t_weelist *weelist_add (t_weelist **, t_weelist **, char *);
void weelist_remove (t_weelist **, t_weelist **, t_weelist *);
extern t_weelist *weelist_search (t_weelist *, char *);
extern t_weelist *weelist_add (t_weelist **, t_weelist **, char *);
extern void weelist_remove (t_weelist **, t_weelist **, t_weelist *);
extern void weelist_print_log (t_weelist *, char *);
#endif /* weelist.h */
+11 -2
View File
@@ -19,10 +19,19 @@ INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
noinst_LIBRARIES = lib_weechat_gui_common.a
lib_weechat_gui_common_a_SOURCES = gui-common.c \
lib_weechat_gui_common_a_SOURCES = gui-buffer.c \
gui-common.c \
gui-action.c \
gui-keyboard.c \
gui.h
gui-log.c \
gui-window.c \
gui-panel.c \
gui.h \
gui-buffer.h \
gui-color.h \
gui-keyboard.h \
gui-panel.h \
gui-window.h
if GUI_NCURSES
curses_dir=curses
+13 -6
View File
@@ -20,8 +20,7 @@ INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
bin_PROGRAMS = weechat-curses
if PLUGINS
weechat_curses_LDADD = ../gui-common.o ../gui-keyboard.o \
../gui-action.o \
weechat_curses_LDADD = ../lib_weechat_gui_common.a \
../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
../../plugins/lib_weechat_plugins.a \
@@ -29,8 +28,7 @@ weechat_curses_LDADD = ../gui-common.o ../gui-keyboard.o \
$(NCURSES_LIBS) \
$(GNUTLS_LFLAGS)
else
weechat_curses_LDADD = ../gui-common.o ../gui-keyboard.o \
../gui-action.o \
weechat_curses_LDADD = ../lib_weechat_gui_common.a \
../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(PLUGINS_LIBS) \
@@ -38,5 +36,14 @@ weechat_curses_LDADD = ../gui-common.o ../gui-keyboard.o \
$(GNUTLS_LFLAGS)
endif
weechat_curses_SOURCES = gui-display.c \
gui-input.c
weechat_curses_SOURCES = gui-curses-chat.c \
gui-curses-color.c \
gui-curses-infobar.c \
gui-curses-input.c \
gui-curses-keyboard.c \
gui-curses-main.c \
gui-curses-nicklist.c \
gui-curses-status.c \
gui-curses-window.c \
gui-curses-panel.c \
gui-curses.h
File diff suppressed because it is too large Load Diff
+602
View File
@@ -0,0 +1,602 @@
/*
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* gui-curses-color.c: color functions for Curses GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "../../common/weechat.h"
#include "../gui.h"
#include "../../common/util.h"
#include "../../common/weeconfig.h"
#include "gui-curses.h"
t_gui_color gui_weechat_colors[] =
{ { -1, 0, 0, "default" },
{ WEECHAT_COLOR_BLACK, 0, 0, "black" },
{ WEECHAT_COLOR_RED, 0, 0, "red" },
{ WEECHAT_COLOR_RED, 0, A_BOLD, "lightred" },
{ WEECHAT_COLOR_GREEN, 0, 0, "green" },
{ WEECHAT_COLOR_GREEN, 0, A_BOLD, "lightgreen" },
{ WEECHAT_COLOR_YELLOW, 0, 0, "brown" },
{ WEECHAT_COLOR_YELLOW, 0, A_BOLD, "yellow" },
{ WEECHAT_COLOR_BLUE, 0, 0, "blue" },
{ WEECHAT_COLOR_BLUE, 0, A_BOLD, "lightblue" },
{ WEECHAT_COLOR_MAGENTA, 0, 0, "magenta" },
{ WEECHAT_COLOR_MAGENTA, 0, A_BOLD, "lightmagenta" },
{ WEECHAT_COLOR_CYAN, 0, 0, "cyan" },
{ WEECHAT_COLOR_CYAN, 0, A_BOLD, "lightcyan" },
{ WEECHAT_COLOR_WHITE, 0, A_BOLD, "white" },
{ 0, 0, 0, NULL }
};
int gui_irc_colors[GUI_NUM_IRC_COLORS][2] =
{ { /* 0 */ WEECHAT_COLOR_WHITE, A_BOLD },
{ /* 1 */ WEECHAT_COLOR_BLACK, 0 },
{ /* 2 */ WEECHAT_COLOR_BLUE, 0 },
{ /* 3 */ WEECHAT_COLOR_GREEN, 0 },
{ /* 4 */ WEECHAT_COLOR_RED, A_BOLD },
{ /* 5 */ WEECHAT_COLOR_RED, 0 },
{ /* 6 */ WEECHAT_COLOR_MAGENTA, 0 },
{ /* 7 */ WEECHAT_COLOR_YELLOW, 0 },
{ /* 8 */ WEECHAT_COLOR_YELLOW, A_BOLD },
{ /* 9 */ WEECHAT_COLOR_GREEN, A_BOLD },
{ /* 10 */ WEECHAT_COLOR_CYAN, 0 },
{ /* 11 */ WEECHAT_COLOR_CYAN, A_BOLD },
{ /* 12 */ WEECHAT_COLOR_BLUE, A_BOLD },
{ /* 13 */ WEECHAT_COLOR_MAGENTA, A_BOLD },
{ /* 14 */ WEECHAT_COLOR_WHITE, 0 },
{ /* 15 */ WEECHAT_COLOR_WHITE, A_BOLD }
};
t_gui_color *gui_color[GUI_NUM_COLORS];
/*
* gui_color_assign: assign a WeeChat color (read from config)
*/
int
gui_color_assign (int *color, char *color_name)
{
int i;
/* look for curses colors in table */
i = 0;
while (gui_weechat_colors[i].string)
{
if (ascii_strcasecmp (gui_weechat_colors[i].string, color_name) == 0)
{
*color = i;
return 1;
}
i++;
}
/* color not found */
return 0;
}
/*
* gui_color_get_name: get color name
*/
char *
gui_color_get_name (int num_color)
{
return gui_weechat_colors[num_color].string;
}
/*
* gui_color_decode: parses a message (coming from IRC server),
* and according:
* - remove any color/style in message
* or:
* - change colors by codes to be compatible with
* other IRC clients
* After use, string returned has to be free()
*/
unsigned char *
gui_color_decode (unsigned char *string, int keep_colors)
{
unsigned char *out;
int out_length, out_pos;
char str_fg[3], str_bg[3];
int fg, bg, attr;
out_length = (strlen ((char *)string) * 2) + 1;
out = (unsigned char *)malloc (out_length);
if (!out)
return NULL;
out_pos = 0;
while (string[0] && (out_pos < out_length - 1))
{
switch (string[0])
{
case GUI_ATTR_BOLD_CHAR:
case GUI_ATTR_RESET_CHAR:
case GUI_ATTR_FIXED_CHAR:
case GUI_ATTR_REVERSE_CHAR:
case GUI_ATTR_REVERSE2_CHAR:
case GUI_ATTR_ITALIC_CHAR:
case GUI_ATTR_UNDERLINE_CHAR:
if (keep_colors)
out[out_pos++] = string[0];
string++;
break;
case GUI_ATTR_COLOR_CHAR:
string++;
str_fg[0] = '\0';
str_bg[0] = '\0';
if (isdigit (string[0]))
{
str_fg[0] = string[0];
str_fg[1] = '\0';
string++;
if (isdigit (string[0]))
{
str_fg[1] = string[0];
str_fg[2] = '\0';
string++;
}
}
if (string[0] == ',')
{
string++;
if (isdigit (string[0]))
{
str_bg[0] = string[0];
str_bg[1] = '\0';
string++;
if (isdigit (string[0]))
{
str_bg[1] = string[0];
str_bg[2] = '\0';
string++;
}
}
}
if (keep_colors)
{
if (!str_fg[0] && !str_bg[0])
out[out_pos++] = GUI_ATTR_COLOR_CHAR;
else
{
attr = 0;
if (str_fg[0])
{
sscanf (str_fg, "%d", &fg);
fg %= GUI_NUM_IRC_COLORS;
attr |= gui_irc_colors[fg][1];
}
if (str_bg[0])
{
sscanf (str_bg, "%d", &bg);
bg %= GUI_NUM_IRC_COLORS;
attr |= gui_irc_colors[bg][1];
}
if (attr & A_BOLD)
{
out[out_pos++] = GUI_ATTR_WEECHAT_SET_CHAR;
out[out_pos++] = GUI_ATTR_BOLD_CHAR;
}
else
{
out[out_pos++] = GUI_ATTR_WEECHAT_REMOVE_CHAR;
out[out_pos++] = GUI_ATTR_BOLD_CHAR;
}
out[out_pos++] = GUI_ATTR_COLOR_CHAR;
if (str_fg[0])
{
out[out_pos++] = (gui_irc_colors[fg][0] / 10) + '0';
out[out_pos++] = (gui_irc_colors[fg][0] % 10) + '0';
}
if (str_bg[0])
{
out[out_pos++] = ',';
out[out_pos++] = (gui_irc_colors[bg][0] / 10) + '0';
out[out_pos++] = (gui_irc_colors[bg][0] % 10) + '0';
}
}
}
break;
case GUI_ATTR_WEECHAT_COLOR_CHAR:
string++;
if (isdigit (string[0]) && isdigit (string[1]))
{
if (keep_colors)
{
out[out_pos++] = string[0];
out[out_pos++] = string[1];
}
string += 2;
}
break;
case GUI_ATTR_WEECHAT_SET_CHAR:
case GUI_ATTR_WEECHAT_REMOVE_CHAR:
string++;
if (string[0])
{
if (keep_colors)
{
out[out_pos++] = *(string - 1);
out[out_pos++] = string[0];
}
string++;
}
break;
default:
out[out_pos++] = string[0];
string++;
}
}
out[out_pos] = '\0';
return out;
}
/*
* gui_color_decode_for_user_entry: parses a message (coming from IRC server),
* and replaces colors/bold/.. by %C, %B, ..
* After use, string returned has to be free()
*/
unsigned char *
gui_color_decode_for_user_entry (unsigned char *string)
{
unsigned char *out;
int out_length, out_pos;
out_length = (strlen ((char *)string) * 2) + 1;
out = (unsigned char *)malloc (out_length);
if (!out)
return NULL;
out_pos = 0;
while (string[0] && (out_pos < out_length - 1))
{
switch (string[0])
{
case GUI_ATTR_BOLD_CHAR:
out[out_pos++] = '%';
out[out_pos++] = 'B';
string++;
break;
case GUI_ATTR_FIXED_CHAR:
string++;
break;
case GUI_ATTR_RESET_CHAR:
out[out_pos++] = '%';
out[out_pos++] = 'O';
string++;
break;
case GUI_ATTR_REVERSE_CHAR:
case GUI_ATTR_REVERSE2_CHAR:
out[out_pos++] = '%';
out[out_pos++] = 'R';
string++;
break;
case GUI_ATTR_ITALIC_CHAR:
string++;
break;
case GUI_ATTR_UNDERLINE_CHAR:
out[out_pos++] = '%';
out[out_pos++] = 'R';
string++;
break;
case GUI_ATTR_COLOR_CHAR:
out[out_pos++] = '%';
out[out_pos++] = 'C';
string++;
break;
default:
out[out_pos++] = string[0];
string++;
}
}
out[out_pos] = '\0';
return out;
}
/*
* gui_color_encode: parses a message (entered by user), and
* encode special chars (%B, %C, ..) in IRC colors
* After use, string returned has to be free()
*/
unsigned char *
gui_color_encode (unsigned char *string)
{
unsigned char *out;
int out_length, out_pos;
out_length = (strlen ((char *)string) * 2) + 1;
out = (unsigned char *)malloc (out_length);
if (!out)
return NULL;
out_pos = 0;
while (string[0] && (out_pos < out_length - 1))
{
switch (string[0])
{
case '%':
string++;
switch (string[0])
{
case '\0':
out[out_pos++] = '%';
break;
case '%': /* double '%' replaced by single '%' */
out[out_pos++] = string[0];
string++;
break;
case 'B': /* bold */
out[out_pos++] = GUI_ATTR_BOLD_CHAR;
string++;
break;
case 'C': /* color */
out[out_pos++] = GUI_ATTR_COLOR_CHAR;
string++;
if (isdigit (string[0]))
{
out[out_pos++] = string[0];
string++;
if (isdigit (string[0]))
{
out[out_pos++] = string[0];
string++;
}
}
if (string[0] == ',')
{
out[out_pos++] = ',';
string++;
if (isdigit (string[0]))
{
out[out_pos++] = string[0];
string++;
if (isdigit (string[0]))
{
out[out_pos++] = string[0];
string++;
}
}
}
break;
case 'O': /* reset */
out[out_pos++] = GUI_ATTR_RESET_CHAR;
string++;
break;
case 'R': /* reverse */
out[out_pos++] = GUI_ATTR_REVERSE_CHAR;
string++;
break;
case 'U': /* underline */
out[out_pos++] = GUI_ATTR_UNDERLINE_CHAR;
string++;
break;
default:
out[out_pos++] = '%';
out[out_pos++] = string[0];
string++;
}
break;
default:
out[out_pos++] = string[0];
string++;
}
}
out[out_pos] = '\0';
return out;
}
/*
* gui_color_build: build a WeeChat color with foreground,
* background and attributes (attributes are
* given with foreground color, with a OR)
*/
t_gui_color *
gui_color_build (int number, int foreground, int background)
{
t_gui_color *new_color;
new_color = (t_gui_color *)malloc (sizeof (t_gui_color));
if (!new_color)
return NULL;
new_color->foreground = gui_weechat_colors[foreground].foreground;
new_color->background = gui_weechat_colors[background].foreground;
new_color->attributes = gui_weechat_colors[foreground].attributes;
new_color->string = (char *)malloc (4);
if (new_color->string)
snprintf (new_color->string, 4,
"%s%02d",
GUI_ATTR_WEECHAT_COLOR_STR, number);
return new_color;
}
/*
* gui_color_get_pair: get color pair with a WeeChat color number
*/
int
gui_color_get_pair (int num_color)
{
int fg, bg;
if ((num_color < 0) || (num_color > GUI_NUM_COLORS - 1))
return WEECHAT_COLOR_WHITE;
fg = gui_color[num_color]->foreground;
bg = gui_color[num_color]->background;
if (((fg == -1) || (fg == 99))
&& ((bg == -1) || (bg == 99)))
return 63;
if ((fg == -1) || (fg == 99))
fg = WEECHAT_COLOR_WHITE;
if ((bg == -1) || (bg == 99))
bg = 0;
return (bg * 8) + fg;
}
/*
* gui_color_init_pairs: init color pairs
*/
void
gui_color_init_pairs ()
{
int i;
char shift_colors[8] = { 0, 4, 2, 6, 1, 5, 3, 7 };
if (has_colors ())
{
for (i = 1; i < 64; i++)
init_pair (i, shift_colors[i % 8], (i < 8) ? -1 : shift_colors[i / 8]);
/* disable white on white, replaced by black on white */
init_pair (63, -1, -1);
/* white on default bg is default (-1) */
if (!cfg_col_real_white)
init_pair (WEECHAT_COLOR_WHITE, -1, -1);
}
}
/*
* gui_color_init_weechat: init WeeChat colors
*/
void
gui_color_init_weechat ()
{
int i;
gui_color[COLOR_WIN_SEPARATOR] = gui_color_build (COLOR_WIN_SEPARATOR, cfg_col_separator, cfg_col_separator);
gui_color[COLOR_WIN_TITLE] = gui_color_build (COLOR_WIN_TITLE, cfg_col_title, cfg_col_title_bg);
gui_color[COLOR_WIN_CHAT] = gui_color_build (COLOR_WIN_CHAT, cfg_col_chat, cfg_col_chat_bg);
gui_color[COLOR_WIN_CHAT_TIME] = gui_color_build (COLOR_WIN_CHAT_TIME, cfg_col_chat_time, cfg_col_chat_bg);
gui_color[COLOR_WIN_CHAT_TIME_SEP] = gui_color_build (COLOR_WIN_CHAT_TIME_SEP, cfg_col_chat_time_sep, cfg_col_chat_bg);
gui_color[COLOR_WIN_CHAT_PREFIX1] = gui_color_build (COLOR_WIN_CHAT_PREFIX1, cfg_col_chat_prefix1, cfg_col_chat_bg);
gui_color[COLOR_WIN_CHAT_PREFIX2] = gui_color_build (COLOR_WIN_CHAT_PREFIX2, cfg_col_chat_prefix2, cfg_col_chat_bg);
gui_color[COLOR_WIN_CHAT_SERVER] = gui_color_build (COLOR_WIN_CHAT_SERVER, cfg_col_chat_server, cfg_col_chat_bg);
gui_color[COLOR_WIN_CHAT_JOIN] = gui_color_build (COLOR_WIN_CHAT_JOIN, cfg_col_chat_join, cfg_col_chat_bg);
gui_color[COLOR_WIN_CHAT_PART] = gui_color_build (COLOR_WIN_CHAT_PART, cfg_col_chat_part, cfg_col_chat_bg);
gui_color[COLOR_WIN_CHAT_NICK] = gui_color_build (COLOR_WIN_CHAT_NICK, cfg_col_chat_nick, cfg_col_chat_bg);
gui_color[COLOR_WIN_CHAT_HOST] = gui_color_build (COLOR_WIN_CHAT_HOST, cfg_col_chat_host, cfg_col_chat_bg);
gui_color[COLOR_WIN_CHAT_CHANNEL] = gui_color_build (COLOR_WIN_CHAT_CHANNEL, cfg_col_chat_channel, cfg_col_chat_bg);
gui_color[COLOR_WIN_CHAT_DARK] = gui_color_build (COLOR_WIN_CHAT_DARK, cfg_col_chat_dark, cfg_col_chat_bg);
gui_color[COLOR_WIN_CHAT_HIGHLIGHT] = gui_color_build (COLOR_WIN_CHAT_HIGHLIGHT, cfg_col_chat_highlight, cfg_col_chat_bg);
gui_color[COLOR_WIN_CHAT_READ_MARKER] = gui_color_build (COLOR_WIN_CHAT_READ_MARKER, cfg_col_chat_read_marker, cfg_col_chat_read_marker_bg);
gui_color[COLOR_WIN_STATUS] = gui_color_build (COLOR_WIN_STATUS, cfg_col_status, cfg_col_status_bg);
gui_color[COLOR_WIN_STATUS_DELIMITERS] = gui_color_build (COLOR_WIN_STATUS_DELIMITERS, cfg_col_status_delimiters, cfg_col_status_bg);
gui_color[COLOR_WIN_STATUS_CHANNEL] = gui_color_build (COLOR_WIN_STATUS_CHANNEL, cfg_col_status_channel, cfg_col_status_bg);
gui_color[COLOR_WIN_STATUS_DATA_MSG] = gui_color_build (COLOR_WIN_STATUS_DATA_MSG, cfg_col_status_data_msg, cfg_col_status_bg);
gui_color[COLOR_WIN_STATUS_DATA_PRIVATE] = gui_color_build (COLOR_WIN_STATUS_DATA_PRIVATE, cfg_col_status_data_private, cfg_col_status_bg);
gui_color[COLOR_WIN_STATUS_DATA_HIGHLIGHT] = gui_color_build (COLOR_WIN_STATUS_DATA_HIGHLIGHT, cfg_col_status_data_highlight, cfg_col_status_bg);
gui_color[COLOR_WIN_STATUS_DATA_OTHER] = gui_color_build (COLOR_WIN_STATUS_DATA_OTHER, cfg_col_status_data_other, cfg_col_status_bg);
gui_color[COLOR_WIN_STATUS_MORE] = gui_color_build (COLOR_WIN_STATUS_MORE, cfg_col_status_more, cfg_col_status_bg);
gui_color[COLOR_WIN_INFOBAR] = gui_color_build (COLOR_WIN_INFOBAR, cfg_col_infobar, cfg_col_infobar_bg);
gui_color[COLOR_WIN_INFOBAR_DELIMITERS] = gui_color_build (COLOR_WIN_INFOBAR_DELIMITERS, cfg_col_infobar_delimiters, cfg_col_infobar_bg);
gui_color[COLOR_WIN_INFOBAR_HIGHLIGHT] = gui_color_build (COLOR_WIN_INFOBAR_HIGHLIGHT, cfg_col_infobar_highlight, cfg_col_infobar_bg);
gui_color[COLOR_WIN_INPUT] = gui_color_build (COLOR_WIN_INPUT, cfg_col_input, cfg_col_input_bg);
gui_color[COLOR_WIN_INPUT_SERVER] = gui_color_build (COLOR_WIN_INPUT_SERVER, cfg_col_input_server, cfg_col_input_bg);
gui_color[COLOR_WIN_INPUT_CHANNEL] = gui_color_build (COLOR_WIN_INPUT_CHANNEL, cfg_col_input_channel, cfg_col_input_bg);
gui_color[COLOR_WIN_INPUT_NICK] = gui_color_build (COLOR_WIN_INPUT_NICK, cfg_col_input_nick, cfg_col_input_bg);
gui_color[COLOR_WIN_INPUT_DELIMITERS] = gui_color_build (COLOR_WIN_INPUT_DELIMITERS, cfg_col_input_delimiters, cfg_col_input_bg);
gui_color[COLOR_WIN_NICK] = gui_color_build (COLOR_WIN_NICK, cfg_col_nick, cfg_col_nick_bg);
gui_color[COLOR_WIN_NICK_AWAY] = gui_color_build (COLOR_WIN_NICK_AWAY, cfg_col_nick_away, cfg_col_nick_bg);
gui_color[COLOR_WIN_NICK_CHANOWNER] = gui_color_build (COLOR_WIN_NICK_CHANOWNER, cfg_col_nick_chanowner, cfg_col_nick_bg);
gui_color[COLOR_WIN_NICK_CHANADMIN] = gui_color_build (COLOR_WIN_NICK_CHANADMIN, cfg_col_nick_chanadmin, cfg_col_nick_bg);
gui_color[COLOR_WIN_NICK_OP] = gui_color_build (COLOR_WIN_NICK_OP, cfg_col_nick_op, cfg_col_nick_bg);
gui_color[COLOR_WIN_NICK_HALFOP] = gui_color_build (COLOR_WIN_NICK_HALFOP, cfg_col_nick_halfop, cfg_col_nick_bg);
gui_color[COLOR_WIN_NICK_VOICE] = gui_color_build (COLOR_WIN_NICK_VOICE, cfg_col_nick_voice, cfg_col_nick_bg);
gui_color[COLOR_WIN_NICK_MORE] = gui_color_build (COLOR_WIN_NICK_MORE, cfg_col_nick_more, cfg_col_nick_bg);
gui_color[COLOR_WIN_NICK_SEP] = gui_color_build (COLOR_WIN_NICK_SEP, cfg_col_nick_sep, cfg_col_nick_bg);
gui_color[COLOR_WIN_NICK_SELF] = gui_color_build (COLOR_WIN_NICK_SELF, cfg_col_nick_self, cfg_col_nick_bg);
gui_color[COLOR_WIN_NICK_PRIVATE] = gui_color_build (COLOR_WIN_NICK_PRIVATE, cfg_col_nick_private, cfg_col_nick_bg);
for (i = 0; i < COLOR_WIN_NICK_NUMBER; i++)
{
gui_color[COLOR_WIN_NICK_1 + i] = gui_color_build (COLOR_WIN_NICK_1 + i, cfg_col_nick_colors[i], cfg_col_chat_bg);
}
gui_color[COLOR_DCC_SELECTED] = gui_color_build (COLOR_DCC_SELECTED, cfg_col_dcc_selected, cfg_col_chat_bg);
gui_color[COLOR_DCC_WAITING] = gui_color_build (COLOR_DCC_WAITING, cfg_col_dcc_waiting, cfg_col_chat_bg);
gui_color[COLOR_DCC_CONNECTING] = gui_color_build (COLOR_DCC_CONNECTING, cfg_col_dcc_connecting, cfg_col_chat_bg);
gui_color[COLOR_DCC_ACTIVE] = gui_color_build (COLOR_DCC_ACTIVE, cfg_col_dcc_active, cfg_col_chat_bg);
gui_color[COLOR_DCC_DONE] = gui_color_build (COLOR_DCC_DONE, cfg_col_dcc_done, cfg_col_chat_bg);
gui_color[COLOR_DCC_FAILED] = gui_color_build (COLOR_DCC_FAILED, cfg_col_dcc_failed, cfg_col_chat_bg);
gui_color[COLOR_DCC_ABORTED] = gui_color_build (COLOR_DCC_ABORTED, cfg_col_dcc_aborted, cfg_col_chat_bg);
}
/*
* gui_color_rebuild_weechat: rebuild WeeChat colors
*/
void
gui_color_rebuild_weechat ()
{
int i;
if (has_colors ())
{
for (i = 0; i < GUI_NUM_COLORS; i++)
{
if (gui_color[i])
{
if (gui_color[i]->string)
free (gui_color[i]->string);
free (gui_color[i]);
gui_color[i] = NULL;
}
}
gui_color_init_weechat ();
}
}
/*
* gui_color_init: init GUI colors
*/
void
gui_color_init ()
{
if (has_colors ())
{
start_color ();
use_default_colors ();
}
gui_color_init_pairs ();
gui_color_init_weechat ();
}
+131
View File
@@ -0,0 +1,131 @@
/*
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* gui-curses-infobar.c: infobar display functions for Curses GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include "../../common/weechat.h"
#include "../gui.h"
#include "../../common/hotlist.h"
#include "../../common/weeconfig.h"
#include "gui-curses.h"
/*
* gui_infobar_draw_time: draw time in infobar window
*/
void
gui_infobar_draw_time (t_gui_buffer *buffer)
{
t_gui_window *ptr_win;
time_t time_seconds;
struct tm *local_time;
/* make gcc happy */
(void) buffer;
if (!gui_ok)
return;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
time_seconds = time (NULL);
local_time = localtime (&time_seconds);
if (local_time)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR);
mvwprintw (GUI_CURSES(ptr_win)->win_infobar,
0, 1,
"%02d:%02d",
local_time->tm_hour, local_time->tm_min);
if (cfg_look_infobar_seconds)
wprintw (GUI_CURSES(ptr_win)->win_infobar,
":%02d",
local_time->tm_sec);
}
wnoutrefresh (GUI_CURSES(ptr_win)->win_infobar);
}
}
/*
* gui_infobar_draw: draw infobar window for a buffer
*/
void
gui_infobar_draw (t_gui_buffer *buffer, int erase)
{
t_gui_window *ptr_win;
time_t time_seconds;
struct tm *local_time;
char text_time[1024 + 1];
/* make gcc happy */
(void) buffer;
if (!gui_ok)
return;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (erase)
gui_window_curses_clear (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR);
time_seconds = time (NULL);
local_time = localtime (&time_seconds);
if (local_time)
{
strftime (text_time, 1024, cfg_look_infobar_timestamp, local_time);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_infobar, "[");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR);
wprintw (GUI_CURSES(ptr_win)->win_infobar,
"%02d:%02d",
local_time->tm_hour, local_time->tm_min);
if (cfg_look_infobar_seconds)
wprintw (GUI_CURSES(ptr_win)->win_infobar,
":%02d",
local_time->tm_sec);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_infobar, "]");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR);
wprintw (GUI_CURSES(ptr_win)->win_infobar,
" %s", text_time);
}
if (gui_infobar)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_infobar, " | ");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, gui_infobar->color);
wprintw (GUI_CURSES(ptr_win)->win_infobar, "%s", gui_infobar->text);
}
wnoutrefresh (GUI_CURSES(ptr_win)->win_infobar);
refresh ();
}
}
+425
View File
@@ -0,0 +1,425 @@
/*
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* gui-curses-input: input display functions for Curses GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include "../../common/weechat.h"
#include "../gui.h"
#include "../../common/utf8.h"
#include "../../common/weeconfig.h"
#include "gui-curses.h"
#ifdef PLUGINS
#include "../../plugins/plugins.h"
#endif
/*
* gui_input_set_color: set color for an input window
*/
void
gui_input_set_color (t_gui_window *window, int irc_color)
{
int fg, bg;
fg = gui_irc_colors[irc_color][0];
bg = gui_color[COLOR_WIN_INPUT]->background;
irc_color %= GUI_NUM_IRC_COLORS;
if (gui_irc_colors[irc_color][1] & A_BOLD)
wattron (GUI_CURSES(window)->win_input, A_BOLD);
if (((fg == -1) || (fg == 99))
&& ((bg == -1) || (bg == 99)))
wattron (GUI_CURSES(window)->win_input, COLOR_PAIR(63));
else
{
if ((fg == -1) || (fg == 99))
fg = WEECHAT_COLOR_WHITE;
if ((bg == -1) || (bg == 99))
bg = 0;
wattron (GUI_CURSES(window)->win_input, COLOR_PAIR((bg * 8) + fg));
}
}
/*
* gui_input_get_prompt_length: return input prompt length (displayed on screen)
*/
int
gui_input_get_prompt_length (t_gui_window *window, char *nick)
{
char *pos, saved_char;
int char_size, length;
length = 0;
pos = cfg_look_input_format;
while (pos && pos[0])
{
switch (pos[0])
{
case '%':
pos++;
switch (pos[0])
{
case 'c':
if (CHANNEL(window->buffer))
length += utf8_strlen (CHANNEL(window->buffer)->name);
else
{
if (SERVER(window->buffer))
length += utf8_strlen (SERVER(window->buffer)->name);
}
pos++;
break;
case 'm':
if (SERVER(window->buffer))
{
if (SERVER(window->buffer)->nick_modes
&& SERVER(window->buffer)->nick_modes[0])
length += strlen (SERVER(window->buffer)->nick_modes);
}
pos++;
break;
case 'n':
length += utf8_strlen (nick);
pos++;
break;
default:
length++;
if (pos[0])
{
if (pos[0] == '%')
pos++;
else
{
length++;
pos += utf8_char_size (pos);
}
}
break;
}
break;
default:
char_size = utf8_char_size (pos);
saved_char = pos[char_size];
pos[char_size] = '\0';
length += utf8_width_screen (pos);
pos[char_size] = saved_char;
pos += char_size;
break;
}
}
return length;
}
/*
* gui_input_draw_prompt: display input prompt
* return: # chars displayed on screen (one UTF-8 char
* may be displayed on more than 1 char on screen)
*/
void
gui_input_draw_prompt (t_gui_window *window, char *nick)
{
char *pos, saved_char;
int char_size;
wmove (GUI_CURSES(window)->win_input, 0, 0);
pos = cfg_look_input_format;
while (pos && pos[0])
{
switch (pos[0])
{
case '%':
pos++;
switch (pos[0])
{
case 'c':
if (CHANNEL(window->buffer))
{
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
COLOR_WIN_INPUT_CHANNEL);
wprintw (GUI_CURSES(window)->win_input, "%s",
CHANNEL(window->buffer)->name);
}
else
{
if (SERVER(window->buffer))
{
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
COLOR_WIN_INPUT_SERVER);
wprintw (GUI_CURSES(window)->win_input, "%s",
SERVER(window->buffer)->name);
}
}
pos++;
break;
case 'm':
if (SERVER(window->buffer))
{
if (SERVER(window->buffer)->nick_modes
&& SERVER(window->buffer)->nick_modes[0])
{
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
COLOR_WIN_INPUT);
wprintw (GUI_CURSES(window)->win_input, "%s",
SERVER(window->buffer)->nick_modes);
}
}
pos++;
break;
case 'n':
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
COLOR_WIN_INPUT_NICK);
wprintw (GUI_CURSES(window)->win_input, "%s", nick);
pos++;
break;
default:
if (pos[0])
{
char_size = utf8_char_size (pos);
saved_char = pos[char_size];
pos[char_size] = '\0';
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
COLOR_WIN_INPUT_DELIMITERS);
wprintw (GUI_CURSES(window)->win_input, "%%%s", pos);
pos[char_size] = saved_char;
pos += char_size;
}
else
{
wprintw (GUI_CURSES(window)->win_input, "%%");
pos++;
}
break;
}
break;
default:
char_size = utf8_char_size (pos);
saved_char = pos[char_size];
pos[char_size] = '\0';
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
COLOR_WIN_INPUT_DELIMITERS);
wprintw (GUI_CURSES(window)->win_input, "%s", pos);
pos[char_size] = saved_char;
pos += char_size;
break;
}
}
}
/*
* gui_input_draw_text: display text in input buffer, according to color mask
* return: offset for cursor position on screen (one UTF-8
* char may be displayed on more than 1 char on screen)
*/
int
gui_input_draw_text (t_gui_window *window, int input_width)
{
char *ptr_start, *ptr_next, saved_char;
int pos_mask, size, last_color, color, count_cursor, offset_cursor;
ptr_start = utf8_add_offset (window->buffer->input_buffer,
window->buffer->input_buffer_1st_display);
pos_mask = ptr_start - window->buffer->input_buffer;
last_color = -1;
count_cursor = window->buffer->input_buffer_pos -
window->buffer->input_buffer_1st_display;
offset_cursor = 0;
while ((input_width > 0) && ptr_start && ptr_start[0])
{
ptr_next = utf8_next_char (ptr_start);
if (ptr_next)
{
saved_char = ptr_next[0];
ptr_next[0] = '\0';
size = ptr_next - ptr_start;
if (window->buffer->input_buffer_color_mask[pos_mask] != ' ')
color = window->buffer->input_buffer_color_mask[pos_mask] - '0';
else
color = -1;
if (color != last_color)
{
if (color == -1)
gui_window_set_weechat_color (GUI_CURSES(window)->win_input, COLOR_WIN_INPUT);
else
gui_input_set_color (window, color);
}
last_color = color;
wprintw (GUI_CURSES(window)->win_input, "%s", ptr_start);
if (count_cursor > 0)
{
offset_cursor += utf8_width_screen (ptr_start);
count_cursor--;
}
ptr_next[0] = saved_char;
ptr_start = ptr_next;
pos_mask += size;
}
else
ptr_start = NULL;
input_width--;
}
return offset_cursor;
}
/*
* gui_input_draw: draw input window for a buffer
*/
void
gui_input_draw (t_gui_buffer *buffer, int erase)
{
t_gui_window *ptr_win;
char format[32];
char *ptr_nickname;
int prompt_length, display_prompt, offset_cursor;
t_irc_dcc *dcc_selected;
if (!gui_ok)
return;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (ptr_win->buffer == buffer)
{
if (erase)
gui_window_curses_clear (GUI_CURSES(ptr_win)->win_input, COLOR_WIN_INPUT);
switch (buffer->type)
{
case BUFFER_TYPE_STANDARD:
if (buffer->has_input)
{
if (buffer->input_buffer_length == 0)
buffer->input_buffer[0] = '\0';
if (SERVER(buffer))
ptr_nickname = (SERVER(buffer)->nick) ?
SERVER(buffer)->nick : SERVER(buffer)->nick1;
else
ptr_nickname = cfg_look_no_nickname;
prompt_length = gui_input_get_prompt_length (ptr_win, ptr_nickname);
if (ptr_win->win_input_width - prompt_length < 3)
{
prompt_length = 0;
display_prompt = 0;
}
else
display_prompt = 1;
if (buffer->input_buffer_pos - buffer->input_buffer_1st_display + 1 >
ptr_win->win_input_width - prompt_length)
buffer->input_buffer_1st_display = buffer->input_buffer_pos -
(ptr_win->win_input_width - prompt_length) + 1;
else
{
if (buffer->input_buffer_pos < buffer->input_buffer_1st_display)
buffer->input_buffer_1st_display = buffer->input_buffer_pos;
else
{
if ((buffer->input_buffer_1st_display > 0) &&
(buffer->input_buffer_pos -
buffer->input_buffer_1st_display + 1)
< ptr_win->win_input_width - prompt_length)
{
buffer->input_buffer_1st_display =
buffer->input_buffer_pos -
(ptr_win->win_input_width - prompt_length) + 1;
if (buffer->input_buffer_1st_display < 0)
buffer->input_buffer_1st_display = 0;
}
}
}
if (display_prompt)
gui_input_draw_prompt (ptr_win, ptr_nickname);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_input, COLOR_WIN_INPUT);
snprintf (format, 32, "%%-%ds", ptr_win->win_input_width - prompt_length);
offset_cursor = 0;
if (ptr_win == gui_current_window)
offset_cursor = gui_input_draw_text (ptr_win,
ptr_win->win_input_width - prompt_length);
else
wprintw (GUI_CURSES(ptr_win)->win_input, format, "");
wclrtoeol (GUI_CURSES(ptr_win)->win_input);
ptr_win->win_input_cursor_x = prompt_length + offset_cursor;
if (ptr_win == gui_current_window)
move (ptr_win->win_input_y,
ptr_win->win_input_x + ptr_win->win_input_cursor_x);
}
break;
case BUFFER_TYPE_DCC:
dcc_selected = (ptr_win->dcc_selected) ? (t_irc_dcc *) ptr_win->dcc_selected : dcc_list;
wmove (GUI_CURSES(ptr_win)->win_input, 0, 0);
if (dcc_selected)
{
switch (dcc_selected->status)
{
case DCC_WAITING:
if (DCC_IS_RECV(dcc_selected->type))
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [A] Accept"));
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [C] Cancel"));
break;
case DCC_CONNECTING:
case DCC_ACTIVE:
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [C] Cancel"));
break;
case DCC_DONE:
case DCC_FAILED:
case DCC_ABORTED:
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [R] Remove"));
break;
}
}
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [P] Purge old DCC"));
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [Q] Close DCC view"));
wclrtoeol (GUI_CURSES(ptr_win)->win_input);
ptr_win->win_input_cursor_x = 0;
if (ptr_win == gui_current_window)
move (ptr_win->win_input_y, ptr_win->win_input_x);
break;
case BUFFER_TYPE_RAW_DATA:
wmove (GUI_CURSES(ptr_win)->win_input, 0, 0);
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [C] Clear buffer"));
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [Q] Close raw data view"));
wclrtoeol (GUI_CURSES(ptr_win)->win_input);
ptr_win->win_input_cursor_x = 0;
if (ptr_win == gui_current_window)
move (ptr_win->win_input_y, ptr_win->win_input_x);
break;
}
wrefresh (GUI_CURSES(ptr_win)->win_input);
refresh ();
}
}
}
+325
View File
@@ -0,0 +1,325 @@
/*
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* gui-curses-keyboard.c: keyboard functions for Curses GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include "../../common/weechat.h"
#include "../gui.h"
#include "../../common/utf8.h"
#include "gui-curses.h"
#ifdef PLUGINS
#include "../../plugins/plugins.h"
#endif
/*
* gui_keyboard_default_bindings: create default key bindings
*/
void
gui_keyboard_default_bindings ()
{
int i;
char key_str[32], command[32];
/* keys bound with internal functions */
gui_keyboard_bind ( /* RC */ "ctrl-M", "return");
gui_keyboard_bind ( /* RC */ "ctrl-J", "return");
gui_keyboard_bind ( /* tab */ "ctrl-I", "tab");
gui_keyboard_bind ( /* s-tab */ "meta2-Z", "tab_previous");
gui_keyboard_bind ( /* basckp */ "ctrl-H", "backspace");
gui_keyboard_bind ( /* basckp */ "ctrl-?", "backspace");
gui_keyboard_bind ( /* del */ "meta2-3~", "delete");
gui_keyboard_bind ( /* ^K */ "ctrl-K", "delete_end_line");
gui_keyboard_bind ( /* ^U */ "ctrl-U", "delete_beginning_line");
gui_keyboard_bind ( /* ^W */ "ctrl-W", "delete_previous_word");
gui_keyboard_bind ( /* ^Y */ "ctrl-Y", "clipboard_paste");
gui_keyboard_bind ( /* ^T */ "ctrl-T", "transpose_chars");
gui_keyboard_bind ( /* home */ "meta2-1~", "home");
gui_keyboard_bind ( /* home */ "meta2-H", "home");
gui_keyboard_bind ( /* home */ "meta2-7~", "home");
gui_keyboard_bind ( /* ^A */ "ctrl-A", "home");
gui_keyboard_bind ( /* end */ "meta2-4~", "end");
gui_keyboard_bind ( /* end */ "meta2-F", "end");
gui_keyboard_bind ( /* end */ "meta2-8~", "end");
gui_keyboard_bind ( /* ^E */ "ctrl-E", "end");
gui_keyboard_bind ( /* left */ "meta2-D", "left");
gui_keyboard_bind ( /* right */ "meta2-C", "right");
gui_keyboard_bind ( /* up */ "meta2-A", "up");
gui_keyboard_bind ( /* ^up */ "meta-Oa", "up_global");
gui_keyboard_bind ( /* down */ "meta2-B", "down");
gui_keyboard_bind ( /* ^down */ "meta-Ob", "down_global");
gui_keyboard_bind ( /* pgup */ "meta2-5~", "page_up");
gui_keyboard_bind ( /* pgdn */ "meta2-6~", "page_down");
gui_keyboard_bind ( /* m-pgup */ "meta-meta2-5~", "scroll_up");
gui_keyboard_bind ( /* m-pgdn */ "meta-meta2-6~", "scroll_down");
gui_keyboard_bind ( /* m-home */ "meta-meta2-1~", "scroll_top");
gui_keyboard_bind ( /* m-end */ "meta-meta2-4~", "scroll_bottom");
gui_keyboard_bind ( /* F10 */ "meta2-21~", "infobar_clear");
gui_keyboard_bind ( /* F11 */ "meta2-23~", "nick_page_up");
gui_keyboard_bind ( /* F12 */ "meta2-24~", "nick_page_down");
gui_keyboard_bind ( /* m-F11 */ "meta-meta2-23~", "nick_beginning");
gui_keyboard_bind ( /* m-F12 */ "meta-meta2-24~", "nick_end");
gui_keyboard_bind ( /* ^L */ "ctrl-L", "refresh");
gui_keyboard_bind ( /* m-a */ "meta-a", "jump_smart");
gui_keyboard_bind ( /* m-b */ "meta-b", "previous_word");
gui_keyboard_bind ( /* ^left */ "meta-Od", "previous_word");
gui_keyboard_bind ( /* m-d */ "meta-d", "delete_next_word");
gui_keyboard_bind ( /* m-f */ "meta-f", "next_word");
gui_keyboard_bind ( /* ^right */ "meta-Oc", "next_word");
gui_keyboard_bind ( /* m-h */ "meta-h", "hotlist_clear");
gui_keyboard_bind ( /* m-j,m-d */ "meta-jmeta-d", "jump_dcc");
gui_keyboard_bind ( /* m-j,m-l */ "meta-jmeta-l", "jump_last_buffer");
gui_keyboard_bind ( /* m-j,m-s */ "meta-jmeta-s", "jump_server");
gui_keyboard_bind ( /* m-j,m-x */ "meta-jmeta-x", "jump_next_server");
gui_keyboard_bind ( /* m-j,m-r */ "meta-jmeta-r", "jump_raw_data");
gui_keyboard_bind ( /* m-k */ "meta-k", "grab_key");
gui_keyboard_bind ( /* m-n */ "meta-n", "scroll_next_highlight");
gui_keyboard_bind ( /* m-p */ "meta-p", "scroll_previous_highlight");
gui_keyboard_bind ( /* m-r */ "meta-r", "delete_line");
gui_keyboard_bind ( /* m-s */ "meta-s", "switch_server");
gui_keyboard_bind ( /* m-u */ "meta-u", "scroll_unread");
/* keys bound with commands */
gui_keyboard_bind ( /* m-left */ "meta-meta2-D", "/buffer -1");
gui_keyboard_bind ( /* F5 */ "meta2-15~", "/buffer -1");
gui_keyboard_bind ( /* m-right */ "meta-meta2-C", "/buffer +1");
gui_keyboard_bind ( /* F6 */ "meta2-17~", "/buffer +1");
gui_keyboard_bind ( /* F7 */ "meta2-18~", "/window -1");
gui_keyboard_bind ( /* F8 */ "meta2-19~", "/window +1");
gui_keyboard_bind ( /* m-w,m-up */ "meta-wmeta-meta2-A", "/window up");
gui_keyboard_bind ( /* m-w,m-down */ "meta-wmeta-meta2-B", "/window down");
gui_keyboard_bind ( /* m-w,m-left */ "meta-wmeta-meta2-D", "/window left");
gui_keyboard_bind ( /* m-w,m-right */ "meta-wmeta-meta2-C", "/window right");
gui_keyboard_bind ( /* m-0 */ "meta-0", "/buffer 10");
gui_keyboard_bind ( /* m-1 */ "meta-1", "/buffer 1");
gui_keyboard_bind ( /* m-2 */ "meta-2", "/buffer 2");
gui_keyboard_bind ( /* m-3 */ "meta-3", "/buffer 3");
gui_keyboard_bind ( /* m-4 */ "meta-4", "/buffer 4");
gui_keyboard_bind ( /* m-5 */ "meta-5", "/buffer 5");
gui_keyboard_bind ( /* m-6 */ "meta-6", "/buffer 6");
gui_keyboard_bind ( /* m-7 */ "meta-7", "/buffer 7");
gui_keyboard_bind ( /* m-8 */ "meta-8", "/buffer 8");
gui_keyboard_bind ( /* m-9 */ "meta-9", "/buffer 9");
/* bind meta-j + {01..99} to switch to buffers # > 10 */
for (i = 1; i < 100; i++)
{
sprintf (key_str, "meta-j%02d", i);
sprintf (command, "/buffer %d", i);
gui_keyboard_bind (key_str, command);
}
}
/*
* gui_keyboard_grab_end: insert grabbed key in input buffer
*/
void
gui_keyboard_grab_end ()
{
char *expanded_key;
char *buffer_before_key;
#ifdef PLUGINS
char *expanded_key2;
int length;
#endif
/* get expanded name (for example: ^U => ctrl-u) */
expanded_key = gui_keyboard_get_expanded_name (gui_key_buffer);
if (expanded_key)
{
if (gui_current_window->buffer->has_input)
{
buffer_before_key =
(gui_current_window->buffer->input_buffer) ?
strdup (gui_current_window->buffer->input_buffer) : strdup ("");
gui_insert_string_input (gui_current_window, expanded_key, -1);
gui_current_window->buffer->input_buffer_pos += utf8_strlen (expanded_key);
gui_input_draw (gui_current_window->buffer, 1);
gui_current_window->buffer->completion.position = -1;
#ifdef PLUGINS
length = strlen (expanded_key) + 1 + 1;
expanded_key2 = (char *) malloc (length);
if (expanded_key2)
{
snprintf (expanded_key2, length, "*%s", expanded_key);
(void) plugin_keyboard_handler_exec (expanded_key2,
buffer_before_key,
gui_current_window->buffer->input_buffer);
free (expanded_key2);
}
#endif
if (buffer_before_key)
free (buffer_before_key);
}
free (expanded_key);
}
/* end grab mode */
gui_key_grab = 0;
gui_key_grab_count = 0;
gui_key_buffer[0] = '\0';
}
/*
* gui_keyboard_read: read keyboard chars
*/
void
gui_keyboard_read ()
{
int key, i, insert_ok;
char key_str[32];
char *buffer_before_key;
#ifdef PLUGINS
char key_str2[33];
#endif
i = 0;
/* do not loop too much here (for example when big paste was made),
to read also socket & co */
while (i < 8)
{
if (gui_key_grab && (gui_key_grab_count > 10))
gui_keyboard_grab_end ();
key = getch ();
insert_ok = 1;
if (key == ERR)
{
if (gui_key_grab && (gui_key_grab_count > 0))
gui_keyboard_grab_end ();
break;
}
#ifdef KEY_RESIZE
if (key == KEY_RESIZE)
continue;
#endif
gui_last_activity_time = time (NULL);
if (key < 32)
{
insert_ok = 0;
key_str[0] = '^';
key_str[1] = (char) key + '@';
key_str[2] = '\0';
}
else if (key == 127)
{
key_str[0] = '^';
key_str[1] = '?';
key_str[2] = '\0';
}
else
{
if (local_utf8)
{
/* 1 char: 0vvvvvvv */
if (key < 0x80)
{
key_str[0] = (char) key;
key_str[1] = '\0';
}
/* 2 chars: 110vvvvv 10vvvvvv */
else if ((key & 0xE0) == 0xC0)
{
key_str[0] = (char) key;
key_str[1] = (char) (getch ());
key_str[2] = '\0';
}
/* 3 chars: 1110vvvv 10vvvvvv 10vvvvvv */
else if ((key & 0xF0) == 0xE0)
{
key_str[0] = (char) key;
key_str[1] = (char) (getch ());
key_str[2] = (char) (getch ());
key_str[3] = '\0';
}
/* 4 chars: 11110vvv 10vvvvvv 10vvvvvv 10vvvvvv */
else if ((key & 0xF8) == 0xF0)
{
key_str[0] = (char) key;
key_str[1] = (char) (getch ());
key_str[2] = (char) (getch ());
key_str[3] = (char) (getch ());
key_str[4] = '\0';
}
}
else
{
key_str[0] = (char) key;
key_str[1] = '\0';
}
}
if (strcmp (key_str, "^") == 0)
{
key_str[1] = '^';
key_str[2] = '\0';
}
/*gui_printf (gui_current_window->buffer, "gui_input_read: key = %s (%d)\n", key_str, key);*/
if ((gui_keyboard_pressed (key_str) != 0) && (insert_ok))
{
if (strcmp (key_str, "^^") == 0)
key_str[1] = '\0';
switch (gui_current_window->buffer->type)
{
case BUFFER_TYPE_STANDARD:
buffer_before_key =
(gui_current_window->buffer->input_buffer) ?
strdup (gui_current_window->buffer->input_buffer) : strdup ("");
gui_insert_string_input (gui_current_window, key_str, -1);
gui_current_window->buffer->input_buffer_pos += utf8_strlen (key_str);
gui_input_draw (gui_current_window->buffer, 0);
gui_current_window->buffer->completion.position = -1;
#ifdef PLUGINS
snprintf (key_str2, sizeof (key_str2), "*%s", key_str);
(void) plugin_keyboard_handler_exec (key_str2,
buffer_before_key,
gui_current_window->buffer->input_buffer);
#endif
break;
case BUFFER_TYPE_DCC:
gui_exec_action_dcc (gui_current_window, key_str);
break;
case BUFFER_TYPE_RAW_DATA:
gui_exec_action_raw_data (gui_current_window, key_str);
break;
}
}
i++;
}
}
+355
View File
@@ -0,0 +1,355 @@
/*
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* gui-curses-main.c: main loop for Curses GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include "../../common/weechat.h"
#include "../gui.h"
#include "../../common/fifo.h"
#include "../../common/utf8.h"
#include "../../common/util.h"
#include "../../common/weeconfig.h"
#include "gui-curses.h"
#ifdef PLUGINS
#include "../../plugins/plugins.h"
#endif
/*
* gui_main_loop: main loop for WeeChat with ncurses GUI
*/
void
gui_main_loop ()
{
fd_set read_fd;
static struct timeval timeout, tv;
static struct timezone tz;
t_irc_server *ptr_server;
t_gui_buffer *ptr_buffer;
int old_day, old_min, old_sec, diff;
char text_time[1024];
time_t new_time;
struct tm *local_time;
quit_weechat = 0;
new_time = time (NULL);
gui_last_activity_time = new_time;
local_time = localtime (&new_time);
old_day = local_time->tm_mday;
old_min = -1;
old_sec = -1;
check_away = 0;
while (!quit_weechat)
{
/* refresh needed ? */
if (gui_refresh_screen_needed)
gui_window_refresh_screen (0);
new_time = time (NULL);
local_time = localtime (&new_time);
/* minute has changed ? => redraw infobar */
if (local_time->tm_min != old_min)
{
old_min = local_time->tm_min;
gui_infobar_draw (gui_current_window->buffer, 1);
if (cfg_look_day_change
&& (local_time->tm_mday != old_day))
{
strftime (text_time, sizeof (text_time),
cfg_look_day_change_timestamp, local_time);
gui_add_hotlist = 0;
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
{
if (ptr_buffer->type == BUFFER_TYPE_STANDARD)
gui_printf_nolog_notime (ptr_buffer,
_("Day changed to %s\n"),
text_time);
}
gui_add_hotlist = 1;
}
old_day = local_time->tm_mday;
}
/* second has changed ? */
if (local_time->tm_sec != old_sec)
{
old_sec = local_time->tm_sec;
if (cfg_look_infobar_seconds)
{
gui_infobar_draw_time (gui_current_window->buffer);
wmove (GUI_CURSES(gui_current_window)->win_input,
0, gui_current_window->win_input_cursor_x);
wrefresh (GUI_CURSES(gui_current_window)->win_input);
}
/* infobar count down */
if (gui_infobar && gui_infobar->remaining_time > 0)
{
gui_infobar->remaining_time--;
if (gui_infobar->remaining_time == 0)
{
gui_infobar_remove ();
gui_infobar_draw (gui_current_window->buffer, 1);
}
}
/* away check */
if (cfg_irc_away_check != 0)
{
check_away++;
if (check_away >= (cfg_irc_away_check * 60))
{
check_away = 0;
server_check_away ();
}
}
#ifdef PLUGINS
/* call timer handlers */
plugin_timer_handler_exec ();
#endif
}
/* read keyboard */
/* on GNU/Hurd 2 select() are causing troubles with keyboard */
/* waiting for a fix, we use only one select() */
#ifndef __GNU__
FD_ZERO (&read_fd);
timeout.tv_sec = 0;
timeout.tv_usec = 8000;
FD_SET (STDIN_FILENO, &read_fd);
if (select (FD_SETSIZE, &read_fd, NULL, NULL, &timeout) > 0)
{
if (FD_ISSET (STDIN_FILENO, &read_fd))
{
gui_keyboard_read ();
}
}
#endif
/* read sockets (servers, child process when connecting, FIFO pipe) */
FD_ZERO (&read_fd);
#ifdef __GNU__
timeout.tv_sec = 0;
timeout.tv_usec = 10000;
FD_SET (STDIN_FILENO, &read_fd);
#else
timeout.tv_sec = 0;
timeout.tv_usec = 2000;
#endif
if (weechat_fifo != -1)
FD_SET (weechat_fifo, &read_fd);
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
/* check if reconnection is pending */
if ((!ptr_server->is_connected)
&& (ptr_server->reconnect_start > 0)
&& (new_time >= (ptr_server->reconnect_start + ptr_server->autoreconnect_delay)))
server_reconnect (ptr_server);
else
{
if (ptr_server->is_connected)
{
/* check for lag */
if ((ptr_server->lag_check_time.tv_sec == 0)
&& (new_time >= ptr_server->lag_next_check))
{
server_sendf (ptr_server, "PING %s\r\n", ptr_server->address);
gettimeofday (&(ptr_server->lag_check_time), &tz);
}
/* lag timeout => disconnect */
if ((ptr_server->lag_check_time.tv_sec != 0)
&& (cfg_irc_lag_disconnect > 0))
{
gettimeofday (&tv, &tz);
diff = (int) get_timeval_diff (&(ptr_server->lag_check_time), &tv);
if (diff / 1000 > cfg_irc_lag_disconnect * 60)
{
irc_display_prefix (ptr_server, ptr_server->buffer, PREFIX_ERROR);
gui_printf (ptr_server->buffer,
_("%s lag is high, disconnecting from server...\n"),
WEECHAT_WARNING);
server_disconnect (ptr_server, 1);
continue;
}
}
}
if (!ptr_server->is_connected && (ptr_server->child_pid > 0))
FD_SET (ptr_server->child_read, &read_fd);
else
{
if (ptr_server->sock >= 0)
FD_SET (ptr_server->sock, &read_fd);
}
}
}
if (select (FD_SETSIZE, &read_fd, NULL, NULL, &timeout) > 0)
{
#ifdef __GNU__
if (FD_ISSET (STDIN_FILENO, &read_fd))
{
gui_keyboard_read ();
}
#endif
if ((weechat_fifo != -1) && (FD_ISSET (weechat_fifo, &read_fd)))
{
fifo_read ();
}
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
if (!ptr_server->is_connected && (ptr_server->child_pid > 0))
{
if (FD_ISSET (ptr_server->child_read, &read_fd))
server_child_read (ptr_server);
}
else
{
if ((ptr_server->sock >= 0) &&
(FD_ISSET (ptr_server->sock, &read_fd)))
server_recv (ptr_server);
}
}
}
/* manages active DCC */
dcc_handle ();
}
}
/*
* gui_main_pre_init: pre-initialize GUI (called before gui_init)
*/
void
gui_main_pre_init (int *argc, char **argv[])
{
/* nothing for Curses interface */
(void) argc;
(void) argv;
}
/*
* gui_main_init: init GUI
*/
void
gui_main_init ()
{
initscr ();
curs_set (1);
noecho ();
nodelay (stdscr, TRUE);
gui_color_init ();
gui_infobar = NULL;
gui_ok = ((COLS > WINDOW_MIN_WIDTH) && (LINES > WINDOW_MIN_HEIGHT));
refresh ();
/* init clipboard buffer */
gui_input_clipboard = NULL;
/* create new window/buffer */
if (gui_window_new (NULL, 0, 0, COLS, LINES, 100, 100))
{
gui_current_window = gui_windows;
gui_buffer_new (gui_windows, NULL, NULL, BUFFER_TYPE_STANDARD, 1);
if (cfg_look_set_title)
gui_window_set_title ();
gui_init_ok = 1;
signal (SIGWINCH, gui_window_refresh_screen_sigwinch);
}
}
/*
* gui_main_end: GUI end
*/
void
gui_main_end ()
{
/* free clipboard buffer */
if (gui_input_clipboard)
free (gui_input_clipboard);
/* delete all panels */
while (gui_panels)
gui_panel_free (gui_panels);
/* delete all windows */
while (gui_windows)
gui_window_free (gui_windows);
gui_window_tree_free (&gui_windows_tree);
/* delete all buffers */
while (gui_buffers)
gui_buffer_free (gui_buffers, 0);
/* delete global history */
history_global_free ();
/* delete infobar messages */
while (gui_infobar)
gui_infobar_remove ();
/* reset title */
if (cfg_look_set_title)
gui_window_reset_title ();
/* end of Curses output */
refresh ();
endwin ();
}
+230
View File
@@ -0,0 +1,230 @@
/*
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* gui-curses-nicklist.c: nicklist display functions for Curses GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "../../common/weechat.h"
#include "../gui.h"
#include "../../common/weeconfig.h"
#include "../../irc/irc.h"
#include "gui-curses.h"
/*
* gui_nicklist_draw: draw nick window for a buffer
*/
void
gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size)
{
t_gui_window *ptr_win;
int i, j, x, y, x2, column, max_length, nicks_displayed;
char format[32], format_empty[32];
t_irc_nick *ptr_nick;
if (!gui_ok || !BUFFER_HAS_NICKLIST(buffer))
return;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if ((ptr_win->buffer == buffer) && (buffer->num_displayed > 0))
{
max_length = nick_get_max_length (CHANNEL(buffer));
if (calculate_size && (gui_window_calculate_pos_size (ptr_win, 0)))
{
delwin (GUI_CURSES(ptr_win)->win_chat);
delwin (GUI_CURSES(ptr_win)->win_nick);
GUI_CURSES(ptr_win)->win_chat = newwin (ptr_win->win_chat_height,
ptr_win->win_chat_width,
ptr_win->win_chat_y,
ptr_win->win_chat_x);
GUI_CURSES(ptr_win)->win_nick = newwin (ptr_win->win_nick_height,
ptr_win->win_nick_width,
ptr_win->win_nick_y,
ptr_win->win_nick_x);
gui_chat_draw (buffer, 1);
erase = 1;
}
if (erase)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK);
snprintf (format_empty, 32, "%%-%ds", ptr_win->win_nick_width);
for (i = 0; i < ptr_win->win_nick_height; i++)
{
mvwprintw (GUI_CURSES(ptr_win)->win_nick, i, 0, format_empty, " ");
}
}
if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ||
(cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM))
snprintf (format, 32, "%%.%ds", max_length);
else
snprintf (format, 32, "%%.%ds",
((cfg_look_nicklist_min_size > 0)
&& (max_length < cfg_look_nicklist_min_size)) ?
cfg_look_nicklist_min_size :
(((cfg_look_nicklist_max_size > 0)
&& (max_length > cfg_look_nicklist_max_size)) ?
cfg_look_nicklist_max_size : max_length));
if (has_colors ())
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_SEP);
switch (cfg_look_nicklist_position)
{
case CFG_LOOK_NICKLIST_LEFT:
mvwvline (GUI_CURSES(ptr_win)->win_nick,
0, ptr_win->win_nick_width - 1, ACS_VLINE,
ptr_win->win_chat_height);
break;
case CFG_LOOK_NICKLIST_RIGHT:
mvwvline (GUI_CURSES(ptr_win)->win_nick,
0, 0, ACS_VLINE,
ptr_win->win_chat_height);
break;
case CFG_LOOK_NICKLIST_TOP:
mvwhline (GUI_CURSES(ptr_win)->win_nick,
ptr_win->win_nick_height - 1, 0, ACS_HLINE,
ptr_win->win_chat_width);
break;
case CFG_LOOK_NICKLIST_BOTTOM:
mvwhline (GUI_CURSES(ptr_win)->win_nick,
0, 0, ACS_HLINE,
ptr_win->win_chat_width);
break;
}
}
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK);
x = 0;
y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0;
column = 0;
if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ||
(cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM))
nicks_displayed = (ptr_win->win_width / (max_length + 2)) * (ptr_win->win_nick_height - 1);
else
nicks_displayed = ptr_win->win_nick_height;
ptr_nick = CHANNEL(buffer)->nicks;
for (i = 0; i < ptr_win->win_nick_start; i++)
{
if (!ptr_nick)
break;
ptr_nick = ptr_nick->next_nick;
}
if (ptr_nick)
{
for (i = 0; i < nicks_displayed; i++)
{
switch (cfg_look_nicklist_position)
{
case CFG_LOOK_NICKLIST_LEFT:
x = 0;
break;
case CFG_LOOK_NICKLIST_RIGHT:
x = 1;
break;
case CFG_LOOK_NICKLIST_TOP:
case CFG_LOOK_NICKLIST_BOTTOM:
x = column;
break;
}
if ( ((i == 0) && (ptr_win->win_nick_start > 0))
|| ((i == nicks_displayed - 1) && (ptr_nick->next_nick)) )
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_MORE);
j = (max_length + 1) >= 4 ? 4 : max_length + 1;
for (x2 = 1; x2 <= j; x2++)
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x + x2, "+");
}
else
{
if (ptr_nick->flags & NICK_CHANOWNER)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_CHANOWNER);
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, "~");
x++;
}
else if (ptr_nick->flags & NICK_CHANADMIN)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_CHANADMIN);
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, "&");
x++;
}
else if (ptr_nick->flags & NICK_OP)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_OP);
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, "@");
x++;
}
else if (ptr_nick->flags & NICK_HALFOP)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_HALFOP);
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, "%%");
x++;
}
else if (ptr_nick->flags & NICK_VOICE)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_VOICE);
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, "+");
x++;
}
else
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK);
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, " ");
x++;
}
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick,
((cfg_irc_away_check > 0) && (ptr_nick->flags & NICK_AWAY)) ?
COLOR_WIN_NICK_AWAY : COLOR_WIN_NICK);
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, format, ptr_nick->nick);
ptr_nick = ptr_nick->next_nick;
if (!ptr_nick)
break;
}
y++;
if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ||
(cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM))
{
if (y - ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0) >= ptr_win->win_nick_height - 1)
{
column += max_length + 2;
y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ?
0 : 1;
}
}
}
}
wnoutrefresh (GUI_CURSES(ptr_win)->win_nick);
refresh ();
}
}
}
+217
View File
@@ -0,0 +1,217 @@
/*
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* gui-curses-panel.c: panel functions for Curses GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "../../common/weechat.h"
#include "../gui.h"
#include "../../irc/irc.h"
#include "gui-curses.h"
/*
* gui_panel_windows_get_size: get total panel size (window panels) for a position
* panel is optional, if not NULL, size is computed
* from panel 1 to panel # - 1
*/
int
gui_panel_window_get_size (t_gui_panel *panel, t_gui_window *window, int position)
{
t_gui_panel_window *ptr_panel_win;
int total_size;
total_size = 0;
for (ptr_panel_win = GUI_CURSES(window)->panel_windows; ptr_panel_win;
ptr_panel_win = ptr_panel_win->next_panel_window)
{
/* stop before panel */
if ((panel) && (ptr_panel_win->panel == panel))
return total_size;
if (ptr_panel_win->panel->position == position)
{
switch (position)
{
case GUI_PANEL_TOP:
case GUI_PANEL_BOTTOM:
total_size += ptr_panel_win->height;
break;
case GUI_PANEL_LEFT:
case GUI_PANEL_RIGHT:
total_size += ptr_panel_win->width;
break;
}
if (ptr_panel_win->panel->separator)
total_size++;
}
}
return total_size;
}
/*
* gui_panel_window_new: create a new "window panel" for a panel, in screen or a window
* if window is not NULL, panel window will be in this window
*/
int
gui_panel_window_new (t_gui_panel *panel, t_gui_window *window)
{
t_gui_panel_window *new_panel_win;
int x1, y1, x2, y2;
int add_top, add_bottom, add_left, add_right;
if (window)
{
x1 = window->win_x;
y1 = window->win_y + 1;
x2 = x1 + window->win_width - 1;
y2 = y1 + window->win_height - 1 - 4;
add_left = gui_panel_window_get_size (panel, window, GUI_PANEL_LEFT);
add_right = gui_panel_window_get_size (panel, window, GUI_PANEL_RIGHT);
add_top = gui_panel_window_get_size (panel, window, GUI_PANEL_TOP);
add_bottom = gui_panel_window_get_size (panel, window, GUI_PANEL_BOTTOM);
}
else
{
x1 = 0;
y1 = 0;
x2 = gui_window_get_width () - 1;
y2 = gui_window_get_height () - 1;
add_left = gui_panel_global_get_size (panel, GUI_PANEL_LEFT);
add_right = gui_panel_global_get_size (panel, GUI_PANEL_RIGHT);
add_top = gui_panel_global_get_size (panel, GUI_PANEL_TOP);
add_bottom = gui_panel_global_get_size (panel, GUI_PANEL_BOTTOM);
}
if ((new_panel_win = (t_gui_panel_window *) malloc (sizeof (t_gui_panel_window))))
{
new_panel_win->panel = panel;
if (window)
{
panel->panel_window = NULL;
new_panel_win->next_panel_window = GUI_CURSES(window)->panel_windows;
GUI_CURSES(window)->panel_windows = new_panel_win;
}
else
{
panel->panel_window = new_panel_win;
new_panel_win->next_panel_window = NULL;
}
switch (panel->position)
{
case GUI_PANEL_TOP:
new_panel_win->x = x1 + add_left;
new_panel_win->y = y1 + add_top;
new_panel_win->width = x2 - x1 + 1;
new_panel_win->height = panel->size;
break;
case GUI_PANEL_BOTTOM:
new_panel_win->x = x1;
new_panel_win->y = y2 - panel->size + 1;
new_panel_win->width = x2 - x1 + 1;
new_panel_win->height = panel->size;
break;
case GUI_PANEL_LEFT:
new_panel_win->x = x1;
new_panel_win->y = y1;
new_panel_win->width = panel->size;
new_panel_win->height = y2 - y1 + 1;
break;
case GUI_PANEL_RIGHT:
new_panel_win->x = x2 - panel->size + 1;
new_panel_win->y = y1;
new_panel_win->width = panel->size;
new_panel_win->height = y2 - y1 + 1;
break;
}
new_panel_win->win_panel = newwin (new_panel_win->height,
new_panel_win->width,
new_panel_win->y,
new_panel_win->x);
new_panel_win->win_separator = NULL;
if (new_panel_win->panel->separator)
{
switch (panel->position)
{
case GUI_PANEL_LEFT:
new_panel_win->win_separator = newwin (new_panel_win->height,
1,
new_panel_win->y,
new_panel_win->x + new_panel_win->width);
break;
}
}
return 1;
}
else
return 0;
}
/*
* gui_panel_window_free: delete a panel window
*/
void
gui_panel_window_free (void *panel_win)
{
t_gui_panel_window *ptr_panel_win;
ptr_panel_win = (t_gui_panel_window *)panel_win;
free (ptr_panel_win);
}
/*
* gui_panel_redraw_buffer: redraw panels for windows displaying a buffer
*/
void
gui_panel_redraw_buffer (t_gui_buffer *buffer)
{
t_gui_window *ptr_win;
t_gui_panel_window *ptr_panel_win;
if (!gui_ok)
return;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if ((ptr_win->buffer == buffer) && (buffer->num_displayed > 0))
{
for (ptr_panel_win = GUI_CURSES(ptr_win)->panel_windows;
ptr_panel_win;
ptr_panel_win = ptr_panel_win->next_panel_window)
{
switch (ptr_panel_win->panel->position)
{
case GUI_PANEL_LEFT:
break;
}
}
}
}
}
+377
View File
@@ -0,0 +1,377 @@
/*
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* gui-curses-status.c: status display functions for Curses GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include "../../common/weechat.h"
#include "../gui.h"
#include "../../common/hotlist.h"
#include "../../common/weeconfig.h"
#include "gui-curses.h"
/*
* gui_status_draw: draw status window for a buffer
*/
void
gui_status_draw (t_gui_buffer *buffer, int erase)
{
t_gui_window *ptr_win;
t_weechat_hotlist *ptr_hotlist;
char format[32], str_nicks[32], *more;
int x, server_pos, server_total;
int display_name, names_count;
/* make gcc happy */
(void) buffer;
if (!gui_ok)
return;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (erase)
gui_window_curses_clear (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
/* display number of buffers */
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
mvwprintw (GUI_CURSES(ptr_win)->win_status, 0, 0, "[");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
(last_gui_buffer) ? last_gui_buffer->number : 0);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "] ");
/* display "<servers>" or current server */
if (ptr_win->buffer->all_servers)
{
wprintw (GUI_CURSES(ptr_win)->win_status, "[");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, _("<servers>"));
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "] ");
}
else if (SERVER(ptr_win->buffer) && SERVER(ptr_win->buffer)->name)
{
wprintw (GUI_CURSES(ptr_win)->win_status, "[");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, "%s", SERVER(ptr_win->buffer)->name);
if (SERVER(ptr_win->buffer)->is_away)
wprintw (GUI_CURSES(ptr_win)->win_status, _("(away)"));
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "] ");
}
/* infos about current server buffer */
if (SERVER(ptr_win->buffer) && !CHANNEL(ptr_win->buffer))
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
ptr_win->buffer->number);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_CHANNEL);
if (SERVER(ptr_win->buffer)->is_connected)
wprintw (GUI_CURSES(ptr_win)->win_status, "[%s] ",
SERVER(ptr_win->buffer)->name);
else
wprintw (GUI_CURSES(ptr_win)->win_status, "(%s) ",
SERVER(ptr_win->buffer)->name);
if (ptr_win->buffer->all_servers)
{
server_get_number_buffer (SERVER(ptr_win->buffer),
&server_pos,
&server_total);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "(");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, "%d", server_pos);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "/");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, "%d", server_total);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, ") ");
}
}
/* infos about current channel/pv buffer */
if (SERVER(ptr_win->buffer) && CHANNEL(ptr_win->buffer))
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
ptr_win->buffer->number);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_CHANNEL);
if (((CHANNEL(ptr_win->buffer)->type == CHANNEL_TYPE_CHANNEL)
&& (!CHANNEL(ptr_win->buffer)->nicks))
|| ((CHANNEL(ptr_win->buffer)->type == CHANNEL_TYPE_DCC_CHAT)
&& (CHANNEL(ptr_win->buffer)->dcc_chat)
&& (((t_irc_dcc *)(CHANNEL(ptr_win->buffer)->dcc_chat))->sock < 0)))
wprintw (GUI_CURSES(ptr_win)->win_status, "(%s)",
CHANNEL(ptr_win->buffer)->name);
else
wprintw (GUI_CURSES(ptr_win)->win_status, "%s",
CHANNEL(ptr_win->buffer)->name);
if (ptr_win->buffer == CHANNEL(ptr_win->buffer)->buffer)
{
/* display channel modes */
if (CHANNEL(ptr_win->buffer)->type == CHANNEL_TYPE_CHANNEL)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "(");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS);
if (CHANNEL(ptr_win->buffer)->modes
&& (strcmp (CHANNEL(ptr_win->buffer)->modes, "+") != 0))
wprintw (GUI_CURSES(ptr_win)->win_status, "%s",
CHANNEL(ptr_win->buffer)->modes);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, ")");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS);
}
/* display DCC if private is DCC CHAT */
if (CHANNEL(ptr_win->buffer)->type == CHANNEL_TYPE_DCC_CHAT)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "(");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_CHANNEL);
wprintw (GUI_CURSES(ptr_win)->win_status, "DCC");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, ")");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS);
}
}
wprintw (GUI_CURSES(ptr_win)->win_status, " ");
}
if (!SERVER(ptr_win->buffer))
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
ptr_win->buffer->number);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS_CHANNEL);
switch (ptr_win->buffer->type)
{
case BUFFER_TYPE_STANDARD:
wprintw (GUI_CURSES(ptr_win)->win_status, _("[not connected] "));
break;
case BUFFER_TYPE_DCC:
wprintw (GUI_CURSES(ptr_win)->win_status, "<DCC> ");
break;
case BUFFER_TYPE_RAW_DATA:
wprintw (GUI_CURSES(ptr_win)->win_status, _("<RAW_IRC> "));
break;
}
}
/* display list of other active windows (if any) with numbers */
if (hotlist)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "[");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, _("Act: "));
names_count = 0;
for (ptr_hotlist = hotlist; ptr_hotlist;
ptr_hotlist = ptr_hotlist->next_hotlist)
{
switch (ptr_hotlist->priority)
{
case HOTLIST_LOW:
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DATA_OTHER);
display_name = ((cfg_look_hotlist_names_level & 1) != 0);
break;
case HOTLIST_MSG:
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DATA_MSG);
display_name = ((cfg_look_hotlist_names_level & 2) != 0);
break;
case HOTLIST_PRIVATE:
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DATA_PRIVATE);
display_name = ((cfg_look_hotlist_names_level & 4) != 0);
break;
case HOTLIST_HIGHLIGHT:
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DATA_HIGHLIGHT);
display_name = ((cfg_look_hotlist_names_level & 8) != 0);
break;
default:
display_name = 0;
break;
}
switch (ptr_hotlist->buffer->type)
{
case BUFFER_TYPE_STANDARD:
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
ptr_hotlist->buffer->number);
if (display_name && (cfg_look_hotlist_names_count != 0)
&& (names_count < cfg_look_hotlist_names_count))
{
names_count++;
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS);
if (cfg_look_hotlist_names_length == 0)
snprintf (format, sizeof (format) - 1, "%%s");
else
snprintf (format, sizeof (format) - 1, "%%.%ds", cfg_look_hotlist_names_length);
if (BUFFER_IS_SERVER(ptr_hotlist->buffer))
wprintw (GUI_CURSES(ptr_win)->win_status, format,
(ptr_hotlist->server) ?
ptr_hotlist->server->name :
SERVER(ptr_hotlist->buffer)->name);
else if (BUFFER_IS_CHANNEL(ptr_hotlist->buffer)
|| BUFFER_IS_PRIVATE(ptr_hotlist->buffer))
wprintw (GUI_CURSES(ptr_win)->win_status, format, CHANNEL(ptr_hotlist->buffer)->name);
}
break;
case BUFFER_TYPE_DCC:
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
ptr_hotlist->buffer->number);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, "DCC");
break;
case BUFFER_TYPE_RAW_DATA:
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
ptr_hotlist->buffer->number);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, _("RAW_IRC"));
break;
}
if (ptr_hotlist->next_hotlist)
wprintw (GUI_CURSES(ptr_win)->win_status, ",");
}
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "] ");
}
/* display lag */
if (SERVER(ptr_win->buffer))
{
if (SERVER(ptr_win->buffer)->lag / 1000 >= cfg_irc_lag_min_show)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "[");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, _("Lag: %.1f"),
((float)(SERVER(ptr_win->buffer)->lag)) / 1000);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "]");
}
}
/* display "-MORE-" (if last line is not displayed) & nicks count */
if (BUFFER_HAS_NICKLIST(ptr_win->buffer))
{
snprintf (str_nicks, sizeof (str_nicks) - 1, "%d", CHANNEL(ptr_win->buffer)->nicks_count);
x = ptr_win->win_status_width - strlen (str_nicks) - 4;
}
else
x = ptr_win->win_status_width - 2;
more = strdup (_("-MORE-"));
x -= strlen (more) - 1;
if (x < 0)
x = 0;
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS_MORE);
if (ptr_win->scroll)
mvwprintw (GUI_CURSES(ptr_win)->win_status, 0, x, "%s", more);
else
{
snprintf (format, sizeof (format) - 1, "%%-%ds", (int)(strlen (more)));
mvwprintw (GUI_CURSES(ptr_win)->win_status, 0, x, format, " ");
}
if (BUFFER_HAS_NICKLIST(ptr_win->buffer))
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, " [");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, "%s", str_nicks);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "]");
}
free (more);
wnoutrefresh (GUI_CURSES(ptr_win)->win_status);
refresh ();
}
}
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More