annotate plugins/perl/common/Util.xs @ 11726:6e0986c82bc5

[gaim-migrate @ 14017] g_utf8_validate() and g_convert() accept -1 as a length argument, so there's no need to call strlen() ourselves. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Sat, 22 Oct 2005 22:58:16 +0000
parents b284c703d398
children 52f27ffe68a5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
1 #include "module.h"
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
2
11290
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
3 typedef struct {
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
4 char *cb;
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
5 } GaimPerlUrlData;
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
6
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
7 void gaim_perl_util_url_cb(void *data, const char *url_data, size_t size) {
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
8 GaimPerlUrlData *gpr = (GaimPerlUrlData *)data;
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
9 dSP;
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
10 ENTER;
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
11 SAVETMPS;
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
12 PUSHMARK(sp);
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
13
11290
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
14 XPUSHs(sv_2mortal(newSVpv(url_data, 0)));
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
15 PUTBACK;
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
16
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
17 call_pv(gpr->cb, G_EVAL | G_SCALAR);
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
18 SPAGAIN;
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
19
11290
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
20 PUTBACK;
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
21 FREETMPS;
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
22 LEAVE;
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
23 }
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
24
11290
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
25
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
26 MODULE = Gaim::Util PACKAGE = Gaim::Util PREFIX = gaim_
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
27 PROTOTYPES: ENABLE
11290
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
28
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
29 void
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
30 gaim_url_fetch(handle, url, full, user_agent, http11, cb)
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
31 Gaim::Plugin handle
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
32 const char *url
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
33 gboolean full
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
34 const char *user_agent
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
35 gboolean http11
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
36 SV * cb
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
37 CODE:
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
38 GaimPerlUrlData *gpr;
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
39 STRLEN len;
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
40 char *basename, *package;
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
41
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
42 basename = g_path_get_basename(handle->path);
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
43 gaim_perl_normalize_script_name(basename);
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
44 package = g_strdup_printf("Gaim::Script::%s", basename);
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
45 gpr = g_new(GaimPerlUrlData, 1);
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
46
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
47 gpr->cb = g_strdup_printf("%s::%s", package, SvPV(cb, len));
b284c703d398 [gaim-migrate @ 13490]
John H. Kelm <johnkelm@gmail.com>
parents: 11118
diff changeset
48 gaim_url_fetch(url, full, user_agent, http11, gaim_perl_util_url_cb, gpr);
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
49
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
50 int
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
51 gaim_build_dir(path, mode)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
52 const char *path
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
53 int mode
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
54
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
55 const char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
56 gaim_date()
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
57
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
58
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
59 const char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
60 gaim_date_full()
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
61
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
62
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
63 gboolean
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
64 gaim_email_is_valid(address)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
65 const char *address
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
66
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
67 const char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
68 gaim_escape_filename(str)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
69 const char *str
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
70
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
71 char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
72 gaim_fd_get_ip(fd)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
73 int fd
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
74
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
75 const gchar *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
76 gaim_home_dir()
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
77
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
78
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
79 gboolean
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
80 gaim_markup_extract_info_field(str, len, dest, start_token, skip, end_token, check_value, no_value_token, display_name, is_link, link_prefix)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
81 const char *str
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
82 int len
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
83 GString *dest
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
84 const char *start_token
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
85 int skip
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
86 const char *end_token
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
87 char check_value
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
88 const char *no_value_token
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
89 const char *display_name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
90 gboolean is_link
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
91 const char *link_prefix
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
92
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
93 gboolean
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
94 gaim_markup_find_tag(needle, haystack, start, end, attributes)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
95 const char *needle
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
96 const char *haystack
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
97 const char **start
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
98 const char **end
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
99 GData **attributes
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
100
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
101 char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
102 gaim_markup_get_tag_name(tag)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
103 const char *tag
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
104
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
105 void
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
106 gaim_markup_html_to_xhtml(html, dest_xhtml, dest_plain)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
107 const char *html
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
108 char **dest_xhtml
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
109 char **dest_plain
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
110
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
111 char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
112 gaim_markup_linkify(str)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
113 const char *str
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
114
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
115 char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
116 gaim_markup_slice(str, x, y)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
117 const char *str
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
118 guint x
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
119 guint y
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
120
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
121 char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
122 gaim_markup_strip_html(str)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
123 const char *str
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
124
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
125 gboolean
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
126 gaim_message_meify(message, len)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
127 char *message
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
128 size_t len
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
129
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
130 FILE *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
131 gaim_mkstemp(path, binary)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
132 char **path
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
133 gboolean binary
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
134
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
135 const char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
136 gaim_normalize(account, str)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
137 Gaim::Account account
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
138 const char *str
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
139
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
140 gboolean
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
141 gaim_program_is_valid(program)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
142 const char *program
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
143
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
144 char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
145 gaim_str_add_cr(str)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
146 const char *str
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
147
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
148 char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
149 gaim_str_binary_to_ascii(binary, len)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
150 const unsigned char *binary
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
151 guint len
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
152
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
153 gboolean
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
154 gaim_str_has_prefix(s, p)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
155 const char *s
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
156 const char *p
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
157
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
158 gboolean
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
159 gaim_str_has_suffix(s, x)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
160 const char *s
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
161 const char *x
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
162
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
163 char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
164 gaim_str_seconds_to_string(sec)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
165 guint sec
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
166
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
167 char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
168 gaim_str_size_to_units(size)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
169 size_t size
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
170
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
171 void
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
172 gaim_str_strip_cr(str)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
173 char *str
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
174
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
175 gchar *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
176 gaim_str_sub_away_formatters(str, name)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
177 const char *str
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
178 const char *name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
179
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
180 time_t
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
181 gaim_str_to_time(timestamp, utc)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
182 const char *timestamp
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
183 gboolean utc
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
184
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
185 gchar *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
186 gaim_strcasereplace(string, delimiter, replacement)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
187 const char *string
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
188 const char *delimiter
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
189 const char *replacement
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
190
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
191 const char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
192 gaim_strcasestr(haystack, needle)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
193 const char *haystack
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
194 const char *needle
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
195
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
196 gchar *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
197 gaim_strdup_withhtml(src)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
198 const gchar *src
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
199
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
200 size_t
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
201 gaim_strftime(s, max, format, tm)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
202 char *s
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
203 size_t max
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
204 const char *format
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
205 const struct tm *tm
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
206
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
207 gchar *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
208 gaim_strreplace(string, delimiter, replacement)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
209 const char *string
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
210 const char *delimiter
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
211 const char *replacement
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
212
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
213 char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
214 gaim_text_strip_mnemonic(in)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
215 const char *in
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
216
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
217 time_t
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
218 gaim_time_build(year, month, day, hour, min, sec)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
219 int year
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
220 int month
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
221 int day
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
222 int hour
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
223 int min
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
224 int sec
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
225
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
226 const char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
227 gaim_unescape_filename(str)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
228 const char *str
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
229
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
230 char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
231 gaim_unescape_html(html)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
232 const char *html
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
233
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
234 const char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
235 gaim_url_decode(str)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
236 const char *str
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
237
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
238 const char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
239 gaim_url_encode(str)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
240 const char *str
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
241
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
242
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
243
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
244 gboolean
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
245 gaim_url_parse(url, ret_host, ret_port, ret_path, ret_user, ret_passwd)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
246 const char *url
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
247 char **ret_host
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
248 int *ret_port
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
249 char **ret_path
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
250 char **ret_user
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
251 char **ret_passwd
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
252
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
253 const char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
254 gaim_user_dir()
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
255
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
256
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
257 void
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
258 gaim_util_set_user_dir(dir)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
259 const char *dir
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
260
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
261 gboolean
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
262 gaim_util_write_data_to_file(filename, data, size)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
263 const char *filename
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
264 const char *data
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
265 size_t size
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
266