summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--doc/upgrade.html2
-rw-r--r--package/deps.mak3
-rw-r--r--src/include/skalibs/sig.h1
-rw-r--r--src/libstddjb/sig0_scan.c33
-rw-r--r--src/libstddjb/sig_scan.c34
6 files changed, 30 insertions, 46 deletions
diff --git a/NEWS b/NEWS
index 89bc01d..ab06da8 100644
--- a/NEWS
+++ b/NEWS
@@ -4,8 +4,7 @@ In 2.6.4.0
----------
- Bugfixes.
- - New functions: execvep_loose(), byte_zzero(), openb_read(),
-sig_scan(), sig0_scan()
+ - New functions: execvep_loose(), byte_zzero(), openb_read(), sig0_scan()
- New function family: skalibs/genqdyn.h
diff --git a/doc/upgrade.html b/doc/upgrade.html
index 6a24aa9..c582e40 100644
--- a/doc/upgrade.html
+++ b/doc/upgrade.html
@@ -21,7 +21,7 @@
<ul>
<li> New functions: <a href="libstddjb/djbunix.html">execvep_loose()</a>,
<tt>byte_zzero()</tt>, <a href="libstddjb/djbunix.html">openb_read()</a>,
-<tt>sig_scan()</tt>, <tt>sig0_scan</tt> </li>
+<tt>sig0_scan</tt> </li>
<li> New family of functions: <a href="libdatastruct/genqdyn.html">skalibs/genqdyn.h</a> </li>
</ul>
diff --git a/package/deps.mak b/package/deps.mak
index 34081ff..380a9eb 100644
--- a/package/deps.mak
+++ b/package/deps.mak
@@ -480,7 +480,7 @@ src/libstddjb/selfpipe_trap.o src/libstddjb/selfpipe_trap.lo: src/libstddjb/self
src/libstddjb/selfpipe_trapset.o src/libstddjb/selfpipe_trapset.lo: src/libstddjb/selfpipe_trapset.c src/include/skalibs/nonposix.h src/include/skalibs/nsig.h src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sig.h src/include/skalibs/sysdeps.h
src/libstddjb/selfpipe_untrap.o src/libstddjb/selfpipe_untrap.lo: src/libstddjb/selfpipe_untrap.c src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sig.h src/include/skalibs/sysdeps.h
src/libstddjb/sgetopt.o src/libstddjb/sgetopt.lo: src/libstddjb/sgetopt.c src/include/skalibs/buffer.h src/include/skalibs/sgetopt.h
-src/libstddjb/sig0_scan.o src/libstddjb/sig0_scan.lo: src/libstddjb/sig0_scan.c src/include/skalibs/sig.h
+src/libstddjb/sig0_scan.o src/libstddjb/sig0_scan.lo: src/libstddjb/sig0_scan.c src/include/skalibs/sig.h src/include/skalibs/types.h
src/libstddjb/sig_block.o src/libstddjb/sig_block.lo: src/libstddjb/sig_block.c src/include/skalibs/sig.h
src/libstddjb/sig_blocknone.o src/libstddjb/sig_blocknone.lo: src/libstddjb/sig_blocknone.c src/include/skalibs/sig.h
src/libstddjb/sig_blockset.o src/libstddjb/sig_blockset.lo: src/libstddjb/sig_blockset.c src/include/skalibs/sig.h
@@ -490,7 +490,6 @@ src/libstddjb/sig_number.o src/libstddjb/sig_number.lo: src/libstddjb/sig_number
src/libstddjb/sig_pause.o src/libstddjb/sig_pause.lo: src/libstddjb/sig_pause.c src/include/skalibs/sig.h
src/libstddjb/sig_push.o src/libstddjb/sig_push.lo: src/libstddjb/sig_push.c src/include/skalibs/sig.h
src/libstddjb/sig_restoreto.o src/libstddjb/sig_restoreto.lo: src/libstddjb/sig_restoreto.c src/include/skalibs/sig.h
-src/libstddjb/sig_scan.o src/libstddjb/sig_scan.lo: src/libstddjb/sig_scan.c src/include/skalibs/sig.h src/include/skalibs/types.h
src/libstddjb/sig_shield.o src/libstddjb/sig_shield.lo: src/libstddjb/sig_shield.c src/include/skalibs/sig.h
src/libstddjb/sig_stack.o src/libstddjb/sig_stack.lo: src/libstddjb/sig_stack.c src/include/skalibs/nonposix.h src/include/skalibs/nsig.h src/include/skalibs/sig.h
src/libstddjb/sig_table.o src/libstddjb/sig_table.lo: src/libstddjb/sig_table.c src/libstddjb/sig-internal.h
diff --git a/src/include/skalibs/sig.h b/src/include/skalibs/sig.h
index 236257b..eb33ed4 100644
--- a/src/include/skalibs/sig.h
+++ b/src/include/skalibs/sig.h
@@ -46,7 +46,6 @@ extern void sig_unshield (void) ;
extern char const *sig_name (int) ;
extern int sig_number (char const *) ;
-extern size_t sig_scan (char const *, int *) ;
extern size_t sig0_scan (char const *, int *) ;
#endif
diff --git a/src/libstddjb/sig0_scan.c b/src/libstddjb/sig0_scan.c
index 7714bfc..d6b2b90 100644
--- a/src/libstddjb/sig0_scan.c
+++ b/src/libstddjb/sig0_scan.c
@@ -1,13 +1,34 @@
/* ISC license. */
-#include <sys/types.h>
+#include <string.h>
+#include <strings.h>
+#include <skalibs/types.h>
#include <skalibs/sig.h>
+static size_t sig0_scan_norec (char const *s, int *sig)
+{
+ int r = sig_number(s) ;
+ if (r)
+ {
+ *sig = r ;
+ return strlen(s) ;
+ }
+ {
+ unsigned int u ;
+ size_t len = uint0_scan(s, &u) ;
+ if (len) *sig = u ;
+ return len ;
+ }
+}
+
size_t sig0_scan (char const *s, int *sig)
{
- int t ;
- size_t len = sig_scan(s, &t) ;
- if (!len || s[len]) return 0 ;
- *sig = t ;
- return len ;
+ size_t len = sig0_scan_norec(s, sig) ;
+ if (len) return len ;
+ if (!strncasecmp(s, "SIG", 3))
+ {
+ len = sig0_scan_norec(s+3, sig) ;
+ if (len) return 3+len ;
+ }
+ return 0 ;
}
diff --git a/src/libstddjb/sig_scan.c b/src/libstddjb/sig_scan.c
deleted file mode 100644
index f037d8c..0000000
--- a/src/libstddjb/sig_scan.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* ISC license. */
-
-#include <string.h>
-#include <strings.h>
-#include <skalibs/types.h>
-#include <skalibs/sig.h>
-
-static size_t sig_scan_norec (char const *s, int *sig)
-{
- int r = sig_number(s) ;
- if (r)
- {
- *sig = r ;
- return strlen(s) ;
- }
- {
- unsigned int u ;
- size_t len = uint_scan(s, &u) ;
- if (len) *sig = u ;
- return len ;
- }
-}
-
-size_t sig_scan (char const *s, int *sig)
-{
- size_t len = sig_scan_norec(s, sig) ;
- if (len) return len ;
- if (!strncasecmp(s, "SIG", 3))
- {
- len = sig_scan_norec(s+3, sig) ;
- if (len) return 3+len ;
- }
- return 0 ;
-}