From mouse Fri Feb 22 14:41:29 2008 Return-Path: Received: from localhost (localhost [[UNIX: localhost]]) by Sparkle.Rodents.Montreal.QC.CA (8.8.8/8.8.8) id OAA18079; Fri, 22 Feb 2008 14:41:29 -0500 (EST) From: der Mouse Message-Id: <200802221941.OAA18079@Sparkle.Rodents.Montreal.QC.CA> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Erik-Conspiracy: There is no Conspiracy - and if there were I wouldn't be part of it anyway. X-Message-Flag: Microsoft: the company who gave us the botnet zombies. Date: Fri, 22 Feb 2008 13:07:00 -0500 (EST) To: mouseware Subject: Two new programs, and a mass update I've added two new programs. One is ccwrapper, which is just a moving into /local/src of something I've had for a long time - a wrapper to cc that provides the necessary options to make it pick up the /local stuff. The other is mcsh. This is my shell. The whole history would be a rather long tale (which I'll be happy to go into if anyone is interested, to be sure), but the upshot is that I recently converted it into changes to the NetBSD csh, and, as a result, it is as redistributable as NetBSD's csh. I'll talk more about it below. I've also updated a bunch of stuff. Here's a blow-by-blow, including an outline of ccwrapper and mcsh. Some of these speak of "nested function stuff". I use nested functions heavily, but there is an issue with how to declare/define them. Under 1.4T, the compiler wanted them declared static for a function with no prior prototype, or auto for forward declarations and the definitions of forward-declared functions. Under 3.1, static produced an error, and I went with auto. Under 4.0, I've been unable to find anything that doesn't upset -Wmissing-prototypes -Wstrict-prototypes in the absence of a prototype, even though those options are documented as applying to global functions, which nested functions aren't. So I'm going with no modifiers, hacking on other things as necessary to make this work. I've got hacks in the 1.4T and 3.1 compilers for this, and intend to do likewise for the 4.0 compiler - I really wish the gcc people would stop changing their minds about how nested functions should be declared and defined. But in the meantime, some of the code still has static, some auto, and some nothing; all nested-function declaration and definition changes driven by this are listed as "nested function stuff". c-publish 1.5.4 - Typo fix in a comment. - Nested function stuff. ccwrapper 20080216 New. Runs cc with options to make it find the /local stuff. Also filters cc's output some (see the manpage and/or the code). compare 20080214 - Better build-on-Linux compatability. - Nested function stuff. copytolog 20080217 - Nested function stuff. count 20080219 - Manpage typo fix. - Nested function stuff. - Add missing include. - Bugfix related to -random. halign 20080217 - Better wording in manpage, some fixes to match reality. - Nested function stuff. lcs-cvt 20080219 - Include for compatability with other systems. - Nested function stuff. libmd5 20080217 - Nested function stuff. libsha 20080217 - Nested function stuff. livebackup 20080202 - Update CHANGELOG. - Sort lists of .o files in the Makefile. - Work around yet another instance of encoraching namespace pollution. - More verbose debugging output, available with -DBLATHER. - Better debugging output in some other cases. - SIGUSR1/SIGUSR2 to lb believed working now. - lbd crashes on SIGHUP believed fixed. - Improve commenting. makefiles 20080219 - Add -- to mkdep command line. - Make VFLAG default to "" instead of -V. mcsh 2.0.9 New. My shell. This is stock NetBSD csh with some changes. The most notable is command-line editing a la sh's "set -o emacs" or tcsh or any of many other such things. The editor is philosophically like emacs in that it binds keystrokes to functions (via keymaps, which are now multi-keystroke sequences are handled). Besides the basic fact of the editor, there are a number of other things, of varying degrees of relatedness: - "set dotglob" makes leading dots unspecial in filenames for shell globbing; normally, . and .. still vanish, but "set dotdotdotglob" makes them reappear. This also affects wildcard processing when doing filename completion in the editor. (dotglob doesn't affect ordinary globbing if GLOB_PERIOD is not available in glob(3); dotdotdotglob requires GLOB_NO_DOTDIRS.) - "set filec" is gone, in favour of the editor's filename completion. - When the shell variable locktty is set, the command-line editor ignores the tty state, replacing it with state saved the first time it was entered after locktty was set. (This is designed to deal with crashes by programs that muck with the tty state.) Some minor trouble is gone to to make sure that "unset locktty; stty ...; set locktty" does more or less what it looks as though it ought to, even though the editor does not get control during the sequence. - A shell variable mcsh is set, holding the mcsh version number. - SHORT_STRINGS and NLS are always on, for 8-bit-cleanness. - cd and pushd take job specs (%-, %2, %?awk, etc) to change to the job's directory (as printed by jobs -l). - Builtin commands bind, disp, and macro, to control the editor. -- bind shows or sets key-sequence-to-function bindings. bind shows all bindings bind keysequence shows what a sequence is bound to bind functionname shows what keystrokes, if any, are bound to a function bind keysequence functionname binds the sequence to the function -- disp controls how characters on the command line are displayed. This originally went in for the Hazeltine 1500, which cannot display a ~, so I wanted to have it display as \^ (akin to the way, say, control-K displays as ^K). disp shows the display sequences for all 256 characters disp N shows the display sequence for character N disp N string sets character N to display as string -- macro packages up a sequence of keystrokes, or of functions, and gives it a name, so it can be bound to a key sequence. macro shows all macros macro foo shows the macro named foo macro -u foo undefines the macro named foo macro [-f] [-k] foo arg [arg [arg ...]] defines macro foo as being the functions (-f) or keystrokes (-k) given as args. For functions, keystrokes can be given, in which case the functions they are bound to (at macro definition time) are used (as opposed to a keystroke macro, which uses the keystrokes' bindings at macro *use* time). For -f, when using functions that care about the last key struck (self-insert is the only current example), you can give function[string] or function{key-key-key...} to specify the key values. [] uses single characters as the keys; {} lets you give names. - Job numbers are now reused much more aggressively: the lowest free number is used, not the much more complex (and less predictable, unless you knew exactly what was going on) algorithm previously used. - la builtin prints the load averages. - FG builtin is just like fg, except that it never gives "ambiguous" errors; it prefers jobs in the current directory, with remaining ties broken arbitrarily. (Arguably it should error on remaining ties; I didn't care enough to bother.) - fork builtin forks the shell itself. I haven't yet reimplemented this in this version; I use it very seldom, so I left it for later. It just prints a "not yet implemented" message. - Slightly better const poisoning on a few internal routines. Some of you are probably wondering "why not just use tcsh?". There are multiple answers to that. The initial answer was that I hadn't met tcsh when I did the first version of mcsh. By now, my fingers are used to mcsh, and it differs from tcsh in some significant ways: - It doesn't mangle history. tcsh's editor history is tokenized; it mangles whitespace (and may mangle more - I have't looked for details). - ^T behaves differently; while this may no longer be true, when I looked, tcsh had no way to get a ^T that worked the way my fingers expect. - tcsh history recall makes it difficult to piece together a command from multiple lines of history (type stuff, type ^P, and the stuff you've typed goes away). - tcsh filename completion works substantially differently from mine. Mine has separate commands for "complete" and "show completions"; mine backs up and re-expands when there are no matches; mine handles {braced,alternatives} better. - I have some commands such as path-next (esc-N) and path-prev (esc-P) that tcsh, as far as I know, doesn't. - There seems to be no way to get a newline into the tcsh command line. ^V^J inserts ^M, and it seems to prevent me from turning off icrnl. moussh 20080215 - -delete can now take a key from stdin. - Fix up a forgotten .h file wrapping. - Remove two noise printfs from client connection-forwarding code. - -kh option to manipulate the known-hosts database (see the manpage). - Document -kh, some other small manpage fixes. nc 20080110 - Handle systems with no SO_REUSEPORT. - Handle systems with no KERN_IOV_MAX. ppmplot 20080217 - Nested function stuff. - More aggressive optimization of some lines entirely off the plot. rotatelog 20071025 - Add -olddir, which allows placing the old-logs directory somewhere other than an OLD/logfilename/ directory with OLD sibling to the logfile. - Add -bg, which causes old logfile compression to be backgrounded. - Remove --repetitive-best from the default compression command. - Add support for not creating new logfiles. /~\ The ASCII der Mouse \ / Ribbon Campaign X Against HTML mouse@rodents.montreal.qc.ca / \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B