diff src/protocols/gg/lib/libgadu.h @ 11546:3c536224f0d0

[gaim-migrate @ 13801] Update gg to compile and seem to work on win32. The win32 thread implementation in libgg has not been tested *at all*, but I think that the gaim tie-in is all synchronous anyway (yes, it hangs up the UI wonderfully whendoing stuff). I should probably look into getting some of this stuff back into libgg committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 14 Sep 2005 19:10:39 +0000
parents cf15c1cdcfbd
children 8724718d387f
line wrap: on
line diff
--- a/src/protocols/gg/lib/libgadu.h	Wed Sep 14 19:01:33 2005 +0000
+++ b/src/protocols/gg/lib/libgadu.h	Wed Sep 14 19:10:39 2005 +0000
@@ -1,4 +1,4 @@
-/* $Id: libgadu.h 13582 2005-08-28 22:46:01Z boler $ */
+/* $Id: libgadu.h 13801 2005-09-14 19:10:39Z datallah $ */
 
 /*
  *  (C) Copyright 2001-2003 Wojtek Kaniewski <wojtekka@irc.pl>
@@ -27,7 +27,7 @@
 #define __GG_LIBGADU_H
 
 #ifdef __cplusplus
-#ifdef _WIN32
+#ifdef _MSC_VER
 #pragma pack(push, 1)
 #endif
 extern "C" {
@@ -98,10 +98,10 @@
 
 	uint32_t external_addr;	/* adres zewnetrzny klienta */
 	uint16_t external_port;	/* port zewnetrzny klienta */
-	
+
 	uin_t uin;		/* numerek klienta */
 	char *password;		/* i jego hasło. zwalniane automagicznie */
-        
+
 	int initial_status;	/* początkowy stan klienta */
 	int status;		/* aktualny stan klienta */
 
@@ -139,7 +139,7 @@
 
 /*
  * struct gg_http
- * 
+ *
  * ogólna struktura opisująca stan wszystkich operacji HTTP. tworzona
  * przez gg_http_connect(), zwalniana przez gg_http_free().
  */
@@ -175,7 +175,7 @@
 
 /*
  * struct gg_file_info
- * 
+ *
  * odpowiednik windowsowej struktury WIN32_FIND_DATA niezbędnej przy
  * wysyłaniu plików.
  */
@@ -194,7 +194,7 @@
 
 /*
  * struct gg_dcc
- * 
+ *
  * struktura opisująca nasłuchujące gniazdo połączeń między klientami.
  * tworzona przez gg_dcc_socket_create(), zwalniana przez gg_dcc_free().
  */
@@ -244,7 +244,7 @@
 	GG_SESSION_UNREGISTER,	/* usuwanie konta */
 	GG_SESSION_USERLIST_REMOVE,	/* usuwanie userlisty */
 	GG_SESSION_TOKEN,	/* pobieranie tokenu */
-	
+
 	GG_SESSION_USER0 = 256,	/* zdefiniowana dla użytkownika */
 	GG_SESSION_USER1,	/* j.w. */
 	GG_SESSION_USER2,	/* j.w. */
@@ -349,7 +349,7 @@
 	int era_omnix;			/* czy udawać klienta era omnix? */
 
 	char dummy[6 * sizeof(int)];	/* miejsce na kolejnych 6 zmiennych,
-					 * żeby z dodaniem parametru nie 
+					 * żeby z dodaniem parametru nie
 					 * zmieniał się rozmiar struktury */
 };
 
@@ -503,11 +503,11 @@
 		enum gg_failure_t failure;	/* błąd połączenia -- GG_EVENT_FAILURE */
 
 		struct gg_dcc *dcc_new;		/* nowe połączenie bezpośrednie -- GG_EVENT_DCC_NEW */
-		
+
 		int dcc_error;			/* błąd połączenia bezpośredniego -- GG_EVENT_DCC_ERROR */
 
 		gg_pubdir50_t pubdir50;		/* wynik operacji związanej z katalogiem publicznym -- GG_EVENT_PUBDIR50_* */
-	
+
 		struct {			/* @msg odebrano wiadomość -- GG_EVENT_MSG */
 			uin_t sender;		/* numer nadawcy */
 			int msgclass;		/* klasa wiadomości */
@@ -516,16 +516,16 @@
 
 			int recipients_count;	/* ilość odbiorców konferencji */
 			uin_t *recipients;	/* odbiorcy konferencji */
-			
+
 			int formats_length;	/* długość informacji o formatowaniu tekstu */
 			void *formats;		/* informacje o formatowaniu tekstu */
 		} msg;
-		
+
 		struct {			/* @notify_descr informacje o liście kontaktów z opisami stanu -- GG_EVENT_NOTIFY_DESCR */
 			struct gg_notify_reply *notify;	/* informacje o liście kontaktów */
 			char *descr;		/* opis stanu */
 		} notify_descr;
-		
+
 		struct {			/* @status zmiana stanu -- GG_EVENT_STATUS */
 			uin_t uin;		/* numer */
 			uint32_t status;	/* nowy stan */
@@ -553,7 +553,7 @@
 			char *descr;		/* opis stanu */
 			time_t time;		/* czas powrotu */
 		} *notify60;
-		
+
 		struct {			/* @ack potwierdzenie wiadomości -- GG_EVENT_ACK */
 			uin_t recipient;	/* numer odbiorcy */
 			int status;		/* stan doręczenia wiadomości */
@@ -760,7 +760,7 @@
 
 /*
  * struct gg_change_info_request
- * 
+ *
  * opis żądania zmiany informacji w katalogu publicznym.
  */
 struct gg_change_info_request {
@@ -835,7 +835,7 @@
 
 /*
  * można podać wskaźnik do funkcji obsługującej wywołania gg_debug().
- * nieoficjalne, nieudokumentowane, może się zmienić. jeśli ktoś jest 
+ * nieoficjalne, nieudokumentowane, może się zmienić. jeśli ktoś jest
  * zainteresowany, niech da znać na ekg-devel.
  */
 extern void (*gg_debug_handler)(int level, const char *format, va_list ap);
@@ -870,11 +870,11 @@
 extern int gg_proxy_http_only;		/* włącza obsługę proxy wyłącznie dla usług HTTP */
 
 
-/* 
+/*
  * adres, z którego ślemy pakiety (np łączymy się z serwerem)
  * używany przy gg_connect()
  */
-extern unsigned long gg_local_ip; 
+extern unsigned long gg_local_ip;
 /*
  * -------------------------------------------------------------------------
  * poniżej znajdują się wewnętrzne sprawy biblioteki. zwykły klient nie
@@ -886,6 +886,8 @@
 
 #ifdef __GG_LIBGADU_HAVE_PTHREAD
 int gg_resolve_pthread(int *fd, void **resolver, const char *hostname);
+#elif defined _WIN32
+int gg_resolve_win32thread(int *fd, void **resolver, const char *hostname);
 #endif
 
 #ifdef _WIN32
@@ -959,7 +961,7 @@
 struct gg_welcome {
 	uint32_t key;			/* klucz szyfrowania hasła */
 } GG_PACKED;
-	
+
 #define GG_LOGIN 0x000c
 
 struct gg_login {
@@ -1076,7 +1078,7 @@
 #define GG_NOTIFY_LAST 0x0010
 
 #define GG_NOTIFY 0x0010
-	
+
 struct gg_notify {
 	uint32_t uin;				/* numerek danej osoby */
 	uint8_t dunno1;				/* rodzaj wpisu w liście */
@@ -1087,9 +1089,9 @@
 #define GG_USER_BLOCKED 0x04	/* zablokowany użytkownik */
 
 #define GG_LIST_EMPTY 0x0012
-	
+
 #define GG_NOTIFY_REPLY 0x000c	/* tak, to samo co GG_LOGIN */
-	
+
 struct gg_notify_reply {
 	uint32_t uin;			/* numerek */
 	uint32_t status;		/* status danej osoby */
@@ -1100,7 +1102,7 @@
 } GG_PACKED;
 
 #define GG_NOTIFY_REPLY60 0x0011
-	
+
 struct gg_notify_reply60 {
 	uint32_t uin;			/* numerek plus flagi w MSB */
 	uint8_t status;			/* status danej osoby */
@@ -1112,7 +1114,7 @@
 } GG_PACKED;
 
 #define GG_STATUS60 0x000f
-	
+
 struct gg_status60 {
 	uint32_t uin;			/* numerek plus flagi w MSB */
 	uint8_t status;			/* status danej osoby */
@@ -1125,7 +1127,7 @@
 
 #define GG_ADD_NOTIFY 0x000d
 #define GG_REMOVE_NOTIFY 0x000e
-	
+
 struct gg_add_remove {
 	uint32_t uin;			/* numerek */
 	uint8_t dunno1;			/* bitmapa */
@@ -1137,7 +1139,7 @@
 	uint32_t uin;			/* numerek */
 	uint32_t status;		/* nowy stan */
 } GG_PACKED;
-	
+
 #define GG_SEND_MSG 0x000b
 
 #define GG_CLASS_QUEUED 0x0001
@@ -1157,13 +1159,13 @@
 } GG_PACKED;
 
 struct gg_msg_richtext {
-	uint8_t flag;		
-	uint16_t length;	  
+	uint8_t flag;
+	uint16_t length;
 } GG_PACKED;
 
 struct gg_msg_richtext_format {
 	uint16_t position;
-	uint8_t font;	  
+	uint8_t font;
 } GG_PACKED;
 
 struct gg_msg_richtext_image {
@@ -1178,7 +1180,7 @@
 #define GG_FONT_COLOR 0x08
 #define GG_FONT_IMAGE 0x80
 
-struct gg_msg_richtext_color { 
+struct gg_msg_richtext_color {
 	uint8_t red;
 	uint8_t green;
 	uint8_t blue;
@@ -1210,7 +1212,7 @@
 #define GG_ACK_QUEUED 0x0003
 #define GG_ACK_MBOXFULL 0x0004
 #define GG_ACK_NOT_DELIVERED 0x0006
-	
+
 struct gg_send_msg_ack {
 	uint32_t status;
 	uint32_t recipient;
@@ -1218,7 +1220,7 @@
 } GG_PACKED;
 
 #define GG_RECV_MSG 0x000a
-	
+
 struct gg_recv_msg {
 	uint32_t sender;
 	uint32_t seq;
@@ -1227,7 +1229,7 @@
 } GG_PACKED;
 
 #define GG_PING 0x0008
-	
+
 #define GG_PONG 0x0007
 
 #define GG_DISCONNECTING 0x000b
@@ -1289,10 +1291,10 @@
 #define GG_DCC_TIMEOUT_VOICE_ACK 300	/* 5 minut */
 
 #ifdef __cplusplus
-}
-#ifdef _WIN32
+#ifdef _MSC_VER
 #pragma pack(pop)
 #endif
+}
 #endif
 
 #endif /* __GG_LIBGADU_H */