comparison libpurple/account.c @ 18058:4ca97b26a8fb

Mark the return type const for the following functions. I noticed this while fixing some DBus stuff which I'll commit shortly. * purple_accounts_get_all * purple_connections_get_all * purple_connections_get_connecting * purple_conv_chat_get_ignored * purple_conv_chat_get_users * purple_get_chats * purple_get_conversations * purple_get_ims * purple_notify_user_info_get_entries References #1344
author Richard Laager <rlaager@wiktel.com>
date Thu, 07 Jun 2007 04:22:42 +0000
parents f2d8658b3a86
children 926ccb104da0
comparison
equal deleted inserted replaced
18057:23b03396e71e 18058:4ca97b26a8fb
369 369
370 static xmlnode * 370 static xmlnode *
371 accounts_to_xmlnode(void) 371 accounts_to_xmlnode(void)
372 { 372 {
373 xmlnode *node, *child; 373 xmlnode *node, *child;
374 GList *cur; 374 const GList *cur;
375 375
376 node = xmlnode_new("account"); 376 node = xmlnode_new("account");
377 xmlnode_set_attrib(node, "version", "1.0"); 377 xmlnode_set_attrib(node, "version", "1.0");
378 378
379 for (cur = purple_accounts_get_all(); cur != NULL; cur = cur->next) 379 for (cur = purple_accounts_get_all(); cur != NULL; cur = cur->next)
875 } 875 }
876 876
877 void 877 void
878 purple_account_destroy(PurpleAccount *account) 878 purple_account_destroy(PurpleAccount *account)
879 { 879 {
880 GList *l; 880 const GList *l;
881 881
882 g_return_if_fail(account != NULL); 882 g_return_if_fail(account != NULL);
883 883
884 purple_debug_info("account", "Destroying account %p\n", account); 884 purple_debug_info("account", "Destroying account %p\n", account);
885 885
2270 accounts = g_list_insert(accounts, account, new_index); 2270 accounts = g_list_insert(accounts, account, new_index);
2271 2271
2272 schedule_accounts_save(); 2272 schedule_accounts_save();
2273 } 2273 }
2274 2274
2275 GList * 2275 const GList *
2276 purple_accounts_get_all(void) 2276 purple_accounts_get_all(void)
2277 { 2277 {
2278 return accounts; 2278 return accounts;
2279 } 2279 }
2280 2280
2281 GList * 2281 GList *
2282 purple_accounts_get_all_active(void) 2282 purple_accounts_get_all_active(void)
2283 { 2283 {
2284 GList *list = NULL; 2284 GList *list = NULL;
2285 GList *all = purple_accounts_get_all(); 2285 const GList *all = purple_accounts_get_all();
2286 2286
2287 while (all != NULL) { 2287 while (all != NULL) {
2288 PurpleAccount *account = all->data; 2288 PurpleAccount *account = all->data;
2289 2289
2290 if (purple_account_get_enabled(account, purple_core_get_ui())) 2290 if (purple_account_get_enabled(account, purple_core_get_ui()))
2298 2298
2299 PurpleAccount * 2299 PurpleAccount *
2300 purple_accounts_find(const char *name, const char *protocol_id) 2300 purple_accounts_find(const char *name, const char *protocol_id)
2301 { 2301 {
2302 PurpleAccount *account = NULL; 2302 PurpleAccount *account = NULL;
2303 GList *l; 2303 const GList *l;
2304 char *who; 2304 char *who;
2305 2305
2306 g_return_val_if_fail(name != NULL, NULL); 2306 g_return_val_if_fail(name != NULL, NULL);
2307 2307
2308 who = g_strdup(purple_normalize(NULL, name)); 2308 who = g_strdup(purple_normalize(NULL, name));
2325 } 2325 }
2326 2326
2327 void 2327 void
2328 purple_accounts_restore_current_statuses() 2328 purple_accounts_restore_current_statuses()
2329 { 2329 {
2330 GList *l; 2330 const GList *l;
2331 PurpleAccount *account; 2331 PurpleAccount *account;
2332 2332
2333 /* If we're not connected to the Internet right now, we bail on this */ 2333 /* If we're not connected to the Internet right now, we bail on this */
2334 if (!purple_network_is_available()) 2334 if (!purple_network_is_available())
2335 { 2335 {