aboutsummaryrefslogtreecommitdiff
path: root/djb/buffer.h
blob: dd920f6359535245b80464f58cf48b0d3bee0179 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef BUFFER_H
#define BUFFER_H

typedef struct buffer {
  char *x;        /* actual buffer space */
  unsigned int p; /* current position */
  unsigned int n; /* string position */
  unsigned int a; /* allocated buffer size */
  int fd;
  int (*op)();
} buffer;

#define BUFFER_INIT(op,fd,buf,len) { (buf), 0, 0, (len), (fd), (int (*)())(op) }
#include "../buffer_defs.h"
#include "../byte_defs.h"
#endif