.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "doc::unibi_from_mem 3" .TH doc::unibi_from_mem 3 2024-03-17 unibilium-2.1.1 unibilium .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME unibi_from_mem \- construct a terminal object from a compiled terminfo entry .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& #include \& \& unibi_term *unibi_from_mem(const char *p, size_t n); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This function parses a compiled terminfo entry that starts at \fIp\fR and is \fIn\fR bytes long, and constructs a \f(CW\*(C`unibi_term\*(C'\fR object from it. When you're done with this object, you should call \f(CW\*(C`unibi_destroy\*(C'\fR to free it. .PP \&\f(CW\*(C`unibi_from_mem\*(C'\fR parses both the traditional ncurses terminfo format (starting with the bytes \f(CW\*(C`1A 01\*(C'\fR) and the newer "wide integer" format (starting with the bytes \f(CW\*(C`1E 02\*(C'\fR). .SH "RETURN VALUE" .IX Header "RETURN VALUE" A pointer to a new \f(CW\*(C`unibi_term\*(C'\fR. In case of failure, \f(CW\*(C`NULL\*(C'\fR is returned and \&\f(CW\*(C`errno\*(C'\fR is set. .SH ERRORS .IX Header "ERRORS" .ie n .IP """EINVAL""" 4 .el .IP \f(CWEINVAL\fR 4 .IX Item "EINVAL" The bytes \fIp\fR points at don't look like a valid terminfo entry. .ie n .IP """EFAULT""" 4 .el .IP \f(CWEFAULT\fR 4 .IX Item "EFAULT" \&\fIn\fR is too small for a valid terminfo entry. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBunibilium.h\fR\|(3), \&\fBunibi_dump\fR\|(3), \&\fBunibi_destroy\fR\|(3), \&\fBunibi_from_fp\fR\|(3), \&\fBunibi_from_fd\fR\|(3), \&\fBunibi_from_file\fR\|(3), \&\fBunibi_from_term\fR\|(3), \&\fBunibi_from_env\fR\|(3)