Mercurial > pidgin
comparison src/protocols/yahoo/util.c @ 11644:f4e58e94ced3
[gaim-migrate @ 13922]
Yahoo! whitespace cleanup from Peter Lawler
Gracias!
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 12 Oct 2005 04:02:46 +0000 |
parents | 1e6bdc7175e9 |
children | 76d8b0032f50 |
comparison
equal
deleted
inserted
replaced
11643:eb14bbcf7249 | 11644:f4e58e94ced3 |
---|---|
98 return ret; | 98 return ret; |
99 else | 99 else |
100 return g_strdup(""); | 100 return g_strdup(""); |
101 } | 101 } |
102 | 102 |
103 | |
104 | |
105 /* | 103 /* |
106 * I found these on some website but i don't know that they actually | 104 * I found these on some website but i don't know that they actually |
107 * work (or are supposed to work). I didn't implement them yet. | 105 * work (or are supposed to work). I didn't implement them yet. |
108 * | 106 * |
109 * [0;30m ---black | 107 * [0;30m ---black |
120 * [0;34m ---blue | 118 * [0;34m ---blue |
121 * [0;36m ---aqua | 119 * [0;36m ---aqua |
122 * (shift+comma)lyellow(shift+period) ---light yellow | 120 * (shift+comma)lyellow(shift+period) ---light yellow |
123 * (shift+comma)lgreen(shift+period) ---light green | 121 * (shift+comma)lgreen(shift+period) ---light green |
124 [2;30m <--white out | 122 [2;30m <--white out |
125 | |
126 */ | 123 */ |
127 | |
128 | 124 |
129 static GHashTable *ht = NULL; | 125 static GHashTable *ht = NULL; |
130 | 126 |
131 void yahoo_init_colorht() | 127 void yahoo_init_colorht() |
132 { | 128 { |
154 * to be a link. gaim figures that out on its own so we | 150 * to be a link. gaim figures that out on its own so we |
155 * just ignore it. | 151 * just ignore it. |
156 */ | 152 */ |
157 g_hash_table_insert(ht, "l", ""); /* link start */ | 153 g_hash_table_insert(ht, "l", ""); /* link start */ |
158 g_hash_table_insert(ht, "xl", ""); /* link end */ | 154 g_hash_table_insert(ht, "xl", ""); /* link end */ |
159 | |
160 | 155 |
161 g_hash_table_insert(ht, "<black>", "<FONT COLOR=\"#000000\">"); | 156 g_hash_table_insert(ht, "<black>", "<FONT COLOR=\"#000000\">"); |
162 g_hash_table_insert(ht, "<blue>", "<FONT COLOR=\"#0000FF\">"); | 157 g_hash_table_insert(ht, "<blue>", "<FONT COLOR=\"#0000FF\">"); |
163 g_hash_table_insert(ht, "<cyan>", "<FONT COLOR=\"#008284\">"); | 158 g_hash_table_insert(ht, "<cyan>", "<FONT COLOR=\"#008284\">"); |
164 g_hash_table_insert(ht, "<gray>", "<FONT COLOR=\"#848284\">"); | 159 g_hash_table_insert(ht, "<gray>", "<FONT COLOR=\"#848284\">"); |
281 g_string_free(tmp, TRUE); | 276 g_string_free(tmp, TRUE); |
282 break; | 277 break; |
283 } | 278 } |
284 } | 279 } |
285 | 280 |
286 | |
287 } else if (!nomoreendtags && (x[i] == '<')) { | 281 } else if (!nomoreendtags && (x[i] == '<')) { |
288 j = i; | 282 j = i; |
289 | 283 |
290 while (j++ < xs) { | 284 while (j++ < xs) { |
291 if (x[j] != '>') | 285 if (x[j] != '>') |
322 g_string_free(tmp, TRUE); | 316 g_string_free(tmp, TRUE); |
323 break; | 317 break; |
324 } | 318 } |
325 | 319 |
326 } | 320 } |
327 | |
328 | |
329 | 321 |
330 } else { | 322 } else { |
331 if (x[i] == '<') | 323 if (x[i] == '<') |
332 g_string_append(s, "<"); | 324 g_string_append(s, "<"); |
333 else if (x[i] == '>') | 325 else if (x[i] == '>') |
474 } | 466 } |
475 | 467 |
476 if (src[m] == ' ') | 468 if (src[m] == ' ') |
477 *j = m; | 469 *j = m; |
478 | 470 |
479 | |
480 | |
481 if (src[m] == '>') { | 471 if (src[m] == '>') { |
482 gboolean needendtag = 0; | 472 gboolean needendtag = 0; |
483 fontattr *f; | 473 fontattr *f; |
484 GString *tmp = g_string_new(NULL); | 474 GString *tmp = g_string_new(NULL); |
485 char *colorstr; | 475 char *colorstr; |
558 char *ret, *esc; | 548 char *ret, *esc; |
559 GQueue *colors, *tags; | 549 GQueue *colors, *tags; |
560 GQueue *ftattr = NULL; | 550 GQueue *ftattr = NULL; |
561 gboolean no_more_specials = FALSE; | 551 gboolean no_more_specials = FALSE; |
562 | 552 |
563 | |
564 colors = g_queue_new(); | 553 colors = g_queue_new(); |
565 tags = g_queue_new(); | 554 tags = g_queue_new(); |
566 | |
567 dest = g_string_sized_new(strlen(src)); | 555 dest = g_string_sized_new(strlen(src)); |
568 | 556 |
569 for (i = 0, len = strlen(src); i < len; i++) { | 557 for (i = 0, len = strlen(src); i < len; i++) { |
570 | 558 |
571 if (!no_more_specials && src[i] == '<') { | 559 if (!no_more_specials && src[i] == '<') { |