comparison src/status.c @ 10009:c124bef68132

[gaim-migrate @ 10926] Thou shalt NULL terminate va_lists! This fixes the crash-at-startup bug I mentioned in my commit of Dave West's stuff last night. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 10 Sep 2004 19:51:52 +0000
parents 9baedaca25c7
children 56e34a659db2
comparison
equal deleted inserted replaced
10008:50c1724d5e59 10009:c124bef68132
169 /************************************************************************** 169 /**************************************************************************
170 * GaimStatusType API 170 * GaimStatusType API
171 **************************************************************************/ 171 **************************************************************************/
172 GaimStatusType * 172 GaimStatusType *
173 gaim_status_type_new_full(GaimStatusPrimitive primitive, const char *id, 173 gaim_status_type_new_full(GaimStatusPrimitive primitive, const char *id,
174 const char *name, gboolean saveable, 174 const char *name, gboolean saveable,
175 gboolean user_settable, gboolean independent) 175 gboolean user_settable, gboolean independent)
176 { 176 {
177 GaimStatusType *status_type; 177 GaimStatusType *status_type;
178 178
179 g_return_val_if_fail(primitive != GAIM_STATUS_UNSET, NULL); 179 g_return_val_if_fail(primitive != GAIM_STATUS_UNSET, NULL);
180 g_return_val_if_fail(id != NULL, NULL); 180 g_return_val_if_fail(id != NULL, NULL);
192 return status_type; 192 return status_type;
193 } 193 }
194 194
195 GaimStatusType * 195 GaimStatusType *
196 gaim_status_type_new(GaimStatusPrimitive primitive, const char *id, 196 gaim_status_type_new(GaimStatusPrimitive primitive, const char *id,
197 const char *name, gboolean user_settable) 197 const char *name, gboolean user_settable)
198 { 198 {
199 g_return_val_if_fail(primitive != GAIM_STATUS_UNSET, NULL); 199 g_return_val_if_fail(primitive != GAIM_STATUS_UNSET, NULL);
200 g_return_val_if_fail(id != NULL, NULL); 200 g_return_val_if_fail(id != NULL, NULL);
201 g_return_val_if_fail(name != NULL, NULL); 201 g_return_val_if_fail(name != NULL, NULL);
202 202
903 presence = g_new0(GaimPresence, 1); 903 presence = g_new0(GaimPresence, 1);
904 904
905 presence->context = context; 905 presence->context = context;
906 906
907 presence->status_table = 907 presence->status_table =
908 g_hash_table_new_full(g_str_hash, g_str_equal, 908 g_hash_table_new_full(g_str_hash, g_str_equal,
909 g_free, (GFreeFunc)gaim_status_destroy); 909 g_free, (GFreeFunc)gaim_status_destroy);
910 910
911 return presence; 911 return presence;
912 } 912 }
913 913
914 GaimPresence * 914 GaimPresence *
915 gaim_presence_new_for_account(GaimAccount *account) 915 gaim_presence_new_for_account(GaimAccount *account)
916 { 916 {
917 GaimPresence *presence; 917 GaimPresence *presence;
918
918 g_return_val_if_fail(account != NULL, NULL); 919 g_return_val_if_fail(account != NULL, NULL);
919 920
920 presence = gaim_presence_new(GAIM_PRESENCE_CONTEXT_ACCOUNT); 921 presence = gaim_presence_new(GAIM_PRESENCE_CONTEXT_ACCOUNT);
921 presence->u.account = account; 922 presence->u.account = account;
922 presence->statuses = gaim_prpl_get_statuses(account, presence); 923 presence->statuses = gaim_prpl_get_statuses(account, presence);