diff options
author | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2018-01-22 18:58:29 +0100 |
---|---|---|
committer | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2018-01-22 18:58:29 +0100 |
commit | e5b6b9412e0e744a870548b50aaba25bc92211f2 (patch) | |
tree | 5319e9fa9bdde29bf13dab64e533359aa05d52fa | |
parent | 744ea80bbcd919e648adbf189776783bdcadf5ec (diff) | |
download | librb-e5b6b9412e0e744a870548b50aaba25bc92211f2.tar.gz librb-e5b6b9412e0e744a870548b50aaba25bc92211f2.tar.bz2 librb-e5b6b9412e0e744a870548b50aaba25bc92211f2.zip |
fix: formating and typos in manuals
-rw-r--r-- | man/man3/rb_destroy.3 | 72 | ||||
-rw-r--r-- | man/man3/rb_new.3 | 2 | ||||
-rw-r--r-- | man/man7/rb_overview.7 | 1 | ||||
-rw-r--r-- | readme.md | 4 |
4 files changed, 38 insertions, 41 deletions
diff --git a/man/man3/rb_destroy.3 b/man/man3/rb_destroy.3 index 9ce9d9f..c652cb6 100644 --- a/man/man3/rb_destroy.3 +++ b/man/man3/rb_destroy.3 @@ -57,53 +57,53 @@ function, to force all threads to exit, then join them, and after that destroy .I rb object. Look at below example. -.nf .PP -void *consumer(void *arg) -{ - struct rb *rb = arg; - int v, e; - if (rb_read(rb, &v, 1) != 0) +.EX + void *consumer(void *arg) { - if (errno == ECANCELED) + struct rb *rb = arg; + int v, e; + if (rb_read(rb, &v, 1) != 0) { - /* function was forced to exit, we should stop thread - * or at least make sure we don't access rb_* functions - * anymore - / + if (errno == ECANCELED) + { + /* function was forced to exit, we should stop thread + * or at least make sure we don't access rb_* functions + * anymore + / - return NULL; + return NULL; + } } + /* more code */ } - /* more code */ -} -void foo(void) -{ - /* some code */ - for (int i = 0; i != 10; ++i) + void foo(void) { - pthread_create(&consumers[i], NULL, consumer, rb); - } + /* some code */ + for (int i = 0; i != 10; ++i) + { + pthread_create(&consumers[i], NULL, consumer, rb); + } - /* wait for some event */ - /* force all consumer threads to exit even if they are locked - * in some conditional variables - */ - rb_stop(rb); + /* wait for some event */ + /* force all consumer threads to exit even if they are locked + * in some conditional variables + */ + rb_stop(rb); - for (i = 0; i != 10; ++i) - { - /* make sure all consumer threads stopped, and none will access - * any rb_* functions - / - pthread_join(consumers[i], NULL); - } + for (i = 0; i != 10; ++i) + { + /* make sure all consumer threads stopped, and none will access + * any rb_* functions + / + pthread_join(consumers[i], NULL); + } - /* now it is safe to call rb_destroy function */ - rb_destroy(rb); -} -.fi + /* now it is safe to call rb_destroy function */ + rb_destroy(rb); + } +.EE .SH RETURN VALUES .PP Function will return 0 when all resources were freed, otherwise -1 is returned. diff --git a/man/man3/rb_new.3 b/man/man3/rb_new.3 index 0bb9f7d..80d1502 100644 --- a/man/man3/rb_new.3 +++ b/man/man3/rb_new.3 @@ -96,7 +96,7 @@ user should also set or .B EINVAL error will be returned to prevent deadlocks. -.SH RETURNED VALUES +.SH RETURN VALUES .PP If no errors have been detected, function will return pointer to newly created ring buffer, otherwise NULL is returned. diff --git a/man/man7/rb_overview.7 b/man/man7/rb_overview.7 index 3057340..173faef 100644 --- a/man/man7/rb_overview.7 +++ b/man/man7/rb_overview.7 @@ -69,6 +69,7 @@ parameters when object size is set to sizeof(struct s). .PP Please note, that example is missing error handling for simplicity. .EX +.PP #include <rb.h> #include <stdio.h> @@ -135,11 +135,7 @@ See also [x64lu]: http://ci.librb.kurwinet.pl/badges/x86_64-builder-linux-uclibc-tests.svg [x64ss]: http://ci.librb.kurwinet.pl/badges/x86_64-builder-solaris-tests.svg -sanitizers ----------- - [fsan]: http://ci.librb.kurwinet.pl/badges/fsanitize-address.svg [fsleak]: http://ci.librb.kurwinet.pl/badges/fsanitize-leak.svg [fsthread]: http://ci.librb.kurwinet.pl/badges/fsanitize-thread.svg [fsun]: http://ci.librb.kurwinet.pl/badges/fsanitize-undefined.svg - |