From d1d677615e12d759b6cdf7ce23a493bc055ef37f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 7 Nov 2005 17:20:37 +0100 Subject: Import win32 branch --- Makefile | 8 +- win32.c | 191 ++++++++++++++++++++++++++ win32/BUILD.TXT | 22 +++ win32/MainDlg.cpp | 78 +++++++++++ win32/MainDlg.h | 52 +++++++ win32/PropAccess.cpp | 123 +++++++++++++++++ win32/PropAccess.h | 56 ++++++++ win32/PropConn.cpp | 125 +++++++++++++++++ win32/PropConn.h | 56 ++++++++ win32/PropLog.cpp | 80 +++++++++++ win32/PropLog.h | 47 +++++++ win32/PropPaths.cpp | 119 ++++++++++++++++ win32/PropPaths.h | 55 ++++++++ win32/PropUsers.cpp | 120 ++++++++++++++++ win32/PropUsers.h | 54 ++++++++ win32/TrayNot.cpp | 106 +++++++++++++++ win32/TrayNot.h | 54 ++++++++ win32/bitlbee.dsp | 338 +++++++++++++++++++++++++++++++++++++++++++++ win32/bitlbee.dsw | 107 +++++++++++++++ win32/bitlbee.iss | 73 ++++++++++ win32/bitlbee.rc | 354 ++++++++++++++++++++++++++++++++++++++++++++++++ win32/bitlbee_ssl.dsp | 99 ++++++++++++++ win32/bitlbeewin.cpp | 210 ++++++++++++++++++++++++++++ win32/bitlbeewin.h | 59 ++++++++ win32/configure.mingw32 | 37 +++++ win32/jabber.dsp | 228 +++++++++++++++++++++++++++++++ win32/msn.dsp | 116 ++++++++++++++++ win32/oscar.dsp | 204 ++++++++++++++++++++++++++++ win32/res/bmp00002.bmp | Bin 0 -> 5830 bytes win32/res/icon2.ico | Bin 0 -> 3774 bytes win32/resource.h | 60 ++++++++ win32/yahoo.dsp | 152 +++++++++++++++++++++ 32 files changed, 3382 insertions(+), 1 deletion(-) create mode 100644 win32.c create mode 100644 win32/BUILD.TXT create mode 100644 win32/MainDlg.cpp create mode 100644 win32/MainDlg.h create mode 100644 win32/PropAccess.cpp create mode 100644 win32/PropAccess.h create mode 100644 win32/PropConn.cpp create mode 100644 win32/PropConn.h create mode 100644 win32/PropLog.cpp create mode 100644 win32/PropLog.h create mode 100644 win32/PropPaths.cpp create mode 100644 win32/PropPaths.h create mode 100644 win32/PropUsers.cpp create mode 100644 win32/PropUsers.h create mode 100644 win32/TrayNot.cpp create mode 100644 win32/TrayNot.h create mode 100644 win32/bitlbee.dsp create mode 100644 win32/bitlbee.dsw create mode 100644 win32/bitlbee.iss create mode 100644 win32/bitlbee.rc create mode 100644 win32/bitlbee_ssl.dsp create mode 100644 win32/bitlbeewin.cpp create mode 100644 win32/bitlbeewin.h create mode 100644 win32/configure.mingw32 create mode 100644 win32/jabber.dsp create mode 100644 win32/msn.dsp create mode 100644 win32/oscar.dsp create mode 100644 win32/res/bmp00002.bmp create mode 100644 win32/res/icon2.ico create mode 100644 win32/resource.h create mode 100644 win32/yahoo.dsp diff --git a/Makefile b/Makefile index 80fbbf0b..15243459 100644 --- a/Makefile +++ b/Makefile @@ -9,9 +9,15 @@ -include Makefile.settings # Program variables -objects = account.o bitlbee.o commands.o conf.o crypting.o help.o ini.o irc.o log.o nick.o query.o set.o unix.o url.o user.o debug.o +objects = account.o bitlbee.o commands.o crypting.o help.o ini.o irc.o nick.o query.o set.o url.o user.o debug.o log.o subdirs = protocols +ifeq ($(ARCH),Windows) +objects += win32.o +else +objects += unix.o conf.o +endif + # Expansion of variables subdirobjs = $(foreach dir,$(subdirs),$(dir)/$(dir).o) CFLAGS += -Wall diff --git a/win32.c b/win32.c new file mode 100644 index 00000000..5234c046 --- /dev/null +++ b/win32.c @@ -0,0 +1,191 @@ + /********************************************************************\ + * BitlBee -- An IRC to other IM-networks gateway * + * * + * Copyright 2002-2004 Wilmer van der Gaast and others * + \********************************************************************/ + +/* Main file (Unix specific part) */ + +/* + 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 with + the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL; + if not, write to the Free Software Foundation, Inc., 59 Temple Place, + Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "bitlbee.h" +#include "commands.h" +#include "crypting.h" +#include "protocols/nogaim.h" +#include "help.h" +#include +#include +#include +#include +#include + +global_t global; /* Against global namespace pollution */ + +int main( int argc, char *argv[] ) +{ + int i = -1; + memset( &global, 0, sizeof( global_t ) ); + + global.loop = g_main_new( FALSE ); + + log_init( ); + nogaim_init( ); + + global.conf = conf_load( argc, argv ); + if( global.conf == NULL ) + return( 1 ); + + if( global.conf->runmode == RUNMODE_INETD ) + { + i = bitlbee_inetd_init(); + log_message( LOGLVL_INFO, "Bitlbee %s starting in inetd mode.", BITLBEE_VERSION ); + + } + else if( global.conf->runmode == RUNMODE_DAEMON ) + { + i = bitlbee_daemon_init(); + log_message( LOGLVL_INFO, "Bitlbee %s starting in daemon mode.", BITLBEE_VERSION ); + } + else + { + log_message( LOGLVL_INFO, "No bitlbee mode specified..."); + } + + if( i != 0 ) + return( i ); + + if( access( global.conf->configdir, F_OK ) != 0 ) + log_message( LOGLVL_WARNING, "The configuration directory %s does not exist. Configuration won't be saved.", global.conf->configdir ); + else if( access( global.conf->configdir, R_OK ) != 0 || access( global.conf->configdir, W_OK ) != 0 ) + log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to %s.", global.conf->configdir ); + if( help_init( &(global.help) ) == NULL ) + log_message( LOGLVL_WARNING, "Error opening helpfile %s.", global.helpfile ); + + g_main_run( global.loop ); + + return( 0 ); +} + +double gettime() +{ + return (GetTickCount() / 1000); +} + +void conf_get_string(HKEY section, const char *name, const char *def, char **dest) +{ + char buf[4096]; + long x; + if (RegQueryValue(section, name, buf, &x) == ERROR_SUCCESS) { + *dest = g_strdup(buf); + } else if (!def) { + *dest = NULL; + } else { + *dest = g_strdup(def); + } +} + + +void conf_get_int(HKEY section, const char *name, int def, int *dest) +{ + char buf[20]; + long x; + DWORD y; + if (RegQueryValue(section, name, buf, &x) == ERROR_SUCCESS) { + memcpy(&y, buf, sizeof(DWORD)); + *dest = y; + } else { + *dest = def; + } +} + +conf_t *conf_load( int argc, char *argv[] ) +{ + conf_t *conf; + HKEY key, key_main, key_proxy; + char *tmp; + RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Bitlbee", &key); + RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Bitlbee\\main", &key_main); + RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Bitlbee\\proxy", &key_proxy); + + memset( &global, 0, sizeof( global_t ) ); + global.loop = g_main_new(FALSE); + nogaim_init(); + + conf = g_new0( conf_t,1 ); + global.conf = conf; + conf_get_string(key_main, "interface", "0.0.0.0", &global.conf->iface); + conf_get_int(key_main, "port", 6667, &global.conf->port); + conf_get_int(key_main, "verbose", 0, &global.conf->verbose); + conf_get_string(key_main, "password", "", &global.conf->password); + conf_get_int(key_main, "ping_interval_timeout", 60, &global.conf->ping_interval); + conf_get_string(key_main, "hostname", "localhost", &global.conf->hostname); + conf_get_string(key_main, "configdir", NULL, &global.conf->configdir); + conf_get_string(key_main, "motdfile", NULL, &global.conf->motdfile); + conf_get_string(key_main, "helpfile", NULL, &global.helpfile); + global.conf->runmode = RUNMODE_INETD; + conf_get_int(key_main, "AuthMode", AUTHMODE_CLOSED, &global.conf->authmode); + conf_get_string(key_proxy, "host", "", &tmp); strcpy(proxyhost, tmp); + conf_get_string(key_proxy, "user", "", &tmp); strcpy(proxyuser, tmp); + conf_get_string(key_proxy, "password", "", &tmp); strcpy(proxypass, tmp); + conf_get_int(key_proxy, "type", PROXY_NONE, &proxytype); + conf_get_int(key_proxy, "port", 3128, &proxyport); + + RegCloseKey(key); + RegCloseKey(key_main); + RegCloseKey(key_proxy); + + return conf; +} + +void conf_loaddefaults( irc_t *irc ) +{ + HKEY key_defaults; + int i; + char name[4096], data[4096]; + DWORD namelen = sizeof(name), datalen = sizeof(data); + DWORD type; + if (RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Bitlbee\\defaults", &key_defaults) != ERROR_SUCCESS) { + return; + } + + for (i = 0; RegEnumValue(key_defaults, i, name, &namelen, NULL, &type, data, &datalen) == ERROR_SUCCESS; i++) { + set_t *s = set_find( irc, name ); + + if( s ) + { + if( s->def ) g_free( s->def ); + s->def = g_strdup( data ); + } + + namelen = sizeof(name); + datalen = sizeof(data); + } + + RegCloseKey(key_defaults); +} + +#ifndef INADDR_NONE +#define INADDR_NONE 0xffffffff +#endif + +int +inet_aton(const char *cp, struct in_addr *addr) +{ + addr->s_addr = inet_addr(cp); + return (addr->s_addr == INADDR_NONE) ? 0 : 1; +} diff --git a/win32/BUILD.TXT b/win32/BUILD.TXT new file mode 100644 index 00000000..718152b7 --- /dev/null +++ b/win32/BUILD.TXT @@ -0,0 +1,22 @@ +Instructions for building the Bitlbee Win32 port +================================================ + +1. Download the latest version using bzr (http://www.bazaar-ng.org/): + bzr branch http://jelmer.vernstok.nl/oss/bitlbee/bzr/win32 bitlbee-win32 +2. Download and install the required development files: + from http://www.ethereal.com/distribution/win32/development/: + - libiconv + - glib + - glib-dev + from http://ftp.mozilla.org/pub/mozilla.org/ + - nss + - nspr + +I've put them inside c:\dev, so you might have the most with that location. + +3. Open bitlbee.dsw in VC++ and build :-) + +4. Now you're done. When running, make sure all the required DLL's are accessible. If they can't be found, place them inside c:\winnt\system32 or the Debug or Release directories inside bitlbee-...\win32\. + +5. To build setup files, compile the bitlbee.iss file using the Inno Setup + program (available from www.jrsoftware.org). diff --git a/win32/MainDlg.cpp b/win32/MainDlg.cpp new file mode 100644 index 00000000..615a9a3b --- /dev/null +++ b/win32/MainDlg.cpp @@ -0,0 +1,78 @@ +// MainDlg.cpp : implementation file +// + +#define BITLBEE_CORE +#include "bitlbeewin.h" +#include "PropUsers.h" +#include "PropPaths.h" +#include "PropAccess.h" +#include "PropLog.h" +#include "PropConn.h" +#include "MainDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CMainDlg + +IMPLEMENT_DYNAMIC(CMainDlg, CPropertySheet) + +CMainDlg::CMainDlg() : CPropertySheet("Bitlbee for Windows") +{ + AddPage(new CPropPaths()); + AddPage(new CPropAccess()); + AddPage(new CPropUsers()); + AddPage(new CPropLog()); + AddPage(new CPropertyPage(IDD_PROPPAGE_ABOUT)); + AddPage(new CPropConn()); + Create(); + ShowWindow(SW_HIDE); +} + +CMainDlg::~CMainDlg() +{ +} + + +BEGIN_MESSAGE_MAP(CMainDlg, CPropertySheet) + //{{AFX_MSG_MAP(CMainDlg) + ON_WM_CLOSE() + //}}AFX_MSG_MAP + ON_BN_CLICKED(IDOK, OnOK) +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CMainDlg message handlers + +BOOL CMainDlg::OnInitDialog() +{ + m_bModeless = FALSE; + m_nFlags |= WF_CONTINUEMODAL; + + CPropertySheet::OnInitDialog(); + GetDlgItem(IDHELP)->ShowWindow(SW_HIDE); + GetDlgItem(IDCANCEL)->ShowWindow(SW_HIDE); + + m_bModeless = TRUE; + m_nFlags &= WF_CONTINUEMODAL; + + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} + +void CMainDlg::OnOK() +{ + PressButton(PSBTN_APPLYNOW); + ShowWindow(SW_HIDE); +} + + +void CMainDlg::OnClose() +{ + ShowWindow(SW_HIDE); +} + diff --git a/win32/MainDlg.h b/win32/MainDlg.h new file mode 100644 index 00000000..7cdf612b --- /dev/null +++ b/win32/MainDlg.h @@ -0,0 +1,52 @@ +#if !defined(AFX_MAINDLG_H__D88FFF4C_047D_4562_A041_CCDCFA52F87C__INCLUDED_) +#define AFX_MAINDLG_H__D88FFF4C_047D_4562_A041_CCDCFA52F87C__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +// MainDlg.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CMainDlg + +class CMainDlg : public CPropertySheet +{ + DECLARE_DYNAMIC(CMainDlg) + +// Construction +public: + CMainDlg(); + +// Attributes +public: + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CMainDlg) + //}}AFX_VIRTUAL + +// Implementation +public: + virtual ~CMainDlg(); + + // Generated message map functions +protected: + //{{AFX_MSG(CMainDlg) + virtual BOOL OnInitDialog(); + afx_msg void OnClose(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +private: + void OnOK(); +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_MAINDLG_H__D88FFF4C_047D_4562_A041_CCDCFA52F87C__INCLUDED_) diff --git a/win32/PropAccess.cpp b/win32/PropAccess.cpp new file mode 100644 index 00000000..fd787b39 --- /dev/null +++ b/win32/PropAccess.cpp @@ -0,0 +1,123 @@ +// PropAccess.cpp : implementation file +// + +#define BITLBEE_CORE +#include "bitlbeewin.h" +#include "PropAccess.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CPropAccess dialog + + +CPropAccess::CPropAccess() + : CPropertyPage(CPropAccess::IDD) +{ + + //{{AFX_DATA_INIT(CPropAccess) + //}}AFX_DATA_INIT +} + + +void CPropAccess::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CPropAccess) + DDX_Control(pDX, IDC_AUTH_REGISTERED, m_auth_registered); + DDX_Control(pDX, IDC_AUTH_OPEN, m_auth_open); + DDX_Control(pDX, IDC_AUTH_CLOSED, m_auth_closed); + DDX_Control(pDX, IDC_PASSWORD, m_password); + DDX_Control(pDX, IDC_PORT, m_port); + DDX_Control(pDX, IDC_INTERFACE, m_interface); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CPropAccess, CPropertyPage) + //{{AFX_MSG_MAP(CPropAccess) + ON_BN_CLICKED(IDC_AUTH_REGISTERED, OnAuthRegistered) + ON_BN_CLICKED(IDC_AUTH_OPEN, OnAuthOpen) + ON_BN_CLICKED(IDC_AUTH_CLOSED, OnAuthClosed) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CPropAccess message handlers + +void CPropAccess::OnOK() +{ + CString iface; m_interface.GetWindowText(iface); + CString port; m_port.GetWindowText(port); + + CString password; m_password.GetWindowText(password); + g_free((void *)global.conf->password); + global.conf->password = g_strdup(password); + + if(m_auth_closed.GetCheck() == 1) global.conf->authmode = AUTHMODE_CLOSED; + if(m_auth_open.GetCheck() == 1) global.conf->authmode = AUTHMODE_OPEN; + if(m_auth_registered.GetCheck() == 1) global.conf->authmode = AUTHMODE_REGISTERED; + + if(strcmp(iface, global.conf->iface) || atol(port) != global.conf->port) { + global.conf->port = atoi(port); + g_free((void *)global.conf->iface); + global.conf->iface = g_strdup(iface); + closesocket(global.listen_socket); + bitlbee_daemon_init(); + } + + + CPropertyPage::OnOK(); +} + +void CPropAccess::OnAuthRegistered() +{ + m_password.EnableWindow(FALSE); + m_auth_open.SetCheck(0); + m_auth_registered.SetCheck(1); + m_auth_closed.SetCheck(0); + +} + +void CPropAccess::OnAuthOpen() +{ + m_password.EnableWindow(FALSE); + m_auth_open.SetCheck(1); + m_auth_registered.SetCheck(0); + m_auth_closed.SetCheck(0); +} + +void CPropAccess::OnAuthClosed() +{ + m_password.EnableWindow(TRUE); + m_auth_open.SetCheck(0); + m_auth_registered.SetCheck(0); + m_auth_closed.SetCheck(1); + +} + +BOOL CPropAccess::OnInitDialog() +{ + CPropertyPage::OnInitDialog(); + + m_interface.SetWindowText(global.conf->iface); + m_password.SetWindowText(global.conf->password); + char tmp[20]; + g_snprintf(tmp, sizeof(tmp), "%d", global.conf->port); + m_port.SetWindowText(tmp); + m_auth_open.SetCheck(0); + m_auth_closed.SetCheck(0); + m_auth_registered.SetCheck(0); + + switch(global.conf->authmode) { + case AUTHMODE_OPEN: m_auth_open.SetCheck(1); m_password.EnableWindow(FALSE);break; + case AUTHMODE_CLOSED: m_auth_closed.SetCheck(1); m_password.EnableWindow(TRUE);break; + case AUTHMODE_REGISTERED: m_auth_registered.SetCheck(1);m_password.EnableWindow(FALSE);break; + } + + return TRUE; +} diff --git a/win32/PropAccess.h b/win32/PropAccess.h new file mode 100644 index 00000000..bc80c648 --- /dev/null +++ b/win32/PropAccess.h @@ -0,0 +1,56 @@ +#if !defined(AFX_PROPACCESS_H__0AC45777_B43C_4467_91FF_391DFD582057__INCLUDED_) +#define AFX_PROPACCESS_H__0AC45777_B43C_4467_91FF_391DFD582057__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +// PropAccess.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CPropAccess dialog + +class CPropAccess : public CPropertyPage +{ +// Construction +public: + CPropAccess(); // standard constructor + +// Dialog Data + //{{AFX_DATA(CPropAccess) + enum { IDD = IDD_PROPPAGE_ACCESS }; + CButton m_auth_registered; + CButton m_auth_open; + CButton m_auth_closed; + CEdit m_password; + CEdit m_port; + CEdit m_interface; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CPropAccess) + public: + virtual void OnOK(); + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + + // Generated message map functions + //{{AFX_MSG(CPropAccess) + afx_msg void OnAuthRegistered(); + afx_msg void OnAuthOpen(); + afx_msg void OnAuthClosed(); + virtual BOOL OnInitDialog(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_PROPACCESS_H__0AC45777_B43C_4467_91FF_391DFD582057__INCLUDED_) diff --git a/win32/PropConn.cpp b/win32/PropConn.cpp new file mode 100644 index 00000000..15d4a90a --- /dev/null +++ b/win32/PropConn.cpp @@ -0,0 +1,125 @@ +// PropConn.cpp : implementation file +// + +#define BITLBEE_CORE +#include "bitlbeewin.h" +#include "PropConn.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CPropConn dialog + + +CPropConn::CPropConn(CWnd* pParent /*=NULL*/) + : CPropertyPage(CPropConn::IDD) +{ + //{{AFX_DATA_INIT(CPropConn) + //}}AFX_DATA_INIT +} + + +void CPropConn::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CPropConn) + DDX_Control(pDX, IDC_PROXYPORT, m_proxyport); + DDX_Control(pDX, IDC_PROXYTYPE, m_proxytype); + DDX_Control(pDX, IDC_PROXY_ENABLED, m_proxy_enabled); + DDX_Control(pDX, IDC_PROXY_AUTH_ENABLED, m_proxy_auth_enabled); + DDX_Control(pDX, IDC_PROXYPASS, m_proxypass); + DDX_Control(pDX, IDC_PROXYHOST, m_proxyhost); + DDX_Control(pDX, IDC_PROXYUSER, m_proxyuser); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CPropConn, CPropertyPage) + //{{AFX_MSG_MAP(CPropConn) + ON_BN_CLICKED(IDC_PROXY_AUTH_ENABLED, OnProxyAuthEnabled) + ON_BN_CLICKED(IDC_PROXY_ENABLED, OnProxyEnabled) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CPropConn message handlers + +void CPropConn::OnProxyAuthEnabled() +{ + m_proxyuser.EnableWindow(m_proxy_enabled.GetCheck() && m_proxy_auth_enabled.GetCheck()); + m_proxypass.EnableWindow(m_proxy_enabled.GetCheck() && m_proxy_auth_enabled.GetCheck()); +} + +void CPropConn::OnProxyEnabled() +{ + // TODO: Add your control notification handler code here + m_proxyhost.EnableWindow(m_proxy_enabled.GetCheck()); + m_proxytype.EnableWindow(m_proxy_enabled.GetCheck()); + m_proxyport.EnableWindow(m_proxy_enabled.GetCheck()); + m_proxy_auth_enabled.EnableWindow(m_proxy_enabled.GetCheck()); + + if(m_proxy_enabled.GetCheck() && (m_proxytype.GetCurSel() < 0 || m_proxytype.GetCurSel() > 2)) + { + m_proxytype.SetCurSel(0); + } + + OnProxyAuthEnabled(); +} + +void CPropConn::OnOK() +{ + if(!m_proxy_enabled.GetCheck()) { + proxytype = PROXY_NONE; + return; + } + + CString tmp; + m_proxyhost.GetWindowText(tmp); + strcpy(proxyhost, tmp); + + m_proxyport.GetWindowText(tmp); + proxyport = atoi(tmp); + + proxytype = m_proxytype.GetCurSel()+1; + + if(!m_proxy_auth_enabled.GetCheck()) { + strcpy(proxyuser, ""); + strcpy(proxypass, ""); + return; + } + + m_proxyuser.GetWindowText(tmp); + strcpy(proxyuser, tmp); + m_proxypass.GetWindowText(tmp); + strcpy(proxypass, tmp); + + CPropertyPage::OnOK(); +} + +BOOL CPropConn::OnInitDialog() +{ + char pp[20]; + CPropertyPage::OnInitDialog(); + + m_proxyhost.SetWindowText(proxyhost); + m_proxyuser.SetWindowText(proxyuser); + m_proxypass.SetWindowText(proxypass); + g_snprintf(pp, 20, "%d", proxyport); + m_proxyport.SetWindowText(pp); + + m_proxytype.AddString("SOCKS 4"); + m_proxytype.AddString("SOCKS 5"); + m_proxytype.AddString("HTTP"); + m_proxytype.SetCurSel(proxytype-1); + + m_proxy_enabled.SetCheck(proxytype == PROXY_NONE?0:1); + m_proxy_auth_enabled.SetCheck(strcmp(proxyuser, "")?1:0); + + OnProxyEnabled(); + + return TRUE; +} diff --git a/win32/PropConn.h b/win32/PropConn.h new file mode 100644 index 00000000..1143912c --- /dev/null +++ b/win32/PropConn.h @@ -0,0 +1,56 @@ +#if !defined(AFX_PROPCONN_H__8969671F_8D9F_45E9_929F_B36CFEFCBAA2__INCLUDED_) +#define AFX_PROPCONN_H__8969671F_8D9F_45E9_929F_B36CFEFCBAA2__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +// PropConn.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CPropConn dialog + +class CPropConn : public CPropertyPage +{ +// Construction +public: + CPropConn(CWnd* pParent = NULL); // standard constructor + +// Dialog Data + //{{AFX_DATA(CPropConn) + enum { IDD = IDD_PROPPAGE_CONNECTION }; + CEdit m_proxyport; + CListBox m_proxytype; + CButton m_proxy_enabled; + CButton m_proxy_auth_enabled; + CEdit m_proxypass; + CEdit m_proxyhost; + CEdit m_proxyuser; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CPropConn) + public: + virtual void OnOK(); + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + + // Generated message map functions + //{{AFX_MSG(CPropConn) + afx_msg void OnProxyAuthEnabled(); + afx_msg void OnProxyEnabled(); + virtual BOOL OnInitDialog(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_PROPCONN_H__8969671F_8D9F_45E9_929F_B36CFEFCBAA2__INCLUDED_) diff --git a/win32/PropLog.cpp b/win32/PropLog.cpp new file mode 100644 index 00000000..27957b07 --- /dev/null +++ b/win32/PropLog.cpp @@ -0,0 +1,80 @@ +// PropLog.cpp : implementation file +// + +#define BITLBEE_CORE +#include "bitlbeewin.h" +#include "PropLog.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CPropLog dialog + + +CPropLog::CPropLog() + : CPropertyPage(CPropLog::IDD) +{ + //{{AFX_DATA_INIT(CPropLog) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT +} + + +void CPropLog::DoDataExchange(CDataExchange* pDX) +{ + CPropertyPage::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CPropLog) + DDX_Control(pDX, IDC_LOG, m_log); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CPropLog, CPropertyPage) + //{{AFX_MSG_MAP(CPropLog) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CPropLog message handlers + +static GList *log = NULL; + +extern "C" { +void glib_logger (const gchar *log_domain, GLogLevelFlags log_level, const gchar *msg, gpointer user_data) +{ + log = g_list_append(log, g_strdup_printf("%s: %s", log_domain, msg)); +} +} + +void log_message(int level, char *message, ... ) { +#define LOG_MAXLEN 300 + va_list ap; + va_start(ap, message); + char *msg = (char *)g_malloc(LOG_MAXLEN); + g_vsnprintf(msg, LOG_MAXLEN, message, ap); + va_end(ap); + log = g_list_append(log, msg); + if(level == LOGLVL_ERROR) ::MessageBox(NULL, msg, "Bitlbee", MB_OK | MB_ICONINFORMATION); + TRACE("%d: %s\n", level, msg); +} + + +BOOL CPropLog::OnInitDialog() +{ + CPropertyPage::OnInitDialog(); + + m_log.ResetContent(); + GList *gl = log; + while(gl) { + char *d = (char *)gl->data; + m_log.AddString(d); + gl = gl->next; + } + + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} diff --git a/win32/PropLog.h b/win32/PropLog.h new file mode 100644 index 00000000..1a847b19 --- /dev/null +++ b/win32/PropLog.h @@ -0,0 +1,47 @@ +#if !defined(AFX_PROPLOG_H__F56909E1_BBCC_4163_B9C2_E8D5685A34AA__INCLUDED_) +#define AFX_PROPLOG_H__F56909E1_BBCC_4163_B9C2_E8D5685A34AA__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +// PropLog.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CPropLog dialog + +class CPropLog : public CPropertyPage +{ +// Construction +public: + CPropLog(); // standard constructor + +// Dialog Data + //{{AFX_DATA(CPropLog) + enum { IDD = IDD_PROPPAGE_LOG }; + CListBox m_log; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CPropLog) + public: + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + + // Generated message map functions + //{{AFX_MSG(CPropLog) + virtual BOOL OnInitDialog(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_PROPLOG_H__F56909E1_BBCC_4163_B9C2_E8D5685A34AA__INCLUDED_) diff --git a/win32/PropPaths.cpp b/win32/PropPaths.cpp new file mode 100644 index 00000000..7790e99c --- /dev/null +++ b/win32/PropPaths.cpp @@ -0,0 +1,119 @@ +// PropPaths.cpp : implementation file +// + +#define BITLBEE_CORE +#include "bitlbeewin.h" +#include "PropPaths.h" +#include "shlobj.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CPropPaths dialog + + +CPropPaths::CPropPaths() + : CPropertyPage(CPropPaths::IDD) +{ + //{{AFX_DATA_INIT(CPropPaths) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT +} + + +void CPropPaths::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CPropPaths) + DDX_Control(pDX, IDC_MOTDFILE, m_motdfile); + DDX_Control(pDX, IDC_EDIT_MOTD, m_edit_motd); + DDX_Control(pDX, IDC_CONFIGDIR, m_configdir); + DDX_Control(pDX, IDC_BROWSE_MOTD, m_browse_motd); + DDX_Control(pDX, IDC_BROWSE_CONFIG, m_browse_config); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CPropPaths, CPropertyPage) + //{{AFX_MSG_MAP(CPropPaths) + ON_BN_CLICKED(IDC_BROWSE_CONFIG, OnBrowseConfig) + ON_BN_CLICKED(IDC_BROWSE_MOTD, OnBrowseMotd) + ON_BN_CLICKED(IDC_EDIT_MOTD, OnEditMotd) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CPropPaths message handlers + +void CPropPaths::OnOK() +{ + CString tmp; + g_free((void *)global.conf->configdir); + m_configdir.GetWindowText(tmp); + + if (tmp.GetLength() > 0 + && tmp.GetAt(tmp.GetLength() - 1) != '/' + && tmp.GetAt(tmp.GetLength() - 1) != '\\') + { + global.conf->configdir = g_strdup_printf("%s\\", tmp); + } else { + global.conf->configdir = g_strdup(tmp); + } + + g_free((void *)global.conf->motdfile); + m_motdfile.GetWindowText(tmp); + global.conf->motdfile = g_strdup(tmp); + + CPropertyPage::OnOK(); +} + +void CPropPaths::OnBrowseConfig() +{ + BROWSEINFO bi = { 0 }; + bi.lpszTitle = _T("Choose a config directory"); + LPITEMIDLIST pidl = SHBrowseForFolder(&bi); + if( pidl != 0) + { + TCHAR path[MAX_PATH]; + if( SHGetPathFromIDList (pidl, path) ) { + m_configdir.SetWindowText(path); + } + + IMalloc * imalloc = 0; + if ( SUCCEEDED (SHGetMalloc (&imalloc)) ) + { + imalloc->Free(pidl); + imalloc->Release(); + } + } +} + +void CPropPaths::OnBrowseMotd() +{ + CFileDialog f(TRUE); + + if(f.DoModal() == IDOK) { + m_motdfile.SetWindowText(f.GetPathName()); + } + +} + +void CPropPaths::OnEditMotd() +{ + CString loc;m_motdfile.GetWindowText(loc); + ShellExecute(this->GetSafeHwnd(), NULL, loc, NULL, NULL, SW_SHOWNORMAL); +} + +BOOL CPropPaths::OnInitDialog() +{ + CPropertyPage::OnInitDialog(); + + m_configdir.SetWindowText(global.conf->configdir); + m_motdfile.SetWindowText(global.conf->motdfile); + + return TRUE; +} diff --git a/win32/PropPaths.h b/win32/PropPaths.h new file mode 100644 index 00000000..89c1c78e --- /dev/null +++ b/win32/PropPaths.h @@ -0,0 +1,55 @@ +#if !defined(AFX_PROPPATHS_H__693C8F02_C150_45DD_99F1_F824795E98C9__INCLUDED_) +#define AFX_PROPPATHS_H__693C8F02_C150_45DD_99F1_F824795E98C9__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +// PropPaths.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CPropPaths dialog + +class CPropPaths : public CPropertyPage +{ +// Construction +public: + CPropPaths(); // standard constructor + +// Dialog Data + //{{AFX_DATA(CPropPaths) + enum { IDD = IDD_PROPPAGE_PATHS }; + CEdit m_motdfile; + CButton m_edit_motd; + CEdit m_configdir; + CButton m_browse_motd; + CButton m_browse_config; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CPropPaths) + public: + virtual void OnOK(); + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + + // Generated message map functions + //{{AFX_MSG(CPropPaths) + afx_msg void OnBrowseConfig(); + afx_msg void OnBrowseMotd(); + afx_msg void OnEditMotd(); + virtual BOOL OnInitDialog(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_PROPPATHS_H__693C8F02_C150_45DD_99F1_F824795E98C9__INCLUDED_) diff --git a/win32/PropUsers.cpp b/win32/PropUsers.cpp new file mode 100644 index 00000000..7f1a2c35 --- /dev/null +++ b/win32/PropUsers.cpp @@ -0,0 +1,120 @@ +// PropUsers.cpp : implementation file +// + +#define BITLBEE_CORE +#include "bitlbeewin.h" +#include "PropUsers.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CPropUsers dialog + + +CPropUsers::CPropUsers() + : CPropertyPage(CPropUsers::IDD) +{ + //{{AFX_DATA_INIT(CPropUsers) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT +} + + +void CPropUsers::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CPropUsers) + DDX_Control(pDX, IDC_KNOWN_USERS, m_known_users); + DDX_Control(pDX, IDC_KICK, m_kick); + DDX_Control(pDX, IDC_DEL_KNOWN_USERS, m_del_known_users); + DDX_Control(pDX, IDC_CURRENT_USERS, m_current_users); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CPropUsers, CPropertyPage) + //{{AFX_MSG_MAP(CPropUsers) + ON_BN_CLICKED(IDC_KICK, OnKick) + ON_BN_CLICKED(IDC_DEL_KNOWN_USERS, OnDelKnownUser) + ON_LBN_SELCHANGE(IDC_CURRENT_USERS, OnSelchangeCurrentUsers) + ON_LBN_SELCHANGE(IDC_KNOWN_USERS, OnSelchangeKnownUsers) + ON_BN_CLICKED(IDC_REFRESH_KNOWN_USERS, OnRefreshKnownUsers) + ON_BN_CLICKED(IDC_REFRESH_CURRENT_USERS, OnRefreshCurrentUsers) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CPropUsers message handlers + +void CPropUsers::OnKick() +{ + int idx = m_current_users.GetCurSel(); + if(idx == LB_ERR) return; + irc_t *irc = (irc_t *)m_current_users.GetItemData(idx); + irc_free(irc); + m_kick.EnableWindow(FALSE); + OnRefreshCurrentUsers(); +} + +void CPropUsers::OnDelKnownUser() +{ + CString nick; + m_known_users.GetText(m_known_users.GetCurSel(), nick); + CString accounts; accounts.Format("%s\\%s.accounts", global.conf->configdir, nick); + CString nicks; nicks.Format("%s\\%s.nicks", global.conf->configdir, nick); + CFile::Remove(accounts); + CFile::Remove(nicks); + m_del_known_users.EnableWindow(FALSE); + OnRefreshKnownUsers(); +} + +void CPropUsers::OnSelchangeCurrentUsers() +{ + m_kick.EnableWindow(m_current_users.GetCurSel() != LB_ERR); + +} + +void CPropUsers::OnSelchangeKnownUsers() +{ + m_del_known_users.EnableWindow(m_known_users.GetCurSel() != LB_ERR); + +} + +void CPropUsers::OnRefreshKnownUsers() +{ + m_known_users.ResetContent(); + GError *error = NULL; + const char *r; + GDir *d = g_dir_open(global.conf->configdir, 0, &error); + if(!d) return; + while(r = g_dir_read_name(d)) { + if(strstr(r, ".accounts")) { + CString tmp(r, strlen(r) - strlen(".accounts")); + m_known_users.AddString(tmp); + } + } + g_dir_close(d); +} + +extern "C" { + extern GSList *irc_connection_list; +} + +void CPropUsers::OnRefreshCurrentUsers() +{ + m_current_users.ResetContent(); + GSList *gl = irc_connection_list; + while(gl) { + irc_t *irc = (irc_t *)gl->data; + CString tmp; + tmp.Format("%s@%s \"%s\"", irc->nick, irc->myhost, irc->realname); + int idx = m_current_users.AddString(tmp); + m_current_users.SetItemData(idx, (unsigned long)irc); + gl = gl->next; + } +} + diff --git a/win32/PropUsers.h b/win32/PropUsers.h new file mode 100644 index 00000000..7dd028c6 --- /dev/null +++ b/win32/PropUsers.h @@ -0,0 +1,54 @@ +#if !defined(AFX_PROPUSERS_H__BA8F6624_F693_403B_B3A8_B140955A894B__INCLUDED_) +#define AFX_PROPUSERS_H__BA8F6624_F693_403B_B3A8_B140955A894B__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +// PropUsers.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CPropUsers dialog + +class CPropUsers : public CPropertyPage +{ +// Construction +public: + CPropUsers(); // standard constructor + +// Dialog Data + //{{AFX_DATA(CPropUsers) + enum { IDD = IDD_PROPPAGE_USERS }; + CListBox m_known_users; + CButton m_kick; + CButton m_del_known_users; + CListBox m_current_users; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CPropUsers) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + + // Generated message map functions + //{{AFX_MSG(CPropUsers) + afx_msg void OnKick(); + afx_msg void OnDelKnownUser(); + afx_msg void OnSelchangeCurrentUsers(); + afx_msg void OnSelchangeKnownUsers(); + afx_msg void OnRefreshKnownUsers(); + afx_msg void OnRefreshCurrentUsers(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_PROPUSERS_H__BA8F6624_F693_403B_B3A8_B140955A894B__INCLUDED_) diff --git a/win32/TrayNot.cpp b/win32/TrayNot.cpp new file mode 100644 index 00000000..bd6bf39a --- /dev/null +++ b/win32/TrayNot.cpp @@ -0,0 +1,106 @@ +// TrayNot.cpp : implementation file +// + +#define BITLBEE_CORE +#include "bitlbeewin.h" +#include "TrayNot.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CTrayNot dialog + + +CTrayNot::CTrayNot(CPropertySheet *s) + : CDialog(CTrayNot::IDD, NULL) +{ + Create(CTrayNot::IDD); + EnableWindow(FALSE); + + dlg = s; + + /* Traybar icon */ + NOTIFYICONDATA dat; + dat.cbSize = sizeof(NOTIFYICONDATA); + dat.hWnd = m_hWnd; + dat.uID = 1; + dat.uFlags = NIF_ICON + NIF_TIP + NIF_MESSAGE; + dat.hIcon = AfxGetApp()->LoadIcon(IDI_BEE); + dat.uCallbackMessage = BITLBEE_TRAY_ICON; + strcpy(dat.szTip, "Bitlbee manager"); + Shell_NotifyIcon(NIM_ADD, &dat); + + //{{AFX_DATA_INIT(CTrayNot) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT +} + + +void CTrayNot::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CTrayNot) + // NOTE: the ClassWizard will add DDX and DDV calls here + //}}AFX_DATA_MAP +} + +///////////////////////////////////////////////////////////////////////////// +// CTrayNot message handlers + +CTrayNot::~CTrayNot() +{ + NOTIFYICONDATA dat; + dat.cbSize = sizeof(NOTIFYICONDATA); + dat.hWnd = m_hWnd; + dat.uID = 1; + Shell_NotifyIcon(NIM_DELETE, &dat); +} + + +BEGIN_MESSAGE_MAP(CTrayNot, CDialog) + //{{AFX_MSG_MAP(CTrayNot) + // NOTE - the ClassWizard will add and remove mapping macros here. + ON_MESSAGE (BITLBEE_TRAY_ICON, OnSysTrayIconClick) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + + +///////////////////////////////////////////////////////////////////////////// +// CTrayNot message handlers + +afx_msg LONG CTrayNot::OnSysTrayIconClick (WPARAM wParam, LPARAM lParam) +{ + switch (lParam) + { + case WM_LBUTTONDOWN: + dlg->ShowWindow(SW_SHOW); + break; + case WM_RBUTTONDOWN: + ShowQuickMenu (); + break ; + } + return 0; +} + +void CTrayNot::ShowQuickMenu() +{ + POINT CurPos; + + CMenu qmenu; + qmenu.LoadMenu(IDR_POPUP); + + GetCursorPos (&CurPos); + + CMenu *submenu = qmenu.GetSubMenu(0); + + SetForegroundWindow(); + // Display the menu. This menu is a popup loaded elsewhere. + + submenu->TrackPopupMenu (TPM_RIGHTBUTTON | TPM_RIGHTALIGN, + CurPos.x, + CurPos.y,this); +} diff --git a/win32/TrayNot.h b/win32/TrayNot.h new file mode 100644 index 00000000..9dbcb282 --- /dev/null +++ b/win32/TrayNot.h @@ -0,0 +1,54 @@ +#if !defined(AFX_TRAYNOT_H__C8B7E607_671B_4C97_8251_AF5AA83DF401__INCLUDED_) +#define AFX_TRAYNOT_H__C8B7E607_671B_4C97_8251_AF5AA83DF401__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +// TrayNot.h : header file +// + +#include + +#define BITLBEE_TRAY_ICON WM_USER+1 + +///////////////////////////////////////////////////////////////////////////// +// CTrayNot dialog + +class CTrayNot : public CDialog +{ +// Construction +public: + virtual ~CTrayNot(); + CTrayNot(CPropertySheet *); // standard constructor + +// Dialog Data + //{{AFX_DATA(CTrayNot) + enum { IDD = IDD_PHONY }; + // NOTE: the ClassWizard will add data members here + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CTrayNot) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + + // Generated message map functions + //{{AFX_MSG(CTrayNot) + // NOTE: the ClassWizard will add member functions here + afx_msg LONG OnSysTrayIconClick (WPARAM wParam, LPARAM lParam); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + CPropertySheet *dlg; + void ShowQuickMenu(); +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_TRAYNOT_H__C8B7E607_671B_4C97_8251_AF5AA83DF401__INCLUDED_) diff --git a/win32/bitlbee.dsp b/win32/bitlbee.dsp new file mode 100644 index 00000000..ef0f3ada --- /dev/null +++ b/win32/bitlbee.dsp @@ -0,0 +1,338 @@ +# Microsoft Developer Studio Project File - Name="bitlbee" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=bitlbee - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "bitlbee.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "bitlbee.mak" CFG="bitlbee - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "bitlbee - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "bitlbee - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "bitlbee - Win32 Release" + +# PROP BASE Use_MFC 6 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 6 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D "GLIB2" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" +# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib iconv.lib glib-2.0.lib gmodule-2.0.lib /nologo /subsystem:windows /machine:I386 /libpath:"release" /libpath:"deps\lib" +# SUBTRACT LINK32 /incremental:yes /nodefaultlib + +!ELSEIF "$(CFG)" == "bitlbee - Win32 Debug" + +# PROP BASE Use_MFC 6 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 6 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D "GLIB2" /FR /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" +# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 iconv.lib glib-2.0.lib gmodule-2.0.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"debug" /libpath:"deps\lib" + +!ENDIF + +# Begin Target + +# Name "bitlbee - Win32 Release" +# Name "bitlbee - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\account.c +# End Source File +# Begin Source File + +SOURCE=..\bitlbee.c +# End Source File +# Begin Source File + +SOURCE=.\bitlbee.rc +# End Source File +# Begin Source File + +SOURCE=.\bitlbeewin.cpp +# End Source File +# Begin Source File + +SOURCE=..\commands.c +# End Source File +# Begin Source File + +SOURCE=..\crypting.c +# End Source File +# Begin Source File + +SOURCE=..\debug.c +# End Source File +# Begin Source File + +SOURCE=..\help.c +# End Source File +# Begin Source File + +SOURCE=..\irc.c +# End Source File +# Begin Source File + +SOURCE=.\MainDlg.cpp +# End Source File +# Begin Source File + +SOURCE=..\protocols\md5.c +# End Source File +# Begin Source File + +SOURCE=..\nick.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\nogaim.c +# End Source File +# Begin Source File + +SOURCE=.\PropAccess.cpp +# End Source File +# Begin Source File + +SOURCE=.\PropConn.cpp +# End Source File +# Begin Source File + +SOURCE=.\PropLog.cpp +# End Source File +# Begin Source File + +SOURCE=.\PropPaths.cpp +# End Source File +# Begin Source File + +SOURCE=.\PropUsers.cpp +# End Source File +# Begin Source File + +SOURCE=..\protocols\proxy.c +# End Source File +# Begin Source File + +SOURCE=..\query.c +# End Source File +# Begin Source File + +SOURCE=..\set.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\sha.c +# End Source File +# Begin Source File + +SOURCE=.\TrayNot.cpp +# End Source File +# Begin Source File + +SOURCE=..\user.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\util.c + +!IF "$(CFG)" == "bitlbee - Win32 Release" + +!ELSEIF "$(CFG)" == "bitlbee - Win32 Debug" + +# PROP Intermediate_Dir "Debugx" + +!ENDIF + +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\account.h +# End Source File +# Begin Source File + +SOURCE=..\bitlbee.h +# End Source File +# Begin Source File + +SOURCE=.\bitlbeewin.h +# End Source File +# Begin Source File + +SOURCE=..\commands.h +# End Source File +# Begin Source File + +SOURCE=..\conf.h +# End Source File +# Begin Source File + +SOURCE=.\config.h +# End Source File +# Begin Source File + +SOURCE=..\crypting.h +# End Source File +# Begin Source File + +SOURCE=..\help.h +# End Source File +# Begin Source File + +SOURCE=..\ini.h +# End Source File +# Begin Source File + +SOURCE=..\irc.h +# End Source File +# Begin Source File + +SOURCE=..\log.h +# End Source File +# Begin Source File + +SOURCE=.\MainDlg.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\md5.h +# End Source File +# Begin Source File + +SOURCE=..\nick.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\nogaim.h +# End Source File +# Begin Source File + +SOURCE=.\PropAccess.h +# End Source File +# Begin Source File + +SOURCE=.\PropConn.h +# End Source File +# Begin Source File + +SOURCE=.\PropLog.h +# End Source File +# Begin Source File + +SOURCE=.\PropPaths.h +# End Source File +# Begin Source File + +SOURCE=.\PropUsers.h +# End Source File +# Begin Source File + +SOURCE=.\Resource.h +# End Source File +# Begin Source File + +SOURCE=..\set.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\sha.h +# End Source File +# Begin Source File + +SOURCE=..\sock.h +# End Source File +# Begin Source File + +SOURCE=.\TrayNot.h +# End Source File +# Begin Source File + +SOURCE=..\user.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\res\bitlbee.rc2 +# End Source File +# Begin Source File + +SOURCE=.\res\bmp00002.bmp +# End Source File +# Begin Source File + +SOURCE=.\res\icon1.ico +# End Source File +# Begin Source File + +SOURCE=.\res\icon2.ico +# End Source File +# End Group +# Begin Source File + +SOURCE=.\README.TXT +# End Source File +# End Target +# End Project diff --git a/win32/bitlbee.dsw b/win32/bitlbee.dsw new file mode 100644 index 00000000..e91fea5e --- /dev/null +++ b/win32/bitlbee.dsw @@ -0,0 +1,107 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "bitlbee"=".\bitlbee.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "bitlbee_ssl"=".\bitlbee_ssl\bitlbee_ssl.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "jabber"=".\jabber.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name bitlbee + End Project Dependency + Begin Project Dependency + Project_Dep_Name bitlbee_ssl + End Project Dependency +}}} + +############################################################################### + +Project: "msn"=".\msn.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name bitlbee + End Project Dependency + Begin Project Dependency + Project_Dep_Name bitlbee_ssl + End Project Dependency +}}} + +############################################################################### + +Project: "oscar"=".\oscar.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name bitlbee + End Project Dependency +}}} + +############################################################################### + +Project: "yahoo"=".\yahoo.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name bitlbee + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/win32/bitlbee.iss b/win32/bitlbee.iss new file mode 100644 index 00000000..a9863f3b --- /dev/null +++ b/win32/bitlbee.iss @@ -0,0 +1,73 @@ +; Inno setup script for Bitlbee +; (C) 2004-2005 Jelmer Vernooij + +[Setup] +AppName=BitlBee +AppPublisher=The BitlBee Team +AppPublisherURL=http://www.bitlbee.org/ +AppSupportURL=http://win32.bitlbee.org/ +AppUpdatesURL=http://win32.bitlbee.org/ +AppCopyright=Copyright © 2002-2005 The BitlBee Team +DefaultDirName={pf}\Bitlbee +DefaultGroupName=Bitlbee +LicenseFile=..\COPYING +InfoAfterFile=README.TXT +OutputDir=. +AppVerName=Bitlbee-20050516 +OutputBaseFileName="BitlBee-setup" + +[Components] +Name: main; Description: Main executable and files; Types: full compact custom; Flags: fixed; +Name: "yahoo"; Description: Yahoo! Messenger support; Types: full; +Name: "oscar"; Description: AIM/ICQ support; Types: full; +Name: ssl; Description: SSL Support; Types: full; +Name: "ssl\msn"; Description: MSN messenger support; Types: full; +Name: "ssl\jabber"; Description: Jabber support; Types: full; +Name: docs; Description: Documentation; Types: full; + +[Tasks] +Name: startupicon; Description: "&Automatically start when the computer boots"; GroupDescription: "Other tasks:"; Flags: unchecked + +[Files] +Source: "Release\bitlbee.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: main; +Source: "Release\libmsn.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl\msn" +Source: "Deps\lib\ssl3.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl" +Source: "Deps\lib\nss3.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl" +Source: "Deps\lib\nssckbi.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl" +Source: "Deps\lib\smime3.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl" +Source: "Deps\lib\softokn3.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl" +Source: "Deps\lib\libplc4.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl" +Source: "Deps\lib\libnspr4.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl" +Source: "Release\libjabber.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl\jabber" +Source: "Release\bitlbee_ssl.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl" +Source: "Deps\bin\libglib-2.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: main; +Source: "Deps\bin\libgmodule-2.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: main; +Source: "Release\liboscar.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "oscar" +Source: "Deps\bin\intl.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: main; +Source: "Deps\bin\iconv.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: main; +Source: "Release\libyahoo.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "yahoo" +Source: "..\motd.txt"; DestDir: "{app}"; Flags: ignoreversion; Components: main; +Source: "..\doc\help.txt"; DestDir: "{app}"; Flags: ignoreversion; Components: main; +Source: "..\COPYING"; DestDir: "{app}"; Flags: ignoreversion; Components: main; +Source: "..\doc\TODO"; DestDir: "{app}"; Flags: ignoreversion; Components: main; +Source: "..\doc\README"; DestDir: "{app}"; Flags: ignoreversion; Components: main; +Source: "..\doc\FAQ"; DestDir: "{app}"; Flags: ignoreversion; Components: docs; +Source: "..\doc\CREDITS"; DestDir: "{app}"; Flags: ignoreversion; Components: main; +; Source: "..\doc\user-guide.pdf"; DestDir: "{app}"; Flags: ignoreversion; Components: docs; +Source: "..\doc\CHANGES"; DestDir: "{app}"; Flags: ignoreversion; Components: main; +Source: "..\doc\AUTHORS"; DestDir: "{app}"; Flags: ignoreversion; Components: main; +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{group}\Bitlbee"; Filename: "{app}\bitlbee.exe" +Name: "{commonstartup}\Bitlbee"; Filename: "{app}\bitlbee.exe"; Tasks: startupicon + + +[Run] +; NOTE: The following entry contains an English phrase ("Launch"). You are free to translate it into another language if required. +Filename: "{app}\bitlbee.exe"; Description: "Launch Bitlbee"; Flags: nowait postinstall skipifsilent + +[Registry] +Root: HKLM; Subkey: "SOFTWARE\Bitlbee"; ValueType: string; ValueName: "helpfile"; ValueData: "{app}\help.txt" +Root: HKLM; Subkey: "SOFTWARE\Bitlbee"; ValueType: string; ValueName: "motdfile"; ValueData: "{app}\motd.txt" +Root: HKLM; Subkey: "SOFTWARE\Bitlbee"; ValueType: string; ValueName: "configdir"; ValueData: "{userappdata}\Bitlbee" diff --git a/win32/bitlbee.rc b/win32/bitlbee.rc new file mode 100644 index 00000000..0762fbbd --- /dev/null +++ b/win32/bitlbee.rc @@ -0,0 +1,354 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "#ifdef _WIN32\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#endif\r\n" + "#include ""afxres.rc"" // Standard components\r\n" + "#endif\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_BEE ICON DISCARDABLE "res\\icon2.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_PROPPAGE_ACCESS DIALOG DISCARDABLE 0, 0, 210, 154 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Access" +FONT 8, "MS Sans Serif" +BEGIN + GROUPBOX "Authentication Mode",IDC_STATIC,7,7,196,47 + CONTROL "&Open",IDC_AUTH_OPEN,"Button",BS_AUTORADIOBUTTON | + WS_GROUP,14,15,181,13 + CONTROL "&Closed",IDC_AUTH_CLOSED,"Button",BS_AUTORADIOBUTTON | + WS_GROUP,14,27,160,11 + CONTROL "&Registered",IDC_AUTH_REGISTERED,"Button", + BS_AUTORADIOBUTTON | WS_GROUP,14,39,182,11 + GROUPBOX "Bind",IDC_STATIC,7,55,196,46 + LTEXT "IP to bind to:",IDC_STATIC,15,67,49,9 + LTEXT "Port:",IDC_STATIC,15,82,52,10 + EDITTEXT IDC_INTERFACE,86,67,108,11,ES_AUTOHSCROLL + EDITTEXT IDC_PORT,86,82,108,11,ES_AUTOHSCROLL + GROUPBOX "Password",IDC_STATIC,7,104,196,43 + EDITTEXT IDC_PASSWORD,14,129,115,11,ES_AUTOHSCROLL + LTEXT "Only used when authentication mode is set to closed.", + IDC_STATIC,13,113,184,11 +END + +IDD_PROPPAGE_USERS DIALOG DISCARDABLE 0, 0, 210, 154 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Users" +FONT 8, "MS Sans Serif" +BEGIN + GROUPBOX "Known users",IDC_STATIC,7,7,196,68 + GROUPBOX "Current users",IDC_STATIC,7,79,196,68 + LISTBOX IDC_KNOWN_USERS,13,17,114,52,LBS_SORT | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "&Remove",IDC_DEL_KNOWN_USERS,133,17,32,14,WS_DISABLED + LISTBOX IDC_CURRENT_USERS,13,89,115,52,LBS_SORT | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "&Kick",IDC_KICK,135,89,19,14,WS_DISABLED + PUSHBUTTON "&Refresh",IDC_REFRESH_KNOWN_USERS,133,38,30,14 + PUSHBUTTON "&Refresh",IDC_REFRESH_CURRENT_USERS,135,110,30,14 +END + +IDD_PROPPAGE_PATHS DIALOG DISCARDABLE 0, 0, 210, 154 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Paths" +FONT 8, "MS Sans Serif" +BEGIN + GROUPBOX "Config path",IDC_STATIC,7,7,196,30 + PUSHBUTTON "&Browse...",IDC_BROWSE_CONFIG,151,16,46,13 + EDITTEXT IDC_CONFIGDIR,13,17,122,13,ES_AUTOHSCROLL + GROUPBOX "Message of the day file",IDC_STATIC,7,42,196,40 + PUSHBUTTON "&Browse...",IDC_BROWSE_MOTD,153,51,43,13 + EDITTEXT IDC_MOTDFILE,13,51,122,13,ES_AUTOHSCROLL + PUSHBUTTON "&Edit...",IDC_EDIT_MOTD,153,66,43,13 +END + +IDD_PHONY DIALOG DISCARDABLE 0, 0, 9, 9 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Dialog" +FONT 8, "MS Sans Serif" +BEGIN +END + +IDD_PROPPAGE_ABOUT DIALOG DISCARDABLE 0, 0, 284, 156 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "About" +FONT 8, "MS Sans Serif" +BEGIN + GROUPBOX "Authors",IDC_STATIC,7,7,270,79 + LTEXT "Bitlbee is written by : \n Wilmer van der Gaast \n Maurits Dijkstra \n Jelmer Vernooij ", + IDC_STATIC,13,16,180,35 + LTEXT "Windows port by Jelmer Vernooij ", + IDC_STATIC,13,55,180,12 + CONTROL 135,IDC_STATIC,"Static",SS_BITMAP | SS_SUNKEN,193,14,73, + 64 + GROUPBOX "More information",IDC_STATIC,7,88,270,61 + LTEXT "See the file CREDITS for a list of contributors.", + IDC_STATIC,16,69,171,11 + LTEXT "The Bitlbee homepage is located at http://www.bitlbee.org/\n\nFor Bitlbee support, go to #bitlbee on irc.oftc.net", + IDC_STATIC,17,100,248,39 +END + +IDD_PROPPAGE_LOG DIALOG DISCARDABLE 0, 0, 210, 154 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Logs" +FONT 8, "MS Sans Serif" +BEGIN + LISTBOX IDC_LOG,7,7,196,140,LBS_SORT | LBS_NOINTEGRALHEIGHT | + WS_VSCROLL | WS_TABSTOP +END + +IDD_PROPPAGE_CONNECTION DIALOG DISCARDABLE 0, 0, 210, 154 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Connection" +FONT 8, "MS Sans Serif" +BEGIN + GROUPBOX "Proxy",IDC_STATIC,7,23,196,124 + EDITTEXT IDC_PROXYHOST,110,33,86,12,ES_AUTOHSCROLL + CONTROL "&Use Proxy",IDC_PROXY_ENABLED,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,7,196,14 + LTEXT "Proxy &Host",IDC_STATIC,13,33,82,12 + EDITTEXT IDC_PROXYUSER,110,105,86,12,ES_AUTOHSCROLL + LTEXT "Proxy &User",IDC_STATIC,13,105,82,12 + EDITTEXT IDC_PROXYPASS,110,122,86,12,ES_PASSWORD | ES_AUTOHSCROLL + LTEXT "Proxy &Password",IDC_STATIC,13,123,82,12 + CONTROL "&Authenticate to proxy",IDC_PROXY_AUTH_ENABLED,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,14,85,86,14 + LTEXT "Proxy &Type",IDC_STATIC,13,63,77,8 + LISTBOX IDC_PROXYTYPE,110,62,86,31,LBS_SORT | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LTEXT "&Proxy Port",IDC_STATIC,14,47,80,9 + EDITTEXT IDC_PROXYPORT,109,47,86,12,ES_AUTOHSCROLL | ES_NUMBER +END + + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "The Bitlbee Team\0" + VALUE "FileDescription", "BitlBee for Windows\0" + VALUE "FileVersion", "1, 0, 0, 1\0" + VALUE "InternalName", "bitlbee\0" + VALUE "LegalCopyright", "Copyright (C) 2002-2004\0" + VALUE "OriginalFilename", "bitlbee.exe\0" + VALUE "ProductName", "Bitlbee Application\0" + VALUE "ProductVersion", "1, 0, 0, 1\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_PROPPAGE_ACCESS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 203 + TOPMARGIN, 7 + BOTTOMMARGIN, 147 + END + + IDD_PROPPAGE_USERS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 203 + TOPMARGIN, 7 + BOTTOMMARGIN, 147 + END + + IDD_PROPPAGE_PATHS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 203 + TOPMARGIN, 7 + BOTTOMMARGIN, 147 + END + + IDD_PHONY, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 2 + TOPMARGIN, 7 + BOTTOMMARGIN, 2 + END + + IDD_PROPPAGE_ABOUT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 277 + TOPMARGIN, 7 + BOTTOMMARGIN, 149 + END + + IDD_PROPPAGE_LOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 203 + TOPMARGIN, 7 + BOTTOMMARGIN, 147 + END + + IDD_PROPPAGE_CONNECTION, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 203 + TOPMARGIN, 7 + BOTTOMMARGIN, 147 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_POPUP MENU DISCARDABLE +BEGIN + POPUP "tray" + BEGIN + MENUITEM "&Show", IDM_SHOW + MENUITEM SEPARATOR + MENUITEM "&Exit", IDM_EXIT + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_BEE_SMALL BITMAP DISCARDABLE "res\\bmp00002.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ABOUTBOX "&About bitlbee..." + IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed." +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE 9, 1 +#pragma code_page(1252) +#endif +#include "afxres.rc" // Standard components +#endif +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/win32/bitlbee_ssl.dsp b/win32/bitlbee_ssl.dsp new file mode 100644 index 00000000..5a4e764d --- /dev/null +++ b/win32/bitlbee_ssl.dsp @@ -0,0 +1,99 @@ +# Microsoft Developer Studio Project File - Name="bitlbee_ssl" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=bitlbee_ssl - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "bitlbee_ssl.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "bitlbee_ssl.mak" CFG="bitlbee_ssl - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "bitlbee_ssl - Win32 Release" (based on\ + "Win32 (x86) Dynamic-Link Library") +!MESSAGE "bitlbee_ssl - Win32 Debug" (based on\ + "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "bitlbee_ssl - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libnspr4.lib nss3.lib ssl3.lib ws2_32.lib glib-2.0.lib /nologo /subsystem:windows /dll /machine:I386 /libpath:"release" /libpath:"deps\lib" + +!ELSEIF "$(CFG)" == "bitlbee_ssl - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libnspr4.lib nss3.lib ssl3.lib ws2_32.lib glib-2.0.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept /libpath:"debug" /libpath:"deps\lib" + +!ENDIF + +# Begin Target + +# Name "bitlbee_ssl - Win32 Release" +# Name "bitlbee_ssl - Win32 Debug" +# Begin Source File + +SOURCE=..\protocols\ssl_client.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\ssl_nss.c +# End Source File +# End Target +# End Project diff --git a/win32/bitlbeewin.cpp b/win32/bitlbeewin.cpp new file mode 100644 index 00000000..e18ae3cd --- /dev/null +++ b/win32/bitlbeewin.cpp @@ -0,0 +1,210 @@ +// bitlbee.cpp : Defines the class behaviors for the application. +// + +#define BITLBEE_CORE +#include "bitlbeewin.h" +#include "traynot.h" +#include "maindlg.h" +#include +extern "C" { +#include "config.h" +#include "bitlbee.h" +#include +#include +int +inet_aton(const char *cp, struct in_addr *addr) +{ + addr->s_addr = inet_addr(cp); + return (addr->s_addr == INADDR_NONE) ? 0 : 1; +} + +void glib_logger (const gchar *log_domain, GLogLevelFlags log_level, const gchar *msg, gpointer user_data); + +} + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CBitlbeeApp + +BEGIN_MESSAGE_MAP(CBitlbeeApp, CWinApp) + //{{AFX_MSG_MAP(CBitlbeeApp) + ON_COMMAND(IDM_EXIT, OnExit) + ON_COMMAND(IDM_SHOW, OnShow) + //}}AFX_MSG_MAP + ON_COMMAND(ID_HELP, CWinApp::OnHelp) +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CBitlbeeApp construction + +CBitlbeeApp::CBitlbeeApp() +{ + // TODO: add construction code here, + // Place all significant initialization in InitInstance +} + +///////////////////////////////////////////////////////////////////////////// +// The one and only CBitlbeeApp object + +CBitlbeeApp theApp; + +///////////////////////////////////////////////////////////////////////////// +// CBitlbeeApp initialization + +static UINT bb_loop(LPVOID data) +{ + g_main_run(global.loop); + return 0; +} + + +gboolean bitlbee_new_client(GIOChannel *src, GIOCondition cond, gpointer data); +global_t global; // Against global namespace pollution + +BOOL CBitlbeeApp::InitInstance() +{ + if (!AfxSocketInit()) + { + AfxMessageBox(IDP_SOCKETS_INIT_FAILED); + return FALSE; + } + + // Standard initialization + // If you are not using these features and wish to reduce the size + // of your final executable, you should remove from the following + // the specific initialization routines you do not need. + +#ifdef _AFXDLL + Enable3dControls(); // Call this when using MFC in a shared DLL +#else + Enable3dControlsStatic(); // Call this when linking to MFC statically +#endif + + HKEY key; + unsigned char databuf[256]; + DWORD len; + RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Bitlbee", &key); + + memset( &global, 0, sizeof( global_t ) ); + g_log_set_handler("GLib", static_cast(G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION), glib_logger, NULL); + global.loop = g_main_new(FALSE); + nogaim_init(); + + SetRegistryKey("Bitlbee"); + conf_t *conf = (conf_t *)g_new0( conf_t, 1 ); + global.conf = conf; + global.conf->iface = g_strdup(GetProfileString("main", "interface", "0.0.0.0")); + global.conf->port = GetProfileInt("main", "port", 6667); + global.conf->verbose = GetProfileInt("main", "verbose", 0); + global.conf->password = g_strdup(GetProfileString("main", "password", "")); + global.conf->ping_interval = GetProfileInt("main", "ping_interval_timeout", 60); + global.conf->hostname = g_strdup(GetProfileString("main", "hostname", "localhost")); + if(RegQueryValueEx(key, "configdir", NULL, NULL, databuf, &len) != ERROR_SUCCESS) strcpy((char *)databuf, ""); + global.conf->configdir = g_strdup(GetProfileString("main", "configdir", (char *)databuf)); + if(RegQueryValueEx(key, "motdfile", NULL, NULL, databuf, &len) != ERROR_SUCCESS) strcpy((char *)databuf, ""); + global.conf->motdfile = g_strdup(GetProfileString("main", "motdfile", (char *)databuf)); + if(RegQueryValueEx(key, "helpfile", NULL, NULL, databuf, &len) != ERROR_SUCCESS) strcpy((char *)databuf, ""); + global.helpfile = g_strdup(GetProfileString("main", "helpfile", (char *)databuf)); + global.conf->runmode = RUNMODE_DAEMON; + global.conf->authmode = (enum authmode) GetProfileInt("main", "AuthMode", AUTHMODE_CLOSED); + strcpy(proxyhost, GetProfileString("proxy", "host", "")); + strcpy(proxyuser, GetProfileString("proxy", "user", "")); + strcpy(proxypass, GetProfileString("proxy", "password", "")); + proxytype = GetProfileInt("proxy", "type", PROXY_NONE); + proxyport = GetProfileInt("proxy", "port", 3128); + + dlg = new CMainDlg(); + not = new CTrayNot(dlg); + dlg->ShowWindow(SW_HIDE); + m_pMainWnd = not; + + if(help_init(&(global.help)) == NULL) { + log_message(LOGLVL_WARNING, "Unable to initialize help"); + } + + if(bitlbee_daemon_init() != 0) { + return FALSE; + } + + AfxBeginThread(bb_loop, NULL); + + + return TRUE; +} + +void log_error(char *a) { + ::MessageBox(NULL, a, "Bitlbee error", MB_OK | MB_ICONEXCLAMATION); +} + +/* Dummy function. log output always goes to screen anyway */ +void log_link(int level, int out) {} + +void conf_loaddefaults(irc_t *irc) {} +double gettime() { + return CTime::GetCurrentTime().GetTime(); +} + +void load_protocol(char *name, char *init_function_name, struct prpl *p) { + void (*init_function) (struct prpl *); + + char *path = g_module_build_path(NULL, name); + if(!path) { + log_message(LOGLVL_WARNING, "Can't build path for %s\n", name); + return; + } + + GModule *mod = g_module_open(path, G_MODULE_BIND_LAZY); + if(!mod) { + log_message(LOGLVL_INFO, "Can't find %s, not loading", name); + return; + } + + if(!g_module_symbol(mod,init_function_name,(void **) &init_function)) { + log_message(LOGLVL_WARNING, "Can't find function %s in %s\n", init_function_name, path); + return; + } + g_free(path); + + init_function(p); +} + +void jabber_init(struct prpl *p) { load_protocol("jabber", "jabber_init", p); } +void msn_init(struct prpl *p) { load_protocol("msn", "msn_init", p); } +void byahoo_init(struct prpl *p) { load_protocol("yahoo", "byahoo_init", p); } +void oscar_init(struct prpl *p) { load_protocol("oscar", "oscar_init", p); } + +void CBitlbeeApp::OnExit() +{ + AfxGetApp()->ExitInstance(); + exit(0); +} + +void CBitlbeeApp::OnShow() +{ + dlg->ShowWindow(SW_SHOW); +} + +int CBitlbeeApp::ExitInstance() +{ + WriteProfileString("main", "interface", global.conf->iface); + WriteProfileInt("main", "port", global.conf->port); + WriteProfileInt("main", "verbose", global.conf->verbose); + WriteProfileString("main", "password", global.conf->password); + WriteProfileString("main", "configdir", global.conf->configdir); + WriteProfileString("main", "hostname", global.conf->hostname); + WriteProfileString("main", "motdfile", global.conf->motdfile); + WriteProfileInt("main", "authmode", global.conf->authmode); + WriteProfileInt("proxy", "type", proxytype); + WriteProfileString("proxy", "host", proxyhost); + WriteProfileString("proxy", "user", proxyuser); + WriteProfileString("proxy", "password", proxypass); + WriteProfileInt("proxy", "port", proxyport); + WriteProfileInt("main", "ping_interval_timeout", global.conf->ping_interval); + delete not; + return CWinApp::ExitInstance(); +} diff --git a/win32/bitlbeewin.h b/win32/bitlbeewin.h new file mode 100644 index 00000000..1a0d0361 --- /dev/null +++ b/win32/bitlbeewin.h @@ -0,0 +1,59 @@ +// bitlbee.h : main header file for the BITLBEE application +// + +#if !defined(AFX_BITLBEE_H__E76A1E72_2177_4477_A796_76D6AB817F80__INCLUDED_) +#define AFX_BITLBEE_H__E76A1E72_2177_4477_A796_76D6AB817F80__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +#include +#include +#include +#include "resource.h" // main symbols + +class CTrayNot; +extern "C" { +#define BITLBEE_CORE +#include "bitlbee.h" +} + +///////////////////////////////////////////////////////////////////////////// +// CBitlbeeApp: +// See bitlbee.cpp for the implementation of this class +// + +class CBitlbeeApp : public CWinApp +{ +public: + CBitlbeeApp(); + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CBitlbeeApp) + public: + virtual BOOL InitInstance(); + virtual int ExitInstance(); + //}}AFX_VIRTUAL + +// Implementation + + //{{AFX_MSG(CBitlbeeApp) + afx_msg void OnExit(); + afx_msg void OnShow(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + protected: + CTrayNot *not; + CPropertySheet *dlg; + GIOChannel *listen; +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_BITLBEE_H__E76A1E72_2177_4477_A796_76D6AB817F80__INCLUDED_) + diff --git a/win32/configure.mingw32 b/win32/configure.mingw32 new file mode 100644 index 00000000..678e9243 --- /dev/null +++ b/win32/configure.mingw32 @@ -0,0 +1,37 @@ +#!/bin/sh +DEPSDIR=$1 +export PKG_CONFIG_LIBDIR=$DEPSDIR/lib/pkgconfig +export PKG_CONFIG_OPTS=--define-variable=prefix=$DEPSDIR +export PKG_CONFIG="pkg-config $PKG_CONFIG_OPTS" + +cat<config.h +/* BitlBee settings, generated by $0 + + Do *NOT* use any of these defines in your code without thinking twice, most + of them can/will be overridden at run-time */ +#define CPU "i386" +#define IPV6 +#define GLIB2 +#define ARCH "Windows" +EOF + +cat<Makefile.settings +## BitlBee settings, generated by $0 +PREFIX= +BINDIR=\$(PREFIX)/sbin/ +ETCDIR=\$(PREFIX)/etc/bitlbee/ +MANDIR=\$(PREFIX)/share/man/ +DATADIR=\$(PREFIX)/share/bitlbee/ +CONFIG=\$(PREFIX)/lib/bitlbee/ +ARCH=Windows +CPU=i386 +OUTFILE=bitlbee.exe +STRIP=i586-mingw32msvc-strip + +DESTDIR= +LFLAGS=`$PKG_CONFIG --libs glib-2.0` -L$DEPSDIR/lib -lws2_32 -liconv +CFLAGS=`$PKG_CONFIG --cflags glib-2.0` -I$DEPSDIR/include -I`pwd` -I`pwd`/protocols +CC=i586-mingw32msvc-gcc +CXX=i586-mingw32msvc-g++ +LD=i586-mingw32msvc-ld +EOF diff --git a/win32/jabber.dsp b/win32/jabber.dsp new file mode 100644 index 00000000..ce5b08c7 --- /dev/null +++ b/win32/jabber.dsp @@ -0,0 +1,228 @@ +# Microsoft Developer Studio Project File - Name="jabber" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=jabber - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "jabber.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "jabber.mak" CFG="jabber - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "jabber - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "jabber - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "jabber - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "jabrel" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\protocols\jabber" /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib iconv.lib glib-2.0.lib /nologo /subsystem:windows /dll /machine:I386 /out:"Release/libjabber.dll" /libpath:"release" /libpath:"deps\lib" + +!ELSEIF "$(CFG)" == "jabber - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "jabber__" +# PROP BASE Intermediate_Dir "jabber__" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "jabdeb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\protocols\jabber" /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 odbc32.lib glib-2.0.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbccp32.lib ws2_32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/libjabber.dll" /pdbtype:sept /libpath:"debug" /libpath:"deps\lib" + +!ENDIF + +# Begin Target + +# Name "jabber - Win32 Release" +# Name "jabber - Win32 Debug" +# Begin Source File + +SOURCE=..\protocols\jabber\asciitab.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\expat.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\genhash.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\hashtable.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\hashtable.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\iasciitab.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\jabber.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\jabber.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\jconn.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\jid.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\jpacket.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\jutil.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\karma.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\latin1tab.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\libxode.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\log.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\log.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\nametab.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\pool.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\pproxy.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\rate.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\str.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\utf8tab.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\xhash.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\xmldef.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\xmlnode.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\xmlparse.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\xmlparse.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\xmlrole.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\xmlrole.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\xmltok.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\xmltok.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\xmltok_impl.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\jabber\xstream.c +# End Source File +# End Target +# End Project diff --git a/win32/msn.dsp b/win32/msn.dsp new file mode 100644 index 00000000..4c5fcfb3 --- /dev/null +++ b/win32/msn.dsp @@ -0,0 +1,116 @@ +# Microsoft Developer Studio Project File - Name="msn" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=msn - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "msn.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "msn.mak" CFG="msn - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "msn - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "msn - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "msn - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "msnrel" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "e:\dev\include\nss" /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib iconv.lib glib-2.0.lib nss3.lib libnspr4.lib ssl3.lib /nologo /subsystem:windows /dll /machine:I386 /out:"Release/libmsn.dll" /libpath:"release" /libpath:"deps\lib" + +!ELSEIF "$(CFG)" == "msn - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "msn___Wi" +# PROP BASE Intermediate_Dir "msn___Wi" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "msndeb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 odbc32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbccp32.lib ws2_32.lib glib-2.0.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/libmsn.dll" /pdbtype:sept /libpath:"debug" /libpath:"deps\lib" + +!ENDIF + +# Begin Target + +# Name "msn - Win32 Release" +# Name "msn - Win32 Debug" +# Begin Source File + +SOURCE=..\protocols\msn\msn.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\msn\msn_util.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\msn\ns.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\msn\passport.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\msn\sb.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\msn\tables.c +# End Source File +# End Target +# End Project diff --git a/win32/oscar.dsp b/win32/oscar.dsp new file mode 100644 index 00000000..aa2242ba --- /dev/null +++ b/win32/oscar.dsp @@ -0,0 +1,204 @@ +# Microsoft Developer Studio Project File - Name="oscar" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=oscar - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "oscar.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "oscar.mak" CFG="oscar - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "oscar - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "oscar - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "oscar - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "oscarrel" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\protocols\oscar" /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib iconv.lib ws2_32.lib glib-2.0.lib /nologo /subsystem:windows /dll /machine:I386 /out:"Release/liboscar.dll" /libpath:"release" /libpath:"deps\lib" + +!ELSEIF "$(CFG)" == "oscar - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "oscar___" +# PROP BASE Intermediate_Dir "oscar___" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "oscdeb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\protocols\oscar" /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 gmodule-2.0.lib ws2_32.lib glib-2.0.lib iconv.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/liboscar.dll" /pdbtype:sept /libpath:"debug" /libpath:"deps\lib" + +!ENDIF + +# Begin Target + +# Name "oscar - Win32 Release" +# Name "oscar - Win32 Debug" +# Begin Source File + +SOURCE=..\protocols\oscar\admin.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\aim.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\aim_cbtypes.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\aim_internal.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\auth.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\bos.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\buddylist.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\chat.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\chatnav.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\conn.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\faimconfig.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\ft.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\icq.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\im.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\info.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\misc.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\msgcookie.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\oscar.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\oscar_util.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\rxhandlers.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\rxqueue.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\search.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\service.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\snac.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\ssi.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\stats.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\tlv.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\oscar\txqueue.c +# End Source File +# End Target +# End Project diff --git a/win32/res/bmp00002.bmp b/win32/res/bmp00002.bmp new file mode 100644 index 00000000..77205cb1 Binary files /dev/null and b/win32/res/bmp00002.bmp differ diff --git a/win32/res/icon2.ico b/win32/res/icon2.ico new file mode 100644 index 00000000..5dfe084f Binary files /dev/null and b/win32/res/icon2.ico differ diff --git a/win32/resource.h b/win32/resource.h new file mode 100644 index 00000000..f655c545 --- /dev/null +++ b/win32/resource.h @@ -0,0 +1,60 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by bitlbee.rc +// +#define IDM_ABOUTBOX 0x0010 +#define IDD_ABOUTBOX 100 +#define IDS_ABOUTBOX 101 +#define IDC_OK 101 +#define IDD_BITLBEE_DIALOG 102 +#define IDP_SOCKETS_INIT_FAILED 103 +#define IDD_PROPPAGE_ACCESS 106 +#define IDD_PROPPAGE_USERS 107 +#define IDD_PROPPAGE_PATHS 108 +#define IDR_MAINFRAME 128 +#define IDI_BEE 130 +#define IDD_PHONY 131 +#define IDR_POPUP 132 +#define IDD_PROPPAGE_ABOUT 132 +#define IDD_PROPPAGE_LOG 133 +#define IDB_BEE_SMALL 135 +#define IDD_PROPPAGE_CONNECTION 137 +#define IDI_ICON1 138 +#define IDC_AUTH_OPEN 1001 +#define IDC_AUTH_CLOSED 1002 +#define IDC_AUTH_REGISTERED 1003 +#define IDC_BROWSE_CONFIG 1004 +#define IDC_CONFIGDIR 1005 +#define IDC_BROWSE_MOTD 1006 +#define IDC_KNOWN_USERS 1007 +#define IDC_MOTDFILE 1007 +#define IDC_EDIT_MOTD 1008 +#define IDC_DEL_KNOWN_USERS 1008 +#define IDC_CURRENT_USERS 1009 +#define IDC_KICK 1010 +#define IDC_INTERFACE 1011 +#define IDC_PORT 1012 +#define IDC_PASSWORD 1013 +#define IDC_REFRESH_KNOWN_USERS 1015 +#define IDC_REFRESH_CURRENT_USERS 1016 +#define IDC_LOG 1017 +#define IDC_PROXYHOST 1018 +#define IDC_PROXYUSER 1019 +#define IDC_PROXYPASS 1020 +#define IDC_PROXY_ENABLED 1021 +#define IDC_PROXY_AUTH_ENABLED 1022 +#define IDC_PROXYPORT 1023 +#define IDC_PROXYTYPE 1024 +#define IDM_SHOW 32771 +#define IDM_EXIT 32773 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 139 +#define _APS_NEXT_COMMAND_VALUE 32774 +#define _APS_NEXT_CONTROL_VALUE 1025 +#define _APS_NEXT_SYMED_VALUE 102 +#endif +#endif diff --git a/win32/yahoo.dsp b/win32/yahoo.dsp new file mode 100644 index 00000000..ebfc4eef --- /dev/null +++ b/win32/yahoo.dsp @@ -0,0 +1,152 @@ +# Microsoft Developer Studio Project File - Name="yahoo" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=yahoo - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "yahoo.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "yahoo.mak" CFG="yahoo - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "yahoo - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "yahoo - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "yahoo - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "yahrel" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_CONFIG_H" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib iconv.lib glib-2.0.lib /nologo /subsystem:windows /dll /machine:I386 /out:"Release/libyahoo.dll" /libpath:"release" /libpath:"deps\lib" + +!ELSEIF "$(CFG)" == "yahoo - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "yahoo___" +# PROP BASE Intermediate_Dir "yahoo___" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "yahdeb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_CONFIG_H" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 ws2_32.lib glib-2.0.lib gmodule-2.0.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/libyahoo.dll" /pdbtype:sept /libpath:"debug" /libpath:"deps\lib" + +!ENDIF + +# Begin Target + +# Name "yahoo - Win32 Release" +# Name "yahoo - Win32 Debug" +# Begin Source File + +SOURCE=..\protocols\yahoo\crypt.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\yahoo\libyahoo2.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\yahoo\yahoo.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\yahoo\yahoo2.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\yahoo\yahoo2_callbacks.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\yahoo\yahoo2_types.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\yahoo\yahoo_debug.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\yahoo\yahoo_fn.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\yahoo\yahoo_fn.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\yahoo\yahoo_httplib.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\yahoo\yahoo_httplib.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\yahoo\yahoo_list.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\yahoo\yahoo_list.h +# End Source File +# Begin Source File + +SOURCE=..\protocols\yahoo\yahoo_util.c +# End Source File +# Begin Source File + +SOURCE=..\protocols\yahoo\yahoo_util.h +# End Source File +# End Target +# End Project -- cgit v1.2.3 From 99318adcb88fa3f1dd21882ec364e682fec96c5e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 7 Nov 2005 17:32:40 +0100 Subject: Import work on services-based Win32 port --- bitlbee.c | 6 --- unix.c | 6 +++ win32.c | 122 +++++++++++++++++++++++++++++++++++++++++------- win32/BUILD.TXT | 5 +- win32/bitlbee.dsp | 85 ++++++--------------------------- win32/bitlbee.dsw | 24 +++++++--- win32/configure.mingw32 | 37 --------------- 7 files changed, 145 insertions(+), 140 deletions(-) delete mode 100644 win32/configure.mingw32 diff --git a/bitlbee.c b/bitlbee.c index 32e28541..1054a42f 100644 --- a/bitlbee.c +++ b/bitlbee.c @@ -56,9 +56,6 @@ int bitlbee_daemon_init() int i; GIOChannel *ch; - log_link( LOGLVL_ERROR, LOGOUTPUT_SYSLOG ); - log_link( LOGLVL_WARNING, LOGOUTPUT_SYSLOG ); - global.listen_socket = socket( AF_INET, SOCK_STREAM, 0 ); if( global.listen_socket == -1 ) { @@ -112,9 +109,6 @@ int bitlbee_inetd_init() if( !irc_new( 0 ) ) return( 1 ); - log_link( LOGLVL_ERROR, LOGOUTPUT_IRC ); - log_link( LOGLVL_WARNING, LOGOUTPUT_IRC ); - return( 0 ); } diff --git a/unix.c b/unix.c index 140be68e..159b3126 100644 --- a/unix.c +++ b/unix.c @@ -60,12 +60,18 @@ int main( int argc, char *argv[] ) if( global.conf->runmode == RUNMODE_INETD ) { + log_link( LOGLVL_ERROR, LOGOUTPUT_IRC ); + log_link( LOGLVL_WARNING, LOGOUTPUT_IRC ); + i = bitlbee_inetd_init(); log_message( LOGLVL_INFO, "Bitlbee %s starting in inetd mode.", BITLBEE_VERSION ); } else if( global.conf->runmode == RUNMODE_DAEMON ) { + log_link( LOGLVL_ERROR, LOGOUTPUT_SYSLOG ); + log_link( LOGLVL_WARNING, LOGOUTPUT_SYSLOG ); + i = bitlbee_daemon_init(); log_message( LOGLVL_INFO, "Bitlbee %s starting in daemon mode.", BITLBEE_VERSION ); } diff --git a/win32.c b/win32.c index 5234c046..25adb9f0 100644 --- a/win32.c +++ b/win32.c @@ -4,7 +4,7 @@ * Copyright 2002-2004 Wilmer van der Gaast and others * \********************************************************************/ -/* Main file (Unix specific part) */ +/* Main file (Windows specific part) */ /* This program is free software; you can redistribute it and/or modify @@ -22,33 +22,56 @@ if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - + +#define BITLBEE_CORE #include "bitlbee.h" #include "commands.h" #include "crypting.h" #include "protocols/nogaim.h" #include "help.h" #include -#include -#include -#include -#include +#include global_t global; /* Against global namespace pollution */ -int main( int argc, char *argv[] ) +static void WINAPI service_ctrl (DWORD dwControl) +{ + switch (dwControl) + { + case SERVICE_CONTROL_STOP: + /* FIXME */ + break; + + case SERVICE_CONTROL_INTERROGATE: + break; + + default: + break; + + } +} + +void service_main (DWORD argc, LPTSTR *argv) { int i = -1; + SERVICE_STATUS_HANDLE handle; + SERVICE_STATUS status; + + handle = RegisterServiceCtrlHandler("bitlbee", service_ctrl); + + if (!handle) + return; + + status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; + status.dwServiceSpecificExitCode = 0; + memset( &global, 0, sizeof( global_t ) ); global.loop = g_main_new( FALSE ); - log_init( ); - nogaim_init( ); - global.conf = conf_load( argc, argv ); if( global.conf == NULL ) - return( 1 ); + return; if( global.conf->runmode == RUNMODE_INETD ) { @@ -67,18 +90,34 @@ int main( int argc, char *argv[] ) } if( i != 0 ) - return( i ); + return; if( access( global.conf->configdir, F_OK ) != 0 ) log_message( LOGLVL_WARNING, "The configuration directory %s does not exist. Configuration won't be saved.", global.conf->configdir ); - else if( access( global.conf->configdir, R_OK ) != 0 || access( global.conf->configdir, W_OK ) != 0 ) + else if( access( global.conf->configdir, 06 ) != 0 ) log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to %s.", global.conf->configdir ); if( help_init( &(global.help) ) == NULL ) log_message( LOGLVL_WARNING, "Error opening helpfile %s.", global.helpfile ); + + SetServiceStatus(handle, &status); g_main_run( global.loop ); - - return( 0 ); +} + +int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + SERVICE_TABLE_ENTRY dispatch_table[] = + { + { TEXT("bitlbee"), (LPSERVICE_MAIN_FUNCTION)service_main }, + { NULL, NULL } + }; + + nogaim_init( ); + + if (!StartServiceCtrlDispatcher(dispatch_table)) + log_message( LOGLVL_ERROR, "StartServiceCtrlDispatcher failed."); + + return 0; } double gettime() @@ -118,9 +157,10 @@ conf_t *conf_load( int argc, char *argv[] ) conf_t *conf; HKEY key, key_main, key_proxy; char *tmp; - RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Bitlbee", &key); - RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Bitlbee\\main", &key_main); - RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Bitlbee\\proxy", &key_proxy); + + RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Bitlbee", &key); + RegOpenKey(key, "main", &key_main); + RegOpenKey(key, "proxy", &key_proxy); memset( &global, 0, sizeof( global_t ) ); global.loop = g_main_new(FALSE); @@ -189,3 +229,49 @@ inet_aton(const char *cp, struct in_addr *addr) addr->s_addr = inet_addr(cp); return (addr->s_addr == INADDR_NONE) ? 0 : 1; } + +void log_error(char *msg) +{ + log_message(LOGLVL_ERROR, "%s", msg); +} + +void log_message(int level, char *message, ...) +{ + HANDLE hEventSource; + LPTSTR lpszStrings[2]; + WORD elevel; + va_list ap; + + va_start(ap, message); + + hEventSource = RegisterEventSource(NULL, TEXT("bitlbee")); + + lpszStrings[0] = TEXT("bitlbee"); + lpszStrings[1] = g_strdup_vprintf(message, ap); + va_end(ap); + + switch (level) { + case LOGLVL_ERROR: elevel = EVENTLOG_ERROR_TYPE; break; + case LOGLVL_WARNING: elevel = EVENTLOG_WARNING_TYPE; break; + case LOGLVL_INFO: elevel = EVENTLOG_INFORMATION_TYPE; break; +#ifdef DEBUG + case LOGLVL_DEBUG: elevel = EVENTLOG_AUDIT_SUCCESS; break; +#endif + } + + if (hEventSource != NULL) { + ReportEvent(hEventSource, + elevel, + 0, + 0, + NULL, + 2, + 0, + lpszStrings, + NULL); + + DeregisterEventSource(hEventSource); + } + + g_free(lpszStrings[1]); +} diff --git a/win32/BUILD.TXT b/win32/BUILD.TXT index 718152b7..03e1b8d9 100644 --- a/win32/BUILD.TXT +++ b/win32/BUILD.TXT @@ -4,10 +4,11 @@ Instructions for building the Bitlbee Win32 port 1. Download the latest version using bzr (http://www.bazaar-ng.org/): bzr branch http://jelmer.vernstok.nl/oss/bitlbee/bzr/win32 bitlbee-win32 2. Download and install the required development files: - from http://www.ethereal.com/distribution/win32/development/: - - libiconv + from ftp://ftp.gtk.org/pub/gtk/v2.8/win32/ - glib - glib-dev + - libiconv + - gettext from http://ftp.mozilla.org/pub/mozilla.org/ - nss - nspr diff --git a/win32/bitlbee.dsp b/win32/bitlbee.dsp index ef0f3ada..3f26fca0 100644 --- a/win32/bitlbee.dsp +++ b/win32/bitlbee.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D "GLIB2" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 @@ -53,7 +53,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib iconv.lib glib-2.0.lib gmodule-2.0.lib /nologo /subsystem:windows /machine:I386 /libpath:"release" /libpath:"deps\lib" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib iconv.lib glib-2.0.lib gmodule-2.0.lib wsock32.lib advapi32.lib /nologo /subsystem:windows /machine:I386 /libpath:"release" /libpath:"deps\lib" # SUBTRACT LINK32 /incremental:yes /nodefaultlib !ELSEIF "$(CFG)" == "bitlbee - Win32 Debug" @@ -70,7 +70,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D "GLIB2" /FR /FD /c +# ADD CPP /nologo /Gd /MDd /Ze /W3 /Gm /GX /Zi /Od /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /FR /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 @@ -81,7 +81,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 iconv.lib glib-2.0.lib gmodule-2.0.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"debug" /libpath:"deps\lib" +# ADD LINK32 iconv.lib glib-2.0.lib gmodule-2.0.lib wsock32.lib kernel32.lib user32.lib advapi32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"debug" /libpath:"deps\lib" !ENDIF @@ -103,10 +103,13 @@ SOURCE=..\bitlbee.c # Begin Source File SOURCE=.\bitlbee.rc -# End Source File -# Begin Source File -SOURCE=.\bitlbeewin.cpp +!IF "$(CFG)" == "bitlbee - Win32 Release" + +!ELSEIF "$(CFG)" == "bitlbee - Win32 Debug" + +!ENDIF + # End Source File # Begin Source File @@ -130,10 +133,6 @@ SOURCE=..\irc.c # End Source File # Begin Source File -SOURCE=.\MainDlg.cpp -# End Source File -# Begin Source File - SOURCE=..\protocols\md5.c # End Source File # Begin Source File @@ -146,26 +145,6 @@ SOURCE=..\protocols\nogaim.c # End Source File # Begin Source File -SOURCE=.\PropAccess.cpp -# End Source File -# Begin Source File - -SOURCE=.\PropConn.cpp -# End Source File -# Begin Source File - -SOURCE=.\PropLog.cpp -# End Source File -# Begin Source File - -SOURCE=.\PropPaths.cpp -# End Source File -# Begin Source File - -SOURCE=.\PropUsers.cpp -# End Source File -# Begin Source File - SOURCE=..\protocols\proxy.c # End Source File # Begin Source File @@ -182,10 +161,6 @@ SOURCE=..\protocols\sha.c # End Source File # Begin Source File -SOURCE=.\TrayNot.cpp -# End Source File -# Begin Source File - SOURCE=..\user.c # End Source File # Begin Source File @@ -200,6 +175,10 @@ SOURCE=..\protocols\util.c !ENDIF +# End Source File +# Begin Source File + +SOURCE=..\win32.c # End Source File # End Group # Begin Group "Header Files" @@ -215,10 +194,6 @@ SOURCE=..\bitlbee.h # End Source File # Begin Source File -SOURCE=.\bitlbeewin.h -# End Source File -# Begin Source File - SOURCE=..\commands.h # End Source File # Begin Source File @@ -251,10 +226,6 @@ SOURCE=..\log.h # End Source File # Begin Source File -SOURCE=.\MainDlg.h -# End Source File -# Begin Source File - SOURCE=..\protocols\md5.h # End Source File # Begin Source File @@ -267,30 +238,6 @@ SOURCE=..\protocols\nogaim.h # End Source File # Begin Source File -SOURCE=.\PropAccess.h -# End Source File -# Begin Source File - -SOURCE=.\PropConn.h -# End Source File -# Begin Source File - -SOURCE=.\PropLog.h -# End Source File -# Begin Source File - -SOURCE=.\PropPaths.h -# End Source File -# Begin Source File - -SOURCE=.\PropUsers.h -# End Source File -# Begin Source File - -SOURCE=.\Resource.h -# End Source File -# Begin Source File - SOURCE=..\set.h # End Source File # Begin Source File @@ -303,10 +250,6 @@ SOURCE=..\sock.h # End Source File # Begin Source File -SOURCE=.\TrayNot.h -# End Source File -# Begin Source File - SOURCE=..\user.h # End Source File # End Group diff --git a/win32/bitlbee.dsw b/win32/bitlbee.dsw index e91fea5e..7f446962 100644 --- a/win32/bitlbee.dsw +++ b/win32/bitlbee.dsw @@ -3,7 +3,7 @@ Microsoft Developer Studio Workspace File, Format Version 5.00 ############################################################################### -Project: "bitlbee"=".\bitlbee.dsp" - Package Owner=<4> +Project: "admin"=.\admin1\admin.dsp - Package Owner=<4> Package=<5> {{{ @@ -15,7 +15,7 @@ Package=<4> ############################################################################### -Project: "bitlbee_ssl"=".\bitlbee_ssl\bitlbee_ssl.dsp" - Package Owner=<4> +Project: "bitlbee"=.\bitlbee.dsp - Package Owner=<4> Package=<5> {{{ @@ -27,7 +27,19 @@ Package=<4> ############################################################################### -Project: "jabber"=".\jabber.dsp" - Package Owner=<4> +Project: "bitlbee_ssl"=.\bitlbee_ssl.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "jabber"=.\jabber.dsp - Package Owner=<4> Package=<5> {{{ @@ -45,7 +57,7 @@ Package=<4> ############################################################################### -Project: "msn"=".\msn.dsp" - Package Owner=<4> +Project: "msn"=.\msn.dsp - Package Owner=<4> Package=<5> {{{ @@ -63,7 +75,7 @@ Package=<4> ############################################################################### -Project: "oscar"=".\oscar.dsp" - Package Owner=<4> +Project: "oscar"=.\oscar.dsp - Package Owner=<4> Package=<5> {{{ @@ -78,7 +90,7 @@ Package=<4> ############################################################################### -Project: "yahoo"=".\yahoo.dsp" - Package Owner=<4> +Project: "yahoo"=.\yahoo.dsp - Package Owner=<4> Package=<5> {{{ diff --git a/win32/configure.mingw32 b/win32/configure.mingw32 deleted file mode 100644 index 678e9243..00000000 --- a/win32/configure.mingw32 +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -DEPSDIR=$1 -export PKG_CONFIG_LIBDIR=$DEPSDIR/lib/pkgconfig -export PKG_CONFIG_OPTS=--define-variable=prefix=$DEPSDIR -export PKG_CONFIG="pkg-config $PKG_CONFIG_OPTS" - -cat<config.h -/* BitlBee settings, generated by $0 - - Do *NOT* use any of these defines in your code without thinking twice, most - of them can/will be overridden at run-time */ -#define CPU "i386" -#define IPV6 -#define GLIB2 -#define ARCH "Windows" -EOF - -cat<Makefile.settings -## BitlBee settings, generated by $0 -PREFIX= -BINDIR=\$(PREFIX)/sbin/ -ETCDIR=\$(PREFIX)/etc/bitlbee/ -MANDIR=\$(PREFIX)/share/man/ -DATADIR=\$(PREFIX)/share/bitlbee/ -CONFIG=\$(PREFIX)/lib/bitlbee/ -ARCH=Windows -CPU=i386 -OUTFILE=bitlbee.exe -STRIP=i586-mingw32msvc-strip - -DESTDIR= -LFLAGS=`$PKG_CONFIG --libs glib-2.0` -L$DEPSDIR/lib -lws2_32 -liconv -CFLAGS=`$PKG_CONFIG --cflags glib-2.0` -I$DEPSDIR/include -I`pwd` -I`pwd`/protocols -CC=i586-mingw32msvc-gcc -CXX=i586-mingw32msvc-g++ -LD=i586-mingw32msvc-ld -EOF -- cgit v1.2.3 From abe53d3c48a6552e136ddc8bc554764daf255a05 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 7 Nov 2005 17:42:49 +0100 Subject: More work on config manager --- .bzrignore | 9 ++ doc/BUILD.win32 | 23 +++ win32.c | 136 +++++++++++------ win32/BUILD.TXT | 23 --- win32/MainDlg.cpp | 78 ---------- win32/MainDlg.h | 52 ------- win32/PropAccess.cpp | 123 --------------- win32/PropAccess.h | 56 ------- win32/PropConn.cpp | 125 --------------- win32/PropConn.h | 56 ------- win32/PropLog.cpp | 80 ---------- win32/PropLog.h | 47 ------ win32/PropPaths.cpp | 119 --------------- win32/PropPaths.h | 55 ------- win32/PropUsers.cpp | 120 --------------- win32/PropUsers.h | 54 ------- win32/TrayNot.cpp | 106 ------------- win32/TrayNot.h | 54 ------- win32/admin/MainDlg.cpp | 71 +++++++++ win32/admin/MainDlg.h | 54 +++++++ win32/admin/PropAccess.cpp | 114 ++++++++++++++ win32/admin/PropAccess.h | 59 ++++++++ win32/admin/PropConn.cpp | 123 +++++++++++++++ win32/admin/PropConn.h | 59 ++++++++ win32/admin/PropLog.cpp | 78 ++++++++++ win32/admin/PropLog.h | 47 ++++++ win32/admin/PropMain.cpp | 99 ++++++++++++ win32/admin/PropMain.h | 58 +++++++ win32/admin/PropPaths.cpp | 115 ++++++++++++++ win32/admin/PropPaths.h | 57 +++++++ win32/admin/admin.dsp | 175 +++++++++++++++++++++ win32/admin/bitlbee.rc | 303 ++++++++++++++++++++++++++++++++++++ win32/admin/bitlbeewin.cpp | 47 ++++++ win32/admin/bitlbeewin.h | 49 ++++++ win32/admin/res/bmp00002.bmp | Bin 0 -> 5830 bytes win32/admin/res/icon2.ico | Bin 0 -> 3774 bytes win32/admin/resource.h | 65 ++++++++ win32/bitlbee.dsp | 44 +----- win32/bitlbee.rc | 354 ------------------------------------------- win32/bitlbeewin.cpp | 210 ------------------------- win32/bitlbeewin.h | 59 -------- win32/res/bmp00002.bmp | Bin 5830 -> 0 bytes win32/res/icon2.ico | Bin 3774 -> 0 bytes win32/resource.h | 60 -------- 44 files changed, 1697 insertions(+), 1919 deletions(-) create mode 100644 doc/BUILD.win32 delete mode 100644 win32/BUILD.TXT delete mode 100644 win32/MainDlg.cpp delete mode 100644 win32/MainDlg.h delete mode 100644 win32/PropAccess.cpp delete mode 100644 win32/PropAccess.h delete mode 100644 win32/PropConn.cpp delete mode 100644 win32/PropConn.h delete mode 100644 win32/PropLog.cpp delete mode 100644 win32/PropLog.h delete mode 100644 win32/PropPaths.cpp delete mode 100644 win32/PropPaths.h delete mode 100644 win32/PropUsers.cpp delete mode 100644 win32/PropUsers.h delete mode 100644 win32/TrayNot.cpp delete mode 100644 win32/TrayNot.h create mode 100644 win32/admin/MainDlg.cpp create mode 100644 win32/admin/MainDlg.h create mode 100644 win32/admin/PropAccess.cpp create mode 100644 win32/admin/PropAccess.h create mode 100644 win32/admin/PropConn.cpp create mode 100644 win32/admin/PropConn.h create mode 100644 win32/admin/PropLog.cpp create mode 100644 win32/admin/PropLog.h create mode 100644 win32/admin/PropMain.cpp create mode 100644 win32/admin/PropMain.h create mode 100644 win32/admin/PropPaths.cpp create mode 100644 win32/admin/PropPaths.h create mode 100644 win32/admin/admin.dsp create mode 100644 win32/admin/bitlbee.rc create mode 100644 win32/admin/bitlbeewin.cpp create mode 100644 win32/admin/bitlbeewin.h create mode 100644 win32/admin/res/bmp00002.bmp create mode 100644 win32/admin/res/icon2.ico create mode 100644 win32/admin/resource.h delete mode 100644 win32/bitlbee.rc delete mode 100644 win32/bitlbeewin.cpp delete mode 100644 win32/bitlbeewin.h delete mode 100644 win32/res/bmp00002.bmp delete mode 100644 win32/res/icon2.ico delete mode 100644 win32/resource.h diff --git a/.bzrignore b/.bzrignore index 87082fd4..6a862781 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1,3 +1,12 @@ Makefile.settings config.h bitlbee +Debug +Debugx +deps +admin/Debug +admin/admin.plg +bitlbee.plg +*.plg +*.aps +*.clw diff --git a/doc/BUILD.win32 b/doc/BUILD.win32 new file mode 100644 index 00000000..03e1b8d9 --- /dev/null +++ b/doc/BUILD.win32 @@ -0,0 +1,23 @@ +Instructions for building the Bitlbee Win32 port +================================================ + +1. Download the latest version using bzr (http://www.bazaar-ng.org/): + bzr branch http://jelmer.vernstok.nl/oss/bitlbee/bzr/win32 bitlbee-win32 +2. Download and install the required development files: + from ftp://ftp.gtk.org/pub/gtk/v2.8/win32/ + - glib + - glib-dev + - libiconv + - gettext + from http://ftp.mozilla.org/pub/mozilla.org/ + - nss + - nspr + +I've put them inside c:\dev, so you might have the most with that location. + +3. Open bitlbee.dsw in VC++ and build :-) + +4. Now you're done. When running, make sure all the required DLL's are accessible. If they can't be found, place them inside c:\winnt\system32 or the Debug or Release directories inside bitlbee-...\win32\. + +5. To build setup files, compile the bitlbee.iss file using the Inno Setup + program (available from www.jrsoftware.org). diff --git a/win32.c b/win32.c index 25adb9f0..63148271 100644 --- a/win32.c +++ b/win32.c @@ -50,10 +50,47 @@ static void WINAPI service_ctrl (DWORD dwControl) } } + +static void bitlbee_init(int argc, char **argv) +{ + int i = -1; + memset( &global, 0, sizeof( global_t ) ); + + global.loop = g_main_new( FALSE ); + + global.conf = conf_load( argc, argv ); + if( global.conf == NULL ) + return; + + if( global.conf->runmode == RUNMODE_INETD ) + { + i = bitlbee_inetd_init(); + log_message( LOGLVL_INFO, "Bitlbee %s starting in inetd mode.", BITLBEE_VERSION ); + + } + else if( global.conf->runmode == RUNMODE_DAEMON ) + { + i = bitlbee_daemon_init(); + log_message( LOGLVL_INFO, "Bitlbee %s starting in daemon mode.", BITLBEE_VERSION ); + } + else + { + log_message( LOGLVL_INFO, "No bitlbee mode specified..."); + } + + if( i != 0 ) + return; + + if( access( global.conf->configdir, F_OK ) != 0 ) + log_message( LOGLVL_WARNING, "The configuration directory %s does not exist. Configuration won't be saved.", global.conf->configdir ); + else if( access( global.conf->configdir, 06 ) != 0 ) + log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to %s.", global.conf->configdir ); + if( help_init( &(global.help) ) == NULL ) + log_message( LOGLVL_WARNING, "Error opening helpfile %s.", global.helpfile ); +} void service_main (DWORD argc, LPTSTR *argv) { - int i = -1; SERVICE_STATUS_HANDLE handle; SERVICE_STATUS status; @@ -64,58 +101,53 @@ void service_main (DWORD argc, LPTSTR *argv) status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; status.dwServiceSpecificExitCode = 0; - - memset( &global, 0, sizeof( global_t ) ); - - global.loop = g_main_new( FALSE ); - - global.conf = conf_load( argc, argv ); - if( global.conf == NULL ) - return; - - if( global.conf->runmode == RUNMODE_INETD ) - { - i = bitlbee_inetd_init(); - log_message( LOGLVL_INFO, "Bitlbee %s starting in inetd mode.", BITLBEE_VERSION ); - - } - else if( global.conf->runmode == RUNMODE_DAEMON ) - { - i = bitlbee_daemon_init(); - log_message( LOGLVL_INFO, "Bitlbee %s starting in daemon mode.", BITLBEE_VERSION ); - } - else - { - log_message( LOGLVL_INFO, "No bitlbee mode specified..."); - } - - if( i != 0 ) - return; - - if( access( global.conf->configdir, F_OK ) != 0 ) - log_message( LOGLVL_WARNING, "The configuration directory %s does not exist. Configuration won't be saved.", global.conf->configdir ); - else if( access( global.conf->configdir, 06 ) != 0 ) - log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to %s.", global.conf->configdir ); - if( help_init( &(global.help) ) == NULL ) - log_message( LOGLVL_WARNING, "Error opening helpfile %s.", global.helpfile ); + + bitlbee_init(argc, argv); SetServiceStatus(handle, &status); g_main_run( global.loop ); } -int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) -{ - SERVICE_TABLE_ENTRY dispatch_table[] = - { - { TEXT("bitlbee"), (LPSERVICE_MAIN_FUNCTION)service_main }, - { NULL, NULL } - }; +SERVICE_TABLE_ENTRY dispatch_table[] = +{ + { TEXT("bitlbee"), (LPSERVICE_MAIN_FUNCTION)service_main }, + { NULL, NULL } +}; + +static int debug = 0; + +static void usage() +{ + printf("Options:\n"); + printf("-h Show this help message\n"); + printf("-d Debug mode (simple console program)\n"); +} + +int main( int argc, char **argv) +{ + int i; + WSADATA WSAData; nogaim_init( ); - - if (!StartServiceCtrlDispatcher(dispatch_table)) - log_message( LOGLVL_ERROR, "StartServiceCtrlDispatcher failed."); + + for (i = 1; i < argc; i++) { + if (!strcmp(argv[i], "-d")) debug = 1; + if (!strcmp(argv[i], "-h")) { + usage(); + return 0; + } + } + + WSAStartup(MAKEWORD(1,1), &WSAData); + + if (!debug) { + if (!StartServiceCtrlDispatcher(dispatch_table)) + log_message( LOGLVL_ERROR, "StartServiceCtrlDispatcher failed."); + } else { + bitlbee_init(argc, argv); + g_main_run( global.loop ); + } return 0; } @@ -164,7 +196,6 @@ conf_t *conf_load( int argc, char *argv[] ) memset( &global, 0, sizeof( global_t ) ); global.loop = g_main_new(FALSE); - nogaim_init(); conf = g_new0( conf_t,1 ); global.conf = conf; @@ -177,8 +208,8 @@ conf_t *conf_load( int argc, char *argv[] ) conf_get_string(key_main, "configdir", NULL, &global.conf->configdir); conf_get_string(key_main, "motdfile", NULL, &global.conf->motdfile); conf_get_string(key_main, "helpfile", NULL, &global.helpfile); - global.conf->runmode = RUNMODE_INETD; - conf_get_int(key_main, "AuthMode", AUTHMODE_CLOSED, &global.conf->authmode); + global.conf->runmode = RUNMODE_DAEMON; + conf_get_int(key_main, "AuthMode", AUTHMODE_OPEN, &global.conf->authmode); conf_get_string(key_proxy, "host", "", &tmp); strcpy(proxyhost, tmp); conf_get_string(key_proxy, "user", "", &tmp); strcpy(proxyuser, tmp); conf_get_string(key_proxy, "password", "", &tmp); strcpy(proxypass, tmp); @@ -242,7 +273,14 @@ void log_message(int level, char *message, ...) WORD elevel; va_list ap; - va_start(ap, message); + va_start(ap, message); + + if (debug) { + vprintf(message, ap); + putchar('\n'); + va_end(ap); + return; + } hEventSource = RegisterEventSource(NULL, TEXT("bitlbee")); diff --git a/win32/BUILD.TXT b/win32/BUILD.TXT deleted file mode 100644 index 03e1b8d9..00000000 --- a/win32/BUILD.TXT +++ /dev/null @@ -1,23 +0,0 @@ -Instructions for building the Bitlbee Win32 port -================================================ - -1. Download the latest version using bzr (http://www.bazaar-ng.org/): - bzr branch http://jelmer.vernstok.nl/oss/bitlbee/bzr/win32 bitlbee-win32 -2. Download and install the required development files: - from ftp://ftp.gtk.org/pub/gtk/v2.8/win32/ - - glib - - glib-dev - - libiconv - - gettext - from http://ftp.mozilla.org/pub/mozilla.org/ - - nss - - nspr - -I've put them inside c:\dev, so you might have the most with that location. - -3. Open bitlbee.dsw in VC++ and build :-) - -4. Now you're done. When running, make sure all the required DLL's are accessible. If they can't be found, place them inside c:\winnt\system32 or the Debug or Release directories inside bitlbee-...\win32\. - -5. To build setup files, compile the bitlbee.iss file using the Inno Setup - program (available from www.jrsoftware.org). diff --git a/win32/MainDlg.cpp b/win32/MainDlg.cpp deleted file mode 100644 index 615a9a3b..00000000 --- a/win32/MainDlg.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// MainDlg.cpp : implementation file -// - -#define BITLBEE_CORE -#include "bitlbeewin.h" -#include "PropUsers.h" -#include "PropPaths.h" -#include "PropAccess.h" -#include "PropLog.h" -#include "PropConn.h" -#include "MainDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CMainDlg - -IMPLEMENT_DYNAMIC(CMainDlg, CPropertySheet) - -CMainDlg::CMainDlg() : CPropertySheet("Bitlbee for Windows") -{ - AddPage(new CPropPaths()); - AddPage(new CPropAccess()); - AddPage(new CPropUsers()); - AddPage(new CPropLog()); - AddPage(new CPropertyPage(IDD_PROPPAGE_ABOUT)); - AddPage(new CPropConn()); - Create(); - ShowWindow(SW_HIDE); -} - -CMainDlg::~CMainDlg() -{ -} - - -BEGIN_MESSAGE_MAP(CMainDlg, CPropertySheet) - //{{AFX_MSG_MAP(CMainDlg) - ON_WM_CLOSE() - //}}AFX_MSG_MAP - ON_BN_CLICKED(IDOK, OnOK) -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CMainDlg message handlers - -BOOL CMainDlg::OnInitDialog() -{ - m_bModeless = FALSE; - m_nFlags |= WF_CONTINUEMODAL; - - CPropertySheet::OnInitDialog(); - GetDlgItem(IDHELP)->ShowWindow(SW_HIDE); - GetDlgItem(IDCANCEL)->ShowWindow(SW_HIDE); - - m_bModeless = TRUE; - m_nFlags &= WF_CONTINUEMODAL; - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CMainDlg::OnOK() -{ - PressButton(PSBTN_APPLYNOW); - ShowWindow(SW_HIDE); -} - - -void CMainDlg::OnClose() -{ - ShowWindow(SW_HIDE); -} - diff --git a/win32/MainDlg.h b/win32/MainDlg.h deleted file mode 100644 index 7cdf612b..00000000 --- a/win32/MainDlg.h +++ /dev/null @@ -1,52 +0,0 @@ -#if !defined(AFX_MAINDLG_H__D88FFF4C_047D_4562_A041_CCDCFA52F87C__INCLUDED_) -#define AFX_MAINDLG_H__D88FFF4C_047D_4562_A041_CCDCFA52F87C__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// MainDlg.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CMainDlg - -class CMainDlg : public CPropertySheet -{ - DECLARE_DYNAMIC(CMainDlg) - -// Construction -public: - CMainDlg(); - -// Attributes -public: - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CMainDlg) - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CMainDlg(); - - // Generated message map functions -protected: - //{{AFX_MSG(CMainDlg) - virtual BOOL OnInitDialog(); - afx_msg void OnClose(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -private: - void OnOK(); -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_MAINDLG_H__D88FFF4C_047D_4562_A041_CCDCFA52F87C__INCLUDED_) diff --git a/win32/PropAccess.cpp b/win32/PropAccess.cpp deleted file mode 100644 index fd787b39..00000000 --- a/win32/PropAccess.cpp +++ /dev/null @@ -1,123 +0,0 @@ -// PropAccess.cpp : implementation file -// - -#define BITLBEE_CORE -#include "bitlbeewin.h" -#include "PropAccess.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CPropAccess dialog - - -CPropAccess::CPropAccess() - : CPropertyPage(CPropAccess::IDD) -{ - - //{{AFX_DATA_INIT(CPropAccess) - //}}AFX_DATA_INIT -} - - -void CPropAccess::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CPropAccess) - DDX_Control(pDX, IDC_AUTH_REGISTERED, m_auth_registered); - DDX_Control(pDX, IDC_AUTH_OPEN, m_auth_open); - DDX_Control(pDX, IDC_AUTH_CLOSED, m_auth_closed); - DDX_Control(pDX, IDC_PASSWORD, m_password); - DDX_Control(pDX, IDC_PORT, m_port); - DDX_Control(pDX, IDC_INTERFACE, m_interface); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CPropAccess, CPropertyPage) - //{{AFX_MSG_MAP(CPropAccess) - ON_BN_CLICKED(IDC_AUTH_REGISTERED, OnAuthRegistered) - ON_BN_CLICKED(IDC_AUTH_OPEN, OnAuthOpen) - ON_BN_CLICKED(IDC_AUTH_CLOSED, OnAuthClosed) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CPropAccess message handlers - -void CPropAccess::OnOK() -{ - CString iface; m_interface.GetWindowText(iface); - CString port; m_port.GetWindowText(port); - - CString password; m_password.GetWindowText(password); - g_free((void *)global.conf->password); - global.conf->password = g_strdup(password); - - if(m_auth_closed.GetCheck() == 1) global.conf->authmode = AUTHMODE_CLOSED; - if(m_auth_open.GetCheck() == 1) global.conf->authmode = AUTHMODE_OPEN; - if(m_auth_registered.GetCheck() == 1) global.conf->authmode = AUTHMODE_REGISTERED; - - if(strcmp(iface, global.conf->iface) || atol(port) != global.conf->port) { - global.conf->port = atoi(port); - g_free((void *)global.conf->iface); - global.conf->iface = g_strdup(iface); - closesocket(global.listen_socket); - bitlbee_daemon_init(); - } - - - CPropertyPage::OnOK(); -} - -void CPropAccess::OnAuthRegistered() -{ - m_password.EnableWindow(FALSE); - m_auth_open.SetCheck(0); - m_auth_registered.SetCheck(1); - m_auth_closed.SetCheck(0); - -} - -void CPropAccess::OnAuthOpen() -{ - m_password.EnableWindow(FALSE); - m_auth_open.SetCheck(1); - m_auth_registered.SetCheck(0); - m_auth_closed.SetCheck(0); -} - -void CPropAccess::OnAuthClosed() -{ - m_password.EnableWindow(TRUE); - m_auth_open.SetCheck(0); - m_auth_registered.SetCheck(0); - m_auth_closed.SetCheck(1); - -} - -BOOL CPropAccess::OnInitDialog() -{ - CPropertyPage::OnInitDialog(); - - m_interface.SetWindowText(global.conf->iface); - m_password.SetWindowText(global.conf->password); - char tmp[20]; - g_snprintf(tmp, sizeof(tmp), "%d", global.conf->port); - m_port.SetWindowText(tmp); - m_auth_open.SetCheck(0); - m_auth_closed.SetCheck(0); - m_auth_registered.SetCheck(0); - - switch(global.conf->authmode) { - case AUTHMODE_OPEN: m_auth_open.SetCheck(1); m_password.EnableWindow(FALSE);break; - case AUTHMODE_CLOSED: m_auth_closed.SetCheck(1); m_password.EnableWindow(TRUE);break; - case AUTHMODE_REGISTERED: m_auth_registered.SetCheck(1);m_password.EnableWindow(FALSE);break; - } - - return TRUE; -} diff --git a/win32/PropAccess.h b/win32/PropAccess.h deleted file mode 100644 index bc80c648..00000000 --- a/win32/PropAccess.h +++ /dev/null @@ -1,56 +0,0 @@ -#if !defined(AFX_PROPACCESS_H__0AC45777_B43C_4467_91FF_391DFD582057__INCLUDED_) -#define AFX_PROPACCESS_H__0AC45777_B43C_4467_91FF_391DFD582057__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// PropAccess.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CPropAccess dialog - -class CPropAccess : public CPropertyPage -{ -// Construction -public: - CPropAccess(); // standard constructor - -// Dialog Data - //{{AFX_DATA(CPropAccess) - enum { IDD = IDD_PROPPAGE_ACCESS }; - CButton m_auth_registered; - CButton m_auth_open; - CButton m_auth_closed; - CEdit m_password; - CEdit m_port; - CEdit m_interface; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CPropAccess) - public: - virtual void OnOK(); - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CPropAccess) - afx_msg void OnAuthRegistered(); - afx_msg void OnAuthOpen(); - afx_msg void OnAuthClosed(); - virtual BOOL OnInitDialog(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_PROPACCESS_H__0AC45777_B43C_4467_91FF_391DFD582057__INCLUDED_) diff --git a/win32/PropConn.cpp b/win32/PropConn.cpp deleted file mode 100644 index 15d4a90a..00000000 --- a/win32/PropConn.cpp +++ /dev/null @@ -1,125 +0,0 @@ -// PropConn.cpp : implementation file -// - -#define BITLBEE_CORE -#include "bitlbeewin.h" -#include "PropConn.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CPropConn dialog - - -CPropConn::CPropConn(CWnd* pParent /*=NULL*/) - : CPropertyPage(CPropConn::IDD) -{ - //{{AFX_DATA_INIT(CPropConn) - //}}AFX_DATA_INIT -} - - -void CPropConn::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CPropConn) - DDX_Control(pDX, IDC_PROXYPORT, m_proxyport); - DDX_Control(pDX, IDC_PROXYTYPE, m_proxytype); - DDX_Control(pDX, IDC_PROXY_ENABLED, m_proxy_enabled); - DDX_Control(pDX, IDC_PROXY_AUTH_ENABLED, m_proxy_auth_enabled); - DDX_Control(pDX, IDC_PROXYPASS, m_proxypass); - DDX_Control(pDX, IDC_PROXYHOST, m_proxyhost); - DDX_Control(pDX, IDC_PROXYUSER, m_proxyuser); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CPropConn, CPropertyPage) - //{{AFX_MSG_MAP(CPropConn) - ON_BN_CLICKED(IDC_PROXY_AUTH_ENABLED, OnProxyAuthEnabled) - ON_BN_CLICKED(IDC_PROXY_ENABLED, OnProxyEnabled) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CPropConn message handlers - -void CPropConn::OnProxyAuthEnabled() -{ - m_proxyuser.EnableWindow(m_proxy_enabled.GetCheck() && m_proxy_auth_enabled.GetCheck()); - m_proxypass.EnableWindow(m_proxy_enabled.GetCheck() && m_proxy_auth_enabled.GetCheck()); -} - -void CPropConn::OnProxyEnabled() -{ - // TODO: Add your control notification handler code here - m_proxyhost.EnableWindow(m_proxy_enabled.GetCheck()); - m_proxytype.EnableWindow(m_proxy_enabled.GetCheck()); - m_proxyport.EnableWindow(m_proxy_enabled.GetCheck()); - m_proxy_auth_enabled.EnableWindow(m_proxy_enabled.GetCheck()); - - if(m_proxy_enabled.GetCheck() && (m_proxytype.GetCurSel() < 0 || m_proxytype.GetCurSel() > 2)) - { - m_proxytype.SetCurSel(0); - } - - OnProxyAuthEnabled(); -} - -void CPropConn::OnOK() -{ - if(!m_proxy_enabled.GetCheck()) { - proxytype = PROXY_NONE; - return; - } - - CString tmp; - m_proxyhost.GetWindowText(tmp); - strcpy(proxyhost, tmp); - - m_proxyport.GetWindowText(tmp); - proxyport = atoi(tmp); - - proxytype = m_proxytype.GetCurSel()+1; - - if(!m_proxy_auth_enabled.GetCheck()) { - strcpy(proxyuser, ""); - strcpy(proxypass, ""); - return; - } - - m_proxyuser.GetWindowText(tmp); - strcpy(proxyuser, tmp); - m_proxypass.GetWindowText(tmp); - strcpy(proxypass, tmp); - - CPropertyPage::OnOK(); -} - -BOOL CPropConn::OnInitDialog() -{ - char pp[20]; - CPropertyPage::OnInitDialog(); - - m_proxyhost.SetWindowText(proxyhost); - m_proxyuser.SetWindowText(proxyuser); - m_proxypass.SetWindowText(proxypass); - g_snprintf(pp, 20, "%d", proxyport); - m_proxyport.SetWindowText(pp); - - m_proxytype.AddString("SOCKS 4"); - m_proxytype.AddString("SOCKS 5"); - m_proxytype.AddString("HTTP"); - m_proxytype.SetCurSel(proxytype-1); - - m_proxy_enabled.SetCheck(proxytype == PROXY_NONE?0:1); - m_proxy_auth_enabled.SetCheck(strcmp(proxyuser, "")?1:0); - - OnProxyEnabled(); - - return TRUE; -} diff --git a/win32/PropConn.h b/win32/PropConn.h deleted file mode 100644 index 1143912c..00000000 --- a/win32/PropConn.h +++ /dev/null @@ -1,56 +0,0 @@ -#if !defined(AFX_PROPCONN_H__8969671F_8D9F_45E9_929F_B36CFEFCBAA2__INCLUDED_) -#define AFX_PROPCONN_H__8969671F_8D9F_45E9_929F_B36CFEFCBAA2__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// PropConn.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CPropConn dialog - -class CPropConn : public CPropertyPage -{ -// Construction -public: - CPropConn(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CPropConn) - enum { IDD = IDD_PROPPAGE_CONNECTION }; - CEdit m_proxyport; - CListBox m_proxytype; - CButton m_proxy_enabled; - CButton m_proxy_auth_enabled; - CEdit m_proxypass; - CEdit m_proxyhost; - CEdit m_proxyuser; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CPropConn) - public: - virtual void OnOK(); - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CPropConn) - afx_msg void OnProxyAuthEnabled(); - afx_msg void OnProxyEnabled(); - virtual BOOL OnInitDialog(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_PROPCONN_H__8969671F_8D9F_45E9_929F_B36CFEFCBAA2__INCLUDED_) diff --git a/win32/PropLog.cpp b/win32/PropLog.cpp deleted file mode 100644 index 27957b07..00000000 --- a/win32/PropLog.cpp +++ /dev/null @@ -1,80 +0,0 @@ -// PropLog.cpp : implementation file -// - -#define BITLBEE_CORE -#include "bitlbeewin.h" -#include "PropLog.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CPropLog dialog - - -CPropLog::CPropLog() - : CPropertyPage(CPropLog::IDD) -{ - //{{AFX_DATA_INIT(CPropLog) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT -} - - -void CPropLog::DoDataExchange(CDataExchange* pDX) -{ - CPropertyPage::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CPropLog) - DDX_Control(pDX, IDC_LOG, m_log); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CPropLog, CPropertyPage) - //{{AFX_MSG_MAP(CPropLog) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CPropLog message handlers - -static GList *log = NULL; - -extern "C" { -void glib_logger (const gchar *log_domain, GLogLevelFlags log_level, const gchar *msg, gpointer user_data) -{ - log = g_list_append(log, g_strdup_printf("%s: %s", log_domain, msg)); -} -} - -void log_message(int level, char *message, ... ) { -#define LOG_MAXLEN 300 - va_list ap; - va_start(ap, message); - char *msg = (char *)g_malloc(LOG_MAXLEN); - g_vsnprintf(msg, LOG_MAXLEN, message, ap); - va_end(ap); - log = g_list_append(log, msg); - if(level == LOGLVL_ERROR) ::MessageBox(NULL, msg, "Bitlbee", MB_OK | MB_ICONINFORMATION); - TRACE("%d: %s\n", level, msg); -} - - -BOOL CPropLog::OnInitDialog() -{ - CPropertyPage::OnInitDialog(); - - m_log.ResetContent(); - GList *gl = log; - while(gl) { - char *d = (char *)gl->data; - m_log.AddString(d); - gl = gl->next; - } - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} diff --git a/win32/PropLog.h b/win32/PropLog.h deleted file mode 100644 index 1a847b19..00000000 --- a/win32/PropLog.h +++ /dev/null @@ -1,47 +0,0 @@ -#if !defined(AFX_PROPLOG_H__F56909E1_BBCC_4163_B9C2_E8D5685A34AA__INCLUDED_) -#define AFX_PROPLOG_H__F56909E1_BBCC_4163_B9C2_E8D5685A34AA__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// PropLog.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CPropLog dialog - -class CPropLog : public CPropertyPage -{ -// Construction -public: - CPropLog(); // standard constructor - -// Dialog Data - //{{AFX_DATA(CPropLog) - enum { IDD = IDD_PROPPAGE_LOG }; - CListBox m_log; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CPropLog) - public: - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CPropLog) - virtual BOOL OnInitDialog(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_PROPLOG_H__F56909E1_BBCC_4163_B9C2_E8D5685A34AA__INCLUDED_) diff --git a/win32/PropPaths.cpp b/win32/PropPaths.cpp deleted file mode 100644 index 7790e99c..00000000 --- a/win32/PropPaths.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// PropPaths.cpp : implementation file -// - -#define BITLBEE_CORE -#include "bitlbeewin.h" -#include "PropPaths.h" -#include "shlobj.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CPropPaths dialog - - -CPropPaths::CPropPaths() - : CPropertyPage(CPropPaths::IDD) -{ - //{{AFX_DATA_INIT(CPropPaths) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT -} - - -void CPropPaths::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CPropPaths) - DDX_Control(pDX, IDC_MOTDFILE, m_motdfile); - DDX_Control(pDX, IDC_EDIT_MOTD, m_edit_motd); - DDX_Control(pDX, IDC_CONFIGDIR, m_configdir); - DDX_Control(pDX, IDC_BROWSE_MOTD, m_browse_motd); - DDX_Control(pDX, IDC_BROWSE_CONFIG, m_browse_config); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CPropPaths, CPropertyPage) - //{{AFX_MSG_MAP(CPropPaths) - ON_BN_CLICKED(IDC_BROWSE_CONFIG, OnBrowseConfig) - ON_BN_CLICKED(IDC_BROWSE_MOTD, OnBrowseMotd) - ON_BN_CLICKED(IDC_EDIT_MOTD, OnEditMotd) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CPropPaths message handlers - -void CPropPaths::OnOK() -{ - CString tmp; - g_free((void *)global.conf->configdir); - m_configdir.GetWindowText(tmp); - - if (tmp.GetLength() > 0 - && tmp.GetAt(tmp.GetLength() - 1) != '/' - && tmp.GetAt(tmp.GetLength() - 1) != '\\') - { - global.conf->configdir = g_strdup_printf("%s\\", tmp); - } else { - global.conf->configdir = g_strdup(tmp); - } - - g_free((void *)global.conf->motdfile); - m_motdfile.GetWindowText(tmp); - global.conf->motdfile = g_strdup(tmp); - - CPropertyPage::OnOK(); -} - -void CPropPaths::OnBrowseConfig() -{ - BROWSEINFO bi = { 0 }; - bi.lpszTitle = _T("Choose a config directory"); - LPITEMIDLIST pidl = SHBrowseForFolder(&bi); - if( pidl != 0) - { - TCHAR path[MAX_PATH]; - if( SHGetPathFromIDList (pidl, path) ) { - m_configdir.SetWindowText(path); - } - - IMalloc * imalloc = 0; - if ( SUCCEEDED (SHGetMalloc (&imalloc)) ) - { - imalloc->Free(pidl); - imalloc->Release(); - } - } -} - -void CPropPaths::OnBrowseMotd() -{ - CFileDialog f(TRUE); - - if(f.DoModal() == IDOK) { - m_motdfile.SetWindowText(f.GetPathName()); - } - -} - -void CPropPaths::OnEditMotd() -{ - CString loc;m_motdfile.GetWindowText(loc); - ShellExecute(this->GetSafeHwnd(), NULL, loc, NULL, NULL, SW_SHOWNORMAL); -} - -BOOL CPropPaths::OnInitDialog() -{ - CPropertyPage::OnInitDialog(); - - m_configdir.SetWindowText(global.conf->configdir); - m_motdfile.SetWindowText(global.conf->motdfile); - - return TRUE; -} diff --git a/win32/PropPaths.h b/win32/PropPaths.h deleted file mode 100644 index 89c1c78e..00000000 --- a/win32/PropPaths.h +++ /dev/null @@ -1,55 +0,0 @@ -#if !defined(AFX_PROPPATHS_H__693C8F02_C150_45DD_99F1_F824795E98C9__INCLUDED_) -#define AFX_PROPPATHS_H__693C8F02_C150_45DD_99F1_F824795E98C9__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// PropPaths.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CPropPaths dialog - -class CPropPaths : public CPropertyPage -{ -// Construction -public: - CPropPaths(); // standard constructor - -// Dialog Data - //{{AFX_DATA(CPropPaths) - enum { IDD = IDD_PROPPAGE_PATHS }; - CEdit m_motdfile; - CButton m_edit_motd; - CEdit m_configdir; - CButton m_browse_motd; - CButton m_browse_config; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CPropPaths) - public: - virtual void OnOK(); - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CPropPaths) - afx_msg void OnBrowseConfig(); - afx_msg void OnBrowseMotd(); - afx_msg void OnEditMotd(); - virtual BOOL OnInitDialog(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_PROPPATHS_H__693C8F02_C150_45DD_99F1_F824795E98C9__INCLUDED_) diff --git a/win32/PropUsers.cpp b/win32/PropUsers.cpp deleted file mode 100644 index 7f1a2c35..00000000 --- a/win32/PropUsers.cpp +++ /dev/null @@ -1,120 +0,0 @@ -// PropUsers.cpp : implementation file -// - -#define BITLBEE_CORE -#include "bitlbeewin.h" -#include "PropUsers.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CPropUsers dialog - - -CPropUsers::CPropUsers() - : CPropertyPage(CPropUsers::IDD) -{ - //{{AFX_DATA_INIT(CPropUsers) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT -} - - -void CPropUsers::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CPropUsers) - DDX_Control(pDX, IDC_KNOWN_USERS, m_known_users); - DDX_Control(pDX, IDC_KICK, m_kick); - DDX_Control(pDX, IDC_DEL_KNOWN_USERS, m_del_known_users); - DDX_Control(pDX, IDC_CURRENT_USERS, m_current_users); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CPropUsers, CPropertyPage) - //{{AFX_MSG_MAP(CPropUsers) - ON_BN_CLICKED(IDC_KICK, OnKick) - ON_BN_CLICKED(IDC_DEL_KNOWN_USERS, OnDelKnownUser) - ON_LBN_SELCHANGE(IDC_CURRENT_USERS, OnSelchangeCurrentUsers) - ON_LBN_SELCHANGE(IDC_KNOWN_USERS, OnSelchangeKnownUsers) - ON_BN_CLICKED(IDC_REFRESH_KNOWN_USERS, OnRefreshKnownUsers) - ON_BN_CLICKED(IDC_REFRESH_CURRENT_USERS, OnRefreshCurrentUsers) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CPropUsers message handlers - -void CPropUsers::OnKick() -{ - int idx = m_current_users.GetCurSel(); - if(idx == LB_ERR) return; - irc_t *irc = (irc_t *)m_current_users.GetItemData(idx); - irc_free(irc); - m_kick.EnableWindow(FALSE); - OnRefreshCurrentUsers(); -} - -void CPropUsers::OnDelKnownUser() -{ - CString nick; - m_known_users.GetText(m_known_users.GetCurSel(), nick); - CString accounts; accounts.Format("%s\\%s.accounts", global.conf->configdir, nick); - CString nicks; nicks.Format("%s\\%s.nicks", global.conf->configdir, nick); - CFile::Remove(accounts); - CFile::Remove(nicks); - m_del_known_users.EnableWindow(FALSE); - OnRefreshKnownUsers(); -} - -void CPropUsers::OnSelchangeCurrentUsers() -{ - m_kick.EnableWindow(m_current_users.GetCurSel() != LB_ERR); - -} - -void CPropUsers::OnSelchangeKnownUsers() -{ - m_del_known_users.EnableWindow(m_known_users.GetCurSel() != LB_ERR); - -} - -void CPropUsers::OnRefreshKnownUsers() -{ - m_known_users.ResetContent(); - GError *error = NULL; - const char *r; - GDir *d = g_dir_open(global.conf->configdir, 0, &error); - if(!d) return; - while(r = g_dir_read_name(d)) { - if(strstr(r, ".accounts")) { - CString tmp(r, strlen(r) - strlen(".accounts")); - m_known_users.AddString(tmp); - } - } - g_dir_close(d); -} - -extern "C" { - extern GSList *irc_connection_list; -} - -void CPropUsers::OnRefreshCurrentUsers() -{ - m_current_users.ResetContent(); - GSList *gl = irc_connection_list; - while(gl) { - irc_t *irc = (irc_t *)gl->data; - CString tmp; - tmp.Format("%s@%s \"%s\"", irc->nick, irc->myhost, irc->realname); - int idx = m_current_users.AddString(tmp); - m_current_users.SetItemData(idx, (unsigned long)irc); - gl = gl->next; - } -} - diff --git a/win32/PropUsers.h b/win32/PropUsers.h deleted file mode 100644 index 7dd028c6..00000000 --- a/win32/PropUsers.h +++ /dev/null @@ -1,54 +0,0 @@ -#if !defined(AFX_PROPUSERS_H__BA8F6624_F693_403B_B3A8_B140955A894B__INCLUDED_) -#define AFX_PROPUSERS_H__BA8F6624_F693_403B_B3A8_B140955A894B__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// PropUsers.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CPropUsers dialog - -class CPropUsers : public CPropertyPage -{ -// Construction -public: - CPropUsers(); // standard constructor - -// Dialog Data - //{{AFX_DATA(CPropUsers) - enum { IDD = IDD_PROPPAGE_USERS }; - CListBox m_known_users; - CButton m_kick; - CButton m_del_known_users; - CListBox m_current_users; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CPropUsers) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CPropUsers) - afx_msg void OnKick(); - afx_msg void OnDelKnownUser(); - afx_msg void OnSelchangeCurrentUsers(); - afx_msg void OnSelchangeKnownUsers(); - afx_msg void OnRefreshKnownUsers(); - afx_msg void OnRefreshCurrentUsers(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_PROPUSERS_H__BA8F6624_F693_403B_B3A8_B140955A894B__INCLUDED_) diff --git a/win32/TrayNot.cpp b/win32/TrayNot.cpp deleted file mode 100644 index bd6bf39a..00000000 --- a/win32/TrayNot.cpp +++ /dev/null @@ -1,106 +0,0 @@ -// TrayNot.cpp : implementation file -// - -#define BITLBEE_CORE -#include "bitlbeewin.h" -#include "TrayNot.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CTrayNot dialog - - -CTrayNot::CTrayNot(CPropertySheet *s) - : CDialog(CTrayNot::IDD, NULL) -{ - Create(CTrayNot::IDD); - EnableWindow(FALSE); - - dlg = s; - - /* Traybar icon */ - NOTIFYICONDATA dat; - dat.cbSize = sizeof(NOTIFYICONDATA); - dat.hWnd = m_hWnd; - dat.uID = 1; - dat.uFlags = NIF_ICON + NIF_TIP + NIF_MESSAGE; - dat.hIcon = AfxGetApp()->LoadIcon(IDI_BEE); - dat.uCallbackMessage = BITLBEE_TRAY_ICON; - strcpy(dat.szTip, "Bitlbee manager"); - Shell_NotifyIcon(NIM_ADD, &dat); - - //{{AFX_DATA_INIT(CTrayNot) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT -} - - -void CTrayNot::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CTrayNot) - // NOTE: the ClassWizard will add DDX and DDV calls here - //}}AFX_DATA_MAP -} - -///////////////////////////////////////////////////////////////////////////// -// CTrayNot message handlers - -CTrayNot::~CTrayNot() -{ - NOTIFYICONDATA dat; - dat.cbSize = sizeof(NOTIFYICONDATA); - dat.hWnd = m_hWnd; - dat.uID = 1; - Shell_NotifyIcon(NIM_DELETE, &dat); -} - - -BEGIN_MESSAGE_MAP(CTrayNot, CDialog) - //{{AFX_MSG_MAP(CTrayNot) - // NOTE - the ClassWizard will add and remove mapping macros here. - ON_MESSAGE (BITLBEE_TRAY_ICON, OnSysTrayIconClick) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - - -///////////////////////////////////////////////////////////////////////////// -// CTrayNot message handlers - -afx_msg LONG CTrayNot::OnSysTrayIconClick (WPARAM wParam, LPARAM lParam) -{ - switch (lParam) - { - case WM_LBUTTONDOWN: - dlg->ShowWindow(SW_SHOW); - break; - case WM_RBUTTONDOWN: - ShowQuickMenu (); - break ; - } - return 0; -} - -void CTrayNot::ShowQuickMenu() -{ - POINT CurPos; - - CMenu qmenu; - qmenu.LoadMenu(IDR_POPUP); - - GetCursorPos (&CurPos); - - CMenu *submenu = qmenu.GetSubMenu(0); - - SetForegroundWindow(); - // Display the menu. This menu is a popup loaded elsewhere. - - submenu->TrackPopupMenu (TPM_RIGHTBUTTON | TPM_RIGHTALIGN, - CurPos.x, - CurPos.y,this); -} diff --git a/win32/TrayNot.h b/win32/TrayNot.h deleted file mode 100644 index 9dbcb282..00000000 --- a/win32/TrayNot.h +++ /dev/null @@ -1,54 +0,0 @@ -#if !defined(AFX_TRAYNOT_H__C8B7E607_671B_4C97_8251_AF5AA83DF401__INCLUDED_) -#define AFX_TRAYNOT_H__C8B7E607_671B_4C97_8251_AF5AA83DF401__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// TrayNot.h : header file -// - -#include - -#define BITLBEE_TRAY_ICON WM_USER+1 - -///////////////////////////////////////////////////////////////////////////// -// CTrayNot dialog - -class CTrayNot : public CDialog -{ -// Construction -public: - virtual ~CTrayNot(); - CTrayNot(CPropertySheet *); // standard constructor - -// Dialog Data - //{{AFX_DATA(CTrayNot) - enum { IDD = IDD_PHONY }; - // NOTE: the ClassWizard will add data members here - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CTrayNot) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CTrayNot) - // NOTE: the ClassWizard will add member functions here - afx_msg LONG OnSysTrayIconClick (WPARAM wParam, LPARAM lParam); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - CPropertySheet *dlg; - void ShowQuickMenu(); -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_TRAYNOT_H__C8B7E607_671B_4C97_8251_AF5AA83DF401__INCLUDED_) diff --git a/win32/admin/MainDlg.cpp b/win32/admin/MainDlg.cpp new file mode 100644 index 00000000..e9ecda34 --- /dev/null +++ b/win32/admin/MainDlg.cpp @@ -0,0 +1,71 @@ +// MainDlg.cpp : implementation file +// + +#include "PropPaths.h" +#include "PropAccess.h" +#include "PropConn.h" +#include "MainDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CMainDlg + +IMPLEMENT_DYNAMIC(CMainDlg, CPropertySheet) + +CMainDlg::CMainDlg() : CPropertySheet("Bitlbee for Windows") +{ + AddPage(new CPropPaths()); + AddPage(new CPropAccess()); + AddPage(new CPropertyPage(IDD_PROPPAGE_ABOUT)); + AddPage(new CPropConn()); + Create(); + ShowWindow(SW_HIDE); +} + +CMainDlg::~CMainDlg() +{ +} + + +BEGIN_MESSAGE_MAP(CMainDlg, CPropertySheet) + //{{AFX_MSG_MAP(CMainDlg) + ON_WM_CLOSE() + //}}AFX_MSG_MAP + ON_BN_CLICKED(IDOK, OnOK) +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CMainDlg message handlers + +BOOL CMainDlg::OnInitDialog() +{ + m_bModeless = FALSE; + m_nFlags |= WF_CONTINUEMODAL; + + CPropertySheet::OnInitDialog(); + GetDlgItem(IDHELP)->ShowWindow(SW_HIDE); + GetDlgItem(IDCANCEL)->ShowWindow(SW_HIDE); + + m_bModeless = TRUE; + m_nFlags &= WF_CONTINUEMODAL; + + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} + +void CMainDlg::OnOK() +{ + PressButton(PSBTN_APPLYNOW); + ShowWindow(SW_HIDE); +} + + +void CMainDlg::OnClose() +{ + ShowWindow(SW_HIDE); +} diff --git a/win32/admin/MainDlg.h b/win32/admin/MainDlg.h new file mode 100644 index 00000000..be5547fd --- /dev/null +++ b/win32/admin/MainDlg.h @@ -0,0 +1,54 @@ +#if !defined(AFX_MAINDLG_H__D88FFF4C_047D_4562_A041_CCDCFA52F87C__INCLUDED_) +#define AFX_MAINDLG_H__D88FFF4C_047D_4562_A041_CCDCFA52F87C__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +// MainDlg.h : header file +// + +#include + +///////////////////////////////////////////////////////////////////////////// +// CMainDlg + +class CMainDlg : public CPropertySheet +{ + DECLARE_DYNAMIC(CMainDlg) + +// Construction +public: + CMainDlg(); + +// Attributes +public: + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CMainDlg) + //}}AFX_VIRTUAL + +// Implementation +public: + virtual ~CMainDlg(); + + // Generated message map functions +protected: + //{{AFX_MSG(CMainDlg) + virtual BOOL OnInitDialog(); + afx_msg void OnClose(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +private: + void OnOK(); +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_MAINDLG_H__D88FFF4C_047D_4562_A041_CCDCFA52F87C__INCLUDED_) diff --git a/win32/admin/PropAccess.cpp b/win32/admin/PropAccess.cpp new file mode 100644 index 00000000..a09ce454 --- /dev/null +++ b/win32/admin/PropAccess.cpp @@ -0,0 +1,114 @@ +// PropAccess.cpp : implementation file +// + +#include "PropAccess.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CPropAccess dialog + + +CPropAccess::CPropAccess() + : CPropertyPage(CPropAccess::IDD) +{ + + //{{AFX_DATA_INIT(CPropAccess) + //}}AFX_DATA_INIT +} + + +void CPropAccess::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CPropAccess) + DDX_Control(pDX, IDC_AUTH_REGISTERED, m_auth_registered); + DDX_Control(pDX, IDC_AUTH_OPEN, m_auth_open); + DDX_Control(pDX, IDC_AUTH_CLOSED, m_auth_closed); + DDX_Control(pDX, IDC_PASSWORD, m_password); + DDX_Control(pDX, IDC_PORT, m_port); + DDX_Control(pDX, IDC_INTERFACE, m_interface); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CPropAccess, CPropertyPage) + //{{AFX_MSG_MAP(CPropAccess) + ON_BN_CLICKED(IDC_AUTH_REGISTERED, OnAuthRegistered) + ON_BN_CLICKED(IDC_AUTH_OPEN, OnAuthOpen) + ON_BN_CLICKED(IDC_AUTH_CLOSED, OnAuthClosed) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CPropAccess message handlers + +void CPropAccess::OnOK() +{ + CString iface; m_interface.GetWindowText(iface); + WriteProfileString("interface", iface); + + CString port; m_port.GetWindowText(port); + WriteProfileInt("port", port); + + CString password; m_password.GetWindowText(password); + WriteProfileString("password", password); + + if(m_auth_closed.GetCheck() == 1) WriteProfileInt("auth_mode", 1); + if(m_auth_open.GetCheck() == 1) WriteProfileInt("auth_mode", 0); + if(m_auth_registered.GetCheck() == 1) WriteProfileInt("auth_mode", 2); + + CPropertyPage::OnOK(); +} + +void CPropAccess::OnAuthRegistered() +{ + m_password.EnableWindow(FALSE); + m_auth_open.SetCheck(0); + m_auth_registered.SetCheck(1); + m_auth_closed.SetCheck(0); + +} + +void CPropAccess::OnAuthOpen() +{ + m_password.EnableWindow(FALSE); + m_auth_open.SetCheck(1); + m_auth_registered.SetCheck(0); + m_auth_closed.SetCheck(0); +} + +void CPropAccess::OnAuthClosed() +{ + m_password.EnableWindow(TRUE); + m_auth_open.SetCheck(0); + m_auth_registered.SetCheck(0); + m_auth_closed.SetCheck(1); + +} + +BOOL CPropAccess::OnInitDialog() +{ + CPropertyPage::OnInitDialog(); + + HKEY key; + RegOpenKey(HKEY_LOCAL_MACHINE, BITLBEE_KEY, &key); + + m_interface.SetWindowText(GetProfileString("interface", "0.0.0.0")); + m_password.SetWindowText(GetProfileString("password", "")); + char tmp[20]; + sprintf(tmp, "%d", GetProfileInt("port", 6667)); + m_port.SetWindowText(tmp); + + switch(GetProfileInt("auth_mode", 1)) { + case 0: OnAuthOpen();break; + case 1: OnAuthClosed();break; + case 2: OnAuthRegistered();break; + } + + return TRUE; +} diff --git a/win32/admin/PropAccess.h b/win32/admin/PropAccess.h new file mode 100644 index 00000000..cae0241c --- /dev/null +++ b/win32/admin/PropAccess.h @@ -0,0 +1,59 @@ +#if !defined(AFX_PROPACCESS_H__0AC45777_B43C_4467_91FF_391DFD582057__INCLUDED_) +#define AFX_PROPACCESS_H__0AC45777_B43C_4467_91FF_391DFD582057__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +// PropAccess.h : header file +// + +#include +#include "Resource.h" + +///////////////////////////////////////////////////////////////////////////// +// CPropAccess dialog + +class CPropAccess : public CPropertyPage +{ +// Construction +public: + CPropAccess(); // standard constructor + +// Dialog Data + //{{AFX_DATA(CPropAccess) + enum { IDD = IDD_PROPPAGE_ACCESS }; + CButton m_auth_registered; + CButton m_auth_open; + CButton m_auth_closed; + CEdit m_password; + CEdit m_port; + CEdit m_interface; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CPropAccess) + public: + virtual void OnOK(); + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + + // Generated message map functions + //{{AFX_MSG(CPropAccess) + afx_msg void OnAuthRegistered(); + afx_msg void OnAuthOpen(); + afx_msg void OnAuthClosed(); + virtual BOOL OnInitDialog(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_PROPACCESS_H__0AC45777_B43C_4467_91FF_391DFD582057__INCLUDED_) diff --git a/win32/admin/PropConn.cpp b/win32/admin/PropConn.cpp new file mode 100644 index 00000000..b16be0f1 --- /dev/null +++ b/win32/admin/PropConn.cpp @@ -0,0 +1,123 @@ +// PropConn.cpp : implementation file +// + +#include "PropConn.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CPropConn dialog + + +CPropConn::CPropConn(CWnd* pParent /*=NULL*/) + : CPropertyPage(CPropConn::IDD) +{ + //{{AFX_DATA_INIT(CPropConn) + //}}AFX_DATA_INIT +} + + +void CPropConn::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CPropConn) + DDX_Control(pDX, IDC_PROXYPORT, m_proxyport); + DDX_Control(pDX, IDC_PROXYTYPE, m_proxytype); + DDX_Control(pDX, IDC_PROXY_ENABLED, m_proxy_enabled); + DDX_Control(pDX, IDC_PROXY_AUTH_ENABLED, m_proxy_auth_enabled); + DDX_Control(pDX, IDC_PROXYPASS, m_proxypass); + DDX_Control(pDX, IDC_PROXYHOST, m_proxyhost); + DDX_Control(pDX, IDC_PROXYUSER, m_proxyuser); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CPropConn, CPropertyPage) + //{{AFX_MSG_MAP(CPropConn) + ON_BN_CLICKED(IDC_PROXY_AUTH_ENABLED, OnProxyAuthEnabled) + ON_BN_CLICKED(IDC_PROXY_ENABLED, OnProxyEnabled) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CPropConn message handlers + +void CPropConn::OnProxyAuthEnabled() +{ + m_proxyuser.EnableWindow(m_proxy_enabled.GetCheck() && m_proxy_auth_enabled.GetCheck()); + m_proxypass.EnableWindow(m_proxy_enabled.GetCheck() && m_proxy_auth_enabled.GetCheck()); +} + +void CPropConn::OnProxyEnabled() +{ + m_proxyhost.EnableWindow(m_proxy_enabled.GetCheck()); + m_proxytype.EnableWindow(m_proxy_enabled.GetCheck()); + m_proxyport.EnableWindow(m_proxy_enabled.GetCheck()); + m_proxy_auth_enabled.EnableWindow(m_proxy_enabled.GetCheck()); + + if(m_proxy_enabled.GetCheck() && (m_proxytype.GetCurSel() < 0 || m_proxytype.GetCurSel() > 2)) + { + m_proxytype.SetCurSel(0); + } + + OnProxyAuthEnabled(); +} + +void CPropConn::OnOK() +{ + CString tmp; + m_proxyhost.GetWindowText(tmp); + WriteProfileString("proxy_host", tmp); + + m_proxyport.GetWindowText(tmp); + WriteProfileInt("proxy_port", atoi(tmp)); + + if(!m_proxy_enabled.GetCheck()) { + WriteProfileInt("proxy_type", 0); + } else { + WriteProfileInt("proxy_type", m_proxytype.GetCurSel()+1); + } + + if(!m_proxy_auth_enabled.GetCheck()) { + WriteProfileString("proxy_user", ""); + WriteProfileString("proxy_password", ""); + } else { + m_proxyuser.GetWindowText(tmp); + WriteProfileString("proxy_user", tmp); + m_proxypass.GetWindowText(tmp); + WriteProfileString("proxy_password", tmp); + } + + CPropertyPage::OnOK(); +} + +BOOL CPropConn::OnInitDialog() +{ + char pp[20]; + CPropertyPage::OnInitDialog(); + int proxytype; + + m_proxyhost.SetWindowText(GetProfileString("proxy_host", "")); + m_proxyuser.SetWindowText(GetProfileString("proxy_user", "")); + m_proxypass.SetWindowText(GetProfileString("proxy_password", "")); + sprintf(pp, "%d", GetProfileInt("proxy_port", 3128)); + m_proxyport.SetWindowText(pp); + + proxytype = GetProfileInt("proxy_type", 0); + + m_proxytype.AddString("SOCKS 4"); + m_proxytype.AddString("SOCKS 5"); + m_proxytype.AddString("HTTP"); + m_proxytype.SetCurSel(proxytype-1); + + m_proxy_enabled.SetCheck(proxytype == 0?0:1); + m_proxy_auth_enabled.SetCheck(strcmp(GetProfileString("proxy_user", ""), "")?1:0); + + OnProxyEnabled(); + + return TRUE; +} \ No newline at end of file diff --git a/win32/admin/PropConn.h b/win32/admin/PropConn.h new file mode 100644 index 00000000..e920da3d --- /dev/null +++ b/win32/admin/PropConn.h @@ -0,0 +1,59 @@ +#if !defined(AFX_PROPCONN_H__8969671F_8D9F_45E9_929F_B36CFEFCBAA2__INCLUDED_) +#define AFX_PROPCONN_H__8969671F_8D9F_45E9_929F_B36CFEFCBAA2__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +// PropConn.h : header file +// + +#include +#include "Resource.h" + +///////////////////////////////////////////////////////////////////////////// +// CPropConn dialog + +class CPropConn : public CPropertyPage +{ +// Construction +public: + CPropConn(CWnd* pParent = NULL); // standard constructor + +// Dialog Data + //{{AFX_DATA(CPropConn) + enum { IDD = IDD_PROPPAGE_CONNECTION }; + CEdit m_proxyport; + CListBox m_proxytype; + CButton m_proxy_enabled; + CButton m_proxy_auth_enabled; + CEdit m_proxypass; + CEdit m_proxyhost; + CEdit m_proxyuser; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CPropConn) + public: + virtual void OnOK(); + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + + // Generated message map functions + //{{AFX_MSG(CPropConn) + afx_msg void OnProxyAuthEnabled(); + afx_msg void OnProxyEnabled(); + virtual BOOL OnInitDialog(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_PROPCONN_H__8969671F_8D9F_45E9_929F_B36CFEFCBAA2__INCLUDED_) diff --git a/win32/admin/PropLog.cpp b/win32/admin/PropLog.cpp new file mode 100644 index 00000000..8b1641d9 --- /dev/null +++ b/win32/admin/PropLog.cpp @@ -0,0 +1,78 @@ +// PropLog.cpp : implementation file +// + +#include "PropLog.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CPropLog dialog + + +CPropLog::CPropLog() + : CPropertyPage(CPropLog::IDD) +{ + //{{AFX_DATA_INIT(CPropLog) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT +} + + +void CPropLog::DoDataExchange(CDataExchange* pDX) +{ + CPropertyPage::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CPropLog) + DDX_Control(pDX, IDC_LOG, m_log); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CPropLog, CPropertyPage) + //{{AFX_MSG_MAP(CPropLog) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CPropLog message handlers + +static GList *log = NULL; + +extern "C" { +void glib_logger (const gchar *log_domain, GLogLevelFlags log_level, const gchar *msg, gpointer user_data) +{ + log = g_list_append(log, g_strdup_printf("%s: %s", log_domain, msg)); +} +} + +void log_message(int level, char *message, ... ) { +#define LOG_MAXLEN 300 + va_list ap; + va_start(ap, message); + char *msg = (char *)g_malloc(LOG_MAXLEN); + g_vsnprintf(msg, LOG_MAXLEN, message, ap); + va_end(ap); + log = g_list_append(log, msg); + if(level == LOGLVL_ERROR) ::MessageBox(NULL, msg, "Bitlbee", MB_OK | MB_ICONINFORMATION); + TRACE("%d: %s\n", level, msg); +} + + +BOOL CPropLog::OnInitDialog() +{ + CPropertyPage::OnInitDialog(); + + m_log.ResetContent(); + GList *gl = log; + while(gl) { + char *d = (char *)gl->data; + m_log.AddString(d); + gl = gl->next; + } + + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} diff --git a/win32/admin/PropLog.h b/win32/admin/PropLog.h new file mode 100644 index 00000000..1a847b19 --- /dev/null +++ b/win32/admin/PropLog.h @@ -0,0 +1,47 @@ +#if !defined(AFX_PROPLOG_H__F56909E1_BBCC_4163_B9C2_E8D5685A34AA__INCLUDED_) +#define AFX_PROPLOG_H__F56909E1_BBCC_4163_B9C2_E8D5685A34AA__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +// PropLog.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CPropLog dialog + +class CPropLog : public CPropertyPage +{ +// Construction +public: + CPropLog(); // standard constructor + +// Dialog Data + //{{AFX_DATA(CPropLog) + enum { IDD = IDD_PROPPAGE_LOG }; + CListBox m_log; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CPropLog) + public: + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + + // Generated message map functions + //{{AFX_MSG(CPropLog) + virtual BOOL OnInitDialog(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_PROPLOG_H__F56909E1_BBCC_4163_B9C2_E8D5685A34AA__INCLUDED_) diff --git a/win32/admin/PropMain.cpp b/win32/admin/PropMain.cpp new file mode 100644 index 00000000..f15af691 --- /dev/null +++ b/win32/admin/PropMain.cpp @@ -0,0 +1,99 @@ +// PropMain.cpp : implementation file +// + +#include +#include "PropMain.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CPropMain property page + +IMPLEMENT_DYNCREATE(CPropMain, CPropertyPage) + +CPropMain::CPropMain() : CPropertyPage(CPropMain::IDD) +{ + //{{AFX_DATA_INIT(CPropMain) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT +} + +CPropMain::~CPropMain() +{ +} + +void CPropMain::DoDataExchange(CDataExchange* pDX) +{ + CPropertyPage::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CPropMain) + DDX_Control(pDX, IDC_STOPSERVICE, m_stopservice); + DDX_Control(pDX, IDC_STARTSERVICE, m_startservice); + DDX_Control(pDX, IDC_PING_INTERVAL, m_ping_interval); + DDX_Control(pDX, IDC_VERBOSE, m_Verbose); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CPropMain, CPropertyPage) + //{{AFX_MSG_MAP(CPropMain) + ON_BN_CLICKED(IDC_STARTSERVICE, OnStartService) + ON_BN_CLICKED(IDC_STOPSERVICE, OnStopService) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CPropMain message handlers + +BOOL CPropMain::OnInitDialog() +{ + CPropertyPage::OnInitDialog(); + + global.conf->verbose = GetProfileInt("verbose", 0); + global.conf->ping_interval = GetProfileInt("ping_interval_timeout", 0); + + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} + +void CPropMain::OnOK() +{ + CPropertyPage::OnOK(); + + WriteProfileInt("verbose", global.conf->verbose); + + WriteProfileInt("ping_interval_timeout", global.conf->ping_interval); +} + +void CPropMain::OnStartService() +{ + SC_HANDLE schService; + SC_HANDLE schSCManager; + SERVICE_STATUS status; + + schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS ); + schService = OpenService(schSCManager, "bitlbee", SERVICE_ALL_ACCESS); + + ControlService( schService, SERVICE_CONTROL_CONTINUE, &status ); + + CloseServiceHandle(schService); + CloseServiceHandle(schSCManager); +} + +void CPropMain::OnStopService() +{ + SC_HANDLE schService; + SC_HANDLE schSCManager; + SERVICE_STATUS status; + + schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS ); + schService = OpenService(schSCManager, "bitlbee", SERVICE_ALL_ACCESS); + + ControlService( schService, SERVICE_CONTROL_PAUSE, &status ); + + CloseServiceHandle(schService); + CloseServiceHandle(schSCManager); +} diff --git a/win32/admin/PropMain.h b/win32/admin/PropMain.h new file mode 100644 index 00000000..832457b2 --- /dev/null +++ b/win32/admin/PropMain.h @@ -0,0 +1,58 @@ +#if !defined(AFX_PROPMAIN_H__F3EF57A7_15AA_4F36_B6C1_2EAD91127449__INCLUDED_) +#define AFX_PROPMAIN_H__F3EF57A7_15AA_4F36_B6C1_2EAD91127449__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +// PropMain.h : header file + +#include "Resource.h" +// + +///////////////////////////////////////////////////////////////////////////// +// CPropMain dialog + +class CPropMain : public CPropertyPage +{ + DECLARE_DYNCREATE(CPropMain) + +// Construction +public: + CPropMain(); + ~CPropMain(); + +// Dialog Data + //{{AFX_DATA(CPropMain) + enum { IDD = IDD_PROPPAGE_MAIN }; + CButton m_stopservice; + CButton m_startservice; + CEdit m_ping_interval; + CButton m_Verbose; + //}}AFX_DATA + + +// Overrides + // ClassWizard generate virtual function overrides + //{{AFX_VIRTUAL(CPropMain) + public: + virtual void OnOK(); + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + // Generated message map functions + //{{AFX_MSG(CPropMain) + virtual BOOL OnInitDialog(); + afx_msg void OnStartService(); + afx_msg void OnStopService(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_PROPMAIN_H__F3EF57A7_15AA_4F36_B6C1_2EAD91127449__INCLUDED_) diff --git a/win32/admin/PropPaths.cpp b/win32/admin/PropPaths.cpp new file mode 100644 index 00000000..4fb49497 --- /dev/null +++ b/win32/admin/PropPaths.cpp @@ -0,0 +1,115 @@ +// PropPaths.cpp : implementation file +// + +#include "PropPaths.h" +#include "shlobj.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CPropPaths dialog + + +CPropPaths::CPropPaths() + : CPropertyPage(CPropPaths::IDD) +{ + //{{AFX_DATA_INIT(CPropPaths) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT +} + + +void CPropPaths::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CPropPaths) + DDX_Control(pDX, IDC_MOTDFILE, m_motdfile); + DDX_Control(pDX, IDC_EDIT_MOTD, m_edit_motd); + DDX_Control(pDX, IDC_CONFIGDIR, m_configdir); + DDX_Control(pDX, IDC_BROWSE_MOTD, m_browse_motd); + DDX_Control(pDX, IDC_BROWSE_CONFIG, m_browse_config); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CPropPaths, CPropertyPage) + //{{AFX_MSG_MAP(CPropPaths) + ON_BN_CLICKED(IDC_BROWSE_CONFIG, OnBrowseConfig) + ON_BN_CLICKED(IDC_BROWSE_MOTD, OnBrowseMotd) + ON_BN_CLICKED(IDC_EDIT_MOTD, OnEditMotd) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CPropPaths message handlers + +void CPropPaths::OnOK() +{ + CString tmp; + m_configdir.GetWindowText(tmp); + + if (tmp.GetLength() > 0 + && tmp.GetAt(tmp.GetLength() - 1) != '/' + && tmp.GetAt(tmp.GetLength() - 1) != '\\') + { + tmp = tmp + "\\"; + } + + WriteProfileString("configdir", tmp); + + m_motdfile.GetWindowText(tmp); + WriteProfileString("motdfile", tmp); + + CPropertyPage::OnOK(); +} + +void CPropPaths::OnBrowseConfig() +{ + BROWSEINFO bi = { 0 }; + bi.lpszTitle = _T("Choose a config directory"); + LPITEMIDLIST pidl = SHBrowseForFolder(&bi); + if( pidl != 0) + { + TCHAR path[MAX_PATH]; + if( SHGetPathFromIDList (pidl, path) ) { + m_configdir.SetWindowText(path); + } + + IMalloc * imalloc = 0; + if ( SUCCEEDED (SHGetMalloc (&imalloc)) ) + { + imalloc->Free(pidl); + imalloc->Release(); + } + } +} + +void CPropPaths::OnBrowseMotd() +{ + CFileDialog f(TRUE); + + if(f.DoModal() == IDOK) { + m_motdfile.SetWindowText(f.GetPathName()); + } + +} + +void CPropPaths::OnEditMotd() +{ + CString loc;m_motdfile.GetWindowText(loc); + ShellExecute(this->GetSafeHwnd(), NULL, loc, NULL, NULL, SW_SHOWNORMAL); +} + +BOOL CPropPaths::OnInitDialog() +{ + CPropertyPage::OnInitDialog(); + + m_configdir.SetWindowText(GetProfileString("configdir", "")); + m_motdfile.SetWindowText(GetProfileString("motdfile", "")); + + return TRUE; +} diff --git a/win32/admin/PropPaths.h b/win32/admin/PropPaths.h new file mode 100644 index 00000000..733e674c --- /dev/null +++ b/win32/admin/PropPaths.h @@ -0,0 +1,57 @@ +#if !defined(AFX_PROPPATHS_H__693C8F02_C150_45DD_99F1_F824795E98C9__INCLUDED_) +#define AFX_PROPPATHS_H__693C8F02_C150_45DD_99F1_F824795E98C9__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +// PropPaths.h : header file +// +#include +#include "Resource.h" + +///////////////////////////////////////////////////////////////////////////// +// CPropPaths dialog + +class CPropPaths : public CPropertyPage +{ +// Construction +public: + CPropPaths(); // standard constructor + +// Dialog Data + //{{AFX_DATA(CPropPaths) + enum { IDD = IDD_PROPPAGE_PATHS }; + CEdit m_motdfile; + CButton m_edit_motd; + CEdit m_configdir; + CButton m_browse_motd; + CButton m_browse_config; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CPropPaths) + public: + virtual void OnOK(); + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + + // Generated message map functions + //{{AFX_MSG(CPropPaths) + afx_msg void OnBrowseConfig(); + afx_msg void OnBrowseMotd(); + afx_msg void OnEditMotd(); + virtual BOOL OnInitDialog(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_PROPPATHS_H__693C8F02_C150_45DD_99F1_F824795E98C9__INCLUDED_) diff --git a/win32/admin/admin.dsp b/win32/admin/admin.dsp new file mode 100644 index 00000000..6d24af0d --- /dev/null +++ b/win32/admin/admin.dsp @@ -0,0 +1,175 @@ +# Microsoft Developer Studio Project File - Name="admin" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=admin - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "admin.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "admin.mak" CFG="admin - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "admin - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "admin - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "admin - Win32 Release" + +# PROP BASE Use_MFC 6 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 6 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" +# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 +# ADD LINK32 /nologo /subsystem:windows /machine:I386 /out:"Release/bitlbeeadm.exe" + +!ELSEIF "$(CFG)" == "admin - Win32 Debug" + +# PROP BASE Use_MFC 6 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 6 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" +# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /out:"Debug/bitlbeeadm.exe" /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "admin - Win32 Release" +# Name "admin - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\bitlbeewin.cpp +# End Source File +# Begin Source File + +SOURCE=.\MainDlg.cpp +# End Source File +# Begin Source File + +SOURCE=.\PropAccess.cpp +# End Source File +# Begin Source File + +SOURCE=.\PropConn.cpp +# End Source File +# Begin Source File + +SOURCE=.\PropMain.cpp +# End Source File +# Begin Source File + +SOURCE=.\PropPaths.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\bitlbeewin.h +# End Source File +# Begin Source File + +SOURCE=.\MainDlg.h +# End Source File +# Begin Source File + +SOURCE=.\PropAccess.h +# End Source File +# Begin Source File + +SOURCE=.\PropConn.h +# End Source File +# Begin Source File + +SOURCE=.\PropMain.h +# End Source File +# Begin Source File + +SOURCE=.\PropPaths.h +# End Source File +# Begin Source File + +SOURCE=.\Resource.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\bitlbee.rc + +!IF "$(CFG)" == "admin - Win32 Release" + +!ELSEIF "$(CFG)" == "admin - Win32 Debug" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\res\bmp00002.bmp +# End Source File +# Begin Source File + +SOURCE=.\res\icon2.ico +# End Source File +# End Group +# End Target +# End Project diff --git a/win32/admin/bitlbee.rc b/win32/admin/bitlbee.rc new file mode 100644 index 00000000..5e9b5407 --- /dev/null +++ b/win32/admin/bitlbee.rc @@ -0,0 +1,303 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "#ifdef _WIN32\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#endif\r\n" + "#include ""afxres.rc"" // Standard components\r\n" + "#endif\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_BEE ICON DISCARDABLE "res\\icon2.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_PROPPAGE_ACCESS DIALOG DISCARDABLE 0, 0, 210, 154 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Access" +FONT 8, "MS Sans Serif" +BEGIN + GROUPBOX "Authentication Mode",IDC_STATIC,7,7,196,47 + CONTROL "&Open",IDC_AUTH_OPEN,"Button",BS_AUTORADIOBUTTON | + WS_GROUP,14,15,181,13 + CONTROL "&Closed",IDC_AUTH_CLOSED,"Button",BS_AUTORADIOBUTTON | + WS_GROUP,14,27,160,11 + CONTROL "&Registered",IDC_AUTH_REGISTERED,"Button", + BS_AUTORADIOBUTTON | WS_GROUP,14,39,182,11 + GROUPBOX "Bind",IDC_STATIC,7,55,196,46 + LTEXT "IP to bind to:",IDC_STATIC,15,67,49,9 + LTEXT "Port:",IDC_STATIC,15,82,52,10 + EDITTEXT IDC_INTERFACE,86,67,108,11,ES_AUTOHSCROLL + EDITTEXT IDC_PORT,86,82,108,11,ES_AUTOHSCROLL + GROUPBOX "Password",IDC_STATIC,7,104,196,43 + EDITTEXT IDC_PASSWORD,14,129,115,11,ES_AUTOHSCROLL + LTEXT "Only used when authentication mode is set to closed.", + IDC_STATIC,13,113,184,11 +END + +IDD_PROPPAGE_PATHS DIALOG DISCARDABLE 0, 0, 210, 154 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Paths" +FONT 8, "MS Sans Serif" +BEGIN + GROUPBOX "Config path",IDC_STATIC,7,7,196,30 + PUSHBUTTON "&Browse...",IDC_BROWSE_CONFIG,151,16,46,13 + EDITTEXT IDC_CONFIGDIR,13,17,122,13,ES_AUTOHSCROLL + GROUPBOX "Message of the day file",IDC_STATIC,7,42,196,40 + PUSHBUTTON "&Browse...",IDC_BROWSE_MOTD,153,51,43,13 + EDITTEXT IDC_MOTDFILE,13,51,122,13,ES_AUTOHSCROLL + PUSHBUTTON "&Edit...",IDC_EDIT_MOTD,153,66,43,13 +END + +IDD_PROPPAGE_ABOUT DIALOG DISCARDABLE 0, 0, 284, 156 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "About" +FONT 8, "MS Sans Serif" +BEGIN + GROUPBOX "Authors",IDC_STATIC,7,7,270,79 + LTEXT "Bitlbee is written by : \n Wilmer van der Gaast \n Maurits Dijkstra \n Jelmer Vernooij ", + IDC_STATIC,13,16,180,35 + LTEXT "Windows port by Jelmer Vernooij ", + IDC_STATIC,13,55,180,12 + CONTROL 135,IDC_STATIC,"Static",SS_BITMAP | SS_SUNKEN,193,14,73, + 64 + GROUPBOX "More information",IDC_STATIC,7,88,270,61 + LTEXT "See the file CREDITS for a list of contributors.", + IDC_STATIC,16,69,171,11 + LTEXT "The Bitlbee homepage is located at http://www.bitlbee.org/\n\nFor Bitlbee support, go to #bitlbee on irc.oftc.net", + IDC_STATIC,17,100,248,39 +END + +IDD_PROPPAGE_CONNECTION DIALOG DISCARDABLE 0, 0, 210, 154 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Connection" +FONT 8, "MS Sans Serif" +BEGIN + GROUPBOX "Proxy",IDC_STATIC,7,23,196,124 + EDITTEXT IDC_PROXYHOST,110,33,86,12,ES_AUTOHSCROLL + CONTROL "&Use Proxy",IDC_PROXY_ENABLED,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,7,196,14 + LTEXT "Proxy &Host",IDC_STATIC,13,33,82,12 + EDITTEXT IDC_PROXYUSER,110,105,86,12,ES_AUTOHSCROLL + LTEXT "Proxy &User",IDC_STATIC,13,105,82,12 + EDITTEXT IDC_PROXYPASS,110,122,86,12,ES_PASSWORD | ES_AUTOHSCROLL + LTEXT "Proxy &Password",IDC_STATIC,13,123,82,12 + CONTROL "&Authenticate to proxy",IDC_PROXY_AUTH_ENABLED,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,14,85,86,14 + LTEXT "Proxy &Type",IDC_STATIC,13,63,77,8 + LISTBOX IDC_PROXYTYPE,110,62,86,31,LBS_SORT | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LTEXT "&Proxy Port",IDC_STATIC,14,47,80,9 + EDITTEXT IDC_PROXYPORT,109,47,86,12,ES_AUTOHSCROLL | ES_NUMBER +END + +IDD_PROPPAGE_MAIN DIALOG DISCARDABLE 0, 0, 210, 101 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Main" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "Current Status:",IDC_STATIC,13,16,66,9 + LTEXT "Static",IDC_STATIC,92,16,80,12 + PUSHBUTTON "&Start",IDC_STARTSERVICE,13,28,40,11 + PUSHBUTTON "&Stop",IDC_STOPSERVICE,65,29,46,11 + CONTROL "&Verbose",IDC_VERBOSE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,15,43,84,12 + EDITTEXT IDC_PING_INTERVAL,93,62,47,12,ES_AUTOHSCROLL + LTEXT "Ping Interval:",IDC_STATIC,13,62,60,10 +END + + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "The Bitlbee Team\0" + VALUE "FileDescription", "BitlBee for Windows\0" + VALUE "FileVersion", "1, 0, 0, 1\0" + VALUE "InternalName", "bitlbee\0" + VALUE "LegalCopyright", "Copyright (C) 2002-2005\0" + VALUE "OriginalFilename", "bitlbeeadm.exe\0" + VALUE "ProductName", "Bitlbee Application\0" + VALUE "ProductVersion", "1, 0, 0, 1\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_PROPPAGE_ACCESS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 203 + TOPMARGIN, 7 + BOTTOMMARGIN, 147 + END + + IDD_PROPPAGE_PATHS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 203 + TOPMARGIN, 7 + BOTTOMMARGIN, 147 + END + + IDD_PROPPAGE_ABOUT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 277 + TOPMARGIN, 7 + BOTTOMMARGIN, 149 + END + + IDD_PROPPAGE_CONNECTION, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 203 + TOPMARGIN, 7 + BOTTOMMARGIN, 147 + END + + IDD_PROPPAGE_MAIN, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 203 + TOPMARGIN, 6 + BOTTOMMARGIN, 94 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_BEE_SMALL BITMAP DISCARDABLE "res\\bmp00002.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ABOUTBOX "&About bitlbee..." +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE 9, 1 +#pragma code_page(1252) +#endif +#include "afxres.rc" // Standard components +#endif +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/win32/admin/bitlbeewin.cpp b/win32/admin/bitlbeewin.cpp new file mode 100644 index 00000000..56e61c3f --- /dev/null +++ b/win32/admin/bitlbeewin.cpp @@ -0,0 +1,47 @@ +// bitlbee.cpp : Defines the class behaviors for the application. +// + +#include "maindlg.h" +#include "bitlbeewin.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CBitlbeeApp + +BEGIN_MESSAGE_MAP(CBitlbeeApp, CWinApp) + //{{AFX_MSG_MAP(CBitlbeeApp) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + + +///////////////////////////////////////////////////////////////////////////// +// The one and only CBitlbeeApp object + +CBitlbeeApp theApp; + +///////////////////////////////////////////////////////////////////////////// +// CBitlbeeApp initialization + +BOOL CBitlbeeApp::InitInstance() +{ + + // Standard initialization + // If you are not using these features and wish to reduce the size + // of your final executable, you should remove from the following + // the specific initialization routines you do not need. + +#ifdef _AFXDLL + Enable3dControls(); // Call this when using MFC in a shared DLL +#else + Enable3dControlsStatic(); // Call this when linking to MFC statically +#endif + + new CMainDlg(); + + return TRUE; +} diff --git a/win32/admin/bitlbeewin.h b/win32/admin/bitlbeewin.h new file mode 100644 index 00000000..73860252 --- /dev/null +++ b/win32/admin/bitlbeewin.h @@ -0,0 +1,49 @@ +// bitlbee.h : main header file for the BITLBEE application +// + +#if !defined(AFX_BITLBEE_H__E76A1E72_2177_4477_A796_76D6AB817F80__INCLUDED_) +#define AFX_BITLBEE_H__E76A1E72_2177_4477_A796_76D6AB817F80__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +#include +#include +#include +#include "resource.h" // main symbols + +///////////////////////////////////////////////////////////////////////////// +// CBitlbeeApp: +// See bitlbee.cpp for the implementation of this class +// + +class CBitlbeeApp : public CWinApp +{ +public: + CBitlbeeApp() {} + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CBitlbeeApp) + public: + virtual BOOL InitInstance(); + virtual int ExitInstance(); + //}}AFX_VIRTUAL + +// Implementation + + //{{AFX_MSG(CBitlbeeApp) + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + protected: + CPropertySheet *dlg; +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_BITLBEE_H__E76A1E72_2177_4477_A796_76D6AB817F80__INCLUDED_) + diff --git a/win32/admin/res/bmp00002.bmp b/win32/admin/res/bmp00002.bmp new file mode 100644 index 00000000..77205cb1 Binary files /dev/null and b/win32/admin/res/bmp00002.bmp differ diff --git a/win32/admin/res/icon2.ico b/win32/admin/res/icon2.ico new file mode 100644 index 00000000..5dfe084f Binary files /dev/null and b/win32/admin/res/icon2.ico differ diff --git a/win32/admin/resource.h b/win32/admin/resource.h new file mode 100644 index 00000000..8c8fe503 --- /dev/null +++ b/win32/admin/resource.h @@ -0,0 +1,65 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by bitlbee.rc +// +#define IDM_ABOUTBOX 0x0010 +#define IDD_ABOUTBOX 100 +#define IDS_ABOUTBOX 101 +#define IDC_OK 101 +#define IDD_BITLBEE_DIALOG 102 +#define IDP_SOCKETS_INIT_FAILED 103 +#define IDD_PROPPAGE_ACCESS 106 +#define IDD_PROPPAGE_USERS 107 +#define IDD_PROPPAGE_PATHS 108 +#define IDR_MAINFRAME 128 +#define IDI_BEE 130 +#define IDD_PHONY 131 +#define IDR_POPUP 132 +#define IDD_PROPPAGE_ABOUT 132 +#define IDD_PROPPAGE_LOG 133 +#define IDB_BEE_SMALL 135 +#define IDD_PROPPAGE_CONNECTION 137 +#define IDI_ICON1 138 +#define IDD_PROPPAGE_MAIN 138 +#define IDC_AUTH_OPEN 1001 +#define IDC_AUTH_CLOSED 1002 +#define IDC_AUTH_REGISTERED 1003 +#define IDC_BROWSE_CONFIG 1004 +#define IDC_CONFIGDIR 1005 +#define IDC_BROWSE_MOTD 1006 +#define IDC_KNOWN_USERS 1007 +#define IDC_MOTDFILE 1007 +#define IDC_EDIT_MOTD 1008 +#define IDC_DEL_KNOWN_USERS 1008 +#define IDC_CURRENT_USERS 1009 +#define IDC_KICK 1010 +#define IDC_INTERFACE 1011 +#define IDC_PORT 1012 +#define IDC_PASSWORD 1013 +#define IDC_REFRESH_KNOWN_USERS 1015 +#define IDC_REFRESH_CURRENT_USERS 1016 +#define IDC_LOG 1017 +#define IDC_PROXYHOST 1018 +#define IDC_PROXYUSER 1019 +#define IDC_PROXYPASS 1020 +#define IDC_PROXY_ENABLED 1021 +#define IDC_PROXY_AUTH_ENABLED 1022 +#define IDC_PROXYPORT 1023 +#define IDC_PROXYTYPE 1024 +#define IDC_STARTSERVICE 1025 +#define IDC_STOPSERVICE 1026 +#define IDC_VERBOSE 1027 +#define IDC_PING_INTERVAL 1028 +#define IDM_SHOW 32771 +#define IDM_EXIT 32773 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 139 +#define _APS_NEXT_COMMAND_VALUE 32774 +#define _APS_NEXT_CONTROL_VALUE 1029 +#define _APS_NEXT_SYMED_VALUE 102 +#endif +#endif diff --git a/win32/bitlbee.dsp b/win32/bitlbee.dsp index 3f26fca0..f08f64a9 100644 --- a/win32/bitlbee.dsp +++ b/win32/bitlbee.dsp @@ -53,8 +53,8 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib iconv.lib glib-2.0.lib gmodule-2.0.lib wsock32.lib advapi32.lib /nologo /subsystem:windows /machine:I386 /libpath:"release" /libpath:"deps\lib" -# SUBTRACT LINK32 /incremental:yes /nodefaultlib +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib iconv.lib glib-2.0.lib gmodule-2.0.lib wsock32.lib advapi32.lib /nologo /machine:I386 /libpath:"release" /libpath:"deps\lib" +# SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "bitlbee - Win32 Debug" @@ -70,7 +70,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /Gd /MDd /Ze /W3 /Gm /GX /Zi /Od /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /FR /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /FR /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 @@ -81,7 +81,8 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 iconv.lib glib-2.0.lib gmodule-2.0.lib wsock32.lib kernel32.lib user32.lib advapi32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"debug" /libpath:"deps\lib" +# ADD LINK32 iconv.lib glib-2.0.lib gmodule-2.0.lib wsock32.lib kernel32.lib user32.lib advapi32.lib /nologo /debug /machine:I386 /pdbtype:sept /libpath:"debug" /libpath:"deps\lib" +# SUBTRACT LINK32 /pdb:none !ENDIF @@ -102,17 +103,6 @@ SOURCE=..\bitlbee.c # End Source File # Begin Source File -SOURCE=.\bitlbee.rc - -!IF "$(CFG)" == "bitlbee - Win32 Release" - -!ELSEIF "$(CFG)" == "bitlbee - Win32 Debug" - -!ENDIF - -# End Source File -# Begin Source File - SOURCE=..\commands.c # End Source File # Begin Source File @@ -253,29 +243,5 @@ SOURCE=..\sock.h SOURCE=..\user.h # End Source File # End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\res\bitlbee.rc2 -# End Source File -# Begin Source File - -SOURCE=.\res\bmp00002.bmp -# End Source File -# Begin Source File - -SOURCE=.\res\icon1.ico -# End Source File -# Begin Source File - -SOURCE=.\res\icon2.ico -# End Source File -# End Group -# Begin Source File - -SOURCE=.\README.TXT -# End Source File # End Target # End Project diff --git a/win32/bitlbee.rc b/win32/bitlbee.rc deleted file mode 100644 index 0762fbbd..00000000 --- a/win32/bitlbee.rc +++ /dev/null @@ -1,354 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" - "#define _AFX_NO_PROPERTY_RESOURCES\r\n" - "\r\n" - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "#ifdef _WIN32\r\n" - "LANGUAGE 9, 1\r\n" - "#pragma code_page(1252)\r\n" - "#endif\r\n" - "#include ""afxres.rc"" // Standard components\r\n" - "#endif\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_BEE ICON DISCARDABLE "res\\icon2.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_PROPPAGE_ACCESS DIALOG DISCARDABLE 0, 0, 210, 154 -STYLE WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Access" -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX "Authentication Mode",IDC_STATIC,7,7,196,47 - CONTROL "&Open",IDC_AUTH_OPEN,"Button",BS_AUTORADIOBUTTON | - WS_GROUP,14,15,181,13 - CONTROL "&Closed",IDC_AUTH_CLOSED,"Button",BS_AUTORADIOBUTTON | - WS_GROUP,14,27,160,11 - CONTROL "&Registered",IDC_AUTH_REGISTERED,"Button", - BS_AUTORADIOBUTTON | WS_GROUP,14,39,182,11 - GROUPBOX "Bind",IDC_STATIC,7,55,196,46 - LTEXT "IP to bind to:",IDC_STATIC,15,67,49,9 - LTEXT "Port:",IDC_STATIC,15,82,52,10 - EDITTEXT IDC_INTERFACE,86,67,108,11,ES_AUTOHSCROLL - EDITTEXT IDC_PORT,86,82,108,11,ES_AUTOHSCROLL - GROUPBOX "Password",IDC_STATIC,7,104,196,43 - EDITTEXT IDC_PASSWORD,14,129,115,11,ES_AUTOHSCROLL - LTEXT "Only used when authentication mode is set to closed.", - IDC_STATIC,13,113,184,11 -END - -IDD_PROPPAGE_USERS DIALOG DISCARDABLE 0, 0, 210, 154 -STYLE WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Users" -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX "Known users",IDC_STATIC,7,7,196,68 - GROUPBOX "Current users",IDC_STATIC,7,79,196,68 - LISTBOX IDC_KNOWN_USERS,13,17,114,52,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "&Remove",IDC_DEL_KNOWN_USERS,133,17,32,14,WS_DISABLED - LISTBOX IDC_CURRENT_USERS,13,89,115,52,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "&Kick",IDC_KICK,135,89,19,14,WS_DISABLED - PUSHBUTTON "&Refresh",IDC_REFRESH_KNOWN_USERS,133,38,30,14 - PUSHBUTTON "&Refresh",IDC_REFRESH_CURRENT_USERS,135,110,30,14 -END - -IDD_PROPPAGE_PATHS DIALOG DISCARDABLE 0, 0, 210, 154 -STYLE WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Paths" -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX "Config path",IDC_STATIC,7,7,196,30 - PUSHBUTTON "&Browse...",IDC_BROWSE_CONFIG,151,16,46,13 - EDITTEXT IDC_CONFIGDIR,13,17,122,13,ES_AUTOHSCROLL - GROUPBOX "Message of the day file",IDC_STATIC,7,42,196,40 - PUSHBUTTON "&Browse...",IDC_BROWSE_MOTD,153,51,43,13 - EDITTEXT IDC_MOTDFILE,13,51,122,13,ES_AUTOHSCROLL - PUSHBUTTON "&Edit...",IDC_EDIT_MOTD,153,66,43,13 -END - -IDD_PHONY DIALOG DISCARDABLE 0, 0, 9, 9 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Dialog" -FONT 8, "MS Sans Serif" -BEGIN -END - -IDD_PROPPAGE_ABOUT DIALOG DISCARDABLE 0, 0, 284, 156 -STYLE WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "About" -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX "Authors",IDC_STATIC,7,7,270,79 - LTEXT "Bitlbee is written by : \n Wilmer van der Gaast \n Maurits Dijkstra \n Jelmer Vernooij ", - IDC_STATIC,13,16,180,35 - LTEXT "Windows port by Jelmer Vernooij ", - IDC_STATIC,13,55,180,12 - CONTROL 135,IDC_STATIC,"Static",SS_BITMAP | SS_SUNKEN,193,14,73, - 64 - GROUPBOX "More information",IDC_STATIC,7,88,270,61 - LTEXT "See the file CREDITS for a list of contributors.", - IDC_STATIC,16,69,171,11 - LTEXT "The Bitlbee homepage is located at http://www.bitlbee.org/\n\nFor Bitlbee support, go to #bitlbee on irc.oftc.net", - IDC_STATIC,17,100,248,39 -END - -IDD_PROPPAGE_LOG DIALOG DISCARDABLE 0, 0, 210, 154 -STYLE WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Logs" -FONT 8, "MS Sans Serif" -BEGIN - LISTBOX IDC_LOG,7,7,196,140,LBS_SORT | LBS_NOINTEGRALHEIGHT | - WS_VSCROLL | WS_TABSTOP -END - -IDD_PROPPAGE_CONNECTION DIALOG DISCARDABLE 0, 0, 210, 154 -STYLE WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Connection" -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX "Proxy",IDC_STATIC,7,23,196,124 - EDITTEXT IDC_PROXYHOST,110,33,86,12,ES_AUTOHSCROLL - CONTROL "&Use Proxy",IDC_PROXY_ENABLED,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,7,7,196,14 - LTEXT "Proxy &Host",IDC_STATIC,13,33,82,12 - EDITTEXT IDC_PROXYUSER,110,105,86,12,ES_AUTOHSCROLL - LTEXT "Proxy &User",IDC_STATIC,13,105,82,12 - EDITTEXT IDC_PROXYPASS,110,122,86,12,ES_PASSWORD | ES_AUTOHSCROLL - LTEXT "Proxy &Password",IDC_STATIC,13,123,82,12 - CONTROL "&Authenticate to proxy",IDC_PROXY_AUTH_ENABLED,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,14,85,86,14 - LTEXT "Proxy &Type",IDC_STATIC,13,63,77,8 - LISTBOX IDC_PROXYTYPE,110,62,86,31,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - LTEXT "&Proxy Port",IDC_STATIC,14,47,80,9 - EDITTEXT IDC_PROXYPORT,109,47,86,12,ES_AUTOHSCROLL | ES_NUMBER -END - - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", "The Bitlbee Team\0" - VALUE "FileDescription", "BitlBee for Windows\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "bitlbee\0" - VALUE "LegalCopyright", "Copyright (C) 2002-2004\0" - VALUE "OriginalFilename", "bitlbee.exe\0" - VALUE "ProductName", "Bitlbee Application\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_PROPPAGE_ACCESS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 203 - TOPMARGIN, 7 - BOTTOMMARGIN, 147 - END - - IDD_PROPPAGE_USERS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 203 - TOPMARGIN, 7 - BOTTOMMARGIN, 147 - END - - IDD_PROPPAGE_PATHS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 203 - TOPMARGIN, 7 - BOTTOMMARGIN, 147 - END - - IDD_PHONY, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 2 - TOPMARGIN, 7 - BOTTOMMARGIN, 2 - END - - IDD_PROPPAGE_ABOUT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 277 - TOPMARGIN, 7 - BOTTOMMARGIN, 149 - END - - IDD_PROPPAGE_LOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 203 - TOPMARGIN, 7 - BOTTOMMARGIN, 147 - END - - IDD_PROPPAGE_CONNECTION, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 203 - TOPMARGIN, 7 - BOTTOMMARGIN, 147 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_POPUP MENU DISCARDABLE -BEGIN - POPUP "tray" - BEGIN - MENUITEM "&Show", IDM_SHOW - MENUITEM SEPARATOR - MENUITEM "&Exit", IDM_EXIT - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_BEE_SMALL BITMAP DISCARDABLE "res\\bmp00002.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ABOUTBOX "&About bitlbee..." - IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed." -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#define _AFX_NO_SPLITTER_RESOURCES -#define _AFX_NO_OLE_RESOURCES -#define _AFX_NO_TRACKER_RESOURCES -#define _AFX_NO_PROPERTY_RESOURCES - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE 9, 1 -#pragma code_page(1252) -#endif -#include "afxres.rc" // Standard components -#endif -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/win32/bitlbeewin.cpp b/win32/bitlbeewin.cpp deleted file mode 100644 index e18ae3cd..00000000 --- a/win32/bitlbeewin.cpp +++ /dev/null @@ -1,210 +0,0 @@ -// bitlbee.cpp : Defines the class behaviors for the application. -// - -#define BITLBEE_CORE -#include "bitlbeewin.h" -#include "traynot.h" -#include "maindlg.h" -#include -extern "C" { -#include "config.h" -#include "bitlbee.h" -#include -#include -int -inet_aton(const char *cp, struct in_addr *addr) -{ - addr->s_addr = inet_addr(cp); - return (addr->s_addr == INADDR_NONE) ? 0 : 1; -} - -void glib_logger (const gchar *log_domain, GLogLevelFlags log_level, const gchar *msg, gpointer user_data); - -} - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CBitlbeeApp - -BEGIN_MESSAGE_MAP(CBitlbeeApp, CWinApp) - //{{AFX_MSG_MAP(CBitlbeeApp) - ON_COMMAND(IDM_EXIT, OnExit) - ON_COMMAND(IDM_SHOW, OnShow) - //}}AFX_MSG_MAP - ON_COMMAND(ID_HELP, CWinApp::OnHelp) -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CBitlbeeApp construction - -CBitlbeeApp::CBitlbeeApp() -{ - // TODO: add construction code here, - // Place all significant initialization in InitInstance -} - -///////////////////////////////////////////////////////////////////////////// -// The one and only CBitlbeeApp object - -CBitlbeeApp theApp; - -///////////////////////////////////////////////////////////////////////////// -// CBitlbeeApp initialization - -static UINT bb_loop(LPVOID data) -{ - g_main_run(global.loop); - return 0; -} - - -gboolean bitlbee_new_client(GIOChannel *src, GIOCondition cond, gpointer data); -global_t global; // Against global namespace pollution - -BOOL CBitlbeeApp::InitInstance() -{ - if (!AfxSocketInit()) - { - AfxMessageBox(IDP_SOCKETS_INIT_FAILED); - return FALSE; - } - - // Standard initialization - // If you are not using these features and wish to reduce the size - // of your final executable, you should remove from the following - // the specific initialization routines you do not need. - -#ifdef _AFXDLL - Enable3dControls(); // Call this when using MFC in a shared DLL -#else - Enable3dControlsStatic(); // Call this when linking to MFC statically -#endif - - HKEY key; - unsigned char databuf[256]; - DWORD len; - RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Bitlbee", &key); - - memset( &global, 0, sizeof( global_t ) ); - g_log_set_handler("GLib", static_cast(G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION), glib_logger, NULL); - global.loop = g_main_new(FALSE); - nogaim_init(); - - SetRegistryKey("Bitlbee"); - conf_t *conf = (conf_t *)g_new0( conf_t, 1 ); - global.conf = conf; - global.conf->iface = g_strdup(GetProfileString("main", "interface", "0.0.0.0")); - global.conf->port = GetProfileInt("main", "port", 6667); - global.conf->verbose = GetProfileInt("main", "verbose", 0); - global.conf->password = g_strdup(GetProfileString("main", "password", "")); - global.conf->ping_interval = GetProfileInt("main", "ping_interval_timeout", 60); - global.conf->hostname = g_strdup(GetProfileString("main", "hostname", "localhost")); - if(RegQueryValueEx(key, "configdir", NULL, NULL, databuf, &len) != ERROR_SUCCESS) strcpy((char *)databuf, ""); - global.conf->configdir = g_strdup(GetProfileString("main", "configdir", (char *)databuf)); - if(RegQueryValueEx(key, "motdfile", NULL, NULL, databuf, &len) != ERROR_SUCCESS) strcpy((char *)databuf, ""); - global.conf->motdfile = g_strdup(GetProfileString("main", "motdfile", (char *)databuf)); - if(RegQueryValueEx(key, "helpfile", NULL, NULL, databuf, &len) != ERROR_SUCCESS) strcpy((char *)databuf, ""); - global.helpfile = g_strdup(GetProfileString("main", "helpfile", (char *)databuf)); - global.conf->runmode = RUNMODE_DAEMON; - global.conf->authmode = (enum authmode) GetProfileInt("main", "AuthMode", AUTHMODE_CLOSED); - strcpy(proxyhost, GetProfileString("proxy", "host", "")); - strcpy(proxyuser, GetProfileString("proxy", "user", "")); - strcpy(proxypass, GetProfileString("proxy", "password", "")); - proxytype = GetProfileInt("proxy", "type", PROXY_NONE); - proxyport = GetProfileInt("proxy", "port", 3128); - - dlg = new CMainDlg(); - not = new CTrayNot(dlg); - dlg->ShowWindow(SW_HIDE); - m_pMainWnd = not; - - if(help_init(&(global.help)) == NULL) { - log_message(LOGLVL_WARNING, "Unable to initialize help"); - } - - if(bitlbee_daemon_init() != 0) { - return FALSE; - } - - AfxBeginThread(bb_loop, NULL); - - - return TRUE; -} - -void log_error(char *a) { - ::MessageBox(NULL, a, "Bitlbee error", MB_OK | MB_ICONEXCLAMATION); -} - -/* Dummy function. log output always goes to screen anyway */ -void log_link(int level, int out) {} - -void conf_loaddefaults(irc_t *irc) {} -double gettime() { - return CTime::GetCurrentTime().GetTime(); -} - -void load_protocol(char *name, char *init_function_name, struct prpl *p) { - void (*init_function) (struct prpl *); - - char *path = g_module_build_path(NULL, name); - if(!path) { - log_message(LOGLVL_WARNING, "Can't build path for %s\n", name); - return; - } - - GModule *mod = g_module_open(path, G_MODULE_BIND_LAZY); - if(!mod) { - log_message(LOGLVL_INFO, "Can't find %s, not loading", name); - return; - } - - if(!g_module_symbol(mod,init_function_name,(void **) &init_function)) { - log_message(LOGLVL_WARNING, "Can't find function %s in %s\n", init_function_name, path); - return; - } - g_free(path); - - init_function(p); -} - -void jabber_init(struct prpl *p) { load_protocol("jabber", "jabber_init", p); } -void msn_init(struct prpl *p) { load_protocol("msn", "msn_init", p); } -void byahoo_init(struct prpl *p) { load_protocol("yahoo", "byahoo_init", p); } -void oscar_init(struct prpl *p) { load_protocol("oscar", "oscar_init", p); } - -void CBitlbeeApp::OnExit() -{ - AfxGetApp()->ExitInstance(); - exit(0); -} - -void CBitlbeeApp::OnShow() -{ - dlg->ShowWindow(SW_SHOW); -} - -int CBitlbeeApp::ExitInstance() -{ - WriteProfileString("main", "interface", global.conf->iface); - WriteProfileInt("main", "port", global.conf->port); - WriteProfileInt("main", "verbose", global.conf->verbose); - WriteProfileString("main", "password", global.conf->password); - WriteProfileString("main", "configdir", global.conf->configdir); - WriteProfileString("main", "hostname", global.conf->hostname); - WriteProfileString("main", "motdfile", global.conf->motdfile); - WriteProfileInt("main", "authmode", global.conf->authmode); - WriteProfileInt("proxy", "type", proxytype); - WriteProfileString("proxy", "host", proxyhost); - WriteProfileString("proxy", "user", proxyuser); - WriteProfileString("proxy", "password", proxypass); - WriteProfileInt("proxy", "port", proxyport); - WriteProfileInt("main", "ping_interval_timeout", global.conf->ping_interval); - delete not; - return CWinApp::ExitInstance(); -} diff --git a/win32/bitlbeewin.h b/win32/bitlbeewin.h deleted file mode 100644 index 1a0d0361..00000000 --- a/win32/bitlbeewin.h +++ /dev/null @@ -1,59 +0,0 @@ -// bitlbee.h : main header file for the BITLBEE application -// - -#if !defined(AFX_BITLBEE_H__E76A1E72_2177_4477_A796_76D6AB817F80__INCLUDED_) -#define AFX_BITLBEE_H__E76A1E72_2177_4477_A796_76D6AB817F80__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include -#include -#include -#include "resource.h" // main symbols - -class CTrayNot; -extern "C" { -#define BITLBEE_CORE -#include "bitlbee.h" -} - -///////////////////////////////////////////////////////////////////////////// -// CBitlbeeApp: -// See bitlbee.cpp for the implementation of this class -// - -class CBitlbeeApp : public CWinApp -{ -public: - CBitlbeeApp(); - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CBitlbeeApp) - public: - virtual BOOL InitInstance(); - virtual int ExitInstance(); - //}}AFX_VIRTUAL - -// Implementation - - //{{AFX_MSG(CBitlbeeApp) - afx_msg void OnExit(); - afx_msg void OnShow(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - protected: - CTrayNot *not; - CPropertySheet *dlg; - GIOChannel *listen; -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_BITLBEE_H__E76A1E72_2177_4477_A796_76D6AB817F80__INCLUDED_) - diff --git a/win32/res/bmp00002.bmp b/win32/res/bmp00002.bmp deleted file mode 100644 index 77205cb1..00000000 Binary files a/win32/res/bmp00002.bmp and /dev/null differ diff --git a/win32/res/icon2.ico b/win32/res/icon2.ico deleted file mode 100644 index 5dfe084f..00000000 Binary files a/win32/res/icon2.ico and /dev/null differ diff --git a/win32/resource.h b/win32/resource.h deleted file mode 100644 index f655c545..00000000 --- a/win32/resource.h +++ /dev/null @@ -1,60 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by bitlbee.rc -// -#define IDM_ABOUTBOX 0x0010 -#define IDD_ABOUTBOX 100 -#define IDS_ABOUTBOX 101 -#define IDC_OK 101 -#define IDD_BITLBEE_DIALOG 102 -#define IDP_SOCKETS_INIT_FAILED 103 -#define IDD_PROPPAGE_ACCESS 106 -#define IDD_PROPPAGE_USERS 107 -#define IDD_PROPPAGE_PATHS 108 -#define IDR_MAINFRAME 128 -#define IDI_BEE 130 -#define IDD_PHONY 131 -#define IDR_POPUP 132 -#define IDD_PROPPAGE_ABOUT 132 -#define IDD_PROPPAGE_LOG 133 -#define IDB_BEE_SMALL 135 -#define IDD_PROPPAGE_CONNECTION 137 -#define IDI_ICON1 138 -#define IDC_AUTH_OPEN 1001 -#define IDC_AUTH_CLOSED 1002 -#define IDC_AUTH_REGISTERED 1003 -#define IDC_BROWSE_CONFIG 1004 -#define IDC_CONFIGDIR 1005 -#define IDC_BROWSE_MOTD 1006 -#define IDC_KNOWN_USERS 1007 -#define IDC_MOTDFILE 1007 -#define IDC_EDIT_MOTD 1008 -#define IDC_DEL_KNOWN_USERS 1008 -#define IDC_CURRENT_USERS 1009 -#define IDC_KICK 1010 -#define IDC_INTERFACE 1011 -#define IDC_PORT 1012 -#define IDC_PASSWORD 1013 -#define IDC_REFRESH_KNOWN_USERS 1015 -#define IDC_REFRESH_CURRENT_USERS 1016 -#define IDC_LOG 1017 -#define IDC_PROXYHOST 1018 -#define IDC_PROXYUSER 1019 -#define IDC_PROXYPASS 1020 -#define IDC_PROXY_ENABLED 1021 -#define IDC_PROXY_AUTH_ENABLED 1022 -#define IDC_PROXYPORT 1023 -#define IDC_PROXYTYPE 1024 -#define IDM_SHOW 32771 -#define IDM_EXIT 32773 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 139 -#define _APS_NEXT_COMMAND_VALUE 32774 -#define _APS_NEXT_CONTROL_VALUE 1025 -#define _APS_NEXT_SYMED_VALUE 102 -#endif -#endif -- cgit v1.2.3 From cf136714caa13e2cd4bf8a69a29c08f3a1518f59 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 28 Nov 2005 02:07:56 +0100 Subject: Remove admin tool (now in a seperate branch) --- win32/admin/MainDlg.cpp | 71 ---------- win32/admin/MainDlg.h | 54 -------- win32/admin/PropAccess.cpp | 114 ---------------- win32/admin/PropAccess.h | 59 --------- win32/admin/PropConn.cpp | 123 ------------------ win32/admin/PropConn.h | 59 --------- win32/admin/PropLog.cpp | 78 ----------- win32/admin/PropLog.h | 47 ------- win32/admin/PropMain.cpp | 99 -------------- win32/admin/PropMain.h | 58 --------- win32/admin/PropPaths.cpp | 115 ---------------- win32/admin/PropPaths.h | 57 -------- win32/admin/admin.dsp | 175 ------------------------- win32/admin/bitlbee.rc | 303 ------------------------------------------- win32/admin/bitlbeewin.cpp | 47 ------- win32/admin/bitlbeewin.h | 49 ------- win32/admin/res/bmp00002.bmp | Bin 5830 -> 0 bytes win32/admin/res/icon2.ico | Bin 3774 -> 0 bytes win32/admin/resource.h | 65 ---------- 19 files changed, 1573 deletions(-) delete mode 100644 win32/admin/MainDlg.cpp delete mode 100644 win32/admin/MainDlg.h delete mode 100644 win32/admin/PropAccess.cpp delete mode 100644 win32/admin/PropAccess.h delete mode 100644 win32/admin/PropConn.cpp delete mode 100644 win32/admin/PropConn.h delete mode 100644 win32/admin/PropLog.cpp delete mode 100644 win32/admin/PropLog.h delete mode 100644 win32/admin/PropMain.cpp delete mode 100644 win32/admin/PropMain.h delete mode 100644 win32/admin/PropPaths.cpp delete mode 100644 win32/admin/PropPaths.h delete mode 100644 win32/admin/admin.dsp delete mode 100644 win32/admin/bitlbee.rc delete mode 100644 win32/admin/bitlbeewin.cpp delete mode 100644 win32/admin/bitlbeewin.h delete mode 100644 win32/admin/res/bmp00002.bmp delete mode 100644 win32/admin/res/icon2.ico delete mode 100644 win32/admin/resource.h diff --git a/win32/admin/MainDlg.cpp b/win32/admin/MainDlg.cpp deleted file mode 100644 index e9ecda34..00000000 --- a/win32/admin/MainDlg.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// MainDlg.cpp : implementation file -// - -#include "PropPaths.h" -#include "PropAccess.h" -#include "PropConn.h" -#include "MainDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CMainDlg - -IMPLEMENT_DYNAMIC(CMainDlg, CPropertySheet) - -CMainDlg::CMainDlg() : CPropertySheet("Bitlbee for Windows") -{ - AddPage(new CPropPaths()); - AddPage(new CPropAccess()); - AddPage(new CPropertyPage(IDD_PROPPAGE_ABOUT)); - AddPage(new CPropConn()); - Create(); - ShowWindow(SW_HIDE); -} - -CMainDlg::~CMainDlg() -{ -} - - -BEGIN_MESSAGE_MAP(CMainDlg, CPropertySheet) - //{{AFX_MSG_MAP(CMainDlg) - ON_WM_CLOSE() - //}}AFX_MSG_MAP - ON_BN_CLICKED(IDOK, OnOK) -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CMainDlg message handlers - -BOOL CMainDlg::OnInitDialog() -{ - m_bModeless = FALSE; - m_nFlags |= WF_CONTINUEMODAL; - - CPropertySheet::OnInitDialog(); - GetDlgItem(IDHELP)->ShowWindow(SW_HIDE); - GetDlgItem(IDCANCEL)->ShowWindow(SW_HIDE); - - m_bModeless = TRUE; - m_nFlags &= WF_CONTINUEMODAL; - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CMainDlg::OnOK() -{ - PressButton(PSBTN_APPLYNOW); - ShowWindow(SW_HIDE); -} - - -void CMainDlg::OnClose() -{ - ShowWindow(SW_HIDE); -} diff --git a/win32/admin/MainDlg.h b/win32/admin/MainDlg.h deleted file mode 100644 index be5547fd..00000000 --- a/win32/admin/MainDlg.h +++ /dev/null @@ -1,54 +0,0 @@ -#if !defined(AFX_MAINDLG_H__D88FFF4C_047D_4562_A041_CCDCFA52F87C__INCLUDED_) -#define AFX_MAINDLG_H__D88FFF4C_047D_4562_A041_CCDCFA52F87C__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// MainDlg.h : header file -// - -#include - -///////////////////////////////////////////////////////////////////////////// -// CMainDlg - -class CMainDlg : public CPropertySheet -{ - DECLARE_DYNAMIC(CMainDlg) - -// Construction -public: - CMainDlg(); - -// Attributes -public: - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CMainDlg) - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CMainDlg(); - - // Generated message map functions -protected: - //{{AFX_MSG(CMainDlg) - virtual BOOL OnInitDialog(); - afx_msg void OnClose(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -private: - void OnOK(); -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_MAINDLG_H__D88FFF4C_047D_4562_A041_CCDCFA52F87C__INCLUDED_) diff --git a/win32/admin/PropAccess.cpp b/win32/admin/PropAccess.cpp deleted file mode 100644 index a09ce454..00000000 --- a/win32/admin/PropAccess.cpp +++ /dev/null @@ -1,114 +0,0 @@ -// PropAccess.cpp : implementation file -// - -#include "PropAccess.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CPropAccess dialog - - -CPropAccess::CPropAccess() - : CPropertyPage(CPropAccess::IDD) -{ - - //{{AFX_DATA_INIT(CPropAccess) - //}}AFX_DATA_INIT -} - - -void CPropAccess::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CPropAccess) - DDX_Control(pDX, IDC_AUTH_REGISTERED, m_auth_registered); - DDX_Control(pDX, IDC_AUTH_OPEN, m_auth_open); - DDX_Control(pDX, IDC_AUTH_CLOSED, m_auth_closed); - DDX_Control(pDX, IDC_PASSWORD, m_password); - DDX_Control(pDX, IDC_PORT, m_port); - DDX_Control(pDX, IDC_INTERFACE, m_interface); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CPropAccess, CPropertyPage) - //{{AFX_MSG_MAP(CPropAccess) - ON_BN_CLICKED(IDC_AUTH_REGISTERED, OnAuthRegistered) - ON_BN_CLICKED(IDC_AUTH_OPEN, OnAuthOpen) - ON_BN_CLICKED(IDC_AUTH_CLOSED, OnAuthClosed) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CPropAccess message handlers - -void CPropAccess::OnOK() -{ - CString iface; m_interface.GetWindowText(iface); - WriteProfileString("interface", iface); - - CString port; m_port.GetWindowText(port); - WriteProfileInt("port", port); - - CString password; m_password.GetWindowText(password); - WriteProfileString("password", password); - - if(m_auth_closed.GetCheck() == 1) WriteProfileInt("auth_mode", 1); - if(m_auth_open.GetCheck() == 1) WriteProfileInt("auth_mode", 0); - if(m_auth_registered.GetCheck() == 1) WriteProfileInt("auth_mode", 2); - - CPropertyPage::OnOK(); -} - -void CPropAccess::OnAuthRegistered() -{ - m_password.EnableWindow(FALSE); - m_auth_open.SetCheck(0); - m_auth_registered.SetCheck(1); - m_auth_closed.SetCheck(0); - -} - -void CPropAccess::OnAuthOpen() -{ - m_password.EnableWindow(FALSE); - m_auth_open.SetCheck(1); - m_auth_registered.SetCheck(0); - m_auth_closed.SetCheck(0); -} - -void CPropAccess::OnAuthClosed() -{ - m_password.EnableWindow(TRUE); - m_auth_open.SetCheck(0); - m_auth_registered.SetCheck(0); - m_auth_closed.SetCheck(1); - -} - -BOOL CPropAccess::OnInitDialog() -{ - CPropertyPage::OnInitDialog(); - - HKEY key; - RegOpenKey(HKEY_LOCAL_MACHINE, BITLBEE_KEY, &key); - - m_interface.SetWindowText(GetProfileString("interface", "0.0.0.0")); - m_password.SetWindowText(GetProfileString("password", "")); - char tmp[20]; - sprintf(tmp, "%d", GetProfileInt("port", 6667)); - m_port.SetWindowText(tmp); - - switch(GetProfileInt("auth_mode", 1)) { - case 0: OnAuthOpen();break; - case 1: OnAuthClosed();break; - case 2: OnAuthRegistered();break; - } - - return TRUE; -} diff --git a/win32/admin/PropAccess.h b/win32/admin/PropAccess.h deleted file mode 100644 index cae0241c..00000000 --- a/win32/admin/PropAccess.h +++ /dev/null @@ -1,59 +0,0 @@ -#if !defined(AFX_PROPACCESS_H__0AC45777_B43C_4467_91FF_391DFD582057__INCLUDED_) -#define AFX_PROPACCESS_H__0AC45777_B43C_4467_91FF_391DFD582057__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// PropAccess.h : header file -// - -#include -#include "Resource.h" - -///////////////////////////////////////////////////////////////////////////// -// CPropAccess dialog - -class CPropAccess : public CPropertyPage -{ -// Construction -public: - CPropAccess(); // standard constructor - -// Dialog Data - //{{AFX_DATA(CPropAccess) - enum { IDD = IDD_PROPPAGE_ACCESS }; - CButton m_auth_registered; - CButton m_auth_open; - CButton m_auth_closed; - CEdit m_password; - CEdit m_port; - CEdit m_interface; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CPropAccess) - public: - virtual void OnOK(); - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CPropAccess) - afx_msg void OnAuthRegistered(); - afx_msg void OnAuthOpen(); - afx_msg void OnAuthClosed(); - virtual BOOL OnInitDialog(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_PROPACCESS_H__0AC45777_B43C_4467_91FF_391DFD582057__INCLUDED_) diff --git a/win32/admin/PropConn.cpp b/win32/admin/PropConn.cpp deleted file mode 100644 index b16be0f1..00000000 --- a/win32/admin/PropConn.cpp +++ /dev/null @@ -1,123 +0,0 @@ -// PropConn.cpp : implementation file -// - -#include "PropConn.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CPropConn dialog - - -CPropConn::CPropConn(CWnd* pParent /*=NULL*/) - : CPropertyPage(CPropConn::IDD) -{ - //{{AFX_DATA_INIT(CPropConn) - //}}AFX_DATA_INIT -} - - -void CPropConn::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CPropConn) - DDX_Control(pDX, IDC_PROXYPORT, m_proxyport); - DDX_Control(pDX, IDC_PROXYTYPE, m_proxytype); - DDX_Control(pDX, IDC_PROXY_ENABLED, m_proxy_enabled); - DDX_Control(pDX, IDC_PROXY_AUTH_ENABLED, m_proxy_auth_enabled); - DDX_Control(pDX, IDC_PROXYPASS, m_proxypass); - DDX_Control(pDX, IDC_PROXYHOST, m_proxyhost); - DDX_Control(pDX, IDC_PROXYUSER, m_proxyuser); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CPropConn, CPropertyPage) - //{{AFX_MSG_MAP(CPropConn) - ON_BN_CLICKED(IDC_PROXY_AUTH_ENABLED, OnProxyAuthEnabled) - ON_BN_CLICKED(IDC_PROXY_ENABLED, OnProxyEnabled) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CPropConn message handlers - -void CPropConn::OnProxyAuthEnabled() -{ - m_proxyuser.EnableWindow(m_proxy_enabled.GetCheck() && m_proxy_auth_enabled.GetCheck()); - m_proxypass.EnableWindow(m_proxy_enabled.GetCheck() && m_proxy_auth_enabled.GetCheck()); -} - -void CPropConn::OnProxyEnabled() -{ - m_proxyhost.EnableWindow(m_proxy_enabled.GetCheck()); - m_proxytype.EnableWindow(m_proxy_enabled.GetCheck()); - m_proxyport.EnableWindow(m_proxy_enabled.GetCheck()); - m_proxy_auth_enabled.EnableWindow(m_proxy_enabled.GetCheck()); - - if(m_proxy_enabled.GetCheck() && (m_proxytype.GetCurSel() < 0 || m_proxytype.GetCurSel() > 2)) - { - m_proxytype.SetCurSel(0); - } - - OnProxyAuthEnabled(); -} - -void CPropConn::OnOK() -{ - CString tmp; - m_proxyhost.GetWindowText(tmp); - WriteProfileString("proxy_host", tmp); - - m_proxyport.GetWindowText(tmp); - WriteProfileInt("proxy_port", atoi(tmp)); - - if(!m_proxy_enabled.GetCheck()) { - WriteProfileInt("proxy_type", 0); - } else { - WriteProfileInt("proxy_type", m_proxytype.GetCurSel()+1); - } - - if(!m_proxy_auth_enabled.GetCheck()) { - WriteProfileString("proxy_user", ""); - WriteProfileString("proxy_password", ""); - } else { - m_proxyuser.GetWindowText(tmp); - WriteProfileString("proxy_user", tmp); - m_proxypass.GetWindowText(tmp); - WriteProfileString("proxy_password", tmp); - } - - CPropertyPage::OnOK(); -} - -BOOL CPropConn::OnInitDialog() -{ - char pp[20]; - CPropertyPage::OnInitDialog(); - int proxytype; - - m_proxyhost.SetWindowText(GetProfileString("proxy_host", "")); - m_proxyuser.SetWindowText(GetProfileString("proxy_user", "")); - m_proxypass.SetWindowText(GetProfileString("proxy_password", "")); - sprintf(pp, "%d", GetProfileInt("proxy_port", 3128)); - m_proxyport.SetWindowText(pp); - - proxytype = GetProfileInt("proxy_type", 0); - - m_proxytype.AddString("SOCKS 4"); - m_proxytype.AddString("SOCKS 5"); - m_proxytype.AddString("HTTP"); - m_proxytype.SetCurSel(proxytype-1); - - m_proxy_enabled.SetCheck(proxytype == 0?0:1); - m_proxy_auth_enabled.SetCheck(strcmp(GetProfileString("proxy_user", ""), "")?1:0); - - OnProxyEnabled(); - - return TRUE; -} \ No newline at end of file diff --git a/win32/admin/PropConn.h b/win32/admin/PropConn.h deleted file mode 100644 index e920da3d..00000000 --- a/win32/admin/PropConn.h +++ /dev/null @@ -1,59 +0,0 @@ -#if !defined(AFX_PROPCONN_H__8969671F_8D9F_45E9_929F_B36CFEFCBAA2__INCLUDED_) -#define AFX_PROPCONN_H__8969671F_8D9F_45E9_929F_B36CFEFCBAA2__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// PropConn.h : header file -// - -#include -#include "Resource.h" - -///////////////////////////////////////////////////////////////////////////// -// CPropConn dialog - -class CPropConn : public CPropertyPage -{ -// Construction -public: - CPropConn(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CPropConn) - enum { IDD = IDD_PROPPAGE_CONNECTION }; - CEdit m_proxyport; - CListBox m_proxytype; - CButton m_proxy_enabled; - CButton m_proxy_auth_enabled; - CEdit m_proxypass; - CEdit m_proxyhost; - CEdit m_proxyuser; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CPropConn) - public: - virtual void OnOK(); - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CPropConn) - afx_msg void OnProxyAuthEnabled(); - afx_msg void OnProxyEnabled(); - virtual BOOL OnInitDialog(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_PROPCONN_H__8969671F_8D9F_45E9_929F_B36CFEFCBAA2__INCLUDED_) diff --git a/win32/admin/PropLog.cpp b/win32/admin/PropLog.cpp deleted file mode 100644 index 8b1641d9..00000000 --- a/win32/admin/PropLog.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// PropLog.cpp : implementation file -// - -#include "PropLog.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CPropLog dialog - - -CPropLog::CPropLog() - : CPropertyPage(CPropLog::IDD) -{ - //{{AFX_DATA_INIT(CPropLog) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT -} - - -void CPropLog::DoDataExchange(CDataExchange* pDX) -{ - CPropertyPage::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CPropLog) - DDX_Control(pDX, IDC_LOG, m_log); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CPropLog, CPropertyPage) - //{{AFX_MSG_MAP(CPropLog) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CPropLog message handlers - -static GList *log = NULL; - -extern "C" { -void glib_logger (const gchar *log_domain, GLogLevelFlags log_level, const gchar *msg, gpointer user_data) -{ - log = g_list_append(log, g_strdup_printf("%s: %s", log_domain, msg)); -} -} - -void log_message(int level, char *message, ... ) { -#define LOG_MAXLEN 300 - va_list ap; - va_start(ap, message); - char *msg = (char *)g_malloc(LOG_MAXLEN); - g_vsnprintf(msg, LOG_MAXLEN, message, ap); - va_end(ap); - log = g_list_append(log, msg); - if(level == LOGLVL_ERROR) ::MessageBox(NULL, msg, "Bitlbee", MB_OK | MB_ICONINFORMATION); - TRACE("%d: %s\n", level, msg); -} - - -BOOL CPropLog::OnInitDialog() -{ - CPropertyPage::OnInitDialog(); - - m_log.ResetContent(); - GList *gl = log; - while(gl) { - char *d = (char *)gl->data; - m_log.AddString(d); - gl = gl->next; - } - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} diff --git a/win32/admin/PropLog.h b/win32/admin/PropLog.h deleted file mode 100644 index 1a847b19..00000000 --- a/win32/admin/PropLog.h +++ /dev/null @@ -1,47 +0,0 @@ -#if !defined(AFX_PROPLOG_H__F56909E1_BBCC_4163_B9C2_E8D5685A34AA__INCLUDED_) -#define AFX_PROPLOG_H__F56909E1_BBCC_4163_B9C2_E8D5685A34AA__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// PropLog.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CPropLog dialog - -class CPropLog : public CPropertyPage -{ -// Construction -public: - CPropLog(); // standard constructor - -// Dialog Data - //{{AFX_DATA(CPropLog) - enum { IDD = IDD_PROPPAGE_LOG }; - CListBox m_log; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CPropLog) - public: - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CPropLog) - virtual BOOL OnInitDialog(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_PROPLOG_H__F56909E1_BBCC_4163_B9C2_E8D5685A34AA__INCLUDED_) diff --git a/win32/admin/PropMain.cpp b/win32/admin/PropMain.cpp deleted file mode 100644 index f15af691..00000000 --- a/win32/admin/PropMain.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// PropMain.cpp : implementation file -// - -#include -#include "PropMain.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CPropMain property page - -IMPLEMENT_DYNCREATE(CPropMain, CPropertyPage) - -CPropMain::CPropMain() : CPropertyPage(CPropMain::IDD) -{ - //{{AFX_DATA_INIT(CPropMain) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT -} - -CPropMain::~CPropMain() -{ -} - -void CPropMain::DoDataExchange(CDataExchange* pDX) -{ - CPropertyPage::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CPropMain) - DDX_Control(pDX, IDC_STOPSERVICE, m_stopservice); - DDX_Control(pDX, IDC_STARTSERVICE, m_startservice); - DDX_Control(pDX, IDC_PING_INTERVAL, m_ping_interval); - DDX_Control(pDX, IDC_VERBOSE, m_Verbose); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CPropMain, CPropertyPage) - //{{AFX_MSG_MAP(CPropMain) - ON_BN_CLICKED(IDC_STARTSERVICE, OnStartService) - ON_BN_CLICKED(IDC_STOPSERVICE, OnStopService) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CPropMain message handlers - -BOOL CPropMain::OnInitDialog() -{ - CPropertyPage::OnInitDialog(); - - global.conf->verbose = GetProfileInt("verbose", 0); - global.conf->ping_interval = GetProfileInt("ping_interval_timeout", 0); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CPropMain::OnOK() -{ - CPropertyPage::OnOK(); - - WriteProfileInt("verbose", global.conf->verbose); - - WriteProfileInt("ping_interval_timeout", global.conf->ping_interval); -} - -void CPropMain::OnStartService() -{ - SC_HANDLE schService; - SC_HANDLE schSCManager; - SERVICE_STATUS status; - - schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS ); - schService = OpenService(schSCManager, "bitlbee", SERVICE_ALL_ACCESS); - - ControlService( schService, SERVICE_CONTROL_CONTINUE, &status ); - - CloseServiceHandle(schService); - CloseServiceHandle(schSCManager); -} - -void CPropMain::OnStopService() -{ - SC_HANDLE schService; - SC_HANDLE schSCManager; - SERVICE_STATUS status; - - schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS ); - schService = OpenService(schSCManager, "bitlbee", SERVICE_ALL_ACCESS); - - ControlService( schService, SERVICE_CONTROL_PAUSE, &status ); - - CloseServiceHandle(schService); - CloseServiceHandle(schSCManager); -} diff --git a/win32/admin/PropMain.h b/win32/admin/PropMain.h deleted file mode 100644 index 832457b2..00000000 --- a/win32/admin/PropMain.h +++ /dev/null @@ -1,58 +0,0 @@ -#if !defined(AFX_PROPMAIN_H__F3EF57A7_15AA_4F36_B6C1_2EAD91127449__INCLUDED_) -#define AFX_PROPMAIN_H__F3EF57A7_15AA_4F36_B6C1_2EAD91127449__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// PropMain.h : header file - -#include "Resource.h" -// - -///////////////////////////////////////////////////////////////////////////// -// CPropMain dialog - -class CPropMain : public CPropertyPage -{ - DECLARE_DYNCREATE(CPropMain) - -// Construction -public: - CPropMain(); - ~CPropMain(); - -// Dialog Data - //{{AFX_DATA(CPropMain) - enum { IDD = IDD_PROPPAGE_MAIN }; - CButton m_stopservice; - CButton m_startservice; - CEdit m_ping_interval; - CButton m_Verbose; - //}}AFX_DATA - - -// Overrides - // ClassWizard generate virtual function overrides - //{{AFX_VIRTUAL(CPropMain) - public: - virtual void OnOK(); - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - // Generated message map functions - //{{AFX_MSG(CPropMain) - virtual BOOL OnInitDialog(); - afx_msg void OnStartService(); - afx_msg void OnStopService(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_PROPMAIN_H__F3EF57A7_15AA_4F36_B6C1_2EAD91127449__INCLUDED_) diff --git a/win32/admin/PropPaths.cpp b/win32/admin/PropPaths.cpp deleted file mode 100644 index 4fb49497..00000000 --- a/win32/admin/PropPaths.cpp +++ /dev/null @@ -1,115 +0,0 @@ -// PropPaths.cpp : implementation file -// - -#include "PropPaths.h" -#include "shlobj.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CPropPaths dialog - - -CPropPaths::CPropPaths() - : CPropertyPage(CPropPaths::IDD) -{ - //{{AFX_DATA_INIT(CPropPaths) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT -} - - -void CPropPaths::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CPropPaths) - DDX_Control(pDX, IDC_MOTDFILE, m_motdfile); - DDX_Control(pDX, IDC_EDIT_MOTD, m_edit_motd); - DDX_Control(pDX, IDC_CONFIGDIR, m_configdir); - DDX_Control(pDX, IDC_BROWSE_MOTD, m_browse_motd); - DDX_Control(pDX, IDC_BROWSE_CONFIG, m_browse_config); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CPropPaths, CPropertyPage) - //{{AFX_MSG_MAP(CPropPaths) - ON_BN_CLICKED(IDC_BROWSE_CONFIG, OnBrowseConfig) - ON_BN_CLICKED(IDC_BROWSE_MOTD, OnBrowseMotd) - ON_BN_CLICKED(IDC_EDIT_MOTD, OnEditMotd) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CPropPaths message handlers - -void CPropPaths::OnOK() -{ - CString tmp; - m_configdir.GetWindowText(tmp); - - if (tmp.GetLength() > 0 - && tmp.GetAt(tmp.GetLength() - 1) != '/' - && tmp.GetAt(tmp.GetLength() - 1) != '\\') - { - tmp = tmp + "\\"; - } - - WriteProfileString("configdir", tmp); - - m_motdfile.GetWindowText(tmp); - WriteProfileString("motdfile", tmp); - - CPropertyPage::OnOK(); -} - -void CPropPaths::OnBrowseConfig() -{ - BROWSEINFO bi = { 0 }; - bi.lpszTitle = _T("Choose a config directory"); - LPITEMIDLIST pidl = SHBrowseForFolder(&bi); - if( pidl != 0) - { - TCHAR path[MAX_PATH]; - if( SHGetPathFromIDList (pidl, path) ) { - m_configdir.SetWindowText(path); - } - - IMalloc * imalloc = 0; - if ( SUCCEEDED (SHGetMalloc (&imalloc)) ) - { - imalloc->Free(pidl); - imalloc->Release(); - } - } -} - -void CPropPaths::OnBrowseMotd() -{ - CFileDialog f(TRUE); - - if(f.DoModal() == IDOK) { - m_motdfile.SetWindowText(f.GetPathName()); - } - -} - -void CPropPaths::OnEditMotd() -{ - CString loc;m_motdfile.GetWindowText(loc); - ShellExecute(this->GetSafeHwnd(), NULL, loc, NULL, NULL, SW_SHOWNORMAL); -} - -BOOL CPropPaths::OnInitDialog() -{ - CPropertyPage::OnInitDialog(); - - m_configdir.SetWindowText(GetProfileString("configdir", "")); - m_motdfile.SetWindowText(GetProfileString("motdfile", "")); - - return TRUE; -} diff --git a/win32/admin/PropPaths.h b/win32/admin/PropPaths.h deleted file mode 100644 index 733e674c..00000000 --- a/win32/admin/PropPaths.h +++ /dev/null @@ -1,57 +0,0 @@ -#if !defined(AFX_PROPPATHS_H__693C8F02_C150_45DD_99F1_F824795E98C9__INCLUDED_) -#define AFX_PROPPATHS_H__693C8F02_C150_45DD_99F1_F824795E98C9__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// PropPaths.h : header file -// -#include -#include "Resource.h" - -///////////////////////////////////////////////////////////////////////////// -// CPropPaths dialog - -class CPropPaths : public CPropertyPage -{ -// Construction -public: - CPropPaths(); // standard constructor - -// Dialog Data - //{{AFX_DATA(CPropPaths) - enum { IDD = IDD_PROPPAGE_PATHS }; - CEdit m_motdfile; - CButton m_edit_motd; - CEdit m_configdir; - CButton m_browse_motd; - CButton m_browse_config; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CPropPaths) - public: - virtual void OnOK(); - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CPropPaths) - afx_msg void OnBrowseConfig(); - afx_msg void OnBrowseMotd(); - afx_msg void OnEditMotd(); - virtual BOOL OnInitDialog(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_PROPPATHS_H__693C8F02_C150_45DD_99F1_F824795E98C9__INCLUDED_) diff --git a/win32/admin/admin.dsp b/win32/admin/admin.dsp deleted file mode 100644 index 6d24af0d..00000000 --- a/win32/admin/admin.dsp +++ /dev/null @@ -1,175 +0,0 @@ -# Microsoft Developer Studio Project File - Name="admin" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=admin - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "admin.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "admin.mak" CFG="admin - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "admin - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "admin - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "admin - Win32 Release" - -# PROP BASE Use_MFC 6 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 6 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" -# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 -# ADD LINK32 /nologo /subsystem:windows /machine:I386 /out:"Release/bitlbeeadm.exe" - -!ELSEIF "$(CFG)" == "admin - Win32 Debug" - -# PROP BASE Use_MFC 6 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 6 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" -# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /out:"Debug/bitlbeeadm.exe" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "admin - Win32 Release" -# Name "admin - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\bitlbeewin.cpp -# End Source File -# Begin Source File - -SOURCE=.\MainDlg.cpp -# End Source File -# Begin Source File - -SOURCE=.\PropAccess.cpp -# End Source File -# Begin Source File - -SOURCE=.\PropConn.cpp -# End Source File -# Begin Source File - -SOURCE=.\PropMain.cpp -# End Source File -# Begin Source File - -SOURCE=.\PropPaths.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\bitlbeewin.h -# End Source File -# Begin Source File - -SOURCE=.\MainDlg.h -# End Source File -# Begin Source File - -SOURCE=.\PropAccess.h -# End Source File -# Begin Source File - -SOURCE=.\PropConn.h -# End Source File -# Begin Source File - -SOURCE=.\PropMain.h -# End Source File -# Begin Source File - -SOURCE=.\PropPaths.h -# End Source File -# Begin Source File - -SOURCE=.\Resource.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\bitlbee.rc - -!IF "$(CFG)" == "admin - Win32 Release" - -!ELSEIF "$(CFG)" == "admin - Win32 Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\res\bmp00002.bmp -# End Source File -# Begin Source File - -SOURCE=.\res\icon2.ico -# End Source File -# End Group -# End Target -# End Project diff --git a/win32/admin/bitlbee.rc b/win32/admin/bitlbee.rc deleted file mode 100644 index 5e9b5407..00000000 --- a/win32/admin/bitlbee.rc +++ /dev/null @@ -1,303 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" - "#define _AFX_NO_PROPERTY_RESOURCES\r\n" - "\r\n" - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "#ifdef _WIN32\r\n" - "LANGUAGE 9, 1\r\n" - "#pragma code_page(1252)\r\n" - "#endif\r\n" - "#include ""afxres.rc"" // Standard components\r\n" - "#endif\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_BEE ICON DISCARDABLE "res\\icon2.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_PROPPAGE_ACCESS DIALOG DISCARDABLE 0, 0, 210, 154 -STYLE WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Access" -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX "Authentication Mode",IDC_STATIC,7,7,196,47 - CONTROL "&Open",IDC_AUTH_OPEN,"Button",BS_AUTORADIOBUTTON | - WS_GROUP,14,15,181,13 - CONTROL "&Closed",IDC_AUTH_CLOSED,"Button",BS_AUTORADIOBUTTON | - WS_GROUP,14,27,160,11 - CONTROL "&Registered",IDC_AUTH_REGISTERED,"Button", - BS_AUTORADIOBUTTON | WS_GROUP,14,39,182,11 - GROUPBOX "Bind",IDC_STATIC,7,55,196,46 - LTEXT "IP to bind to:",IDC_STATIC,15,67,49,9 - LTEXT "Port:",IDC_STATIC,15,82,52,10 - EDITTEXT IDC_INTERFACE,86,67,108,11,ES_AUTOHSCROLL - EDITTEXT IDC_PORT,86,82,108,11,ES_AUTOHSCROLL - GROUPBOX "Password",IDC_STATIC,7,104,196,43 - EDITTEXT IDC_PASSWORD,14,129,115,11,ES_AUTOHSCROLL - LTEXT "Only used when authentication mode is set to closed.", - IDC_STATIC,13,113,184,11 -END - -IDD_PROPPAGE_PATHS DIALOG DISCARDABLE 0, 0, 210, 154 -STYLE WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Paths" -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX "Config path",IDC_STATIC,7,7,196,30 - PUSHBUTTON "&Browse...",IDC_BROWSE_CONFIG,151,16,46,13 - EDITTEXT IDC_CONFIGDIR,13,17,122,13,ES_AUTOHSCROLL - GROUPBOX "Message of the day file",IDC_STATIC,7,42,196,40 - PUSHBUTTON "&Browse...",IDC_BROWSE_MOTD,153,51,43,13 - EDITTEXT IDC_MOTDFILE,13,51,122,13,ES_AUTOHSCROLL - PUSHBUTTON "&Edit...",IDC_EDIT_MOTD,153,66,43,13 -END - -IDD_PROPPAGE_ABOUT DIALOG DISCARDABLE 0, 0, 284, 156 -STYLE WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "About" -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX "Authors",IDC_STATIC,7,7,270,79 - LTEXT "Bitlbee is written by : \n Wilmer van der Gaast \n Maurits Dijkstra \n Jelmer Vernooij ", - IDC_STATIC,13,16,180,35 - LTEXT "Windows port by Jelmer Vernooij ", - IDC_STATIC,13,55,180,12 - CONTROL 135,IDC_STATIC,"Static",SS_BITMAP | SS_SUNKEN,193,14,73, - 64 - GROUPBOX "More information",IDC_STATIC,7,88,270,61 - LTEXT "See the file CREDITS for a list of contributors.", - IDC_STATIC,16,69,171,11 - LTEXT "The Bitlbee homepage is located at http://www.bitlbee.org/\n\nFor Bitlbee support, go to #bitlbee on irc.oftc.net", - IDC_STATIC,17,100,248,39 -END - -IDD_PROPPAGE_CONNECTION DIALOG DISCARDABLE 0, 0, 210, 154 -STYLE WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Connection" -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX "Proxy",IDC_STATIC,7,23,196,124 - EDITTEXT IDC_PROXYHOST,110,33,86,12,ES_AUTOHSCROLL - CONTROL "&Use Proxy",IDC_PROXY_ENABLED,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,7,7,196,14 - LTEXT "Proxy &Host",IDC_STATIC,13,33,82,12 - EDITTEXT IDC_PROXYUSER,110,105,86,12,ES_AUTOHSCROLL - LTEXT "Proxy &User",IDC_STATIC,13,105,82,12 - EDITTEXT IDC_PROXYPASS,110,122,86,12,ES_PASSWORD | ES_AUTOHSCROLL - LTEXT "Proxy &Password",IDC_STATIC,13,123,82,12 - CONTROL "&Authenticate to proxy",IDC_PROXY_AUTH_ENABLED,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,14,85,86,14 - LTEXT "Proxy &Type",IDC_STATIC,13,63,77,8 - LISTBOX IDC_PROXYTYPE,110,62,86,31,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - LTEXT "&Proxy Port",IDC_STATIC,14,47,80,9 - EDITTEXT IDC_PROXYPORT,109,47,86,12,ES_AUTOHSCROLL | ES_NUMBER -END - -IDD_PROPPAGE_MAIN DIALOG DISCARDABLE 0, 0, 210, 101 -STYLE WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Main" -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "Current Status:",IDC_STATIC,13,16,66,9 - LTEXT "Static",IDC_STATIC,92,16,80,12 - PUSHBUTTON "&Start",IDC_STARTSERVICE,13,28,40,11 - PUSHBUTTON "&Stop",IDC_STOPSERVICE,65,29,46,11 - CONTROL "&Verbose",IDC_VERBOSE,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,15,43,84,12 - EDITTEXT IDC_PING_INTERVAL,93,62,47,12,ES_AUTOHSCROLL - LTEXT "Ping Interval:",IDC_STATIC,13,62,60,10 -END - - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", "The Bitlbee Team\0" - VALUE "FileDescription", "BitlBee for Windows\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "bitlbee\0" - VALUE "LegalCopyright", "Copyright (C) 2002-2005\0" - VALUE "OriginalFilename", "bitlbeeadm.exe\0" - VALUE "ProductName", "Bitlbee Application\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_PROPPAGE_ACCESS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 203 - TOPMARGIN, 7 - BOTTOMMARGIN, 147 - END - - IDD_PROPPAGE_PATHS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 203 - TOPMARGIN, 7 - BOTTOMMARGIN, 147 - END - - IDD_PROPPAGE_ABOUT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 277 - TOPMARGIN, 7 - BOTTOMMARGIN, 149 - END - - IDD_PROPPAGE_CONNECTION, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 203 - TOPMARGIN, 7 - BOTTOMMARGIN, 147 - END - - IDD_PROPPAGE_MAIN, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 203 - TOPMARGIN, 6 - BOTTOMMARGIN, 94 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_BEE_SMALL BITMAP DISCARDABLE "res\\bmp00002.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ABOUTBOX "&About bitlbee..." -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#define _AFX_NO_SPLITTER_RESOURCES -#define _AFX_NO_OLE_RESOURCES -#define _AFX_NO_TRACKER_RESOURCES -#define _AFX_NO_PROPERTY_RESOURCES - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE 9, 1 -#pragma code_page(1252) -#endif -#include "afxres.rc" // Standard components -#endif -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/win32/admin/bitlbeewin.cpp b/win32/admin/bitlbeewin.cpp deleted file mode 100644 index 56e61c3f..00000000 --- a/win32/admin/bitlbeewin.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// bitlbee.cpp : Defines the class behaviors for the application. -// - -#include "maindlg.h" -#include "bitlbeewin.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CBitlbeeApp - -BEGIN_MESSAGE_MAP(CBitlbeeApp, CWinApp) - //{{AFX_MSG_MAP(CBitlbeeApp) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - - -///////////////////////////////////////////////////////////////////////////// -// The one and only CBitlbeeApp object - -CBitlbeeApp theApp; - -///////////////////////////////////////////////////////////////////////////// -// CBitlbeeApp initialization - -BOOL CBitlbeeApp::InitInstance() -{ - - // Standard initialization - // If you are not using these features and wish to reduce the size - // of your final executable, you should remove from the following - // the specific initialization routines you do not need. - -#ifdef _AFXDLL - Enable3dControls(); // Call this when using MFC in a shared DLL -#else - Enable3dControlsStatic(); // Call this when linking to MFC statically -#endif - - new CMainDlg(); - - return TRUE; -} diff --git a/win32/admin/bitlbeewin.h b/win32/admin/bitlbeewin.h deleted file mode 100644 index 73860252..00000000 --- a/win32/admin/bitlbeewin.h +++ /dev/null @@ -1,49 +0,0 @@ -// bitlbee.h : main header file for the BITLBEE application -// - -#if !defined(AFX_BITLBEE_H__E76A1E72_2177_4477_A796_76D6AB817F80__INCLUDED_) -#define AFX_BITLBEE_H__E76A1E72_2177_4477_A796_76D6AB817F80__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include -#include -#include -#include "resource.h" // main symbols - -///////////////////////////////////////////////////////////////////////////// -// CBitlbeeApp: -// See bitlbee.cpp for the implementation of this class -// - -class CBitlbeeApp : public CWinApp -{ -public: - CBitlbeeApp() {} - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CBitlbeeApp) - public: - virtual BOOL InitInstance(); - virtual int ExitInstance(); - //}}AFX_VIRTUAL - -// Implementation - - //{{AFX_MSG(CBitlbeeApp) - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - protected: - CPropertySheet *dlg; -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_BITLBEE_H__E76A1E72_2177_4477_A796_76D6AB817F80__INCLUDED_) - diff --git a/win32/admin/res/bmp00002.bmp b/win32/admin/res/bmp00002.bmp deleted file mode 100644 index 77205cb1..00000000 Binary files a/win32/admin/res/bmp00002.bmp and /dev/null differ diff --git a/win32/admin/res/icon2.ico b/win32/admin/res/icon2.ico deleted file mode 100644 index 5dfe084f..00000000 Binary files a/win32/admin/res/icon2.ico and /dev/null differ diff --git a/win32/admin/resource.h b/win32/admin/resource.h deleted file mode 100644 index 8c8fe503..00000000 --- a/win32/admin/resource.h +++ /dev/null @@ -1,65 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by bitlbee.rc -// -#define IDM_ABOUTBOX 0x0010 -#define IDD_ABOUTBOX 100 -#define IDS_ABOUTBOX 101 -#define IDC_OK 101 -#define IDD_BITLBEE_DIALOG 102 -#define IDP_SOCKETS_INIT_FAILED 103 -#define IDD_PROPPAGE_ACCESS 106 -#define IDD_PROPPAGE_USERS 107 -#define IDD_PROPPAGE_PATHS 108 -#define IDR_MAINFRAME 128 -#define IDI_BEE 130 -#define IDD_PHONY 131 -#define IDR_POPUP 132 -#define IDD_PROPPAGE_ABOUT 132 -#define IDD_PROPPAGE_LOG 133 -#define IDB_BEE_SMALL 135 -#define IDD_PROPPAGE_CONNECTION 137 -#define IDI_ICON1 138 -#define IDD_PROPPAGE_MAIN 138 -#define IDC_AUTH_OPEN 1001 -#define IDC_AUTH_CLOSED 1002 -#define IDC_AUTH_REGISTERED 1003 -#define IDC_BROWSE_CONFIG 1004 -#define IDC_CONFIGDIR 1005 -#define IDC_BROWSE_MOTD 1006 -#define IDC_KNOWN_USERS 1007 -#define IDC_MOTDFILE 1007 -#define IDC_EDIT_MOTD 1008 -#define IDC_DEL_KNOWN_USERS 1008 -#define IDC_CURRENT_USERS 1009 -#define IDC_KICK 1010 -#define IDC_INTERFACE 1011 -#define IDC_PORT 1012 -#define IDC_PASSWORD 1013 -#define IDC_REFRESH_KNOWN_USERS 1015 -#define IDC_REFRESH_CURRENT_USERS 1016 -#define IDC_LOG 1017 -#define IDC_PROXYHOST 1018 -#define IDC_PROXYUSER 1019 -#define IDC_PROXYPASS 1020 -#define IDC_PROXY_ENABLED 1021 -#define IDC_PROXY_AUTH_ENABLED 1022 -#define IDC_PROXYPORT 1023 -#define IDC_PROXYTYPE 1024 -#define IDC_STARTSERVICE 1025 -#define IDC_STOPSERVICE 1026 -#define IDC_VERBOSE 1027 -#define IDC_PING_INTERVAL 1028 -#define IDM_SHOW 32771 -#define IDM_EXIT 32773 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 139 -#define _APS_NEXT_COMMAND_VALUE 32774 -#define _APS_NEXT_CONTROL_VALUE 1029 -#define _APS_NEXT_SYMED_VALUE 102 -#endif -#endif -- cgit v1.2.3 From 2983f5e8c2d3046bf01337e5caefa3af55ba6bff Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 29 Nov 2005 00:32:50 +0100 Subject: Switch to using a Makefile rather then VC project files. --- doc/BUILD.win32 | 27 ++++-- win32.mk | 136 +++++++++++++++++++++++++++ win32/bitlbee.dsp | 247 -------------------------------------------------- win32/bitlbee.dsw | 119 ------------------------ win32/bitlbee_ssl.dsp | 99 -------------------- win32/jabber.dsp | 228 ---------------------------------------------- win32/msn.dsp | 116 ------------------------ win32/oscar.dsp | 204 ----------------------------------------- win32/yahoo.dsp | 152 ------------------------------- 9 files changed, 154 insertions(+), 1174 deletions(-) create mode 100644 win32.mk delete mode 100644 win32/bitlbee.dsp delete mode 100644 win32/bitlbee.dsw delete mode 100644 win32/bitlbee_ssl.dsp delete mode 100644 win32/jabber.dsp delete mode 100644 win32/msn.dsp delete mode 100644 win32/oscar.dsp delete mode 100644 win32/yahoo.dsp diff --git a/doc/BUILD.win32 b/doc/BUILD.win32 index 03e1b8d9..e21e1aaf 100644 --- a/doc/BUILD.win32 +++ b/doc/BUILD.win32 @@ -1,23 +1,32 @@ -Instructions for building the Bitlbee Win32 port +Instructions for building BitlBee on Windows ================================================ 1. Download the latest version using bzr (http://www.bazaar-ng.org/): - bzr branch http://jelmer.vernstok.nl/oss/bitlbee/bzr/win32 bitlbee-win32 + + H:\> bzr branch http://win32.bitlbee.org/bzr bitlbee-win32 + ... + 2. Download and install the required development files: from ftp://ftp.gtk.org/pub/gtk/v2.8/win32/ - glib - glib-dev - - libiconv - - gettext + - libiconv (in dependencies/) + - gettext (in dependencies/) from http://ftp.mozilla.org/pub/mozilla.org/ - - nss - - nspr + - nss (in security/nss/) + - nspr (in nspr/) + +3. Set the following variables in Makefile.settings, if you don't have the + libraries above installed in the default directories searched by MSVC: -I've put them inside c:\dev, so you might have the most with that location. + - GLIB_DIR + - NSS_DIR + - NSPR_DIR -3. Open bitlbee.dsw in VC++ and build :-) +4. Build: -4. Now you're done. When running, make sure all the required DLL's are accessible. If they can't be found, place them inside c:\winnt\system32 or the Debug or Release directories inside bitlbee-...\win32\. + H:\BitlBee> nmake /f win32.mk + ... 5. To build setup files, compile the bitlbee.iss file using the Inno Setup program (available from www.jrsoftware.org). diff --git a/win32.mk b/win32.mk new file mode 100644 index 00000000..59ca7a81 --- /dev/null +++ b/win32.mk @@ -0,0 +1,136 @@ +!INCLUDE Makefile.settings + +GLIB_CFLAGS = /I "$(GLIB_DIR)\include" \ + /I "$(GLIB_DIR)\include\glib-2.0" \ + /I "$(GLIB_DIR)\lib\glib-2.0\include" + +GLIB_LFLAGS = /libpath:"$(GLIB_DIR)\lib" + +NSS_CFLAGS = /I "$(NSS_DIR)\include" /I "$(NSPR_DIR)\include" +NSS_LFLAGS = /libpath:"$(NSS_DIR)\lib" /libpath:"$(NSPR_DIR)\lib" +NSS_LIBS = nss3.lib ssl3.lib libnspr4.lib + +COMMON_LIBS = kernel32.lib user32.lib advapi32.lib shell32.lib iconv.lib \ + glib-2.0.lib gmodule-2.0.lib wsock32.lib advapi32.lib + + +MAIN_OBJS = account.obj bitlbee.obj commands.obj crypting.obj \ + help.obj irc.obj protocols\md5.obj protocols\nogaim.obj \ + protocols\sha.obj protocols\proxy.obj query.obj nick.obj set.obj \ + user.obj protocols\util.obj win32.obj + +MAIN_LIBS = $(COMMON_LIBS) + +SSL_OBJS = protocols\ssl_nss.obj +SSL_LIBS = $(NSS_LFLAGS) $(NSS_LIBS) + +MSN_OBJS = \ + protocols\msn\msn.obj \ + protocols\msn\msn_util.obj \ + protocols\msn\ns.obj \ + protocols\msn\passport.obj \ + protocols\msn\sb.obj \ + protocols\msn\tables.obj \ + $(SSL_OBJS) + +MSN_LIBS = $(COMMON_LIBS) $(SSL_LIBS) + +OSCAR_OBJS = \ + protocols\oscar\admin.obj \ + protocols\oscar\auth.obj \ + protocols\oscar\bos.obj \ + protocols\oscar\buddylist.obj \ + protocols\oscar\chat.obj \ + protocols\oscar\chatnav.obj \ + protocols\oscar\conn.obj \ + protocols\oscar\icq.obj \ + protocols\oscar\im.obj \ + protocols\oscar\info.obj \ + protocols\oscar\misc.obj \ + protocols\oscar\msgcookie.obj \ + protocols\oscar\oscar.obj \ + protocols\oscar\oscar_util.obj \ + protocols\oscar\rxhandlers.obj \ + protocols\oscar\rxqueue.obj \ + protocols\oscar\search.obj \ + protocols\oscar\service.obj \ + protocols\oscar\snac.obj \ + protocols\oscar\ssi.obj \ + protocols\oscar\stats.obj \ + protocols\oscar\tlv.obj \ + protocols\oscar\txqueue.obj + +OSCAR_LIBS = $(COMMON_LIBS) + +JABBER_OBJS = \ + protocols\jabber\expat.obj \ + protocols\jabber\genhash.obj \ + protocols\jabber\hashtable.obj \ + protocols\jabber\jabber.obj \ + protocols\jabber\jconn.obj \ + protocols\jabber\jid.obj \ + protocols\jabber\jpacket.obj \ + protocols\jabber\jutil.obj \ + protocols\jabber\karma.obj \ + protocols\jabber\log.obj \ + protocols\jabber\pool.obj \ + protocols\jabber\pproxy.obj \ + protocols\jabber\rate.obj \ + protocols\jabber\str.obj \ + protocols\jabber\xhash.obj \ + protocols\jabber\xmlnode.obj \ + protocols\jabber\xmlparse.obj \ + protocols\jabber\xmlrole.obj \ + protocols\jabber\xmltok.obj \ + protocols\jabber\xstream.obj \ + $(SSL_OBJS) + +JABBER_LIBS = $(COMMON_LIBS) $(SSL_LIBS) + +YAHOO_OBJS = \ + protocols\yahoo\crypt.obj \ + protocols\yahoo\libyahoo2.obj \ + protocols\yahoo\vc50.idb \ + protocols\yahoo\yahoo.obj \ + protocols\yahoo\yahoo_fn.obj \ + protocols\yahoo\yahoo_httplib.obj \ + protocols\yahoo\yahoo_list.obj \ + protocols\yahoo\yahoo_util.obj + +YAHOO_LIBS = $(COMMON_LIBS) + +CC=cl.exe +CFLAGS=$(GLIB_CFLAGS) $(NSS_CFLAGS) /D NDEBUG /D WIN32 /D _WINDOWS \ + /I . /I protocols /I protocols\oscar /nologo \ + /D GLIB2 /D ARCH="\"Windows\"" /D CPU="\"x86\"" \ + /D PLUGINDIR="plugins" + +.c.obj: + $(CC) $(CFLAGS) /c /Fo$@ $< + +ALL: bitlbee.exe libmsn.dll liboscar.dll libjabber.dll libyahoo.dll + +LINK32=link.exe +LINK32_FLAGS=/nologo $(GLIB_LFLAGS) + +bitlbee.exe: $(DEF_FILE) $(MAIN_OBJS) + $(LINK32) $(MAIN_LIBS) $(LINK32_FLAGS) /out:bitlbee.exe $(MAIN_OBJS) + +libmsn.dll: $(MSN_OBJS) + $(LINK32) /DLL /SUBSYSTEM:WINDOWS /ENTRY:msn_init $(MSN_LIBS) $(LINK32_FLAGS) /out:libmsn.dll $(MSN_OBJS) + +libyahoo.dll: $(YAHOO_OBJS) + $(LINK32) /DLL /SUBSYSTEM:WINDOWS /ENTRY:yahoo_init $(YAHOO_LIBS) $(LINK32_FLAGS) /out:libyahoo.dll $(YAHOO_OBJS) + +liboscar.dll: $(OSCAR_OBJS) + $(LINK32) /DLL /SUBSYSTEM:WINDOWS /ENTRY:oscar_init $(OSCAR_LIBS) $(LINK32_FLAGS) /out:liboscar.dll $(OSCAR_OBJS) + +libjabber.dll: $(JABBER_OBJS) + $(LINK32) /DLL /SUBSYSTEM:WINDOWS /ENTRY:jabber_init $(JABBER_LIBS) $(LINK32_FLAGS) /out:libjabber.dll $(JABBER_OBJS) + +clean: + @-erase $(MAIN_OBJS) + @-erase $(MSN_OBJS) + @-erase $(JABBER_OBJS) + @-erase $(OSCAR_OBJS) + @-erase $(YAHOO_OBJS) diff --git a/win32/bitlbee.dsp b/win32/bitlbee.dsp deleted file mode 100644 index f08f64a9..00000000 --- a/win32/bitlbee.dsp +++ /dev/null @@ -1,247 +0,0 @@ -# Microsoft Developer Studio Project File - Name="bitlbee" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=bitlbee - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "bitlbee.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "bitlbee.mak" CFG="bitlbee - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "bitlbee - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "bitlbee - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "bitlbee - Win32 Release" - -# PROP BASE Use_MFC 6 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 6 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" -# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib iconv.lib glib-2.0.lib gmodule-2.0.lib wsock32.lib advapi32.lib /nologo /machine:I386 /libpath:"release" /libpath:"deps\lib" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "bitlbee - Win32 Debug" - -# PROP BASE Use_MFC 6 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 6 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" -# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 iconv.lib glib-2.0.lib gmodule-2.0.lib wsock32.lib kernel32.lib user32.lib advapi32.lib /nologo /debug /machine:I386 /pdbtype:sept /libpath:"debug" /libpath:"deps\lib" -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "bitlbee - Win32 Release" -# Name "bitlbee - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\account.c -# End Source File -# Begin Source File - -SOURCE=..\bitlbee.c -# End Source File -# Begin Source File - -SOURCE=..\commands.c -# End Source File -# Begin Source File - -SOURCE=..\crypting.c -# End Source File -# Begin Source File - -SOURCE=..\debug.c -# End Source File -# Begin Source File - -SOURCE=..\help.c -# End Source File -# Begin Source File - -SOURCE=..\irc.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\md5.c -# End Source File -# Begin Source File - -SOURCE=..\nick.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\nogaim.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\proxy.c -# End Source File -# Begin Source File - -SOURCE=..\query.c -# End Source File -# Begin Source File - -SOURCE=..\set.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\sha.c -# End Source File -# Begin Source File - -SOURCE=..\user.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\util.c - -!IF "$(CFG)" == "bitlbee - Win32 Release" - -!ELSEIF "$(CFG)" == "bitlbee - Win32 Debug" - -# PROP Intermediate_Dir "Debugx" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\win32.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\account.h -# End Source File -# Begin Source File - -SOURCE=..\bitlbee.h -# End Source File -# Begin Source File - -SOURCE=..\commands.h -# End Source File -# Begin Source File - -SOURCE=..\conf.h -# End Source File -# Begin Source File - -SOURCE=.\config.h -# End Source File -# Begin Source File - -SOURCE=..\crypting.h -# End Source File -# Begin Source File - -SOURCE=..\help.h -# End Source File -# Begin Source File - -SOURCE=..\ini.h -# End Source File -# Begin Source File - -SOURCE=..\irc.h -# End Source File -# Begin Source File - -SOURCE=..\log.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\md5.h -# End Source File -# Begin Source File - -SOURCE=..\nick.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\nogaim.h -# End Source File -# Begin Source File - -SOURCE=..\set.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\sha.h -# End Source File -# Begin Source File - -SOURCE=..\sock.h -# End Source File -# Begin Source File - -SOURCE=..\user.h -# End Source File -# End Group -# End Target -# End Project diff --git a/win32/bitlbee.dsw b/win32/bitlbee.dsw deleted file mode 100644 index 7f446962..00000000 --- a/win32/bitlbee.dsw +++ /dev/null @@ -1,119 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "admin"=.\admin1\admin.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "bitlbee"=.\bitlbee.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "bitlbee_ssl"=.\bitlbee_ssl.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "jabber"=.\jabber.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name bitlbee - End Project Dependency - Begin Project Dependency - Project_Dep_Name bitlbee_ssl - End Project Dependency -}}} - -############################################################################### - -Project: "msn"=.\msn.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name bitlbee - End Project Dependency - Begin Project Dependency - Project_Dep_Name bitlbee_ssl - End Project Dependency -}}} - -############################################################################### - -Project: "oscar"=.\oscar.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name bitlbee - End Project Dependency -}}} - -############################################################################### - -Project: "yahoo"=.\yahoo.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name bitlbee - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/win32/bitlbee_ssl.dsp b/win32/bitlbee_ssl.dsp deleted file mode 100644 index 5a4e764d..00000000 --- a/win32/bitlbee_ssl.dsp +++ /dev/null @@ -1,99 +0,0 @@ -# Microsoft Developer Studio Project File - Name="bitlbee_ssl" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=bitlbee_ssl - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "bitlbee_ssl.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "bitlbee_ssl.mak" CFG="bitlbee_ssl - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "bitlbee_ssl - Win32 Release" (based on\ - "Win32 (x86) Dynamic-Link Library") -!MESSAGE "bitlbee_ssl - Win32 Debug" (based on\ - "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "bitlbee_ssl - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libnspr4.lib nss3.lib ssl3.lib ws2_32.lib glib-2.0.lib /nologo /subsystem:windows /dll /machine:I386 /libpath:"release" /libpath:"deps\lib" - -!ELSEIF "$(CFG)" == "bitlbee_ssl - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libnspr4.lib nss3.lib ssl3.lib ws2_32.lib glib-2.0.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept /libpath:"debug" /libpath:"deps\lib" - -!ENDIF - -# Begin Target - -# Name "bitlbee_ssl - Win32 Release" -# Name "bitlbee_ssl - Win32 Debug" -# Begin Source File - -SOURCE=..\protocols\ssl_client.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\ssl_nss.c -# End Source File -# End Target -# End Project diff --git a/win32/jabber.dsp b/win32/jabber.dsp deleted file mode 100644 index ce5b08c7..00000000 --- a/win32/jabber.dsp +++ /dev/null @@ -1,228 +0,0 @@ -# Microsoft Developer Studio Project File - Name="jabber" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=jabber - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "jabber.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "jabber.mak" CFG="jabber - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "jabber - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "jabber - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "jabber - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "jabrel" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\protocols\jabber" /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib iconv.lib glib-2.0.lib /nologo /subsystem:windows /dll /machine:I386 /out:"Release/libjabber.dll" /libpath:"release" /libpath:"deps\lib" - -!ELSEIF "$(CFG)" == "jabber - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "jabber__" -# PROP BASE Intermediate_Dir "jabber__" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "jabdeb" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\protocols\jabber" /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 odbc32.lib glib-2.0.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbccp32.lib ws2_32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/libjabber.dll" /pdbtype:sept /libpath:"debug" /libpath:"deps\lib" - -!ENDIF - -# Begin Target - -# Name "jabber - Win32 Release" -# Name "jabber - Win32 Debug" -# Begin Source File - -SOURCE=..\protocols\jabber\asciitab.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\expat.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\genhash.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\hashtable.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\hashtable.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\iasciitab.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\jabber.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\jabber.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\jconn.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\jid.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\jpacket.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\jutil.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\karma.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\latin1tab.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\libxode.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\log.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\log.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\nametab.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\pool.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\pproxy.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\rate.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\str.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\utf8tab.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\xhash.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\xmldef.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\xmlnode.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\xmlparse.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\xmlparse.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\xmlrole.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\xmlrole.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\xmltok.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\xmltok.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\xmltok_impl.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\jabber\xstream.c -# End Source File -# End Target -# End Project diff --git a/win32/msn.dsp b/win32/msn.dsp deleted file mode 100644 index 4c5fcfb3..00000000 --- a/win32/msn.dsp +++ /dev/null @@ -1,116 +0,0 @@ -# Microsoft Developer Studio Project File - Name="msn" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=msn - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "msn.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "msn.mak" CFG="msn - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "msn - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "msn - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "msn - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "msnrel" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "e:\dev\include\nss" /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib iconv.lib glib-2.0.lib nss3.lib libnspr4.lib ssl3.lib /nologo /subsystem:windows /dll /machine:I386 /out:"Release/libmsn.dll" /libpath:"release" /libpath:"deps\lib" - -!ELSEIF "$(CFG)" == "msn - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "msn___Wi" -# PROP BASE Intermediate_Dir "msn___Wi" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "msndeb" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 odbc32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbccp32.lib ws2_32.lib glib-2.0.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/libmsn.dll" /pdbtype:sept /libpath:"debug" /libpath:"deps\lib" - -!ENDIF - -# Begin Target - -# Name "msn - Win32 Release" -# Name "msn - Win32 Debug" -# Begin Source File - -SOURCE=..\protocols\msn\msn.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\msn\msn_util.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\msn\ns.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\msn\passport.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\msn\sb.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\msn\tables.c -# End Source File -# End Target -# End Project diff --git a/win32/oscar.dsp b/win32/oscar.dsp deleted file mode 100644 index aa2242ba..00000000 --- a/win32/oscar.dsp +++ /dev/null @@ -1,204 +0,0 @@ -# Microsoft Developer Studio Project File - Name="oscar" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=oscar - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "oscar.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "oscar.mak" CFG="oscar - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "oscar - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "oscar - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "oscar - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "oscarrel" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\protocols\oscar" /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib iconv.lib ws2_32.lib glib-2.0.lib /nologo /subsystem:windows /dll /machine:I386 /out:"Release/liboscar.dll" /libpath:"release" /libpath:"deps\lib" - -!ELSEIF "$(CFG)" == "oscar - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "oscar___" -# PROP BASE Intermediate_Dir "oscar___" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "oscdeb" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\protocols\oscar" /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 gmodule-2.0.lib ws2_32.lib glib-2.0.lib iconv.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/liboscar.dll" /pdbtype:sept /libpath:"debug" /libpath:"deps\lib" - -!ENDIF - -# Begin Target - -# Name "oscar - Win32 Release" -# Name "oscar - Win32 Debug" -# Begin Source File - -SOURCE=..\protocols\oscar\admin.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\aim.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\aim_cbtypes.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\aim_internal.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\auth.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\bos.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\buddylist.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\chat.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\chatnav.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\conn.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\faimconfig.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\ft.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\icq.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\im.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\info.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\misc.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\msgcookie.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\oscar.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\oscar_util.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\rxhandlers.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\rxqueue.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\search.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\service.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\snac.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\ssi.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\stats.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\tlv.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\oscar\txqueue.c -# End Source File -# End Target -# End Project diff --git a/win32/yahoo.dsp b/win32/yahoo.dsp deleted file mode 100644 index ebfc4eef..00000000 --- a/win32/yahoo.dsp +++ /dev/null @@ -1,152 +0,0 @@ -# Microsoft Developer Studio Project File - Name="yahoo" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=yahoo - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "yahoo.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "yahoo.mak" CFG="yahoo - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "yahoo - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "yahoo - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "yahoo - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "yahrel" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_CONFIG_H" /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib iconv.lib glib-2.0.lib /nologo /subsystem:windows /dll /machine:I386 /out:"Release/libyahoo.dll" /libpath:"release" /libpath:"deps\lib" - -!ELSEIF "$(CFG)" == "yahoo - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "yahoo___" -# PROP BASE Intermediate_Dir "yahoo___" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "yahdeb" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I "..\protocols" /I ".." /I "deps\include" /I "deps\include\glib-2.0" /I "deps\lib\glib-2.0\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_CONFIG_H" /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ws2_32.lib glib-2.0.lib gmodule-2.0.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/libyahoo.dll" /pdbtype:sept /libpath:"debug" /libpath:"deps\lib" - -!ENDIF - -# Begin Target - -# Name "yahoo - Win32 Release" -# Name "yahoo - Win32 Debug" -# Begin Source File - -SOURCE=..\protocols\yahoo\crypt.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\yahoo\libyahoo2.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\yahoo\yahoo.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\yahoo\yahoo2.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\yahoo\yahoo2_callbacks.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\yahoo\yahoo2_types.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\yahoo\yahoo_debug.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\yahoo\yahoo_fn.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\yahoo\yahoo_fn.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\yahoo\yahoo_httplib.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\yahoo\yahoo_httplib.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\yahoo\yahoo_list.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\yahoo\yahoo_list.h -# End Source File -# Begin Source File - -SOURCE=..\protocols\yahoo\yahoo_util.c -# End Source File -# Begin Source File - -SOURCE=..\protocols\yahoo\yahoo_util.h -# End Source File -# End Target -# End Project -- cgit v1.2.3 From 4146a07de5f44f3ea00a3ef0026098b28e7451de Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 17 Dec 2005 02:25:32 +0100 Subject: Fix win32 build using mingw32 on linux (no ssl and yahoo yet though) --- Makefile | 4 ++-- bitlbee.h | 7 ++----- doc/BUILD.win32 | 3 +++ sock.h | 5 ----- storage_text.c | 8 ++++++++ 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index ae86fcf1..762457bf 100644 --- a/Makefile +++ b/Makefile @@ -9,13 +9,13 @@ -include Makefile.settings # Program variables -objects = account.o bitlbee.o commands.o crypting.o help.o ini.o irc.o log.o nick.o query.o set.o url.o user.o storage_text.o storage.o +objects = account.o bitlbee.o commands.o crypting.o help.o ini.o irc.o nick.o query.o set.o url.o user.o storage_text.o storage.o subdirs = protocols ifeq ($(ARCH),Windows) objects += win32.o else -objects += unix.o conf.o +objects += unix.o conf.o log.o endif # Expansion of variables diff --git a/bitlbee.h b/bitlbee.h index 41247270..fdde4b6f 100644 --- a/bitlbee.h +++ b/bitlbee.h @@ -47,9 +47,10 @@ #include #include #include +#include + #ifndef _WIN32 #include -#include #endif #include @@ -75,10 +76,6 @@ #undef strncasecmp #define strncasecmp __PLEASE_USE_G_STRNCASECMP_INSTEAD__ -#ifndef F_OK -#define F_OK 0 -#endif - #define _( x ) x #define ROOT_NICK "root" diff --git a/doc/BUILD.win32 b/doc/BUILD.win32 index e21e1aaf..e00cfdda 100644 --- a/doc/BUILD.win32 +++ b/doc/BUILD.win32 @@ -16,6 +16,9 @@ Instructions for building BitlBee on Windows - nss (in security/nss/) - nspr (in nspr/) + glib and gettext are only required for actually running BitlBee - building + should work fine without them. + 3. Set the following variables in Makefile.settings, if you don't have the libraries above installed in the default directories searched by MSVC: diff --git a/sock.h b/sock.h index 3e74bf96..3878cff1 100644 --- a/sock.h +++ b/sock.h @@ -9,17 +9,12 @@ #define closesocket(a) close(a) #else # include -# ifndef _MSC_VER -# include -# endif # if !defined(BITLBEE_CORE) && defined(_MSC_VER) # pragma comment(lib,"bitlbee.lib") # endif # include # define read(a,b,c) recv(a,b,c,0) # define write(a,b,c) send(a,b,c,0) -# define umask _umask -# define mode_t int # define sock_make_nonblocking(fd) { int non_block = 1; ioctlsocket(fd, FIONBIO, &non_block); } # define sockerr_again() (WSAGetLastError() == WSAEINTR || WSAGetLastError() == WSAEINPROGRESS || WSAGetLastError() == WSAEWOULDBLOCK) # define ETIMEDOUT WSAETIMEDOUT diff --git a/storage_text.c b/storage_text.c index ed32b73f..d3823cac 100644 --- a/storage_text.c +++ b/storage_text.c @@ -26,6 +26,14 @@ #define BITLBEE_CORE #include "bitlbee.h" #include "crypting.h" +#ifdef _WIN32 +# define umask _umask +# define mode_t int +#endif + +#ifndef F_OK +#define F_OK 0 +#endif /* DO NOT USE THIS FUNCTION IN NEW CODE. This * function is here merely because the save/load code still uses -- cgit v1.2.3 From e3fb6789b0004c7162efde679632bf094b7b0eec Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 18 Dec 2005 17:10:24 +0100 Subject: Initial work on a SSPI SSL backend --- configure | 4 +- protocols/ssl_sspi.c | 210 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 213 insertions(+), 1 deletion(-) create mode 100644 protocols/ssl_sspi.c diff --git a/configure b/configure index 37915a07..d8f3187b 100755 --- a/configure +++ b/configure @@ -58,7 +58,7 @@ Option Description Default --ipv6=0/1 IPv6 socket support $ipv6 ---ssl=... SSL library to use (gnutls, nss, openssl, bogus, auto) +--ssl=... SSL library to use (gnutls, nss, openssl, sspi, bogus, auto) $ssl EOF exit; @@ -216,6 +216,8 @@ if [ "$msn" = 1 -o "$jabber" = 1 ]; then detect_gnutls; elif [ "$ssl" = "nss" ]; then detect_nss; + elif [ "$ssl" = "sspi" ]; then + echo elif [ "$ssl" = "openssl" ]; then echo echo 'No detection code exists for OpenSSL. Make sure that you have a complete' diff --git a/protocols/ssl_sspi.c b/protocols/ssl_sspi.c new file mode 100644 index 00000000..2129f07b --- /dev/null +++ b/protocols/ssl_sspi.c @@ -0,0 +1,210 @@ + /********************************************************************\ + * BitlBee -- An IRC to other IM-networks gateway * + * * + * Copyright 2002-2004 Wilmer van der Gaast and others * + \********************************************************************/ + +/* SSL module - SSPI backend */ + +/* Copyright (C) 2005 Jelmer Vernooij */ + +/* + 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 with + the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL; + if not, write to the Free Software Foundation, Inc., 59 Temple Place, + Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "ssl_client.h" +#include +#define SECURITY_WIN32 +#include +#include +#include + +static gboolean initialized = FALSE; +int ssl_errno; + +struct scd +{ + int fd; + SslInputFunction func; + gpointer data; + gboolean established; + int inpa; + CredHandle cred; /* SSL credentials */ + CtxtHandle context; /* SSL context */ + SecPkgContext_StreamSizes sizes; +}; + +static void ssl_connected( gpointer data, gint source, GaimInputCondition cond ); + +void sspi_global_init( void ) +{ + /* FIXME */ +} + +void sspi_global_deinit( void ) +{ + /* FIXME */ +} + +void *ssl_connect( char *host, int port, SslInputFunction func, gpointer data ) +{ + struct scd *conn = g_new0( struct scd, 1 ); + SCHANNEL_CRED ssl_cred; + TimeStamp timestamp; + + conn->fd = proxy_connect( host, port, ssl_connected, conn ); + conn->func = func; + conn->data = data; + conn->inpa = -1; + + if( conn->fd < 0 ) + { + g_free( conn ); + return( NULL ); + } + + if( !initialized ) + { + sspi_global_init(); + initialized = TRUE; + atexit( sspi_global_deinit ); + } + + conn->context = NULL; + + memset(&ssl_cred, 0, sizeof(SCHANNEL_CRED)); + ssl_cred.dwVersion = SCHANNEL_CRED_VERSION; + ssl_cred.grbitEnabledProtocols = SP_PROT_SSL3_CLIENT; + + SECURITY_STATUS st = AcquireCredentialsHandle(NULL, UNISP_NAME, SECPKG_CRED_OUTBOUND, NULL, &ssl_cred, NULL, NULL, &conn->cred, ×tamp); + + InitializeSecurityContext(&conn->cred, &conn->context, host, FIXME, 1, FIXME); + + QueryContextAttributes(&conn->context, SECPKG_ATTR_STREAM_SIZES, &conn->sizes); + + + return( conn ); +} + +int ssl_read( void *conn, char *retdata, int len ) +{ + struct scd *scd = conn; + SecBufferDesc msg; + SecBuffer buf[4]; + int ret = -1, i; + char *data = g_malloc(scd->sizes.cbHeader + scd->sizes.cbMaximumMessage + scd->sizes.cbTrailer); + + /* FIXME: Try to read some data */ + + msg.ulVersion = SECBUFFER_VERSION; + msg.cBuffers = 4; + msg.pBuffers = buf; + + buf[0].BufferType = SECBUFFER_DATA; + buf[0].cbBuffer = len; + buf[0].pvBuffer = data; + + buf[1].BufferType = SECBUFFER_EMPTY; + buf[2].BufferType = SECBUFFER_EMPTY; + buf[3].BufferType = SECBUFFER_EMPTY; + + SECURITY_STATUS st = DecryptMessage(&scd->context, &msg, 0, NULL); + + for (i = 0; i < 4; i++) { + if (buf[i].BufferType == SECBUFFER_DATA) { + memcpy(retdata, buf[i].pvBuffer, len); + ret = len; + } + } + + g_free(data); + return( -1 ); +} + +int ssl_write( void *conn, const char *userdata, int len ) +{ + struct scd *scd = conn; + SecBuffer buf[4]; + SecBufferDesc msg; + char *data; + int ret; + + msg.ulVersion = SECBUFFER_VERSION; + msg.cBuffers = 4; + msg.pBuffers = buf; + + data = g_malloc(scd->sizes.cbHeader + scd->sizes.cbMaximumMessage + scd->sizes.cbTrailer); + memcpy(data + scd->sizes.cbHeader, userdata, len); + + buf[0].BufferType = SECBUFFER_STREAM_HEADER; + buf[0].cbBuffer = scd->sizes.cbHeader; + buf[0].pvBuffer = data; + + buf[1].BufferType = SECBUFFER_DATA; + buf[1].cbBuffer = len; + buf[1].pvBuffer = data + scd->sizes.cbHeader; + + buf[2].BufferType = SECBUFFER_STREAM_TRAILER; + buf[2].cbBuffer = scd->sizes.cbTrailer; + buf[2].pvBuffer = data + scd->sizes.cbHeader + len; + buf[3].BufferType = SECBUFFER_EMPTY; + + SECURITY_STATUS st = EncryptMessage(&scd->context, 0, &msg, 0); + + ret = send(scd->fd, data, + buf[0].cbBuffer + buf[1].cbBuffer + buf[2].cbBuffer, 0); + + g_free(data); + + return ret; +} + +void ssl_disconnect( void *conn ) +{ + struct scd *scd = conn; + + SecBufferDesc msg; + SecBuffer buf; + DWORD dw; + + dw = SCHANNEL_SHUTDOWN; + buf.cbBuffer = sizeof(dw); + buf.BufferType = SECBUFFER_TOKEN; + buf.pvBuffer = &dw; + + msg.ulVersion = SECBUFFER_VERSION; + msg.cBuffers = 1; + msg.pBuffers = &buf; + + SECURITY_STATUS st = ApplyControlToken(&scd->context, &msg); + + if (st != SEC_E_OK) { + /* FIXME */ + } + + /* FIXME: call InitializeSecurityContext(Schannel), passing + * in empty buffers*/ + + DeleteSecurityContext(&scd->context); + + closesocket( scd->fd ); + g_free(scd); +} + +int ssl_getfd( void *conn ) +{ + return( ((struct scd*)conn)->fd ); +} -- cgit v1.2.3 From 3e91c3ec7d6426c4c2819e78275f935e1a7fce2c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 10 Jan 2006 22:32:56 +0100 Subject: emove traditional setup file --- win32/bitlbee.iss | 73 ------------------------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 win32/bitlbee.iss diff --git a/win32/bitlbee.iss b/win32/bitlbee.iss deleted file mode 100644 index a9863f3b..00000000 --- a/win32/bitlbee.iss +++ /dev/null @@ -1,73 +0,0 @@ -; Inno setup script for Bitlbee -; (C) 2004-2005 Jelmer Vernooij - -[Setup] -AppName=BitlBee -AppPublisher=The BitlBee Team -AppPublisherURL=http://www.bitlbee.org/ -AppSupportURL=http://win32.bitlbee.org/ -AppUpdatesURL=http://win32.bitlbee.org/ -AppCopyright=Copyright © 2002-2005 The BitlBee Team -DefaultDirName={pf}\Bitlbee -DefaultGroupName=Bitlbee -LicenseFile=..\COPYING -InfoAfterFile=README.TXT -OutputDir=. -AppVerName=Bitlbee-20050516 -OutputBaseFileName="BitlBee-setup" - -[Components] -Name: main; Description: Main executable and files; Types: full compact custom; Flags: fixed; -Name: "yahoo"; Description: Yahoo! Messenger support; Types: full; -Name: "oscar"; Description: AIM/ICQ support; Types: full; -Name: ssl; Description: SSL Support; Types: full; -Name: "ssl\msn"; Description: MSN messenger support; Types: full; -Name: "ssl\jabber"; Description: Jabber support; Types: full; -Name: docs; Description: Documentation; Types: full; - -[Tasks] -Name: startupicon; Description: "&Automatically start when the computer boots"; GroupDescription: "Other tasks:"; Flags: unchecked - -[Files] -Source: "Release\bitlbee.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: main; -Source: "Release\libmsn.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl\msn" -Source: "Deps\lib\ssl3.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl" -Source: "Deps\lib\nss3.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl" -Source: "Deps\lib\nssckbi.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl" -Source: "Deps\lib\smime3.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl" -Source: "Deps\lib\softokn3.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl" -Source: "Deps\lib\libplc4.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl" -Source: "Deps\lib\libnspr4.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl" -Source: "Release\libjabber.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl\jabber" -Source: "Release\bitlbee_ssl.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "ssl" -Source: "Deps\bin\libglib-2.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: main; -Source: "Deps\bin\libgmodule-2.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: main; -Source: "Release\liboscar.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "oscar" -Source: "Deps\bin\intl.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: main; -Source: "Deps\bin\iconv.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: main; -Source: "Release\libyahoo.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "yahoo" -Source: "..\motd.txt"; DestDir: "{app}"; Flags: ignoreversion; Components: main; -Source: "..\doc\help.txt"; DestDir: "{app}"; Flags: ignoreversion; Components: main; -Source: "..\COPYING"; DestDir: "{app}"; Flags: ignoreversion; Components: main; -Source: "..\doc\TODO"; DestDir: "{app}"; Flags: ignoreversion; Components: main; -Source: "..\doc\README"; DestDir: "{app}"; Flags: ignoreversion; Components: main; -Source: "..\doc\FAQ"; DestDir: "{app}"; Flags: ignoreversion; Components: docs; -Source: "..\doc\CREDITS"; DestDir: "{app}"; Flags: ignoreversion; Components: main; -; Source: "..\doc\user-guide.pdf"; DestDir: "{app}"; Flags: ignoreversion; Components: docs; -Source: "..\doc\CHANGES"; DestDir: "{app}"; Flags: ignoreversion; Components: main; -Source: "..\doc\AUTHORS"; DestDir: "{app}"; Flags: ignoreversion; Components: main; -; NOTE: Don't use "Flags: ignoreversion" on any shared system files - -[Icons] -Name: "{group}\Bitlbee"; Filename: "{app}\bitlbee.exe" -Name: "{commonstartup}\Bitlbee"; Filename: "{app}\bitlbee.exe"; Tasks: startupicon - - -[Run] -; NOTE: The following entry contains an English phrase ("Launch"). You are free to translate it into another language if required. -Filename: "{app}\bitlbee.exe"; Description: "Launch Bitlbee"; Flags: nowait postinstall skipifsilent - -[Registry] -Root: HKLM; Subkey: "SOFTWARE\Bitlbee"; ValueType: string; ValueName: "helpfile"; ValueData: "{app}\help.txt" -Root: HKLM; Subkey: "SOFTWARE\Bitlbee"; ValueType: string; ValueName: "motdfile"; ValueData: "{app}\motd.txt" -Root: HKLM; Subkey: "SOFTWARE\Bitlbee"; ValueType: string; ValueName: "configdir"; ValueData: "{userappdata}\Bitlbee" -- cgit v1.2.3 From 46ad029950221205d1eb6201ec2f01c7231876c2 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 2 Mar 2006 12:12:40 +0100 Subject: Fix password change --- win32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/win32.c b/win32.c index 63148271..cf36e772 100644 --- a/win32.c +++ b/win32.c @@ -202,7 +202,8 @@ conf_t *conf_load( int argc, char *argv[] ) conf_get_string(key_main, "interface", "0.0.0.0", &global.conf->iface); conf_get_int(key_main, "port", 6667, &global.conf->port); conf_get_int(key_main, "verbose", 0, &global.conf->verbose); - conf_get_string(key_main, "password", "", &global.conf->password); + conf_get_string(key_main, "auth_pass", "", &global.conf->auth_pass); + conf_get_string(key_main, "oper_pass", "", &global.conf->oper_pass); conf_get_int(key_main, "ping_interval_timeout", 60, &global.conf->ping_interval); conf_get_string(key_main, "hostname", "localhost", &global.conf->hostname); conf_get_string(key_main, "configdir", NULL, &global.conf->configdir); -- cgit v1.2.3 From 80c1e4d9e8c82a83499d6b66cdf3a95d15bf0fa1 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 25 May 2006 01:31:20 +0200 Subject: #ifdef out some Win32-incompatible code blocks --- bitlbee.c | 6 +++++- ipc.c | 2 +- protocols/ssl_sspi.c | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bitlbee.c b/bitlbee.c index cca14916..30167fea 100644 --- a/bitlbee.c +++ b/bitlbee.c @@ -122,6 +122,7 @@ int bitlbee_daemon_init() global.conf->runmode == RUNMODE_FORKDAEMON ) ipc_master_listen_socket(); +#ifndef _WIN32 if( ( fp = fopen( global.conf->pidfile, "w" ) ) ) { fprintf( fp, "%d\n", (int) getpid() ); @@ -131,6 +132,7 @@ int bitlbee_daemon_init() { log_message( LOGLVL_WARNING, "Warning: Couldn't write PID to `%s'", global.conf->pidfile ); } +#endif return( 0 ); } @@ -252,7 +254,6 @@ gboolean bitlbee_io_new_client( GIOChannel *source, GIOCondition condition, gpoi size_t size = sizeof( struct sockaddr_in ); struct sockaddr_in conn_info; int new_socket = accept( global.listen_socket, (struct sockaddr *) &conn_info, &size ); - pid_t client_pid = 0; if( new_socket == -1 ) { @@ -260,8 +261,10 @@ gboolean bitlbee_io_new_client( GIOChannel *source, GIOCondition condition, gpoi return TRUE; } +#ifndef _WIN32 if( global.conf->runmode == RUNMODE_FORKDAEMON ) { + pid_t client_pid = 0; int fds[2]; if( socketpair( AF_UNIX, SOCK_STREAM, 0, fds ) == -1 ) @@ -312,6 +315,7 @@ gboolean bitlbee_io_new_client( GIOChannel *source, GIOCondition condition, gpoi } } else +#endif { log_message( LOGLVL_INFO, "Creating new connection with fd %d.", new_socket ); irc_new( new_socket ); diff --git a/ipc.c b/ipc.c index 18d3284e..a9f3ea34 100644 --- a/ipc.c +++ b/ipc.c @@ -416,6 +416,7 @@ void ipc_master_free_all() child_list = NULL; } +#ifndef _WIN32 char *ipc_master_save_state() { char *fn = g_strdup( "/tmp/bee-restart.XXXXXX" ); @@ -483,7 +484,6 @@ static gboolean new_ipc_client (GIOChannel *gio, GIOCondition cond, gpointer dat return TRUE; } -#ifndef _WIN32 int ipc_master_listen_socket() { struct sockaddr_un un_addr; diff --git a/protocols/ssl_sspi.c b/protocols/ssl_sspi.c index 2129f07b..0529b4ec 100644 --- a/protocols/ssl_sspi.c +++ b/protocols/ssl_sspi.c @@ -38,7 +38,7 @@ int ssl_errno; struct scd { int fd; - SslInputFunction func; + ssl_input_function func; gpointer data; gboolean established; int inpa; @@ -59,7 +59,7 @@ void sspi_global_deinit( void ) /* FIXME */ } -void *ssl_connect( char *host, int port, SslInputFunction func, gpointer data ) +void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data ) { struct scd *conn = g_new0( struct scd, 1 ); SCHANNEL_CRED ssl_cred; -- cgit v1.2.3 From 51a4ffb83d6fbe23f1c2b8499cc78584e7213812 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 25 May 2006 11:55:00 +0200 Subject: Some more work on SSL on Windows --- protocols/ssl_sspi.c | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/protocols/ssl_sspi.c b/protocols/ssl_sspi.c index 0529b4ec..c6d7def9 100644 --- a/protocols/ssl_sspi.c +++ b/protocols/ssl_sspi.c @@ -64,6 +64,13 @@ void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data struct scd *conn = g_new0( struct scd, 1 ); SCHANNEL_CRED ssl_cred; TimeStamp timestamp; + SecBuffer ibuf[2],obuf[1]; + SecBufferDesc ibufs,obufs; + ULONG req = ISC_REQ_REPLAY_DETECT | ISC_REQ_SEQUENCE_DETECT | + ISC_REQ_CONFIDENTIALITY | ISC_REQ_USE_SESSION_KEY | + ISC_REQ_ALLOCATE_MEMORY | ISC_REQ_STREAM | ISC_REQ_EXTENDED_ERROR | + ISC_REQ_MANUAL_CRED_VALIDATION; + ULONG a; conn->fd = proxy_connect( host, port, ssl_connected, conn ); conn->func = func; @@ -83,17 +90,42 @@ void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data atexit( sspi_global_deinit ); } - conn->context = NULL; - memset(&ssl_cred, 0, sizeof(SCHANNEL_CRED)); ssl_cred.dwVersion = SCHANNEL_CRED_VERSION; ssl_cred.grbitEnabledProtocols = SP_PROT_SSL3_CLIENT; SECURITY_STATUS st = AcquireCredentialsHandle(NULL, UNISP_NAME, SECPKG_CRED_OUTBOUND, NULL, &ssl_cred, NULL, NULL, &conn->cred, ×tamp); + + if (st != SEC_E_OK) + return NULL; + + do { + /* initialize buffers */ + ibuf[0].cbBuffer = size; ibuf[0].pvBuffer = buf; + ibuf[1].cbBuffer = 0; ibuf[1].pvBuffer = NIL; + obuf[0].cbBuffer = 0; obuf[0].pvBuffer = NIL; + ibuf[0].BufferType = obuf[0].BufferType = SECBUFFER_TOKEN; + ibuf[1].BufferType = SECBUFFER_EMPTY; + + /* initialize buffer descriptors */ + ibufs.ulVersion = obufs.ulVersion = SECBUFFER_VERSION; + ibufs.cBuffers = 2; obufs.cBuffers = 1; + ibufs.pBuffers = ibuf; obufs.pBuffers = obuf; + + st = InitializeSecurityContext(&conn->cred, size?&conn->context:NULL, host, req, 0, SECURITY_NETWORK_DREP, size?&ibufs:NULL, 0, &conn->context, &obufs, &a, ×tamp); + if (obuf[0].pvBuffer && obuf[0].cbBuffer) { + send(conn->fd, obuf[0].pvBuffer, obuf[0].cbBuffer, 0); + } + + switch (st) { + case SEC_I_INCOMPLETE_CREDENTIALS: + break; + case SEC_I_CONTINUE_NEEDED: + + } - InitializeSecurityContext(&conn->cred, &conn->context, host, FIXME, 1, FIXME); - QueryContextAttributes(&conn->context, SECPKG_ATTR_STREAM_SIZES, &conn->sizes); + QueryContextAttributes(&conn->context, SECPKG_ATTR_STREAM_SIZES, &conn->sizes); return( conn ); @@ -200,6 +232,8 @@ void ssl_disconnect( void *conn ) DeleteSecurityContext(&scd->context); + FreeCredentialHandle(&scd->cred); + closesocket( scd->fd ); g_free(scd); } -- cgit v1.2.3 From 1705ec3724462b1ceac91aefb5bef24d7c8def54 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 25 May 2006 18:10:39 +0200 Subject: Add tool for cross compiling for Windows --- utils/cross-compile.win32 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 utils/cross-compile.win32 diff --git a/utils/cross-compile.win32 b/utils/cross-compile.win32 new file mode 100755 index 00000000..21f3551c --- /dev/null +++ b/utils/cross-compile.win32 @@ -0,0 +1,23 @@ +#!/bin/sh +# Simple cross compilation script for BitlBee using mingw32 +# (C) Jelmer Vernooij 2005-2006 + +GTK_SITE=ftp://ftp.gtk.org/pub/gtk/v2.8/win32 + +GLIB_VERSION=2.10.1 +LIBICONV_VERSION=1.9.1 + +wget -c $GTK_SITE/glib-dev-$GLIB_VERSION.zip +wget -c $GTK_SITE/dependencies/libiconv-$LIBICONV_VERSION.bin.woe32.zip + +DEPSDIR=`pwd`/win32 +mkdir $DEPSDIR + +unzip -d $DEPSDIR -o libiconv-$LIBICONV_VERSION.bin.woe32.zip +unzip -d $DEPSDIR -o glib-dev-$GLIB_VERSION.zip + +LD=i586-mingw32msvc-ld CC=i586-mingw32msvc-gcc STRIP=i586-mingw32msvc-strip PKG_CONFIG_PATH="$DEPSDIR" PKG_CONFIG="pkg-config --define-variable=prefix=\"$DEPSDIR\"" ./configure --ssl=sspi --ipv6=0 --yahoo=0 +echo OUTFILE=bitlbee.exe >> Makefile.settings +echo ARCH=Windows >> Makefile.settings +echo LFLAGS+=-lwsock32 >> Makefile.settings +$MAKE -- cgit v1.2.3 From eecccf1230639dc883c5687b442a89df89040ae2 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 26 May 2006 01:08:15 +0200 Subject: Add replacement functions for log_link(), inet_pton() and inet_ntop() --- win32.c | 575 ++++++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 471 insertions(+), 104 deletions(-) diff --git a/win32.c b/win32.c index cf36e772..511deb23 100644 --- a/win32.c +++ b/win32.c @@ -22,7 +22,7 @@ if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - + #define BITLBEE_CORE #include "bitlbee.h" #include "commands.h" @@ -50,48 +50,48 @@ static void WINAPI service_ctrl (DWORD dwControl) } } - -static void bitlbee_init(int argc, char **argv) -{ - int i = -1; - memset( &global, 0, sizeof( global_t ) ); - - global.loop = g_main_new( FALSE ); - - global.conf = conf_load( argc, argv ); - if( global.conf == NULL ) - return; - - if( global.conf->runmode == RUNMODE_INETD ) - { - i = bitlbee_inetd_init(); - log_message( LOGLVL_INFO, "Bitlbee %s starting in inetd mode.", BITLBEE_VERSION ); - - } - else if( global.conf->runmode == RUNMODE_DAEMON ) - { - i = bitlbee_daemon_init(); - log_message( LOGLVL_INFO, "Bitlbee %s starting in daemon mode.", BITLBEE_VERSION ); - } - else - { - log_message( LOGLVL_INFO, "No bitlbee mode specified..."); - } - - if( i != 0 ) - return; - - if( access( global.conf->configdir, F_OK ) != 0 ) - log_message( LOGLVL_WARNING, "The configuration directory %s does not exist. Configuration won't be saved.", global.conf->configdir ); - else if( access( global.conf->configdir, 06 ) != 0 ) - log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to %s.", global.conf->configdir ); - if( help_init( &(global.help) ) == NULL ) - log_message( LOGLVL_WARNING, "Error opening helpfile %s.", global.helpfile ); -} + +static void bitlbee_init(int argc, char **argv) +{ + int i = -1; + memset( &global, 0, sizeof( global_t ) ); + + global.loop = g_main_new( FALSE ); + + global.conf = conf_load( argc, argv ); + if( global.conf == NULL ) + return; + + if( global.conf->runmode == RUNMODE_INETD ) + { + i = bitlbee_inetd_init(); + log_message( LOGLVL_INFO, "Bitlbee %s starting in inetd mode.", BITLBEE_VERSION ); + + } + else if( global.conf->runmode == RUNMODE_DAEMON ) + { + i = bitlbee_daemon_init(); + log_message( LOGLVL_INFO, "Bitlbee %s starting in daemon mode.", BITLBEE_VERSION ); + } + else + { + log_message( LOGLVL_INFO, "No bitlbee mode specified..."); + } + + if( i != 0 ) + return; + + if( access( global.conf->configdir, F_OK ) != 0 ) + log_message( LOGLVL_WARNING, "The configuration directory %s does not exist. Configuration won't be saved.", global.conf->configdir ); + else if( access( global.conf->configdir, 06 ) != 0 ) + log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to %s.", global.conf->configdir ); + if( help_init( &(global.help) ) == NULL ) + log_message( LOGLVL_WARNING, "Error opening helpfile %s.", global.helpfile ); +} void service_main (DWORD argc, LPTSTR *argv) { - SERVICE_STATUS_HANDLE handle; + SERVICE_STATUS_HANDLE handle; SERVICE_STATUS status; handle = RegisterServiceCtrlHandler("bitlbee", service_ctrl); @@ -101,55 +101,55 @@ void service_main (DWORD argc, LPTSTR *argv) status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; status.dwServiceSpecificExitCode = 0; - + bitlbee_init(argc, argv); SetServiceStatus(handle, &status); g_main_run( global.loop ); } - -SERVICE_TABLE_ENTRY dispatch_table[] = -{ - { TEXT("bitlbee"), (LPSERVICE_MAIN_FUNCTION)service_main }, - { NULL, NULL } -}; - -static int debug = 0; - -static void usage() -{ - printf("Options:\n"); - printf("-h Show this help message\n"); - printf("-d Debug mode (simple console program)\n"); -} - + +SERVICE_TABLE_ENTRY dispatch_table[] = +{ + { TEXT("bitlbee"), (LPSERVICE_MAIN_FUNCTION)service_main }, + { NULL, NULL } +}; + +static int debug = 0; + +static void usage() +{ + printf("Options:\n"); + printf("-h Show this help message\n"); + printf("-d Debug mode (simple console program)\n"); +} + int main( int argc, char **argv) -{ - int i; - WSADATA WSAData; - - nogaim_init( ); - - for (i = 1; i < argc; i++) { - if (!strcmp(argv[i], "-d")) debug = 1; - if (!strcmp(argv[i], "-h")) { - usage(); - return 0; - } - } - - WSAStartup(MAKEWORD(1,1), &WSAData); - +{ + int i; + WSADATA WSAData; + + nogaim_init( ); + + for (i = 1; i < argc; i++) { + if (!strcmp(argv[i], "-d")) debug = 1; + if (!strcmp(argv[i], "-h")) { + usage(); + return 0; + } + } + + WSAStartup(MAKEWORD(1,1), &WSAData); + if (!debug) { if (!StartServiceCtrlDispatcher(dispatch_table)) - log_message( LOGLVL_ERROR, "StartServiceCtrlDispatcher failed."); - } else { - bitlbee_init(argc, argv); - g_main_run( global.loop ); + log_message( LOGLVL_ERROR, "StartServiceCtrlDispatcher failed."); + } else { + bitlbee_init(argc, argv); + g_main_run( global.loop ); } - - return 0; + + return 0; } double gettime() @@ -261,42 +261,42 @@ inet_aton(const char *cp, struct in_addr *addr) addr->s_addr = inet_addr(cp); return (addr->s_addr == INADDR_NONE) ? 0 : 1; } - -void log_error(char *msg) -{ - log_message(LOGLVL_ERROR, "%s", msg); -} + +void log_error(char *msg) +{ + log_message(LOGLVL_ERROR, "%s", msg); +} void log_message(int level, char *message, ...) { HANDLE hEventSource; - LPTSTR lpszStrings[2]; + LPTSTR lpszStrings[2]; WORD elevel; va_list ap; - va_start(ap, message); - - if (debug) { - vprintf(message, ap); - putchar('\n'); - va_end(ap); - return; + va_start(ap, message); + + if (debug) { + vprintf(message, ap); + putchar('\n'); + va_end(ap); + return; } hEventSource = RegisterEventSource(NULL, TEXT("bitlbee")); lpszStrings[0] = TEXT("bitlbee"); lpszStrings[1] = g_strdup_vprintf(message, ap); - va_end(ap); - - switch (level) { - case LOGLVL_ERROR: elevel = EVENTLOG_ERROR_TYPE; break; - case LOGLVL_WARNING: elevel = EVENTLOG_WARNING_TYPE; break; - case LOGLVL_INFO: elevel = EVENTLOG_INFORMATION_TYPE; break; -#ifdef DEBUG - case LOGLVL_DEBUG: elevel = EVENTLOG_AUDIT_SUCCESS; break; -#endif - } + va_end(ap); + + switch (level) { + case LOGLVL_ERROR: elevel = EVENTLOG_ERROR_TYPE; break; + case LOGLVL_WARNING: elevel = EVENTLOG_WARNING_TYPE; break; + case LOGLVL_INFO: elevel = EVENTLOG_INFORMATION_TYPE; break; +#ifdef DEBUG + case LOGLVL_DEBUG: elevel = EVENTLOG_AUDIT_SUCCESS; break; +#endif + } if (hEventSource != NULL) { ReportEvent(hEventSource, @@ -310,7 +310,374 @@ void log_message(int level, char *message, ...) NULL); DeregisterEventSource(hEventSource); - } - + } + g_free(lpszStrings[1]); } + +void log_link(int level, int output) { /* FIXME */ } + +#ifndef NS_INADDRSZ +#define NS_INADDRSZ 4 +#endif +#ifndef NS_IN6ADDRSZ +#define NS_IN6ADDRSZ 16 +#endif +#ifndef NS_INT16SZ +#define NS_INT16SZ 2 +#endif + +static const char *inet_ntop4(const guchar *src, char *dst, size_t size); +static const char *inet_ntop6(const guchar *src, char *dst, size_t size); + +/* char * + * inet_ntop(af, src, dst, size) + * convert a network format address to presentation format. + * return: + * pointer to presentation format address (`dst'), or NULL (see errno). + * author: + * Paul Vixie, 1996. + */ +const char * +inet_ntop(af, src, dst, size) + int af; + const void *src; + char *dst; + size_t size; +{ + switch (af) { + case AF_INET: + return (inet_ntop4(src, dst, size)); + case AF_INET6: + return (inet_ntop6(src, dst, size)); + default: + errno = WSAEAFNOSUPPORT; + return (NULL); + } + /* NOTREACHED */ +} + +/* const char * + * inet_ntop4(src, dst, size) + * format an IPv4 address + * return: + * `dst' (as a const) + * notes: + * (1) uses no statics + * (2) takes a u_char* not an in_addr as input + * author: + * Paul Vixie, 1996. + */ +static const char * +inet_ntop4(src, dst, size) + const u_char *src; + char *dst; + size_t size; +{ + static const char fmt[] = "%u.%u.%u.%u"; + char tmp[sizeof "255.255.255.255"]; + int nprinted; + + nprinted = g_snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]); + if (nprinted < 0) + return (NULL); /* we assume "errno" was set by "g_snprintf()" */ + if ((size_t)nprinted > size) { + errno = ENOSPC; + return (NULL); + } + strcpy(dst, tmp); + return (dst); +} + +/* const char * + * inet_ntop6(src, dst, size) + * convert IPv6 binary address into presentation (printable) format + * author: + * Paul Vixie, 1996. + */ +static const char * +inet_ntop6(src, dst, size) + const u_char *src; + char *dst; + size_t size; +{ + /* + * Note that int32_t and int16_t need only be "at least" large enough + * to contain a value of the specified size. On some systems, like + * Crays, there is no such thing as an integer variable with 16 bits. + * Keep this in mind if you think this function should have been coded + * to use pointer overlays. All the world's not a VAX. + */ + char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp; + struct { int base, len; } best, cur; + guint words[NS_IN6ADDRSZ / NS_INT16SZ]; + int i; + + /* + * Preprocess: + * Copy the input (bytewise) array into a wordwise array. + * Find the longest run of 0x00's in src[] for :: shorthanding. + */ + memset(words, '\0', sizeof words); + for (i = 0; i < NS_IN6ADDRSZ; i++) + words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3)); + best.base = -1; + cur.base = -1; + for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { + if (words[i] == 0) { + if (cur.base == -1) + cur.base = i, cur.len = 1; + else + cur.len++; + } else { + if (cur.base != -1) { + if (best.base == -1 || cur.len > best.len) + best = cur; + cur.base = -1; + } + } + } + if (cur.base != -1) { + if (best.base == -1 || cur.len > best.len) + best = cur; + } + if (best.base != -1 && best.len < 2) + best.base = -1; + + /* + * Format the result. + */ + tp = tmp; + for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { + /* Are we inside the best run of 0x00's? */ + if (best.base != -1 && i >= best.base && + i < (best.base + best.len)) { + if (i == best.base) + *tp++ = ':'; + continue; + } + /* Are we following an initial run of 0x00s or any real hex? */ + if (i != 0) + *tp++ = ':'; + /* Is this address an encapsulated IPv4? */ + if (i == 6 && best.base == 0 && + (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) { + if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp))) + return (NULL); + tp += strlen(tp); + break; + } + tp += g_snprintf(tp, sizeof tmp - (tp - tmp), "%x", words[i]); + } + /* Was it a trailing run of 0x00's? */ + if (best.base != -1 && (best.base + best.len) == + (NS_IN6ADDRSZ / NS_INT16SZ)) + *tp++ = ':'; + *tp++ = '\0'; + + /* + * Check for overflow, copy, and we're done. + */ + if ((size_t)(tp - tmp) > size) { + errno = ENOSPC; + return (NULL); + } + strcpy(dst, tmp); + return (dst); +} + +#ifdef AF_INET +static int inet_pton4(const char *src, u_char *dst); +#endif +#ifdef AF_INET6 +static int inet_pton6(const char *src, u_char *dst); +#endif + +/* int + * inet_pton(af, src, dst) + * convert from presentation format (which usually means ASCII printable) + * to network format (which is usually some kind of binary format). + * return: + * 1 if the address was valid for the specified address family + * 0 if the address wasn't valid (`dst' is untouched in this case) + * -1 if some other error occurred (`dst' is untouched in this case, too) + * author: + * Paul Vixie, 1996. + */ +int +inet_pton(af, src, dst) + int af; + const char *src; + void *dst; +{ + switch (af) { +#ifdef AF_INET + case AF_INET: + return (inet_pton4(src, dst)); +#endif +#ifdef AF_INET6 + case AF_INET6: + return (inet_pton6(src, dst)); +#endif + default: + errno = WSAEAFNOSUPPORT; + return (-1); + } + /* NOTREACHED */ +} + +#ifdef AF_INET +/* int + * inet_pton4(src, dst) + * like inet_aton() but without all the hexadecimal and shorthand. + * return: + * 1 if `src' is a valid dotted quad, else 0. + * notice: + * does not touch `dst' unless it's returning 1. + * author: + * Paul Vixie, 1996. + */ +static int +inet_pton4(src, dst) + const char *src; + u_char *dst; +{ + static const char digits[] = "0123456789"; + int saw_digit, octets, ch; + u_char tmp[NS_INADDRSZ], *tp; + + saw_digit = 0; + octets = 0; + *(tp = tmp) = 0; + while ((ch = *src++) != '\0') { + const char *pch; + + if ((pch = strchr(digits, ch)) != NULL) { + u_int new = *tp * 10 + (pch - digits); + + if (new > 255) + return (0); + *tp = new; + if (! saw_digit) { + if (++octets > 4) + return (0); + saw_digit = 1; + } + } else if (ch == '.' && saw_digit) { + if (octets == 4) + return (0); + *++tp = 0; + saw_digit = 0; + } else + return (0); + } + if (octets < 4) + return (0); + memcpy(dst, tmp, NS_INADDRSZ); + return (1); +} +#endif + +#ifdef AF_INET6 +/* int + * inet_pton6(src, dst) + * convert presentation level address to network order binary form. + * return: + * 1 if `src' is a valid [RFC1884 2.2] address, else 0. + * notice: + * (1) does not touch `dst' unless it's returning 1. + * (2) :: in a full address is silently ignored. + * credit: + * inspired by Mark Andrews. + * author: + * Paul Vixie, 1996. + */ +static int +inet_pton6(src, dst) + const char *src; + u_char *dst; +{ + static const char xdigits_l[] = "0123456789abcdef", + xdigits_u[] = "0123456789ABCDEF"; + u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; + const char *xdigits, *curtok; + int ch, saw_xdigit; + u_int val; + + memset((tp = tmp), '\0', NS_IN6ADDRSZ); + endp = tp + NS_IN6ADDRSZ; + colonp = NULL; + /* Leading :: requires some special handling. */ + if (*src == ':') + if (*++src != ':') + return (0); + curtok = src; + saw_xdigit = 0; + val = 0; + while ((ch = *src++) != '\0') { + const char *pch; + + if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL) + pch = strchr((xdigits = xdigits_u), ch); + if (pch != NULL) { + val <<= 4; + val |= (pch - xdigits); + if (val > 0xffff) + return (0); + saw_xdigit = 1; + continue; + } + if (ch == ':') { + curtok = src; + if (!saw_xdigit) { + if (colonp) + return (0); + colonp = tp; + continue; + } else if (*src == '\0') { + return (0); + } + if (tp + NS_INT16SZ > endp) + return (0); + *tp++ = (u_char) (val >> 8) & 0xff; + *tp++ = (u_char) val & 0xff; + saw_xdigit = 0; + val = 0; + continue; + } + if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) && + inet_pton4(curtok, tp) > 0) { + tp += NS_INADDRSZ; + saw_xdigit = 0; + break; /* '\0' was seen by inet_pton4(). */ + } + return (0); + } + if (saw_xdigit) { + if (tp + NS_INT16SZ > endp) + return (0); + *tp++ = (u_char) (val >> 8) & 0xff; + *tp++ = (u_char) val & 0xff; + } + if (colonp != NULL) { + /* + * Since some memmove()'s erroneously fail to handle + * overlapping regions, we'll do the shift by hand. + */ + const int n = tp - colonp; + int i; + + if (tp == endp) + return (0); + for (i = 1; i <= n; i++) { + endp[- i] = colonp[n - i]; + colonp[n - i] = 0; + } + tp = endp; + } + if (tp != endp) + return (0); + memcpy(dst, tmp, NS_IN6ADDRSZ); + return (1); +} +#endif -- cgit v1.2.3 From 1cda4f348372a755d99b291e6f4f9973a949f441 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 26 May 2006 17:02:09 +0200 Subject: Fix some unresolved symbols. --- ipc.c | 4 +++ irc_commands.c | 2 ++ protocols/oscar/AUTHORS | 2 -- protocols/ssl_sspi.c | 81 ++++++++++++++++++++++++++++++++----------------- 4 files changed, 59 insertions(+), 30 deletions(-) diff --git a/ipc.c b/ipc.c index a9f3ea34..c926197f 100644 --- a/ipc.c +++ b/ipc.c @@ -527,7 +527,11 @@ int ipc_master_listen_socket() return 1; } #else +int ipc_master_listen_socket() +{ /* FIXME: Open named pipe \\.\BITLBEE */ + return 0; +} #endif int ipc_master_load_state() diff --git a/irc_commands.c b/irc_commands.c index fe67a534..b33601be 100644 --- a/irc_commands.c +++ b/irc_commands.c @@ -543,7 +543,9 @@ static void irc_cmd_rehash( irc_t *irc, char **cmd ) else ipc_to_master( cmd ); +#ifndef _WIN32 irc_reply( irc, 382, "%s :Rehashing", CONF_FILE ); +#endif } static const command_t irc_commands[] = { diff --git a/protocols/oscar/AUTHORS b/protocols/oscar/AUTHORS index 5ca13988..51e8768d 100644 --- a/protocols/oscar/AUTHORS +++ b/protocols/oscar/AUTHORS @@ -27,5 +27,3 @@ N: Brock Wilcox H: awwaiid E: awwaiid@auk.cx D: Figured out original password roasting - - diff --git a/protocols/ssl_sspi.c b/protocols/ssl_sspi.c index 110f0af2..a16423b1 100644 --- a/protocols/ssl_sspi.c +++ b/protocols/ssl_sspi.c @@ -31,6 +31,7 @@ #include #include #include +#include "sock.h" static gboolean initialized = FALSE; int ssl_errno; @@ -41,52 +42,59 @@ struct scd ssl_input_function func; gpointer data; gboolean established; - int inpa; CredHandle cred; /* SSL credentials */ CtxtHandle context; /* SSL context */ SecPkgContext_StreamSizes sizes; + + char *host; + + char *pending_raw_data; + gsize pending_raw_data_len; + char *pending_data; + gsize pending_data_len; }; static void ssl_connected(gpointer, gint, GaimInputCondition); -void sspi_global_init( void ) +void sspi_global_init(void) { /* FIXME */ } -void sspi_global_deinit( void ) +void sspi_global_deinit(void) { /* FIXME */ } -void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data ) +void *ssl_connect(char *host, int port, ssl_input_function func, gpointer data) { - struct scd *conn = g_new0( struct scd, 1 ); + struct scd *conn = g_new0(struct scd, 1); - conn->fd = proxy_connect( host, port, ssl_connected, conn ); + conn->fd = proxy_connect(host, port, ssl_connected, conn); + sock_make_nonblocking(conn->fd); conn->func = func; conn->data = data; - conn->inpa = -1; + conn->host = g_strdup(host); - if( conn->fd < 0 ) + if (conn->fd < 0) { - g_free( conn ); - return( NULL ); + g_free(conn); + return NULL; } - if( !initialized ) + if (!initialized) { sspi_global_init(); initialized = TRUE; - atexit( sspi_global_deinit ); + atexit(sspi_global_deinit); } return conn; } -static void ssl_connected(gpointer data, gint fd, GaimInputCondition cond) +static void ssl_connected(gpointer _conn, gint fd, GaimInputCondition cond) { - struct scd *conn = data; + struct scd *conn = _conn; SCHANNEL_CRED ssl_cred; TimeStamp timestamp; SecBuffer ibuf[2],obuf[1]; @@ -96,6 +104,8 @@ static void ssl_connected(gpointer data, gint fd, GaimInputCondition cond) ISC_REQ_ALLOCATE_MEMORY | ISC_REQ_STREAM | ISC_REQ_EXTENDED_ERROR | ISC_REQ_MANUAL_CRED_VALIDATION; ULONG a; + gsize size = 0; + gchar *data = NULL; memset(&ssl_cred, 0, sizeof(SCHANNEL_CRED)); ssl_cred.dwVersion = SCHANNEL_CRED_VERSION; @@ -104,13 +114,13 @@ static void ssl_connected(gpointer data, gint fd, GaimInputCondition cond) SECURITY_STATUS st = AcquireCredentialsHandle(NULL, UNISP_NAME, SECPKG_CRED_OUTBOUND, NULL, &ssl_cred, NULL, NULL, &conn->cred, ×tamp); if (st != SEC_E_OK) { - conn->func( conn->data, NULL, cond ); + conn->func(conn->data, NULL, cond); return; - + } do { /* initialize buffers */ - ibuf[0].cbBuffer = size; ibuf[0].pvBuffer = buf; + ibuf[0].cbBuffer = size; ibuf[0].pvBuffer = data; ibuf[1].cbBuffer = 0; ibuf[1].pvBuffer = NULL; obuf[0].cbBuffer = 0; obuf[0].pvBuffer = NULL; ibuf[0].BufferType = obuf[0].BufferType = SECBUFFER_TOKEN; @@ -121,8 +131,9 @@ static void ssl_connected(gpointer data, gint fd, GaimInputCondition cond) ibufs.cBuffers = 2; obufs.cBuffers = 1; ibufs.pBuffers = ibuf; obufs.pBuffers = obuf; - st = InitializeSecurityContext(&conn->cred, size?&conn->context:NULL, host, req, 0, SECURITY_NETWORK_DREP, size?&ibufs:NULL, 0, &conn->context, &obufs, &a, ×tamp); + st = InitializeSecurityContext(&conn->cred, size?&conn->context:NULL, conn->host, req, 0, SECURITY_NETWORK_DREP, size?&ibufs:NULL, 0, &conn->context, &obufs, &a, ×tamp); if (obuf[0].pvBuffer && obuf[0].cbBuffer) { + /* FIXME: Check return value */ send(conn->fd, obuf[0].pvBuffer, obuf[0].cbBuffer, 0); } @@ -130,17 +141,20 @@ static void ssl_connected(gpointer data, gint fd, GaimInputCondition cond) case SEC_I_INCOMPLETE_CREDENTIALS: break; case SEC_I_CONTINUE_NEEDED: - + break; + case SEC_E_INCOMPLETE_MESSAGE: + break; + case SEC_E_OK: + break; } - QueryContextAttributes(&conn->context, SECPKG_ATTR_STREAM_SIZES, &conn->sizes); } while (1); - conn->func( conn->data, conn, cond ); + conn->func(conn->data, conn, cond); } -int ssl_read( void *conn, char *retdata, int len ) +int ssl_read(void *conn, char *retdata, int len) { struct scd *scd = conn; SecBufferDesc msg; @@ -164,6 +178,11 @@ int ssl_read( void *conn, char *retdata, int len ) SECURITY_STATUS st = DecryptMessage(&scd->context, &msg, 0, NULL); + if (st != SEC_E_OK) { + /* FIXME */ + return -1; + } + for (i = 0; i < 4; i++) { if (buf[i].BufferType == SECBUFFER_DATA) { memcpy(retdata, buf[i].pvBuffer, len); @@ -172,10 +191,10 @@ int ssl_read( void *conn, char *retdata, int len ) } g_free(data); - return( -1 ); + return -1; } -int ssl_write( void *conn, const char *userdata, int len ) +int ssl_write(void *conn, const char *userdata, int len) { struct scd *scd = conn; SecBuffer buf[4]; @@ -213,7 +232,7 @@ int ssl_write( void *conn, const char *userdata, int len ) return ret; } -void ssl_disconnect( void *conn ) +void ssl_disconnect(void *conn) { struct scd *scd = conn; @@ -243,11 +262,17 @@ void ssl_disconnect( void *conn ) FreeCredentialsHandle(&scd->cred); - closesocket( scd->fd ); + closesocket(scd->fd); + g_free(scd->host); g_free(scd); } -int ssl_getfd( void *conn ) +int ssl_getfd(void *conn) +{ + return ((struct scd*)conn)->fd; +} + +GaimInputCondition ssl_getdirection( void *conn ) { - return( ((struct scd*)conn)->fd ); + return GAIM_INPUT_WRITE; /* FIXME: or GAIM_INPUT_READ */ } -- cgit v1.2.3 From 84eddeefb197efe9a44d5a866bca209156b52257 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 26 May 2006 17:45:58 +0200 Subject: Use right pkgconfig location, trim the amount of magic. --- utils/cross-compile.win32 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/utils/cross-compile.win32 b/utils/cross-compile.win32 index 21f3551c..d4f581a0 100755 --- a/utils/cross-compile.win32 +++ b/utils/cross-compile.win32 @@ -6,18 +6,17 @@ GTK_SITE=ftp://ftp.gtk.org/pub/gtk/v2.8/win32 GLIB_VERSION=2.10.1 LIBICONV_VERSION=1.9.1 +GETTEXT_VERSION=0.14.5 wget -c $GTK_SITE/glib-dev-$GLIB_VERSION.zip wget -c $GTK_SITE/dependencies/libiconv-$LIBICONV_VERSION.bin.woe32.zip +wget -c $GTK_SITE/dependencies/gettext-dev-$GETTEXT_VERSION.zip DEPSDIR=`pwd`/win32 mkdir $DEPSDIR unzip -d $DEPSDIR -o libiconv-$LIBICONV_VERSION.bin.woe32.zip unzip -d $DEPSDIR -o glib-dev-$GLIB_VERSION.zip +unzip -d $DEPSDIR -o gettext-dev-$GETTEXT_VERSION.zip -LD=i586-mingw32msvc-ld CC=i586-mingw32msvc-gcc STRIP=i586-mingw32msvc-strip PKG_CONFIG_PATH="$DEPSDIR" PKG_CONFIG="pkg-config --define-variable=prefix=\"$DEPSDIR\"" ./configure --ssl=sspi --ipv6=0 --yahoo=0 -echo OUTFILE=bitlbee.exe >> Makefile.settings -echo ARCH=Windows >> Makefile.settings -echo LFLAGS+=-lwsock32 >> Makefile.settings -$MAKE +LD=i586-mingw32msvc-ld CC=i586-mingw32msvc-gcc STRIP=i586-mingw32msvc-strip PKG_CONFIG_PATH="$DEPSDIR/lib/pkgconfig" PKG_CONFIG="pkg-config --define-variable=prefix=\"$DEPSDIR\"" ./configure --ssl=sspi --arch=Windows -- cgit v1.2.3 From aec56b0acf7965e7ec484b76ec1902603b8b3ea5 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 26 May 2006 17:46:23 +0200 Subject: Allow overriding --arch, support --arch=Windows --- configure | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configure b/configure index cda7d8a6..2a4e3ce3 100755 --- a/configure +++ b/configure @@ -65,6 +65,8 @@ Option Description Default --ssl=... SSL library to use (gnutls, nss, openssl, sspi, bogus, auto) $ssl +--arch=... Override target architecture $arch + EOF exit; fi @@ -406,6 +408,11 @@ IRIX ) CYGWIN* ) echo 'Cygwin is not officially supported.' ;; +Windows ) + echo OUTFILE=bitlbee.exe >> Makefile.settings + echo LFLAGS+=-lwsock32 >> Makefile.settings + echo EFLAGS+=-lsecur32 >> Makefile.settings +;; * ) echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV.' echo 'Please report any problems at http://bugs.bitlbee.org/.' -- cgit v1.2.3 From fcc2da97bcfa5e0d704179fae9c4ed59cbaf79c5 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 26 May 2006 17:46:51 +0200 Subject: Remove unnecessary Windows-specific code. --- protocols/yahoo/libyahoo2.c | 2 -- protocols/yahoo/yahoo_httplib.c | 2 -- sock.h | 5 +++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/protocols/yahoo/libyahoo2.c b/protocols/yahoo/libyahoo2.c index c691f18b..967ba681 100644 --- a/protocols/yahoo/libyahoo2.c +++ b/protocols/yahoo/libyahoo2.c @@ -68,8 +68,6 @@ char *strchr (), *strrchr (); #ifdef __MINGW32__ # include -# define write(a,b,c) send(a,b,c,0) -# define read(a,b,c) recv(a,b,c,0) #endif #include diff --git a/protocols/yahoo/yahoo_httplib.c b/protocols/yahoo/yahoo_httplib.c index dbbe2a84..1b084992 100644 --- a/protocols/yahoo/yahoo_httplib.c +++ b/protocols/yahoo/yahoo_httplib.c @@ -50,8 +50,6 @@ char *strchr (), *strrchr (); #include "yahoo_debug.h" #ifdef __MINGW32__ # include -# define write(a,b,c) send(a,b,c,0) -# define read(a,b,c) recv(a,b,c,0) # define snprintf _snprintf #endif diff --git a/sock.h b/sock.h index a005bb5a..22b09306 100644 --- a/sock.h +++ b/sock.h @@ -20,12 +20,13 @@ #define closesocket(a) close(a) #else # include +# ifdef IPV6 +# include +# endif # if !defined(BITLBEE_CORE) && defined(_MSC_VER) # pragma comment(lib,"bitlbee.lib") # endif # include -# define read(a,b,c) recv(a,b,c,0) -# define write(a,b,c) send(a,b,c,0) # define sock_make_nonblocking(fd) { int non_block = 1; ioctlsocket(fd, FIONBIO, &non_block); } # define sock_make_blocking(fd) { int non_block = 0; ioctlsocket(fd, FIONBIO, &non_block); } # define sockerr_again() (WSAGetLastError() == WSAEINTR || WSAGetLastError() == WSAEINPROGRESS || WSAGetLastError() == WSAEWOULDBLOCK) -- cgit v1.2.3 From 875ad4201402b1a8f80ba22a6cdcdb152c6e5510 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 27 May 2006 17:02:22 +0200 Subject: Install glib, gettext and iconv in temporary directory --- utils/cross-compile.win32 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/utils/cross-compile.win32 b/utils/cross-compile.win32 index d4f581a0..c90ebc1b 100755 --- a/utils/cross-compile.win32 +++ b/utils/cross-compile.win32 @@ -12,8 +12,7 @@ wget -c $GTK_SITE/glib-dev-$GLIB_VERSION.zip wget -c $GTK_SITE/dependencies/libiconv-$LIBICONV_VERSION.bin.woe32.zip wget -c $GTK_SITE/dependencies/gettext-dev-$GETTEXT_VERSION.zip -DEPSDIR=`pwd`/win32 -mkdir $DEPSDIR +DEPSDIR=`mktemp -d` unzip -d $DEPSDIR -o libiconv-$LIBICONV_VERSION.bin.woe32.zip unzip -d $DEPSDIR -o glib-dev-$GLIB_VERSION.zip -- cgit v1.2.3 From 0a14b8cb44e199e39e04e04d0be1b74b660e7447 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 2 Apr 2008 17:03:37 +0200 Subject: Remove no longer needed functions. --- sock.h | 4 +- win32.c | 381 ++-------------------------------------------------------------- 2 files changed, 9 insertions(+), 376 deletions(-) diff --git a/sock.h b/sock.h index 744099d0..848dc466 100644 --- a/sock.h +++ b/sock.h @@ -15,9 +15,7 @@ #endif #else # include -# ifdef IPV6 -# include -# endif +# include # if !defined(BITLBEE_CORE) && defined(_MSC_VER) # pragma comment(lib,"bitlbee.lib") # endif diff --git a/win32.c b/win32.c index 511deb23..d741e294 100644 --- a/win32.c +++ b/win32.c @@ -55,8 +55,8 @@ static void bitlbee_init(int argc, char **argv) { int i = -1; memset( &global, 0, sizeof( global_t ) ); - - global.loop = g_main_new( FALSE ); + + b_main_init(); global.conf = conf_load( argc, argv ); if( global.conf == NULL ) @@ -85,7 +85,7 @@ static void bitlbee_init(int argc, char **argv) log_message( LOGLVL_WARNING, "The configuration directory %s does not exist. Configuration won't be saved.", global.conf->configdir ); else if( access( global.conf->configdir, 06 ) != 0 ) log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to %s.", global.conf->configdir ); - if( help_init( &(global.help) ) == NULL ) + if( help_init( &(global.help), HELP_FILE ) == NULL ) log_message( LOGLVL_WARNING, "Error opening helpfile %s.", global.helpfile ); } @@ -106,7 +106,7 @@ void service_main (DWORD argc, LPTSTR *argv) SetServiceStatus(handle, &status); - g_main_run( global.loop ); + b_main_run( ); } SERVICE_TABLE_ENTRY dispatch_table[] = @@ -146,7 +146,7 @@ int main( int argc, char **argv) log_message( LOGLVL_ERROR, "StartServiceCtrlDispatcher failed."); } else { bitlbee_init(argc, argv); - g_main_run( global.loop ); + b_main_run(); } return 0; @@ -195,12 +195,12 @@ conf_t *conf_load( int argc, char *argv[] ) RegOpenKey(key, "proxy", &key_proxy); memset( &global, 0, sizeof( global_t ) ); - global.loop = g_main_new(FALSE); + b_main_init(); conf = g_new0( conf_t,1 ); global.conf = conf; conf_get_string(key_main, "interface", "0.0.0.0", &global.conf->iface); - conf_get_int(key_main, "port", 6667, &global.conf->port); + conf_get_string(key_main, "port", "6667", &global.conf->port); conf_get_int(key_main, "verbose", 0, &global.conf->verbose); conf_get_string(key_main, "auth_pass", "", &global.conf->auth_pass); conf_get_string(key_main, "oper_pass", "", &global.conf->oper_pass); @@ -236,7 +236,7 @@ void conf_loaddefaults( irc_t *irc ) } for (i = 0; RegEnumValue(key_defaults, i, name, &namelen, NULL, &type, data, &datalen) == ERROR_SUCCESS; i++) { - set_t *s = set_find( irc, name ); + set_t *s = set_find( &irc->set, name ); if( s ) { @@ -316,368 +316,3 @@ void log_message(int level, char *message, ...) } void log_link(int level, int output) { /* FIXME */ } - -#ifndef NS_INADDRSZ -#define NS_INADDRSZ 4 -#endif -#ifndef NS_IN6ADDRSZ -#define NS_IN6ADDRSZ 16 -#endif -#ifndef NS_INT16SZ -#define NS_INT16SZ 2 -#endif - -static const char *inet_ntop4(const guchar *src, char *dst, size_t size); -static const char *inet_ntop6(const guchar *src, char *dst, size_t size); - -/* char * - * inet_ntop(af, src, dst, size) - * convert a network format address to presentation format. - * return: - * pointer to presentation format address (`dst'), or NULL (see errno). - * author: - * Paul Vixie, 1996. - */ -const char * -inet_ntop(af, src, dst, size) - int af; - const void *src; - char *dst; - size_t size; -{ - switch (af) { - case AF_INET: - return (inet_ntop4(src, dst, size)); - case AF_INET6: - return (inet_ntop6(src, dst, size)); - default: - errno = WSAEAFNOSUPPORT; - return (NULL); - } - /* NOTREACHED */ -} - -/* const char * - * inet_ntop4(src, dst, size) - * format an IPv4 address - * return: - * `dst' (as a const) - * notes: - * (1) uses no statics - * (2) takes a u_char* not an in_addr as input - * author: - * Paul Vixie, 1996. - */ -static const char * -inet_ntop4(src, dst, size) - const u_char *src; - char *dst; - size_t size; -{ - static const char fmt[] = "%u.%u.%u.%u"; - char tmp[sizeof "255.255.255.255"]; - int nprinted; - - nprinted = g_snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]); - if (nprinted < 0) - return (NULL); /* we assume "errno" was set by "g_snprintf()" */ - if ((size_t)nprinted > size) { - errno = ENOSPC; - return (NULL); - } - strcpy(dst, tmp); - return (dst); -} - -/* const char * - * inet_ntop6(src, dst, size) - * convert IPv6 binary address into presentation (printable) format - * author: - * Paul Vixie, 1996. - */ -static const char * -inet_ntop6(src, dst, size) - const u_char *src; - char *dst; - size_t size; -{ - /* - * Note that int32_t and int16_t need only be "at least" large enough - * to contain a value of the specified size. On some systems, like - * Crays, there is no such thing as an integer variable with 16 bits. - * Keep this in mind if you think this function should have been coded - * to use pointer overlays. All the world's not a VAX. - */ - char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp; - struct { int base, len; } best, cur; - guint words[NS_IN6ADDRSZ / NS_INT16SZ]; - int i; - - /* - * Preprocess: - * Copy the input (bytewise) array into a wordwise array. - * Find the longest run of 0x00's in src[] for :: shorthanding. - */ - memset(words, '\0', sizeof words); - for (i = 0; i < NS_IN6ADDRSZ; i++) - words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3)); - best.base = -1; - cur.base = -1; - for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { - if (words[i] == 0) { - if (cur.base == -1) - cur.base = i, cur.len = 1; - else - cur.len++; - } else { - if (cur.base != -1) { - if (best.base == -1 || cur.len > best.len) - best = cur; - cur.base = -1; - } - } - } - if (cur.base != -1) { - if (best.base == -1 || cur.len > best.len) - best = cur; - } - if (best.base != -1 && best.len < 2) - best.base = -1; - - /* - * Format the result. - */ - tp = tmp; - for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { - /* Are we inside the best run of 0x00's? */ - if (best.base != -1 && i >= best.base && - i < (best.base + best.len)) { - if (i == best.base) - *tp++ = ':'; - continue; - } - /* Are we following an initial run of 0x00s or any real hex? */ - if (i != 0) - *tp++ = ':'; - /* Is this address an encapsulated IPv4? */ - if (i == 6 && best.base == 0 && - (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) { - if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp))) - return (NULL); - tp += strlen(tp); - break; - } - tp += g_snprintf(tp, sizeof tmp - (tp - tmp), "%x", words[i]); - } - /* Was it a trailing run of 0x00's? */ - if (best.base != -1 && (best.base + best.len) == - (NS_IN6ADDRSZ / NS_INT16SZ)) - *tp++ = ':'; - *tp++ = '\0'; - - /* - * Check for overflow, copy, and we're done. - */ - if ((size_t)(tp - tmp) > size) { - errno = ENOSPC; - return (NULL); - } - strcpy(dst, tmp); - return (dst); -} - -#ifdef AF_INET -static int inet_pton4(const char *src, u_char *dst); -#endif -#ifdef AF_INET6 -static int inet_pton6(const char *src, u_char *dst); -#endif - -/* int - * inet_pton(af, src, dst) - * convert from presentation format (which usually means ASCII printable) - * to network format (which is usually some kind of binary format). - * return: - * 1 if the address was valid for the specified address family - * 0 if the address wasn't valid (`dst' is untouched in this case) - * -1 if some other error occurred (`dst' is untouched in this case, too) - * author: - * Paul Vixie, 1996. - */ -int -inet_pton(af, src, dst) - int af; - const char *src; - void *dst; -{ - switch (af) { -#ifdef AF_INET - case AF_INET: - return (inet_pton4(src, dst)); -#endif -#ifdef AF_INET6 - case AF_INET6: - return (inet_pton6(src, dst)); -#endif - default: - errno = WSAEAFNOSUPPORT; - return (-1); - } - /* NOTREACHED */ -} - -#ifdef AF_INET -/* int - * inet_pton4(src, dst) - * like inet_aton() but without all the hexadecimal and shorthand. - * return: - * 1 if `src' is a valid dotted quad, else 0. - * notice: - * does not touch `dst' unless it's returning 1. - * author: - * Paul Vixie, 1996. - */ -static int -inet_pton4(src, dst) - const char *src; - u_char *dst; -{ - static const char digits[] = "0123456789"; - int saw_digit, octets, ch; - u_char tmp[NS_INADDRSZ], *tp; - - saw_digit = 0; - octets = 0; - *(tp = tmp) = 0; - while ((ch = *src++) != '\0') { - const char *pch; - - if ((pch = strchr(digits, ch)) != NULL) { - u_int new = *tp * 10 + (pch - digits); - - if (new > 255) - return (0); - *tp = new; - if (! saw_digit) { - if (++octets > 4) - return (0); - saw_digit = 1; - } - } else if (ch == '.' && saw_digit) { - if (octets == 4) - return (0); - *++tp = 0; - saw_digit = 0; - } else - return (0); - } - if (octets < 4) - return (0); - memcpy(dst, tmp, NS_INADDRSZ); - return (1); -} -#endif - -#ifdef AF_INET6 -/* int - * inet_pton6(src, dst) - * convert presentation level address to network order binary form. - * return: - * 1 if `src' is a valid [RFC1884 2.2] address, else 0. - * notice: - * (1) does not touch `dst' unless it's returning 1. - * (2) :: in a full address is silently ignored. - * credit: - * inspired by Mark Andrews. - * author: - * Paul Vixie, 1996. - */ -static int -inet_pton6(src, dst) - const char *src; - u_char *dst; -{ - static const char xdigits_l[] = "0123456789abcdef", - xdigits_u[] = "0123456789ABCDEF"; - u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; - const char *xdigits, *curtok; - int ch, saw_xdigit; - u_int val; - - memset((tp = tmp), '\0', NS_IN6ADDRSZ); - endp = tp + NS_IN6ADDRSZ; - colonp = NULL; - /* Leading :: requires some special handling. */ - if (*src == ':') - if (*++src != ':') - return (0); - curtok = src; - saw_xdigit = 0; - val = 0; - while ((ch = *src++) != '\0') { - const char *pch; - - if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL) - pch = strchr((xdigits = xdigits_u), ch); - if (pch != NULL) { - val <<= 4; - val |= (pch - xdigits); - if (val > 0xffff) - return (0); - saw_xdigit = 1; - continue; - } - if (ch == ':') { - curtok = src; - if (!saw_xdigit) { - if (colonp) - return (0); - colonp = tp; - continue; - } else if (*src == '\0') { - return (0); - } - if (tp + NS_INT16SZ > endp) - return (0); - *tp++ = (u_char) (val >> 8) & 0xff; - *tp++ = (u_char) val & 0xff; - saw_xdigit = 0; - val = 0; - continue; - } - if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) && - inet_pton4(curtok, tp) > 0) { - tp += NS_INADDRSZ; - saw_xdigit = 0; - break; /* '\0' was seen by inet_pton4(). */ - } - return (0); - } - if (saw_xdigit) { - if (tp + NS_INT16SZ > endp) - return (0); - *tp++ = (u_char) (val >> 8) & 0xff; - *tp++ = (u_char) val & 0xff; - } - if (colonp != NULL) { - /* - * Since some memmove()'s erroneously fail to handle - * overlapping regions, we'll do the shift by hand. - */ - const int n = tp - colonp; - int i; - - if (tp == endp) - return (0); - for (i = 1; i <= n; i++) { - endp[- i] = colonp[n - i]; - colonp[n - i] = 0; - } - tp = endp; - } - if (tp != endp) - return (0); - memcpy(dst, tmp, NS_IN6ADDRSZ); - return (1); -} -#endif -- cgit v1.2.3 From 12ebe748ad292e10c7680f65222c5c145db8a9b3 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 9 Jun 2008 04:18:15 +0200 Subject: Deal with changes in configuration struct. --- win32.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/win32.c b/win32.c index d741e294..7808ac2e 100644 --- a/win32.c +++ b/win32.c @@ -199,7 +199,8 @@ conf_t *conf_load( int argc, char *argv[] ) conf = g_new0( conf_t,1 ); global.conf = conf; - conf_get_string(key_main, "interface", "0.0.0.0", &global.conf->iface); + conf_get_string(key_main, "interface_in", "0.0.0.0", &global.conf->iface_in); + conf_get_string(key_main, "interface_out", "0.0.0.0", &global.conf->iface_out); conf_get_string(key_main, "port", "6667", &global.conf->port); conf_get_int(key_main, "verbose", 0, &global.conf->verbose); conf_get_string(key_main, "auth_pass", "", &global.conf->auth_pass); @@ -210,7 +211,7 @@ conf_t *conf_load( int argc, char *argv[] ) conf_get_string(key_main, "motdfile", NULL, &global.conf->motdfile); conf_get_string(key_main, "helpfile", NULL, &global.helpfile); global.conf->runmode = RUNMODE_DAEMON; - conf_get_int(key_main, "AuthMode", AUTHMODE_OPEN, &global.conf->authmode); + conf_get_int(key_main, "AuthMode", AUTHMODE_OPEN, (int *)&global.conf->authmode); conf_get_string(key_proxy, "host", "", &tmp); strcpy(proxyhost, tmp); conf_get_string(key_proxy, "user", "", &tmp); strcpy(proxyuser, tmp); conf_get_string(key_proxy, "password", "", &tmp); strcpy(proxypass, tmp); -- cgit v1.2.3 From 1bf94924d6ae35c4369006ddbb6405ff0af74fe8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 9 Jun 2008 04:18:34 +0200 Subject: Use system lib directories and pkg-config directory from target when specified. --- Makefile | 2 +- configure | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 014b8450..d8b40237 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ objects = account.o bitlbee.o crypting.o help.o ipc.o irc.o irc_commands.o nick. headers = account.h bitlbee.h commands.h conf.h config.h crypting.h help.h ipc.h irc.h log.h nick.h query.h set.h sock.h storage.h user.h lib/events.h lib/http_client.h lib/ini.h lib/md5.h lib/misc.h lib/proxy.h lib/sha1.h lib/ssl_client.h lib/url.h protocols/nogaim.h subdirs = lib protocols -ifeq ($(ARCH),Windows) +ifeq ($(TARGET),i586-mingw32msvc) objects += win32.o else objects += unix.o conf.o log.o diff --git a/configure b/configure index a83bd94d..23e0a5c3 100755 --- a/configure +++ b/configure @@ -19,6 +19,7 @@ libevent='/usr/' pidfile='/var/run/bitlbee.pid' ipcsocket='/var/run/bitlbee.sock' pcdir='$prefix/lib/pkgconfig' +systemlibdirs="/lib /usr/lib /usr/local/lib" msn=1 jabber=1 @@ -108,6 +109,7 @@ CONFIG=$config INCLUDEDIR=$includedir PCDIR=$pcdir +TARGET=$target ARCH=$arch CPU=$cpu OUTFILE=bitlbee @@ -133,13 +135,18 @@ cat<config.h #define CPU "$cpu" EOF + + if [ -n "$target" ]; then - PKG_CONFIG_PATH=/usr/$target/lib/pkgconfig + PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig + export PKG_CONFIG_LIBDIR PATH=/usr/$target/bin:$PATH CC=$target-cc LD=$target-ld + systemlibdirs="/usr/$target/lib" fi + if [ "$debug" = "1" ]; then [ -z "$CFLAGS" ] && CFLAGS=-g echo 'DEBUG=1' >> Makefile.settings @@ -342,7 +349,7 @@ fi; echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings -for i in /lib /usr/lib /usr/local/lib; do +for i in $systemlibdirs; do if [ -f $i/libresolv.a ]; then echo '#define HAVE_RESOLV_A' >> config.h echo 'EFLAGS+='$i'/libresolv.a' >> Makefile.settings -- cgit v1.2.3 From 7d3ef7bbfd09ce0a8d8dbdb651fdaa862f75af21 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 10 Jun 2008 05:04:44 +0200 Subject: Fix undefined references. --- bitlbee.h | 2 ++ configure | 2 +- irc.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bitlbee.h b/bitlbee.h index d1722377..37f9a1c1 100644 --- a/bitlbee.h +++ b/bitlbee.h @@ -28,6 +28,8 @@ #define _GNU_SOURCE /* Stupid GNU :-P */ +#define _WIN32_WINNT 0x0501 + #define PACKAGE "BitlBee" #define BITLBEE_VERSION "1.2" #define VERSION BITLBEE_VERSION diff --git a/configure b/configure index 23e0a5c3..d92a2fc6 100755 --- a/configure +++ b/configure @@ -511,7 +511,7 @@ CYGWIN* ) ;; Windows ) echo OUTFILE=bitlbee.exe >> Makefile.settings - echo LFLAGS+=-lwsock32 >> Makefile.settings + echo LFLAGS+=-lws2_32 >> Makefile.settings echo EFLAGS+=-lsecur32 >> Makefile.settings ;; * ) diff --git a/irc.c b/irc.c index a6220140..c850b65c 100644 --- a/irc.c +++ b/irc.c @@ -25,6 +25,7 @@ #define BITLBEE_CORE #include "bitlbee.h" +#include "sock.h" #include "crypting.h" #include "ipc.h" -- cgit v1.2.3 From 55eda086dc21a5ed7f4e13a3b129b817d151df86 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 10 Jun 2008 05:09:33 +0200 Subject: Provide thread-unsafe replacement for gmtime_r on Windows. --- win32.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/win32.c b/win32.c index 7808ac2e..fc73b611 100644 --- a/win32.c +++ b/win32.c @@ -317,3 +317,16 @@ void log_message(int level, char *message, ...) } void log_link(int level, int output) { /* FIXME */ } + +struct tm * +gmtime_r (const time_t *timer, struct tm *result) +{ + struct tm *local_result; + local_result = gmtime (timer); + + if (local_result == NULL || result == NULL) + return NULL; + + memcpy (result, local_result, sizeof (result)); + return result; +} -- cgit v1.2.3 From 7f49a8642e162611cf20ab95955098597d1f4472 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 10 Jun 2008 05:09:49 +0200 Subject: Move random_bytes() back to lib/ --- lib/misc.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ unix.c | 65 ------------------------------------------------------------ 2 files changed, 67 insertions(+), 65 deletions(-) diff --git a/lib/misc.c b/lib/misc.c index 1670b91d..0998b7e2 100644 --- a/lib/misc.c +++ b/lib/misc.c @@ -391,6 +391,73 @@ signed int do_iconv( char *from_cs, char *to_cs, char *src, char *dst, size_t si return( outbuf - dst ); } +/* A pretty reliable random number generator. Tries to use the /dev/random + devices first, and falls back to the random number generator from libc + when it fails. Opens randomizer devices with O_NONBLOCK to make sure a + lack of entropy won't halt BitlBee. */ +void random_bytes( unsigned char *buf, int count ) +{ +#ifndef _WIN32 + static int use_dev = -1; + + /* Actually this probing code isn't really necessary, is it? */ + if( use_dev == -1 ) + { + if( access( "/dev/random", R_OK ) == 0 || access( "/dev/urandom", R_OK ) == 0 ) + use_dev = 1; + else + { + use_dev = 0; + srand( ( getpid() << 16 ) ^ time( NULL ) ); + } + } + + if( use_dev ) + { + int fd; + + /* At least on Linux, /dev/random can block if there's not + enough entropy. We really don't want that, so if it can't + give anything, use /dev/urandom instead. */ + if( ( fd = open( "/dev/random", O_RDONLY | O_NONBLOCK ) ) >= 0 ) + if( read( fd, buf, count ) == count ) + { + close( fd ); + return; + } + close( fd ); + + /* urandom isn't supposed to block at all, but just to be + sure. If it blocks, we'll disable use_dev and use the libc + randomizer instead. */ + if( ( fd = open( "/dev/urandom", O_RDONLY | O_NONBLOCK ) ) >= 0 ) + if( read( fd, buf, count ) == count ) + { + close( fd ); + return; + } + close( fd ); + + /* If /dev/random blocks once, we'll still try to use it + again next time. If /dev/urandom also fails for some + reason, stick with libc during this session. */ + + use_dev = 0; + srand( ( getpid() << 16 ) ^ time( NULL ) ); + } + + if( !use_dev ) +#endif + { + int i; + + /* Possibly the LSB of rand() isn't very random on some + platforms. Seems okay on at least Linux and OSX though. */ + for( i = 0; i < count; i ++ ) + buf[i] = rand() & 0xff; + } +} + int is_bool( char *value ) { if( *value == 0 ) diff --git a/unix.c b/unix.c index f90f03b9..0566fa56 100644 --- a/unix.c +++ b/unix.c @@ -225,69 +225,4 @@ double gettime() return( (double) time->tv_sec + (double) time->tv_usec / 1000000 ); } -/* A pretty reliable random number generator. Tries to use the /dev/random - devices first, and falls back to the random number generator from libc - when it fails. Opens randomizer devices with O_NONBLOCK to make sure a - lack of entropy won't halt BitlBee. */ -void random_bytes( unsigned char *buf, int count ) -{ - static int use_dev = -1; - - /* Actually this probing code isn't really necessary, is it? */ - if( use_dev == -1 ) - { - if( access( "/dev/random", R_OK ) == 0 || access( "/dev/urandom", R_OK ) == 0 ) - use_dev = 1; - else - { - use_dev = 0; - srand( ( getpid() << 16 ) ^ time( NULL ) ); - } - } - - if( use_dev ) - { - int fd; - - /* At least on Linux, /dev/random can block if there's not - enough entropy. We really don't want that, so if it can't - give anything, use /dev/urandom instead. */ - if( ( fd = open( "/dev/random", O_RDONLY | O_NONBLOCK ) ) >= 0 ) - if( read( fd, buf, count ) == count ) - { - close( fd ); - return; - } - close( fd ); - - /* urandom isn't supposed to block at all, but just to be - sure. If it blocks, we'll disable use_dev and use the libc - randomizer instead. */ - if( ( fd = open( "/dev/urandom", O_RDONLY | O_NONBLOCK ) ) >= 0 ) - if( read( fd, buf, count ) == count ) - { - close( fd ); - return; - } - close( fd ); - - /* If /dev/random blocks once, we'll still try to use it - again next time. If /dev/urandom also fails for some - reason, stick with libc during this session. */ - - use_dev = 0; - srand( ( getpid() << 16 ) ^ time( NULL ) ); - } - - if( !use_dev ) - { - int i; - - /* Possibly the LSB of rand() isn't very random on some - platforms. Seems okay on at least Linux and OSX though. */ - for( i = 0; i < count; i ++ ) - buf[i] = rand() & 0xff; - } -} - -- cgit v1.2.3 From fde7b91536d2d0f5bc8e3e2226fba2188f038fb4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 10 Jun 2008 05:10:03 +0200 Subject: Implement ssl_pending() in bogus ssl backend. --- lib/ssl_bogus.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ssl_bogus.c b/lib/ssl_bogus.c index 5bae3496..a07ea752 100644 --- a/lib/ssl_bogus.c +++ b/lib/ssl_bogus.c @@ -60,3 +60,8 @@ b_input_condition ssl_getdirection( void *conn ) { return GAIM_INPUT_READ; } + +int ssl_pending( void *conn ) +{ + return 0; +} -- cgit v1.2.3 From 8a4ae0da867a142dff6f5c96b6c460b725199ba0 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 10 Jun 2008 05:13:21 +0200 Subject: Ignore windows executable. --- .bzrignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.bzrignore b/.bzrignore index 77270c00..71ec8c68 100644 --- a/.bzrignore +++ b/.bzrignore @@ -27,3 +27,4 @@ tests/check *.o coverage bitlbee.info +bitlbee.exe -- cgit v1.2.3 From 21e5d4981de057bae5261720021757d893061652 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 10 Jun 2008 05:16:15 +0200 Subject: Move SSPI SSL implementation to same directory as other SSL backends. --- lib/ssl_sspi.c | 278 +++++++++++++++++++++++++++++++++++++++++++++++++++ protocols/ssl_sspi.c | 278 --------------------------------------------------- 2 files changed, 278 insertions(+), 278 deletions(-) create mode 100644 lib/ssl_sspi.c delete mode 100644 protocols/ssl_sspi.c diff --git a/lib/ssl_sspi.c b/lib/ssl_sspi.c new file mode 100644 index 00000000..a16423b1 --- /dev/null +++ b/lib/ssl_sspi.c @@ -0,0 +1,278 @@ + /********************************************************************\ + * BitlBee -- An IRC to other IM-networks gateway * + * * + * Copyright 2002-2004 Wilmer van der Gaast and others * + \********************************************************************/ + +/* SSL module - SSPI backend */ + +/* Copyright (C) 2005 Jelmer Vernooij */ + +/* + 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 with + the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL; + if not, write to the Free Software Foundation, Inc., 59 Temple Place, + Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "ssl_client.h" +#include +#define SECURITY_WIN32 +#include +#include +#include +#include "sock.h" + +static gboolean initialized = FALSE; +int ssl_errno; + +struct scd +{ + int fd; + ssl_input_function func; + gpointer data; + gboolean established; + CredHandle cred; /* SSL credentials */ + CtxtHandle context; /* SSL context */ + SecPkgContext_StreamSizes sizes; + + char *host; + + char *pending_raw_data; + gsize pending_raw_data_len; + char *pending_data; + gsize pending_data_len; +}; + +static void ssl_connected(gpointer, gint, GaimInputCondition); + +void sspi_global_init(void) +{ + /* FIXME */ +} + +void sspi_global_deinit(void) +{ + /* FIXME */ +} + +void *ssl_connect(char *host, int port, ssl_input_function func, gpointer data) +{ + struct scd *conn = g_new0(struct scd, 1); + + conn->fd = proxy_connect(host, port, ssl_connected, conn); + sock_make_nonblocking(conn->fd); + conn->func = func; + conn->data = data; + conn->host = g_strdup(host); + + if (conn->fd < 0) + { + g_free(conn); + return NULL; + } + + if (!initialized) + { + sspi_global_init(); + initialized = TRUE; + atexit(sspi_global_deinit); + } + + return conn; +} + +static void ssl_connected(gpointer _conn, gint fd, GaimInputCondition cond) +{ + struct scd *conn = _conn; + SCHANNEL_CRED ssl_cred; + TimeStamp timestamp; + SecBuffer ibuf[2],obuf[1]; + SecBufferDesc ibufs,obufs; + ULONG req = ISC_REQ_REPLAY_DETECT | ISC_REQ_SEQUENCE_DETECT | + ISC_REQ_CONFIDENTIALITY | ISC_REQ_USE_SESSION_KEY | + ISC_REQ_ALLOCATE_MEMORY | ISC_REQ_STREAM | ISC_REQ_EXTENDED_ERROR | + ISC_REQ_MANUAL_CRED_VALIDATION; + ULONG a; + gsize size = 0; + gchar *data = NULL; + + memset(&ssl_cred, 0, sizeof(SCHANNEL_CRED)); + ssl_cred.dwVersion = SCHANNEL_CRED_VERSION; + ssl_cred.grbitEnabledProtocols = SP_PROT_SSL3_CLIENT; + + SECURITY_STATUS st = AcquireCredentialsHandle(NULL, UNISP_NAME, SECPKG_CRED_OUTBOUND, NULL, &ssl_cred, NULL, NULL, &conn->cred, ×tamp); + + if (st != SEC_E_OK) { + conn->func(conn->data, NULL, cond); + return; + } + + do { + /* initialize buffers */ + ibuf[0].cbBuffer = size; ibuf[0].pvBuffer = data; + ibuf[1].cbBuffer = 0; ibuf[1].pvBuffer = NULL; + obuf[0].cbBuffer = 0; obuf[0].pvBuffer = NULL; + ibuf[0].BufferType = obuf[0].BufferType = SECBUFFER_TOKEN; + ibuf[1].BufferType = SECBUFFER_EMPTY; + + /* initialize buffer descriptors */ + ibufs.ulVersion = obufs.ulVersion = SECBUFFER_VERSION; + ibufs.cBuffers = 2; obufs.cBuffers = 1; + ibufs.pBuffers = ibuf; obufs.pBuffers = obuf; + + st = InitializeSecurityContext(&conn->cred, size?&conn->context:NULL, conn->host, req, 0, SECURITY_NETWORK_DREP, size?&ibufs:NULL, 0, &conn->context, &obufs, &a, ×tamp); + if (obuf[0].pvBuffer && obuf[0].cbBuffer) { + /* FIXME: Check return value */ + send(conn->fd, obuf[0].pvBuffer, obuf[0].cbBuffer, 0); + } + + switch (st) { + case SEC_I_INCOMPLETE_CREDENTIALS: + break; + case SEC_I_CONTINUE_NEEDED: + break; + case SEC_E_INCOMPLETE_MESSAGE: + break; + case SEC_E_OK: + break; + } + + QueryContextAttributes(&conn->context, SECPKG_ATTR_STREAM_SIZES, &conn->sizes); + } while (1); + + conn->func(conn->data, conn, cond); +} + +int ssl_read(void *conn, char *retdata, int len) +{ + struct scd *scd = conn; + SecBufferDesc msg; + SecBuffer buf[4]; + int ret = -1, i; + char *data = g_malloc(scd->sizes.cbHeader + scd->sizes.cbMaximumMessage + scd->sizes.cbTrailer); + + /* FIXME: Try to read some data */ + + msg.ulVersion = SECBUFFER_VERSION; + msg.cBuffers = 4; + msg.pBuffers = buf; + + buf[0].BufferType = SECBUFFER_DATA; + buf[0].cbBuffer = len; + buf[0].pvBuffer = data; + + buf[1].BufferType = SECBUFFER_EMPTY; + buf[2].BufferType = SECBUFFER_EMPTY; + buf[3].BufferType = SECBUFFER_EMPTY; + + SECURITY_STATUS st = DecryptMessage(&scd->context, &msg, 0, NULL); + + if (st != SEC_E_OK) { + /* FIXME */ + return -1; + } + + for (i = 0; i < 4; i++) { + if (buf[i].BufferType == SECBUFFER_DATA) { + memcpy(retdata, buf[i].pvBuffer, len); + ret = len; + } + } + + g_free(data); + return -1; +} + +int ssl_write(void *conn, const char *userdata, int len) +{ + struct scd *scd = conn; + SecBuffer buf[4]; + SecBufferDesc msg; + char *data; + int ret; + + msg.ulVersion = SECBUFFER_VERSION; + msg.cBuffers = 4; + msg.pBuffers = buf; + + data = g_malloc(scd->sizes.cbHeader + scd->sizes.cbMaximumMessage + scd->sizes.cbTrailer); + memcpy(data + scd->sizes.cbHeader, userdata, len); + + buf[0].BufferType = SECBUFFER_STREAM_HEADER; + buf[0].cbBuffer = scd->sizes.cbHeader; + buf[0].pvBuffer = data; + + buf[1].BufferType = SECBUFFER_DATA; + buf[1].cbBuffer = len; + buf[1].pvBuffer = data + scd->sizes.cbHeader; + + buf[2].BufferType = SECBUFFER_STREAM_TRAILER; + buf[2].cbBuffer = scd->sizes.cbTrailer; + buf[2].pvBuffer = data + scd->sizes.cbHeader + len; + buf[3].BufferType = SECBUFFER_EMPTY; + + SECURITY_STATUS st = EncryptMessage(&scd->context, 0, &msg, 0); + + ret = send(scd->fd, data, + buf[0].cbBuffer + buf[1].cbBuffer + buf[2].cbBuffer, 0); + + g_free(data); + + return ret; +} + +void ssl_disconnect(void *conn) +{ + struct scd *scd = conn; + + SecBufferDesc msg; + SecBuffer buf; + DWORD dw; + + dw = SCHANNEL_SHUTDOWN; + buf.cbBuffer = sizeof(dw); + buf.BufferType = SECBUFFER_TOKEN; + buf.pvBuffer = &dw; + + msg.ulVersion = SECBUFFER_VERSION; + msg.cBuffers = 1; + msg.pBuffers = &buf; + + SECURITY_STATUS st = ApplyControlToken(&scd->context, &msg); + + if (st != SEC_E_OK) { + /* FIXME */ + } + + /* FIXME: call InitializeSecurityContext(Schannel), passing + * in empty buffers*/ + + DeleteSecurityContext(&scd->context); + + FreeCredentialsHandle(&scd->cred); + + closesocket(scd->fd); + g_free(scd->host); + g_free(scd); +} + +int ssl_getfd(void *conn) +{ + return ((struct scd*)conn)->fd; +} + +GaimInputCondition ssl_getdirection( void *conn ) +{ + return GAIM_INPUT_WRITE; /* FIXME: or GAIM_INPUT_READ */ +} diff --git a/protocols/ssl_sspi.c b/protocols/ssl_sspi.c deleted file mode 100644 index a16423b1..00000000 --- a/protocols/ssl_sspi.c +++ /dev/null @@ -1,278 +0,0 @@ - /********************************************************************\ - * BitlBee -- An IRC to other IM-networks gateway * - * * - * Copyright 2002-2004 Wilmer van der Gaast and others * - \********************************************************************/ - -/* SSL module - SSPI backend */ - -/* Copyright (C) 2005 Jelmer Vernooij */ - -/* - 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 with - the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL; - if not, write to the Free Software Foundation, Inc., 59 Temple Place, - Suite 330, Boston, MA 02111-1307 USA -*/ - -#include "ssl_client.h" -#include -#define SECURITY_WIN32 -#include -#include -#include -#include "sock.h" - -static gboolean initialized = FALSE; -int ssl_errno; - -struct scd -{ - int fd; - ssl_input_function func; - gpointer data; - gboolean established; - CredHandle cred; /* SSL credentials */ - CtxtHandle context; /* SSL context */ - SecPkgContext_StreamSizes sizes; - - char *host; - - char *pending_raw_data; - gsize pending_raw_data_len; - char *pending_data; - gsize pending_data_len; -}; - -static void ssl_connected(gpointer, gint, GaimInputCondition); - -void sspi_global_init(void) -{ - /* FIXME */ -} - -void sspi_global_deinit(void) -{ - /* FIXME */ -} - -void *ssl_connect(char *host, int port, ssl_input_function func, gpointer data) -{ - struct scd *conn = g_new0(struct scd, 1); - - conn->fd = proxy_connect(host, port, ssl_connected, conn); - sock_make_nonblocking(conn->fd); - conn->func = func; - conn->data = data; - conn->host = g_strdup(host); - - if (conn->fd < 0) - { - g_free(conn); - return NULL; - } - - if (!initialized) - { - sspi_global_init(); - initialized = TRUE; - atexit(sspi_global_deinit); - } - - return conn; -} - -static void ssl_connected(gpointer _conn, gint fd, GaimInputCondition cond) -{ - struct scd *conn = _conn; - SCHANNEL_CRED ssl_cred; - TimeStamp timestamp; - SecBuffer ibuf[2],obuf[1]; - SecBufferDesc ibufs,obufs; - ULONG req = ISC_REQ_REPLAY_DETECT | ISC_REQ_SEQUENCE_DETECT | - ISC_REQ_CONFIDENTIALITY | ISC_REQ_USE_SESSION_KEY | - ISC_REQ_ALLOCATE_MEMORY | ISC_REQ_STREAM | ISC_REQ_EXTENDED_ERROR | - ISC_REQ_MANUAL_CRED_VALIDATION; - ULONG a; - gsize size = 0; - gchar *data = NULL; - - memset(&ssl_cred, 0, sizeof(SCHANNEL_CRED)); - ssl_cred.dwVersion = SCHANNEL_CRED_VERSION; - ssl_cred.grbitEnabledProtocols = SP_PROT_SSL3_CLIENT; - - SECURITY_STATUS st = AcquireCredentialsHandle(NULL, UNISP_NAME, SECPKG_CRED_OUTBOUND, NULL, &ssl_cred, NULL, NULL, &conn->cred, ×tamp); - - if (st != SEC_E_OK) { - conn->func(conn->data, NULL, cond); - return; - } - - do { - /* initialize buffers */ - ibuf[0].cbBuffer = size; ibuf[0].pvBuffer = data; - ibuf[1].cbBuffer = 0; ibuf[1].pvBuffer = NULL; - obuf[0].cbBuffer = 0; obuf[0].pvBuffer = NULL; - ibuf[0].BufferType = obuf[0].BufferType = SECBUFFER_TOKEN; - ibuf[1].BufferType = SECBUFFER_EMPTY; - - /* initialize buffer descriptors */ - ibufs.ulVersion = obufs.ulVersion = SECBUFFER_VERSION; - ibufs.cBuffers = 2; obufs.cBuffers = 1; - ibufs.pBuffers = ibuf; obufs.pBuffers = obuf; - - st = InitializeSecurityContext(&conn->cred, size?&conn->context:NULL, conn->host, req, 0, SECURITY_NETWORK_DREP, size?&ibufs:NULL, 0, &conn->context, &obufs, &a, ×tamp); - if (obuf[0].pvBuffer && obuf[0].cbBuffer) { - /* FIXME: Check return value */ - send(conn->fd, obuf[0].pvBuffer, obuf[0].cbBuffer, 0); - } - - switch (st) { - case SEC_I_INCOMPLETE_CREDENTIALS: - break; - case SEC_I_CONTINUE_NEEDED: - break; - case SEC_E_INCOMPLETE_MESSAGE: - break; - case SEC_E_OK: - break; - } - - QueryContextAttributes(&conn->context, SECPKG_ATTR_STREAM_SIZES, &conn->sizes); - } while (1); - - conn->func(conn->data, conn, cond); -} - -int ssl_read(void *conn, char *retdata, int len) -{ - struct scd *scd = conn; - SecBufferDesc msg; - SecBuffer buf[4]; - int ret = -1, i; - char *data = g_malloc(scd->sizes.cbHeader + scd->sizes.cbMaximumMessage + scd->sizes.cbTrailer); - - /* FIXME: Try to read some data */ - - msg.ulVersion = SECBUFFER_VERSION; - msg.cBuffers = 4; - msg.pBuffers = buf; - - buf[0].BufferType = SECBUFFER_DATA; - buf[0].cbBuffer = len; - buf[0].pvBuffer = data; - - buf[1].BufferType = SECBUFFER_EMPTY; - buf[2].BufferType = SECBUFFER_EMPTY; - buf[3].BufferType = SECBUFFER_EMPTY; - - SECURITY_STATUS st = DecryptMessage(&scd->context, &msg, 0, NULL); - - if (st != SEC_E_OK) { - /* FIXME */ - return -1; - } - - for (i = 0; i < 4; i++) { - if (buf[i].BufferType == SECBUFFER_DATA) { - memcpy(retdata, buf[i].pvBuffer, len); - ret = len; - } - } - - g_free(data); - return -1; -} - -int ssl_write(void *conn, const char *userdata, int len) -{ - struct scd *scd = conn; - SecBuffer buf[4]; - SecBufferDesc msg; - char *data; - int ret; - - msg.ulVersion = SECBUFFER_VERSION; - msg.cBuffers = 4; - msg.pBuffers = buf; - - data = g_malloc(scd->sizes.cbHeader + scd->sizes.cbMaximumMessage + scd->sizes.cbTrailer); - memcpy(data + scd->sizes.cbHeader, userdata, len); - - buf[0].BufferType = SECBUFFER_STREAM_HEADER; - buf[0].cbBuffer = scd->sizes.cbHeader; - buf[0].pvBuffer = data; - - buf[1].BufferType = SECBUFFER_DATA; - buf[1].cbBuffer = len; - buf[1].pvBuffer = data + scd->sizes.cbHeader; - - buf[2].BufferType = SECBUFFER_STREAM_TRAILER; - buf[2].cbBuffer = scd->sizes.cbTrailer; - buf[2].pvBuffer = data + scd->sizes.cbHeader + len; - buf[3].BufferType = SECBUFFER_EMPTY; - - SECURITY_STATUS st = EncryptMessage(&scd->context, 0, &msg, 0); - - ret = send(scd->fd, data, - buf[0].cbBuffer + buf[1].cbBuffer + buf[2].cbBuffer, 0); - - g_free(data); - - return ret; -} - -void ssl_disconnect(void *conn) -{ - struct scd *scd = conn; - - SecBufferDesc msg; - SecBuffer buf; - DWORD dw; - - dw = SCHANNEL_SHUTDOWN; - buf.cbBuffer = sizeof(dw); - buf.BufferType = SECBUFFER_TOKEN; - buf.pvBuffer = &dw; - - msg.ulVersion = SECBUFFER_VERSION; - msg.cBuffers = 1; - msg.pBuffers = &buf; - - SECURITY_STATUS st = ApplyControlToken(&scd->context, &msg); - - if (st != SEC_E_OK) { - /* FIXME */ - } - - /* FIXME: call InitializeSecurityContext(Schannel), passing - * in empty buffers*/ - - DeleteSecurityContext(&scd->context); - - FreeCredentialsHandle(&scd->cred); - - closesocket(scd->fd); - g_free(scd->host); - g_free(scd); -} - -int ssl_getfd(void *conn) -{ - return ((struct scd*)conn)->fd; -} - -GaimInputCondition ssl_getdirection( void *conn ) -{ - return GAIM_INPUT_WRITE; /* FIXME: or GAIM_INPUT_READ */ -} -- cgit v1.2.3 From 73c2dce8961e937e97c78f0b8b0ee4abd347756b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 10 Jun 2008 05:21:13 +0200 Subject: Update docs, remove obsolete win32-related utilities. --- .bzrignore | 9 --- Makefile | 2 + configure | 2 - doc/BUILD.win32 | 37 ++----------- utils/cross-compile.win32 | 21 ------- win32.mk | 136 ---------------------------------------------- 6 files changed, 8 insertions(+), 199 deletions(-) delete mode 100755 utils/cross-compile.win32 delete mode 100644 win32.mk diff --git a/.bzrignore b/.bzrignore index 71ec8c68..0312b204 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1,15 +1,6 @@ Makefile.settings config.h bitlbee -Debug -Debugx -deps -admin/Debug -admin/admin.plg -bitlbee.plg -*.plg -*.aps -*.clw user-guide.txt user-guide.html help.txt diff --git a/Makefile b/Makefile index d8b40237..fa202ef1 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,8 @@ subdirs = lib protocols ifeq ($(TARGET),i586-mingw32msvc) objects += win32.o +LFLAGS+=-lws2_32 +EFLAGS+=-lsecur32 else objects += unix.o conf.o log.o endif diff --git a/configure b/configure index d92a2fc6..62f0f5d9 100755 --- a/configure +++ b/configure @@ -511,8 +511,6 @@ CYGWIN* ) ;; Windows ) echo OUTFILE=bitlbee.exe >> Makefile.settings - echo LFLAGS+=-lws2_32 >> Makefile.settings - echo EFLAGS+=-lsecur32 >> Makefile.settings ;; * ) echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV.' diff --git a/doc/BUILD.win32 b/doc/BUILD.win32 index e00cfdda..e1afe600 100644 --- a/doc/BUILD.win32 +++ b/doc/BUILD.win32 @@ -1,35 +1,10 @@ -Instructions for building BitlBee on Windows -================================================ +Instructions for building BitlBee for Windows +============================================= -1. Download the latest version using bzr (http://www.bazaar-ng.org/): +1) Install the mingw32 compiler - H:\> bzr branch http://win32.bitlbee.org/bzr bitlbee-win32 - ... +2) Compile GLib2 for the target i586-mingw32msvc -2. Download and install the required development files: - from ftp://ftp.gtk.org/pub/gtk/v2.8/win32/ - - glib - - glib-dev - - libiconv (in dependencies/) - - gettext (in dependencies/) - from http://ftp.mozilla.org/pub/mozilla.org/ - - nss (in security/nss/) - - nspr (in nspr/) +3) Cross-compile BitlBee: - glib and gettext are only required for actually running BitlBee - building - should work fine without them. - -3. Set the following variables in Makefile.settings, if you don't have the - libraries above installed in the default directories searched by MSVC: - - - GLIB_DIR - - NSS_DIR - - NSPR_DIR - -4. Build: - - H:\BitlBee> nmake /f win32.mk - ... - -5. To build setup files, compile the bitlbee.iss file using the Inno Setup - program (available from www.jrsoftware.org). +$ ./configure --target=i586-mingw32msvc --ssl=bogus --arch=Windows diff --git a/utils/cross-compile.win32 b/utils/cross-compile.win32 deleted file mode 100755 index c90ebc1b..00000000 --- a/utils/cross-compile.win32 +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# Simple cross compilation script for BitlBee using mingw32 -# (C) Jelmer Vernooij 2005-2006 - -GTK_SITE=ftp://ftp.gtk.org/pub/gtk/v2.8/win32 - -GLIB_VERSION=2.10.1 -LIBICONV_VERSION=1.9.1 -GETTEXT_VERSION=0.14.5 - -wget -c $GTK_SITE/glib-dev-$GLIB_VERSION.zip -wget -c $GTK_SITE/dependencies/libiconv-$LIBICONV_VERSION.bin.woe32.zip -wget -c $GTK_SITE/dependencies/gettext-dev-$GETTEXT_VERSION.zip - -DEPSDIR=`mktemp -d` - -unzip -d $DEPSDIR -o libiconv-$LIBICONV_VERSION.bin.woe32.zip -unzip -d $DEPSDIR -o glib-dev-$GLIB_VERSION.zip -unzip -d $DEPSDIR -o gettext-dev-$GETTEXT_VERSION.zip - -LD=i586-mingw32msvc-ld CC=i586-mingw32msvc-gcc STRIP=i586-mingw32msvc-strip PKG_CONFIG_PATH="$DEPSDIR/lib/pkgconfig" PKG_CONFIG="pkg-config --define-variable=prefix=\"$DEPSDIR\"" ./configure --ssl=sspi --arch=Windows diff --git a/win32.mk b/win32.mk deleted file mode 100644 index 59ca7a81..00000000 --- a/win32.mk +++ /dev/null @@ -1,136 +0,0 @@ -!INCLUDE Makefile.settings - -GLIB_CFLAGS = /I "$(GLIB_DIR)\include" \ - /I "$(GLIB_DIR)\include\glib-2.0" \ - /I "$(GLIB_DIR)\lib\glib-2.0\include" - -GLIB_LFLAGS = /libpath:"$(GLIB_DIR)\lib" - -NSS_CFLAGS = /I "$(NSS_DIR)\include" /I "$(NSPR_DIR)\include" -NSS_LFLAGS = /libpath:"$(NSS_DIR)\lib" /libpath:"$(NSPR_DIR)\lib" -NSS_LIBS = nss3.lib ssl3.lib libnspr4.lib - -COMMON_LIBS = kernel32.lib user32.lib advapi32.lib shell32.lib iconv.lib \ - glib-2.0.lib gmodule-2.0.lib wsock32.lib advapi32.lib - - -MAIN_OBJS = account.obj bitlbee.obj commands.obj crypting.obj \ - help.obj irc.obj protocols\md5.obj protocols\nogaim.obj \ - protocols\sha.obj protocols\proxy.obj query.obj nick.obj set.obj \ - user.obj protocols\util.obj win32.obj - -MAIN_LIBS = $(COMMON_LIBS) - -SSL_OBJS = protocols\ssl_nss.obj -SSL_LIBS = $(NSS_LFLAGS) $(NSS_LIBS) - -MSN_OBJS = \ - protocols\msn\msn.obj \ - protocols\msn\msn_util.obj \ - protocols\msn\ns.obj \ - protocols\msn\passport.obj \ - protocols\msn\sb.obj \ - protocols\msn\tables.obj \ - $(SSL_OBJS) - -MSN_LIBS = $(COMMON_LIBS) $(SSL_LIBS) - -OSCAR_OBJS = \ - protocols\oscar\admin.obj \ - protocols\oscar\auth.obj \ - protocols\oscar\bos.obj \ - protocols\oscar\buddylist.obj \ - protocols\oscar\chat.obj \ - protocols\oscar\chatnav.obj \ - protocols\oscar\conn.obj \ - protocols\oscar\icq.obj \ - protocols\oscar\im.obj \ - protocols\oscar\info.obj \ - protocols\oscar\misc.obj \ - protocols\oscar\msgcookie.obj \ - protocols\oscar\oscar.obj \ - protocols\oscar\oscar_util.obj \ - protocols\oscar\rxhandlers.obj \ - protocols\oscar\rxqueue.obj \ - protocols\oscar\search.obj \ - protocols\oscar\service.obj \ - protocols\oscar\snac.obj \ - protocols\oscar\ssi.obj \ - protocols\oscar\stats.obj \ - protocols\oscar\tlv.obj \ - protocols\oscar\txqueue.obj - -OSCAR_LIBS = $(COMMON_LIBS) - -JABBER_OBJS = \ - protocols\jabber\expat.obj \ - protocols\jabber\genhash.obj \ - protocols\jabber\hashtable.obj \ - protocols\jabber\jabber.obj \ - protocols\jabber\jconn.obj \ - protocols\jabber\jid.obj \ - protocols\jabber\jpacket.obj \ - protocols\jabber\jutil.obj \ - protocols\jabber\karma.obj \ - protocols\jabber\log.obj \ - protocols\jabber\pool.obj \ - protocols\jabber\pproxy.obj \ - protocols\jabber\rate.obj \ - protocols\jabber\str.obj \ - protocols\jabber\xhash.obj \ - protocols\jabber\xmlnode.obj \ - protocols\jabber\xmlparse.obj \ - protocols\jabber\xmlrole.obj \ - protocols\jabber\xmltok.obj \ - protocols\jabber\xstream.obj \ - $(SSL_OBJS) - -JABBER_LIBS = $(COMMON_LIBS) $(SSL_LIBS) - -YAHOO_OBJS = \ - protocols\yahoo\crypt.obj \ - protocols\yahoo\libyahoo2.obj \ - protocols\yahoo\vc50.idb \ - protocols\yahoo\yahoo.obj \ - protocols\yahoo\yahoo_fn.obj \ - protocols\yahoo\yahoo_httplib.obj \ - protocols\yahoo\yahoo_list.obj \ - protocols\yahoo\yahoo_util.obj - -YAHOO_LIBS = $(COMMON_LIBS) - -CC=cl.exe -CFLAGS=$(GLIB_CFLAGS) $(NSS_CFLAGS) /D NDEBUG /D WIN32 /D _WINDOWS \ - /I . /I protocols /I protocols\oscar /nologo \ - /D GLIB2 /D ARCH="\"Windows\"" /D CPU="\"x86\"" \ - /D PLUGINDIR="plugins" - -.c.obj: - $(CC) $(CFLAGS) /c /Fo$@ $< - -ALL: bitlbee.exe libmsn.dll liboscar.dll libjabber.dll libyahoo.dll - -LINK32=link.exe -LINK32_FLAGS=/nologo $(GLIB_LFLAGS) - -bitlbee.exe: $(DEF_FILE) $(MAIN_OBJS) - $(LINK32) $(MAIN_LIBS) $(LINK32_FLAGS) /out:bitlbee.exe $(MAIN_OBJS) - -libmsn.dll: $(MSN_OBJS) - $(LINK32) /DLL /SUBSYSTEM:WINDOWS /ENTRY:msn_init $(MSN_LIBS) $(LINK32_FLAGS) /out:libmsn.dll $(MSN_OBJS) - -libyahoo.dll: $(YAHOO_OBJS) - $(LINK32) /DLL /SUBSYSTEM:WINDOWS /ENTRY:yahoo_init $(YAHOO_LIBS) $(LINK32_FLAGS) /out:libyahoo.dll $(YAHOO_OBJS) - -liboscar.dll: $(OSCAR_OBJS) - $(LINK32) /DLL /SUBSYSTEM:WINDOWS /ENTRY:oscar_init $(OSCAR_LIBS) $(LINK32_FLAGS) /out:liboscar.dll $(OSCAR_OBJS) - -libjabber.dll: $(JABBER_OBJS) - $(LINK32) /DLL /SUBSYSTEM:WINDOWS /ENTRY:jabber_init $(JABBER_LIBS) $(LINK32_FLAGS) /out:libjabber.dll $(JABBER_OBJS) - -clean: - @-erase $(MAIN_OBJS) - @-erase $(MSN_OBJS) - @-erase $(JABBER_OBJS) - @-erase $(OSCAR_OBJS) - @-erase $(YAHOO_OBJS) -- cgit v1.2.3 From 6a72a574df321683ee51f7cef14255cbb4cdbeba Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 10 Jun 2008 05:43:46 +0200 Subject: Move OUTFILE determination to Makefile rather than configure. --- Makefile | 2 ++ configure | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fa202ef1..5309adf4 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,10 @@ ifeq ($(TARGET),i586-mingw32msvc) objects += win32.o LFLAGS+=-lws2_32 EFLAGS+=-lsecur32 +OUTFILE=bitlbee.exe else objects += unix.o conf.o log.o +OUTFILE=bitlbee endif # Expansion of variables diff --git a/configure b/configure index 62f0f5d9..b3a98086 100755 --- a/configure +++ b/configure @@ -112,7 +112,6 @@ PCDIR=$pcdir TARGET=$target ARCH=$arch CPU=$cpu -OUTFILE=bitlbee DESTDIR= LFLAGS= @@ -510,7 +509,6 @@ CYGWIN* ) echo 'Cygwin is not officially supported.' ;; Windows ) - echo OUTFILE=bitlbee.exe >> Makefile.settings ;; * ) echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV.' -- cgit v1.2.3 From 47b571d306a3da9932bc2616ab954ee342ec6519 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 28 Jun 2008 19:35:34 +0200 Subject: Avoid g_access on GLib < 2.8.0. --- storage_xml.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/storage_xml.c b/storage_xml.c index ca82a9d1..cb92135c 100644 --- a/storage_xml.c +++ b/storage_xml.c @@ -30,6 +30,11 @@ #include "md5.h" #include +#if !GLIB_CHECK_VERSION(2,8,0) +/* GLib < 2.8.0 doesn't have g_access, so just use the system access(). */ +#define g_access access +#endif + typedef enum { XML_PASS_CHECK_ONLY = -1, @@ -245,7 +250,8 @@ static void xml_init( void ) { if( ! g_file_test( global.conf->configdir, G_FILE_TEST_EXISTS ) ) log_message( LOGLVL_WARNING, "The configuration directory `%s' does not exist. Configuration won't be saved.", global.conf->configdir ); - else if( ! g_file_test( global.conf->configdir, G_FILE_TEST_EXISTS ) || g_access( global.conf->configdir, W_OK ) != 0 ) + else if( ! g_file_test( global.conf->configdir, G_FILE_TEST_EXISTS ) || + g_access( global.conf->configdir, W_OK ) != 0 ) log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to `%s'.", global.conf->configdir ); } -- cgit v1.2.3 From 913545e54123296fb8229ecad2c77a6e899e0242 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 28 Jun 2008 20:38:52 +0200 Subject: Fix indentation. --- win32.c | 76 ++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/win32.c b/win32.c index fc73b611..4ab1d522 100644 --- a/win32.c +++ b/win32.c @@ -1,10 +1,10 @@ /********************************************************************\ - * BitlBee -- An IRC to other IM-networks gateway * - * * - * Copyright 2002-2004 Wilmer van der Gaast and others * + * BitlBee -- An IRC to other IM-networks gateway * + * * + * Copyright 2002-2004 Wilmer van der Gaast and others * \********************************************************************/ -/* Main file (Windows specific part) */ +/* Main file (Windows specific part) */ /* This program is free software; you can redistribute it and/or modify @@ -38,17 +38,17 @@ static void WINAPI service_ctrl (DWORD dwControl) { switch (dwControl) { - case SERVICE_CONTROL_STOP: + case SERVICE_CONTROL_STOP: /* FIXME */ - break; + break; - case SERVICE_CONTROL_INTERROGATE: - break; + case SERVICE_CONTROL_INTERROGATE: + break; - default: - break; + default: + break; - } + } } static void bitlbee_init(int argc, char **argv) @@ -94,13 +94,13 @@ void service_main (DWORD argc, LPTSTR *argv) SERVICE_STATUS_HANDLE handle; SERVICE_STATUS status; - handle = RegisterServiceCtrlHandler("bitlbee", service_ctrl); + handle = RegisterServiceCtrlHandler("bitlbee", service_ctrl); - if (!handle) + if (!handle) return; - status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; - status.dwServiceSpecificExitCode = 0; + status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; + status.dwServiceSpecificExitCode = 0; bitlbee_init(argc, argv); @@ -125,7 +125,7 @@ static void usage() } int main( int argc, char **argv) -{ +{ int i; WSADATA WSAData; @@ -139,7 +139,7 @@ int main( int argc, char **argv) } } - WSAStartup(MAKEWORD(1,1), &WSAData); + WSAStartup(MAKEWORD(1,1), &WSAData); if (!debug) { if (!StartServiceCtrlDispatcher(dispatch_table)) @@ -270,12 +270,12 @@ void log_error(char *msg) void log_message(int level, char *message, ...) { - HANDLE hEventSource; - LPTSTR lpszStrings[2]; + HANDLE hEventSource; + LPTSTR lpszStrings[2]; WORD elevel; - va_list ap; + va_list ap; - va_start(ap, message); + va_start(ap, message); if (debug) { vprintf(message, ap); @@ -284,11 +284,11 @@ void log_message(int level, char *message, ...) return; } - hEventSource = RegisterEventSource(NULL, TEXT("bitlbee")); + hEventSource = RegisterEventSource(NULL, TEXT("bitlbee")); - lpszStrings[0] = TEXT("bitlbee"); - lpszStrings[1] = g_strdup_vprintf(message, ap); - va_end(ap); + lpszStrings[0] = TEXT("bitlbee"); + lpszStrings[1] = g_strdup_vprintf(message, ap); + va_end(ap); switch (level) { case LOGLVL_ERROR: elevel = EVENTLOG_ERROR_TYPE; break; @@ -299,19 +299,19 @@ void log_message(int level, char *message, ...) #endif } - if (hEventSource != NULL) { - ReportEvent(hEventSource, - elevel, - 0, - 0, - NULL, - 2, - 0, - lpszStrings, - NULL); - - DeregisterEventSource(hEventSource); - } + if (hEventSource != NULL) { + ReportEvent(hEventSource, + elevel, + 0, + 0, + NULL, + 2, + 0, + lpszStrings, + NULL); + + DeregisterEventSource(hEventSource); + } g_free(lpszStrings[1]); } -- cgit v1.2.3