src/chxj_chtml50.c
/**
 * It is a handler who processes the IMG tag.
 *
 * @param pdoc  [i/o] The pointer to the CHTML structure at the output
 *                     destination is specified.
 * @param node   [i]   The IMG tag node is specified.
 * @return The conversion result is returned.
 */
It is a handler who processes the IMG tag.
@param pdoc  [i/o] The pointer to the CHTML structure at the output
destination is specified.
@param node   [i]   The IMG tag node is specified.
@return The conversion result is returned.
It is a handler who processes the IMG tag . @param pdoc [ i / o ] The pointer to the CHTML structure at the output destination is specified . @param node [ i ] The IMG tag node is specified . @return The conversion result is returned .
static char *
s_chtml50_start_img_tag(void *pdoc, Node *node) 
{
#ifndef IMG_NOT_CONVERT_FILENAME
  device_table *spec;
#endif
  chtml50_t    *chtml50;
  Doc          *doc;
  request_rec  *r;
  Attr         *attr;
  chtml50 = GET_CHTML50(pdoc);
  doc     = chtml50->doc;
  r       = doc->r;
#ifndef IMG_NOT_CONVERT_FILENAME
  spec    = chtml50->spec;
#endif
  W_L("<img");
  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);
    if (STRCASEEQ('s','S',"src", name)) {
#ifdef IMG_NOT_CONVERT_FILENAME
      value = chxj_encoding_parameter(r, value);
      value = chxj_add_cookie_parameter(r, value, chtml50->cookie);
      if (value) {
        value = apr_psprintf(r->pool,
                             "%s%c%s=true",
                             value,
                             (strchr(value, '?')) ? '&' : '?',
                             CHXJ_COOKIE_NOUPDATE_PARAM);
        W_L(" src=\"");
        W_V(value);
        W_L("\"");
      }
#else
      value = chxj_img_conv(r,spec,value);
      value = chxj_encoding_parameter(r, value);
      value = chxj_add_cookie_parameter(r, value, chtml50->cookie);
      if (value) {
        value = apr_psprintf(r->pool,
                             "%s%c%s=true",
                             value,
                             (strchr(value, '?')) ? '&' : '?',
                             CHXJ_COOKIE_NOUPDATE_PARAM);
      }
      W_L(" src=\"");
      W_V(value);
      W_L("\"");
#endif
    }
    else if (STRCASEEQ('a','A',"align", name)) {
      if (value) {
        if (STRCASEEQ('t','T',"top",   value) ||
            STRCASEEQ('m','M',"middle",value) ||
            STRCASEEQ('b','B',"bottom",value) ||
            STRCASEEQ('l','L',"left",  value) ||
            STRCASEEQ('c','C',"center",  value) ||
            STRCASEEQ('r','R',"right", value)) {
          W_L(" align=\"");
          W_V(value);
          W_L("\"");
        }
      }
    }
    else if (STRCASEEQ('w','W',"width", name) && value && *value) {
      W_L(" width=\"");
      W_V(value);
      W_L("\"");
    }
    else if (STRCASEEQ('h','H', "height", name) && value && *value) {
      W_L(" height=\"");
      W_V(value);
      W_L("\"");
    }
    else if (STRCASEEQ('h','H',"hspace", name) && value && *value) {
      W_L(" hspace=\"");
      W_V(value);
      W_L("\"");
    }
    else if (STRCASEEQ('v','V',"vspace", name) && value && *value) {
      W_L(" vspace=\"");
      W_V(value);
      W_L("\"");
    }
    else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
      W_L(" alt=\"");
      W_V(value);
      W_L("\"");
    }
  }
  W_L(">");
  return chtml50->out;
}
static char * s_chtml50_start_img_tag ( void * pdoc , Node * node ) { #ifndef IMG_NOT_CONVERT_FILENAME device_table * spec ; #endif chtml50_t * chtml50 ; Doc * doc ; request_rec * r ; Attr * attr ; chtml50 = GET_CHTML50 ( pdoc ) ; doc = chtml50 -> doc ; r = doc -> r ; #ifndef IMG_NOT_CONVERT_FILENAME spec = chtml50 -> spec ; #endif 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 ) ; if ( STRCASEEQ ( ' ' , ' ' , " " , name ) ) { #ifdef IMG_NOT_CONVERT_FILENAME value = chxj_encoding_parameter ( r , value ) ; value = chxj_add_cookie_parameter ( r , value , chtml50 -> cookie ) ; if ( value ) { value = apr_psprintf ( r -> pool , " " , value , ( strchr ( value , ' ' ) ) ? ' ' : ' ' , CHXJ_COOKIE_NOUPDATE_PARAM ) ; W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; } #else value = chxj_img_conv ( r , spec , value ) ; value = chxj_encoding_parameter ( r , value ) ; value = chxj_add_cookie_parameter ( r , value , chtml50 -> cookie ) ; if ( value ) { value = apr_psprintf ( r -> pool , " " , value , ( strchr ( value , ' ' ) ) ? ' ' : ' ' , CHXJ_COOKIE_NOUPDATE_PARAM ) ; } W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; #endif } else if ( STRCASEEQ ( ' ' , ' ' , " " , name ) ) { if ( value ) { if ( STRCASEEQ ( ' ' , ' ' , " " , value ) || STRCASEEQ ( ' ' , ' ' , " " , value ) || STRCASEEQ ( ' ' , ' ' , " " , value ) || STRCASEEQ ( ' ' , ' ' , " " , value ) || STRCASEEQ ( ' ' , ' ' , " " , value ) || STRCASEEQ ( ' ' , ' ' , " " , value ) ) { W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; } } } else if ( STRCASEEQ ( ' ' , ' ' , " " , name ) && value && * value ) { W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; } else if ( STRCASEEQ ( ' ' , ' ' , " " , name ) && value && * value ) { W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; } else if ( STRCASEEQ ( ' ' , ' ' , " " , name ) && value && * value ) { W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; } else if ( STRCASEEQ ( ' ' , ' ' , " " , name ) && value && * value ) { W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; } else if ( STRCASEEQ ( ' ' , ' ' , " " , name ) && value && * value ) { W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; } } W_L ( " " ) ; return chtml50 -> out ; }
It is a handler who processes the IMG tag.
It is a handler who processes the IMG tag .
/*--------------------------------------------------------------------------*/ /* Get Attributes                                                           */ /*--------------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ /* CHTML 1.0                                                            */ /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ /* CHTML 1.0                                                            */ /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ /* CHTML 1.0                                                            */ /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ /* CHTML 1.0                                                            */ /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ /* CHTML 1.0                                                            */ /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ /* CHTML 1.0                                                            */ /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ /* CHTML 1.0                                                            */ /*----------------------------------------------------------------------*/