README.cords 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. Copyright (c) 1993-1994 by Xerox Corporation. All rights reserved.
  2. THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
  3. OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
  4. Permission is hereby granted to use or copy this program
  5. for any purpose, provided the above notices are retained on all copies.
  6. Permission to modify the code and to distribute modified code is granted,
  7. provided the above notices are retained, and a notice that the code was
  8. modified is included with the above copyright notice.
  9. Please send bug reports to Hans-J. Boehm (Hans_Boehm@hp.com or
  10. boehm@acm.org).
  11. This is a string packages that uses a tree-based representation.
  12. See cord.h for a description of the functions provided. Ec.h describes
  13. "extensible cords", which are essentially output streams that write
  14. to a cord. These allow for efficient construction of cords without
  15. requiring a bound on the size of a cord.
  16. More details on the data structure can be found in
  17. Boehm, Atkinson, and Plass, "Ropes: An Alternative to Strings",
  18. Software Practice and Experience 25, 12, December 1995, pp. 1315-1330.
  19. A fundamentally similar "rope" data structure is also part of SGI's standard
  20. template library implementation, and its descendents, which include the
  21. GNU C++ library. That uses reference counting by default.
  22. There is a short description of that data structure at
  23. http://reality.sgi.com/boehm/ropeimpl.html . (The more official location
  24. http://www.sgi.com/tech/stl/ropeimpl.html is missing a figure.)
  25. All of these are descendents of the "ropes" in Xerox Cedar.
  26. de.c is a very dumb text editor that illustrates the use of cords.
  27. It maintains a list of file versions. Each version is simply a
  28. cord representing the file contents. Nonetheless, standard
  29. editing operations are efficient, even on very large files.
  30. (Its 3 line "user manual" can be obtained by invoking it without
  31. arguments. Note that ^R^N and ^R^P move the cursor by
  32. almost a screen. It does not understand tabs, which will show
  33. up as highlighred "I"s. Use the UNIX "expand" program first.)
  34. To build the editor, type "make cord/de" in the gc directory.
  35. This package assumes an ANSI C compiler such as gcc. It will
  36. not compile with an old-style K&R compiler.
  37. Note that CORD_printf iand friends use C functions with variable numbers
  38. of arguments in non-standard-conforming ways. This code is known to
  39. break on some platforms, notably PowerPC. It should be possible to
  40. build the remainder of the library (everything but cordprnt.c) on
  41. any platform that supports the collector.