src/chxj_hdml.c
/**
 * It is a handler who processes the IMG tag.
 *
 * @param pdoc   [i/o] The pointer to the HDML 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 HDML 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 HDML 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_hdml_start_img_tag(void *pdoc, Node *node) 
{
  hdml_t        *hdml;
  Doc           *doc;
#ifndef IMG_NOT_CONVERT_FILENAME
  device_table  *spec;
#endif
  Attr          *attr;
  char          *out;
  int           align_flag = 0;
  hdml = GET_HDML(pdoc);
  doc  = hdml->doc;
#ifndef IMG_NOT_CONVERT_FILENAME
  spec = hdml->spec;
#endif
  s_hdml_tag_output_upper_half(hdml, node);
  out = apr_palloc(doc->r->pool, 1);
  out[0] = 0;
  out = apr_pstrcat(doc->r->pool, out, "<img", NULL);
  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) && value && *value) {
      value = chxj_encoding_parameter(hdml->doc->r, value);
      out = apr_pstrcat(doc->r->pool, out, " src=\"", NULL);
#ifdef IMG_NOT_CONVERT_FILENAME
      out = apr_pstrcat(doc->r->pool, out, value, NULL);
#else
      out = apr_pstrcat(doc->r->pool, out, chxj_img_conv(doc->r, spec,value), NULL);
#endif
      out = apr_pstrcat(doc->r->pool, out, "\"", NULL);
    }
    else if (STRCASEEQ('a','A',"align",name)) {
      if (value) {
        if (STRCASEEQ('r','R',"right", value)) {
          s_output_to_hdml_out(hdml, "<RIGHT>" );
          align_flag = 1;
        }
        else if (STRCASEEQ('c','C',"center",value)) {
          s_output_to_hdml_out(hdml, "<CENTER>" );
          align_flag = 1;
        }
      }
    }
    else if (STRCASEEQ('w','W',"width",name)) {
    }
    else if (STRCASEEQ('h','H',"height",name) && value && *value) {
    }
    else if (STRCASEEQ('h','H',"hspace", name) && value && *value) {
    }
    else if (STRCASEEQ('v','V',"vspace",name) && value && *value) {
    }
    else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
      out = apr_pstrcat(doc->r->pool, out, " alt=\"", NULL);
      out = apr_pstrcat(doc->r->pool, out, value, NULL);
      out = apr_pstrcat(doc->r->pool, out, "\"", NULL);
    }
  }
  out = apr_pstrcat(doc->r->pool, out, ">", NULL);
  s_output_to_hdml_out(hdml, out);
  if (align_flag) {
    s_output_to_hdml_out(hdml, "<BR>");
  }
  hdml->hdml_br_flag = 0;
  return hdml->out;
}
static char * s_hdml_start_img_tag ( void * pdoc , Node * node ) { hdml_t * hdml ; Doc * doc ; #ifndef IMG_NOT_CONVERT_FILENAME device_table * spec ; #endif Attr * attr ; char * out ; int align_flag = 0 ; hdml = GET_HDML ( pdoc ) ; doc = hdml -> doc ; #ifndef IMG_NOT_CONVERT_FILENAME spec = hdml -> spec ; #endif s_hdml_tag_output_upper_half ( hdml , node ) ; out = apr_palloc ( doc -> r -> pool , 1 ) ; out [ 0 ] = 0 ; out = apr_pstrcat ( doc -> r -> pool , out , " " , NULL ) ; 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 ) && value && * value ) { value = chxj_encoding_parameter ( hdml -> doc -> r , value ) ; out = apr_pstrcat ( doc -> r -> pool , out , " \" " , NULL ) ; #ifdef IMG_NOT_CONVERT_FILENAME out = apr_pstrcat ( doc -> r -> pool , out , value , NULL ) ; #else out = apr_pstrcat ( doc -> r -> pool , out , chxj_img_conv ( doc -> r , spec , value ) , NULL ) ; #endif out = apr_pstrcat ( doc -> r -> pool , out , " \" " , NULL ) ; } else if ( STRCASEEQ ( ' ' , ' ' , " " , name ) ) { if ( value ) { if ( STRCASEEQ ( ' ' , ' ' , " " , value ) ) { s_output_to_hdml_out ( hdml , " " ) ; align_flag = 1 ; } else if ( STRCASEEQ ( ' ' , ' ' , " " , value ) ) { s_output_to_hdml_out ( hdml , " " ) ; align_flag = 1 ; } } } else if ( STRCASEEQ ( ' ' , ' ' , " " , name ) ) { } else if ( STRCASEEQ ( ' ' , ' ' , " " , name ) && value && * value ) { } else if ( STRCASEEQ ( ' ' , ' ' , " " , name ) && value && * value ) { } else if ( STRCASEEQ ( ' ' , ' ' , " " , name ) && value && * value ) { } else if ( STRCASEEQ ( ' ' , ' ' , " " , name ) && value && * value ) { out = apr_pstrcat ( doc -> r -> pool , out , " \" " , NULL ) ; out = apr_pstrcat ( doc -> r -> pool , out , value , NULL ) ; out = apr_pstrcat ( doc -> r -> pool , out , " \" " , NULL ) ; } } out = apr_pstrcat ( doc -> r -> pool , out , " " , NULL ) ; s_output_to_hdml_out ( hdml , out ) ; if ( align_flag ) { s_output_to_hdml_out ( hdml , " " ) ; } hdml -> hdml_br_flag = 0 ; return hdml -> out ; }
It is a handler who processes the IMG tag.
It is a handler who processes the IMG tag .
/* Get Attributes */ /* ignore */ /* ignore */ /* ignore */ /* ignore */