Mercurial > pidgin.yaz
comparison src/account.c @ 5565:c3c4aaf69f65
[gaim-migrate @ 5967]
More goodies.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Fri, 30 May 2003 18:25:11 +0000 |
parents | 187c740f2a4e |
children | 5e7de337a053 |
comparison
equal
deleted
inserted
replaced
5564:187c740f2a4e | 5565:c3c4aaf69f65 |
---|---|
322 g_return_val_if_fail(account != NULL, FALSE); | 322 g_return_val_if_fail(account != NULL, FALSE); |
323 | 323 |
324 return account->remember_pass; | 324 return account->remember_pass; |
325 } | 325 } |
326 | 326 |
327 gboolean | |
328 gaim_account_get_check_mail(const GaimAccount *account) | |
329 { | |
330 g_return_val_if_fail(account != NULL, FALSE); | |
331 | |
332 return account->check_mail; | |
333 } | |
334 | |
327 int | 335 int |
328 gaim_account_get_int(const GaimAccount *account, const char *name, | 336 gaim_account_get_int(const GaimAccount *account, const char *name, |
329 int default_value) | 337 int default_value) |
330 { | 338 { |
331 GaimAccountSetting *setting; | 339 GaimAccountSetting *setting; |
332 | 340 |
333 g_return_val_if_fail(account != NULL, -1); | 341 g_return_val_if_fail(account != NULL, default_value); |
334 g_return_val_if_fail(name != NULL, -1); | 342 g_return_val_if_fail(name != NULL, default_value); |
335 | 343 |
336 setting = g_hash_table_lookup(account->settings, name); | 344 setting = g_hash_table_lookup(account->settings, name); |
337 | 345 |
338 if (setting == NULL) | 346 if (setting == NULL) |
339 return default_value; | 347 return default_value; |
340 | 348 |
341 g_return_val_if_fail(setting->type == GAIM_PREF_INT, -1); | 349 g_return_val_if_fail(setting->type == GAIM_PREF_INT, default_value); |
342 | 350 |
343 return setting->value.integer; | 351 return setting->value.integer; |
344 } | 352 } |
345 | 353 |
346 const char * | 354 const char * |
347 gaim_account_get_string(const GaimAccount *account, const char *name, | 355 gaim_account_get_string(const GaimAccount *account, const char *name, |
348 const char *default_value) | 356 const char *default_value) |
349 { | 357 { |
350 GaimAccountSetting *setting; | 358 GaimAccountSetting *setting; |
351 | 359 |
352 g_return_val_if_fail(account != NULL, NULL); | 360 g_return_val_if_fail(account != NULL, default_value); |
353 g_return_val_if_fail(name != NULL, NULL); | 361 g_return_val_if_fail(name != NULL, default_value); |
354 | 362 |
355 setting = g_hash_table_lookup(account->settings, name); | 363 setting = g_hash_table_lookup(account->settings, name); |
356 | 364 |
357 if (setting == NULL) | 365 if (setting == NULL) |
358 return default_value; | 366 return default_value; |
359 | 367 |
360 g_return_val_if_fail(setting->type == GAIM_PREF_STRING, NULL); | 368 g_return_val_if_fail(setting->type == GAIM_PREF_STRING, default_value); |
361 | 369 |
362 return setting->value.string; | 370 return setting->value.string; |
363 } | 371 } |
364 | 372 |
365 gboolean | 373 gboolean |
366 gaim_account_get_bool(const GaimAccount *account, const char *name, | 374 gaim_account_get_bool(const GaimAccount *account, const char *name, |
367 gboolean default_value) | 375 gboolean default_value) |
368 { | 376 { |
369 GaimAccountSetting *setting; | 377 GaimAccountSetting *setting; |
370 | 378 |
371 g_return_val_if_fail(account != NULL, FALSE); | 379 g_return_val_if_fail(account != NULL, default_value); |
372 g_return_val_if_fail(name != NULL, FALSE); | 380 g_return_val_if_fail(name != NULL, default_value); |
373 | 381 |
374 setting = g_hash_table_lookup(account->settings, name); | 382 setting = g_hash_table_lookup(account->settings, name); |
375 | 383 |
376 if (setting == NULL) | 384 if (setting == NULL) |
377 return default_value; | 385 return default_value; |
378 | 386 |
379 g_return_val_if_fail(setting->type == GAIM_PREF_BOOLEAN, FALSE); | 387 g_return_val_if_fail(setting->type == GAIM_PREF_BOOLEAN, default_value); |
380 | 388 |
381 return setting->value.bool; | 389 return setting->value.bool; |
382 } | 390 } |
383 | 391 |
384 GList * | 392 GList * |