129 lines
3.4 KiB
HTML
129 lines
3.4 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of SD_ID128_TO_STRING</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>SD_ID128_TO_STRING</H1>
|
|
Section: sd_id128_to_string (3)<BR>Updated: <BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
sd_id128_to_string, sd_id128_from_string - Format or parse 128-bit IDs as strings
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<P>
|
|
<B>
|
|
</B><PRE>
|
|
#include <<A HREF="file:///usr/include/systemd/sd-id128.h">systemd/sd-id128.h</A>>
|
|
</PRE>
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">
|
|
<B>char *sd_id128_to_string(sd_id128_t </B><I>id</I><B>, char </B><I>s</I><B>[33]);</B>
|
|
|
|
<DT id="2">
|
|
<B>int sd_id128_from_string(const char *</B><I>s</I><B>, sd_id128_t *</B><I>ret</I><B>);</B>
|
|
|
|
</DL>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
|
|
<B>sd_id128_to_string()</B>
|
|
<DD>formats a 128-bit ID as a character string. It expects the ID and a string array capable of storing 33 characters. The ID will be formatted as 32 lowercase hexadecimal digits and be terminated by a
|
|
<B>NUL</B>
|
|
byte.
|
|
<P>
|
|
|
|
<B>sd_id128_from_string()</B>
|
|
implements the reverse operation: it takes a 33 character string with 32 hexadecimal digits (either lowercase or uppercase, terminated by
|
|
<B>NUL</B>) and parses them back into a 128-bit ID returned in
|
|
<I>ret</I>. Alternatively, this call can also parse a 37-character string with a 128-bit ID formatted as RFC UUID. If
|
|
<I>ret</I>
|
|
is passed as NULL the function will validate the passed ID string, but not actually return it in parsed form.
|
|
<P>
|
|
|
|
For more information about the
|
|
"sd_id128_t"
|
|
type see
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd-id128">sd-id128</A></B>(3). Note that these calls operate the same way on all architectures, i.e. the results do not depend on endianness.
|
|
<P>
|
|
|
|
When formatting a 128-bit ID into a string, it is often easier to use a format string for
|
|
<B><A HREF="/cgi-bin/man/man2html?3+printf">printf</A></B>(3). This is easily done using the
|
|
<B>SD_ID128_FORMAT_STR</B>
|
|
and
|
|
<B>SD_ID128_FORMAT_VAL()</B>
|
|
macros. For more information see
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd-id128">sd-id128</A></B>(3).
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
<P>
|
|
|
|
<B>sd_id128_to_string()</B>
|
|
always succeeds and returns a pointer to the string array passed in.
|
|
<B>sd_id128_from_string</B>
|
|
returns 0 on success, in which case
|
|
<I>ret</I>
|
|
is filled in, or a negative errno-style error code.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
<P>
|
|
|
|
These APIs are implemented as a shared library, which can be compiled and linked to with the
|
|
<B>libsystemd</B> <B><A HREF="/cgi-bin/man/man2html?1+pkg-config">pkg-config</A></B>(1)
|
|
file.
|
|
<A NAME="lbAG"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<P>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+systemd">systemd</A></B>(1),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd-id128">sd-id128</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+printf">printf</A></B>(3)
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="3"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="4"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="5"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="6"><A HREF="#lbAE">RETURN VALUE</A><DD>
|
|
<DT id="7"><A HREF="#lbAF">NOTES</A><DD>
|
|
<DT id="8"><A HREF="#lbAG">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:55 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|