1706f2543Smrg/* 2706f2543Smrg * Copyright (c) 1997 Metro Link Incorporated 3706f2543Smrg * 4706f2543Smrg * Permission is hereby granted, free of charge, to any person obtaining a 5706f2543Smrg * copy of this software and associated documentation files (the "Software"), 6706f2543Smrg * to deal in the Software without restriction, including without limitation 7706f2543Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8706f2543Smrg * and/or sell copies of the Software, and to permit persons to whom the 9706f2543Smrg * Software is furnished to do so, subject to the following conditions: 10706f2543Smrg * 11706f2543Smrg * The above copyright notice and this permission notice shall be included in 12706f2543Smrg * all copies or substantial portions of the Software. 13706f2543Smrg * 14706f2543Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15706f2543Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16706f2543Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17706f2543Smrg * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18706f2543Smrg * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 19706f2543Smrg * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20706f2543Smrg * SOFTWARE. 21706f2543Smrg * 22706f2543Smrg * Except as contained in this notice, the name of the Metro Link shall not be 23706f2543Smrg * used in advertising or otherwise to promote the sale, use or other dealings 24706f2543Smrg * in this Software without prior written authorization from Metro Link. 25706f2543Smrg * 26706f2543Smrg */ 27706f2543Smrg 28706f2543Smrg#ifndef _xisb_H_ 29706f2543Smrg#define _xisb_H_ 30706f2543Smrg 31706f2543Smrg#include <unistd.h> 32706f2543Smrg 33706f2543Smrg/****************************************************************************** 34706f2543Smrg * Definitions 35706f2543Smrg * structs, typedefs, #defines, enums 36706f2543Smrg *****************************************************************************/ 37706f2543Smrg 38706f2543Smrgtypedef struct _XISBuffer 39706f2543Smrg{ 40706f2543Smrg int fd; 41706f2543Smrg int trace; 42706f2543Smrg int block_duration; 43706f2543Smrg ssize_t current; /* bytes read */ 44706f2543Smrg ssize_t end; 45706f2543Smrg ssize_t buffer_size; 46706f2543Smrg unsigned char *buf; 47706f2543Smrg} XISBuffer; 48706f2543Smrg 49706f2543Smrg/****************************************************************************** 50706f2543Smrg * Declarations 51706f2543Smrg * variables: use xisb_LOC in front 52706f2543Smrg * of globals. 53706f2543Smrg * put locals in the .c file. 54706f2543Smrg *****************************************************************************/ 55706f2543Smrgextern _X_EXPORT XISBuffer * XisbNew (int fd, ssize_t size); 56706f2543Smrgextern _X_EXPORT void XisbFree (XISBuffer *b); 57706f2543Smrgextern _X_EXPORT int XisbRead (XISBuffer *b); 58706f2543Smrgextern _X_EXPORT ssize_t XisbWrite (XISBuffer *b, unsigned char *msg, ssize_t len); 59706f2543Smrgextern _X_EXPORT void XisbTrace (XISBuffer *b, int trace); 60706f2543Smrgextern _X_EXPORT void XisbBlockDuration (XISBuffer *b, int block_duration); 61706f2543Smrg 62706f2543Smrg/* 63706f2543Smrg * DO NOT PUT ANYTHING AFTER THIS ENDIF 64706f2543Smrg */ 65706f2543Smrg#endif 66