xref: /illumos-gate/usr/src/lib/libxcurses/h/m_wio.h (revision 201ceb75ab95f9bf1f42ea1dc9ab363b43ba47cf)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*
28  * m_wio.h
29  *
30  * Wide I/O Library
31  *
32  * Copyright 1990, 1995 by Mortice Kern Systems Inc.  All rights reserved.
33  *
34  * $Header: /rd/h/rcs/m_wio.h 1.3 1995/10/02 15:36:15 ant Exp $
35  */
36 
37 #ifndef __M_WIO_H__
38 #define __M_WIO_H__
39 
40 #include <stdlib.h>
41 #include <wchar.h>
42 
43 typedef struct {
44         /* Public. */
45         void *object;                   /* I/O object (normally a stream). */
46         int (*get)(void *);             /* Get byte from input object. */
47         int (*put)(int, void *);        /* Put byte to output object. */
48         int (*unget)(int, void *);      /* Push byte onto input object. */
49         int (*iseof)(void *);           /* Eof last read? */
50         int (*iserror)(void *);         /* Error last read/write? */
51         void (*reset)(void *);		/* Reset error flags. */
52 
53         /* Private. */
54         int _next;
55         int _size;
56         mbstate_t _state;
57         unsigned char _mb[MB_LEN_MAX];
58 } t_wide_io;
59 
60 extern wint_t m_wio_get(t_wide_io *);
61 extern int m_wio_put(wint_t, t_wide_io *);
62 
63 #endif /* __M_WIO_H__ */
64