comparison libpurple/protocols/oscar/util.c @ 30406:f18b6eb0ed02

Cleanup, basically. Move the icbm snac error handling from oscar.c to family_icbm.c so we don't have to bother we va_args. This is simpler, and gives us the benefit of type checking by the compiler, which will help avoid the crash bug we encountered.
author Mark Doliner <mark@kingant.net>
date Thu, 20 May 2010 02:44:00 +0000
parents 74e487f82f39
children e5575248ca82 9881f18b95b1
comparison
equal deleted inserted replaced
30405:c1b8e619f1b8 30406:f18b6eb0ed02
32 #include <ctype.h> 32 #include <ctype.h>
33 33
34 #ifdef _WIN32 34 #ifdef _WIN32
35 #include "win32dep.h" 35 #include "win32dep.h"
36 #endif 36 #endif
37
38 static const char * const msgerrreason[] = {
39 N_("Invalid error"),
40 N_("Invalid SNAC"),
41 N_("Rate to host"),
42 N_("Rate to client"),
43 N_("Not logged in"),
44 N_("Service unavailable"),
45 N_("Service not defined"),
46 N_("Obsolete SNAC"),
47 N_("Not supported by host"),
48 N_("Not supported by client"),
49 N_("Refused by client"),
50 N_("Reply too big"),
51 N_("Responses lost"),
52 N_("Request denied"),
53 N_("Busted SNAC payload"),
54 N_("Insufficient rights"),
55 N_("In local permit/deny"),
56 N_("Warning level too high (sender)"),
57 N_("Warning level too high (receiver)"),
58 N_("User temporarily unavailable"),
59 N_("No match"),
60 N_("List overflow"),
61 N_("Request ambiguous"),
62 N_("Queue full"),
63 N_("Not while on AOL")
64 };
65 static const int msgerrreasonlen = G_N_ELEMENTS(msgerrreason);
66
67 const char *oscar_get_msgerr_reason(size_t reason)
68 {
69 return (reason < msgerrreasonlen) ? _(msgerrreason[reason]) : _("Unknown reason");
70 }
37 71
38 int oscar_get_ui_info_int(const char *str, int default_value) 72 int oscar_get_ui_info_int(const char *str, int default_value)
39 { 73 {
40 GHashTable *ui_info; 74 GHashTable *ui_info;
41 75