File: _buffer.h

package info (click to toggle)
libmemcache 1.4.0.rc2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny, squeeze, wheezy
  • size: 2,772 kB
  • ctags: 530
  • sloc: sh: 8,605; ansic: 4,207; makefile: 361
file content (39 lines) | stat: -rw-r--r-- 852 bytes parent folder | download
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
#ifndef __MC_BUFFER_H__
#define __MC_BUFFER_H__

#include <sys/types.h>

#ifdef __cplusplus
extern "C" {
#endif

struct memcache_buf {
  /* A null terminated buffer. */
  char *ptr;

  /* Buffer flags. */
  char flags;

  /* Length of the buffer.  The length never includes the terminating
   * null zero. */
  size_t len;

  /* Allocated memory dedicated for the buffer.  The length is always
   * at least one byte smaller than the size.  The size includes the
   * null terminating zero. */
  size_t size;

  /* A generic offset that can be internally used by this structure's
   * consumer.  Used primarily for read(2) and write(2) offsets. */
  size_t off;

  /* Recycle buffers where possible: used to keep a linked list of
   * rotating buffers. */
  TAILQ_ENTRY(memcache_buf) next;
};

#ifdef __cplusplus
}
#endif

#endif /* __MC_BUFFER_H__ */