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)
19 #define TMPL_BUF_SIZE 1024
31 int z_offset
; /* offset to use when index is zero */
35 tmpl_format_t
*format
;
38 char raw_buf
[TMPL_BUF_SIZE
];
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
);