CVS log for epic5/include/ircaux.h |
![]() |
Request diff between arbitrary revisions
* Add a new internal function prepare_display2() a reduced version of p_d(). * Add a new internal function fix_string_width(), the guts of $fix_string() * Fix /set indent to use prepare_display2(). Now you can use ^C codes. yay! * Fix fd leak if fork() fails for /exec. * Fix window toplines so they extend the width of the screen like statusbars.
Fix build (rb zlonix)
* Everything below is from fusion (Alexander Grotewohl) * If libarchive is present, support zip/tar files in /load and $open() * Create a new "epic load file" data type that wraps FILE or libarchive. * Extend uzfopen() to use the new "epic load file" data type. * Extend the loader to honor the new "epic load file" data type * Extend $open() [read only for now] to honor the epic load file data type * Not all operations are supported on zip files. * Add new function $fix_width() returns string with a guaranteed printable len * End of things contributed by fusion (Alexander Grotewohl)
* Add split_string() which converts a general delimited string to (char **) * Add $splitw(delim string) which converts delimited string into a dword list * Use $unsplit() to convert $splitw() into a uword list (see UPDATES) * Fix ./configure --without-ipv6 to allow compiling on opensewer.
* Revert commit 1498 (the dcc stuff) -- it was half baked. * Fix warnings found with --with-warns.
* Commit 1500! * Added function $isutf8(). This function "guesses" whether or not a string is UTF-8, and will return the number of UTF-8 symbols, if it is recognised as UTF-8.
* Fix missing NULL for $hookctl(list ...) [rb howl] * Fix various other issues that valgrind found (yay!)
* Add /lastlog -rewrite (see UPDATES) * Add /set lastlog_rewrite as a special favor for larne.
* Fix it so it compiles without ssl support again. * Add "ALL" $xform() encoder, returns all valid xforms
* Fix happykey(). Sometimes, I just don't pay enough attention. * Don't trim 1 too many chars on incoming encrypted messages. Important! * Fix buffer sizes being too small to hold buffer for enc/dec short strings. * Add $xform() handlers for blowfish and cast5 * Whip the $xform() callback functions into usable shape. * Fix base64 encoding both via $xform() and $b64encode(). * Rewrite $xform(), see UPDATES. Strong crypto now supported! YAY!
* Add arg to panic() controlling whether panic is sent via QUIT (rb black)
* Make the build work with socks5 again, for freebsd ports support * Add malloc_strcat3_c(). * Optimize malloc_strcat_word_c
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.
* Desupport dwords in a lot of builtin functions (see updates) [nullie] * Make /window foo kill fail for want of 'foo' (see updates)
* Fix /whois so trailing spaces don't look like real words. * Change ltoa() to my_ltoa() for hpux's sake * Change finite() to isfinite() for hpux's sake
___ 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 partial implementation of $xform() (see UPDATES) * Add shell of implementation of new_send_text() which i hope to finish... * Fix bug in $b64decode()
* 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.
* 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.
For a little while at least, $stripcrap() acts differently from the /set mangle_* type stuff. This is a work in progress. Please be patient =) * Nix the last vestiges of the unsupported ROM_CHAR feature. * Nix some now unused function decls in screen.h * Add new_normalize_line, which is a unified normalizer/mangler (*gulp*) * Cut over $stripcrap() to use new_normalize_line (*double gulp*) * Rename "ANSI" mangle type to "NORMALIZE", but still accept "ANSI" * Nix the gxlate table, and change ^T from State 4 to State 6 character.
* Fix $stripc() to be a clone of $stripcrap(), just to strip colors * Nix the now unused strcpy_nocolorcodes(). * Fix up read_color_seq() to return an offset, not ptr, a la skip_ctl_c_seq(). * Fix mangle_line() to use read_color_seq instead of skip_ctl_c_seq * Nix the now unused skip_ctl_c_seq(). Only one thing now reads ^C's! HUZZAH. * Rename skip_esc_seq() to read_esc_seq() just because. * Begin moving logic|display_attributes towards a change model system * Begin a radical change on how characters are given "state" (see source) * Basically 8 bit chars (except c1 chars) are treated as "always printable" now * Mangle a few other callers to logic_attributes, i'm sure these are b0rked.
Add configure glop for intmax_t for c90 systems. Will start using later.
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 "UNPRINTABLE" as a mangle type, remove all non-printable chars.
* Fix up how relative filenames are found with /load. See UPDATES * Add ascii_str[n]icmp and rfc1459_str[n]icmp for use with alists. * Make nick+channel name lookups handled according to 005 CASEMAPPING!
* When a window is resized, make sure scrollback is bigger than new size. * Add multiple stricmp tables, "ascii" and "rfc1459" * Make all string insensitive compares use "ascii" * Add black's ornamentation on the addset script. * Fix some regression scripts * Fix pf bugs with various scripts. * Add the [$func](args) capability to the new math parser. * Add the === and !== literal equivalence (case sensitive) operators. * Sort of set the case sensitive mapping to use in the 005 handler (hack!) * Fix error recovery of ssl connections.
* 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.
Fix $sar() and $msar() so the "new" string can contain the "old" string as part of it (which before this commit infinitely substituted until failure)
* 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 $winquery() and $hookctl(), written by howl.
* Add a bunch of stuff to debug the who_queue to find and fix adm's bug.
* Minor changes to dcc loss processing and the commandqueues script. * Applied Howls shebang patch.
* 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.
* Add the rest of funcs to do builtin var support in unified symbol table.
* Change the unified data type for builtin funcs to (IrcVariable *).
* Implement "buckets", for O(N) scans of the unified symbol table.
* Change DEFAULT_USERINFO to DEFAULT_USER_INFORMATION to match the /set.
* Make the *_VAR stuff in vars.h 'int's.
* Change USER_INFO_VAR to USER_INFORMATION_VAR to match the /set.
* Change CLIENTINFO_VAR to CLIENT_INFORMATION_VAR to match the /set.
* Change STATUS_NICK_VAR to STATUS_NICKNAME_VAR to match the set.
* Put the defn of (struct IrcVariable) in vars.h, to expose to unified table.
* Convert all uses of now defunct (enum VAR_TYPES) to (int)
* Create "make_string_var_bydata", converts (IrcVariable *) to malloc string
* Change get_var_alias() to return (IrcVariable *)
* In that function that outputs set values, use make_string_var_bydata().
* Change hardcoded *_VAR uses into pointers to *_VAR, for deref at runtime.
* Major revamp of vars.c, to wholly create built in vars at runtime.
* Built in variables are stored in unified symbol table and vars.c xref array.
* *_VAR values now point through xref array to the actual variable data.
* Nix the now unnecessary get_variable_index().
* Add create_user_set(), backend for /SET -CREATE
* Add /SET -CREATE <name> <type> [{<code>}]
* Need to go back and implement the {<code>} thing.
* Revamp how /set works, using buckets, to implement auto-completion.
* $getsets() is not implemented yet, do that too.
* When looking up $<setname>, use the unified symbol table. HUZZAH!
* 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.
Merge changes from epic4 commits 674 to 692, inclusive.
* Be careful what modes we add to modestr in update_channel_mode. * GC some old epic4 macros which we don't use * Fix a typo that b0rked /on server_status * Force output for a server connection to go to its connected window. * Make /server reset server's status, so it can be reconnected to.
* 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 *)
* Assimilate notice.c into parse.c. *poof* * Fix some compiler issues and so forth * Nix the NOTE level. * Move load_ircrc() to irc.c, nix "startup_file" global var.
Make 'empty_string' (const char []). Now we're cooking with gas!
* 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.
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.
* 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.
* 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 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.
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.
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!
Commit 527 New ignore implementation. I will document all this stuff tomorrow. As it stands, I've tested this for several days and all seems well. Of course let me know if you see any problems.
It is better to use (ssize_t) instead of (int) when refering to string lengths.
Commit 519 * Change m_strcat_ues_c to take a (char *) "unescape" param and not (int) * Rename m_strcat_ues_c to malloc_strcat_ues_c * Rewrite malloc_strcat_ues_c to support new semantics. * Make sure not to pass 0 to alloca() in ctcp checks * Initialize (DCC)->server [found by valgrind] * Change 'expand_alias' so 'unescape' is (char *) and not (int) * Add extra sanity checks in mangle_line against buffer overruns * Fix window_channel() to use new malloc_strcat_ues() arguments.
* 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 509: * Move /DCC from commands.c to dcc.c * Nix the "dcc deadlist" crap. Handle deleted dcc's more sensibly now. * Add a "dequote" internal function that removes "s in extended words. * Add "QWORDS" as new arglist type, for quoted-words with "s left in. * Add "arglist" regression test. * Fix strlcpy() in compat.c so it doesn't walk off end of string. * Implement more sensible "locking" mechanism for dcc's * Nix the nominally unimplemented "encrypt" feature for dcc * Create "dcc_create" to create dcc entry * Remove "creation" functionality from "dcc_searchlist" * Nix global variables 'filesize' and 'global_family' now unneeded. * Change order around of arguments to "dcc_searchlist". * Rename "dcc_opened" to "dcc_connected" since that is what it does. * Add "dcc_garbage_collect" which looks for dcc's that need removal. * Add "get_dcc_by_filedesc" and "get_dcc_by_refnum" to look up dcc's * Add "lock_dcc" and "unlock_dcc" to prevent dcc's from being GC'd. * Double check that all output that occurs in dcc.c goes to LOG_DCC * Use dcc_open in dcc_raw_listen() instead of doing the network stuff directly. * Allow "booster ctcp" to be sent for dcc chat re-offerings. * Reorganize register_dcc_offer() so it doesn't create dcc until all is well. * Reorganize process_outgoing_file() into sub-functions. * Don't call "dcc_dead" or "dcc_check" in main io() looper. * Fix new_next_arg_count() to use real_move_to_abs_word() to emulate $1 usage
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.
* 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.
Another merge.
Whooo! I'm on a roll! Commit #487
* Add /timer -delete_for_window <winref> to delete window's timer.
* Enhance my_strerror() to take an EPIC Network Error and an errno.
* Enhance Getaddrinfo() to use AF_UNIX path as 'path' not 'host'.
* Confirmed that $match("\\[s s1 "s *"\\]" "s s") works like it should now.
* Store a "current window priority" number in each window.
* Add get_winref_by_servref() returns highest "priority" window for a server
* Have /defer track server, use server's "current window" (per above)
* I'd like to have other things use this, like maybe /xeval -s.
* Explicitly set "mask" to 0 in cs_alist_hash(), so it is initialized * Change type() to typecmd() to avoid name conflicts. * Change 'dot' to 'dotlocl' to avoid name conflicts. * Change 'op' to 'reduce' to avoid name conflicts. * Fix a typo in the error message from /window kill. * Add a panic to detect larne's recent bug that I fixed, just in case. * Constify the "path" argument to uzfopen(). * Make sure return value of strlen() is assigned to a 'size_t' not an 'int'. * Split load() into load() and load1(), load1() reads a file opened by load(). * Now load() is "interpretation-free", and load1() can be replaced. * Fix various minor compile-time issues. * Change %P status line expando to give more useful information.
Yikes. Merged to become consistent with HEAD. Sorry for all the commits, I'll be quiet again soon. :) -wd
* Updated $wordtoindex() to obey "/xdebug extractw".
* Altered the default FLOATING_POINT_PRECISION from 6 to 16 which fixes a math bug. * Melded a count argument into next_args and new_next args to cause a specific number of words to be returned. * Rewrote the /alias xxx (args) form of /alias to avoid using extractw and to use *next_args_count instead. * Tuned the call.xtrace alias in debug.irc. * Extended $is_on() in guh to allow and return multiple arguments. * Added $is_off() as a compliment to $is_on(). * Made a minor philosophical change to the way flood detection works: A message is not counted as a flood if it is the first message in a flood. The most important impact of this is that rate calculations are more accurate.
Documented /exec features.
Note: The -line* switches for the %proc mode are new and haven't been
commited yet.
* 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.
* Implement top-of-minute handling in a system timer * Eliminate top-of-minute handling from io(). * Eliminate CPU_SAVER stuff for the time being. * Change time_to_next_minute() to return a (double) not (Timeval)
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.
* Remove /set suppress_server_motd which didn't really work anyways. * Add function decls for bsd_arc4* to ircaux.c * Always check (window->hold_mode || window->autohold) together! * Unhold_window()s only if both hold_mode and autohold are off! * unhold_window()s instead of doing scrollback_end for robustness. * Attempt to recover from the "output is below bottom of window" bug, whine.
* 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!
* 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().
* Fix expand_twiddle to take a (const char *) * Fix do_log and set_log_file to take a (const char *) * Remove a couple of no-ops in keys.c * Revamp do_log into two parts; open_log and close_log; do_log now a wrapper. * Fix a string that had a newline in it. spotted by Szabolcs Rumi.
* 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.
* Add Getnameinfo(), front end to getnameinfo() takes GNI_INTEGER for DCC use * Fix inet_ntostr() to use Getnameinfo() instead of getnameinfo() directly. * Fix inet_ntostr() to return int for success/failure, not hostname. * Fix the DCC handshake generator to use inet_ntostr(). * Fix callers of inet_ntostr() to handle integer return values.
* 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.
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.
* Fix for an SSL problem where SSL fails to negotiate. It will bail to non-encrytion in this case now. * Fix for splitw() which is used by $uniq() and other functions where some of the elements could be null pointers due to its use of new_next arg. This would cause qsort() to coredump. Switched to safe_new_next_arg which seems to have a performance penalty of about 4%. * Added an "OTHER" flag to $stripcrap() and the mangle settings, which catches all characters that other flags don't. It isn't included in the ALL flag.
Remove the (now) obsolete decl of inet_aton() in ircaux.h. Reported by genok.
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.
Functionally complete the protocol independance of DCC. There are no more ISA's in server code or dcc. To phrase that differently, every IPv4 assumption in the server code or dcc has been identified and conditionalized. Adding support for ipv6 is now simply a matter of adding the conditionals to make it happen. Now we need to test what we have here and see how badly i've broken things. The only remaining IPv4 customers are /WINDOW CREATE (which is likely to stay ipv4 only for the time being) and $iptolong() and $longtoip() which clearly are IPv4 only concepts.
Move the transition macros into ircaux.h. Migrate the server over into protocol independance. That was pretty painless. If you're reading this with rapt attention, please understand that 'protocol independance' does not mean "multi-protocol support". What it means is that instead of using (struct sockaddr_in)s, we're using (struct sockaddr_storage)s, and we conditionalize all IPv4 specific code to work only on (struct sockaddr_storage)s whose family has been set to AF_INET (ipv4). Once total protocol independance has been acheived, adding support for IPv6 will be a matter of adding conditionals to handle it in the same manner IPv4 is already supported. So the current project i'm working on is the protocol independance of epic. Multi-protocol support comes later.
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!
Yet another swath of changes in The Great IPv4 Cleanup. This time I took a broad hatchet to the resolver-assistant functions in network.c. Using modern techniques really increases readability and makes it look less like a hack. Making good progress!
Next round of in_addr/u_short -> sockaddr_in conversions, along with some other minor details. As far as i know, this shouldn't break anything, but I don't promise that. Save your old binary first! If anything is really bad, let me know. I'll fix it ASAP.
Comment the danger of using LOCAL_COPY in a function call argument list. Since this is only a comment change, commit_id is not incremented.
This is my first go at supporting embedded colons in server specs. You can use double-quoted words now in your server spec. Man, I Hope this doesn't break anything (famous last words). Here's an example: /server /tmp/.ircd/6667::"tmp:pass":hop:groovy Would add "/tmp/.ircd/6667" as a server, with the group "groovy" using the nickname "hop" and the password "tmp:pass", all without the double quotes, of course. Using double-quotes to surround arguments like this will protect colons inside from being mistaken. I would like to support backslashed colons at some point, but since backslshes are perfectly legal nickname characters, I can't see a way to do this without hackery. :/ I added a "findchar" function in ircaux.c to find the next instance of a character that isn't backslashed.
Thanks to wd for this patch, which: * Breaks part of figure_out_address() off into figure_out_domain(). * Fixes /ignore and $mask() such that they don't munge the given address inappropriately. I have compared $mask() behaviour with previous versions to confirm that it works, which would tend to imply that the main guts are all working, but nevertheless, figure_out_address seems to be particularly delicate so there may be problems.
* Added a url encoded message switch to /xquote, designed with socks proxy scripts in mind. eg: "xquote -u $urlencode(ISON xxx)%0a" works. One problem with this is that the last command works, and can be used to get around the built in barriers for such things. Is this good or bad? * -- and any other invalid option will end /xquote switch processing now. * Added $servergroup() and $serverourname(). These were copied from $servername() and behave in much the same way, differing in their return values.
This does precisely nothing at this point except, perhaps cause compilation to fail. It is necessary for external encryption, to come later. It adds exec_pipe which forks a sub process with a given list of args, feeds it a given input on stdin and returns stdout as one big string.
Hurried patch. This rolls back the $read() patch for now.
The beginning of the migration away from 'time_t's towards 'struct timeval's. This first round of support is very rough and may have some issues, which I will be happy to fix (or you can fix them yourself if you want), but it is more proof-of-concept work for now. I don't expect that I will migrate *everything* to struct timeval, just the important stuff. I have not made any serious attempt to optimize this yet and please don't jump the gun and start optimizing this until I've got the bugs settled out. Thanks. =) Oh yes, I almost forgot the good part -- /timer now has highly accurate sub-second timer resolution. This means you can do /timer 0.82 echo test and it will go off in exactly 0.82 seconds. No more "approximate" timers! The traditional restrictions about timer execution (timers do not go off while another timer is executing, and while you are /wait'ing) still apply.
* 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.
More complete support for random local ports; /set random_local_ports now cooperates with /setenv EPIC_USE_HIGHPORTS=1, and it works on freebsd, openbsd, and linux, such as it is.
Two patches applied, aka, the string and perl patches.
The perl patch adds perl support via three perl functions.
The string patch:
* Rewrites new_realloc to more closely resemble new_realloc in its
interface, and in that it calls realloc directly.
* Adds an argument to the 3cat functions that permits it to seek
directly to the end of the string. Designed to improve performance.
* Alters a few things to use the above.
* Tunes a few other string functions in ircaux.c.
* Rewrites $uniq() for performance reasons.
* Removes the part of $jot() that preallocates the string. I feel a
little guilty about this somehow though it seems to have absolutely
no effect on performance anymore.
Add the /for <var> in (<list>) {<commands>} command
Add the /for <var> from <min> to <max> {<commands>} command
Implement "break_args" that breaks argument lists to commands to an array.
Implement "skip_spaces" which skips leading spaces in a string.
This is commit #46, isn't it?
Implement the "delayed free" queue, a dynamically sized holding area for pointers passed to new_free() that will be free()d whenever we are about to return to the main() function. This obviates the "pointer on the stack" crashes, at the expense of not being able to have crashes tell us when we have a pointer on the stack. ;-)
Initial import into CVS
Initial revision