mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
util: typedparam: Introduce virTypedParamListFromParams
The helper constructs a virTypedParamList from loose params. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
6c9117c988
commit
45064119c1
@ -3493,6 +3493,7 @@ virTypedParamListAddString;
|
||||
virTypedParamListAddUInt;
|
||||
virTypedParamListAddULLong;
|
||||
virTypedParamListFree;
|
||||
virTypedParamListFromParams;
|
||||
virTypedParamListStealParams;
|
||||
virTypedParamsCheck;
|
||||
virTypedParamsCopy;
|
||||
|
@ -738,6 +738,19 @@ virTypedParamListStealParams(virTypedParamList *list,
|
||||
return ret;
|
||||
}
|
||||
|
||||
virTypedParamList *
|
||||
virTypedParamListFromParams(virTypedParameterPtr *params,
|
||||
size_t nparams)
|
||||
{
|
||||
virTypedParamList *l = g_new0(virTypedParamList, 1);
|
||||
|
||||
l->par = g_steal_pointer(params);
|
||||
l->npar = nparams;
|
||||
l->par_alloc = nparams;
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
|
||||
static int G_GNUC_PRINTF(2, 0)
|
||||
virTypedParamSetNameVPrintf(virTypedParameterPtr par,
|
||||
|
@ -138,6 +138,10 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virTypedParamList, virTypedParamListFree);
|
||||
size_t virTypedParamListStealParams(virTypedParamList *list,
|
||||
virTypedParameterPtr *params);
|
||||
|
||||
virTypedParamList *
|
||||
virTypedParamListFromParams(virTypedParameterPtr *params,
|
||||
size_t nparams);
|
||||
|
||||
int virTypedParamListAddInt(virTypedParamList *list,
|
||||
int value,
|
||||
const char *namefmt,
|
||||
|
Loading…
Reference in New Issue
Block a user