text-lookup.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /******************************************************************************
  2. Copyright (c) 2013 by Hugh Bailey <[email protected]>
  3. This software is provided 'as-is', without any express or implied
  4. warranty. In no event will the authors be held liable for any damages
  5. arising from the use of this software.
  6. Permission is granted to anyone to use this software for any purpose,
  7. including commercial applications, and to alter it and redistribute it
  8. freely, subject to the following restrictions:
  9. 1. The origin of this software must not be misrepresented; you must not
  10. claim that you wrote the original software. If you use this software
  11. in a product, an acknowledgment in the product documentation would be
  12. appreciated but is not required.
  13. 2. Altered source versions must be plainly marked as such, and must not be
  14. misrepresented as being the original software.
  15. 3. This notice may not be removed or altered from any source
  16. distribution.
  17. ******************************************************************************/
  18. #ifndef TEXT_LOOKUP_H
  19. #define TEXT_LOOKUP_H
  20. /*
  21. * Text Lookup interface
  22. *
  23. * Used for storing and looking up localized strings. Stores locazation
  24. * strings in a radix/trie tree to efficiently look up associated strings via a
  25. * unique string identifier name.
  26. */
  27. #include "c99defs.h"
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. /* opaque typdef */
  32. struct text_lookup;
  33. typedef struct text_lookup *lookup_t;
  34. /* functions */
  35. EXPORT lookup_t text_lookup_create(const char *path);
  36. EXPORT void text_lookup_destroy(lookup_t lookup);
  37. EXPORT bool text_lookup_getstr(lookup_t lookup, const char *lookup_val,
  38. const char **out);
  39. #ifdef __cplusplus
  40. }
  41. #endif
  42. #endif