diff --git a/array/sc_array.h b/array/sc_array.h index 22ff14b..cefca91 100644 --- a/array/sc_array.h +++ b/array/sc_array.h @@ -70,7 +70,7 @@ } while (0) /** - * Term array + * Destroy array * @param a array */ #define sc_array_term(a) \ diff --git a/condition/sc_cond.h b/condition/sc_cond.h index dabe2c1..b3b5810 100644 --- a/condition/sc_cond.h +++ b/condition/sc_cond.h @@ -57,12 +57,16 @@ struct sc_cond { }; /** + * Init cond object + * * @param c cond * @return '0' on success, negative on error, errno will be set. */ int sc_cond_init(struct sc_cond *c); /** + * Destroy cond object + * * @param c cond * @return '0' on success, negative on error, errno will be set. */ diff --git a/map/README.md b/map/README.md index c1e1977..1e6b6f0 100644 --- a/map/README.md +++ b/map/README.md @@ -28,6 +28,8 @@ sc_map_dec_strkey(s64, const char *, uint64_t) sc_map_dec_strkey(sll, const char *, long long) ``` +If you need more types, you can add at the end of sc_map.h and sc_map.c + - This is a very fast hashmap. - Single array allocation for all data. - Linear probing over an array. diff --git a/memory-map/sc_mmap.h b/memory-map/sc_mmap.h index 65ea213..b882bdd 100644 --- a/memory-map/sc_mmap.h +++ b/memory-map/sc_mmap.h @@ -86,12 +86,16 @@ struct sc_mmap { int sc_mmap_init(struct sc_mmap *m, const char *name, int file_flags, int prot, int map_flags, size_t offset, size_t len); /** + * Destroy mmap instance. + * * @param m mmap * @return '0' on success, '-1' on error, call sc_mmap_err() for details. */ int sc_mmap_term(struct sc_mmap *m); /** + * Sync mmap to the disk. + * * @param m mmap * @param offset offset * @param len len diff --git a/queue/sc_queue.h b/queue/sc_queue.h index 3021435..fa50512 100644 --- a/queue/sc_queue.h +++ b/queue/sc_queue.h @@ -111,7 +111,7 @@ } while (0) /** - * Term queue + * Destroy queue * @param q queue */ #define sc_queue_term(q) \ diff --git a/thread/sc_thread.h b/thread/sc_thread.h index eb82b60..65e549b 100644 --- a/thread/sc_thread.h +++ b/thread/sc_thread.h @@ -58,11 +58,15 @@ struct sc_thread { #endif /** + * Init thread. + * * @param t thread */ void sc_thread_init(struct sc_thread *t); /** + * Destroy thread. + * * @param t thread * @return '0' on success, * '-1' on error, call 'sc_thread_err()' for error string. @@ -70,19 +74,26 @@ void sc_thread_init(struct sc_thread *t); int sc_thread_term(struct sc_thread *t); /** + * Get last error string. + * * @param t thread * @return last error message */ const char *sc_thread_err(struct sc_thread *t); /** + * Start thread. + * * @param t thread + * @param fn thread function * @return '0' on success, * '-1' on error, call 'sc_thread_err()' for error string. */ int sc_thread_start(struct sc_thread *t, void *(*fn)(void *), void *arg); /** + * Wait until thread joins. + * * @param t thread * @return '0' on success, * '-1' on error, call 'sc_thread_err()' for error string.