Sat, 16 Dec 2006 04:59:55 +0000
This is a hand-crafted commit to migrate across subversion revisions
16854:16861, due to some vagaries of the way the original renames were
done. Witness that monotone can do in one revision what svn had to
spread across several.
| 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 | ||
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13033
diff
changeset
|
54 | const char * |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
55 | gaim_date_format_full(tm) |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
56 | const struct tm *tm |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13033
diff
changeset
|
57 | |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13033
diff
changeset
|
58 | const char * |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13033
diff
changeset
|
59 | gaim_date_format_long(tm) |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13033
diff
changeset
|
60 | const struct tm *tm |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13033
diff
changeset
|
61 | |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13033
diff
changeset
|
62 | const char * |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13033
diff
changeset
|
63 | gaim_date_format_short(tm) |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13033
diff
changeset
|
64 | const struct tm *tm |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13033
diff
changeset
|
65 | |
| 12783 | 66 | gboolean |
| 11118 | 67 | gaim_email_is_valid(address) |
| 68 | const char *address | |
| 69 | ||
| 70 | const char * | |
| 71 | gaim_escape_filename(str) | |
| 72 | const char *str | |
| 73 | ||
| 74 | char * | |
| 75 | gaim_fd_get_ip(fd) | |
| 76 | int fd | |
| 77 | ||
| 78 | const gchar * | |
| 79 | gaim_home_dir() | |
| 80 | ||
| 12783 | 81 | gboolean |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13033
diff
changeset
|
82 | gaim_markup_extract_info_field(str, len, dest, start_token, skip, end_token, check_value, no_value_token, display_name, is_link, link_prefix, format_cb) |
| 11118 | 83 | const char *str |
| 84 | int len | |
| 85 | GString *dest | |
| 86 | const char *start_token | |
| 87 | int skip | |
| 88 | const char *end_token | |
| 89 | char check_value | |
| 90 | const char *no_value_token | |
| 91 | const char *display_name | |
| 92 | gboolean is_link | |
| 93 | const char *link_prefix | |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13033
diff
changeset
|
94 | Gaim::Util::InfoFieldFormatCallback format_cb |
| 11118 | 95 | |
| 12783 | 96 | gboolean |
| 11118 | 97 | gaim_markup_find_tag(needle, haystack, start, end, attributes) |
| 98 | const char *needle | |
| 99 | const char *haystack | |
| 100 | const char **start | |
| 101 | const char **end | |
| 102 | GData **attributes | |
| 103 | ||
| 104 | char * | |
| 105 | gaim_markup_get_tag_name(tag) | |
| 106 | const char *tag | |
| 107 | ||
| 12783 | 108 | void |
| 11118 | 109 | gaim_markup_html_to_xhtml(html, dest_xhtml, dest_plain) |
| 110 | const char *html | |
| 111 | char **dest_xhtml | |
| 112 | char **dest_plain | |
| 113 | ||
| 114 | char * | |
| 115 | gaim_markup_linkify(str) | |
| 116 | const char *str | |
| 117 | ||
| 118 | char * | |
| 119 | gaim_markup_slice(str, x, y) | |
| 120 | const char *str | |
| 121 | guint x | |
| 122 | guint y | |
| 123 | ||
| 124 | char * | |
| 125 | gaim_markup_strip_html(str) | |
| 126 | const char *str | |
| 127 | ||
| 12783 | 128 | gboolean |
| 11118 | 129 | gaim_message_meify(message, len) |
| 130 | char *message | |
| 131 | size_t len | |
| 132 | ||
| 133 | FILE * | |
| 134 | gaim_mkstemp(path, binary) | |
| 135 | char **path | |
| 136 | gboolean binary | |
| 137 | ||
| 138 | const char * | |
| 139 | gaim_normalize(account, str) | |
| 140 | Gaim::Account account | |
| 141 | const char *str | |
| 142 | ||
| 12783 | 143 | gboolean |
| 11118 | 144 | gaim_program_is_valid(program) |
| 145 | const char *program | |
| 146 | ||
| 147 | char * | |
| 148 | gaim_str_add_cr(str) | |
| 149 | const char *str | |
| 150 | ||
| 151 | char * | |
| 152 | gaim_str_binary_to_ascii(binary, len) | |
| 153 | const unsigned char *binary | |
| 154 | guint len | |
| 155 | ||
| 12783 | 156 | gboolean |
| 11118 | 157 | gaim_str_has_prefix(s, p) |
| 158 | const char *s | |
| 159 | const char *p | |
| 160 | ||
| 12783 | 161 | gboolean |
| 11118 | 162 | gaim_str_has_suffix(s, x) |
| 163 | const char *s | |
| 164 | const char *x | |
| 165 | ||
| 166 | char * | |
| 167 | gaim_str_seconds_to_string(sec) | |
| 168 | guint sec | |
| 169 | ||
| 170 | char * | |
| 171 | gaim_str_size_to_units(size) | |
| 172 | size_t size | |
| 173 | ||
| 12783 | 174 | void |
|
11920
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11290
diff
changeset
|
175 | gaim_str_strip_char(str, thechar) |
| 11118 | 176 | char *str |
|
11920
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11290
diff
changeset
|
177 | char thechar |
| 11118 | 178 | |
| 12783 | 179 | time_t |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
180 | gaim_str_to_time(timestamp, utc = FALSE, tm = NULL, tz_off = NULL, rest = NULL) |
| 11118 | 181 | const char *timestamp |
| 182 | gboolean utc | |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
183 | struct tm *tm |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
184 | long *tz_off |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
185 | const char **rest |
| 11118 | 186 | |
| 187 | gchar * | |
| 188 | gaim_strcasereplace(string, delimiter, replacement) | |
| 189 | const char *string | |
| 190 | const char *delimiter | |
| 191 | const char *replacement | |
| 192 | ||
| 193 | const char * | |
| 194 | gaim_strcasestr(haystack, needle) | |
| 195 | const char *haystack | |
| 196 | const char *needle | |
| 197 | ||
| 198 | gchar * | |
| 199 | gaim_strdup_withhtml(src) | |
| 200 | const gchar *src | |
| 201 | ||
| 202 | gchar * | |
| 203 | gaim_strreplace(string, delimiter, replacement) | |
| 204 | const char *string | |
| 205 | const char *delimiter | |
| 206 | const char *replacement | |
| 207 | ||
| 208 | char * | |
| 209 | gaim_text_strip_mnemonic(in) | |
| 210 | const char *in | |
| 211 | ||
| 12783 | 212 | time_t |
| 11118 | 213 | gaim_time_build(year, month, day, hour, min, sec) |
| 214 | int year | |
| 215 | int month | |
| 216 | int day | |
| 217 | int hour | |
| 218 | int min | |
| 219 | int sec | |
| 220 | ||
| 221 | const char * | |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13033
diff
changeset
|
222 | gaim_time_format(tm) |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13033
diff
changeset
|
223 | const struct tm *tm |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13033
diff
changeset
|
224 | |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13033
diff
changeset
|
225 | const char * |
| 11118 | 226 | gaim_unescape_filename(str) |
| 227 | const char *str | |
| 228 | ||
| 229 | char * | |
| 230 | gaim_unescape_html(html) | |
| 231 | const char *html | |
| 232 | ||
| 233 | const char * | |
| 234 | gaim_url_decode(str) | |
| 235 | const char *str | |
| 236 | ||
| 237 | const char * | |
| 238 | gaim_url_encode(str) | |
| 239 | const char *str | |
| 240 | ||
| 12783 | 241 | gboolean |
| 11118 | 242 | gaim_url_parse(url, ret_host, ret_port, ret_path, ret_user, ret_passwd) |
| 243 | const char *url | |
| 244 | char **ret_host | |
| 245 | int *ret_port | |
| 246 | char **ret_path | |
| 247 | char **ret_user | |
| 248 | char **ret_passwd | |
| 249 | ||
| 250 | const char * | |
| 251 | gaim_user_dir() | |
| 252 | ||
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13033
diff
changeset
|
253 | const char * |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13033
diff
changeset
|
254 | gaim_utf8_strftime(const char *format, const struct tm *tm); |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13033
diff
changeset
|
255 | |
| 12783 | 256 | void |
| 11118 | 257 | gaim_util_set_user_dir(dir) |
| 258 | const char *dir | |
| 259 | ||
| 12783 | 260 | gboolean |
| 11118 | 261 | gaim_util_write_data_to_file(filename, data, size) |
| 262 | const char *filename | |
| 263 | const char *data | |
| 264 | size_t size |