xref: /freebsd/lib/libsysdecode/sysdecode_quotactl_cmd.3 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
19289f547SJohn Baldwin.\"
29289f547SJohn Baldwin.\" Copyright (c) 2016 John Baldwin <jhb@FreeBSD.org>
39289f547SJohn Baldwin.\"
49289f547SJohn Baldwin.\" Redistribution and use in source and binary forms, with or without
59289f547SJohn Baldwin.\" modification, are permitted provided that the following conditions
69289f547SJohn Baldwin.\" are met:
79289f547SJohn Baldwin.\" 1. Redistributions of source code must retain the above copyright
89289f547SJohn Baldwin.\"    notice, this list of conditions and the following disclaimer.
99289f547SJohn Baldwin.\" 2. Redistributions in binary form must reproduce the above copyright
109289f547SJohn Baldwin.\"    notice, this list of conditions and the following disclaimer in the
119289f547SJohn Baldwin.\"    documentation and/or other materials provided with the distribution.
129289f547SJohn Baldwin.\"
139289f547SJohn Baldwin.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
149289f547SJohn Baldwin.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
159289f547SJohn Baldwin.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
169289f547SJohn Baldwin.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
179289f547SJohn Baldwin.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
189289f547SJohn Baldwin.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
199289f547SJohn Baldwin.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
209289f547SJohn Baldwin.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
219289f547SJohn Baldwin.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
229289f547SJohn Baldwin.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
239289f547SJohn Baldwin.\" SUCH DAMAGE.
249289f547SJohn Baldwin.\"
25*2edb60b9SJohn Baldwin.Dd November 24, 2017
269289f547SJohn Baldwin.Dt sysdecode_quotactl_cmd 3
279289f547SJohn Baldwin.Os
289289f547SJohn Baldwin.Sh NAME
299289f547SJohn Baldwin.Nm sysdecode_quotactl_cmd
309289f547SJohn Baldwin.Nd output name of quotactl command
319289f547SJohn Baldwin.Sh LIBRARY
329289f547SJohn Baldwin.Lb libsysdecode
339289f547SJohn Baldwin.Sh SYNOPSIS
349289f547SJohn Baldwin.In sysdecode.h
359289f547SJohn Baldwin.Ft bool
369289f547SJohn Baldwin.Fn sysdecode_quotactl_cmd "FILE *fp" "int cmd"
379289f547SJohn Baldwin.Sh DESCRIPTION
389289f547SJohn BaldwinThe
399289f547SJohn Baldwin.Fn sysdecode_quotactl_cmd
409289f547SJohn Baldwinfunction outputs a text description of the
419289f547SJohn Baldwin.Fa cmd
429289f547SJohn Baldwinargument to
439289f547SJohn Baldwin.Xr quotactl 2
449289f547SJohn Baldwinto the stream
459289f547SJohn Baldwin.Fa fp .
469289f547SJohn BaldwinThe description is formatted as an invocation of the
479289f547SJohn Baldwin.Dv QCMD
489289f547SJohn Baldwinmacro defined in the
499289f547SJohn Baldwin.In ufs/ufs/quota.h
509289f547SJohn Baldwinheader.
519289f547SJohn Baldwin.Pp
529289f547SJohn BaldwinThe function first computes the primary and secondary values used by
539289f547SJohn Baldwin.Dv QCMD
549289f547SJohn Baldwinto construct
559289f547SJohn Baldwin.Fa cmd .
569289f547SJohn BaldwinIf the primary command value does not represent a known constant,
579289f547SJohn Baldwin.Fn sysdecode_quotactl_cmd
589289f547SJohn Baldwindoes not generate any output and returns
599289f547SJohn Baldwin.Dv false .
609289f547SJohn BaldwinOtherwise,
619289f547SJohn Baldwin.Fn sysdecode_quotactl_cmd
629289f547SJohn Baldwinoutputs text depicting an invocation of
639289f547SJohn Baldwin.Dv QCMD
649289f547SJohn Baldwinwith the associated constants for the primary and secondary command values
659289f547SJohn Baldwinand returns
669289f547SJohn Baldwin.Dv true .
679289f547SJohn BaldwinIf the secondary command values does not represent a known constant,
689289f547SJohn Baldwinits value is output as a hexadecimal integer.
699289f547SJohn Baldwin.Sh RETURN VALUES
709289f547SJohn BaldwinThe
719289f547SJohn Baldwin.Nm sysdecode_quotactl_cmd
729289f547SJohn Baldwinfunction returns
739289f547SJohn Baldwin.Dv true
749289f547SJohn Baldwinif it outputs a description of
759289f547SJohn Baldwin.Fa cmd
769289f547SJohn Baldwinand
779289f547SJohn Baldwin.Dv false
789289f547SJohn Baldwinif it does not.
799289f547SJohn Baldwin.Sh EXAMPLES
809289f547SJohn BaldwinThe statement
819289f547SJohn Baldwin.Pp
829289f547SJohn Baldwin.Dl sysdecode_quotatcl_cmd(stdout, QCMD(Q_GETQUOTA, USRQUOTA);
839289f547SJohn Baldwin.Pp
849289f547SJohn Baldwinoutputs the text
859289f547SJohn Baldwin.Dq QCMD(Q_GETQUOTA, USRQUOTA)
869289f547SJohn Baldwinto standard output.
879289f547SJohn Baldwin.Sh SEE ALSO
889289f547SJohn Baldwin.Xr sysdecode 3
89