ifcfg-rh: add svSetValueInt64() utility

This commit is contained in:
Thomas Haller 2015-10-08 13:40:45 +02:00
parent bc5a8e2e18
commit 325faa2379
2 changed files with 10 additions and 0 deletions

View file

@ -445,6 +445,15 @@ svSetValueFull (shvarFile *s, const char *key, const char *value, gboolean verba
g_free (keyValue);
}
void
svSetValueInt64 (shvarFile *s, const char *key, gint64 value)
{
gs_free char *v = NULL;
v = g_strdup_printf ("%"G_GINT64_FORMAT, value);
svSetValueFull (s, key, v, TRUE);
}
/* Write the current contents iff modified. Returns FALSE on error
* and TRUE on success. Do not write if no values have been modified.
* The mode argument is only used if creating the file, not if

View file

@ -75,6 +75,7 @@ gint64 svGetValueInt64 (shvarFile *s, const char *key, guint base, gint64 min, g
*/
void svSetValue (shvarFile *s, const char *key, const char *value, gboolean verbatim);
void svSetValueFull (shvarFile *s, const char *key, const char *value, gboolean verbatim);
void svSetValueInt64 (shvarFile *s, const char *key, gint64 value);
/* Write the current contents iff modified. Returns FALSE on error