Module Name: othersrc Committed By: agc Date: Sat Jan 12 01:31:21 UTC 2013
Modified Files: othersrc/external/bsd/netdiff/bin: Makefile othersrc/external/bsd/netdiff/bin/netdiff: 004.expected othersrc/external/bsd/netdiff/bin/qdiff: 004.expected othersrc/external/bsd/netdiff/dist: diff.c diff_subr.c diffreg.c libnetdiff.3 netdiff.h qdiff.c Added Files: othersrc/external/bsd/netdiff/bin/memdiff: 001.expected 002.expected 003.expected 005.expected 006.expected 007.expected Makefile f1 f2 othersrc/external/bsd/netdiff/dist: mem.c Log Message: Abstract the I/O routines within netdiff to work with either areas of memory (mmap'ed or allocated), or with stdio; use the appropriate implementation automatically. This doesn't change comparisons which use normal file I/O through stdio in any way - all of the existing tests continue to pass; however, in addition, it enables the use of the same comparison functionality on areas of memory. Using the abstracted I/O, add a diff_mem() function to compare two areas of memory. Within the comparison, unless labels are provided for each area of memory, any netdiff output will be labelled "lhs" and "rhs". The mtime for comparison output is taken to be the time at which the comparison was started, and is the same for both areas of memory. Together with the function which retrieves comparison output in memory, this allows us to do diff comparisons without hitting any file system at all. Directory comparisons continue to function in exactly the same way. Add an example program called memdiff (again, not installed), which uses mmap to read its input files, diff_mem() to compare the memory, and diff_get_diffs() to retrieve the differences, all completely in memory. Add tests for this program, including filters so that we don't check the mtimes on the areas of memory compared. Regular files can still be compared using diff_file(), or the higher-level difference(), although these will not be as quick as the mmap()/diff_mem()/diff_get_diffs() combination. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 othersrc/external/bsd/netdiff/bin/Makefile cvs rdiff -u -r0 -r1.1 othersrc/external/bsd/netdiff/bin/memdiff/001.expected \ othersrc/external/bsd/netdiff/bin/memdiff/002.expected \ othersrc/external/bsd/netdiff/bin/memdiff/003.expected \ othersrc/external/bsd/netdiff/bin/memdiff/005.expected \ othersrc/external/bsd/netdiff/bin/memdiff/006.expected \ othersrc/external/bsd/netdiff/bin/memdiff/007.expected \ othersrc/external/bsd/netdiff/bin/memdiff/Makefile \ othersrc/external/bsd/netdiff/bin/memdiff/f1 \ othersrc/external/bsd/netdiff/bin/memdiff/f2 cvs rdiff -u -r1.3 -r1.4 \ othersrc/external/bsd/netdiff/bin/netdiff/004.expected cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/netdiff/bin/qdiff/004.expected cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/netdiff/dist/diff.c \ othersrc/external/bsd/netdiff/dist/diffreg.c \ othersrc/external/bsd/netdiff/dist/libnetdiff.3 cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/netdiff/dist/diff_subr.c cvs rdiff -u -r0 -r1.1 othersrc/external/bsd/netdiff/dist/mem.c cvs rdiff -u -r1.1.1.1 -r1.2 othersrc/external/bsd/netdiff/dist/netdiff.h \ othersrc/external/bsd/netdiff/dist/qdiff.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.