summaryrefslogtreecommitdiffabout
path: root/libical/src/libical/icalmemory.h
Unidiff
Diffstat (limited to 'libical/src/libical/icalmemory.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libical/src/libical/icalmemory.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/libical/src/libical/icalmemory.h b/libical/src/libical/icalmemory.h
index f833c6c..7c42566 100644
--- a/libical/src/libical/icalmemory.h
+++ b/libical/src/libical/icalmemory.h
@@ -26,13 +26,11 @@
26#ifndef ICALMEMORY_H 26#ifndef ICALMEMORY_H
27#define ICALMEMORY_H 27#define ICALMEMORY_H
28 28
29#ifndef WIN32
29#include <sys/types.h> /* for size_t */ 30#include <sys/types.h> /* for size_t */
30 31#else
31// Eugen C. <eug@thekompany.com>
32#ifdef _WIN32
33#include <stddef.h> 32#include <stddef.h>
34#endif 33#endif
35// Eugen C. <eug@thekompany.com>
36 34
37/* Tmp buffers are managed by ical. References can be returned to the 35/* Tmp buffers are managed by ical. References can be returned to the
38 caller, although the caller will not own the memory. */ 36 caller, although the caller will not own the memory. */
@@ -40,11 +38,11 @@
40void* icalmemory_tmp_buffer(size_t size); 38void* icalmemory_tmp_buffer(size_t size);
41char* icalmemory_tmp_copy(const char* str); 39char* icalmemory_tmp_copy(const char* str);
42 40
43/* Add an externally allocated buffer to the ring. */ 41/** Add an externally allocated buffer to the ring. */
44void icalmemory_add_tmp_buffer(void*); 42void icalmemory_add_tmp_buffer(void*);
45 43
46 44
47/* Free all memory used in the ring */ 45/** Free all memory used in the ring */
48void icalmemory_free_ring(void); 46void icalmemory_free_ring(void);
49 47
50/* Non-tmp buffers must be freed. These are mostly wrappers around 48/* Non-tmp buffers must be freed. These are mostly wrappers around
@@ -55,7 +53,8 @@ void* icalmemory_new_buffer(size_t size);
55void* icalmemory_resize_buffer(void* buf, size_t size); 53void* icalmemory_resize_buffer(void* buf, size_t size);
56void icalmemory_free_buffer(void* buf); 54void icalmemory_free_buffer(void* buf);
57 55
58/* icalmemory_append_string will copy the string 'string' to the 56/**
57 icalmemory_append_string will copy the string 'string' to the
59 buffer 'buf' starting at position 'pos', reallocing 'buf' if it is 58 buffer 'buf' starting at position 'pos', reallocing 'buf' if it is
60 too small. 'buf_size' is the size of 'buf' and will be changed if 59 too small. 'buf_size' is the size of 'buf' and will be changed if
61 'buf' is reallocated. 'pos' will point to the last byte of the new 60 'buf' is reallocated. 'pos' will point to the last byte of the new
@@ -71,12 +70,12 @@ void icalmemory_free_buffer(void* buf);
71void icalmemory_append_string(char** buf, char** pos, size_t* buf_size, 70void icalmemory_append_string(char** buf, char** pos, size_t* buf_size,
72 const char* string); 71 const char* string);
73 72
74/* icalmemory_append_char is similar, but is appends a character instead of a string */ 73/** icalmemory_append_char is similar, but is appends a character instead of a string */
75void icalmemory_append_char(char** buf, char** pos, size_t* buf_size, 74void icalmemory_append_char(char** buf, char** pos, size_t* buf_size,
76 char ch); 75 char ch);
77 76
78/* A wrapper around strdup. Partly to trap calls to strdup, partly 77/** A wrapper around strdup. Partly to trap calls to strdup, partly
79 because in -ansi, gcc on Red Hat claims that strudup is undeclared */ 78 because in -ansi, gcc on Red Hat claims that strdup is undeclared */
80char* icalmemory_strdup(const char *s); 79char* icalmemory_strdup(const char *s);
81 80
82#endif /* !ICALMEMORY_H */ 81#endif /* !ICALMEMORY_H */