src/chxj_xhtml_mobile_1_0.c
/**
 * converts from CHTML to XHTML.
 *
 * @param r     [i]   Requet_rec is appointed.
 * @param spec  [i]   The result of the device specification processing which 
 *                    was done in advance is appointed.
 * @param src   [i]   The character string before the converting is appointed.
 * @return The character string after the converting is returned.
 */
converts from CHTML to XHTML.
@param r     [i]   Requet_rec is appointed.
@param spec  [i]   The result of the device specification processing which
was done in advance is appointed.
@param src   [i]   The character string before the converting is appointed.
@return The character string after the converting is returned.
converts from CHTML to XHTML . @param r [ i ] Requet_rec is appointed . @param spec [ i ] The result of the device specification processing which was done in advance is appointed . @param src [ i ] The character string before the converting is appointed . @return The character string after the converting is returned .
char *
chxj_convert_xhtml_mobile_1_0(
  request_rec        *r,
  device_table       *spec,
  const char         *src,
  apr_size_t         srclen,
  apr_size_t         *dstlen,
  chxjconvrule_entry *entryp,
  cookie_t           *UNUSED(cookie)
)
{
  char      *dst = NULL;
  char      *ss;
  xhtml_t   xhtml;
  Doc       doc;
  DBG(r,"start chxj_convert_xhtml_mobile_1_0()");
  *dstlen = srclen;
  dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
  if (dst != NULL) {
    DBG(r,"end chxj_convert_xhtml_mobile_1_0() (found qrcode.xml)");
    return dst;
  }
  s_init_xhtml(&xhtml, &doc, r, spec);
  xhtml.entryp = entryp;
  chxj_set_content_type(r, "text/html; charset=Windows-31J");
  qs_init_malloc(&doc);
  qs_init_root_node(&doc);
  ss = apr_pcalloc(r->pool, srclen + 1);
  memset(ss,   0, srclen + 1);
  memcpy(ss, src, srclen);
#ifdef DUMP_LOG
  chxj_dump_out("[src] CHTML->XHTML", ss, srclen);
#endif
  qs_parse_string(&doc,ss, strlen(ss));
  chxj_buffered_write_init(r->pool, &doc.buf);
  chxj_node_convert(spec,r,(void *)&xhtml, &doc, qs_get_root(&doc), 0);
  xhtml.out = chxj_buffered_write_flush(xhtml.out, &doc.buf);
  dst = apr_pstrdup(r->pool, xhtml.out);
  chxj_buffered_write_terminate(&doc.buf);
  qs_all_free(&doc,QX_LOGMARK);
  if (! dst) {
    return apr_pstrdup(r->pool,ss);
  }
  if (! *dst) {
    dst = apr_psprintf(r->pool, "\n");
  }
  *dstlen = strlen(dst);
#ifdef DUMP_LOG
  chxj_dump_out("[dst] CHTML->XHTML", dst, *dstlen);
#endif
  DBG(r,"end chxj_convert_xhtml_mobile_1_0()");
  return dst;
}
char * chxj_convert_xhtml_mobile_1_0 ( request_rec * r , device_table * spec , const char * src , apr_size_t srclen , apr_size_t * dstlen , chxjconvrule_entry * entryp , cookie_t * UNUSED ( cookie ) ) { char * dst = NULL ; char * ss ; xhtml_t xhtml ; Doc doc ; DBG ( r , " " ) ; * dstlen = srclen ; dst = chxj_qr_code_blob_handler ( r , src , ( size_t * ) dstlen ) ; if ( dst != NULL ) { DBG ( r , " " ) ; return dst ; } s_init_xhtml ( & xhtml , & doc , r , spec ) ; xhtml . entryp = entryp ; chxj_set_content_type ( r , " " ) ; qs_init_malloc ( & doc ) ; qs_init_root_node ( & doc ) ; ss = apr_pcalloc ( r -> pool , srclen + 1 ) ; memset ( ss , 0 , srclen + 1 ) ; memcpy ( ss , src , srclen ) ; #ifdef DUMP_LOG chxj_dump_out ( " " , ss , srclen ) ; #endif qs_parse_string ( & doc , ss , strlen ( ss ) ) ; chxj_buffered_write_init ( r -> pool , & doc . buf ) ; chxj_node_convert ( spec , r , ( void * ) & xhtml , & doc , qs_get_root ( & doc ) , 0 ) ; xhtml . out = chxj_buffered_write_flush ( xhtml . out , & doc . buf ) ; dst = apr_pstrdup ( r -> pool , xhtml . out ) ; chxj_buffered_write_terminate ( & doc . buf ) ; qs_all_free ( & doc , QX_LOGMARK ) ; if ( ! dst ) { return apr_pstrdup ( r -> pool , ss ) ; } if ( ! * dst ) { dst = apr_psprintf ( r -> pool , " \n " ) ; } * dstlen = strlen ( dst ) ; #ifdef DUMP_LOG chxj_dump_out ( " " , dst , * dstlen ) ; #endif DBG ( r , " " ) ; return dst ; }
converts from CHTML to XHTML.
converts from CHTML to XHTML .
/*--------------------------------------------------------------------------*/ /* If qrcode xml                                                            */ /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ /* The XHTML structure is initialized.                                      */ /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ /* The character string of the input is analyzed.                           */ /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ /* It converts it from CHTML to XHTML.                                      */ /*--------------------------------------------------------------------------*/