src/chxj_chtml50.c
/**
 * It is a handler who processes the META tag.
 *
 * @param pdoc  [i/o] The pointer to the CHTML structure at the output
 *                     destination is specified.
 * @param node   [i]   The META tag node is specified.
 * @return The conversion result is returned.
 */
It is a handler who processes the META tag.
@param pdoc  [i/o] The pointer to the CHTML structure at the output
destination is specified.
@param node   [i]   The META tag node is specified.
@return The conversion result is returned.
It is a handler who processes the META tag . @param pdoc [ i / o ] The pointer to the CHTML structure at the output destination is specified . @param node [ i ] The META tag node is specified . @return The conversion result is returned .
static char *
s_chtml50_start_meta_tag(void *pdoc, Node *node) 
{
  chtml50_t     *chtml50;
  Doc           *doc;
  request_rec   *r;
  Attr          *attr;
  int           content_type_flag;
  int           refresh_flag;
  chtml50 = GET_CHTML50(pdoc);
  doc     = chtml50->doc;
  r       = doc->r;
  content_type_flag = 0;
  refresh_flag      = 0;
  W_L("<meta");
  for (attr = qs_get_attr(doc,node);
       attr;
       attr = qs_get_next_attr(doc,attr)) {
    char *name   = qs_get_attr_name(doc,attr);
    char *value  = qs_get_attr_value(doc,attr);
    switch(*name) {
    case 'h':
    case 'H':
      if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
        W_L(" http-equiv=\"");
        W_V(value);
        W_L("\"");
        if (STRCASEEQ('c','C',"content-type", value))
          content_type_flag = 1;
        if (STRCASEEQ('r','R',"refresh", value))
          refresh_flag = 1;
      }
      break;
    case 'c':
    case 'C':
      if (strcasecmp(name, "content") == 0 && value && *value) {
        if (content_type_flag) {
          W_L(" ");
          W_V(name);
          W_L("=\"text/html; charset=Windows-31J\"");
        }
        else
        if (refresh_flag) {
          char *buf;
          char *sec;
          char *url;
          buf = apr_pstrdup(r->pool, value);
          url = strchr(buf, ';');
          if (url) {
            sec = apr_pstrdup(r->pool, buf);
            sec[url-buf] = 0;
            url++;
            url = chxj_encoding_parameter(r, url);
            url = chxj_add_cookie_parameter(r, url, chtml50->cookie);
            W_L(" ");
            W_V(name);
            W_L("=\"");
            W_V(sec);
            W_L(";");
            W_V(url);
            W_L("\"");
          }
        }
        else {
          W_L(" ");
          W_V(name);
          W_L("=\"");
          W_V(value);
          W_L("\"");
        }
      }
      break;
    default:
      break;
    }
  }
  W_L(">");
  return chtml50->out;
}
static char * s_chtml50_start_meta_tag ( void * pdoc , Node * node ) { chtml50_t * chtml50 ; Doc * doc ; request_rec * r ; Attr * attr ; int content_type_flag ; int refresh_flag ; chtml50 = GET_CHTML50 ( pdoc ) ; doc = chtml50 -> doc ; r = doc -> r ; content_type_flag = 0 ; refresh_flag = 0 ; W_L ( " " ) ; for ( attr = qs_get_attr ( doc , node ) ; attr ; attr = qs_get_next_attr ( doc , attr ) ) { char * name = qs_get_attr_name ( doc , attr ) ; char * value = qs_get_attr_value ( doc , attr ) ; switch ( * name ) { case ' ' : case ' ' : if ( strcasecmp ( name , " " ) == 0 && value && * value ) { W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; if ( STRCASEEQ ( ' ' , ' ' , " " , value ) ) content_type_flag = 1 ; if ( STRCASEEQ ( ' ' , ' ' , " " , value ) ) refresh_flag = 1 ; } break ; case ' ' : case ' ' : if ( strcasecmp ( name , " " ) == 0 && value && * value ) { if ( content_type_flag ) { W_L ( " " ) ; W_V ( name ) ; W_L ( " \" \" " ) ; } else if ( refresh_flag ) { char * buf ; char * sec ; char * url ; buf = apr_pstrdup ( r -> pool , value ) ; url = strchr ( buf , ' ' ) ; if ( url ) { sec = apr_pstrdup ( r -> pool , buf ) ; sec [ url - buf ] = 0 ; url ++ ; url = chxj_encoding_parameter ( r , url ) ; url = chxj_add_cookie_parameter ( r , url , chtml50 -> cookie ) ; W_L ( " " ) ; W_V ( name ) ; W_L ( " \" " ) ; W_V ( sec ) ; W_L ( " " ) ; W_V ( url ) ; W_L ( " \" " ) ; } } else { W_L ( " " ) ; W_V ( name ) ; W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; } } break ; default : break ; } } W_L ( " " ) ; return chtml50 -> out ; }
It is a handler who processes the META tag.
It is a handler who processes the META tag .
/*--------------------------------------------------------------------------*/ /* Get Attributes                                                           */ /*--------------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ /* CHTML 2.0                                                            */ /*----------------------------------------------------------------------*/