CVS log for epic5/source/lastlog.c |
![]() |
Request diff between arbitrary revisions
Fix all the compile warnings that I let go way too long.
* Add /lastlog -window for fusion.
* 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.
* Add a bunch of functions to move lastlog items between windows. * No way for the user to use them yet (still thinking about it) * Add $windowctl(NEW) and $windowctl(NEW_HIDE)...
* Refactor all lastlog stuff to use a global lastlog buffer. Yay! * Comment out per-window lastlog stuff
* Add a "rejects" variable to str_to_mask() * Make str_to_mask() shut up. Callers should handle error output * Create a standard_level_warning() handler callers can use. * Make the consumers of str_to_mask() handle their own error messages. yay!
Fix a bug for larne.
* Add /lastlog -rewrite (see UPDATES) * Add /set lastlog_rewrite as a special favor for larne.
* Add arg to panic() controlling whether panic is sent via QUIT (rb black)
* Fix warnings found by gcc4 and run make depend. * Add check for -Wno-pointer-sign to configure; makes using gcc4 less painful.
* Fix bugs with 'builtins' (zlonix) * Revamp the term_init() function, document, etc. * Unconditionally turn off IEXTEN, IXON, IXOFF, to reclaim all of the chars that kernels steal from us (like ^S, ^Q, ^O, ^V, etc) * Whack the -f/-F/-o/-O command line options; per above. * I can now bind and use ^S and ^Q and ^V. Yay! * Fix initialization of ruby, so it actually works for the first time! YAY! * Refactor how lastlog is trimmed, by removing a specific item * Start working on code to remove items from lastlog by grep. * Fix crashes with /stack push set that kitambi told me about * Put in a trivial sleep when checking screen size to avoid race with screen.
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.
___ WARNING ___ This stuff is all wildly un(der)tested. I will get to that soon! But I'm too excited about this to sit on it. * Add AESSHA256 support (AES256 using the SHA256 digest of your passkey) * Rename "EXTCRYPT" to "PROGCRYPT" * Migrate SED support from crypt.c to crypto.c * Integrate SED and extprog support into the mainline [de]cipher_message() * Refactor [de]cipher_message() to be less lame. * Support "anycrypt" support (AESSHA, AES, BLOWFISH, CAST5, SED, PROG) * Include sha256 implementation from Karll. Thanks Karll! * Unify the ctcp handling of all crypto ctcps * Add $sha256() function to test sha support (digest) * Make funcs in crypto.c static and just expose [de]crypt_msg(). * This finishes the divide between crypt.c (front end) and crypto.c (back end) * Fix a gazillion compiler warnings and sort out const/unsigned char issues.
* Add /set mail_type (MBOX or MAILDIR) to control what we check for mail. * Make rebuild-scrollback a toggle flag instead of an operation. * Teach update_all_windows() how to rebuild scrollback * Write some preliminary code for the unified lastlog
* Lay the foundations for nonblocking ssl connection (not supported yet) * Change SEND_LINE to do SCROLL_FORWARD if we're in scrollback mode * Add support for maildir mailboxes. * Fix crash with 042 numeric.
Make a header file for external lang support to cut down on the number of 'extern' decls we have inside functions. Clean up warnings and stuff.
Make ruby support work with ruby-1.6.4.
* Check for <ndbm.h> in configure, don't do DBM if it is absent. * $dbmctl() always no-ops, returns empty string if dbm not available. * Add 'd' to $info(o) if DBM support is included * Add a check for solaris cc, moxy up the CFLAGS for larne. * Fix compile breakage if both tparm() and base64() are missing. doh. * Fail when maximum number of levels have been added. * Note a few places the window refnum is changed.
* Switch users of LEVEL_CRAP to LEVEL_OTHER. yay! * Whack some unused functions and decls, make *toa() funcs return const. * Roll get_window_by_name() into get_window_by_desc(), it's only user.
* New file, levels.c, holds all the Mask and window level manip stuff. * Move level_to_str/str_to_level, mask_to_str/str_to_mask to levels.c * Change #define LEVEL_*'s into (int)s * Use BIT_VALID() instead of NUMBER_OF_LEVELS, whack NUMBER_OF_LEVELS. * Whack hardcoded level_types char array. yay! * Change users of "LEVEL_CURRENT" into "LEVEL_NONE" and whack "LEVEL_CURRENT" * Add "OTHER" window level, as replacement for "CRAP" * Continue to honor "CRAP" as a synonym for "OTHER". * New function $levelctl(), to add/query window levels. * Window/lastlog levels can now be added at runtime. HUZZAH!
* Fix /away -all so it doesn't error on gaps in server list (weirdo) * Fix bogon in /xecho. doh. * Fix /who -real so it matches both with and without the hopcount. * Convert all uses of message_to() to message_setall(). yay!
* Nix some func decls in windows.h that don't exist any more * Add message_setall(), lets you save to_window on the message_from stack. * Replace users of message_to() with message_setall(). * Replace direct users of to_window with message_setall(). yay! * /XECHO got rewritten as part of this. See UPDATES * Fix various compiler warnings.
* Change all the builtin functions to use new_normalize_string(). * Change the input prompt to use new_normalize_string(). * Add /set mangle_display. HUZZAH! * Change the display stuff to new_normalize_string() and /set mangle_display * Whack the now unused normalize_string(). HUZZAH! HUZZAH! HUZZAH! * Change the seperator of the mangler-type-parser to be spaces and not commas. * Start keeping a monotonically increasing refnum for all lastlog items * Change add_to_lastlog() to return the lastlog refnum * Change add_to[_window]_scrollback]() to take the lastlog refnum * Cross-link scrollback items with the corresponding lastlog refnum. * Save scrollback/hold position across scrollback rebuilds * This means rebuilding doesn't affect scrollback/hold users! HUZZAH! * Whack the now unnecessary /window auto_scrollback (mis)feature. * Don't unconditionally unclear after rebuild, if everything still fits.
* Add the idea of a "visible" and "invisible" lastlog entry * Always skip "invisible" lastlog entries, handle them when trimming, etc. * Rename remove_from_lastlog() to trim_lastlog() and have it do looping * Unconditionally keep every item in the lastlog, even if it's "hidden". * When screen changes width, purge+recreate all window's scrollback * Add /window rebuild_scrollback to manually invoke this process. * For now, auto-recreate unholds all, and cancels scrollback * Add /window auto_scrollback to opt-out of auto-recreate feature * Store each window's width individually, don't refer to server * Use each window's personal width to re-break lines (more on this later) * Fix so "/window lastlog foo" doesn't delete your lastlog!
* Include <stddef.h> if we can, for no particular reason... * Nix now unused mangle_line(). yay! * Use (intptr_t) instead of (intmax_t) to treat pointers as integers... * Try to handle failures from the dns helpers with more grace.
* Convert the other users of mangle_line() to new_normalize_string (*gulp!*)
Round 1 of an attempt to support 64 bit ints without breaking the build for systems with only 32 bit ints (ie, vms). I will phase in support for c99's "intmax_t" and hacks for backwards compatability "soon".
* Add /lastlog -mangle to permit you to match against mangled lines.
Fixed bugs caused by me being a dork.
Permit /set -new_server_lastlog_level and /set -old_server_lastlog_level which prevents epic from changing the window's level when you're connected to a server or when a level collision occurs after a /server. Use these with caution, I don't know what might happen!
* Keep timestamps along with lastlog entries. * Add $line(<num> -TIME), return the timestamp when <num> was added to lastlog. * Remove some #define's from config.h that are not referenced any longer. * Remove #define QUIT_ON_OPERATOR_KILL because 1 line of script defeats it.
* 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.
* Make $getsets() work again. * Fix alloca() warning for freebsd-current * Fix warnings about static variables not used * Fix /set notify_level, which is supposed to cascade to /window notify_level * Fix /set lastlog_level, same thing.
* Make stripcrap(ALL) exclude "ALL_OFF", so I can... * Fix bug with $stripcrap(ALL,-BOLD ^B^B^Btest). (rb BlackJac) * Make the #define Char const char thing global to all of epic now. * Whack /set scroll. * Create a "/set data" type (VARIABLE) which is union of (int) and (char *). * Expose VARIABLE and variable types in vars.h for others to use. * Break init of /set's into two parts, one to malloc() the set data * The second part is to init the default values once command line is done. * Fix some warnings from --with-warns * Fix all /set callbacks to accept a (void *)(VARIABLE *) variable * /Set callbacks can now directly modify the /set via that variable! * So don't allow direct setting of /set's from outside vars.c. * Everybody must use set_var_value() which is the backend to /set. * Whack the /IRCNAME and /REALNAME variable -- use /SET REALNAME, eh! * Hack up /xecho -x to bide my time until i whack all those /sets it uses. * Don't call set_input_prompt() in main() any more, it's handled elsewhere. * Whack /set logfile callback, since nobody seems to have missed it. * Whack the "number" (float) data in /set since i wasn't gonna use it. * Whack the "GLOBAL/CHANGED" tracking in /set's. Tell me if you miss this. * Unify output of /set values as "[New|Current] value of <var> is <val>" * Don't limit the size of /set continued_line, this will be revisited soon. * Quick and dirty hack to work around adm's bug, will fix this later.
* Add /set old_server_lastlog_level, for when you merge windows to servers.
* Add %{2}W status expando for black, shows /set status_window in all windows.
* 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.
GC a bunch of useless cruft and stuff.
* Move Lastlog definition to lastlog.c, leave stub behind for window.h * Add window_all_channels(), return all windows for channel from names.c * Change boolean vartype for windows and status: int -> short. * Add do_short_boolean(), like do_boolean(), but it takes a short. * Make the default server quit message "Leaving" * Have /window describe show all the channels in a window. * Have /window describe show nicks, channels in flat list, not one per line. * Make sure to use the server's default quit message when closing it. * Create a prototype of atoll() for compat systems.
* Make dcc connections ($connect, /dcc get, /dcc chat) nonblocking * /DCC RESUME is totaly broken by this. Will fix later, maybe ;-) * Add $startupfile(), which returns the epicrc/ircrc file that was loaded * Offer unknown ctcp requests through /on ctcp_request before /on ctcp. * Fix /window level none and other such breakages (adm)
* Reduce the size of level masks to 1 byte, to save cpu. * Add turn_on_level() and turn_off_level(), for reasons that escape me. * Nix the /help command, make howl's scripted replacement the default. * Add $cofilter() entry so you can use it (it was already written)
Well, at least it compiles again, but I think i still need at least one or two sweeps of the code to make sure I got everything proper.
DOES NOT EVEN COMPILE DO NOT USE DOES NOT EVEN COMPILE DO NOT USE DOES NOT EVEN COMPILE DO NOT USE DOES NOT EVEN COMPILE DO NOT USE More work in progress DOES NOT EVEN COMPILE DO NOT USE DOES NOT EVEN COMPILE DO NOT USE DOES NOT EVEN COMPILE DO NOT USE DOES NOT EVEN COMPILE DO NOT USE
*********** DONT RUN THIS -- IT'S WORK IN PROGRESS -- DONT RUN THIS *********** * Import epic4 commits 674 through 692, inclusive. * Import epic4 commits 693 through 710, inclusive (epic4-2.0 final) * Change _X and _Y macros to LEVEL and LEVELMASK for linux (sigh) * Add a searchbuf() 8 bit clean byte-finder for future use. * Convert flood checking, ignore checking, lastlog, logfiles to int masks. * Convert message_from to int masks. *********** DONT RUN THIS -- IT'S WORK IN PROGRESS -- DONT RUN THIS ***********
Const correctness madness!
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.
* Fix /lastlog <number> for kanan.
See KNOWNBUGS
* Add /set wserv_type, either "xterm" or "screen". * Add malloc_strcat_word_c, add a single word to word list, with "" support * Convert a bunch of stuff to use malloc_strcat_word_c to honor ""s right. * GC a bunch of unused code.
* Revert all uses of LOG_CURRENT to LOG_CRAP * Change all uses of message_to(0) to message_to(-1) * Fix show_help() to not change to_window, it doesn't need to care about that. * Fix help_put_it() to not change message_from, doesn't need to care about it. * Fix /lastlog to use message_to(0) to send all output to current window. * Don't make output of /log go to current window -- no point to that. * Teach add_to_screen() to honor from_server's current window for LOG_CURRENT * And for /set current_window_level as well * Fix message_from() not to save/restore lastlog level, doesn't need to care. * All of this pretty much nukes LOG_CURRENT except for /window, HUZZAH!
Fix some bugs that can be attributed solely to a total lack of testing on my part. I'm rather embarrased about this.
Teach all the /set callbacks to take a (const void *). This fixes a bad-c problem with /set!
* Rework the bug report form to point people to the bugs website * Add /lastlog -target.
Overhaul of malloced string handling functions: * Convert m_[s]c3cat[_s]() to malloc_strcat_wordlist_c() * Nix m_e3cat(), m_s3cat(), m_s3cat_s(), m_3cat() * Nix m_ec3cat(), m_sc3cat(), m_sc3cat_s(), m_c3cat(). * Convert m_dupchar() to malloc_dupchar(). * Convert m_strndup() to malloc_strndup(). * Make malloc_strcpy/malloc_strcat/malloc_strcat2/malloc_strcat_wordlist macros * Convert m_2dup() to malloc_strdup2(). * Convert m_3cat() to malloc_strcat2[_c](). * Convert m_3dup() to malloc_strdup3(). * Convert m_ec3cat() to malloc_strcat2_c() * Use strlcat_c() in $repeat() instead of strlcpy(). whee! * Sanity check first arg to $regcomp(), to avoid crashes. * Don't pass NULL to bsearch(), even if 'nmem' is 0 [$remws()] * Nix the original malloc_strcpy (supplanted by malloc_strcpy_c) * Comment out all the deprecated functions
Convert m_strdup() to malloc_strdup().
Cut over m_sprintf() to malloc_sprintf().
* 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.
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 #427 * Add -l<tcl> to the front of $LIBS so -lm can come after it * Look for SSL stuff in default location before hunting for it in /usr/local. * Reset $withval after check for perl so --without-perl doesn't --without-tcl * Make first arg of cvtchar() a (const char *) to silence warning. * Move 'this_sucks' label to a place where it is legal. * Make check_val() cope with NaNs and INFs more graciously... * Fix null deref with /lastlog -c * Update the input line in set_update(), not the caller * Do update the input line when redrawing status * Change make_status() to return a success/failure value. * Don't clear the "status line wants redraw" flag if redrawing status fails. * Nuke the now unecessary "in_window_command" global variable. * Fix bug where <scrollback> + <scrollforward> left you in scrollback mode. * Force init of Window->lines_held = 0 even though that shouldnt be needed.
* Added functions $asciiq() $chrq() $exec() $timerctl() $tcl() $winline() and $floodinfo(). * Altered the two argument version of $read() to ctcp quote the strings it returns. * Added sets FLOOD_RATE_PER and FLOOD_MASKUSER. * Altered the "accept" mode of the dcc_raw and dcc_connect hooks to refer to the local port instead of the remote port. * Added a "-closein %proc" switch to /exec. * Altered the arg list mode of /alias to use extractw instead of next_arg. * Added the documented "words" argument to the above. * Tuned autoget, mudirc, tabkey.ce and commandqueues. * Altered /pretend to not chop the string. * Set about rewriting the flood detection and then decided that it's better off being a script. * Moved the function macros to their own file (functions.h) and replaced all the copies that are strewn throughout the source with an #include. The exception is array.c which broke when I tried it. * Moved the ctcp enquoting/dequoting functions to ircaux.c. * Added some command/function ordering checks to funcs/regress, and a check for all the functions that are undocumented. * Rewrote function chanmodetype() so that it doesn't have all those flakey buffering things. Hopefully it's readable now. The significant change is that if a mode character appears twice in CHANMODES, the first one is returned instead of the last. * Added EPIC::call() in the perl routines and an equivalent under tcl. this is designed to call a $function() directly, but it isn't really that fast, so I might rip them out again. * The /wait internals used to store a few other settings, which were taken out, so I put them back. * Fixed a few problems with normalize_filename() around the place. * Fixed a bug with /timer in which it would never show the timers after a callback.
Make /lastlog -context work more like grep -<number> Requested by starfox.
Update copyright notices and copyright dates.
Fix "make installscript" Fix /lastlog so that the header/footer use "numeric_banner" instead of fetching /SET BANNER so that /SET BANNER_EXPAND is honored. This requires that 'lastlog.c' include 'numbers.h' This requires a 'make depend' Minor nitpick in output.c
* Enhanced flood checking to keep records based on userhost rather than nick. Not designed to catch clones but to make it harder to avoid. * Flood checking keeps its time in microseconds now, which _may_ make it a little hyperactive on occasions. * Small re-arrangement to find_array_item() to make it slightly faster. * Terminology fix in /alias /s. * Added $regmatches() which works exactly like $regexec, but returns pairs of numbers which can be applied to $mid() to extract the matched strings and substrings from the original string. It also takes a new second argument indicating the maximum number of subexpressions to return. * New -file option to /lastlog. If given, all output will be written to the file rather than the screen. file_put_it() may be questionable. * $channel() will return "h" in the op field if the user is a half-op.
I was passing in the *normalized* string to the lastlog stuff, which was definitely a bad idea. Now i pass the raw string to window_disp and then pass the raw string onto lastlog and log, and so on, so that they don't get broken. I *will* be changing this again, but this is a stopgap fix for now.
/lastlog wouldn't accept levels correctly.
Start documenting some of the stuff in 1.1.1. Change comments for /lastlog to reflect recent changes. Once I finish the "KNOWNBUGS" file, unless there are any issues i am made aware of, I will release epic4-1.1.1 as an alpha release.
I made two goofups here: /LASTLOG <num1> <num2> -- I switched the meanings of <num1> and <num2>. <num1> means the number of entries to look at, and <num2> is the number of entries to skip. I had that reversed. The other goofup is that i had <num1> counting from the oldest entry, but it's supposed to count from the newest entry. That makes me wonder just what good <num2> is for. Probably because I goofed that up too. Oh well. That's a battle for another day. Found by Xavier.
Fix some compile warnings -- things are getting in shape!
* Miscelaneous 3cat updates.
* History expansion copies the history buffer verbatim now.
* Bugfix: /!0 would not retrieve the first command entered.
* Bugfix: Negative numbers not found would be display the
incorrect number in the error message. eg: /!-4444
* Alterations to remove_trailing_spaces interface.
* $igetrmatches() was defined, but inaccessible.
There was a bug in my lastlog loop that didn't show the most recent item put in the lastlog. Fix this.
Fixes to /lastlog -context.
Two things: * Remove /set notify_handler which didn't do anything. * Rewrite /lastlog so i understand how it works. Big new feature, -regex, to support regex searching on lastlog! * Commit #75.
Initial import into CVS
Initial revision
| CVS Admin |
Powered by ViewCVS 0.9.2 |