Thu, 07 Apr 2005 14:55:02 +0000
[gaim-migrate @ 12431]
" The following log snippets should explain it: " --rlaager
(20:24:00) rlaager: Regarding the signal handling
conversation the other day... I've written a patch to stop
calling signal handlers and return as soon as we find one
signal handler that returns TRUE to indicate that it's
handled the signal. Is this the right approach?
(20:24:22) Ethan Blanton (Paco-Paco): the trouble is that it's
documented to behave exactly the way it does
(20:24:31) Ethan Blanton (Paco-Paco): so changing it is
notbackwards compatible
(20:24:31) rlaager: I'm talking for HEAD.
(20:24:41) Ethan Blanton (Paco-Paco): oh, I think that's a
good approach, yes
(20:24:53) rlaager: The way I've described is how I
*expected* it to work, having not read the documentation.
(20:25:09) Ethan Blanton (Paco-Paco): I'm convinced
(20:27:04) Stu Tomlinson (nosnilmot): rlaager: this, I
assume, breaks the generic-ness of signals, by assuming
that any that return values return booleans?
(20:27:26) Ethan Blanton (Paco-Paco): please break it
(20:27:33) Ethan Blanton (Paco-Paco): we already have
out-parameters
(20:27:42) rlaager: nosnilmot: from what I can see, the
return type is handled as a (void *)... so I'm checking that
ret_value != NULL
(20:27:57) rlaager: nosnilmot: that's the correct way to do it,
right?
...
(20:29:01) Ethan Blanton (Paco-Paco): allowing a
meaningful return value is an over-engineering
(20:30:07) rlaager: even after this patch, you should be able
to return meaningful return values
(20:30:15) rlaager: it'll just short-circuit on the first handler
that does
committer: Luke Schierer <lschiere@pidgin.im>
| 8849 | 1 | /* |
| 2 | ||
| 3 | silcgaim.h | |
| 4 | ||
| 5 | Author: Pekka Riikonen <priikone@silcnet.org> | |
| 6 | ||
| 7 | Copyright (C) 2004 Pekka Riikonen | |
| 8 | ||
| 9 | This program is free software; you can redistribute it and/or modify | |
| 10 | it under the terms of the GNU General Public License as published by | |
| 11 | the Free Software Foundation; version 2 of the License. | |
| 12 | ||
| 13 | This program is distributed in the hope that it will be useful, | |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | GNU General Public License for more details. | |
| 17 | ||
| 18 | */ | |
| 19 | ||
| 20 | #ifndef SILCGAIM_H | |
| 21 | #define SILCGAIM_H | |
| 22 | ||
| 23 | /* Gaim includes */ | |
| 24 | #include "internal.h" | |
| 25 | #include "account.h" | |
| 26 | #include "accountopt.h" | |
|
10246
aa5bff72f94c
[gaim-migrate @ 11386]
Mark Doliner <markdoliner@pidgin.im>
parents:
10050
diff
changeset
|
27 | #include "cmds.h" |
|
aa5bff72f94c
[gaim-migrate @ 11386]
Mark Doliner <markdoliner@pidgin.im>
parents:
10050
diff
changeset
|
28 | #include "conversation.h" |
| 8849 | 29 | #include "debug.h" |
|
10246
aa5bff72f94c
[gaim-migrate @ 11386]
Mark Doliner <markdoliner@pidgin.im>
parents:
10050
diff
changeset
|
30 | #include "ft.h" |
| 8849 | 31 | #include "notify.h" |
| 32 | #include "prpl.h" | |
| 33 | #include "request.h" | |
|
10246
aa5bff72f94c
[gaim-migrate @ 11386]
Mark Doliner <markdoliner@pidgin.im>
parents:
10050
diff
changeset
|
34 | #include "roomlist.h" |
| 8849 | 35 | #include "server.h" |
| 36 | #include "util.h" | |
| 37 | ||
| 38 | /* Default public and private key file names */ | |
| 39 | #define SILCGAIM_PUBLIC_KEY_NAME "public_key.pub" | |
| 40 | #define SILCGAIM_PRIVATE_KEY_NAME "private_key.prv" | |
| 41 | ||
| 42 | /* Default settings for creating key pair */ | |
| 43 | #define SILCGAIM_DEF_PKCS "rsa" | |
| 44 | #define SILCGAIM_DEF_PKCS_LEN 2048 | |
| 45 | ||
| 46 | #define SILCGAIM_PRVGRP 0x001fffff | |
| 47 | ||
|
10050
78e480f768f2
[gaim-migrate @ 11011]
Dave West <kat@users.sourceforge.net>
parents:
9917
diff
changeset
|
48 | /* Status IDs */ |
|
78e480f768f2
[gaim-migrate @ 11011]
Dave West <kat@users.sourceforge.net>
parents:
9917
diff
changeset
|
49 | #define SILCGAIM_STATUS_ID_OFFLINE "offline" |
|
78e480f768f2
[gaim-migrate @ 11011]
Dave West <kat@users.sourceforge.net>
parents:
9917
diff
changeset
|
50 | #define SILCGAIM_STATUS_ID_ONLINE "online" |
|
78e480f768f2
[gaim-migrate @ 11011]
Dave West <kat@users.sourceforge.net>
parents:
9917
diff
changeset
|
51 | #define SILCGAIM_STATUS_ID_HYPER "hyper" |
|
78e480f768f2
[gaim-migrate @ 11011]
Dave West <kat@users.sourceforge.net>
parents:
9917
diff
changeset
|
52 | #define SILCGAIM_STATUS_ID_AWAY "away" |
|
78e480f768f2
[gaim-migrate @ 11011]
Dave West <kat@users.sourceforge.net>
parents:
9917
diff
changeset
|
53 | #define SILCGAIM_STATUS_ID_BUSY "busy" |
|
78e480f768f2
[gaim-migrate @ 11011]
Dave West <kat@users.sourceforge.net>
parents:
9917
diff
changeset
|
54 | #define SILCGAIM_STATUS_ID_INDISPOSED "indisposed" |
|
78e480f768f2
[gaim-migrate @ 11011]
Dave West <kat@users.sourceforge.net>
parents:
9917
diff
changeset
|
55 | #define SILCGAIM_STATUS_ID_PAGE "page" |
|
78e480f768f2
[gaim-migrate @ 11011]
Dave West <kat@users.sourceforge.net>
parents:
9917
diff
changeset
|
56 | |
| 8849 | 57 | typedef struct { |
| 58 | unsigned long id; | |
| 59 | const char *channel; | |
| 60 | unsigned long chid; | |
| 61 | const char *parentch; | |
| 62 | SilcChannelPrivateKey key; | |
| 63 | } *SilcGaimPrvgrp; | |
| 64 | ||
| 65 | /* The SILC Gaim plugin context */ | |
| 66 | typedef struct SilcGaimStruct { | |
| 67 | SilcClient client; | |
| 68 | SilcClientConnection conn; | |
| 69 | ||
| 70 | guint scheduler; | |
| 71 | GaimConnection *gc; | |
| 72 | GaimAccount *account; | |
| 73 | unsigned long channel_ids; | |
| 74 | GList *grps; | |
| 75 | ||
| 76 | char *motd; | |
| 77 | GaimRoomlist *roomlist; | |
| 78 | ||
| 79 | unsigned int detaching : 1; | |
| 80 | unsigned int resuming : 1; | |
| 81 | unsigned int roomlist_canceled : 1; | |
| 82 | unsigned int chpk : 1; | |
| 83 | } *SilcGaim; | |
| 84 | ||
| 85 | ||
| 86 | gboolean silcgaim_check_silc_dir(GaimConnection *gc); | |
| 87 | void silcgaim_chat_join_done(SilcClient client, | |
| 88 | SilcClientConnection conn, | |
| 89 | SilcClientEntry *clients, | |
| 90 | SilcUInt32 clients_count, | |
| 91 | void *context); | |
| 92 | const char *silcgaim_silcdir(void); | |
| 93 | const char *silcgaim_session_file(const char *account); | |
| 94 | void silcgaim_verify_public_key(SilcClient client, SilcClientConnection conn, | |
| 95 | const char *name, SilcSocketType conn_type, | |
| 96 | unsigned char *pk, SilcUInt32 pk_len, | |
| 97 | SilcSKEPKType pk_type, | |
| 98 | SilcVerifyPublicKey completion, void *context); | |
| 9038 | 99 | GList *silcgaim_buddy_menu(GaimBuddy *buddy); |
|
9288
a19f73556084
[gaim-migrate @ 10091]
Mark Doliner <markdoliner@pidgin.im>
parents:
9272
diff
changeset
|
100 | void silcgaim_add_buddy(GaimConnection *gc, GaimBuddy *buddy, GaimGroup *group); |
|
10341
92c66f97b73f
[gaim-migrate @ 11550]
Mark Doliner <markdoliner@pidgin.im>
parents:
10246
diff
changeset
|
101 | void silcgaim_add_buddies(GaimConnection *gc, GList *buddies, GList *groups); |
|
9288
a19f73556084
[gaim-migrate @ 10091]
Mark Doliner <markdoliner@pidgin.im>
parents:
9272
diff
changeset
|
102 | void silcgaim_remove_buddy(GaimConnection *gc, GaimBuddy *buddy, GaimGroup *group); |
| 8849 | 103 | void silcgaim_buddy_keyagr_request(SilcClient client, |
| 104 | SilcClientConnection conn, | |
| 105 | SilcClientEntry client_entry, | |
| 106 | const char *hostname, SilcUInt16 port); | |
| 107 | void silcgaim_idle_set(GaimConnection *gc, int idle); | |
| 108 | char *silcgaim_tooltip_text(GaimBuddy *b); | |
| 109 | char *silcgaim_status_text(GaimBuddy *b); | |
| 110 | gboolean silcgaim_ip_is_private(const char *ip); | |
|
9466
b6425eab60ca
[gaim-migrate @ 10291]
Daniel Atallah <datallah@pidgin.im>
parents:
9353
diff
changeset
|
111 | void silcgaim_ftp_send_file(GaimConnection *gc, const char *name, const char *file); |
| 8849 | 112 | void silcgaim_ftp_request(SilcClient client, SilcClientConnection conn, |
| 113 | SilcClientEntry client_entry, SilcUInt32 session_id, | |
| 114 | const char *hostname, SilcUInt16 port); | |
| 115 | void silcgaim_show_public_key(SilcGaim sg, | |
| 116 | const char *name, SilcPublicKey public_key, | |
| 117 | GCallback callback, void *context); | |
| 118 | void silcgaim_get_info(GaimConnection *gc, const char *who); | |
| 119 | SilcAttributePayload | |
| 120 | silcgaim_get_attr(SilcDList attrs, SilcAttribute attribute); | |
| 121 | void silcgaim_get_umode_string(SilcUInt32 mode, char *buf, | |
| 122 | SilcUInt32 buf_size); | |
| 123 | void silcgaim_get_chmode_string(SilcUInt32 mode, char *buf, | |
| 124 | SilcUInt32 buf_size); | |
| 125 | void silcgaim_get_chumode_string(SilcUInt32 mode, char *buf, | |
| 126 | SilcUInt32 buf_size); | |
| 127 | GList *silcgaim_chat_info(GaimConnection *gc); | |
| 9756 | 128 | GHashTable *silcgaim_chat_info_defaults(GaimConnection *gc, const char *chat_name); |
| 9038 | 129 | GList *silcgaim_chat_menu(GaimChat *); |
| 8849 | 130 | void silcgaim_chat_join(GaimConnection *gc, GHashTable *data); |
|
9917
2fbb3c9fab2b
[gaim-migrate @ 10809]
Daniel Atallah <datallah@pidgin.im>
parents:
9756
diff
changeset
|
131 | char *silcgaim_get_chat_name(GHashTable *data); |
| 8849 | 132 | void silcgaim_chat_invite(GaimConnection *gc, int id, const char *msg, |
| 133 | const char *name); | |
| 134 | void silcgaim_chat_leave(GaimConnection *gc, int id); | |
| 135 | int silcgaim_chat_send(GaimConnection *gc, int id, const char *msg); | |
| 136 | void silcgaim_chat_set_topic(GaimConnection *gc, int id, const char *topic); | |
| 137 | GaimRoomlist *silcgaim_roomlist_get_list(GaimConnection *gc); | |
| 138 | void silcgaim_roomlist_cancel(GaimRoomlist *list); | |
| 139 | void silcgaim_chat_chauth_show(SilcGaim sg, SilcChannelEntry channel, | |
| 140 | SilcBuffer channel_pubkeys); | |
|
9488
9d6520fa53fd
[gaim-migrate @ 10313]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9466
diff
changeset
|
141 | void silcgaim_parse_attrs(SilcDList attrs, char **moodstr, char **statusstr, |
|
9d6520fa53fd
[gaim-migrate @ 10313]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9466
diff
changeset
|
142 | char **contactstr, char **langstr, char **devicestr, |
|
9d6520fa53fd
[gaim-migrate @ 10313]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9466
diff
changeset
|
143 | char **tzstr, char **geostr); |
| 8849 | 144 | |
|
9353
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
145 | #ifdef _WIN32 |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
146 | typedef int uid_t; |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
147 | |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
148 | struct passwd { |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
149 | char *pw_name; /* user name */ |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
150 | char *pw_passwd; /* user password */ |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
151 | int pw_uid; /* user id */ |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
152 | int pw_gid; /* group id */ |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
153 | char *pw_gecos; /* real name */ |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
154 | char *pw_dir; /* home directory */ |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
155 | char *pw_shell; /* shell program */ |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
156 | }; |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
157 | |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
158 | struct passwd *getpwuid(int uid); |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
159 | int getuid(); |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
160 | int geteuid(); |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
161 | #endif |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
162 | |
| 8849 | 163 | #endif /* SILCGAIM_H */ |