summaryrefslogtreecommitdiffstats
path: root/common/basicobjects/simplebuffer.h
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2010-07-23 19:33:04 -0400
committerDmitri Pal <dpal@redhat.com>2010-08-10 12:51:32 -0400
commit3b65ae0b2b60d86111ee03005dad7f6ccf7fc40f (patch)
treef249204c0971abfefedf0d8e3f2ff293b2352c68 /common/basicobjects/simplebuffer.h
parenta1935263ae19d2161b1e425135864c7edb9efe49 (diff)
downloadsssd-3b65ae0b2b60d86111ee03005dad7f6ccf7fc40f.tar.gz
sssd-3b65ae0b2b60d86111ee03005dad7f6ccf7fc40f.tar.xz
sssd-3b65ae0b2b60d86111ee03005dad7f6ccf7fc40f.zip
[BASICOBJ] 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 'common/basicobjects/simplebuffer.h')
-rw-r--r--common/basicobjects/simplebuffer.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/basicobjects/simplebuffer.h b/common/basicobjects/simplebuffer.h
index 002e8b6..4d02321 100644
--- a/common/basicobjects/simplebuffer.h
+++ b/common/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);