OSDN Git Service

* Updated changelog.
[modchxj/mod_chxj.git] / include / chxj_specified_device.h
index 246e63e..d02c073 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005-2009 Atsushi Konno All rights reserved.
+ * Copyright (C) 2005-2011 Atsushi Konno All rights reserved.
  * Copyright (C) 2005 QSDN,Inc. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -30,12 +30,27 @@ 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)->html_spec_type == CHXJ_SPEC_iPhone2) \
+                     || ((X)->html_spec_type == CHXJ_SPEC_iPhone3) \
+                     || ((X)->html_spec_type == CHXJ_SPEC_iPhone4))
+#define IS_ANDROID(X) (  ((X)->html_spec_type == CHXJ_SPEC_softbank_android) \
+                      || ((X)->html_spec_type == CHXJ_SPEC_au_android)  \
+                      || ((X)->html_spec_type == CHXJ_SPEC_docomo_android) \
+                      || ((X)->html_spec_type == CHXJ_SPEC_android))
+
 #include "mod_chxj.h"
 #include "chxj_cookie.h"
 
@@ -98,6 +113,9 @@ 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;
@@ -130,13 +148,4 @@ extern device_table* chxj_specified_device(
   request_rec             *r, 
   const char              *user_agent);
 
-extern device_table* chxj_specified_device_from_xml(
-  request_rec             *r,
-  const char              *user_agent);
-
-extern device_table* chxj_specified_device_from_tsv(
-    request_rec           *r,
-    device_table          *spec,
-    const char            *user_agent);
-
 #endif