aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Łyszczek <michal.lyszczek@bofc.pl>2018-01-23 13:38:13 +0100
committerMichał Łyszczek <michal.lyszczek@bofc.pl>2018-01-23 13:38:13 +0100
commit492e7580aa482b754713f258b82474f22b2e63a1 (patch)
tree452dc299689e900ce72578db3e600724f0f0a215
parent66ee9ef1cbe165298158c784708a3966d5bbdf06 (diff)
downloadlibrb-492e7580aa482b754713f258b82474f22b2e63a1.tar.gz
librb-492e7580aa482b754713f258b82474f22b2e63a1.tar.bz2
librb-492e7580aa482b754713f258b82474f22b2e63a1.zip
change: move manuals into single directory
-rw-r--r--man/Makefile.am24
-rw-r--r--man/rb_clear.3 (renamed from man/man3/rb_clear.3)0
-rw-r--r--man/rb_count.3 (renamed from man/man3/rb_count.3)0
-rw-r--r--man/rb_destroy.3 (renamed from man/man3/rb_destroy.3)0
-rw-r--r--man/rb_new.3 (renamed from man/man3/rb_new.3)0
-rw-r--r--man/rb_overview.7 (renamed from man/man7/rb_overview.7)0
-rw-r--r--man/rb_read.3 (renamed from man/man3/rb_read.3)0
-rw-r--r--man/rb_recv.3 (renamed from man/man3/rb_recv.3)0
-rw-r--r--man/rb_send.3 (renamed from man/man3/rb_send.3)0
-rw-r--r--man/rb_space.3 (renamed from man/man3/rb_space.3)0
-rw-r--r--man/rb_stop.3 (renamed from man/man3/rb_stop.3)0
-rw-r--r--man/rb_version.3 (renamed from man/man3/rb_version.3)0
-rw-r--r--man/rb_write.3 (renamed from man/man3/rb_write.3)0
-rwxr-xr-xman2html.sh100
-rw-r--r--readme.md20
15 files changed, 77 insertions, 67 deletions
diff --git a/man/Makefile.am b/man/Makefile.am
index 60fc426..f827035 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,13 +1,13 @@
-man_MANS = man3/rb_clear.3 \
- man3/rb_count.3 \
- man3/rb_destroy.3 \
- man3/rb_new.3 \
- man7/rb_overview.7 \
- man3/rb_read.3 \
- man3/rb_recv.3 \
- man3/rb_send.3 \
- man3/rb_space.3 \
- man3/rb_version.3 \
- man3/rb_write.3 \
- man3/rb_stop.3
+man_MANS = rb_clear.3 \
+ rb_count.3 \
+ rb_destroy.3 \
+ rb_new.3 \
+ rb_overview.7 \
+ rb_read.3 \
+ rb_recv.3 \
+ rb_send.3 \
+ rb_space.3 \
+ rb_version.3 \
+ rb_write.3 \
+ rb_stop.3
EXTRA_DIST = $(man_MANS)
diff --git a/man/man3/rb_clear.3 b/man/rb_clear.3
index 543b1bb..543b1bb 100644
--- a/man/man3/rb_clear.3
+++ b/man/rb_clear.3
diff --git a/man/man3/rb_count.3 b/man/rb_count.3
index 5d80eb5..5d80eb5 100644
--- a/man/man3/rb_count.3
+++ b/man/rb_count.3
diff --git a/man/man3/rb_destroy.3 b/man/rb_destroy.3
index f325bfa..f325bfa 100644
--- a/man/man3/rb_destroy.3
+++ b/man/rb_destroy.3
diff --git a/man/man3/rb_new.3 b/man/rb_new.3
index b10c5e5..b10c5e5 100644
--- a/man/man3/rb_new.3
+++ b/man/rb_new.3
diff --git a/man/man7/rb_overview.7 b/man/rb_overview.7
index ec84868..ec84868 100644
--- a/man/man7/rb_overview.7
+++ b/man/rb_overview.7
diff --git a/man/man3/rb_read.3 b/man/rb_read.3
index 03ef45c..03ef45c 100644
--- a/man/man3/rb_read.3
+++ b/man/rb_read.3
diff --git a/man/man3/rb_recv.3 b/man/rb_recv.3
index 9948d24..9948d24 100644
--- a/man/man3/rb_recv.3
+++ b/man/rb_recv.3
diff --git a/man/man3/rb_send.3 b/man/rb_send.3
index d97fa6d..d97fa6d 100644
--- a/man/man3/rb_send.3
+++ b/man/rb_send.3
diff --git a/man/man3/rb_space.3 b/man/rb_space.3
index e7c284b..e7c284b 100644
--- a/man/man3/rb_space.3
+++ b/man/rb_space.3
diff --git a/man/man3/rb_stop.3 b/man/rb_stop.3
index 1888bf1..1888bf1 100644
--- a/man/man3/rb_stop.3
+++ b/man/rb_stop.3
diff --git a/man/man3/rb_version.3 b/man/rb_version.3
index 8f54f75..8f54f75 100644
--- a/man/man3/rb_version.3
+++ b/man/rb_version.3
diff --git a/man/man3/rb_write.3 b/man/rb_write.3
index fe79bf4..fe79bf4 100644
--- a/man/man3/rb_write.3
+++ b/man/rb_write.3
diff --git a/man2html.sh b/man2html.sh
index 97806e9..955f031 100755
--- a/man2html.sh
+++ b/man2html.sh
@@ -5,66 +5,76 @@ out="$(pwd)/www/manuals"
root="$(pwd)"
ftmp="/tmp/mtest-man2html"
-for n in {3,7}
+cd "${root}/man"
+mkdir "${out}"
+
+for m in *.[1-8]
do
- mkdir -p "${out}/man${n}"
- cd "${root}/man/man${n}"
+ n="${m##*.}"
+ echo "opening ${m}"
- for m in *
- do
+ if grep "\.so man${n}" "${m}"
+ then
+ sed -i "s/man${n}/man/" "${m}"
+ man2html -r -H "${hostname}" "${m}" > "${ftmp}"
+ sed -i "s/man\//man${n}\//g" "${m}"
+ else
man2html -r -H "${hostname}" "${m}" > "${ftmp}"
+ fi
+
+ # get only body part of the file
+ body_only="$(sed -n '/<BODY>/,/<\/BODY>/p' "${ftmp}")"
+ echo "$body_only" > "${ftmp}"
- # get only body part of the file
- body_only="$(sed -n '/<BODY>/,/<\/BODY>/p' "${ftmp}")"
- echo "$body_only" > "${ftmp}"
+ # remove leftover <body> and <h1>man</h1> tags from beginning
+ tail -n+3 "${ftmp}" > tmp; mv tmp "${ftmp}"
- # remove leftover <body> and <h1>man</h1> tags from beginning
- tail -n+3 "${ftmp}" > tmp; mv tmp "${ftmp}"
+ # construct top page heading with page info, remove superflous info
+ name="$(basename ${m})"
+ name="${name%.*}"
+ version_info="$(head -n1 ${ftmp} | cut -f3 -d: | cut -f1 -d\<)"
+ tail -n+2 "${ftmp}" > tmp; mv tmp "${ftmp}"
+ sed -i "1s/^/<p class=\"info left\">${name}(${n})<\/p><p class=\"info center\">kurwinet manual pages<\/p><p class=\"info right\">${name}(${n})<\/p>\n<br><P> /" "${ftmp}"
- # construct top page heading with page info, remove superflous info
- name="$(basename ${m})"
- name="${name%.*}"
- version_info="$(head -n1 ${ftmp} | cut -f3 -d: | cut -f1 -d\<)"
- tail -n+2 "${ftmp}" > tmp; mv tmp "${ftmp}"
- sed -i "1s/^/<p class=\"info left\">${name}(${n})<\/p><p class=\"info center\">kurwinet manual pages<\/p><p class=\"info right\">${name}(${n})<\/p>\n<br><P> /" "${ftmp}"
+ # remove uneeded links to non-existing index
+ sed -i 's/<A HREF="\.\.\/index.html">Return to Main Contents<\/A><HR>//' "${ftmp}"
+ sed -i 's/<A HREF="#index">Index<\/A>//g' "${ftmp}"
- # remove uneeded links to non-existing index
- sed -i 's/<A HREF="\.\.\/index.html">Return to Main Contents<\/A><HR>//' "${ftmp}"
- sed -i 's/<A HREF="#index">Index<\/A>//g' "${ftmp}"
+ # extract table of content and put it in the beginning of file
+ ## cache first two lines (page info) and remove them from file
+ tmp="$(head -n2 ${ftmp})"
+ tail -n+3 "${ftmp}" > tmp; mv tmp "${ftmp}"
- # extract table of content and put it in the beginning of file
- ## cache first two lines (page info) and remove them from file
- tmp="$(head -n2 ${ftmp})"
- tail -n+3 "${ftmp}" > tmp; mv tmp "${ftmp}"
+ ## get table of content from file
+ toc="$(sed -n '/<DL>/,/<\/DL>/p' "${ftmp}")"
- ## get table of content from file
- toc="$(sed -n '/<DL>/,/<\/DL>/p' "${ftmp}")"
+ toc="$(echo "${toc}" | sed 's/<DL>/<UL class="man-toc">/')"
+ toc="$(echo "${toc}" | sed 's/<\/DL>/<\/UL>/')"
+ toc="$(echo "${toc}" | sed 's/<DT>/<LI>/')"
+ toc="$(echo "${toc}" | sed 's/<DD>/<\/LI>/')"
- toc="$(echo "${toc}" | sed 's/<DL>/<UL class="man-toc">/')"
- toc="$(echo "${toc}" | sed 's/<\/DL>/<\/UL>/')"
- toc="$(echo "${toc}" | sed 's/<DT>/<LI>/')"
- toc="$(echo "${toc}" | sed 's/<DD>/<\/LI>/')"
+ ## put table of content and first two lines into file and append hr
+ { echo -e "${tmp}\n${toc}\n<HR>"; cat "${ftmp}"; } > tmp; mv tmp "${ftmp}"
- ## put table of content and first two lines into file and append hr
- { echo -e "${tmp}\n${toc}\n<HR>"; cat "${ftmp}"; } > tmp; mv tmp "${ftmp}"
+ ## remove table of content and some uneeded info from bottom of file
+ sed -i '/^<A NAME="index">&nbsp;<\/A><H2>Index<\/H2>$/,$d' "${ftmp}"
+ head -n-3 "${ftmp}" > tmp; mv tmp "${ftmp}"
- ## remove table of content and some uneeded info from bottom of file
- sed -i '/^<A NAME="index">&nbsp;<\/A><H2>Index<\/H2>$/,$d' "${ftmp}"
- head -n-3 "${ftmp}" > tmp; mv tmp "${ftmp}"
+ # change deprecated name in <a> into id
+ sed -i 's/A NAME="/A ID="/g' "${ftmp}"
- # change deprecated name in <a> into id
- sed -i 's/A NAME="/A ID="/g' "${ftmp}"
+ # generate page info at bottom of page
+ echo "<p class=\"info left\"><a href=\"http://en.bofc.pl\">bofc.pl</a></p><p class=\"info center\">${version_info}</p><p class=\"info right\">${name}(${n})</p>" >> "${ftmp}"
- # generate page info at bottom of page
- echo "<p class=\"info left\"><a href=\"http://en.bofc.pl\">bofc.pl</a></p><p class=\"info center\">${version_info}</p><p class=\"info right\">${name}(${n})</p>" >> "${ftmp}"
+ # convert all h2 into h1 headings
+ sed -i 's/H2>/H1>/g' "${ftmp}"
- # convert all h2 into h1 headings
- sed -i 's/H2>/H1>/g' "${ftmp}"
+ # remove obsolete COMPACT from dl
+ sed -i 's/DL COMPACT/DL/g' "${ftmp}"
- # remove obsolete COMPACT from dl
- sed -i 's/DL COMPACT/DL/g' "${ftmp}"
+ # change ../man# to ./ as we have all mans in single directory
+ sed -i 's/\.\.\/man.\//.\//g' "${ftmp}"
- # move generated file into output directory for further processing
- cp "${ftmp}" "${out}/man${n}/${m}.html"
- done
+ # move generated file into output directory for further processing
+ cp "${ftmp}" "${out}/${m}.html"
done
diff --git a/readme.md b/readme.md
index 0cbcdc2..048e89a 100644
--- a/readme.md
+++ b/readme.md
@@ -10,28 +10,28 @@ there are 0 (zero) syscalls, everything is done in user's process without kernel
interfering and steeling precious cpu cycles. Altough librb provides
some more functions, it can be operated using 4 basic functions
- * [rb_new](http://librb.kurwinet.pl/manuals/man3/rb_clear.3.html) -
+ * [rb_new](http://librb.kurwinet.pl/manuals/rb_clear.3.html) -
creates new ring buffer
- * [rb_read](http://librb.kurwinet.pl/manuals/man3/rb_read.3.html) -
+ * [rb_read](http://librb.kurwinet.pl/manuals/rb_read.3.html) -
reads from the ring buffer
- * [rb_write](http://librb.kurwinet.pl/manuals/man3/rb_write.3.html) -
+ * [rb_write](http://librb.kurwinet.pl/manuals/rb_write.3.html) -
writes to the ring buffer
- * [rb_destroy](http://librb.kurwinet.pl/manuals/man3/rb_destroy.3.html) -
+ * [rb_destroy](http://librb.kurwinet.pl/manuals/rb_destroy.3.html) -
destroys ring buffer
Additional functions are:
- * [rb_recv](http://librb.kurwinet.pl/manuals/man3/rb_recv.3.html) -
+ * [rb_recv](http://librb.kurwinet.pl/manuals/rb_recv.3.html) -
reads from the ring buffer but also accepts flags
- * [rb_send](http://librb.kurwinet.pl/manuals/man3/rb_send.3.html) -
+ * [rb_send](http://librb.kurwinet.pl/manuals/rb_send.3.html) -
writes to the ring buffer but also accepts flags
- * [rb_clear](http://librb.kurwinet.pl/manuals/man3/rb_clear.3.html) -
+ * [rb_clear](http://librb.kurwinet.pl/manuals/rb_clear.3.html) -
removes all elements from the buffer
- * [rb_count](http://librb.kurwinet.pl/manuals/man3/rb_count.3.html) -
+ * [rb_count](http://librb.kurwinet.pl/manuals/rb_count.3.html) -
returns number of elements in the buffer
- * [rb_space](http://librb.kurwinet.pl/manuals/man3/rb_space.3.html) -
+ * [rb_space](http://librb.kurwinet.pl/manuals/rb_space.3.html) -
returns number of free space for number of elements
- * [rb_stop](http://librb.kurwinet.pl/manuals/man3/rb_stop.3.html) -
+ * [rb_stop](http://librb.kurwinet.pl/manuals/rb_stop.3.html) -
forces all threads to exit **rb_write** and **rb_read** functions
Dependencies