X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=include%2Fchxj_specified_device.h;h=abd2f556be306d94f1fcaa25110cb1ca64d82e14;hb=33e56f3595ebc61c708de0f68c4b38df4fa6f65f;hp=c66340bbff95d9866b6fd8205eb55a927a1a6db5;hpb=2d8a15b0949ecccbd24b5c9b61e583c0e02e163b;p=modchxj%2Fmod_chxj.git diff --git a/include/chxj_specified_device.h b/include/chxj_specified_device.h old mode 100644 new mode 100755 index c66340bb..abd2f556 --- a/include/chxj_specified_device.h +++ b/include/chxj_specified_device.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2008 Atsushi Konno All rights reserved. + * Copyright (C) 2005-2009 Atsushi Konno All rights reserved. * Copyright (C) 2005 QSDN,Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,26 +24,36 @@ typedef enum { CHXJ_SPEC_Chtml_3_0, CHXJ_SPEC_Chtml_4_0, CHXJ_SPEC_Chtml_5_0, - CHXJ_SPEC_Chtml_6_0, - CHXJ_SPEC_Chtml_7_0, + CHXJ_SPEC_Chtml_6_0, /* use XHTML */ + CHXJ_SPEC_Chtml_7_0, /* use XHTML */ CHXJ_SPEC_XHtml_Mobile_1_0, 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" -#define GET_HTML_SPEC_TYPE(X) ((X)->html_spec_type) 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; @@ -84,44 +94,52 @@ struct device_table_t { /* 15680000: 15680000 over colors */ /*--------------------------------------------------------------------------*/ int color; - char *emoji_type; - char *charset; + char* emoji_type; + char* output_encoding; /* Output encoding */ }; -#define GET_EMOJI_TYPE(spec) ((spec)->emoji_type) - typedef struct device_table_list_t device_table_list; struct device_table_list_t { - struct device_table_list_t* next; + struct device_table_list_t *next; + + char *pattern; + ap_regex_t *regexp; + device_table *table; + device_table *tail; - char* pattern; - 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, - struct device_table_t* spec, - const char* src, + char *(*converter)(request_rec *r, + struct device_table_t *spec, + const char *src, apr_size_t srclen, - apr_size_t* dstlen, - struct chxjconvrule_entry* entryp, - cookie_t* cookie); + apr_size_t *dstlen, + struct chxjconvrule_entry *entryp, + cookie_t *cookie); + + char *(*encoder)(request_rec *r, + const char *src, + apr_size_t *len); + - 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[]; extern device_table* chxj_specified_device( - request_rec* r, - const char* user_agent); + request_rec *r, + const char *user_agent); #endif