#include <stddef.h>#include "gwlib/gwlib.h"Include dependency graph for html.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Functions | |
| Octstr * | html_to_sms (Octstr *html) |
|
|
Definition at line 283 of file html.c. References convert_html_entity(), html_comment_begins(), octstr_append_char(), octstr_create, octstr_get_char(), octstr_len(), octstr_shrink_blanks(), octstr_strip_blanks(), skip_html_comment(), skip_html_tag(), and sms. Referenced by smsbox_sendsms_post(), and url_result_thread(). 00284 {
00285 long i, len;
00286 int c;
00287 Octstr *sms;
00288
00289 sms = octstr_create("");
00290 len = octstr_len(html);
00291 i = 0;
00292 while (i < len) {
00293 c = octstr_get_char(html, i);
00294 switch (c) {
00295 case '<':
00296 if (html_comment_begins(html, i))
00297 skip_html_comment(html, &i);
00298 else
00299 skip_html_tag(html, &i);
00300 break;
00301 case '&':
00302 convert_html_entity(sms, html, &i);
00303 break;
00304 default:
00305 octstr_append_char(sms, c);
00306 ++i;
00307 break;
00308 }
00309 }
00310 octstr_shrink_blanks(sms);
00311 octstr_strip_blanks(sms);
00312 return sms;
00313 }
|
Here is the call graph for this function:
