aboutsummaryrefslogtreecommitdiffstats
path: root/man3/libnormalform_clone.3
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-07-19 01:29:42 +0200
committerMattias Andrée <maandree@kth.se>2024-07-19 01:29:42 +0200
commit4294ec0ed06ee34920c9edaeebaeb8b65c720791 (patch)
treee0cded59452597c04fb38f403745a384675cb5f9 /man3/libnormalform_clone.3
downloadlibnormalform-4294ec0ed06ee34920c9edaeebaeb8b65c720791.tar.gz
libnormalform-4294ec0ed06ee34920c9edaeebaeb8b65c720791.tar.bz2
libnormalform-4294ec0ed06ee34920c9edaeebaeb8b65c720791.tar.xz
First commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--man3/libnormalform_clone.3104
1 files changed, 104 insertions, 0 deletions
diff --git a/man3/libnormalform_clone.3 b/man3/libnormalform_clone.3
new file mode 100644
index 0000000..0906a44
--- /dev/null
+++ b/man3/libnormalform_clone.3
@@ -0,0 +1,104 @@
+.TH LIBNORMALFORM_CLONE 3 LIBNORMALFORM
+.SH NAME
+libnormalform_clone \- Create a deep clone
+
+.SH SYNOPSIS
+.nf
+#include <libnormalform.h>
+
+LIBNORMALFORM_SENTENCE *libnormalform_clone(LIBNORMALFORM_SENTENCE *\fIx\fP);
+.fi
+.PP
+Link with
+.IR -lnormalform .
+
+.SH DESCRIPTION
+The
+.BR libnormalform_clone ()
+function creates a deep clone of
+.IR x ,
+letting the application use the same
+sentence in concurrently from two threads.
+.PP
+Before calling the
+.BR libnormalform_clone ()
+function, application provided objects in
+.I x
+must be configured for cloning:
+.I .copy_for_clone
+in each
+.IR "struct libnormalform_variable" ,
+.IR "struct libnormalform_function" ,
+.IR "struct libnormalform_map" ,
+and
+.IR "struct libnormalform_transformer" ,
+shall either be set to the copy of the
+object to use in the clone of
+.IR x ,
+or to
+.I NULL
+if the object can safely be used by the
+clone of
+.IR x .
+.PP
+The returned pointer shall either be
+deallocated with the
+.BR libnormalform_free (3)
+function or be relinquished by being
+used as part of another sentence.
+
+.SH RETURN VALUE
+Upon successful completion, the
+.BR libnormalform_clone ()
+function returns a deep clone of
+.IR x ;
+otherwise, the function returns
+.I NULL
+and sets
+.I errno
+to indicate the error.
+
+.SH ERRORS
+The
+.BR libnormalform_clone ()
+function fails if:
+.TP
+.I ENOMEM
+Insufficient memory was available to
+create the sentence object.
+.PP
+The
+.BR libnormalform_clone ()
+function also fails without setting
+.I errno
+if
+.I x
+is
+.IR NULL .
+
+.SH ATTRIBUTES
+For an explanation of the terms used in this
+section, see
+.BR attributes (7)
+and
+.IR "info \(dq(libc)POSIX Safety Concepts\(dq" .
+.TS
+allbox;
+lb lb lb
+l l l.
+Interface Attribute Value
+T{
+.BR libnormalform_clone ()
+T} Thread safety MT-Safe race:\fIx\fP
+T{
+.BR libnormalform_clone ()
+T} Async-signal safety AS-Unsafe heap
+T{
+.BR libnormalform_clone ()
+T} Async-cancel safety AC-Safe mem, AC-Unsafe heap
+.TE
+
+.SH SEE ALSO
+.BR libnormalform (7),
+.BR libnormalform_ref (3),
+.BR libnormalform_free (3)