xref: /OK3568_Linux_fs/external/xserver/hw/xfree86/common/xisb.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Copyright (c) 1997  Metro Link Incorporated
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Permission is hereby granted, free of charge, to any person obtaining a
5*4882a593Smuzhiyun  * copy of this software and associated documentation files (the "Software"),
6*4882a593Smuzhiyun  * to deal in the Software without restriction, including without limitation
7*4882a593Smuzhiyun  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8*4882a593Smuzhiyun  * and/or sell copies of the Software, and to permit persons to whom the
9*4882a593Smuzhiyun  * Software is furnished to do so, subject to the following conditions:
10*4882a593Smuzhiyun  *
11*4882a593Smuzhiyun  * The above copyright notice and this permission notice shall be included in
12*4882a593Smuzhiyun  * all copies or substantial portions of the Software.
13*4882a593Smuzhiyun  *
14*4882a593Smuzhiyun  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15*4882a593Smuzhiyun  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16*4882a593Smuzhiyun  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17*4882a593Smuzhiyun  * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18*4882a593Smuzhiyun  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
19*4882a593Smuzhiyun  * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20*4882a593Smuzhiyun  * SOFTWARE.
21*4882a593Smuzhiyun  *
22*4882a593Smuzhiyun  * Except as contained in this notice, the name of the Metro Link shall not be
23*4882a593Smuzhiyun  * used in advertising or otherwise to promote the sale, use or other dealings
24*4882a593Smuzhiyun  * in this Software without prior written authorization from Metro Link.
25*4882a593Smuzhiyun  *
26*4882a593Smuzhiyun  */
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun #ifndef	_xisb_H_
29*4882a593Smuzhiyun #define _xisb_H_
30*4882a593Smuzhiyun 
31*4882a593Smuzhiyun #include <unistd.h>
32*4882a593Smuzhiyun 
33*4882a593Smuzhiyun /******************************************************************************
34*4882a593Smuzhiyun  *		Definitions
35*4882a593Smuzhiyun  *									structs, typedefs, #defines, enums
36*4882a593Smuzhiyun  *****************************************************************************/
37*4882a593Smuzhiyun 
38*4882a593Smuzhiyun typedef struct _XISBuffer {
39*4882a593Smuzhiyun     int fd;
40*4882a593Smuzhiyun     int trace;
41*4882a593Smuzhiyun     int block_duration;
42*4882a593Smuzhiyun     ssize_t current;            /* bytes read */
43*4882a593Smuzhiyun     ssize_t end;
44*4882a593Smuzhiyun     ssize_t buffer_size;
45*4882a593Smuzhiyun     unsigned char *buf;
46*4882a593Smuzhiyun } XISBuffer;
47*4882a593Smuzhiyun 
48*4882a593Smuzhiyun /******************************************************************************
49*4882a593Smuzhiyun  *		Declarations
50*4882a593Smuzhiyun  *								variables:	use xisb_LOC in front
51*4882a593Smuzhiyun  *											of globals.
52*4882a593Smuzhiyun  *											put locals in the .c file.
53*4882a593Smuzhiyun  *****************************************************************************/
54*4882a593Smuzhiyun extern _X_EXPORT XISBuffer *XisbNew(int fd, ssize_t size);
55*4882a593Smuzhiyun extern _X_EXPORT void XisbFree(XISBuffer * b);
56*4882a593Smuzhiyun extern _X_EXPORT int XisbRead(XISBuffer * b);
57*4882a593Smuzhiyun extern _X_EXPORT ssize_t XisbWrite(XISBuffer * b, unsigned char *msg,
58*4882a593Smuzhiyun                                    ssize_t len);
59*4882a593Smuzhiyun extern _X_EXPORT void XisbTrace(XISBuffer * b, int trace);
60*4882a593Smuzhiyun extern _X_EXPORT void XisbBlockDuration(XISBuffer * b, int block_duration);
61*4882a593Smuzhiyun 
62*4882a593Smuzhiyun /*
63*4882a593Smuzhiyun  *	DO NOT PUT ANYTHING AFTER THIS ENDIF
64*4882a593Smuzhiyun  */
65*4882a593Smuzhiyun #endif
66