From 266a16b1485b5f08096699d2eb3240eab8cb1f84 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Wed, 18 Jul 2012 11:32:44 +0200 Subject: [PATCH] Signals: Documentation --- ucw/doc/Makefile | 2 +- ucw/doc/index.txt | 1 + ucw/doc/signal.txt | 7 +++++++ ucw/signames.h | 17 +++++++++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 ucw/doc/signal.txt diff --git a/ucw/doc/Makefile b/ucw/doc/Makefile index 92561d50..4da7cf8c 100644 --- a/ucw/doc/Makefile +++ b/ucw/doc/Makefile @@ -2,7 +2,7 @@ DIRS+=ucw/doc -UCW_DOCS=basics log fastbuf index config configure install basecode hash docsys conf mempool eltpool mainloop generic growbuf unaligned lists chartype unicode prime binsearch heap binheap compress sort hashtable relnotes trans string time daemon +UCW_DOCS=basics log fastbuf index config configure install basecode hash docsys conf mempool eltpool mainloop generic growbuf unaligned lists chartype unicode prime binsearch heap binheap compress sort hashtable relnotes trans string time daemon signal UCW_INDEX=$(o)/ucw/doc/def_index.html UCW_DOCS_HTML=$(addprefix $(o)/ucw/doc/,$(addsuffix .html,$(UCW_DOCS))) diff --git a/ucw/doc/index.txt b/ucw/doc/index.txt index 8ac58c92..e449c755 100644 --- a/ucw/doc/index.txt +++ b/ucw/doc/index.txt @@ -41,6 +41,7 @@ Modules - <> - <> - <> +- <> Other features -------------- diff --git a/ucw/doc/signal.txt b/ucw/doc/signal.txt new file mode 100644 index 00000000..b78f065d --- /dev/null +++ b/ucw/doc/signal.txt @@ -0,0 +1,7 @@ +Signal helpers +============== + +ucw/signames.h +-------------- + +!!ucw/signames.h diff --git a/ucw/signames.h b/ucw/signames.h index d7b9cac7..0876bab5 100644 --- a/ucw/signames.h +++ b/ucw/signames.h @@ -7,8 +7,25 @@ #ifndef _UCW_SIGNAMES_H #define _UCW_SIGNAMES_H +/*** + * POSIX lacks facilities for conversion between signal names + * and signal numbers. They are available in LibUCW, but please + * be aware that some signals might be missing on your system. + * If they do, please notify LibUCW maintainers. + ***/ + +/** + * Converts signal name to the corresponding number. + * Returns -1 if not found. + **/ int sig_name_to_number(const char *name); +/** + * Converts signal number to the corresponding name. + * If more names are known for the given signal, one of them + * is considered canonical and preferred. + * Returns NULL if not found. + **/ const char *sig_number_to_name(int number); #endif -- 2.39.5