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