aboutsummaryrefslogtreecommitdiffstats
path: root/include/buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/buffer.h')
-rw-r--r--include/buffer.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/buffer.h b/include/buffer.h
index 5c081fb81f..724bcbe90a 100644
--- a/include/buffer.h
+++ b/include/buffer.h
@@ -10,6 +10,9 @@ struct ul_buffer {
size_t sz; /* allocated space for data */
size_t chunksize;
+ char *encoded; /* encoded data (from mbs_safe_encode_to_buffer)) */
+ size_t encoded_sz; /* space allocated for encoded data */
+
char **ptrs; /* saved pointers */
size_t nptrs; /* number of saved poiters */
};
@@ -26,12 +29,16 @@ int ul_buffer_append_data(struct ul_buffer *buf, const char *data, size_t sz);
int ul_buffer_append_string(struct ul_buffer *buf, const char *str);
int ul_buffer_append_ntimes(struct ul_buffer *buf, size_t n, const char *str);
int ul_buffer_set_data(struct ul_buffer *buf, const char *data, size_t sz);
-char *ul_buffer_get_data(struct ul_buffer *buf, size_t *sz);
+
+char *ul_buffer_get_data(struct ul_buffer *buf, size_t *sz, size_t *width);
+char *ul_buffer_get_safe_data(struct ul_buffer *buf, size_t *sz, size_t *width, const char *safechars);
+
size_t ul_buffer_get_bufsiz(struct ul_buffer *buf);
int ul_buffer_save_pointer(struct ul_buffer *buf, unsigned short ptr_idx);
char *ul_buffer_get_pointer(struct ul_buffer *buf, unsigned short ptr_idx);
size_t ul_buffer_get_pointer_length(struct ul_buffer *buf, unsigned short ptr_idx);
+size_t ul_buffer_get_safe_pointer_width(struct ul_buffer *buf, unsigned short ptr_idx);
#endif /* UTIL_LINUX_BUFFER */