CVS log for epic5/source/hook.c |
![]() |
Request diff between arbitrary revisions
Added /on. /ON WINDOW_NOTIFED.
* Roll in a bunch of changes from larne to make epic5 more vms-friendly * Rename if.h -> ifcmd.h (larne) -- Make sure you rerun configure! * Run make depend to pick up name change of if.h * Check for <sys/param.h> in configure (larne) * Extern funcs are case insensitive in strict c90, fix (larne) * Rename options -> options.h since vms requires a dot in filename (larne) * Change "readonly" -> "rdonly" since "readonly" is a symbol in vms. (larne) * Pull in "compat.h" for gailib.c and glob.c (larne) * Set stdout to be explciitly line buffered at startup (larne) * Returning a value from void functino forbidden by strict c90. fix (larne) * Fix some compiler warnings that were lying around. * There are more changes forthcoming, these were the easy ones.
* Add /on signal (pegasus) * Fix build on interix (twincest) * Fix compile warnings and a c99-ism * Fix another panic() causable by /echo. ugh.
* Change /on listings so they tell you if a hook is "disabled". * Add forgotten code to move lastlog items between windows for /window number * Fix bug where default numeric output wouldn't go to a channel's window. * Remove a superfluous message_from() when parsing server stuff.
* Revert commit 1498 (the dcc stuff) -- it was half baked. * Fix warnings found with --with-warns.
* Apparantly solaris 9 doesn't have <stdint.h>, intmax_t, or strtoimax. ick. * Begin "fixing" protected implied hooks. Must test above examples. * The sequence we delete stuff on shutdown actually does matter. (Fix crash)
* Fix missing NULL for $hookctl(list ...) [rb howl] * Fix various other issues that valgrind found (yay!)
* Fix hookctl(set list ... implied {...}) to work as intended (rb zlonix)
* Fix bug that kept implied on hooks from working (important fix!)
* Fix infinite recursion if you load a script as a formats file.
* Fix a couple of bugs rb zlonix * When doing /stack pop set ... the callback (if any) should be invoked.
* Add arg to panic() controlling whether panic is sent via QUIT (rb black)
This is the start of a major project to normalize the behavior of word handling in built in functions. The project involves stipulating that every place that handles a "word list" define what a "word" is and use it consistenly, and to output the same type of "words" that it accepts as input. This leverages /xdebug dword to control optional support for dwords in many built in functions.
* Fixes for two memory leaks from nullie * New /on, /ON WINDOW_SERVER, from nullie who needs to write a blurb.
Add /on unknown_command, from nullie (thanks!)
Add /on channel_lost from nullie who needs to write an updates blurb
* Fix finite()/isfinite() madness. * Look for clock_gettime() in -lrt for ubuntu. * Automatic reconnect from nullie. yay! * Change /xecho -v to always output to current window if it's visible. * Fix /on's with arglists, so lower serial nums don't corrupt $*. [rb nullie] * Fix memory leak with $url(en|de)code() [rb nullie] * Change /server - so it calls disconnect() directly * Fix const correctness problems with sha2.c
* Add /on operwall and operwall window level for black. * Fix $levelwindow()
* Add /ON NUMERIC which is thrown if you don't hook the numeric specifically.
* Eliminate the third argument to expand_alias(), the statement spanner. * Rename parse_line() to parse_block() to better reflect its duties. * Make parse_block() static. Everything needs to call runcmds() now. * Eliminate the local-stack-creating feature of parse_block(), callers do this. * Rename 'line' to 'stmt' in parse_statement(). * Sort of forget to re-implement /set cmdchars. The / is the cmdchar. * Try to optimize parse_statement() and next_statement() some.
Add /on keybinding. (*gulp*)
* Add flush_all_symbols() which does a total cleanup of symbols at exit-time. * Fix a few bugs * Use flush_all_symbols() instead of /dump to catch memory leaks.
* Improve /dcc get * Fix warnings
* Implement $windowctl(SET .. NOTIFY_NAME) for howl. * Fix a few things with the dns helper. * In /on type '<pattern>', Set $* so <pattern> can match against itself.
* Change /on leave to /on part. * Only ever do one io event per call through select() or poll() * Do put_echo() and not add_to_screen() in /window echo so it can be logged
More brain damage on my part.
Initialize implied hooks. doh!
Stuff for fudd and blackjac.
* Check for arc4random() in configure, don't use compat.c version if possible. * GC "fill_it_out" code which has been deactive for a while. * Fix translation casting error for zlonix * Allow current_package() to return NULL, handle that as special case. * Refactor the startup loading stuff * Move a couple of loads out of basical and into global.
Fixes from darwin that they "forgot" to submit upstream.
* Add $hookctl(SET LIST <type> IMPLIED <string>) though it's off by default. * If you do turn it on, it shows up as 'h' in $info(o) * Sort logfiles by refnum, so new refnums always go at the end of the list. * Fix up 338 again, oops!
* Refactor the error stuff by eliminating my_strerror() and dgets_errno. * Error messages are now delivered on multiple levels as info is available. * This may get annoying, but it's a lot more accurate now! * Change inet_* functions to return int's since their retval is unused. * Add a new internal "syserr()" function that generates formatted errors. * Syserr's look like say()s but they act like yell()s. (can hook with /on yell) * Keep an counter in the server stuff so we can count off as addrs are used. * So the error message in /ON DCC_LOST is always just "ERROR" now. * Fix various compiler warnings and stuff. * Add $hookctl(GET HOOK <ref> STRING), return /load'able format of ON * Fix some debugging outbound in switch_hostname(), doh! * Roll set_socket_options() into a new Socket() function. * Roll connections to AF_UNIX sockets into the mainline stuff. * Roll nonblocking/connect/nonblocking into Connect(). * Add AF_UNIX support to Getnameinfo() to remove annoying errors. * When doing recovery from EBADF in select, only check fd's we're using * Just puke if configured for kqueue() and kqueue() fails. * Don't puke on default 353 output if the userlist arg is missing. (for ratbox) * Permit doing /window name to change case of window's name.
* Implement a proper built in /INVITE command. See UPDATES * Revert 2.8script change. * Add "subpackage" command, which i'll document later. * Package up 'global', and '2.8script' and 'basical' so they can be /unload'ed. * Don't load "global" if user has their own startup script. * Don't load "global" if the -q option is set, either. * Thus, the "global" script acts as a default "epicrc" for those without one. * THIS IS BACKWARDS INCOMPATABLE. SEE UPDATES FOR IMPORTANT INFORMATION. * Nix the "loading_global" variable, only used by hooks. * Fix /on 005 so it shows the /on 005's and not all numeric hooks. * If Accept() fails, tell the user straight-way so I can debug this. * Fix /window name - so it redraws the status bar.
* Refactor $sar() and $msar() so they share as much code as possible. * Refactor newio, support select/kqueue/poll (#define's in newio.h) * ... Getting closer to not needing select! * Fix SSL. * Fix a bunch of misc compiler warnings * Remove restrictions on /QUOTE, so there! * Add pthread support to newio for larne. HUZZAH! * I'm sure a zillion things are broken, so it's time to test!
* Hide ArgListT in alias.h to only those who need it, to save numbers.c * Fix up a lot of compile warnings all over the place. * Some changes to $hookctl() might need feedback from howl... * Fix vhost support so we can do inbound sockets again.
* Refactor window_check_servers() to work with server's current window only. * Roll forward all the rest of changes from epic4 (i think) * Add /ON NEW_NICKNAME, when epic needs a new nickname from you. * Run 'make depend', fix compile errors, fix 'environment' script
* Add arglists to hooks (by howl, who I will pester to document this). Woot! * Finish $hookctl(), by howl.
Add $winquery() and $hookctl(), written by howl.
* Nix calls to dcc_connected(<fd>, 0) which were always bogus. * Create print_arglist() for printing alias arglists, natch. * Fix crash from /queue -del <name> <num> for <num> = <items> + 1 (rb black) * Show arglist when creating and listing aliases. * Fix memory leaks of buckets when user grabs /on set. * Add a "alternate names" bucket to server data. * Create a whole new api for querying and creating server refnums. * Fix crash with /dump on (/dump all) * Add $serverctl(GET|SET <refnum> ALIAS) get and set server alternate desigs * Add $serverctl(GET|SET <refnum> ALIASES) get and set entire list. * Fix memory leak with /on set
* Numerous new and changed features as per UPDATES. * Better handling of damaged /who x,y responses.
* Nix /save and pray nobody notices. * Implement pmatch_* stuff in alias.c to use the unified symbol table. * Commands, functions, and expandos now 100% integrated. HUZZAH! * Reimplement $get(set|command|function)s() to use the pmatch_* stuff. * So they now pick up changes at runtime. HUZZAH! * Allow built in /set to be conditionally added to the "set bucket" * Don't put user-created /set's in the bucket * Allow user to replace one user-created /sets but not builtin sets. * Allow mangling of ALT_CHAR -- how did this ever get missed? * Fix $currchans() so it works the way the documentation says it does. * Fix some const correctness issues, introduce others. bleh.
* Begin massive refactorization of alias.c, redefining "Alias" as "Symbol" * Refactor parse_line() with a bunch of front end call_* functions. * And a general parse_line() front end, "runcmds()". * Roll builtin expandos in with the user variables * Roll variables and commands together into one name space. HUZZAH! * Nix the caches for the global name space, for now. * I definitely broke /stack alias|assign here. I'll fix it later. * Inline expandos are now officially strings instead of a single char. * Fix bug with $unshift() that popped up. * Move after_expando() to ircaux.c. I think it belongs there more.
Keep fixoring.
Fix bugorz.
* Create one unified "hook" table for numerics and named hooks * Nuke "numeric lists" as separate beast in hook.c * Refactor code to only worry about one hook table. * Refactor do_hook() to re-start at start of list every time /on runs * This makes it 100% safe to edit/delete /on's from within /on's, HUZZAH! * Revert /on type ^"pattern" to epic4 behavior (suppressive action) * Add /on type !"pattern" to act like ircII's /on type ^"pattern" (exceptive)
* Fix (maybe?) a NULL deref with prepare_display() that hsoc tripped across. * Revert all the regex stuff for /on's -- the idea needs a lot more thoguht. * Convert do_hook()'s algorithm so it's safe to delete /on's from within /on's
* Move some defines from comands.h to where they belong * Add and remove func decls in header files as necessary. * Add /wait =<fd> which returns when a nonblocking dcc connection finishes * Make all keybinding funcs/decls use the BUILT_IN_KEYBINDING macro. * Make the BUILT_IN_KEYBINDING macro use unsigned chars. * Hide (struct Key) inside keys.c, and use (void *) to hold state. * Make the input line use (unsigned char), not (char), huzzah! * Make the "othername" ($3 in /on dcc_raw "E") the port number. * Avoid a NULL deref with "parse_command" keybinding.
* Fix some compiler issues and so forth * Nix the NOTE level. * Move load_ircrc() to irc.c, nix "startup_file" global var. * Always change server state using set_server_status(), because... * Add /ON SERVER_STATUS, $0 is refnum, $1 is old state, $2 is new state * Delete /on widelist, no longer used * Prototype mode string manipulation functions * Reorganize names.h to reflect new realities * Prototype (Get|Free)addrinfo() now that server.c uses them. * Nix /window bind, rebind, unbound; $windowctl(* BIND_CHANNEL *)
* Flexible hooks need to have 'hook->regexpr' set to NULL to avoid segfault
* Fix matching of /on type "*" to always have a weight of 1. (rb adm)
Experiemntal -- compile /on patterns into regex_t's, and use regexec(3) to process them at runtime. Looking for bugs -- this will eventually give way to several improvements in the /on system.
Make 'empty_string' (const char []). Now we're cooking with gas!
EPIC5-0.0.1! Huzzah!
* Remove /set beep_on_msg, a half-broken feature which can be scripted. * Nix /set beep_when_away, a 1-line scriptable feature. * Add new noise level %, (/ON %TYPE); like ^ but doesn't turn off display and other stuff as well.
Make message_from() work off of a stack; use panics to guard against unmatched message_from()s, and other wackiness.
* Nix auto-append-of-$* feature (args_flag to expand_alias/parse_inline) * Fix provided scripts to add $* when necessary. * Fix up Makefile, configure, et al, to use epic5/ directories.
* Add /ON WINDOW_BEFOREKILL
* Another iteration of the 'notify' script, hooks the system's /ONs now! =)
* Put a space in place of a newline in the PF loader.
* Always ignore spaces after semicolons in parse_line (the {} parser).
* Some compiler warning fixes from rain.
(*gulp*) Some changes for fudd. * Add /ON WINDOW_COMMAND, hooked after every /window command, $* is refnum. * Add concept of "fixed" or "frozen" windows when you SKIP ON FIXED ON * Fix /window kill to not kill the last "non-fixed" window * Fix /window hide to not hide the last "non-fixed" window * Allow /window kill to kill a "fixed" window, but not the last window. * (*gulp*) I hope all of the above works! * Fix $windowctl(REFNUM ...) it was out of order with REFNUMS * Make /xecho -l override the "who_from" target and always send to the level
Implement infinite recursion detector and thwarter. It requires a #define in config.h, the future of which I have not decided yet.
Add /on dcc_activity, a hook for scripters to create a %D-workalike.
Commit 551 -- second to last commit for this project -- the big one! * Roll in the new universal_next_arg_count() and attendant macros. * Comment out some deprecated function decls in ircaux.h * Do another round of make depends. * Modify alias arglist code to use the new universal_next_arg_count() stuff * Convert dequote() to dequoter(). * Convert new_new_next_arg() into new_new_next_arg_count(). * Comment out deprecated functions in ircaux.c -- will be deleted later.
Commit 548 * Nix channel_window, duplicate of get_winref_by_channame() * Make arglist processor panic if it sees an argtype that doesn't exist. * Fix bug with * operator in exprs like (a ? b : *c) in new expression parser. * Fix theoretical crash with deleting hooks from /on window. Bleh. * General cleanups in if.c. * Fix /timer -list acting all wacky. * Fix compilation warnings, you know the deal...
* Convert parse_line_with_return() to call_lambda_function().
Convert m_strdup() to malloc_strdup().
* Rename 'dcc()' to 'dcc_cmd()' so we can use dcc as variable
* Garbage collect unused 'irc_path' global variable.
* Add --with-warns to configure to do FreeBSD "WARNS" like compiler checks
* Many hundreds of changes to improve the "quality of code" in epic, including:
* - Treat all literal strings as (const char *) and fix const correctness.
* - Mopping up all remaining const-correctness issues
* - Do not "launder" a (const char *) to a (char *) in string searches, (ala
strchr) but rather return a ssize_t offset value.
* - Particular, MatchingBracket() returns (ssize_t) and not (char *).
* - Eliminate all "shadow" variable names by changing them to something else.
* - Eliminate most function decls that do not include a prototype list.
* - Add prototypes for all extern functions that are missing them.
* - Ensure most function pointers include a prototype list.
* - In term.c, most of those (char *)'s are really (const char *)'s.
* - Explicitly specify 'static' functions as 'static'
* - Ensure every function is either 'static' or has a prototype.
* - Eliminate (unsigned) < (signed) type comparisons.
* Hopefully you should not notice any changes!
Nominally remove all uses of "unsafe" functions: (Commit 506)
* Convert all uses of strcpy() to strlcpy()
* Convert all uses of strcat() to strlcat()
* Convert all uses of strmcpy() to strlcpy()
* Convert all uses of strmcat() to strlcat()
* Convert all uses of sprintf() to snprintf()
* As much as possible, use 'sizeof var' in snprintf/strlcpy/strlcat.
* Qualify the size of some global vars so we can sizeof() them.
* Nuke strmcpy(), strmcat(), strmcat_ue(), strmccat(),
* Change strmopencat() to strlopencat().
* Change strmpcat() to strlpcat().
* Fix switch_hostname so it doesn't return a (const) string.
* Fix TimerTimeout so it doesn't return a (const) Timeval.
* Change things like (ret) to do ret while (0); for when "ret" is "{}".
* Fix initialization for load_level
* Stop passing in static strings into io(), so we can modify them.
* Make messages passed to io() more informative to the user.
* Fix CTCP FINGER handler not to assume (struct pw) strings can be overwritten.
* Use (socklen_t) and not an (int) for socket sizes.
* Don't return a value in a void function...
* Don't use return value of process_dcc_chat_ctcps() for assignment.
* Don't put semicolons after function bodies
* Fix $getopt() to save 'input_size' so we can use it with strl*().
* Convert all uses of stpcpy() to strlcat() and strlopencat().
* Nix checks for stpcpy() in configure -- regen configure.
A lot more cleanup. Namespace scope changing within aliases now works. -wd
Okay. User input is now handled specially, and parse_command() will not accept incomplete command names anymore. -wd
Another merge.
Yikes. Merged to become consistent with HEAD. Sorry for all the commits, I'll be quiet again soon. :) -wd
Commit 443 * Uniformly use 32 bit file sizes in dcc. That's the way it has to be. * Split process_incoming_chat into modular functions. It's an experiment. * Remove the old, #if 0'd dcc_getfile_resume. * Remove the second, redundant warning from /window refnum(_or_swap). * Make the ArgList portion of server messages const. All const! Huzzah! * Roll /names, /list, and /mode numeric handlers into numbers.c * Roll "funny" global variables into server-specific variables * Nuke funny.c and funny.h -- huzzah! * /on window_kill provides two args now, $0 is refnum, $1 is name/refnum. * Rename "numeric_banner" to "banner" * Rename "parse_notice" to "p_notice" * In /xecho, rename 'banner' local var to 'want_banner'. * Revamp p_notice to look like and act like p_privmsg as much as possible. * Finish the rest of the larnifications. Done with phase 1. Huzzah!
Commit 436 This commit is deceptive because it is huge in scope but can be explained pretty simply. * Const correctness improvements. * Invert the meaning of 'new_check_flooding' to return TRUE if flooding. * Revamp funny.c, /list, /names, /mode reply handling. * Remove unused joined_nick, public_nick * Change got_initial_version_28() arguments singly and not an array * Change signature of protocol handling to take "command" as an argument * The above change cascades to a lot of other changes. * Allow the /msg'ing of @W<refnum> to msg a window's refnum. * First round of larnification (Protection against unexpected server data) * This involved substantial rewrites of parse.c, and numbers.c * Now "fake" stuff goes through /on odd_server_stuff. * Fix /on invite so it takes 3 arguments, not 2.
* Add $getserial() function. * Add +|- special serial handlers to /on -wd
Update copyright notices and copyright dates.
No functional changes, just removal of unecessary whitespace at the end of lines. From adm.
* Rolled the $getsets() and $getcommands() code into macros and added $getfunctions(). * Added a server_established hook. This is called before anything is sent to the server, and it is intended that for ssl connections, stuff can be quoted and hooked in plain text until the hook returns, although, it is difficult to verify that this will actually work. * Made it so that when all variables are erased, the low level array that contains the variables is erased. This is intended to make it easier to profile the memory use. * Copyright notice added to perl.c. * Minor stuff for tabkey.ce.
Applied the SSL patch from ay-ar. Details are in README.SSL. This works well at this point, but there may be teething problems.
Fixed a bunch of memory leaks: * In /alias with no args, one leak for each line printed. * If an /on would clober another /on, there would be a leak. * In "/timer -ref xxx", if xxx existed and therefore blocked the timer, there would be a leak. * "/server -d" wouldn't erase the notify list and one or two other things for the server * And the last one I am _not_ sure about. prepare_display() had a leak, however, this does appear to be a work in progress, and the pointer in question points to a strange combination of static, dynamic and alloca() variables. I made the smallest possible patch which seems to work, however, its quality may be questionable.
I put GENERAL_PRIVMSG in the hook.c list twice. Broke everything. Removed.
Ok. ESR asked us to change our manpage. Some of his changes worked, some of them did not. I took the ones that did work. Add /on general_notice and /on general_privmsg. These will be documented in UPDATES -- they are generalized versions of /on (msg*|public*) and /on (notice|server_notice). Break backwards compatability on /on ctcp_reply by changing $* $0 Sender $1 Target [new] $2 CTCP command [Was $1] $3- CTCP Arguments [Was $2-] Everyone i asked wanted this change, so i claim immunity.
The value returned by parse_command_with_return in do_hook is malloced and needs to be freed. Rearranged the code a little to make this clean.
Revert the previous change -- this is a bad time to experiment.
/on topic throws three arguments, not two; fix the numargs value for /on topic in hook.c
Commit #29: * Add /on error, to handle ERROR protocol messages. * Fix /window * toggle, to actually toggle. * Add /defer command, per email on epic list. * New hybrid6 script from is-. * Fix a bug with strlcat() from openbsd via freebsd. * Axe long broken "1 second cursor in window" delay thing. * Repeal the "deferred free" stuff in 0.9.15-10 that wasn't too good. That's it!
Initial import into CVS
Initial revision
| CVS Admin |
Powered by ViewCVS 0.9.2 |