summaryrefslogtreecommitdiffstats
path: root/basicobjects/simplebuffer.h
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2010-07-23 19:33:04 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-09-22 14:57:53 -0400
commitee99d5d047080218bde02e2d06e0d14518fefa4f (patch)
tree59b8ec3bd8d19dd98e78aec2de0aac74e38ffd97 /basicobjects/simplebuffer.h
parent2893de11973c4912f4c2a3d40f09ef0823a3f091 (diff)
downloadding-libs-ee99d5d047080218bde02e2d06e0d14518fefa4f.tar.gz
ding-libs-ee99d5d047080218bde02e2d06e0d14518fefa4f.tar.xz
ding-libs-ee99d5d047080218bde02e2d06e0d14518fefa4f.zip
Added a convenience function
Added a function to add a string to the buffer. Allows adding const strings to the buffer. This solution eliminates all the hassle of type casting that was needed before.
Diffstat (limited to 'basicobjects/simplebuffer.h')
-rw-r--r--basicobjects/simplebuffer.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/basicobjects/simplebuffer.h b/basicobjects/simplebuffer.h
index 002e8b6..4d02321 100644
--- a/basicobjects/simplebuffer.h
+++ b/basicobjects/simplebuffer.h
@@ -53,6 +53,15 @@ int simplebuffer_add_raw(struct simplebuffer *data,
uint32_t len,
uint32_t block);
+
+/* Function to add string to the buffer.
+ * Same as above just uses string as an argument.
+ */
+int simplebuffer_add_str(struct simplebuffer *data,
+ const char *str,
+ uint32_t len,
+ uint32_t block);
+
/* Finction to add CR to the buffer */
int simplebuffer_add_cr(struct simplebuffer *data);