string_int.h 662 B

123456789101112131415161718192021222324252627282930
  1. #ifndef __sti__string_int_h__
  2. #define __sti__string_int_h__
  3. struct string_internment_table;
  4. extern struct string_internment_table* global_string_internment_table;
  5. // returns a pointer to the permanent unique string
  6. char* strint_(struct string_internment_table* tab, char* s);
  7. #define strint(a) strint_(global_string_internment_table, (a))
  8. // returns a pointer to the permanent unique string
  9. char* strnint_(struct string_internment_table* tab, char* s, size_t slen);
  10. #define strnint(a, b) strnint_(global_string_internment_table, (a), (b))
  11. void string_internment_table_init(struct string_internment_table** ptab);
  12. #endif // __sti__string_int_h__