/usr/include/buf.h is in tcl-memchan-dev 2.3-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | #ifndef BUF_H
/*
* buf.h --
*
* Definitions for buffer objects.
*
* Copyright (C) 2000 Andreas Kupries (a.kupries@westend.com)
* All rights reserved.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
* software and its documentation for any purpose, provided that the
* above copyright notice and the following two paragraphs appear in
* all copies of this software.
*
* IN NO EVENT SHALL I BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
* INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS
* SOFTWARE AND ITS DOCUMENTATION, EVEN IF I HAVE BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* I SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND
* I HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
* ENHANCEMENTS, OR MODIFICATIONS.
*
* CVS: $Id: buf.h,v 1.3 2002/08/23 18:04:40 andreas_kupries Exp $
*/
#include <errno.h>
#include <tcl.h>
/*
* Windows needs to know which symbols to export. Unix does not.
* BUILD_Memchan should be undefined for Unix.
*/
#ifdef BUILD_Memchan
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLEXPORT
#endif /* BUILD_Memchan */
#ifdef __cplusplus
extern "C" {
#endif
/*
* The definitions in this header and the accompanying code define a
* generic buffer object.
*
* The code here is partially based upon the buffer structures used by
* the tcl core and uponconcepts laid out in the STREAMS paper at
* http://cm.bell-labs.com/cm/cs/who/dmr/st.html
*
* I hope that it can and will be used in a future reorganization of
* the core I/O system.
*/
/* Basis:
* Refcounted buffers. The structures actually holding
* information. Buffers are typed to allow differentation
* between simple data and special control blocks.
*
* To the outside they are opaque tokens.
* All access to them have to go through the public API.
*/
typedef struct Buf_Buffer_* Buf_Buffer;
/*
* Definition of the type for variables referencing a position
* in a buffer. Opaque token.
*/
typedef struct Buf_BufferPosition_* Buf_BufferPosition;
/*
* Another opaque structure: Queues of buffers.
* The queues defined here are thread-safe !
*/
typedef struct Buf_BufferQueue_* Buf_BufferQueue;
/* The structure for a buffer type.
* Before that the interfaces of the procedures used by buffer types.
*/
typedef int (Buf_ReadProc) _ANSI_ARGS_ ((Buf_Buffer buf, ClientData clientData,
VOID* outbuf, int size));
typedef int (Buf_WriteProc) _ANSI_ARGS_ ((Buf_Buffer buf, ClientData clientData,
CONST VOID* inbuf, int size));
typedef Buf_Buffer (Buf_DuplicateProc) _ANSI_ARGS_ ((Buf_Buffer buf,
ClientData clientData));
typedef void (Buf_FreeProc) _ANSI_ARGS_ ((Buf_Buffer buf,
ClientData clientData));
typedef int (Buf_SizeProc) _ANSI_ARGS_ ((Buf_Buffer buf,
ClientData clientData));
typedef int (Buf_TellProc) _ANSI_ARGS_ ((Buf_Buffer buf,
ClientData clientData));
typedef char* (Buf_DataProc) _ANSI_ARGS_ ((Buf_Buffer buf,
ClientData clientData));
typedef struct Buf_BufferType_ {
char* typeName; /* The name of the buffer type.
* Statically allocated.
* Not touched by the system */
Buf_ReadProc* readProc; /* Procedure called to read data
* from a buffer of this type. */
Buf_WriteProc* writeProc; /* Procedure called to write data
* into a buffer of this type. */
Buf_DuplicateProc* dupProc; /* Procedure called to duplicate
* a buffer of this type. */
Buf_FreeProc* freeProc; /* Procedure called to free
* a buffer of this type. */
Buf_SizeProc* sizeProc; /* Procedure called to ask for the
* size of a buffer of this type. */
Buf_TellProc* tellProc; /* Procedure called to ask for the
* offset of the read location. */
Buf_DataProc* dataProc; /* Procedure called to ask for a
* pointer to the data area of a
* buffer. */
} Buf_BufferType;
#include "bufDecls.h"
#ifdef __cplusplus
}
#endif /* C++ */
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
#endif /* BUF_H */
|