CVS log for epic4/source/functions.c |
![]() |
Request diff between arbitrary revisions
* Fix brain-o -- AC_MSG_RESULT is not the same as AC_DEFINE, dummy. * Add $regcomp_cs() from epic5 as a special favor to blackjac.
* Move "term.h" out of the way so we can #include <term.h> (mv'd to termx.h) * This makes it possible to avoid empty decls for tparm() * Which is supposed to fix the build for larne on who-only-knows-what. * Rename tparm() to my_tparm(). * Do a make depend since i changed the name of a header file. ugh. * Change the name of (struct term) to (struct my_term) for freebsd sake. ugh.
Fix the build on systems without intmax_t/strtoimax().
* I made an oopsie. $tobase() should *now* support negative integers!
* Backported functions $strtol() and $tobase() from EPIC5. Request from |Rain|. See UPDATES for more information.
* Add support for maildir mail boxes, which must be selected at compile time.
* Fix space-related panic. See UPDATES for all the gruesome details. * Add ALT_CHAR to the list of things that can be mangled.
Flush all of the small bug fixes i've been sitting on.
Fix many errors using realpath() and normalize_filename().
* Document the material changes we made to the release candidate. * Fix a few compiler warnings since we've already made changes. * This is the second release candidate. * The vote will not be restarted.
Fixes and new features as per KNOWNBUGS and UPDATES.
* Fixed $shuffle*() to respect extractw. * Altered $rest() so that a negative first argument makes it a compliment to $right() in the same way that a positive arg makes it a compliment to $left(). This may conceivably cause problems for scripts. * Spruced $joinstr() up a bit. It now accepts any number of variables and respects extractw. * Fixed an extractw bug in malloc_strcat_word_c while testing the above. * Added $splicec() in functions script. * Added /set dcc_dequote_filenames. Perhaps this should default to off?
* 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.
Fix some issues with $numlines()
* The last argument to open_file_for_write() needs to be lowercase. * Add $numlines() from fudd. EPIC4-1.2.3!
* Fix /window query, it was a victim of larneproofing. Ooops! (Bugref 6) * Hook in $windowctl(), just for fun for now. * Enclose a few more dcc outputs in the target nick context.
* current_window_priority should be global variable * Valgrind is my hero -- fix buffer underruns with mangle_line(). * Make the "current input window" its server's current window on user input.
From previous commit... * Fix urldecode * /lastlog -msgs 3 is obliged to skip back 3 msgs, not just 3 lastlog entries. * Fix warnings in gailib.h From this commit... * Fix some const correctness issues * Make message_to() take an (int) and not (unsigned) so we can pass in -1. * Fix some arglist regression tests to reflect new extractw semantics. * Fix uninitialized variable in ok_to_output() that caused panics.
Fix $hash_32bit(), reported by q.
* Fix panic with $joinstr() * Fix compiler warning comparing pointer against integer * Fix word appender to NOT USE DOUBLE QUOTES if /xdebug extractw is off! * Fix the word appender so it actually works right.
* Numerous updates/changes/fixes to DCC, functions, scripts, /EXEC, the new math parser, as per UPDATES and KNOWNBUGS. One potential incompatibility is in the change to $open(). (as per UPDATES)
* 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.
Commit 610: * Use the server's message in our default 330 output. * Make $numwords() use count_words() as a test. Looks ok so far... * Make $indextoword() use count_words(). * Implement regression tests for $indextoword() * Any further problems with $indextoword() should add regress tests! * Make epic behave like ircII when doing /window create with screen and X. * Make move_to_next_word() stop when it hits a trailing nul, duh!
Implement "privleged yells" which allow syou to do /set debug 7 at the same time as /set output_rewrite. Yea~!
* Add $servernick(<global>) to return the client's global nickname * Update tabkey.jm to latest version * Add new ircII-compatable /window hold_mode thingee. * Add /set hold_slider, /window hold_slider * Add 'hold_mode' script, implements ircII-like /set hold_mode[_interval] * /XEVAL -- ends eval option processing, like how /xecho does it.
Fix $servernick()
Add $servernick(<global>) which returns the client's global current nickname.
Fix panic for $push(:foo )
Fix bug 5 -- panic when you do $push(:foo ) [and $unshift() too]
Teach all the /set callbacks to take a (const void *). This fixes a bad-c problem with /set!
* Fix time functions to take (const Timeval) if they don't change the arg. * Create a special handler for /squit to avoid sending QUIT * to server. * Protect some IPv6 stuff i added recently to dcc with #ifdef INET6. Ooops. * Hack up $repeat(<num><space><space>) so it works again. ugh. * Hack up /set <variable><space><space> so it works again. ugh. * Dont allow /timer -repeat -1 0 because that busy-loops. * Add shell of $windowctl() which will be filled in going forward.
Commit #555: * Add #define MINIMUM_CLOCK_INTERVAL and MINIMUM_MAIL_INTERVAL in config.h * Add #define DEFAULT_CLOCK_INTERVAL and DEFAULT_MAIL_INTERVAL in config.h * Add reset_system_timers(), do_update_clock(), and set_cpu_saver_after() * Add time_to_next_interval(), general form of time_to_next_minute(). * Add get_clock() and reset_clock() to replace update_clock(). * Make remove_timer() an extern function so i can delete timers. ;-) * Add /SET CLOCK_INTERVAL and /SET MAIL_INTERVAL * Make $T use the static clock. * Reorganize system timers 1 and 2 into four timers: * - CPU SAVER timer, checks for idleness, to turn on cpu saver * - CLOCK timer, updates the status bar clock periodically * - MAIL timer, checks for new mail periodically * - NOTIFY timer, checks for others on irc periodically * The above three honor "cpu saver" mode. * Nix the old "do_every_minute" timer. * Reorganize the clock generation stuff into "reset_*_clock" functions * Generate the clock statically; only update it from the CLOCK timer * Add reset_system_timers() which regenerates all four system timers. * Don't set system timers in main, call reset_system_timers() instead. * Don't enforce "notify interval" in do_notify(), handle that in NOTIFY timer. * Comment stuff in words.c
Commit 552 * Fix a couple of compiler warnings from freebsd-5 * Revamp move_to_prev_word() so its behavior isn't stinky * Same thing with move_to_next_word(), and they need to be commented. * Now move_to_abs_word() doesn't need to skip leading spaces. * Remove now pointless "strip extraneous spaces" feature. * Don't worry about cheating in real_extractw * Fix last_arg() per all of the above
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().
* Add some new functions to ircaux.c for malloced string handling * Fix some const correctness issues.
Fix some stragglers and GC unused m_sprintf() function. Fix $serverwin() which was doing a bogus check on server refnums.
Cut over m_sprintf() to malloc_sprintf().
Commit 541
* Move #define CTCP_* into ctcp.h
* Add /xdebug extractw_debug
* Move #define LOCAL_COPY and SAFE into irc_std.h
* Create compat.h, move all the compat.c decls into there (from ircaux.h)
* Create network.h, move all the network.c decls into there (from ircaux.h)
* Create words.h, move all the words.c decls into there (from ircaux.h)
* Include "compat.h" and "network.h" in ircaux.h
* Do another round of make depends
* Rename 'search' to 'search_for'.
* Fix the metric clock hooking /on timer too much.
* Revamp words.c, to support passing word quoter (' or ") as an argument.
Metric clock support!
$levelwindow() was supposed to take a server refnum as the first arg. Ooops. Fix this. I'll update the docs.
Commit 528. Let us never speak of this commit again.
COMMIT 523 Add $serverwin().
* Misc bugfixes as per KNOWNBUGS. * This patch involves renaming crypt.h to sedcrypt.h.
* 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!
Commit 512 * Add $levelwindow() * Change default for /set new_server_lastlog_level to ALL,-DCC to prevent multiple servers having level dcc until i figure out why the code to handle this isn't working. This value is more sensible anyways.
Add $outputinfo(), to help the scripter know what the output level/target is. Garbage Collect some now unused code.
These are relatively minor changes except for the $prefix() fix. * commandqueues as per UPDATES. * $prefix() fix and regression test as per KNOWNBUGS. * /exec and nick rolling as per KNOWN bugs.
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.
* DCC chat fixes as per KNOWNBUGS. * $stat() fixed for tildes. * Misc tabkey.ce cleanups.
* New /set, /SET SWITCH_CHANNELS_BETWEEN_WINDOWS * C language issues (const correctness, integer size correctness) * Revamp channel structure to hold window refnum and not window pointer * Add "current channel counter" to channel structure. * Determine "current channel" by election. * Garbage collect a lot of now unnecessary code. * Add get_echannel_by_refnum(), returns window's "elected" current channel * Add internal function is_waiting_for_channel() * Add internal function move_waiting_channel() * Add internal function get_winref_by_bound_channel() * Add internal function get_bound_channel_by_refnum() * Convert uses of get_channel_by_refnum() to get_echannel_by_refnum() * Fix $winbound() to work when given a window refnum * Fix valgrind issue with $regcomp() * Remove sanity checks from traverse_all_channels(); handled elsewhere now * Change traverse_all_channels() with "this server" or "not this server" arg * Nuke (Window *)->current_channel. Handled by channels now. HUZZAH! * Implement /ON SWITCH_WINDOWS again.
A lot more cleanup. Namespace scope changing within aliases now works. -wd
* $fsize(), $fexist() and $stat() now take an empty first argument as an indication that the rest of the line is the full filename. * tabkey.ce can now complete for commands that have commands as arguments such as /eval and /repeat.
Another merge.
* Make /LOAD locate and open file arguments; and a generic handler * Create loader_which() which a /LOAD handler for /WHICH command * The standard loader is now called "loader_std" * Add an empty next-generation loader called "loader_pf" * Add "loader" info to "load_level" data; It's $2 in $loadinfo(). * /LOAD now takes -std and -pf arguments to specify which loader you want.
* Add extra slop for logically attributed denormalized display strings * Const-ify a few Timevals, just for good measure. * Don't hardcode use of AF_INET in dcc.c, rather use a global variable for it. * Use "global_family" var to pass hint what socket fam to use. AF_INET for now. * Add extra sanity check just in case window->screen goes NULL in status redraw * Fix several benign compile-time issues. * Reword a few previous entries to fit onto one line.
* $dccctl() changes as per UPDATES. * Misc bug fixes as per KNOWNBUGS.
Yikes. Merged to become consistent with HEAD. Sorry for all the commits, I'll be quiet again soon. :) -wd
Whee. Preliminary work is done. I've converted things to use hash tables instead of alists (if this doesn't work out, I'll go back to alists). Namespaces exist, but are not yet addable. That will come. I'm very sure things are still a bit unstable, but the absolute basics of adding variables/functions and executing/retrieving them works. That was my first milestone. -wd
* Whoops, damaged space quoting in $glob*(). Found by NSX.
* "Word Philosophy" alterations, /alias leak, flood checking, $glob(),
tabkey.ce, regression tests, autoget, /fe, /fec, safe_new_next_arg, as
per KNOWNBUGS.
* $findws(), functions (script), ${i}finditems(), $dccctl(), as per
UPDATES.
Fix $winbound(), reported by Joe Eversole.
Commit 459 * Add back support for $mychannels(#winref) * Fix null deref with /LOG KILL * Ignore KICKS based on the victim as well as the kicker.
More conversions in irc.c to handle strings-to-winrefs.
* Docs say that $info(o) includes 'g' if $glob() is available. Add it.
* Revamp $win(serv|size|chan|bound|level)() to use get_window_by_desc.
* Revamp $win(screen)() to use get_window_by_desc.
* Use get_window_by_refnum(0) and not 'current_window'
* Allow a \ to escape a space where spaces would be stripped.
* Above bug fixes things like switch ($foo) {(foo\ ) {...}} to work.
* Add handler for /on 330, "user is logged in" numeric in ircu.
* Don't honor/ignore "#" in a window name/refnum. This was lame anways.
* Fix is_window_visible/get_window to use get_window_by_desc().
* New aliases for script/functions as per UPDATES. * A tentative solution for the $glob() problem as per KNOWNBUGS. * A leak fix for /list as per KNOWNBUGS. * $timerctl() tuning as per UPDATES.
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!
* Added Tyraks /stack patch as per KNOWNBUGS. * $afterw(), $beforew(), $fromw(), $tow() as per UPDATES. *potential bug* * Regress tests as per KNOWNBUGS. * ERROR hook fix as per KNOWNBUGS. * autoget script as per KNOWNBUGS. * $serverctl() as per UPDATES. * $writeb() as per UPDATES. * /sleep as per UPDATES.
Fix $glob() and $globi() to call expand_twiddle() and not normalize_filename() Globs (or anything that has a wildcard) must not be passed to normalize_filename() since it obviously can't normalize something that is not an actual bona fide filename.
* Fixed a leak in /window channel. * Fixed a couple of leaks in /server -d. * Added $finditems() but it isn't finished yet, so it's #ifed out.
* Remove colon at end of RETURN_MSTR so it is like others. * Unify dgets() and SSL_dgets() * Add a 4th argument to dgets(), an (SSL *) for ssl reads, NULL for normals * Integrate SSL stuff more tightly by removing unecessary #ifdef's * Change 'enable_ssl' to 'try_ssl' to avoid confusion with 'ssl_enabled' * Remove uneccesary members of (Window) * #include "functions.h" in any file implementing built in functions. * panic if ssl op attempted on non-ssl connection. * Don't call functions in RETURN_* macros. (they're evaled twice) * Nuke #ifdef 0'd uses of 'ceiling_of_display'
Fix $winchan()'s two-argument format, due to an incorrect test. Found by crazyeddy.
* Use server_list_size() and not number_of_servers outside of server.c * Use NOSERV and not -1 for "no server" * Use (Timeval) and not (struct timeval) * Fix (get|set)_server_sent_*() et al to take server refnum. * Use parse_server_index() and not my_atol() to parse server refnums * re-indent quotecmd * Rename is_server_connected() to is_server_registered * Make /quote work as long as server is open (not registered) * Use send_to_aserver() when it can avoid setting from_server unecessarily * Change sent_to_server and clear_sent_to_server to (set|get)server_sent(). * Change doing_* to get_server_doing_*. * Use (unsigned short) and not (u_short) * Use (unsigned long) and not (u_long) * Make output_reject_ctcp() take a refnum * Lock a dcc while we are connecting it, just in case. ;-) * Fix /dcc send -p <port> * Store protocol enforcements as (get|set)_server_protocol_state(). * Use (Stat) and not (struct stat) * Rewrite $timerctl() so it works like $logctl() * Rename is_server_connected() to is_server_registered() * Fix an off-by-one error with /FOR ... IN ... * Keep track of both readable and writable fd's with newio stuff. * Convert server_list to an array of pointers * When user /server -delete's, leave a gap, don't change refnums around. * Nix code that handles deleting server refnums. * New function, new_open_for_writing(), for when we do nonblocking connects. * Change new_open() to deregister fd as "writable" * Renovate the notify stuff to take refnums and not just use from_server. * Renovate /WHO, /ISON, /USERHOST to take refnums and not just use from_server. * Make everything that uses server_list[] use get_server() instead. * Make everything capable of dealing with "gaps" in server_list[]. * Use a bunch of macros, to handle with getting and setting server attrs. * Make as much as possible use refnums as params and not from_server. * And a lot of other stuff...
* Fixed $glob() and $globi() to expand twiddles again.
* 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.
* Add $getserial() function. * Add +|- special serial handlers to /on -wd
Another round of epic5 changes... * Make $B, $., $,, $:, $;, $I, /WAIT stuff server specific, from epic5 * Make tracking of doing_(privmsg|notice|ctcp) server specific, from epic5 * Fixes for Const Correctness.
Backport some changes from EPIC5... * Fix /WINDOW NAME so it takes extended-words (/window name "foo bar") * Add 'get_geom_by_winref()' for $geom(), 'const'ify a few things... * Fix $geom() so it can take a window refnum as an argument. * Replace $center() with a better one from epic5.
Add $joinstr() and let $jot() work on floating point variables.
* Add checks/workaround for linux's broken realpath(). Bleh. * Add arc4random stuff to compat.c -- will be used later! * Fix $realpath() to use normalize_filename() so it gets realpath() fix. * Add $serverctl(SET <refnum> PRIMARY) to set primary server. User beware!
* Experimental fix for $indextoword(), worked out with fudd.
* Change expand_twiddle(), path_search() to take results as params, int retval * Add normalize_filename(), to do job expand_twiddle() used to do. * Add isdir(), just because * Change /CD, /LOAD, /SAVE, /DCC SEND, /DCC GET, to use normalize_filename. * Change /DCC RESUME, $open(), $which(), $unlink() to use normalize_filename. * Change $rename(), $rmdir(), $fexist(), $fsize() to use normalize_filename. * Change $glob(), $globi(), $mkdir(), $chmod() to use normalize_filename. * Change $ftime(), $randread(), and uzfopen() to use normalize_filename. * Change /LOG, /SET LOGFILE, servers file to use normalize_filename. * Fix /LOG so maximum number of targets per log is a compile time #define. * Revamp expand_twiddle() and uzfopen(). * Fix uzfopen() to look for 'bunzip2' in addition to 'bunzip'. * Fix bug with /QUEUE -delete * Remove unused variable in window_scroll().
$logctl() and $log10() were backwards in the function list.
Commit the current /LOG command and $logctl() function. These are nowhere near ready to be used at this point. I am still working on them, but this is good enough if you want to take a look at it. THINGS WILL STILL CHANGE FROM THIS POINT. DON'T BE USING THIS YET.
Cleaned up a few -Wall warnings.
* /exec leak fix for -line, -part, etc.
* /for var from x to y step z will work for negative z now, but for bug
compatibility, you must use a negative step to actually make this work.
* Local variable tweaks.
* Fixed $word() to not discard words after a "".
* /userip now uses the internal queue, if the server supports it via the
USERIP 005. Otherwise, it will send the command directly to the server.
The problem with this is that to avoid the internal cache returning the
users address, you must use -direct. This needs to be fixed.
* Karll Array overhaul. Removed certain performance traps for very large
arrays, which have very large numbers of like items, and made it such
that arrays can be in an unsorted internaly until the time that they
need to be sorted, when a quicksort is called on them.
* Added two new functions to deal with this: $usetitem() and
$delitems(). These work like their similarly named counterparts, but
leave the array unsorted, and generally perform better.
* Any function which uses indexes or performs a binary search on an
array will cause the array to be sorted.
* For the most part, extended functions to allow for additional
item/index args. $getitem(array $getmatches(array *cat*)) will
return the contents of all items that have the character sequence
"cat" in them. $getitem(array2 $getmatches(array1 *cat*)) will
act much like $copattern().
New keybindings system coming through. Details can be found in doc/keys and in a few other places. :) -wd
Allow you to $killpid(0 <pid>) for liandrin.
* Added support for CHANMODES, PREFIX and CHANTYPES in the processing of modes. If the server doesn't support these, then hopefuly sane default strings are chosen, and these _don't_ include the wacky extensions that have been added over the years, so conceivably, this could break things like halfops and ban/invite exemptions. * Stored the UMODES field from the 004 numeric in the server data. Can be retrieved with $serverctl(get x umodes). * Altered "/msg @$fd" so that $fd must be a number, otherwise, it will be treated as a privmsg. * Added $xdebug() which returns all single bit flags with + or - added as appropriate. /xdebug $xdebug() is a no-op. * Fixed an /xdebug bug in which - would cause all subsequent flags to be switched off. For bug compatibility, it still works this way, but you can specify + to turn all subsequent values on. * Altered m_sc3cat_s() to call m_sc3cat rather than m_c3cat, which results in a cleaner string. Examination of the uses of this function showed that they all dealt with this bug in some way. * Altered $which() to call path_search() directly, rather than uzfopen(). It may be useful to add a flag to path_search indicating which attributes we are searching for. This could cause problems since the old method would skip over a file if it wasn't readable. * Added clue variables for $unsplit().
Fix some compile warnings. Nothing to write home about.
#ifdef INET6 a bunch of uses of AF_INET6.
Update copyright notices and copyright dates.
* Added 005 framework. The internal interfaces to this are get_server_005() and set_server_005(). The scripting interface is $serverctl([gs]et [ref] 005 [set] [[value]]). Unsetting is done by setting a null value, and $serverctl(..set..) will return 1 for set or 0 for unset. All values are reset upon successful reconnect. * Altered $rand() to be more conservative when drawing on the random data source. It should be faster for lower max-values now. * Altered $splice() somehow. I think it was for the clue variables. It didn't improve the speed due to other problems, but it still works.
I'm going to start sweeping the entire source, adding the official copyright notice to each file (like ircII does already), and making sure that the /* $EPIC$ */ thingee is at the top of the file. This is my first swath of files.
* Merged in another /fe fix I was brewing.
* Altered new_next_arg to not truncate the arguments list if the argument
taken happened to be empty. This fixes bugs with /fe and $shift() where
the list has "" arguments.
* Gave malloc_strcat and m_strcat_ues a clue variable and used it within
the variable expansion routines so that expanding works in liner time.
* I am a little bothered by this. The _correct_ thing to do is to put
the clue variables into the malloc data for the strings themselves
like perl does.
* Moved the base structure for 1cmd in command queues from last.qcmd. to
1cmd.
* Added command completion to tabkey.ce.
* Applied a patch from NSX which fixes a problem with the last commit that prevents the inital server connection working. Other things also commited: * Fix for ODD_SERVER_STUFF so that it will never have a blank server field. * fixed $chr() to not have input size limits, however it still cores on random data. I'll fix this later. * Fix for get_time() in the case of HAVE_GETTIMEOFDAY being undefined. I forget who this was from. * Minor method addition to tabkey.ce.
* Allow $listen() to take a family argument, like $connect(). * Add some V6 macros in ircaux.h, modeled after V4 macros. * Add a "family" member to the dcc structure. Default to AF_INET for now. * Start fetching ports by calling inet_ntostr() instead of peeking directly -- into the sockaddr. This yields protocol independance. * Fix bug where $listen() or /dcc send w/o a virtual host caused NULL deref.
Due to the way the new attribute parser works, mangle_line needs a destination buffer that is at least eleven times as large as the original string. Change all uses of mangle_line to pass in 11 times as much as necessary. This avoids uneccesary truncation of input lines with excessive attribute changes in them.
Remove the second argument to inet_ntostr(), [socklen_t of the first argument] because the socket length of the first argument can be inferred directly from the first argument and passing in the length is totaly unecessary. Changes to callers of inet_ntostr() per above change. Change connectory() to call Getaddrinfo() directly and to iterate over all of the returned addresses until it finds one it likes. This change permits epic to automatically detect/support IPv4 and IPv6 server connections without user intervention. make Getaddrinfo(), Freeaddrinfo(), socklen(), Accept(), and Connect() all static functions.
functions.c references 'sys_siglist' which may be declared in "sig.inc", so provide for "sig.inc" to be #include'd if necessary. Reported by da5id.
Back out work-in-progress changes that leaked out in functions.c from commit 294.
Fix $printlen(). How come nobody ever told me about this before? Reported by is, but he can't remember who told him about it.
Oh, nothing important, just make $connect() support ipv6. ;-)
Lots more work on the ipv6 front. Remove the last of the vestiges of the old historical address handlers (inet_ntop/inet_pton/inet_aton/inet_ntoa). Now everything, and I mean EVERYTHING goes through inet_strton and inet_ntostr which are just fancy front ends to getaddrinfo() and getnameinfo(). Quite a bit of EPIC is already family-independent, but there is still some left to be clubbed into submission. The project to add support for IPv6 is now about 75% complete! Perversely enough, the only thing stopping DCC from being essentially 100% IPv6 capable is the inability to send an IPv6 hostname through a handshake without breaking the standard...
Fix some function names that I didn't like after sleeping on them. Add extra argument to inet_ntostr() which is passed to getaddrinfo().
OK. So i had some inspiration and decided not to go to bed. Vastly simplify the conversions between sockaddr/host/p-addr to sockaddr/host/p-addr. More simplifications yet to come. IPv6 support is roughly about 50% done now.
Huge major commit #1 in the great IPv6 support addition... Rather than include all of the changes here, read KNOWNBUGS changes.
* Fixed $numsort() to be case insensitive. Since the effort was made to get it to cope with text, this kinda makes sense, however, it may not exactly be consistant with my_stricmp since it uses libc's tolower(). I guess the correct way to do this is to add my_tolower() which taps the same structures. I'll do this if it's necessary. * Removed the var array initialisation code in /fe since the code doesn't rely on it being initialised. * Made the /fe code calculate the size of said array directly. As far back as I can remember, compilers have been doing math with constants at compile time, so this shouldn't effect performance at all, although, it's probably better being a macro. * Changed the "Invalid user mode referenced" panic into a warning, and enhanced its readability. Trying to find which server did what invalid mode when you're connected to many of them is a little difficult.
Add $killpid() for Liandrin. I have no idea if this works or not. Want to test this for me? ;-)
Make $connect() protocol independant. This requires changing dcc->offer to a (struct sockaddr_storage) and requires changing dcc_open and even register_dcc_offer. Much progress being made on the protocol-independance of DCC. Somehow I doubt IPv6 will ever come to DCC, but it's nice to at least say that we'll be prepared when it comes...
* Convert more (last?) inet_ntoa to inet_ntop, and inet_aton to inet_pton. * Fix bug with $convert() (one_to_another) * Try to make /window create only bind to 127.0.0.1.
Fix those three annoying functions in network.c that use static local variables, making them non-reentrant and fraught with peril. Now they require you pass in space to put the results.
This is a huge monster commit -- I put the particulars of the commit in KNOWNBUGS. I will only say here that this fixes a lot of issues with DCC and introduces a lot of protocol independance into the networking API that epic works with. Good things will continue to come in the future!
The last round of changes for tonight. More of the same... I promise! I'll document the user visible parts of this soon! Really! =) I mean it!
Update /INFO, year in startup message Fix compile warning in function_get*().
* 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.
Fix $isnumber(.) to return 0, because fudd asked me to.
Fix a couple of legacy ircII bugs with regard to $M and $P and so on. The bug is that the mode/op status is checked for (current_window->current_channel, from_server) when it should be checked for (current_window->current_channel, current_window->server) because obviously "from_server" is not always