Kannel: Open Source WAP and SMS gateway  svn-r5335
wml_definitions.h
Go to the documentation of this file.
1 /* ====================================================================
2  * The Kannel Software License, Version 1.0
3  *
4  * Copyright (c) 2001-2018 Kannel Group
5  * Copyright (c) 1998-2001 WapIT Ltd.
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in
17  * the documentation and/or other materials provided with the
18  * distribution.
19  *
20  * 3. The end-user documentation included with the redistribution,
21  * if any, must include the following acknowledgment:
22  * "This product includes software developed by the
23  * Kannel Group (http://www.kannel.org/)."
24  * Alternately, this acknowledgment may appear in the software itself,
25  * if and wherever such third-party acknowledgments normally appear.
26  *
27  * 4. The names "Kannel" and "Kannel Group" must not be used to
28  * endorse or promote products derived from this software without
29  * prior written permission. For written permission, please
30  * contact org@kannel.org.
31  *
32  * 5. Products derived from this software may not be called "Kannel",
33  * nor may "Kannel" appear in their name, without prior written
34  * permission of the Kannel Group.
35  *
36  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39  * DISCLAIMED. IN NO EVENT SHALL THE KANNEL GROUP OR ITS CONTRIBUTORS
40  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
41  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
42  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
43  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
44  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
45  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
46  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47  * ====================================================================
48  *
49  * This software consists of voluntary contributions made by many
50  * individuals on behalf of the Kannel Group. For more information on
51  * the Kannel Group, please see <http://www.kannel.org/>.
52  *
53  * Portions of this software are based upon software originally written at
54  * WapIT Ltd., Helsinki, Finland for the Kannel project.
55  */
56 
57 /*
58  * wml_definitions.h - definitions unique to WML compiler
59  *
60  * This file contains fefinitions for global tokens and structures containing
61  * element and attribute tokens for the code page 1.
62  *
63  *
64  * Tuomas Luttinen for Wapit Ltd.
65  */
66 
67 /***********************************************************************
68  * Declarations of global variables.
69  */
70 
71 /*
72  * Elements as defined by tag code page 0.
73  */
74 
75 static
77  { "wml", 0x3F },
78  { "card", 0x27 },
79  { "do", 0x28 },
80  { "onevent", 0x33 },
81  { "head", 0x2C },
82  { "template", 0x3B },
83  { "access", 0x23 },
84  { "meta", 0x30 },
85  { "go", 0x2B },
86  { "prev", 0x32 },
87  { "refresh", 0x36 },
88  { "noop", 0x31 },
89  { "postfield", 0x21 },
90  { "setvar", 0x3E },
91  { "select", 0x37 },
92  { "optgroup", 0x34 },
93  { "option", 0x35 },
94  { "input", 0x2F },
95  { "fieldset", 0x2A },
96  { "timer", 0x3C },
97  { "img", 0x2E },
98  { "anchor", 0x22 },
99  { "a", 0x1C },
100  { "table", 0x1F },
101  { "tr", 0x1E },
102  { "td", 0x1D },
103  { "em", 0x29 },
104  { "strong", 0x39 },
105  { "b", 0x24 },
106  { "i", 0x2D },
107  { "u", 0x3D },
108  { "big", 0x25 },
109  { "small", 0x38 },
110  { "p", 0x20 },
111  { "br", 0x26 },
112  { NULL }
113 };
114 
115 
116 /*
117  * Attributes as defined by WAP-191-WML-20000219a
118  * section 14.3.3 Attribute Start Tokens
119  */
120 
121 static
123  { "accept-charset", NULL, 0x05 },
124  { "accesskey", NULL, 0x5E },
125  { "align", NULL, 0x52 },
126  { "align", "bottom", 0x06 },
127  { "align", "center", 0x07 },
128  { "align", "left", 0x08 },
129  { "align", "middle", 0x09 },
130  { "align", "right", 0x0A },
131  { "align", "top", 0x0B },
132  { "alt", NULL, 0x0C },
133  { "cache-control", "no-cache", 0x64 },
134  { "class", NULL, 0x54 },
135  { "columns", NULL, 0x53 },
136  { "content", NULL, 0x0D },
137  { "content", "application/vnd.wap.wmlc;charset=", 0x5C },
138  { "domain", NULL, 0x0F },
139  { "emptyok", "false", 0x10 },
140  { "emptyok", "true", 0x11 },
141  { "enctype", NULL, 0x5F },
142  { "enctype", "application/x-www-form-urlencoded", 0x60 },
143  { "enctype", "multipart/form-data", 0x61 },
144  { "format", NULL, 0x12 },
145  { "forua", "false", 0x56 },
146  { "forua", "true", 0x57 },
147  { "height", NULL, 0x13 },
148  { "href", NULL, 0x4A },
149  { "href", "http://", 0x4B },
150  { "href", "https://", 0x4C },
151  { "hspace", NULL, 0x14 },
152  { "http-equiv", NULL, 0x5A },
153  { "http-equiv", "Content-Type", 0x5B },
154  { "http-equiv", "Expires", 0x5D },
155  { "id", NULL, 0x55 },
156  { "ivalue", NULL, 0x15 },
157  { "iname", NULL, 0x16 },
158  { "label", NULL, 0x18 },
159  { "localsrc", NULL, 0x19 },
160  { "maxlength", NULL, 0x1A },
161  { "method", "get", 0x1B },
162  { "method", "post", 0x1C },
163  { "mode", "nowrap", 0x1D },
164  { "mode", "wrap", 0x1E },
165  { "multiple", "false", 0x1F },
166  { "multiple", "true", 0x20 },
167  { "name", NULL, 0x21 },
168  { "newcontext", "false", 0x22 },
169  { "newcontext", "true", 0x23 },
170  { "onenterbackward", NULL, 0x25 },
171  { "onenterforward", NULL, 0x26 },
172  { "onpick", NULL, 0x24 },
173  { "ontimer", NULL, 0x27 },
174  { "optional", "false", 0x28 },
175  { "optional", "true", 0x29 },
176  { "path", NULL, 0x2A },
177  { "scheme", NULL, 0x2E },
178  { "sendreferer", "false", 0x2F },
179  { "sendreferer", "true", 0x30 },
180  { "size", NULL, 0x31 },
181  { "src", NULL, 0x32 },
182  { "src", "http://", 0x58 },
183  { "src", "https://", 0x59 },
184  { "ordered", "true", 0x33 },
185  { "ordered", "false", 0x34 },
186  { "tabindex", NULL, 0x35 },
187  { "title", NULL, 0x36 },
188  { "type", NULL, 0x37 },
189  { "type", "accept", 0x38 },
190  { "type", "delete", 0x39 },
191  { "type", "help", 0x3A },
192  { "type", "password", 0x3B },
193  { "type", "onpick", 0x3C },
194  { "type", "onenterbackward", 0x3D },
195  { "type", "onenterforward", 0x3E },
196  { "type", "ontimer", 0x3F },
197  { "type", "options", 0x45 },
198  { "type", "prev", 0x46 },
199  { "type", "reset", 0x47 },
200  { "type", "text", 0x48 },
201  { "type", "vnd.", 0x49 },
202  { "value", NULL, 0x4D },
203  { "vspace", NULL, 0x4E },
204  { "width", NULL, 0x4F },
205  { "xml:lang", NULL, 0x50 },
206  { "xml:space", "preserve", 0x62 },
207  { "xml:space", "default", 0x63 },
208  { NULL }
209 };
210 
211 
212 /*
213  * Attribute value codes.
214  */
215 
216 static
218  { "accept", 0x89 },
219  { "bottom", 0x8A },
220  { "clear", 0x8B },
221  { "delete", 0x8C },
222  { "help", 0x8D },
223  { "middle", 0x93 },
224  { "nowrap", 0x94 },
225  { "onenterbackward", 0x96 },
226  { "onenterforward", 0x97 },
227  { "onpick", 0x95 },
228  { "ontimer", 0x98 },
229  { "options", 0x99 },
230  { "password", 0x9A },
231  { "reset", 0x9B },
232  { "text", 0x9D },
233  { "top", 0x9E },
234  { "unknown", 0x9F },
235  { "wrap", 0xA0 },
236  { NULL }
237 };
238 
239 /*
240  * URL value codes.
241  */
242 
243 static
245  { "www.", 0xA1 },
246  { ".com/", 0x85 },
247  { ".edu/", 0x86 },
248  { ".net/", 0x87 },
249  { ".org/", 0x88 },
250  { "http://", 0x8E },
251  { "http://www.", 0x8F },
252  { "https://", 0x90 },
253  { "https://www.", 0x91 },
254  { "Www.", 0xA1 },
255  { NULL }
256 };
257 
258 
259 
260 
261 
262 
263 
264 
265 
266 
267 
268 
269 
270 
271 
static wml_table_t wml_URL_values[]
static wml_table_t wml_elements[]
static wml_table_t wml_attribute_values[]
static wml_table3_t wml_attributes[]
See file LICENSE for details about the license agreement for using, modifying, copying or deriving work from this software.