OSDN Git Service

* Writing is changed.
authorkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Fri, 16 Jun 2006 11:06:56 +0000 (11:06 +0000)
committerkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Fri, 16 Jun 2006 11:06:56 +0000 (11:06 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/trunk@711 1a406e8e-add9-4483-a2c8-d8cac5b7c224

include/chxj_specified_device.h
src/chxj_load_device_data.c

index 5f0bb53..35b67ad 100644 (file)
@@ -33,9 +33,11 @@ typedef enum _spec_type_t {
 #define CHXJ_PIC_OK                (0x01)
 #define CHXJ_PIC_NG                (0x00)
 
+#include "mod_chxj.h"
 
-typedef struct device_table_t {
-  struct device_table_t* next;
+
+typedef struct _device_table_t {
+  struct _device_table_t* next;
   const char* device_id;
   const char* device_name;
   spec_type_t html_spec_type;
@@ -77,11 +79,13 @@ typedef struct device_table_t {
   /*--------------------------------------------------------------------------*/
   int color;
   char* emoji_type;
+
 } device_table_t;
 
 typedef struct device_table_list_t {
   struct device_table_list_t* next;
   char* pattern;
+  ap_regex_t* regexp;
   device_table_t* table;
   device_table_t* tail;
 } device_table_list_t;
index 5ce2460..3be9d8f 100644 (file)
@@ -99,8 +99,10 @@ s_set_user_agent_data(Doc* doc, apr_pool_t* p, mod_chxj_config* conf, Node* node
       for (attr = qs_get_attr(doc,child); 
            attr ; 
            attr = qs_get_next_attr(doc,attr)) {
-        if (strcasecmp(qs_get_attr_name(doc,attr), "pattern") == 0)
+        if (strcasecmp(qs_get_attr_name(doc,attr), "pattern") == 0) {
             dtl->pattern = apr_pstrdup(p, qs_get_attr_value(doc,attr));
+            dtl->regexp = ap_pregcomp(p, dtl->pattern, AP_REG_EXTENDED);
+        }
       }
       s_set_device_data(doc, p, dtl, child);
     }