OSDN Git Service

* version up for RELEASE
[modchxj/mod_chxj.git] / include / chxj_hdml.h
1 /*
2  * Copyright (C) 2005-2009 Atsushi Konno All rights reserved.
3  * Copyright (C) 2005 QSDN,Inc. All rights reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 #ifndef __CHXJ_HDML_H__
18 #define __CHXJ_HDML_H__
19
20 /*============================================================================*/
21 /* The maximum number of form is up to ten.                                   */
22 /*============================================================================*/
23 #define MAX_FORM_COUNT           (10)
24 #define MAX_RADIO_COUNT          (10)
25 #define MAX_RADIO_VALUE_COUNT    (100)
26 #define MAX_SUBMIT_BUTTON_COUNT  (10)
27 #define END_LINE                 "\0"
28
29 #include "mod_chxj.h"
30 #include "chxj_cookie.h"
31
32 /*============================================================================*/
33 /* Structure for HDML                                                         */
34 /*============================================================================*/
35 typedef struct hdml_t hdml_t;
36
37 struct hdml_t {
38   Doc            *doc;
39   char           *out;
40   int            center;
41   int            in_center;
42   char           *card;
43   int            card_cnt;
44   apr_time_t     form_cnt;
45
46   /*--------------------------------------------------------------------------*/
47   /* If the title tag is found, it becomes ``1''.                             */
48   /*--------------------------------------------------------------------------*/
49   int            found_title;
50   /*--------------------------------------------------------------------------*/
51   /* Counter of pure form tag                                                 */
52   /*--------------------------------------------------------------------------*/
53   int            pure_form_cnt;
54
55   int     var_cnt[MAX_FORM_COUNT];
56   char    *postdata[MAX_FORM_COUNT];
57   /*------------------------------*/
58   /* max <input type="radio"> tag */
59   /*------------------------------*/
60   char    *radio_value_list[MAX_RADIO_COUNT][MAX_RADIO_VALUE_COUNT];
61   char    *radio_name_list[MAX_RADIO_COUNT];
62   int     radio_out_cnt[MAX_RADIO_COUNT];
63   char    *radio_checked_value[MAX_RADIO_COUNT];
64   /*---------------------------------*/
65   /* for <input type="submit"> tag   */
66   /*---------------------------------*/
67   char    *submit_button[MAX_SUBMIT_BUTTON_COUNT];
68
69   /*---------------------------------*/
70   /* for <input type="checkbox"> tag */
71   /*---------------------------------*/
72   int     has_checkbox;
73
74   char    *form_tmp;
75   char    *init_vars;
76   int     out_len;
77   int     card_len;
78
79   /*------------------------------*/
80   /* Counter for variable of HDML */
81   /*------------------------------*/
82   int     qs_cnt;
83   int     option_flag;
84   int     div_right_flag;
85   int     div_center_flag;
86   int     div_in_center;
87   int     hdml_a_flag;
88   int     hdml_br_flag;
89   int     hdml_blockquote_flag;
90
91   int     hdml_end_flag;
92   int     dir_level;
93   int     plaintext_value_len;
94   int     pre_flag;
95
96   device_table     *spec;
97   mod_chxj_config  *conf;
98
99   chxjconvrule_entry *entryp;
100   cookie_t           *cookie;
101 };
102
103
104 /*============================================================================*/
105 /* Prototype declaration.                                                     */
106 /*============================================================================*/
107 extern char *chxj_convert_hdml(
108   request_rec         *r, 
109   device_table        *spec,
110   const char          *src,
111   apr_size_t          srclen,
112   apr_size_t          *dstlen,
113   chxjconvrule_entry  *entryp,
114   cookie_t            *cookie);
115
116 extern char *qs_out_apr_pstrcat(
117   request_rec  *r, 
118   char         *o, 
119   char         *s, 
120   int          *len);
121
122 extern char *qs_conv_istyle_to_format(
123   request_rec  *r, 
124   char         *is);
125
126 #endif