xref: /freebsd/share/man/man9/devctl_safe_quote_sb.9 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1c6d67028SWarner Losh.\"
2c6d67028SWarner Losh.\" Copyright (c) 2020 M Warner Losh
3c6d67028SWarner Losh.\"
4c6d67028SWarner Losh.\" Redistribution and use in source and binary forms, with or without
5c6d67028SWarner Losh.\" modification, are permitted provided that the following conditions
6c6d67028SWarner Losh.\" are met:
7c6d67028SWarner Losh.\" 1. Redistributions of source code must retain the above copyright
8c6d67028SWarner Losh.\"    notice, this list of conditions and the following disclaimer.
9c6d67028SWarner Losh.\" 2. Redistributions in binary form must reproduce the above copyright
10c6d67028SWarner Losh.\"    notice, this list of conditions and the following disclaimer in the
11c6d67028SWarner Losh.\"    documentation and/or other materials provided with the distribution.
12c6d67028SWarner Losh.\"
13c6d67028SWarner Losh.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
14c6d67028SWarner Losh.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15c6d67028SWarner Losh.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16c6d67028SWarner Losh.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
17c6d67028SWarner Losh.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18c6d67028SWarner Losh.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19c6d67028SWarner Losh.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20c6d67028SWarner Losh.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21c6d67028SWarner Losh.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22c6d67028SWarner Losh.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23c6d67028SWarner Losh.\"
24c6d67028SWarner Losh.Dd September 22, 2020
25c6d67028SWarner Losh.Dt DEVCTL_SAFE_QUOTE_SB 9
26c6d67028SWarner Losh.Os
27c6d67028SWarner Losh.Sh NAME
28c6d67028SWarner Losh.Nm devctl_safe_quote_sb
29c6d67028SWarner Losh.Nd Insert a string, properly quoted, into a sbuf
30c6d67028SWarner Losh.Sh SYNOPSIS
31c6d67028SWarner Losh.In sys/devctl.h
32c6d67028SWarner Losh.In sys/sbuf.h
33c6d67028SWarner Losh.Ft void
34c6d67028SWarner Losh.Fn devctl_safe_quote_sb "struct sbuf *sb" "const char *src"
35c6d67028SWarner Losh.Sh DESCRIPTION
36c6d67028SWarner LoshCopy the string from
37*4d1bad3cSWarner Losh.Va src
38c6d67028SWarner Loshinto
39*4d1bad3cSWarner Losh.Va sb .
40c6d67028SWarner LoshAll backslash characters are doubled.
41c6d67028SWarner LoshAll double quote characters
42*4d1bad3cSWarner Losh.Sq \&"
43c6d67028SWarner Loshare also preceded by a backslash.
44c6d67028SWarner LoshAll other characters are copied without modification.
45c6d67028SWarner LoshThe
46c6d67028SWarner Losh.Xr devctl 4
47c6d67028SWarner Loshprotocol requires quoted string to be quoted thus.
48c6d67028SWarner LoshThis routine centralizes this knowledge.
49c6d67028SWarner Losh.Sh SEE ALSO
50c6d67028SWarner Losh.Xr devd 8
51c6d67028SWarner Losh.Sh AUTHORS
52c6d67028SWarner LoshThis manual page was written by
53c6d67028SWarner Losh.An M. Warner Losh
54