cds.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef __CDS_H
  2. #define __CDS_H
  3. /** \defgroup cds CDS library - Common Data Structures
  4. *
  5. * This library contains many useful functions and data structures. It is
  6. possible to use it with Sip Express Router (SER) or without it. In the first
  7. case it is able to use some internal SER's data types like strings.
  8. *
  9. * \section cds_conventions Conventions
  10. * - data types (structures, enums, ...) have their names with suffix \c _t
  11. * (\c str_t, \c dstring_t, ...)
  12. * - many functions have prefix according to data structure on which are
  13. * operating (like dstr_append which operates on dstring_t data structure)
  14. * - most functions return 0 as successful result and nonzero value as error
  15. *
  16. * \section cds_dependencies Dependencies
  17. * This library depends only on standard C libraries and needs no other
  18. * external libraries.
  19. *
  20. * \section cds_ser_usage Usage with SER
  21. * There can be problems with using shared libraries on different platforms.
  22. * Currently supported solution is that user must supply LD_LIBRARY_PATH
  23. * (or something similar on his OS) with the path to the library before
  24. * starting SER with modules needed the library.
  25. *
  26. * \section cds_nonser_usage Usage without SER
  27. * The library can be compiled without dependencies on SER and can be linked
  28. * to whatever program as any other dynamic library. This style of usage is
  29. * probably used only when debugging problems which is hard to find with SER
  30. * (outside of SER is possible to use tools like Valgrind) and for author's
  31. * little programs and need not to be documented more... ;-)
  32. *
  33. * \par History
  34. * There were following reasons to introduce this library:
  35. * - many duplicated functions in modules (copy&pasted between modules)
  36. * without touching SER's core
  37. * - possibility to debug programs outside of SER due to its simplicity
  38. * and many usefull tools
  39. *
  40. * @{ */
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44. #if 0
  45. /* not used */
  46. /** \defgroup cds_init Initialization/destruction
  47. * Library needs to be initialized before using it and
  48. * un-initialized after it is not used more. Use \ref cds_initialize and
  49. * \ref cds_cleanup for this purpose.
  50. * @{ */
  51. /** Initializes CDS library.
  52. *
  53. * Currently initializes reference counter which is experimental and
  54. * probably will be removed in the future because seems to be rather
  55. * useless here. */
  56. int cds_initialize();
  57. /** Cleans up after CDS. After calling this function can't be called
  58. * reference counter functions. */
  59. void cds_cleanup();
  60. #endif
  61. /** @} */
  62. #ifdef __cplusplus
  63. }
  64. #endif
  65. /** @} */
  66. #endif