annotate contrib/splicex/tools/im-steal/im-steal.c @ 823:8af3f6429824 draft

added onionnet.ano
author Nick <nick@somerandomnick.ano>
date Tue, 13 Dec 2011 07:21:10 +0000
parents a554ba2c1e81
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
697
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
1 /*
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
2 * Modified libpurple nullclient.c from http://pidgin.sourcearchive.com.
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
3 * This libpurple program serves no other purpose other than testing
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
4 * for a successfull login.
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
5 */
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
6
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
7 #include "purple.h"
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
8 #include <glib.h>
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
9 #include <signal.h>
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
10 #include <string.h>
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
11 #include <unistd.h>
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
12 #include <stdio.h>
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
13 #define CUSTOM_USER_DIRECTORY "/dev/null"
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
14 #define CUSTOM_PLUGIN_PATH ""
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
15 #define PLUGIN_SAVE_PREF "/purple/user/plugins/saved"
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
16 #define UI_ID "user"
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
17 #define PURPLE_GLIB_READ_COND (G_IO_IN | G_IO_HUP | G_IO_ERR)
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
18 #define PURPLE_GLIB_WRITE_COND (G_IO_OUT | G_IO_HUP | G_IO_ERR | G_IO_NVAL)
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
19
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
20 typedef struct _PurpleGLibIOClosure {
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
21 PurpleInputFunction function;
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
22 guint result;
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
23 gpointer data;
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
24 } PurpleGLibIOClosure;
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
25
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
26
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
27 static void purple_glib_io_destroy(gpointer data)
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
28 {
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
29 g_free(data);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
30 }
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
31
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
32 static gboolean purple_glib_io_invoke(GIOChannel *source, GIOCondition condition, gpointer data)
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
33 {
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
34 PurpleGLibIOClosure *closure = data;
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
35 PurpleInputCondition purple_cond = 0;
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
36
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
37 if (condition & PURPLE_GLIB_READ_COND)
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
38 purple_cond |= PURPLE_INPUT_READ;
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
39 if (condition & PURPLE_GLIB_WRITE_COND)
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
40 purple_cond |= PURPLE_INPUT_WRITE;
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
41
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
42 closure->function(closure->data, g_io_channel_unix_get_fd(source),
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
43 purple_cond);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
44
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
45 return TRUE;
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
46 }
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
47
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
48 static guint glib_input_add(gint fd, PurpleInputCondition condition, PurpleInputFunction function,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
49 gpointer data)
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
50 {
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
51 PurpleGLibIOClosure *closure = g_new0(PurpleGLibIOClosure, 1);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
52 GIOChannel *channel;
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
53 GIOCondition cond = 0;
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
54
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
55 closure->function = function;
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
56 closure->data = data;
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
57
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
58 if (condition & PURPLE_INPUT_READ)
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
59 cond |= PURPLE_GLIB_READ_COND;
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
60 if (condition & PURPLE_INPUT_WRITE)
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
61 cond |= PURPLE_GLIB_WRITE_COND;
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
62
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
63 channel = g_io_channel_unix_new(fd);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
64 closure->result = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT, cond,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
65 purple_glib_io_invoke, closure, purple_glib_io_destroy);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
66
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
67 g_io_channel_unref(channel);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
68 return closure->result;
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
69 }
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
70
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
71 static PurpleEventLoopUiOps glib_eventloops =
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
72 {
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
73 g_timeout_add,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
74 g_source_remove,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
75 glib_input_add,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
76 g_source_remove,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
77 NULL,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
78 #if GLIB_CHECK_VERSION(2,14,0)
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
79 g_timeout_add_seconds,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
80 #else
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
81 NULL,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
82 #endif
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
83 NULL,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
84 NULL,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
85 NULL
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
86 };
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
87
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
88 static void network_disconnected(void)
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
89 {
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
90 printf("This machine has been disconnected from the internet\n");
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
91 }
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
92
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
93 static void report_disconnect_reason(PurpleConnection *gc, PurpleConnectionError reason, const char *text)
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
94 {
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
95 PurpleAccount *account = purple_connection_get_account(gc);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
96 printf("Connection disconnected: \"%s\" (%s)\n >Error: %d\n >Reason: %s\n", purple_account_get_username(account), purple_account_get_protocol_id(account), reason, text);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
97 abort();
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
98 }
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
99
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
100 static PurpleConnectionUiOps connection_uiops =
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
101 {
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
102 NULL, /* connect_progress */
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
103 NULL, /* connected */
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
104 NULL, /* disconnected */
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
105 NULL, /* notice */
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
106 NULL, /* report_disconnect */
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
107 NULL, /* network_connected */
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
108 network_disconnected, /* network_disconnected */
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
109 report_disconnect_reason, /* report_disconnect_reason */
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
110 NULL,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
111 NULL,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
112 NULL
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
113 };
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
114
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
115 static void ui_init(void)
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
116 {
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
117 purple_connections_set_ui_ops(&connection_uiops);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
118 }
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
119
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
120 static PurpleCoreUiOps core_uiops =
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
121 {
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
122 NULL,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
123 NULL,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
124 ui_init,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
125 NULL,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
126
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
127 /* padding */
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
128 NULL,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
129 NULL,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
130 NULL,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
131 NULL
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
132 };
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
133
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
134 static void init_libpurple(void)
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
135 {
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
136 purple_debug_set_enabled(FALSE);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
137 purple_core_set_ui_ops(&core_uiops);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
138 purple_eventloop_set_ui_ops(&glib_eventloops);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
139
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
140 if (!purple_core_init(UI_ID)) {
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
141 fprintf(stderr,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
142 "libpurple initialization failed. Dumping core.\n"
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
143 "Please report this!\n");
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
144 abort();
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
145 }
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
146 purple_set_blist(purple_blist_new()); // "Unnecessary" code left here to prevent output spam.
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
147 }
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
148
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
149 static void signed_on(PurpleConnection *gc)
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
150 {
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
151 printf("Account Connected\n");
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
152 abort();
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
153 }
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
154
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
155 static void connect_to_signals(void)
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
156 {
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
157 static int handle;
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
158 purple_signal_connect(purple_connections_get_handle(), "signed-on", &handle,
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
159 PURPLE_CALLBACK(signed_on), NULL);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
160 }
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
161
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
162 int main(int argc, char *argv[])
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
163 {
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
164 GMainLoop *loop = g_main_loop_new(NULL, FALSE);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
165 signal(SIGCHLD, SIG_IGN);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
166 init_libpurple();
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
167 connect_to_signals();
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
168 PurpleAccount *account = purple_account_new(argv[2], argv[1]);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
169 purple_account_set_password(account, argv[3]);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
170 purple_accounts_add(account);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
171 purple_account_set_enabled(account, UI_ID, TRUE);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
172 g_main_loop_run(loop);
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
173 return 0;
a554ba2c1e81 SpliceX now compiles to true binary
d3v11 <d3v11@d3v11.ano>
parents:
diff changeset
174 }