CVS log for epic4/source/screen.c |
![]() |
Request diff between arbitrary revisions
* 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.
* Add /on signal (pegasus) * Fix /set indent if /set continued_line contains ^C stuff (pegasus)
Last material change to epic4! (hopefully -- cross fingers) * Fix wording of default messages for 347 and 349 numerics. * Fix column alignment for /timer list. * Fix add_to_window() to stop runaway recursion through /set output_rewrite. * Fix bug in expand_alias() -- all output must be privileged_yell()! * Change /on send_to_server so it can't be hooked recursively.
* Fix color bleeding with color changes in middle of long words that wrap. -- This was reported by blackjac. It's a bug that occurs if you do a color change in a very long word that ends up wrapping to the next line. If there are no more attribute changes ni the next line that it wraps to, then the line after *that* (the third line) will get the attributes at the end of the 1st line instead of the attributes at the end of the 2nd line.
Flush all of the small bug fixes i've been sitting on.
You know, there is really no excuse for me to make mistakes like this. This is just a very bad start to the day...
I really should be drawn and quartered for this. When I reverted my previous bad patch, I accidentally reverted too much. Put back code that made it into epic4-2.0. I am *such* a dork.
This should NOT have been commited. Back it out.
Add /xecho -f for howl Add a timer dump for "stuck in a polling loop!"
* Make the output-window-searcher ignore from_server for LOG_DCC * Make status_hold and status_hold_lines use scrollback numbers too. * Make add_to_scrollback() redraw status bar if output while scrollbacking.
Fix typo after i told nsx the bug couldn't possibly be becuase of a typo. (nsx found the way to reproduce the bug so he did all the hard work here)
* Fix a possible logic hole in ok_to_output() * Fix memory leaks found by valgrind.
* 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.
Expound a few panics to help track down a bug.
* 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.
* 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!
* Add "ON/OFF" toggle set variable to the system timer data. * Create 'update_system_timer' which uses the "toggle" var to run or stop timer * Merge '(start|stop)_system_timer' into 'update_system_timer' * Nix #define MINIMUM_(NOTIFY|CLOCK|MAIL)_INTERVAL since we can't stop that. * Do not enforce minimums for /SET *_INTERVAL since user could get around it. * Track "last event" time, maybe I'll use that in the future * Reset "now" global variable before calling timer callback. * Fix null deref bug with $($$) * Add default binding to ^G to "self_insert" for beeps. * Do not enforce MINIMUM_NOTIFY_INTERVAL in do_notify() * Don't include exec.h from screen.c * Add 'number' (floating point) field to /set's * Add FLOAT_TYPE_VAR type for /set's, using 'number' field * Update all the /set entries to include a default 'number' field. * Add get_float_var() to get the 'number' field in a set. * Add set_float_var() to set the 'number' field in a set. * Teach set_variable() about FLOAT_TYPE_VAR sets. * Teach save_variables() about FLOAT_TYPE_VAR sets. * Teach get_string_variable() about FLOAT_TYPE_VAR sets.
Commit 556 * Change #define DEFAULT_CPU_SAVER_EVERY to 60, it needs not be 0. * Create 'clock.c', to hold clock generation, system timers, cpu saver watchdog * Create notion of "sys(tem)timers", callbacks for mail, notify, clock gen. * Add 'system_timer', generalized callback for all of the system timers. * Fix add_timer() so the 'command' argument does what the docs say it does. * Extern 'timer_exists' so we don't try to remove_timer() and invalid timer * Redo dependancies because clock.h exists. * Add code to bootstrap mail systimer with /set mail * Add code to bootstrap clock generation with /set clock * Add code to bootstrap notify handling with /set notify_interval. * Start enforcing "NOTIFY_INTERVAL" again in do_notify() to avoid excess flood.
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
Convert m_strdup() to malloc_strdup().
* Rename 'dcc()' to 'dcc_cmd()' so we can use dcc as variable
* Garbage collect unused 'irc_path' global variable.
* Add --with-warns to configure to do FreeBSD "WARNS" like compiler checks
* Many hundreds of changes to improve the "quality of code" in epic, including:
* - Treat all literal strings as (const char *) and fix const correctness.
* - Mopping up all remaining const-correctness issues
* - Do not "launder" a (const char *) to a (char *) in string searches, (ala
strchr) but rather return a ssize_t offset value.
* - Particular, MatchingBracket() returns (ssize_t) and not (char *).
* - Eliminate all "shadow" variable names by changing them to something else.
* - Eliminate most function decls that do not include a prototype list.
* - Add prototypes for all extern functions that are missing them.
* - Ensure most function pointers include a prototype list.
* - In term.c, most of those (char *)'s are really (const char *)'s.
* - Explicitly specify 'static' functions as 'static'
* - Ensure every function is either 'static' or has a prototype.
* - Eliminate (unsigned) < (signed) type comparisons.
* Hopefully you should not notice any changes!
Nominally remove all uses of "unsafe" functions: (Commit 506)
* Convert all uses of strcpy() to strlcpy()
* Convert all uses of strcat() to strlcat()
* Convert all uses of strmcpy() to strlcpy()
* Convert all uses of strmcat() to strlcat()
* Convert all uses of sprintf() to snprintf()
* As much as possible, use 'sizeof var' in snprintf/strlcpy/strlcat.
* Qualify the size of some global vars so we can sizeof() them.
* Nuke strmcpy(), strmcat(), strmcat_ue(), strmccat(),
* Change strmopencat() to strlopencat().
* Change strmpcat() to strlpcat().
* Fix switch_hostname so it doesn't return a (const) string.
* Fix TimerTimeout so it doesn't return a (const) Timeval.
* Change things like (ret) to do ret while (0); for when "ret" is "{}".
* Fix initialization for load_level
* Stop passing in static strings into io(), so we can modify them.
* Make messages passed to io() more informative to the user.
* Fix CTCP FINGER handler not to assume (struct pw) strings can be overwritten.
* Use (socklen_t) and not an (int) for socket sizes.
* Don't return a value in a void function...
* Don't use return value of process_dcc_chat_ctcps() for assignment.
* Don't put semicolons after function bodies
* Fix $getopt() to save 'input_size' so we can use it with strl*().
* Convert all uses of stpcpy() to strlcat() and strlopencat().
* Nix checks for stpcpy() in configure -- regen configure.
* 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.
Okay. User input is now handled specially, and parse_command() will not accept incomplete command names anymore. -wd
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.
* Fix bug that caused cursor to go wacky on screen < 32 columns. * Fix 464 handler to only prompt for password if we're not registered yet. * Fix bug that made ^C,,, slurp up all ,'s after it.
* 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.
* Reorganize param list to dgets() to include a length argument * Add (set|get)_server_line_length(), the maximum size of an irc protocol line. * Convert dgets() callers to the new calling style.
Oops. fix a typo.
64 bytes of slop is no longer enough to work with a "logically denormalized" string. (it was before Attributes). 192 bytes is plenty for now.
* $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
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.
Fix all the rest of the compile issues. bleh.
* 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'
* 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...
Uncripple CPU_SAVER mode. yea!
Fix bug where /window delete caused 100% cpu usage Add /log level which I overlooked. Oops.
Ach. Here goes nothing. Major commit which does many things, but the most prominent of which is the final integration of the scrollback buffer with the hold buffer. This fixes several annoying "features" and introduces a small truckload of new features which have been requested recently. Please see the KNOWNBUGS or UPDATES file for more info, since I don't want this message to be ridiculously long.
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.
New keybindings system coming through. Details can be found in doc/keys and in a few other places. :) -wd
* Applied MaXxX's patch which readjusts the mirc to ansi colour translations. In particular, the colours for ^c5 and ^c7 have been swapped, and the bold/flash values have also been tuned. * Re-integrated support for /set term_does_bright_blink. If this is on, bright backgrounds which are not normally supported by ansi terminals will be given the blink attribute instead, which many/most xterms normally translate to bold.
Update copyright notices and copyright dates.
Add the commit_id to /version, requested by adm Fix an obscure bug that caused an abort() in the attribute code. This was found/reported by fudd and was caused when the first line of a multi-line output contained an attribute change but no space.
No functional changes, just removal of unecessary whitespace at the end of lines. From adm.
Unbreak /window create for the time being. I'm not real wild about this solution. I'll look into it later.
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.
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!
It seems like a no-brainer, but 'lines' needs to be set to 0 before calling prepare_display(). Who knows what odd things might happen if we don't. This bug was found by da5id using solaris.
Fix two bugs regarding the output handler: 1) (Reported by |rain|) -- If an attribute change is found in the MIDDLE of a word, and that word is wrapped from one line to the next (ie, it is the word that is wrapped), then previously, epic was thinking that the attribute was already turned on at the end of the previous line and not in the next line. Anyhow, every time we mark the "word break" position, save the current attribute set -- THAT is what we want to "bleed" into the start of the next line. 2) Speaking of "bleeding", output_with_count() wasn't doing a term_all_off() at the end of the physical line, which permitted attributes to "bleed" onto the next line's /set continued_line value, which is DEFINITELY the wrong thing to do. Fix output_with_count() to turn off all attributes at the end of every line to prevent this "bleeding".
Fix some compile errors if you're weird enough to #undef WINDOW_CREATE.
Various compiliation warning fixes. No meaningful changes.
Fixed a bunch of memory leaks: * In /alias with no args, one leak for each line printed. * If an /on would clober another /on, there would be a leak. * In "/timer -ref xxx", if xxx existed and therefore blocked the timer, there would be a leak. * "/server -d" wouldn't erase the notify list and one or two other things for the server * And the last one I am _not_ sure about. prepare_display() had a leak, however, this does appear to be a work in progress, and the pointer in question points to a strange combination of static, dynamic and alloca() variables. I made the smallest possible patch which seems to work, however, its quality may be questionable.
The whole ROM_CHAR thing was an accident waiting to happen. Removed. Add /SET ALLOW_C1_CHARS to protect from the ascii char 128-159 attacks upon XTerm and GNU Screen users. Defaults to OFF.
Thanks go to crazyeddy and zinx for working on this in my absence. Add /set rom_char (defaults to off) which determines whether ^R rom_char sequences will be honored or dishonored by epic. Dishonored sequences are not removed; they are just mangled. This will help you detect those who might try to use this feature for less than noble purposes. Re-set the ^R character to "mode 5" processing; it had been set to "mode 6" as a stop-gap measure.
Disabled ROM characters entirely due to its insecure nature and its limited value. To be removed entirely at a later date. The code may be useful for UTF-8 later on.
prepare_display() was appending an ALL_OFF to the end of the last line, but that's not the right thing to do any more since ALL_OFFs have been converted to Attributes before calling prepare_display(). Anyhow, append a zero-valued Attribute at the end of the last line in place of the ALL_OFF -- reported by fudd.
In at least one place, we might use an Attribute before it has been initialized. Just make sure we always start with empty attributes any time we put one on the stack.
A next_char() was out of place, causing a buffer overrun. Oops.
character 18 (the ROM_CHAR attribute) had a put_back() call that was missing its corresponding next_char() call, resulting in an infinite loop. Crazyeddy pointed this out to me.
* Fix $printlen() -- must call normalize_string() before output_with_count()! * Make 'add_to_window' and 'window_disp' static to screen.c again. * "Fix" /WINDOW ECHO to not call add_to_window() but rather use "to_window". Commit #150
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.
Honor attribute markups in /set continued_line Save the attributes at the line-break point and reset them after we have pressed the /set continued_line in the next line. This means that having color/bold/whatever in your continued_line won't "cancel out" any color/bold/whatever you had going on in the text. The continued_line markups end at the end of the continued line text.
This is the new highlight/attribute renderer. It is a "true renderer" because it actually renders things to look like what you say. No longer does turning on some attributes (color) turn others off, nor does turning some off (bold) turn others off. Some things may break with this, please let me know, or feel free to pitch in and fix them. Zinx will be happy to know that i did NOT use the epic5 "prepare_display" routine because he was right, i did totaly break it. I used the epic4 prepare_display function but just made it aware of the new attribute stuff.
Resizable wserv support! No, really! Backported from epic5. I have to go through term.c again and make sure there are no unintended casualties of the merge. We should also start testing the resize handlers to make sure they're happy. I don't promise they'll all work first time, but this is a good place to start!
Implement the "redirect sink", which instead of sending all output to another irc server, drops the output entirely. This is used by /flush (which is now safe to use again) and can be used by the user via /redirect 0 to execute a server query but suppress it's output.
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.
Use FD_CLR to prevent multiple hits on a file descriptor between select calls. Discovered by Q when he was testing the 010 redirect handler.
Initial import into CVS
Initial revision
| CVS Admin |
Powered by ViewCVS 0.9.2 |