Commit c0675181 authored by Christian Hergert's avatar Christian Hergert

build: add versioning macros to public ABI

parent dc3d84cd
......@@ -25,6 +25,8 @@
#include <glib.h>
#include "tmpl-version-macros.h"
G_BEGIN_DECLS
#define TMPL_ERROR (tmpl_error_quark())
......@@ -51,6 +53,7 @@ typedef enum
TMPL_ERROR_NOT_A_FUNCTION,
} TmplError;
TMPL_AVAILABLE_IN_ALL
GQuark tmpl_error_quark (void);
G_END_DECLS
......
......@@ -25,6 +25,8 @@
#include <glib-object.h>
#include "tmpl-version-macros.h"
#include "tmpl-enums.h"
G_BEGIN_DECLS
......@@ -88,8 +90,11 @@ typedef enum
TMPL_EXPR_BUILTIN_TYPEOF,
} TmplExprBuiltin;
TMPL_AVAILABLE_IN_ALL
GType tmpl_expr_get_type (void);
TMPL_AVAILABLE_IN_ALL
GType tmpl_scope_get_type (void);
TMPL_AVAILABLE_IN_ALL
GType tmpl_symbol_get_type (void);
G_END_DECLS
......
......@@ -23,45 +23,65 @@
#ifndef TMPL_EXPR_H
#define TMPL_EXPR_H
#include "tmpl-version-macros.h"
#include "tmpl-expr-types.h"
G_BEGIN_DECLS
TMPL_AVAILABLE_IN_ALL
TmplExpr *tmpl_expr_from_string (const gchar *str,
GError **error);
TMPL_AVAILABLE_IN_ALL
TmplExpr *tmpl_expr_ref (TmplExpr *expr);
TMPL_AVAILABLE_IN_ALL
void tmpl_expr_unref (TmplExpr *expr);
TMPL_AVAILABLE_IN_ALL
gboolean tmpl_expr_eval (TmplExpr *expr,
TmplScope *scope,
GValue *return_value,
GError **error);
TMPL_AVAILABLE_IN_ALL
TmplExpr *tmpl_expr_new_boolean (gboolean value);
TMPL_AVAILABLE_IN_ALL
TmplExpr *tmpl_expr_new_invert_boolean(TmplExpr *left);
TMPL_AVAILABLE_IN_ALL
TmplExpr *tmpl_expr_new_getattr (TmplExpr *left,
const gchar *attr);
TMPL_AVAILABLE_IN_ALL
TmplExpr *tmpl_expr_new_setattr (TmplExpr *left,
const gchar *attr,
TmplExpr *right);
TMPL_AVAILABLE_IN_ALL
TmplExpr *tmpl_expr_new_require (const gchar *typelib,
const gchar *version);
TMPL_AVAILABLE_IN_ALL
TmplExpr *tmpl_expr_new_simple (TmplExprType type,
TmplExpr *left,
TmplExpr *right);
TMPL_AVAILABLE_IN_ALL
TmplExpr *tmpl_expr_new_string (const gchar *value,
gssize length);
TMPL_AVAILABLE_IN_ALL
TmplExpr *tmpl_expr_new_number (gdouble value);
TMPL_AVAILABLE_IN_ALL
TmplExpr *tmpl_expr_new_gi_call (TmplExpr *left,
const gchar *name,
TmplExpr *params);
TMPL_AVAILABLE_IN_ALL
TmplExpr *tmpl_expr_new_fn_call (TmplExprBuiltin builtin,
TmplExpr *param);
TMPL_AVAILABLE_IN_ALL
TmplExpr *tmpl_expr_new_user_fn_call (const gchar *name,
TmplExpr *param);
TMPL_AVAILABLE_IN_ALL
TmplExpr *tmpl_expr_new_flow (TmplExprType type,
TmplExpr *condition,
TmplExpr *primary,
TmplExpr *secondary);
TMPL_AVAILABLE_IN_ALL
TmplExpr *tmpl_expr_new_symbol_ref (const gchar *symbol);
TMPL_AVAILABLE_IN_ALL
TmplExpr *tmpl_expr_new_symbol_assign (const gchar *symbol,
TmplExpr *right);
......
......@@ -23,6 +23,8 @@
#ifndef TMPL_SCOPE_H
#define TMPL_SCOPE_H
#include "tmpl-version-macros.h"
#include "tmpl-expr-types.h"
G_BEGIN_DECLS
......@@ -32,35 +34,49 @@ typedef gboolean (*TmplScopeResolver) (TmplScope *scope,
TmplSymbol **symbol,
gpointer user_data);
TMPL_AVAILABLE_IN_ALL
TmplScope *tmpl_scope_new (void);
TMPL_AVAILABLE_IN_ALL
TmplScope *tmpl_scope_new_with_parent (TmplScope *parent);
TMPL_AVAILABLE_IN_ALL
TmplScope *tmpl_scope_ref (TmplScope *self);
TMPL_AVAILABLE_IN_ALL
void tmpl_scope_unref (TmplScope *self);
TMPL_AVAILABLE_IN_ALL
TmplSymbol *tmpl_scope_peek (TmplScope *self,
const gchar *name);
TMPL_AVAILABLE_IN_ALL
TmplSymbol *tmpl_scope_get (TmplScope *self,
const gchar *name);
TMPL_AVAILABLE_IN_ALL
void tmpl_scope_set (TmplScope *self,
const gchar *name,
TmplSymbol *symbol);
TMPL_AVAILABLE_IN_ALL
void tmpl_scope_take (TmplScope *self,
const gchar *name,
TmplSymbol *symbol);
TMPL_AVAILABLE_IN_ALL
void tmpl_scope_set_value (TmplScope *self,
const gchar *name,
const GValue *value);
TMPL_AVAILABLE_IN_ALL
void tmpl_scope_set_boolean (TmplScope *self,
const gchar *name,
gboolean value);
TMPL_AVAILABLE_IN_ALL
void tmpl_scope_set_double (TmplScope *self,
const gchar *name,
gdouble value);
TMPL_AVAILABLE_IN_ALL
void tmpl_scope_set_string (TmplScope *self,
const gchar *name,
const gchar *value);
TMPL_AVAILABLE_IN_ALL
void tmpl_scope_set_object (TmplScope *self,
const gchar *name,
gpointer value);
TMPL_AVAILABLE_IN_ALL
void tmpl_scope_set_resolver (TmplScope *self,
TmplScopeResolver resolver,
gpointer user_data,
......
......@@ -23,28 +23,42 @@
#ifndef TMPL_SYMBOL_H
#define TMPL_SYMBOL_H
#include "tmpl-version-macros.h"
#include "tmpl-expr-types.h"
G_BEGIN_DECLS
TMPL_AVAILABLE_IN_ALL
TmplSymbol *tmpl_symbol_new (void);
TMPL_AVAILABLE_IN_ALL
TmplSymbol *tmpl_symbol_ref (TmplSymbol *self);
TMPL_AVAILABLE_IN_ALL
void tmpl_symbol_unref (TmplSymbol *self);
TMPL_AVAILABLE_IN_ALL
TmplSymbolType tmpl_symbol_get_symbol_type (TmplSymbol *self);
TMPL_AVAILABLE_IN_ALL
void tmpl_symbol_get_value (TmplSymbol *self,
GValue *value);
TMPL_AVAILABLE_IN_ALL
TmplExpr *tmpl_symbol_get_expr (TmplSymbol *self,
GPtrArray **params);
TMPL_AVAILABLE_IN_ALL
void tmpl_symbol_assign_value (TmplSymbol *self,
const GValue *value);
TMPL_AVAILABLE_IN_ALL
void tmpl_symbol_assign_boolean (TmplSymbol *self,
gboolean v_bool);
TMPL_AVAILABLE_IN_ALL
void tmpl_symbol_assign_double (TmplSymbol *self,
gdouble v_double);
TMPL_AVAILABLE_IN_ALL
void tmpl_symbol_assign_string (TmplSymbol *self,
const gchar *v_string);
TMPL_AVAILABLE_IN_ALL
void tmpl_symbol_assign_object (TmplSymbol *self,
gpointer v_object);
TMPL_AVAILABLE_IN_ALL
void tmpl_symbol_assign_expr (TmplSymbol *self,
TmplExpr *expr,
GPtrArray *args);
......
......@@ -25,6 +25,8 @@
#include <gio/gio.h>
#include "tmpl-version-macros.h"
#include "tmpl-template-locator.h"
G_BEGIN_DECLS
......@@ -42,14 +44,19 @@ struct _TmplTemplateLocatorClass
GError **error);
};
TMPL_AVAILABLE_IN_ALL
TmplTemplateLocator *tmpl_template_locator_new (void);
TMPL_AVAILABLE_IN_ALL
void tmpl_template_locator_append_search_path (TmplTemplateLocator *self,
const gchar *path);
TMPL_AVAILABLE_IN_ALL
void tmpl_template_locator_prepend_search_path (TmplTemplateLocator *self,
const gchar *path);
TMPL_AVAILABLE_IN_ALL
GInputStream *tmpl_template_locator_locate (TmplTemplateLocator *self,
const gchar *path,
GError **error);
TMPL_AVAILABLE_IN_ALL
gchar **tmpl_template_locator_get_search_path (TmplTemplateLocator *self);
G_END_DECLS
......
......@@ -25,6 +25,8 @@
#include <gio/gio.h>
#include "tmpl-version-macros.h"
#include "tmpl-scope.h"
#include "tmpl-template-locator.h"
......@@ -39,34 +41,44 @@ struct _TmplTemplateClass
GObjectClass parent_class;
};
TMPL_AVAILABLE_IN_ALL
TmplTemplate *tmpl_template_new (TmplTemplateLocator *locator);
TMPL_AVAILABLE_IN_ALL
TmplTemplateLocator *tmpl_template_get_locator (TmplTemplate *self);
TMPL_AVAILABLE_IN_ALL
void tmpl_template_set_locator (TmplTemplate *self,
TmplTemplateLocator *locator);
TMPL_AVAILABLE_IN_ALL
gboolean tmpl_template_parse_file (TmplTemplate *self,
GFile *file,
GCancellable *cancellable,
GError **error);
TMPL_AVAILABLE_IN_ALL
gboolean tmpl_template_parse_resource (TmplTemplate *self,
const gchar *path,
GCancellable *cancellable,
GError **error);
TMPL_AVAILABLE_IN_ALL
gboolean tmpl_template_parse_path (TmplTemplate *self,
const gchar *path,
GCancellable *cancellable,
GError **error);
TMPL_AVAILABLE_IN_ALL
gboolean tmpl_template_parse_string (TmplTemplate *self,
const gchar *input,
GError **error);
TMPL_AVAILABLE_IN_ALL
gboolean tmpl_template_parse (TmplTemplate *self,
GInputStream *stream,
GCancellable *cancellable,
GError **error);
TMPL_AVAILABLE_IN_ALL
gboolean tmpl_template_expand (TmplTemplate *self,
GOutputStream *stream,
TmplScope *scope,
GCancellable *cancellable,
GError **error);
TMPL_AVAILABLE_IN_ALL
gchar *tmpl_template_expand_string (TmplTemplate *self,
TmplScope *scope,
GError **error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment