comparison lib/imlib/imbuf.h @ 0:92745d501b9a

initial import from kinput2-v3.1
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Mon, 08 Mar 2010 04:44:30 +0900
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:92745d501b9a
1 /* $Id: imbuf.h,v 1.4 1994/05/12 09:01:05 ishisone Exp $ */
2 /*
3 * Copyright (c) 1994 Software Research Associates, Inc.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation for any purpose and without fee is hereby granted, provided
7 * that the above copyright notice appear in all copies and that both that
8 * copyright notice and this permission notice appear in supporting
9 * documentation, and that the name of Software Research Associates not be
10 * used in advertising or publicity pertaining to distribution of the
11 * software without specific, written prior permission. Software Research
12 * Associates makes no representations about the suitability of this software
13 * for any purpose. It is provided "as is" without express or implied
14 * warranty.
15 *
16 * Author: Makoto Ishisone, Software Research Associates, Inc., Japan
17 */
18
19 #ifndef _imbuf_h
20 #define _imbuf_h
21
22 #include "imprtype.h"
23
24 /*
25 * IMBuffer -- variable length buffer
26 */
27
28 #define IMBUF_INT_SIZE 256
29 typedef struct {
30 char *buf; /* pointer to the buffer */
31 int size; /* size of the buffer */
32 int start; /* start offset of the data */
33 int end; /* end offset of the data */
34 char internal[IMBUF_INT_SIZE]; /* internal data buffer */
35 } IMBuffer;
36
37 #define IMBUFLEN(ibp) ((ibp)->end - (ibp)->start)
38 #define IMBUFDATA(ibp) ((ibp)->buf + (ibp)->start)
39
40 extern void IMBufInit _Pt_((IMBuffer *ibp));
41 extern void IMBufClear _Pt_((IMBuffer *ibp));
42 extern void IMBufAdd _Pt_((IMBuffer *ibp, char *data, int len));
43 extern void IMBufOverwrite _Pt_((IMBuffer *ibp, int offset,
44 char *data, int len));
45 extern char *IMBufAlloc _Pt_((IMBuffer *ibp, int len));
46 extern void IMBufDiscard _Pt_((IMBuffer *ibp, int len));
47 extern void IMBufDiscardNUL _Pt_((IMBuffer *ibp));
48 extern void IMBufCompact _Pt_((IMBuffer *ibp));
49
50 #endif /* _imbuf_h */