Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #ifndef _String_h
  2. #define _String_h 1
  3.  
  4. #include <stdint.h>
  5.  
  6. typedef
  7. struct String {
  8.     uint32_t check;
  9.     uint32_t capacity;
  10.     uint32_t length;
  11.     char data[1];
  12. } String;
  13.  
  14. char* utstrdup(const char* src);
  15. uint32_t utstrlen(const char* src);
  16. char* utstrcat(char* s, const char* suffix); // append the suffix to s
  17. char* utstrcpy(char* dst, const char* src); // overwrite dst with src
  18. void utstrfree(char* self);
  19. char* utstrrealloc(char* s, uint32_t new_capacity);
  20.  
  21. #endif /* _String_h */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement