OSDN Git Service

* Added New Feature
[modchxj/mod_chxj.git] / include / chxj_specified_device.h
old mode 100644 (file)
new mode 100755 (executable)
index 5ea3c16..abd2f55
@@ -30,12 +30,21 @@ typedef enum {
   CHXJ_SPEC_Hdml,
   CHXJ_SPEC_Jhtml,
   CHXJ_SPEC_Jxhtml,    /* use XHTML */
+  CHXJ_SPEC_iPhone2,   /* use XHTML */
+  CHXJ_SPEC_iPhone3,   /* use XHTML */
+  CHXJ_SPEC_iPhone4,   /* use XHTML */
+  CHXJ_SPEC_softbank_android, /* use XHTML (SoftBank) */
+  CHXJ_SPEC_au_android, /* use XHTML (au KDDI)  */
+  CHXJ_SPEC_docomo_android, /* use XHTML (docomo)   */
+  CHXJ_SPEC_android,        /* use XHTML */
   CHXJ_SPEC_HTML,
 } spec_type;
 
 #define CHXJ_PIC_OK                (0x01)
 #define CHXJ_PIC_NG                (0x00)
 
+#define IS_IPHONE(X) (((X) == CHXJ_SPEC_iPhone2) || ((X) == CHXJ_SPEC_iPhone3) || ((X) == CHXJ_SPEC_iPhone4))
+
 #include "mod_chxj.h"
 #include "chxj_cookie.h"
 
@@ -44,6 +53,7 @@ typedef struct device_table_t device_table;
 
 struct device_table_t {
   struct device_table_t* next;
+  int                    provider;              /* DOCOMO|AU|SOFTBANK|UNKNOWN */
   const char*            device_id;
   const char*            device_name;
   spec_type              html_spec_type;
@@ -85,6 +95,7 @@ struct device_table_t {
   /*--------------------------------------------------------------------------*/
   int                    color;
   char*                  emoji_type;
+  char*                  output_encoding;  /* Output encoding */
 };
 
 typedef struct device_table_list_t  device_table_list;
@@ -96,13 +107,16 @@ struct device_table_list_t {
   ap_regex_t                  *regexp;
   device_table                *table;
   device_table                *tail;
+
+  device_table                **sort_table;
+  size_t                      table_count;
 };
 
 typedef struct converter_t converter_t;
 
 struct converter_t {
   /* convert routine */
-  char(*converter)(request_rec                 *r,
+  char *(*converter)(request_rec                 *r,
                      struct device_table_t       *spec,
                      const char                  *src, 
                      apr_size_t                  srclen, 
@@ -110,9 +124,16 @@ struct converter_t {
                      struct chxjconvrule_entry   *entryp,
                      cookie_t                    *cookie);
 
-  char(*encoder)(request_rec  *r,
+  char *(*encoder)(request_rec  *r,
                    const char   *src,
                    apr_size_t   *len);
+
+
+  char *(*emoji_only_converter)(
+                   request_rec           *r,
+                   struct device_table_t *spec,
+                   const char            *src,
+                   apr_size_t            len);
 };
 
 extern converter_t convert_routine[];