diff options
author | Olivier Gayot <duskcoder@gmail.com> | 2013-12-23 19:51:14 +0100 |
---|---|---|
committer | Olivier Gayot <duskcoder@gmail.com> | 2014-01-18 13:44:28 +0100 |
commit | 68122955675e2b7a5652760d609b91eec34b80b7 (patch) | |
tree | 1d5b6ae1a5f15905b190177bf3b11319ab5be1ed /src | |
parent | 646515d288da8aec7dc266f7d30047320b271742 (diff) |
rb: t_rb has been renamed to rb_t
t_rb will be kept in the source files for backward compatibility.
However, it will not have to be used anymore.
Diffstat (limited to 'src')
-rw-r--r-- | src/rb.c | 16 | ||||
-rw-r--r-- | src/rb_str.c | 10 |
2 files changed, 13 insertions, 13 deletions
@@ -6,7 +6,7 @@ #define MAX(_x1, _x2) (((_x1) > (_x2)) ? (_x1) : (_x2)) #define MIN(_x1, _x2) (((_x1) < (_x2)) ? (_x1) : (_x2)) -int rb_init(t_rb *rb) +int rb_init(rb_t *rb) { rb->off_r = 0; rb->off_w = 0; @@ -15,11 +15,11 @@ int rb_init(t_rb *rb) return 0; } -t_rb *rb_new(void) +rb_t *rb_new(void) { - t_rb *rb; + rb_t *rb; - if ((rb = malloc(sizeof(t_rb))) == NULL) { + if ((rb = malloc(sizeof(rb_t))) == NULL) { return NULL; } @@ -28,13 +28,13 @@ t_rb *rb_new(void) return rb; } -void rb_delete(t_rb **rb) +void rb_delete(rb_t **rb) { free(*rb); *rb = NULL; } -t_rb *rb_put(t_rb *rb, const void *src, size_t n) +rb_t *rb_put(rb_t *rb, const void *src, size_t n) { size_t size; @@ -83,7 +83,7 @@ t_rb *rb_put(t_rb *rb, const void *src, size_t n) return rb; } -size_t rb_get(t_rb *rb, void *dest, size_t n) +size_t rb_get(rb_t *rb, void *dest, size_t n) { size_t size = rb_peek(rb, dest, n); @@ -98,7 +98,7 @@ size_t rb_get(t_rb *rb, void *dest, size_t n) return size; } -size_t rb_peek(const t_rb *rb, void *dest, size_t n) +size_t rb_peek(const rb_t *rb, void *dest, size_t n) { uint16_t offset; size_t size; diff --git a/src/rb_str.c b/src/rb_str.c index 07b2844..f6b3878 100644 --- a/src/rb_str.c +++ b/src/rb_str.c @@ -4,7 +4,7 @@ typedef uint8_t byte; -static char *__rb_gets2(t_rb *rb, const char *const *delim, +static char *__rb_gets2(rb_t *rb, const char *const *delim, const byte *data, size_t size) { char *ret = NULL; @@ -37,7 +37,7 @@ static char *__rb_gets2(t_rb *rb, const char *const *delim, return ret; } -char *rb_gets2(t_rb *rb, const char *const *delim) +char *rb_gets2(rb_t *rb, const char *const *delim) { size_t size; char *ret; @@ -58,7 +58,7 @@ char *rb_gets2(t_rb *rb, const char *const *delim) return ret; } -char *rb_gets(t_rb *rb, const char *delimit) +char *rb_gets(rb_t *rb, const char *delimit) { char *data = malloc((rb->size_filled) * sizeof(char)); @@ -81,7 +81,7 @@ char *rb_gets(t_rb *rb, const char *delimit) return ret; } -t_rb *rb_vprintf(t_rb *rb, const char *fmt, va_list ap) +rb_t *rb_vprintf(rb_t *rb, const char *fmt, va_list ap) { char *buffer; @@ -102,7 +102,7 @@ t_rb *rb_vprintf(t_rb *rb, const char *fmt, va_list ap) } __attribute__((format(printf, 2, 3))) -t_rb *rb_printf(t_rb *rb, const char *fmt, ...) +rb_t *rb_printf(rb_t *rb, const char *fmt, ...) { va_list ap; |