Sync up miranda files with current libsipe branch
[siplcs.git] / src / miranda / miranda-private.h
blobeb6dd93951f1d02f65573fb9f52a22ccf5edb1ea
1 #define SIPSIMPLE_PROTOCOL_NAME LPGEN("SIP/SIMPLE")
2 #define SIP_UNIQUEID "sip_screenname"
4 #define snprintf sprintf_s
6 typedef struct sipe_backend_private
8 PROTO_INTERFACE proto;
9 struct sipe_core_public *sip;
10 HANDLE m_hServerNetlibUser;
11 } SIPPROTO;
13 struct miranda_sipe_ack_args
15 HANDLE hContact;
16 int nAckType;
17 int nAckResult;
18 HANDLE hSequence;
19 LPARAM pszMessage;
22 typedef enum
24 SIPE_MIRANDA_INPUT_READ = 1 << 0, /**< A read condition. */
25 SIPE_MIRANDA_INPUT_WRITE = 1 << 1 /**< A write condition. */
27 } sipe_miranda_input_condition;
29 /** The type of callbacks to handle events on file descriptors, as passed to
30 * sipe_input_add(). The callback will receive the @c user_data passed to
31 * sipe_input_add(), the file descriptor on which the event occurred, and the
32 * condition that was satisfied to cause the callback to be invoked.
34 typedef void (*sipe_miranda_input_function)(gpointer, gint, sipe_miranda_input_condition);
36 typedef struct sipe_miranda_sel_entry
38 int sig;
39 HANDLE fd;
40 sipe_miranda_input_function func;
41 gpointer user_data;
45 typedef INT_PTR (*SipSimpleServiceFunc)( SIPPROTO*, WPARAM, LPARAM );
46 typedef int (*SipSimpleEventFunc)( SIPPROTO*, WPARAM, LPARAM );
47 typedef void (*SipSimpleThreadFunc)( SIPPROTO*, void* );
49 #define _PVTDATAI(sip) ((struct miranda_sipe_private_data*)sip->sipe_public.backend_private)
50 #define _PVTDATA ((struct miranda_sipe_private_data*)sip->sipe_public.backend_private)
52 #define _NI(string) SIPE_DEBUG_INFO( "%s:%s (%d) ##NOT IMPLEMENTED## %s", __FILE__, __FUNCTION__, __LINE__, #string )
53 #define _NIF() _NI("")
55 gchar* sipe_miranda_getContactString(const SIPPROTO *pr, HANDLE hContact, const gchar* name);
56 gchar* sipe_miranda_getString(const SIPPROTO *pr, const gchar* name);
57 int sipe_miranda_getStaticString(const SIPPROTO *pr, HANDLE hContact, const gchar* valueName, gchar* dest, unsigned dest_len);
58 DWORD sipe_miranda_getDword( const SIPPROTO *pr, HANDLE hContact, const gchar* name, DWORD* rv);
59 gboolean sipe_miranda_get_bool(const SIPPROTO *pr, const gchar *name, gboolean defval);
61 void sipe_miranda_setContactString(const SIPPROTO *pr, HANDLE hContact, const gchar* name, const gchar* value);
62 void sipe_miranda_setContactStringUtf(const SIPPROTO *pr, HANDLE hContact, const gchar* valueName, const gchar* parValue );
63 void sipe_miranda_setString(const SIPPROTO *pr, const gchar* name, const gchar* value);
64 void sipe_miranda_setStringUtf(const SIPPROTO *pr, const gchar* name, const gchar* value);
65 int sipe_miranda_setWord(const SIPPROTO *pr, HANDLE hContact, const gchar* szSetting, WORD wValue);
67 struct sipe_miranda_sel_entry* sipe_miranda_input_add(HANDLE fd, sipe_miranda_input_condition cond, sipe_miranda_input_function func, gpointer user_data);
68 gboolean sipe_miranda_input_remove(struct sipe_miranda_sel_entry *entry);
70 int SendBroadcast(SIPPROTO *pr, HANDLE hContact,int type,int result,HANDLE hProcess,LPARAM lParam);
72 gchar* sipe_miranda_eliminate_html(const gchar *string, int len);
73 unsigned short sipe_miranda_network_get_port_from_fd( HANDLE fd );
75 /* Plugin interface functions */
76 int sipe_miranda_SendMsg(SIPPROTO *pr, HANDLE hContact, int flags, const char* msg );
77 int sipe_miranda_RecvMsg(SIPPROTO *pr, HANDLE hContact, PROTORECVEVENT* pre);