Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dmitry Baryshkov
nettle
Commits
97fcea89
Commit
97fcea89
authored
Feb 11, 2003
by
Niels Möller
Browse files
(nettle_buffer_init_realloc): New function.
Rev: src/nettle/buffer.c:1.6 Rev: src/nettle/buffer.h:1.5
parent
9c9123a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
buffer.c
View file @
97fcea89
...
...
@@ -54,6 +54,18 @@ nettle_buffer_grow(struct nettle_buffer *buffer,
return
1
;
}
void
nettle_buffer_init_realloc
(
struct
nettle_buffer
*
buffer
,
void
*
realloc_ctx
,
nettle_realloc_func
realloc
)
{
buffer
->
contents
=
NULL
;
buffer
->
alloc
=
0
;
buffer
->
realloc
=
realloc
;
buffer
->
realloc_ctx
=
realloc_ctx
;
buffer
->
size
=
0
;
}
void
nettle_buffer_init_size
(
struct
nettle_buffer
*
buffer
,
unsigned
length
,
uint8_t
*
space
)
...
...
buffer.h
View file @
97fcea89
...
...
@@ -34,8 +34,8 @@ struct nettle_buffer
/* Allocated size */
unsigned
alloc
;
nettle_realloc_func
*
realloc
;
void
*
realloc_ctx
;
nettle_realloc_func
*
realloc
;
/* Current size */
unsigned
size
;
...
...
@@ -45,6 +45,11 @@ struct nettle_buffer
void
nettle_buffer_init
(
struct
nettle_buffer
*
buffer
);
void
nettle_buffer_init_realloc
(
struct
nettle_buffer
*
buffer
,
void
*
realloc_ctx
,
nettle_realloc_func
realloc
);
/* Initializes a buffer of fix size */
void
nettle_buffer_init_size
(
struct
nettle_buffer
*
buffer
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment