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