seendll - Seen dll for mIRC
Copyright (C) 2003 Gustavo Picon
v30130


Functions:



All functions will return:
	"+<code> [string]" on a success or
	"-<code> [string]" on a failure



SeenTableAdd <table>
	Creates a seen table

	Return values:
	"+OK"
	"-TABLE Invalid table name"
	"-DUP There is already a table with that name"

	$dll(seen.dll, SeenTableAdd, foo)



SeenTableDel <table>
	Removes a seen table

	Return values:
	"+OK"
	"-TABLE Invalid table name"
	"-NOTFOUND Table not found"

	$dll(seen.dll, SeenTableDel, foo)



SeenTableDelMatch <*table*>
	Removes the matching seen tables

	Return values:
	"+OK <removed> <remaining>"
	"-MATCH Invalid match expression"

	$dll(seen.dll, SeenTableDelMatch, dal*)



SeenTableCount
	Returns the number of stored seen tables

	Return values:
	"+OK <total>"

	$dll(seen.dll, SeenTableCount, -)



SeenTableClear
	Removes all the seen tables

	Return values:
	"+OK <removed_tables>"

	$dll(seen.dll, SeenTableClear, -)



SeenAdd <table> <nick> <addy> <chan> <type> <when> <timespent> [msg]
	Adds an entry to a seen table. The 'when' and 'timespent' field must be
	valid positive numbers (should be valid ctime values).

	Return values:
	"+OK"
	"-TABLE Invalid table name"
	"-NICK Invalid nick"
	"-ADDY Invalid address"
	"-CHAN Invalid channel"
	"-TYPE Invalid type"
	"-WHEN Invalid seen time"
	"-TIMESPENT Invalid time spent"

	$dll(seen.dll, SeenAdd, foo tabo kenobi@127.0.0.1 #lamest part $ctime 5 blah!)



SeenDel <table> <nick>
	Removes an entry from a seen table.

	Return values:
	"+OK"
	"-TABLE Invalid table name"
	"-NICK Invalid nick"
	"-FOUND Nick not found"

	$dll(seen.dll, SeenDel, foo idiot)



SeenDelMatch <table> <*nick*|*> <*uhost*|*> <*chan*|*>
	Removes the matching entries from a seen table

	Return values:
	"+OK <removed_items> <remaining_items>"
	"-TABLE Invalid table name"
	"-NICK Invalid nick"
	"-ADDY Invalid address"
	"-CHAN Invalid channel"

	$dll(seen.dll, SeenDelMatch, foo * *.lameprovider.com #*mp3*)



SeenGet <table> <nick>
	Returns the data of an entry in a seen table.

	Return values:
	"+OK <nick> <address> <channel> <type> <when> <timespent> [msg]"
	"-TABLE", "Invalid table name"
	"-NICK", "Invalid nick"
	"-FOUND", "Nick not found"

	$dll(seen.dll, SeenGet, foo tabo)



SeenMatch <table> <*nick*|*> <*uhost*|*> <*chan*|*> <maxnicks>
	Returns the nicks that match the given pattern sorted alphabetically.
	A valid 'maxnicks' param must be given. If maxnicks is "0", it will
	search the entire table, else, it'll look only in the first <maxnicks>
	matching nicks.
	Note that this function is a lot faster than 'SeenMatchSort'.

	Return values:
	"+OK <total> <displayed> <nick1> [nick2] ..."
	     <total> is the number of matching seen entries
	     <displayed> is the number of nicks that are returned to mIRC,
	       it will be <= <total>. This is because sometimes all the nicks
	       found can't be returned by the dll because of mIRC's ~900 bytes
	       buffer limitation,
	"-TABLE Invalid table name"
	"-NICK Invalid nick"
	"-ADDY Invalid address"
	"-CHAN Invalid channel"
	"-MAXNICKS Invalid maxnicks number"

	$dll(seen.dll, SeenMatch, foo *tabo* * * 0)
	$dll(seen.dll, SeenMatch, foo *tabo* * * 5)
	$dll(seen.dll, SeenMatch, foo *tabo* * * 500)



SeenMatchSort <table> <*nick*|*> <*uhost*|*> <*chan*|*> <maxnicks>
	Returns the nicks that match the given pattern sorted descending by the
	date the entries were set. A valid 'maxnicks' param must be given. If
	maxnicks is "0", it will search the entire table, else, it'll look only
	in the first <maxnicks> matching nicks.
	Note that this function is a lot slower than 'SeenMatch'.

	Return values:
	"+OK <total> <displayed> <nick1> [nick2] ..."
	     <total> is the number of matching seen entries
	     <displayed> is the number of nicks that are returned to mIRC,
	       it will be <= <total>. This is because sometimes all the nicks
	       found can't be returned by the dll because of mIRC's ~900 bytes
	       buffer limitation,
	"-TABLE Invalid table name"
	"-NICK Invalid nick"
	"-ADDY Invalid address"
	"-CHAN Invalid channel"
	"-MAXNICKS Invalid maxnicks number"

	$dll(seen.dll, SeenMatchSort, foo *tabo* * * 0)
	$dll(seen.dll, SeenMatchSort, foo *tabo* * * 5)
	$dll(seen.dll, SeenMatchSort, foo *tabo* * * 500)



SeenMatchCount <table> <*nick*|*> <*uhost*|*> <*chan*|*> <maxnicks>
	Returns the number of nicks that match the given pattern. A valid
	'maxnicks' param must be given. If maxnicks is "0", it will search the
	entire table, else, it'll look only in the first <maxnicks> matching
	nicks.

	Return values:
	"+OK <total>"
	"-TABLE Invalid table name"
	"-NICK Invalid nick"
	"-ADDY Invalid address"
	"-CHAN Invalid channel"
	"-MAXNICKS Invalid maxnicks number"

	$dll(seen.dll, SeenMatchCount, foo *tabo* * * 0)
	$dll(seen.dll, SeenMatchCount, foo *tabo* * * 5)
	$dll(seen.dll, SeenMatchCount, foo *tabo* * * 500)



SeenCount <table>
	Returns the number of entries in a seen table

	Return values:
	"+OK <number>"
	"-TABLE Invalid table name"

	$dll(seen.dll, SeenCount, foo)



SeenClear <table>
	Removes all the entries in a seen table

	Return values:
	"+OK"
	"-TABLE Invalid table name"

	$dll(seen.dll, SeenClear, foo)



SeenExpire <table> <n <number>|t <ctime>>
	Removes entries older than <ctime> or keep only the most recent
 	<number> entries

	Return values:
	"+OK <number_of_entries_removed>"
	"-TABLE Invalid table name"
	"-OPTION Invalid option"
	"-SECONDS Invalid seconds number"
	"-ENTRIESN Invalid entries number"

	$dll(seen.dll, SeenExpire, foo t $calc($ctime - 3600))
	$dll(seen.dll, SeenExpire, foo n 500)



SeenLoad <table> <file>
	Loads a seen table from a file.

	Return values:
	"+OK <number_of_entries_loaded>"
	"-TABLE Invalid table name"
	"-FILE Invalid File"
	"-OPEN Couldn't open file."
	"-NOFILE File not found or invalid"
	"-OPTFILE", "Invalid Seen File"

	$dll(seen.dll, SeenLoad, foo seen.dat)



SeenSave <table> <file>
	Saves a seen table to a file.

	Return values:
	"+OK <number_of_entries_saved>"
	"-TABLE", "Invalid table name"
	"-FILE Invalid File"
	"-OPEN Couldn't open file."

	$dll(seen.dll, SeenSave, foo seen.dat)



DllInfo
	Returns some info about the dll

	Return values:
	"+OK seendll <version> (C) Gustavo Picon (http://www.airc.ws)"

	$dll(seen.dll, DllInfo, -)
