.\" Automatically generated by Pandoc 2.0.6
.\"
.TH "PMEMSET_SOURCE_FROM_PMEM2" "3" "2022-08-25" "PMDK - pmemset API version 1.0" "PMDK Programmer's Manual"
.hy
.\" SPDX-License-Identifier: BSD-3-Clause
.\" Copyright 2020, Intel Corporation
.SH NAME
.PP
\f[B]pmemset_source_from_pmem2\f[]() \- creates an instance of
persistent set data source
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\ <libpmemset.h>

int\ pmemset_source_from_pmem2(struct\ pmemset_source\ **src,\ struct\ pmem2_source\ *pmem2_src);
\f[]
.fi
.SH DESCRIPTION
.PP
The \f[B]pmemset_source_from_pmem2\f[]() function instantiates a new
\f[I]struct pmemset_source\f[] object describing set of data.
The \f[I]pmemset_source\f[] is created using \f[I]pmem2_source\f[] from
\f[B]libpmem2\f[](7) library.
For more details see \f[B]pmem2_source\f[](3) man page.
.SH RETURN VALUE
.PP
The \f[B]pmemset_source_from_pmem2\f[]() function returns 0 on success
or a negative error code on failure.
.SH ERRORS
.PP
\f[B]pmemset_source_from_pmem2\f[]() can fail with the following errors:
.IP \[bu] 2
\f[B]\-ENOMEM\f[] \- in case of insufficient memory to allocate an
instance of \f[I]struct pmemset_source\f[].
.IP \[bu] 2
\f[B]PMEMSET_E_INVALID_PMEM2_SOURCE\f[] \- if the \f[I]struct
pmem2_source\f[] is NULL.
.SH SEE ALSO
.PP
\f[B]errno\f[](3), \f[B]pmem2_source\f[](3), \f[B]libpmem2\f[](7),
\f[B]libpmemset\f[](7) and \f[B]<http://pmem.io>\f[]
