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