comparison libpurple/protocols/novell/nmrtf.c @ 15823:32c366eeeb99

sed -ie 's/gaim/purple/g'
author Sean Egan <seanegan@gmail.com>
date Mon, 19 Mar 2007 07:01:17 +0000
parents 5fe8042783c1
children 941965d6fd88
comparison
equal deleted inserted replaced
15822:84b0f9b23ede 15823:32c366eeeb99
231 ctx->input = (char *)input; 231 ctx->input = (char *)input;
232 status = rtf_parse(ctx); 232 status = rtf_parse(ctx);
233 if (status == NMRTF_OK) 233 if (status == NMRTF_OK)
234 return g_strdup(ctx->output->str); 234 return g_strdup(ctx->output->str);
235 235
236 gaim_debug_info("novell", "RTF parser failed with error code %d", status); 236 purple_debug_info("novell", "RTF parser failed with error code %d", status);
237 return NULL; 237 return NULL;
238 } 238 }
239 239
240 void 240 void
241 nm_rtf_deinit(NMRtfContext *ctx) 241 nm_rtf_deinit(NMRtfContext *ctx)
310 case 238: 310 case 238:
311 return "CP1250"; 311 return "CP1250";
312 case 254: 312 case 254:
313 return "CP437"; 313 return "CP437";
314 default: 314 default:
315 gaim_debug_info("novell", "Unhandled font charset %d\n", font->charset); 315 purple_debug_info("novell", "Unhandled font charset %d\n", font->charset);
316 return "CP1252"; 316 return "CP1252";
317 } 317 }
318 return "CP1252"; 318 return "CP1252";
319 } 319 }
320 320
329 329
330 font->number = number; 330 font->number = number;
331 font->name = g_strdup(name); 331 font->name = g_strdup(name);
332 font->charset = charset; 332 font->charset = charset;
333 333
334 gaim_debug_info("novell", "Adding font to table: #%d\t%s\t%d\n", 334 purple_debug_info("novell", "Adding font to table: #%d\t%s\t%d\n",
335 font->number, font->name, font->charset); 335 font->number, font->name, font->charset);
336 336
337 ctx->font_table = g_slist_append(ctx->font_table, font); 337 ctx->font_table = g_slist_append(ctx->font_table, font);
338 338
339 return NMRTF_OK; 339 return NMRTF_OK;
627 rtf_flush_data(ctx); 627 rtf_flush_data(ctx);
628 628
629 /* convert the unicode character to utf8 and add directly to the output buffer */ 629 /* convert the unicode character to utf8 and add directly to the output buffer */
630 num = g_unichar_to_utf8((gunichar) ch, buf); 630 num = g_unichar_to_utf8((gunichar) ch, buf);
631 buf[num] = 0; 631 buf[num] = 0;
632 gaim_debug_info("novell", "converted unichar 0x%X to utf8 char %s\n", ch, buf); 632 purple_debug_info("novell", "converted unichar 0x%X to utf8 char %s\n", ch, buf);
633 633
634 ctx->output = g_string_append(ctx->output, buf); 634 ctx->output = g_string_append(ctx->output, buf);
635 return NMRTF_OK; 635 return NMRTF_OK;
636 } 636 }
637 637
654 ctx->output = g_string_append(ctx->output, conv_data); 654 ctx->output = g_string_append(ctx->output, conv_data);
655 g_free(conv_data); 655 g_free(conv_data);
656 ctx->ansi = g_string_truncate(ctx->ansi, 0); 656 ctx->ansi = g_string_truncate(ctx->ansi, 0);
657 } else { 657 } else {
658 status = NMRTF_CONVERT_ERROR; 658 status = NMRTF_CONVERT_ERROR;
659 gaim_debug_info("novell", "failed to convert data! error code = %d msg = %s\n", 659 purple_debug_info("novell", "failed to convert data! error code = %d msg = %s\n",
660 gerror->code, gerror->message); 660 gerror->code, gerror->message);
661 g_free(gerror); 661 g_free(gerror);
662 } 662 }
663 } 663 }
664 664
781 break; 781 break;
782 case NMRTF_SPECIAL_HEX: 782 case NMRTF_SPECIAL_HEX:
783 ctx->ris = NMRTF_STATE_HEX; 783 ctx->ris = NMRTF_STATE_HEX;
784 break; 784 break;
785 case NMRTF_SPECIAL_UNICODE: 785 case NMRTF_SPECIAL_UNICODE:
786 gaim_debug_info("novell", "parsing unichar\n"); 786 purple_debug_info("novell", "parsing unichar\n");
787 status = rtf_dispatch_unicode_char(ctx, ctx->param); 787 status = rtf_dispatch_unicode_char(ctx, ctx->param);
788 /* Skip next char */ 788 /* Skip next char */
789 if (status == NMRTF_OK) 789 if (status == NMRTF_OK)
790 status = rtf_get_char(ctx, &ch); 790 status = rtf_get_char(ctx, &ch);
791 break; 791 break;