Changeset 99318ad
- Timestamp:
- 2005-11-07T16:32:40Z (19 years ago)
- Branches:
- master
- Children:
- abe53d3
- Parents:
- d1d6776
- Files:
-
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
bitlbee.c
rd1d6776 r99318ad 57 57 GIOChannel *ch; 58 58 59 log_link( LOGLVL_ERROR, LOGOUTPUT_SYSLOG );60 log_link( LOGLVL_WARNING, LOGOUTPUT_SYSLOG );61 62 59 global.listen_socket = socket( AF_INET, SOCK_STREAM, 0 ); 63 60 if( global.listen_socket == -1 ) … … 112 109 if( !irc_new( 0 ) ) 113 110 return( 1 ); 114 115 log_link( LOGLVL_ERROR, LOGOUTPUT_IRC );116 log_link( LOGLVL_WARNING, LOGOUTPUT_IRC );117 111 118 112 return( 0 ); -
unix.c
rd1d6776 r99318ad 61 61 if( global.conf->runmode == RUNMODE_INETD ) 62 62 { 63 log_link( LOGLVL_ERROR, LOGOUTPUT_IRC ); 64 log_link( LOGLVL_WARNING, LOGOUTPUT_IRC ); 65 63 66 i = bitlbee_inetd_init(); 64 67 log_message( LOGLVL_INFO, "Bitlbee %s starting in inetd mode.", BITLBEE_VERSION ); … … 67 70 else if( global.conf->runmode == RUNMODE_DAEMON ) 68 71 { 72 log_link( LOGLVL_ERROR, LOGOUTPUT_SYSLOG ); 73 log_link( LOGLVL_WARNING, LOGOUTPUT_SYSLOG ); 74 69 75 i = bitlbee_daemon_init(); 70 76 log_message( LOGLVL_INFO, "Bitlbee %s starting in daemon mode.", BITLBEE_VERSION ); -
win32.c
rd1d6776 r99318ad 5 5 \********************************************************************/ 6 6 7 /* Main file ( Unix specific part)*/7 /* Main file (Windows specific part) */ 8 8 9 9 /* … … 24 24 */ 25 25 26 #define BITLBEE_CORE 26 27 #include "bitlbee.h" 27 28 #include "commands.h" … … 30 31 #include "help.h" 31 32 #include <signal.h> 32 #include <unistd.h> 33 #include <sys/time.h> 34 #include <winreg.h> 35 #include <winbase.h> 33 #include <windows.h> 36 34 37 35 global_t global; /* Against global namespace pollution */ 38 36 39 int main( int argc, char *argv[] ) 37 static void WINAPI service_ctrl (DWORD dwControl) 38 { 39 switch (dwControl) 40 { 41 case SERVICE_CONTROL_STOP: 42 /* FIXME */ 43 break; 44 45 case SERVICE_CONTROL_INTERROGATE: 46 break; 47 48 default: 49 break; 50 51 } 52 } 53 54 void service_main (DWORD argc, LPTSTR *argv) 40 55 { 41 56 int i = -1; 57 SERVICE_STATUS_HANDLE handle; 58 SERVICE_STATUS status; 59 60 handle = RegisterServiceCtrlHandler("bitlbee", service_ctrl); 61 62 if (!handle) 63 return; 64 65 status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; 66 status.dwServiceSpecificExitCode = 0; 67 42 68 memset( &global, 0, sizeof( global_t ) ); 43 69 44 70 global.loop = g_main_new( FALSE ); 45 46 log_init( );47 nogaim_init( );48 71 49 72 global.conf = conf_load( argc, argv ); 50 73 if( global.conf == NULL ) 51 return ( 1 );74 return; 52 75 53 76 if( global.conf->runmode == RUNMODE_INETD ) … … 68 91 69 92 if( i != 0 ) 70 return ( i );93 return; 71 94 72 95 if( access( global.conf->configdir, F_OK ) != 0 ) 73 96 log_message( LOGLVL_WARNING, "The configuration directory %s does not exist. Configuration won't be saved.", global.conf->configdir ); 74 else if( access( global.conf->configdir, R_OK ) != 0 || access( global.conf->configdir, W_OK) != 0 )97 else if( access( global.conf->configdir, 06 ) != 0 ) 75 98 log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to %s.", global.conf->configdir ); 76 99 if( help_init( &(global.help) ) == NULL ) 77 100 log_message( LOGLVL_WARNING, "Error opening helpfile %s.", global.helpfile ); 101 102 SetServiceStatus(handle, &status); 78 103 79 104 g_main_run( global.loop ); 80 81 return( 0 ); 105 } 106 107 int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) 108 { 109 SERVICE_TABLE_ENTRY dispatch_table[] = 110 { 111 { TEXT("bitlbee"), (LPSERVICE_MAIN_FUNCTION)service_main }, 112 { NULL, NULL } 113 }; 114 115 nogaim_init( ); 116 117 if (!StartServiceCtrlDispatcher(dispatch_table)) 118 log_message( LOGLVL_ERROR, "StartServiceCtrlDispatcher failed."); 119 120 return 0; 82 121 } 83 122 … … 119 158 HKEY key, key_main, key_proxy; 120 159 char *tmp; 121 RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Bitlbee", &key); 122 RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Bitlbee\\main", &key_main); 123 RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Bitlbee\\proxy", &key_proxy); 160 161 RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Bitlbee", &key); 162 RegOpenKey(key, "main", &key_main); 163 RegOpenKey(key, "proxy", &key_proxy); 124 164 125 165 memset( &global, 0, sizeof( global_t ) ); … … 190 230 return (addr->s_addr == INADDR_NONE) ? 0 : 1; 191 231 } 232 233 void log_error(char *msg) 234 { 235 log_message(LOGLVL_ERROR, "%s", msg); 236 } 237 238 void log_message(int level, char *message, ...) 239 { 240 HANDLE hEventSource; 241 LPTSTR lpszStrings[2]; 242 WORD elevel; 243 va_list ap; 244 245 va_start(ap, message); 246 247 hEventSource = RegisterEventSource(NULL, TEXT("bitlbee")); 248 249 lpszStrings[0] = TEXT("bitlbee"); 250 lpszStrings[1] = g_strdup_vprintf(message, ap); 251 va_end(ap); 252 253 switch (level) { 254 case LOGLVL_ERROR: elevel = EVENTLOG_ERROR_TYPE; break; 255 case LOGLVL_WARNING: elevel = EVENTLOG_WARNING_TYPE; break; 256 case LOGLVL_INFO: elevel = EVENTLOG_INFORMATION_TYPE; break; 257 #ifdef DEBUG 258 case LOGLVL_DEBUG: elevel = EVENTLOG_AUDIT_SUCCESS; break; 259 #endif 260 } 261 262 if (hEventSource != NULL) { 263 ReportEvent(hEventSource, 264 elevel, 265 0, 266 0, 267 NULL, 268 2, 269 0, 270 lpszStrings, 271 NULL); 272 273 DeregisterEventSource(hEventSource); 274 } 275 276 g_free(lpszStrings[1]); 277 } -
win32/BUILD.TXT
rd1d6776 r99318ad 5 5 bzr branch http://jelmer.vernstok.nl/oss/bitlbee/bzr/win32 bitlbee-win32 6 6 2. Download and install the required development files: 7 from http://www.ethereal.com/distribution/win32/development/: 8 - libiconv 7 from ftp://ftp.gtk.org/pub/gtk/v2.8/win32/ 9 8 - glib 10 9 - glib-dev 10 - libiconv 11 - gettext 11 12 from http://ftp.mozilla.org/pub/mozilla.org/ 12 13 - nss -
win32/bitlbee.dsp
rd1d6776 r99318ad 43 43 # PROP Target_Dir "" 44 44 # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c 45 # 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 /c45 # 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 46 46 # SUBTRACT CPP /YX 47 47 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 … … 54 54 LINK32=link.exe 55 55 # ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 56 # 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"56 # 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" 57 57 # SUBTRACT LINK32 /incremental:yes /nodefaultlib 58 58 … … 71 71 # PROP Target_Dir "" 72 72 # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c 73 # 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 /c73 # 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 74 74 # SUBTRACT CPP /YX 75 75 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 … … 82 82 LINK32=link.exe 83 83 # ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept 84 # 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"84 # 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" 85 85 86 86 !ENDIF … … 104 104 105 105 SOURCE=.\bitlbee.rc 106 # End Source File 107 # Begin Source File 108 109 SOURCE=.\bitlbeewin.cpp 106 107 !IF "$(CFG)" == "bitlbee - Win32 Release" 108 109 !ELSEIF "$(CFG)" == "bitlbee - Win32 Debug" 110 111 !ENDIF 112 110 113 # End Source File 111 114 # Begin Source File … … 131 134 # Begin Source File 132 135 133 SOURCE=.\MainDlg.cpp134 # End Source File135 # Begin Source File136 137 136 SOURCE=..\protocols\md5.c 138 137 # End Source File … … 147 146 # Begin Source File 148 147 149 SOURCE=.\PropAccess.cpp150 # End Source File151 # Begin Source File152 153 SOURCE=.\PropConn.cpp154 # End Source File155 # Begin Source File156 157 SOURCE=.\PropLog.cpp158 # End Source File159 # Begin Source File160 161 SOURCE=.\PropPaths.cpp162 # End Source File163 # Begin Source File164 165 SOURCE=.\PropUsers.cpp166 # End Source File167 # Begin Source File168 169 148 SOURCE=..\protocols\proxy.c 170 149 # End Source File … … 183 162 # Begin Source File 184 163 185 SOURCE=.\TrayNot.cpp186 # End Source File187 # Begin Source File188 189 164 SOURCE=..\user.c 190 165 # End Source File … … 201 176 !ENDIF 202 177 178 # End Source File 179 # Begin Source File 180 181 SOURCE=..\win32.c 203 182 # End Source File 204 183 # End Group … … 216 195 # Begin Source File 217 196 218 SOURCE=.\bitlbeewin.h219 # End Source File220 # Begin Source File221 222 197 SOURCE=..\commands.h 223 198 # End Source File … … 252 227 # Begin Source File 253 228 254 SOURCE=.\MainDlg.h255 # End Source File256 # Begin Source File257 258 229 SOURCE=..\protocols\md5.h 259 230 # End Source File … … 268 239 # Begin Source File 269 240 270 SOURCE=.\PropAccess.h271 # End Source File272 # Begin Source File273 274 SOURCE=.\PropConn.h275 # End Source File276 # Begin Source File277 278 SOURCE=.\PropLog.h279 # End Source File280 # Begin Source File281 282 SOURCE=.\PropPaths.h283 # End Source File284 # Begin Source File285 286 SOURCE=.\PropUsers.h287 # End Source File288 # Begin Source File289 290 SOURCE=.\Resource.h291 # End Source File292 # Begin Source File293 294 241 SOURCE=..\set.h 295 242 # End Source File … … 301 248 302 249 SOURCE=..\sock.h 303 # End Source File304 # Begin Source File305 306 SOURCE=.\TrayNot.h307 250 # End Source File 308 251 # Begin Source File -
win32/bitlbee.dsw
rd1d6776 r99318ad 4 4 ############################################################################### 5 5 6 Project: " bitlbee"=".\bitlbee.dsp"- Package Owner=<4>6 Project: "admin"=.\admin1\admin.dsp - Package Owner=<4> 7 7 8 8 Package=<5> … … 16 16 ############################################################################### 17 17 18 Project: "bitlbee _ssl"=".\bitlbee_ssl\bitlbee_ssl.dsp"- Package Owner=<4>18 Project: "bitlbee"=.\bitlbee.dsp - Package Owner=<4> 19 19 20 20 Package=<5> … … 28 28 ############################################################################### 29 29 30 Project: "jabber"=".\jabber.dsp" - Package Owner=<4> 30 Project: "bitlbee_ssl"=.\bitlbee_ssl.dsp - Package Owner=<4> 31 32 Package=<5> 33 {{{ 34 }}} 35 36 Package=<4> 37 {{{ 38 }}} 39 40 ############################################################################### 41 42 Project: "jabber"=.\jabber.dsp - Package Owner=<4> 31 43 32 44 Package=<5> … … 46 58 ############################################################################### 47 59 48 Project: "msn"= ".\msn.dsp"- Package Owner=<4>60 Project: "msn"=.\msn.dsp - Package Owner=<4> 49 61 50 62 Package=<5> … … 64 76 ############################################################################### 65 77 66 Project: "oscar"= ".\oscar.dsp"- Package Owner=<4>78 Project: "oscar"=.\oscar.dsp - Package Owner=<4> 67 79 68 80 Package=<5> … … 79 91 ############################################################################### 80 92 81 Project: "yahoo"= ".\yahoo.dsp"- Package Owner=<4>93 Project: "yahoo"=.\yahoo.dsp - Package Owner=<4> 82 94 83 95 Package=<5>
Note: See TracChangeset
for help on using the changeset viewer.