19a78dbdeSMike Pritchard.\" Copyright (c) [year] 29a78dbdeSMike Pritchard.\" [you name here]. All rights reserved. 39a78dbdeSMike Pritchard.\" 49a78dbdeSMike Pritchard.\" Redistribution and use in source and binary forms, with or without 59a78dbdeSMike Pritchard.\" modification, are permitted provided that the following conditions 69a78dbdeSMike Pritchard.\" are met: 79a78dbdeSMike Pritchard.\" 1. Redistributions of source code must retain the above copyright 89a78dbdeSMike Pritchard.\" notice, this list of conditions and the following disclaimer. 99a78dbdeSMike Pritchard.\" 2. Redistributions in binary form must reproduce the above copyright 109a78dbdeSMike Pritchard.\" notice, this list of conditions and the following disclaimer in the 119a78dbdeSMike Pritchard.\" documentation and/or other materials provided with the distribution. 129a78dbdeSMike Pritchard.\" 3. All advertising materials mentioning features or use of this software 139a78dbdeSMike Pritchard.\" must display the following acknowledgement: 149a78dbdeSMike Pritchard.\" This product includes software developed by [you name] 159a78dbdeSMike Pritchard.\" and its contributors. 169a78dbdeSMike Pritchard.\" 4. Neither the name of the University nor the names of its contributors 179a78dbdeSMike Pritchard.\" may be used to endorse or promote products derived from this software 189a78dbdeSMike Pritchard.\" without specific prior written permission. 199a78dbdeSMike Pritchard.\" 209a78dbdeSMike Pritchard.\" THIS SOFTWARE IS PROVIDED BY [you name] AND CONTRIBUTORS ``AS IS'' AND 219a78dbdeSMike Pritchard.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 229a78dbdeSMike Pritchard.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 239a78dbdeSMike Pritchard.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 249a78dbdeSMike Pritchard.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 259a78dbdeSMike Pritchard.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 269a78dbdeSMike Pritchard.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 279a78dbdeSMike Pritchard.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 289a78dbdeSMike Pritchard.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 299a78dbdeSMike Pritchard.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 309a78dbdeSMike Pritchard.\" SUCH DAMAGE. 319a78dbdeSMike Pritchard.\" 329a78dbdeSMike Pritchard.\" 339a78dbdeSMike Pritchard.Dd "January 2, 1997" 349a78dbdeSMike Pritchard.Dt EXAMPLE 3 359a78dbdeSMike Pritchard.\" Note: Only specify the operating system when the command 369a78dbdeSMike Pritchard.\" is FreeBSD specific, otherwise use the .Os macro with no 379a78dbdeSMike Pritchard.\" arguments. 389a78dbdeSMike Pritchard.Os FreeBSD 3.0 399a78dbdeSMike Pritchard.Sh NAME 409a78dbdeSMike Pritchard.Nm example 419a78dbdeSMike Pritchard.Nd example library function manual page 429a78dbdeSMike Pritchard.Sh SYNOPSIS 439a78dbdeSMike Pritchard.Fd #include <example.h> 449a78dbdeSMike Pritchard.Ft int 459a78dbdeSMike Pritchard.Fn example "char *ptr" "int mode" 469a78dbdeSMike Pritchard.Sh DESCRIPTION 479a78dbdeSMike PritchardThis is an example library function manual page for 489a78dbdeSMike Pritchardthe 499a78dbdeSMike Pritchard.Fn example 509a78dbdeSMike Pritchardfunction. It is intended 519a78dbdeSMike Pritchardthat this example can be used as a template when writing 529a78dbdeSMike Pritcharda new manual page. 539a78dbdeSMike Pritchard.Pp 549a78dbdeSMike PritchardThe 559a78dbdeSMike Pritchard.Fn example 569a78dbdeSMike Pritchardfunction takes two arguments: 579a78dbdeSMike Pritchard.Fa ptr 589a78dbdeSMike Pritchardand 599a78dbdeSMike Pritchard.Fa mode . 609a78dbdeSMike PritchardThe argument 619a78dbdeSMike Pritchard.Fa mode 629a78dbdeSMike Pritchardmay have one of the following values: 639a78dbdeSMike Pritchard.Bl -tag -width EXAMPLE_ONE 649a78dbdeSMike Pritchard.It Dv EXAMPLE_ONE 659a78dbdeSMike PritchardFirst example of a defined variable. 669a78dbdeSMike Pritchard.Dv EXAMPLE_ONE is described below. 679a78dbdeSMike Pritchard.It Dv EXAMPLE_TWO 689a78dbdeSMike PritchardSecond example. 699a78dbdeSMike Pritchard.El 709a78dbdeSMike Pritchard.Pp 719a78dbdeSMike PritchardThe above value are defined in 729a78dbdeSMike Pritchard.Aq example.h 739a78dbdeSMike Pritchardas follows: 749a78dbdeSMike Pritchard.Bd -literal 759a78dbdeSMike Pritchard#define EXAMPLE_ONE 1 769a78dbdeSMike Pritchard#define EXAMPLE_TWO 2 779a78dbdeSMike Pritchard.Ed 789a78dbdeSMike Pritchard.Sh RETURN VALUES 799a78dbdeSMike PritchardA 0 value is returned if the operation succeeds, 809a78dbdeSMike Pritchardotherwise 819a78dbdeSMike Pritchard.Fn example 829a78dbdeSMike Pritchardreturns -1 and the global variable 839a78dbdeSMike Pritchard.Va errno 849a78dbdeSMike Pritchardindicates the reason for the falure. 859a78dbdeSMike Pritchard.Sh ENVIRONMENT 869a78dbdeSMike PritchardThe 879a78dbdeSMike Pritchard.Fn example 889a78dbdeSMike Pritchardlibrary function ignores the 899a78dbdeSMike Pritchard.Ev EXAMPLE 909a78dbdeSMike Pritchardenvironment variable. 919a78dbdeSMike Pritchard.Sh FILES 929a78dbdeSMike Pritchard.Bl -tag -width /dev/null -compact 939a78dbdeSMike Pritchard.It Pa /dev/null 949a78dbdeSMike PritchardExample of a file in the 959a78dbdeSMike Pritchard.Sx FILES 969a78dbdeSMike Pritchardsection. 979a78dbdeSMike Pritchard.El 989a78dbdeSMike Pritchard.Sh SEE ALSO 999a78dbdeSMike Pritchard.Xr example 1 , 1009a78dbdeSMike Pritchard.Xr example 4 , 1019a78dbdeSMike Pritchard.Xr mdoc 7 , 1029a78dbdeSMike Pritchard.Xr mdoc.samples 7 1039a78dbdeSMike Pritchard.Sh STANDARDS 1049a78dbdeSMike PritchardIf the command conforms to some standard, such as 1059a78dbdeSMike Pritchard.St -p1003.2 1069a78dbdeSMike Pritchardor 1079a78dbdeSMike Pritchard.St -ansiC , 1089a78dbdeSMike Pritchardit should be noted here. 1099a78dbdeSMike Pritchard.Sh DIAGNOSTICS 1109a78dbdeSMike PritchardNone. 1119a78dbdeSMike Pritchard.Sh ERRORS 1129a78dbdeSMike Pritchard.Fn Example 1139a78dbdeSMike Pritchardwill fail if: 1149a78dbdeSMike Pritchard.Bl -tag -width Er 1159a78dbdeSMike Pritchard.It Bq Er EINVAL 1169a78dbdeSMike PritchardOne of the arguments passed to 1179a78dbdeSMike Pritchard.Fn example 1189a78dbdeSMike Pritchardwas invalid. 1199a78dbdeSMike Pritchard.It Bq Er EPERM 1209a78dbdeSMike PritchardThe caller did not have permission to 1219a78dbdeSMike Pritcharduse the 1229a78dbdeSMike Pritchard.Fn example 1239a78dbdeSMike Pritchardfunction. 1249a78dbdeSMike Pritchard.El 1259a78dbdeSMike Pritchard.Sh HISTORY 1269a78dbdeSMike PritchardThe 1279a78dbdeSMike Pritchard.Nm 1289a78dbdeSMike Pritchardmanual page example first appeared in 1299a78dbdeSMike Pritchard.Fx 3.0 . 1309a78dbdeSMike Pritchard.Sh AUTHOR 1319a78dbdeSMike PritchardThis 1329a78dbdeSMike Pritchardmanual page was written by Mike Pritchard 1339a78dbdeSMike Pritchard.Aq mpp@FreeBSD.ORG . 1349a78dbdeSMike Pritchard.Sh BUGS 1359a78dbdeSMike PritchardThe actual code for this function is vaporware. 136