Permalink
Browse files

Add str_size()

  • Loading branch information...
1 parent b36aea6 commit fffa6a57f9753245520cca35e0e8fe66fa1e37a7 @jordansissel jordansissel committed Aug 11, 2012
Showing with 5 additions and 0 deletions.
  1. +4 −0 str.c
  2. +1 −0 str.h
View
@@ -34,6 +34,10 @@ inline size_t str_length(struct str *str) {
return str->data_len;
} /* str_length */
+inline size_t str_size(struct str *str) {
+ return str->data_size;
+} /* str_size */
+
inline char *str_data(struct str *str) {
return str->data;
} /* str_data */
View
@@ -20,6 +20,7 @@ void str_free(struct str *str);
void str_grow(struct str *str);
size_t str_length(struct str *str);
+size_t str_size(struct str *str);
char *str_data(struct str *str);
void str_append(struct str *str, const char *data, size_t length);
void str_append_str(struct str *dst_str, struct str *src_str);

0 comments on commit fffa6a5

Please sign in to comment.