Compare commits
144 Commits
v2.10.1
...
wip/connec
Author | SHA1 | Date | |
---|---|---|---|
![]() |
480fa3cefc | ||
![]() |
eb08bcfacf | ||
![]() |
086d4e3962 | ||
![]() |
9bd7405502 | ||
![]() |
2a28289314 | ||
![]() |
112632bb4e | ||
![]() |
c5016e390f | ||
![]() |
63bb87fc93 | ||
![]() |
1fa4a000e7 | ||
![]() |
448cc962cd | ||
![]() |
6ef7298870 | ||
![]() |
9f7444baa2 | ||
![]() |
fef580ed7f | ||
![]() |
3bb717a3b5 | ||
![]() |
5beaf15f21 | ||
![]() |
1b2bee37e4 | ||
![]() |
9cb73f839f | ||
![]() |
330e31c70f | ||
![]() |
cbaa04905f | ||
![]() |
14d3a03f41 | ||
![]() |
95febd978c | ||
![]() |
3f855f07f5 | ||
![]() |
83032b1aa3 | ||
![]() |
c4cb1b25ec | ||
![]() |
77ecaa6093 | ||
![]() |
664f6bf1e7 | ||
![]() |
aeb5d15871 | ||
![]() |
76c2cfebc3 | ||
![]() |
addefa9ef1 | ||
![]() |
7769bc99fe | ||
![]() |
ce396b3ddb | ||
![]() |
ebe0ad4cd5 | ||
![]() |
bdb5c3eb9d | ||
![]() |
c54a0c6db9 | ||
![]() |
46061f4f3c | ||
![]() |
ec7a0d6e13 | ||
![]() |
a86b03e939 | ||
![]() |
35fd47da55 | ||
![]() |
2b1396add3 | ||
![]() |
0e4164ad0c | ||
![]() |
94568bc517 | ||
![]() |
226d54c90d | ||
![]() |
7e4c482737 | ||
![]() |
ac01ba9cb0 | ||
![]() |
a537fa3ca7 | ||
![]() |
f614a3c311 | ||
![]() |
d6e3f740bc | ||
![]() |
72f82d096c | ||
![]() |
74ff67acd3 | ||
![]() |
6aafc8e51d | ||
![]() |
10246f121a | ||
![]() |
025152ee53 | ||
![]() |
58e871696b | ||
![]() |
0ba8b922a2 | ||
![]() |
b296839538 | ||
![]() |
5fb21a04ad | ||
![]() |
fda692d250 | ||
![]() |
99a1fff590 | ||
![]() |
65c8494698 | ||
![]() |
2b94011fdc | ||
![]() |
2da5308fd2 | ||
![]() |
c1831cb19d | ||
![]() |
65da34f19e | ||
![]() |
b7afcc3632 | ||
![]() |
73cd6487d0 | ||
![]() |
5152040c17 | ||
![]() |
985ea610e6 | ||
![]() |
8062bce835 | ||
![]() |
3fbe5b876e | ||
![]() |
e38f00775f | ||
![]() |
05a6097dc6 | ||
![]() |
85557f2416 | ||
![]() |
0019af675a | ||
![]() |
f03023297b | ||
![]() |
c92b247878 | ||
![]() |
232096801b | ||
![]() |
c0769397d5 | ||
![]() |
c9b63f7f9b | ||
![]() |
ebaaf466bf | ||
![]() |
4b6215051f | ||
![]() |
f83d78dd28 | ||
![]() |
9fb4eb5107 | ||
![]() |
3c89de48a8 | ||
![]() |
6653582f0a | ||
![]() |
abaed2bda4 | ||
![]() |
e8fb2dde56 | ||
![]() |
25c6638ce4 | ||
![]() |
ce4e129849 | ||
![]() |
ecd1aa226a | ||
![]() |
760d18b6e7 | ||
![]() |
f389257403 | ||
![]() |
84df81f336 | ||
![]() |
a9a6cbda4e | ||
![]() |
7a4a0243bd | ||
![]() |
e209e55e59 | ||
![]() |
ad2300f236 | ||
![]() |
80bdd9ce11 | ||
![]() |
5f99d34c3b | ||
![]() |
2aa3eb8cfb | ||
![]() |
d1b9118056 | ||
![]() |
fd95c729d5 | ||
![]() |
d1c40196e3 | ||
![]() |
9716185edf | ||
![]() |
a38892ff3b | ||
![]() |
dc18e3da07 | ||
![]() |
9127b510f2 | ||
![]() |
8f9ed6d942 | ||
![]() |
422edd8812 | ||
![]() |
345c8a29ad | ||
![]() |
a854234c1f | ||
![]() |
4b549eeac8 | ||
![]() |
7c2c8b1403 | ||
![]() |
c2ecb4c68c | ||
![]() |
ea9dafcd43 | ||
![]() |
7a7b9c682d | ||
![]() |
0d3706e2ee | ||
![]() |
3c584e2cd5 | ||
![]() |
9372972ad4 | ||
![]() |
121cb8b88d | ||
![]() |
93caf4c7b4 | ||
![]() |
21c0e47869 | ||
![]() |
f1e853c1cb | ||
![]() |
aa7291fc9c | ||
![]() |
3de79bca10 | ||
![]() |
466646f84a | ||
![]() |
e0f80e41bf | ||
![]() |
9a5977a9c9 | ||
![]() |
c3c6b46230 | ||
![]() |
47b4b0da8a | ||
![]() |
45526205ab | ||
![]() |
3342af4185 | ||
![]() |
7374637d34 | ||
![]() |
62209618e1 | ||
![]() |
7bfa2ee8a7 | ||
![]() |
73c914cca9 | ||
![]() |
77d9d421fb | ||
![]() |
59f3a65911 | ||
![]() |
9181ea068a | ||
![]() |
c1d9aad546 | ||
![]() |
3cd8556c54 | ||
![]() |
9c981cfc6b | ||
![]() |
11e3ecc739 | ||
![]() |
5849a0588e | ||
![]() |
b8c02f71d9 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -69,6 +69,7 @@ stamp-h1
|
|||||||
*.po~
|
*.po~
|
||||||
*.pot
|
*.pot
|
||||||
*.patch
|
*.patch
|
||||||
|
src/**/*.plist
|
||||||
# Win32 generated files
|
# Win32 generated files
|
||||||
plugins/wmpa/wmpa_h.h
|
plugins/wmpa/wmpa_h.h
|
||||||
plugins/wmpa/wmpa_i.c
|
plugins/wmpa/wmpa_i.c
|
||||||
@@ -85,6 +86,7 @@ resource.h
|
|||||||
*.sdf
|
*.sdf
|
||||||
*.suo
|
*.suo
|
||||||
*.user
|
*.user
|
||||||
|
*.exe
|
||||||
#OSX
|
#OSX
|
||||||
osx/HexChat.app
|
osx/HexChat.app
|
||||||
osx/.HexChat.app
|
osx/.HexChat.app
|
||||||
|
11
.travis.yml
11
.travis.yml
@@ -1,14 +1,17 @@
|
|||||||
language: c
|
language: c
|
||||||
compiler: gcc
|
compiler: clang
|
||||||
before_script:
|
before_script:
|
||||||
|
- sudo apt-get update
|
||||||
- sudo apt-get build-dep -qq xchat
|
- sudo apt-get build-dep -qq xchat
|
||||||
- sudo apt-get install -qq libnotify-dev libproxy-dev libpci-dev libcanberra-dev monodevelop gnome-common
|
- sudo apt-get install -qq libnotify-dev libproxy-dev libpci-dev libcanberra-dev monodevelop gnome-common
|
||||||
script:
|
script:
|
||||||
- ./autogen.sh
|
- ./autogen.sh
|
||||||
- ./configure --enable-textfe --with-theme-manager
|
- ./configure --enable-textfe --with-theme-manager --enable-static-analysis
|
||||||
- make V=1
|
- make V=1 -j$(nproc)
|
||||||
notifications:
|
notifications:
|
||||||
irc:
|
irc:
|
||||||
channels: "chat.freenode.net#hexchat-devel"
|
channels: "chat.freenode.net#hexchat-devel"
|
||||||
template: "Build #%{build_number} (%{commit}) by %{author}: %{message}"
|
template: "Build %{build_url} (%{commit} in %{branch}) by %{author}: %{message}"
|
||||||
on_success: change
|
on_success: change
|
||||||
|
matrix:
|
||||||
|
fast_finish: true
|
||||||
|
211
configure.ac
211
configure.ac
@@ -1,6 +1,6 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
AC_INIT([HexChat],[2.10.1])
|
AC_INIT([HexChat],[2.11.0])
|
||||||
|
|
||||||
AC_PREREQ([2.60])
|
AC_PREREQ([2.60])
|
||||||
AC_COPYRIGHT([Copyright (C) 1998-2010 Peter Zelezny])
|
AC_COPYRIGHT([Copyright (C) 1998-2010 Peter Zelezny])
|
||||||
@@ -38,14 +38,10 @@ AH_VERBATIM([OLD_PERL],[#undef OLD_PERL])
|
|||||||
AH_VERBATIM([PREFIX],[#undef PREFIX])
|
AH_VERBATIM([PREFIX],[#undef PREFIX])
|
||||||
AH_VERBATIM([HEXCHATLIBDIR],[#undef HEXCHATLIBDIR])
|
AH_VERBATIM([HEXCHATLIBDIR],[#undef HEXCHATLIBDIR])
|
||||||
AH_VERBATIM([HEXCHATSHAREDIR],[#undef HEXCHATSHAREDIR])
|
AH_VERBATIM([HEXCHATSHAREDIR],[#undef HEXCHATSHAREDIR])
|
||||||
AH_VERBATIM([SOCKS],[#undef SOCKS])
|
|
||||||
AH_VERBATIM([USE_MSPROXY],[#undef USE_MSPROXY])
|
|
||||||
AH_VERBATIM([USE_LIBPROXY],[#undef USE_LIBPROXY])
|
|
||||||
AH_VERBATIM([HAVE_ISO_CODES],[#undef HAVE_ISO_CODES])
|
AH_VERBATIM([HAVE_ISO_CODES],[#undef HAVE_ISO_CODES])
|
||||||
AH_VERBATIM([HAVE_GTK_MAC],[#undef HAVE_GTK_MAC])
|
AH_VERBATIM([HAVE_GTK_MAC],[#undef HAVE_GTK_MAC])
|
||||||
AH_VERBATIM([USE_LIBNOTIFY],[#undef USE_LIBNOTIFY])
|
AH_VERBATIM([USE_LIBNOTIFY],[#undef USE_LIBNOTIFY])
|
||||||
AH_VERBATIM([USE_LIBCANBERRA],[#undef USE_LIBCANBERRA])
|
AH_VERBATIM([USE_LIBCANBERRA],[#undef USE_LIBCANBERRA])
|
||||||
AH_VERBATIM([USE_IPV6],[#undef USE_IPV6])
|
|
||||||
AH_VERBATIM([USE_OPENSSL],[#undef USE_OPENSSL])
|
AH_VERBATIM([USE_OPENSSL],[#undef USE_OPENSSL])
|
||||||
AH_VERBATIM([USE_PLUGIN],[#undef USE_PLUGIN])
|
AH_VERBATIM([USE_PLUGIN],[#undef USE_PLUGIN])
|
||||||
AH_VERBATIM([USE_SIGACTION],[#undef USE_SIGACTION])
|
AH_VERBATIM([USE_SIGACTION],[#undef USE_SIGACTION])
|
||||||
@@ -74,18 +70,17 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
platform_win32=no
|
||||||
|
case $host_os in
|
||||||
|
*mingw*|*cygwin*|*msys*)
|
||||||
|
platform_win32=yes;;
|
||||||
|
*);;
|
||||||
|
esac
|
||||||
|
|
||||||
dnl *********************************************************************
|
dnl *********************************************************************
|
||||||
dnl ** configure switches ***********************************************
|
dnl ** configure switches ***********************************************
|
||||||
dnl *********************************************************************
|
dnl *********************************************************************
|
||||||
|
|
||||||
AC_ARG_ENABLE(socks,
|
|
||||||
[AS_HELP_STRING([--enable-socks],[link with SOCKS5 library (default: no)])],
|
|
||||||
socks=$enableval, socks=no)
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(ipv6,
|
|
||||||
[AS_HELP_STRING([--disable-ipv6],[disable IPv6])],
|
|
||||||
ipv6=$enableval, ipv6=yes)
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(openssl,
|
AC_ARG_ENABLE(openssl,
|
||||||
[AS_HELP_STRING([--enable-openssl[=PATH]],[enable use of openSSL])],
|
[AS_HELP_STRING([--enable-openssl[=PATH]],[enable use of openSSL])],
|
||||||
openssl=$enableval, openssl=yes)
|
openssl=$enableval, openssl=yes)
|
||||||
@@ -143,14 +138,6 @@ AC_ARG_ENABLE(libcanberra,
|
|||||||
[AS_HELP_STRING([--disable-libcanberra],[disable libcanberra support])],
|
[AS_HELP_STRING([--disable-libcanberra],[disable libcanberra support])],
|
||||||
libcanberra=$enableval, libcanberra=yes)
|
libcanberra=$enableval, libcanberra=yes)
|
||||||
|
|
||||||
AC_ARG_ENABLE(ntlm,
|
|
||||||
[AS_HELP_STRING([--enable-ntlm],[enable Microsoft\'s NTLM auth (libntlm) library support (default: no)])],
|
|
||||||
ntlm=$enableval, ntlm=no)
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(libproxy,
|
|
||||||
[AS_HELP_STRING([--disable-libproxy],[disable libproxy support (default: auto)])],
|
|
||||||
libproxy=$enableval, libproxy=auto)
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(isocodes,
|
AC_ARG_ENABLE(isocodes,
|
||||||
[AS_HELP_STRING([--disable-isocodes],[disable iso-codes with spell-check])],
|
[AS_HELP_STRING([--disable-isocodes],[disable iso-codes with spell-check])],
|
||||||
isocodes=$enableval, isocodes=yes)
|
isocodes=$enableval, isocodes=yes)
|
||||||
@@ -159,6 +146,10 @@ AC_ARG_ENABLE(minimal-flags,
|
|||||||
[AS_HELP_STRING([--enable-minimal-flags],[only add those CFLAGS that are really needed or not intrusive (default: no)])],
|
[AS_HELP_STRING([--enable-minimal-flags],[only add those CFLAGS that are really needed or not intrusive (default: no)])],
|
||||||
minimalflags=$enableval, minimalflags=no)
|
minimalflags=$enableval, minimalflags=no)
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(static-analysis,
|
||||||
|
[AS_HELP_STRING([--enable-static-analysis],[if using clang run static analysis during build (default: no)])],
|
||||||
|
analyze=$enableval, analyze=no)
|
||||||
|
|
||||||
AC_ARG_WITH(theme-manager,
|
AC_ARG_WITH(theme-manager,
|
||||||
[AS_HELP_STRING([--with-theme-manager],[compile theme manager (needs monodevelop, default: off)])],
|
[AS_HELP_STRING([--with-theme-manager],[compile theme manager (needs monodevelop, default: off)])],
|
||||||
theme_manager=$withval, theme_manager=no)
|
theme_manager=$withval, theme_manager=no)
|
||||||
@@ -179,17 +170,11 @@ dnl *********************************************************************
|
|||||||
dnl ** GLIB *************************************************************
|
dnl ** GLIB *************************************************************
|
||||||
dnl *********************************************************************
|
dnl *********************************************************************
|
||||||
|
|
||||||
AM_PATH_GLIB_2_0(2.28.0, glib=yes, glib=no)
|
AM_PATH_GLIB_2_0([2.36.0], [], [AC_MSG_ERROR([Glib not found!])], [gmodule gobject gio])
|
||||||
if test "$glib" = no; then
|
COMMON_CFLAGS="$GLIB_CFLAGS -DG_DISABLE_SINGLE_INCLUDES"
|
||||||
AC_MSG_ERROR(Cannot find GLib!)
|
COMMON_LIBS="$GLIB_LIBS"
|
||||||
fi
|
AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_36], [Dont warn using older APIs])
|
||||||
|
AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [GLIB_VERSION_2_36], [Prevents using newer APIs])
|
||||||
PKG_CHECK_MODULES([GOBJECT], [gobject-2.0], [], [AC_MSG_ERROR(Cannot find gobject-2.0!)])
|
|
||||||
PKG_CHECK_MODULES([GIO], [gio-2.0], [], [AC_MSG_ERROR(Cannot find gio-2.0!)])
|
|
||||||
PKG_CHECK_MODULES([GMODULE], [gmodule-2.0], [], [AC_MSG_ERROR(Cannot find gmodule-2.0!)])
|
|
||||||
|
|
||||||
COMMON_CFLAGS="$GLIB_CFLAGS $GIO_CFLAGS $GOBJECT_CFLAGS $GMODULE_CFLAGS -DG_DISABLE_SINGLE_INCLUDES"
|
|
||||||
COMMON_LIBS="$GLIB_LIBS $GIO_LIBS $GOBJECT_LIBS $GMODULE_LIBS"
|
|
||||||
|
|
||||||
dnl *********************************************************************
|
dnl *********************************************************************
|
||||||
dnl ** GTK **************************************************************
|
dnl ** GTK **************************************************************
|
||||||
@@ -216,7 +201,7 @@ dnl *********************************************************************
|
|||||||
|
|
||||||
_gdk_tgt=`$PKG_CONFIG --variable=target gdk-2.0`
|
_gdk_tgt=`$PKG_CONFIG --variable=target gdk-2.0`
|
||||||
if test "x$_gdk_tgt" = xquartz; then
|
if test "x$_gdk_tgt" = xquartz; then
|
||||||
PKG_CHECK_MODULES(GTK_MAC, gtk-mac-integration, [
|
PKG_CHECK_MODULES(GTK_MAC, gtk-mac-integration-gtk2, [
|
||||||
GUI_LIBS="$GUI_LIBS $GTK_MAC_LIBS"
|
GUI_LIBS="$GUI_LIBS $GTK_MAC_LIBS"
|
||||||
GUI_CFLAGS="$GUI_CFLAGS $GTK_MAC_CFLAGS"
|
GUI_CFLAGS="$GUI_CFLAGS $GTK_MAC_CFLAGS"
|
||||||
AC_DEFINE(HAVE_GTK_MAC)
|
AC_DEFINE(HAVE_GTK_MAC)
|
||||||
@@ -255,8 +240,11 @@ if test "$perl" = yes; then
|
|||||||
original_ldflags="$LDFLAGS"
|
original_ldflags="$LDFLAGS"
|
||||||
CFLAGS="$PERL_CFLAGS"
|
CFLAGS="$PERL_CFLAGS"
|
||||||
LDFLAGS="$PERL_LDFLAGS"
|
LDFLAGS="$PERL_LDFLAGS"
|
||||||
AC_TRY_LINK([#include <EXTERN.h>
|
AC_TRY_LINK([
|
||||||
#include <perl.h>], [], perl_is_usable=yes, perl_is_usable=no)
|
#define PERL_NO_INLINE_FUNCTIONS
|
||||||
|
#include <EXTERN.h>
|
||||||
|
#include <perl.h>
|
||||||
|
], [], perl_is_usable=yes, perl_is_usable=no)
|
||||||
CFLAGS="$original_cflags"
|
CFLAGS="$original_cflags"
|
||||||
LDFLAGS="$original_ldflags"
|
LDFLAGS="$original_ldflags"
|
||||||
if test x$perl_is_usable = xno ; then
|
if test x$perl_is_usable = xno ; then
|
||||||
@@ -351,16 +339,13 @@ AC_CHECK_FUNC(select, ,
|
|||||||
AC_MSG_WARN(i can not find select. you might need to help me)))))))
|
AC_MSG_WARN(i can not find select. you might need to help me)))))))
|
||||||
AC_CHECK_LIB(socket, select)
|
AC_CHECK_LIB(socket, select)
|
||||||
|
|
||||||
if test "$ipv6" = yes; then
|
AC_CHECK_FUNCS(getaddrinfo, have_getaddrinfo=yes)
|
||||||
AC_CHECK_FUNCS(getaddrinfo, have_getaddrinfo=yes)
|
AC_MSG_CHECKING(whether IPv6 is supported)
|
||||||
AC_MSG_CHECKING(whether to enable IPv6 support)
|
if test "$have_getaddrinfo" = yes; then
|
||||||
if test "$have_getaddrinfo" = yes; then
|
AC_MSG_RESULT(yes)
|
||||||
AC_MSG_RESULT(yes)
|
else
|
||||||
AC_DEFINE(USE_IPV6)
|
AC_MSG_RESULT(no)
|
||||||
else
|
AC_MSG_ERROR(ipv6 support not found!)
|
||||||
ipv6=no
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl *********************************************************************
|
dnl *********************************************************************
|
||||||
@@ -369,17 +354,14 @@ dnl *********************************************************************
|
|||||||
|
|
||||||
retry=no
|
retry=no
|
||||||
if test "$openssl" != no; then
|
if test "$openssl" != no; then
|
||||||
AC_MSG_CHECKING(for openssl through pkg-config)
|
PKG_CHECK_MODULES(OPENSSL, [openssl], [
|
||||||
if $PKG_CONFIG openssl --exists; then
|
|
||||||
CPPFLAGS="$CPPFLAGS `$PKG_CONFIG openssl --cflags`"
|
|
||||||
LIBS="$LIBS `$PKG_CONFIG openssl --libs`"
|
|
||||||
AC_DEFINE(USE_OPENSSL)
|
AC_DEFINE(USE_OPENSSL)
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
openssl=yes
|
openssl=yes
|
||||||
else
|
COMMON_LIBS="$COMMON_LIBS $OPENSSL_LIBS"
|
||||||
AC_MSG_RESULT(no)
|
COMMON_CFLAGS="$COMMON_CFLAGS $OPENSSL_CFLAGS"
|
||||||
|
], [
|
||||||
retry=yes
|
retry=yes
|
||||||
fi
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$retry" = "yes"; then
|
if test "$retry" = "yes"; then
|
||||||
@@ -388,50 +370,29 @@ if test "$retry" = "yes"; then
|
|||||||
openssl_path=$openssl
|
openssl_path=$openssl
|
||||||
fi
|
fi
|
||||||
openssl=no
|
openssl=no
|
||||||
SAVED_LIBS=$LIBS
|
OPENSSL_LIBS="-lcrypto"
|
||||||
LIBS="$LIBS -lcrypto"
|
|
||||||
if test -n "$openssl_path"; then
|
if test -n "$openssl_path"; then
|
||||||
LIBS="-L$openssl_path/lib $LIBS"
|
OPENSSL_LIBS="-L$openssl_path/lib $OPENSSL_LIBS"
|
||||||
fi
|
fi
|
||||||
AC_CHECK_LIB(ssl, SSL_new, have_openssl=yes)
|
SAVED_LIBS=$LIBS
|
||||||
LIBS=$SAVED_LIBS
|
LIBS="$LIBS $OPENSSL_LIBS"
|
||||||
if test "$have_openssl" = yes; then
|
AC_CHECK_LIB(ssl, SSL_new, [
|
||||||
SAVED_CPPFLAGS=$CPPFLAGS
|
|
||||||
if test -n "$openssl_path"; then
|
if test -n "$openssl_path"; then
|
||||||
CPPFLAGS="-I$openssl_path/include $CPPFLAGS"
|
OPENSSL_CFLAGS="-I$openssl_path/include"
|
||||||
fi
|
fi
|
||||||
AC_CHECK_HEADERS(openssl/ssl.h, have_openssl_h=yes)
|
SAVED_CFLAGS=$CFLAGS
|
||||||
if test "$have_openssl_h" = yes; then
|
CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
|
||||||
|
AC_CHECK_HEADERS(openssl/ssl.h, [
|
||||||
openssl=yes
|
openssl=yes
|
||||||
AC_DEFINE(USE_OPENSSL)
|
AC_DEFINE(USE_OPENSSL)
|
||||||
LIBS="$LIBS -lssl -lcrypto"
|
OPENSSL_LIBS="$OPENSSL_LIBS -lssl"
|
||||||
if test -n "$openssl_path"; then
|
|
||||||
LIBS="-L$openssl_path/lib $LIBS"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
CPPFLAGS=$SAVED_CPPFLAGS
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl *********************************************************************
|
COMMON_LIBS="$COMMON_LIBS $OPENSSL_LIBS"
|
||||||
dnl ** LIBPROXY *********************************************************
|
COMMON_CFLAGS="$COMMON_CFLAGS $OPENSSL_CFLAGS"
|
||||||
dnl *********************************************************************
|
])
|
||||||
|
CFLAGS=$SAVED_CFLAGS
|
||||||
if test "x$libproxy" = "xyes" -o "x$libproxy" = "xauto" ; then
|
|
||||||
PKG_CHECK_MODULES([LIBPROXY], [libproxy-1.0], [
|
|
||||||
COMMON_LIBS="$COMMON_LIBS $LIBPROXY_LIBS"
|
|
||||||
COMMON_CFLAGS="$COMMON_CFLAGS $LIBPROXY_CFLAGS"
|
|
||||||
AC_DEFINE(USE_LIBPROXY)
|
|
||||||
libproxy=yes
|
|
||||||
], [
|
|
||||||
if test "x$libproxy" = "xyes" ; then
|
|
||||||
AC_MSG_ERROR(Cannot find libproxy!)
|
|
||||||
fi
|
|
||||||
libproxy=no
|
|
||||||
])
|
])
|
||||||
else
|
LIBS=$SAVED_LIBS
|
||||||
libproxy=no
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl *********************************************************************
|
dnl *********************************************************************
|
||||||
@@ -440,6 +401,10 @@ dnl *********************************************************************
|
|||||||
|
|
||||||
if test "$plugin" = yes; then
|
if test "$plugin" = yes; then
|
||||||
AC_DEFINE(USE_PLUGIN)
|
AC_DEFINE(USE_PLUGIN)
|
||||||
|
PLUGIN_LDFLAGS="-avoid-version"
|
||||||
|
if test "$platform_win32" = yes; then
|
||||||
|
PLUGIN_LDFLAGS="$PLUGIN_LDFLAGS -no-undefined"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl *********************************************************************
|
dnl *********************************************************************
|
||||||
@@ -450,14 +415,8 @@ if test "$checksum" != "no"; then
|
|||||||
checksum=no
|
checksum=no
|
||||||
AC_MSG_CHECKING(for plugin interface used by Checksum)
|
AC_MSG_CHECKING(for plugin interface used by Checksum)
|
||||||
if test "$plugin" = yes; then
|
if test "$plugin" = yes; then
|
||||||
|
checksum=yes
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
AC_MSG_CHECKING(for OpenSSL used by Checksum)
|
|
||||||
if test "$openssl" = yes; then
|
|
||||||
checksum=yes
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
else
|
|
||||||
AC_MSG_RESULT([OpenSSL cannot be found, use the --enable-openssl option])
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option])
|
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option])
|
||||||
fi
|
fi
|
||||||
@@ -523,8 +482,7 @@ if test "x$dbus" = "xyes" ; then
|
|||||||
dbus=no
|
dbus=no
|
||||||
])
|
])
|
||||||
AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool, no)
|
AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool, no)
|
||||||
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal, no)
|
if test "x$DBUS_BINDING_TOOL" = "xno" || test "x$dbus" = "xno" ; then
|
||||||
if test "x$DBUS_BINDING_TOOL" = "xno" || test "x$GLIB_GENMARSHAL" = "xno" || test "x$dbus" = "xno" ; then
|
|
||||||
dbus="no"
|
dbus="no"
|
||||||
else
|
else
|
||||||
COMMON_LIBS="$COMMON_LIBS $DBUS_LIBS"
|
COMMON_LIBS="$COMMON_LIBS $DBUS_LIBS"
|
||||||
@@ -584,6 +542,17 @@ if test "x$isocodes" = "xyes" ; then
|
|||||||
])
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
dnl *********************************************************************
|
||||||
|
dnl ** Static Analysis **************************************************
|
||||||
|
dnl *********************************************************************
|
||||||
|
|
||||||
|
if test "x$analyze" = "xyes"; then
|
||||||
|
if test "$CC" != "clang"; then
|
||||||
|
AC_MSG_WARN(CC is not clang for static analysis)
|
||||||
|
analyze=no
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
dnl *********************************************************************
|
dnl *********************************************************************
|
||||||
dnl ** CONDITIONALS *****************************************************
|
dnl ** CONDITIONALS *****************************************************
|
||||||
dnl *********************************************************************
|
dnl *********************************************************************
|
||||||
@@ -591,7 +560,6 @@ dnl *********************************************************************
|
|||||||
AM_CONDITIONAL(USE_OPENSSL, test "x$openssl" = "xyes")
|
AM_CONDITIONAL(USE_OPENSSL, test "x$openssl" = "xyes")
|
||||||
AM_CONDITIONAL(USE_LIBNOTIFY, test "x$libnotify" = "xyes")
|
AM_CONDITIONAL(USE_LIBNOTIFY, test "x$libnotify" = "xyes")
|
||||||
AM_CONDITIONAL(USE_LIBCANBERRA, test "x$libcanberra" = "xyes")
|
AM_CONDITIONAL(USE_LIBCANBERRA, test "x$libcanberra" = "xyes")
|
||||||
AM_CONDITIONAL(USE_MSPROXY, test "x$ntlm" = "xyes")
|
|
||||||
AM_CONDITIONAL(DO_TEXT, test "x$textfe" = "xyes")
|
AM_CONDITIONAL(DO_TEXT, test "x$textfe" = "xyes")
|
||||||
AM_CONDITIONAL(DO_GTK, test "x$gtkfe" = "xyes")
|
AM_CONDITIONAL(DO_GTK, test "x$gtkfe" = "xyes")
|
||||||
AM_CONDITIONAL(DO_PERL, test "x$perl" = "xyes")
|
AM_CONDITIONAL(DO_PERL, test "x$perl" = "xyes")
|
||||||
@@ -601,41 +569,11 @@ AM_CONDITIONAL(DO_CHECKSUM, test "x$checksum" = "xyes")
|
|||||||
AM_CONDITIONAL(DO_DOAT, test "x$doat" = "xyes")
|
AM_CONDITIONAL(DO_DOAT, test "x$doat" = "xyes")
|
||||||
AM_CONDITIONAL(DO_FISHLIM, test "x$fishlim" = "xyes")
|
AM_CONDITIONAL(DO_FISHLIM, test "x$fishlim" = "xyes")
|
||||||
AM_CONDITIONAL(DO_SYSINFO, test "x$sysinfo" = "xyes")
|
AM_CONDITIONAL(DO_SYSINFO, test "x$sysinfo" = "xyes")
|
||||||
|
AM_CONDITIONAL(DO_STATIC_ANALYSIS, test "x$analyze" = "xyes")
|
||||||
AM_CONDITIONAL(USE_DBUS, test "x$dbus" = "xyes")
|
AM_CONDITIONAL(USE_DBUS, test "x$dbus" = "xyes")
|
||||||
AM_CONDITIONAL(HAVE_ISO_CODES, test "x$isocodes" = "xyes")
|
AM_CONDITIONAL(HAVE_ISO_CODES, test "x$isocodes" = "xyes")
|
||||||
AM_CONDITIONAL(WITH_TM, test "x$theme_manager" != "xno")
|
AM_CONDITIONAL(WITH_TM, test "x$theme_manager" != "xno")
|
||||||
|
|
||||||
dnl *********************************************************************
|
|
||||||
dnl ** SOCKS5 ***********************************************************
|
|
||||||
dnl *********************************************************************
|
|
||||||
|
|
||||||
if test "$socks" = yes; then
|
|
||||||
socks=no
|
|
||||||
AC_CHECK_LIB(socks5, SOCKSconnect, have_socks=yes)
|
|
||||||
if test "$have_socks" = yes; then
|
|
||||||
AC_CHECK_HEADERS(socks.h, have_socks_h=yes)
|
|
||||||
if test "$have_socks_h" = yes; then
|
|
||||||
socks=yes
|
|
||||||
AC_DEFINE(SOCKS)
|
|
||||||
LIBS="$LIBS -lsocks5"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl *********************************************************************
|
|
||||||
dnl ** MS PROXY *********************************************************
|
|
||||||
dnl *********************************************************************
|
|
||||||
|
|
||||||
have_ntlm="no"
|
|
||||||
if test "x$ntlm" = "xyes" ; then
|
|
||||||
have_ntlm="no"
|
|
||||||
AC_CHECK_LIB(ntlm, ntlm_smb_encrypt, have_ntlm=yes)
|
|
||||||
if test "$have_ntlm" = yes; then
|
|
||||||
LIBS="$LIBS -lntlm"
|
|
||||||
AC_DEFINE(USE_MSPROXY)
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl *********************************************************************
|
dnl *********************************************************************
|
||||||
dnl ** GCC FLAGS ********************************************************
|
dnl ** GCC FLAGS ********************************************************
|
||||||
dnl *********************************************************************
|
dnl *********************************************************************
|
||||||
@@ -742,8 +680,7 @@ AC_TRY_COMPILE(
|
|||||||
],
|
],
|
||||||
AC_MSG_RESULT(no))
|
AC_MSG_RESULT(no))
|
||||||
|
|
||||||
dnl if we don\'t have this, use g_snprintf instead
|
AC_CHECK_FUNCS(memrchr)
|
||||||
AC_CHECK_FUNCS(snprintf vsnprintf memrchr strtoull)
|
|
||||||
|
|
||||||
AC_CHECK_FUNC(gethostbyname, ,
|
AC_CHECK_FUNC(gethostbyname, ,
|
||||||
AC_CHECK_LIB(resolv, gethostbyname, ,
|
AC_CHECK_LIB(resolv, gethostbyname, ,
|
||||||
@@ -792,12 +729,12 @@ AC_SUBST(PY_CFLAGS)
|
|||||||
AC_SUBST(PY_LIBS)
|
AC_SUBST(PY_LIBS)
|
||||||
AC_SUBST(DBUS_CFLAGS)
|
AC_SUBST(DBUS_CFLAGS)
|
||||||
AC_SUBST(DBUS_LIBS)
|
AC_SUBST(DBUS_LIBS)
|
||||||
|
AC_SUBST(OPENSSL_LIBS)
|
||||||
|
AC_SUBST(OPENSSL_CFLAGS)
|
||||||
|
AC_SUBST(PLUGIN_LDFLAGS)
|
||||||
|
|
||||||
m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], AC_SUBST([pkgconfigdir], ${libdir}/pkgconfig))
|
m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], AC_SUBST([pkgconfigdir], ${libdir}/pkgconfig))
|
||||||
|
|
||||||
PLUGIN_INCLUDES='-I$(top_srcdir)/plugins'
|
|
||||||
AC_SUBST(PLUGIN_INCLUDES)
|
|
||||||
|
|
||||||
dnl for plugin.c and pixmaps.c
|
dnl for plugin.c and pixmaps.c
|
||||||
test "x$prefix" = xNONE && prefix="$ac_default_prefix"
|
test "x$prefix" = xNONE && prefix="$ac_default_prefix"
|
||||||
test "x$exec_prefix" = xNONE && exec_prefix="$prefix"
|
test "x$exec_prefix" = xNONE && exec_prefix="$prefix"
|
||||||
@@ -855,10 +792,6 @@ echo D-Bus support ......... : $dbus
|
|||||||
echo libnotify support ..... : $libnotify
|
echo libnotify support ..... : $libnotify
|
||||||
echo libcanberra support ... : $libcanberra
|
echo libcanberra support ... : $libcanberra
|
||||||
echo Plugin interface ...... : $plugin
|
echo Plugin interface ...... : $plugin
|
||||||
echo NLS/gettext ........... : $USE_NLS
|
|
||||||
echo IPv6 support .......... : $ipv6
|
|
||||||
echo MS Proxy NTLM \(ISA\) ... : $have_ntlm
|
|
||||||
echo libproxy support ...... : $libproxy
|
|
||||||
echo
|
echo
|
||||||
echo Perl .................. : $perl
|
echo Perl .................. : $perl
|
||||||
echo Python ................ : $python
|
echo Python ................ : $python
|
||||||
|
8
m4/clang-analyze.am
Normal file
8
m4/clang-analyze.am
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
analysis_verbose = $(analysis_verbose_$(V))
|
||||||
|
analysis_verbose_ = $(analysis_verbose_$(AM_DEFAULT_VERBOSITY))
|
||||||
|
analysis_verbose_0 = @echo " CCSA " $@; $(COMPILE) --analyze $< -o $@;
|
||||||
|
analysis_verbose_1 = $(COMPILE) --analyze $< -o $@;
|
||||||
|
|
||||||
|
%.plist: %.c
|
||||||
|
$(analysis_verbose)
|
||||||
|
|
@@ -2,7 +2,8 @@
|
|||||||
<app-bundle>
|
<app-bundle>
|
||||||
|
|
||||||
<meta>
|
<meta>
|
||||||
<prefix name="default">${env:JHBUILD_PREFIX}</prefix>
|
<prefix name="default">/usr/local</prefix>
|
||||||
|
<prefix name="enchant">/usr/local/opt/enchant-applespell</prefix>
|
||||||
<destination overwrite="yes">${project}</destination>
|
<destination overwrite="yes">${project}</destination>
|
||||||
|
|
||||||
<run-install-name-tool/>
|
<run-install-name-tool/>
|
||||||
@@ -21,25 +22,12 @@
|
|||||||
</binary>
|
</binary>
|
||||||
|
|
||||||
<binary>
|
<binary>
|
||||||
${prefix}/lib/libenchant.dylib
|
${prefix:enchant}/lib/libenchant.dylib
|
||||||
</binary>
|
</binary>
|
||||||
<binary>
|
<binary>
|
||||||
${prefix}/lib/enchant/libenchant_applespell.so
|
${prefix:enchant}/lib/enchant/libenchant_applespell.so
|
||||||
</binary>
|
</binary>
|
||||||
|
|
||||||
<binary dest="${bundle}/Contents/MacOS">
|
|
||||||
${prefix}/bin/python
|
|
||||||
</binary>
|
|
||||||
<binary>
|
|
||||||
${prefix}/lib/libpython2.7.dylib
|
|
||||||
</binary>
|
|
||||||
<data>
|
|
||||||
${prefix}/lib/python2.7/
|
|
||||||
</data>
|
|
||||||
<data>
|
|
||||||
${prefix}/include/python2.7/pyconfig.h
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<binary>
|
<binary>
|
||||||
${prefix}/lib/${gtkdir}/modules/*.so
|
${prefix}/lib/${gtkdir}/modules/*.so
|
||||||
</binary>
|
</binary>
|
||||||
@@ -59,7 +47,7 @@
|
|||||||
${prefix}/lib/pango/${pkg:pango:pango_module_version}/modules/
|
${prefix}/lib/pango/${pkg:pango:pango_module_version}/modules/
|
||||||
</binary>
|
</binary>
|
||||||
<data>
|
<data>
|
||||||
${prefix}/share/themes/Mac/
|
${prefix}/share/themes/Mac/gtk-2.0-key/gtkrc
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<translations name="gtk20">
|
<translations name="gtk20">
|
||||||
@@ -77,7 +65,4 @@
|
|||||||
${project}/hexchat.icns
|
${project}/hexchat.icns
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<!-- icon-theme icons="none">
|
|
||||||
</icon-theme -->
|
|
||||||
|
|
||||||
</app-bundle>
|
</app-bundle>
|
||||||
|
@@ -36,10 +36,6 @@ export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders"
|
|||||||
export PANGO_LIBDIR="$bundle_lib"
|
export PANGO_LIBDIR="$bundle_lib"
|
||||||
export PANGO_SYSCONFDIR="$bundle_etc"
|
export PANGO_SYSCONFDIR="$bundle_etc"
|
||||||
|
|
||||||
export PYTHON="$bundle_contents/MacOS/python"
|
|
||||||
export PYTHONHOME="$bundle_res"
|
|
||||||
export PYTHONPATH="$bundle_lib/python2.7:$bundle_lib/python2.7/site-packages"
|
|
||||||
|
|
||||||
export OPENSSL_CONF="/System/Library/OpenSSL/openssl.cnf"
|
export OPENSSL_CONF="/System/Library/OpenSSL/openssl.cnf"
|
||||||
|
|
||||||
export HEXCHAT_LIBDIR="$bundle_lib/hexchat/plugins"
|
export HEXCHAT_LIBDIR="$bundle_lib/hexchat/plugins"
|
||||||
|
@@ -1,24 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if [ -z "$JHBUILD_PREFIX" ]; then
|
|
||||||
echo "You must run this within a jhbuild shell."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f $JHBUILD_PREFIX/bin/python ]; then
|
|
||||||
echo "You must install python with jhbuild."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -rf HexChat.app
|
rm -rf HexChat.app
|
||||||
rm -f *.app.zip
|
rm -f *.app.zip
|
||||||
|
|
||||||
$JHBUILD_PREFIX/bin/python $HOME/.local/bin/gtk-mac-bundler hexchat.bundle
|
python $HOME/.local/bin/gtk-mac-bundler hexchat.bundle
|
||||||
|
|
||||||
# These take up a lot of space in the bundle
|
|
||||||
echo "Cleaning up python files"
|
|
||||||
find ./HexChat.app/Contents/Resources/lib/python2.7 -name "*.pyc" -delete
|
|
||||||
find ./HexChat.app/Contents/Resources/lib/python2.7 -name "*.pyo" -delete
|
|
||||||
|
|
||||||
echo "Compressing bundle"
|
echo "Compressing bundle"
|
||||||
#hdiutil create -format UDBZ -srcdir HexChat.app -quiet HexChat-2.9.6.1-$(git rev-parse --short master).dmg
|
#hdiutil create -format UDBZ -srcdir HexChat.app -quiet HexChat-2.9.6.1-$(git rev-parse --short master).dmg
|
||||||
|
@@ -2,6 +2,6 @@ libdir = $(hexchatlibdir)
|
|||||||
|
|
||||||
lib_LTLIBRARIES = checksum.la
|
lib_LTLIBRARIES = checksum.la
|
||||||
checksum_la_SOURCES = checksum.c
|
checksum_la_SOURCES = checksum.c
|
||||||
checksum_la_LDFLAGS = -avoid-version -module
|
checksum_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module
|
||||||
checksum_la_LIBADD =
|
checksum_la_LIBADD = $(GLIB_LIBS)
|
||||||
AM_CPPFLAGS = $(COMMON_CFLAGS) -I$(srcdir)/../../src/common
|
checksum_la_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)/src/common
|
||||||
|
@@ -20,131 +20,40 @@
|
|||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#include "config.h"
|
||||||
#define __AVAILABILITYMACROS__
|
|
||||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <errno.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <openssl/sha.h>
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
#include <glib/gstdio.h>
|
||||||
#ifdef WIN32
|
#include <gio/gio.h>
|
||||||
#ifndef snprintf
|
|
||||||
#define snprintf _snprintf
|
|
||||||
#endif
|
|
||||||
#define stat _stat64
|
|
||||||
#else
|
|
||||||
/* for INT_MAX */
|
|
||||||
#include <limits.h>
|
|
||||||
#define __USE_LARGEFILE64
|
|
||||||
#define _LARGEFILE_SOURCE
|
|
||||||
#define _LARGEFILE64_SOURCE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "hexchat-plugin.h"
|
#include "hexchat-plugin.h"
|
||||||
|
|
||||||
#define BUFSIZE 32768
|
#define BUFSIZE 32768
|
||||||
#define DEFAULT_LIMIT 256 /* default size is 256 MiB */
|
#define DEFAULT_LIMIT 256 /* default size is 256 MiB */
|
||||||
|
#define SHA256_DIGEST_LENGTH 32
|
||||||
|
#define SHA256_BUFFER_LENGTH 65
|
||||||
|
|
||||||
static hexchat_plugin *ph; /* plugin handle */
|
static hexchat_plugin *ph; /* plugin handle */
|
||||||
static char name[] = "Checksum";
|
static char name[] = "Checksum";
|
||||||
static char desc[] = "Calculate checksum for DCC file transfers";
|
static char desc[] = "Calculate checksum for DCC file transfers";
|
||||||
static char version[] = "3.1";
|
static char version[] = "3.1";
|
||||||
|
|
||||||
/* Use of OpenSSL SHA256 interface: http://adamlamers.com/?p=5 */
|
|
||||||
static void
|
static void
|
||||||
sha256_hash_string (unsigned char hash[SHA256_DIGEST_LENGTH], char outputBuffer[65])
|
set_limit (char *size)
|
||||||
{
|
{
|
||||||
int i;
|
int limit = atoi (size);
|
||||||
for (i = 0; i < SHA256_DIGEST_LENGTH; i++)
|
|
||||||
|
if (limit > 0 && limit < INT_MAX)
|
||||||
{
|
{
|
||||||
sprintf (outputBuffer + (i * 2), "%02x", hash[i]);
|
if (hexchat_pluginpref_set_int (ph, "limit", limit))
|
||||||
}
|
hexchat_printf (ph, "Checksum: File size limit has successfully been set to: %d MiB\n", limit);
|
||||||
outputBuffer[64] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
static void
|
|
||||||
sha256 (char *string, char outputBuffer[65])
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
unsigned char hash[SHA256_DIGEST_LENGTH];
|
|
||||||
SHA256_CTX sha256;
|
|
||||||
|
|
||||||
SHA256_Init (&sha256);
|
|
||||||
SHA256_Update (&sha256, string, strlen (string));
|
|
||||||
SHA256_Final (hash, &sha256);
|
|
||||||
|
|
||||||
for (i = 0; i < SHA256_DIGEST_LENGTH; i++)
|
|
||||||
{
|
|
||||||
sprintf (outputBuffer + (i * 2), "%02x", hash[i]);
|
|
||||||
}
|
|
||||||
outputBuffer[64] = 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int
|
|
||||||
sha256_file (char *path, char outputBuffer[65])
|
|
||||||
{
|
|
||||||
int bytesRead;
|
|
||||||
unsigned char *buffer;
|
|
||||||
unsigned char hash[SHA256_DIGEST_LENGTH];
|
|
||||||
SHA256_CTX sha256;
|
|
||||||
|
|
||||||
FILE *file = fopen (path, "rb");
|
|
||||||
if (!file)
|
|
||||||
{
|
|
||||||
return -534;
|
|
||||||
}
|
|
||||||
|
|
||||||
SHA256_Init (&sha256);
|
|
||||||
buffer = malloc (BUFSIZE);
|
|
||||||
bytesRead = 0;
|
|
||||||
|
|
||||||
if (!buffer)
|
|
||||||
{
|
|
||||||
fclose (file);
|
|
||||||
return ENOMEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
while ((bytesRead = fread (buffer, 1, BUFSIZE, file)))
|
|
||||||
{
|
|
||||||
SHA256_Update (&sha256, buffer, bytesRead);
|
|
||||||
}
|
|
||||||
|
|
||||||
SHA256_Final (hash, &sha256);
|
|
||||||
sha256_hash_string (hash, outputBuffer);
|
|
||||||
|
|
||||||
fclose (file);
|
|
||||||
free (buffer);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
set_limit (char* size)
|
|
||||||
{
|
|
||||||
int buffer = atoi (size);
|
|
||||||
|
|
||||||
if (buffer > 0 && buffer < INT_MAX)
|
|
||||||
{
|
|
||||||
if (hexchat_pluginpref_set_int (ph, "limit", buffer))
|
|
||||||
{
|
|
||||||
hexchat_printf (ph, "File size limit has successfully been set to: %d MiB\n", buffer);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
hexchat_printf (ph, "Checksum: File access error while saving!\n");
|
||||||
hexchat_printf (ph, "File access error while saving!\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
hexchat_printf (ph, "Invalid input!\n");
|
hexchat_printf (ph, "Checksum: Invalid input!\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,89 +62,152 @@ get_limit ()
|
|||||||
{
|
{
|
||||||
int size = hexchat_pluginpref_get_int (ph, "limit");
|
int size = hexchat_pluginpref_get_int (ph, "limit");
|
||||||
|
|
||||||
if (size <= -1 || size >= INT_MAX)
|
if (size <= 0 || size >= INT_MAX)
|
||||||
{
|
|
||||||
return DEFAULT_LIMIT;
|
return DEFAULT_LIMIT;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
return size;
|
return size;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static gboolean
|
||||||
print_limit ()
|
check_limit (GFile *file)
|
||||||
{
|
{
|
||||||
hexchat_printf (ph, "File size limit for checksums: %d MiB", get_limit ());
|
GFileInfo *file_info;
|
||||||
|
goffset file_size;
|
||||||
|
|
||||||
|
file_info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_SIZE, G_FILE_QUERY_INFO_NONE,
|
||||||
|
NULL, NULL);
|
||||||
|
|
||||||
|
if (!file_info)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
file_size = g_file_info_get_size (file_info);
|
||||||
|
g_object_unref (file_info);
|
||||||
|
|
||||||
|
if (file_size > get_limit () * 1048576ll)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
sha256_from_stream (GFileInputStream *file_stream, char out_buf[])
|
||||||
|
{
|
||||||
|
GChecksum *checksum;
|
||||||
|
gssize bytes_read;
|
||||||
|
guint8 digest[SHA256_DIGEST_LENGTH];
|
||||||
|
gsize digest_len = sizeof(digest);
|
||||||
|
guchar buffer[BUFSIZE];
|
||||||
|
gsize i;
|
||||||
|
|
||||||
|
checksum = g_checksum_new (G_CHECKSUM_SHA256);
|
||||||
|
|
||||||
|
while ((bytes_read = g_input_stream_read (G_INPUT_STREAM (file_stream), buffer, sizeof (buffer), NULL, NULL)))
|
||||||
|
{
|
||||||
|
if (bytes_read == -1)
|
||||||
|
{
|
||||||
|
g_checksum_free (checksum);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_checksum_update (checksum, buffer, bytes_read);
|
||||||
|
}
|
||||||
|
|
||||||
|
g_checksum_get_digest (checksum, digest, &digest_len);
|
||||||
|
g_checksum_free (checksum);
|
||||||
|
|
||||||
|
for (i = 0; i < SHA256_DIGEST_LENGTH; i++)
|
||||||
|
{
|
||||||
|
/* out_buf will be exactly SHA256_BUFFER_LENGTH including null */
|
||||||
|
g_sprintf (out_buf + (i * 2), "%02x", digest[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
sha256_from_file (char *filename, char out_buf[])
|
||||||
|
{
|
||||||
|
GFileInputStream *file_stream;
|
||||||
|
char *filename_fs;
|
||||||
|
GFile *file;
|
||||||
|
|
||||||
|
filename_fs = g_filename_from_utf8 (filename, -1, NULL, NULL, NULL);
|
||||||
|
if (!filename_fs)
|
||||||
|
{
|
||||||
|
hexchat_printf (ph, "Checksum: Invalid filename (%s)\n", filename);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
file = g_file_new_for_path (filename_fs);
|
||||||
|
g_free (filename_fs);
|
||||||
|
if (!file)
|
||||||
|
{
|
||||||
|
hexchat_printf (ph, "Checksum: Failed to open %s\n", filename);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!check_limit (file))
|
||||||
|
{
|
||||||
|
hexchat_printf (ph, "Checksum: %s is larger than size limit. You can increase it with /CHECKSUM SET.\n", filename);
|
||||||
|
g_object_unref (file);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
file_stream = g_file_read (file, NULL, NULL);
|
||||||
|
if (!file_stream)
|
||||||
|
{
|
||||||
|
hexchat_printf (ph, "Checksum: Failed to read file %s\n", filename);
|
||||||
|
g_object_unref (file);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!sha256_from_stream (file_stream, out_buf))
|
||||||
|
{
|
||||||
|
hexchat_printf (ph, "Checksum: Failed to generate checksum for %s\n", filename);
|
||||||
|
g_object_unref (file_stream);
|
||||||
|
g_object_unref (file);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_object_unref (file_stream);
|
||||||
|
g_object_unref (file);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
dccrecv_cb (char *word[], void *userdata)
|
dccrecv_cb (char *word[], void *userdata)
|
||||||
{
|
{
|
||||||
int result;
|
const char *dcc_completed_dir;
|
||||||
struct stat buffer; /* buffer for storing file info */
|
char *filename, checksum[SHA256_BUFFER_LENGTH];
|
||||||
char sum[65]; /* buffer for checksum */
|
|
||||||
const char *file;
|
|
||||||
char *cfile;
|
|
||||||
|
|
||||||
if (hexchat_get_prefs (ph, "dcc_completed_dir", &file, NULL) == 1 && file[0] != 0)
|
/* Print in the privmsg tab of the sender */
|
||||||
{
|
hexchat_set_context (ph, hexchat_find_context (ph, NULL, word[3]));
|
||||||
cfile = g_strconcat (file, G_DIR_SEPARATOR_S, word[1], NULL);
|
|
||||||
}
|
if (hexchat_get_prefs (ph, "dcc_completed_dir", &dcc_completed_dir, NULL) == 1 && dcc_completed_dir[0] != '\0')
|
||||||
|
filename = g_build_filename (dcc_completed_dir, word[1], NULL);
|
||||||
else
|
else
|
||||||
|
filename = g_strdup (word[2]);
|
||||||
|
|
||||||
|
if (sha256_from_file (filename, checksum))
|
||||||
{
|
{
|
||||||
cfile = g_strdup(word[2]);
|
hexchat_printf (ph, "SHA-256 checksum for %s (local): %s\n", word[1], checksum);
|
||||||
}
|
}
|
||||||
|
|
||||||
result = stat (cfile, &buffer);
|
g_free (filename);
|
||||||
if (result == 0) /* stat returns 0 on success */
|
|
||||||
{
|
|
||||||
if (buffer.st_size <= (unsigned long long) get_limit () * 1048576)
|
|
||||||
{
|
|
||||||
sha256_file (cfile, sum); /* file is the full filename even if completed dir set */
|
|
||||||
/* try to print the checksum in the privmsg tab of the sender */
|
|
||||||
hexchat_set_context (ph, hexchat_find_context (ph, NULL, word[3]));
|
|
||||||
hexchat_printf (ph, "SHA-256 checksum for %s (local): %s\n", word[1], sum);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
hexchat_set_context (ph, hexchat_find_context (ph, NULL, word[3]));
|
|
||||||
hexchat_printf (ph, "SHA-256 checksum for %s (local): (size limit reached, no checksum calculated, you can increase it with /CHECKSUM INC)\n", word[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
hexchat_printf (ph, "File access error!\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
g_free (cfile);
|
|
||||||
return HEXCHAT_EAT_NONE;
|
return HEXCHAT_EAT_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
dccoffer_cb (char *word[], void *userdata)
|
dccoffer_cb (char *word[], void *userdata)
|
||||||
{
|
{
|
||||||
int result;
|
char checksum[SHA256_BUFFER_LENGTH];
|
||||||
struct stat buffer; /* buffer for storing file info */
|
|
||||||
char sum[65]; /* buffer for checksum */
|
|
||||||
|
|
||||||
result = stat (word[3], &buffer);
|
/* Print in the privmsg tab of the receiver */
|
||||||
if (result == 0) /* stat returns 0 on success */
|
hexchat_set_context (ph, hexchat_find_context (ph, NULL, word[3]));
|
||||||
|
|
||||||
|
if (sha256_from_file (word[3], checksum))
|
||||||
{
|
{
|
||||||
if (buffer.st_size <= (unsigned long long) get_limit () * 1048576)
|
hexchat_commandf (ph, "quote PRIVMSG %s :SHA-256 checksum for %s (remote): %s", word[2], word[1], checksum);
|
||||||
{
|
|
||||||
sha256_file (word[3], sum); /* word[3] is the full filename */
|
|
||||||
hexchat_commandf (ph, "quote PRIVMSG %s :SHA-256 checksum for %s (remote): %s", word[2], word[1], sum);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
hexchat_set_context (ph, hexchat_find_context (ph, NULL, word[3]));
|
|
||||||
hexchat_printf (ph, "quote PRIVMSG %s :SHA-256 checksum for %s (remote): (size limit reached, no checksum calculated)", word[2], word[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
hexchat_printf (ph, "File access error!\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return HEXCHAT_EAT_NONE;
|
return HEXCHAT_EAT_NONE;
|
||||||
@@ -246,7 +218,7 @@ checksum (char *word[], char *word_eol[], void *userdata)
|
|||||||
{
|
{
|
||||||
if (!g_ascii_strcasecmp ("GET", word[2]))
|
if (!g_ascii_strcasecmp ("GET", word[2]))
|
||||||
{
|
{
|
||||||
print_limit ();
|
hexchat_printf (ph, "File size limit for checksums: %d MiB", get_limit ());
|
||||||
}
|
}
|
||||||
else if (!g_ascii_strcasecmp ("SET", word[2]))
|
else if (!g_ascii_strcasecmp ("SET", word[2]))
|
||||||
{
|
{
|
||||||
@@ -259,7 +231,7 @@ checksum (char *word[], char *word_eol[], void *userdata)
|
|||||||
hexchat_printf (ph, " SET <filesize> - set the maximum file size (in MiB) to be hashed\n");
|
hexchat_printf (ph, " SET <filesize> - set the maximum file size (in MiB) to be hashed\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return HEXCHAT_EAT_NONE;
|
return HEXCHAT_EAT_ALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@@ -277,7 +249,7 @@ hexchat_plugin_init (hexchat_plugin *plugin_handle, char **plugin_name, char **p
|
|||||||
hexchat_pluginpref_set_int (ph, "limit", DEFAULT_LIMIT);
|
hexchat_pluginpref_set_int (ph, "limit", DEFAULT_LIMIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
hexchat_hook_command (ph, "CHECKSUM", HEXCHAT_PRI_NORM, checksum, "Usage: /CHECKSUM GET|SET", 0);
|
hexchat_hook_command (ph, "CHECKSUM", HEXCHAT_PRI_NORM, checksum, "Usage: /CHECKSUM GET|SET", NULL);
|
||||||
hexchat_hook_print (ph, "DCC RECV Complete", HEXCHAT_PRI_NORM, dccrecv_cb, NULL);
|
hexchat_hook_print (ph, "DCC RECV Complete", HEXCHAT_PRI_NORM, dccrecv_cb, NULL);
|
||||||
hexchat_hook_print (ph, "DCC Offer", HEXCHAT_PRI_NORM, dccoffer_cb, NULL);
|
hexchat_hook_print (ph, "DCC Offer", HEXCHAT_PRI_NORM, dccoffer_cb, NULL);
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@ libdir = $(hexchatlibdir)
|
|||||||
|
|
||||||
lib_LTLIBRARIES = doat.la
|
lib_LTLIBRARIES = doat.la
|
||||||
doat_la_SOURCES = doat.c
|
doat_la_SOURCES = doat.c
|
||||||
doat_la_LDFLAGS = -avoid-version -module
|
doat_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module
|
||||||
doat_la_LIBADD =
|
doat_la_LIBADD = $(GLIB_LIBS)
|
||||||
AM_CPPFLAGS = $(COMMON_CFLAGS) -I$(srcdir)/../../src/common
|
doat_la_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)/src/common
|
||||||
|
|
||||||
|
@@ -5,9 +5,12 @@
|
|||||||
* http://sam.zoy.org/wtfpl/COPYING or http://lwsitu.com/xchat/COPYING
|
* http://sam.zoy.org/wtfpl/COPYING or http://lwsitu.com/xchat/COPYING
|
||||||
* for more details. */
|
* for more details. */
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <glib.h>
|
||||||
#include "hexchat-plugin.h"
|
#include "hexchat-plugin.h"
|
||||||
|
|
||||||
static hexchat_plugin *ph;
|
static hexchat_plugin *ph;
|
||||||
@@ -31,7 +34,7 @@ parse_command( char *word[], char *word_eol[], void *userdata ) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
channel = strdup( token );
|
channel = g_strdup( token );
|
||||||
|
|
||||||
delimiter = strchr( channel, '/' );
|
delimiter = strchr( channel, '/' );
|
||||||
|
|
||||||
@@ -40,13 +43,13 @@ parse_command( char *word[], char *word_eol[], void *userdata ) {
|
|||||||
*delimiter = '\0';
|
*delimiter = '\0';
|
||||||
|
|
||||||
if( strlen( delimiter + 1 ) > 0 ) {
|
if( strlen( delimiter + 1 ) > 0 ) {
|
||||||
server = strdup( delimiter + 1 );
|
server = g_strdup( delimiter + 1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* /Network form */
|
/* /Network form */
|
||||||
if( strlen( channel ) == 0 ) {
|
if( strlen( channel ) == 0 ) {
|
||||||
free( channel );
|
g_free( channel );
|
||||||
channel = NULL;
|
channel = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,13 +61,8 @@ parse_command( char *word[], char *word_eol[], void *userdata ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( channel != NULL ) {
|
g_free( channel );
|
||||||
free( channel );
|
g_free( server );
|
||||||
}
|
|
||||||
|
|
||||||
if( server != NULL ) {
|
|
||||||
free( server );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return HEXCHAT_EAT_HEXCHAT;
|
return HEXCHAT_EAT_HEXCHAT;
|
||||||
|
@@ -62,7 +62,7 @@
|
|||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;DOAT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;DOAT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\..\src\common;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
@@ -70,6 +70,8 @@
|
|||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ModuleDefinitionFile>doat.def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>doat.def</ModuleDefinitionFile>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
@@ -80,7 +82,7 @@
|
|||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;DOAT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;DOAT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\..\src\common;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
@@ -88,6 +90,8 @@
|
|||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ModuleDefinitionFile>doat.def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>doat.def</ModuleDefinitionFile>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
@@ -3,7 +3,7 @@ EXTRA_DIST = INSTALL LICENSE
|
|||||||
libdir = $(hexchatlibdir)
|
libdir = $(hexchatlibdir)
|
||||||
|
|
||||||
lib_LTLIBRARIES = fishlim.la
|
lib_LTLIBRARIES = fishlim.la
|
||||||
fishlim_la_SOURCES = fish.c irc.c keystore.c misc.c plugin_hexchat.c
|
fishlim_la_SOURCES = fish.c irc.c keystore.c plugin_hexchat.c
|
||||||
fishlim_la_LDFLAGS = -avoid-version -module
|
fishlim_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module
|
||||||
fishlim_la_LIBADD =
|
fishlim_la_LIBADD = $(GLIB_LIBS) $(OPENSSL_LIBS)
|
||||||
AM_CPPFLAGS = $(COMMON_CFLAGS) -I$(srcdir)/../../src/common
|
fishlim_la_CFLAGS = $(GLIB_CFLAGS) $(OPENSSL_CFLAGS) -I$(top_srcdir)/src/common
|
||||||
|
@@ -39,17 +39,17 @@ static const char fish_base64[64] = "./0123456789abcdefghijklmnopqrstuvwxyzABCDE
|
|||||||
static const signed char fish_unbase64[256] = {
|
static const signed char fish_unbase64[256] = {
|
||||||
IB,IB,IB,IB,IB,IB,IB,IB, IB,IB,IB,IB,IB,IB,IB,IB,
|
IB,IB,IB,IB,IB,IB,IB,IB, IB,IB,IB,IB,IB,IB,IB,IB,
|
||||||
IB,IB,IB,IB,IB,IB,IB,IB, IB,IB,IB,IB,IB,IB,IB,IB,
|
IB,IB,IB,IB,IB,IB,IB,IB, IB,IB,IB,IB,IB,IB,IB,IB,
|
||||||
// ! " # $ % & ' ( ) * + , - . /
|
/* ! " # $ % & ' ( ) * + , - . / */
|
||||||
IB,IB,IB,IB,IB,IB,IB,IB, IB,IB,IB,IB,IB,IB, 0, 1,
|
IB,IB,IB,IB,IB,IB,IB,IB, IB,IB,IB,IB,IB,IB, 0, 1,
|
||||||
// 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
|
/* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */
|
||||||
2, 3, 4, 5, 6, 7, 8, 9, 10,11,IB,IB,IB,IB,IB,IB,
|
2, 3, 4, 5, 6, 7, 8, 9, 10,11,IB,IB,IB,IB,IB,IB,
|
||||||
// @ A B C D E F G H I J K L M N O
|
/* @ A B C D E F G H I J K L M N O */
|
||||||
IB,38,39,40,41,42,43,44, 45,46,47,48,49,50,51,52,
|
IB,38,39,40,41,42,43,44, 45,46,47,48,49,50,51,52,
|
||||||
// P Q R S T U V W X Y Z [ \ ] ^ _
|
/* P Q R S T U V W X Y Z [ \ ] ^ _*/
|
||||||
53,54,55,56,57,58,59,60, 61,62,63,IB,IB,IB,IB,IB,
|
53,54,55,56,57,58,59,60, 61,62,63,IB,IB,IB,IB,IB,
|
||||||
// ` a b c d e f g h i j k l m n o
|
/* ` a b c d e f g h i j k l m n o */
|
||||||
IB,12,13,14,15,16,17,18, 19,20,21,22,23,24,25,26,
|
IB,12,13,14,15,16,17,18, 19,20,21,22,23,24,25,26,
|
||||||
// p q r s t u v w x y z { | } ~ <del>
|
/* p q r s t u v w x y z { | } ~ <del> */
|
||||||
27,28,29,30,31,32,33,34, 35,36,37,IB,IB,IB,IB,IB,
|
27,28,29,30,31,32,33,34, 35,36,37,IB,IB,IB,IB,IB,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -75,12 +75,11 @@ char *fish_encrypt(const char *key, size_t keylen, const char *message) {
|
|||||||
|
|
||||||
messagelen = strlen(message);
|
messagelen = strlen(message);
|
||||||
if (messagelen == 0) return NULL;
|
if (messagelen == 0) return NULL;
|
||||||
encrypted = malloc(((messagelen-1)/8)*12 + 12 + 1); // each 8-byte block becomes 12 bytes
|
encrypted = g_malloc(((messagelen - 1) / 8) * 12 + 12 + 1); /* each 8-byte block becomes 12 bytes */
|
||||||
end = encrypted;
|
end = encrypted;
|
||||||
if (!encrypted) return NULL;
|
|
||||||
|
|
||||||
while (*message) {
|
while (*message) {
|
||||||
// Read 8 bytes (a Blowfish block)
|
/* Read 8 bytes (a Blowfish block) */
|
||||||
BF_LONG binary[2] = { 0, 0 };
|
BF_LONG binary[2] = { 0, 0 };
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
@@ -90,10 +89,10 @@ char *fish_encrypt(const char *key, size_t keylen, const char *message) {
|
|||||||
}
|
}
|
||||||
message += 8;
|
message += 8;
|
||||||
|
|
||||||
// Encrypt block
|
/* Encrypt block */
|
||||||
BF_encrypt(binary, &bfkey);
|
BF_encrypt(binary, &bfkey);
|
||||||
|
|
||||||
// Emit FiSH-BASE64
|
/* Emit FiSH-BASE64 */
|
||||||
bit = 0;
|
bit = 0;
|
||||||
word = 1;
|
word = 1;
|
||||||
for (j = 0; j < 12; j++) {
|
for (j = 0; j < 12; j++) {
|
||||||
@@ -106,7 +105,7 @@ char *fish_encrypt(const char *key, size_t keylen, const char *message) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop if a null terminator was found
|
/* Stop if a null terminator was found */
|
||||||
if (c == '\0') break;
|
if (c == '\0') break;
|
||||||
}
|
}
|
||||||
*end = '\0';
|
*end = '\0';
|
||||||
@@ -124,12 +123,11 @@ char *fish_decrypt(const char *key, size_t keylen, const char *data) {
|
|||||||
unsigned char d;
|
unsigned char d;
|
||||||
BF_set_key(&bfkey, keylen, (const unsigned char*)key);
|
BF_set_key(&bfkey, keylen, (const unsigned char*)key);
|
||||||
|
|
||||||
decrypted = malloc(strlen(data)+1);
|
decrypted = g_malloc(strlen(data) + 1);
|
||||||
end = decrypted;
|
end = decrypted;
|
||||||
if (!decrypted) return NULL;
|
|
||||||
|
|
||||||
while (*data) {
|
while (*data) {
|
||||||
// Convert from FiSH-BASE64
|
/* Convert from FiSH-BASE64 */
|
||||||
BF_LONG binary[2] = { 0, 0 };
|
BF_LONG binary[2] = { 0, 0 };
|
||||||
bit = 0;
|
bit = 0;
|
||||||
word = 1;
|
word = 1;
|
||||||
@@ -144,10 +142,10 @@ char *fish_decrypt(const char *key, size_t keylen, const char *data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decrypt block
|
/* Decrypt block */
|
||||||
BF_decrypt(binary, &bfkey);
|
BF_decrypt(binary, &bfkey);
|
||||||
|
|
||||||
// Copy to buffer
|
/* Copy to buffer */
|
||||||
GET_BYTES(end, binary[0]);
|
GET_BYTES(end, binary[0]);
|
||||||
GET_BYTES(end, binary[1]);
|
GET_BYTES(end, binary[1]);
|
||||||
}
|
}
|
||||||
@@ -165,14 +163,14 @@ char *fish_encrypt_for_nick(const char *nick, const char *data) {
|
|||||||
char *key;
|
char *key;
|
||||||
char *encrypted;
|
char *encrypted;
|
||||||
|
|
||||||
// Look for key
|
/* Look for key */
|
||||||
key = keystore_get_key(nick);
|
key = keystore_get_key(nick);
|
||||||
if (!key) return NULL;
|
if (!key) return NULL;
|
||||||
|
|
||||||
// Encrypt
|
/* Encrypt */
|
||||||
encrypted = fish_encrypt(key, strlen(key), data);
|
encrypted = fish_encrypt(key, strlen(key), data);
|
||||||
|
|
||||||
free(key);
|
g_free(key);
|
||||||
return encrypted;
|
return encrypted;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,14 +181,14 @@ char *fish_encrypt_for_nick(const char *nick, const char *data) {
|
|||||||
char *fish_decrypt_from_nick(const char *nick, const char *data) {
|
char *fish_decrypt_from_nick(const char *nick, const char *data) {
|
||||||
char *key;
|
char *key;
|
||||||
char *decrypted;
|
char *decrypted;
|
||||||
// Look for key
|
/* Look for key */
|
||||||
key = keystore_get_key(nick);
|
key = keystore_get_key(nick);
|
||||||
if (!key) return NULL;
|
if (!key) return NULL;
|
||||||
|
|
||||||
// Decrypt
|
/* Decrypt */
|
||||||
decrypted = fish_decrypt(key, strlen(key), data);
|
decrypted = fish_decrypt(key, strlen(key), data);
|
||||||
|
|
||||||
free(key);
|
g_free(key);
|
||||||
return decrypted;
|
return decrypted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,9 +25,10 @@
|
|||||||
#ifndef FISH_H
|
#ifndef FISH_H
|
||||||
#define FISH_H
|
#define FISH_H
|
||||||
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#include <glib.h>
|
||||||
|
|
||||||
char *fish_encrypt(const char *key, size_t keylen, const char *message);
|
char *fish_encrypt(const char *key, size_t keylen, const char *message);
|
||||||
char *fish_decrypt(const char *key, size_t keylen, const char *data);
|
char *fish_decrypt(const char *key, size_t keylen, const char *data);
|
||||||
char *fish_encrypt_for_nick(const char *nick, const char *data);
|
char *fish_encrypt_for_nick(const char *nick, const char *data);
|
||||||
|
@@ -103,14 +103,12 @@
|
|||||||
<ClInclude Include="fish.h" />
|
<ClInclude Include="fish.h" />
|
||||||
<ClInclude Include="irc.h" />
|
<ClInclude Include="irc.h" />
|
||||||
<ClInclude Include="keystore.h" />
|
<ClInclude Include="keystore.h" />
|
||||||
<ClInclude Include="misc.h" />
|
|
||||||
<ClInclude Include="plugin_hexchat.h" />
|
<ClInclude Include="plugin_hexchat.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="fish.c" />
|
<ClCompile Include="fish.c" />
|
||||||
<ClCompile Include="irc.c" />
|
<ClCompile Include="irc.c" />
|
||||||
<ClCompile Include="keystore.c" />
|
<ClCompile Include="keystore.c" />
|
||||||
<ClCompile Include="misc.c" />
|
|
||||||
<ClCompile Include="plugin_hexchat.c" />
|
<ClCompile Include="plugin_hexchat.c" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
@@ -32,9 +32,6 @@
|
|||||||
<ClInclude Include="keystore.h">
|
<ClInclude Include="keystore.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="misc.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="plugin_hexchat.h">
|
<ClInclude Include="plugin_hexchat.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@@ -49,9 +46,6 @@
|
|||||||
<ClCompile Include="keystore.c">
|
<ClCompile Include="keystore.c">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="misc.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="plugin_hexchat.c">
|
<ClCompile Include="plugin_hexchat.c">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@@ -22,8 +22,9 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include "config.h"
|
||||||
#include <string.h>
|
|
||||||
|
#include <glib.h>
|
||||||
#include "irc.h"
|
#include "irc.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,26 +32,26 @@
|
|||||||
* at spaces. The prefix and command is extracted from the message, and
|
* at spaces. The prefix and command is extracted from the message, and
|
||||||
* parameters_offset is set to the index of the first parameter.
|
* parameters_offset is set to the index of the first parameter.
|
||||||
*/
|
*/
|
||||||
bool irc_parse_message(const char *words[],
|
gboolean irc_parse_message(const char *words[],
|
||||||
const char **prefix, const char **command,
|
const char **prefix, const char **command,
|
||||||
size_t *parameters_offset) {
|
size_t *parameters_offset) {
|
||||||
size_t w = 1;
|
size_t w = 1;
|
||||||
if (prefix) *prefix = NULL;
|
if (prefix) *prefix = NULL;
|
||||||
if (command) *command = NULL;
|
if (command) *command = NULL;
|
||||||
|
|
||||||
// See if the message starts with a prefix (sender user)
|
/* See if the message starts with a prefix (sender user) */
|
||||||
if (words[w][0] == ':') {
|
if (words[w][0] == ':') {
|
||||||
if (prefix) *prefix = &words[w][1];
|
if (prefix) *prefix = &words[w][1];
|
||||||
w++;
|
w++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check command
|
/* Check command */
|
||||||
if (words[w][0] == '\0') return false;
|
if (words[w][0] == '\0') return FALSE;
|
||||||
if (command) *command = words[w];
|
if (command) *command = words[w];
|
||||||
w++;
|
w++;
|
||||||
|
|
||||||
*parameters_offset = w;
|
*parameters_offset = w;
|
||||||
return true;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -65,48 +66,15 @@ bool irc_parse_message(const char *words[],
|
|||||||
*/
|
*/
|
||||||
char *irc_prefix_get_nick(const char *prefix) {
|
char *irc_prefix_get_nick(const char *prefix) {
|
||||||
const char *end;
|
const char *end;
|
||||||
char *nick;
|
|
||||||
size_t length;
|
size_t length;
|
||||||
|
|
||||||
if (!prefix) return NULL;
|
if (!prefix) return NULL;
|
||||||
|
|
||||||
// Find end of nick
|
/* Find end of nick */
|
||||||
end = prefix;
|
end = prefix;
|
||||||
while (*end != '\0' && *end != '!' && *end != '@') end++;
|
while (*end != '\0' && *end != '!' && *end != '@') end++;
|
||||||
|
|
||||||
// Allocate string
|
/* Allocate string */
|
||||||
length = end - prefix;
|
length = end - prefix;
|
||||||
nick = malloc(length+1);
|
return g_strndup (prefix, length);
|
||||||
if (!nick) return NULL;
|
|
||||||
|
|
||||||
// Copy to string
|
|
||||||
memcpy(nick, prefix, length);
|
|
||||||
nick[length] = '\0';
|
|
||||||
return nick;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compares two nick names. Return 0 if equal. Otherwise the return value is
|
|
||||||
* less than zero if a is less than b or greater than zero if a is greater
|
|
||||||
* than b.
|
|
||||||
*/
|
|
||||||
int irc_nick_cmp(const char *a, const char *b) {
|
|
||||||
char ac;
|
|
||||||
char bc;
|
|
||||||
char diff;
|
|
||||||
for (;;) {
|
|
||||||
ac = *(a++);
|
|
||||||
bc = *(b++);
|
|
||||||
|
|
||||||
// Change into IRC uppercase (see RFC 2812 section 2.2)
|
|
||||||
if (ac >= 'a' && ac <= '~') ac &= ~0x20;
|
|
||||||
if (bc >= 'a' && bc <= '~') bc &= ~0x20;
|
|
||||||
|
|
||||||
diff = ac - bc;
|
|
||||||
if (diff) return diff;
|
|
||||||
if (!ac) return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -25,14 +25,13 @@
|
|||||||
#ifndef IRC_H
|
#ifndef IRC_H
|
||||||
#define IRC_H
|
#define IRC_H
|
||||||
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
#include <glib.h>
|
||||||
|
|
||||||
bool irc_parse_message(const char *words[],
|
gboolean irc_parse_message(const char *words[],
|
||||||
const char **prefix, const char **command,
|
const char **prefix, const char **command,
|
||||||
size_t *parameters_offset);
|
size_t *parameters_offset);
|
||||||
char *irc_prefix_get_nick(const char *prefix);
|
char *irc_prefix_get_nick(const char *prefix);
|
||||||
int irc_nick_cmp(const char *a, const char *b);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -22,12 +22,13 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "irc.h"
|
#include "irc.h"
|
||||||
#include "fish.h"
|
#include "fish.h"
|
||||||
#include "misc.h"
|
|
||||||
#include "keystore.h"
|
#include "keystore.h"
|
||||||
#include "plugin_hexchat.h"
|
#include "plugin_hexchat.h"
|
||||||
|
|
||||||
@@ -57,7 +58,7 @@ static GKeyFile *getConfigFile() {
|
|||||||
static const char *get_keystore_password() {
|
static const char *get_keystore_password() {
|
||||||
return (keystore_password != NULL ?
|
return (keystore_password != NULL ?
|
||||||
keystore_password :
|
keystore_password :
|
||||||
// Silly default value...
|
/* Silly default value... */
|
||||||
"blowinikey");
|
"blowinikey");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,17 +88,17 @@ static gchar *get_nick_value(GKeyFile *keyfile, const char *nick, const char *it
|
|||||||
* Extracts a key from the key store file.
|
* Extracts a key from the key store file.
|
||||||
*/
|
*/
|
||||||
char *keystore_get_key(const char *nick) {
|
char *keystore_get_key(const char *nick) {
|
||||||
// Get the key
|
/* Get the key */
|
||||||
GKeyFile *keyfile = getConfigFile();
|
GKeyFile *keyfile = getConfigFile();
|
||||||
gchar *value = get_nick_value(keyfile, nick, "key");
|
gchar *value = get_nick_value(keyfile, nick, "key");
|
||||||
g_key_file_free(keyfile);
|
g_key_file_free(keyfile);
|
||||||
if (!value) return NULL;
|
if (!value) return NULL;
|
||||||
|
|
||||||
if (strncmp(value, "+OK ", 4) != 0) {
|
if (strncmp(value, "+OK ", 4) != 0) {
|
||||||
// Key is stored in plaintext
|
/* Key is stored in plaintext */
|
||||||
return import_glib_string(value);
|
return value;
|
||||||
} else {
|
} else {
|
||||||
// Key is encrypted
|
/* Key is encrypted */
|
||||||
const char *encrypted = value+4;
|
const char *encrypted = value+4;
|
||||||
const char *password = get_keystore_password();
|
const char *password = get_keystore_password();
|
||||||
char *decrypted = fish_decrypt(password, strlen(password), encrypted);
|
char *decrypted = fish_decrypt(password, strlen(password), encrypted);
|
||||||
@@ -109,10 +110,10 @@ char *keystore_get_key(const char *nick) {
|
|||||||
/**
|
/**
|
||||||
* Deletes a nick and the associated key in the key store file.
|
* Deletes a nick and the associated key in the key store file.
|
||||||
*/
|
*/
|
||||||
static bool delete_nick(GKeyFile *keyfile, const char *nick) {
|
static gboolean delete_nick(GKeyFile *keyfile, const char *nick) {
|
||||||
gchar **group;
|
gchar **group;
|
||||||
gchar **groups = g_key_file_get_groups(keyfile, NULL);
|
gchar **groups = g_key_file_get_groups(keyfile, NULL);
|
||||||
bool ok = false;
|
gboolean ok = FALSE;
|
||||||
|
|
||||||
for (group = groups; *group != NULL; group++) {
|
for (group = groups; *group != NULL; group++) {
|
||||||
if (!irc_nick_cmp(*group, nick)) {
|
if (!irc_nick_cmp(*group, nick)) {
|
||||||
@@ -125,58 +126,77 @@ static bool delete_nick(GKeyFile *keyfile, const char *nick) {
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !GLIB_CHECK_VERSION(2,40,0)
|
||||||
/**
|
/**
|
||||||
* Writes the key store file to disk.
|
* Writes the key store file to disk.
|
||||||
*/
|
*/
|
||||||
static bool save_keystore(GKeyFile *keyfile) {
|
static gboolean keyfile_save_to_file (GKeyFile *keyfile, char *filename) {
|
||||||
char *filename;
|
gboolean ok;
|
||||||
bool ok;
|
|
||||||
// Serialize
|
/* Serialize */
|
||||||
gsize file_length;
|
gsize file_length;
|
||||||
gchar *file_data = g_key_file_to_data(keyfile, &file_length, NULL);
|
gchar *file_data = g_key_file_to_data(keyfile, &file_length, NULL);
|
||||||
if (!file_data) return false;
|
if (!file_data)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
// Write to file
|
/* Write to file */
|
||||||
filename = get_config_filename();
|
ok = g_file_set_contents (filename, file_data, file_length, NULL);
|
||||||
ok = g_file_set_contents(filename, file_data, file_length, NULL);
|
|
||||||
g_free(filename);
|
|
||||||
g_free(file_data);
|
g_free(file_data);
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes the key store file to disk.
|
||||||
|
*/
|
||||||
|
static gboolean save_keystore(GKeyFile *keyfile) {
|
||||||
|
char *filename;
|
||||||
|
gboolean ok;
|
||||||
|
|
||||||
|
filename = get_config_filename();
|
||||||
|
#if !GLIB_CHECK_VERSION(2,40,0)
|
||||||
|
ok = keyfile_save_to_file (keyfile, filename);
|
||||||
|
#else
|
||||||
|
ok = g_key_file_save_to_file (keyfile, filename, NULL);
|
||||||
|
#endif
|
||||||
|
g_free (filename);
|
||||||
|
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a key in the key store file.
|
* Sets a key in the key store file.
|
||||||
*/
|
*/
|
||||||
bool keystore_store_key(const char *nick, const char *key) {
|
gboolean keystore_store_key(const char *nick, const char *key) {
|
||||||
const char *password;
|
const char *password;
|
||||||
char *encrypted;
|
char *encrypted;
|
||||||
char *wrapped;
|
char *wrapped;
|
||||||
bool ok = false;
|
gboolean ok = FALSE;
|
||||||
GKeyFile *keyfile = getConfigFile();
|
GKeyFile *keyfile = getConfigFile();
|
||||||
|
|
||||||
// Remove old key
|
/* Remove old key */
|
||||||
delete_nick(keyfile, nick);
|
delete_nick(keyfile, nick);
|
||||||
|
|
||||||
// Add new key
|
/* Add new key */
|
||||||
password = get_keystore_password();
|
password = get_keystore_password();
|
||||||
if (password) {
|
if (password) {
|
||||||
// Encrypt the password
|
/* Encrypt the password */
|
||||||
encrypted = fish_encrypt(password, strlen(password), key);
|
encrypted = fish_encrypt(password, strlen(password), key);
|
||||||
if (!encrypted) goto end;
|
if (!encrypted) goto end;
|
||||||
|
|
||||||
// Prepend "+OK "
|
/* Prepend "+OK " */
|
||||||
wrapped = g_strconcat("+OK ", encrypted, NULL);
|
wrapped = g_strconcat("+OK ", encrypted, NULL);
|
||||||
g_free(encrypted);
|
g_free(encrypted);
|
||||||
|
|
||||||
// Store encrypted in file
|
/* Store encrypted in file */
|
||||||
g_key_file_set_string(keyfile, nick, "key", wrapped);
|
g_key_file_set_string(keyfile, nick, "key", wrapped);
|
||||||
free(wrapped);
|
g_free(wrapped);
|
||||||
} else {
|
} else {
|
||||||
// Store unencrypted in file
|
/* Store unencrypted in file */
|
||||||
g_key_file_set_string(keyfile, nick, "key", key);
|
g_key_file_set_string(keyfile, nick, "key", key);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save key store file
|
/* Save key store file */
|
||||||
ok = save_keystore(keyfile);
|
ok = save_keystore(keyfile);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
@@ -187,23 +207,15 @@ bool keystore_store_key(const char *nick, const char *key) {
|
|||||||
/**
|
/**
|
||||||
* Deletes a nick from the key store.
|
* Deletes a nick from the key store.
|
||||||
*/
|
*/
|
||||||
bool keystore_delete_nick(const char *nick) {
|
gboolean keystore_delete_nick(const char *nick) {
|
||||||
GKeyFile *keyfile = getConfigFile();
|
GKeyFile *keyfile = getConfigFile();
|
||||||
|
|
||||||
// Delete entry
|
/* Delete entry */
|
||||||
bool ok = delete_nick(keyfile, nick);
|
gboolean ok = delete_nick(keyfile, nick);
|
||||||
|
|
||||||
// Save
|
/* Save */
|
||||||
if (ok) save_keystore(keyfile);
|
if (ok) save_keystore(keyfile);
|
||||||
|
|
||||||
g_key_file_free(keyfile);
|
g_key_file_free(keyfile);
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void keystore_secure_free(void *ptr, size_t size) {
|
|
||||||
secure_erase(ptr, size);
|
|
||||||
free(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -25,14 +25,13 @@
|
|||||||
#ifndef KEYSTORE_H
|
#ifndef KEYSTORE_H
|
||||||
#define KEYSTORE_H
|
#define KEYSTORE_H
|
||||||
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
char *keystore_get_key(const char *nick);
|
#include <glib.h>
|
||||||
bool keystore_store_key(const char *nick, const char *key);
|
|
||||||
bool keystore_delete_nick(const char *nick);
|
|
||||||
|
|
||||||
void keystore_secure_free(void *ptr, size_t size);
|
char *keystore_get_key(const char *nick);
|
||||||
|
gboolean keystore_store_key(const char *nick, const char *key);
|
||||||
|
gboolean keystore_delete_nick(const char *nick);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -1,54 +0,0 @@
|
|||||||
/*
|
|
||||||
|
|
||||||
Copyright (c) 2010 Samuel Lidén Borell <samuel@kodafritt.se>
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <glib.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include "misc.h"
|
|
||||||
|
|
||||||
|
|
||||||
void secure_erase(void *ptr, size_t size) {
|
|
||||||
// "volatile" prevents this code from being optimized away
|
|
||||||
volatile char* volptr = ptr;
|
|
||||||
while (size--) *volptr++ = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Re-allocates a string with the native allocator.
|
|
||||||
*/
|
|
||||||
char *import_glib_string(gchar *gstr) {
|
|
||||||
size_t size;
|
|
||||||
char *native;
|
|
||||||
if (g_mem_is_system_malloc()) return gstr;
|
|
||||||
|
|
||||||
size = strlen(gstr)+1;
|
|
||||||
native = malloc(size);
|
|
||||||
memcpy(native, gstr, size);
|
|
||||||
|
|
||||||
secure_erase(gstr, size);
|
|
||||||
g_free(gstr);
|
|
||||||
return native;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
|
|
||||||
Copyright (c) 2010 Samuel Lidén Borell <samuel@kodafritt.se>
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MISC_H
|
|
||||||
#define MISC_H
|
|
||||||
|
|
||||||
void secure_erase(void *ptr, size_t size);
|
|
||||||
|
|
||||||
#ifdef __G_LIB_H__
|
|
||||||
char *import_glib_string(gchar *gstr);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
@@ -22,17 +22,14 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
// #pragma GCC visibility push(default)
|
|
||||||
#include "hexchat-plugin.h"
|
#include "hexchat-plugin.h"
|
||||||
#define HEXCHAT_MAX_WORDS 32
|
#define HEXCHAT_MAX_WORDS 32
|
||||||
// #pragma GCC visibility pop
|
|
||||||
|
|
||||||
//#define EXPORT __attribute((visibility("default")))
|
|
||||||
//#define EXPORT
|
|
||||||
|
|
||||||
#include "fish.h"
|
#include "fish.h"
|
||||||
#include "keystore.h"
|
#include "keystore.h"
|
||||||
@@ -52,27 +49,19 @@ static hexchat_plugin *ph;
|
|||||||
* Returns the path to the key store file.
|
* Returns the path to the key store file.
|
||||||
*/
|
*/
|
||||||
gchar *get_config_filename() {
|
gchar *get_config_filename() {
|
||||||
return g_build_filename(hexchat_get_info(ph, "configdir"), "addon_fishlim.conf", NULL);
|
char *filename_fs, *filename_utf8;
|
||||||
|
|
||||||
|
filename_utf8 = g_build_filename(hexchat_get_info(ph, "configdir"), "addon_fishlim.conf", NULL);
|
||||||
|
filename_fs = g_filename_from_utf8 (filename_utf8, -1, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
g_free (filename_utf8);
|
||||||
|
return filename_fs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
int irc_nick_cmp(const char *a, const char *b) {
|
||||||
* Appends data to a string. Returns true if there was sufficient memory.
|
return hexchat_nickcmp (ph, a, b);
|
||||||
* Frees *s and returns false if an error occurs.
|
|
||||||
*/
|
|
||||||
static bool append(char **s, size_t *length, const char *data) {
|
|
||||||
size_t datalen = strlen(data);
|
|
||||||
char *extended = realloc(*s, *length + datalen + 1);
|
|
||||||
if (!extended) {
|
|
||||||
free(*s);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
memcpy(extended + *length, data, datalen + 1);
|
|
||||||
*s = extended;
|
|
||||||
*length += datalen;
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*static int handle_debug(char *word[], char *word_eol[], void *userdata) {
|
/*static int handle_debug(char *word[], char *word_eol[], void *userdata) {
|
||||||
hexchat_printf(ph, "debug incoming: ");
|
hexchat_printf(ph, "debug incoming: ");
|
||||||
for (size_t i = 1; word[i] != NULL && word[i][0] != '\0'; i++) {
|
for (size_t i = 1; word[i] != NULL && word[i][0] != '\0'; i++) {
|
||||||
@@ -87,26 +76,26 @@ static bool append(char **s, size_t *length, const char *data) {
|
|||||||
*/
|
*/
|
||||||
static int handle_outgoing(char *word[], char *word_eol[], void *userdata) {
|
static int handle_outgoing(char *word[], char *word_eol[], void *userdata) {
|
||||||
const char *own_nick;
|
const char *own_nick;
|
||||||
// Encrypt the message if possible
|
/* Encrypt the message if possible */
|
||||||
const char *channel = hexchat_get_info(ph, "channel");
|
const char *channel = hexchat_get_info(ph, "channel");
|
||||||
char *encrypted = fish_encrypt_for_nick(channel, word_eol[1]);
|
char *encrypted = fish_encrypt_for_nick(channel, word_eol[1]);
|
||||||
if (!encrypted) return HEXCHAT_EAT_NONE;
|
if (!encrypted) return HEXCHAT_EAT_NONE;
|
||||||
|
|
||||||
// Display message
|
/* Display message */
|
||||||
own_nick = hexchat_get_info(ph, "nick");
|
own_nick = hexchat_get_info(ph, "nick");
|
||||||
hexchat_emit_print(ph, "Your Message", own_nick, word_eol[1], NULL);
|
hexchat_emit_print(ph, "Your Message", own_nick, word_eol[1], NULL);
|
||||||
|
|
||||||
// Send message
|
/* Send message */
|
||||||
hexchat_commandf(ph, "PRIVMSG %s :+OK %s", channel, encrypted);
|
hexchat_commandf(ph, "PRIVMSG %s :+OK %s", channel, encrypted);
|
||||||
|
|
||||||
free(encrypted);
|
g_free(encrypted);
|
||||||
return HEXCHAT_EAT_HEXCHAT;
|
return HEXCHAT_EAT_HEXCHAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a channel message or private message is received.
|
* Called when a channel message or private message is received.
|
||||||
*/
|
*/
|
||||||
static int handle_incoming(char *word[], char *word_eol[], void *userdata) {
|
static int handle_incoming(char *word[], char *word_eol[], hexchat_event_attrs *attrs, void *userdata) {
|
||||||
const char *prefix;
|
const char *prefix;
|
||||||
const char *command;
|
const char *command;
|
||||||
const char *recipient;
|
const char *recipient;
|
||||||
@@ -114,20 +103,19 @@ static int handle_incoming(char *word[], char *word_eol[], void *userdata) {
|
|||||||
const char *peice;
|
const char *peice;
|
||||||
char *sender_nick;
|
char *sender_nick;
|
||||||
char *decrypted;
|
char *decrypted;
|
||||||
char *message;
|
|
||||||
size_t w;
|
size_t w;
|
||||||
size_t ew;
|
size_t ew;
|
||||||
size_t uw;
|
size_t uw;
|
||||||
size_t length;
|
|
||||||
char prefix_char = 0;
|
char prefix_char = 0;
|
||||||
|
GString *message;
|
||||||
|
|
||||||
if (!irc_parse_message((const char **)word, &prefix, &command, &w))
|
if (!irc_parse_message((const char **)word, &prefix, &command, &w))
|
||||||
return HEXCHAT_EAT_NONE;
|
return HEXCHAT_EAT_NONE;
|
||||||
|
|
||||||
// Topic (command 332) has an extra parameter
|
/* Topic (command 332) has an extra parameter */
|
||||||
if (!strcmp(command, "332")) w++;
|
if (!strcmp(command, "332")) w++;
|
||||||
|
|
||||||
// Look for encrypted data
|
/* Look for encrypted data */
|
||||||
for (ew = w+1; ew < HEXCHAT_MAX_WORDS-1; ew++) {
|
for (ew = w+1; ew < HEXCHAT_MAX_WORDS-1; ew++) {
|
||||||
const char *s = (ew == w+1 ? word[ew]+1 : word[ew]);
|
const char *s = (ew == w+1 ? word[ew]+1 : word[ew]);
|
||||||
if (*s && (s[1] == '+' || s[1] == 'm')) { prefix_char = *(s++); }
|
if (*s && (s[1] == '+' || s[1] == 'm')) { prefix_char = *(s++); }
|
||||||
@@ -136,61 +124,70 @@ static int handle_incoming(char *word[], char *word_eol[], void *userdata) {
|
|||||||
}
|
}
|
||||||
return HEXCHAT_EAT_NONE;
|
return HEXCHAT_EAT_NONE;
|
||||||
has_encrypted_data: ;
|
has_encrypted_data: ;
|
||||||
// Extract sender nick and recipient nick/channel
|
/* Extract sender nick and recipient nick/channel */
|
||||||
sender_nick = irc_prefix_get_nick(prefix);
|
sender_nick = irc_prefix_get_nick(prefix);
|
||||||
recipient = word[w];
|
recipient = word[w];
|
||||||
|
|
||||||
// Try to decrypt with these (the keys are searched for in the key store)
|
/* Try to decrypt with these (the keys are searched for in the key store) */
|
||||||
encrypted = word[ew+1];
|
encrypted = word[ew+1];
|
||||||
decrypted = fish_decrypt_from_nick(recipient, encrypted);
|
decrypted = fish_decrypt_from_nick(recipient, encrypted);
|
||||||
if (!decrypted) decrypted = fish_decrypt_from_nick(sender_nick, encrypted);
|
if (!decrypted) decrypted = fish_decrypt_from_nick(sender_nick, encrypted);
|
||||||
|
|
||||||
// Check for error
|
/* Check for error */
|
||||||
if (!decrypted) goto decrypt_error;
|
if (!decrypted) goto decrypt_error;
|
||||||
|
|
||||||
// Build unecrypted message
|
/* Build unecrypted message */
|
||||||
message = NULL;
|
message = g_string_sized_new (100); /* TODO: more accurate estimation of size */
|
||||||
length = 0;
|
g_string_append (message, "RECV");
|
||||||
if (!append(&message, &length, "RECV")) goto decrypt_error;
|
|
||||||
|
if (attrs->server_time_utc)
|
||||||
|
{
|
||||||
|
GTimeVal tv = { (glong)attrs->server_time_utc, 0 };
|
||||||
|
char *timestamp = g_time_val_to_iso8601 (&tv);
|
||||||
|
|
||||||
|
g_string_append (message, " @time=");
|
||||||
|
g_string_append (message, timestamp);
|
||||||
|
g_free (timestamp);
|
||||||
|
}
|
||||||
|
|
||||||
for (uw = 1; uw < HEXCHAT_MAX_WORDS; uw++) {
|
for (uw = 1; uw < HEXCHAT_MAX_WORDS; uw++) {
|
||||||
if (word[uw][0] != '\0' && !append(&message, &length, " ")) goto decrypt_error;
|
if (word[uw][0] != '\0')
|
||||||
|
g_string_append_c (message, ' ');
|
||||||
|
|
||||||
if (uw == ew) {
|
if (uw == ew) {
|
||||||
// Add the encrypted data
|
/* Add the encrypted data */
|
||||||
peice = decrypted;
|
peice = decrypted;
|
||||||
uw++; // Skip "OK+"
|
uw++; /* Skip "OK+" */
|
||||||
|
|
||||||
if (ew == w+1) {
|
if (ew == w+1) {
|
||||||
// Prefix with colon, which gets stripped out otherwise
|
/* Prefix with colon, which gets stripped out otherwise */
|
||||||
if (!append(&message, &length, ":")) goto decrypt_error;
|
g_string_append_c (message, ':');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prefix_char) {
|
if (prefix_char) {
|
||||||
char prefix_str[2] = { prefix_char, '\0' };
|
g_string_append_c (message, prefix_char);
|
||||||
if (!append(&message, &length, prefix_str)) goto decrypt_error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Add unencrypted data (for example, a prefix from a bouncer or bot)
|
/* Add unencrypted data (for example, a prefix from a bouncer or bot) */
|
||||||
peice = word[uw];
|
peice = word[uw];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!append(&message, &length, peice)) goto decrypt_error;
|
g_string_append (message, peice);
|
||||||
}
|
}
|
||||||
free(decrypted);
|
g_free(decrypted);
|
||||||
|
|
||||||
// Simulate unencrypted message
|
/* Simulate unencrypted message */
|
||||||
//hexchat_printf(ph, "simulating: %s\n", message);
|
/* hexchat_printf(ph, "simulating: %s\n", message->str); */
|
||||||
hexchat_command(ph, message);
|
hexchat_command(ph, message->str);
|
||||||
|
|
||||||
free(message);
|
g_string_free (message, TRUE);
|
||||||
free(sender_nick);
|
g_free(sender_nick);
|
||||||
return HEXCHAT_EAT_HEXCHAT;
|
return HEXCHAT_EAT_HEXCHAT;
|
||||||
|
|
||||||
decrypt_error:
|
decrypt_error:
|
||||||
free(decrypted);
|
g_free(decrypted);
|
||||||
free(sender_nick);
|
g_free(sender_nick);
|
||||||
return HEXCHAT_EAT_NONE;
|
return HEXCHAT_EAT_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,27 +198,27 @@ static int handle_setkey(char *word[], char *word_eol[], void *userdata) {
|
|||||||
const char *nick;
|
const char *nick;
|
||||||
const char *key;
|
const char *key;
|
||||||
|
|
||||||
// Check syntax
|
/* Check syntax */
|
||||||
if (*word[2] == '\0') {
|
if (*word[2] == '\0') {
|
||||||
hexchat_printf(ph, "%s\n", usage_setkey);
|
hexchat_printf(ph, "%s\n", usage_setkey);
|
||||||
return HEXCHAT_EAT_HEXCHAT;
|
return HEXCHAT_EAT_HEXCHAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*word[3] == '\0') {
|
if (*word[3] == '\0') {
|
||||||
// /setkey password
|
/* /setkey password */
|
||||||
nick = hexchat_get_info(ph, "channel");
|
nick = hexchat_get_info(ph, "channel");
|
||||||
key = word_eol[2];
|
key = word_eol[2];
|
||||||
} else {
|
} else {
|
||||||
// /setkey #channel password
|
/* /setkey #channel password */
|
||||||
nick = word[2];
|
nick = word[2];
|
||||||
key = word_eol[3];
|
key = word_eol[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set password
|
/* Set password */
|
||||||
if (keystore_store_key(nick, key)) {
|
if (keystore_store_key(nick, key)) {
|
||||||
hexchat_printf(ph, "Stored key for %s\n", nick);
|
hexchat_printf(ph, "Stored key for %s\n", nick);
|
||||||
} else {
|
} else {
|
||||||
hexchat_printf(ph, "\00305Failed to store key in addon_fishlim.conf\n", nick, key);
|
hexchat_printf(ph, "\00305Failed to store key in addon_fishlim.conf\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return HEXCHAT_EAT_HEXCHAT;
|
return HEXCHAT_EAT_HEXCHAT;
|
||||||
@@ -233,19 +230,19 @@ static int handle_setkey(char *word[], char *word_eol[], void *userdata) {
|
|||||||
static int handle_delkey(char *word[], char *word_eol[], void *userdata) {
|
static int handle_delkey(char *word[], char *word_eol[], void *userdata) {
|
||||||
const char *nick;
|
const char *nick;
|
||||||
|
|
||||||
// Check syntax
|
/* Check syntax */
|
||||||
if (*word[2] == '\0' || *word[3] != '\0') {
|
if (*word[2] == '\0' || *word[3] != '\0') {
|
||||||
hexchat_printf(ph, "%s\n", usage_delkey);
|
hexchat_printf(ph, "%s\n", usage_delkey);
|
||||||
return HEXCHAT_EAT_HEXCHAT;
|
return HEXCHAT_EAT_HEXCHAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
nick = word_eol[2];
|
nick = g_strstrip (word_eol[2]);
|
||||||
|
|
||||||
// Delete the given nick from the key store
|
/* Delete the given nick from the key store */
|
||||||
if (keystore_delete_nick(nick)) {
|
if (keystore_delete_nick(nick)) {
|
||||||
hexchat_printf(ph, "Deleted key for %s\n", nick);
|
hexchat_printf(ph, "Deleted key for %s\n", nick);
|
||||||
} else {
|
} else {
|
||||||
hexchat_printf(ph, "\00305Failed to delete key in addon_fishlim.conf!\n", nick);
|
hexchat_printf(ph, "\00305Failed to delete key in addon_fishlim.conf!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return HEXCHAT_EAT_HEXCHAT;
|
return HEXCHAT_EAT_HEXCHAT;
|
||||||
@@ -282,11 +279,11 @@ int hexchat_plugin_init(hexchat_plugin *plugin_handle,
|
|||||||
|
|
||||||
/* Add handlers */
|
/* Add handlers */
|
||||||
hexchat_hook_command(ph, "", HEXCHAT_PRI_NORM, handle_outgoing, NULL, NULL);
|
hexchat_hook_command(ph, "", HEXCHAT_PRI_NORM, handle_outgoing, NULL, NULL);
|
||||||
hexchat_hook_server(ph, "NOTICE", HEXCHAT_PRI_NORM, handle_incoming, NULL);
|
hexchat_hook_server_attrs(ph, "NOTICE", HEXCHAT_PRI_NORM, handle_incoming, NULL);
|
||||||
hexchat_hook_server(ph, "PRIVMSG", HEXCHAT_PRI_NORM, handle_incoming, NULL);
|
hexchat_hook_server_attrs(ph, "PRIVMSG", HEXCHAT_PRI_NORM, handle_incoming, NULL);
|
||||||
//hexchat_hook_server(ph, "RAW LINE", HEXCHAT_PRI_NORM, handle_debug, NULL);
|
/* hexchat_hook_server(ph, "RAW LINE", HEXCHAT_PRI_NORM, handle_debug, NULL); */
|
||||||
hexchat_hook_server(ph, "TOPIC", HEXCHAT_PRI_NORM, handle_incoming, NULL);
|
hexchat_hook_server_attrs(ph, "TOPIC", HEXCHAT_PRI_NORM, handle_incoming, NULL);
|
||||||
hexchat_hook_server(ph, "332", HEXCHAT_PRI_NORM, handle_incoming, NULL);
|
hexchat_hook_server_attrs(ph, "332", HEXCHAT_PRI_NORM, handle_incoming, NULL);
|
||||||
|
|
||||||
hexchat_printf(ph, "%s plugin loaded\n", plugin_name);
|
hexchat_printf(ph, "%s plugin loaded\n", plugin_name);
|
||||||
/* Return success */
|
/* Return success */
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#define PLUGIN_HEXCHAT_H
|
#define PLUGIN_HEXCHAT_H
|
||||||
|
|
||||||
gchar *get_config_filename();
|
gchar *get_config_filename();
|
||||||
|
int irc_nick_cmp (const char *, const char *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -47,7 +47,7 @@ static int decrypt(int nick_count, char *nicks[]) {
|
|||||||
return 1;
|
return 1;
|
||||||
success:
|
success:
|
||||||
fprintf(stderr, "Decrypted text >>>%s<<<\n", msg);
|
fprintf(stderr, "Decrypted text >>>%s<<<\n", msg);
|
||||||
free(msg);
|
g_free(msg);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ static int encrypt(int nick_count, char *nicks[]) {
|
|||||||
char *encrypted = fish_encrypt_for_nick(nicks[i], message);
|
char *encrypted = fish_encrypt_for_nick(nicks[i], message);
|
||||||
if (encrypted) {
|
if (encrypted) {
|
||||||
fprintf(stderr, "Encrypted [%s]: >>>%s<<<\n", nicks[i], encrypted);
|
fprintf(stderr, "Encrypted [%s]: >>>%s<<<\n", nicks[i], encrypted);
|
||||||
free(encrypted);
|
g_free(encrypted);
|
||||||
} else {
|
} else {
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
|
@@ -14,54 +14,27 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
#include <glib.h>
|
||||||
typedef int (*MYPROC)(HWND,HWND,char*,char*,BOOL,BOOL);
|
|
||||||
|
|
||||||
int dllProc(char *name, char *data){
|
char *split(char *text, char separator)
|
||||||
HINSTANCE hinstLib;
|
|
||||||
hinstLib = LoadLibrary("mpcinfo");
|
|
||||||
//MYPROC proc;
|
|
||||||
int res;
|
|
||||||
if (hinstLib != NULL){
|
|
||||||
//proc = ;
|
|
||||||
if ((MYPROC) GetProcAddress(hinstLib, name)!=NULL){
|
|
||||||
res=(MYPROC)(NULL,NULL,data,NULL,TRUE,TRUE);
|
|
||||||
}
|
|
||||||
else{fprintf(stderr,"can't get proc: %s\n",name);res=-2;}
|
|
||||||
}
|
|
||||||
else{fprintf(stderr,"can't access dll\n");return -1;}
|
|
||||||
FreeLibrary(hinstLib);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
int dllProc(char *name, char *data)
|
|
||||||
{
|
{
|
||||||
static HMODULE lib = NULL;
|
int pos = -1;
|
||||||
if (!lib)
|
size_t i;
|
||||||
|
for (i = 0; i < strlen(text); i++)
|
||||||
{
|
{
|
||||||
lib = LoadLibraryA ("mpcinfo");
|
if (text[i] == separator) {
|
||||||
if (!lib)
|
pos = i;
|
||||||
{
|
i = strlen(text) + 1;
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
FreeLibrary (lib);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
if (pos == -1)
|
||||||
}
|
{
|
||||||
*/
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
char *split(char *text, char seperator){
|
text[pos] = 0;
|
||||||
//if (DEBUG==1) putlog("splitting");
|
return &(text[pos + 1]);
|
||||||
int i;int pos=-1;
|
|
||||||
for (i=0;i<strlen(text);i++){
|
|
||||||
if (text[i]==seperator){pos=i;i=strlen(text)+1;}
|
|
||||||
}
|
|
||||||
if (pos==-1) return text;
|
|
||||||
text[pos]=0;
|
|
||||||
return &(text[pos+1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int endsWith(char *text, char *suffix){
|
int endsWith(char *text, char *suffix){
|
||||||
@@ -71,21 +44,32 @@ int endsWith(char *text, char *suffix){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int inStr(char *s1, int sl1, char *s2){
|
int inStr(char *s1, size_t sl1, char *s2)
|
||||||
//if (DEBUG==1) putlog("checking instr");
|
{
|
||||||
int i;int j;
|
size_t i;
|
||||||
for(i=0;i<sl1-strlen(s2);i++){
|
for (i = 0; i < sl1 - strlen(s2); i++)
|
||||||
for (j=0;j<strlen(s2);j++){
|
{
|
||||||
if (s1[i+j]!=s2[j]) j=strlen(s2)+2;
|
size_t j;
|
||||||
|
for (j = 0; j < strlen(s2); j++)
|
||||||
|
{
|
||||||
|
if (s1[i + j] != s2[j])
|
||||||
|
{
|
||||||
|
j = strlen(s2) + 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (j == strlen(s2))
|
||||||
|
{
|
||||||
|
return i;
|
||||||
}
|
}
|
||||||
if (j==strlen(s2)) return i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *subString(char *text, int first, int length, int spcKill){
|
static char *subString(char *text, int first, int length, int spcKill){
|
||||||
//if (DEBUG==1) putlog("creating substring");
|
//if (DEBUG==1) putlog("creating substring");
|
||||||
char *ret=(char*) calloc (length+1,sizeof(char)); //malloc(sizeof(char)*(length+1));
|
char *ret = g_new (char, length + 1);
|
||||||
int i;
|
int i;
|
||||||
ret[length]=0;
|
ret[length]=0;
|
||||||
for (i=0;i<length;i++){
|
for (i=0;i<length;i++){
|
||||||
@@ -107,7 +91,7 @@ static char *substring(char *text, int first, int length){return subString(text,
|
|||||||
|
|
||||||
char *readLine(FILE *f){
|
char *readLine(FILE *f){
|
||||||
//if (DEBUG==1) putlog("reading line from file");
|
//if (DEBUG==1) putlog("reading line from file");
|
||||||
char *buffer=(char*)calloc(1024,sizeof(char)); //malloc(sizeof(char)*1024);
|
char *buffer = g_new (char, 1024);
|
||||||
int pos=0;
|
int pos=0;
|
||||||
int cc=0;
|
int cc=0;
|
||||||
while((cc!=EOF)&&(pos<1024)&&(cc!=10)){
|
while((cc!=EOF)&&(pos<1024)&&(cc!=10)){
|
||||||
@@ -121,14 +105,19 @@ char *readLine(FILE *f){
|
|||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *toUpper(char *text){
|
char *toUpper(char *text)
|
||||||
//if (DEBUG==1) putlog("converting text to upper case");
|
{
|
||||||
char *ret=(char*) calloc(strlen(text)+1,sizeof(char));
|
char *ret = (char*) calloc(strlen(text) + 1, sizeof(char));
|
||||||
int i;
|
|
||||||
for (i=0;i<strlen(text);i++) ret[i]=toupper(text[i]);
|
size_t i;
|
||||||
ret[strlen(text)]=0;
|
for (i = 0; i < strlen(text); i++)
|
||||||
//if (DEBUG==1) putlog("uc done");
|
{
|
||||||
return ret;
|
ret[i] = toupper(text[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
ret[strlen(text)] = 0;
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *str3cat(char *s1, char *s2, char *s3){
|
static char *str3cat(char *s1, char *s2, char *s3){
|
||||||
|
@@ -75,62 +75,25 @@ static char MODES [][13]={"Stereo","Joint-Stereo","Dual-Channel","Mono"};
|
|||||||
|
|
||||||
int iPow(int x, int y){return (int)(pow((double)x,(double) y));}
|
int iPow(int x, int y){return (int)(pow((double)x,(double) y));}
|
||||||
|
|
||||||
int str2int(char *text){
|
int str2int(char *text)
|
||||||
//if (DEBUG==1) putlog("converting string to int");
|
{
|
||||||
int i;
|
int ret = 0;
|
||||||
int ret=0;
|
|
||||||
for (i=1;i<=strlen(text);i++){
|
|
||||||
if ((text[strlen(text)-i]>57)||(text[strlen(text)-i]<48)){
|
|
||||||
hexchat_printf(ph,"invalid char in string: %i",text[strlen(text)-i]);
|
|
||||||
return 255;
|
|
||||||
}
|
|
||||||
ret+=((int)text[strlen(text)-i]-48)*iPow(10,i-1);
|
|
||||||
}
|
|
||||||
//hexchat_printf(ph, "str2int(%s)=%i",text,ret);
|
|
||||||
//if (DEBUG==1) putlog("int converted");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
static int getSize(char *file){
|
|
||||||
//if (DEBUG==1) putlog("reading filesize");
|
|
||||||
struct stat info;
|
|
||||||
if (stat(file,&info)!=0) return -1;
|
|
||||||
return info.st_size;
|
|
||||||
}*/
|
|
||||||
/*
|
|
||||||
int inStr(char *s1, int sl1, char *s2){
|
|
||||||
//if (DEBUG==1) putlog("checking instr");
|
|
||||||
int i;int j;
|
|
||||||
for(i=0;i<sl1-strlen(s2);i++){
|
|
||||||
for (j=0;j<strlen(s2);j++){
|
|
||||||
if (s1[i+j]!=s2[j]) j=strlen(s2)+2;
|
|
||||||
}
|
|
||||||
if (j==strlen(s2)) return i;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static char *subString(char *text, int first, int length, int spcKill){
|
size_t i;
|
||||||
//if (DEBUG==1) putlog("creating substring");
|
for (i = 1; i <= strlen(text); i++)
|
||||||
char *ret=(char*) calloc (length+1,sizeof(char)); //malloc(sizeof(char)*(length+1));
|
{
|
||||||
ret[length]=0;int i;
|
if ((text[strlen(text) - i] > 57) || (text[strlen(text) - i] < 48))
|
||||||
for (i=0;i<length;i++){
|
{
|
||||||
ret[i]=text[i+first];
|
hexchat_printf(ph, "invalid char in string: %i", (int) text[strlen(text) - i]);
|
||||||
//if (ret[i]==0) ret[i]='0';
|
return 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret += ((int) text[strlen(text) - i] - 48)*iPow(10, i - 1);
|
||||||
}
|
}
|
||||||
if (spcKill==1){
|
|
||||||
for (i=length-1;i>=0;i--){
|
|
||||||
if (ret[i]==32) ret[i]=0;
|
|
||||||
else i=-1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//if (DEBUG==1) putlog("substring created");
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *substring(char *text, int first, int length){return subString(text,first,length,0);} //1
|
|
||||||
*/
|
|
||||||
|
|
||||||
static char *tagExtract(char *tag, int tagLen, char* info){
|
static char *tagExtract(char *tag, int tagLen, char* info){
|
||||||
//if (DEBUG==1) putlog("extracting tag");
|
//if (DEBUG==1) putlog("extracting tag");
|
||||||
int pos, len, i;
|
int pos, len, i;
|
||||||
@@ -204,23 +167,28 @@ struct tagInfo readID3V1(char *file){
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *extractID3Genre(char *tag){
|
char *extractID3Genre(char *tag)
|
||||||
//if (DEBUG==1) putlog("extracting id3 genre");
|
{
|
||||||
if (tag[strlen(tag)-1]==')'){
|
if (tag[strlen(tag) - 1] == ')')
|
||||||
tag[strlen(tag)-1]=0;
|
{
|
||||||
tag=&tag[1];
|
tag[strlen(tag) - 1] = 0;
|
||||||
return GENRES[str2int(tag)];
|
tag = &tag[1];
|
||||||
//return tag;
|
return GENRES[str2int(tag)];
|
||||||
}
|
}
|
||||||
else{
|
else
|
||||||
int i;
|
{
|
||||||
//hexchat_print(ph, "Using 2 criteria");
|
size_t i;
|
||||||
for (i=0;i<strlen(tag);i++){
|
for (i = 0; i < strlen(tag); i++)
|
||||||
if (tag[i]==')'){ tag=&tag[i]+1;return tag;}
|
{
|
||||||
//return tag;
|
if (tag[i] == ')')
|
||||||
}
|
{
|
||||||
}
|
tag = &tag[i] + 1;
|
||||||
return "[152] failed";
|
return tag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "[152] failed";
|
||||||
}
|
}
|
||||||
|
|
||||||
struct tagInfo readID3V2(char *file){
|
struct tagInfo readID3V2(char *file){
|
||||||
|
@@ -48,11 +48,19 @@ static int mpc_tell(char *word[], char *word_eol[], void *userdata){
|
|||||||
HWND hwnd = FindWindow("MediaPlayerClassicW",NULL);
|
HWND hwnd = FindWindow("MediaPlayerClassicW",NULL);
|
||||||
if (hwnd==0) {hexchat_print(ph, randomLine(notRunTheme));return HEXCHAT_EAT_ALL;}
|
if (hwnd==0) {hexchat_print(ph, randomLine(notRunTheme));return HEXCHAT_EAT_ALL;}
|
||||||
|
|
||||||
tTitle=(char*)malloc(sizeof(char)*1024);
|
tTitle = g_new(char, 1024);
|
||||||
GetWindowText(hwnd, tTitle, 1024);
|
GetWindowText(hwnd, tTitle, 1024);
|
||||||
zero=strstr(tTitle," - Media Player Classic");
|
zero = strstr (tTitle, " - Media Player Classic");
|
||||||
if (zero!=NULL) zero[0]=0;
|
if (zero != NULL)
|
||||||
else hexchat_print(ph,"pattern not found");
|
{
|
||||||
|
zero[0] = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_free(tTitle);
|
||||||
|
hexchat_print(ph, "pattern not found");
|
||||||
|
return HEXCHAT_EAT_ALL;
|
||||||
|
}
|
||||||
|
|
||||||
if ((tTitle[1]==':')&&(tTitle[2]=='\\')){
|
if ((tTitle[1]==':')&&(tTitle[2]=='\\')){
|
||||||
//hexchat_print(ph,"seams to be full path");
|
//hexchat_print(ph,"seams to be full path");
|
||||||
@@ -82,7 +90,8 @@ static int mpc_tell(char *word[], char *word_eol[], void *userdata){
|
|||||||
//mp3Line=intReplace(mp3Line,"%perc",perc);
|
//mp3Line=intReplace(mp3Line,"%perc",perc);
|
||||||
//mp3Line=replace(mp3Line,"%plTitle",title);
|
//mp3Line=replace(mp3Line,"%plTitle",title);
|
||||||
mp3Line=replace(mp3Line,"%file",tTitle);
|
mp3Line=replace(mp3Line,"%file",tTitle);
|
||||||
hexchat_command(ph, mp3Line);
|
g_free(tTitle);
|
||||||
|
hexchat_command(ph, mp3Line);
|
||||||
return HEXCHAT_EAT_ALL;
|
return HEXCHAT_EAT_ALL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -111,14 +120,16 @@ static int mpc_tell(char *word[], char *word_eol[], void *userdata){
|
|||||||
//oggLine=intReplace(oggLine,"%perc",perc);
|
//oggLine=intReplace(oggLine,"%perc",perc);
|
||||||
//oggLine=replace(oggLine,"%plTitle",title);
|
//oggLine=replace(oggLine,"%plTitle",title);
|
||||||
oggLine=replace(oggLine,"%file",tTitle);
|
oggLine=replace(oggLine,"%file",tTitle);
|
||||||
hexchat_command(ph, oggLine);
|
g_free(tTitle);
|
||||||
|
hexchat_command(ph, oggLine);
|
||||||
return HEXCHAT_EAT_ALL;
|
return HEXCHAT_EAT_ALL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
line=randomLine(titleTheme);
|
line=randomLine(titleTheme);
|
||||||
line=replace(line,"%title", tTitle);
|
line=replace(line,"%title", tTitle);
|
||||||
hexchat_command(ph,line);
|
g_free(tTitle);
|
||||||
|
hexchat_command(ph, line);
|
||||||
return HEXCHAT_EAT_ALL;
|
return HEXCHAT_EAT_ALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -63,13 +63,15 @@
|
|||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MPCINFO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MPCINFO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<AdditionalIncludeDirectories>..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\..\src\common;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ModuleDefinitionFile>mpcinfo.def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>mpcinfo.def</ModuleDefinitionFile>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
@@ -81,13 +83,15 @@
|
|||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;MPCINFO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;MPCINFO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<AdditionalIncludeDirectories>..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\..\src\common;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ModuleDefinitionFile>mpcinfo.def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>mpcinfo.def</ModuleDefinitionFile>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
@@ -25,14 +25,18 @@ static int getOggInt(char *buff, int beg, int bytes){
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *upperStr(char *text){
|
static char *upperStr(char *text)
|
||||||
//if (DEBUG==1) putlog("converting text to uc");
|
{
|
||||||
//printf("upperStr(%s)\n",text);
|
char *ret = (char*) malloc(sizeof(char)*(strlen(text) + 1));
|
||||||
int i;
|
|
||||||
char *ret=(char*) malloc(sizeof(char)*(strlen(text)+1));
|
size_t i;
|
||||||
ret[strlen(text)]=0;
|
for (i = 0; i < strlen(text); i++)
|
||||||
for (i=0;i<strlen(text);i++) ret[i]=toupper(text[i]);
|
{
|
||||||
//printf("Result: %s\n",ret);
|
ret[i] = toupper(text[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
ret[strlen(text)] = 0;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -49,24 +49,32 @@ void printThemes(){
|
|||||||
hexchat_printf(ph,"\nTitle-Theme:\n");printTheme(titleTheme);
|
hexchat_printf(ph,"\nTitle-Theme:\n");printTheme(titleTheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cbFix(char *line){
|
void cbFix(char *line)
|
||||||
//if (DEBUG==1) putlog("cbfix");
|
{
|
||||||
int i, j;
|
size_t i;
|
||||||
for (i=0;i<strlen(line);i++){
|
for (i = 0; i < strlen(line); i++)
|
||||||
if (line[i]=='%'){
|
{
|
||||||
if ((line[i+1]=='C')||(line[i+1]=='B')||(line[i+1]=='U')||(line[i+1]=='O')||(line[i+1]=='R')){
|
size_t j;
|
||||||
if(line[i+1]=='C') line[i]=3;
|
|
||||||
if(line[i+1]=='B') line[i]=2;
|
|
||||||
if(line[i+1]=='U') line[i]=37;
|
|
||||||
if(line[i+1]=='O') line[i]=17;
|
|
||||||
if(line[i+1]=='R') line[i]=26;
|
|
||||||
|
|
||||||
for (j=i+1;j<strlen(line)-1;j++) line[j]=line[j+1];
|
if (line[i] == '%')
|
||||||
line[strlen(line)-1]=0;
|
{
|
||||||
}
|
if ((line[i + 1] == 'C') || (line[i + 1] == 'B') || (line[i + 1] == 'U') || (line[i + 1] == 'O') || (line[i + 1] == 'R'))
|
||||||
}
|
{
|
||||||
}
|
if (line[i + 1] == 'C') line[i] = 3;
|
||||||
//if (DEBUG==1) putlog("cbfix done");
|
if (line[i + 1] == 'B') line[i] = 2;
|
||||||
|
if (line[i + 1] == 'U') line[i] = 37;
|
||||||
|
if (line[i + 1] == 'O') line[i] = 17;
|
||||||
|
if (line[i + 1] == 'R') line[i] = 26;
|
||||||
|
|
||||||
|
for (j = i + 1; j < strlen(line) - 1; j++)
|
||||||
|
{
|
||||||
|
line[j] = line[j + 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
line[strlen(line) - 1] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct theme themeAdd(struct theme data, char *info){
|
struct theme themeAdd(struct theme data, char *info){
|
||||||
|
@@ -6,13 +6,14 @@ libdir = $(hexchatlibdir)
|
|||||||
|
|
||||||
lib_LTLIBRARIES = perl.la
|
lib_LTLIBRARIES = perl.la
|
||||||
perl_la_SOURCES = perl.c
|
perl_la_SOURCES = perl.c
|
||||||
perl_la_LDFLAGS = -avoid-version -module
|
perl_la_LDFLAGS = $(PERL_LDFLAGS) $(PLUGIN_LDFLAGS) -module
|
||||||
perl_la_LIBADD = $(PERL_LDFLAGS)
|
perl_la_LIBADD = $(PERL_LIBS) $(GLIB_LIBS)
|
||||||
|
perl_la_CFLAGS = $(PERL_CFLAGS) $(GLIB_CFLAGS) -I$(top_srcdir)/src/common
|
||||||
|
|
||||||
BUILT_SOURCES = hexchat.pm.h irc.pm.h
|
BUILT_SOURCES = hexchat.pm.h irc.pm.h
|
||||||
#CFLAGS = @CFLAGS@ -Wno-unused
|
CLEANFILES = $(BUILT_SOURCES)
|
||||||
AM_CPPFLAGS = $(PERL_CFLAGS) $(COMMON_CFLAGS) -I$(srcdir)/../../src/common
|
|
||||||
CLEANFILES = hexchat.pm.h irc.pm.h
|
|
||||||
hexchat.pm.h irc.pm.h: lib/HexChat.pm lib/Xchat.pm lib/HexChat/Embed.pm \
|
hexchat.pm.h irc.pm.h: lib/HexChat.pm lib/Xchat.pm lib/HexChat/Embed.pm \
|
||||||
lib/HexChat/List/Network.pm lib/HexChat/List/Network/Entry.pm \
|
lib/HexChat/List/Network.pm lib/HexChat/List/Network/Entry.pm \
|
||||||
lib/HexChat/List/Network/AutoJoin.pm lib/IRC.pm
|
lib/HexChat/List/Network/AutoJoin.pm lib/IRC.pm
|
||||||
perl generate_header
|
cd $(srcdir); perl generate_header
|
||||||
|
@@ -16,6 +16,8 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -31,12 +33,10 @@
|
|||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <glib.h>
|
||||||
|
|
||||||
#undef PACKAGE
|
#undef PACKAGE
|
||||||
#ifdef WIN32
|
|
||||||
#include "../../config-win32.h" /* for #define OLD_PERL */
|
|
||||||
#else
|
|
||||||
#include "../../config.h"
|
|
||||||
#endif
|
|
||||||
#include "hexchat-plugin.h"
|
#include "hexchat-plugin.h"
|
||||||
|
|
||||||
static hexchat_plugin *ph; /* plugin handle */
|
static hexchat_plugin *ph; /* plugin handle */
|
||||||
@@ -78,37 +78,26 @@ thread_mbox (char *str)
|
|||||||
static void
|
static void
|
||||||
perl_auto_load_from_path (const char *path)
|
perl_auto_load_from_path (const char *path)
|
||||||
{
|
{
|
||||||
WIN32_FIND_DATA find_data;
|
char *search_path = g_build_filename (path, "*.pl", NULL);
|
||||||
HANDLE find_handle;
|
WIN32_FIND_DATAA find_data;
|
||||||
char *search_path;
|
HANDLE find_handle = FindFirstFileA (search_path, &find_data);
|
||||||
int path_len = strlen (path);
|
|
||||||
|
|
||||||
/* +6 for \*.pl and \0 */
|
|
||||||
search_path = malloc(path_len + 6);
|
|
||||||
sprintf (search_path, "%s\\*.pl", path);
|
|
||||||
|
|
||||||
find_handle = FindFirstFile (search_path, &find_data);
|
|
||||||
|
|
||||||
if (find_handle != INVALID_HANDLE_VALUE)
|
if (find_handle != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (!(find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY
|
if ((find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0 && (find_data.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) == 0)
|
||||||
||find_data.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN))
|
|
||||||
{
|
{
|
||||||
char *full_path =
|
char *full_path = g_build_filename (path, find_data.cFileName, NULL);
|
||||||
malloc (path_len + strlen (find_data.cFileName) + 2);
|
|
||||||
sprintf (full_path, "%s\\%s", path, find_data.cFileName);
|
|
||||||
|
|
||||||
perl_load_file (full_path);
|
perl_load_file (full_path);
|
||||||
free (full_path);
|
g_free (full_path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (FindNextFile (find_handle, &find_data) != 0);
|
while (FindNextFileA (find_handle, &find_data) != 0);
|
||||||
FindClose (find_handle);
|
FindClose (find_handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
free (search_path);
|
g_free (search_path);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static void
|
static void
|
||||||
@@ -118,14 +107,16 @@ perl_auto_load_from_path (const char *path)
|
|||||||
struct dirent *ent;
|
struct dirent *ent;
|
||||||
|
|
||||||
dir = opendir (path);
|
dir = opendir (path);
|
||||||
if (dir) {
|
if (dir)
|
||||||
while ((ent = readdir (dir))) {
|
{
|
||||||
|
while ((ent = readdir (dir)))
|
||||||
|
{
|
||||||
int len = strlen (ent->d_name);
|
int len = strlen (ent->d_name);
|
||||||
if (len > 3 && strcasecmp (".pl", ent->d_name + len - 3) == 0) {
|
if (len > 3 && strcasecmp (".pl", ent->d_name + len - 3) == 0)
|
||||||
char *file = malloc (len + strlen (path) + 2);
|
{
|
||||||
sprintf (file, "%s/%s", path, ent->d_name);
|
char *file = g_build_filename (path, ent->d_name, NULL);
|
||||||
perl_load_file (file);
|
perl_load_file (file);
|
||||||
free (file);
|
g_free (file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir (dir);
|
closedir (dir);
|
||||||
@@ -148,31 +139,10 @@ perl_auto_load (void *unused)
|
|||||||
|
|
||||||
/* don't pollute the filesystem with script files, this only causes misuse of the folders
|
/* don't pollute the filesystem with script files, this only causes misuse of the folders
|
||||||
* only use ~/.config/hexchat/addons/ and %APPDATA%\HexChat\addons */
|
* only use ~/.config/hexchat/addons/ and %APPDATA%\HexChat\addons */
|
||||||
#if 0
|
sub_dir = g_build_filename (xdir, "addons", NULL);
|
||||||
/* autoload from ~/.config/hexchat/ or %APPDATA%\HexChat\ on win32 */
|
|
||||||
perl_auto_load_from_path (xdir);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
sub_dir = malloc (strlen (xdir) + 8);
|
|
||||||
strcpy (sub_dir, xdir);
|
|
||||||
strcat (sub_dir, "/addons");
|
|
||||||
perl_auto_load_from_path (sub_dir);
|
perl_auto_load_from_path (sub_dir);
|
||||||
free (sub_dir);
|
g_free (sub_dir);
|
||||||
|
|
||||||
#if 0
|
|
||||||
#ifdef WIN32
|
|
||||||
/* autoload from C:\Program Files\HexChat\plugins\ */
|
|
||||||
sub_dir = malloc (1025 + 9);
|
|
||||||
copied = GetModuleFileName( 0, sub_dir, 1024 );
|
|
||||||
sub_dir[copied] = '\0';
|
|
||||||
slash = strrchr( sub_dir, '\\' );
|
|
||||||
if( slash != NULL ) {
|
|
||||||
*slash = '\0';
|
|
||||||
}
|
|
||||||
perl_auto_load_from_path ( strncat (sub_dir, "\\plugins", 9));
|
|
||||||
free (sub_dir);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,7 +261,19 @@ list_item_to_sv ( hexchat_list *list, const char *const *fields )
|
|||||||
field_value = newSVuv (hexchat_list_int (ph, list, field_name));
|
field_value = newSVuv (hexchat_list_int (ph, list, field_name));
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
field_value = newSVnv (hexchat_list_time (ph, list, field_name));
|
/* From perldoc for Perl's own timelocal() and timegm():
|
||||||
|
* <quote>
|
||||||
|
* On perl versions older than 5.12.0, the range of dates that can be actually be handled depends on the size of time_t (usually a signed integer) on the given platform.
|
||||||
|
* As of version 5.12.0, perl has stopped using the underlying time library of the operating system it's running on and has its own implementation of those routines with a
|
||||||
|
* safe range of at least +/ 2**52 (about 142 million years).
|
||||||
|
* </quote>
|
||||||
|
*
|
||||||
|
* This is further confirmed from looking at the source for Time::Local - it's a Perl module and the implementations of timelocal() and timegm() use simple addition and
|
||||||
|
* subtraction of numbers. Perl automatically promotes numbers from int32_t (IV) to uint32_t (UV) to 64-bit IEEE754 double (NV) as required.
|
||||||
|
*
|
||||||
|
* This means that using a double (NV) for our own time_t suffers from the same assumptions that Perl's own functions do.
|
||||||
|
*/
|
||||||
|
field_value = newSVnv ((const NV) hexchat_list_time (ph, list, field_name));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
field_value = &PL_sv_undef;
|
field_value = &PL_sv_undef;
|
||||||
@@ -375,7 +357,7 @@ fd_cb (int fd, int flags, void *userdata)
|
|||||||
if (data->userdata) {
|
if (data->userdata) {
|
||||||
SvREFCNT_dec (data->userdata);
|
SvREFCNT_dec (data->userdata);
|
||||||
}
|
}
|
||||||
free (data);
|
g_free (data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -739,7 +721,7 @@ XS (XS_HexChat_send_modes)
|
|||||||
if (SvROK (ST (0))) {
|
if (SvROK (ST (0))) {
|
||||||
p_targets = (AV*) SvRV (ST (0));
|
p_targets = (AV*) SvRV (ST (0));
|
||||||
target_count = av_len (p_targets) + 1;
|
target_count = av_len (p_targets) + 1;
|
||||||
targets = malloc (target_count * sizeof (char *));
|
targets = g_new (const char *, target_count);
|
||||||
for (i = 0; i < target_count; i++ ) {
|
for (i = 0; i < target_count; i++ ) {
|
||||||
elem = av_fetch (p_targets, i, 0);
|
elem = av_fetch (p_targets, i, 0);
|
||||||
|
|
||||||
@@ -750,13 +732,13 @@ XS (XS_HexChat_send_modes)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else{
|
} else{
|
||||||
targets = malloc (sizeof (char *));
|
targets = g_new (const char *, 1);
|
||||||
targets[0] = SvPV_nolen (ST (0));
|
targets[0] = SvPV_nolen (ST (0));
|
||||||
target_count = 1;
|
target_count = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target_count == 0) {
|
if (target_count == 0) {
|
||||||
free (targets);
|
g_free ((char**) targets);
|
||||||
XSRETURN_EMPTY;
|
XSRETURN_EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -768,7 +750,7 @@ XS (XS_HexChat_send_modes)
|
|||||||
}
|
}
|
||||||
|
|
||||||
hexchat_send_modes (ph, targets, target_count, modes_per_line, sign, mode);
|
hexchat_send_modes (ph, targets, target_count, modes_per_line, sign, mode);
|
||||||
free (targets);
|
g_free ((char**) targets);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static
|
static
|
||||||
@@ -886,11 +868,7 @@ XS (XS_HexChat_hook_server)
|
|||||||
userdata = ST (3);
|
userdata = ST (3);
|
||||||
package = ST (4);
|
package = ST (4);
|
||||||
data = NULL;
|
data = NULL;
|
||||||
data = malloc (sizeof (HookData));
|
data = g_new (HookData, 1);
|
||||||
if (data == NULL) {
|
|
||||||
XSRETURN_UNDEF;
|
|
||||||
}
|
|
||||||
|
|
||||||
data->callback = newSVsv (callback);
|
data->callback = newSVsv (callback);
|
||||||
data->userdata = newSVsv (userdata);
|
data->userdata = newSVsv (userdata);
|
||||||
data->depth = 0;
|
data->depth = 0;
|
||||||
@@ -935,11 +913,7 @@ XS (XS_HexChat_hook_command)
|
|||||||
package = ST (5);
|
package = ST (5);
|
||||||
data = NULL;
|
data = NULL;
|
||||||
|
|
||||||
data = malloc (sizeof (HookData));
|
data = g_new (HookData, 1);
|
||||||
if (data == NULL) {
|
|
||||||
XSRETURN_UNDEF;
|
|
||||||
}
|
|
||||||
|
|
||||||
data->callback = newSVsv (callback);
|
data->callback = newSVsv (callback);
|
||||||
data->userdata = newSVsv (userdata);
|
data->userdata = newSVsv (userdata);
|
||||||
data->depth = 0;
|
data->depth = 0;
|
||||||
@@ -975,11 +949,7 @@ XS (XS_HexChat_hook_print)
|
|||||||
userdata = ST (3);
|
userdata = ST (3);
|
||||||
package = ST (4);
|
package = ST (4);
|
||||||
|
|
||||||
data = malloc (sizeof (HookData));
|
data = g_new (HookData, 1);
|
||||||
if (data == NULL) {
|
|
||||||
XSRETURN_UNDEF;
|
|
||||||
}
|
|
||||||
|
|
||||||
data->callback = newSVsv (callback);
|
data->callback = newSVsv (callback);
|
||||||
data->userdata = newSVsv (userdata);
|
data->userdata = newSVsv (userdata);
|
||||||
data->depth = 0;
|
data->depth = 0;
|
||||||
@@ -1013,11 +983,7 @@ XS (XS_HexChat_hook_timer)
|
|||||||
userdata = ST (2);
|
userdata = ST (2);
|
||||||
package = ST (3);
|
package = ST (3);
|
||||||
|
|
||||||
data = malloc (sizeof (HookData));
|
data = g_new (HookData, 1);
|
||||||
if (data == NULL) {
|
|
||||||
XSRETURN_UNDEF;
|
|
||||||
}
|
|
||||||
|
|
||||||
data->callback = newSVsv (callback);
|
data->callback = newSVsv (callback);
|
||||||
data->userdata = newSVsv (userdata);
|
data->userdata = newSVsv (userdata);
|
||||||
data->ctx = hexchat_get_context (ph);
|
data->ctx = hexchat_get_context (ph);
|
||||||
@@ -1067,11 +1033,7 @@ XS (XS_HexChat_hook_fd)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
data = malloc (sizeof (HookData));
|
data = g_new (HookData, 1);
|
||||||
if (data == NULL) {
|
|
||||||
XSRETURN_UNDEF;
|
|
||||||
}
|
|
||||||
|
|
||||||
data->callback = newSVsv (callback);
|
data->callback = newSVsv (callback);
|
||||||
data->userdata = newSVsv (userdata);
|
data->userdata = newSVsv (userdata);
|
||||||
data->depth = 0;
|
data->depth = 0;
|
||||||
@@ -1111,7 +1073,7 @@ XS (XS_HexChat_unhook)
|
|||||||
SvREFCNT_dec (userdata->package);
|
SvREFCNT_dec (userdata->package);
|
||||||
}
|
}
|
||||||
|
|
||||||
free (userdata);
|
g_free (userdata);
|
||||||
}
|
}
|
||||||
XSRETURN (retCount);
|
XSRETURN (retCount);
|
||||||
}
|
}
|
||||||
|
@@ -62,7 +62,7 @@
|
|||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PERL520_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PERL520_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>$(PerlPath)\lib\CORE;$(IntDir);..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir)..;$(PerlPath)\lib\CORE;$(IntDir);..\..\src\common;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
@@ -70,8 +70,8 @@
|
|||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>$(OutDir);$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<AdditionalDependencies>$(PerlLib).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>$(PerlLib).lib;$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ModuleDefinitionFile>perl.def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>perl.def</ModuleDefinitionFile>
|
||||||
<DelayLoadDLLs>$(PerlLib).dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
<DelayLoadDLLs>$(PerlLib).dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||||
</Link>
|
</Link>
|
||||||
@@ -91,7 +91,7 @@ move hexchat.pm.h "$(IntDir)"</Command>
|
|||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;PERL520_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;PERL520_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>$(PerlPath)\lib\CORE;$(IntDir);..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir)..;$(PerlPath)\lib\CORE;$(IntDir);..\..\src\common;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
@@ -99,8 +99,8 @@ move hexchat.pm.h "$(IntDir)"</Command>
|
|||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>$(OutDir);$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<AdditionalDependencies>$(PerlLib).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>$(PerlLib).lib;$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ModuleDefinitionFile>perl.def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>perl.def</ModuleDefinitionFile>
|
||||||
<DelayLoadDLLs>$(PerlLib).dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
<DelayLoadDLLs>$(PerlLib).dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||||
</Link>
|
</Link>
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
EXTRA_DIST =
|
|
||||||
|
|
||||||
libdir = $(hexchatlibdir)
|
libdir = $(hexchatlibdir)
|
||||||
|
|
||||||
lib_LTLIBRARIES = python.la
|
lib_LTLIBRARIES = python.la
|
||||||
python_la_SOURCES = python.c
|
python_la_SOURCES = python.c
|
||||||
python_la_LDFLAGS = -avoid-version -module
|
python_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module
|
||||||
python_la_LIBADD = $(PY_LIBS)
|
python_la_LIBADD = $(PY_LIBS) $(GLIB_LIBS)
|
||||||
AM_CPPFLAGS = $(PY_CFLAGS) $(COMMON_CFLAGS) -I$(srcdir)/../../src/common
|
python_la_CFLAGS = $(PY_CFLAGS) $(GLIB_CFLAGS) -I$(top_srcdir)/src/common
|
||||||
|
|
||||||
|
@@ -51,23 +51,24 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
#include <glib/gstdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#include <glib/gstdio.h>
|
|
||||||
#include "../../src/dirent/dirent-win32.h"
|
|
||||||
#include "../../config-win32.h"
|
|
||||||
#else
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hexchat-plugin.h"
|
#include "hexchat-plugin.h"
|
||||||
#undef _POSIX_C_SOURCE /* Avoid warning: also in /usr/include/features.h from glib.h */
|
#undef _POSIX_C_SOURCE /* Avoid warnings from /usr/include/features.h */
|
||||||
|
#undef _XOPEN_SOURCE
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
#include <structmember.h>
|
#include <structmember.h>
|
||||||
#include <pythread.h>
|
#include <pythread.h>
|
||||||
@@ -415,6 +416,9 @@ Util_BuildEOLList(char *word[])
|
|||||||
PyObject *list;
|
PyObject *list;
|
||||||
int listsize = 31;
|
int listsize = 31;
|
||||||
int i;
|
int i;
|
||||||
|
char *accum = NULL;
|
||||||
|
char *last = NULL;
|
||||||
|
|
||||||
/* Find the last valid array member; there may be intermediate NULLs that
|
/* Find the last valid array member; there may be intermediate NULLs that
|
||||||
* would otherwise cause us to drop some members. */
|
* would otherwise cause us to drop some members. */
|
||||||
while (listsize > 0 &&
|
while (listsize > 0 &&
|
||||||
@@ -425,10 +429,9 @@ Util_BuildEOLList(char *word[])
|
|||||||
PyErr_Print();
|
PyErr_Print();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
char *accum = NULL;
|
|
||||||
char *last = NULL;
|
|
||||||
for (i = listsize; i > 0; i--) {
|
for (i = listsize; i > 0; i--) {
|
||||||
char *part = word[i];
|
char *part = word[i];
|
||||||
|
PyObject *uni_part;
|
||||||
if (accum == NULL) {
|
if (accum == NULL) {
|
||||||
accum = g_strdup (part);
|
accum = g_strdup (part);
|
||||||
} else if (part != NULL && part[0] != 0) {
|
} else if (part != NULL && part[0] != 0) {
|
||||||
@@ -444,14 +447,12 @@ Util_BuildEOLList(char *word[])
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PyObject *uni_part = PyUnicode_FromString(accum);
|
uni_part = PyUnicode_FromString(accum);
|
||||||
PyList_SetItem(list, i - 1, uni_part);
|
PyList_SetItem(list, i - 1, uni_part);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (last)
|
g_free (last);
|
||||||
g_free (last);
|
g_free (accum);
|
||||||
if (accum)
|
|
||||||
g_free (accum);
|
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
@@ -459,26 +460,31 @@ Util_BuildEOLList(char *word[])
|
|||||||
static void
|
static void
|
||||||
Util_Autoload_from (const char *dir_name)
|
Util_Autoload_from (const char *dir_name)
|
||||||
{
|
{
|
||||||
#ifndef PATH_MAX
|
gchar *oldcwd;
|
||||||
#define PATH_MAX 1024 /* Hurd doesn't define it */
|
const char *entry_name;
|
||||||
#endif
|
GDir *dir;
|
||||||
char oldcwd[PATH_MAX];
|
|
||||||
struct dirent *ent;
|
oldcwd = g_get_current_dir ();
|
||||||
DIR *dir;
|
if (oldcwd == NULL)
|
||||||
if (getcwd(oldcwd, PATH_MAX) == NULL)
|
|
||||||
return;
|
return;
|
||||||
if (chdir(dir_name) != 0)
|
if (g_chdir(dir_name) != 0)
|
||||||
|
{
|
||||||
|
g_free (oldcwd);
|
||||||
return;
|
return;
|
||||||
dir = opendir(".");
|
|
||||||
if (dir == NULL)
|
|
||||||
return;
|
|
||||||
while ((ent = readdir(dir))) {
|
|
||||||
int len = strlen(ent->d_name);
|
|
||||||
if (len > 3 && strcmp(".py", ent->d_name+len-3) == 0)
|
|
||||||
Command_PyLoad(ent->d_name);
|
|
||||||
}
|
}
|
||||||
closedir(dir);
|
dir = g_dir_open (".", 0, NULL);
|
||||||
chdir(oldcwd);
|
if (dir == NULL)
|
||||||
|
{
|
||||||
|
g_free (oldcwd);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
while ((entry_name = g_dir_read_name (dir)))
|
||||||
|
{
|
||||||
|
if (g_str_has_suffix (entry_name, ".py"))
|
||||||
|
Command_PyLoad((char*)entry_name);
|
||||||
|
}
|
||||||
|
g_dir_close (dir);
|
||||||
|
g_chdir (oldcwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -486,7 +492,7 @@ Util_Autoload()
|
|||||||
{
|
{
|
||||||
const char *xdir;
|
const char *xdir;
|
||||||
char *sub_dir;
|
char *sub_dir;
|
||||||
/* we need local filesystem encoding for chdir, opendir etc */
|
/* we need local filesystem encoding for g_chdir, g_dir_open etc */
|
||||||
|
|
||||||
xdir = hexchat_get_info(ph, "configdir");
|
xdir = hexchat_get_info(ph, "configdir");
|
||||||
|
|
||||||
@@ -796,9 +802,7 @@ Callback_ThreadTimer(void *userdata)
|
|||||||
/* We keep this information global, so we can reset it when the
|
/* We keep this information global, so we can reset it when the
|
||||||
* deinit function is called. */
|
* deinit function is called. */
|
||||||
/* XXX This should be somehow bound to the printing context. */
|
/* XXX This should be somehow bound to the printing context. */
|
||||||
static char *xchatout_buffer = NULL;
|
static GString *xchatout_buffer = NULL;
|
||||||
static int xchatout_buffer_size = 0;
|
|
||||||
static int xchatout_buffer_pos = 0;
|
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
XChatOut_New()
|
XChatOut_New()
|
||||||
@@ -822,76 +826,42 @@ XChatOut_dealloc(PyObject *self)
|
|||||||
static PyObject *
|
static PyObject *
|
||||||
XChatOut_write(PyObject *self, PyObject *args)
|
XChatOut_write(PyObject *self, PyObject *args)
|
||||||
{
|
{
|
||||||
int new_buffer_pos, data_size, print_limit, add_space;
|
gboolean add_space;
|
||||||
char *data, *pos;
|
char *data, *pos;
|
||||||
if (!PyArg_ParseTuple(args, "s#:write", &data, &data_size))
|
|
||||||
|
if (!PyArg_ParseTuple(args, "s:write", &data))
|
||||||
return NULL;
|
return NULL;
|
||||||
if (!data_size) {
|
if (!data || !*data) {
|
||||||
Py_INCREF(Py_None);
|
Py_RETURN_NONE;
|
||||||
return Py_None;
|
|
||||||
}
|
}
|
||||||
BEGIN_XCHAT_CALLS(RESTORE_CONTEXT|ALLOW_THREADS);
|
BEGIN_XCHAT_CALLS(RESTORE_CONTEXT|ALLOW_THREADS);
|
||||||
if (((XChatOutObject *)self)->softspace) {
|
if (((XChatOutObject *)self)->softspace) {
|
||||||
add_space = 1;
|
add_space = TRUE;
|
||||||
((XChatOutObject *)self)->softspace = 0;
|
((XChatOutObject *)self)->softspace = 0;
|
||||||
} else {
|
} else {
|
||||||
add_space = 0;
|
add_space = FALSE;
|
||||||
}
|
}
|
||||||
if (xchatout_buffer_size-xchatout_buffer_pos < data_size+add_space) {
|
|
||||||
char *new_buffer;
|
g_string_append (xchatout_buffer, data);
|
||||||
/* This buffer grows whenever needed, and does not
|
|
||||||
* shrink. If we ever implement unloading of the
|
/* If not end of line add space to continue buffer later */
|
||||||
* python interface, we must find some way to free
|
if (add_space && xchatout_buffer->str[xchatout_buffer->len - 1] != '\n')
|
||||||
* this buffer as well. */
|
{
|
||||||
xchatout_buffer_size += data_size*2+16;
|
g_string_append_c (xchatout_buffer, ' ');
|
||||||
new_buffer = g_realloc(xchatout_buffer, xchatout_buffer_size);
|
}
|
||||||
if (new_buffer == NULL) {
|
|
||||||
hexchat_print(ph, "Not enough memory to print");
|
/* If there is an end of line print up to that */
|
||||||
/* The system is out of resources. Let's help. */
|
if ((pos = strrchr (xchatout_buffer->str, '\n')))
|
||||||
g_free(xchatout_buffer);
|
{
|
||||||
xchatout_buffer = NULL;
|
*pos = '\0';
|
||||||
xchatout_buffer_size = 0;
|
hexchat_print (ph, xchatout_buffer->str);
|
||||||
xchatout_buffer_pos = 0;
|
|
||||||
/* Return something valid, since we have
|
/* Then remove it from buffer */
|
||||||
* already warned the user, and he probably
|
g_string_erase (xchatout_buffer, 0, pos - xchatout_buffer->str + 1);
|
||||||
* won't be able to notice this exception. */
|
|
||||||
goto exit;
|
|
||||||
}
|
|
||||||
xchatout_buffer = new_buffer;
|
|
||||||
}
|
|
||||||
memcpy(xchatout_buffer+xchatout_buffer_pos, data, data_size);
|
|
||||||
print_limit = new_buffer_pos = xchatout_buffer_pos+data_size;
|
|
||||||
pos = xchatout_buffer+print_limit;
|
|
||||||
if (add_space && *(pos-1) != '\n') {
|
|
||||||
*pos = ' ';
|
|
||||||
*(pos+1) = 0;
|
|
||||||
new_buffer_pos++;
|
|
||||||
}
|
|
||||||
while (*pos != '\n' && print_limit > xchatout_buffer_pos) {
|
|
||||||
pos--;
|
|
||||||
print_limit--;
|
|
||||||
}
|
|
||||||
if (*pos == '\n') {
|
|
||||||
/* Crop it, inserting the string limiter there. */
|
|
||||||
*pos = 0;
|
|
||||||
hexchat_print(ph, xchatout_buffer);
|
|
||||||
if (print_limit < new_buffer_pos) {
|
|
||||||
/* There's still data to be printed. */
|
|
||||||
print_limit += 1; /* Include the limiter. */
|
|
||||||
xchatout_buffer_pos = new_buffer_pos-print_limit;
|
|
||||||
memmove(xchatout_buffer, xchatout_buffer+print_limit,
|
|
||||||
xchatout_buffer_pos);
|
|
||||||
} else {
|
|
||||||
xchatout_buffer_pos = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
xchatout_buffer_pos = new_buffer_pos;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:
|
|
||||||
END_XCHAT_CALLS();
|
END_XCHAT_CALLS();
|
||||||
Py_INCREF(Py_None);
|
Py_RETURN_NONE;
|
||||||
return Py_None;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define OFF(x) offsetof(XChatOutObject, x)
|
#define OFF(x) offsetof(XChatOutObject, x)
|
||||||
@@ -1043,8 +1013,7 @@ Context_set(ContextObject *self, PyObject *args)
|
|||||||
{
|
{
|
||||||
PyObject *plugin = Plugin_GetCurrent();
|
PyObject *plugin = Plugin_GetCurrent();
|
||||||
Plugin_SetContext(plugin, self->context);
|
Plugin_SetContext(plugin, self->context);
|
||||||
Py_INCREF(Py_None);
|
Py_RETURN_NONE;
|
||||||
return Py_None;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
@@ -1057,8 +1026,7 @@ Context_command(ContextObject *self, PyObject *args)
|
|||||||
hexchat_set_context(ph, self->context);
|
hexchat_set_context(ph, self->context);
|
||||||
hexchat_command(ph, text);
|
hexchat_command(ph, text);
|
||||||
END_XCHAT_CALLS();
|
END_XCHAT_CALLS();
|
||||||
Py_INCREF(Py_None);
|
Py_RETURN_NONE;
|
||||||
return Py_None;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
@@ -1071,8 +1039,7 @@ Context_prnt(ContextObject *self, PyObject *args)
|
|||||||
hexchat_set_context(ph, self->context);
|
hexchat_set_context(ph, self->context);
|
||||||
hexchat_print(ph, text);
|
hexchat_print(ph, text);
|
||||||
END_XCHAT_CALLS();
|
END_XCHAT_CALLS();
|
||||||
Py_INCREF(Py_None);
|
Py_RETURN_NONE;
|
||||||
return Py_None;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
@@ -1117,8 +1084,7 @@ Context_get_info(ContextObject *self, PyObject *args)
|
|||||||
info = hexchat_get_info(ph, name);
|
info = hexchat_get_info(ph, name);
|
||||||
END_XCHAT_CALLS();
|
END_XCHAT_CALLS();
|
||||||
if (info == NULL) {
|
if (info == NULL) {
|
||||||
Py_INCREF(Py_None);
|
Py_RETURN_NONE;
|
||||||
return Py_None;
|
|
||||||
}
|
}
|
||||||
return PyUnicode_FromString(info);
|
return PyUnicode_FromString(info);
|
||||||
}
|
}
|
||||||
@@ -1401,11 +1367,7 @@ static Hook *
|
|||||||
Plugin_AddHook(int type, PyObject *plugin, PyObject *callback,
|
Plugin_AddHook(int type, PyObject *plugin, PyObject *callback,
|
||||||
PyObject *userdata, char *name, void *data)
|
PyObject *userdata, char *name, void *data)
|
||||||
{
|
{
|
||||||
Hook *hook = (Hook *) g_malloc(sizeof(Hook));
|
Hook *hook = g_new(Hook, 1);
|
||||||
if (hook == NULL) {
|
|
||||||
PyErr_NoMemory();
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
hook->type = type;
|
hook->type = type;
|
||||||
hook->plugin = plugin;
|
hook->plugin = plugin;
|
||||||
Py_INCREF(callback);
|
Py_INCREF(callback);
|
||||||
@@ -1459,8 +1421,7 @@ Plugin_RemoveHook(PyObject *plugin, Hook *hook)
|
|||||||
hook));
|
hook));
|
||||||
Py_DECREF(hook->callback);
|
Py_DECREF(hook->callback);
|
||||||
Py_DECREF(hook->userdata);
|
Py_DECREF(hook->userdata);
|
||||||
if (hook->name)
|
g_free(hook->name);
|
||||||
g_free(hook->name);
|
|
||||||
g_free(hook);
|
g_free(hook);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1479,8 +1440,7 @@ Plugin_RemoveAllHooks(PyObject *plugin)
|
|||||||
}
|
}
|
||||||
Py_DECREF(hook->callback);
|
Py_DECREF(hook->callback);
|
||||||
Py_DECREF(hook->userdata);
|
Py_DECREF(hook->userdata);
|
||||||
if (hook->name)
|
g_free(hook->name);
|
||||||
g_free(hook->name);
|
|
||||||
g_free(hook);
|
g_free(hook);
|
||||||
list = list->next;
|
list = list->next;
|
||||||
}
|
}
|
||||||
@@ -1709,8 +1669,7 @@ Module_hexchat_command(PyObject *self, PyObject *args)
|
|||||||
BEGIN_XCHAT_CALLS(RESTORE_CONTEXT|ALLOW_THREADS);
|
BEGIN_XCHAT_CALLS(RESTORE_CONTEXT|ALLOW_THREADS);
|
||||||
hexchat_command(ph, text);
|
hexchat_command(ph, text);
|
||||||
END_XCHAT_CALLS();
|
END_XCHAT_CALLS();
|
||||||
Py_INCREF(Py_None);
|
Py_RETURN_NONE;
|
||||||
return Py_None;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
@@ -1722,8 +1681,7 @@ Module_xchat_prnt(PyObject *self, PyObject *args)
|
|||||||
BEGIN_XCHAT_CALLS(RESTORE_CONTEXT|ALLOW_THREADS);
|
BEGIN_XCHAT_CALLS(RESTORE_CONTEXT|ALLOW_THREADS);
|
||||||
hexchat_print(ph, text);
|
hexchat_print(ph, text);
|
||||||
END_XCHAT_CALLS();
|
END_XCHAT_CALLS();
|
||||||
Py_INCREF(Py_None);
|
Py_RETURN_NONE;
|
||||||
return Py_None;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
@@ -1766,8 +1724,7 @@ Module_hexchat_get_info(PyObject *self, PyObject *args)
|
|||||||
info = hexchat_get_info(ph, name);
|
info = hexchat_get_info(ph, name);
|
||||||
END_XCHAT_CALLS();
|
END_XCHAT_CALLS();
|
||||||
if (info == NULL) {
|
if (info == NULL) {
|
||||||
Py_INCREF(Py_None);
|
Py_RETURN_NONE;
|
||||||
return Py_None;
|
|
||||||
}
|
}
|
||||||
if (strcmp (name, "gtkwin_ptr") == 0)
|
if (strcmp (name, "gtkwin_ptr") == 0)
|
||||||
return PyUnicode_FromFormat("%p", info); /* format as pointer */
|
return PyUnicode_FromFormat("%p", info); /* format as pointer */
|
||||||
@@ -1820,8 +1777,7 @@ Module_hexchat_get_context(PyObject *self, PyObject *args)
|
|||||||
return NULL;
|
return NULL;
|
||||||
ctxobj = Context_FromContext(Plugin_GetContext(plugin));
|
ctxobj = Context_FromContext(Plugin_GetContext(plugin));
|
||||||
if (ctxobj == NULL) {
|
if (ctxobj == NULL) {
|
||||||
Py_INCREF(Py_None);
|
Py_RETURN_NONE;
|
||||||
return Py_None;
|
|
||||||
}
|
}
|
||||||
return ctxobj;
|
return ctxobj;
|
||||||
}
|
}
|
||||||
@@ -1838,8 +1794,7 @@ Module_hexchat_find_context(PyObject *self, PyObject *args, PyObject *kwargs)
|
|||||||
return NULL;
|
return NULL;
|
||||||
ctxobj = Context_FromServerAndChannel(server, channel);
|
ctxobj = Context_FromServerAndChannel(server, channel);
|
||||||
if (ctxobj == NULL) {
|
if (ctxobj == NULL) {
|
||||||
Py_INCREF(Py_None);
|
Py_RETURN_NONE;
|
||||||
return Py_None;
|
|
||||||
}
|
}
|
||||||
return ctxobj;
|
return ctxobj;
|
||||||
}
|
}
|
||||||
@@ -1885,7 +1840,7 @@ Module_hexchat_pluginpref_get(PyObject *self, PyObject *args)
|
|||||||
if (!PyArg_ParseTuple(args, "s:get_pluginpref", &var))
|
if (!PyArg_ParseTuple(args, "s:get_pluginpref", &var))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// This will always return numbers as integers.
|
/* This will always return numbers as integers. */
|
||||||
BEGIN_XCHAT_CALLS(NONE);
|
BEGIN_XCHAT_CALLS(NONE);
|
||||||
result = hexchat_pluginpref_get_str(prefph, var, retstr);
|
result = hexchat_pluginpref_get_str(prefph, var, retstr);
|
||||||
END_XCHAT_CALLS();
|
END_XCHAT_CALLS();
|
||||||
@@ -2219,8 +2174,7 @@ Module_hexchat_unhook(PyObject *self, PyObject *args)
|
|||||||
Plugin_RemoveHook(plugin, hook);
|
Plugin_RemoveHook(plugin, hook);
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_INCREF(Py_None);
|
Py_RETURN_NONE;
|
||||||
return Py_None;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
@@ -2528,11 +2482,8 @@ IInterp_Exec(char *command)
|
|||||||
}
|
}
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
len = strlen(command);
|
len = strlen(command);
|
||||||
buffer = (char *) g_malloc(len+2);
|
|
||||||
if (buffer == NULL) {
|
buffer = g_malloc(len + 2);
|
||||||
hexchat_print(ph, "Not enough memory for command buffer");
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
memcpy(buffer, command, len);
|
memcpy(buffer, command, len);
|
||||||
buffer[len] = '\n';
|
buffer[len] = '\n';
|
||||||
buffer[len+1] = 0;
|
buffer[len+1] = 0;
|
||||||
@@ -2778,6 +2729,7 @@ hexchat_plugin_init(hexchat_plugin *plugin_handle,
|
|||||||
Py_Initialize();
|
Py_Initialize();
|
||||||
PySys_SetArgv(1, argv);
|
PySys_SetArgv(1, argv);
|
||||||
|
|
||||||
|
xchatout_buffer = g_string_new (NULL);
|
||||||
xchatout = XChatOut_New();
|
xchatout = XChatOut_New();
|
||||||
if (xchatout == NULL) {
|
if (xchatout == NULL) {
|
||||||
hexchat_print(ph, "Can't allocate xchatout object");
|
hexchat_print(ph, "Can't allocate xchatout object");
|
||||||
@@ -2848,10 +2800,8 @@ hexchat_plugin_deinit()
|
|||||||
plugin_list = NULL;
|
plugin_list = NULL;
|
||||||
|
|
||||||
/* Reset xchatout buffer. */
|
/* Reset xchatout buffer. */
|
||||||
g_free(xchatout_buffer);
|
g_string_free (xchatout_buffer, TRUE);
|
||||||
xchatout_buffer = NULL;
|
xchatout_buffer = NULL;
|
||||||
xchatout_buffer_size = 0;
|
|
||||||
xchatout_buffer_pos = 0;
|
|
||||||
|
|
||||||
if (interp_plugin) {
|
if (interp_plugin) {
|
||||||
Py_DECREF(interp_plugin);
|
Py_DECREF(interp_plugin);
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
libdir = $(hexchatlibdir)
|
libdir = $(hexchatlibdir)
|
||||||
|
|
||||||
lib_LTLIBRARIES = sysinfo.la
|
lib_LTLIBRARIES = sysinfo.la
|
||||||
sysinfo_la_SOURCES = hwmon.c match.c parse.c pci.c xsys.c
|
sysinfo_la_SOURCES = match.c parse.c pci.c xsys.c
|
||||||
sysinfo_la_LDFLAGS = -avoid-version -module
|
sysinfo_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module
|
||||||
sysinfo_la_LIBADD = -lpci
|
sysinfo_la_LIBADD = $(LIBPCI_LIBS) $(GLIB_LIBS)
|
||||||
AM_CPPFLAGS = $(COMMON_CFLAGS) -I$(srcdir)/../../src/common
|
sysinfo_la_CFLAGS = $(LIBPCI_CFLAGS) $(GLIB_CFLAGS) -I$(srcdir)/../../src/common
|
||||||
|
@@ -1,63 +0,0 @@
|
|||||||
/*
|
|
||||||
* hwmon.c - Hardware monitoring functions for X-Sys
|
|
||||||
* Copyright (C) 2005 Tony Vroon
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include "xsys.h"
|
|
||||||
|
|
||||||
int hwmon_chip_present()
|
|
||||||
{
|
|
||||||
FILE *fp = fopen("/sys/class/hwmon/hwmon0/device/name", "r");
|
|
||||||
if(fp != NULL) {
|
|
||||||
fclose(fp);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
void get_hwmon_chip_name(char *name)
|
|
||||||
{
|
|
||||||
char *position, buffer[bsize];
|
|
||||||
FILE *fp = fopen("/sys/class/hwmon/hwmon0/device/name", "r");
|
|
||||||
if(fp != NULL) {
|
|
||||||
if(fgets(buffer, bsize, fp) != NULL) {
|
|
||||||
position = strstr(buffer, "\n");
|
|
||||||
*(position) = '\0';
|
|
||||||
snprintf(name, sizeof(name), "%s", buffer);
|
|
||||||
}
|
|
||||||
fclose(fp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void get_hwmon_temp(unsigned int *value, unsigned int *sensor)
|
|
||||||
{
|
|
||||||
char buffer[bsize];
|
|
||||||
snprintf(buffer, bsize, "/sys/class/hwmon/hwmon0/device/temp%i_input", *sensor);
|
|
||||||
FILE *fp = fopen(buffer, "r");
|
|
||||||
if(fp != NULL) {
|
|
||||||
if(fgets(buffer, bsize, fp) != NULL)
|
|
||||||
*value = atoi(buffer);
|
|
||||||
fclose(fp);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
* hwmon.h - Hardware monitoring header for X-Sys
|
|
||||||
* Copyright (C) 2005 Tony Vroon
|
|
||||||
*
|
|
||||||
* 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 _HWMON_H_
|
|
||||||
#define _HWMON_H_
|
|
||||||
|
|
||||||
int hwmon_chip_present();
|
|
||||||
void get_hwmon_chip_name(char *name);
|
|
||||||
void get_hwmon_temp(unsigned int *value, unsigned int *sensor);
|
|
||||||
|
|
||||||
#endif
|
|
@@ -22,6 +22,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <glib.h>
|
||||||
#include "xsys.h"
|
#include "xsys.h"
|
||||||
|
|
||||||
float percentage(unsigned long long *free, unsigned long long *total)
|
float percentage(unsigned long long *free, unsigned long long *total)
|
||||||
@@ -32,18 +33,18 @@ float percentage(unsigned long long *free, unsigned long long *total)
|
|||||||
|
|
||||||
char *pretty_freespace(const char *desc, unsigned long long *free_k, unsigned long long *total_k)
|
char *pretty_freespace(const char *desc, unsigned long long *free_k, unsigned long long *total_k)
|
||||||
{
|
{
|
||||||
char *result, **quantity;
|
char *quantities[] = { "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB", 0 };
|
||||||
|
char *result, **quantity;
|
||||||
double free_space, total_space;
|
double free_space, total_space;
|
||||||
free_space = *free_k;
|
free_space = *free_k;
|
||||||
total_space = *total_k;
|
total_space = *total_k;
|
||||||
result = malloc(bsize * sizeof(char));
|
result = g_new(char, bsize);
|
||||||
char *quantities[] = { "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB", 0 };
|
|
||||||
if (total_space == 0)
|
if (total_space == 0)
|
||||||
{
|
{
|
||||||
snprintf(result, bsize, "%s: none", desc);
|
g_snprintf(result, bsize, "%s: none", desc);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
quantity = quantities;
|
quantity = quantities;
|
||||||
while (total_space > 1023 && *(quantity + 1))
|
while (total_space > 1023 && *(quantity + 1))
|
||||||
{
|
{
|
||||||
quantity++;
|
quantity++;
|
||||||
@@ -51,11 +52,11 @@ char *pretty_freespace(const char *desc, unsigned long long *free_k, unsigned lo
|
|||||||
total_space = total_space / 1024;
|
total_space = total_space / 1024;
|
||||||
}
|
}
|
||||||
if (sysinfo_get_percent () != 0)
|
if (sysinfo_get_percent () != 0)
|
||||||
snprintf(result, bsize, "%s: %.1f%s, %.1f%% free",
|
g_snprintf(result, bsize, "%s: %.1f%s, %.1f%% free",
|
||||||
desc, total_space, *quantity,
|
desc, total_space, *quantity,
|
||||||
percentage(free_k, total_k));
|
percentage(free_k, total_k));
|
||||||
else
|
else
|
||||||
snprintf(result, bsize, "%s: %.1f%s/%.1f%s free",
|
g_snprintf(result, bsize, "%s: %.1f%s/%.1f%s free",
|
||||||
desc, free_space, *quantity, total_space, *quantity);
|
desc, free_space, *quantity, total_space, *quantity);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -63,28 +64,15 @@ char *pretty_freespace(const char *desc, unsigned long long *free_k, unsigned lo
|
|||||||
|
|
||||||
void remove_leading_whitespace(char *buffer)
|
void remove_leading_whitespace(char *buffer)
|
||||||
{
|
{
|
||||||
char *buffer2 = NULL;
|
char *p;
|
||||||
int i = 0, j = 0, ews = 0;
|
|
||||||
|
|
||||||
buffer2 = (char*)malloc(strlen(buffer) * sizeof(char));
|
if (buffer == NULL)
|
||||||
if (buffer2 == NULL)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
memset (buffer2, (char)0, strlen(buffer));
|
for (p = buffer; *p && isspace (*p); p++)
|
||||||
while (i < strlen(buffer))
|
;
|
||||||
{
|
|
||||||
/* count tabs, spaces as whitespace. */
|
memmove (buffer, p, strlen (p) + 1);
|
||||||
if (!(buffer[i] == (char)32 || buffer[i] == (char)9) || ews == 1)
|
|
||||||
{
|
|
||||||
ews = 1;
|
|
||||||
buffer2[j] = buffer[i];
|
|
||||||
j++;
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
memset (buffer, (char)0, strlen(buffer));
|
|
||||||
strcpy (buffer, buffer2);
|
|
||||||
free (buffer2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char *decruft_filename(char *buffer)
|
char *decruft_filename(char *buffer)
|
||||||
|
@@ -29,11 +29,12 @@
|
|||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <pci/header.h>
|
#include <pci/header.h>
|
||||||
|
#include <glib.h>
|
||||||
|
|
||||||
#include "pci.h"
|
#include "pci.h"
|
||||||
#include "match.h"
|
#include "match.h"
|
||||||
#include "hwmon.h"
|
|
||||||
#include "xsys.h"
|
#include "xsys.h"
|
||||||
|
#include "parse.h"
|
||||||
|
|
||||||
int xs_parse_cpu(char *model, char *vendor, double *freq, char *cache, unsigned int *count)
|
int xs_parse_cpu(char *model, char *vendor, double *freq, char *cache, unsigned int *count)
|
||||||
{
|
{
|
||||||
@@ -46,7 +47,8 @@ int xs_parse_cpu(char *model, char *vendor, double *freq, char *cache, unsigned
|
|||||||
FILE *fp = fopen("/proc/cpuinfo", "r");
|
FILE *fp = fopen("/proc/cpuinfo", "r");
|
||||||
if(fp == NULL)
|
if(fp == NULL)
|
||||||
return 1;
|
return 1;
|
||||||
if(count != NULL) *count = 0;
|
|
||||||
|
*count = 0;
|
||||||
strcpy(cache,"unknown\0");
|
strcpy(cache,"unknown\0");
|
||||||
|
|
||||||
#if defined(__i386__) || defined(__x86_64__)
|
#if defined(__i386__) || defined(__x86_64__)
|
||||||
@@ -121,7 +123,7 @@ int xs_parse_cpu(char *model, char *vendor, double *freq, char *cache, unsigned
|
|||||||
while ((entry = readdir(dir)) != NULL)
|
while ((entry = readdir(dir)) != NULL)
|
||||||
if (strncmp(entry->d_name,"SUNW,UltraSPARC",15) == 0)
|
if (strncmp(entry->d_name,"SUNW,UltraSPARC",15) == 0)
|
||||||
{
|
{
|
||||||
snprintf(buffer,bsize,"/proc/openprom/%s/ecache-size",entry->d_name);
|
g_snprintf(buffer,bsize,"/proc/openprom/%s/ecache-size",entry->d_name);
|
||||||
fp2 = fopen(buffer, "r");
|
fp2 = fopen(buffer, "r");
|
||||||
if (fp2 == NULL) break;
|
if (fp2 == NULL) break;
|
||||||
fscanf(fp2,"%16s",cache);
|
fscanf(fp2,"%16s",cache);
|
||||||
@@ -170,7 +172,7 @@ int xs_parse_os(char *user, char *host, char *kernel)
|
|||||||
|
|
||||||
strncpy(user, usern, bsize);
|
strncpy(user, usern, bsize);
|
||||||
strcpy(host, hostn);
|
strcpy(host, hostn);
|
||||||
snprintf(kernel, bsize, "%s %s %s", osinfo.sysname, osinfo.release, osinfo.machine);
|
g_snprintf(kernel, bsize, "%s %s %s", osinfo.sysname, osinfo.release, osinfo.machine);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -201,9 +203,9 @@ int xs_parse_sound(char *snd_card)
|
|||||||
pos = strstr(buffer, ":");
|
pos = strstr(buffer, ":");
|
||||||
card_id = strtoll(buffer, NULL, 0);
|
card_id = strtoll(buffer, NULL, 0);
|
||||||
if (card_id == 0)
|
if (card_id == 0)
|
||||||
snprintf(card_buf, bsize, "%s", pos+2);
|
g_snprintf(card_buf, bsize, "%s", pos+2);
|
||||||
else
|
else
|
||||||
snprintf(card_buf, bsize, "%ld: %s", card_id, pos+2);
|
g_snprintf(card_buf, bsize, "%ld: %s", card_id, pos+2);
|
||||||
pos = strstr(card_buf, "\n");
|
pos = strstr(card_buf, "\n");
|
||||||
*pos = '\0';
|
*pos = '\0';
|
||||||
strcat(cards, card_buf);
|
strcat(cards, card_buf);
|
||||||
@@ -267,11 +269,11 @@ int xs_parse_netdev(const char *device, unsigned long long *bytes_recv, unsigned
|
|||||||
fclose(fp);
|
fclose(fp);
|
||||||
pos = strstr(buffer, ":");
|
pos = strstr(buffer, ":");
|
||||||
pos++;
|
pos++;
|
||||||
*bytes_recv = strtoull(pos, &pos, 0);
|
*bytes_recv = g_ascii_strtoull (pos, &pos, 0);
|
||||||
|
|
||||||
for(i=0;i<7;i++) strtoull(pos, &pos, 0);
|
for(i=0;i<7;i++) g_ascii_strtoull (pos, &pos, 0);
|
||||||
|
|
||||||
*bytes_sent = strtoull(pos, NULL, 0);
|
*bytes_sent = g_ascii_strtoull (pos, NULL, 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -297,15 +299,15 @@ int xs_parse_df(const char *mount_point, char *result)
|
|||||||
for(;isspace(*pos);pos++);
|
for(;isspace(*pos);pos++);
|
||||||
if(mount_point == NULL)
|
if(mount_point == NULL)
|
||||||
{
|
{
|
||||||
total_k += strtoull(pos, &pos, 0);
|
total_k += g_ascii_strtoull (pos, &pos, 0);
|
||||||
strtoull(pos, &pos, 0);
|
g_ascii_strtoull(pos, &pos, 0);
|
||||||
free_k += strtoull(pos, &pos, 0);
|
free_k += g_ascii_strtoull (pos, &pos, 0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
total_k = strtoull(pos, &pos, 0);
|
total_k = g_ascii_strtoull (pos, &pos, 0);
|
||||||
strtoull(pos, &pos, 0);
|
g_ascii_strtoull(pos, &pos, 0);
|
||||||
free_k = strtoull(pos, &pos, 0);
|
free_k = g_ascii_strtoull (pos, &pos, 0);
|
||||||
strtoull(pos, &pos, 0);
|
g_ascii_strtoull (pos, &pos, 0);
|
||||||
for(;isspace(*pos);pos++);
|
for(;isspace(*pos);pos++);
|
||||||
for(;*pos!='/';pos++);
|
for(;*pos!='/';pos++);
|
||||||
for(i=0;*(buffer+i)!='\n';i++);
|
for(i=0;*(buffer+i)!='\n';i++);
|
||||||
@@ -316,16 +318,16 @@ int xs_parse_df(const char *mount_point, char *result)
|
|||||||
char *tmp_buf = pretty_freespace(pos, &free_k, &total_k);
|
char *tmp_buf = pretty_freespace(pos, &free_k, &total_k);
|
||||||
strcat(tmp_buf, " | ");
|
strcat(tmp_buf, " | ");
|
||||||
strcat(result, tmp_buf);
|
strcat(result, tmp_buf);
|
||||||
free(tmp_buf);
|
g_free(tmp_buf);
|
||||||
}
|
}
|
||||||
else if(strncmp(mount_point, pos, strlen(mount_point)) == 0)
|
else if(strncmp(mount_point, pos, strlen(mount_point)) == 0)
|
||||||
{
|
{
|
||||||
char *tmp_buf = pretty_freespace(mount_point, &free_k, &total_k);
|
char *tmp_buf = pretty_freespace(mount_point, &free_k, &total_k);
|
||||||
strncpy(result, tmp_buf, bsize);
|
strncpy(result, tmp_buf, bsize);
|
||||||
free(tmp_buf);
|
g_free(tmp_buf);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else snprintf(result, bsize, "Mount point %s not found!", mount_point);
|
else g_snprintf(result, bsize, "Mount point %s not found!", mount_point);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mount_point != NULL && strncasecmp(mount_point, "ALL", 3)==0)
|
if(mount_point != NULL && strncasecmp(mount_point, "ALL", 3)==0)
|
||||||
@@ -335,7 +337,7 @@ int xs_parse_df(const char *mount_point, char *result)
|
|||||||
{
|
{
|
||||||
char *tmp_buf = pretty_freespace("Total", &free_k, &total_k);
|
char *tmp_buf = pretty_freespace("Total", &free_k, &total_k);
|
||||||
strncpy(result, tmp_buf, bsize);
|
strncpy(result, tmp_buf, bsize);
|
||||||
free(tmp_buf);
|
g_free(tmp_buf);
|
||||||
}
|
}
|
||||||
pclose(pipe);
|
pclose(pipe);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -387,9 +389,9 @@ int xs_parse_distro(char *name)
|
|||||||
find_match_char(buffer, "ACCEPT_KEYWORDS", keywords);
|
find_match_char(buffer, "ACCEPT_KEYWORDS", keywords);
|
||||||
/* cppcheck-suppress uninitvar */
|
/* cppcheck-suppress uninitvar */
|
||||||
if (strstr(keywords, "\"") == NULL)
|
if (strstr(keywords, "\"") == NULL)
|
||||||
snprintf(buffer, bsize, "Gentoo Linux (stable)");
|
g_snprintf(buffer, bsize, "Gentoo Linux (stable)");
|
||||||
else
|
else
|
||||||
snprintf(buffer, bsize, "Gentoo Linux %s", keywords);
|
g_snprintf(buffer, bsize, "Gentoo Linux %s", keywords);
|
||||||
}
|
}
|
||||||
else if((fp = fopen("/etc/redhat-release", "r")) != NULL)
|
else if((fp = fopen("/etc/redhat-release", "r")) != NULL)
|
||||||
fgets(buffer, bsize, fp);
|
fgets(buffer, bsize, fp);
|
||||||
@@ -404,7 +406,7 @@ int xs_parse_distro(char *name)
|
|||||||
else if((fp = fopen("/etc/turbolinux-release", "r")) != NULL)
|
else if((fp = fopen("/etc/turbolinux-release", "r")) != NULL)
|
||||||
fgets(buffer, bsize, fp);
|
fgets(buffer, bsize, fp);
|
||||||
else if((fp = fopen("/etc/arch-release", "r")) != NULL)
|
else if((fp = fopen("/etc/arch-release", "r")) != NULL)
|
||||||
snprintf(buffer, bsize, "ArchLinux");
|
g_snprintf(buffer, bsize, "ArchLinux");
|
||||||
else if((fp = fopen("/etc/lsb-release", "r")) != NULL)
|
else if((fp = fopen("/etc/lsb-release", "r")) != NULL)
|
||||||
{
|
{
|
||||||
char id[bsize], codename[bsize], release[bsize];
|
char id[bsize], codename[bsize], release[bsize];
|
||||||
@@ -417,16 +419,16 @@ int xs_parse_distro(char *name)
|
|||||||
find_match_char(buffer, "DISTRIB_CODENAME", codename);
|
find_match_char(buffer, "DISTRIB_CODENAME", codename);
|
||||||
find_match_char(buffer, "DISTRIB_RELEASE", release);
|
find_match_char(buffer, "DISTRIB_RELEASE", release);
|
||||||
}
|
}
|
||||||
snprintf(buffer, bsize, "%s \"%s\" %s", id, codename, release);
|
g_snprintf(buffer, bsize, "%s \"%s\" %s", id, codename, release);
|
||||||
}
|
}
|
||||||
else if((fp = fopen("/etc/debian_version", "r")) != NULL)
|
else if((fp = fopen("/etc/debian_version", "r")) != NULL)
|
||||||
{
|
{
|
||||||
char release[bsize];
|
char release[bsize];
|
||||||
fgets(release, bsize, fp);
|
fgets(release, bsize, fp);
|
||||||
snprintf(buffer, bsize, "Debian %s", release);
|
g_snprintf(buffer, bsize, "Debian %s", release);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
snprintf(buffer, bsize, "Unknown Distro");
|
g_snprintf(buffer, bsize, "Unknown Distro");
|
||||||
if(fp != NULL) fclose(fp);
|
if(fp != NULL) fclose(fp);
|
||||||
|
|
||||||
pos=strchr(buffer, '\n');
|
pos=strchr(buffer, '\n');
|
||||||
@@ -434,28 +436,3 @@ int xs_parse_distro(char *name)
|
|||||||
strcpy(name, buffer);
|
strcpy(name, buffer);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int xs_parse_hwmon_chip(char *chip)
|
|
||||||
{
|
|
||||||
if (!hwmon_chip_present())
|
|
||||||
return 1;
|
|
||||||
#if 0
|
|
||||||
else
|
|
||||||
get_hwmon_chip_name(chip);
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int xs_parse_hwmon_temp(char *temp, unsigned int *sensor)
|
|
||||||
{
|
|
||||||
unsigned int value;
|
|
||||||
float celsius;
|
|
||||||
|
|
||||||
if (!hwmon_chip_present())
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
get_hwmon_temp(&value, sensor);
|
|
||||||
celsius = (float)value;
|
|
||||||
snprintf(temp, bsize, "%.1fC", celsius/1000.0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
@@ -34,7 +34,5 @@ int xs_parse_video(char *vid_card);
|
|||||||
int xs_parse_agpbridge(char *agp_bridge);
|
int xs_parse_agpbridge(char *agp_bridge);
|
||||||
int xs_parse_ether(char *ethernet_card);
|
int xs_parse_ether(char *ethernet_card);
|
||||||
int xs_parse_distro(char *name);
|
int xs_parse_distro(char *name);
|
||||||
int xs_parse_hwmon_chip(char *chip);
|
|
||||||
int xs_parse_hwmon_temp(char *temp, unsigned int *sensor);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -25,6 +25,8 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <pci/pci.h>
|
#include <pci/pci.h>
|
||||||
|
#include <glib.h>
|
||||||
|
|
||||||
#include "xsys.h"
|
#include "xsys.h"
|
||||||
|
|
||||||
static struct pci_filter filter; /* Device filter */
|
static struct pci_filter filter; /* Device filter */
|
||||||
@@ -47,8 +49,7 @@ static struct device *scan_device(struct pci_dev *p)
|
|||||||
|
|
||||||
if (!pci_filter_match(&filter, p))
|
if (!pci_filter_match(&filter, p))
|
||||||
return NULL;
|
return NULL;
|
||||||
d = malloc(sizeof(struct device));
|
d = g_new0 (struct device, 1);
|
||||||
bzero(d, sizeof(*d));
|
|
||||||
d->dev = p;
|
d->dev = p;
|
||||||
if (!pci_read_block(p, 0, d->config, how_much))
|
if (!pci_read_block(p, 0, d->config, how_much))
|
||||||
exit(1);
|
exit(1);
|
||||||
@@ -98,8 +99,8 @@ int pci_find_by_class(u16 *class, char *vendor, char *device)
|
|||||||
/* Acquire vendor & device ID if the class matches */
|
/* Acquire vendor & device ID if the class matches */
|
||||||
if(get_conf_word(d, PCI_CLASS_DEVICE) == *class) {
|
if(get_conf_word(d, PCI_CLASS_DEVICE) == *class) {
|
||||||
nomatch = 0;
|
nomatch = 0;
|
||||||
snprintf(vendor,7,"%04x",p->vendor_id);
|
g_snprintf(vendor,7,"%04x",p->vendor_id);
|
||||||
snprintf(device,7,"%04x",p->device_id);
|
g_snprintf(device,7,"%04x",p->device_id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -115,12 +116,13 @@ void pci_find_fullname(char *fullname, char *vendor, char *device)
|
|||||||
char devicename[bsize/2] = "";
|
char devicename[bsize/2] = "";
|
||||||
char *position;
|
char *position;
|
||||||
int cardfound = 0;
|
int cardfound = 0;
|
||||||
|
FILE *fp;
|
||||||
|
|
||||||
sysinfo_get_pciids (buffer);
|
sysinfo_get_pciids (buffer);
|
||||||
FILE *fp = fopen (buffer, "r");
|
fp = fopen (buffer, "r");
|
||||||
|
|
||||||
if(fp == NULL) {
|
if(fp == NULL) {
|
||||||
snprintf(fullname, bsize, "%s:%s", vendor, device);
|
g_snprintf(fullname, bsize, "%s:%s", vendor, device);
|
||||||
sysinfo_print_error ("pci.ids file not found! You might want to adjust your pciids setting with /SYSINFO SET pciids (you can query its current value with /SYSINFO LIST).\n");
|
sysinfo_print_error ("pci.ids file not found! You might want to adjust your pciids setting with /SYSINFO SET pciids (you can query its current value with /SYSINFO LIST).\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -149,8 +151,8 @@ void pci_find_fullname(char *fullname, char *vendor, char *device)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cardfound == 1)
|
if (cardfound == 1)
|
||||||
snprintf(fullname, bsize, "%s %s", vendorname, devicename);
|
g_snprintf(fullname, bsize, "%s %s", vendorname, devicename);
|
||||||
else
|
else
|
||||||
snprintf(fullname, bsize, "%s:%s", vendor, device);
|
g_snprintf(fullname, bsize, "%s:%s", vendor, device);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
@@ -155,7 +155,7 @@ getOsName (void)
|
|||||||
static char *
|
static char *
|
||||||
getCpuName (void)
|
getCpuName (void)
|
||||||
{
|
{
|
||||||
// Get extended ids.
|
/* Get extended ids. */
|
||||||
unsigned int nExIds;
|
unsigned int nExIds;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
int CPUInfo[4] = {-1};
|
int CPUInfo[4] = {-1};
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -86,6 +87,7 @@ print_summary (int announce, char* format)
|
|||||||
char os_host[bsize];
|
char os_host[bsize];
|
||||||
char os_user[bsize];
|
char os_user[bsize];
|
||||||
char os_kernel[bsize];
|
char os_kernel[bsize];
|
||||||
|
char *free_space;
|
||||||
unsigned long long mem_total;
|
unsigned long long mem_total;
|
||||||
unsigned long long mem_free;
|
unsigned long long mem_free;
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
@@ -98,7 +100,7 @@ print_summary (int announce, char* format)
|
|||||||
int seconds;
|
int seconds;
|
||||||
sysinfo[0] = '\0';
|
sysinfo[0] = '\0';
|
||||||
|
|
||||||
snprintf (buffer, bsize, "%s", hexchat_get_info (ph, "version"));
|
g_snprintf (buffer, bsize, "%s", hexchat_get_info (ph, "version"));
|
||||||
format_output ("HexChat", buffer, format);
|
format_output ("HexChat", buffer, format);
|
||||||
strcat (sysinfo, "\017 ");
|
strcat (sysinfo, "\017 ");
|
||||||
strncat (sysinfo, buffer, bsize - strlen (sysinfo));
|
strncat (sysinfo, buffer, bsize - strlen (sysinfo));
|
||||||
@@ -110,7 +112,7 @@ print_summary (int announce, char* format)
|
|||||||
return HEXCHAT_EAT_ALL;
|
return HEXCHAT_EAT_ALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf (buffer, bsize, "%s", os_kernel);
|
g_snprintf (buffer, bsize, "%s", os_kernel);
|
||||||
format_output ("OS", buffer, format);
|
format_output ("OS", buffer, format);
|
||||||
strcat (sysinfo, "\017 ");
|
strcat (sysinfo, "\017 ");
|
||||||
strncat (sysinfo, buffer, bsize - strlen (sysinfo));
|
strncat (sysinfo, buffer, bsize - strlen (sysinfo));
|
||||||
@@ -140,11 +142,11 @@ print_summary (int announce, char* format)
|
|||||||
|
|
||||||
if (giga)
|
if (giga)
|
||||||
{
|
{
|
||||||
snprintf (buffer, bsize, "%u x %s (%s) @ %.2fGHz", count, cpu_model, cpu_vendor, cpu_freq);
|
g_snprintf (buffer, bsize, "%u x %s (%s) @ %.2fGHz", count, cpu_model, cpu_vendor, cpu_freq);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf (buffer, bsize, "%u x %s (%s) @ %.0fMHz", count, cpu_model, cpu_vendor, cpu_freq);
|
g_snprintf (buffer, bsize, "%u x %s (%s) @ %.0fMHz", count, cpu_model, cpu_vendor, cpu_freq);
|
||||||
}
|
}
|
||||||
|
|
||||||
format_output ("CPU", buffer, format);
|
format_output ("CPU", buffer, format);
|
||||||
@@ -158,7 +160,9 @@ print_summary (int announce, char* format)
|
|||||||
return HEXCHAT_EAT_ALL;
|
return HEXCHAT_EAT_ALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf (buffer, bsize, "%s", pretty_freespace ("Physical", &mem_free, &mem_total));
|
free_space = pretty_freespace ("Physical", &mem_free, &mem_total);
|
||||||
|
g_snprintf (buffer, bsize, "%s", free_space);
|
||||||
|
g_free (free_space);
|
||||||
format_output ("RAM", buffer, format);
|
format_output ("RAM", buffer, format);
|
||||||
strcat (sysinfo, "\017 ");
|
strcat (sysinfo, "\017 ");
|
||||||
strncat (sysinfo, buffer, bsize - strlen (sysinfo));
|
strncat (sysinfo, buffer, bsize - strlen (sysinfo));
|
||||||
@@ -220,21 +224,21 @@ print_summary (int announce, char* format)
|
|||||||
{
|
{
|
||||||
if (weeks != 0)
|
if (weeks != 0)
|
||||||
{
|
{
|
||||||
snprintf (buffer, bsize, "%dw %dd %dh %dm %ds", weeks, days, hours, minutes, seconds);
|
g_snprintf (buffer, bsize, "%dw %dd %dh %dm %ds", weeks, days, hours, minutes, seconds);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf (buffer, bsize, "%dd %dh %dm %ds", days, hours, minutes, seconds);
|
g_snprintf (buffer, bsize, "%dd %dh %dm %ds", days, hours, minutes, seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf (buffer, bsize, "%dh %dm %ds", hours, minutes, seconds);
|
g_snprintf (buffer, bsize, "%dh %dm %ds", hours, minutes, seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf (buffer, bsize, "%dm %ds", minutes, seconds);
|
g_snprintf (buffer, bsize, "%dm %ds", minutes, seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,7 +272,7 @@ print_os (int announce, char* format)
|
|||||||
return HEXCHAT_EAT_ALL;
|
return HEXCHAT_EAT_ALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf (buffer, bsize, "%s@%s, %s", user, host, kernel);
|
g_snprintf (buffer, bsize, "%s@%s, %s", user, host, kernel);
|
||||||
format_output ("OS", buffer, format);
|
format_output ("OS", buffer, format);
|
||||||
|
|
||||||
if (announce)
|
if (announce)
|
||||||
@@ -332,11 +336,11 @@ print_cpu (int announce, char* format)
|
|||||||
|
|
||||||
if (giga)
|
if (giga)
|
||||||
{
|
{
|
||||||
snprintf (buffer, bsize, "%u x %s (%s) @ %.2fGHz w/ %s L2 Cache", count, model, vendor, freq, cache);
|
g_snprintf (buffer, bsize, "%u x %s (%s) @ %.2fGHz w/ %s L2 Cache", count, model, vendor, freq, cache);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf (buffer, bsize, "%u x %s (%s) @ %.0fMHz w/ %s L2 Cache", count, model, vendor, freq, cache);
|
g_snprintf (buffer, bsize, "%u x %s (%s) @ %.0fMHz w/ %s L2 Cache", count, model, vendor, freq, cache);
|
||||||
}
|
}
|
||||||
|
|
||||||
format_output ("CPU", buffer, format);
|
format_output ("CPU", buffer, format);
|
||||||
@@ -373,7 +377,7 @@ print_ram (int announce, char* format)
|
|||||||
return HEXCHAT_EAT_ALL;
|
return HEXCHAT_EAT_ALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf (string, bsize, "%s - %s", pretty_freespace ("Physical", &mem_free, &mem_total), pretty_freespace ("Swap", &swap_free, &swap_total));
|
g_snprintf (string, bsize, "%s - %s", pretty_freespace ("Physical", &mem_free, &mem_total), pretty_freespace ("Swap", &swap_free, &swap_total));
|
||||||
format_output ("RAM", string, format);
|
format_output ("RAM", string, format);
|
||||||
|
|
||||||
if (announce)
|
if (announce)
|
||||||
@@ -448,11 +452,11 @@ print_vga (int announce, char* format)
|
|||||||
|
|
||||||
if (xs_parse_agpbridge (agp_bridge) != 0)
|
if (xs_parse_agpbridge (agp_bridge) != 0)
|
||||||
{
|
{
|
||||||
snprintf (buffer, bsize, "%s", vid_card);
|
g_snprintf (buffer, bsize, "%s", vid_card);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf (buffer, bsize, "%s @ %s", vid_card, agp_bridge);
|
g_snprintf (buffer, bsize, "%s @ %s", vid_card, agp_bridge);
|
||||||
}
|
}
|
||||||
|
|
||||||
format_output ("VGA", buffer, format);
|
format_output ("VGA", buffer, format);
|
||||||
@@ -543,21 +547,21 @@ print_uptime (int announce, char* format)
|
|||||||
{
|
{
|
||||||
if (weeks != 0)
|
if (weeks != 0)
|
||||||
{
|
{
|
||||||
snprintf (buffer, bsize, "%dw %dd %dh %dm %ds", weeks, days, hours, minutes, seconds);
|
g_snprintf (buffer, bsize, "%dw %dd %dh %dm %ds", weeks, days, hours, minutes, seconds);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf (buffer, bsize, "%dd %dh %dm %ds", days, hours, minutes, seconds);
|
g_snprintf (buffer, bsize, "%dd %dh %dm %ds", days, hours, minutes, seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf (buffer, bsize, "%dh %dm %ds", hours, minutes, seconds);
|
g_snprintf (buffer, bsize, "%dh %dm %ds", hours, minutes, seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf (buffer, bsize, "%dm %ds", minutes, seconds);
|
g_snprintf (buffer, bsize, "%dm %ds", minutes, seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -598,7 +602,7 @@ netdata_cb (char *word[], char *word_eol[], void *userdata)
|
|||||||
bytes_recv /= 1024;
|
bytes_recv /= 1024;
|
||||||
bytes_sent /= 1024;
|
bytes_sent /= 1024;
|
||||||
|
|
||||||
snprintf (netdata, bsize, "%s: %.1f MB Received, %.1f MB Sent", word[2], (double)bytes_recv/1024.0, (double)bytes_sent/1024.0);
|
g_snprintf (netdata, bsize, "%s: %.1f MB Received, %.1f MB Sent", word[2], (double)bytes_recv/1024.0, (double)bytes_sent/1024.0);
|
||||||
hexchat_pluginpref_get_str (ph, "format", format);
|
hexchat_pluginpref_get_str (ph, "format", format);
|
||||||
format_output ("Netdata", netdata, format);
|
format_output ("Netdata", netdata, format);
|
||||||
|
|
||||||
@@ -654,24 +658,24 @@ netstream_cb (char *word[], char *word_eol[], void *userdata)
|
|||||||
if (bytes_recv > 1024)
|
if (bytes_recv > 1024)
|
||||||
{
|
{
|
||||||
bytes_recv /= 1024;
|
bytes_recv /= 1024;
|
||||||
snprintf (mag_r, 5, "KB/s");
|
g_snprintf (mag_r, 5, "KB/s");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf (mag_r, 5, "B/s");
|
g_snprintf (mag_r, 5, "B/s");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bytes_sent > 1024)
|
if (bytes_sent > 1024)
|
||||||
{
|
{
|
||||||
bytes_sent /= 1024;
|
bytes_sent /= 1024;
|
||||||
snprintf (mag_s, 5, "KB/s");
|
g_snprintf (mag_s, 5, "KB/s");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf (mag_s, 5, "B/s");
|
g_snprintf (mag_s, 5, "B/s");
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf (netstream, bsize, "%s: Receiving %llu %s, Sending %llu %s", word[2], bytes_recv, mag_r, bytes_sent, mag_s);
|
g_snprintf (netstream, bsize, "%s: Receiving %llu %s, Sending %llu %s", word[2], bytes_recv, mag_r, bytes_sent, mag_s);
|
||||||
hexchat_pluginpref_get_str (ph, "format", format);
|
hexchat_pluginpref_get_str (ph, "format", format);
|
||||||
format_output ("Netstream", netstream, format);
|
format_output ("Netstream", netstream, format);
|
||||||
|
|
||||||
@@ -750,7 +754,7 @@ sysinfo_cb (char *word[], char *word_eol[], void *userdata)
|
|||||||
|
|
||||||
if (!g_ascii_strcasecmp ("HELP", word[2+offset]))
|
if (!g_ascii_strcasecmp ("HELP", word[2+offset]))
|
||||||
{
|
{
|
||||||
hexchat_printf (ph, sysinfo_help);
|
hexchat_printf (ph, "%s", sysinfo_help);
|
||||||
return HEXCHAT_EAT_ALL;
|
return HEXCHAT_EAT_ALL;
|
||||||
}
|
}
|
||||||
else if (!g_ascii_strcasecmp ("LIST", word[2+offset]))
|
else if (!g_ascii_strcasecmp ("LIST", word[2+offset]))
|
||||||
@@ -870,7 +874,7 @@ sysinfo_cb (char *word[], char *word_eol[], void *userdata)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
hexchat_printf (ph, sysinfo_help);
|
hexchat_printf (ph, "%s", sysinfo_help);
|
||||||
return HEXCHAT_EAT_ALL;
|
return HEXCHAT_EAT_ALL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -878,11 +882,11 @@ sysinfo_cb (char *word[], char *word_eol[], void *userdata)
|
|||||||
int
|
int
|
||||||
hexchat_plugin_init (hexchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg)
|
hexchat_plugin_init (hexchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg)
|
||||||
{
|
{
|
||||||
|
char buffer[bsize];
|
||||||
ph = plugin_handle;
|
ph = plugin_handle;
|
||||||
*plugin_name = name;
|
*plugin_name = name;
|
||||||
*plugin_desc = desc;
|
*plugin_desc = desc;
|
||||||
*plugin_version = version;
|
*plugin_version = version;
|
||||||
char buffer[bsize];
|
|
||||||
|
|
||||||
hexchat_hook_command (ph, "SYSINFO", HEXCHAT_PRI_NORM, sysinfo_cb, sysinfo_help, NULL);
|
hexchat_hook_command (ph, "SYSINFO", HEXCHAT_PRI_NORM, sysinfo_cb, sysinfo_help, NULL);
|
||||||
hexchat_hook_command (ph, "NETDATA", HEXCHAT_PRI_NORM, netdata_cb, NULL, NULL);
|
hexchat_hook_command (ph, "NETDATA", HEXCHAT_PRI_NORM, netdata_cb, NULL, NULL);
|
||||||
|
@@ -128,7 +128,7 @@ print_version (char *word[], char *word_eol[], void *userdata)
|
|||||||
|
|
||||||
if (!g_ascii_strcasecmp ("HELP", word[2]))
|
if (!g_ascii_strcasecmp ("HELP", word[2]))
|
||||||
{
|
{
|
||||||
hexchat_printf (ph, upd_help);
|
hexchat_printf (ph, "%s", upd_help);
|
||||||
return HEXCHAT_EAT_HEXCHAT;
|
return HEXCHAT_EAT_HEXCHAT;
|
||||||
}
|
}
|
||||||
else if (!g_ascii_strcasecmp ("SET", word[2]))
|
else if (!g_ascii_strcasecmp ("SET", word[2]))
|
||||||
@@ -200,7 +200,7 @@ print_version (char *word[], char *word_eol[], void *userdata)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
hexchat_printf (ph, upd_help);
|
hexchat_printf (ph, "%s", upd_help);
|
||||||
return HEXCHAT_EAT_HEXCHAT;
|
return HEXCHAT_EAT_HEXCHAT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -10,6 +10,8 @@ src/common/inbound.c
|
|||||||
src/common/notify.c
|
src/common/notify.c
|
||||||
src/common/outbound.c
|
src/common/outbound.c
|
||||||
src/common/plugin.c
|
src/common/plugin.c
|
||||||
|
src/common/plugin-identd.c
|
||||||
|
src/common/plugin-timer.c
|
||||||
src/common/server.c
|
src/common/server.c
|
||||||
src/common/servlist.c
|
src/common/servlist.c
|
||||||
src/common/textevents.h
|
src/common/textevents.h
|
||||||
|
2
po/bg.po
2
po/bg.po
@@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# Translators:
|
# Translators:
|
||||||
# Rostislav Raykov <zbrox@i-space.org>, 2005
|
# Rostislav Raykov <zbrox@i-space.org>, 2005
|
||||||
# n0kS Phr33d0m <shibam@v-gz.cz.cc>, 2012
|
# Phr33d0m <shibam@v-gz.cz.cc>, 2012
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: HexChat\n"
|
"Project-Id-Version: HexChat\n"
|
||||||
|
2
po/da.po
2
po/da.po
@@ -6,7 +6,7 @@
|
|||||||
# Birger Langkjer <birger.langkjer@image.dk>, 1999
|
# Birger Langkjer <birger.langkjer@image.dk>, 1999
|
||||||
# bviktor, 2012
|
# bviktor, 2012
|
||||||
# Daniel Nylander <po@danielnylander.se>, 2007-2008,2010
|
# Daniel Nylander <po@danielnylander.se>, 2007-2008,2010
|
||||||
# Dennis Skov Midjord <dennisskovhermannsen@gmail.com>, 2012-2013
|
# Incendia <dennisskovhermannsen@gmail.com>, 2012-2013
|
||||||
# Henrik Hansen <hh@mailserver.dk>, 1999
|
# Henrik Hansen <hh@mailserver.dk>, 1999
|
||||||
# Keld Simonsen, <keld2keldix.com>, 2011
|
# Keld Simonsen, <keld2keldix.com>, 2011
|
||||||
# Morten Brix Pedersen <morten@wtf.dk>, 2001
|
# Morten Brix Pedersen <morten@wtf.dk>, 2001
|
||||||
|
134
po/de.po
134
po/de.po
@@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# Translators:
|
# Translators:
|
||||||
# SSL <albkert@gmail.com>, 2013
|
# SSL <albkert@gmail.com>, 2013
|
||||||
# Alf Gaida <agaida@siduction.org>, 2014
|
# agaida <agaida@siduction.org>, 2014
|
||||||
# Benedikt Roth <Benedikt.Roth@gmx.net>, 2000
|
# Benedikt Roth <Benedikt.Roth@gmx.net>, 2000
|
||||||
# Christian Meyer <linux@chrisim.de>, 2000
|
# Christian Meyer <linux@chrisim.de>, 2000
|
||||||
# Aray <dataray@web.de>, 2014
|
# Aray <dataray@web.de>, 2014
|
||||||
@@ -13,11 +13,11 @@
|
|||||||
# Jakob Kramer <jakob.kramer@gmx.de>, 2012-2013
|
# Jakob Kramer <jakob.kramer@gmx.de>, 2012-2013
|
||||||
# Karl Eichwalder <ke@gnu.franken.de>, 2003
|
# Karl Eichwalder <ke@gnu.franken.de>, 2003
|
||||||
# Klaas <klaasdemter@googlemail.com>, 2013
|
# Klaas <klaasdemter@googlemail.com>, 2013
|
||||||
# RJ ., 2012
|
# subscious, 2012
|
||||||
# Marcel Metz <mmetz@adrian-broher.net>, 2013
|
# adrian_broher <mmetz@adrian-broher.net>, 2013
|
||||||
# Matthias Warkus <mawa@iname.com>, 1999
|
# Matthias Warkus <mawa@iname.com>, 1999
|
||||||
# RJ ., 2014
|
# subscious, 2014
|
||||||
# Richard Schwab <mail@w.tf-w.tf>, 2013-2014
|
# Nothing4You <mail@w.tf-w.tf>, 2013-2014
|
||||||
# Tamer Fahmy <e9526976@stud2.tuwien.ac.at>, 1999
|
# Tamer Fahmy <e9526976@stud2.tuwien.ac.at>, 1999
|
||||||
# TheX <xerus@live.de>, 2013
|
# TheX <xerus@live.de>, 2013
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -25,7 +25,7 @@ msgstr ""
|
|||||||
"Project-Id-Version: HexChat\n"
|
"Project-Id-Version: HexChat\n"
|
||||||
"Report-Msgid-Bugs-To: www.hexchat.org\n"
|
"Report-Msgid-Bugs-To: www.hexchat.org\n"
|
||||||
"POT-Creation-Date: 2014-05-14 13:20-0400\n"
|
"POT-Creation-Date: 2014-05-14 13:20-0400\n"
|
||||||
"PO-Revision-Date: 2014-07-25 21:49+0000\n"
|
"PO-Revision-Date: 2014-06-02 04:31+0000\n"
|
||||||
"Last-Translator: Aray <dataray@web.de>\n"
|
"Last-Translator: Aray <dataray@web.de>\n"
|
||||||
"Language-Team: German (http://www.transifex.com/projects/p/hexchat/language/de/)\n"
|
"Language-Team: German (http://www.transifex.com/projects/p/hexchat/language/de/)\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
@@ -45,7 +45,7 @@ msgstr "HexChar ist ein einfach zu benutzender, aber erweiterbarer IRC-CLient. E
|
|||||||
msgid ""
|
msgid ""
|
||||||
"HexChat supports features such as: DCC, SASL, proxies, spellcheck, alerts, "
|
"HexChat supports features such as: DCC, SASL, proxies, spellcheck, alerts, "
|
||||||
"logging, custom themes, and Python/Perl scripts."
|
"logging, custom themes, and Python/Perl scripts."
|
||||||
msgstr "Hexchat unterstützt Features wie: DCC, SASL, procies, Rechtschreibprüfung, Benachrichtigungen, Logging, Benutzerdesigns und Python/Perl-Scripte"
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/misc/hexchat.desktop.in.h:1
|
#: ../data/misc/hexchat.desktop.in.h:1
|
||||||
msgid "HexChat"
|
msgid "HexChat"
|
||||||
@@ -57,11 +57,11 @@ msgstr "IRC-Client"
|
|||||||
|
|
||||||
#: ../data/misc/hexchat.desktop.in.h:3
|
#: ../data/misc/hexchat.desktop.in.h:3
|
||||||
msgid "Chat with other people online"
|
msgid "Chat with other people online"
|
||||||
msgstr "Chatte online mit anderen Leuten"
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/misc/hexchat.desktop.in.h:4
|
#: ../data/misc/hexchat.desktop.in.h:4
|
||||||
msgid "IM;Chat;"
|
msgid "IM;Chat;"
|
||||||
msgstr "IM;Chat;"
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/misc/hexchat.desktop.in.h:5
|
#: ../data/misc/hexchat.desktop.in.h:5
|
||||||
msgid "Open Safe Mode"
|
msgid "Open Safe Mode"
|
||||||
@@ -299,7 +299,7 @@ msgstr "CTCP-Flut von %s, %s wird jetzt ignoriert\n"
|
|||||||
#: ../src/common/ignore.c:410
|
#: ../src/common/ignore.c:410
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "You are being MSG flooded from %s, setting gui_autoopen_dialog OFF.\n"
|
msgid "You are being MSG flooded from %s, setting gui_autoopen_dialog OFF.\n"
|
||||||
msgstr "Du wirst gerade von %s ge\"MSGflooded\". Setze gui_autoopen_dialog auf AUS.\n"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/notify.c:558
|
#: ../src/common/notify.c:558
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -365,7 +365,7 @@ msgstr "Unbekanntes Argument »%s« ignoriert."
|
|||||||
|
|
||||||
#: ../src/common/outbound.c:3093 ../src/common/outbound.c:3123
|
#: ../src/common/outbound.c:3093 ../src/common/outbound.c:3123
|
||||||
msgid "Quiet is not supported by this server."
|
msgid "Quiet is not supported by this server."
|
||||||
msgstr "Ruhigstellen wird von diesem Server nicht unterstützt."
|
msgstr ""
|
||||||
|
|
||||||
#. error
|
#. error
|
||||||
#: ../src/common/outbound.c:3585 ../src/common/outbound.c:3619
|
#: ../src/common/outbound.c:3585 ../src/common/outbound.c:3619
|
||||||
@@ -670,7 +670,7 @@ msgstr "QUERY [-nofocus] <Nick >, öffnet ein neues Dialogfenster [im Hintergrun
|
|||||||
msgid ""
|
msgid ""
|
||||||
"QUIET <mask> [<quiettype>], quiet everyone matching the mask in the current "
|
"QUIET <mask> [<quiettype>], quiet everyone matching the mask in the current "
|
||||||
"channel if supported by the server."
|
"channel if supported by the server."
|
||||||
msgstr "QUIET <mask>[<quiettype>], stellt jeden im aktuellen Kanal ruhig, der auf diese Maske passt, wenn der Server Ruhigstellen unterstützt."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/outbound.c:4041
|
#: ../src/common/outbound.c:4041
|
||||||
msgid "QUIT [<reason>], disconnects from the current server"
|
msgid "QUIT [<reason>], disconnects from the current server"
|
||||||
@@ -780,7 +780,7 @@ msgstr "UNLOAD <Name>, entfernt ein Plugin oder Skript"
|
|||||||
msgid ""
|
msgid ""
|
||||||
"UNQUIET <mask> [<mask>...], unquiets the specified masks if supported by the"
|
"UNQUIET <mask> [<mask>...], unquiets the specified masks if supported by the"
|
||||||
" server."
|
" server."
|
||||||
msgstr "UNQUIET <mask> [<mask>...], hebt eine Maske auf, die für automatische Ruhigstellung benutzt wird, wenn der Server es unterstützt."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/outbound.c:4090
|
#: ../src/common/outbound.c:4090
|
||||||
msgid "URL <url>, opens a URL in your browser"
|
msgid "URL <url>, opens a URL in your browser"
|
||||||
@@ -874,27 +874,27 @@ msgstr "%C18*%O$t%C18$1%O zur Benachrichtigungsliste hinzugefügt."
|
|||||||
|
|
||||||
#: ../src/common/textevents.h:9
|
#: ../src/common/textevents.h:9
|
||||||
msgid "%C22*%O$t%C22$1%O: %C18$2%O on %C24$4%O by %C26$3%O"
|
msgid "%C22*%O$t%C22$1%O: %C18$2%O on %C24$4%O by %C26$3%O"
|
||||||
msgstr "%C22*%O$t%C22$1%O: %C18$2%O auf %C24$4%O von %C26$3%O"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/textevents.h:12
|
#: ../src/common/textevents.h:12
|
||||||
msgid "%C22*%O$tCannot join %C22$1 %O(%C20You are banned%O)."
|
msgid "%C22*%O$tCannot join %C22$1 %O(%C20You are banned%O)."
|
||||||
msgstr "%C22*%O$t Kann nicht betreten: %C22$1 %O(%C20Du wurdest gebannt%O)."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/textevents.h:18
|
#: ../src/common/textevents.h:18
|
||||||
msgid "%C29*%O$tCapabilities acknowledged: %C29$2%O"
|
msgid "%C29*%O$tCapabilities acknowledged: %C29$2%O"
|
||||||
msgstr "%C29*%O$tRechte erteilt: %C29$2%O"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/textevents.h:21
|
#: ../src/common/textevents.h:21
|
||||||
msgid "%C23*%O$tCapabilities supported: %C29$2%O"
|
msgid "%C23*%O$tCapabilities supported: %C29$2%O"
|
||||||
msgstr "%C23*%O$tRechte unterstützt: %C29$2%O"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/textevents.h:24
|
#: ../src/common/textevents.h:24
|
||||||
msgid "%C23*%O$tCapabilities requested: %C29$1%O"
|
msgid "%C23*%O$tCapabilities requested: %C29$1%O"
|
||||||
msgstr "%C23*%O$tRechte erbeten: %C29$1%O"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/textevents.h:27
|
#: ../src/common/textevents.h:27
|
||||||
msgid "%C24*%O$t%C28$1%O is now known as %C18$2%O"
|
msgid "%C24*%O$t%C28$1%O is now known as %C18$2%O"
|
||||||
msgstr "%C24*%O$t%C28$1%O heißt jetzt %C18$2%O"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/textevents.h:36
|
#: ../src/common/textevents.h:36
|
||||||
msgid "%C22*%O$t%C26$1%O sets ban on %C18$2%O"
|
msgid "%C22*%O$t%C26$1%O sets ban on %C18$2%O"
|
||||||
@@ -902,7 +902,7 @@ msgstr "%C22*%O$t%C26$1%O setzt einen Bann auf %C18$2%O"
|
|||||||
|
|
||||||
#: ../src/common/textevents.h:39
|
#: ../src/common/textevents.h:39
|
||||||
msgid "%C22*%O$tChannel %C22$1%O created on %C24$2%O"
|
msgid "%C22*%O$tChannel %C22$1%O created on %C24$2%O"
|
||||||
msgstr "%C22*%O$tKanal %C22$1%O wurde erstellt am %C24$2%O"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/textevents.h:42
|
#: ../src/common/textevents.h:42
|
||||||
msgid "%C22*%O$t%C26$1%O removes channel half-operator status from %C18$2%O"
|
msgid "%C22*%O$t%C26$1%O removes channel half-operator status from %C18$2%O"
|
||||||
@@ -918,15 +918,15 @@ msgstr "%C22*%O$t%C26$1%O entfernt Voice-Status bei%C26 $2"
|
|||||||
|
|
||||||
#: ../src/common/textevents.h:51
|
#: ../src/common/textevents.h:51
|
||||||
msgid "%C22*%O$t%C26$1%C sets exempt on %C18$2%O"
|
msgid "%C22*%O$t%C26$1%C sets exempt on %C18$2%O"
|
||||||
msgstr "%C22*%O$t%C26$1%C setzt Ausnahme für %C18$2%O"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/textevents.h:54
|
#: ../src/common/textevents.h:54
|
||||||
msgid "%C22*%O$t%C26$1%O gives channel half-operator status to %C18$2%O"
|
msgid "%C22*%O$t%C26$1%O gives channel half-operator status to %C18$2%O"
|
||||||
msgstr "%C22*%O$t%C26$1%O erteilt %C18$2%O Halb-Operator-Status"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/textevents.h:57
|
#: ../src/common/textevents.h:57
|
||||||
msgid "%C22*%O$t%C26$1%C sets invite exempt on %C18$2%O"
|
msgid "%C22*%O$t%C26$1%C sets invite exempt on %C18$2%O"
|
||||||
msgstr "%C22*%O$t%C26$1%C setzt Invite-Ausnahme für %C18$2%O"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/textevents.h:60
|
#: ../src/common/textevents.h:60
|
||||||
msgid "%UChannel Users Topic"
|
msgid "%UChannel Users Topic"
|
||||||
@@ -1481,7 +1481,7 @@ msgstr "Server-Name"
|
|||||||
|
|
||||||
#: ../src/common/text.c:1060
|
#: ../src/common/text.c:1060
|
||||||
msgid "Acknowledged Capabilities"
|
msgid "Acknowledged Capabilities"
|
||||||
msgstr "Verliehene Rechte"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/text.c:1065
|
#: ../src/common/text.c:1065
|
||||||
msgid "Server Capabilities"
|
msgid "Server Capabilities"
|
||||||
@@ -1489,7 +1489,7 @@ msgstr "Server-Fähigkeiten"
|
|||||||
|
|
||||||
#: ../src/common/text.c:1069
|
#: ../src/common/text.c:1069
|
||||||
msgid "Requested Capabilities"
|
msgid "Requested Capabilities"
|
||||||
msgstr "Angeforderte Rechte"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/text.c:1073 ../src/common/text.c:1135
|
#: ../src/common/text.c:1073 ../src/common/text.c:1135
|
||||||
msgid "Old nickname"
|
msgid "Old nickname"
|
||||||
@@ -1637,11 +1637,11 @@ msgstr "Die Bannmaske"
|
|||||||
|
|
||||||
#: ../src/common/text.c:1201
|
#: ../src/common/text.c:1201
|
||||||
msgid "The nick of the person who did the quieting"
|
msgid "The nick of the person who did the quieting"
|
||||||
msgstr "Der Nick der Person, die ruhig stellte"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/text.c:1202 ../src/common/text.c:1234
|
#: ../src/common/text.c:1202 ../src/common/text.c:1234
|
||||||
msgid "The quiet mask"
|
msgid "The quiet mask"
|
||||||
msgstr "Die Ruhigstellungsmaske"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/text.c:1206
|
#: ../src/common/text.c:1206
|
||||||
msgid "The nick who removed the key"
|
msgid "The nick who removed the key"
|
||||||
@@ -1681,7 +1681,7 @@ msgstr "Der Nick der Person, die den Bann entfernte"
|
|||||||
|
|
||||||
#: ../src/common/text.c:1233
|
#: ../src/common/text.c:1233
|
||||||
msgid "The nick of the person of did the unquiet'ing"
|
msgid "The nick of the person of did the unquiet'ing"
|
||||||
msgstr "Nick der Person, die die Ruhigstellung aufhob"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/text.c:1238
|
#: ../src/common/text.c:1238
|
||||||
msgid "The nick of the person who did the exempt"
|
msgid "The nick of the person who did the exempt"
|
||||||
@@ -3110,11 +3110,11 @@ msgstr "Einlad."
|
|||||||
|
|
||||||
#: ../src/fe-gtk/banlist.c:76
|
#: ../src/fe-gtk/banlist.c:76
|
||||||
msgid "Quiets"
|
msgid "Quiets"
|
||||||
msgstr "Ruhigstellungen"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/banlist.c:77
|
#: ../src/fe-gtk/banlist.c:77
|
||||||
msgid "Quiet"
|
msgid "Quiet"
|
||||||
msgstr "Ruhigstellen"
|
msgstr ""
|
||||||
|
|
||||||
#. poor way to get which is selected but it works
|
#. poor way to get which is selected but it works
|
||||||
#: ../src/fe-gtk/banlist.c:351 ../src/fe-gtk/banlist.c:385
|
#: ../src/fe-gtk/banlist.c:351 ../src/fe-gtk/banlist.c:385
|
||||||
@@ -3405,7 +3405,7 @@ msgstr "Plugins nicht automatisch laden"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/fe-gtk.c:83
|
#: ../src/fe-gtk/fe-gtk.c:83
|
||||||
msgid "Show plugin/script auto-load directory"
|
msgid "Show plugin/script auto-load directory"
|
||||||
msgstr "Zeige automatisches Ladeverzeichnis für Plugins/Scripte"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/fe-gtk.c:84
|
#: ../src/fe-gtk/fe-gtk.c:84
|
||||||
msgid "Show user config directory"
|
msgid "Show user config directory"
|
||||||
@@ -3475,7 +3475,7 @@ msgid ""
|
|||||||
"switch to the page with the most recent and important activity (queries "
|
"switch to the page with the most recent and important activity (queries "
|
||||||
"first, then channels with hilight, channels with dialogue, channels with "
|
"first, then channels with hilight, channels with dialogue, channels with "
|
||||||
"other data)"
|
"other data)"
|
||||||
msgstr "Der \"Seite ändern\" Befehl wechselt zwischen den Seiten im Notizblock. Setze \"Data 1\" auf die Seite, zu der du wechseln möchtest. Wenn \"Data 2\" festgelegt wurde, wird der Wechsel relativ zur aktuellen Position erfolgen. Setze \"Data 1\", um automatisch zu der Seite mit den neuesten und wichtigsten Aktivitäten (Privatchats zuerst, dann Kanäle mit Highlight, Kanäle mit Dialog, Kanäle mit anderen Daten) zu wechseln."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/fkeys.c:145
|
#: ../src/fe-gtk/fkeys.c:145
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -3487,7 +3487,7 @@ msgstr "Die Insert in Buffer Aktion fügt den Inhalt von »Data 1« in die Zei
|
|||||||
msgid ""
|
msgid ""
|
||||||
"The Scroll Page command scrolls the text widget up or down one page or one"
|
"The Scroll Page command scrolls the text widget up or down one page or one"
|
||||||
" line. Set Data 1 to either Top, Bottom, Up, Down, +1 or -1."
|
" line. Set Data 1 to either Top, Bottom, Up, Down, +1 or -1."
|
||||||
msgstr "Der Bildlauf-Befehl verschiebt das Text-Widget um eine Seite oder eine Zeile aufwärts oder abwärts. Setze \"Data 1\" Anfang, Ende oder Auf, Ab um +1 oder -1."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/fkeys.c:149
|
#: ../src/fe-gtk/fkeys.c:149
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -3552,7 +3552,7 @@ msgstr "Fehler beim Laden der Tastaturkürzel-Konfiguration"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/fkeys.c:540
|
#: ../src/fe-gtk/fkeys.c:540
|
||||||
msgid "Select a row to get help information on its Action."
|
msgid "Select a row to get help information on its Action."
|
||||||
msgstr "Markiere eine Zeile, für Hilfestellung über die jeweilige Aktion."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/fkeys.c:809
|
#: ../src/fe-gtk/fkeys.c:809
|
||||||
msgid ": Keyboard Shortcuts"
|
msgid ": Keyboard Shortcuts"
|
||||||
@@ -3859,7 +3859,7 @@ msgstr "Suche beendet, kein Treffer."
|
|||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:2944
|
#: ../src/fe-gtk/maingui.c:2944
|
||||||
msgid "Highlight _all"
|
msgid "Highlight _all"
|
||||||
msgstr "Highlight _alle"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:2950
|
#: ../src/fe-gtk/maingui.c:2950
|
||||||
msgid "Highlight all occurrences, and underline the current occurrence."
|
msgid "Highlight all occurrences, and underline the current occurrence."
|
||||||
@@ -3867,7 +3867,7 @@ msgstr "Hebe alle Vorkommnisse hervor und unterstreiche das aktuelle Vorkommnis.
|
|||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:2952
|
#: ../src/fe-gtk/maingui.c:2952
|
||||||
msgid "Mat_ch case"
|
msgid "Mat_ch case"
|
||||||
msgstr "Groß-/Kleins_chreibung angleichen"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:2957
|
#: ../src/fe-gtk/maingui.c:2957
|
||||||
msgid "Perform a case-sensitive search."
|
msgid "Perform a case-sensitive search."
|
||||||
@@ -3875,7 +3875,7 @@ msgstr "Eine Case-Sensitive Suche ausführen"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:2959
|
#: ../src/fe-gtk/maingui.c:2959
|
||||||
msgid "_Regex"
|
msgid "_Regex"
|
||||||
msgstr "_Regulärer Ausdruck"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:2964
|
#: ../src/fe-gtk/maingui.c:2964
|
||||||
msgid "Regard search string as a regular expression."
|
msgid "Regard search string as a regular expression."
|
||||||
@@ -3973,7 +3973,7 @@ msgstr "Automatisches Betreten"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1113 ../src/fe-gtk/menu.c:1117
|
#: ../src/fe-gtk/menu.c:1113 ../src/fe-gtk/menu.c:1117
|
||||||
msgid "_Auto-Connect"
|
msgid "_Auto-Connect"
|
||||||
msgstr "_Automatisches Verbinden"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1137
|
#: ../src/fe-gtk/menu.c:1137
|
||||||
msgid ": User menu"
|
msgid ": User menu"
|
||||||
@@ -3998,7 +3998,7 @@ msgstr "Markierungslinie manuell zurücksetzen"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1304
|
#: ../src/fe-gtk/menu.c:1304
|
||||||
msgid "Marker line reset because exceeded scrollback limit."
|
msgid "Marker line reset because exceeded scrollback limit."
|
||||||
msgstr "Markierungslinie wurde zurückgesetzt, weil die begrenzung des Scrollbalkens überschritten wurde."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1306
|
#: ../src/fe-gtk/menu.c:1306
|
||||||
msgid "Marker line reset by CLEAR command."
|
msgid "Marker line reset by CLEAR command."
|
||||||
@@ -4014,7 +4014,7 @@ msgstr "Empfange Channelliste …"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1461
|
#: ../src/fe-gtk/menu.c:1461
|
||||||
msgid " has been build without plugin support."
|
msgid " has been build without plugin support."
|
||||||
msgstr "wurde ohne Plugin-Support erstellt"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1469
|
#: ../src/fe-gtk/menu.c:1469
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -4215,7 +4215,7 @@ msgstr "Grafisch"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1785
|
#: ../src/fe-gtk/menu.c:1785
|
||||||
msgid "_Fullscreen"
|
msgid "_Fullscreen"
|
||||||
msgstr "_Vollbild"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1787
|
#: ../src/fe-gtk/menu.c:1787
|
||||||
msgid "_Server"
|
msgid "_Server"
|
||||||
@@ -4231,15 +4231,15 @@ msgstr "_Wiederverbinden"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1790
|
#: ../src/fe-gtk/menu.c:1790
|
||||||
msgid "_Join a Channel..."
|
msgid "_Join a Channel..."
|
||||||
msgstr "_Betrete einen Kanal"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1791
|
#: ../src/fe-gtk/menu.c:1791
|
||||||
msgid "_List of Channels..."
|
msgid "_List of Channels..."
|
||||||
msgstr "_Liste aller Kanäle"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1794
|
#: ../src/fe-gtk/menu.c:1794
|
||||||
msgid "Marked _Away"
|
msgid "Marked _Away"
|
||||||
msgstr "Als _Abwesend markiert"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1796
|
#: ../src/fe-gtk/menu.c:1796
|
||||||
msgid "_Usermenu"
|
msgid "_Usermenu"
|
||||||
@@ -4297,7 +4297,7 @@ msgstr "_Fenster"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1812
|
#: ../src/fe-gtk/menu.c:1812
|
||||||
msgid "_Ban List..."
|
msgid "_Ban List..."
|
||||||
msgstr "_Bannliste"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1813
|
#: ../src/fe-gtk/menu.c:1813
|
||||||
msgid "Character Chart..."
|
msgid "Character Chart..."
|
||||||
@@ -4309,7 +4309,7 @@ msgstr "Direktchat …"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1815
|
#: ../src/fe-gtk/menu.c:1815
|
||||||
msgid "File _Transfers..."
|
msgid "File _Transfers..."
|
||||||
msgstr "Dateiüber_tragung"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1816
|
#: ../src/fe-gtk/menu.c:1816
|
||||||
msgid "Friends List..."
|
msgid "Friends List..."
|
||||||
@@ -4321,11 +4321,11 @@ msgstr "Ignorierliste …"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1818
|
#: ../src/fe-gtk/menu.c:1818
|
||||||
msgid "_Plugins and Scripts..."
|
msgid "_Plugins and Scripts..."
|
||||||
msgstr "_Plugins und Scripte"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1819
|
#: ../src/fe-gtk/menu.c:1819
|
||||||
msgid "_Raw Log..."
|
msgid "_Raw Log..."
|
||||||
msgstr "_Roher Log"
|
msgstr ""
|
||||||
|
|
||||||
#. 61
|
#. 61
|
||||||
#: ../src/fe-gtk/menu.c:1820
|
#: ../src/fe-gtk/menu.c:1820
|
||||||
@@ -4564,11 +4564,11 @@ msgstr "_Laden …"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/plugingui.c:270
|
#: ../src/fe-gtk/plugingui.c:270
|
||||||
msgid "_Unload"
|
msgid "_Unload"
|
||||||
msgstr "_Entladen"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/plugingui.c:273
|
#: ../src/fe-gtk/plugingui.c:273
|
||||||
msgid "_Reload"
|
msgid "_Reload"
|
||||||
msgstr "_Neu laden"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/rawlog.c:80 ../src/fe-gtk/rawlog.c:136
|
#: ../src/fe-gtk/rawlog.c:80 ../src/fe-gtk/rawlog.c:136
|
||||||
#: ../src/fe-gtk/textgui.c:479 ../src/fe-gtk/urlgrab.c:216
|
#: ../src/fe-gtk/textgui.c:479 ../src/fe-gtk/urlgrab.c:216
|
||||||
@@ -4694,7 +4694,7 @@ msgstr "Passwort:"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/servlistgui.c:1885
|
#: ../src/fe-gtk/servlistgui.c:1885
|
||||||
msgid "Password used for login. If in doubt, leave blank."
|
msgid "Password used for login. If in doubt, leave blank."
|
||||||
msgstr "Passwort zum Einloggen. Im Zweifel leer lassen."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/servlistgui.c:1890
|
#: ../src/fe-gtk/servlistgui.c:1890
|
||||||
msgid "Character set:"
|
msgid "Character set:"
|
||||||
@@ -5106,11 +5106,11 @@ msgstr "Nickvervollständigung sortiert nach:"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:205
|
#: ../src/fe-gtk/setup.c:205
|
||||||
msgid "Nick completion amount:"
|
msgid "Nick completion amount:"
|
||||||
msgstr "Anzahl Nickvervollständigung"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:205
|
#: ../src/fe-gtk/setup.c:205
|
||||||
msgid "Threshold of nicks to start listing instead of completing"
|
msgid "Threshold of nicks to start listing instead of completing"
|
||||||
msgstr "Schwellwert zum Auflisten von Nicks anstatt Vervollständigung"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:205
|
#: ../src/fe-gtk/setup.c:205
|
||||||
msgid "nicks."
|
msgid "nicks."
|
||||||
@@ -5303,7 +5303,7 @@ msgstr "Neue Reiter im Vordergrund:"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:319
|
#: ../src/fe-gtk/setup.c:319
|
||||||
msgid "Placement of notices:"
|
msgid "Placement of notices:"
|
||||||
msgstr "Plaziern von Notizen:"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:320
|
#: ../src/fe-gtk/setup.c:320
|
||||||
msgid "Show channel switcher at:"
|
msgid "Show channel switcher at:"
|
||||||
@@ -5436,7 +5436,7 @@ msgstr "Symbol im Benachrichtigungsbereich blinken lassen bei:"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:404
|
#: ../src/fe-gtk/setup.c:404
|
||||||
msgid "Bounce dock icon on:"
|
msgid "Bounce dock icon on:"
|
||||||
msgstr "Dock-Icon springen lassen bei:"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:407 ../src/fe-gtk/setup.c:453
|
#: ../src/fe-gtk/setup.c:407 ../src/fe-gtk/setup.c:453
|
||||||
msgid "Blink task bar on:"
|
msgid "Blink task bar on:"
|
||||||
@@ -5451,17 +5451,17 @@ msgstr "Piepsen bei:"
|
|||||||
msgid ""
|
msgid ""
|
||||||
"Play the \"Instant Message Notification\" system sound upon the selected "
|
"Play the \"Instant Message Notification\" system sound upon the selected "
|
||||||
"events"
|
"events"
|
||||||
msgstr "Den \"Sofortnachrichten-Benachrichtigungs\"-Systemton bei folgenden Ereignissen abspielen:"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:414
|
#: ../src/fe-gtk/setup.c:414
|
||||||
msgid ""
|
msgid ""
|
||||||
"Play \"message-new-instant\" from the freedesktop.org sound theme upon the "
|
"Play \"message-new-instant\" from the freedesktop.org sound theme upon the "
|
||||||
"selected events"
|
"selected events"
|
||||||
msgstr "Den \"message-new-instant\"-Ton aus dem freedesktop.org Soundthema bei ausgewählten Ereignissen abspielen"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:416
|
#: ../src/fe-gtk/setup.c:416
|
||||||
msgid "Play a GTK beep upon the selected events"
|
msgid "Play a GTK beep upon the selected events"
|
||||||
msgstr "einen GTK Piepton bei den ausgewählten Ereignissen abspielen"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:420 ../src/fe-gtk/setup.c:456
|
#: ../src/fe-gtk/setup.c:420 ../src/fe-gtk/setup.c:456
|
||||||
msgid "Omit alerts when marked as being away"
|
msgid "Omit alerts when marked as being away"
|
||||||
@@ -5489,7 +5489,7 @@ msgstr "Ins Infofeld schließen"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:431
|
#: ../src/fe-gtk/setup.c:431
|
||||||
msgid "Automatically mark away/back"
|
msgid "Automatically mark away/back"
|
||||||
msgstr "Automatisch als abwesend/zurück markieren"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:431
|
#: ../src/fe-gtk/setup.c:431
|
||||||
msgid "Automatically change status when hiding to tray."
|
msgid "Automatically change status when hiding to tray."
|
||||||
@@ -5497,7 +5497,7 @@ msgstr "Status automatisch wechseln, wenn das Programm in den Tray geschlossen w
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:433
|
#: ../src/fe-gtk/setup.c:433
|
||||||
msgid "Only show tray balloons when hidden or iconified"
|
msgid "Only show tray balloons when hidden or iconified"
|
||||||
msgstr "Balloon-Tipps nur anzeigen, wenn minimiert oder im Tray"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:436 ../src/fe-gtk/setup.c:459
|
#: ../src/fe-gtk/setup.c:436 ../src/fe-gtk/setup.c:459
|
||||||
msgid "Highlighted Messages"
|
msgid "Highlighted Messages"
|
||||||
@@ -5668,7 +5668,7 @@ msgstr "Benutze Serverzeit, wenn unterstützt"
|
|||||||
msgid ""
|
msgid ""
|
||||||
"Display timestamps obtained from server if it supports the time-server "
|
"Display timestamps obtained from server if it supports the time-server "
|
||||||
"extension."
|
"extension."
|
||||||
msgstr "Zeitstempel vom Server holen, wenn die \"Time-Server\"-Erweiterung unterstützt wird."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:521
|
#: ../src/fe-gtk/setup.c:521
|
||||||
msgid "Automatically reconnect to servers on disconnect"
|
msgid "Automatically reconnect to servers on disconnect"
|
||||||
@@ -5684,13 +5684,13 @@ msgstr "Verzögerung beim automatischen Betreten:"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:524
|
#: ../src/fe-gtk/setup.c:524
|
||||||
msgid "Ban Type:"
|
msgid "Ban Type:"
|
||||||
msgstr "Bannart:"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:524
|
#: ../src/fe-gtk/setup.c:524
|
||||||
msgid ""
|
msgid ""
|
||||||
"Attempt to use this banmask when banning or quieting. (requires "
|
"Attempt to use this banmask when banning or quieting. (requires "
|
||||||
"irc_who_join)"
|
"irc_who_join)"
|
||||||
msgstr "Versuchen, diese Bannmaske zu benutzen, wenn gebannt oder ruhiggestellt wird. (benötigt irc_who_join)"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:531 ../src/fe-gtk/setup.c:1817
|
#: ../src/fe-gtk/setup.c:531 ../src/fe-gtk/setup.c:1817
|
||||||
msgid "Logging"
|
msgid "Logging"
|
||||||
@@ -5795,7 +5795,7 @@ msgstr "Nur für Computer mit mehreren Adressen."
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:585
|
#: ../src/fe-gtk/setup.c:585
|
||||||
msgid "File Transfers"
|
msgid "File Transfers"
|
||||||
msgstr "Dateiübertragungen"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:586
|
#: ../src/fe-gtk/setup.c:586
|
||||||
msgid "Get my address from the IRC server"
|
msgid "Get my address from the IRC server"
|
||||||
@@ -5997,7 +5997,7 @@ msgstr "Chatten"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:1816
|
#: ../src/fe-gtk/setup.c:1816
|
||||||
msgid "Sounds"
|
msgid "Sounds"
|
||||||
msgstr "Töne"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:1818
|
#: ../src/fe-gtk/setup.c:1818
|
||||||
msgid "Advanced"
|
msgid "Advanced"
|
||||||
@@ -6062,12 +6062,12 @@ msgstr "Ignoriere Alles"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/sexy-spell-entry.c:711
|
#: ../src/fe-gtk/sexy-spell-entry.c:711
|
||||||
msgid "Spelling Suggestions"
|
msgid "Spelling Suggestions"
|
||||||
msgstr "Rechtschreib-Vorschläge"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/sexy-spell-entry.c:1272
|
#: ../src/fe-gtk/sexy-spell-entry.c:1272
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "enchant error for language: %s"
|
msgid "enchant error for language: %s"
|
||||||
msgstr "Fehler in der enchant-Bibliothek in Sprache: %s"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/textgui.c:171
|
#: ../src/fe-gtk/textgui.c:171
|
||||||
msgid "There was an error parsing the string"
|
msgid "There was an error parsing the string"
|
||||||
|
2
po/el.po
2
po/el.po
@@ -3,7 +3,7 @@
|
|||||||
# This file is distributed under the same license as the PACKAGE package.
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
#
|
#
|
||||||
# Translators:
|
# Translators:
|
||||||
# Filippos Soulakis <txapollo243@gmail.com>, 2013
|
# txapollo243 <txapollo243@gmail.com>, 2013
|
||||||
# Stathis Kamperis <ekamperi@auth.gr>, 2006
|
# Stathis Kamperis <ekamperi@auth.gr>, 2006
|
||||||
# Γιάννης Ανθυμίδης <yannanth@gmail.com>, 2013
|
# Γιάννης Ανθυμίδης <yannanth@gmail.com>, 2013
|
||||||
msgid ""
|
msgid ""
|
||||||
|
22
po/en_GB.po
22
po/en_GB.po
@@ -3,19 +3,19 @@
|
|||||||
# This file is distributed under the same license as the PACKAGE package.
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
#
|
#
|
||||||
# Translators:
|
# Translators:
|
||||||
# Alfred Daw <sacarasc@gmail.com>, 2013
|
# sacarasc <sacarasc@gmail.com>, 2013
|
||||||
# Sir_Burpalot <doctor.z01db3rg@gmail.com>, 2014
|
# Sir_Burpalot <doctor.z01db3rg@gmail.com>, 2014
|
||||||
# Gareth Owen <gowen72@yahoo.com>, 2004
|
# Gareth Owen <gowen72@yahoo.com>, 2004
|
||||||
# Ivan Srbulov <Srbulov.Ivan@gmail.com>, 2013
|
# tea <Srbulov.Ivan@gmail.com>, 2013
|
||||||
# Richard Hitt <rbh00@netcom.com>, 2013
|
# rbh00 <rbh00@netcom.com>, 2013
|
||||||
# Alfred Daw <sacarasc@gmail.com>, 2012
|
# sacarasc <sacarasc@gmail.com>, 2012
|
||||||
# TheEndermen <theendermenofdoom@gmail.com>, 2012
|
# TheEndermen <theendermenofdoom@gmail.com>, 2012
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: HexChat\n"
|
"Project-Id-Version: HexChat\n"
|
||||||
"Report-Msgid-Bugs-To: www.hexchat.org\n"
|
"Report-Msgid-Bugs-To: www.hexchat.org\n"
|
||||||
"POT-Creation-Date: 2014-05-14 13:20-0400\n"
|
"POT-Creation-Date: 2014-05-14 13:20-0400\n"
|
||||||
"PO-Revision-Date: 2014-07-09 19:40+0000\n"
|
"PO-Revision-Date: 2014-05-21 20:52+0000\n"
|
||||||
"Last-Translator: Sir_Burpalot <doctor.z01db3rg@gmail.com>\n"
|
"Last-Translator: Sir_Burpalot <doctor.z01db3rg@gmail.com>\n"
|
||||||
"Language-Team: English (United Kingdom) (http://www.transifex.com/projects/p/hexchat/language/en_GB/)\n"
|
"Language-Team: English (United Kingdom) (http://www.transifex.com/projects/p/hexchat/language/en_GB/)\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
@@ -126,7 +126,7 @@ msgstr "No active DCCs\n"
|
|||||||
|
|
||||||
#: ../src/common/hexchat.c:867
|
#: ../src/common/hexchat.c:867
|
||||||
msgid "_Open Dialog Window"
|
msgid "_Open Dialog Window"
|
||||||
msgstr "_Open Dialogue Window"
|
msgstr "_Open Dialog Window"
|
||||||
|
|
||||||
#: ../src/common/hexchat.c:868
|
#: ../src/common/hexchat.c:868
|
||||||
msgid "_Send a File"
|
msgid "_Send a File"
|
||||||
@@ -3670,7 +3670,7 @@ msgstr "_Always show this dialog after connecting."
|
|||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:397
|
#: ../src/fe-gtk/maingui.c:397
|
||||||
msgid "Dialog with"
|
msgid "Dialog with"
|
||||||
msgstr "Dialogue with"
|
msgstr "Dialog with"
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:695
|
#: ../src/fe-gtk/maingui.c:695
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -3686,7 +3686,7 @@ msgstr "No topic is set"
|
|||||||
msgid ""
|
msgid ""
|
||||||
"This server still has %d channels or dialogs associated with it. Close them "
|
"This server still has %d channels or dialogs associated with it. Close them "
|
||||||
"all?"
|
"all?"
|
||||||
msgstr "This server still has %d channels or dialogues associated with it. Close them all?"
|
msgstr "This server still has %d channels or dialogs associated with it. Close them all?"
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1203
|
#: ../src/fe-gtk/maingui.c:1203
|
||||||
msgid "Quit HexChat?"
|
msgid "Quit HexChat?"
|
||||||
@@ -4056,7 +4056,7 @@ msgid ""
|
|||||||
"%s = selected nick\n"
|
"%s = selected nick\n"
|
||||||
"%t = time/date\n"
|
"%t = time/date\n"
|
||||||
"%u = selected users account"
|
"%u = selected users account"
|
||||||
msgstr "Dialogue Buttons - Special codes:\n\n%a = all selected nicks\n%c = current channel\n%e = current network name\n%h = selected nick's hostname\n%m = machine info\n%n = your nick\n%s = selected nick\n%t = time/date\n%u = selected users account"
|
msgstr "Dialog Buttons - Special codes:\n\n%a = all selected nicks\n%c = current channel\n%e = current network name\n%h = selected nick's hostname\n%m = machine info\n%n = your nick\n%s = selected nick\n%t = time/date\n%u = selected users account"
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1507
|
#: ../src/fe-gtk/menu.c:1507
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -4112,7 +4112,7 @@ msgstr ": Userlist buttons"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1574
|
#: ../src/fe-gtk/menu.c:1574
|
||||||
msgid ": Dialog buttons"
|
msgid ": Dialog buttons"
|
||||||
msgstr ": Dialogue buttons"
|
msgstr ": Dialog buttons"
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1581
|
#: ../src/fe-gtk/menu.c:1581
|
||||||
msgid ": CTCP Replies"
|
msgid ": CTCP Replies"
|
||||||
@@ -4428,7 +4428,7 @@ msgstr ": Friends List"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/notifygui.c:429
|
#: ../src/fe-gtk/notifygui.c:429
|
||||||
msgid "Open Dialog"
|
msgid "Open Dialog"
|
||||||
msgstr "Open Dialogue"
|
msgstr "Open Dialog"
|
||||||
|
|
||||||
#: ../src/fe-gtk/plugin-tray.c:264
|
#: ../src/fe-gtk/plugin-tray.c:264
|
||||||
#, c-format
|
#, c-format
|
||||||
|
8
po/es.po
8
po/es.po
@@ -4,16 +4,16 @@
|
|||||||
#
|
#
|
||||||
# Translators:
|
# Translators:
|
||||||
# bviktor, 2012
|
# bviktor, 2012
|
||||||
# Víctor <vegadark89@gmail.com>, 2013-2014
|
# Víctor منتصر <vegadark89@gmail.com>, 2013-2014
|
||||||
# Víctor <vegadark89@gmail.com>, 2012-2013
|
# Víctor منتصر <vegadark89@gmail.com>, 2012-2013
|
||||||
# Víctor <vegadark89@gmail.com>, 2014
|
# Víctor منتصر <vegadark89@gmail.com>, 2014
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: HexChat\n"
|
"Project-Id-Version: HexChat\n"
|
||||||
"Report-Msgid-Bugs-To: www.hexchat.org\n"
|
"Report-Msgid-Bugs-To: www.hexchat.org\n"
|
||||||
"POT-Creation-Date: 2014-05-14 13:20-0400\n"
|
"POT-Creation-Date: 2014-05-14 13:20-0400\n"
|
||||||
"PO-Revision-Date: 2014-05-14 17:34+0000\n"
|
"PO-Revision-Date: 2014-05-14 17:34+0000\n"
|
||||||
"Last-Translator: Víctor <vegadark89@gmail.com>\n"
|
"Last-Translator: Víctor منتصر <vegadark89@gmail.com>\n"
|
||||||
"Language-Team: Spanish (http://www.transifex.com/projects/p/hexchat/language/es/)\n"
|
"Language-Team: Spanish (http://www.transifex.com/projects/p/hexchat/language/es/)\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
2
po/eu.po
2
po/eu.po
@@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# Translators:
|
# Translators:
|
||||||
# Mikel Olasagasti <hey_neken@euskal.org>, 2004
|
# Mikel Olasagasti <hey_neken@euskal.org>, 2004
|
||||||
# Mikel Olasagasti Uranga <mikel@olasagasti.info>, 2012
|
# Hey_neken <mikel@olasagasti.info>, 2012
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: HexChat\n"
|
"Project-Id-Version: HexChat\n"
|
||||||
|
157
po/fi.po
157
po/fi.po
@@ -3,14 +3,13 @@
|
|||||||
# This file is distributed under the same license as the PACKAGE package.
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
#
|
#
|
||||||
# Translators:
|
# Translators:
|
||||||
# Toni Willberg, 2014
|
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: HexChat\n"
|
"Project-Id-Version: HexChat\n"
|
||||||
"Report-Msgid-Bugs-To: www.hexchat.org\n"
|
"Report-Msgid-Bugs-To: www.hexchat.org\n"
|
||||||
"POT-Creation-Date: 2014-05-14 13:20-0400\n"
|
"POT-Creation-Date: 2014-05-14 13:20-0400\n"
|
||||||
"PO-Revision-Date: 2014-06-24 13:54+0000\n"
|
"PO-Revision-Date: 2014-05-14 17:20+0000\n"
|
||||||
"Last-Translator: Toni Willberg\n"
|
"Last-Translator: TingPing <tingping@tingping.se>\n"
|
||||||
"Language-Team: Finnish (http://www.transifex.com/projects/p/hexchat/language/fi/)\n"
|
"Language-Team: Finnish (http://www.transifex.com/projects/p/hexchat/language/fi/)\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
@@ -37,7 +36,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../data/misc/hexchat.desktop.in.h:2
|
#: ../data/misc/hexchat.desktop.in.h:2
|
||||||
msgid "IRC Client"
|
msgid "IRC Client"
|
||||||
msgstr "IRC Client"
|
msgstr ""
|
||||||
|
|
||||||
#: ../data/misc/hexchat.desktop.in.h:3
|
#: ../data/misc/hexchat.desktop.in.h:3
|
||||||
msgid "Chat with other people online"
|
msgid "Chat with other people online"
|
||||||
@@ -120,19 +119,19 @@ msgstr "Ei aktiivisia DCC-yhteyksiä\n"
|
|||||||
|
|
||||||
#: ../src/common/hexchat.c:867
|
#: ../src/common/hexchat.c:867
|
||||||
msgid "_Open Dialog Window"
|
msgid "_Open Dialog Window"
|
||||||
msgstr "Avaa keskusteluikkuna"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/hexchat.c:868
|
#: ../src/common/hexchat.c:868
|
||||||
msgid "_Send a File"
|
msgid "_Send a File"
|
||||||
msgstr "Lähetä tiedo_sto"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/hexchat.c:869
|
#: ../src/common/hexchat.c:869
|
||||||
msgid "_User Info (WhoIs)"
|
msgid "_User Info (WhoIs)"
|
||||||
msgstr "Käyttäjätiedot (Whois)"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/hexchat.c:870
|
#: ../src/common/hexchat.c:870
|
||||||
msgid "_Add to Friends List"
|
msgid "_Add to Friends List"
|
||||||
msgstr "Lisää k_averilistalle"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/hexchat.c:871
|
#: ../src/common/hexchat.c:871
|
||||||
msgid "_Ignore"
|
msgid "_Ignore"
|
||||||
@@ -306,12 +305,12 @@ msgstr "Mihinkään palvelimeen ei ole yhteyttä. Kokeile /server <isäntä> [<p
|
|||||||
#: ../src/common/outbound.c:280
|
#: ../src/common/outbound.c:280
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Server %s already exists on network %s.\n"
|
msgid "Server %s already exists on network %s.\n"
|
||||||
msgstr "Palvelin %s on jo verkossa %s.\n"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/outbound.c:286
|
#: ../src/common/outbound.c:286
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Added server %s to network %s.\n"
|
msgid "Added server %s to network %s.\n"
|
||||||
msgstr "Lisättiin palvelin %s verkoon %s.\n"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/outbound.c:371
|
#: ../src/common/outbound.c:371
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -607,7 +606,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/common/outbound.c:4020
|
#: ../src/common/outbound.c:4020
|
||||||
msgid "NAMES [channel], Lists the nicks on the channel"
|
msgid "NAMES [channel], Lists the nicks on the channel"
|
||||||
msgstr "NAMES [kanava], luettelee kanavalla olevat käyttäjät"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/outbound.c:4022
|
#: ../src/common/outbound.c:4022
|
||||||
msgid "NCTCP <nick> <message>, Sends a CTCP notice"
|
msgid "NCTCP <nick> <message>, Sends a CTCP notice"
|
||||||
@@ -1192,7 +1191,7 @@ msgstr ""
|
|||||||
#: ../src/common/textevents.h:279
|
#: ../src/common/textevents.h:279
|
||||||
msgid ""
|
msgid ""
|
||||||
"%C20*%O$tNickname is erroneous or already in use. Use /NICK to try another."
|
"%C20*%O$tNickname is erroneous or already in use. Use /NICK to try another."
|
||||||
msgstr "%C20*%O$tNimi on virheellinen tai jo käytössä. Käytä /NICK -komentoa yrittääksesi uudelleen."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/textevents.h:282
|
#: ../src/common/textevents.h:282
|
||||||
msgid "%C20*%O$tNo such DCC."
|
msgid "%C20*%O$tNo such DCC."
|
||||||
@@ -1204,11 +1203,11 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/common/textevents.h:294
|
#: ../src/common/textevents.h:294
|
||||||
msgid "%C23*%O$tNotify: %C18$1%C is away (%C24$2%O)"
|
msgid "%C23*%O$tNotify: %C18$1%C is away (%C24$2%O)"
|
||||||
msgstr "%C23*%O$tNotify: %C18$1%C on poissa (%C24$2%O)"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/textevents.h:297
|
#: ../src/common/textevents.h:297
|
||||||
msgid "%C23*%O$tNotify: %C18$1%C is back"
|
msgid "%C23*%O$tNotify: %C18$1%C is back"
|
||||||
msgstr "%C23*%O$tNotify: %C18$1%C tuli takaisin"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/textevents.h:300
|
#: ../src/common/textevents.h:300
|
||||||
msgid "$tNotify list is empty."
|
msgid "$tNotify list is empty."
|
||||||
@@ -2108,7 +2107,7 @@ msgstr "Kanada"
|
|||||||
|
|
||||||
#: ../src/common/util.c:1028 ../src/fe-gtk/setup.c:96
|
#: ../src/common/util.c:1028 ../src/fe-gtk/setup.c:96
|
||||||
msgid "Catalan"
|
msgid "Catalan"
|
||||||
msgstr "Katalaani"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/util.c:1029
|
#: ../src/common/util.c:1029
|
||||||
msgid "Cocos Islands"
|
msgid "Cocos Islands"
|
||||||
@@ -3360,7 +3359,7 @@ msgstr "Aloitusaika"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/editlist.c:358 ../src/fe-gtk/fkeys.c:826
|
#: ../src/fe-gtk/editlist.c:358 ../src/fe-gtk/fkeys.c:826
|
||||||
msgid "Add"
|
msgid "Add"
|
||||||
msgstr "Lisää"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/editlist.c:360 ../src/fe-gtk/fkeys.c:828
|
#: ../src/fe-gtk/editlist.c:360 ../src/fe-gtk/fkeys.c:828
|
||||||
#: ../src/fe-gtk/ignoregui.c:383
|
#: ../src/fe-gtk/ignoregui.c:383
|
||||||
@@ -3684,7 +3683,7 @@ msgstr "Palvelimelta on edelleen auki %d kanavaa tai keskustelua. Suljetaanko ka
|
|||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1203
|
#: ../src/fe-gtk/maingui.c:1203
|
||||||
msgid "Quit HexChat?"
|
msgid "Quit HexChat?"
|
||||||
msgstr "Suljetaanko HexChat?"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1223
|
#: ../src/fe-gtk/maingui.c:1223
|
||||||
msgid "Don't ask next time."
|
msgid "Don't ask next time."
|
||||||
@@ -3721,7 +3720,7 @@ msgstr "<u>Alleviivattu</u>"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1475
|
#: ../src/fe-gtk/maingui.c:1475
|
||||||
msgid "<i>Italic</i>"
|
msgid "<i>Italic</i>"
|
||||||
msgstr "<i>Kursiivi</i>"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1476
|
#: ../src/fe-gtk/maingui.c:1476
|
||||||
msgid "Normal"
|
msgid "Normal"
|
||||||
@@ -3737,11 +3736,11 @@ msgstr "Värit 8–15"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1534
|
#: ../src/fe-gtk/maingui.c:1534
|
||||||
msgid "_Settings"
|
msgid "_Settings"
|
||||||
msgstr "A_setukset"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1536
|
#: ../src/fe-gtk/maingui.c:1536
|
||||||
msgid "_Log to Disk"
|
msgid "_Log to Disk"
|
||||||
msgstr "Tallenna _lokitiedosto levylle"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1537
|
#: ../src/fe-gtk/maingui.c:1537
|
||||||
msgid "_Reload Scrollback"
|
msgid "_Reload Scrollback"
|
||||||
@@ -3753,7 +3752,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1541
|
#: ../src/fe-gtk/maingui.c:1541
|
||||||
msgid "_Hide Join/Part Messages"
|
msgid "_Hide Join/Part Messages"
|
||||||
msgstr "Piilota liittymis- ja poistumisviestit"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1550
|
#: ../src/fe-gtk/maingui.c:1550
|
||||||
msgid "_Extra Alerts"
|
msgid "_Extra Alerts"
|
||||||
@@ -3761,7 +3760,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1552
|
#: ../src/fe-gtk/maingui.c:1552
|
||||||
msgid "Beep on _Message"
|
msgid "Beep on _Message"
|
||||||
msgstr "Anna ääni_merkki kun uusi viesti saapuu"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1554
|
#: ../src/fe-gtk/maingui.c:1554
|
||||||
msgid "Blink Tray _Icon"
|
msgid "Blink Tray _Icon"
|
||||||
@@ -3835,7 +3834,7 @@ msgstr "Anna uusi kutsumanimi:"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:2832
|
#: ../src/fe-gtk/maingui.c:2832
|
||||||
msgid "No results found."
|
msgid "No results found."
|
||||||
msgstr "Ei osumia."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:2928
|
#: ../src/fe-gtk/maingui.c:2928
|
||||||
msgid "Search hit end or not found."
|
msgid "Search hit end or not found."
|
||||||
@@ -3859,7 +3858,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:2959
|
#: ../src/fe-gtk/maingui.c:2959
|
||||||
msgid "_Regex"
|
msgid "_Regex"
|
||||||
msgstr "_Regex"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:2964
|
#: ../src/fe-gtk/maingui.c:2964
|
||||||
msgid "Regard search string as a regular expression."
|
msgid "Regard search string as a regular expression."
|
||||||
@@ -3919,7 +3918,7 @@ msgstr "Poissaoloviesti:"
|
|||||||
#: ../src/fe-gtk/menu.c:737
|
#: ../src/fe-gtk/menu.c:737
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%d nicks selected."
|
msgid "%d nicks selected."
|
||||||
msgstr "%d nimeä valittu."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:862
|
#: ../src/fe-gtk/menu.c:862
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -4338,7 +4337,7 @@ msgstr "Tallenna teksti..."
|
|||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1828
|
#: ../src/fe-gtk/menu.c:1828
|
||||||
msgid "Search"
|
msgid "Search"
|
||||||
msgstr "Etsi"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1829
|
#: ../src/fe-gtk/menu.c:1829
|
||||||
msgid "Search Text..."
|
msgid "Search Text..."
|
||||||
@@ -4346,11 +4345,11 @@ msgstr "Hae tekstistä..."
|
|||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1830
|
#: ../src/fe-gtk/menu.c:1830
|
||||||
msgid "Search Next"
|
msgid "Search Next"
|
||||||
msgstr "Etsi seuraava"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1831
|
#: ../src/fe-gtk/menu.c:1831
|
||||||
msgid "Search Previous"
|
msgid "Search Previous"
|
||||||
msgstr "Etsi edellinen"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1834 ../src/fe-gtk/menu.c:2321
|
#: ../src/fe-gtk/menu.c:1834 ../src/fe-gtk/menu.c:2321
|
||||||
msgid "_Help"
|
msgid "_Help"
|
||||||
@@ -4393,7 +4392,7 @@ msgstr "%d minuuttia sitten"
|
|||||||
#: ../src/fe-gtk/notifygui.c:195
|
#: ../src/fe-gtk/notifygui.c:195
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "An hour ago"
|
msgid "An hour ago"
|
||||||
msgstr "Tunti sitten"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/notifygui.c:197
|
#: ../src/fe-gtk/notifygui.c:197
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -4418,7 +4417,7 @@ msgstr "Pilkuilla eroteltu luettelo IRC-verkkoja."
|
|||||||
|
|
||||||
#: ../src/fe-gtk/notifygui.c:407
|
#: ../src/fe-gtk/notifygui.c:407
|
||||||
msgid ": Friends List"
|
msgid ": Friends List"
|
||||||
msgstr ": Kaverilista"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/notifygui.c:429
|
#: ../src/fe-gtk/notifygui.c:429
|
||||||
msgid "Open Dialog"
|
msgid "Open Dialog"
|
||||||
@@ -4579,11 +4578,11 @@ msgstr "Haluatko todella poistaa verkon \"%s\" ja kaikki sen palvelimet?"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/servlistgui.c:1126 ../src/fe-gtk/servlistgui.c:1557
|
#: ../src/fe-gtk/servlistgui.c:1126 ../src/fe-gtk/servlistgui.c:1557
|
||||||
msgid "User name cannot be left blank."
|
msgid "User name cannot be left blank."
|
||||||
msgstr "Käyttäjätunnus ei voi olla tyhjä."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/servlistgui.c:1578
|
#: ../src/fe-gtk/servlistgui.c:1578
|
||||||
msgid "You must have two unique nick names."
|
msgid "You must have two unique nick names."
|
||||||
msgstr "Lempinimet pitää olla uniikkeja."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/servlistgui.c:1630
|
#: ../src/fe-gtk/servlistgui.c:1630
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -4598,11 +4597,11 @@ msgstr "XChat: Muokkaa %s-verkkoa"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/servlistgui.c:1725
|
#: ../src/fe-gtk/servlistgui.c:1725
|
||||||
msgid "Servers"
|
msgid "Servers"
|
||||||
msgstr "Palvelimet"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/servlistgui.c:1726
|
#: ../src/fe-gtk/servlistgui.c:1726
|
||||||
msgid "Autojoin channels"
|
msgid "Autojoin channels"
|
||||||
msgstr "Liity kanaville automaattisesti"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/servlistgui.c:1727
|
#: ../src/fe-gtk/servlistgui.c:1727
|
||||||
msgid "Connect commands"
|
msgid "Connect commands"
|
||||||
@@ -4634,7 +4633,7 @@ msgstr "Älä yritä yhdistää muihin palvelimiin, jos valittuun palvelimeen ei
|
|||||||
|
|
||||||
#: ../src/fe-gtk/servlistgui.c:1862
|
#: ../src/fe-gtk/servlistgui.c:1862
|
||||||
msgid "Connect to this network automatically"
|
msgid "Connect to this network automatically"
|
||||||
msgstr "Yhdistä tähän verkkoon automaattisesti"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/servlistgui.c:1863
|
#: ../src/fe-gtk/servlistgui.c:1863
|
||||||
msgid "Bypass proxy server"
|
msgid "Bypass proxy server"
|
||||||
@@ -4776,7 +4775,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:99
|
#: ../src/fe-gtk/setup.c:99
|
||||||
msgid "Czech"
|
msgid "Czech"
|
||||||
msgstr "Tsekki"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:100
|
#: ../src/fe-gtk/setup.c:100
|
||||||
msgid "Danish"
|
msgid "Danish"
|
||||||
@@ -4784,11 +4783,11 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:101
|
#: ../src/fe-gtk/setup.c:101
|
||||||
msgid "Dutch"
|
msgid "Dutch"
|
||||||
msgstr "Hollanti"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:102
|
#: ../src/fe-gtk/setup.c:102
|
||||||
msgid "English (British)"
|
msgid "English (British)"
|
||||||
msgstr "Englanti (Brittiläinen)"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:103
|
#: ../src/fe-gtk/setup.c:103
|
||||||
msgid "English"
|
msgid "English"
|
||||||
@@ -4800,23 +4799,23 @@ msgstr "Viro"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:105
|
#: ../src/fe-gtk/setup.c:105
|
||||||
msgid "Finnish"
|
msgid "Finnish"
|
||||||
msgstr "Suomi"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:106
|
#: ../src/fe-gtk/setup.c:106
|
||||||
msgid "French"
|
msgid "French"
|
||||||
msgstr "Ranska"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:107
|
#: ../src/fe-gtk/setup.c:107
|
||||||
msgid "Galician"
|
msgid "Galician"
|
||||||
msgstr "Galego"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:108
|
#: ../src/fe-gtk/setup.c:108
|
||||||
msgid "German"
|
msgid "German"
|
||||||
msgstr "Saksa"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:109
|
#: ../src/fe-gtk/setup.c:109
|
||||||
msgid "Greek"
|
msgid "Greek"
|
||||||
msgstr "Kreikka"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:110
|
#: ../src/fe-gtk/setup.c:110
|
||||||
msgid "Gujarati"
|
msgid "Gujarati"
|
||||||
@@ -4828,7 +4827,7 @@ msgstr "Intia"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:112
|
#: ../src/fe-gtk/setup.c:112
|
||||||
msgid "Hungarian"
|
msgid "Hungarian"
|
||||||
msgstr "Unkari"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:113
|
#: ../src/fe-gtk/setup.c:113
|
||||||
msgid "Indonesian"
|
msgid "Indonesian"
|
||||||
@@ -4836,15 +4835,15 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:114
|
#: ../src/fe-gtk/setup.c:114
|
||||||
msgid "Italian"
|
msgid "Italian"
|
||||||
msgstr "Italia"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:115
|
#: ../src/fe-gtk/setup.c:115
|
||||||
msgid "Japanese"
|
msgid "Japanese"
|
||||||
msgstr "Japani"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:116
|
#: ../src/fe-gtk/setup.c:116
|
||||||
msgid "Kannada"
|
msgid "Kannada"
|
||||||
msgstr "Kannada"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:117
|
#: ../src/fe-gtk/setup.c:117
|
||||||
msgid "Kinyarwanda"
|
msgid "Kinyarwanda"
|
||||||
@@ -4852,19 +4851,19 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:118
|
#: ../src/fe-gtk/setup.c:118
|
||||||
msgid "Korean"
|
msgid "Korean"
|
||||||
msgstr "Korea"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:119
|
#: ../src/fe-gtk/setup.c:119
|
||||||
msgid "Latvian"
|
msgid "Latvian"
|
||||||
msgstr "Latvia"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:120
|
#: ../src/fe-gtk/setup.c:120
|
||||||
msgid "Lithuanian"
|
msgid "Lithuanian"
|
||||||
msgstr "Liettua"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:121
|
#: ../src/fe-gtk/setup.c:121
|
||||||
msgid "Macedonian"
|
msgid "Macedonian"
|
||||||
msgstr "Makedonia"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:122
|
#: ../src/fe-gtk/setup.c:122
|
||||||
msgid "Malay"
|
msgid "Malay"
|
||||||
@@ -4876,51 +4875,51 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:124
|
#: ../src/fe-gtk/setup.c:124
|
||||||
msgid "Norwegian (Bokmal)"
|
msgid "Norwegian (Bokmal)"
|
||||||
msgstr "Norja (Bokmal)"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:125
|
#: ../src/fe-gtk/setup.c:125
|
||||||
msgid "Norwegian (Nynorsk)"
|
msgid "Norwegian (Nynorsk)"
|
||||||
msgstr "Norja (Nynorsk)"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:126
|
#: ../src/fe-gtk/setup.c:126
|
||||||
msgid "Polish"
|
msgid "Polish"
|
||||||
msgstr "Puola"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:127
|
#: ../src/fe-gtk/setup.c:127
|
||||||
msgid "Portuguese"
|
msgid "Portuguese"
|
||||||
msgstr "Portugali"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:128
|
#: ../src/fe-gtk/setup.c:128
|
||||||
msgid "Portuguese (Brazilian)"
|
msgid "Portuguese (Brazilian)"
|
||||||
msgstr "Portugali (Brasilian)"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:129
|
#: ../src/fe-gtk/setup.c:129
|
||||||
msgid "Punjabi"
|
msgid "Punjabi"
|
||||||
msgstr "Punjabi"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:130
|
#: ../src/fe-gtk/setup.c:130
|
||||||
msgid "Russian"
|
msgid "Russian"
|
||||||
msgstr "Venäjä"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:131
|
#: ../src/fe-gtk/setup.c:131
|
||||||
msgid "Serbian"
|
msgid "Serbian"
|
||||||
msgstr "Serbia"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:132
|
#: ../src/fe-gtk/setup.c:132
|
||||||
msgid "Slovak"
|
msgid "Slovak"
|
||||||
msgstr "Slovakki"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:133
|
#: ../src/fe-gtk/setup.c:133
|
||||||
msgid "Slovenian"
|
msgid "Slovenian"
|
||||||
msgstr "Sloveeni"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:134
|
#: ../src/fe-gtk/setup.c:134
|
||||||
msgid "Spanish"
|
msgid "Spanish"
|
||||||
msgstr "Espanja"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:135
|
#: ../src/fe-gtk/setup.c:135
|
||||||
msgid "Swedish"
|
msgid "Swedish"
|
||||||
msgstr "Ruotsi"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:136
|
#: ../src/fe-gtk/setup.c:136
|
||||||
msgid "Thai"
|
msgid "Thai"
|
||||||
@@ -4928,11 +4927,11 @@ msgstr "Thaimaa"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:137
|
#: ../src/fe-gtk/setup.c:137
|
||||||
msgid "Turkish"
|
msgid "Turkish"
|
||||||
msgstr "Turkki"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:138
|
#: ../src/fe-gtk/setup.c:138
|
||||||
msgid "Ukrainian"
|
msgid "Ukrainian"
|
||||||
msgstr "Ukraina"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:139
|
#: ../src/fe-gtk/setup.c:139
|
||||||
msgid "Vietnamese"
|
msgid "Vietnamese"
|
||||||
@@ -4940,7 +4939,7 @@ msgstr "Vietnam"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:140
|
#: ../src/fe-gtk/setup.c:140
|
||||||
msgid "Walloon"
|
msgid "Walloon"
|
||||||
msgstr "Valloni"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:147 ../src/fe-gtk/setup.c:1814
|
#: ../src/fe-gtk/setup.c:147 ../src/fe-gtk/setup.c:1814
|
||||||
msgid "General"
|
msgid "General"
|
||||||
@@ -4948,11 +4947,11 @@ msgstr "Yleiset"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:149
|
#: ../src/fe-gtk/setup.c:149
|
||||||
msgid "Language:"
|
msgid "Language:"
|
||||||
msgstr "Kieli:"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:150
|
#: ../src/fe-gtk/setup.c:150
|
||||||
msgid "Main font:"
|
msgid "Main font:"
|
||||||
msgstr "Pääfontti:"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:152
|
#: ../src/fe-gtk/setup.c:152
|
||||||
msgid "Font:"
|
msgid "Font:"
|
||||||
@@ -4996,7 +4995,7 @@ msgstr "Läpikuultavuuden säätö"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:162
|
#: ../src/fe-gtk/setup.c:162
|
||||||
msgid "Window Opacity:"
|
msgid "Window Opacity:"
|
||||||
msgstr "Ikkunan läpinäkyvyys:"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:164 ../src/fe-gtk/setup.c:538
|
#: ../src/fe-gtk/setup.c:164 ../src/fe-gtk/setup.c:538
|
||||||
msgid "Time Stamps"
|
msgid "Time Stamps"
|
||||||
@@ -5064,7 +5063,7 @@ msgstr "Oikoluku"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:195
|
#: ../src/fe-gtk/setup.c:195
|
||||||
msgid "Dictionaries to use:"
|
msgid "Dictionaries to use:"
|
||||||
msgstr "Käytettävät sanakirjat:"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:197
|
#: ../src/fe-gtk/setup.c:197
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -5098,7 +5097,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:205
|
#: ../src/fe-gtk/setup.c:205
|
||||||
msgid "nicks."
|
msgid "nicks."
|
||||||
msgstr "nimeä."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:213
|
#: ../src/fe-gtk/setup.c:213
|
||||||
msgid "Graphical"
|
msgid "Graphical"
|
||||||
@@ -5232,7 +5231,7 @@ msgstr "Vain itse avatut"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:293
|
#: ../src/fe-gtk/setup.c:293
|
||||||
msgid "Automatic"
|
msgid "Automatic"
|
||||||
msgstr "Automaattinen"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:294
|
#: ../src/fe-gtk/setup.c:294
|
||||||
msgid "In an extra tab"
|
msgid "In an extra tab"
|
||||||
@@ -5473,7 +5472,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:431
|
#: ../src/fe-gtk/setup.c:431
|
||||||
msgid "Automatically mark away/back"
|
msgid "Automatically mark away/back"
|
||||||
msgstr "Päivitä paikalla/poissa -statuksesi automaattisesti"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:431
|
#: ../src/fe-gtk/setup.c:431
|
||||||
msgid "Automatically change status when hiding to tray."
|
msgid "Automatically change status when hiding to tray."
|
||||||
@@ -5548,7 +5547,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:481 ../src/fe-gtk/setup.c:514
|
#: ../src/fe-gtk/setup.c:481 ../src/fe-gtk/setup.c:514
|
||||||
msgid "Miscellaneous"
|
msgid "Miscellaneous"
|
||||||
msgstr "Sekalaiset"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:482
|
#: ../src/fe-gtk/setup.c:482
|
||||||
msgid "Display MODEs in raw form"
|
msgid "Display MODEs in raw form"
|
||||||
@@ -5626,7 +5625,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:515
|
#: ../src/fe-gtk/setup.c:515
|
||||||
msgid "Real name:"
|
msgid "Real name:"
|
||||||
msgstr "Oikea nimi:"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:517
|
#: ../src/fe-gtk/setup.c:517
|
||||||
msgid "Alternative fonts:"
|
msgid "Alternative fonts:"
|
||||||
@@ -5779,7 +5778,7 @@ msgstr "Käyttökelpoinen vain, kun tietokoneessa on monta osoitetta."
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:585
|
#: ../src/fe-gtk/setup.c:585
|
||||||
msgid "File Transfers"
|
msgid "File Transfers"
|
||||||
msgstr "Tiedostojen siirrot"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:586
|
#: ../src/fe-gtk/setup.c:586
|
||||||
msgid "Get my address from the IRC server"
|
msgid "Get my address from the IRC server"
|
||||||
@@ -5981,7 +5980,7 @@ msgstr "Keskustelu"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:1816
|
#: ../src/fe-gtk/setup.c:1816
|
||||||
msgid "Sounds"
|
msgid "Sounds"
|
||||||
msgstr "Äänet"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:1818
|
#: ../src/fe-gtk/setup.c:1818
|
||||||
msgid "Advanced"
|
msgid "Advanced"
|
||||||
@@ -6007,7 +6006,7 @@ msgstr "Puuta ei voi laittaa ylös eikä alas!\nMuuta ensin välilehtiasettelua
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:2160
|
#: ../src/fe-gtk/setup.c:2160
|
||||||
msgid "The Real name option cannot be left blank. Falling back to \"realname\"."
|
msgid "The Real name option cannot be left blank. Falling back to \"realname\"."
|
||||||
msgstr "Oikeaa nimeä ei voi jättää tyhjäksi."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:2167
|
#: ../src/fe-gtk/setup.c:2167
|
||||||
msgid "Some settings were changed that require a restart to take full effect."
|
msgid "Some settings were changed that require a restart to take full effect."
|
||||||
@@ -6084,7 +6083,7 @@ msgstr "Kokeile kaikki"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/textgui.c:485
|
#: ../src/fe-gtk/textgui.c:485
|
||||||
msgid "OK"
|
msgid "OK"
|
||||||
msgstr "OK"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/urlgrab.c:198
|
#: ../src/fe-gtk/urlgrab.c:198
|
||||||
msgid ": URL Grabber"
|
msgid ": URL Grabber"
|
||||||
|
46
po/fr.po
46
po/fr.po
@@ -8,16 +8,14 @@
|
|||||||
# Calinou, 2014
|
# Calinou, 2014
|
||||||
# Misdre <misdre@hexchat.misdre.info>, 2013
|
# Misdre <misdre@hexchat.misdre.info>, 2013
|
||||||
# Misdre <misdre@hexchat.misdre.info>, 2013
|
# Misdre <misdre@hexchat.misdre.info>, 2013
|
||||||
# Towinet, 2014
|
|
||||||
# Calinou, 2013
|
# Calinou, 2013
|
||||||
# Yannick Le Guen <leguen.yannick@gmail.com>, 2014
|
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: HexChat\n"
|
"Project-Id-Version: HexChat\n"
|
||||||
"Report-Msgid-Bugs-To: www.hexchat.org\n"
|
"Report-Msgid-Bugs-To: www.hexchat.org\n"
|
||||||
"POT-Creation-Date: 2014-05-14 13:20-0400\n"
|
"POT-Creation-Date: 2014-05-14 13:20-0400\n"
|
||||||
"PO-Revision-Date: 2014-07-21 15:47+0000\n"
|
"PO-Revision-Date: 2014-05-14 17:20+0000\n"
|
||||||
"Last-Translator: Towinet\n"
|
"Last-Translator: TingPing <tingping@tingping.se>\n"
|
||||||
"Language-Team: French (http://www.transifex.com/projects/p/hexchat/language/fr/)\n"
|
"Language-Team: French (http://www.transifex.com/projects/p/hexchat/language/fr/)\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
@@ -1418,7 +1416,7 @@ msgstr "Hôte de la personne"
|
|||||||
|
|
||||||
#: ../src/common/text.c:1035
|
#: ../src/common/text.c:1035
|
||||||
msgid "The account of the person"
|
msgid "The account of the person"
|
||||||
msgstr "Le compte de la personne"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/text.c:1039 ../src/common/text.c:1046
|
#: ../src/common/text.c:1039 ../src/common/text.c:1046
|
||||||
#: ../src/common/text.c:1053 ../src/common/text.c:1265
|
#: ../src/common/text.c:1053 ../src/common/text.c:1265
|
||||||
@@ -3213,7 +3211,7 @@ msgstr "_Télécharger"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/chanlist.c:806
|
#: ../src/fe-gtk/chanlist.c:806
|
||||||
msgid "Save _List..."
|
msgid "Save _List..."
|
||||||
msgstr "Enregistrer la _Liste..."
|
msgstr "Sauver la _Liste"
|
||||||
|
|
||||||
#. =============================================================
|
#. =============================================================
|
||||||
#: ../src/fe-gtk/chanlist.c:819
|
#: ../src/fe-gtk/chanlist.c:819
|
||||||
@@ -3319,7 +3317,7 @@ msgstr "Envois"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/dccgui.c:858
|
#: ../src/fe-gtk/dccgui.c:858
|
||||||
msgid "Downloads"
|
msgid "Downloads"
|
||||||
msgstr "Récupérations"
|
msgstr "Récupération"
|
||||||
|
|
||||||
#: ../src/fe-gtk/dccgui.c:863
|
#: ../src/fe-gtk/dccgui.c:863
|
||||||
msgid "Details"
|
msgid "Details"
|
||||||
@@ -3456,7 +3454,7 @@ msgid ""
|
|||||||
"When run all \\n characters in Data 1 are used to deliminate separate "
|
"When run all \\n characters in Data 1 are used to deliminate separate "
|
||||||
"commands so it is possible to run more than one command. If you want a \\ "
|
"commands so it is possible to run more than one command. If you want a \\ "
|
||||||
"in the actual text run then enter \\\\"
|
"in the actual text run then enter \\\\"
|
||||||
msgstr "La commande d'action Exécuter (Run) lance la donnée dans Data 1 telle que si elle avait été tapée dans la boîte de saisie dans laquelle vous pressez la séquence de touches. Ainsi elle peut contenir du texte (qui sera envoyé à la chaîne/personne), des commandes ou des commandes d'utilisateur. Lorsqu'elle est exécutée tous les caractères \\n dans Données 1 sont utilisés pour délimiter les commandes séparées, afin qu'il soit possible de faire fonctionner davantage qu'une commande. Si vous voulez un \\n dans le texte réel alors entrez \\\\"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/fkeys.c:143
|
#: ../src/fe-gtk/fkeys.c:143
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -3466,7 +3464,7 @@ msgid ""
|
|||||||
"switch to the page with the most recent and important activity (queries "
|
"switch to the page with the most recent and important activity (queries "
|
||||||
"first, then channels with hilight, channels with dialogue, channels with "
|
"first, then channels with hilight, channels with dialogue, channels with "
|
||||||
"other data)"
|
"other data)"
|
||||||
msgstr "La page changements (Change Page) commande le basculement entre les pages du carnet. Si Donnée 2 est paramétrée à n'importe quoi alors le commutateur sera relatif à la position actuelle. Paramétrer Donnée 1 à auto afin de commuter vers la page ayant l'activité la plus récente et la plus fréquente (requêtes d'abord, puis canaux mis en évidence, canaux avec des dialogues, canaux avec d'autres données)"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/fkeys.c:145
|
#: ../src/fe-gtk/fkeys.c:145
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -3478,7 +3476,7 @@ msgstr "La commande Insert in Buffer insérera le contenu de Données 1 dans l
|
|||||||
msgid ""
|
msgid ""
|
||||||
"The Scroll Page command scrolls the text widget up or down one page or one"
|
"The Scroll Page command scrolls the text widget up or down one page or one"
|
||||||
" line. Set Data 1 to either Top, Bottom, Up, Down, +1 or -1."
|
" line. Set Data 1 to either Top, Bottom, Up, Down, +1 or -1."
|
||||||
msgstr "La commande Scroll Page fait défiler le widget textuel vers le haut ou vers le bas d'une page ou d'une ligne. Définir Data 1 soit à Top, Bottom, Up, Down, +1 ou -1."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/fkeys.c:149
|
#: ../src/fe-gtk/fkeys.c:149
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -3580,7 +3578,7 @@ msgstr "DCC"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/ignoregui.c:165
|
#: ../src/fe-gtk/ignoregui.c:165
|
||||||
msgid "Unignore"
|
msgid "Unignore"
|
||||||
msgstr "Ne plus ignorer"
|
msgstr "Ne plus exclure"
|
||||||
|
|
||||||
#: ../src/fe-gtk/ignoregui.c:293
|
#: ../src/fe-gtk/ignoregui.c:293
|
||||||
msgid "Are you sure you want to remove all ignores?"
|
msgid "Are you sure you want to remove all ignores?"
|
||||||
@@ -3977,27 +3975,27 @@ msgstr "Éditer ce menu..."
|
|||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1292
|
#: ../src/fe-gtk/menu.c:1292
|
||||||
msgid "Marker line disabled."
|
msgid "Marker line disabled."
|
||||||
msgstr "Ligne de repérage désactivée."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1298
|
#: ../src/fe-gtk/menu.c:1298
|
||||||
msgid "Marker line never set."
|
msgid "Marker line never set."
|
||||||
msgstr "Ligne de repérage jamais définie."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1302
|
#: ../src/fe-gtk/menu.c:1302
|
||||||
msgid "Marker line reset manually."
|
msgid "Marker line reset manually."
|
||||||
msgstr "Ligne de repérage repositionnée manuellement."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1304
|
#: ../src/fe-gtk/menu.c:1304
|
||||||
msgid "Marker line reset because exceeded scrollback limit."
|
msgid "Marker line reset because exceeded scrollback limit."
|
||||||
msgstr "Ligne de repérage repositionnée à cause de la limite de défilement."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1306
|
#: ../src/fe-gtk/menu.c:1306
|
||||||
msgid "Marker line reset by CLEAR command."
|
msgid "Marker line reset by CLEAR command."
|
||||||
msgstr "Ligne de repérage repositionnée avec la commande CLEAR."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1308
|
#: ../src/fe-gtk/menu.c:1308
|
||||||
msgid "Marker line state unknown."
|
msgid "Marker line state unknown."
|
||||||
msgstr "État de la ligne de repérage inconnu."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1395
|
#: ../src/fe-gtk/menu.c:1395
|
||||||
msgid "Retrieve channel list..."
|
msgid "Retrieve channel list..."
|
||||||
@@ -4329,7 +4327,7 @@ msgstr "Repositionner la ligne de repérage"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1823
|
#: ../src/fe-gtk/menu.c:1823
|
||||||
msgid "Move to Marker Line"
|
msgid "Move to Marker Line"
|
||||||
msgstr "Aller à la ligne de repérage"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1824
|
#: ../src/fe-gtk/menu.c:1824
|
||||||
msgid "_Copy Selection"
|
msgid "_Copy Selection"
|
||||||
@@ -4590,7 +4588,7 @@ msgstr "Le nom d'utilisateur ne peut être vide."
|
|||||||
|
|
||||||
#: ../src/fe-gtk/servlistgui.c:1578
|
#: ../src/fe-gtk/servlistgui.c:1578
|
||||||
msgid "You must have two unique nick names."
|
msgid "You must have two unique nick names."
|
||||||
msgstr "Vous devez avoir deux pseudonymes uniques."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/servlistgui.c:1630
|
#: ../src/fe-gtk/servlistgui.c:1630
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -5427,7 +5425,7 @@ msgstr "Faire clignoter l'icône de barre d'état"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:404
|
#: ../src/fe-gtk/setup.c:404
|
||||||
msgid "Bounce dock icon on:"
|
msgid "Bounce dock icon on:"
|
||||||
msgstr "Faire rebondir l'icône du dock sur :"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:407 ../src/fe-gtk/setup.c:453
|
#: ../src/fe-gtk/setup.c:407 ../src/fe-gtk/setup.c:453
|
||||||
msgid "Blink task bar on:"
|
msgid "Blink task bar on:"
|
||||||
@@ -5579,7 +5577,7 @@ msgstr "Cacher les messages d'entrée/sortie par défaut."
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:485
|
#: ../src/fe-gtk/setup.c:485
|
||||||
msgid "Hide nick change messages"
|
msgid "Hide nick change messages"
|
||||||
msgstr "Cacher les messages de changement de pseudonyme"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:492
|
#: ../src/fe-gtk/setup.c:492
|
||||||
msgid "*!*@*.host"
|
msgid "*!*@*.host"
|
||||||
@@ -5629,7 +5627,7 @@ msgstr "Ajouter automatiquement les informations de couleur"
|
|||||||
msgid ""
|
msgid ""
|
||||||
"Automatically include color information in copied lines of text. Otherwise,"
|
"Automatically include color information in copied lines of text. Otherwise,"
|
||||||
" include color information if the CONTROL key is held down while selecting."
|
" include color information if the CONTROL key is held down while selecting."
|
||||||
msgstr "Ajouter automatiquement les informations de couleurs dans les lignes de texte copiées. Sinon, la couleur sera ajoutée uniquement si la touche Control est appuyée lors de la sélection."
|
msgstr "Ajouter automatiquement les informations de couleurs dans les lignes de texte copiées. Sinon, la couleur sera ajouté uniquement si la touche Control est appuyée lors de la sélection."
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:515
|
#: ../src/fe-gtk/setup.c:515
|
||||||
msgid "Real name:"
|
msgid "Real name:"
|
||||||
@@ -5860,7 +5858,7 @@ msgstr "Sélectionner une image"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:1088
|
#: ../src/fe-gtk/setup.c:1088
|
||||||
msgid "Select Download Folder"
|
msgid "Select Download Folder"
|
||||||
msgstr "Choisir le dossier pour la réception de fichiers"
|
msgstr "Choisir le dossier pour le réception de fichiers"
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:1098
|
#: ../src/fe-gtk/setup.c:1098
|
||||||
msgid "Select font"
|
msgid "Select font"
|
||||||
@@ -6091,7 +6089,7 @@ msgstr "Tout tester"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/textgui.c:485
|
#: ../src/fe-gtk/textgui.c:485
|
||||||
msgid "OK"
|
msgid "OK"
|
||||||
msgstr "OK"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/urlgrab.c:198
|
#: ../src/fe-gtk/urlgrab.c:198
|
||||||
msgid ": URL Grabber"
|
msgid ": URL Grabber"
|
||||||
|
4
po/id.po
4
po/id.po
@@ -4,8 +4,8 @@
|
|||||||
#
|
#
|
||||||
# Translators:
|
# Translators:
|
||||||
# Andhika Padmawan <andhika.padmawan@gmail.com>, 2010
|
# Andhika Padmawan <andhika.padmawan@gmail.com>, 2010
|
||||||
# Rahmat Bambang <doplank@gmx.com>, 2012-2013
|
# doplank <doplank@gmx.com>, 2012-2013
|
||||||
# Rahmat Bambang <doplank@gmx.com>, 2013
|
# doplank <doplank@gmx.com>, 2013
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: HexChat\n"
|
"Project-Id-Version: HexChat\n"
|
||||||
|
543
po/ja_JP.po
543
po/ja_JP.po
File diff suppressed because it is too large
Load Diff
6
po/ko.po
6
po/ko.po
@@ -3,15 +3,15 @@
|
|||||||
# This file is distributed under the same license as the PACKAGE package.
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
#
|
#
|
||||||
# Translators:
|
# Translators:
|
||||||
# Seong-ho Cho <darkcircle.0426@gmail.com>, 2014
|
# Darkcircle <darkcircle.0426@gmail.com>, 2014
|
||||||
# Seong-ho Cho <darkcircle.0426@gmail.com>, 2014
|
# Darkcircle <darkcircle.0426@gmail.com>, 2014
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: HexChat\n"
|
"Project-Id-Version: HexChat\n"
|
||||||
"Report-Msgid-Bugs-To: www.hexchat.org\n"
|
"Report-Msgid-Bugs-To: www.hexchat.org\n"
|
||||||
"POT-Creation-Date: 2014-05-14 13:20-0400\n"
|
"POT-Creation-Date: 2014-05-14 13:20-0400\n"
|
||||||
"PO-Revision-Date: 2014-05-15 13:09+0000\n"
|
"PO-Revision-Date: 2014-05-15 13:09+0000\n"
|
||||||
"Last-Translator: Seong-ho Cho <darkcircle.0426@gmail.com>\n"
|
"Last-Translator: Darkcircle <darkcircle.0426@gmail.com>\n"
|
||||||
"Language-Team: Korean (http://www.transifex.com/projects/p/hexchat/language/ko/)\n"
|
"Language-Team: Korean (http://www.transifex.com/projects/p/hexchat/language/ko/)\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
4
po/ml.po
4
po/ml.po
@@ -4,8 +4,8 @@
|
|||||||
#
|
#
|
||||||
# Translators:
|
# Translators:
|
||||||
# bviktor, 2012
|
# bviktor, 2012
|
||||||
# Thorne Heathenspring <thorne@null.net>, 2013
|
# Thorne <thorne@null.net>, 2013
|
||||||
# Thorne Heathenspring <thorne@null.net>, 2012
|
# Thorne <thorne@null.net>, 2012
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: HexChat\n"
|
"Project-Id-Version: HexChat\n"
|
||||||
|
6
po/nb.po
6
po/nb.po
@@ -3,9 +3,9 @@
|
|||||||
# This file is distributed under the same license as the PACKAGE package.
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
#
|
#
|
||||||
# Translators:
|
# Translators:
|
||||||
# Xtreme Power <neethan98@hotmail.ca>, 2013
|
# xtremesmw <neethan98@hotmail.ca>, 2013
|
||||||
# Thor K. H. <nitrolinken@gmail.com>, 2013
|
# Thor K.H. <nitrolinken@gmail.com>, 2013
|
||||||
# Thor K. H. <nitrolinken@gmail.com>, 2012-2013
|
# Thor K.H. <nitrolinken@gmail.com>, 2012-2013
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: HexChat\n"
|
"Project-Id-Version: HexChat\n"
|
||||||
|
4
po/pt.po
4
po/pt.po
@@ -3,8 +3,8 @@
|
|||||||
# This file is distributed under the same license as the PACKAGE package.
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
#
|
#
|
||||||
# Translators:
|
# Translators:
|
||||||
# artur simões <artursimoes.pt@gmail.com>, 2013
|
# artur_pt <artursimoes.pt@gmail.com>, 2013
|
||||||
# artur simões <artursimoes.pt@gmail.com>, 2012-2013
|
# artur_pt <artursimoes.pt@gmail.com>, 2012-2013
|
||||||
# Sandro Amaral <sandro123iv@gmail.com>, 2013
|
# Sandro Amaral <sandro123iv@gmail.com>, 2013
|
||||||
# Vitor Antunes <vhda@mega.ist.utl.pt>, 2004
|
# Vitor Antunes <vhda@mega.ist.utl.pt>, 2004
|
||||||
msgid ""
|
msgid ""
|
||||||
|
159
po/pt_BR.po
159
po/pt_BR.po
@@ -6,16 +6,15 @@
|
|||||||
# Flamarion Jorge <flamarilinux@yahoo.com.br>, 2009
|
# Flamarion Jorge <flamarilinux@yahoo.com.br>, 2009
|
||||||
# Flamarion Jorge Flamarion <jorge.flamarion@gmail.com>, 2012
|
# Flamarion Jorge Flamarion <jorge.flamarion@gmail.com>, 2012
|
||||||
# Frédéric L. W. Meunier <fredlwm@olympiquedemarseille.org>, 20, 2009
|
# Frédéric L. W. Meunier <fredlwm@olympiquedemarseille.org>, 20, 2009
|
||||||
# Leonardo Pires Felix <leonardo@piresfelix.com>, 2013
|
# Leonardopf <leonardo@piresfelix.com>, 2013
|
||||||
# Matheus Felipe Braga, 2014
|
# mkbu95 <mkbu95@gmail.com>, 2012
|
||||||
# Matheus Macabu <mkbu95@gmail.com>, 2012
|
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: HexChat\n"
|
"Project-Id-Version: HexChat\n"
|
||||||
"Report-Msgid-Bugs-To: www.hexchat.org\n"
|
"Report-Msgid-Bugs-To: www.hexchat.org\n"
|
||||||
"POT-Creation-Date: 2014-05-14 13:20-0400\n"
|
"POT-Creation-Date: 2014-05-14 13:20-0400\n"
|
||||||
"PO-Revision-Date: 2014-06-05 15:02+0000\n"
|
"PO-Revision-Date: 2014-05-14 17:20+0000\n"
|
||||||
"Last-Translator: Matheus Felipe Braga\n"
|
"Last-Translator: TingPing <tingping@tingping.se>\n"
|
||||||
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/hexchat/language/pt_BR/)\n"
|
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/hexchat/language/pt_BR/)\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
@@ -230,11 +229,11 @@ msgstr "Enviar arquivo"
|
|||||||
|
|
||||||
#: ../src/common/hexchat.c:921
|
#: ../src/common/hexchat.c:921
|
||||||
msgid "Dialog"
|
msgid "Dialog"
|
||||||
msgstr "Diálogo"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/hexchat.c:930
|
#: ../src/common/hexchat.c:930
|
||||||
msgid "WhoIs"
|
msgid "WhoIs"
|
||||||
msgstr "Quem É"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/hexchat.c:931
|
#: ../src/common/hexchat.c:931
|
||||||
msgid "Send"
|
msgid "Send"
|
||||||
@@ -1466,7 +1465,7 @@ msgstr "Mensagem"
|
|||||||
#: ../src/common/text.c:1379 ../src/common/text.c:1507
|
#: ../src/common/text.c:1379 ../src/common/text.c:1507
|
||||||
#: ../src/common/text.c:1549
|
#: ../src/common/text.c:1549
|
||||||
msgid "Server Name"
|
msgid "Server Name"
|
||||||
msgstr "Servidor"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/text.c:1060
|
#: ../src/common/text.c:1060
|
||||||
msgid "Acknowledged Capabilities"
|
msgid "Acknowledged Capabilities"
|
||||||
@@ -1714,7 +1713,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/common/text.c:1268
|
#: ../src/common/text.c:1268
|
||||||
msgid "Full name"
|
msgid "Full name"
|
||||||
msgstr "Nome completo"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/text.c:1273
|
#: ../src/common/text.c:1273
|
||||||
msgid "Channel Membership/\"is an IRC operator\""
|
msgid "Channel Membership/\"is an IRC operator\""
|
||||||
@@ -1722,11 +1721,11 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/common/text.c:1278
|
#: ../src/common/text.c:1278
|
||||||
msgid "Server Information"
|
msgid "Server Information"
|
||||||
msgstr "Informações do servidor"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/text.c:1283 ../src/common/text.c:1288
|
#: ../src/common/text.c:1283 ../src/common/text.c:1288
|
||||||
msgid "Idle time"
|
msgid "Idle time"
|
||||||
msgstr "Tempo inativo"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/text.c:1289
|
#: ../src/common/text.c:1289
|
||||||
msgid "Signon time"
|
msgid "Signon time"
|
||||||
@@ -1773,7 +1772,7 @@ msgstr ""
|
|||||||
#: ../src/fe-gtk/menu.c:1781 ../src/fe-gtk/setup.c:214
|
#: ../src/fe-gtk/menu.c:1781 ../src/fe-gtk/setup.c:214
|
||||||
#: ../src/fe-gtk/textgui.c:382
|
#: ../src/fe-gtk/textgui.c:382
|
||||||
msgid "Text"
|
msgid "Text"
|
||||||
msgstr "Texto"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/text.c:1349
|
#: ../src/common/text.c:1349
|
||||||
msgid "Nick of person who invited you"
|
msgid "Nick of person who invited you"
|
||||||
@@ -1793,16 +1792,16 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/common/text.c:1369 ../src/common/text.c:1515
|
#: ../src/common/text.c:1369 ../src/common/text.c:1515
|
||||||
msgid "IP"
|
msgid "IP"
|
||||||
msgstr "IP"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/text.c:1370 ../src/common/text.c:1406
|
#: ../src/common/text.c:1370 ../src/common/text.c:1406
|
||||||
msgid "Port"
|
msgid "Port"
|
||||||
msgstr "Porta"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/text.c:1380 ../src/fe-gtk/notifygui.c:125
|
#: ../src/common/text.c:1380 ../src/fe-gtk/notifygui.c:125
|
||||||
#: ../src/fe-gtk/setup.c:1820
|
#: ../src/fe-gtk/setup.c:1820
|
||||||
msgid "Network"
|
msgid "Network"
|
||||||
msgstr "Rede"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/text.c:1385 ../src/common/text.c:1395
|
#: ../src/common/text.c:1385 ../src/common/text.c:1395
|
||||||
msgid "Modes string"
|
msgid "Modes string"
|
||||||
@@ -1823,7 +1822,7 @@ msgstr ""
|
|||||||
#: ../src/common/text.c:1472 ../src/common/text.c:1481
|
#: ../src/common/text.c:1472 ../src/common/text.c:1481
|
||||||
#: ../src/common/text.c:1487
|
#: ../src/common/text.c:1487
|
||||||
msgid "Filename"
|
msgid "Filename"
|
||||||
msgstr "Nome do arquivo"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/text.c:1423 ../src/common/text.c:1430
|
#: ../src/common/text.c:1423 ../src/common/text.c:1430
|
||||||
msgid "Destination filename"
|
msgid "Destination filename"
|
||||||
@@ -1843,7 +1842,7 @@ msgstr "Posição"
|
|||||||
|
|
||||||
#: ../src/common/text.c:1488 ../src/fe-gtk/dccgui.c:817
|
#: ../src/common/text.c:1488 ../src/fe-gtk/dccgui.c:817
|
||||||
msgid "Size"
|
msgid "Size"
|
||||||
msgstr "Tamanho"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/text.c:1493
|
#: ../src/common/text.c:1493
|
||||||
msgid "DCC String"
|
msgid "DCC String"
|
||||||
@@ -1993,7 +1992,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/common/util.c:998
|
#: ../src/common/util.c:998
|
||||||
msgid "Reverse DNS"
|
msgid "Reverse DNS"
|
||||||
msgstr "DNS Reverso"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/util.c:999
|
#: ../src/common/util.c:999
|
||||||
msgid "American Samoa"
|
msgid "American Samoa"
|
||||||
@@ -2081,7 +2080,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/common/util.c:1020
|
#: ../src/common/util.c:1020
|
||||||
msgid "Brazil"
|
msgid "Brazil"
|
||||||
msgstr "Brasil"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/util.c:1021
|
#: ../src/common/util.c:1021
|
||||||
msgid "Bahamas"
|
msgid "Bahamas"
|
||||||
@@ -2237,7 +2236,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/common/util.c:1059
|
#: ../src/common/util.c:1059
|
||||||
msgid "Egypt"
|
msgid "Egypt"
|
||||||
msgstr "Egito"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/util.c:1060
|
#: ../src/common/util.c:1060
|
||||||
msgid "Western Sahara"
|
msgid "Western Sahara"
|
||||||
@@ -3057,7 +3056,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/common/dbus/dbus-plugin.c:30
|
#: ../src/common/dbus/dbus-plugin.c:30
|
||||||
msgid "remote access"
|
msgid "remote access"
|
||||||
msgstr "acesso remoto"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/dbus/dbus-plugin.c:31
|
#: ../src/common/dbus/dbus-plugin.c:31
|
||||||
msgid "plugin for remote access using DBUS"
|
msgid "plugin for remote access using DBUS"
|
||||||
@@ -3143,11 +3142,11 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/banlist.c:728
|
#: ../src/fe-gtk/banlist.c:728
|
||||||
msgid "From"
|
msgid "From"
|
||||||
msgstr "De"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/banlist.c:729
|
#: ../src/fe-gtk/banlist.c:729
|
||||||
msgid "Date"
|
msgid "Date"
|
||||||
msgstr "Data"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/banlist.c:785
|
#: ../src/fe-gtk/banlist.c:785
|
||||||
msgid "You can only open the Ban List window while in a channel tab."
|
msgid "You can only open the Ban List window while in a channel tab."
|
||||||
@@ -3164,7 +3163,7 @@ msgstr ": Lista de banidos (%s)"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/banlist.c:848 ../src/fe-gtk/notifygui.c:425
|
#: ../src/fe-gtk/banlist.c:848 ../src/fe-gtk/notifygui.c:425
|
||||||
msgid "Remove"
|
msgid "Remove"
|
||||||
msgstr "Remover"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/banlist.c:850
|
#: ../src/fe-gtk/banlist.c:850
|
||||||
msgid "Crop"
|
msgid "Crop"
|
||||||
@@ -3172,7 +3171,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/banlist.c:854
|
#: ../src/fe-gtk/banlist.c:854
|
||||||
msgid "Refresh"
|
msgid "Refresh"
|
||||||
msgstr "Atualizar"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/chanlist.c:98
|
#: ../src/fe-gtk/chanlist.c:98
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -3186,7 +3185,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/chanlist.c:624 ../src/fe-gtk/chanlist.c:812
|
#: ../src/fe-gtk/chanlist.c:624 ../src/fe-gtk/chanlist.c:812
|
||||||
msgid "_Join Channel"
|
msgid "_Join Channel"
|
||||||
msgstr "_Entrar no Canal"
|
msgstr "E_ntrar no Canal"
|
||||||
|
|
||||||
#: ../src/fe-gtk/chanlist.c:626
|
#: ../src/fe-gtk/chanlist.c:626
|
||||||
msgid "_Copy Channel Name"
|
msgid "_Copy Channel Name"
|
||||||
@@ -3203,7 +3202,7 @@ msgstr ": Lista de Canais (%s)"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/chanlist.c:794
|
#: ../src/fe-gtk/chanlist.c:794
|
||||||
msgid "_Search"
|
msgid "_Search"
|
||||||
msgstr "_Procurar"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/chanlist.c:800
|
#: ../src/fe-gtk/chanlist.c:800
|
||||||
msgid "_Download List"
|
msgid "_Download List"
|
||||||
@@ -3216,7 +3215,7 @@ msgstr "Salvar _Lista..."
|
|||||||
#. =============================================================
|
#. =============================================================
|
||||||
#: ../src/fe-gtk/chanlist.c:819
|
#: ../src/fe-gtk/chanlist.c:819
|
||||||
msgid "Show only:"
|
msgid "Show only:"
|
||||||
msgstr "Exibir apenas:"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/chanlist.c:831
|
#: ../src/fe-gtk/chanlist.c:831
|
||||||
msgid "channels with"
|
msgid "channels with"
|
||||||
@@ -3224,7 +3223,7 @@ msgstr "canais com"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/chanlist.c:844
|
#: ../src/fe-gtk/chanlist.c:844
|
||||||
msgid "to"
|
msgid "to"
|
||||||
msgstr "para"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/chanlist.c:856
|
#: ../src/fe-gtk/chanlist.c:856
|
||||||
msgid "users."
|
msgid "users."
|
||||||
@@ -3246,7 +3245,7 @@ msgstr "Tipo de pesquisa:"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/chanlist.c:901
|
#: ../src/fe-gtk/chanlist.c:901
|
||||||
msgid "Simple Search"
|
msgid "Simple Search"
|
||||||
msgstr "Pesquisa Simples"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/chanlist.c:902
|
#: ../src/fe-gtk/chanlist.c:902
|
||||||
msgid "Pattern Match (Wildcards)"
|
msgid "Pattern Match (Wildcards)"
|
||||||
@@ -3264,12 +3263,12 @@ msgstr "Encontrar:"
|
|||||||
#: ../src/fe-gtk/dccgui.c:150
|
#: ../src/fe-gtk/dccgui.c:150
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Send file to %s"
|
msgid "Send file to %s"
|
||||||
msgstr "Enviar arquivo para %s"
|
msgstr ""
|
||||||
|
|
||||||
#. unknown error
|
#. unknown error
|
||||||
#: ../src/fe-gtk/dccgui.c:526
|
#: ../src/fe-gtk/dccgui.c:526
|
||||||
msgid "That file is not resumable."
|
msgid "That file is not resumable."
|
||||||
msgstr "Este arquivo não é resumivel."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/dccgui.c:530
|
#: ../src/fe-gtk/dccgui.c:530
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -3277,7 +3276,7 @@ msgid ""
|
|||||||
"Cannot access file: %s\n"
|
"Cannot access file: %s\n"
|
||||||
"%s.\n"
|
"%s.\n"
|
||||||
"Resuming not possible."
|
"Resuming not possible."
|
||||||
msgstr "Falha ao acessar arquivo: %s\n%s.\nResumir não é possivel."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/dccgui.c:537
|
#: ../src/fe-gtk/dccgui.c:537
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -3296,11 +3295,11 @@ msgstr ""
|
|||||||
#: ../src/fe-gtk/dccgui.c:815 ../src/fe-gtk/dccgui.c:1056
|
#: ../src/fe-gtk/dccgui.c:815 ../src/fe-gtk/dccgui.c:1056
|
||||||
#: ../src/fe-gtk/notifygui.c:124
|
#: ../src/fe-gtk/notifygui.c:124
|
||||||
msgid "Status"
|
msgid "Status"
|
||||||
msgstr "Status"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/dccgui.c:816 ../src/fe-gtk/plugingui.c:65
|
#: ../src/fe-gtk/dccgui.c:816 ../src/fe-gtk/plugingui.c:65
|
||||||
msgid "File"
|
msgid "File"
|
||||||
msgstr "Arquivo"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/dccgui.c:821
|
#: ../src/fe-gtk/dccgui.c:821
|
||||||
msgid "ETA"
|
msgid "ETA"
|
||||||
@@ -3313,7 +3312,7 @@ msgstr "Ambos"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/dccgui.c:852
|
#: ../src/fe-gtk/dccgui.c:852
|
||||||
msgid "Uploads"
|
msgid "Uploads"
|
||||||
msgstr "Uploads"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/dccgui.c:858
|
#: ../src/fe-gtk/dccgui.c:858
|
||||||
msgid "Downloads"
|
msgid "Downloads"
|
||||||
@@ -3321,7 +3320,7 @@ msgstr "Downloads"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/dccgui.c:863
|
#: ../src/fe-gtk/dccgui.c:863
|
||||||
msgid "Details"
|
msgid "Details"
|
||||||
msgstr "Detalhes"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/dccgui.c:874
|
#: ../src/fe-gtk/dccgui.c:874
|
||||||
msgid "File:"
|
msgid "File:"
|
||||||
@@ -3333,19 +3332,19 @@ msgstr "Endereço:"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/dccgui.c:881 ../src/fe-gtk/dccgui.c:1080
|
#: ../src/fe-gtk/dccgui.c:881 ../src/fe-gtk/dccgui.c:1080
|
||||||
msgid "Abort"
|
msgid "Abort"
|
||||||
msgstr "Abortar"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/dccgui.c:882 ../src/fe-gtk/dccgui.c:1081
|
#: ../src/fe-gtk/dccgui.c:882 ../src/fe-gtk/dccgui.c:1081
|
||||||
msgid "Accept"
|
msgid "Accept"
|
||||||
msgstr "Aceitar"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/dccgui.c:883
|
#: ../src/fe-gtk/dccgui.c:883
|
||||||
msgid "Resume"
|
msgid "Resume"
|
||||||
msgstr "Resumir"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/dccgui.c:885
|
#: ../src/fe-gtk/dccgui.c:885
|
||||||
msgid "Open Folder..."
|
msgid "Open Folder..."
|
||||||
msgstr "Abrir Pasta..."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/dccgui.c:1045
|
#: ../src/fe-gtk/dccgui.c:1045
|
||||||
msgid ": DCC Chat List"
|
msgid ": DCC Chat List"
|
||||||
@@ -3357,7 +3356,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/dccgui.c:1059
|
#: ../src/fe-gtk/dccgui.c:1059
|
||||||
msgid "Sent"
|
msgid "Sent"
|
||||||
msgstr "Enviado"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/dccgui.c:1060
|
#: ../src/fe-gtk/dccgui.c:1060
|
||||||
msgid "Start Time"
|
msgid "Start Time"
|
||||||
@@ -3370,7 +3369,7 @@ msgstr ""
|
|||||||
#: ../src/fe-gtk/editlist.c:360 ../src/fe-gtk/fkeys.c:828
|
#: ../src/fe-gtk/editlist.c:360 ../src/fe-gtk/fkeys.c:828
|
||||||
#: ../src/fe-gtk/ignoregui.c:383
|
#: ../src/fe-gtk/ignoregui.c:383
|
||||||
msgid "Delete"
|
msgid "Delete"
|
||||||
msgstr "Apagar"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/editlist.c:362 ../src/fe-gtk/fkeys.c:830
|
#: ../src/fe-gtk/editlist.c:362 ../src/fe-gtk/fkeys.c:830
|
||||||
msgid "Cancel"
|
msgid "Cancel"
|
||||||
@@ -3378,7 +3377,7 @@ msgstr "Cancelar"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/editlist.c:364 ../src/fe-gtk/fkeys.c:832
|
#: ../src/fe-gtk/editlist.c:364 ../src/fe-gtk/fkeys.c:832
|
||||||
msgid "Save"
|
msgid "Save"
|
||||||
msgstr "Salvar"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/fe-gtk.c:80
|
#: ../src/fe-gtk/fe-gtk.c:80
|
||||||
msgid "Don't auto connect to servers"
|
msgid "Don't auto connect to servers"
|
||||||
@@ -3390,7 +3389,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/fe-gtk.c:82
|
#: ../src/fe-gtk/fe-gtk.c:82
|
||||||
msgid "Don't auto load any plugins"
|
msgid "Don't auto load any plugins"
|
||||||
msgstr "Não carregar automaticamente nenhum plugin"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/fe-gtk.c:83
|
#: ../src/fe-gtk/fe-gtk.c:83
|
||||||
msgid "Show plugin/script auto-load directory"
|
msgid "Show plugin/script auto-load directory"
|
||||||
@@ -3398,7 +3397,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/fe-gtk.c:84
|
#: ../src/fe-gtk/fe-gtk.c:84
|
||||||
msgid "Show user config directory"
|
msgid "Show user config directory"
|
||||||
msgstr "Exibir diretório de configuração do usuário"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/fe-gtk.c:85 ../src/fe-gtk/fe-gtk.c:92
|
#: ../src/fe-gtk/fe-gtk.c:85 ../src/fe-gtk/fe-gtk.c:92
|
||||||
msgid "Open an irc://server:port/channel?key URL"
|
msgid "Open an irc://server:port/channel?key URL"
|
||||||
@@ -3414,15 +3413,15 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/fe-gtk.c:90
|
#: ../src/fe-gtk/fe-gtk.c:90
|
||||||
msgid "Begin minimized. Level 0=Normal 1=Iconified 2=Tray"
|
msgid "Begin minimized. Level 0=Normal 1=Iconified 2=Tray"
|
||||||
msgstr "Iniciar minimizado. Nivel 0=Normal 1=Iconified 2=Bandeja"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/fe-gtk.c:90
|
#: ../src/fe-gtk/fe-gtk.c:90
|
||||||
msgid "level"
|
msgid "level"
|
||||||
msgstr "nivel"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/fe-gtk.c:91
|
#: ../src/fe-gtk/fe-gtk.c:91
|
||||||
msgid "Show version information"
|
msgid "Show version information"
|
||||||
msgstr "Exibir informação da versão"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/fe-gtk.c:268
|
#: ../src/fe-gtk/fe-gtk.c:268
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -3562,11 +3561,11 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/ignoregui.c:160
|
#: ../src/fe-gtk/ignoregui.c:160
|
||||||
msgid "Private"
|
msgid "Private"
|
||||||
msgstr "Privado"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/ignoregui.c:161
|
#: ../src/fe-gtk/ignoregui.c:161
|
||||||
msgid "Notice"
|
msgid "Notice"
|
||||||
msgstr "Aviso"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/ignoregui.c:162
|
#: ../src/fe-gtk/ignoregui.c:162
|
||||||
msgid "CTCP"
|
msgid "CTCP"
|
||||||
@@ -3602,11 +3601,11 @@ msgstr "Canal:"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/ignoregui.c:367
|
#: ../src/fe-gtk/ignoregui.c:367
|
||||||
msgid "Private:"
|
msgid "Private:"
|
||||||
msgstr "Privado:"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/ignoregui.c:368
|
#: ../src/fe-gtk/ignoregui.c:368
|
||||||
msgid "Notice:"
|
msgid "Notice:"
|
||||||
msgstr "Aviso:"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/ignoregui.c:369
|
#: ../src/fe-gtk/ignoregui.c:369
|
||||||
msgid "CTCP:"
|
msgid "CTCP:"
|
||||||
@@ -3622,7 +3621,7 @@ msgstr "Adicionar..."
|
|||||||
|
|
||||||
#: ../src/fe-gtk/joind.c:91
|
#: ../src/fe-gtk/joind.c:91
|
||||||
msgid "Channel name too short, try again."
|
msgid "Channel name too short, try again."
|
||||||
msgstr "Nome do canal pequeno, tente novamente."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/joind.c:133
|
#: ../src/fe-gtk/joind.c:133
|
||||||
msgid ": Connection Complete"
|
msgid ": Connection Complete"
|
||||||
@@ -3641,11 +3640,11 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/joind.c:176
|
#: ../src/fe-gtk/joind.c:176
|
||||||
msgid "What would you like to do next?"
|
msgid "What would you like to do next?"
|
||||||
msgstr "O que voce gostaria de fazer em seguida?"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/joind.c:181
|
#: ../src/fe-gtk/joind.c:181
|
||||||
msgid "_Nothing, I'll join a channel later."
|
msgid "_Nothing, I'll join a channel later."
|
||||||
msgstr "_Nada, entrarei em um canal depois."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/joind.c:190
|
#: ../src/fe-gtk/joind.c:190
|
||||||
msgid "_Join this channel:"
|
msgid "_Join this channel:"
|
||||||
@@ -3653,7 +3652,7 @@ msgstr "_Entrar neste canal:"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/joind.c:202
|
#: ../src/fe-gtk/joind.c:202
|
||||||
msgid "If you know the name of the channel you want to join, enter it here."
|
msgid "If you know the name of the channel you want to join, enter it here."
|
||||||
msgstr "Se voce sabe o nome do canal que deseja entrar, digite aqui."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/joind.c:209
|
#: ../src/fe-gtk/joind.c:209
|
||||||
msgid "O_pen the Channel-List window."
|
msgid "O_pen the Channel-List window."
|
||||||
@@ -3674,7 +3673,7 @@ msgstr "Diálogo com"
|
|||||||
#: ../src/fe-gtk/maingui.c:695
|
#: ../src/fe-gtk/maingui.c:695
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Topic for %s is: %s"
|
msgid "Topic for %s is: %s"
|
||||||
msgstr "Tópico para %s é: %s"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:700
|
#: ../src/fe-gtk/maingui.c:700
|
||||||
msgid "No topic is set"
|
msgid "No topic is set"
|
||||||
@@ -3689,28 +3688,28 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1203
|
#: ../src/fe-gtk/maingui.c:1203
|
||||||
msgid "Quit HexChat?"
|
msgid "Quit HexChat?"
|
||||||
msgstr "Sair?"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1223
|
#: ../src/fe-gtk/maingui.c:1223
|
||||||
msgid "Don't ask next time."
|
msgid "Don't ask next time."
|
||||||
msgstr "Não perguntar novamente."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1229
|
#: ../src/fe-gtk/maingui.c:1229
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "You are connected to %i IRC networks."
|
msgid "You are connected to %i IRC networks."
|
||||||
msgstr "Voce esta conectado a %i redes IRC."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1231
|
#: ../src/fe-gtk/maingui.c:1231
|
||||||
msgid "Are you sure you want to quit?"
|
msgid "Are you sure you want to quit?"
|
||||||
msgstr "Voce tem certeza que deseja sair?"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1233
|
#: ../src/fe-gtk/maingui.c:1233
|
||||||
msgid "Some file transfers are still active."
|
msgid "Some file transfers are still active."
|
||||||
msgstr "Algumas transferencias de arquivos continuam ativas."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1251
|
#: ../src/fe-gtk/maingui.c:1251
|
||||||
msgid "_Minimize to Tray"
|
msgid "_Minimize to Tray"
|
||||||
msgstr "_Minimizar para bandeja"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1471
|
#: ../src/fe-gtk/maingui.c:1471
|
||||||
msgid "Insert Attribute or Color Code"
|
msgid "Insert Attribute or Color Code"
|
||||||
@@ -3718,7 +3717,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1473
|
#: ../src/fe-gtk/maingui.c:1473
|
||||||
msgid "<b>Bold</b>"
|
msgid "<b>Bold</b>"
|
||||||
msgstr "<b>Negrito</b>"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:1474
|
#: ../src/fe-gtk/maingui.c:1474
|
||||||
msgid "<u>Underline</u>"
|
msgid "<u>Underline</u>"
|
||||||
@@ -3808,15 +3807,15 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:2069
|
#: ../src/fe-gtk/maingui.c:2069
|
||||||
msgid "Topic Protection"
|
msgid "Topic Protection"
|
||||||
msgstr "Tópico Protegido"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:2070
|
#: ../src/fe-gtk/maingui.c:2070
|
||||||
msgid "Invite Only"
|
msgid "Invite Only"
|
||||||
msgstr "Apenas convidados"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:2071
|
#: ../src/fe-gtk/maingui.c:2071
|
||||||
msgid "Moderated"
|
msgid "Moderated"
|
||||||
msgstr "Moderado"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:2072
|
#: ../src/fe-gtk/maingui.c:2072
|
||||||
msgid "Ban List"
|
msgid "Ban List"
|
||||||
@@ -3832,7 +3831,7 @@ msgstr "Limite de Usuários"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:2196
|
#: ../src/fe-gtk/maingui.c:2196
|
||||||
msgid "Show/Hide userlist"
|
msgid "Show/Hide userlist"
|
||||||
msgstr "Exibir/Ocultar lista usuários"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/maingui.c:2609
|
#: ../src/fe-gtk/maingui.c:2609
|
||||||
msgid "Enter new nickname:"
|
msgid "Enter new nickname:"
|
||||||
@@ -3915,7 +3914,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:666 ../src/fe-gtk/menu.c:669
|
#: ../src/fe-gtk/menu.c:666 ../src/fe-gtk/menu.c:669
|
||||||
msgid "Last Msg:"
|
msgid "Last Msg:"
|
||||||
msgstr "Ultima msg:"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:679
|
#: ../src/fe-gtk/menu.c:679
|
||||||
msgid "Away Msg:"
|
msgid "Away Msg:"
|
||||||
@@ -3934,11 +3933,11 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:970
|
#: ../src/fe-gtk/menu.c:970
|
||||||
msgid "Open Link in Browser"
|
msgid "Open Link in Browser"
|
||||||
msgstr "Abrir Link no Navegador"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:971
|
#: ../src/fe-gtk/menu.c:971
|
||||||
msgid "Copy Selected Link"
|
msgid "Copy Selected Link"
|
||||||
msgstr "Copiar Link Selecionado"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1033 ../src/fe-gtk/menu.c:1393
|
#: ../src/fe-gtk/menu.c:1033 ../src/fe-gtk/menu.c:1393
|
||||||
msgid "Join Channel"
|
msgid "Join Channel"
|
||||||
@@ -4095,7 +4094,7 @@ msgstr ": Menu contextual da lista de usuários"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1541
|
#: ../src/fe-gtk/menu.c:1541
|
||||||
msgid "Replace with"
|
msgid "Replace with"
|
||||||
msgstr "Substituir com"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1541
|
#: ../src/fe-gtk/menu.c:1541
|
||||||
msgid ": Replace"
|
msgid ": Replace"
|
||||||
@@ -4339,19 +4338,19 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1826
|
#: ../src/fe-gtk/menu.c:1826
|
||||||
msgid "Save Text..."
|
msgid "Save Text..."
|
||||||
msgstr "Salvar Texto..."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1828
|
#: ../src/fe-gtk/menu.c:1828
|
||||||
msgid "Search"
|
msgid "Search"
|
||||||
msgstr "Procurar"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1829
|
#: ../src/fe-gtk/menu.c:1829
|
||||||
msgid "Search Text..."
|
msgid "Search Text..."
|
||||||
msgstr "Procurar Texto..."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1830
|
#: ../src/fe-gtk/menu.c:1830
|
||||||
msgid "Search Next"
|
msgid "Search Next"
|
||||||
msgstr "Procurar Proximo"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1831
|
#: ../src/fe-gtk/menu.c:1831
|
||||||
msgid "Search Previous"
|
msgid "Search Previous"
|
||||||
@@ -4376,7 +4375,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/notifygui.c:123 ../src/fe-gtk/plugingui.c:63
|
#: ../src/fe-gtk/notifygui.c:123 ../src/fe-gtk/plugingui.c:63
|
||||||
msgid "Name"
|
msgid "Name"
|
||||||
msgstr "Nome"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/notifygui.c:126
|
#: ../src/fe-gtk/notifygui.c:126
|
||||||
msgid "Last Seen"
|
msgid "Last Seen"
|
||||||
@@ -4388,7 +4387,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/notifygui.c:188 ../src/fe-gtk/setup.c:285
|
#: ../src/fe-gtk/notifygui.c:188 ../src/fe-gtk/setup.c:285
|
||||||
msgid "Never"
|
msgid "Never"
|
||||||
msgstr "Nunca"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/notifygui.c:193 ../src/fe-gtk/notifygui.c:222
|
#: ../src/fe-gtk/notifygui.c:193 ../src/fe-gtk/notifygui.c:222
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -4537,7 +4536,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/fe-gtk/plugingui.c:66 ../src/fe-gtk/textgui.c:428
|
#: ../src/fe-gtk/plugingui.c:66 ../src/fe-gtk/textgui.c:428
|
||||||
msgid "Description"
|
msgid "Description"
|
||||||
msgstr "Descrição"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/plugingui.c:163
|
#: ../src/fe-gtk/plugingui.c:163
|
||||||
msgid "Select a Plugin or Script to load"
|
msgid "Select a Plugin or Script to load"
|
||||||
|
2
po/ru.po
2
po/ru.po
@@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# Translators:
|
# Translators:
|
||||||
# Aleksandr P <davian818@gmail.com>, 2010
|
# Aleksandr P <davian818@gmail.com>, 2010
|
||||||
# Andrey Vihrov <andrey.vihrov@gmail.com>, 2013
|
# andreyv <andrey.vihrov@gmail.com>, 2013
|
||||||
# Valek Filippov <frob@df.ru>, 2001
|
# Valek Filippov <frob@df.ru>, 2001
|
||||||
# Volosenkov Dmitry <_bil_@mail.ru>, 1999
|
# Volosenkov Dmitry <_bil_@mail.ru>, 1999
|
||||||
msgid ""
|
msgid ""
|
||||||
|
2
po/sr.po
2
po/sr.po
@@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# Translators:
|
# Translators:
|
||||||
# o Zoltan Čala <zolika@sezampro.yu>, 1999
|
# o Zoltan Čala <zolika@sezampro.yu>, 1999
|
||||||
# Velimir Majstorov <majstorov@gmail.com>, 2013
|
# Ortak Velja <majstorov@gmail.com>, 2013
|
||||||
# Zlatan Vasović <legospace9876@gmail.com>, 2013-2014
|
# Zlatan Vasović <legospace9876@gmail.com>, 2013-2014
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
# This file is distributed under the same license as the PACKAGE package.
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
#
|
#
|
||||||
# Translators:
|
# Translators:
|
||||||
# Velimir Majstorov <majstorov@gmail.com>, 2013
|
# Ortak Velja <majstorov@gmail.com>, 2013
|
||||||
# o Zoltan Čala <zolika@sezampro.yu>, 1999
|
# o Zoltan Čala <zolika@sezampro.yu>, 1999
|
||||||
# Zlatan Vasović <legospace9876@gmail.com>, 2013
|
# Zlatan Vasović <legospace9876@gmail.com>, 2013
|
||||||
msgid ""
|
msgid ""
|
||||||
|
2
po/sv.po
2
po/sv.po
@@ -3,7 +3,7 @@
|
|||||||
# This file is distributed under the same license as the PACKAGE package.
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
#
|
#
|
||||||
# Translators:
|
# Translators:
|
||||||
# Jakob <jakob@knugen.nu>, 2012
|
# androidnisse <jakob@knugen.nu>, 2012
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: HexChat\n"
|
"Project-Id-Version: HexChat\n"
|
||||||
|
19
po/tr.po
19
po/tr.po
@@ -3,19 +3,18 @@
|
|||||||
# This file is distributed under the same license as the PACKAGE package.
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
#
|
#
|
||||||
# Translators:
|
# Translators:
|
||||||
# Atilla Öntaş <tarakbumba@gmail.com>, 2014
|
# tulliana <mdemiray@msn.com>, 2014
|
||||||
# Demiray Muhterem <mdemiray@msn.com>, 2014
|
|
||||||
# ifthenelse <ifthenelse@gmx.com>, 2013
|
# ifthenelse <ifthenelse@gmx.com>, 2013
|
||||||
# osmanos <osman.erkan@yandex.com>, 2014
|
# osmanos <osman.erkan@yandex.com>, 2014
|
||||||
# TingPing <tingping@tingping.se>, 2014
|
# TingPing <tingping@tingping.se>, 2014
|
||||||
# Ufuk UYUMAZ <ufukuyumaz@gmail.com>, 2013
|
# Ufuk Uyumaz <ufukuyumaz@gmail.com>, 2013
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: HexChat\n"
|
"Project-Id-Version: HexChat\n"
|
||||||
"Report-Msgid-Bugs-To: www.hexchat.org\n"
|
"Report-Msgid-Bugs-To: www.hexchat.org\n"
|
||||||
"POT-Creation-Date: 2014-05-14 13:20-0400\n"
|
"POT-Creation-Date: 2014-05-14 13:20-0400\n"
|
||||||
"PO-Revision-Date: 2014-07-14 10:59+0000\n"
|
"PO-Revision-Date: 2014-05-14 17:20+0000\n"
|
||||||
"Last-Translator: Atilla Öntaş <tarakbumba@gmail.com>\n"
|
"Last-Translator: TingPing <tingping@tingping.se>\n"
|
||||||
"Language-Team: Turkish (http://www.transifex.com/projects/p/hexchat/language/tr/)\n"
|
"Language-Team: Turkish (http://www.transifex.com/projects/p/hexchat/language/tr/)\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
@@ -404,13 +403,13 @@ msgstr "BAN <maske> [<yasaktipi>], maskeye uygun herkesi kanalda yasaklar. Zaten
|
|||||||
|
|
||||||
#: ../src/common/outbound.c:3913
|
#: ../src/common/outbound.c:3913
|
||||||
msgid "CHANOPT [-quiet] <variable> [<value>]"
|
msgid "CHANOPT [-quiet] <variable> [<value>]"
|
||||||
msgstr "CHANOPT [-quiet] <değişken> [<değer>]"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/outbound.c:3914
|
#: ../src/common/outbound.c:3914
|
||||||
msgid ""
|
msgid ""
|
||||||
"CHARSET [<encoding>], get or set the encoding used for the current "
|
"CHARSET [<encoding>], get or set the encoding used for the current "
|
||||||
"connection"
|
"connection"
|
||||||
msgstr "CHARSET [<kodlama>], geçerli bağlantı için kullanılan kodlamayı getir veya ayarla"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/outbound.c:3915
|
#: ../src/common/outbound.c:3915
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -424,19 +423,19 @@ msgstr ""
|
|||||||
|
|
||||||
#: ../src/common/outbound.c:3919
|
#: ../src/common/outbound.c:3919
|
||||||
msgid "COUNTRY [-s] <code|wildcard>, finds a country code, eg: au = australia"
|
msgid "COUNTRY [-s] <code|wildcard>, finds a country code, eg: au = australia"
|
||||||
msgstr "COUNTRY [-s] <kodlama/değişken ifade>, bir ülke kodlaması bulur, mesela: au = australia"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/outbound.c:3921
|
#: ../src/common/outbound.c:3921
|
||||||
msgid ""
|
msgid ""
|
||||||
"CTCP <nick> <message>, send the CTCP message to nick, common messages are "
|
"CTCP <nick> <message>, send the CTCP message to nick, common messages are "
|
||||||
"VERSION and USERINFO"
|
"VERSION and USERINFO"
|
||||||
msgstr "CTCP <rumuz> <ileti>,CTCP iletisinii rumuza gönder, ortak iletiler VERSION ve USERINFO' dur"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/outbound.c:3923
|
#: ../src/common/outbound.c:3923
|
||||||
msgid ""
|
msgid ""
|
||||||
"CYCLE [<channel>], parts the current or given channel and immediately "
|
"CYCLE [<channel>], parts the current or given channel and immediately "
|
||||||
"rejoins"
|
"rejoins"
|
||||||
msgstr "CYCLE [<kanall>], geçerli olan veya verilen kanalı böler ve hemen yeniden katılır"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/outbound.c:3925
|
#: ../src/common/outbound.c:3925
|
||||||
msgid ""
|
msgid ""
|
||||||
|
40
po/zh_CN.po
40
po/zh_CN.po
@@ -5,16 +5,14 @@
|
|||||||
# Translators:
|
# Translators:
|
||||||
# Aron Xu <happyaron.xu@gmail.com>, 2010
|
# Aron Xu <happyaron.xu@gmail.com>, 2010
|
||||||
# Dalin <ayi880@hotmail.com>, 2003
|
# Dalin <ayi880@hotmail.com>, 2003
|
||||||
# Eleanor Chen <chenyueg@gmail.com>, 2010
|
# chenyueg <chenyueg@gmail.com>, 2010
|
||||||
# highwind <highwindmx@126.com>, 2014
|
# michaeljayt <michaeljayt@gmail.com>, 2014
|
||||||
# bababababanana1, 2014
|
|
||||||
# Michael Jay Tong <michaeljayt@gmail.com>, 2014
|
|
||||||
# Minor revision by Walte <webmaster@www.linuxfans.org>, 2003
|
# Minor revision by Walte <webmaster@www.linuxfans.org>, 2003
|
||||||
# Rongjun Mu <elanmu@sina.com>, 2003
|
# Rongjun Mu <elanmu@sina.com>, 2003
|
||||||
# Rongjun Mu <rongjunmu+i18n@gmail.com>, 2004
|
# Rongjun Mu <rongjunmu+i18n@gmail.com>, 2004
|
||||||
# Sarah Smith <sarahs@redhat.com>, 2003
|
# Sarah Smith <sarahs@redhat.com>, 2003
|
||||||
# SEPTEM <septeman@gmail.com>, 2006
|
# SEPTEM <septeman@gmail.com>, 2006
|
||||||
# Tong Hui <tonghuix@gmail.com>, 2014
|
# tonghuix <tonghuix@gmail.com>, 2014
|
||||||
# Zhuyuan Liu <gtkdict@yahoo.com.cn>, 2005
|
# Zhuyuan Liu <gtkdict@yahoo.com.cn>, 2005
|
||||||
# Zong Yaotang <zong@cosix.com.au>, 2002
|
# Zong Yaotang <zong@cosix.com.au>, 2002
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -22,8 +20,8 @@ msgstr ""
|
|||||||
"Project-Id-Version: HexChat\n"
|
"Project-Id-Version: HexChat\n"
|
||||||
"Report-Msgid-Bugs-To: www.hexchat.org\n"
|
"Report-Msgid-Bugs-To: www.hexchat.org\n"
|
||||||
"POT-Creation-Date: 2014-05-14 13:20-0400\n"
|
"POT-Creation-Date: 2014-05-14 13:20-0400\n"
|
||||||
"PO-Revision-Date: 2014-07-16 13:16+0000\n"
|
"PO-Revision-Date: 2014-05-14 17:20+0000\n"
|
||||||
"Last-Translator: bababababanana1\n"
|
"Last-Translator: TingPing <tingping@tingping.se>\n"
|
||||||
"Language-Team: Chinese (China) (http://www.transifex.com/projects/p/hexchat/language/zh_CN/)\n"
|
"Language-Team: Chinese (China) (http://www.transifex.com/projects/p/hexchat/language/zh_CN/)\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
@@ -291,7 +289,7 @@ msgstr "否 "
|
|||||||
#: ../src/common/ignore.c:385
|
#: ../src/common/ignore.c:385
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "You are being CTCP flooded from %s, ignoring %s\n"
|
msgid "You are being CTCP flooded from %s, ignoring %s\n"
|
||||||
msgstr "您正受到来自 %s 的洗屏攻击,忽略 %s\n"
|
msgstr "您正受到来自 %s 的 CTCP 洪水攻击,忽略 %s\n"
|
||||||
|
|
||||||
#: ../src/common/ignore.c:410
|
#: ../src/common/ignore.c:410
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -310,7 +308,7 @@ msgstr " %-20s 离线\n"
|
|||||||
|
|
||||||
#: ../src/common/outbound.c:72
|
#: ../src/common/outbound.c:72
|
||||||
msgid "No channel joined. Try /join #<channel>\n"
|
msgid "No channel joined. Try /join #<channel>\n"
|
||||||
msgstr "没有进入任何频道。请尝试输入 /join #<channel>\n"
|
msgstr "没有进入任何频道。请尝试 /join #<channel>\n"
|
||||||
|
|
||||||
#: ../src/common/outbound.c:78
|
#: ../src/common/outbound.c:78
|
||||||
msgid "Not connected. Try /server <host> [<port>]\n"
|
msgid "Not connected. Try /server <host> [<port>]\n"
|
||||||
@@ -1424,7 +1422,7 @@ msgstr "此人的主机名"
|
|||||||
|
|
||||||
#: ../src/common/text.c:1035
|
#: ../src/common/text.c:1035
|
||||||
msgid "The account of the person"
|
msgid "The account of the person"
|
||||||
msgstr "这个人的帐号"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/common/text.c:1039 ../src/common/text.c:1046
|
#: ../src/common/text.c:1039 ../src/common/text.c:1046
|
||||||
#: ../src/common/text.c:1053 ../src/common/text.c:1265
|
#: ../src/common/text.c:1053 ../src/common/text.c:1265
|
||||||
@@ -3983,27 +3981,27 @@ msgstr "编辑此菜单..."
|
|||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1292
|
#: ../src/fe-gtk/menu.c:1292
|
||||||
msgid "Marker line disabled."
|
msgid "Marker line disabled."
|
||||||
msgstr "标记线已禁用."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1298
|
#: ../src/fe-gtk/menu.c:1298
|
||||||
msgid "Marker line never set."
|
msgid "Marker line never set."
|
||||||
msgstr "标记线永不设置."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1302
|
#: ../src/fe-gtk/menu.c:1302
|
||||||
msgid "Marker line reset manually."
|
msgid "Marker line reset manually."
|
||||||
msgstr "标记线手动重设."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1304
|
#: ../src/fe-gtk/menu.c:1304
|
||||||
msgid "Marker line reset because exceeded scrollback limit."
|
msgid "Marker line reset because exceeded scrollback limit."
|
||||||
msgstr "因超越回滚限制重设标记线."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1306
|
#: ../src/fe-gtk/menu.c:1306
|
||||||
msgid "Marker line reset by CLEAR command."
|
msgid "Marker line reset by CLEAR command."
|
||||||
msgstr "使用CLEAR命令重设标记线."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1308
|
#: ../src/fe-gtk/menu.c:1308
|
||||||
msgid "Marker line state unknown."
|
msgid "Marker line state unknown."
|
||||||
msgstr "标记线状态未知."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1395
|
#: ../src/fe-gtk/menu.c:1395
|
||||||
msgid "Retrieve channel list..."
|
msgid "Retrieve channel list..."
|
||||||
@@ -4335,7 +4333,7 @@ msgstr "重置标记线"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1823
|
#: ../src/fe-gtk/menu.c:1823
|
||||||
msgid "Move to Marker Line"
|
msgid "Move to Marker Line"
|
||||||
msgstr "移动至标记线."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/menu.c:1824
|
#: ../src/fe-gtk/menu.c:1824
|
||||||
msgid "_Copy Selection"
|
msgid "_Copy Selection"
|
||||||
@@ -4596,7 +4594,7 @@ msgstr "用户名不可留空。"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/servlistgui.c:1578
|
#: ../src/fe-gtk/servlistgui.c:1578
|
||||||
msgid "You must have two unique nick names."
|
msgid "You must have two unique nick names."
|
||||||
msgstr "您必须拥有两个昵称."
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/servlistgui.c:1630
|
#: ../src/fe-gtk/servlistgui.c:1630
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -5433,7 +5431,7 @@ msgstr "托盘图标闪烁于:"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:404
|
#: ../src/fe-gtk/setup.c:404
|
||||||
msgid "Bounce dock icon on:"
|
msgid "Bounce dock icon on:"
|
||||||
msgstr "弹跳托盘图标于:"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:407 ../src/fe-gtk/setup.c:453
|
#: ../src/fe-gtk/setup.c:407 ../src/fe-gtk/setup.c:453
|
||||||
msgid "Blink task bar on:"
|
msgid "Blink task bar on:"
|
||||||
@@ -5585,7 +5583,7 @@ msgstr "默认隐藏频道里的进入/离开信息"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:485
|
#: ../src/fe-gtk/setup.c:485
|
||||||
msgid "Hide nick change messages"
|
msgid "Hide nick change messages"
|
||||||
msgstr "隐藏昵称变更信息"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/setup.c:492
|
#: ../src/fe-gtk/setup.c:492
|
||||||
msgid "*!*@*.host"
|
msgid "*!*@*.host"
|
||||||
@@ -6097,7 +6095,7 @@ msgstr "测试全部"
|
|||||||
|
|
||||||
#: ../src/fe-gtk/textgui.c:485
|
#: ../src/fe-gtk/textgui.c:485
|
||||||
msgid "OK"
|
msgid "OK"
|
||||||
msgstr "确认"
|
msgstr ""
|
||||||
|
|
||||||
#: ../src/fe-gtk/urlgrab.c:198
|
#: ../src/fe-gtk/urlgrab.c:198
|
||||||
msgid ": URL Grabber"
|
msgid ": URL Grabber"
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# HexChat [](https://travis-ci.org/hexchat/hexchat) [](http://nekomimi.cloudapp.net:8080/job/hexchat/) [](https://bitdeli.com/free "Bitdeli Badge")
|
# HexChat [](https://travis-ci.org/hexchat/hexchat) [](http://nekomimi.cloudapp.net:8080/job/hexchat/)
|
||||||
|
|
||||||
HexChat is an IRC client for Windows and UNIX-like operating systems.
|
HexChat is an IRC client for Windows and UNIX-like operating systems.
|
||||||
See [IRCHelp.org](http://irchelp.org) for information about IRC in general.
|
See [IRCHelp.org](http://irchelp.org) for information about IRC in general.
|
||||||
|
@@ -1,8 +1,10 @@
|
|||||||
## Process this file with automake to produce Makefile.in
|
## Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
|
include $(top_srcdir)/m4/clang-analyze.am
|
||||||
|
|
||||||
noinst_LIBRARIES = libhexchatcommon.a
|
noinst_LIBRARIES = libhexchatcommon.a
|
||||||
|
|
||||||
AM_CPPFLAGS = $(COMMON_CFLAGS)
|
AM_CPPFLAGS = $(COMMON_CFLAGS) -I$(top_srcdir)
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
cfgfiles.h \
|
cfgfiles.h \
|
||||||
@@ -20,11 +22,11 @@ EXTRA_DIST = \
|
|||||||
inet.h \
|
inet.h \
|
||||||
make-te.c \
|
make-te.c \
|
||||||
modes.h \
|
modes.h \
|
||||||
msproxy.h \
|
|
||||||
network.h \
|
network.h \
|
||||||
notify.h \
|
notify.h \
|
||||||
outbound.h \
|
outbound.h \
|
||||||
plugin.h \
|
plugin.h \
|
||||||
|
plugin-identd.h \
|
||||||
plugin-timer.h \
|
plugin-timer.h \
|
||||||
proto-irc.h \
|
proto-irc.h \
|
||||||
server.h \
|
server.h \
|
||||||
@@ -44,10 +46,6 @@ if USE_OPENSSL
|
|||||||
ssl_c = ssl.c
|
ssl_c = ssl.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if USE_MSPROXY
|
|
||||||
msproxy_c = msproxy.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
if USE_DBUS
|
if USE_DBUS
|
||||||
dbusdir = dbus
|
dbusdir = dbus
|
||||||
libhexchatcommon_a_LIBADD = \
|
libhexchatcommon_a_LIBADD = \
|
||||||
@@ -62,23 +60,28 @@ endif
|
|||||||
noinst_PROGRAMS = make-te
|
noinst_PROGRAMS = make-te
|
||||||
|
|
||||||
libhexchatcommon_a_SOURCES = cfgfiles.c chanopt.c ctcp.c dcc.c hexchat.c \
|
libhexchatcommon_a_SOURCES = cfgfiles.c chanopt.c ctcp.c dcc.c hexchat.c \
|
||||||
history.c ignore.c inbound.c marshal.c modes.c $(msproxy_c) network.c notify.c \
|
history.c ignore.c inbound.c marshal.c modes.c network.c notify.c \
|
||||||
outbound.c plugin.c plugin-timer.c proto-irc.c server.c servlist.c \
|
outbound.c plugin.c plugin-identd.c plugin-timer.c proto-irc.c server.c servlist.c \
|
||||||
$(ssl_c) text.c tree.c url.c userlist.c util.c
|
$(ssl_c) text.c tree.c url.c userlist.c util.c
|
||||||
libhexchatcommon_a_CFLAGS = $(LIBPROXY_CFLAGS)
|
|
||||||
|
|
||||||
textenums.h: textevents.h
|
textenums.h: textevents.h
|
||||||
|
|
||||||
textevents.h: textevents.in make-te
|
textevents.h: $(srcdir)/textevents.in make-te
|
||||||
$(AM_V_GEN) ./make-te < textevents.in > textevents.h 2> textenums.h
|
$(AM_V_GEN) ./make-te < $< > $@ 2> textenums.h
|
||||||
|
|
||||||
marshal.h: marshalers.list
|
marshal.h: $(srcdir)/marshalers.list
|
||||||
$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_hexchat_marshal --header $(srcdir)/marshalers.list > $@
|
$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_hexchat_marshal --header $< > $@
|
||||||
|
|
||||||
marshal.c: marshalers.list
|
marshal.c: $(srcdir)/marshalers.list
|
||||||
$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_hexchat_marshal --body $(srcdir)/marshalers.list > $@
|
$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_hexchat_marshal --body $< > $@
|
||||||
|
|
||||||
|
|
||||||
|
if DO_STATIC_ANALYSIS
|
||||||
|
analyze_plists = $(libhexchatcommon_a_SOURCES:%.c=%.plist)
|
||||||
|
all-local: $(analyze_plists)
|
||||||
|
MOSTLYCLEANFILES = $(analyze_plists)
|
||||||
|
endif
|
||||||
|
|
||||||
BUILT_SOURCES = textenums.h textevents.h marshal.c marshal.h
|
BUILT_SOURCES = textenums.h textevents.h marshal.c marshal.h
|
||||||
|
|
||||||
CLEANFILES = $(BUILT_SOURCES)
|
CLEANFILES = $(BUILT_SOURCES)
|
||||||
|
@@ -57,15 +57,11 @@ list_addentry (GSList ** list, char *cmd, char *name)
|
|||||||
size_t name_len;
|
size_t name_len;
|
||||||
size_t cmd_len = 1;
|
size_t cmd_len = 1;
|
||||||
|
|
||||||
/* remove <2.8.0 stuff */
|
|
||||||
if (!strcmp (cmd, "away") && !strcmp (name, "BACK"))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (cmd)
|
if (cmd)
|
||||||
cmd_len = strlen (cmd) + 1;
|
cmd_len = strlen (cmd) + 1;
|
||||||
name_len = strlen (name) + 1;
|
name_len = strlen (name) + 1;
|
||||||
|
|
||||||
pop = malloc (sizeof (struct popup) + cmd_len + name_len);
|
pop = g_malloc (sizeof (struct popup) + cmd_len + name_len);
|
||||||
pop->name = (char *) pop + sizeof (struct popup);
|
pop->name = (char *) pop + sizeof (struct popup);
|
||||||
pop->cmd = pop->name + name_len;
|
pop->cmd = pop->name + name_len;
|
||||||
|
|
||||||
@@ -137,13 +133,13 @@ list_loadconf (char *file, GSList ** list, char *defaultconf)
|
|||||||
abort ();
|
abort ();
|
||||||
}
|
}
|
||||||
|
|
||||||
ibuf = malloc (st.st_size);
|
ibuf = g_malloc (st.st_size);
|
||||||
read (fd, ibuf, st.st_size);
|
read (fd, ibuf, st.st_size);
|
||||||
close (fd);
|
close (fd);
|
||||||
|
|
||||||
list_load_from_data (list, ibuf, st.st_size);
|
list_load_from_data (list, ibuf, st.st_size);
|
||||||
|
|
||||||
free (ibuf);
|
g_free (ibuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -153,7 +149,7 @@ list_free (GSList ** list)
|
|||||||
while (*list)
|
while (*list)
|
||||||
{
|
{
|
||||||
data = (void *) (*list)->data;
|
data = (void *) (*list)->data;
|
||||||
free (data);
|
g_free (data);
|
||||||
*list = g_slist_remove (*list, data);
|
*list = g_slist_remove (*list, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -170,7 +166,7 @@ list_delentry (GSList ** list, char *name)
|
|||||||
if (!g_ascii_strcasecmp (name, pop->name))
|
if (!g_ascii_strcasecmp (name, pop->name))
|
||||||
{
|
{
|
||||||
*list = g_slist_remove (*list, pop);
|
*list = g_slist_remove (*list, pop);
|
||||||
free (pop);
|
g_free (pop);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
alist = alist->next;
|
alist = alist->next;
|
||||||
@@ -211,10 +207,10 @@ cfg_get_str (char *cfg, const char *var, char *dest, int dest_len)
|
|||||||
while (*cfg != 0 && *cfg != '\n')
|
while (*cfg != 0 && *cfg != '\n')
|
||||||
cfg++;
|
cfg++;
|
||||||
if (*cfg == 0)
|
if (*cfg == 0)
|
||||||
return 0;
|
return NULL;
|
||||||
cfg++;
|
cfg++;
|
||||||
if (*cfg == 0)
|
if (*cfg == 0)
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,7 +220,7 @@ cfg_put_str (int fh, char *var, char *value)
|
|||||||
char buf[512];
|
char buf[512];
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
snprintf (buf, sizeof buf, "%s = %s\n", var, value);
|
g_snprintf (buf, sizeof buf, "%s = %s\n", var, value);
|
||||||
len = strlen (buf);
|
len = strlen (buf);
|
||||||
return (write (fh, buf, len) == len);
|
return (write (fh, buf, len) == len);
|
||||||
}
|
}
|
||||||
@@ -235,7 +231,7 @@ cfg_put_color (int fh, int r, int g, int b, char *var)
|
|||||||
char buf[400];
|
char buf[400];
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
snprintf (buf, sizeof buf, "%s = %04x %04x %04x\n", var, r, g, b);
|
g_snprintf (buf, sizeof buf, "%s = %04x %04x %04x\n", var, r, g, b);
|
||||||
len = strlen (buf);
|
len = strlen (buf);
|
||||||
return (write (fh, buf, len) == len);
|
return (write (fh, buf, len) == len);
|
||||||
}
|
}
|
||||||
@@ -249,7 +245,7 @@ cfg_put_int (int fh, int value, char *var)
|
|||||||
if (value == -1)
|
if (value == -1)
|
||||||
value = 1;
|
value = 1;
|
||||||
|
|
||||||
snprintf (buf, sizeof buf, "%s = %d\n", var, value);
|
g_snprintf (buf, sizeof buf, "%s = %d\n", var, value);
|
||||||
len = strlen (buf);
|
len = strlen (buf);
|
||||||
return (write (fh, buf, len) == len);
|
return (write (fh, buf, len) == len);
|
||||||
}
|
}
|
||||||
@@ -312,14 +308,9 @@ get_xdir (void)
|
|||||||
|
|
||||||
if (portable_mode () || SHGetKnownFolderPath (&FOLDERID_RoamingAppData, 0, NULL, &roaming_path_wide) != S_OK)
|
if (portable_mode () || SHGetKnownFolderPath (&FOLDERID_RoamingAppData, 0, NULL, &roaming_path_wide) != S_OK)
|
||||||
{
|
{
|
||||||
char *path;
|
char *path = g_win32_get_package_installation_directory_of_module (NULL);
|
||||||
char file[MAX_PATH];
|
if (path)
|
||||||
HMODULE hModule;
|
|
||||||
|
|
||||||
hModule = GetModuleHandle (NULL);
|
|
||||||
if (GetModuleFileName (hModule, file, sizeof(file)))
|
|
||||||
{
|
{
|
||||||
path = g_path_get_dirname (file);
|
|
||||||
xdir = g_build_filename (path, "config", NULL);
|
xdir = g_build_filename (path, "config", NULL);
|
||||||
g_free (path);
|
g_free (path);
|
||||||
}
|
}
|
||||||
@@ -443,6 +434,7 @@ const struct prefs vars[] =
|
|||||||
{"gui_tab_dots", P_OFFINT (hex_gui_tab_dots), TYPE_BOOL},
|
{"gui_tab_dots", P_OFFINT (hex_gui_tab_dots), TYPE_BOOL},
|
||||||
{"gui_tab_icons", P_OFFINT (hex_gui_tab_icons), TYPE_BOOL},
|
{"gui_tab_icons", P_OFFINT (hex_gui_tab_icons), TYPE_BOOL},
|
||||||
{"gui_tab_layout", P_OFFINT (hex_gui_tab_layout), TYPE_INT},
|
{"gui_tab_layout", P_OFFINT (hex_gui_tab_layout), TYPE_INT},
|
||||||
|
{"gui_tab_middleclose", P_OFFINT (hex_gui_tab_middleclose), TYPE_BOOL},
|
||||||
{"gui_tab_newtofront", P_OFFINT (hex_gui_tab_newtofront), TYPE_INT},
|
{"gui_tab_newtofront", P_OFFINT (hex_gui_tab_newtofront), TYPE_INT},
|
||||||
{"gui_tab_pos", P_OFFINT (hex_gui_tab_pos), TYPE_INT},
|
{"gui_tab_pos", P_OFFINT (hex_gui_tab_pos), TYPE_INT},
|
||||||
{"gui_tab_scrollchans", P_OFFINT (hex_gui_tab_scrollchans), TYPE_BOOL},
|
{"gui_tab_scrollchans", P_OFFINT (hex_gui_tab_scrollchans), TYPE_BOOL},
|
||||||
@@ -485,6 +477,7 @@ const struct prefs vars[] =
|
|||||||
{"gui_win_width", P_OFFINT (hex_gui_win_width), TYPE_INT},
|
{"gui_win_width", P_OFFINT (hex_gui_win_width), TYPE_INT},
|
||||||
|
|
||||||
{"identd", P_OFFINT (hex_identd), TYPE_BOOL},
|
{"identd", P_OFFINT (hex_identd), TYPE_BOOL},
|
||||||
|
{"identd_port", P_OFFINT (hex_identd_port), TYPE_INT},
|
||||||
|
|
||||||
{"input_balloon_chans", P_OFFINT (hex_input_balloon_chans), TYPE_BOOL},
|
{"input_balloon_chans", P_OFFINT (hex_input_balloon_chans), TYPE_BOOL},
|
||||||
{"input_balloon_hilight", P_OFFINT (hex_input_balloon_hilight), TYPE_BOOL},
|
{"input_balloon_hilight", P_OFFINT (hex_input_balloon_hilight), TYPE_BOOL},
|
||||||
@@ -536,9 +529,7 @@ const struct prefs vars[] =
|
|||||||
{"irc_whois_front", P_OFFINT (hex_irc_whois_front), TYPE_BOOL},
|
{"irc_whois_front", P_OFFINT (hex_irc_whois_front), TYPE_BOOL},
|
||||||
|
|
||||||
{"net_auto_reconnect", P_OFFINT (hex_net_auto_reconnect), TYPE_BOOL},
|
{"net_auto_reconnect", P_OFFINT (hex_net_auto_reconnect), TYPE_BOOL},
|
||||||
#ifndef WIN32 /* FIXME fix reconnect crashes and remove this ifdef! */
|
|
||||||
{"net_auto_reconnectonfail", P_OFFINT (hex_net_auto_reconnectonfail), TYPE_BOOL},
|
{"net_auto_reconnectonfail", P_OFFINT (hex_net_auto_reconnectonfail), TYPE_BOOL},
|
||||||
#endif
|
|
||||||
{"net_bind_host", P_OFFSET (hex_net_bind_host), TYPE_STR},
|
{"net_bind_host", P_OFFSET (hex_net_bind_host), TYPE_STR},
|
||||||
{"net_ping_timeout", P_OFFINT (hex_net_ping_timeout), TYPE_INT},
|
{"net_ping_timeout", P_OFFINT (hex_net_ping_timeout), TYPE_INT},
|
||||||
{"net_proxy_auth", P_OFFINT (hex_net_proxy_auth), TYPE_BOOL},
|
{"net_proxy_auth", P_OFFINT (hex_net_proxy_auth), TYPE_BOOL},
|
||||||
@@ -593,10 +584,10 @@ const struct prefs vars[] =
|
|||||||
{0, 0, 0},
|
{0, 0, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
static char *
|
static const char *
|
||||||
convert_with_fallback (const char *str, const char *fallback)
|
convert_with_fallback (const char *str, const char *fallback)
|
||||||
{
|
{
|
||||||
char *utf;
|
const char *utf;
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
/* On non-Windows, g_get_user_name and g_get_real_name return a string in system locale, so convert it to utf-8. */
|
/* On non-Windows, g_get_user_name and g_get_real_name return a string in system locale, so convert it to utf-8. */
|
||||||
@@ -655,7 +646,7 @@ get_default_language (void)
|
|||||||
|
|
||||||
if (lang_no >= 0)
|
if (lang_no >= 0)
|
||||||
{
|
{
|
||||||
free (lang);
|
g_free (lang);
|
||||||
return lang_no;
|
return lang_no;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -664,7 +655,7 @@ get_default_language (void)
|
|||||||
|
|
||||||
lang_no = find_language_number (lang);
|
lang_no = find_language_number (lang);
|
||||||
|
|
||||||
free (lang);
|
g_free (lang);
|
||||||
|
|
||||||
return lang_no >= 0 ? lang_no : find_language_number ("en");
|
return lang_no >= 0 ? lang_no : find_language_number ("en");
|
||||||
}
|
}
|
||||||
@@ -706,8 +697,8 @@ get_default_spell_languages (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (last != NULL)
|
|
||||||
g_free(last);
|
g_free (last);
|
||||||
|
|
||||||
if (lang_list[0])
|
if (lang_list[0])
|
||||||
return g_strdup (ret);
|
return g_strdup (ret);
|
||||||
@@ -768,6 +759,7 @@ load_default_config(void)
|
|||||||
prefs.hex_gui_tab_chans = 1;
|
prefs.hex_gui_tab_chans = 1;
|
||||||
prefs.hex_gui_tab_dialogs = 1;
|
prefs.hex_gui_tab_dialogs = 1;
|
||||||
prefs.hex_gui_tab_icons = 1;
|
prefs.hex_gui_tab_icons = 1;
|
||||||
|
prefs.hex_gui_tab_middleclose = 1;
|
||||||
prefs.hex_gui_tab_server = 1;
|
prefs.hex_gui_tab_server = 1;
|
||||||
prefs.hex_gui_tab_sort = 1;
|
prefs.hex_gui_tab_sort = 1;
|
||||||
prefs.hex_gui_topicbar = 1;
|
prefs.hex_gui_topicbar = 1;
|
||||||
@@ -779,12 +771,12 @@ load_default_config(void)
|
|||||||
prefs.hex_gui_ulist_resizable = 1;
|
prefs.hex_gui_ulist_resizable = 1;
|
||||||
prefs.hex_gui_ulist_style = 1;
|
prefs.hex_gui_ulist_style = 1;
|
||||||
prefs.hex_gui_win_save = 1;
|
prefs.hex_gui_win_save = 1;
|
||||||
prefs.hex_identd = 1;
|
|
||||||
prefs.hex_input_flash_hilight = 1;
|
prefs.hex_input_flash_hilight = 1;
|
||||||
prefs.hex_input_flash_priv = 1;
|
prefs.hex_input_flash_priv = 1;
|
||||||
prefs.hex_input_tray_hilight = 1;
|
prefs.hex_input_tray_hilight = 1;
|
||||||
prefs.hex_input_tray_priv = 1;
|
prefs.hex_input_tray_priv = 1;
|
||||||
prefs.hex_irc_cap_server_time = 1;
|
prefs.hex_irc_cap_server_time = 1;
|
||||||
|
prefs.hex_irc_logging = 1;
|
||||||
prefs.hex_irc_who_join = 1; /* Can kick with inordinate amount of channels, required for some of our features though, TODO: add cap like away check? */
|
prefs.hex_irc_who_join = 1; /* Can kick with inordinate amount of channels, required for some of our features though, TODO: add cap like away check? */
|
||||||
prefs.hex_irc_whois_front = 1;
|
prefs.hex_irc_whois_front = 1;
|
||||||
prefs.hex_net_auto_reconnect = 1;
|
prefs.hex_net_auto_reconnect = 1;
|
||||||
@@ -849,7 +841,7 @@ load_default_config(void)
|
|||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
if (portable_mode () || SHGetKnownFolderPath (&FOLDERID_Downloads, 0, NULL, &roaming_path_wide) != S_OK)
|
if (portable_mode () || SHGetKnownFolderPath (&FOLDERID_Downloads, 0, NULL, &roaming_path_wide) != S_OK)
|
||||||
{
|
{
|
||||||
snprintf (prefs.hex_dcc_dir, sizeof (prefs.hex_dcc_dir), "%s\\downloads", get_xdir ());
|
g_snprintf (prefs.hex_dcc_dir, sizeof (prefs.hex_dcc_dir), "%s\\downloads", get_xdir ());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -863,34 +855,36 @@ load_default_config(void)
|
|||||||
#else
|
#else
|
||||||
if (g_get_user_special_dir (G_USER_DIRECTORY_DOWNLOAD))
|
if (g_get_user_special_dir (G_USER_DIRECTORY_DOWNLOAD))
|
||||||
{
|
{
|
||||||
strcpy (prefs.hex_dcc_dir, g_get_user_special_dir (G_USER_DIRECTORY_DOWNLOAD));
|
safe_strcpy (prefs.hex_dcc_dir, g_get_user_special_dir (G_USER_DIRECTORY_DOWNLOAD), sizeof(prefs.hex_dcc_dir));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strcpy (prefs.hex_dcc_dir, g_build_filename (g_get_home_dir (), "Downloads", NULL));
|
char *download_dir = g_build_filename (g_get_home_dir (), "Downloads", NULL);
|
||||||
|
safe_strcpy (prefs.hex_dcc_dir, download_dir, sizeof(prefs.hex_dcc_dir));
|
||||||
|
g_free (download_dir);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
strcpy (prefs.hex_gui_ulist_doubleclick, "QUERY %s");
|
strcpy (prefs.hex_gui_ulist_doubleclick, "QUERY %s");
|
||||||
strcpy (prefs.hex_input_command_char, "/");
|
strcpy (prefs.hex_input_command_char, "/");
|
||||||
strcpy (prefs.hex_irc_logmask, g_build_filename ("%n", "%c.log", NULL));
|
strcpy (prefs.hex_irc_logmask, "%n"G_DIR_SEPARATOR_S"%c.log");
|
||||||
strcpy (prefs.hex_irc_nick1, username);
|
safe_strcpy (prefs.hex_irc_nick1, username, sizeof(prefs.hex_irc_nick1));
|
||||||
strcpy (prefs.hex_irc_nick2, username);
|
safe_strcpy (prefs.hex_irc_nick2, username, sizeof(prefs.hex_irc_nick2));
|
||||||
strcat (prefs.hex_irc_nick2, "_");
|
g_strlcat (prefs.hex_irc_nick2, "_", sizeof(prefs.hex_irc_nick2));
|
||||||
strcpy (prefs.hex_irc_nick3, username);
|
safe_strcpy (prefs.hex_irc_nick3, username, sizeof(prefs.hex_irc_nick3));
|
||||||
strcat (prefs.hex_irc_nick3, "__");
|
g_strlcat (prefs.hex_irc_nick3, "__", sizeof(prefs.hex_irc_nick3));
|
||||||
strcpy (prefs.hex_irc_no_hilight, "NickServ,ChanServ,InfoServ,N,Q");
|
strcpy (prefs.hex_irc_no_hilight, "NickServ,ChanServ,InfoServ,N,Q");
|
||||||
strcpy (prefs.hex_irc_part_reason, _("Leaving"));
|
safe_strcpy (prefs.hex_irc_part_reason, _("Leaving"), sizeof(prefs.hex_irc_part_reason));
|
||||||
strcpy (prefs.hex_irc_quit_reason, prefs.hex_irc_part_reason);
|
safe_strcpy (prefs.hex_irc_quit_reason, prefs.hex_irc_part_reason, sizeof(prefs.hex_irc_quit_reason));
|
||||||
strcpy (prefs.hex_irc_real_name, realname);
|
safe_strcpy (prefs.hex_irc_real_name, realname, sizeof(prefs.hex_irc_real_name));
|
||||||
strcpy (prefs.hex_irc_user_name, username);
|
safe_strcpy (prefs.hex_irc_user_name, username, sizeof(prefs.hex_irc_user_name));
|
||||||
strcpy (prefs.hex_stamp_log_format, "%b %d %H:%M:%S ");
|
strcpy (prefs.hex_stamp_log_format, "%b %d %H:%M:%S ");
|
||||||
strcpy (prefs.hex_stamp_text_format, "[%H:%M:%S] ");
|
strcpy (prefs.hex_stamp_text_format, "[%H:%M:%S] ");
|
||||||
|
|
||||||
font = fe_get_default_font ();
|
font = fe_get_default_font ();
|
||||||
if (font)
|
if (font)
|
||||||
{
|
{
|
||||||
strcpy (prefs.hex_text_font, font);
|
safe_strcpy (prefs.hex_text_font, font, sizeof(prefs.hex_text_font));
|
||||||
strcpy (prefs.hex_text_font_main, font);
|
safe_strcpy (prefs.hex_text_font_main, font, sizeof(prefs.hex_text_font_main));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -900,7 +894,7 @@ load_default_config(void)
|
|||||||
|
|
||||||
strcpy (prefs.hex_text_font_alternative, DEF_FONT_ALTER);
|
strcpy (prefs.hex_text_font_alternative, DEF_FONT_ALTER);
|
||||||
langs = get_default_spell_languages ();
|
langs = get_default_spell_languages ();
|
||||||
strcpy (prefs.hex_text_spell_langs, langs);
|
safe_strcpy (prefs.hex_text_spell_langs, langs, sizeof(prefs.hex_text_spell_langs));
|
||||||
|
|
||||||
|
|
||||||
/* private variables */
|
/* private variables */
|
||||||
@@ -1230,7 +1224,7 @@ cmd_set (struct session *sess, char *tbuf, char *word[], char *word_eol[])
|
|||||||
if (erase || *val)
|
if (erase || *val)
|
||||||
{
|
{
|
||||||
/* save the previous value until we print it out */
|
/* save the previous value until we print it out */
|
||||||
prev_string = (char*) malloc (vars[i].len + 1);
|
prev_string = g_malloc (vars[i].len + 1);
|
||||||
strncpy (prev_string, (char *) &prefs + vars[i].offset, vars[i].len);
|
strncpy (prev_string, (char *) &prefs + vars[i].offset, vars[i].len);
|
||||||
|
|
||||||
/* update the variable */
|
/* update the variable */
|
||||||
@@ -1242,7 +1236,7 @@ cmd_set (struct session *sess, char *tbuf, char *word[], char *word_eol[])
|
|||||||
PrintTextf (sess, "%s set to: %s (was: %s)\n", var, (char *) &prefs + vars[i].offset, prev_string);
|
PrintTextf (sess, "%s set to: %s (was: %s)\n", var, (char *) &prefs + vars[i].offset, prev_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
free (prev_string);
|
g_free (prev_string);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1317,7 +1311,7 @@ cmd_set (struct session *sess, char *tbuf, char *word[], char *word_eol[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
hexchat_open_file (char *file, int flags, int mode, int xof_flags)
|
hexchat_open_file (const char *file, int flags, int mode, int xof_flags)
|
||||||
{
|
{
|
||||||
char *buf;
|
char *buf;
|
||||||
int fd;
|
int fd;
|
||||||
|
@@ -48,7 +48,7 @@ void list_loadconf (char *file, GSList ** list, char *defaultconf);
|
|||||||
int list_delentry (GSList ** list, char *name);
|
int list_delentry (GSList ** list, char *name);
|
||||||
void list_addentry (GSList ** list, char *cmd, char *name);
|
void list_addentry (GSList ** list, char *cmd, char *name);
|
||||||
int cmd_set (session *sess, char *tbuf, char *word[], char *word_eol[]);
|
int cmd_set (session *sess, char *tbuf, char *word[], char *word_eol[]);
|
||||||
int hexchat_open_file (char *file, int flags, int mode, int xof_flags);
|
int hexchat_open_file (const char *file, int flags, int mode, int xof_flags);
|
||||||
FILE *hexchat_fopen_file (const char *file, const char *mode, int xof_flags);
|
FILE *hexchat_fopen_file (const char *file, const char *mode, int xof_flags);
|
||||||
|
|
||||||
#define XOF_DOMODE 1
|
#define XOF_DOMODE 1
|
||||||
|
@@ -119,7 +119,7 @@ chanopt_command (session *sess, char *tbuf, char *word[], char *word_eol[])
|
|||||||
if (!quiet)
|
if (!quiet)
|
||||||
PrintTextf (sess, "\002Network\002: %s \002Channel\002: %s\n",
|
PrintTextf (sess, "\002Network\002: %s \002Channel\002: %s\n",
|
||||||
sess->server->network ? server_get_network (sess->server, TRUE) : _("<none>"),
|
sess->server->network ? server_get_network (sess->server, TRUE) : _("<none>"),
|
||||||
sess->channel[0] ? sess->channel : _("<none>"));
|
sess->session_name[0] ? sess->session_name : _("<none>"));
|
||||||
|
|
||||||
while (i < sizeof (chanopt) / sizeof (channel_options))
|
while (i < sizeof (chanopt) / sizeof (channel_options))
|
||||||
{
|
{
|
||||||
@@ -208,7 +208,7 @@ chanopt_find (char *network, char *channel, gboolean add_new)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* allocate a new one */
|
/* allocate a new one */
|
||||||
co = g_malloc0 (sizeof (chanopt_in_memory));
|
co = g_new0 (chanopt_in_memory, 1);
|
||||||
co->channel = g_strdup (channel);
|
co->channel = g_strdup (channel);
|
||||||
co->network = g_strdup (network);
|
co->network = g_strdup (network);
|
||||||
|
|
||||||
@@ -298,7 +298,7 @@ chanopt_load (session *sess)
|
|||||||
chanopt_in_memory *co;
|
chanopt_in_memory *co;
|
||||||
char *network;
|
char *network;
|
||||||
|
|
||||||
if (sess->channel[0] == 0)
|
if (sess->session_name[0] == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
network = server_get_network (sess->server, FALSE);
|
network = server_get_network (sess->server, FALSE);
|
||||||
@@ -311,7 +311,7 @@ chanopt_load (session *sess)
|
|||||||
chanopt_load_all ();
|
chanopt_load_all ();
|
||||||
}
|
}
|
||||||
|
|
||||||
co = chanopt_find (network, sess->channel, FALSE);
|
co = chanopt_find (network, sess->session_name, FALSE);
|
||||||
if (!co)
|
if (!co)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -334,7 +334,7 @@ chanopt_save (session *sess)
|
|||||||
chanopt_in_memory *co;
|
chanopt_in_memory *co;
|
||||||
char *network;
|
char *network;
|
||||||
|
|
||||||
if (sess->channel[0] == 0)
|
if (sess->session_name[0] == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
network = server_get_network (sess->server, FALSE);
|
network = server_get_network (sess->server, FALSE);
|
||||||
@@ -343,7 +343,7 @@ chanopt_save (session *sess)
|
|||||||
|
|
||||||
/* 2. reconcile sess with what we loaded from disk */
|
/* 2. reconcile sess with what we loaded from disk */
|
||||||
|
|
||||||
co = chanopt_find (network, sess->channel, TRUE);
|
co = chanopt_find (network, sess->session_name, TRUE);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i < sizeof (chanopt) / sizeof (channel_options))
|
while (i < sizeof (chanopt) / sizeof (channel_options))
|
||||||
@@ -368,10 +368,10 @@ chanopt_save_one_channel (chanopt_in_memory *co, int fh)
|
|||||||
char buf[256];
|
char buf[256];
|
||||||
guint8 val;
|
guint8 val;
|
||||||
|
|
||||||
snprintf (buf, sizeof (buf), "%s = %s\n", "network", co->network);
|
g_snprintf (buf, sizeof (buf), "%s = %s\n", "network", co->network);
|
||||||
write (fh, buf, strlen (buf));
|
write (fh, buf, strlen (buf));
|
||||||
|
|
||||||
snprintf (buf, sizeof (buf), "%s = %s\n", "channel", co->channel);
|
g_snprintf (buf, sizeof (buf), "%s = %s\n", "channel", co->channel);
|
||||||
write (fh, buf, strlen (buf));
|
write (fh, buf, strlen (buf));
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
@@ -380,7 +380,7 @@ chanopt_save_one_channel (chanopt_in_memory *co, int fh)
|
|||||||
val = G_STRUCT_MEMBER (guint8, co, chanopt[i].offset);
|
val = G_STRUCT_MEMBER (guint8, co, chanopt[i].offset);
|
||||||
if (val != SET_DEFAULT)
|
if (val != SET_DEFAULT)
|
||||||
{
|
{
|
||||||
snprintf (buf, sizeof (buf), "%s = %d\n", chanopt[i].name, val);
|
g_snprintf (buf, sizeof (buf), "%s = %d\n", chanopt[i].name, val);
|
||||||
write (fh, buf, strlen (buf));
|
write (fh, buf, strlen (buf));
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
|
@@ -20,16 +20,15 @@
|
|||||||
<ClInclude Include="dcc.h" />
|
<ClInclude Include="dcc.h" />
|
||||||
<ClInclude Include="fe.h" />
|
<ClInclude Include="fe.h" />
|
||||||
<ClInclude Include="history.h" />
|
<ClInclude Include="history.h" />
|
||||||
<ClInclude Include="identd.h" />
|
|
||||||
<ClInclude Include="ignore.h" />
|
<ClInclude Include="ignore.h" />
|
||||||
<ClInclude Include="inbound.h" />
|
<ClInclude Include="inbound.h" />
|
||||||
<ClInclude Include="inet.h" />
|
<ClInclude Include="inet.h" />
|
||||||
<ClInclude Include="marshal.h" />
|
<ClInclude Include="marshal.h" />
|
||||||
<ClInclude Include="modes.h" />
|
<ClInclude Include="modes.h" />
|
||||||
<ClInclude Include="msproxy.h" />
|
|
||||||
<ClInclude Include="network.h" />
|
<ClInclude Include="network.h" />
|
||||||
<ClInclude Include="notify.h" />
|
<ClInclude Include="notify.h" />
|
||||||
<ClInclude Include="outbound.h" />
|
<ClInclude Include="outbound.h" />
|
||||||
|
<ClInclude Include="plugin-identd.h" />
|
||||||
<ClInclude Include="plugin-timer.h" />
|
<ClInclude Include="plugin-timer.h" />
|
||||||
<ClInclude Include="plugin.h" />
|
<ClInclude Include="plugin.h" />
|
||||||
<ClInclude Include="proto-irc.h" />
|
<ClInclude Include="proto-irc.h" />
|
||||||
@@ -54,12 +53,11 @@
|
|||||||
<ClCompile Include="ctcp.c" />
|
<ClCompile Include="ctcp.c" />
|
||||||
<ClCompile Include="dcc.c" />
|
<ClCompile Include="dcc.c" />
|
||||||
<ClCompile Include="history.c" />
|
<ClCompile Include="history.c" />
|
||||||
<ClCompile Include="identd.c" />
|
<ClCompile Include="plugin-identd.c" />
|
||||||
<ClCompile Include="ignore.c" />
|
<ClCompile Include="ignore.c" />
|
||||||
<ClCompile Include="inbound.c" />
|
<ClCompile Include="inbound.c" />
|
||||||
<ClCompile Include="marshal.c" />
|
<ClCompile Include="marshal.c" />
|
||||||
<ClCompile Include="modes.c" />
|
<ClCompile Include="modes.c" />
|
||||||
<ClCompile Include="msproxy.c" />
|
|
||||||
<ClCompile Include="network.c" />
|
<ClCompile Include="network.c" />
|
||||||
<ClCompile Include="notify.c" />
|
<ClCompile Include="notify.c" />
|
||||||
<ClCompile Include="outbound.c" />
|
<ClCompile Include="outbound.c" />
|
||||||
@@ -77,8 +75,8 @@
|
|||||||
<ClCompile Include="hexchat.c" />
|
<ClCompile Include="hexchat.c" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="..\..\config-win32.h.tt" />
|
<None Include="..\..\win32\config.h.tt" />
|
||||||
<ClInclude Include="..\..\config-win32.h" />
|
<ClInclude Include="..\..\config.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<ProjectGuid>{87554B59-006C-4D94-9714-897B27067BA3}</ProjectGuid>
|
<ProjectGuid>{87554B59-006C-4D94-9714-897B27067BA3}</ProjectGuid>
|
||||||
@@ -125,7 +123,7 @@
|
|||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir)..;$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
@@ -142,7 +140,7 @@
|
|||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir)..;$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<DisableSpecificWarnings>4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@@ -160,7 +158,7 @@
|
|||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command><![CDATA[
|
<Command><![CDATA[
|
||||||
SET SOLUTIONDIR=$(SolutionDir)..\
|
SET SOLUTIONDIR=$(SolutionDir)..\
|
||||||
powershell -File "$(SolutionDir)..\version-template.ps1" "$(SolutionDir)..\config-win32.h.tt" "$(SolutionDir)..\config-win32.h"
|
powershell -File "$(SolutionDir)..\win32\version-template.ps1" "$(SolutionDir)..\win32\config.h.tt" "$(SolutionDir)..\config.h"
|
||||||
"$(DepsRoot)\bin\glib-genmarshal.exe" --prefix=_hexchat_marshal --header "$(ProjectDir)marshalers.list" > "$(ProjectDir)marshal.h"
|
"$(DepsRoot)\bin\glib-genmarshal.exe" --prefix=_hexchat_marshal --header "$(ProjectDir)marshalers.list" > "$(ProjectDir)marshal.h"
|
||||||
"$(DepsRoot)\bin\glib-genmarshal.exe" --prefix=_hexchat_marshal --body "$(ProjectDir)marshalers.list" > "$(ProjectDir)marshal.c"
|
"$(DepsRoot)\bin\glib-genmarshal.exe" --prefix=_hexchat_marshal --body "$(ProjectDir)marshalers.list" > "$(ProjectDir)marshal.c"
|
||||||
|
|
||||||
|
@@ -29,9 +29,6 @@
|
|||||||
<ClInclude Include="history.h">
|
<ClInclude Include="history.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="identd.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ignore.h">
|
<ClInclude Include="ignore.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@@ -44,9 +41,6 @@
|
|||||||
<ClInclude Include="modes.h">
|
<ClInclude Include="modes.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="msproxy.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="network.h">
|
<ClInclude Include="network.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@@ -104,7 +98,7 @@
|
|||||||
<ClInclude Include="hexchat-plugin.h">
|
<ClInclude Include="hexchat-plugin.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\config-win32.h">
|
<ClInclude Include="..\..\config.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="typedef.h">
|
<ClInclude Include="typedef.h">
|
||||||
@@ -113,6 +107,9 @@
|
|||||||
<ClInclude Include="marshal.h">
|
<ClInclude Include="marshal.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="plugin-identd.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="cfgfiles.c">
|
<ClCompile Include="cfgfiles.c">
|
||||||
@@ -130,9 +127,6 @@
|
|||||||
<ClCompile Include="history.c">
|
<ClCompile Include="history.c">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="identd.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ignore.c">
|
<ClCompile Include="ignore.c">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@@ -142,9 +136,6 @@
|
|||||||
<ClCompile Include="modes.c">
|
<ClCompile Include="modes.c">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="msproxy.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="network.c">
|
<ClCompile Include="network.c">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@@ -193,8 +184,11 @@
|
|||||||
<ClCompile Include="marshal.c">
|
<ClCompile Include="marshal.c">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="plugin-identd.c">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="..\..\config-win32.h.tt" />
|
<None Include="..\..\win32\config.h.tt" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
@@ -44,12 +44,12 @@ ctcp_reply (session *sess, char *nick, char *word[], char *word_eol[],
|
|||||||
{
|
{
|
||||||
char tbuf[4096]; /* can receive 2048 from IRC, so this is enough */
|
char tbuf[4096]; /* can receive 2048 from IRC, so this is enough */
|
||||||
|
|
||||||
conf = strdup (conf);
|
conf = g_strdup (conf);
|
||||||
/* process %C %B etc */
|
/* process %C %B etc */
|
||||||
check_special_chars (conf, TRUE);
|
check_special_chars (conf, TRUE);
|
||||||
auto_insert (tbuf, sizeof (tbuf), conf, word, word_eol, "", "", word_eol[5],
|
auto_insert (tbuf, sizeof (tbuf), conf, word, word_eol, "", "", word_eol[5],
|
||||||
server_get_network (sess->server, TRUE), "", "", nick, "");
|
server_get_network (sess->server, TRUE), "", "", nick, "");
|
||||||
free (conf);
|
g_free (conf);
|
||||||
handle_command (sess, tbuf, FALSE);
|
handle_command (sess, tbuf, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,10 +139,10 @@ ctcp_handle (session *sess, char *to, char *nick, char *ip,
|
|||||||
if (!g_ascii_strcasecmp (msg, "VERSION") && !prefs.hex_irc_hide_version)
|
if (!g_ascii_strcasecmp (msg, "VERSION") && !prefs.hex_irc_hide_version)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
snprintf (outbuf, sizeof (outbuf), "VERSION HexChat "PACKAGE_VERSION" [x%d] / %s",
|
g_snprintf (outbuf, sizeof (outbuf), "VERSION HexChat "PACKAGE_VERSION" [x%d] / %s",
|
||||||
get_cpu_arch (), get_sys_str (1));
|
get_cpu_arch (), get_sys_str (1));
|
||||||
#else
|
#else
|
||||||
snprintf (outbuf, sizeof (outbuf), "VERSION HexChat "PACKAGE_VERSION" / %s",
|
g_snprintf (outbuf, sizeof (outbuf), "VERSION HexChat "PACKAGE_VERSION" / %s",
|
||||||
get_sys_str (1));
|
get_sys_str (1));
|
||||||
#endif
|
#endif
|
||||||
serv->p_nctcp (serv, nick, outbuf);
|
serv->p_nctcp (serv, nick, outbuf);
|
||||||
|
@@ -15,7 +15,7 @@ BUILT_SOURCES = \
|
|||||||
|
|
||||||
CLEANFILES = $(BUILT_SOURCES)
|
CLEANFILES = $(BUILT_SOURCES)
|
||||||
|
|
||||||
AM_CPPFLAGS = $(COMMON_CFLAGS) $(DBUS_CFLAGS)
|
AM_CPPFLAGS = $(COMMON_CFLAGS) $(DBUS_CFLAGS) -I$(top_srcdir)/src/common
|
||||||
|
|
||||||
noinst_PROGRAMS = example
|
noinst_PROGRAMS = example
|
||||||
example_SOURCES = example.c
|
example_SOURCES = example.c
|
||||||
|
@@ -19,11 +19,13 @@
|
|||||||
* xclaesse@gmail.com
|
* xclaesse@gmail.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||||
#include <dbus/dbus-glib.h>
|
#include <dbus/dbus-glib.h>
|
||||||
#include "dbus-client.h"
|
#include "dbus-client.h"
|
||||||
#include "../hexchat.h"
|
#include "hexchat.h"
|
||||||
#include "../hexchatc.h"
|
#include "hexchatc.h"
|
||||||
|
|
||||||
#define DBUS_SERVICE "org.hexchat.service"
|
#define DBUS_SERVICE "org.hexchat.service"
|
||||||
#define DBUS_REMOTE "/org/hexchat/Remote"
|
#define DBUS_REMOTE "/org/hexchat/Remote"
|
||||||
@@ -91,7 +93,7 @@ hexchat_remote (void)
|
|||||||
g_object_unref (dbus);
|
g_object_unref (dbus);
|
||||||
|
|
||||||
if (!hexchat_running) {
|
if (!hexchat_running) {
|
||||||
//dbus_g_connection_unref (connection);
|
/* dbus_g_connection_unref (connection); */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,7 +25,8 @@
|
|||||||
#include <dbus/dbus-glib.h>
|
#include <dbus/dbus-glib.h>
|
||||||
#include <dbus/dbus-glib-lowlevel.h>
|
#include <dbus/dbus-glib-lowlevel.h>
|
||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
#include "../hexchat-plugin.h"
|
#include "hexchat-plugin.h"
|
||||||
|
#include "dbus-plugin.h"
|
||||||
|
|
||||||
#define PNAME _("remote access")
|
#define PNAME _("remote access")
|
||||||
#define PDESC _("plugin for remote access using DBUS")
|
#define PDESC _("plugin for remote access using DBUS")
|
||||||
|
@@ -33,7 +33,7 @@ guint command_id;
|
|||||||
guint server_id;
|
guint server_id;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
write_error (char *message,
|
write_error (const char *message,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
if (error == NULL || *error == NULL) {
|
if (error == NULL || *error == NULL) {
|
||||||
|
592
src/common/dcc.c
592
src/common/dcc.c
File diff suppressed because it is too large
Load Diff
@@ -39,17 +39,6 @@
|
|||||||
|
|
||||||
#define CPS_AVG_WINDOW 10
|
#define CPS_AVG_WINDOW 10
|
||||||
|
|
||||||
/* can we do 64-bit dcc? */
|
|
||||||
#if defined(G_GINT64_FORMAT) && defined(HAVE_STRTOULL)
|
|
||||||
#define USE_DCC64
|
|
||||||
/* we really get only 63 bits, since st_size is signed */
|
|
||||||
#define DCC_SIZE gint64
|
|
||||||
#define DCC_SFMT G_GINT64_FORMAT
|
|
||||||
#else
|
|
||||||
#define DCC_SIZE unsigned int
|
|
||||||
#define DCC_SFMT "u"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct DCC
|
struct DCC
|
||||||
{
|
{
|
||||||
struct server *serv;
|
struct server *serv;
|
||||||
@@ -62,21 +51,21 @@ struct DCC
|
|||||||
int wiotag; /* writing/sending io tag */
|
int wiotag; /* writing/sending io tag */
|
||||||
int port;
|
int port;
|
||||||
int pasvid; /* mIRC's passive DCC id */
|
int pasvid; /* mIRC's passive DCC id */
|
||||||
int cps;
|
gint64 cps;
|
||||||
int resume_error;
|
int resume_error;
|
||||||
int resume_errno;
|
int resume_errno;
|
||||||
|
|
||||||
GTimeVal lastcpstv, firstcpstv;
|
GTimeVal lastcpstv, firstcpstv;
|
||||||
DCC_SIZE lastcpspos;
|
goffset lastcpspos;
|
||||||
int maxcps;
|
gint64 maxcps;
|
||||||
|
|
||||||
unsigned char ack_buf[4]; /* buffer for reading 4-byte ack */
|
unsigned char ack_buf[4]; /* buffer for reading 4-byte ack */
|
||||||
int ack_pos;
|
int ack_pos;
|
||||||
|
|
||||||
DCC_SIZE size;
|
guint64 size;
|
||||||
DCC_SIZE resumable;
|
guint64 resumable;
|
||||||
DCC_SIZE ack;
|
guint64 ack;
|
||||||
DCC_SIZE pos;
|
guint64 pos;
|
||||||
time_t starttime;
|
time_t starttime;
|
||||||
time_t offertime;
|
time_t offertime;
|
||||||
time_t lasttime;
|
time_t lasttime;
|
||||||
@@ -125,7 +114,7 @@ void dcc_check_timeouts (void);
|
|||||||
void dcc_change_nick (server *serv, char *oldnick, char *newnick);
|
void dcc_change_nick (server *serv, char *oldnick, char *newnick);
|
||||||
void dcc_notify_kill (struct server *serv);
|
void dcc_notify_kill (struct server *serv);
|
||||||
struct DCC *dcc_write_chat (char *nick, char *text);
|
struct DCC *dcc_write_chat (char *nick, char *text);
|
||||||
void dcc_send (struct session *sess, char *to, char *file, int maxcps, int passive);
|
void dcc_send (struct session *sess, char *to, char *file, gint64 maxcps, int passive);
|
||||||
struct DCC *find_dcc (char *nick, char *file, int type);
|
struct DCC *find_dcc (char *nick, char *file, int type);
|
||||||
void dcc_get_nick (struct session *sess, char *nick);
|
void dcc_get_nick (struct session *sess, char *nick);
|
||||||
void dcc_chat (session *sess, char *nick, int passive);
|
void dcc_chat (session *sess, char *nick, int passive);
|
||||||
@@ -134,5 +123,6 @@ void handle_dcc (session *sess, char *nick, char *word[], char *word_eol[],
|
|||||||
void dcc_show_list (session *sess);
|
void dcc_show_list (session *sess);
|
||||||
guint32 dcc_get_my_address (void);
|
guint32 dcc_get_my_address (void);
|
||||||
void dcc_get_with_destfile (struct DCC *dcc, char *utf8file);
|
void dcc_get_with_destfile (struct DCC *dcc, char *utf8file);
|
||||||
|
char *net_ip (guint32 addr);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -88,11 +88,10 @@ void fe_progressbar_start (struct session *sess);
|
|||||||
void fe_progressbar_end (struct server *serv);
|
void fe_progressbar_end (struct server *serv);
|
||||||
void fe_print_text (struct session *sess, char *text, time_t stamp,
|
void fe_print_text (struct session *sess, char *text, time_t stamp,
|
||||||
gboolean no_activity);
|
gboolean no_activity);
|
||||||
void fe_userlist_insert (struct session *sess, struct User *newuser, int row, int sel);
|
void fe_userlist_insert (struct session *sess, struct User *newuser, gboolean sel);
|
||||||
int fe_userlist_remove (struct session *sess, struct User *user);
|
int fe_userlist_remove (struct session *sess, struct User *user);
|
||||||
void fe_userlist_rehash (struct session *sess, struct User *user);
|
void fe_userlist_rehash (struct session *sess, struct User *user);
|
||||||
void fe_userlist_update (struct session *sess, struct User *user);
|
void fe_userlist_update (struct session *sess, struct User *user);
|
||||||
void fe_userlist_move (struct session *sess, struct User *user, int new_row);
|
|
||||||
void fe_userlist_numbers (struct session *sess);
|
void fe_userlist_numbers (struct session *sess);
|
||||||
void fe_userlist_clear (struct session *sess);
|
void fe_userlist_clear (struct session *sess);
|
||||||
void fe_userlist_set_selected (struct session *sess);
|
void fe_userlist_set_selected (struct session *sess);
|
||||||
|
@@ -88,11 +88,19 @@ struct _hexchat_plugin
|
|||||||
void (*hexchat_print) (hexchat_plugin *ph,
|
void (*hexchat_print) (hexchat_plugin *ph,
|
||||||
const char *text);
|
const char *text);
|
||||||
void (*hexchat_printf) (hexchat_plugin *ph,
|
void (*hexchat_printf) (hexchat_plugin *ph,
|
||||||
const char *format, ...);
|
const char *format, ...)
|
||||||
|
#ifdef __GNUC__
|
||||||
|
__attribute__((format(printf, 2, 3)))
|
||||||
|
#endif
|
||||||
|
;
|
||||||
void (*hexchat_command) (hexchat_plugin *ph,
|
void (*hexchat_command) (hexchat_plugin *ph,
|
||||||
const char *command);
|
const char *command);
|
||||||
void (*hexchat_commandf) (hexchat_plugin *ph,
|
void (*hexchat_commandf) (hexchat_plugin *ph,
|
||||||
const char *format, ...);
|
const char *format, ...)
|
||||||
|
#ifdef __GNUC__
|
||||||
|
__attribute__((format(printf, 2, 3)))
|
||||||
|
#endif
|
||||||
|
;
|
||||||
int (*hexchat_nickcmp) (hexchat_plugin *ph,
|
int (*hexchat_nickcmp) (hexchat_plugin *ph,
|
||||||
const char *s1,
|
const char *s1,
|
||||||
const char *s2);
|
const char *s2);
|
||||||
@@ -254,7 +262,11 @@ hexchat_print (hexchat_plugin *ph,
|
|||||||
|
|
||||||
void
|
void
|
||||||
hexchat_printf (hexchat_plugin *ph,
|
hexchat_printf (hexchat_plugin *ph,
|
||||||
const char *format, ...);
|
const char *format, ...)
|
||||||
|
#ifdef __GNUC__
|
||||||
|
__attribute__((format(printf, 2, 3)))
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
|
||||||
void
|
void
|
||||||
hexchat_command (hexchat_plugin *ph,
|
hexchat_command (hexchat_plugin *ph,
|
||||||
@@ -262,7 +274,11 @@ hexchat_command (hexchat_plugin *ph,
|
|||||||
|
|
||||||
void
|
void
|
||||||
hexchat_commandf (hexchat_plugin *ph,
|
hexchat_commandf (hexchat_plugin *ph,
|
||||||
const char *format, ...);
|
const char *format, ...)
|
||||||
|
#ifdef __GNUC__
|
||||||
|
__attribute__((format(printf, 2, 3)))
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
|
||||||
int
|
int
|
||||||
hexchat_nickcmp (hexchat_plugin *ph,
|
hexchat_nickcmp (hexchat_plugin *ph,
|
||||||
|
@@ -42,6 +42,7 @@
|
|||||||
#include "ignore.h"
|
#include "ignore.h"
|
||||||
#include "hexchat-plugin.h"
|
#include "hexchat-plugin.h"
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
#include "plugin-identd.h"
|
||||||
#include "plugin-timer.h"
|
#include "plugin-timer.h"
|
||||||
#include "notify.h"
|
#include "notify.h"
|
||||||
#include "server.h"
|
#include "server.h"
|
||||||
@@ -55,19 +56,6 @@
|
|||||||
#include <glib-object.h> /* for g_type_init() */
|
#include <glib-object.h> /* for g_type_init() */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_OPENSSL
|
|
||||||
#include <openssl/ssl.h> /* SSL_() */
|
|
||||||
#include "ssl.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_MSPROXY
|
|
||||||
#include "msproxy.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_LIBPROXY
|
|
||||||
#include <proxy.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
GSList *popup_list = 0;
|
GSList *popup_list = 0;
|
||||||
GSList *button_list = 0;
|
GSList *button_list = 0;
|
||||||
GSList *dlgbutton_list = 0;
|
GSList *dlgbutton_list = 0;
|
||||||
@@ -118,14 +106,6 @@ struct session *current_tab;
|
|||||||
struct session *current_sess = 0;
|
struct session *current_sess = 0;
|
||||||
struct hexchatprefs prefs;
|
struct hexchatprefs prefs;
|
||||||
|
|
||||||
#ifdef USE_OPENSSL
|
|
||||||
SSL_CTX *ctx = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_LIBPROXY
|
|
||||||
pxProxyFactory *libproxy_factory;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Update the priority queue of the "interesting sessions"
|
* Update the priority queue of the "interesting sessions"
|
||||||
* (sess_list_by_lastact).
|
* (sess_list_by_lastact).
|
||||||
@@ -221,7 +201,7 @@ find_dialog (server *serv, char *nick)
|
|||||||
}
|
}
|
||||||
list = list->next;
|
list = list->next;
|
||||||
}
|
}
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
session *
|
session *
|
||||||
@@ -232,14 +212,14 @@ find_channel (server *serv, char *chan)
|
|||||||
while (list)
|
while (list)
|
||||||
{
|
{
|
||||||
sess = list->data;
|
sess = list->data;
|
||||||
if ((!serv || serv == sess->server) && sess->type == SESS_CHANNEL)
|
if ((serv == sess->server) && sess->type == SESS_CHANNEL)
|
||||||
{
|
{
|
||||||
if (!serv->p_cmp (chan, sess->channel))
|
if (!serv->p_cmp (chan, sess->channel))
|
||||||
return sess;
|
return sess;
|
||||||
}
|
}
|
||||||
list = list->next;
|
list = list->next;
|
||||||
}
|
}
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -269,7 +249,7 @@ lag_check (void)
|
|||||||
unsigned long tim;
|
unsigned long tim;
|
||||||
char tbuf[128];
|
char tbuf[128];
|
||||||
time_t now = time (0);
|
time_t now = time (0);
|
||||||
int lag;
|
time_t lag;
|
||||||
|
|
||||||
tim = make_ping_time ();
|
tim = make_ping_time ();
|
||||||
|
|
||||||
@@ -279,16 +259,17 @@ lag_check (void)
|
|||||||
if (serv->connected && serv->end_of_motd)
|
if (serv->connected && serv->end_of_motd)
|
||||||
{
|
{
|
||||||
lag = now - serv->ping_recv;
|
lag = now - serv->ping_recv;
|
||||||
if (prefs.hex_net_ping_timeout && lag > prefs.hex_net_ping_timeout && lag > 0)
|
if (prefs.hex_net_ping_timeout != 0 && lag > prefs.hex_net_ping_timeout && lag > 0)
|
||||||
{
|
{
|
||||||
sprintf (tbuf, "%d", lag);
|
sprintf (tbuf, "%" G_GINT64_FORMAT, (gint64) lag);
|
||||||
EMIT_SIGNAL (XP_TE_PINGTIMEOUT, serv->server_session, tbuf, NULL,
|
EMIT_SIGNAL (XP_TE_PINGTIMEOUT, serv->server_session, tbuf, NULL,
|
||||||
NULL, NULL, 0);
|
NULL, NULL, 0);
|
||||||
if (prefs.hex_net_auto_reconnect)
|
if (prefs.hex_net_auto_reconnect)
|
||||||
serv->auto_reconnect (serv, FALSE, -1);
|
serv->auto_reconnect (serv, FALSE, -1);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
snprintf (tbuf, sizeof (tbuf), "LAG%lu", tim);
|
g_snprintf (tbuf, sizeof (tbuf), "LAG%lu", tim);
|
||||||
serv->p_ping (serv, "", tbuf);
|
serv->p_ping (serv, "", tbuf);
|
||||||
|
|
||||||
if (!serv->lag_sent)
|
if (!serv->lag_sent)
|
||||||
@@ -368,9 +349,6 @@ static int
|
|||||||
hexchat_misc_checks (void) /* this gets called every 1/2 second */
|
hexchat_misc_checks (void) /* this gets called every 1/2 second */
|
||||||
{
|
{
|
||||||
static int count = 0;
|
static int count = 0;
|
||||||
#ifdef USE_MSPROXY
|
|
||||||
static int count2 = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
|
|
||||||
@@ -386,15 +364,6 @@ hexchat_misc_checks (void) /* this gets called every 1/2 second */
|
|||||||
count = 0;
|
count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_MSPROXY
|
|
||||||
count2++;
|
|
||||||
if (count2 >= 720) /* 720 every 6 minutes */
|
|
||||||
{
|
|
||||||
msproxy_keepalive ();
|
|
||||||
count2 = 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -405,7 +374,6 @@ irc_init (session *sess)
|
|||||||
{
|
{
|
||||||
static int done_init = FALSE;
|
static int done_init = FALSE;
|
||||||
char *buf;
|
char *buf;
|
||||||
int i;
|
|
||||||
|
|
||||||
if (done_init)
|
if (done_init)
|
||||||
return;
|
return;
|
||||||
@@ -413,6 +381,7 @@ irc_init (session *sess)
|
|||||||
done_init = TRUE;
|
done_init = TRUE;
|
||||||
|
|
||||||
plugin_add (sess, NULL, NULL, timer_plugin_init, NULL, NULL, FALSE);
|
plugin_add (sess, NULL, NULL, timer_plugin_init, NULL, NULL, FALSE);
|
||||||
|
plugin_add (sess, NULL, NULL, identd_plugin_init, identd_plugin_deinit, NULL, FALSE);
|
||||||
|
|
||||||
#ifdef USE_PLUGIN
|
#ifdef USE_PLUGIN
|
||||||
if (!arg_skip_plugins)
|
if (!arg_skip_plugins)
|
||||||
@@ -440,7 +409,8 @@ irc_init (session *sess)
|
|||||||
|
|
||||||
if (arg_urls != NULL)
|
if (arg_urls != NULL)
|
||||||
{
|
{
|
||||||
for (i = 0; i < g_strv_length(arg_urls); i++)
|
guint i;
|
||||||
|
for (i = 0; i < g_strv_length (arg_urls); i++)
|
||||||
{
|
{
|
||||||
buf = g_strdup_printf ("%s %s", i==0? "server" : "newserver", arg_urls[i]);
|
buf = g_strdup_printf ("%s %s", i==0? "server" : "newserver", arg_urls[i]);
|
||||||
handle_command (sess, buf, FALSE);
|
handle_command (sess, buf, FALSE);
|
||||||
@@ -464,12 +434,7 @@ session_new (server *serv, char *from, int type, int focus)
|
|||||||
{
|
{
|
||||||
session *sess;
|
session *sess;
|
||||||
|
|
||||||
sess = malloc (sizeof (struct session));
|
sess = g_new0 (struct session, 1);
|
||||||
if (sess == NULL)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
memset (sess, 0, sizeof (struct session));
|
|
||||||
|
|
||||||
sess->server = serv;
|
sess->server = serv;
|
||||||
sess->logfd = -1;
|
sess->logfd = -1;
|
||||||
@@ -488,7 +453,10 @@ session_new (server *serv, char *from, int type, int focus)
|
|||||||
sess->lastact_idx = LACT_NONE;
|
sess->lastact_idx = LACT_NONE;
|
||||||
|
|
||||||
if (from != NULL)
|
if (from != NULL)
|
||||||
safe_strcpy (sess->channel, from, CHANLEN);
|
{
|
||||||
|
safe_strcpy(sess->channel, from, CHANLEN);
|
||||||
|
safe_strcpy(sess->session_name, from, CHANLEN);
|
||||||
|
}
|
||||||
|
|
||||||
sess_list = g_slist_prepend (sess_list, sess);
|
sess_list = g_slist_prepend (sess_list, sess);
|
||||||
|
|
||||||
@@ -548,9 +516,8 @@ exec_notify_kill (session * sess)
|
|||||||
waitpid (re->childpid, NULL, WNOHANG);
|
waitpid (re->childpid, NULL, WNOHANG);
|
||||||
fe_input_remove (re->iotag);
|
fe_input_remove (re->iotag);
|
||||||
close (re->myfd);
|
close (re->myfd);
|
||||||
if (re->linebuf)
|
g_free(re->linebuf);
|
||||||
free(re->linebuf);
|
g_free (re);
|
||||||
free (re);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -656,10 +623,8 @@ session_free (session *killsess)
|
|||||||
send_quit_or_part (killsess);
|
send_quit_or_part (killsess);
|
||||||
|
|
||||||
history_free (&killsess->history);
|
history_free (&killsess->history);
|
||||||
if (killsess->topic)
|
g_free (killsess->topic);
|
||||||
free (killsess->topic);
|
g_free (killsess->current_modes);
|
||||||
if (killsess->current_modes)
|
|
||||||
free (killsess->current_modes);
|
|
||||||
|
|
||||||
fe_session_callback (killsess);
|
fe_session_callback (killsess);
|
||||||
|
|
||||||
@@ -670,7 +635,7 @@ session_free (session *killsess)
|
|||||||
current_sess = sess_list->data;
|
current_sess = sess_list->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
free (killsess);
|
g_free (killsess);
|
||||||
|
|
||||||
if (!sess_list && !in_hexchat_exit)
|
if (!sess_list && !in_hexchat_exit)
|
||||||
hexchat_exit (); /* sess_list is empty, quit! */
|
hexchat_exit (); /* sess_list is empty, quit! */
|
||||||
@@ -789,15 +754,11 @@ xchat_init (void)
|
|||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
WSADATA wsadata;
|
WSADATA wsadata;
|
||||||
|
|
||||||
#ifdef USE_IPV6
|
|
||||||
if (WSAStartup(0x0202, &wsadata) != 0)
|
if (WSAStartup(0x0202, &wsadata) != 0)
|
||||||
{
|
{
|
||||||
MessageBox (NULL, "Cannot find winsock 2.2+", "Error", MB_OK);
|
MessageBox (NULL, "Cannot find winsock 2.2+", "Error", MB_OK);
|
||||||
exit (0);
|
exit (0);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
WSAStartup(0x0101, &wsadata);
|
|
||||||
#endif /* !USE_IPV6 */
|
|
||||||
#endif /* !WIN32 */
|
#endif /* !WIN32 */
|
||||||
|
|
||||||
#ifdef USE_SIGACTION
|
#ifdef USE_SIGACTION
|
||||||
@@ -834,7 +795,7 @@ xchat_init (void)
|
|||||||
notify_load ();
|
notify_load ();
|
||||||
ignore_load ();
|
ignore_load ();
|
||||||
|
|
||||||
snprintf (buf, sizeof (buf),
|
g_snprintf (buf, sizeof (buf),
|
||||||
"NAME %s~%s~\n" "CMD query %%s\n\n"\
|
"NAME %s~%s~\n" "CMD query %%s\n\n"\
|
||||||
"NAME %s~%s~\n" "CMD send %%s\n\n"\
|
"NAME %s~%s~\n" "CMD send %%s\n\n"\
|
||||||
"NAME %s~%s~\n" "CMD whois %%s %%s\n\n"\
|
"NAME %s~%s~\n" "CMD whois %%s %%s\n\n"\
|
||||||
@@ -890,7 +851,7 @@ xchat_init (void)
|
|||||||
|
|
||||||
list_loadconf ("popup.conf", &popup_list, buf);
|
list_loadconf ("popup.conf", &popup_list, buf);
|
||||||
|
|
||||||
snprintf (buf, sizeof (buf),
|
g_snprintf (buf, sizeof (buf),
|
||||||
"NAME %s\n" "CMD part\n\n"
|
"NAME %s\n" "CMD part\n\n"
|
||||||
"NAME %s\n" "CMD getstr # join \"%s\"\n\n"
|
"NAME %s\n" "CMD getstr # join \"%s\"\n\n"
|
||||||
"NAME %s\n" "CMD quote LINKS\n\n"
|
"NAME %s\n" "CMD quote LINKS\n\n"
|
||||||
@@ -904,7 +865,7 @@ xchat_init (void)
|
|||||||
_("Hide Version"));
|
_("Hide Version"));
|
||||||
list_loadconf ("usermenu.conf", &usermenu_list, buf);
|
list_loadconf ("usermenu.conf", &usermenu_list, buf);
|
||||||
|
|
||||||
snprintf (buf, sizeof (buf),
|
g_snprintf (buf, sizeof (buf),
|
||||||
"NAME %s\n" "CMD op %%a\n\n"
|
"NAME %s\n" "CMD op %%a\n\n"
|
||||||
"NAME %s\n" "CMD deop %%a\n\n"
|
"NAME %s\n" "CMD deop %%a\n\n"
|
||||||
"NAME %s\n" "CMD ban %%s\n\n"
|
"NAME %s\n" "CMD ban %%s\n\n"
|
||||||
@@ -921,7 +882,7 @@ xchat_init (void)
|
|||||||
_("Dialog"));
|
_("Dialog"));
|
||||||
list_loadconf ("buttons.conf", &button_list, buf);
|
list_loadconf ("buttons.conf", &button_list, buf);
|
||||||
|
|
||||||
snprintf (buf, sizeof (buf),
|
g_snprintf (buf, sizeof (buf),
|
||||||
"NAME %s\n" "CMD whois %%s %%s\n\n"
|
"NAME %s\n" "CMD whois %%s %%s\n\n"
|
||||||
"NAME %s\n" "CMD send %%s\n\n"
|
"NAME %s\n" "CMD send %%s\n\n"
|
||||||
"NAME %s\n" "CMD dcc chat %%s\n\n"
|
"NAME %s\n" "CMD dcc chat %%s\n\n"
|
||||||
@@ -991,47 +952,12 @@ hexchat_exit (void)
|
|||||||
fe_exit ();
|
fe_exit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
|
|
||||||
static int
|
|
||||||
child_handler (gpointer userdata)
|
|
||||||
{
|
|
||||||
int pid = GPOINTER_TO_INT (userdata);
|
|
||||||
|
|
||||||
if (waitpid (pid, 0, WNOHANG) == pid)
|
|
||||||
return 0; /* remove timeout handler */
|
|
||||||
return 1; /* keep the timeout handler */
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
void
|
||||||
hexchat_exec (const char *cmd)
|
hexchat_exec (const char *cmd)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
|
||||||
util_exec (cmd);
|
util_exec (cmd);
|
||||||
#else
|
|
||||||
int pid = util_exec (cmd);
|
|
||||||
if (pid != -1)
|
|
||||||
/* zombie avoiding system. Don't ask! it has to be like this to work
|
|
||||||
with zvt (which overrides the default handler) */
|
|
||||||
fe_timeout_add (1000, child_handler, GINT_TO_POINTER (pid));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
hexchat_execv (char * const argv[])
|
|
||||||
{
|
|
||||||
#ifdef WIN32
|
|
||||||
util_execv (argv);
|
|
||||||
#else
|
|
||||||
int pid = util_execv (argv);
|
|
||||||
if (pid != -1)
|
|
||||||
/* zombie avoiding system. Don't ask! it has to be like this to work
|
|
||||||
with zvt (which overrides the default handler) */
|
|
||||||
fe_timeout_add (1000, child_handler, GINT_TO_POINTER (pid));
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_locale (void)
|
set_locale (void)
|
||||||
@@ -1056,29 +982,33 @@ main (int argc, char *argv[])
|
|||||||
int i;
|
int i;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
srand (time (0)); /* CL: do this only once! */
|
srand ((unsigned int) time (NULL)); /* CL: do this only once! */
|
||||||
|
|
||||||
/* We must check for the config dir parameter, otherwise load_config() will behave incorrectly.
|
/* We must check for the config dir parameter, otherwise load_config() will behave incorrectly.
|
||||||
* load_config() must come before fe_args() because fe_args() calls gtk_init() which needs to
|
* load_config() must come before fe_args() because fe_args() calls gtk_init() which needs to
|
||||||
* know the language which is set in the config. The code below is copy-pasted from fe_args()
|
* know the language which is set in the config. The code below is copy-pasted from fe_args()
|
||||||
* for the most part. */
|
* for the most part. */
|
||||||
if (argc >= 3)
|
if (argc >= 2)
|
||||||
{
|
{
|
||||||
for (i = 1; i < argc - 1; i++)
|
for (i = 1; i < argc; i++)
|
||||||
{
|
{
|
||||||
if (strcmp (argv[i], "-d") == 0)
|
if ((strcmp (argv[i], "-d") == 0 || strcmp (argv[i], "--cfgdir") == 0)
|
||||||
|
&& i + 1 < argc)
|
||||||
{
|
{
|
||||||
if (xdir)
|
xdir = g_strdup (argv[i + 1]);
|
||||||
{
|
}
|
||||||
g_free (xdir);
|
else if (strncmp (argv[i], "--cfgdir=", 9) == 0)
|
||||||
}
|
{
|
||||||
|
xdir = g_strdup (argv[i] + 9);
|
||||||
xdir = strdup (argv[i + 1]);
|
}
|
||||||
|
|
||||||
|
if (xdir != NULL)
|
||||||
|
{
|
||||||
if (xdir[strlen (xdir) - 1] == G_DIR_SEPARATOR)
|
if (xdir[strlen (xdir) - 1] == G_DIR_SEPARATOR)
|
||||||
{
|
{
|
||||||
xdir[strlen (xdir) - 1] = 0;
|
xdir[strlen (xdir) - 1] = 0;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1102,10 +1032,6 @@ main (int argc, char *argv[])
|
|||||||
/* we MUST do this after load_config () AND before fe_init (thus gtk_init) otherwise it will fail */
|
/* we MUST do this after load_config () AND before fe_init (thus gtk_init) otherwise it will fail */
|
||||||
set_locale ();
|
set_locale ();
|
||||||
|
|
||||||
#ifdef SOCKS
|
|
||||||
SOCKSinit (argv[0]);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ret = fe_args (argc, argv);
|
ret = fe_args (argc, argv);
|
||||||
if (ret != -1)
|
if (ret != -1)
|
||||||
return ret;
|
return ret;
|
||||||
@@ -1114,10 +1040,6 @@ main (int argc, char *argv[])
|
|||||||
hexchat_remote ();
|
hexchat_remote ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_LIBPROXY
|
|
||||||
libproxy_factory = px_proxy_factory_new();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
fe_init ();
|
fe_init ();
|
||||||
|
|
||||||
/* This is done here because cfgfiles.c is too early in
|
/* This is done here because cfgfiles.c is too early in
|
||||||
@@ -1145,19 +1067,6 @@ main (int argc, char *argv[])
|
|||||||
|
|
||||||
fe_main ();
|
fe_main ();
|
||||||
|
|
||||||
#ifdef USE_LIBPROXY
|
|
||||||
px_proxy_factory_free(libproxy_factory);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_OPENSSL
|
|
||||||
if (ctx)
|
|
||||||
_SSL_context_free (ctx);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_DEBUG
|
|
||||||
hexchat_mem_list ();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
WSACleanup ();
|
WSACleanup ();
|
||||||
#endif
|
#endif
|
||||||
|
@@ -17,14 +17,12 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef WIN32
|
#include "config.h"
|
||||||
#include "../../config-win32.h"
|
|
||||||
#else
|
|
||||||
#include "../../config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib/gstdio.h>
|
#include <glib/gstdio.h>
|
||||||
|
#include <glib/gi18n.h>
|
||||||
|
#include <gio/gio.h>
|
||||||
|
|
||||||
#include <time.h> /* need time_t */
|
#include <time.h> /* need time_t */
|
||||||
|
|
||||||
@@ -39,33 +37,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "history.h"
|
#include "history.h"
|
||||||
|
#include "tree.h"
|
||||||
#ifndef HAVE_SNPRINTF
|
|
||||||
#define snprintf g_snprintf
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef HAVE_VSNPRINTF
|
|
||||||
#define vsnprintf _vsnprintf
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_DEBUG
|
|
||||||
#define malloc(n) hexchat_malloc(n, __FILE__, __LINE__)
|
|
||||||
#define realloc(n, m) hexchat_realloc(n, m, __FILE__, __LINE__)
|
|
||||||
#define free(n) hexchat_dfree(n, __FILE__, __LINE__)
|
|
||||||
#define strdup(n) hexchat_strdup(n, __FILE__, __LINE__)
|
|
||||||
void *hexchat_malloc (int size, char *file, int line);
|
|
||||||
void *hexchat_strdup (char *str, char *file, int line);
|
|
||||||
void hexchat_dfree (void *buf, char *file, int line);
|
|
||||||
void *hexchat_realloc (char *old, int len, char *file, int line);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SOCKS
|
|
||||||
#ifdef __sgi
|
|
||||||
#include <sys/time.h>
|
|
||||||
#define INCLUDE_PROTOTYPES 1
|
|
||||||
#endif
|
|
||||||
#include <socks.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_OPENSSL
|
#ifdef USE_OPENSSL
|
||||||
#include <openssl/ssl.h> /* SSL_() */
|
#include <openssl/ssl.h> /* SSL_() */
|
||||||
@@ -80,9 +52,7 @@ void *hexchat_realloc (char *old, int len, char *file, int line);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* force a 32bit CMP.L */
|
/* force a 32bit CMP.L */
|
||||||
#define CMPL(a, c0, c1, c2, c3) (a == (guint32)(c0 | (c1 << 8) | (c2 << 16) | (c3 << 24)))
|
|
||||||
#define WORDL(c0, c1, c2, c3) (guint32)(c0 | (c1 << 8) | (c2 << 16) | (c3 << 24))
|
#define WORDL(c0, c1, c2, c3) (guint32)(c0 | (c1 << 8) | (c2 << 16) | (c3 << 24))
|
||||||
#define WORDW(c0, c1) (guint16)(c0 | (c1 << 8))
|
|
||||||
|
|
||||||
#ifdef WIN32 /* for win32 */
|
#ifdef WIN32 /* for win32 */
|
||||||
#define OFLAGS O_BINARY
|
#define OFLAGS O_BINARY
|
||||||
@@ -109,20 +79,6 @@ void *hexchat_realloc (char *old, int len, char *file, int line);
|
|||||||
#define USERNAMELEN 10
|
#define USERNAMELEN 10
|
||||||
#define HIDDEN_CHAR 8 /* invisible character for xtext */
|
#define HIDDEN_CHAR 8 /* invisible character for xtext */
|
||||||
|
|
||||||
#if defined(ENABLE_NLS) && !defined(_)
|
|
||||||
# include <libintl.h>
|
|
||||||
# define _(x) gettext(x)
|
|
||||||
# ifdef gettext_noop
|
|
||||||
# define N_(String) gettext_noop (String)
|
|
||||||
# else
|
|
||||||
# define N_(String) (String)
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#if !defined(_)
|
|
||||||
# define N_(String) (String)
|
|
||||||
# define _(x) (x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct nbexec
|
struct nbexec
|
||||||
{
|
{
|
||||||
int myfd;
|
int myfd;
|
||||||
@@ -292,6 +248,7 @@ struct hexchatprefs
|
|||||||
int hex_gui_search_pos;
|
int hex_gui_search_pos;
|
||||||
int hex_gui_slist_select;
|
int hex_gui_slist_select;
|
||||||
int hex_gui_tab_layout;
|
int hex_gui_tab_layout;
|
||||||
|
int hex_gui_tab_middleclose;
|
||||||
int hex_gui_tab_newtofront;
|
int hex_gui_tab_newtofront;
|
||||||
int hex_gui_tab_pos;
|
int hex_gui_tab_pos;
|
||||||
int hex_gui_tab_small;
|
int hex_gui_tab_small;
|
||||||
@@ -307,6 +264,7 @@ struct hexchatprefs
|
|||||||
int hex_gui_win_state;
|
int hex_gui_win_state;
|
||||||
int hex_gui_win_top;
|
int hex_gui_win_top;
|
||||||
int hex_gui_win_width;
|
int hex_gui_win_width;
|
||||||
|
int hex_identd_port;
|
||||||
int hex_input_balloon_time;
|
int hex_input_balloon_time;
|
||||||
int hex_irc_ban_type;
|
int hex_irc_ban_type;
|
||||||
int hex_irc_join_delay;
|
int hex_irc_join_delay;
|
||||||
@@ -412,12 +370,12 @@ typedef struct session
|
|||||||
guint8 text_strip;
|
guint8 text_strip;
|
||||||
|
|
||||||
struct server *server;
|
struct server *server;
|
||||||
void *usertree_alpha; /* pure alphabetical tree */
|
tree *usertree; /* alphabetical tree */
|
||||||
void *usertree; /* ordered with Ops first */
|
|
||||||
struct User *me; /* points to myself in the usertree */
|
struct User *me; /* points to myself in the usertree */
|
||||||
char channel[CHANLEN];
|
char channel[CHANLEN];
|
||||||
char waitchannel[CHANLEN]; /* waiting to join channel (/join sent) */
|
char waitchannel[CHANLEN]; /* waiting to join channel (/join sent) */
|
||||||
char willjoinchannel[CHANLEN]; /* will issue /join for this channel */
|
char willjoinchannel[CHANLEN]; /* will issue /join for this channel */
|
||||||
|
char session_name[CHANLEN]; /* the name of the session, should not modified */
|
||||||
char channelkey[64]; /* XXX correct max length? */
|
char channelkey[64]; /* XXX correct max length? */
|
||||||
int limit; /* channel user limit */
|
int limit; /* channel user limit */
|
||||||
int logfd;
|
int logfd;
|
||||||
@@ -464,14 +422,6 @@ typedef struct session
|
|||||||
void (*scrollback_replay_marklast) (struct session *sess);
|
void (*scrollback_replay_marklast) (struct session *sess);
|
||||||
} session;
|
} session;
|
||||||
|
|
||||||
struct msproxy_state_t
|
|
||||||
{
|
|
||||||
gint32 clientid;
|
|
||||||
gint32 serverid;
|
|
||||||
unsigned char seq_recv; /* seq number of last packet recv. */
|
|
||||||
unsigned char seq_sent; /* seq number of last packet sent. */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* SASL Mechanisms */
|
/* SASL Mechanisms */
|
||||||
#define MECH_PLAIN 0
|
#define MECH_PLAIN 0
|
||||||
#define MECH_BLOWFISH 1
|
#define MECH_BLOWFISH 1
|
||||||
@@ -521,25 +471,19 @@ typedef struct server
|
|||||||
int (*p_raw)(struct server *, char *raw);
|
int (*p_raw)(struct server *, char *raw);
|
||||||
int (*p_cmp)(const char *s1, const char *s2);
|
int (*p_cmp)(const char *s1, const char *s2);
|
||||||
|
|
||||||
int port;
|
guint16 port;
|
||||||
int sok; /* is equal to sok4 or sok6 (the one we are using) */
|
GSocket *sok; /* is equal to sok4 or sok6 (the one we are using) */
|
||||||
int sok4; /* tcp4 socket */
|
GSocket *sok4; /* tcp4 socket */
|
||||||
int sok6; /* tcp6 socket */
|
GSocket *sok6; /* tcp6 socket */
|
||||||
int proxy_type;
|
|
||||||
int proxy_sok; /* Additional information for MS Proxy beast */
|
|
||||||
int proxy_sok4;
|
|
||||||
int proxy_sok6;
|
|
||||||
struct msproxy_state_t msp_state;
|
|
||||||
int id; /* unique ID number (for plugin API) */
|
int id; /* unique ID number (for plugin API) */
|
||||||
#ifdef USE_OPENSSL
|
#ifdef USE_OPENSSL
|
||||||
|
SSL_CTX *ctx;
|
||||||
SSL *ssl;
|
SSL *ssl;
|
||||||
int ssl_do_connect_tag;
|
int ssl_do_connect_tag;
|
||||||
#else
|
#else
|
||||||
void *ssl;
|
void *ssl;
|
||||||
#endif
|
#endif
|
||||||
int childread;
|
GCancellable *cancellable; /* to cancel connecting thread */
|
||||||
int childwrite;
|
|
||||||
int childpid;
|
|
||||||
int iotag;
|
int iotag;
|
||||||
int recondelay_tag; /* reconnect delay timeout */
|
int recondelay_tag; /* reconnect delay timeout */
|
||||||
int joindelay_tag; /* waiting before we send JOIN */
|
int joindelay_tag; /* waiting before we send JOIN */
|
||||||
@@ -661,7 +605,4 @@ struct popup
|
|||||||
/* CL: get a random int in the range [0..n-1]. DON'T use rand() % n, it gives terrible results. */
|
/* CL: get a random int in the range [0..n-1]. DON'T use rand() % n, it gives terrible results. */
|
||||||
#define RAND_INT(n) ((int)(rand() / (RAND_MAX + 1.0) * (n)))
|
#define RAND_INT(n) ((int)(rand() / (RAND_MAX + 1.0) * (n)))
|
||||||
|
|
||||||
#define hexchat_filename_from_utf8 g_filename_from_utf8
|
|
||||||
#define hexchat_filename_to_utf8 g_filename_to_utf8
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -57,6 +57,5 @@ void session_free (session *killsess);
|
|||||||
void lag_check (void);
|
void lag_check (void);
|
||||||
void hexchat_exit (void);
|
void hexchat_exit (void);
|
||||||
void hexchat_exec (const char *cmd);
|
void hexchat_exec (const char *cmd);
|
||||||
void hexchat_execv (char * const argv[]);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -18,14 +18,14 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <glib.h>
|
||||||
#include "history.h"
|
#include "history.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
history_add (struct history *his, char *text)
|
history_add (struct history *his, char *text)
|
||||||
{
|
{
|
||||||
if (his->lines[his->realpos])
|
g_free (his->lines[his->realpos]);
|
||||||
free (his->lines[his->realpos]);
|
his->lines[his->realpos] = g_strdup (text);
|
||||||
his->lines[his->realpos] = strdup (text);
|
|
||||||
his->realpos++;
|
his->realpos++;
|
||||||
if (his->realpos == HISTORY_SIZE)
|
if (his->realpos == HISTORY_SIZE)
|
||||||
his->realpos = 0;
|
his->realpos = 0;
|
||||||
@@ -40,7 +40,7 @@ history_free (struct history *his)
|
|||||||
{
|
{
|
||||||
if (his->lines[i])
|
if (his->lines[i])
|
||||||
{
|
{
|
||||||
free (his->lines[i]);
|
g_free (his->lines[i]);
|
||||||
his->lines[i] = 0;
|
his->lines[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -52,7 +52,7 @@ history_down (struct history *his)
|
|||||||
int next;
|
int next;
|
||||||
|
|
||||||
if (his->pos == his->realpos) /* allow down only after up */
|
if (his->pos == his->realpos) /* allow down only after up */
|
||||||
return 0;
|
return NULL;
|
||||||
if (his->realpos == 0)
|
if (his->realpos == 0)
|
||||||
{
|
{
|
||||||
if (his->pos == HISTORY_SIZE - 1)
|
if (his->pos == HISTORY_SIZE - 1)
|
||||||
@@ -79,7 +79,7 @@ history_down (struct history *his)
|
|||||||
return his->lines[his->pos];
|
return his->lines[his->pos];
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
@@ -90,11 +90,11 @@ history_up (struct history *his, char *current_text)
|
|||||||
if (his->realpos == HISTORY_SIZE - 1)
|
if (his->realpos == HISTORY_SIZE - 1)
|
||||||
{
|
{
|
||||||
if (his->pos == 0)
|
if (his->pos == 0)
|
||||||
return 0;
|
return NULL;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
if (his->pos == his->realpos + 1)
|
if (his->pos == his->realpos + 1)
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
next = HISTORY_SIZE - 1;
|
next = HISTORY_SIZE - 1;
|
||||||
@@ -117,5 +117,5 @@ history_up (struct history *his, char *current_text)
|
|||||||
return his->lines[his->pos];
|
return his->lines[his->pos];
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@@ -1,201 +0,0 @@
|
|||||||
/* HexChat
|
|
||||||
* Copyright (C) 1998-2010 Peter Zelezny.
|
|
||||||
* Copyright (C) 2009-2013 Berke Viktor.
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* simple identd server for HexChat under Win32 */
|
|
||||||
|
|
||||||
#include "inet.h"
|
|
||||||
#include "hexchat.h"
|
|
||||||
#include "hexchatc.h"
|
|
||||||
#include "text.h"
|
|
||||||
|
|
||||||
static int identd_is_running = FALSE;
|
|
||||||
#ifdef USE_IPV6
|
|
||||||
static int identd_ipv6_is_running = FALSE;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int
|
|
||||||
identd (char *username)
|
|
||||||
{
|
|
||||||
int sok, read_sok, len;
|
|
||||||
char *p;
|
|
||||||
char buf[256];
|
|
||||||
char outbuf[256];
|
|
||||||
char ipbuf[INET_ADDRSTRLEN];
|
|
||||||
struct sockaddr_in addr;
|
|
||||||
|
|
||||||
sok = socket (AF_INET, SOCK_STREAM, 0);
|
|
||||||
if (sok == INVALID_SOCKET)
|
|
||||||
{
|
|
||||||
free (username);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
len = 1;
|
|
||||||
setsockopt (sok, SOL_SOCKET, SO_REUSEADDR, (char *) &len, sizeof (len));
|
|
||||||
|
|
||||||
memset (&addr, 0, sizeof (addr));
|
|
||||||
addr.sin_family = AF_INET;
|
|
||||||
addr.sin_port = htons (113);
|
|
||||||
|
|
||||||
if (bind (sok, (struct sockaddr *) &addr, sizeof (addr)) == SOCKET_ERROR)
|
|
||||||
{
|
|
||||||
closesocket (sok);
|
|
||||||
free (username);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (listen (sok, 1) == SOCKET_ERROR)
|
|
||||||
{
|
|
||||||
closesocket (sok);
|
|
||||||
free (username);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
len = sizeof (addr);
|
|
||||||
read_sok = accept (sok, (struct sockaddr *) &addr, &len);
|
|
||||||
closesocket (sok);
|
|
||||||
if (read_sok == INVALID_SOCKET)
|
|
||||||
{
|
|
||||||
free (username);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
identd_is_running = FALSE;
|
|
||||||
|
|
||||||
#if 0 /* causes random crashes, probably due to CreateThread */
|
|
||||||
EMIT_SIGNAL (XP_TE_IDENTD, current_sess, inet_ntoa (addr.sin_addr), username, NULL, NULL, 0);
|
|
||||||
#endif
|
|
||||||
inet_ntop (AF_INET, &addr.sin_addr, ipbuf, sizeof (ipbuf));
|
|
||||||
snprintf (outbuf, sizeof (outbuf), "*\tServicing ident request from %s as %s\n", ipbuf, username);
|
|
||||||
PrintText (current_sess, outbuf);
|
|
||||||
|
|
||||||
recv (read_sok, buf, sizeof (buf) - 1, 0);
|
|
||||||
buf[sizeof (buf) - 1] = 0; /* ensure null termination */
|
|
||||||
|
|
||||||
p = strchr (buf, ',');
|
|
||||||
if (p)
|
|
||||||
{
|
|
||||||
snprintf (outbuf, sizeof (outbuf) - 1, "%d, %d : USERID : UNIX : %s\r\n",
|
|
||||||
atoi (buf), atoi (p + 1), username);
|
|
||||||
outbuf[sizeof (outbuf) - 1] = 0; /* ensure null termination */
|
|
||||||
send (read_sok, outbuf, strlen (outbuf), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
sleep (1);
|
|
||||||
closesocket (read_sok);
|
|
||||||
free (username);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef USE_IPV6
|
|
||||||
static int
|
|
||||||
identd_ipv6 (char *username)
|
|
||||||
{
|
|
||||||
int sok, read_sok, len;
|
|
||||||
char *p;
|
|
||||||
char buf[256];
|
|
||||||
char outbuf[256];
|
|
||||||
char ipbuf[INET6_ADDRSTRLEN];
|
|
||||||
struct sockaddr_in6 addr;
|
|
||||||
|
|
||||||
sok = socket (AF_INET6, SOCK_STREAM, 0);
|
|
||||||
if (sok == INVALID_SOCKET)
|
|
||||||
{
|
|
||||||
free (username);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
len = 1;
|
|
||||||
setsockopt (sok, SOL_SOCKET, SO_REUSEADDR, (char *) &len, sizeof (len));
|
|
||||||
|
|
||||||
memset (&addr, 0, sizeof (addr));
|
|
||||||
addr.sin6_family = AF_INET6;
|
|
||||||
addr.sin6_port = htons (113);
|
|
||||||
|
|
||||||
if (bind (sok, (struct sockaddr *) &addr, sizeof (addr)) == SOCKET_ERROR)
|
|
||||||
{
|
|
||||||
closesocket (sok);
|
|
||||||
free (username);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (listen (sok, 1) == SOCKET_ERROR)
|
|
||||||
{
|
|
||||||
closesocket (sok);
|
|
||||||
free (username);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
len = sizeof (addr);
|
|
||||||
read_sok = accept (sok, (struct sockaddr *) &addr, &len);
|
|
||||||
closesocket (sok);
|
|
||||||
if (read_sok == INVALID_SOCKET)
|
|
||||||
{
|
|
||||||
free (username);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
identd_ipv6_is_running = FALSE;
|
|
||||||
|
|
||||||
inet_ntop (AF_INET6, &addr.sin6_addr, ipbuf, sizeof (ipbuf));
|
|
||||||
snprintf (outbuf, sizeof (outbuf), "*\tServicing ident request from %s as %s\n", ipbuf, username);
|
|
||||||
PrintText (current_sess, outbuf);
|
|
||||||
|
|
||||||
recv (read_sok, buf, sizeof (buf) - 1, 0);
|
|
||||||
buf[sizeof (buf) - 1] = 0; /* ensure null termination */
|
|
||||||
|
|
||||||
p = strchr (buf, ',');
|
|
||||||
if (p)
|
|
||||||
{
|
|
||||||
snprintf (outbuf, sizeof (outbuf) - 1, "%d, %d : USERID : UNIX : %s\r\n", atoi (buf), atoi (p + 1), username);
|
|
||||||
outbuf[sizeof (outbuf) - 1] = 0; /* ensure null termination */
|
|
||||||
send (read_sok, outbuf, strlen (outbuf), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
sleep (1);
|
|
||||||
closesocket (read_sok);
|
|
||||||
free (username);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
|
||||||
identd_start (char *username)
|
|
||||||
{
|
|
||||||
DWORD tid;
|
|
||||||
|
|
||||||
#ifdef USE_IPV6
|
|
||||||
DWORD tidv6;
|
|
||||||
if (identd_ipv6_is_running == FALSE)
|
|
||||||
{
|
|
||||||
identd_ipv6_is_running = TRUE;
|
|
||||||
CloseHandle (CreateThread (NULL, 0, (LPTHREAD_START_ROUTINE) identd_ipv6,
|
|
||||||
strdup (username), 0, &tidv6));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (identd_is_running == FALSE)
|
|
||||||
{
|
|
||||||
identd_is_running = TRUE;
|
|
||||||
CloseHandle (CreateThread (NULL, 0, (LPTHREAD_START_ROUTINE) identd,
|
|
||||||
strdup (username), 0, &tid));
|
|
||||||
}
|
|
||||||
}
|
|
@@ -53,7 +53,7 @@ static int ignored_total = 0;
|
|||||||
struct ignore *
|
struct ignore *
|
||||||
ignore_exists (char *mask)
|
ignore_exists (char *mask)
|
||||||
{
|
{
|
||||||
struct ignore *ig = 0;
|
struct ignore *ig = NULL;
|
||||||
GSList *list;
|
GSList *list;
|
||||||
|
|
||||||
list = ignore_list;
|
list = ignore_list;
|
||||||
@@ -79,7 +79,7 @@ ignore_exists (char *mask)
|
|||||||
int
|
int
|
||||||
ignore_add (char *mask, int type, gboolean overwrite)
|
ignore_add (char *mask, int type, gboolean overwrite)
|
||||||
{
|
{
|
||||||
struct ignore *ig = 0;
|
struct ignore *ig = NULL;
|
||||||
int change_only = FALSE;
|
int change_only = FALSE;
|
||||||
|
|
||||||
/* first check if it's already ignored */
|
/* first check if it's already ignored */
|
||||||
@@ -88,12 +88,9 @@ ignore_add (char *mask, int type, gboolean overwrite)
|
|||||||
change_only = TRUE;
|
change_only = TRUE;
|
||||||
|
|
||||||
if (!change_only)
|
if (!change_only)
|
||||||
ig = malloc (sizeof (struct ignore));
|
ig = g_new (struct ignore, 1);
|
||||||
|
|
||||||
if (!ig)
|
ig->mask = g_strdup (mask);
|
||||||
return 0;
|
|
||||||
|
|
||||||
ig->mask = strdup (mask);
|
|
||||||
|
|
||||||
if (!overwrite && change_only)
|
if (!overwrite && change_only)
|
||||||
ig->type |= type;
|
ig->type |= type;
|
||||||
@@ -125,7 +122,7 @@ ignore_showlist (session *sess)
|
|||||||
ig = list->data;
|
ig = list->data;
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
snprintf (tbuf, sizeof (tbuf), " %-25s ", ig->mask);
|
g_snprintf (tbuf, sizeof (tbuf), " %-25s ", ig->mask);
|
||||||
if (ig->type & IG_PRIV)
|
if (ig->type & IG_PRIV)
|
||||||
strcat (tbuf, _("YES "));
|
strcat (tbuf, _("YES "));
|
||||||
else
|
else
|
||||||
@@ -192,8 +189,8 @@ ignore_del (char *mask, struct ignore *ig)
|
|||||||
if (ig)
|
if (ig)
|
||||||
{
|
{
|
||||||
ignore_list = g_slist_remove (ignore_list, ig);
|
ignore_list = g_slist_remove (ignore_list, ig);
|
||||||
free (ig->mask);
|
g_free (ig->mask);
|
||||||
free (ig);
|
g_free (ig);
|
||||||
fe_ignore_update (1);
|
fe_ignore_update (1);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -265,7 +262,7 @@ ignore_read_next_entry (char *my_cfg, struct ignore *ignore)
|
|||||||
my_cfg = cfg_get_str (my_cfg, "mask", tbuf, sizeof (tbuf));
|
my_cfg = cfg_get_str (my_cfg, "mask", tbuf, sizeof (tbuf));
|
||||||
if (!my_cfg)
|
if (!my_cfg)
|
||||||
return NULL;
|
return NULL;
|
||||||
ignore->mask = strdup (tbuf);
|
ignore->mask = g_strdup (tbuf);
|
||||||
}
|
}
|
||||||
if (my_cfg)
|
if (my_cfg)
|
||||||
{
|
{
|
||||||
@@ -281,7 +278,7 @@ ignore_load ()
|
|||||||
struct ignore *ignore;
|
struct ignore *ignore;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
char *cfg, *my_cfg;
|
char *cfg, *my_cfg;
|
||||||
int fh, i;
|
int fh;
|
||||||
|
|
||||||
fh = hexchat_open_file ("ignore.conf", O_RDONLY, 0, 0);
|
fh = hexchat_open_file ("ignore.conf", O_RDONLY, 0, 0);
|
||||||
if (fh != -1)
|
if (fh != -1)
|
||||||
@@ -289,22 +286,18 @@ ignore_load ()
|
|||||||
fstat (fh, &st);
|
fstat (fh, &st);
|
||||||
if (st.st_size)
|
if (st.st_size)
|
||||||
{
|
{
|
||||||
cfg = malloc (st.st_size + 1);
|
cfg = g_malloc0 (st.st_size + 1);
|
||||||
cfg[0] = '\0';
|
read (fh, cfg, st.st_size);
|
||||||
i = read (fh, cfg, st.st_size);
|
|
||||||
if (i >= 0)
|
|
||||||
cfg[i] = '\0';
|
|
||||||
my_cfg = cfg;
|
my_cfg = cfg;
|
||||||
while (my_cfg)
|
while (my_cfg)
|
||||||
{
|
{
|
||||||
ignore = malloc (sizeof (struct ignore));
|
ignore = g_new0 (struct ignore, 1);
|
||||||
memset (ignore, 0, sizeof (struct ignore));
|
|
||||||
if ((my_cfg = ignore_read_next_entry (my_cfg, ignore)))
|
if ((my_cfg = ignore_read_next_entry (my_cfg, ignore)))
|
||||||
ignore_list = g_slist_prepend (ignore_list, ignore);
|
ignore_list = g_slist_prepend (ignore_list, ignore);
|
||||||
else
|
else
|
||||||
free (ignore);
|
g_free (ignore);
|
||||||
}
|
}
|
||||||
free (cfg);
|
g_free (cfg);
|
||||||
}
|
}
|
||||||
close (fh);
|
close (fh);
|
||||||
}
|
}
|
||||||
@@ -326,7 +319,7 @@ ignore_save ()
|
|||||||
ig = (struct ignore *) temp->data;
|
ig = (struct ignore *) temp->data;
|
||||||
if (!(ig->type & IG_NOSAVE))
|
if (!(ig->type & IG_NOSAVE))
|
||||||
{
|
{
|
||||||
snprintf (buf, sizeof (buf), "mask = %s\ntype = %u\n\n",
|
g_snprintf (buf, sizeof (buf), "mask = %s\ntype = %u\n\n",
|
||||||
ig->mask, ig->type);
|
ig->mask, ig->type);
|
||||||
write (fh, buf, strlen (buf));
|
write (fh, buf, strlen (buf));
|
||||||
}
|
}
|
||||||
@@ -379,9 +372,9 @@ flood_check (char *nick, char *ip, server *serv, session *sess, int what) /*0=ct
|
|||||||
for (i = 0; i < 128; i++)
|
for (i = 0; i < 128; i++)
|
||||||
if (ip[i] == '@')
|
if (ip[i] == '@')
|
||||||
break;
|
break;
|
||||||
snprintf (real_ip, sizeof (real_ip), "*!*%s", &ip[i]);
|
g_snprintf (real_ip, sizeof (real_ip), "*!*%s", &ip[i]);
|
||||||
|
|
||||||
snprintf (buf, sizeof (buf),
|
g_snprintf (buf, sizeof (buf),
|
||||||
_("You are being CTCP flooded from %s, ignoring %s\n"),
|
_("You are being CTCP flooded from %s, ignoring %s\n"),
|
||||||
nick, real_ip);
|
nick, real_ip);
|
||||||
PrintText (sess, buf);
|
PrintText (sess, buf);
|
||||||
@@ -406,7 +399,7 @@ flood_check (char *nick, char *ip, server *serv, session *sess, int what) /*0=ct
|
|||||||
serv->msg_counter++;
|
serv->msg_counter++;
|
||||||
if (serv->msg_counter == prefs.hex_flood_msg_num) /*if we reached the maximun numbers of ctcp in the seconds limits */
|
if (serv->msg_counter == prefs.hex_flood_msg_num) /*if we reached the maximun numbers of ctcp in the seconds limits */
|
||||||
{
|
{
|
||||||
snprintf (buf, sizeof (buf),
|
g_snprintf (buf, sizeof (buf),
|
||||||
_("You are being MSG flooded from %s, setting gui_autoopen_dialog OFF.\n"),
|
_("You are being MSG flooded from %s, setting gui_autoopen_dialog OFF.\n"),
|
||||||
ip);
|
ip);
|
||||||
PrintText (sess, buf);
|
PrintText (sess, buf);
|
||||||
|
@@ -33,8 +33,6 @@
|
|||||||
#define WANTDNS
|
#define WANTDNS
|
||||||
#include "inet.h"
|
#include "inet.h"
|
||||||
|
|
||||||
#include <gio/gio.h>
|
|
||||||
|
|
||||||
#include "hexchat.h"
|
#include "hexchat.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "ignore.h"
|
#include "ignore.h"
|
||||||
@@ -64,7 +62,7 @@ clear_channel (session *sess)
|
|||||||
|
|
||||||
if (sess->current_modes)
|
if (sess->current_modes)
|
||||||
{
|
{
|
||||||
free (sess->current_modes);
|
g_free (sess->current_modes);
|
||||||
sess->current_modes = NULL;
|
sess->current_modes = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,9 +81,8 @@ clear_channel (session *sess)
|
|||||||
void
|
void
|
||||||
set_topic (session *sess, char *topic, char *stripped_topic)
|
set_topic (session *sess, char *topic, char *stripped_topic)
|
||||||
{
|
{
|
||||||
if (sess->topic)
|
g_free (sess->topic);
|
||||||
free (sess->topic);
|
sess->topic = g_strdup (stripped_topic);
|
||||||
sess->topic = strdup (stripped_topic);
|
|
||||||
fe_set_topic (sess, topic, stripped_topic);
|
fe_set_topic (sess, topic, stripped_topic);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +118,7 @@ find_session_from_nick (char *nick, server *serv)
|
|||||||
}
|
}
|
||||||
list = list->next;
|
list = list->next;
|
||||||
}
|
}
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static session *
|
static session *
|
||||||
@@ -187,7 +184,7 @@ inbound_privmsg (server *serv, char *from, char *ip, char *text, int id,
|
|||||||
(!sess->topic || strcmp(sess->topic, ip)))
|
(!sess->topic || strcmp(sess->topic, ip)))
|
||||||
{
|
{
|
||||||
char tbuf[1024];
|
char tbuf[1024];
|
||||||
snprintf (tbuf, sizeof (tbuf), "[%s has address %s]\n", from, ip);
|
g_snprintf (tbuf, sizeof (tbuf), "[%s has address %s]\n", from, ip);
|
||||||
write (sess->logfd, tbuf, strlen (tbuf));
|
write (sess->logfd, tbuf, strlen (tbuf));
|
||||||
}
|
}
|
||||||
set_topic (sess, ip, ip);
|
set_topic (sess, ip, ip);
|
||||||
@@ -558,7 +555,7 @@ find_unused_session (server *serv)
|
|||||||
}
|
}
|
||||||
list = list->next;
|
list = list->next;
|
||||||
}
|
}
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static session *
|
static session *
|
||||||
@@ -576,7 +573,7 @@ find_session_from_waitchannel (char *chan, struct server *serv)
|
|||||||
}
|
}
|
||||||
list = list->next;
|
list = list->next;
|
||||||
}
|
}
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -682,7 +679,8 @@ inbound_nameslist (server *serv, char *chan, char *names,
|
|||||||
char **name_list;
|
char **name_list;
|
||||||
char *host, *nopre_name;
|
char *host, *nopre_name;
|
||||||
char name[NICKLEN];
|
char name[NICKLEN];
|
||||||
int i, offset;
|
int i;
|
||||||
|
size_t offset;
|
||||||
|
|
||||||
sess = find_channel (serv, chan);
|
sess = find_channel (serv, chan);
|
||||||
if (!sess)
|
if (!sess)
|
||||||
@@ -916,7 +914,7 @@ inbound_ping_reply (session *sess, char *timestring, char *from,
|
|||||||
tags_data->timestamp);
|
tags_data->timestamp);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
snprintf (outbuf, sizeof (outbuf), "%ld.%03ld", dif / 1000, dif % 1000);
|
g_snprintf (outbuf, sizeof (outbuf), "%ld.%03ld", dif / 1000, dif % 1000);
|
||||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_PINGREP, sess, from, outbuf, NULL, NULL, 0,
|
EMIT_SIGNAL_TIMESTAMP (XP_TE_PINGREP, sess, from, outbuf, NULL, NULL, 0,
|
||||||
tags_data->timestamp);
|
tags_data->timestamp);
|
||||||
}
|
}
|
||||||
@@ -934,7 +932,7 @@ find_session_from_type (int type, server *serv)
|
|||||||
return sess;
|
return sess;
|
||||||
list = list->next;
|
list = list->next;
|
||||||
}
|
}
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -969,14 +967,14 @@ inbound_notice (server *serv, char *to, char *nick, char *msg, char *ip, int id,
|
|||||||
/* guess where chanserv meant to post this -sigh- */
|
/* guess where chanserv meant to post this -sigh- */
|
||||||
if (!g_ascii_strcasecmp (nick, "ChanServ") && !find_dialog (serv, nick))
|
if (!g_ascii_strcasecmp (nick, "ChanServ") && !find_dialog (serv, nick))
|
||||||
{
|
{
|
||||||
char *dest = strdup (msg + 1);
|
char *dest = g_strdup (msg + 1);
|
||||||
char *end = strchr (dest, ']');
|
char *end = strchr (dest, ']');
|
||||||
if (end)
|
if (end)
|
||||||
{
|
{
|
||||||
*end = 0;
|
*end = 0;
|
||||||
sess = find_channel (serv, dest);
|
sess = find_channel (serv, dest);
|
||||||
}
|
}
|
||||||
free (dest);
|
g_free (dest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!sess)
|
if (!sess)
|
||||||
@@ -1455,8 +1453,7 @@ inbound_user_info (session *sess, char *chan, char *user, char *host,
|
|||||||
|
|
||||||
if (user && host)
|
if (user && host)
|
||||||
{
|
{
|
||||||
uhost = g_malloc (strlen (user) + strlen (host) + 2);
|
uhost = g_strdup_printf ("%s@%s", user, host);
|
||||||
sprintf (uhost, "%s@%s", user, host);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chan)
|
if (chan)
|
||||||
|
@@ -47,13 +47,9 @@
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include "../../config-win32.h"
|
#include "config.h"
|
||||||
#ifdef USE_IPV6
|
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
#else
|
|
||||||
#include <winsock2.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define set_blocking(sok) { \
|
#define set_blocking(sok) { \
|
||||||
unsigned long zero = 0; \
|
unsigned long zero = 0; \
|
||||||
|
@@ -42,7 +42,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
int main()
|
int main(void)
|
||||||
{
|
{
|
||||||
char name[512];
|
char name[512];
|
||||||
char num[512];
|
char num[512];
|
||||||
@@ -87,9 +87,11 @@ int main()
|
|||||||
if (i + 1 < max)
|
if (i + 1 < max)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "\t%s,\t\t%s,\n", defines[i], defines[i+1]);
|
fprintf(stderr, "\t%s,\t\t%s,\n", defines[i], defines[i+1]);
|
||||||
|
free (defines[i]);
|
||||||
i++;
|
i++;
|
||||||
} else
|
} else
|
||||||
fprintf(stderr, "\t%s,\n", defines[i]);
|
fprintf(stderr, "\t%s,\n", defines[i]);
|
||||||
|
free (defines[i]);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
fprintf(stderr, "\tNUM_XP\n};\n");
|
fprintf(stderr, "\tNUM_XP\n};\n");
|
||||||
|
@@ -331,7 +331,7 @@ record_chan_mode (session *sess, char sign, char mode, char *arg)
|
|||||||
current = g_string_erase(current, argument_offset+1, argument_length-1);
|
current = g_string_erase(current, argument_offset+1, argument_length-1);
|
||||||
current = g_string_insert(current, argument_offset+1, arg);
|
current = g_string_insert(current, argument_offset+1, arg);
|
||||||
|
|
||||||
free(sess->current_modes);
|
g_free(sess->current_modes);
|
||||||
sess->current_modes = g_string_free(current, FALSE);
|
sess->current_modes = g_string_free(current, FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -348,7 +348,7 @@ record_chan_mode (session *sess, char sign, char mode, char *arg)
|
|||||||
current = g_string_append(current, arg);
|
current = g_string_append(current, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(sess->current_modes);
|
g_free(sess->current_modes);
|
||||||
sess->current_modes = g_string_free(current, FALSE);
|
sess->current_modes = g_string_free(current, FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -361,7 +361,7 @@ record_chan_mode (session *sess, char sign, char mode, char *arg)
|
|||||||
/* remove the mode character */
|
/* remove the mode character */
|
||||||
current = g_string_erase(current, mode_pos, 1);
|
current = g_string_erase(current, mode_pos, 1);
|
||||||
|
|
||||||
free(sess->current_modes);
|
g_free(sess->current_modes);
|
||||||
sess->current_modes = g_string_free(current, FALSE);
|
sess->current_modes = g_string_free(current, FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -374,12 +374,13 @@ mode_cat (char *str, char *addition)
|
|||||||
if (str)
|
if (str)
|
||||||
{
|
{
|
||||||
len = strlen (str) + strlen (addition) + 2;
|
len = strlen (str) + strlen (addition) + 2;
|
||||||
str = realloc (str, len);
|
str = g_realloc (str, len);
|
||||||
strcat (str, " ");
|
strcat (str, " ");
|
||||||
strcat (str, addition);
|
strcat (str, addition);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
str = strdup (addition);
|
str = g_strdup (addition);
|
||||||
}
|
}
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
@@ -560,12 +561,12 @@ handle_single_mode (mode_run *mr, char sign, char mode, char *nick,
|
|||||||
{
|
{
|
||||||
if (*arg)
|
if (*arg)
|
||||||
{
|
{
|
||||||
char *buf = malloc (strlen (chan) + strlen (arg) + 2);
|
char *buf = g_strdup_printf ("%s %s", chan, arg);
|
||||||
sprintf (buf, "%s %s", chan, arg);
|
|
||||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANMODEGEN, sess, nick, outbuf,
|
EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANMODEGEN, sess, nick, outbuf,
|
||||||
outbuf + 2, buf, 0, tags_data->timestamp);
|
outbuf + 2, buf, 0, tags_data->timestamp);
|
||||||
free (buf);
|
g_free (buf);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANMODEGEN, sess, nick, outbuf,
|
EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANMODEGEN, sess, nick, outbuf,
|
||||||
outbuf + 2, chan, 0, tags_data->timestamp);
|
outbuf + 2, chan, 0, tags_data->timestamp);
|
||||||
}
|
}
|
||||||
@@ -635,7 +636,7 @@ mode_print_grouped (session *sess, char *nick, mode_run *mr,
|
|||||||
{
|
{
|
||||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANOP, sess, nick, mr->op, NULL, NULL, 0,
|
EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANOP, sess, nick, mr->op, NULL, NULL, 0,
|
||||||
tags_data->timestamp);
|
tags_data->timestamp);
|
||||||
free (mr->op);
|
g_free(mr->op);
|
||||||
mr->op = NULL;
|
mr->op = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -643,7 +644,7 @@ mode_print_grouped (session *sess, char *nick, mode_run *mr,
|
|||||||
{
|
{
|
||||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANDEOP, sess, nick, mr->deop, NULL, NULL,
|
EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANDEOP, sess, nick, mr->deop, NULL, NULL,
|
||||||
0, tags_data->timestamp);
|
0, tags_data->timestamp);
|
||||||
free (mr->deop);
|
g_free(mr->deop);
|
||||||
mr->deop = NULL;
|
mr->deop = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -651,7 +652,7 @@ mode_print_grouped (session *sess, char *nick, mode_run *mr,
|
|||||||
{
|
{
|
||||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANVOICE, sess, nick, mr->voice, NULL, NULL,
|
EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANVOICE, sess, nick, mr->voice, NULL, NULL,
|
||||||
0, tags_data->timestamp);
|
0, tags_data->timestamp);
|
||||||
free (mr->voice);
|
g_free(mr->voice);
|
||||||
mr->voice = NULL;
|
mr->voice = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -659,7 +660,7 @@ mode_print_grouped (session *sess, char *nick, mode_run *mr,
|
|||||||
{
|
{
|
||||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANDEVOICE, sess, nick, mr->devoice, NULL,
|
EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANDEVOICE, sess, nick, mr->devoice, NULL,
|
||||||
NULL, 0, tags_data->timestamp);
|
NULL, 0, tags_data->timestamp);
|
||||||
free (mr->devoice);
|
g_free(mr->devoice);
|
||||||
mr->devoice = NULL;
|
mr->devoice = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -677,10 +678,10 @@ handle_mode (server * serv, char *word[], char *word_eol[],
|
|||||||
char *argstr;
|
char *argstr;
|
||||||
char sign;
|
char sign;
|
||||||
int len;
|
int len;
|
||||||
int arg;
|
size_t arg;
|
||||||
int i, num_args;
|
size_t i, num_args;
|
||||||
int num_modes;
|
int num_modes;
|
||||||
int offset = 3;
|
size_t offset = 3;
|
||||||
int all_modes_have_args = FALSE;
|
int all_modes_have_args = FALSE;
|
||||||
int using_front_tab = FALSE;
|
int using_front_tab = FALSE;
|
||||||
mode_run mr;
|
mode_run mr;
|
||||||
@@ -717,9 +718,8 @@ handle_mode (server * serv, char *word[], char *word_eol[],
|
|||||||
|
|
||||||
if (numeric_324 && !using_front_tab)
|
if (numeric_324 && !using_front_tab)
|
||||||
{
|
{
|
||||||
if (sess->current_modes)
|
g_free (sess->current_modes);
|
||||||
free (sess->current_modes);
|
sess->current_modes = g_strdup (word_eol[offset+1]);
|
||||||
sess->current_modes = strdup (word_eol[offset+1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sign = *modes;
|
sign = *modes;
|
||||||
@@ -762,7 +762,7 @@ handle_mode (server * serv, char *word[], char *word_eol[],
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
argstr = "";
|
argstr = "";
|
||||||
if ((all_modes_have_args || mode_has_arg (serv, sign, *modes)) && arg < (num_args+1))
|
if ((all_modes_have_args || mode_has_arg (serv, sign, *modes)) && arg < (num_args + 1))
|
||||||
{
|
{
|
||||||
arg++;
|
arg++;
|
||||||
argstr = word[arg + offset];
|
argstr = word[arg + offset];
|
||||||
@@ -799,30 +799,29 @@ inbound_005 (server * serv, char *word[], const message_tags_data *tags_data)
|
|||||||
serv->modes_per_line = atoi (word[w] + 6);
|
serv->modes_per_line = atoi (word[w] + 6);
|
||||||
} else if (strncmp (word[w], "CHANTYPES=", 10) == 0)
|
} else if (strncmp (word[w], "CHANTYPES=", 10) == 0)
|
||||||
{
|
{
|
||||||
free (serv->chantypes);
|
g_free (serv->chantypes);
|
||||||
serv->chantypes = strdup (word[w] + 10);
|
serv->chantypes = g_strdup (word[w] + 10);
|
||||||
} else if (strncmp (word[w], "CHANMODES=", 10) == 0)
|
} else if (strncmp (word[w], "CHANMODES=", 10) == 0)
|
||||||
{
|
{
|
||||||
free (serv->chanmodes);
|
g_free (serv->chanmodes);
|
||||||
serv->chanmodes = strdup (word[w] + 10);
|
serv->chanmodes = g_strdup (word[w] + 10);
|
||||||
} else if (strncmp (word[w], "PREFIX=", 7) == 0)
|
} else if (strncmp (word[w], "PREFIX=", 7) == 0)
|
||||||
{
|
{
|
||||||
pre = strchr (word[w] + 7, ')');
|
pre = strchr (word[w] + 7, ')');
|
||||||
if (pre)
|
if (pre)
|
||||||
{
|
{
|
||||||
pre[0] = 0; /* NULL out the ')' */
|
pre[0] = 0; /* NULL out the ')' */
|
||||||
free (serv->nick_prefixes);
|
g_free (serv->nick_prefixes);
|
||||||
free (serv->nick_modes);
|
g_free (serv->nick_modes);
|
||||||
serv->nick_prefixes = strdup (pre + 1);
|
serv->nick_prefixes = g_strdup (pre + 1);
|
||||||
serv->nick_modes = strdup (word[w] + 8);
|
serv->nick_modes = g_strdup (word[w] + 8);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
/* bad! some ircds don't give us the modes. */
|
/* bad! some ircds don't give us the modes. */
|
||||||
/* in this case, we use it only to strip /NAMES */
|
/* in this case, we use it only to strip /NAMES */
|
||||||
serv->bad_prefix = TRUE;
|
serv->bad_prefix = TRUE;
|
||||||
if (serv->bad_nick_prefixes)
|
g_free (serv->bad_nick_prefixes);
|
||||||
free (serv->bad_nick_prefixes);
|
serv->bad_nick_prefixes = g_strdup (word[w] + 7);
|
||||||
serv->bad_nick_prefixes = strdup (word[w] + 7);
|
|
||||||
}
|
}
|
||||||
} else if (strncmp (word[w], "WATCH=", 6) == 0)
|
} else if (strncmp (word[w], "WATCH=", 6) == 0)
|
||||||
{
|
{
|
||||||
@@ -832,10 +831,6 @@ inbound_005 (server * serv, char *word[], const message_tags_data *tags_data)
|
|||||||
serv->supports_monitor = TRUE;
|
serv->supports_monitor = TRUE;
|
||||||
} else if (strncmp (word[w], "NETWORK=", 8) == 0)
|
} else if (strncmp (word[w], "NETWORK=", 8) == 0)
|
||||||
{
|
{
|
||||||
/* if (serv->networkname)
|
|
||||||
free (serv->networkname);
|
|
||||||
serv->networkname = strdup (word[w] + 8);*/
|
|
||||||
|
|
||||||
if (serv->server_session->type == SESS_SERVER)
|
if (serv->server_session->type == SESS_SERVER)
|
||||||
{
|
{
|
||||||
safe_strcpy (serv->server_session->channel, word[w] + 8, CHANLEN);
|
safe_strcpy (serv->server_session->channel, word[w] + 8, CHANLEN);
|
||||||
|
@@ -1,470 +0,0 @@
|
|||||||
/* X-Chat
|
|
||||||
* Copyright (C) 1998 Peter Zelezny.
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
*
|
|
||||||
* MS Proxy (ISA server) support is (c) 2006 Pavel Fedin <sonic_amiga@rambler.ru>
|
|
||||||
* based on Dante source code
|
|
||||||
* Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
|
||||||
* Inferno Nettverk A/S, Norway. All rights reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*#define DEBUG_MSPROXY*/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define WANTSOCKET
|
|
||||||
#define WANTARPA
|
|
||||||
#include "inet.h"
|
|
||||||
|
|
||||||
#include "hexchat.h"
|
|
||||||
#include "network.h"
|
|
||||||
#include "hexchatc.h"
|
|
||||||
#include "server.h"
|
|
||||||
#include "msproxy.h"
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_MSPROXY
|
|
||||||
#include <ntlm.h>
|
|
||||||
|
|
||||||
static int
|
|
||||||
send_msprequest(s, state, request, end)
|
|
||||||
int s;
|
|
||||||
struct msproxy_state_t *state;
|
|
||||||
struct msproxy_request_t *request;
|
|
||||||
char *end;
|
|
||||||
{
|
|
||||||
ssize_t w;
|
|
||||||
size_t l;
|
|
||||||
|
|
||||||
request->magic25 = htonl(MSPROXY_VERSION);
|
|
||||||
request->serverack = state->seq_recv;
|
|
||||||
/* don't start incrementing sequence until we are acking packet #2. */
|
|
||||||
request->sequence = (unsigned char)(request->serverack >= 2 ? state->seq_sent + 1 : 0);
|
|
||||||
|
|
||||||
memcpy(request->RWSP, "RWSP", sizeof(request->RWSP));
|
|
||||||
|
|
||||||
l = end - (char *)request;
|
|
||||||
/* all requests must be atleast MSPROXY_MINLENGTH it seems. */
|
|
||||||
if (l < MSPROXY_MINLENGTH) {
|
|
||||||
bzero(end, (size_t)(MSPROXY_MINLENGTH - l));
|
|
||||||
l = MSPROXY_MINLENGTH;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((w = send(s, request, l, 0)) != l) {
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("send_msprequest(): send() failed (%ld bytes sent instead of %Iu\n", w, l);
|
|
||||||
perror ("Error is");
|
|
||||||
#endif
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
state->seq_sent = request->sequence;
|
|
||||||
|
|
||||||
return w;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
recv_mspresponse(s, state, response)
|
|
||||||
int s;
|
|
||||||
struct msproxy_state_t *state;
|
|
||||||
struct msproxy_response_t *response;
|
|
||||||
{
|
|
||||||
ssize_t r;
|
|
||||||
|
|
||||||
do {
|
|
||||||
if ((r = recv (s, response, sizeof (*response), 0)) < MSPROXY_MINLENGTH) {
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("recv_mspresponse(): expected to read atleast %d, read %ld\n", MSPROXY_MINLENGTH, r);
|
|
||||||
#endif
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (state->seq_recv == 0)
|
|
||||||
break; /* not started incrementing yet. */
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
if (response->sequence == state->seq_recv)
|
|
||||||
printf ("seq_recv: %d, dup response, seqnumber: 0x%x\n", state->seq_recv, response->sequence);
|
|
||||||
#endif
|
|
||||||
} while (response->sequence == state->seq_recv);
|
|
||||||
|
|
||||||
state->seq_recv = response->sequence;
|
|
||||||
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
traverse_msproxy (int sok, char *serverAddr, int port, struct msproxy_state_t *state, netstore *ns_proxy, int csok4, int csok6, int *csok, char bound)
|
|
||||||
{
|
|
||||||
struct msproxy_request_t req;
|
|
||||||
struct msproxy_response_t res;
|
|
||||||
char *data, *p;
|
|
||||||
char hostname[NT_MAXNAMELEN];
|
|
||||||
char ntdomain[NT_MAXNAMELEN];
|
|
||||||
char challenge[8];
|
|
||||||
netstore *ns_client;
|
|
||||||
int clientport;
|
|
||||||
guint32 destaddr;
|
|
||||||
guint32 flags;
|
|
||||||
|
|
||||||
if (!prefs.hex_net_proxy_auth || !prefs.hex_net_proxy_user[0] || !prefs.hex_net_proxy_pass[0] )
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
/* MS proxy protocol implementation currently doesn't support IPv6 */
|
|
||||||
destaddr = net_getsockaddr_v4 (ns_proxy);
|
|
||||||
if (!destaddr)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
state->seq_recv = 0;
|
|
||||||
state->seq_sent = 0;
|
|
||||||
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("Connecting to %s:%d via MS proxy\n", serverAddr, port);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
gethostname (hostname, NT_MAXNAMELEN);
|
|
||||||
p = strchr (hostname, '.');
|
|
||||||
if (p)
|
|
||||||
*p = '\0';
|
|
||||||
|
|
||||||
bzero (&req, sizeof(req));
|
|
||||||
req.clientid = htonl(0x0a000000); /* Initial client ID is always 0x0a */
|
|
||||||
req.command = htons(MSPROXY_HELLO); /* HELLO command */
|
|
||||||
req.packet.hello.magic5 = htons(0x4b00); /* Fill in magic values */
|
|
||||||
req.packet.hello.magic10 = htons(0x1400);
|
|
||||||
req.packet.hello.magic15 = htons(0x0400);
|
|
||||||
req.packet.hello.magic20 = htons(0x5704);
|
|
||||||
req.packet.hello.magic25 = htons(0x0004);
|
|
||||||
req.packet.hello.magic30 = htons(0x0100);
|
|
||||||
req.packet.hello.magic35 = htons(0x4a02);
|
|
||||||
req.packet.hello.magic40 = htons(0x3000);
|
|
||||||
req.packet.hello.magic45 = htons(0x4400);
|
|
||||||
req.packet.hello.magic50 = htons(0x3900);
|
|
||||||
data = req.packet.hello.data;
|
|
||||||
strcpy (data, prefs.hex_net_proxy_user); /* Append a username */
|
|
||||||
data += strlen (prefs.hex_net_proxy_user)+2; /* +2 automatically creates second empty string */
|
|
||||||
strcpy (data, MSPROXY_EXECUTABLE); /* Append an application name */
|
|
||||||
data += strlen (MSPROXY_EXECUTABLE)+1;
|
|
||||||
strcpy (data, hostname); /* Append a hostname */
|
|
||||||
data += strlen (hostname)+1;
|
|
||||||
|
|
||||||
if (send_msprequest(sok, state, &req, data) == -1)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (recv_mspresponse(sok, state, &res) == -1)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (strcmp(res.RWSP, "RWSP") != 0) {
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("Received mailformed packet (no RWSP signature)\n");
|
|
||||||
#endif
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ntohs(res.command) >> 8 != 0x10) {
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("expected res.command = 10??, is %x", ntohs(res.command));
|
|
||||||
#endif
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
state->clientid = htonl(rand());
|
|
||||||
state->serverid = res.serverid;
|
|
||||||
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("clientid: 0x%x, serverid: 0x%0x\n", state->clientid, state->serverid);
|
|
||||||
printf ("packet #2\n");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* almost identical. */
|
|
||||||
req.clientid = state->clientid;
|
|
||||||
req.serverid = state->serverid;
|
|
||||||
|
|
||||||
if (send_msprequest(sok, state, &req, data) == -1)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (recv_mspresponse(sok, state, &res) == -1)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (res.serverid != state->serverid) {
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("expected serverid = 0x%x, is 0x%x\n",state->serverid, res.serverid);
|
|
||||||
#endif
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (res.sequence != 0x01) {
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("expected res.sequence = 0x01, is 0x%x\n", res.sequence);
|
|
||||||
#endif
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ntohs(res.command) != MSPROXY_USERINFO_ACK) {
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("expected res.command = 0x%x, is 0x%x\n", MSPROXY_USERINFO_ACK, ntohs(res.command));
|
|
||||||
#endif
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("packet #3\n");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bzero(&req, sizeof(req));
|
|
||||||
req.clientid = state->clientid;
|
|
||||||
req.serverid = state->serverid;
|
|
||||||
req.command = htons(MSPROXY_AUTHENTICATE);
|
|
||||||
memcpy(req.packet.auth.NTLMSSP, "NTLMSSP", sizeof("NTLMSSP"));
|
|
||||||
req.packet.auth.bindaddr = htonl(0x02000000);
|
|
||||||
req.packet.auth.msgtype = htonl(0x01000000);
|
|
||||||
/* NTLM flags: 0x80000000 Negotiate LAN Manager key
|
|
||||||
0x10000000 Negotiate sign
|
|
||||||
0x04000000 Request target
|
|
||||||
0x02000000 Negotiate OEM
|
|
||||||
0x00800000 Always sign
|
|
||||||
0x00020000 Negotiate NTLM
|
|
||||||
*/
|
|
||||||
req.packet.auth.flags = htonl(0x06020000);
|
|
||||||
|
|
||||||
if (send_msprequest(sok, state, &req, &req.packet.auth.data) == -1)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (recv_mspresponse(sok, state, &res) == -1)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (res.serverid != state->serverid) {
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("expected serverid = 0x%x, is 0x%x\n", state->serverid, res.serverid);
|
|
||||||
#endif
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ntohs(res.command) != MSPROXY_AUTHENTICATE_ACK) {
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("expected res.command = 0x%x, is 0x%x\n", MSPROXY_AUTHENTICATE_ACK, ntohs(res.command));
|
|
||||||
#endif
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
flags = res.packet.auth.flags & htonl(0x00020000); /* Remember if the server supports NTLM */
|
|
||||||
memcpy(challenge, &res.packet.auth.challenge, sizeof(challenge));
|
|
||||||
memcpy(ntdomain, &res.packet.auth.NTLMSSP[res.packet.auth.target.offset], res.packet.auth.target.len);
|
|
||||||
ntdomain[res.packet.auth.target.len] = 0;
|
|
||||||
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("ntdomain: \"%s\"\n", ntdomain);
|
|
||||||
printf ("packet #4\n");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bzero(&req, sizeof(req));
|
|
||||||
req.clientid = state->clientid;
|
|
||||||
req.serverid = state->serverid;
|
|
||||||
req.command = htons(MSPROXY_AUTHENTICATE_2); /* Authentication response */
|
|
||||||
req.packet.auth2.magic3 = htons(0x0200); /* Something */
|
|
||||||
memcpy(req.packet.auth2.NTLMSSP, "NTLMSSP", sizeof("NTLMSSP")); /* Start of NTLM message */
|
|
||||||
req.packet.auth2.msgtype = htonl(0x03000000); /* Message type 2 */
|
|
||||||
req.packet.auth2.flags = flags | htonl(0x02000000); /* Choose authentication method */
|
|
||||||
data = req.packet.auth2.data;
|
|
||||||
if (flags) {
|
|
||||||
req.packet.auth2.lm_resp.len = 0; /* We are here if NTLM is supported, */
|
|
||||||
req.packet.auth2.lm_resp.alloc = 0; /* Do not fill in insecure LM response */
|
|
||||||
req.packet.auth2.lm_resp.offset = data - req.packet.auth2.NTLMSSP;
|
|
||||||
req.packet.auth2.ntlm_resp.len = 24; /* Fill in NTLM response security buffer */
|
|
||||||
req.packet.auth2.ntlm_resp.alloc = 24;
|
|
||||||
req.packet.auth2.ntlm_resp.offset = data - req.packet.auth2.NTLMSSP;
|
|
||||||
ntlm_smb_nt_encrypt(prefs.hex_net_proxy_pass, challenge, data); /* Append an NTLM response */
|
|
||||||
data += 24;
|
|
||||||
} else {
|
|
||||||
req.packet.auth2.lm_resp.len = 24; /* Fill in LM response security buffer */
|
|
||||||
req.packet.auth2.lm_resp.alloc = 24;
|
|
||||||
req.packet.auth2.lm_resp.offset = data - req.packet.auth2.NTLMSSP;
|
|
||||||
ntlm_smb_encrypt(prefs.hex_net_proxy_pass, challenge, data); /* Append an LM response */
|
|
||||||
data += 24;
|
|
||||||
req.packet.auth2.ntlm_resp.len = 0; /* NTLM response is empty */
|
|
||||||
req.packet.auth2.ntlm_resp.alloc = 0;
|
|
||||||
req.packet.auth2.ntlm_resp.offset = data - req.packet.auth2.NTLMSSP;
|
|
||||||
}
|
|
||||||
req.packet.auth2.ntdomain_buf.len = strlen(ntdomain); /* Domain name */
|
|
||||||
req.packet.auth2.ntdomain_buf.alloc = req.packet.auth2.ntdomain_buf.len;
|
|
||||||
req.packet.auth2.ntdomain_buf.offset = data - req.packet.auth2.NTLMSSP;
|
|
||||||
strcpy(data, ntdomain);
|
|
||||||
data += req.packet.auth2.ntdomain_buf.len;
|
|
||||||
req.packet.auth2.username_buf.len = strlen(prefs.hex_net_proxy_user); /* Username */
|
|
||||||
req.packet.auth2.username_buf.alloc = req.packet.auth2.username_buf.len;
|
|
||||||
req.packet.auth2.username_buf.offset = data - req.packet.auth2.NTLMSSP;
|
|
||||||
strcpy(data, prefs.hex_net_proxy_user);
|
|
||||||
data += req.packet.auth2.username_buf.len;
|
|
||||||
req.packet.auth2.clienthost_buf.len = strlen(hostname); /* Hostname */
|
|
||||||
req.packet.auth2.clienthost_buf.alloc = req.packet.auth2.clienthost_buf.len;
|
|
||||||
req.packet.auth2.clienthost_buf.offset = data - req.packet.auth2.NTLMSSP;
|
|
||||||
strcpy(data, hostname);
|
|
||||||
data += req.packet.auth2.clienthost_buf.len;
|
|
||||||
req.packet.auth2.sessionkey_buf.len = 0; /* Session key (we don't use it) */
|
|
||||||
req.packet.auth2.sessionkey_buf.alloc = 0;
|
|
||||||
req.packet.auth2.sessionkey_buf.offset = data - req.packet.auth2.NTLMSSP;
|
|
||||||
|
|
||||||
if (send_msprequest(sok, state, &req, data) == -1)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (recv_mspresponse(sok, state, &res) == -1)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (res.serverid != state->serverid) {
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("expected res.serverid = 0x%x, is 0x%x\n", state->serverid, res.serverid);
|
|
||||||
#endif
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (res.clientack != 0x01) {
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("expected res.clientack = 0x01, is 0x%x\n", res.clientack);
|
|
||||||
#endif
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ntohs(res.command) >> 8 != 0x47) {
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("expected res.command = 47??, is 0x%x\n", ntohs(res.command));
|
|
||||||
#endif
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ntohs(res.command) == MSPROXY_AUTHENTICATE_2_NAK) {
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("Authentication failed\n");
|
|
||||||
#endif
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("packet #5\n");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bzero(&req, sizeof(req));
|
|
||||||
req.clientid = state->clientid;
|
|
||||||
req.serverid = state->serverid;
|
|
||||||
req.command = htons(MSPROXY_CONNECT);
|
|
||||||
req.packet.connect.magic2 = htons(0x0200);
|
|
||||||
req.packet.connect.magic6 = htons(0x0200);
|
|
||||||
req.packet.connect.destport = htons(port);
|
|
||||||
req.packet.connect.destaddr = destaddr;
|
|
||||||
data = req.packet.connect.executable;
|
|
||||||
strcpy(data, MSPROXY_EXECUTABLE);
|
|
||||||
data += strlen(MSPROXY_EXECUTABLE) + 1;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* need to tell server what port we will connect from, so we bind our sockets.
|
|
||||||
*/
|
|
||||||
ns_client = net_store_new ();
|
|
||||||
if (!bound) {
|
|
||||||
net_store_fill_any (ns_client);
|
|
||||||
net_bind(ns_client, csok4, csok6);
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
perror ("bind() result");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
clientport = net_getsockport(csok4, csok6);
|
|
||||||
if (clientport == -1) {
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("Unable to obtain source port\n");
|
|
||||||
#endif
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
req.packet.connect.srcport = clientport;
|
|
||||||
|
|
||||||
if (send_msprequest(sok, state, &req, data) == -1)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (recv_mspresponse(sok, state, &res) == -1)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (ntohs(res.command) != MSPROXY_CONNECT_ACK) {
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("expected res.command = 0x%x, is 0x%x\n",MSPROXY_CONNECT_ACK, ntohs(res.command));
|
|
||||||
#endif
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
net_store_fill_v4 (ns_client, res.packet.connect.clientaddr, res.packet.connect.clientport);
|
|
||||||
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("Connecting...\n");
|
|
||||||
#endif
|
|
||||||
if (net_connect (ns_client, csok4, csok6, csok) != 0) {
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("Failed to connect to port %d\n", htons(res.packet.connect.clientport));
|
|
||||||
#endif
|
|
||||||
net_store_destroy (ns_client);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
net_store_destroy (ns_client);
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("packet #6\n");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
req.clientid = state->clientid;
|
|
||||||
req.serverid = state->serverid;
|
|
||||||
req.command = htons(MSPROXY_USERINFO_ACK);
|
|
||||||
|
|
||||||
if (send_msprequest(sok, state, &req, req.packet.connack.data) == -1)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
msproxy_keepalive (void)
|
|
||||||
{
|
|
||||||
server *serv;
|
|
||||||
GSList *list = serv_list;
|
|
||||||
struct msproxy_request_t req;
|
|
||||||
struct msproxy_response_t res;
|
|
||||||
|
|
||||||
while (list)
|
|
||||||
{
|
|
||||||
serv = list->data;
|
|
||||||
if (serv->connected && (serv->proxy_sok != -1))
|
|
||||||
{
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
printf ("sending MS proxy keepalive packet\n");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bzero(&req, sizeof(req));
|
|
||||||
req.clientid = serv->msp_state.clientid;
|
|
||||||
req.serverid = serv->msp_state.serverid;
|
|
||||||
req.command = htons(MSPROXY_HELLO);
|
|
||||||
|
|
||||||
if (send_msprequest(serv->proxy_sok, &serv->msp_state, &req, req.packet.hello.data) == -1)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
recv_mspresponse(serv->proxy_sok, &serv->msp_state, &res);
|
|
||||||
|
|
||||||
#ifdef DEBUG_MSPROXY
|
|
||||||
if (ntohs(res.command) != MSPROXY_USERINFO_ACK)
|
|
||||||
printf ("expected res.command = 0x%x, is 0x%x\n", MSPROXY_USERINFO_ACK, ntohs(res.command));
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
list = list->next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
@@ -1,262 +0,0 @@
|
|||||||
/* X-Chat
|
|
||||||
* Copyright (C) 1998 Peter Zelezny.
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
*
|
|
||||||
* MS Proxy (ISA server) support is (c) 2006 Pavel Fedin <sonic_amiga@rambler.ru>
|
|
||||||
* based on Dante source code
|
|
||||||
* Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
|
||||||
* Inferno Nettverk A/S, Norway. All rights reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef HEXCHAT_MSPROXY_H
|
|
||||||
#define HEXCHAT_MSPROXY_H
|
|
||||||
|
|
||||||
#include "network.h"
|
|
||||||
|
|
||||||
#define MSPROXY_EXECUTABLE "hexchat.exe" /* This probably can be used for access control on the server side */
|
|
||||||
|
|
||||||
#define MSPROXY_MINLENGTH 172 /* minimum length of packet. */
|
|
||||||
#define NT_MAXNAMELEN 17 /* maximum name length (domain etc), comes from NetBIOS */
|
|
||||||
#define MSPROXY_VERSION 0x00010200 /* MS Proxy v2 ? */
|
|
||||||
|
|
||||||
/* Commands / responses */
|
|
||||||
#define MSPROXY_HELLO 0x0500 /* packet 1 from client. */
|
|
||||||
#define MSPROXY_HELLO_ACK 0x1000 /* packet 1 from server. */
|
|
||||||
|
|
||||||
#define MSPROXY_USERINFO_ACK 0x0400 /* packet 2 from server. */
|
|
||||||
|
|
||||||
#define MSPROXY_AUTHENTICATE 0x4700 /* authentication request */
|
|
||||||
#define MSPROXY_AUTHENTICATE_ACK 0x4714 /* authentication challenge */
|
|
||||||
|
|
||||||
#define MSPROXY_AUTHENTICATE_2 0x4701 /* authentication response */
|
|
||||||
#define MSPROXY_AUTHENTICATE_2_ACK 0x4715 /* authentication passed */
|
|
||||||
#define MSPROXY_AUTHENTICATE_2_NAK 0x4716 /* authentication failure */
|
|
||||||
|
|
||||||
#define MSPROXY_CONNECT 0x071e /* connect request. */
|
|
||||||
#define MSPROXY_CONNECT_ACK 0x0703 /* connect request accepted. */
|
|
||||||
|
|
||||||
#pragma pack(1)
|
|
||||||
|
|
||||||
struct ntlm_buffer {
|
|
||||||
guint16 len;
|
|
||||||
guint16 alloc;
|
|
||||||
guint32 offset;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct msproxy_request_t {
|
|
||||||
guint32 clientid; /* 1-4 */
|
|
||||||
guint32 magic25; /* 5-8 */
|
|
||||||
guint32 serverid; /* 9-12 */
|
|
||||||
unsigned char serverack; /* 13: ack of last server packet */
|
|
||||||
char pad10[3]; /* 14-16 */
|
|
||||||
unsigned char sequence; /* 17: sequence # of this packet. */
|
|
||||||
char pad11[7]; /* 18-24 */
|
|
||||||
char RWSP[4]; /* 25-28: 0x52,0x57,0x53,0x50 */
|
|
||||||
char pad15[8]; /* 29-36 */
|
|
||||||
guint16 command; /* 37-38 */
|
|
||||||
|
|
||||||
/* packet specifics start at 39. */
|
|
||||||
union {
|
|
||||||
struct {
|
|
||||||
char pad1[18]; /* 39-56 */
|
|
||||||
guint16 magic3; /* 57-58 */
|
|
||||||
char pad3[114]; /* 59-172 */
|
|
||||||
guint16 magic5; /* 173-174: 0x4b, 0x00 */
|
|
||||||
char pad5[2]; /* 175-176 */
|
|
||||||
guint16 magic10; /* 177-178: 0x14, 0x00 */
|
|
||||||
char pad6[2]; /* 179-180 */
|
|
||||||
guint16 magic15; /* 181-182: 0x04, 0x00 */
|
|
||||||
char pad10[2]; /* 183-184 */
|
|
||||||
guint16 magic16; /* 185-186 */
|
|
||||||
char pad11[2]; /* 187-188 */
|
|
||||||
guint16 magic20; /* 189-190: 0x57, 0x04 */
|
|
||||||
guint16 magic25; /* 191-192: 0x00, 0x04 */
|
|
||||||
guint16 magic30; /* 193-194: 0x01, 0x00 */
|
|
||||||
char pad20[2]; /* 195-196: 0x4a, 0x02 */
|
|
||||||
guint16 magic35; /* 197-198: 0x4a, 0x02 */
|
|
||||||
char pad30[10]; /* 199-208 */
|
|
||||||
guint16 magic40; /* 209-210: 0x30, 0x00 */
|
|
||||||
char pad40[2]; /* 211-212 */
|
|
||||||
guint16 magic45; /* 213-214: 0x44, 0x00 */
|
|
||||||
char pad45[2]; /* 215-216 */
|
|
||||||
guint16 magic50; /* 217-218: 0x39, 0x00 */
|
|
||||||
char pad50[2]; /* 219-220 */
|
|
||||||
char data[256]; /* 221-EOP: a sequence of NULL-terminated strings:
|
|
||||||
- username;
|
|
||||||
- empty string (just a NULL);
|
|
||||||
- application name;
|
|
||||||
- hostname */
|
|
||||||
} hello;
|
|
||||||
|
|
||||||
struct {
|
|
||||||
char pad1[4]; /* 39-42 */
|
|
||||||
guint16 magic2; /* 43-44 */
|
|
||||||
char pad10[12]; /* 45-56 */
|
|
||||||
guint32 bindaddr; /* 57-60: address to bind. */
|
|
||||||
guint16 bindport; /* 61-62: port to bind. */
|
|
||||||
char pad15[2]; /* 63-64 */
|
|
||||||
guint16 magic3; /* 65-66 */
|
|
||||||
guint16 boundport; /* 67-68 */
|
|
||||||
char pad20[104]; /* 69-172 */
|
|
||||||
char NTLMSSP[sizeof("NTLMSSP")]; /* 173-180: "NTLMSSP" */
|
|
||||||
guint32 msgtype; /* 181-184: NTLM message type = 1 */
|
|
||||||
guint32 flags; /* 185-188: NTLM message flags */
|
|
||||||
guint16 magic20; /* 189-190: 0x28, 0x00 */
|
|
||||||
char pad30[2]; /* 191-192 */
|
|
||||||
guint16 magic25; /* 193-194: 0x96, 0x82 */
|
|
||||||
guint16 magic30; /* 195-196: 0x01, 0x00 */
|
|
||||||
char pad40[12]; /* 197-208 */
|
|
||||||
guint16 magic50; /* 209-210: 0x30, 0x00 */
|
|
||||||
char pad50[6]; /* 211-216 */
|
|
||||||
guint16 magic55; /* 217-218: 0x30, 0x00 */
|
|
||||||
char pad55[2]; /* 219-220 */
|
|
||||||
char data[0]; /* Dummy end marker, no real data required */
|
|
||||||
} auth;
|
|
||||||
|
|
||||||
struct {
|
|
||||||
char pad1[4]; /* 39-42 */
|
|
||||||
guint16 magic1; /* 43-44 */
|
|
||||||
guint32 magic2; /* 45-48 */
|
|
||||||
char pad2[8]; /* 49-56 */
|
|
||||||
guint16 magic3; /* 57-58 */
|
|
||||||
char pad3[6]; /* 59-64 */
|
|
||||||
guint16 magic4; /* 65-66 */
|
|
||||||
guint16 boundport; /* 67-68 */
|
|
||||||
char pad4[104]; /* 69-172 */
|
|
||||||
char NTLMSSP[sizeof("NTLMSSP")]; /* 173-180: "NTLMSSP" */
|
|
||||||
guint32 msgtype; /* 181-184: NTLM message type = 3 */
|
|
||||||
struct ntlm_buffer lm_resp; /* 185-192: LM response security buffer */
|
|
||||||
struct ntlm_buffer ntlm_resp; /* 193-200: NTLM response security buffer */
|
|
||||||
struct ntlm_buffer ntdomain_buf; /* 201-208: domain name security buffer */
|
|
||||||
struct ntlm_buffer username_buf; /* 209-216: username security buffer */
|
|
||||||
struct ntlm_buffer clienthost_buf; /* 217-224: hostname security buffer */
|
|
||||||
struct ntlm_buffer sessionkey_buf; /* 225-232: session key security buffer */
|
|
||||||
guint32 flags; /* 233-236: message flags */
|
|
||||||
char data[1024]; /* 237-EOP: data area */
|
|
||||||
} auth2;
|
|
||||||
|
|
||||||
struct {
|
|
||||||
guint16 magic1; /* 39-40 */
|
|
||||||
char pad1[2]; /* 41-42 */
|
|
||||||
guint16 magic2; /* 43-44 */
|
|
||||||
guint32 magic3; /* 45-48 */
|
|
||||||
char pad5[8]; /* 48-56 */
|
|
||||||
guint16 magic6; /* 57-58: 0x0200 */
|
|
||||||
guint16 destport; /* 59-60 */
|
|
||||||
guint32 destaddr; /* 61-64 */
|
|
||||||
char pad10[4]; /* 65-68 */
|
|
||||||
guint16 magic10; /* 69-70 */
|
|
||||||
char pad15[2]; /* 71-72 */
|
|
||||||
guint16 srcport; /* 73-74: port client connects from */
|
|
||||||
char pad20[82]; /* 75-156 */
|
|
||||||
char executable[256]; /* 76-EOP: application name */
|
|
||||||
} connect;
|
|
||||||
|
|
||||||
struct {
|
|
||||||
guint16 magic1; /* 39-40 */
|
|
||||||
char pad5[2]; /* 41-42 */
|
|
||||||
guint16 magic5; /* 43-44 */
|
|
||||||
guint32 magic10; /* 45-48 */
|
|
||||||
char pad10[2]; /* 49-50 */
|
|
||||||
guint16 magic15; /* 51-52 */
|
|
||||||
guint32 magic16; /* 53-56 */
|
|
||||||
guint16 magic20; /* 57-58 */
|
|
||||||
guint16 clientport; /* 59-60: forwarded port. */
|
|
||||||
guint32 clientaddr; /* 61-64: forwarded address. */
|
|
||||||
guint32 magic30; /* 65-68 */
|
|
||||||
guint32 magic35; /* 69-72 */
|
|
||||||
guint16 serverport; /* 73-74: port server will connect to us from. */
|
|
||||||
guint16 srcport; /* 75-76: connect request; port used on client behalf. */
|
|
||||||
guint16 boundport; /* 77-78: bind request; port used on client behalf. */
|
|
||||||
guint32 boundaddr; /* 79-82: addr used on client behalf */
|
|
||||||
char pad30[90]; /* 83-172 */
|
|
||||||
char data[0]; /* End marker */
|
|
||||||
} connack;
|
|
||||||
|
|
||||||
} packet;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct msproxy_response_t {
|
|
||||||
guint32 packetid; /* 1-4 */
|
|
||||||
guint32 magic5; /* 5-8 */
|
|
||||||
guint32 serverid; /* 9-12 */
|
|
||||||
char clientack; /* 13: ack of last client packet. */
|
|
||||||
char pad5[3]; /* 14-16 */
|
|
||||||
unsigned char sequence; /* 17: sequence # of this packet. */
|
|
||||||
char pad10[7]; /* 18-24 */
|
|
||||||
char RWSP[4]; /* 25-28: 0x52,0x57,0x53,0x50 */
|
|
||||||
char pad15[8]; /* 29-36 */
|
|
||||||
guint16 command; /* 37-38 */
|
|
||||||
|
|
||||||
union {
|
|
||||||
struct {
|
|
||||||
char pad5[18]; /* 39-56 */
|
|
||||||
guint16 magic20; /* 57-58: 0x02, 0x00 */
|
|
||||||
char pad10[6]; /* 59-64 */
|
|
||||||
guint16 magic30; /* 65-66: 0x74, 0x01 */
|
|
||||||
char pad15[2]; /* 67-68 */
|
|
||||||
guint16 magic35; /* 69-70: 0x0c, 0x00 */
|
|
||||||
char pad20[6]; /* 71-76 */
|
|
||||||
guint16 magic50; /* 77-78: 0x04, 0x00 */
|
|
||||||
char pad30[6]; /* 79-84 */
|
|
||||||
guint16 magic60; /* 85-86: 0x65, 0x05 */
|
|
||||||
char pad35[2]; /* 87-88 */
|
|
||||||
guint16 magic65; /* 89-90: 0x02, 0x00 */
|
|
||||||
char pad40[8]; /* 91-98 */
|
|
||||||
guint16 udpport; /* 99-100 */
|
|
||||||
guint32 udpaddr; /* 101-104 */
|
|
||||||
} hello;
|
|
||||||
|
|
||||||
struct {
|
|
||||||
char pad1[6]; /* 39-44 */
|
|
||||||
guint32 magic10; /* 45-48 */
|
|
||||||
char pad3[10]; /* 49-58 */
|
|
||||||
guint16 boundport; /* 59-60: port server bound for us. */
|
|
||||||
guint32 boundaddr; /* 61-64: addr server bound for us. */
|
|
||||||
char pad10[4]; /* 65-68 */
|
|
||||||
guint16 magic15; /* 69-70 */
|
|
||||||
char pad15[102]; /* 70-172 */
|
|
||||||
char NTLMSSP[sizeof("NTLMSSP")]; /* 173-180: "NTLMSSP" */
|
|
||||||
guint32 msgtype; /* 181-184: NTLM message type = 2 */
|
|
||||||
struct ntlm_buffer target; /* 185-192: target security buffer */
|
|
||||||
guint32 flags; /* 193-196: NTLM message flags */
|
|
||||||
char challenge[8]; /* 197-204: NTLM challenge request */
|
|
||||||
char context[8]; /* 205-212: NTLM context */
|
|
||||||
char data[1024]; /* 213-EOP: target information data */
|
|
||||||
} auth;
|
|
||||||
|
|
||||||
struct {
|
|
||||||
guint16 magic1; /* 39-40 */
|
|
||||||
char pad5[18]; /* 41-58 */
|
|
||||||
guint16 clientport; /* 59-60: forwarded port. */
|
|
||||||
guint32 clientaddr; /* 61-64: forwarded address. */
|
|
||||||
guint32 magic10; /* 65-68 */
|
|
||||||
guint32 magic15; /* 69-72 */
|
|
||||||
guint16 serverport; /* 73-74: port server will connect to us from. */
|
|
||||||
guint16 srcport; /* 75-76: connect request; port used on client behalf. */
|
|
||||||
guint16 boundport; /* 77-78: bind request; port used on client behalf. */
|
|
||||||
guint32 boundaddr; /* 79-82: addr used on client behalf */
|
|
||||||
char pad10[90]; /* 83-172 */
|
|
||||||
} connect;
|
|
||||||
} packet;
|
|
||||||
};
|
|
||||||
|
|
||||||
#pragma pack()
|
|
||||||
|
|
||||||
int traverse_msproxy (int sok, char *serverAddr, int port, struct msproxy_state_t *state, netstore *ns_proxy, int csok4, int csok6, int *csok, char bound);
|
|
||||||
void msproxy_keepalive (void);
|
|
||||||
|
|
||||||
#endif
|
|
@@ -18,370 +18,231 @@
|
|||||||
|
|
||||||
/* ipv4 and ipv6 networking functions with a common interface */
|
/* ipv4 and ipv6 networking functions with a common interface */
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include "config.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
#include <gio/gio.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
#include "../../config-win32.h" /* grab USE_IPV6 and LOOKUPD defines */
|
|
||||||
#else
|
|
||||||
#include <unistd.h>
|
|
||||||
#include "../../config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define WANTSOCKET
|
|
||||||
#define WANTARPA
|
|
||||||
#define WANTDNS
|
|
||||||
#include "inet.h"
|
|
||||||
|
|
||||||
#define NETWORK_PRIVATE
|
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
|
|
||||||
#define RAND_INT(n) ((int)(rand() / (RAND_MAX + 1.0) * (n)))
|
|
||||||
|
|
||||||
|
|
||||||
/* ================== COMMON ================= */
|
|
||||||
|
|
||||||
static void
|
|
||||||
net_set_socket_options (int sok)
|
|
||||||
{
|
|
||||||
socklen_t sw;
|
|
||||||
|
|
||||||
sw = 1;
|
|
||||||
setsockopt (sok, SOL_SOCKET, SO_REUSEADDR, (char *) &sw, sizeof (sw));
|
|
||||||
sw = 1;
|
|
||||||
setsockopt (sok, SOL_SOCKET, SO_KEEPALIVE, (char *) &sw, sizeof (sw));
|
|
||||||
}
|
|
||||||
|
|
||||||
char *
|
|
||||||
net_ip (guint32 addr)
|
|
||||||
{
|
|
||||||
struct in_addr ia;
|
|
||||||
|
|
||||||
ia.s_addr = htonl (addr);
|
|
||||||
return inet_ntoa (ia);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
net_store_destroy (netstore * ns)
|
net_store_destroy (netstore *ns)
|
||||||
{
|
{
|
||||||
#ifdef USE_IPV6
|
g_return_if_fail (ns != NULL);
|
||||||
if (ns->ip6_hostent)
|
|
||||||
freeaddrinfo (ns->ip6_hostent);
|
g_resolver_free_addresses (ns->addrs);
|
||||||
#endif
|
g_free (ns);
|
||||||
free (ns);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
netstore *
|
netstore *
|
||||||
net_store_new (void)
|
net_store_new (void)
|
||||||
{
|
{
|
||||||
netstore *ns;
|
return g_new0 (netstore, 1);
|
||||||
|
|
||||||
ns = malloc (sizeof (netstore));
|
|
||||||
memset (ns, 0, sizeof (netstore));
|
|
||||||
|
|
||||||
return ns;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef USE_IPV6
|
|
||||||
|
|
||||||
/* =================== IPV4 ================== */
|
|
||||||
|
|
||||||
/*
|
|
||||||
A note about net_resolve and lookupd:
|
|
||||||
|
|
||||||
Many IRC networks rely on round-robin DNS for load balancing, rotating the list
|
|
||||||
of IP address on each query. However, this method breaks when DNS queries are
|
|
||||||
cached. Mac OS X and Darwin handle DNS lookups through the lookupd daemon, which
|
|
||||||
caches queries in its default configuration: thus, if we always pick the first
|
|
||||||
address, we will be stuck with the same host (which might be down!) until the
|
|
||||||
TTL reaches 0 or lookupd is reset (typically, at reboot). Therefore, we need to
|
|
||||||
pick a random address from the result list, instead of always using the first.
|
|
||||||
*/
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
net_resolve (netstore * ns, char *hostname, int port, char **real_host)
|
net_resolve (netstore *ns, char *hostname, char **real_host, GError **error)
|
||||||
{
|
{
|
||||||
ns->ip4_hostent = gethostbyname (hostname);
|
GResolver *res;
|
||||||
if (!ns->ip4_hostent)
|
GList *addrs;
|
||||||
|
GInetAddress *addr;
|
||||||
|
char *ipstring;
|
||||||
|
|
||||||
|
res = g_resolver_get_default ();
|
||||||
|
|
||||||
|
// todo: lookup by irc service?
|
||||||
|
addrs = g_resolver_lookup_by_name (res, hostname, NULL, error);
|
||||||
|
if (!addrs)
|
||||||
|
{
|
||||||
|
g_object_unref (res);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
memset (&ns->addr, 0, sizeof (ns->addr));
|
ns->addrs = addrs;
|
||||||
#ifdef LOOKUPD
|
addr = G_INET_ADDRESS(addrs->data);
|
||||||
int count = 0;
|
ipstring = g_inet_address_to_string (addr);
|
||||||
while (ns->ip4_hostent->h_addr_list[count]) count++;
|
|
||||||
memcpy (&ns->addr.sin_addr,
|
|
||||||
ns->ip4_hostent->h_addr_list[RAND_INT(count)],
|
|
||||||
ns->ip4_hostent->h_length);
|
|
||||||
#else
|
|
||||||
memcpy (&ns->addr.sin_addr, ns->ip4_hostent->h_addr,
|
|
||||||
ns->ip4_hostent->h_length);
|
|
||||||
#endif
|
|
||||||
ns->addr.sin_port = htons (port);
|
|
||||||
ns->addr.sin_family = AF_INET;
|
|
||||||
|
|
||||||
*real_host = strdup (ns->ip4_hostent->h_name);
|
if (real_host)
|
||||||
return strdup (inet_ntoa (ns->addr.sin_addr));
|
{
|
||||||
}
|
if (!(*real_host = g_resolver_lookup_by_address (res, addr, NULL, NULL)))
|
||||||
|
*real_host = g_strdup (hostname);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
g_object_unref (res);
|
||||||
net_connect (netstore * ns, int sok4, int sok6, int *sok_return)
|
|
||||||
{
|
|
||||||
*sok_return = sok4;
|
|
||||||
return connect (sok4, (struct sockaddr *) &ns->addr, sizeof (ns->addr));
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
return ipstring;
|
||||||
net_bind (netstore * tobindto, int sok4, int sok6)
|
|
||||||
{
|
|
||||||
bind (sok4, (struct sockaddr *) &tobindto->addr, sizeof (tobindto->addr));
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
net_sockets (int *sok4, int *sok6)
|
|
||||||
{
|
|
||||||
*sok4 = socket (AF_INET, SOCK_STREAM, 0);
|
|
||||||
*sok6 = -1;
|
|
||||||
net_set_socket_options (*sok4);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
udp_sockets (int *sok4, int *sok6)
|
|
||||||
{
|
|
||||||
*sok4 = socket (AF_INET, SOCK_DGRAM, 0);
|
|
||||||
*sok6 = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
net_store_fill_any (netstore *ns)
|
|
||||||
{
|
|
||||||
ns->addr.sin_family = AF_INET;
|
|
||||||
ns->addr.sin_addr.s_addr = INADDR_ANY;
|
|
||||||
ns->addr.sin_port = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
net_store_fill_v4 (netstore *ns, guint32 addr, int port)
|
|
||||||
{
|
|
||||||
ns->addr.sin_family = AF_INET;
|
|
||||||
ns->addr.sin_addr.s_addr = addr;
|
|
||||||
ns->addr.sin_port = port;
|
|
||||||
}
|
|
||||||
|
|
||||||
guint32
|
|
||||||
net_getsockaddr_v4 (netstore *ns)
|
|
||||||
{
|
|
||||||
return ns->addr.sin_addr.s_addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
net_getsockport (int sok4, int sok6)
|
|
||||||
{
|
|
||||||
struct sockaddr_in addr;
|
|
||||||
int len = sizeof (addr);
|
|
||||||
|
|
||||||
if (getsockname (sok4, (struct sockaddr *)&addr, &len) == -1)
|
|
||||||
return -1;
|
|
||||||
return addr.sin_port;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* =================== IPV6 ================== */
|
|
||||||
|
|
||||||
char *
|
|
||||||
net_resolve (netstore * ns, char *hostname, int port, char **real_host)
|
|
||||||
{
|
|
||||||
struct addrinfo hints;
|
|
||||||
char ipstring[MAX_HOSTNAME];
|
|
||||||
char portstring[MAX_HOSTNAME];
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* if (ns->ip6_hostent)
|
|
||||||
freeaddrinfo (ns->ip6_hostent);*/
|
|
||||||
|
|
||||||
sprintf (portstring, "%d", port);
|
|
||||||
|
|
||||||
memset (&hints, 0, sizeof (struct addrinfo));
|
|
||||||
hints.ai_family = PF_UNSPEC; /* support ipv6 and ipv4 */
|
|
||||||
hints.ai_flags = AI_CANONNAME | AI_ADDRCONFIG;
|
|
||||||
hints.ai_socktype = SOCK_STREAM;
|
|
||||||
|
|
||||||
if (port == 0)
|
|
||||||
ret = getaddrinfo (hostname, NULL, &hints, &ns->ip6_hostent);
|
|
||||||
else
|
|
||||||
ret = getaddrinfo (hostname, portstring, &hints, &ns->ip6_hostent);
|
|
||||||
if (ret != 0)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
#ifdef LOOKUPD /* See note about lookupd above the IPv4 version of net_resolve. */
|
|
||||||
struct addrinfo *tmp;
|
|
||||||
int count = 0;
|
|
||||||
|
|
||||||
for (tmp = ns->ip6_hostent; tmp; tmp = tmp->ai_next)
|
|
||||||
count ++;
|
|
||||||
|
|
||||||
count = RAND_INT(count);
|
|
||||||
|
|
||||||
while (count--) ns->ip6_hostent = ns->ip6_hostent->ai_next;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* find the numeric IP number */
|
|
||||||
ipstring[0] = 0;
|
|
||||||
getnameinfo (ns->ip6_hostent->ai_addr, ns->ip6_hostent->ai_addrlen,
|
|
||||||
ipstring, sizeof (ipstring), NULL, 0, NI_NUMERICHOST);
|
|
||||||
|
|
||||||
if (ns->ip6_hostent->ai_canonname)
|
|
||||||
*real_host = strdup (ns->ip6_hostent->ai_canonname);
|
|
||||||
else
|
|
||||||
*real_host = strdup (hostname);
|
|
||||||
|
|
||||||
return strdup (ipstring);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the only thing making this interface unclean, this shitty sok4, sok6 business */
|
/* the only thing making this interface unclean, this shitty sok4, sok6 business */
|
||||||
|
|
||||||
int
|
GSocket *
|
||||||
net_connect (netstore * ns, int sok4, int sok6, int *sok_return)
|
net_connect (netstore *ns, guint16 port, GSocket *sok4, GSocket *sok6, GError **error)
|
||||||
{
|
{
|
||||||
struct addrinfo *res, *res0;
|
GSocket *sok;
|
||||||
int error = -1;
|
GList *addrs;
|
||||||
|
gboolean success;
|
||||||
|
|
||||||
res0 = ns->ip6_hostent;
|
for (addrs = ns->addrs; addrs; addrs = g_list_next (addrs))
|
||||||
|
|
||||||
for (res = res0; res; res = res->ai_next)
|
|
||||||
{
|
{
|
||||||
/* sok = socket (res->ai_family, res->ai_socktype, res->ai_protocol);
|
GInetAddress *inet_addr = G_INET_ADDRESS(addrs->data);
|
||||||
if (sok < 0)
|
GSocketAddress *sok_addr;
|
||||||
continue;*/
|
|
||||||
switch (res->ai_family)
|
g_clear_error (error); /* Last failed attempt set */
|
||||||
|
|
||||||
|
sok_addr = g_inet_socket_address_new (inet_addr, port);
|
||||||
|
if (g_socket_address_get_family (sok_addr) == G_SOCKET_FAMILY_IPV4)
|
||||||
|
sok = sok4;
|
||||||
|
else
|
||||||
|
sok = sok6;
|
||||||
|
success = g_socket_connect (sok, sok_addr, NULL, error);
|
||||||
|
g_object_unref (sok_addr);
|
||||||
|
|
||||||
|
if (success)
|
||||||
|
return sok;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
net_bind (netstore *ns, GSocket *sok4, GSocket *sok6, GError **error4, GError **error6)
|
||||||
|
{
|
||||||
|
GInetAddress *inet_addr = G_INET_ADDRESS(ns->addrs->data);
|
||||||
|
GSocketAddress *sok_addr;
|
||||||
|
gboolean success;
|
||||||
|
|
||||||
|
sok_addr = g_inet_socket_address_new (inet_addr, 0);
|
||||||
|
success = g_socket_bind (sok4, sok_addr, TRUE, error4);
|
||||||
|
success &= g_socket_bind (sok6, sok_addr, TRUE, error6);
|
||||||
|
g_object_unref (sok_addr);
|
||||||
|
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
net_sockets (GSocket **sok4, GSocket **sok6, GError **error4, GError **error6)
|
||||||
|
{
|
||||||
|
*sok4 = g_socket_new (G_SOCKET_FAMILY_IPV4, G_SOCKET_TYPE_STREAM, G_SOCKET_PROTOCOL_TCP, error4);
|
||||||
|
*sok6 = g_socket_new (G_SOCKET_FAMILY_IPV6, G_SOCKET_TYPE_STREAM, G_SOCKET_PROTOCOL_TCP, error6);
|
||||||
|
|
||||||
|
if (!*sok4 || !*sok6)
|
||||||
|
{
|
||||||
|
g_warning ("Creating sockets failed\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_socket_set_keepalive (*sok4, TRUE);
|
||||||
|
g_socket_set_keepalive (*sok6, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
net_resolve_proxy (const char *hostname, guint16 port, GError **error)
|
||||||
|
{
|
||||||
|
GProxyResolver *res;
|
||||||
|
char *uri;
|
||||||
|
char **proxies;
|
||||||
|
char *proxy = NULL;
|
||||||
|
guint i;
|
||||||
|
|
||||||
|
res = g_proxy_resolver_get_default ();
|
||||||
|
if (!res)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// FIXME: ircs also
|
||||||
|
uri = g_strdup_printf ("irc://%s:%d", hostname, port);
|
||||||
|
proxies = g_proxy_resolver_lookup (res, uri, NULL, error);
|
||||||
|
g_free (uri);
|
||||||
|
if (g_strv_length (proxies) == 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
for (i = 0; i < g_strv_length (proxies); i++)
|
||||||
|
{
|
||||||
|
int type;
|
||||||
|
|
||||||
|
net_parse_proxy_uri (proxies[i], NULL, NULL, &type);
|
||||||
|
|
||||||
|
if (type != -1)
|
||||||
{
|
{
|
||||||
case AF_INET:
|
proxy = g_strdup (proxies[i]);
|
||||||
error = connect (sok4, res->ai_addr, res->ai_addrlen);
|
|
||||||
*sok_return = sok4;
|
|
||||||
break;
|
break;
|
||||||
case AF_INET6:
|
|
||||||
error = connect (sok6, res->ai_addr, res->ai_addrlen);
|
|
||||||
*sok_return = sok6;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
error = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error == 0)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
g_strfreev (proxies);
|
||||||
|
|
||||||
return error;
|
if (!proxy) /* FIXME: error code */
|
||||||
|
*error = g_error_new_literal (0, 0, "No system proxy found that is supported");
|
||||||
|
|
||||||
|
return proxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
net_bind (netstore * tobindto, int sok4, int sok6)
|
net_parse_proxy_uri (const char *proxy_uri, char **host, guint16 *port, int *type)
|
||||||
{
|
{
|
||||||
bind (sok4, tobindto->ip6_hostent->ai_addr,
|
if (type)
|
||||||
tobindto->ip6_hostent->ai_addrlen);
|
{
|
||||||
bind (sok6, tobindto->ip6_hostent->ai_addr,
|
char *scheme = g_uri_parse_scheme (proxy_uri);
|
||||||
tobindto->ip6_hostent->ai_addrlen);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
if (!strcmp (scheme, "direct"))
|
||||||
net_sockets (int *sok4, int *sok6)
|
*type = 0;
|
||||||
{
|
else if (!strcmp (scheme, "http"))
|
||||||
*sok4 = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
*type = 4;
|
||||||
*sok6 = socket (AF_INET6, SOCK_STREAM, IPPROTO_TCP);
|
else if (!strcmp (scheme, "socks5"))
|
||||||
net_set_socket_options (*sok4);
|
*type = 3;
|
||||||
net_set_socket_options (*sok6);
|
else if (!strcmp (scheme, "socks"))
|
||||||
}
|
*type = 2;
|
||||||
|
else
|
||||||
|
*type = -1;
|
||||||
|
|
||||||
void
|
g_free (scheme);
|
||||||
udp_sockets (int *sok4, int *sok6)
|
|
||||||
{
|
|
||||||
*sok4 = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
|
||||||
*sok6 = socket (AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* the following functions are used only by MSPROXY and are not
|
|
||||||
proper ipv6 implementations - do not use in new code! */
|
|
||||||
|
|
||||||
void
|
|
||||||
net_store_fill_any (netstore *ns)
|
|
||||||
{
|
|
||||||
struct addrinfo *ai;
|
|
||||||
struct sockaddr_in *sin;
|
|
||||||
|
|
||||||
ai = ns->ip6_hostent;
|
|
||||||
if (!ai) {
|
|
||||||
ai = malloc (sizeof (struct addrinfo));
|
|
||||||
memset (ai, 0, sizeof (struct addrinfo));
|
|
||||||
ns->ip6_hostent = ai;
|
|
||||||
}
|
}
|
||||||
sin = (struct sockaddr_in *)ai->ai_addr;
|
|
||||||
if (!sin) {
|
if (host)
|
||||||
sin = malloc (sizeof (struct sockaddr_in));
|
{
|
||||||
memset (sin, 0, sizeof (struct sockaddr_in));
|
char *c1, *c2;
|
||||||
ai->ai_addr = (struct sockaddr *)sin;
|
|
||||||
|
c1 = strchr (proxy_uri, ':') + 3;
|
||||||
|
if (c1)
|
||||||
|
{
|
||||||
|
c2 = strrchr (c1, ':');
|
||||||
|
|
||||||
|
if (c2)
|
||||||
|
*host = g_strndup (c1, c2 - c1);
|
||||||
|
else
|
||||||
|
*host = g_strdup (c1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*host = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (port)
|
||||||
|
{
|
||||||
|
char *c;
|
||||||
|
guint64 p;
|
||||||
|
|
||||||
|
c = strrchr (proxy_uri, ':');
|
||||||
|
if (c)
|
||||||
|
{
|
||||||
|
p = g_ascii_strtoull (c + 1, NULL, 0);
|
||||||
|
if (p <= G_MAXUINT16)
|
||||||
|
*port = (guint16)p;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*port = 0;
|
||||||
}
|
}
|
||||||
ai->ai_family = AF_INET;
|
|
||||||
ai->ai_addrlen = sizeof(struct sockaddr_in);
|
|
||||||
sin->sin_family = AF_INET;
|
|
||||||
sin->sin_addr.s_addr = INADDR_ANY;
|
|
||||||
sin->sin_port = 0;
|
|
||||||
ai->ai_next = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
guint16
|
||||||
net_store_fill_v4 (netstore *ns, guint32 addr, int port)
|
net_get_local_port (GSocket *sok)
|
||||||
{
|
{
|
||||||
struct addrinfo *ai;
|
GSocketAddress *addr;
|
||||||
struct sockaddr_in *sin;
|
guint16 port;
|
||||||
|
|
||||||
ai = ns->ip6_hostent;
|
addr = g_socket_get_local_address (sok, NULL);
|
||||||
if (!ai) {
|
if (!addr)
|
||||||
ai = malloc (sizeof (struct addrinfo));
|
return 0;
|
||||||
memset (ai, 0, sizeof (struct addrinfo));
|
|
||||||
ns->ip6_hostent = ai;
|
port = g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS(addr));
|
||||||
}
|
g_object_unref (addr);
|
||||||
sin = (struct sockaddr_in *)ai->ai_addr;
|
|
||||||
if (!sin) {
|
return port;
|
||||||
sin = malloc (sizeof (struct sockaddr_in));
|
|
||||||
memset (sin, 0, sizeof (struct sockaddr_in));
|
|
||||||
ai->ai_addr = (struct sockaddr *)sin;
|
|
||||||
}
|
|
||||||
ai->ai_family = AF_INET;
|
|
||||||
ai->ai_addrlen = sizeof(struct sockaddr_in);
|
|
||||||
sin->sin_family = AF_INET;
|
|
||||||
sin->sin_addr.s_addr = addr;
|
|
||||||
sin->sin_port = port;
|
|
||||||
ai->ai_next = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
guint32
|
|
||||||
net_getsockaddr_v4 (netstore *ns)
|
|
||||||
{
|
|
||||||
struct addrinfo *ai;
|
|
||||||
struct sockaddr_in *sin;
|
|
||||||
|
|
||||||
ai = ns->ip6_hostent;
|
|
||||||
|
|
||||||
while (ai->ai_family != AF_INET) {
|
|
||||||
ai = ai->ai_next;
|
|
||||||
if (!ai)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
sin = (struct sockaddr_in *)ai->ai_addr;
|
|
||||||
return sin->sin_addr.s_addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
net_getsockport (int sok4, int sok6)
|
|
||||||
{
|
|
||||||
struct sockaddr_in addr;
|
|
||||||
int len = sizeof (addr);
|
|
||||||
|
|
||||||
if (getsockname (sok4, (struct sockaddr *)&addr, &len) == -1)
|
|
||||||
return -1;
|
|
||||||
return addr.sin_port;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user