Skip to content

Commit

Permalink
sdb: cleanup unused functions and macros
Browse files Browse the repository at this point in the history
  • Loading branch information
createyourpersonalaccount authored and XVilka committed Oct 13, 2023
1 parent a564f13 commit 5b8f00e
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions librz/util/sdb/src/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,46 +20,11 @@ typedef struct buffer {
BufferOp op;
} buffer;

#define BUFFER_INIT(op, fd, buf, len) \
{ (buf), 0, (len), (fd), (op) }
#define BUFFER_INSIZE 8192
#define BUFFER_OUTSIZE 8192

extern void buffer_init(buffer *, BufferOp, int, char *, unsigned int);

extern int buffer_flush(buffer *);
extern int buffer_put(buffer *, const char *, unsigned int);
extern int buffer_putalign(buffer *, const char *, unsigned int);
extern int buffer_putflush(buffer *, const char *, unsigned int);

#define buffer_PUTC(s, c) \
(((s)->n != (s)->p) \
? ((s)->x[(s)->p++] = (c), 0) \
: buffer_put((s), &(c), 1))

extern int buffer_get(buffer *, char *, unsigned int);
extern int buffer_bget(buffer *, char *, unsigned int);
extern int buffer_feed(buffer *);

extern char *buffer_peek(buffer *);
extern void buffer_seek(buffer *, unsigned int);

#define buffer_PEEK(s) ((s)->x + (s)->n)
#define buffer_SEEK(s, len) (((s)->p -= (len)), ((s)->n += (len)))

#define buffer_GETC(s, c) \
(((s)->p > 0) \
? (*(c) = (s)->x[(s)->n], buffer_SEEK((s), 1), 1) \
: buffer_get((s), (c), 1))

extern int buffer_copy(buffer *, buffer *);

extern buffer *buffer_0;
extern buffer *buffer_0small;
extern buffer *buffer_1;
extern buffer *buffer_1small;
extern buffer *buffer_2;

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit 5b8f00e

Please sign in to comment.