xref: /netbsd-src/lib/libcurses/curses_fileio.3 (revision 8ac07aec990b9d2e483062509d0a9fa5b4f57cf2)
1.\"	$NetBSD: curses_fileio.3,v 1.2 2008/04/14 21:29:30 jdc Exp $
2.\" Copyright (c) 2008 The NetBSD Foundation, Inc.
3.\" All rights reserved.
4.\"
5.\" This code is derived from software contributed to The NetBSD Foundation
6.\" by Julian Coleman.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in the
15.\"    documentation and/or other materials provided with the distribution.
16.\" 3. Neither the name of The NetBSD Foundation nor the names of its
17.\"    contributors may be used to endorse or promote products derived
18.\"    from this software without specific prior written permission.
19.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29.\" POSSIBILITY OF SUCH DAMAGE.
30.\"
31.Dd March 31, 2008
32.Dt CURSES_FILEIO 3
33.Os
34.Sh NAME
35.Nm curses_fileio ,
36.Nm getwin ,
37.Nm putwin
38.Nd curses file input/output routines
39.Sh LIBRARY
40.Lb libcurses
41.Sh SYNOPSIS
42.In curses.h
43.Ft WINDOW *
44.Fn getwin "FILE *fp"
45.Ft int
46.Fn putwin "WINDOW *win" "FILE *fp"
47.Sh DESCRIPTION
48These functions read and write data to and from files.
49.Pp
50The
51.Fn getwin
52function reads window data that has been stored in the file to which
53.Fa fp
54points, and then creates a new window using that data.
55.Pp
56The
57.Fn putwin
58function writes window data from the window
59.Fa win
60to the file pointed to by
61.Fa fp .
62.Sh RETURN VALUES
63The
64.Fn getwin
65function returns one of the following values:
66.Pp
67.Bl -tag -width ERR -compact
68.It Er OK
69The function completed successfully.
70.It Er ERR
71An error occurred in the function.
72.El
73.Pp
74The
75.Fn putwin
76function returns
77.Dv NULL
78if an error is detected.
79.Sh SEE ALSO
80.Xr curses_window 3 ,
81.Xr fread 3,
82.Xr fwrite 3
83.Sh NOTES
84Subwindows can not be created by the
85.Fn getwin
86function, nor written by the
87.Fn putwin
88function.
89.Sh STANDARDS
90The
91.Nx
92Curses library complies with the X/Open Curses specification, part of the
93Single Unix Specification.
94.Sh HISTORY
95These functions first appeared in
96.Nx 5.0 .
97