[template-glib] scope: add null helper



commit e3ea65b25b8e95473a4ba7d1ed10f7588c761956
Author: Christian Hergert <chergert redhat com>
Date:   Thu May 5 16:53:47 2022 -0700

    scope: add null helper

 src/tmpl-scope.c | 12 ++++++++++++
 src/tmpl-scope.h |  3 +++
 2 files changed, 15 insertions(+)
---
diff --git a/src/tmpl-scope.c b/src/tmpl-scope.c
index e38606b..ecd1c5f 100644
--- a/src/tmpl-scope.c
+++ b/src/tmpl-scope.c
@@ -483,3 +483,15 @@ tmpl_scope_list_symbols (TmplScope *self,
 
   return (char **)g_ptr_array_free (ar, FALSE);
 }
+
+void
+tmpl_scope_set_null (TmplScope  *self,
+                     const char *name)
+{
+  GValue value = G_VALUE_INIT;
+
+  g_value_init (&value, G_TYPE_POINTER);
+  g_value_set_pointer (&value, NULL);
+
+  tmpl_scope_set_value (self, name, &value);
+}
diff --git a/src/tmpl-scope.h b/src/tmpl-scope.h
index a871bf0..8e09c9c 100644
--- a/src/tmpl-scope.h
+++ b/src/tmpl-scope.h
@@ -99,6 +99,9 @@ gboolean    tmpl_scope_require         (TmplScope         *self,
 TMPL_AVAILABLE_IN_3_36
 char      **tmpl_scope_list_symbols    (TmplScope         *self,
                                         gboolean           recursive);
+TMPL_AVAILABLE_IN_3_36
+void        tmpl_scope_set_null        (TmplScope         *self,
+                                        const char        *name);
 
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (TmplScope, tmpl_scope_unref)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]