More const changes.
[iwhd.git] / template.h
blob084836243a6225ee5edae88cbcb0b69e86f31c8d
1 /* Copyright (C) 2010 Free Software Foundation, Inc.
3 This program is free software: you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation, either version 3 of the License, or
6 (at your option) any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>. */
16 #if !defined(_TEMPLATE_H)
17 #define _TEMPLATE_H
19 #define TMPL_BUF_SIZE 1024
21 typedef struct {
22 char *root_header;
23 char *root_entry;
24 char *root_footer;
25 char *prov_header;
26 char *prov_entry;
27 char *prov_footer;
28 char *obj_header;
29 char *obj_entry;
30 char *obj_footer;
31 int z_offset; /* offset to use when index is zero */
32 } tmpl_format_t;
34 typedef struct {
35 tmpl_format_t *format;
36 const char *base;
37 unsigned int index;
38 char raw_buf[TMPL_BUF_SIZE];
39 char *buf;
40 } tmpl_ctx_t;
42 #define TMPL_CTX_DONE ((tmpl_ctx_t *)(-1))
44 tmpl_ctx_t *tmpl_get_ctx (const char *type);
45 int tmpl_root_header (tmpl_ctx_t *ctx,
46 const char *name, const char *version);
47 int tmpl_root_entry (tmpl_ctx_t *ctx,
48 const char *rel, const char *link);
49 int tmpl_root_footer (tmpl_ctx_t *ctx);
50 int tmpl_prov_header (tmpl_ctx_t *ctx);
51 int tmpl_prov_entry (tmpl_ctx_t *ctx,
52 const char *name, const char *type,
53 const char *host, int port,
54 const char *user, const char *pass);
55 int tmpl_root_footer (tmpl_ctx_t *ctx);
56 int tmpl_obj_header (tmpl_ctx_t *ctx);
57 int tmpl_obj_entry (tmpl_ctx_t *ctx,
58 const char *bucket, const char *key);
59 int tmpl_obj_footer (tmpl_ctx_t *ctx);
60 int tmpl_prov_footer (tmpl_ctx_t *ctx);
62 #endif