Ai
2 Star 1 Fork 0

长江/oscam-nx111

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
module-webif-tpl.h 2.27 KB
一键复制 编辑 原始数据 按行查看 历史
Aeon 提交于 2015-06-30 02:30 +08:00 . username() should return const char*
#ifndef MODULE_WEBIF_TPL_H_
#define MODULE_WEBIF_TPL_H_
#ifdef WEBIF
/* Templates: Adds a variable. The variable can be used as often as wanted. */
#define TPLADD 0
/* Templates: Appends a variable or adds it if doesn't exist yet. The variable can be used as often as wanted. */
#define TPLAPPEND 1
/* Templates: Adds a variable which will be reset to "" after being used once, either through tpl_getVar or when used in a template.
tpl_addVar/tpl_printf don't do a reset and will overwrite the appendmode with a new value. */
#define TPLADDONCE 2
/* Templates: Appends a variable or adds it if doesn't exist yet. The variable will be reset to "" after being used once. See TPLADDONCE for details. */
#define TPLAPPENDONCE 3
#define TOUCH_SUBDIR "touch/"
struct templatevars
{
uint32_t varscnt;
uint32_t varsalloc;
uint32_t tmpcnt;
uint32_t tmpalloc;
char **names;
char **values;
uint8_t *vartypes;
char **tmp;
uint8_t messages;
};
void webif_tpls_prepare(void);
void webif_tpls_free(void);
struct templatevars *tpl_create(void);
void tpl_clear(struct templatevars *vars);
void tpl_addVar(struct templatevars *vars, uint8_t addmode, const char *name, const char *value);
void tpl_addMsg(struct templatevars *vars, const char *value);
void tpl_printf(struct templatevars *vars, uint8_t addmode, const char *varname, const char *fmtstring, ...) __attribute__((format(printf, 4, 5)));
char *tpl_getVar(struct templatevars *vars, const char *name);
char *tpl_getFilePathInSubdir(const char *path, const char *subdir, const char *name, const char *ext, char *result, uint32_t resultsize);
char *tpl_getTplPath(const char *name, const char *path, char *result, uint32_t resultsize);
char *tpl_getTpl(struct templatevars *vars, const char *name);
char *tpl_getUnparsedTpl(const char *name, int8_t removeHeader, const char *subdir);
int32_t tpl_saveIncludedTpls(const char *path);
void tpl_checkOneDirDiskRevisions(const char *subdir);
void tpl_checkDiskRevisions(void);
char *urlencode(struct templatevars *vars, const char *str);
char *xml_encode(struct templatevars *vars, const char *chartoencode);
char *sec2timeformat(struct templatevars *vars, int32_t seconds);
#else
static inline void webif_tpls_free(void)
{
return;
}
#endif
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/4a02/oscam-nx111.git
git@gitee.com:4a02/oscam-nx111.git
4a02
oscam-nx111
oscam-nx111
master

搜索帮助