src/chxj_chtml50.c
/**
 * It is a handler who processes the INPUT tag.
 *
 * @param pdoc  [i/o] The pointer to the CHTML structure at the output
 *                     destination is specified.
 * @param node   [i]   The INPUT tag node is specified.
 * @return The conversion result is returned.
 */
It is a handler who processes the INPUT tag.
@param pdoc  [i/o] The pointer to the CHTML structure at the output
destination is specified.
@param node   [i]   The INPUT tag node is specified.
@return The conversion result is returned.
It is a handler who processes the INPUT tag . @param pdoc [ i / o ] The pointer to the CHTML structure at the output destination is specified . @param node [ i ] The INPUT tag node is specified . @return The conversion result is returned .
static char *
s_chtml50_start_input_tag(void *pdoc, Node *node) 
{
  chtml50_t   *chtml50;
  Doc         *doc;
  request_rec *r;
  char        *max_length  = NULL;
  char        *type        = NULL;
  char        *name        = NULL;
  char        *value       = NULL;
  char        *istyle      = NULL;
  char        *size        = NULL;
  char        *checked     = NULL;
  char        *accesskey   = NULL;
  chtml50   = GET_CHTML50(pdoc);
  doc       = chtml50->doc;
  r         = doc->r;
  W_L("<input");
  type       = qs_get_type_attr(doc, node, doc->buf.pool);
  name       = qs_get_name_attr(doc, node, doc->buf.pool);
  value      = qs_get_value_attr(doc,node, doc->buf.pool);
  istyle     = qs_get_istyle_attr(doc,node,doc->buf.pool);
  max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
  checked    = qs_get_checked_attr(doc,node,doc->buf.pool);
  accesskey  = qs_get_accesskey_attr(doc, node, doc->buf.pool);
  size       = qs_get_size_attr(doc, node, doc->buf.pool);
  if (type) {
    type = qs_trim_string(doc->buf.pool, type);
    if (type && (STRCASEEQ('t','T',"text",    type) ||
                 STRCASEEQ('p','P',"password",type) ||
                 STRCASEEQ('c','C',"checkbox",type) ||
                 STRCASEEQ('r','R',"radio",   type) ||
                 STRCASEEQ('h','H',"hidden",  type) ||
                 STRCASEEQ('s','S',"submit",  type) ||
                 STRCASEEQ('r','R',"reset",   type))) {
      W_L(" type=\"");
      W_V(type);
      W_L("\"");
    }
  }
  if (size && *size) {
    W_L(" size=\"");
    W_V(size);
    W_L("\"");
  }
  if (name && *name) {
    W_L(" name=\"");
    W_V(name);
    W_L("\"");
  }
  if (value && *value) {
    W_L(" value=\"");
    W_V(value);
    W_L("\"");
  }
  if (accesskey && *accesskey) {
    W_L(" accesskey=\"");
    W_V(accesskey);
    W_L("\"");
  }
  if (istyle) {
    if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
      W_L(" istyle=\"");
      W_V(istyle);
      W_L("\"");
    }
  }
  if (max_length && *max_length) {
    if (chxj_chk_numeric(max_length) != 0) {
      max_length = apr_psprintf(r->pool, "0");
    }
    if (istyle != NULL && *istyle == '1') {
      char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
      W_V(vv);
    }
    else  {
      char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
      W_V(vv);
    }
  }
  if (checked) {
    W_L(" checked");
  }
  W_L(">");
  return chtml50->out;
}
static char * s_chtml50_start_input_tag ( void * pdoc , Node * node ) { chtml50_t * chtml50 ; Doc * doc ; request_rec * r ; char * max_length = NULL ; char * type = NULL ; char * name = NULL ; char * value = NULL ; char * istyle = NULL ; char * size = NULL ; char * checked = NULL ; char * accesskey = NULL ; chtml50 = GET_CHTML50 ( pdoc ) ; doc = chtml50 -> doc ; r = doc -> r ; W_L ( " " ) ; type = qs_get_type_attr ( doc , node , doc -> buf . pool ) ; name = qs_get_name_attr ( doc , node , doc -> buf . pool ) ; value = qs_get_value_attr ( doc , node , doc -> buf . pool ) ; istyle = qs_get_istyle_attr ( doc , node , doc -> buf . pool ) ; max_length = qs_get_maxlength_attr ( doc , node , doc -> buf . pool ) ; checked = qs_get_checked_attr ( doc , node , doc -> buf . pool ) ; accesskey = qs_get_accesskey_attr ( doc , node , doc -> buf . pool ) ; size = qs_get_size_attr ( doc , node , doc -> buf . pool ) ; if ( type ) { type = qs_trim_string ( doc -> buf . pool , type ) ; if ( type && ( STRCASEEQ ( ' ' , ' ' , " " , type ) || STRCASEEQ ( ' ' , ' ' , " " , type ) || STRCASEEQ ( ' ' , ' ' , " " , type ) || STRCASEEQ ( ' ' , ' ' , " " , type ) || STRCASEEQ ( ' ' , ' ' , " " , type ) || STRCASEEQ ( ' ' , ' ' , " " , type ) || STRCASEEQ ( ' ' , ' ' , " " , type ) ) ) { W_L ( " \" " ) ; W_V ( type ) ; W_L ( " \" " ) ; } } if ( size && * size ) { W_L ( " \" " ) ; W_V ( size ) ; W_L ( " \" " ) ; } if ( name && * name ) { W_L ( " \" " ) ; W_V ( name ) ; W_L ( " \" " ) ; } if ( value && * value ) { W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; } if ( accesskey && * accesskey ) { W_L ( " \" " ) ; W_V ( accesskey ) ; W_L ( " \" " ) ; } if ( istyle ) { if ( * istyle == ' ' || * istyle == ' ' || * istyle == ' ' || * istyle == ' ' ) { W_L ( " \" " ) ; W_V ( istyle ) ; W_L ( " \" " ) ; } } if ( max_length && * max_length ) { if ( chxj_chk_numeric ( max_length ) != 0 ) { max_length = apr_psprintf ( r -> pool , " " ) ; } if ( istyle != NULL && * istyle == ' ' ) { char * vv = apr_psprintf ( doc -> buf . pool , " \" \" " , chxj_atoi ( max_length ) * 2 ) ; W_V ( vv ) ; } else { char * vv = apr_psprintf ( doc -> buf . pool , " \" \" " , chxj_atoi ( max_length ) ) ; W_V ( vv ) ; } } if ( checked ) { W_L ( " " ) ; } W_L ( " " ) ; return chtml50 -> out ; }
It is a handler who processes the INPUT tag.
It is a handler who processes the INPUT tag .
/*--------------------------------------------------------------------------*/ /* Get Attributes                                                           */ /*--------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/ /* CHTML 2.0                                                              */ /*------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ /* The figure is default for the password.                                  */ /*--------------------------------------------------------------------------*/