(use eggdoc) (define doc `((eggdoc:begin (name "format-textdiff") (description "Output text diff scripts in different formats.") (author (url "http://chicken.wiki.br/users/ivan-raikov" "Ivan Raikov")) (history (version "1.7" "Some improvements to the test suite") (version "1.6" "Ported to Chicken 4") (version "1.5" "Build script updated for better cross-platform compatibility") (version "1.4" "eggdoc documentation fix") (version "1.3" "License upgrade to GPL v3") (version "1.2" "Added license text to source files") (version "1.1" "Added procedure " (tt "textdiff->sexp") " [thanks to Felix for the suggestion]") (version "1.0" "Initial release")) (requires (url "npdiff.html" "npdiff") (url "vector-lib.html" "vector-lib") (url "dyn-vector.html" "dyn-vector")) (usage "(require-extension format-textdiff)") (download "format-textdiff.egg") (documentation (p "The format-textdiff library defines the " (tt "textdiff") " procedure, which produces a diff script for two SRFI-43 vectors that " "contain strings, and it provides a formatting procedure that " "can output the text diff hunks in several formats commonly " "supported by the Unix " (tt "diff(1)") " tool.") (subsection "Procedures" (procedure "textdiff:: TEXT1 TEXT2 [CONTEXT] -> (HUNK ... )" (p "text diff procedure; " (ul (li (tt "TEXT1") " and " (tt "TEXT2") " are two SRFI-43 vectors that contain strings;") (li (tt "CONTEXT") " is an optional number of context lines " " to be provided with each operation in the diff script")) "See the documentation for the " (url "npdiff.html" "npdiff egg") " " "for a detailed description of the " (tt "HUNK") " data type.")) (procedure "make-format-textdiff:: TYPE -> FORMAT-PROC" (p "returns a hunk formatter procedure of the specified types; " "the following formats are supported: " (symbol-table (describe "'ed" "ed(1) script") (describe "'normal" "normal diff format") (describe "'rcs" "rcs(1) diff script") (describe "'context" "context diff format")) "Each hunk formatter procedure is of the form " (tt "LAMBDA OUT-PORT HUNK-LIST") ", except for the context formatter, which is of the form " (tt "LAMBDA OUT-PORT HUNK-LIST FNAME1 TSTAMP1 FNAME2 TSTAMP2") ", where the timestamp and filename arguments are strings. " "Please see the " (tt "diff(1)") " manual for a detailed description of each format.")) (procedure "textdiff->sexp:: (HUNK ... ) -> (SEXP ...)" (p "converts a list of hunks to a list of s-expressions suitable for " "input to the " (tt "apply-patch") " procedure of the " (url "patch.html" "patch egg") ". ")))) (examples (pre #<sexp hunks)) (with-input-from-port (open-input-file "file0") (lambda () (with-output-to-port (open-output-file "file1.new") (lambda () (apply-patch sexp))))) EOF )) (license "Copyright 2007-2009 Ivan Raikov. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. A full copy of the GPL license can be found at .")))) (if (eggdoc->html doc) (void))