CVS log for epic5/source/files.c |
![]() |
Request diff between arbitrary revisions
* Add $serverctl(READ_FILE filename) to add servers from a servers file. * Add some preliminary code for sending a /msg to a logfile. * Make scrollback_start/end use "scroll up/down 999,999 lines" * This is for future consolidation of the scrollback code.
* Roll in a bunch of changes from larne to make epic5 more vms-friendly * Rename if.h -> ifcmd.h (larne) -- Make sure you rerun configure! * Run make depend to pick up name change of if.h * Check for <sys/param.h> in configure (larne) * Extern funcs are case insensitive in strict c90, fix (larne) * Rename options -> options.h since vms requires a dot in filename (larne) * Change "readonly" -> "rdonly" since "readonly" is a symbol in vms. (larne) * Pull in "compat.h" for gailib.c and glob.c (larne) * Set stdout to be explciitly line buffered at startup (larne) * Returning a value from void functino forbidden by strict c90. fix (larne) * Fix some compiler warnings that were lying around. * There are more changes forthcoming, these were the easy ones.
* $write(w-1 ....) is documented to write to the global logfile and now does. * Fixed a long standing notify bug where only one ISON would be sent.
* Put 'sig.inc' in include rather than source to fix build for r/o srcdir * #undef strtoimax() if we are going to define our own to fix build * Fix printf() qualification for syserr() * Fix $write(@W<num> ...) so uppercase W works * Nix strip_control() which isn't used any more. * Make #define WINDOW_CREATE go away -- it's now mandatory. * Reorganize do_screens() in prep for future work
Fix $write(w3 blah) crash reported by ce.
* 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)
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.
* Make GET_INT_ARG() support 64 bit ints, for future use * Make $fseek() support 64 bit file offsets (yay!) * Begin converting some time_t uses over to 64 bits, Just In Case * Make $numsort(), $strtol(), $tobase() support 64 bit ints. * Make $stat() support 64 bit ints where possible.
EPIC-ize the sdbm code and stuff.
* Add a pd implementation of sdbm, make $dbmctl() use it. * Make configure warn harder if it looks like termcap/terminfo not found.
* Check for <ndbm.h> in configure, don't do DBM if it is absent. * $dbmctl() always no-ops, returns empty string if dbm not available. * Add 'd' to $info(o) if DBM support is included * Add a check for solaris cc, moxy up the CFLAGS for larne. * Fix compile breakage if both tparm() and base64() are missing. doh. * Fail when maximum number of levels have been added. * Note a few places the window refnum is changed.
DBM (hash table) support. See UPDATES.
* Fix compile error for #define UNAME_HACK * Fix crash when you do $open(/file/doesnt/exist R) * Add an /on 338 default handler. * Fix integer underflow with log file refnums * Rename STATUS_USER0 to STATUS_USER for backwards compat. oops! * Whack BRACE_LOAD_HACK, it's been unsupported for a while. PF loader rules! * Don't allow /botmode if #define NO_BOTS * Fix DCC connections instantly "timing out"? (Check on this) * Whack FLOATING_POINT_SUPPORT and depend only on /set floating_point_math
Check return value of uzfopen() differently.
* Minor changes to dcc loss processing and the commandqueues script. * Applied Howls shebang patch.
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.
* 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)
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.
Another merge.
Yikes. Merged to become consistent with HEAD. Sorry for all the commits, I'll be quiet again soon. :) -wd
* 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.
* 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.
Fix brain-o and a few other non-operative changes.
* 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().
Update copyright notices and copyright dates.
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.
Fix a null deref when writing to a window's logfile that doesn't exist. Add some comments to numbers.c in anticipation of future work.
Bulk commit:
1) Fix typos in KNOWNBUGS
2) Flesh out the things in UPDATES that need documenting
3) Add target_file_write() to files.[ch] for send_text()'s use.
4) Create "reg.h", to hold protos for reg.c
5) Add some missing protos.
6) If /redirect'ing to 0 or to @<fd>, don't output to the screen.
7) Messages sent to target 0 are dropped (/redirect 0 now actually sends
to target 0, and epic drops it.) You can /query 0 now if you want.
8) Messages sent to @NUMBER get sent to the NUMBER file, where NUMBER is
returned by $open(). For example, to paste stuff to log but not to screen:
@fd = open(FILE w)
query @$fd
<paste some stuff>
query
@close($fd)
or
@fd = open(FILE w)
redirect @$fd lastlog foo
@close($fd)
9) Add a function to reg.c to compile a pattern into a regex -- experimental.
10) Fix some compile warnings regarding ssl.
The small stuff first: * $fskip now takes a second optional argument for the number of lines to skip, and returns the number of lines skipped. If the two numbers match, no error was encountered. If the number is -1, the file was in an error state at the start. * While trying to figure $regexec out, made $encode() and $decode() use the ircaux.c versions instead, and fixed a bug along the way. If this has any imact on these functions then there is a bug. Regex tomfoolery: * Changed the regcomp() library call args a little to make way for $regmatches() which isn't working yet. This should have no impact, but it may, because regcomp is a libc thing. * Eliminated the first argument to $regerror() to bring it in line with the documentation. Cursory examination of some publically available scripts show that although people have been coding around bugs in $regexec(), $regerror() is only ever used the documented way. * Altered $regerror() to return nothing in the case of a successful match for compatibility. See above.
Preliminary support for $write() and $writeb() support to logfiles. Basically if you prefix the window refnum with the letter 'w', then it will write to that window's logfile (if one is open). If you use the otherwise invalid window refnum -1, then it will log to the global logfile (if one is open). -1 is returned if you try to write to a logfile that isn't open (of course). Examples: $write(w1 this is a test) write to window refnum 1's logfile $write(w0 this is a test) write to the current window's logfile $write(w-1 this is a test) write to the global logfile Uppercase 'w's are of course acceptable as well.
Whitefang wanted to know if I would be willing to fix $read(), and crazyeddy wasn't around, and I tested this pretty thoroughly, so here's my hand at making things better for now. My apologies to crazyeddy for doing this without talking to him first.
*sigh* Sorry about this folks, these patches are not related to the situation at hand. They accidently got rolled into that hastily applied update, and none of us "on duty" right now know how to roll them back. Untouched, these should not effect the workings in any way. Service will resume as soon as possible. This particular one should fix the original problem.
Hurried patch. This rolls back the $read() patch for now.
A cleaner rewrite of the above, which fixes a minor bug.
This fixes $read(fd) (the single argument version) so that it reads arbitary length strings without problem.
Let the work on 1.1.2 commence!
Initial import into CVS
Initial revision
| CVS Admin |
Powered by ViewCVS 0.9.2 |