cstr_fixed.h 525 B

1234567891011121314151617181920212223242526
  1. #ifndef TOOLBOX_CSTR_FIXED_H
  2. #define TOOLBOX_CSTR_FIXED_H
  3. #include <stddef.h>
  4. #ifndef TOOLBOX_CSTR_FIXED_MAX_SIZE
  5. #define TOOLBOX_CSTR_FIXED_MAX_SIZE ((size_t) 255L)
  6. #endif
  7. struct cstr_fixed {
  8. size_t size;
  9. char data[TOOLBOX_CSTR_FIXED_MAX_SIZE];
  10. };
  11. struct cstr_fixed
  12. cstr_fixed_from_cstring(const char *cstring);
  13. _Bool
  14. cstr_fixed_equal(const struct cstr_fixed cstr_fixed1
  15. , const struct cstr_fixed cstr_fixed2);
  16. _Bool
  17. cstr_fixed_equal_cstring(const struct cstr_fixed cstr_fixed
  18. , const char *cstring);
  19. #endif