2020-10-03 04:51:22 -04:00
|
|
|
/* Icecast
|
|
|
|
*
|
|
|
|
* This program is distributed under the GNU General Public License, version 2.
|
|
|
|
* A copy of this license is included with this source.
|
|
|
|
*
|
|
|
|
* Copyright 2020, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* This file contains helper functions for report XML document parsing, manipulation, and rendering. */
|
|
|
|
|
|
|
|
#ifndef __REPORTXML_HELPER_H__
|
|
|
|
#define __REPORTXML_HELPER_H__
|
|
|
|
|
|
|
|
#include "reportxml.h"
|
|
|
|
|
2020-10-03 05:01:26 -04:00
|
|
|
void reportxml_helper_add_value(reportxml_node_t *parent, const char *type, const char *member, const char *str);
|
|
|
|
|
|
|
|
#define reportxml_helper_add_value_string(parent,member,str) reportxml_helper_add_value((parent), "string", (member), (str))
|
|
|
|
#define reportxml_helper_add_value_enum(parent,member,str) reportxml_helper_add_value((parent), "enum", (member), (str))
|
2022-03-05 15:25:01 -05:00
|
|
|
#define reportxml_helper_add_value_boolean(parent,member,value) reportxml_helper_add_value((parent), "boolean", (member), (value) ? "true" : "false")
|
2022-03-11 06:31:43 -05:00
|
|
|
#define reportxml_helper_add_value_flag(parent,member,value) reportxml_helper_add_value((parent), "flag", (member), (value) ? "true" : "false")
|
2020-10-03 05:01:26 -04:00
|
|
|
void reportxml_helper_add_value_int(reportxml_node_t *parent, const char *member, long long int val);
|
|
|
|
|
|
|
|
void reportxml_helper_add_text(reportxml_node_t *parent, const char *definition, const char *text);
|
|
|
|
|
|
|
|
void reportxml_helper_add_reference(reportxml_node_t *parent, const char *type, const char *href);
|
|
|
|
|
2020-10-14 06:50:03 -04:00
|
|
|
reportxml_node_t * reportxml_helper_add_incident(const char *state, const char *text, const char *docs, reportxml_database_t *db);
|
|
|
|
|
2020-10-03 04:51:22 -04:00
|
|
|
#endif
|