/usr/include/girara/template.h is in libgirara-dev 0.2.7-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | /* See LICENSE file for license and copyright information */
#ifndef GIRARA_TEMPLATE_H
#define GIRARA_TEMPLATE_H
#include <glib-object.h>
#include "types.h"
struct girara_template_s {
GObject parent;
};
struct girara_template_class_s {
GObjectClass parent_class;
void (*base_changed)(GiraraTemplate*);
void (*variable_changed)(GiraraTemplate*, const char* name);
void (*changed)(GiraraTemplate*);
};
#define GIRARA_TYPE_TEMPLATE \
(girara_template_get_type())
#define GIRARA_TEMPLATE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), GIRARA_TYPE_TEMPLATE, GiraraTemplate))
#define GIRARA_TEMPLATE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_CAST((obj), GIRARA_TYPE_TEMPLATE, GiraraTemplateClass))
#define GIRARA_IS_TEMPLATE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GIRARA_TYPE_TEMPLATE))
#define GIRARA_IS_TEMPLATE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((obj), GIRARA_TYPE_TEMPLATE))
#define GIRARA_TEMPLATE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS((obj), GIRARA_TYPE_TEMPLATE, GiraraTemplateClass))
/**
* Returns the type of the template.
*
* @return the type
*/
GType girara_template_get_type(void);
/**
* Create new template object.
*
* @param base a string that is used as template
* @returns a templot object
*/
GiraraTemplate* girara_template_new(const char* base);
/**
* Set the base string of the template.
*
* @param object GiraraTemplate object
* @param base a string that is used as template
*/
void girara_template_set_base(GiraraTemplate* object, const char* base);
/**
* Get the base string of the template.
*
* @param object GiraraTemplate object
* @returns string that is used as template
*/
const char* girara_template_get_base(GiraraTemplate* object);
/**
* Get list of variable names referenced in the template.
*
* @param object GiraraTemplate object
* @returns list of variables names referenced in the template
*/
girara_list_t* girara_template_referenced_variables(GiraraTemplate* object);
/**
* Register a variable.
*
* @param object GiraraTemplate object
* @param name name of the variable
* @returns true if the variable was added, false otherwise
*/
bool girara_template_add_variable(GiraraTemplate* object, const char* name);
/**
* Set value of a variable.
*
* @param object GiraraTemplate object
* @param name name of the variable
* @param value value of the variable
*/
void girara_template_set_variable_value(GiraraTemplate* object, const char* name, const char* value);
/**
* Replace all variables with their values in the template.
*
* @param object GiraraTemplate object
* @returns evaluated template, needes to be deallocated with g_free
*/
char* girara_template_evaluate(GiraraTemplate* object);
#endif
|