diff options
| author | Jelmer Vernooij <jelmer@samba.org> | 2005-11-07 17:42:49 +0100 | 
|---|---|---|
| committer | Jelmer Vernooij <jelmer@samba.org> | 2005-11-07 17:42:49 +0100 | 
| commit | abe53d3c48a6552e136ddc8bc554764daf255a05 (patch) | |
| tree | 946f5254a5a3931e2d48eefc4d697fae59500260 | |
| parent | 99318adcb88fa3f1dd21882ec364e682fec96c5e (diff) | |
More work on config manager
| -rw-r--r-- | .bzrignore | 9 | ||||
| -rw-r--r-- | doc/BUILD.win32 (renamed from win32/BUILD.TXT) | 0 | ||||
| -rw-r--r-- | win32.c | 136 | ||||
| -rw-r--r-- | win32/PropUsers.cpp | 120 | ||||
| -rw-r--r-- | win32/PropUsers.h | 54 | ||||
| -rw-r--r-- | win32/TrayNot.cpp | 106 | ||||
| -rw-r--r-- | win32/TrayNot.h | 54 | ||||
| -rw-r--r-- | win32/admin/MainDlg.cpp (renamed from win32/MainDlg.cpp) | 13 | ||||
| -rw-r--r-- | win32/admin/MainDlg.h (renamed from win32/MainDlg.h) | 4 | ||||
| -rw-r--r-- | win32/admin/PropAccess.cpp (renamed from win32/PropAccess.cpp) | 59 | ||||
| -rw-r--r-- | win32/admin/PropAccess.h (renamed from win32/PropAccess.h) | 3 | ||||
| -rw-r--r-- | win32/admin/PropConn.cpp (renamed from win32/PropConn.cpp) | 50 | ||||
| -rw-r--r-- | win32/admin/PropConn.h (renamed from win32/PropConn.h) | 3 | ||||
| -rw-r--r-- | win32/admin/PropLog.cpp (renamed from win32/PropLog.cpp) | 4 | ||||
| -rw-r--r-- | win32/admin/PropLog.h (renamed from win32/PropLog.h) | 0 | ||||
| -rw-r--r-- | win32/admin/PropMain.cpp | 99 | ||||
| -rw-r--r-- | win32/admin/PropMain.h | 58 | ||||
| -rw-r--r-- | win32/admin/PropPaths.cpp (renamed from win32/PropPaths.cpp) | 32 | ||||
| -rw-r--r-- | win32/admin/PropPaths.h (renamed from win32/PropPaths.h) | 2 | ||||
| -rw-r--r-- | win32/admin/admin.dsp | 175 | ||||
| -rw-r--r-- | win32/admin/bitlbee.rc (renamed from win32/bitlbee.rc) | 93 | ||||
| -rw-r--r-- | win32/admin/bitlbeewin.cpp | 47 | ||||
| -rw-r--r-- | win32/admin/bitlbeewin.h (renamed from win32/bitlbeewin.h) | 12 | ||||
| -rw-r--r-- | win32/admin/res/bmp00002.bmp (renamed from win32/res/bmp00002.bmp) | bin | 5830 -> 5830 bytes | |||
| -rw-r--r-- | win32/admin/res/icon2.ico (renamed from win32/res/icon2.ico) | bin | 3774 -> 3774 bytes | |||
| -rw-r--r-- | win32/admin/resource.h (renamed from win32/resource.h) | 7 | ||||
| -rw-r--r-- | win32/bitlbee.dsp | 44 | ||||
| -rw-r--r-- | win32/bitlbeewin.cpp | 210 | 
28 files changed, 586 insertions, 808 deletions
| @@ -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/win32/BUILD.TXT b/doc/BUILD.win32 index 03e1b8d9..03e1b8d9 100644 --- a/win32/BUILD.TXT +++ b/doc/BUILD.win32 @@ -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/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 <afxwin.h> - -#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/MainDlg.cpp b/win32/admin/MainDlg.cpp index 615a9a3b..e9ecda34 100644 --- a/win32/MainDlg.cpp +++ b/win32/admin/MainDlg.cpp @@ -1,12 +1,8 @@  // MainDlg.cpp : implementation file  // -
 -#define BITLBEE_CORE -#include "bitlbeewin.h" -#include "PropUsers.h" +  #include "PropPaths.h" -#include "PropAccess.h" -#include "PropLog.h"
 +#include "PropAccess.h"
  #include "PropConn.h"  #include "MainDlg.h" @@ -25,8 +21,6 @@ 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(); @@ -74,5 +68,4 @@ void CMainDlg::OnOK()  void CMainDlg::OnClose()   {  	ShowWindow(SW_HIDE); -} -
 +}
 diff --git a/win32/MainDlg.h b/win32/admin/MainDlg.h index 7cdf612b..be5547fd 100644 --- a/win32/MainDlg.h +++ b/win32/admin/MainDlg.h @@ -5,7 +5,9 @@  #pragma once  #endif // _MSC_VER >= 1000  // MainDlg.h : header file -// +//
 +
 +#include <afxdlgs.h>  /////////////////////////////////////////////////////////////////////////////  // CMainDlg diff --git a/win32/PropAccess.cpp b/win32/admin/PropAccess.cpp index fd787b39..a09ce454 100644 --- a/win32/PropAccess.cpp +++ b/win32/admin/PropAccess.cpp @@ -1,8 +1,6 @@  // PropAccess.cpp : implementation file  // -
 -#define BITLBEE_CORE -#include "bitlbeewin.h" +  #include "PropAccess.h"  #ifdef _DEBUG @@ -51,25 +49,18 @@ END_MESSAGE_MAP()  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(); -	} +	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();  } @@ -101,22 +92,22 @@ void CPropAccess::OnAuthClosed()  }  BOOL CPropAccess::OnInitDialog()  -{ -	CPropertyPage::OnInitDialog(); +{
 +	CPropertyPage::OnInitDialog();
 +
 +	HKEY key;
 +	RegOpenKey(HKEY_LOCAL_MACHINE, BITLBEE_KEY, &key);
 -	m_interface.SetWindowText(global.conf->iface); -	m_password.SetWindowText(global.conf->password); +	m_interface.SetWindowText(GetProfileString("interface", "0.0.0.0")); +	m_password.SetWindowText(GetProfileString("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); +	sprintf(tmp, "%d", GetProfileInt("port", 6667)); +	m_port.SetWindowText(tmp);
 -	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; +	switch(GetProfileInt("auth_mode", 1)) { +	case 0: OnAuthOpen();break; +	case 1: OnAuthClosed();break; +	case 2: OnAuthRegistered();break;  	}  	return TRUE; diff --git a/win32/PropAccess.h b/win32/admin/PropAccess.h index bc80c648..cae0241c 100644 --- a/win32/PropAccess.h +++ b/win32/admin/PropAccess.h @@ -6,6 +6,9 @@  #endif // _MSC_VER >= 1000  // PropAccess.h : header file  // +
 +#include <afxdlgs.h>
 +#include "Resource.h"
  /////////////////////////////////////////////////////////////////////////////  // CPropAccess dialog diff --git a/win32/PropConn.cpp b/win32/admin/PropConn.cpp index 15d4a90a..b16be0f1 100644 --- a/win32/PropConn.cpp +++ b/win32/admin/PropConn.cpp @@ -1,8 +1,6 @@  // PropConn.cpp : implementation file
  //
 -#define BITLBEE_CORE
 -#include "bitlbeewin.h"
  #include "PropConn.h"
  #ifdef _DEBUG
 @@ -56,7 +54,6 @@ void CPropConn::OnProxyAuthEnabled()  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());
 @@ -72,30 +69,28 @@ void CPropConn::OnProxyEnabled()  void CPropConn::OnOK() 
  {
 -	if(!m_proxy_enabled.GetCheck()) {
 -		proxytype = PROXY_NONE;
 -		return;
 -	}
 -
  	CString tmp;
  	m_proxyhost.GetWindowText(tmp);
 -	strcpy(proxyhost, tmp);
 +	WriteProfileString("proxy_host", tmp);
  	m_proxyport.GetWindowText(tmp);
 -	proxyport = atoi(tmp);
 +	WriteProfileInt("proxy_port", atoi(tmp));
 -	proxytype = m_proxytype.GetCurSel()+1;
 +	if(!m_proxy_enabled.GetCheck()) {
 +		WriteProfileInt("proxy_type", 0);
 +	} else {
 +		WriteProfileInt("proxy_type", m_proxytype.GetCurSel()+1);
 +	}
  	if(!m_proxy_auth_enabled.GetCheck()) {
 -		strcpy(proxyuser, "");
 -		strcpy(proxypass, "");
 -		return;
 +		WriteProfileString("proxy_user", "");
 +		WriteProfileString("proxy_password", "");
 +	} else {
 +		m_proxyuser.GetWindowText(tmp);
 +		WriteProfileString("proxy_user", tmp);
 +		m_proxypass.GetWindowText(tmp);
 +		WriteProfileString("proxy_password", tmp);
  	}
 -
 -	m_proxyuser.GetWindowText(tmp);
 -	strcpy(proxyuser, tmp);
 -	m_proxypass.GetWindowText(tmp);
 -	strcpy(proxypass, tmp);
  	CPropertyPage::OnOK();
  }
 @@ -104,22 +99,25 @@ BOOL CPropConn::OnInitDialog()  {
  	char pp[20];
  	CPropertyPage::OnInitDialog();
 +	int proxytype;
 -	m_proxyhost.SetWindowText(proxyhost);
 -	m_proxyuser.SetWindowText(proxyuser);
 -	m_proxypass.SetWindowText(proxypass);
 -	g_snprintf(pp, 20, "%d", proxyport);
 +	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 == PROXY_NONE?0:1); 
 -	m_proxy_auth_enabled.SetCheck(strcmp(proxyuser, "")?1:0);
 +	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/PropConn.h b/win32/admin/PropConn.h index 1143912c..e920da3d 100644 --- a/win32/PropConn.h +++ b/win32/admin/PropConn.h @@ -7,6 +7,9 @@  // PropConn.h : header file
  //
 +#include <afxdlgs.h>
 +#include "Resource.h"
 +
  /////////////////////////////////////////////////////////////////////////////
  // CPropConn dialog
 diff --git a/win32/PropLog.cpp b/win32/admin/PropLog.cpp index 27957b07..8b1641d9 100644 --- a/win32/PropLog.cpp +++ b/win32/admin/PropLog.cpp @@ -1,8 +1,6 @@  // PropLog.cpp : implementation file  // -
 -#define BITLBEE_CORE -#include "bitlbeewin.h" +  #include "PropLog.h"  #ifdef _DEBUG diff --git a/win32/PropLog.h b/win32/admin/PropLog.h index 1a847b19..1a847b19 100644 --- a/win32/PropLog.h +++ b/win32/admin/PropLog.h 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 <afxdlgs.h>
 +#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/PropPaths.cpp b/win32/admin/PropPaths.cpp index 7790e99c..4fb49497 100644 --- a/win32/PropPaths.cpp +++ b/win32/admin/PropPaths.cpp @@ -1,8 +1,6 @@  // PropPaths.cpp : implementation file  // -
 -#define BITLBEE_CORE -#include "bitlbeewin.h" +  #include "PropPaths.h"  #include "shlobj.h" @@ -52,22 +50,20 @@ END_MESSAGE_MAP()  void CPropPaths::OnOK()   {  	CString tmp; -	g_free((void *)global.conf->configdir); -	m_configdir.GetWindowText(tmp); +	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); -	} +	{
 +		tmp = tmp + "\\"; +	}
 +
 +	WriteProfileString("configdir", tmp); + +	m_motdfile.GetWindowText(tmp);
 +	WriteProfileString("motdfile", tmp);
 -	g_free((void *)global.conf->motdfile); -	m_motdfile.GetWindowText(tmp); -	global.conf->motdfile = g_strdup(tmp); -	  	CPropertyPage::OnOK();  } @@ -110,10 +106,10 @@ void CPropPaths::OnEditMotd()  BOOL CPropPaths::OnInitDialog()   { -	CPropertyPage::OnInitDialog(); -	 -	m_configdir.SetWindowText(global.conf->configdir); -	m_motdfile.SetWindowText(global.conf->motdfile); +	CPropertyPage::OnInitDialog();
 + +	m_configdir.SetWindowText(GetProfileString("configdir", "")); +	m_motdfile.SetWindowText(GetProfileString("motdfile", ""));  	return TRUE;    } diff --git a/win32/PropPaths.h b/win32/admin/PropPaths.h index 89c1c78e..733e674c 100644 --- a/win32/PropPaths.h +++ b/win32/admin/PropPaths.h @@ -6,6 +6,8 @@  #endif // _MSC_VER >= 1000  // PropPaths.h : header file  // +#include <afxdlgs.h>
 +#include "Resource.h"
  /////////////////////////////////////////////////////////////////////////////  // CPropPaths dialog 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/bitlbee.rc b/win32/admin/bitlbee.rc index 0762fbbd..5e9b5407 100644 --- a/win32/bitlbee.rc +++ b/win32/admin/bitlbee.rc @@ -94,23 +94,6 @@ BEGIN                      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"
 @@ -125,13 +108,6 @@ BEGIN      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"
 @@ -151,15 +127,6 @@ BEGIN                      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"
 @@ -183,6 +150,21 @@ BEGIN      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
  /////////////////////////////////////////////////////////////////////////////
 @@ -211,8 +193,8 @@ BEGIN              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 "LegalCopyright", "Copyright (C) 2002-2005\0"
 +            VALUE "OriginalFilename", "bitlbeeadm.exe\0"
              VALUE "ProductName", "Bitlbee Application\0"
              VALUE "ProductVersion", "1, 0, 0, 1\0"
          END
 @@ -242,14 +224,6 @@ BEGIN          BOTTOMMARGIN, 147
      END
 -    IDD_PROPPAGE_USERS, DIALOG
 -    BEGIN
 -        LEFTMARGIN, 7
 -        RIGHTMARGIN, 203
 -        TOPMARGIN, 7
 -        BOTTOMMARGIN, 147
 -    END
 -
      IDD_PROPPAGE_PATHS, DIALOG
      BEGIN
          LEFTMARGIN, 7
 @@ -258,14 +232,6 @@ BEGIN          BOTTOMMARGIN, 147
      END
 -    IDD_PHONY, DIALOG
 -    BEGIN
 -        LEFTMARGIN, 7
 -        RIGHTMARGIN, 2
 -        TOPMARGIN, 7
 -        BOTTOMMARGIN, 2
 -    END
 -
      IDD_PROPPAGE_ABOUT, DIALOG
      BEGIN
          LEFTMARGIN, 7
 @@ -274,7 +240,7 @@ BEGIN          BOTTOMMARGIN, 149
      END
 -    IDD_PROPPAGE_LOG, DIALOG
 +    IDD_PROPPAGE_CONNECTION, DIALOG
      BEGIN
          LEFTMARGIN, 7
          RIGHTMARGIN, 203
 @@ -282,12 +248,12 @@ BEGIN          BOTTOMMARGIN, 147
      END
 -    IDD_PROPPAGE_CONNECTION, DIALOG
 +    IDD_PROPPAGE_MAIN, DIALOG
      BEGIN
          LEFTMARGIN, 7
          RIGHTMARGIN, 203
 -        TOPMARGIN, 7
 -        BOTTOMMARGIN, 147
 +        TOPMARGIN, 6
 +        BOTTOMMARGIN, 94
      END
  END
  #endif    // APSTUDIO_INVOKED
 @@ -295,22 +261,6 @@ END  /////////////////////////////////////////////////////////////////////////////
  //
 -// Menu
 -//
 -
 -IDR_POPUP MENU DISCARDABLE 
 -BEGIN
 -    POPUP "tray"
 -    BEGIN
 -        MENUITEM "&Show",                       IDM_SHOW
 -        MENUITEM SEPARATOR
 -        MENUITEM "&Exit",                       IDM_EXIT
 -    END
 -END
 -
 -
 -/////////////////////////////////////////////////////////////////////////////
 -//
  // Bitmap
  //
 @@ -324,7 +274,6 @@ IDB_BEE_SMALL           BITMAP  DISCARDABLE     "res\\bmp00002.bmp"  STRINGTABLE DISCARDABLE 
  BEGIN
      IDS_ABOUTBOX            "&About bitlbee..."
 -    IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed."
  END
  #endif    // English (U.S.) resources
 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/bitlbeewin.h b/win32/admin/bitlbeewin.h index 1a0d0361..73860252 100644 --- a/win32/bitlbeewin.h +++ b/win32/admin/bitlbeewin.h @@ -13,12 +13,6 @@  #include <windows.h>
  #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 @@ -27,7 +21,7 @@ extern "C" {  class CBitlbeeApp : public CWinApp  {  public: -	CBitlbeeApp(); +	CBitlbeeApp() {}  // Overrides  	// ClassWizard generated virtual function overrides @@ -40,14 +34,10 @@ public:  // Implementation  	//{{AFX_MSG(CBitlbeeApp) -	afx_msg void OnExit(); -	afx_msg void OnShow();  	//}}AFX_MSG  	DECLARE_MESSAGE_MAP()  	protected: -		CTrayNot *not;  		CPropertySheet *dlg; -		GIOChannel *listen;  };  ///////////////////////////////////////////////////////////////////////////// diff --git a/win32/res/bmp00002.bmp b/win32/admin/res/bmp00002.bmpBinary files differ index 77205cb1..77205cb1 100644 --- a/win32/res/bmp00002.bmp +++ b/win32/admin/res/bmp00002.bmp diff --git a/win32/res/icon2.ico b/win32/admin/res/icon2.icoBinary files differ index 5dfe084f..5dfe084f 100644 --- a/win32/res/icon2.ico +++ b/win32/admin/res/icon2.ico diff --git a/win32/resource.h b/win32/admin/resource.h index f655c545..8c8fe503 100644 --- a/win32/resource.h +++ b/win32/admin/resource.h @@ -20,6 +20,7 @@  #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
 @@ -45,6 +46,10 @@  #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
 @@ -54,7 +59,7 @@  #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_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/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 <afxsock.h> -extern "C" { -#include "config.h" -#include "bitlbee.h" -#include <stdarg.h> -#include <gmodule.h>
 -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<GLogLevelFlags>(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(); -} | 
