2 * LuCI Template - Parser header
4 * Copyright (C) 2009 Jo-Philipp Wich <jow@openwrt.org>
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
19 #ifndef _TEMPLATE_PARSER_H_
20 #define _TEMPLATE_PARSER_H_
41 #define T_TYPE_COMMENT 2
43 #define T_TYPE_INCLUDE 4
45 #define T_TYPE_I18N_RAW 6
50 struct template_chunk {
58 struct template_parser {
68 struct template_chunk prv_chunk;
69 struct template_chunk cur_chunk;
73 struct template_parser * template_open(const char *file);
74 struct template_parser * template_string(const char *str, uint32_t len);
75 void template_close(struct template_parser *parser);
77 const char *template_reader(lua_State *L, void *ud, size_t *sz);
78 int template_error(lua_State *L, struct template_parser *parser);