diff options
| author | Toomas Soome <tsoome@me.com> | 2016-10-23 15:21:04 +0300 |
|---|---|---|
| committer | Robert Mustacchi <rm@joyent.com> | 2016-10-23 09:57:07 -0700 |
| commit | 67ab13dcc8a263ef90b5607c54df109997849a2b (patch) | |
| tree | b96c41bc4f6dc8449677677c9a926d4f516244ca | |
| parent | f9227b3195a9c18631fd7189f610528ced15121a (diff) | |
| download | illumos-joyent-67ab13dcc8a263ef90b5607c54df109997849a2b.tar.gz | |
7493 ficl: want additional softwords
Reviewed by: Gordon Ross <gwr@nexenta.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Approved by: Robert Mustacchi <rm@joyent.com>
| -rw-r--r-- | usr/src/boot/sys/boot/ficl/softcore/Makefile | 2 | ||||
| -rw-r--r-- | usr/src/common/ficl/softcore/wordsets.fr | 37 | ||||
| -rw-r--r-- | usr/src/lib/libficl/softcore/Makefile | 2 |
3 files changed, 39 insertions, 2 deletions
diff --git a/usr/src/boot/sys/boot/ficl/softcore/Makefile b/usr/src/boot/sys/boot/ficl/softcore/Makefile index 18565a73c3..92ec77324f 100644 --- a/usr/src/boot/sys/boot/ficl/softcore/Makefile +++ b/usr/src/boot/sys/boot/ficl/softcore/Makefile @@ -22,7 +22,7 @@ PROG = makesoftcore # not needed: file access # FR = softcore.fr ifbrack.fr prefix.fr ficl.fr jhlocal.fr marker.fr -FR += freebsd.fr ficllocal.fr oo.fr classes.fr string.fr +FR += freebsd.fr ficllocal.fr oo.fr classes.fr string.fr wordsets.fr SOURCES= $(FR:%=$(SOFTCORE)/%) OBJS= makesoftcore.o lz4.o diff --git a/usr/src/common/ficl/softcore/wordsets.fr b/usr/src/common/ficl/softcore/wordsets.fr new file mode 100644 index 0000000000..0658b69270 --- /dev/null +++ b/usr/src/common/ficl/softcore/wordsets.fr @@ -0,0 +1,37 @@ +\ +\ This file and its contents are supplied under the terms of the +\ Common Development and Distribution License ("CDDL"), version 1.0. +\ You may only use this file in accordance with the terms of version +\ 1.0 of the CDDL. +\ +\ A full copy of the text of the CDDL should have accompanied this +\ source. A copy of the CDDL is also available via the Internet at +\ http://www.illumos.org/license/CDDL. + +\ Copyright 2016 Toomas Soome <tsoome@me.com> + +\ This file is part of the softcore, implementing [partial] word sets. + +\ Optional String word set. +\ compare is implemented in ficl core. + +\ search ( c-addr1 u1 c-addr2 u2 -- c-addr3 u3 flag ) +\ Search the string specified by c-addr1 u1 for the string specified by +\ c-addr2 u2. If flag is true, a match was found at c-addr3 with u3 characters +\ remaining. If flag is false there was no match and c-addr3 is c-addr1 and u3 +\ is u1. +: search { c-addr1 u1 c-addr2 u2 | saved-addr1 saved-u1 -- c-addr3 u3 flag } + c-addr1 to saved-addr1 \ save original c-addr1 + u1 to saved-u1 \ save original u1 + begin + c-addr1 u1 u2 < if u1 else u2 then + c-addr2 u2 compare + while + c-addr1 1+ to c-addr1 + u1 1- to u1 + u1 0= if + saved-addr1 saved-u1 0 exit \ not found + then + repeat + c-addr1 u1 -1 +; diff --git a/usr/src/lib/libficl/softcore/Makefile b/usr/src/lib/libficl/softcore/Makefile index a1cec6287f..7d62e1ba32 100644 --- a/usr/src/lib/libficl/softcore/Makefile +++ b/usr/src/lib/libficl/softcore/Makefile @@ -24,7 +24,7 @@ PROG = makesoftcore # not needed: file access # FR = softcore.fr ifbrack.fr prefix.fr ficl.fr jhlocal.fr marker.fr -FR += freebsd.fr ficllocal.fr oo.fr classes.fr string.fr +FR += freebsd.fr ficllocal.fr oo.fr classes.fr string.fr wordsets.fr SOURCES= $(FR:%=$(SOFTCORE)/%) OBJS= makesoftcore.o lz4.o |
