]> jfr.im git - irc/quakenet/newserv.git/commit - newsearch/ns-or.c
Newsearch overhauled.
authorsplidge <redacted>
Tue, 5 Jun 2007 22:16:02 +0000 (23:16 +0100)
committersplidge <redacted>
Tue, 5 Jun 2007 22:16:02 +0000 (23:16 +0100)
commitc7f7a584fd6c8ee4a0ede6e79e8ce2177ab863f0
tree3f508468af2d55e586e343d1bf1eb18153f3f628
parentec6c86c867cc10c723668a50381cbc0b2c4c34b4
Newsearch overhauled.

Removed the confusion of having both a return type specified in each node
and the return type being passed in on execute.

Now each node should always return the type indicated in its "returntype"
member.  Nodes who want its callees to return a certain type can call the
new "coerceNode()" to insert a conversion node as necessary to convert
types.  Note that coerceNode() has no overhead if the node already returns
the correct type.

The "type" parameter passed to search execute functions has been removed.

All existing modules have been rewritten to honour these rules, in a lot of
cases this means ripping out useless code to return different types (and as
a side-effect it has fixed all problems where a node was unable to correctly
return some types).  Sadly some nodes (eq, lt, gt) have got a bit messier as
they now need to coerce each subsequent parameter to match the type of the
first parameter.

Also fixed up some of the channel nodes to just return the relevant piece of
data rather than a BOOL acquired by performing some arbitrary operation on
that data.

Added the (length) function which returns the length of its input string.

Removed the (namelen) function as you can now call (length (name)) - or, to
reproduce the old function, (gt (length (name)) <constant>) which will
return all channel names above a constant length.
34 files changed:
newsearch/Makefile
newsearch/newsearch.c
newsearch/newsearch.h
newsearch/ns-and.c
newsearch/ns-authedpct.c
newsearch/ns-authname.c
newsearch/ns-channel.c
newsearch/ns-country.c
newsearch/ns-eq.c
newsearch/ns-exists.c
newsearch/ns-gline.c
newsearch/ns-gt.c
newsearch/ns-host.c
newsearch/ns-hostmask.c
newsearch/ns-hostpct.c
newsearch/ns-ident.c
newsearch/ns-ip.c
newsearch/ns-kill.c
newsearch/ns-length.c [new file with mode: 0644]
newsearch/ns-lt.c
newsearch/ns-match.c
newsearch/ns-modes.c
newsearch/ns-name.c
newsearch/ns-namelen.c [deleted file]
newsearch/ns-nick.c
newsearch/ns-not.c
newsearch/ns-oppct.c
newsearch/ns-or.c
newsearch/ns-realname.c
newsearch/ns-regex.c
newsearch/ns-services.c
newsearch/ns-size.c
newsearch/ns-timestamp.c
newsearch/ns-topic.c