Debian Codegraph @

upstream/debian-unstable/man3/sd-varlink.3

raw
1 '\" t
2 .TH "SD\-VARLINK" "3" "" "systemd 261~rc3" "sd-varlink"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 sd-varlink \- APIs for Varlink IPC
24 .SH "SYNOPSIS"
25 .sp
26 .ft B
27 .nf
28 #include <systemd/sd\-varlink\&.h>
29 .fi
30 .ft
31 .HP \w'\fBpkg\-config\ \-\-cflags\ \-\-libs\ libsystemd\fR\ 'u
32 \fBpkg\-config \-\-cflags \-\-libs libsystemd\fR
33 .SH "DESCRIPTION"
34 .PP
35 sd\-varlink\&.h
36 is part of
37 \fBlibsystemd\fR(3)
38 and provides APIs for implementing Varlink IPC clients and services\&. See
39 \m[blue]\fB\%https://varlink.org/\fR\m[]
40 for more information about Varlink IPC\&.
41 .PP
42 Varlink IPC uses
43 \m[blue]\fBJSON\fR\m[]\&\s-2\u[1]\d\s+2
44 as marshalling format\&. The sd\-varlink API relies on the
45 \fBsd-json\fR(3)
46 API for JSON serialization, deserialization and manipulation\&.
47 .PP
48 Canonical encoding rules: sd\-varlink omits the
49 ""parameters""
50 member on the wire in replies, errors, and notifications when there are no parameters to transmit\&. This reduces message size and avoids ambiguity\&. Receivers must be tolerant and accept any of the following encodings for the absence of parameters: an omitted
51 ""parameters""
52 key (preferred), a JSON
53 "null"
54 value, or an empty object
55 "{}"\&. When decoding, sd\-varlink treats JSON
56 "null"
57 as if the member was omitted\&.
58 .PP
59 The
60 \fBvarlinkctl\fR(1)
61 tool makes the functionality implemented by sd\-varlink available from the command line\&.
62 .SH "NOTES"
63 .PP
64 Functions described here are available as a shared library, which can be compiled against and linked to with the
65 \fBlibsystemd\fR\ \&\fBpkg-config\fR(1)
66 file\&.
67 .PP
68 The code described here uses
69 \fBgetenv\fR(3), which is declared to be not multi\-thread\-safe\&. This means that the code calling the functions described here must not call
70 \fBsetenv\fR(3)
71 from a parallel thread\&. It is recommended to only do calls to
72 \fBsetenv()\fR
73 from an early phase of the program when no other threads have been started\&.
74 .SH "DIRECTORIES"
75 .PP
76 /usr/lib/systemd/varlink\-bridges/
77 .RS 4
78 When
79 \fBsd_varlink_connect_url()\fR
80 encounters a URL with a scheme that is not natively supported, it looks for a bridge helper binary named after the URL scheme in this directory\&. The binary is invoked the same way as
81 "exec:"
82 binaries but with the full URL passed as the first command line argument\&.
83 .sp
84 For example, if
85 \fBvarlinkctl introspect https://example\&.com/ws/sockets/io\&.systemd\&.Hostname\fR
86 is called,
87 \fBvarlinkctl\fR
88 will look for an executable
89 /usr/lib/systemd/varlink\-bridges/https
90 and invoke it with
91 "https://example\&.com/ws/sockets/io\&.systemd\&.Hostname"
92 as its only argument\&.
93 .RE
94 .SH "SEE ALSO"
95 .PP
96 \fBsystemd\fR(1), \fBsd-event\fR(3), \fBsd-json\fR(3), \fBvarlinkctl\fR(1), \fBsd-bus\fR(3), \fBpkg-config\fR(1)
97 .SH "NOTES"
98 .IP " 1." 4
99 JSON
100 .RS 4
101 \%https://json.org/
102 .RE