Added #include "config.h" with #ifdef HAVE_CONFIG_H

This commit is contained in:
Sebastien Helleu 2003-10-26 13:21:07 +00:00
parent cafd93dcdd
commit 65c9a79603
48 changed files with 2942 additions and 122 deletions

View File

@ -19,10 +19,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT(WeeChat, 0.0.3, flashcode@flashtux.org)
AC_INIT(WeeChat, 0.0.3-pre3, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/common/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.0.3])
AM_INIT_AUTOMAKE([weechat], [0.0.3-pre3])
# Checks for programs.
AC_PROG_CC

View File

@ -18,7 +18,12 @@
noinst_LIBRARIES = lib_weechat_main.a
lib_weechat_main_a_SOURCES = weechat.c \
weechat.h \
command.c \
command.h \
completion.c \
config.c \
history.c
completion.h \
weeconfig.c \
weeconfig.h \
history.c \
history.h

View File

@ -19,16 +19,19 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* command.c: WeeChat internal commands */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include "weechat.h"
#include "command.h"
#include "config.h"
#include "weeconfig.h"
#include "../irc/irc.h"
#include "../gui/gui.h"
@ -528,7 +531,7 @@ exec_weechat_command (t_irc_server *server, char *string)
gui_printf (NULL,
_("%s wrong argument count for %s command \"%s\" "
"(expected: %d arg%s)\n"),
WEECHAT_ERROR, WEECHAT_NAME,
WEECHAT_ERROR, PACKAGE_NAME,
command + 1,
weechat_commands[i].max_arg,
(weechat_commands[i].max_arg >
@ -537,7 +540,7 @@ exec_weechat_command (t_irc_server *server, char *string)
gui_printf (NULL,
_("%s wrong argument count for %s command \"%s\" "
"(expected: between %d and %d arg%s)\n"),
WEECHAT_ERROR, WEECHAT_NAME,
WEECHAT_ERROR, PACKAGE_NAME,
command + 1,
weechat_commands[i].min_arg,
weechat_commands[i].max_arg,
@ -555,7 +558,7 @@ exec_weechat_command (t_irc_server *server, char *string)
if (return_code < 0)
gui_printf (NULL,
_("%s %s command \"%s\" failed\n"),
WEECHAT_ERROR, WEECHAT_NAME, command + 1);
WEECHAT_ERROR, PACKAGE_NAME, command + 1);
}
if (argv)
{
@ -906,7 +909,7 @@ weechat_cmd_help (int argc, char **argv)
if (argc == 0)
{
gui_printf (NULL,
_("> List of %s internal commands:\n"), WEECHAT_NAME);
_("> List of %s internal commands:\n"), PACKAGE_NAME);
for (i = 0; weechat_commands[i].command_name; i++)
gui_printf (NULL, " %s - %s\n",
weechat_commands[i].command_name,
@ -927,7 +930,7 @@ weechat_cmd_help (int argc, char **argv)
gui_printf
(NULL,
_("> Help on %s internal command \"%s\":\n"),
WEECHAT_NAME, weechat_commands[i].command_name);
PACKAGE_NAME, weechat_commands[i].command_name);
gui_printf (NULL,
_("Syntax: /%s %s\n"),
weechat_commands[i].command_name,

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* completion.c: completes words according to context (cmd/nick) */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* history.c: memorize and call again commands or text */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>

View File

@ -36,10 +36,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* weechat.c: core functions for WeeChat */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
@ -49,7 +52,7 @@
#include <time.h>
#include "weechat.h"
#include "config.h"
#include "weeconfig.h"
#include "command.h"
#include "../irc/irc.h"
#include "../gui/gui.h"
@ -128,7 +131,7 @@ wee_parse_args (int argc, char *argv[])
else if ((strcmp (argv[i], "-v") == 0)
|| (strcmp (argv[i], "--version") == 0))
{
printf (WEECHAT_VERSION "\n");
printf (PACKAGE_VERSION "\n");
exit (0);
}
else
@ -280,14 +283,14 @@ main (int argc, char *argv[])
{
gui_printf_color (NULL, COLOR_WIN_CHAT, _("%sWelcome to "),
(cfg_look_startup_logo) ? " " : "");
gui_printf_color (NULL, COLOR_WIN_CHAT_PREFIX2, WEECHAT_NAME);
gui_printf_color (NULL, COLOR_WIN_CHAT_PREFIX2, PACKAGE_NAME);
gui_printf_color (NULL, COLOR_WIN_CHAT,
", %s\n", cfg_look_weechat_slogan);
}
if (cfg_look_startup_version)
{
gui_printf_color (NULL, COLOR_WIN_CHAT_PREFIX2,
"%s" WEECHAT_NAME_AND_VERSION,
"%s" PACKAGE_STRING,
(cfg_look_startup_logo) ? " " : "");
gui_printf_color (NULL, COLOR_WIN_CHAT,
", %s %s %s\n",

View File

@ -31,15 +31,11 @@
#define _(string) gettext(string)
#define N_(string) (string)
#define WEECHAT_NAME "WeeChat"
#define WEECHAT_VERSION "0.0.3-pre2"
#define WEECHAT_NAME_AND_VERSION WEECHAT_NAME " " WEECHAT_VERSION
#define WEECHAT_COPYRIGHT WEECHAT_NAME " (c) 2003 by Wee Team"
#define WEECHAT_COPYRIGHT PACKAGE_NAME " (c) 2003 by Wee Team"
#define WEECHAT_WEBSITE "http://weechat.flashtux.org"
#define WEECHAT_ERROR _(WEECHAT_NAME " Error:")
#define WEECHAT_WARNING _(WEECHAT_NAME " Warning:")
#define WEECHAT_ERROR _(PACKAGE_NAME " Error:")
#define WEECHAT_WARNING _(PACKAGE_NAME " Warning:")
/* debug mode, 0=normal use, 1=some debug msg, 2=full debug (developers only) */
#define DEBUG 0
@ -51,7 +47,7 @@
/* license */
#define WEE_LICENSE \
WEECHAT_NAME_AND_VERSION " (c) Copyright 2003, compiled on " __DATE__ __TIME__ \
PACKAGE_STRING " (c) Copyright 2003, compiled on " __DATE__ __TIME__ \
"Developed by FlashCode <flashcode@flashtux.org>\n" \
" Bounga <bounga@altern.org>\n" \
" Xahlexx <xahlexx@tuxisland.org>\n\n" \
@ -71,7 +67,7 @@
"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n\n"
#define WEE_USAGE \
WEECHAT_NAME_AND_VERSION " (c) Copyright 2003, compiled on " __DATE__ __TIME__ \
PACKAGE_STRING " (c) Copyright 2003, compiled on " __DATE__ __TIME__ \
"Developed by FlashCode <flashcode@flashtux.org>\n" \
" Bounga <bounga@altern.org>\n" \
" Xahlexx <xahlexx@tuxisland.org>\n\n" \

1201
src/common/weeconfig.c Normal file

File diff suppressed because it is too large Load Diff

157
src/common/weeconfig.h Normal file
View File

@ -0,0 +1,157 @@
/*
* Copyright (c) 2003 by FlashCode <flashcode@flashtux.org>
* Bounga <bounga@altern.org>
* Xahlexx <xahlexx@tuxisland.org>
* See README for License detail.
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WEECHAT_CONFIG_H
#define __WEECHAT_CONFIG_H 1
#define WEECHAT_CONFIG_NAME "weechat.rc"
#define CONFIG_SECTION_NONE -1
#define CONFIG_SECTION_LOOK 0
#define CONFIG_SECTION_COLORS 1
#define CONFIG_SECTION_HISTORY 2
#define CONFIG_SECTION_LOG 3
#define CONFIG_SECTION_DCC 4
#define CONFIG_SECTION_PROXY 5
#define CONFIG_SECTION_ALIAS 6
#define CONFIG_SECTION_SERVER 7
#define CONFIG_NUMBER_SECTIONS 8
#define OPTION_TYPE_BOOLEAN 1 /* values: on/off */
#define OPTION_TYPE_INT 2 /* values: from min to max */
#define OPTION_TYPE_INT_WITH_STRING 3 /* values: one from **array_values */
#define OPTION_TYPE_COLOR 4 /* values: a color name */
#define OPTION_TYPE_STRING 5 /* values: any string, may be empty */
#define BOOL_FALSE 0
#define BOOL_TRUE 1
#define CFG_LOOK_NICKLIST_LEFT 0
#define CFG_LOOK_NICKLIST_RIGHT 1
#define CFG_LOOK_NICKLIST_TOP 2
#define CFG_LOOK_NICKLIST_BOTTOM 3
typedef struct t_config_section t_config_section;
struct t_config_section
{
int section_number;
char *section_name;
};
typedef struct t_config_option t_config_option;
struct t_config_option
{
char *option_name;
char *short_description;
char *long_description;
int option_type;
int min, max;
int default_int;
char *default_string;
char **array_values;
int *ptr_int;
char **ptr_string;
int (*handler_change)(int *, char **);
};
extern int cfg_look_set_title;
extern int cfg_look_startup_logo;
extern int cfg_look_startup_version;
extern char *cfg_look_weechat_slogan;
extern int cfg_look_color_nicks;
extern int cfg_look_color_actions;
extern int cfg_look_remove_colors_from_msgs;
extern int cfg_look_nicklist;
extern int cfg_look_nicklist_position;
extern int cfg_look_nicklist_min_size;
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 int cfg_col_title;
extern int cfg_col_title_bg;
extern int cfg_col_chat;
extern int cfg_col_chat_time;
extern int cfg_col_chat_time_sep;
extern int cfg_col_chat_prefix1;
extern int cfg_col_chat_prefix2;
extern int cfg_col_chat_nick;
extern int cfg_col_chat_host;
extern int cfg_col_chat_channel;
extern int cfg_col_chat_dark;
extern int cfg_col_chat_bg;
extern int cfg_col_status;
extern int cfg_col_status_active;
extern int cfg_col_status_data_msg;
extern int cfg_col_status_data_other;
extern int cfg_col_status_more;
extern int cfg_col_status_bg;
extern int cfg_col_input;
extern int cfg_col_input_channel;
extern int cfg_col_input_nick;
extern int cfg_col_input_bg;
extern int cfg_col_nick;
extern int cfg_col_nick_op;
extern int cfg_col_nick_halfop;
extern int cfg_col_nick_voice;
extern int cfg_col_nick_sep;
extern int cfg_col_nick_self;
extern int cfg_col_nick_private;
extern int cfg_col_nick_bg;
extern int cfg_history_max_lines;
extern int cfg_history_max_commands;
extern int cfg_log_auto_channels;
extern int cfg_log_auto_private;
extern char *cfg_log_path;
extern char *cfg_log_name;
extern char *cfg_log_timestamp;
extern char *cfg_log_start_string;
extern char *cfg_log_end_string;
extern int cfg_dcc_auto_accept_files;
extern int cfg_dcc_auto_accept_max_size;
extern int cfg_dcc_auto_accept_chats;
extern int cfg_dcc_timeout;
extern char *cfg_dcc_download_path;
extern char *cfg_dcc_upload_path;
extern int cfg_dcc_auto_rename;
extern int cfg_dcc_auto_resume;
extern int cfg_proxy_use;
extern char *cfg_proxy_address;
extern int cfg_proxy_port;
extern char *cfg_proxy_password;
extern t_config_section config_sections [CONFIG_NUMBER_SECTIONS];
extern t_config_option * weechat_options [CONFIG_NUMBER_SECTIONS];
extern int config_read ();
extern int config_create_default ();
extern int config_write ();
#endif /* config.h */

View File

@ -21,6 +21,7 @@ weechat_curses_LDADD = ../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(CURSES_LIBS)
weechat_curses_SOURCES = ../gui-common.c \
weechat_curses_SOURCES = ../gui.h \
../gui-common.c \
gui-display.c \
gui-input.c

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* gui-display.c: display functions for Curses GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@ -33,7 +36,7 @@
#include "../../common/weechat.h"
#include "../gui.h"
#include "../../common/config.h"
#include "../../common/weeconfig.h"
#include "../../irc/irc.h"
@ -302,7 +305,7 @@ gui_draw_window_title (t_gui_window *window)
{
/* TODO: change this copyright as title? */
mvwprintw (window->win_title, 0, 0,
"%s", WEECHAT_NAME_AND_VERSION " - " WEECHAT_WEBSITE);
"%s", PACKAGE_STRING " - " WEECHAT_WEBSITE);
mvwprintw (window->win_title, 0, COLS - strlen (WEECHAT_COPYRIGHT),
"%s", WEECHAT_COPYRIGHT);
}
@ -1396,7 +1399,7 @@ gui_init ()
#ifdef __linux__
/* set title for term window, not for console */
if (cfg_look_set_title && (strcmp (getenv ("TERM"), "linux") != 0))
printf ("\e]2;" WEECHAT_NAME " " WEECHAT_VERSION "\a\e]1;" WEECHAT_NAME " " WEECHAT_VERSION "\a");
printf ("\e]2;" PACKAGE_NAME " " PACKAGE_VERSION "\a\e]1;" PACKAGE_NAME " " PACKAGE_VERSION "\a");
#endif
gui_ready = 1;

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* gui-input: user input functions for Curses GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@ -34,7 +37,7 @@
#include "../../common/weechat.h"
#include "../gui.h"
#include "../../common/config.h"
#include "../../common/weeconfig.h"
#include "../../common/command.h"
#include "../../irc/irc.h"

View File

@ -23,6 +23,7 @@ weechat_gtk_LDADD = ../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(GTK_LIBS)
weechat_gtk_SOURCES = ../gui-common.c \
weechat_gtk_SOURCES = ../gui.h \
../gui-common.c \
gui-display.c \
gui-input.c

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* gui-display.c: display functions for Gtk GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@ -33,7 +36,7 @@
#include "../../common/weechat.h"
#include "../gui.h"
#include "../../common/config.h"
#include "../../common/weeconfig.h"
#include "../../irc/irc.h"
@ -577,7 +580,7 @@ void
gui_init ()
{
gtk_main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (gtk_main_window), WEECHAT_NAME_AND_VERSION);
gtk_window_set_title (GTK_WINDOW (gtk_main_window), PACKAGE_STRING);
vbox1 = gtk_vbox_new (FALSE, 0);
gtk_widget_show (vbox1);

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* gui-input: user input functions for Gtk GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@ -34,7 +37,7 @@
#include "../../common/weechat.h"
#include "../gui.h"
#include "../../common/config.h"
#include "../../common/weeconfig.h"
#include "../../common/command.h"
#include "../../irc/irc.h"

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* gui-common.c: display functions, used by any GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>

View File

@ -17,7 +17,8 @@
noinst_LIBRARIES = lib_weechat_irc.a
lib_weechat_irc_a_SOURCES = irc-commands.c \
lib_weechat_irc_a_SOURCES = irc.h \
irc-commands.c \
irc-send.c \
irc-recv.c \
irc-server.c \

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* irc-channel.c: manages a chat (channel or private chat) */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>

View File

@ -19,11 +19,14 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* irc-commands.c: implementation of IRC commands, according to
RFC 1459,2810,2811,2812 */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "../common/weechat.h"
#include "irc.h"
#include "../common/command.h"
@ -157,7 +160,7 @@ t_irc_command irc_commands[] =
{ "privmsg", N_("message received"),
"", "",
0, 0, 1, NULL, NULL, irc_cmd_recv_privmsg },
{ "quit", N_("close all connections & quit " WEECHAT_NAME),
{ "quit", N_("close all connections & quit " PACKAGE_NAME),
N_("[quit_message]"),
N_("quit_message: quit message (displayed to other users)"),
0, MAX_ARGS, 0, NULL, irc_cmd_send_quit, irc_cmd_recv_quit },

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* irc-display.c: display functions for IRC */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
@ -30,7 +33,7 @@
#include "../common/weechat.h"
#include "irc.h"
#include "../common/config.h"
#include "../common/weeconfig.h"
#include "../gui/gui.h"

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* irc-nick.c: manages nick list for channels */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <limits.h>

View File

@ -19,11 +19,14 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* irc-recv.c: implementation of IRC commands (server to client),
according to RFC 1459,2810,2811,2812 */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
@ -35,7 +38,7 @@
#include "../common/weechat.h"
#include "irc.h"
#include "../common/command.h"
#include "../common/config.h"
#include "../common/weeconfig.h"
#include "../gui/gui.h"
@ -838,7 +841,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
_("NOTICE %s :%sVERSION %s v%s"
" compiled on %s, host \"%s\" is running "
"%s %s / %s%s"),
host, "\01", WEECHAT_NAME, WEECHAT_VERSION, __DATE__,
host, "\01", PACKAGE_NAME, PACKAGE_VERSION, __DATE__,
&buf->nodename, &buf->sysname,
&buf->release, &buf->machine, "\01\r\n");
free (buf);
@ -2418,7 +2421,7 @@ irc_cmd_recv_433 (t_irc_server *server, char *host, char *arguments)
gui_printf (server->window,
_("%s: nickname \"%s\" is already in use, "
"trying 2nd nickname \"%s\"\n"),
WEECHAT_NAME, server->nick, server->nick2);
PACKAGE_NAME, server->nick, server->nick2);
free (server->nick);
server->nick = strdup (server->nick2);
}
@ -2429,7 +2432,7 @@ irc_cmd_recv_433 (t_irc_server *server, char *host, char *arguments)
gui_printf (server->window,
_("%s: nickname \"%s\" is already in use, "
"trying 3rd nickname \"%s\"\n"),
WEECHAT_NAME, server->nick, server->nick3);
PACKAGE_NAME, server->nick, server->nick3);
free (server->nick);
server->nick = strdup (server->nick3);
}
@ -2438,7 +2441,7 @@ irc_cmd_recv_433 (t_irc_server *server, char *host, char *arguments)
gui_printf (server->window,
_("%s: all declared nicknames are already in use, "
"closing connection with server!\n"),
WEECHAT_NAME);
PACKAGE_NAME);
server_disconnect (server);
return 0;
}

View File

@ -19,11 +19,14 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* irc-send.c: implementation of IRC commands (client to server),
according to RFC 1459,2810,2811,2812 */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
@ -35,7 +38,7 @@
#include "../common/weechat.h"
#include "irc.h"
#include "../common/command.h"
#include "../common/config.h"
#include "../common/weeconfig.h"
#include "../gui/gui.h"
@ -57,7 +60,7 @@ irc_login (t_irc_server *server)
strcpy (hostname, _("unknown"));
gui_printf (server->window,
_("%s: using local hostname \"%s\"\n"),
WEECHAT_NAME, hostname);
PACKAGE_NAME, hostname);
server_sendf (server,
"NICK %s\r\n"
"USER %s %s %s :%s\r\n",
@ -973,7 +976,7 @@ irc_cmd_send_version (t_irc_server *server, char *arguments)
{
irc_display_prefix (server->window, PREFIX_INFO);
gui_printf (server->window, _("%s, compiled on %s %s\n"),
WEECHAT_NAME_AND_VERSION,
PACKAGE_STRING,
__DATE__, __TIME__);
server_sendf (server, "VERSION\r\n");
}

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* irc-server.c: (dis)connection and communication with irc server */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
@ -480,7 +483,7 @@ server_connect (t_irc_server *server)
gui_printf (server->window,
_("%s: connecting to %s:%d...\n"),
WEECHAT_NAME, server->address, server->port);
PACKAGE_NAME, server->address, server->port);
log_printf (_("connecting to server %s:%d...\n"),
server->address, server->port);
server->is_connected = 0;
@ -551,7 +554,7 @@ server_connect (t_irc_server *server)
/* connection to server */
gui_printf (server->window,
_("%s: server IP is: %s\n"), WEECHAT_NAME, ip_address);
_("%s: server IP is: %s\n"), PACKAGE_NAME, ip_address);
error = connect (server->sock4, (struct sockaddr *) &addr, sizeof (addr));
if (error != 0)

View File

@ -19,10 +19,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT(WeeChat, 0.0.3, flashcode@flashtux.org)
AC_INIT(WeeChat, 0.0.3-pre3, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/common/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.0.3])
AM_INIT_AUTOMAKE([weechat], [0.0.3-pre3])
# Checks for programs.
AC_PROG_CC

View File

@ -18,7 +18,12 @@
noinst_LIBRARIES = lib_weechat_main.a
lib_weechat_main_a_SOURCES = weechat.c \
weechat.h \
command.c \
command.h \
completion.c \
config.c \
history.c
completion.h \
weeconfig.c \
weeconfig.h \
history.c \
history.h

View File

@ -19,16 +19,19 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* command.c: WeeChat internal commands */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include "weechat.h"
#include "command.h"
#include "config.h"
#include "weeconfig.h"
#include "../irc/irc.h"
#include "../gui/gui.h"
@ -528,7 +531,7 @@ exec_weechat_command (t_irc_server *server, char *string)
gui_printf (NULL,
_("%s wrong argument count for %s command \"%s\" "
"(expected: %d arg%s)\n"),
WEECHAT_ERROR, WEECHAT_NAME,
WEECHAT_ERROR, PACKAGE_NAME,
command + 1,
weechat_commands[i].max_arg,
(weechat_commands[i].max_arg >
@ -537,7 +540,7 @@ exec_weechat_command (t_irc_server *server, char *string)
gui_printf (NULL,
_("%s wrong argument count for %s command \"%s\" "
"(expected: between %d and %d arg%s)\n"),
WEECHAT_ERROR, WEECHAT_NAME,
WEECHAT_ERROR, PACKAGE_NAME,
command + 1,
weechat_commands[i].min_arg,
weechat_commands[i].max_arg,
@ -555,7 +558,7 @@ exec_weechat_command (t_irc_server *server, char *string)
if (return_code < 0)
gui_printf (NULL,
_("%s %s command \"%s\" failed\n"),
WEECHAT_ERROR, WEECHAT_NAME, command + 1);
WEECHAT_ERROR, PACKAGE_NAME, command + 1);
}
if (argv)
{
@ -906,7 +909,7 @@ weechat_cmd_help (int argc, char **argv)
if (argc == 0)
{
gui_printf (NULL,
_("> List of %s internal commands:\n"), WEECHAT_NAME);
_("> List of %s internal commands:\n"), PACKAGE_NAME);
for (i = 0; weechat_commands[i].command_name; i++)
gui_printf (NULL, " %s - %s\n",
weechat_commands[i].command_name,
@ -927,7 +930,7 @@ weechat_cmd_help (int argc, char **argv)
gui_printf
(NULL,
_("> Help on %s internal command \"%s\":\n"),
WEECHAT_NAME, weechat_commands[i].command_name);
PACKAGE_NAME, weechat_commands[i].command_name);
gui_printf (NULL,
_("Syntax: /%s %s\n"),
weechat_commands[i].command_name,

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* completion.c: completes words according to context (cmd/nick) */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* history.c: memorize and call again commands or text */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>

View File

@ -36,10 +36,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* weechat.c: core functions for WeeChat */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
@ -49,7 +52,7 @@
#include <time.h>
#include "weechat.h"
#include "config.h"
#include "weeconfig.h"
#include "command.h"
#include "../irc/irc.h"
#include "../gui/gui.h"
@ -128,7 +131,7 @@ wee_parse_args (int argc, char *argv[])
else if ((strcmp (argv[i], "-v") == 0)
|| (strcmp (argv[i], "--version") == 0))
{
printf (WEECHAT_VERSION "\n");
printf (PACKAGE_VERSION "\n");
exit (0);
}
else
@ -280,14 +283,14 @@ main (int argc, char *argv[])
{
gui_printf_color (NULL, COLOR_WIN_CHAT, _("%sWelcome to "),
(cfg_look_startup_logo) ? " " : "");
gui_printf_color (NULL, COLOR_WIN_CHAT_PREFIX2, WEECHAT_NAME);
gui_printf_color (NULL, COLOR_WIN_CHAT_PREFIX2, PACKAGE_NAME);
gui_printf_color (NULL, COLOR_WIN_CHAT,
", %s\n", cfg_look_weechat_slogan);
}
if (cfg_look_startup_version)
{
gui_printf_color (NULL, COLOR_WIN_CHAT_PREFIX2,
"%s" WEECHAT_NAME_AND_VERSION,
"%s" PACKAGE_STRING,
(cfg_look_startup_logo) ? " " : "");
gui_printf_color (NULL, COLOR_WIN_CHAT,
", %s %s %s\n",

View File

@ -31,15 +31,11 @@
#define _(string) gettext(string)
#define N_(string) (string)
#define WEECHAT_NAME "WeeChat"
#define WEECHAT_VERSION "0.0.3-pre2"
#define WEECHAT_NAME_AND_VERSION WEECHAT_NAME " " WEECHAT_VERSION
#define WEECHAT_COPYRIGHT WEECHAT_NAME " (c) 2003 by Wee Team"
#define WEECHAT_COPYRIGHT PACKAGE_NAME " (c) 2003 by Wee Team"
#define WEECHAT_WEBSITE "http://weechat.flashtux.org"
#define WEECHAT_ERROR _(WEECHAT_NAME " Error:")
#define WEECHAT_WARNING _(WEECHAT_NAME " Warning:")
#define WEECHAT_ERROR _(PACKAGE_NAME " Error:")
#define WEECHAT_WARNING _(PACKAGE_NAME " Warning:")
/* debug mode, 0=normal use, 1=some debug msg, 2=full debug (developers only) */
#define DEBUG 0
@ -51,7 +47,7 @@
/* license */
#define WEE_LICENSE \
WEECHAT_NAME_AND_VERSION " (c) Copyright 2003, compiled on " __DATE__ __TIME__ \
PACKAGE_STRING " (c) Copyright 2003, compiled on " __DATE__ __TIME__ \
"Developed by FlashCode <flashcode@flashtux.org>\n" \
" Bounga <bounga@altern.org>\n" \
" Xahlexx <xahlexx@tuxisland.org>\n\n" \
@ -71,7 +67,7 @@
"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n\n"
#define WEE_USAGE \
WEECHAT_NAME_AND_VERSION " (c) Copyright 2003, compiled on " __DATE__ __TIME__ \
PACKAGE_STRING " (c) Copyright 2003, compiled on " __DATE__ __TIME__ \
"Developed by FlashCode <flashcode@flashtux.org>\n" \
" Bounga <bounga@altern.org>\n" \
" Xahlexx <xahlexx@tuxisland.org>\n\n" \

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,157 @@
/*
* Copyright (c) 2003 by FlashCode <flashcode@flashtux.org>
* Bounga <bounga@altern.org>
* Xahlexx <xahlexx@tuxisland.org>
* See README for License detail.
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WEECHAT_CONFIG_H
#define __WEECHAT_CONFIG_H 1
#define WEECHAT_CONFIG_NAME "weechat.rc"
#define CONFIG_SECTION_NONE -1
#define CONFIG_SECTION_LOOK 0
#define CONFIG_SECTION_COLORS 1
#define CONFIG_SECTION_HISTORY 2
#define CONFIG_SECTION_LOG 3
#define CONFIG_SECTION_DCC 4
#define CONFIG_SECTION_PROXY 5
#define CONFIG_SECTION_ALIAS 6
#define CONFIG_SECTION_SERVER 7
#define CONFIG_NUMBER_SECTIONS 8
#define OPTION_TYPE_BOOLEAN 1 /* values: on/off */
#define OPTION_TYPE_INT 2 /* values: from min to max */
#define OPTION_TYPE_INT_WITH_STRING 3 /* values: one from **array_values */
#define OPTION_TYPE_COLOR 4 /* values: a color name */
#define OPTION_TYPE_STRING 5 /* values: any string, may be empty */
#define BOOL_FALSE 0
#define BOOL_TRUE 1
#define CFG_LOOK_NICKLIST_LEFT 0
#define CFG_LOOK_NICKLIST_RIGHT 1
#define CFG_LOOK_NICKLIST_TOP 2
#define CFG_LOOK_NICKLIST_BOTTOM 3
typedef struct t_config_section t_config_section;
struct t_config_section
{
int section_number;
char *section_name;
};
typedef struct t_config_option t_config_option;
struct t_config_option
{
char *option_name;
char *short_description;
char *long_description;
int option_type;
int min, max;
int default_int;
char *default_string;
char **array_values;
int *ptr_int;
char **ptr_string;
int (*handler_change)(int *, char **);
};
extern int cfg_look_set_title;
extern int cfg_look_startup_logo;
extern int cfg_look_startup_version;
extern char *cfg_look_weechat_slogan;
extern int cfg_look_color_nicks;
extern int cfg_look_color_actions;
extern int cfg_look_remove_colors_from_msgs;
extern int cfg_look_nicklist;
extern int cfg_look_nicklist_position;
extern int cfg_look_nicklist_min_size;
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 int cfg_col_title;
extern int cfg_col_title_bg;
extern int cfg_col_chat;
extern int cfg_col_chat_time;
extern int cfg_col_chat_time_sep;
extern int cfg_col_chat_prefix1;
extern int cfg_col_chat_prefix2;
extern int cfg_col_chat_nick;
extern int cfg_col_chat_host;
extern int cfg_col_chat_channel;
extern int cfg_col_chat_dark;
extern int cfg_col_chat_bg;
extern int cfg_col_status;
extern int cfg_col_status_active;
extern int cfg_col_status_data_msg;
extern int cfg_col_status_data_other;
extern int cfg_col_status_more;
extern int cfg_col_status_bg;
extern int cfg_col_input;
extern int cfg_col_input_channel;
extern int cfg_col_input_nick;
extern int cfg_col_input_bg;
extern int cfg_col_nick;
extern int cfg_col_nick_op;
extern int cfg_col_nick_halfop;
extern int cfg_col_nick_voice;
extern int cfg_col_nick_sep;
extern int cfg_col_nick_self;
extern int cfg_col_nick_private;
extern int cfg_col_nick_bg;
extern int cfg_history_max_lines;
extern int cfg_history_max_commands;
extern int cfg_log_auto_channels;
extern int cfg_log_auto_private;
extern char *cfg_log_path;
extern char *cfg_log_name;
extern char *cfg_log_timestamp;
extern char *cfg_log_start_string;
extern char *cfg_log_end_string;
extern int cfg_dcc_auto_accept_files;
extern int cfg_dcc_auto_accept_max_size;
extern int cfg_dcc_auto_accept_chats;
extern int cfg_dcc_timeout;
extern char *cfg_dcc_download_path;
extern char *cfg_dcc_upload_path;
extern int cfg_dcc_auto_rename;
extern int cfg_dcc_auto_resume;
extern int cfg_proxy_use;
extern char *cfg_proxy_address;
extern int cfg_proxy_port;
extern char *cfg_proxy_password;
extern t_config_section config_sections [CONFIG_NUMBER_SECTIONS];
extern t_config_option * weechat_options [CONFIG_NUMBER_SECTIONS];
extern int config_read ();
extern int config_create_default ();
extern int config_write ();
#endif /* config.h */

View File

@ -21,6 +21,7 @@ weechat_curses_LDADD = ../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(CURSES_LIBS)
weechat_curses_SOURCES = ../gui-common.c \
weechat_curses_SOURCES = ../gui.h \
../gui-common.c \
gui-display.c \
gui-input.c

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* gui-display.c: display functions for Curses GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@ -33,7 +36,7 @@
#include "../../common/weechat.h"
#include "../gui.h"
#include "../../common/config.h"
#include "../../common/weeconfig.h"
#include "../../irc/irc.h"
@ -302,7 +305,7 @@ gui_draw_window_title (t_gui_window *window)
{
/* TODO: change this copyright as title? */
mvwprintw (window->win_title, 0, 0,
"%s", WEECHAT_NAME_AND_VERSION " - " WEECHAT_WEBSITE);
"%s", PACKAGE_STRING " - " WEECHAT_WEBSITE);
mvwprintw (window->win_title, 0, COLS - strlen (WEECHAT_COPYRIGHT),
"%s", WEECHAT_COPYRIGHT);
}
@ -1396,7 +1399,7 @@ gui_init ()
#ifdef __linux__
/* set title for term window, not for console */
if (cfg_look_set_title && (strcmp (getenv ("TERM"), "linux") != 0))
printf ("\e]2;" WEECHAT_NAME " " WEECHAT_VERSION "\a\e]1;" WEECHAT_NAME " " WEECHAT_VERSION "\a");
printf ("\e]2;" PACKAGE_NAME " " PACKAGE_VERSION "\a\e]1;" PACKAGE_NAME " " PACKAGE_VERSION "\a");
#endif
gui_ready = 1;

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* gui-input: user input functions for Curses GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@ -34,7 +37,7 @@
#include "../../common/weechat.h"
#include "../gui.h"
#include "../../common/config.h"
#include "../../common/weeconfig.h"
#include "../../common/command.h"
#include "../../irc/irc.h"

View File

@ -23,6 +23,7 @@ weechat_gtk_LDADD = ../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(GTK_LIBS)
weechat_gtk_SOURCES = ../gui-common.c \
weechat_gtk_SOURCES = ../gui.h \
../gui-common.c \
gui-display.c \
gui-input.c

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* gui-display.c: display functions for Gtk GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@ -33,7 +36,7 @@
#include "../../common/weechat.h"
#include "../gui.h"
#include "../../common/config.h"
#include "../../common/weeconfig.h"
#include "../../irc/irc.h"
@ -577,7 +580,7 @@ void
gui_init ()
{
gtk_main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (gtk_main_window), WEECHAT_NAME_AND_VERSION);
gtk_window_set_title (GTK_WINDOW (gtk_main_window), PACKAGE_STRING);
vbox1 = gtk_vbox_new (FALSE, 0);
gtk_widget_show (vbox1);

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* gui-input: user input functions for Gtk GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@ -34,7 +37,7 @@
#include "../../common/weechat.h"
#include "../gui.h"
#include "../../common/config.h"
#include "../../common/weeconfig.h"
#include "../../common/command.h"
#include "../../irc/irc.h"

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* gui-common.c: display functions, used by any GUI */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>

View File

@ -17,7 +17,8 @@
noinst_LIBRARIES = lib_weechat_irc.a
lib_weechat_irc_a_SOURCES = irc-commands.c \
lib_weechat_irc_a_SOURCES = irc.h \
irc-commands.c \
irc-send.c \
irc-recv.c \
irc-server.c \

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* irc-channel.c: manages a chat (channel or private chat) */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>

View File

@ -19,11 +19,14 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* irc-commands.c: implementation of IRC commands, according to
RFC 1459,2810,2811,2812 */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "../common/weechat.h"
#include "irc.h"
#include "../common/command.h"
@ -157,7 +160,7 @@ t_irc_command irc_commands[] =
{ "privmsg", N_("message received"),
"", "",
0, 0, 1, NULL, NULL, irc_cmd_recv_privmsg },
{ "quit", N_("close all connections & quit " WEECHAT_NAME),
{ "quit", N_("close all connections & quit " PACKAGE_NAME),
N_("[quit_message]"),
N_("quit_message: quit message (displayed to other users)"),
0, MAX_ARGS, 0, NULL, irc_cmd_send_quit, irc_cmd_recv_quit },

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* irc-display.c: display functions for IRC */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
@ -30,7 +33,7 @@
#include "../common/weechat.h"
#include "irc.h"
#include "../common/config.h"
#include "../common/weeconfig.h"
#include "../gui/gui.h"

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* irc-nick.c: manages nick list for channels */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <limits.h>

View File

@ -19,11 +19,14 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* irc-recv.c: implementation of IRC commands (server to client),
according to RFC 1459,2810,2811,2812 */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
@ -35,7 +38,7 @@
#include "../common/weechat.h"
#include "irc.h"
#include "../common/command.h"
#include "../common/config.h"
#include "../common/weeconfig.h"
#include "../gui/gui.h"
@ -838,7 +841,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
_("NOTICE %s :%sVERSION %s v%s"
" compiled on %s, host \"%s\" is running "
"%s %s / %s%s"),
host, "\01", WEECHAT_NAME, WEECHAT_VERSION, __DATE__,
host, "\01", PACKAGE_NAME, PACKAGE_VERSION, __DATE__,
&buf->nodename, &buf->sysname,
&buf->release, &buf->machine, "\01\r\n");
free (buf);
@ -2418,7 +2421,7 @@ irc_cmd_recv_433 (t_irc_server *server, char *host, char *arguments)
gui_printf (server->window,
_("%s: nickname \"%s\" is already in use, "
"trying 2nd nickname \"%s\"\n"),
WEECHAT_NAME, server->nick, server->nick2);
PACKAGE_NAME, server->nick, server->nick2);
free (server->nick);
server->nick = strdup (server->nick2);
}
@ -2429,7 +2432,7 @@ irc_cmd_recv_433 (t_irc_server *server, char *host, char *arguments)
gui_printf (server->window,
_("%s: nickname \"%s\" is already in use, "
"trying 3rd nickname \"%s\"\n"),
WEECHAT_NAME, server->nick, server->nick3);
PACKAGE_NAME, server->nick, server->nick3);
free (server->nick);
server->nick = strdup (server->nick3);
}
@ -2438,7 +2441,7 @@ irc_cmd_recv_433 (t_irc_server *server, char *host, char *arguments)
gui_printf (server->window,
_("%s: all declared nicknames are already in use, "
"closing connection with server!\n"),
WEECHAT_NAME);
PACKAGE_NAME);
server_disconnect (server);
return 0;
}

View File

@ -19,11 +19,14 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* irc-send.c: implementation of IRC commands (client to server),
according to RFC 1459,2810,2811,2812 */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
@ -35,7 +38,7 @@
#include "../common/weechat.h"
#include "irc.h"
#include "../common/command.h"
#include "../common/config.h"
#include "../common/weeconfig.h"
#include "../gui/gui.h"
@ -57,7 +60,7 @@ irc_login (t_irc_server *server)
strcpy (hostname, _("unknown"));
gui_printf (server->window,
_("%s: using local hostname \"%s\"\n"),
WEECHAT_NAME, hostname);
PACKAGE_NAME, hostname);
server_sendf (server,
"NICK %s\r\n"
"USER %s %s %s :%s\r\n",
@ -973,7 +976,7 @@ irc_cmd_send_version (t_irc_server *server, char *arguments)
{
irc_display_prefix (server->window, PREFIX_INFO);
gui_printf (server->window, _("%s, compiled on %s %s\n"),
WEECHAT_NAME_AND_VERSION,
PACKAGE_STRING,
__DATE__, __TIME__);
server_sendf (server, "VERSION\r\n");
}

View File

@ -19,10 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* irc-server.c: (dis)connection and communication with irc server */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
@ -480,7 +483,7 @@ server_connect (t_irc_server *server)
gui_printf (server->window,
_("%s: connecting to %s:%d...\n"),
WEECHAT_NAME, server->address, server->port);
PACKAGE_NAME, server->address, server->port);
log_printf (_("connecting to server %s:%d...\n"),
server->address, server->port);
server->is_connected = 0;
@ -551,7 +554,7 @@ server_connect (t_irc_server *server)
/* connection to server */
gui_printf (server->window,
_("%s: server IP is: %s\n"), WEECHAT_NAME, ip_address);
_("%s: server IP is: %s\n"), PACKAGE_NAME, ip_address);
error = connect (server->sock4, (struct sockaddr *) &addr, sizeof (addr));
if (error != 0)