From c36daed13ba47edf59aa47e27aeffa35b3030f0e Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Tue, 23 Feb 2016 12:06:03 +0100 Subject: du_buff: Restructured for information hiding Moved struct buffer and struct du_buff definitions to the source file. --- include/ouroboros/du_buff.h | 12 +++--------- src/lib/du_buff.c | 10 +++++++++- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/include/ouroboros/du_buff.h b/include/ouroboros/du_buff.h index 522733f8..d23f4b09 100644 --- a/include/ouroboros/du_buff.h +++ b/include/ouroboros/du_buff.h @@ -27,15 +27,9 @@ #include "common.h" #include "list.h" -struct buffer; - -typedef struct { - struct buffer * buffer; - size_t size; - size_t du_start; - size_t du_end; - struct list_head list; -} du_buff_t; +struct du_buff; + +typedef struct du_buff du_buff_t; du_buff_t * du_buff_create(size_t size); void du_buff_destroy(du_buff_t * dub); diff --git a/src/lib/du_buff.c b/src/lib/du_buff.c index 53d9c3e4..84bf528c 100644 --- a/src/lib/du_buff.c +++ b/src/lib/du_buff.c @@ -34,7 +34,15 @@ struct buffer { uint8_t * data; size_t size; struct list_head list; -} buffer; +}; + +struct du_buff { + struct buffer * buffer; + size_t size; + size_t du_start; + size_t du_end; + struct list_head list; +}; void buffer_destroy(struct buffer * buf) { -- cgit v1.2.3