/[qemacs]/qemacs/libqhtml/xmlparse.c
ViewVC logotype

Diff of /qemacs/libqhtml/xmlparse.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by chqrlie, Sun May 8 15:07:29 2005 UTC revision 1.5 by chqrlie, Wed May 11 15:48:31 2005 UTC
# Line 59  int find_entity(const char *str) Line 59  int find_entity(const char *str)
59      }      }
60    
61      e = html_entities;      e = html_entities;
62      for(;;) {      for (;;) {
63          name = e->name;          name = e->name;
64          if (!name)          if (!name)
65              break;              break;
# Line 74  const char *find_entity_str(int code) Line 74  const char *find_entity_str(int code)
74  {  {
75      const XMLEntity *e;      const XMLEntity *e;
76      e = html_entities;      e = html_entities;
77      for(;;) {      for (;;) {
78          if (!e->name)          if (!e->name)
79              break;              break;
80          if (e->val == code)          if (e->val == code)
# Line 96  static int parse_entity(const char **pp) Line 96  static int parse_entity(const char **pp)
96      if (ch == '&') {      if (ch == '&') {
97          p1 = p;          p1 = p;
98          q = name;          q = name;
99          for(;;) {          for (;;) {
100              ch1 = *p;              ch1 = *p;
101              if (ch1 == '\0')              if (ch1 == '\0')
102                  break;                  break;
# Line 264  struct XMLState { Line 264  struct XMLState {
264      int pretaglen;      int pretaglen;
265      char pretag[32]; /* current tag in XML_STATE_PRETAG */      char pretag[32]; /* current tag in XML_STATE_PRETAG */
266      StringBuffer str;      StringBuffer str;
267      char filename[1024];      char filename[MAX_FILENAME_SIZE];
268      CharsetDecodeState charset_state;      CharsetDecodeState charset_state;
269  };  };
270    
# Line 395  void html_table_borders(CSSBox *box, int Line 395  void html_table_borders(CSSBox *box, int
395      }      }
396    
397      if (box->content_type == CSS_CONTENT_TYPE_CHILDS) {      if (box->content_type == CSS_CONTENT_TYPE_CHILDS) {
398          for(box1 = box->u.child.first; box1 != NULL; box1 = box1->next) {          for (box1 = box->u.child.first; box1 != NULL; box1 = box1->next) {
399              html_table_borders(box1, border, padding);              html_table_borders(box1, border, padding);
400          }          }
401      }      }
# Line 415  static void html_eval_tag(XMLState *s, C Line 415  static void html_eval_tag(XMLState *s, C
415    
416      first_prop = NULL;      first_prop = NULL;
417      last_prop = &first_prop;      last_prop = &first_prop;
418      switch(box->tag) {      switch (box->tag) {
419      case CSS_ID_img:      case CSS_ID_img:
420      parse_img:      parse_img:
421          box->content_type = CSS_CONTENT_TYPE_IMAGE;          box->content_type = CSS_CONTENT_TYPE_IMAGE;
# Line 711  static void html_eval_tag(XMLState *s, C Line 711  static void html_eval_tag(XMLState *s, C
711      }      }
712      value = css_attr_strlower(box, CSS_ID_align);      value = css_attr_strlower(box, CSS_ID_align);
713      if (value) {      if (value) {
714          switch(box->tag) {          switch (box->tag) {
715          case CSS_ID_caption:          case CSS_ID_caption:
716              /* use caption-side property for captions */              /* use caption-side property for captions */
717              val = css_get_enum(value, "top,bottom,left,right");              val = css_get_enum(value, "top,bottom,left,right");
# Line 850  static int parse_tag(XMLState *s, const Line 850  static int parse_tag(XMLState *s, const
850      /* parse attributes */      /* parse attributes */
851      first_attr = NULL;      first_attr = NULL;
852      pattr = &first_attr;      pattr = &first_attr;
853      for(;;) {      for (;;) {
854          skip_spaces(&p);          skip_spaces(&p);
855          if (*p == '\0' || *p == '/')          if (*p == '\0' || *p == '/')
856              break;              break;
# Line 903  static int parse_tag(XMLState *s, const Line 903  static int parse_tag(XMLState *s, const
903          CSSBox *box1;          CSSBox *box1;
904          const HTMLClosedTags *ct;          const HTMLClosedTags *ct;
905          ct = html_closed_tags;          ct = html_closed_tags;
906          for(;;) {          for (;;) {
907              if (!ct->tag)              if (!ct->tag)
908                  break;                  break;
909              if (css_tag == ct->tag) {              if (css_tag == ct->tag) {
# Line 1062  static int xml_parse_internal(XMLState * Line 1062  static int xml_parse_internal(XMLState *
1062      offset_end = offset_start + buf_len;      offset_end = offset_start + buf_len;
1063      offset0 = 0; /* not used */      offset0 = 0; /* not used */
1064      text_offset_start = 0; /* not used */      text_offset_start = 0; /* not used */
1065      for(;;) {      for (;;) {
1066          if (buf) {          if (buf) {
1067              if (buf >= buf_end)              if (buf >= buf_end)
1068                  break;                  break;
# Line 1081  static int xml_parse_internal(XMLState * Line 1081  static int xml_parse_internal(XMLState *
1081              s->line_num++;              s->line_num++;
1082          }          }
1083    
1084          switch(s->state) {          switch (s->state) {
1085          case XML_STATE_TAG:          case XML_STATE_TAG:
1086              if (ch == '>') {              if (ch == '>') {
1087                  strbuf_addch(&s->str, '\0');                  strbuf_addch(&s->str, '\0');
1088                  ret = parse_tag(s, s->str.buf);                  ret = parse_tag(s, s->str.buf);
1089                  switch(ret) {                  switch (ret) {
1090                  default:                  default:
1091                  case XML_STATE_TEXT:                  case XML_STATE_TEXT:
1092                  xml_text:                  xml_text:

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26