From bcbf441e09fb502cf64924ff2530fa144bdf52c5 Mon Sep 17 00:00:00 2001 From: Andreas Brachold Date: Mon, 13 Aug 2007 18:41:27 +0000 Subject: * Move files to trunk --- Makefile | 84 + README.txt | 3 + bin/xxvd | 741 +++ contrib/README | 27 + contrib/at-vdradmin2xxv.pl | 222 + contrib/chronicle-remove-duplicate.pl | 105 + contrib/create-database.sql | 22 + contrib/export-data.sql | 10 + contrib/import-data.sql | 17 + contrib/update-xxv | 283 + contrib/upgrade-xxv-db.sql | 304 + default | 1 + doc/CHANGELOG.txt | 1415 +++++ doc/COPYING.txt | 504 ++ doc/LIESMICH.txt | 65 + doc/Makefile | 71 + doc/NEWS.txt | 871 +++ doc/README.txt | 65 + doc/TODO.txt | 13 + doc/TUTORIAL.txt.gz | Bin 0 -> 6344 bytes doc/docu.tmpl | 99 + doc/xxvd.1 | 94 + doc/xxvd.sgml | 213 + etc/logrotate.d/xxvd | 8 + etc/xxvd | 85 + etc/xxvd.cfg.example | 158 + html/alist.tmpl | 84 + html/asearch.tmpl | 1 + html/bloecke/event_links.tmpl | 28 + html/bloecke/links.tmpl | 9 + html/bloecke/percentbar.tmpl | 21 + html/bloecke/stars.tmpl | 4 + html/bloecke/tooltip.tmpl | 12 + html/clist.tmpl | 157 + html/cmdlist.tmpl | 38 + html/display.tmpl | 85 + html/favicon.ico | Bin 0 -> 3262 bytes html/filesys.tmpl | 76 + html/help.tmpl | 127 + html/images/16_9Screen.png | Bin 0 -> 1345 bytes html/images/1_stars.png | Bin 0 -> 3722 bytes html/images/2_stars.png | Bin 0 -> 3928 bytes html/images/3_stars.png | Bin 0 -> 3949 bytes html/images/4_3Screen.png | Bin 0 -> 1357 bytes html/images/4_stars.png | Bin 0 -> 3975 bytes html/images/5_stars.png | Bin 0 -> 3973 bytes html/images/I.png | Bin 0 -> 148 bytes html/images/L.png | Bin 0 -> 153 bytes html/images/Lminus.png | Bin 0 -> 219 bytes html/images/Lplus.png | Bin 0 -> 224 bytes html/images/T.png | Bin 0 -> 152 bytes html/images/Tminus.png | Bin 0 -> 207 bytes html/images/Tplus.png | Bin 0 -> 222 bytes html/images/arrow.down.png | Bin 0 -> 170 bytes html/images/arrow.right.png | Bin 0 -> 181 bytes html/images/asc.png | Bin 0 -> 155 bytes html/images/at.png | Bin 0 -> 1347 bytes html/images/back.png | Bin 0 -> 542 bytes html/images/back_big.png | Bin 0 -> 1843 bytes html/images/bar_green.png | Bin 0 -> 2707 bytes html/images/bar_red.png | Bin 0 -> 2644 bytes html/images/blank.png | Bin 0 -> 144 bytes html/images/delete.png | Bin 0 -> 1370 bytes html/images/desc.png | Bin 0 -> 170 bytes html/images/dolby.png | Bin 0 -> 1400 bytes html/images/down.png | Bin 0 -> 1337 bytes html/images/edit.png | Bin 0 -> 1062 bytes html/images/english.gif | Bin 0 -> 1256 bytes html/images/exit.png | Bin 0 -> 1947 bytes html/images/file.png | Bin 0 -> 251 bytes html/images/foldericon.png | Bin 0 -> 229 bytes html/images/french.gif | Bin 0 -> 1151 bytes html/images/german.gif | Bin 0 -> 1114 bytes html/images/leer.png | Bin 0 -> 51 bytes html/images/linkbg.png | Bin 0 -> 2205 bytes html/images/logo.gif | Bin 0 -> 6370 bytes html/images/menu_big.png | Bin 0 -> 935 bytes html/images/movie.png | Bin 0 -> 18607 bytes html/images/new.png | Bin 0 -> 583 bytes html/images/newfolder.png | Bin 0 -> 560 bytes html/images/next.png | Bin 0 -> 1330 bytes html/images/nocover.gif | Bin 0 -> 1416 bytes html/images/notimers.png | Bin 0 -> 1578 bytes html/images/oben.png | Bin 0 -> 650 bytes html/images/off.png | Bin 0 -> 1330 bytes html/images/ok.png | Bin 0 -> 1359 bytes html/images/on.png | Bin 0 -> 1107 bytes html/images/openfoldericon.png | Bin 0 -> 232 bytes html/images/radio.png | Bin 0 -> 27086 bytes html/images/record.png | Bin 0 -> 1389 bytes html/images/record_blue.png | Bin 0 -> 1347 bytes html/images/record_green.png | Bin 0 -> 1389 bytes html/images/record_red.png | Bin 0 -> 1470 bytes html/images/repeat.png | Bin 0 -> 1337 bytes html/images/schnell_back.png | Bin 0 -> 679 bytes html/images/schnell_vor.png | Bin 0 -> 672 bytes html/images/spanish.gif | Bin 0 -> 1250 bytes html/images/star.png | Bin 0 -> 690 bytes html/images/stardark.png | Bin 0 -> 517 bytes html/images/switch.png | Bin 0 -> 1371 bytes html/images/timers.png | Bin 0 -> 4101 bytes html/images/trans.gif | Bin 0 -> 43 bytes html/images/up.png | Bin 0 -> 1338 bytes html/images/view_event.png | Bin 0 -> 702 bytes html/images/vor.png | Bin 0 -> 537 bytes html/images/xp/I.png | Bin 0 -> 148 bytes html/images/xp/L.png | Bin 0 -> 153 bytes html/images/xp/Lminus.png | Bin 0 -> 340 bytes html/images/xp/Lplus.png | Bin 0 -> 348 bytes html/images/xp/T.png | Bin 0 -> 152 bytes html/images/xp/Tminus.png | Bin 0 -> 341 bytes html/images/xp/Tplus.png | Bin 0 -> 348 bytes html/images/xp/file.png | Bin 0 -> 377 bytes html/images/xp/folder.png | Bin 0 -> 413 bytes html/images/xp/openfolder.png | Bin 0 -> 474 bytes html/images/xxv.gif | Bin 0 -> 4180 bytes html/images/zurueck.png | Bin 0 -> 1343 bytes html/index.tmpl | 15 + html/javascript/XHConn.js | 41 + html/javascript/coolmenus4.js | 427 ++ html/javascript/global.js | 174 + html/javascript/helptip.js | 240 + html/javascript/records.js | 26 + html/javascript/tabpane.js | 368 ++ html/javascript/tooltip.js | 101 + html/javascript/xtree.js | 541 ++ html/logger.tmpl | 55 + html/memory.tmpl | 105 + html/mlcopy.tmpl | 1 + html/mldisplay.tmpl | 228 + html/mledit.tmpl | 206 + html/mlgenres.tmpl | 17 + html/mlimport.tmpl | 1 + html/mlist.tmpl | 104 + html/mllist.tmpl | 10 + html/mllistmedias.tmpl | 55 + html/mlnavcontainer.tmpl | 110 + html/mlresearch.tmpl | 71 + html/mlsearch.tmpl | 52 + html/network.tmpl | 115 + html/next.tmpl | 1 + html/now.tmpl | 104 + html/program.tmpl | 107 + html/rdisplay.tmpl | 169 + html/report.tmpl | 43 + html/rlist.tmpl | 269 + html/rsearch.tmpl | 1 + html/schema.tmpl | 174 + html/search.tmpl | 131 + html/skin.cfg | 3 + html/style/coolmenus4.css | 19 + html/style/helptip.css | 36 + html/style/luna/tab.active.png | Bin 0 -> 1083 bytes html/style/luna/tab.css | 84 + html/style/luna/tab.hover.png | Bin 0 -> 1163 bytes html/style/luna/tab.png | Bin 0 -> 1171 bytes html/style/style.css | 225 + html/style/xtree.css | 46 + html/tlist.tmpl | 143 + html/topten.tmpl | 86 + html/tsearch.tmpl | 1 + html/ulist.tmpl | 41 + html/vitals.tmpl | 86 + html/widgets/checkbox.tmpl | 17 + html/widgets/confirm.tmpl | 12 + html/widgets/date.tmpl | 32 + html/widgets/dir.tmpl | 20 + html/widgets/err.tmpl | 2 + html/widgets/file.tmpl | 20 + html/widgets/footer.tmpl | 60 + html/widgets/formEnd.tmpl | 11 + html/widgets/formStart.tmpl | 10 + html/widgets/hidden.tmpl | 2 + html/widgets/host.tmpl | 23 + html/widgets/integer.tmpl | 9 + html/widgets/link.tmpl | 2 + html/widgets/list.tmpl | 38 + html/widgets/littlemenu.tmpl | 12 + html/widgets/menu.tmpl | 21 + html/widgets/message.tmpl | 4 + html/widgets/password.tmpl | 11 + html/widgets/player.tmpl | 20 + html/widgets/radio.tmpl | 12 + html/widgets/redirect.tmpl | 4 + html/widgets/referer.tmpl | 8 + html/widgets/remote.tmpl | 134 + html/widgets/start.tmpl | 29 + html/widgets/string.tmpl | 21 + html/widgets/table.tmpl | 47 + html/widgets/url.tmpl | 16 + html/widgets/vtx.tmpl | 45 + html/widgets/wait.tmpl | 33 + install-debian.sh | 91 + install.sh | 463 ++ lib/Attribute/Handlers.pm | 845 +++ lib/Benchmark/Timer.pm | 618 ++ lib/Bundle/Xxv.pm | 81 + lib/CGI.pm | 7318 ++++++++++++++++++++++ lib/CGI/Apache.pm | 26 + lib/CGI/Carp.pm | 524 ++ lib/CGI/Cookie.pm | 478 ++ lib/CGI/Fast.pm | 230 + lib/CGI/Pretty.pm | 275 + lib/CGI/Push.pm | 328 + lib/CGI/Switch.pm | 27 + lib/CGI/Util.pm | 317 + lib/Class/MakeMethods.pm | 1520 +++++ lib/Class/MakeMethods/Attribute.pm | 143 + lib/Class/MakeMethods/Autoload.pm | 182 + lib/Class/MakeMethods/Basic.pm | 98 + lib/Class/MakeMethods/Basic/Array.pm | 422 ++ lib/Class/MakeMethods/Basic/Global.pm | 298 + lib/Class/MakeMethods/Basic/Hash.pm | 362 ++ lib/Class/MakeMethods/Composite.pm | 218 + lib/Class/MakeMethods/Composite/Array.pm | 794 +++ lib/Class/MakeMethods/Composite/Global.pm | 588 ++ lib/Class/MakeMethods/Composite/Hash.pm | 719 +++ lib/Class/MakeMethods/Composite/Inheritable.pm | 613 ++ lib/Class/MakeMethods/Composite/Universal.pm | 150 + lib/Class/MakeMethods/Docs/Catalog.pod | 888 +++ lib/Class/MakeMethods/Docs/Changes.pod | 661 ++ lib/Class/MakeMethods/Docs/Examples.pod | 554 ++ lib/Class/MakeMethods/Docs/ReadMe.pod | 279 + lib/Class/MakeMethods/Docs/RelatedModules.pod | 962 +++ lib/Class/MakeMethods/Docs/ToDo.pod | 296 + lib/Class/MakeMethods/Emulator.pm | 165 + lib/Class/MakeMethods/Emulator/AccessorFast.pm | 102 + lib/Class/MakeMethods/Emulator/Inheritable.pm | 162 + lib/Class/MakeMethods/Emulator/MethodMaker.pm | 676 +++ lib/Class/MakeMethods/Emulator/Singleton.pm | 85 + lib/Class/MakeMethods/Emulator/Struct.pm | 154 + lib/Class/MakeMethods/Emulator/accessors.pm | 122 + lib/Class/MakeMethods/Emulator/mcoder.pm | 116 + lib/Class/MakeMethods/Evaled.pm | 97 + lib/Class/MakeMethods/Evaled/Hash.pm | 349 ++ lib/Class/MakeMethods/Standard.pm | 68 + lib/Class/MakeMethods/Standard/Array.pm | 555 ++ lib/Class/MakeMethods/Standard/Global.pm | 405 ++ lib/Class/MakeMethods/Standard/Hash.pm | 501 ++ lib/Class/MakeMethods/Standard/Inheritable.pm | 428 ++ lib/Class/MakeMethods/Standard/Universal.pm | 336 ++ lib/Class/MakeMethods/Template.pm | 1255 ++++ lib/Class/MakeMethods/Template/Array.pm | 102 + lib/Class/MakeMethods/Template/Class.pm | 103 + lib/Class/MakeMethods/Template/ClassInherit.pm | 144 + lib/Class/MakeMethods/Template/ClassName.pm | 330 + lib/Class/MakeMethods/Template/ClassVar.pm | 178 + lib/Class/MakeMethods/Template/Flyweight.pm | 43 + lib/Class/MakeMethods/Template/Generic.pm | 2349 ++++++++ lib/Class/MakeMethods/Template/Global.pm | 97 + lib/Class/MakeMethods/Template/Hash.pm | 229 + lib/Class/MakeMethods/Template/Inheritable.pm | 154 + lib/Class/MakeMethods/Template/InsideOut.pm | 218 + lib/Class/MakeMethods/Template/PackageVar.pm | 168 + lib/Class/MakeMethods/Template/Ref.pm | 207 + lib/Class/MakeMethods/Template/Scalar.pm | 80 + lib/Class/MakeMethods/Template/Static.pm | 41 + lib/Class/MakeMethods/Template/Struct.pm | 41 + lib/Class/MakeMethods/Template/StructBuiltin.pm | 148 + lib/Class/MakeMethods/Template/Universal.pm | 415 ++ lib/Class/MakeMethods/Utility/ArraySplicer.pm | 243 + lib/Class/MakeMethods/Utility/DiskCache.pm | 165 + lib/Class/MakeMethods/Utility/Inheritable.pm | 126 + lib/Class/MakeMethods/Utility/Ref.pm | 171 + lib/Class/MakeMethods/Utility/TextBuilder.pm | 207 + lib/Config/Tiny.pm | 248 + lib/Date/Manip.pm | 7362 +++++++++++++++++++++++ lib/Digest/HMAC.pm | 111 + lib/Digest/HMAC_MD5.pm | 71 + lib/Digest/HMAC_SHA1.pm | 71 + lib/Event/File.pm | 92 + lib/Event/File/tail.pm | 675 +++ lib/GD/Graph/Data.pm | 725 +++ lib/GD/Graph/Error.pm | 346 ++ lib/GD/Graph/FAQ.pod | 130 + lib/GD/Graph/area.pm | 112 + lib/GD/Graph/axestype3d.pm | 787 +++ lib/GD/Graph/bars.pm | 372 ++ lib/GD/Graph/bars3d.pm | 349 ++ lib/GD/Graph/colour.pm | 371 ++ lib/GD/Graph/cylinder.pm | 126 + lib/GD/Graph/cylinder3d.pm | 30 + lib/GD/Graph/hbars.pm | 71 + lib/GD/Graph/lines.pm | 182 + lib/GD/Graph/lines3d.pm | 522 ++ lib/GD/Graph/linespoints.pm | 46 + lib/GD/Graph/mixed.pm | 99 + lib/GD/Graph/pie.pm | 446 ++ lib/GD/Graph/pie3d.pm | 331 + lib/GD/Graph/points.pm | 183 + lib/GD/Graph/utils.pm | 49 + lib/GD/Graph3d.pm | 157 + lib/HTML/TextToHTML.pm | 5266 ++++++++++++++++ lib/Locale/Maketext/Extract.pm | 502 ++ lib/Locale/Maketext/Extract/Run.pm | 83 + lib/Locale/Maketext/Lexicon.pm | 461 ++ lib/Locale/Maketext/Lexicon/Auto.pm | 59 + lib/Locale/Maketext/Lexicon/Gettext.pm | 251 + lib/Locale/Maketext/Lexicon/Msgcat.pm | 123 + lib/Locale/Maketext/Lexicon/Tie.pm | 67 + lib/MP3/Icecast.pm | 727 +++ lib/MP3/Info.pm | 1563 +++++ lib/Mail/SendEasy.pm | 743 +++ lib/Mail/SendEasy/AUTH.pm | 171 + lib/Mail/SendEasy/Base64.pm | 103 + lib/Mail/SendEasy/IOScalar.pm | 95 + lib/Mail/SendEasy/SMTP.pm | 365 ++ lib/MediaLibParser.pm | 310 + lib/MediaLibParser/DVDPalace.pm | 330 + lib/MediaLibParser/IMDb.pm | 74 + lib/Module/Reload.pm | 79 + lib/Net/Amazon.pm | 1255 ++++ lib/Net/Amazon/Attribute/Review.pm | 104 + lib/Net/Amazon/Attribute/ReviewSet.pm | 137 + lib/Net/Amazon/Property.pm | 320 + lib/Net/Amazon/Property/Book.pm | 152 + lib/Net/Amazon/Property/DVD.pm | 156 + lib/Net/Amazon/Property/Music.pm | 161 + lib/Net/Amazon/Request.pm | 221 + lib/Net/Amazon/Request/ASIN.pm | 139 + lib/Net/Amazon/Request/Artist.pm | 86 + lib/Net/Amazon/Request/Blended.pm | 80 + lib/Net/Amazon/Request/BrowseNode.pm | 137 + lib/Net/Amazon/Request/Exchange.pm | 91 + lib/Net/Amazon/Request/Keyword.pm | 90 + lib/Net/Amazon/Request/Manufacturer.pm | 78 + lib/Net/Amazon/Request/Power.pm | 95 + lib/Net/Amazon/Request/Seller.pm | 84 + lib/Net/Amazon/Request/Similar.pm | 95 + lib/Net/Amazon/Request/Sort.pm | 246 + lib/Net/Amazon/Request/TextStream.pm | 76 + lib/Net/Amazon/Request/UPC.pm | 94 + lib/Net/Amazon/Request/Wishlist.pm | 89 + lib/Net/Amazon/Response.pm | 214 + lib/Net/Amazon/Response/ASIN.pm | 28 + lib/Net/Amazon/Response/Artist.pm | 29 + lib/Net/Amazon/Response/Blended.pm | 73 + lib/Net/Amazon/Response/BrowseNode.pm | 29 + lib/Net/Amazon/Response/Exchange.pm | 81 + lib/Net/Amazon/Response/Keyword.pm | 29 + lib/Net/Amazon/Response/Manufacturer.pm | 29 + lib/Net/Amazon/Response/Power.pm | 28 + lib/Net/Amazon/Response/Seller.pm | 78 + lib/Net/Amazon/Response/Similar.pm | 28 + lib/Net/Amazon/Response/TextStream.pm | 28 + lib/Net/Amazon/Response/UPC.pm | 40 + lib/Net/Amazon/Response/Wishlist.pm | 29 + lib/Net/Amazon/Result/Seller.pm | 130 + lib/Net/Amazon/Result/Seller/Listing.pm | 146 + lib/Net/IP/Match/Regexp.pm | 293 + lib/Paths.pm | 3 + lib/Proc/Killfam.pm | 83 + lib/SOAP/Transport/HTTP/Event.pm | 76 + lib/Template.pm | 961 +++ lib/Template/Base.pm | 314 + lib/Template/Config.pm | 467 ++ lib/Template/Constants.pm | 287 + lib/Template/Context.pm | 1570 +++++ lib/Template/Directive.pm | 1004 ++++ lib/Template/Document.pm | 492 ++ lib/Template/Exception.pm | 254 + lib/Template/FAQ.pod | 329 + lib/Template/Filters.pm | 1448 +++++ lib/Template/Grammar.pm | 6179 +++++++++++++++++++ lib/Template/Iterator.pm | 456 ++ lib/Template/Library/HTML.pod | 316 + lib/Template/Library/PostScript.pod | 78 + lib/Template/Library/Splash.pod | 1030 ++++ lib/Template/Manual.pod | 180 + lib/Template/Manual/Config.pod | 2122 +++++++ lib/Template/Manual/Credits.pod | 188 + lib/Template/Manual/Directives.pod | 2179 +++++++ lib/Template/Manual/Filters.pod | 529 ++ lib/Template/Manual/Internals.pod | 556 ++ lib/Template/Manual/Intro.pod | 295 + lib/Template/Manual/Plugins.pod | 552 ++ lib/Template/Manual/Refs.pod | 171 + lib/Template/Manual/Syntax.pod | 306 + lib/Template/Manual/VMethods.pod | 529 ++ lib/Template/Manual/Variables.pod | 868 +++ lib/Template/Manual/Views.pod | 642 ++ lib/Template/Modules.pod | 448 ++ lib/Template/Namespace/Constants.pm | 205 + lib/Template/Parser.pm | 1446 +++++ lib/Template/Plugin.pm | 409 ++ lib/Template/Plugin/Autoformat.pm | 242 + lib/Template/Plugin/CGI.pm | 168 + lib/Template/Plugin/DBI.pm | 947 +++ lib/Template/Plugin/Datafile.pm | 198 + lib/Template/Plugin/Date.pm | 361 ++ lib/Template/Plugin/Directory.pm | 410 ++ lib/Template/Plugin/Dumper.pm | 179 + lib/Template/Plugin/File.pm | 416 ++ lib/Template/Plugin/Filter.pm | 436 ++ lib/Template/Plugin/Format.pm | 124 + lib/Template/Plugin/GD/Constants.pm | 138 + lib/Template/Plugin/GD/Graph/area.pm | 148 + lib/Template/Plugin/GD/Graph/bars.pm | 191 + lib/Template/Plugin/GD/Graph/bars3d.pm | 166 + lib/Template/Plugin/GD/Graph/lines.pm | 178 + lib/Template/Plugin/GD/Graph/lines3d.pm | 166 + lib/Template/Plugin/GD/Graph/linespoints.pm | 158 + lib/Template/Plugin/GD/Graph/mixed.pm | 176 + lib/Template/Plugin/GD/Graph/pie.pm | 141 + lib/Template/Plugin/GD/Graph/pie3d.pm | 145 + lib/Template/Plugin/GD/Graph/points.pm | 155 + lib/Template/Plugin/GD/Image.pm | 184 + lib/Template/Plugin/GD/Polygon.pm | 155 + lib/Template/Plugin/GD/Text.pm | 140 + lib/Template/Plugin/GD/Text/Align.pm | 147 + lib/Template/Plugin/GD/Text/Wrap.pm | 183 + lib/Template/Plugin/HTML.pm | 197 + lib/Template/Plugin/Image.pm | 425 ++ lib/Template/Plugin/Iterator.pm | 118 + lib/Template/Plugin/Pod.pm | 116 + lib/Template/Plugin/Procedural.pm | 170 + lib/Template/Plugin/String.pm | 796 +++ lib/Template/Plugin/Table.pm | 464 ++ lib/Template/Plugin/URL.pm | 236 + lib/Template/Plugin/View.pm | 127 + lib/Template/Plugin/Wrap.pm | 162 + lib/Template/Plugin/XML/DOM.pm | 841 +++ lib/Template/Plugin/XML/RSS.pm | 194 + lib/Template/Plugin/XML/Simple.pm | 124 + lib/Template/Plugin/XML/Style.pm | 357 ++ lib/Template/Plugin/XML/XPath.pm | 284 + lib/Template/Plugins.pm | 1041 ++++ lib/Template/Provider.pm | 1449 +++++ lib/Template/Service.pm | 775 +++ lib/Template/Stash.pm | 1040 ++++ lib/Template/Stash/Context.pm | 791 +++ lib/Template/Stash/XS.pm | 176 + lib/Template/Test.pm | 711 +++ lib/Template/Tools/tpage.pod | 76 + lib/Template/Tools/ttree.pod | 332 + lib/Template/Tutorial.pod | 109 + lib/Template/Tutorial/Datafile.pod | 461 ++ lib/Template/Tutorial/Web.pod | 801 +++ lib/Template/View.pm | 752 +++ lib/Term/ReadLine/Perl.pm | 144 + lib/Term/ReadLine/readline.pm | 4054 +++++++++++++ lib/Text/ASCIITable.pm | 1037 ++++ lib/Text/ASCIITable/Wrap.pm | 97 + lib/Text/Wrap.pm | 106 + lib/Tools.pm | 607 ++ lib/URI.pm | 1019 ++++ lib/URI/Escape.pm | 218 + lib/URI/Heuristic.pm | 224 + lib/URI/QueryParam.pm | 200 + lib/URI/Split.pm | 96 + lib/URI/URL.pm | 305 + lib/URI/WithBase.pm | 171 + lib/URI/_foreign.pm | 6 + lib/URI/_generic.pm | 249 + lib/URI/_ldap.pm | 140 + lib/URI/_login.pm | 10 + lib/URI/_query.pm | 81 + lib/URI/_segment.pm | 20 + lib/URI/_server.pm | 106 + lib/URI/_userpass.pm | 51 + lib/URI/data.pm | 139 + lib/URI/file.pm | 329 + lib/URI/file/Base.pm | 80 + lib/URI/file/FAT.pm | 23 + lib/URI/file/Mac.pm | 120 + lib/URI/file/OS2.pm | 28 + lib/URI/file/QNX.pm | 18 + lib/URI/file/Unix.pm | 55 + lib/URI/file/Win32.pm | 84 + lib/URI/ftp.pm | 45 + lib/URI/gopher.pm | 94 + lib/URI/http.pm | 25 + lib/URI/https.pm | 7 + lib/URI/ldap.pm | 122 + lib/URI/ldapi.pm | 30 + lib/URI/ldaps.pm | 7 + lib/URI/mailto.pm | 72 + lib/URI/mms.pm | 8 + lib/URI/news.pm | 68 + lib/URI/nntp.pm | 6 + lib/URI/pop.pm | 68 + lib/URI/rlogin.pm | 7 + lib/URI/rsync.pm | 12 + lib/URI/rtsp.pm | 8 + lib/URI/rtspu.pm | 8 + lib/URI/sip.pm | 86 + lib/URI/sips.pm | 7 + lib/URI/snews.pm | 8 + lib/URI/ssh.pm | 9 + lib/URI/telnet.pm | 7 + lib/URI/tn3270.pm | 7 + lib/URI/urn.pm | 97 + lib/URI/urn/isbn.pm | 58 + lib/URI/urn/oid.pm | 18 + lib/XML/Dumper.pm | 897 +++ lib/XML/Simple.pm | 3041 ++++++++++ lib/XML/Stream.pm | 3268 ++++++++++ lib/XML/Stream/Namespace.pm | 190 + lib/XML/Stream/Node.pm | 944 +++ lib/XML/Stream/Parser.pm | 567 ++ lib/XML/Stream/Parser/DTD.pm | 769 +++ lib/XML/Stream/Tree.pm | 682 +++ lib/XML/Stream/XPath.pm | 50 + lib/XML/Stream/XPath/Op.pm | 919 +++ lib/XML/Stream/XPath/Query.pm | 374 ++ lib/XML/Stream/XPath/Value.pm | 153 + lib/XXV/MODULES/AUTOTIMER.pm | 1359 +++++ lib/XXV/MODULES/CHANNELS.pm | 1018 ++++ lib/XXV/MODULES/CHRONICLE.pm | 249 + lib/XXV/MODULES/CONFIG.pm | 283 + lib/XXV/MODULES/EPG.pm | 1243 ++++ lib/XXV/MODULES/EVENTS.pm | 190 + lib/XXV/MODULES/GRAB.pm | 290 + lib/XXV/MODULES/HTTPD.pm | 588 ++ lib/XXV/MODULES/INTERFACE.pm | 179 + lib/XXV/MODULES/LOGREAD.pm | 221 + lib/XXV/MODULES/MEDIALIB.pm | 1328 ++++ lib/XXV/MODULES/MUSIC.pm | 1352 +++++ lib/XXV/MODULES/RECORDS.pm | 2136 +++++++ lib/XXV/MODULES/REMOTE.pm | 279 + lib/XXV/MODULES/REPORT.pm | 288 + lib/XXV/MODULES/ROBOT.pm | 180 + lib/XXV/MODULES/SHARE.pm | 280 + lib/XXV/MODULES/STATUS.pm | 771 +++ lib/XXV/MODULES/STREAM.pm | 179 + lib/XXV/MODULES/SVDRP.pm | 228 + lib/XXV/MODULES/TELNET.pm | 326 + lib/XXV/MODULES/TIMERS.pm | 1721 ++++++ lib/XXV/MODULES/USER.pm | 919 +++ lib/XXV/MODULES/VTX.pm | 1396 +++++ lib/XXV/MODULES/WAPD.pm | 354 ++ lib/XXV/OUTPUT/Ajax.pm | 231 + lib/XXV/OUTPUT/Console.pm | 741 +++ lib/XXV/OUTPUT/Dump.pm | 62 + lib/XXV/OUTPUT/HTML/PUSH.pm | 95 + lib/XXV/OUTPUT/HTML/WAIT.pm | 169 + lib/XXV/OUTPUT/Html.pm | 851 +++ lib/XXV/OUTPUT/NEWS/JABBER.pm | 296 + lib/XXV/OUTPUT/NEWS/MAIL.pm | 313 + lib/XXV/OUTPUT/NEWS/RSS.pm | 233 + lib/XXV/OUTPUT/NEWS/VDR.pm | 165 + lib/XXV/OUTPUT/Wml.pm | 431 ++ locale/Makefile | 99 + locale/README | 24 + locale/de.po | 4236 +++++++++++++ locale/de/LC_MESSAGES/xxv.mo | Bin 0 -> 66243 bytes locale/xgettext.pl | 102 + share/fonts/ttf-bitstream-vera/Vera.ttf | Bin 0 -> 65932 bytes share/fonts/ttf-bitstream-vera/VeraBI.ttf | Bin 0 -> 63208 bytes share/fonts/ttf-bitstream-vera/VeraBd.ttf | Bin 0 -> 58716 bytes share/fonts/ttf-bitstream-vera/VeraIt.ttf | Bin 0 -> 63684 bytes share/fonts/ttf-bitstream-vera/VeraMoBI.ttf | Bin 0 -> 55032 bytes share/fonts/ttf-bitstream-vera/VeraMoBd.ttf | Bin 0 -> 49052 bytes share/fonts/ttf-bitstream-vera/VeraMoIt.ttf | Bin 0 -> 54508 bytes share/fonts/ttf-bitstream-vera/VeraMono.ttf | Bin 0 -> 49224 bytes share/fonts/ttf-bitstream-vera/VeraSe.ttf | Bin 0 -> 60280 bytes share/fonts/ttf-bitstream-vera/VeraSeBd.ttf | Bin 0 -> 58736 bytes share/news/mail_010_header.tmpl | 6 + share/news/mail_050_content.tmpl | 8 + share/news/mail_090_footer.tmpl | 7 + share/vtx/black20.gif | Bin 0 -> 49 bytes share/vtx/black21.gif | Bin 0 -> 54 bytes share/vtx/black22.gif | Bin 0 -> 55 bytes share/vtx/black23.gif | Bin 0 -> 53 bytes share/vtx/black24.gif | Bin 0 -> 54 bytes share/vtx/black25.gif | Bin 0 -> 58 bytes share/vtx/black26.gif | Bin 0 -> 58 bytes share/vtx/black27.gif | Bin 0 -> 55 bytes share/vtx/black28.gif | Bin 0 -> 54 bytes share/vtx/black29.gif | Bin 0 -> 58 bytes share/vtx/black2A.gif | Bin 0 -> 58 bytes share/vtx/black2B.gif | Bin 0 -> 56 bytes share/vtx/black2C.gif | Bin 0 -> 53 bytes share/vtx/black2D.gif | Bin 0 -> 57 bytes share/vtx/black2E.gif | Bin 0 -> 56 bytes share/vtx/black2F.gif | Bin 0 -> 53 bytes share/vtx/black30.gif | Bin 0 -> 54 bytes share/vtx/black31.gif | Bin 0 -> 58 bytes share/vtx/black32.gif | Bin 0 -> 58 bytes share/vtx/black33.gif | Bin 0 -> 55 bytes share/vtx/black34.gif | Bin 0 -> 56 bytes share/vtx/black35.gif | Bin 0 -> 60 bytes share/vtx/black36.gif | Bin 0 -> 60 bytes share/vtx/black37.gif | Bin 0 -> 57 bytes share/vtx/black38.gif | Bin 0 -> 57 bytes share/vtx/black39.gif | Bin 0 -> 60 bytes share/vtx/black3A.gif | Bin 0 -> 60 bytes share/vtx/black3B.gif | Bin 0 -> 56 bytes share/vtx/black3C.gif | Bin 0 -> 55 bytes share/vtx/black3D.gif | Bin 0 -> 58 bytes share/vtx/black3E.gif | Bin 0 -> 58 bytes share/vtx/black3F.gif | Bin 0 -> 54 bytes share/vtx/black60.gif | Bin 0 -> 54 bytes share/vtx/black61.gif | Bin 0 -> 58 bytes share/vtx/black62.gif | Bin 0 -> 58 bytes share/vtx/black63.gif | Bin 0 -> 55 bytes share/vtx/black64.gif | Bin 0 -> 56 bytes share/vtx/black65.gif | Bin 0 -> 60 bytes share/vtx/black66.gif | Bin 0 -> 60 bytes share/vtx/black67.gif | Bin 0 -> 57 bytes share/vtx/black68.gif | Bin 0 -> 57 bytes share/vtx/black69.gif | Bin 0 -> 60 bytes share/vtx/black6A.gif | Bin 0 -> 60 bytes share/vtx/black6B.gif | Bin 0 -> 56 bytes share/vtx/black6C.gif | Bin 0 -> 55 bytes share/vtx/black6D.gif | Bin 0 -> 58 bytes share/vtx/black6E.gif | Bin 0 -> 58 bytes share/vtx/black6F.gif | Bin 0 -> 54 bytes share/vtx/black70.gif | Bin 0 -> 53 bytes share/vtx/black71.gif | Bin 0 -> 56 bytes share/vtx/black72.gif | Bin 0 -> 57 bytes share/vtx/black73.gif | Bin 0 -> 53 bytes share/vtx/black74.gif | Bin 0 -> 56 bytes share/vtx/black75.gif | Bin 0 -> 58 bytes share/vtx/black76.gif | Bin 0 -> 58 bytes share/vtx/black77.gif | Bin 0 -> 54 bytes share/vtx/black78.gif | Bin 0 -> 55 bytes share/vtx/black79.gif | Bin 0 -> 58 bytes share/vtx/black7A.gif | Bin 0 -> 58 bytes share/vtx/black7B.gif | Bin 0 -> 54 bytes share/vtx/black7C.gif | Bin 0 -> 53 bytes share/vtx/black7D.gif | Bin 0 -> 55 bytes share/vtx/black7E.gif | Bin 0 -> 54 bytes share/vtx/black7F.gif | Bin 0 -> 49 bytes share/vtx/blue20.gif | Bin 0 -> 49 bytes share/vtx/blue21.gif | Bin 0 -> 54 bytes share/vtx/blue22.gif | Bin 0 -> 55 bytes share/vtx/blue23.gif | Bin 0 -> 53 bytes share/vtx/blue24.gif | Bin 0 -> 54 bytes share/vtx/blue25.gif | Bin 0 -> 58 bytes share/vtx/blue26.gif | Bin 0 -> 58 bytes share/vtx/blue27.gif | Bin 0 -> 55 bytes share/vtx/blue28.gif | Bin 0 -> 54 bytes share/vtx/blue29.gif | Bin 0 -> 58 bytes share/vtx/blue2A.gif | Bin 0 -> 58 bytes share/vtx/blue2B.gif | Bin 0 -> 56 bytes share/vtx/blue2C.gif | Bin 0 -> 53 bytes share/vtx/blue2D.gif | Bin 0 -> 57 bytes share/vtx/blue2E.gif | Bin 0 -> 56 bytes share/vtx/blue2F.gif | Bin 0 -> 53 bytes share/vtx/blue30.gif | Bin 0 -> 54 bytes share/vtx/blue31.gif | Bin 0 -> 58 bytes share/vtx/blue32.gif | Bin 0 -> 58 bytes share/vtx/blue33.gif | Bin 0 -> 55 bytes share/vtx/blue34.gif | Bin 0 -> 56 bytes share/vtx/blue35.gif | Bin 0 -> 60 bytes share/vtx/blue36.gif | Bin 0 -> 60 bytes share/vtx/blue37.gif | Bin 0 -> 57 bytes share/vtx/blue38.gif | Bin 0 -> 57 bytes share/vtx/blue39.gif | Bin 0 -> 60 bytes share/vtx/blue3A.gif | Bin 0 -> 60 bytes share/vtx/blue3B.gif | Bin 0 -> 56 bytes share/vtx/blue3C.gif | Bin 0 -> 55 bytes share/vtx/blue3D.gif | Bin 0 -> 58 bytes share/vtx/blue3E.gif | Bin 0 -> 58 bytes share/vtx/blue3F.gif | Bin 0 -> 54 bytes share/vtx/blue60.gif | Bin 0 -> 54 bytes share/vtx/blue61.gif | Bin 0 -> 58 bytes share/vtx/blue62.gif | Bin 0 -> 58 bytes share/vtx/blue63.gif | Bin 0 -> 55 bytes share/vtx/blue64.gif | Bin 0 -> 56 bytes share/vtx/blue65.gif | Bin 0 -> 60 bytes share/vtx/blue66.gif | Bin 0 -> 60 bytes share/vtx/blue67.gif | Bin 0 -> 57 bytes share/vtx/blue68.gif | Bin 0 -> 57 bytes share/vtx/blue69.gif | Bin 0 -> 60 bytes share/vtx/blue6A.gif | Bin 0 -> 60 bytes share/vtx/blue6B.gif | Bin 0 -> 56 bytes share/vtx/blue6C.gif | Bin 0 -> 55 bytes share/vtx/blue6D.gif | Bin 0 -> 58 bytes share/vtx/blue6E.gif | Bin 0 -> 58 bytes share/vtx/blue6F.gif | Bin 0 -> 54 bytes share/vtx/blue70.gif | Bin 0 -> 53 bytes share/vtx/blue71.gif | Bin 0 -> 56 bytes share/vtx/blue72.gif | Bin 0 -> 57 bytes share/vtx/blue73.gif | Bin 0 -> 53 bytes share/vtx/blue74.gif | Bin 0 -> 56 bytes share/vtx/blue75.gif | Bin 0 -> 58 bytes share/vtx/blue76.gif | Bin 0 -> 58 bytes share/vtx/blue77.gif | Bin 0 -> 54 bytes share/vtx/blue78.gif | Bin 0 -> 55 bytes share/vtx/blue79.gif | Bin 0 -> 58 bytes share/vtx/blue7A.gif | Bin 0 -> 58 bytes share/vtx/blue7B.gif | Bin 0 -> 54 bytes share/vtx/blue7C.gif | Bin 0 -> 53 bytes share/vtx/blue7D.gif | Bin 0 -> 55 bytes share/vtx/blue7E.gif | Bin 0 -> 54 bytes share/vtx/blue7F.gif | Bin 0 -> 49 bytes share/vtx/cyan20.gif | Bin 0 -> 49 bytes share/vtx/cyan21.gif | Bin 0 -> 54 bytes share/vtx/cyan22.gif | Bin 0 -> 55 bytes share/vtx/cyan23.gif | Bin 0 -> 53 bytes share/vtx/cyan24.gif | Bin 0 -> 54 bytes share/vtx/cyan25.gif | Bin 0 -> 58 bytes share/vtx/cyan26.gif | Bin 0 -> 58 bytes share/vtx/cyan27.gif | Bin 0 -> 55 bytes share/vtx/cyan28.gif | Bin 0 -> 54 bytes share/vtx/cyan29.gif | Bin 0 -> 58 bytes share/vtx/cyan2A.gif | Bin 0 -> 58 bytes share/vtx/cyan2B.gif | Bin 0 -> 56 bytes share/vtx/cyan2C.gif | Bin 0 -> 53 bytes share/vtx/cyan2D.gif | Bin 0 -> 57 bytes share/vtx/cyan2E.gif | Bin 0 -> 56 bytes share/vtx/cyan2F.gif | Bin 0 -> 53 bytes share/vtx/cyan30.gif | Bin 0 -> 54 bytes share/vtx/cyan31.gif | Bin 0 -> 58 bytes share/vtx/cyan32.gif | Bin 0 -> 58 bytes share/vtx/cyan33.gif | Bin 0 -> 55 bytes share/vtx/cyan34.gif | Bin 0 -> 56 bytes share/vtx/cyan35.gif | Bin 0 -> 60 bytes share/vtx/cyan36.gif | Bin 0 -> 60 bytes share/vtx/cyan37.gif | Bin 0 -> 57 bytes share/vtx/cyan38.gif | Bin 0 -> 57 bytes share/vtx/cyan39.gif | Bin 0 -> 60 bytes share/vtx/cyan3A.gif | Bin 0 -> 60 bytes share/vtx/cyan3B.gif | Bin 0 -> 56 bytes share/vtx/cyan3C.gif | Bin 0 -> 55 bytes share/vtx/cyan3D.gif | Bin 0 -> 58 bytes share/vtx/cyan3E.gif | Bin 0 -> 58 bytes share/vtx/cyan3F.gif | Bin 0 -> 54 bytes share/vtx/cyan60.gif | Bin 0 -> 54 bytes share/vtx/cyan61.gif | Bin 0 -> 58 bytes share/vtx/cyan62.gif | Bin 0 -> 58 bytes share/vtx/cyan63.gif | Bin 0 -> 55 bytes share/vtx/cyan64.gif | Bin 0 -> 56 bytes share/vtx/cyan65.gif | Bin 0 -> 60 bytes share/vtx/cyan66.gif | Bin 0 -> 60 bytes share/vtx/cyan67.gif | Bin 0 -> 57 bytes share/vtx/cyan68.gif | Bin 0 -> 57 bytes share/vtx/cyan69.gif | Bin 0 -> 60 bytes share/vtx/cyan6A.gif | Bin 0 -> 60 bytes share/vtx/cyan6B.gif | Bin 0 -> 56 bytes share/vtx/cyan6C.gif | Bin 0 -> 55 bytes share/vtx/cyan6D.gif | Bin 0 -> 58 bytes share/vtx/cyan6E.gif | Bin 0 -> 58 bytes share/vtx/cyan6F.gif | Bin 0 -> 54 bytes share/vtx/cyan70.gif | Bin 0 -> 53 bytes share/vtx/cyan71.gif | Bin 0 -> 56 bytes share/vtx/cyan72.gif | Bin 0 -> 57 bytes share/vtx/cyan73.gif | Bin 0 -> 53 bytes share/vtx/cyan74.gif | Bin 0 -> 56 bytes share/vtx/cyan75.gif | Bin 0 -> 58 bytes share/vtx/cyan76.gif | Bin 0 -> 58 bytes share/vtx/cyan77.gif | Bin 0 -> 54 bytes share/vtx/cyan78.gif | Bin 0 -> 55 bytes share/vtx/cyan79.gif | Bin 0 -> 58 bytes share/vtx/cyan7A.gif | Bin 0 -> 58 bytes share/vtx/cyan7B.gif | Bin 0 -> 54 bytes share/vtx/cyan7C.gif | Bin 0 -> 53 bytes share/vtx/cyan7D.gif | Bin 0 -> 55 bytes share/vtx/cyan7E.gif | Bin 0 -> 54 bytes share/vtx/cyan7F.gif | Bin 0 -> 49 bytes share/vtx/green20.gif | Bin 0 -> 49 bytes share/vtx/green21.gif | Bin 0 -> 54 bytes share/vtx/green22.gif | Bin 0 -> 55 bytes share/vtx/green23.gif | Bin 0 -> 53 bytes share/vtx/green24.gif | Bin 0 -> 54 bytes share/vtx/green25.gif | Bin 0 -> 58 bytes share/vtx/green26.gif | Bin 0 -> 58 bytes share/vtx/green27.gif | Bin 0 -> 55 bytes share/vtx/green28.gif | Bin 0 -> 54 bytes share/vtx/green29.gif | Bin 0 -> 58 bytes share/vtx/green2A.gif | Bin 0 -> 58 bytes share/vtx/green2B.gif | Bin 0 -> 56 bytes share/vtx/green2C.gif | Bin 0 -> 53 bytes share/vtx/green2D.gif | Bin 0 -> 57 bytes share/vtx/green2E.gif | Bin 0 -> 56 bytes share/vtx/green2F.gif | Bin 0 -> 53 bytes share/vtx/green30.gif | Bin 0 -> 54 bytes share/vtx/green31.gif | Bin 0 -> 58 bytes share/vtx/green32.gif | Bin 0 -> 58 bytes share/vtx/green33.gif | Bin 0 -> 55 bytes share/vtx/green34.gif | Bin 0 -> 56 bytes share/vtx/green35.gif | Bin 0 -> 60 bytes share/vtx/green36.gif | Bin 0 -> 60 bytes share/vtx/green37.gif | Bin 0 -> 57 bytes share/vtx/green38.gif | Bin 0 -> 57 bytes share/vtx/green39.gif | Bin 0 -> 60 bytes share/vtx/green3A.gif | Bin 0 -> 60 bytes share/vtx/green3B.gif | Bin 0 -> 56 bytes share/vtx/green3C.gif | Bin 0 -> 55 bytes share/vtx/green3D.gif | Bin 0 -> 58 bytes share/vtx/green3E.gif | Bin 0 -> 58 bytes share/vtx/green3F.gif | Bin 0 -> 54 bytes share/vtx/green60.gif | Bin 0 -> 54 bytes share/vtx/green61.gif | Bin 0 -> 58 bytes share/vtx/green62.gif | Bin 0 -> 58 bytes share/vtx/green63.gif | Bin 0 -> 55 bytes share/vtx/green64.gif | Bin 0 -> 56 bytes share/vtx/green65.gif | Bin 0 -> 60 bytes share/vtx/green66.gif | Bin 0 -> 60 bytes share/vtx/green67.gif | Bin 0 -> 57 bytes share/vtx/green68.gif | Bin 0 -> 57 bytes share/vtx/green69.gif | Bin 0 -> 60 bytes share/vtx/green6A.gif | Bin 0 -> 60 bytes share/vtx/green6B.gif | Bin 0 -> 56 bytes share/vtx/green6C.gif | Bin 0 -> 55 bytes share/vtx/green6D.gif | Bin 0 -> 58 bytes share/vtx/green6E.gif | Bin 0 -> 58 bytes share/vtx/green6F.gif | Bin 0 -> 54 bytes share/vtx/green70.gif | Bin 0 -> 53 bytes share/vtx/green71.gif | Bin 0 -> 56 bytes share/vtx/green72.gif | Bin 0 -> 57 bytes share/vtx/green73.gif | Bin 0 -> 53 bytes share/vtx/green74.gif | Bin 0 -> 56 bytes share/vtx/green75.gif | Bin 0 -> 58 bytes share/vtx/green76.gif | Bin 0 -> 58 bytes share/vtx/green77.gif | Bin 0 -> 54 bytes share/vtx/green78.gif | Bin 0 -> 55 bytes share/vtx/green79.gif | Bin 0 -> 58 bytes share/vtx/green7A.gif | Bin 0 -> 58 bytes share/vtx/green7B.gif | Bin 0 -> 54 bytes share/vtx/green7C.gif | Bin 0 -> 53 bytes share/vtx/green7D.gif | Bin 0 -> 55 bytes share/vtx/green7E.gif | Bin 0 -> 54 bytes share/vtx/green7F.gif | Bin 0 -> 49 bytes share/vtx/magenta20.gif | Bin 0 -> 49 bytes share/vtx/magenta21.gif | Bin 0 -> 54 bytes share/vtx/magenta22.gif | Bin 0 -> 55 bytes share/vtx/magenta23.gif | Bin 0 -> 53 bytes share/vtx/magenta24.gif | Bin 0 -> 54 bytes share/vtx/magenta25.gif | Bin 0 -> 58 bytes share/vtx/magenta26.gif | Bin 0 -> 58 bytes share/vtx/magenta27.gif | Bin 0 -> 55 bytes share/vtx/magenta28.gif | Bin 0 -> 54 bytes share/vtx/magenta29.gif | Bin 0 -> 58 bytes share/vtx/magenta2A.gif | Bin 0 -> 58 bytes share/vtx/magenta2B.gif | Bin 0 -> 56 bytes share/vtx/magenta2C.gif | Bin 0 -> 53 bytes share/vtx/magenta2D.gif | Bin 0 -> 57 bytes share/vtx/magenta2E.gif | Bin 0 -> 56 bytes share/vtx/magenta2F.gif | Bin 0 -> 53 bytes share/vtx/magenta30.gif | Bin 0 -> 54 bytes share/vtx/magenta31.gif | Bin 0 -> 58 bytes share/vtx/magenta32.gif | Bin 0 -> 58 bytes share/vtx/magenta33.gif | Bin 0 -> 55 bytes share/vtx/magenta34.gif | Bin 0 -> 56 bytes share/vtx/magenta35.gif | Bin 0 -> 60 bytes share/vtx/magenta36.gif | Bin 0 -> 60 bytes share/vtx/magenta37.gif | Bin 0 -> 57 bytes share/vtx/magenta38.gif | Bin 0 -> 57 bytes share/vtx/magenta39.gif | Bin 0 -> 60 bytes share/vtx/magenta3A.gif | Bin 0 -> 60 bytes share/vtx/magenta3B.gif | Bin 0 -> 56 bytes share/vtx/magenta3C.gif | Bin 0 -> 55 bytes share/vtx/magenta3D.gif | Bin 0 -> 58 bytes share/vtx/magenta3E.gif | Bin 0 -> 58 bytes share/vtx/magenta3F.gif | Bin 0 -> 54 bytes share/vtx/magenta60.gif | Bin 0 -> 54 bytes share/vtx/magenta61.gif | Bin 0 -> 58 bytes share/vtx/magenta62.gif | Bin 0 -> 58 bytes share/vtx/magenta63.gif | Bin 0 -> 55 bytes share/vtx/magenta64.gif | Bin 0 -> 56 bytes share/vtx/magenta65.gif | Bin 0 -> 60 bytes share/vtx/magenta66.gif | Bin 0 -> 60 bytes share/vtx/magenta67.gif | Bin 0 -> 57 bytes share/vtx/magenta68.gif | Bin 0 -> 57 bytes share/vtx/magenta69.gif | Bin 0 -> 60 bytes share/vtx/magenta6A.gif | Bin 0 -> 60 bytes share/vtx/magenta6B.gif | Bin 0 -> 56 bytes share/vtx/magenta6C.gif | Bin 0 -> 55 bytes share/vtx/magenta6D.gif | Bin 0 -> 58 bytes share/vtx/magenta6E.gif | Bin 0 -> 58 bytes share/vtx/magenta6F.gif | Bin 0 -> 54 bytes share/vtx/magenta70.gif | Bin 0 -> 53 bytes share/vtx/magenta71.gif | Bin 0 -> 56 bytes share/vtx/magenta72.gif | Bin 0 -> 57 bytes share/vtx/magenta73.gif | Bin 0 -> 53 bytes share/vtx/magenta74.gif | Bin 0 -> 56 bytes share/vtx/magenta75.gif | Bin 0 -> 58 bytes share/vtx/magenta76.gif | Bin 0 -> 58 bytes share/vtx/magenta77.gif | Bin 0 -> 54 bytes share/vtx/magenta78.gif | Bin 0 -> 55 bytes share/vtx/magenta79.gif | Bin 0 -> 58 bytes share/vtx/magenta7A.gif | Bin 0 -> 58 bytes share/vtx/magenta7B.gif | Bin 0 -> 54 bytes share/vtx/magenta7C.gif | Bin 0 -> 53 bytes share/vtx/magenta7D.gif | Bin 0 -> 55 bytes share/vtx/magenta7E.gif | Bin 0 -> 54 bytes share/vtx/magenta7F.gif | Bin 0 -> 49 bytes share/vtx/red20.gif | Bin 0 -> 49 bytes share/vtx/red21.gif | Bin 0 -> 54 bytes share/vtx/red22.gif | Bin 0 -> 55 bytes share/vtx/red23.gif | Bin 0 -> 53 bytes share/vtx/red24.gif | Bin 0 -> 54 bytes share/vtx/red25.gif | Bin 0 -> 58 bytes share/vtx/red26.gif | Bin 0 -> 58 bytes share/vtx/red27.gif | Bin 0 -> 55 bytes share/vtx/red28.gif | Bin 0 -> 54 bytes share/vtx/red29.gif | Bin 0 -> 58 bytes share/vtx/red2A.gif | Bin 0 -> 58 bytes share/vtx/red2B.gif | Bin 0 -> 56 bytes share/vtx/red2C.gif | Bin 0 -> 53 bytes share/vtx/red2D.gif | Bin 0 -> 57 bytes share/vtx/red2E.gif | Bin 0 -> 56 bytes share/vtx/red2F.gif | Bin 0 -> 53 bytes share/vtx/red30.gif | Bin 0 -> 54 bytes share/vtx/red31.gif | Bin 0 -> 58 bytes share/vtx/red32.gif | Bin 0 -> 58 bytes share/vtx/red33.gif | Bin 0 -> 55 bytes share/vtx/red34.gif | Bin 0 -> 56 bytes share/vtx/red35.gif | Bin 0 -> 60 bytes share/vtx/red36.gif | Bin 0 -> 60 bytes share/vtx/red37.gif | Bin 0 -> 57 bytes share/vtx/red38.gif | Bin 0 -> 57 bytes share/vtx/red39.gif | Bin 0 -> 60 bytes share/vtx/red3A.gif | Bin 0 -> 60 bytes share/vtx/red3B.gif | Bin 0 -> 56 bytes share/vtx/red3C.gif | Bin 0 -> 55 bytes share/vtx/red3D.gif | Bin 0 -> 58 bytes share/vtx/red3E.gif | Bin 0 -> 58 bytes share/vtx/red3F.gif | Bin 0 -> 54 bytes share/vtx/red60.gif | Bin 0 -> 54 bytes share/vtx/red61.gif | Bin 0 -> 58 bytes share/vtx/red62.gif | Bin 0 -> 58 bytes share/vtx/red63.gif | Bin 0 -> 55 bytes share/vtx/red64.gif | Bin 0 -> 56 bytes share/vtx/red65.gif | Bin 0 -> 60 bytes share/vtx/red66.gif | Bin 0 -> 60 bytes share/vtx/red67.gif | Bin 0 -> 57 bytes share/vtx/red68.gif | Bin 0 -> 57 bytes share/vtx/red69.gif | Bin 0 -> 60 bytes share/vtx/red6A.gif | Bin 0 -> 60 bytes share/vtx/red6B.gif | Bin 0 -> 56 bytes share/vtx/red6C.gif | Bin 0 -> 55 bytes share/vtx/red6D.gif | Bin 0 -> 58 bytes share/vtx/red6E.gif | Bin 0 -> 58 bytes share/vtx/red6F.gif | Bin 0 -> 54 bytes share/vtx/red70.gif | Bin 0 -> 53 bytes share/vtx/red71.gif | Bin 0 -> 56 bytes share/vtx/red72.gif | Bin 0 -> 57 bytes share/vtx/red73.gif | Bin 0 -> 53 bytes share/vtx/red74.gif | Bin 0 -> 56 bytes share/vtx/red75.gif | Bin 0 -> 58 bytes share/vtx/red76.gif | Bin 0 -> 58 bytes share/vtx/red77.gif | Bin 0 -> 54 bytes share/vtx/red78.gif | Bin 0 -> 55 bytes share/vtx/red79.gif | Bin 0 -> 58 bytes share/vtx/red7A.gif | Bin 0 -> 58 bytes share/vtx/red7B.gif | Bin 0 -> 54 bytes share/vtx/red7C.gif | Bin 0 -> 53 bytes share/vtx/red7D.gif | Bin 0 -> 55 bytes share/vtx/red7E.gif | Bin 0 -> 54 bytes share/vtx/red7F.gif | Bin 0 -> 49 bytes share/vtx/white20.gif | Bin 0 -> 49 bytes share/vtx/white21.gif | Bin 0 -> 54 bytes share/vtx/white22.gif | Bin 0 -> 55 bytes share/vtx/white23.gif | Bin 0 -> 53 bytes share/vtx/white24.gif | Bin 0 -> 54 bytes share/vtx/white25.gif | Bin 0 -> 58 bytes share/vtx/white26.gif | Bin 0 -> 58 bytes share/vtx/white27.gif | Bin 0 -> 55 bytes share/vtx/white28.gif | Bin 0 -> 54 bytes share/vtx/white29.gif | Bin 0 -> 58 bytes share/vtx/white2A.gif | Bin 0 -> 58 bytes share/vtx/white2B.gif | Bin 0 -> 56 bytes share/vtx/white2C.gif | Bin 0 -> 53 bytes share/vtx/white2D.gif | Bin 0 -> 57 bytes share/vtx/white2E.gif | Bin 0 -> 56 bytes share/vtx/white2F.gif | Bin 0 -> 53 bytes share/vtx/white30.gif | Bin 0 -> 54 bytes share/vtx/white31.gif | Bin 0 -> 58 bytes share/vtx/white32.gif | Bin 0 -> 58 bytes share/vtx/white33.gif | Bin 0 -> 55 bytes share/vtx/white34.gif | Bin 0 -> 56 bytes share/vtx/white35.gif | Bin 0 -> 60 bytes share/vtx/white36.gif | Bin 0 -> 60 bytes share/vtx/white37.gif | Bin 0 -> 57 bytes share/vtx/white38.gif | Bin 0 -> 57 bytes share/vtx/white39.gif | Bin 0 -> 60 bytes share/vtx/white3A.gif | Bin 0 -> 60 bytes share/vtx/white3B.gif | Bin 0 -> 56 bytes share/vtx/white3C.gif | Bin 0 -> 55 bytes share/vtx/white3D.gif | Bin 0 -> 58 bytes share/vtx/white3E.gif | Bin 0 -> 58 bytes share/vtx/white3F.gif | Bin 0 -> 54 bytes share/vtx/white60.gif | Bin 0 -> 54 bytes share/vtx/white61.gif | Bin 0 -> 58 bytes share/vtx/white62.gif | Bin 0 -> 58 bytes share/vtx/white63.gif | Bin 0 -> 55 bytes share/vtx/white64.gif | Bin 0 -> 56 bytes share/vtx/white65.gif | Bin 0 -> 60 bytes share/vtx/white66.gif | Bin 0 -> 60 bytes share/vtx/white67.gif | Bin 0 -> 57 bytes share/vtx/white68.gif | Bin 0 -> 57 bytes share/vtx/white69.gif | Bin 0 -> 60 bytes share/vtx/white6A.gif | Bin 0 -> 60 bytes share/vtx/white6B.gif | Bin 0 -> 56 bytes share/vtx/white6C.gif | Bin 0 -> 55 bytes share/vtx/white6D.gif | Bin 0 -> 58 bytes share/vtx/white6E.gif | Bin 0 -> 58 bytes share/vtx/white6F.gif | Bin 0 -> 54 bytes share/vtx/white70.gif | Bin 0 -> 53 bytes share/vtx/white71.gif | Bin 0 -> 56 bytes share/vtx/white72.gif | Bin 0 -> 57 bytes share/vtx/white73.gif | Bin 0 -> 53 bytes share/vtx/white74.gif | Bin 0 -> 56 bytes share/vtx/white75.gif | Bin 0 -> 58 bytes share/vtx/white76.gif | Bin 0 -> 58 bytes share/vtx/white77.gif | Bin 0 -> 54 bytes share/vtx/white78.gif | Bin 0 -> 55 bytes share/vtx/white79.gif | Bin 0 -> 58 bytes share/vtx/white7A.gif | Bin 0 -> 58 bytes share/vtx/white7B.gif | Bin 0 -> 54 bytes share/vtx/white7C.gif | Bin 0 -> 53 bytes share/vtx/white7D.gif | Bin 0 -> 55 bytes share/vtx/white7E.gif | Bin 0 -> 54 bytes share/vtx/white7F.gif | Bin 0 -> 49 bytes share/vtx/yellow20.gif | Bin 0 -> 49 bytes share/vtx/yellow21.gif | Bin 0 -> 54 bytes share/vtx/yellow22.gif | Bin 0 -> 55 bytes share/vtx/yellow23.gif | Bin 0 -> 53 bytes share/vtx/yellow24.gif | Bin 0 -> 54 bytes share/vtx/yellow25.gif | Bin 0 -> 58 bytes share/vtx/yellow26.gif | Bin 0 -> 58 bytes share/vtx/yellow27.gif | Bin 0 -> 55 bytes share/vtx/yellow28.gif | Bin 0 -> 54 bytes share/vtx/yellow29.gif | Bin 0 -> 58 bytes share/vtx/yellow2A.gif | Bin 0 -> 58 bytes share/vtx/yellow2B.gif | Bin 0 -> 56 bytes share/vtx/yellow2C.gif | Bin 0 -> 53 bytes share/vtx/yellow2D.gif | Bin 0 -> 57 bytes share/vtx/yellow2E.gif | Bin 0 -> 56 bytes share/vtx/yellow2F.gif | Bin 0 -> 53 bytes share/vtx/yellow30.gif | Bin 0 -> 54 bytes share/vtx/yellow31.gif | Bin 0 -> 58 bytes share/vtx/yellow32.gif | Bin 0 -> 58 bytes share/vtx/yellow33.gif | Bin 0 -> 55 bytes share/vtx/yellow34.gif | Bin 0 -> 56 bytes share/vtx/yellow35.gif | Bin 0 -> 60 bytes share/vtx/yellow36.gif | Bin 0 -> 60 bytes share/vtx/yellow37.gif | Bin 0 -> 57 bytes share/vtx/yellow38.gif | Bin 0 -> 57 bytes share/vtx/yellow39.gif | Bin 0 -> 60 bytes share/vtx/yellow3A.gif | Bin 0 -> 60 bytes share/vtx/yellow3B.gif | Bin 0 -> 56 bytes share/vtx/yellow3C.gif | Bin 0 -> 55 bytes share/vtx/yellow3D.gif | Bin 0 -> 58 bytes share/vtx/yellow3E.gif | Bin 0 -> 58 bytes share/vtx/yellow3F.gif | Bin 0 -> 54 bytes share/vtx/yellow60.gif | Bin 0 -> 54 bytes share/vtx/yellow61.gif | Bin 0 -> 58 bytes share/vtx/yellow62.gif | Bin 0 -> 58 bytes share/vtx/yellow63.gif | Bin 0 -> 55 bytes share/vtx/yellow64.gif | Bin 0 -> 56 bytes share/vtx/yellow65.gif | Bin 0 -> 60 bytes share/vtx/yellow66.gif | Bin 0 -> 60 bytes share/vtx/yellow67.gif | Bin 0 -> 57 bytes share/vtx/yellow68.gif | Bin 0 -> 57 bytes share/vtx/yellow69.gif | Bin 0 -> 60 bytes share/vtx/yellow6A.gif | Bin 0 -> 60 bytes share/vtx/yellow6B.gif | Bin 0 -> 56 bytes share/vtx/yellow6C.gif | Bin 0 -> 55 bytes share/vtx/yellow6D.gif | Bin 0 -> 58 bytes share/vtx/yellow6E.gif | Bin 0 -> 58 bytes share/vtx/yellow6F.gif | Bin 0 -> 54 bytes share/vtx/yellow70.gif | Bin 0 -> 53 bytes share/vtx/yellow71.gif | Bin 0 -> 56 bytes share/vtx/yellow72.gif | Bin 0 -> 57 bytes share/vtx/yellow73.gif | Bin 0 -> 53 bytes share/vtx/yellow74.gif | Bin 0 -> 56 bytes share/vtx/yellow75.gif | Bin 0 -> 58 bytes share/vtx/yellow76.gif | Bin 0 -> 58 bytes share/vtx/yellow77.gif | Bin 0 -> 54 bytes share/vtx/yellow78.gif | Bin 0 -> 55 bytes share/vtx/yellow79.gif | Bin 0 -> 58 bytes share/vtx/yellow7A.gif | Bin 0 -> 58 bytes share/vtx/yellow7B.gif | Bin 0 -> 54 bytes share/vtx/yellow7C.gif | Bin 0 -> 53 bytes share/vtx/yellow7D.gif | Bin 0 -> 55 bytes share/vtx/yellow7E.gif | Bin 0 -> 54 bytes share/vtx/yellow7F.gif | Bin 0 -> 49 bytes wml/images/apply.wbm | Bin 0 -> 30 bytes wml/images/back.wbm | Bin 0 -> 36 bytes wml/images/delete.wbm | Bin 0 -> 36 bytes wml/images/edit.wbm | Bin 0 -> 36 bytes wml/images/find.wbm | Bin 0 -> 36 bytes wml/images/forward.wbm | Bin 0 -> 36 bytes wml/images/home.wbm | Bin 0 -> 36 bytes wml/images/movie.wbm | Bin 0 -> 388 bytes wml/images/new.wbm | Bin 0 -> 36 bytes wml/images/off.wbm | Bin 0 -> 36 bytes wml/images/on.wbm | Bin 0 -> 36 bytes wml/images/onoff.wbm | Bin 0 -> 36 bytes wml/images/record.wbm | Bin 0 -> 36 bytes wml/images/refresh.wbm | Bin 0 -> 36 bytes wml/images/watch.wbm | Bin 0 -> 36 bytes wml/images/xxv.wbm | Bin 0 -> 132 bytes wml/next.tmpl | 1 + wml/now.tmpl | 49 + wml/program.tmpl | 80 + wml/search.tmpl | 51 + wml/skin.cfg | 15 + wml/tlist.tmpl | 79 + wml/tsearch.tmpl | 1 + wml/wapd.tmpl | 2 + wml/widgets/checkbox.tmpl | 17 + wml/widgets/confirm.tmpl | 13 + wml/widgets/date.tmpl | 1 + wml/widgets/dir.tmpl | 12 + wml/widgets/err.tmpl | 21 + wml/widgets/file.tmpl | 10 + wml/widgets/footer.tmpl | 22 + wml/widgets/formEnd.tmpl | 7 + wml/widgets/formStart.tmpl | 18 + wml/widgets/hidden.tmpl | 3 + wml/widgets/host.tmpl | 4 + wml/widgets/integer.tmpl | 4 + wml/widgets/link.tmpl | 1 + wml/widgets/list.tmpl | 27 + wml/widgets/littlemenu.tmpl | 10 + wml/widgets/menu.tmpl | 18 + wml/widgets/message.tmpl | 21 + wml/widgets/password.tmpl | 4 + wml/widgets/radio.tmpl | 17 + wml/widgets/redirect.tmpl | 1 + wml/widgets/start.tmpl | 5 + wml/widgets/string.tmpl | 4 + wml/widgets/table.tmpl | 35 + 1119 files changed, 169949 insertions(+) create mode 100644 Makefile create mode 100644 README.txt create mode 100755 bin/xxvd create mode 100644 contrib/README create mode 100755 contrib/at-vdradmin2xxv.pl create mode 100755 contrib/chronicle-remove-duplicate.pl create mode 100644 contrib/create-database.sql create mode 100644 contrib/export-data.sql create mode 100644 contrib/import-data.sql create mode 100755 contrib/update-xxv create mode 100644 contrib/upgrade-xxv-db.sql create mode 120000 default create mode 100644 doc/CHANGELOG.txt create mode 100644 doc/COPYING.txt create mode 100644 doc/LIESMICH.txt create mode 100644 doc/Makefile create mode 100644 doc/NEWS.txt create mode 100644 doc/README.txt create mode 100644 doc/TODO.txt create mode 100644 doc/TUTORIAL.txt.gz create mode 100644 doc/docu.tmpl create mode 100644 doc/xxvd.1 create mode 100644 doc/xxvd.sgml create mode 100644 etc/logrotate.d/xxvd create mode 100755 etc/xxvd create mode 100644 etc/xxvd.cfg.example create mode 100644 html/alist.tmpl create mode 120000 html/asearch.tmpl create mode 100644 html/bloecke/event_links.tmpl create mode 100644 html/bloecke/links.tmpl create mode 100644 html/bloecke/percentbar.tmpl create mode 100644 html/bloecke/stars.tmpl create mode 100644 html/bloecke/tooltip.tmpl create mode 100644 html/clist.tmpl create mode 100644 html/cmdlist.tmpl create mode 100644 html/display.tmpl create mode 100644 html/favicon.ico create mode 100644 html/filesys.tmpl create mode 100644 html/help.tmpl create mode 100644 html/images/16_9Screen.png create mode 100644 html/images/1_stars.png create mode 100644 html/images/2_stars.png create mode 100644 html/images/3_stars.png create mode 100644 html/images/4_3Screen.png create mode 100644 html/images/4_stars.png create mode 100644 html/images/5_stars.png create mode 100644 html/images/I.png create mode 100644 html/images/L.png create mode 100644 html/images/Lminus.png create mode 100644 html/images/Lplus.png create mode 100644 html/images/T.png create mode 100644 html/images/Tminus.png create mode 100644 html/images/Tplus.png create mode 100644 html/images/arrow.down.png create mode 100644 html/images/arrow.right.png create mode 100644 html/images/asc.png create mode 100644 html/images/at.png create mode 100644 html/images/back.png create mode 100644 html/images/back_big.png create mode 100644 html/images/bar_green.png create mode 100644 html/images/bar_red.png create mode 100644 html/images/blank.png create mode 100644 html/images/delete.png create mode 100644 html/images/desc.png create mode 100644 html/images/dolby.png create mode 100644 html/images/down.png create mode 100644 html/images/edit.png create mode 100644 html/images/english.gif create mode 100644 html/images/exit.png create mode 100644 html/images/file.png create mode 100644 html/images/foldericon.png create mode 100644 html/images/french.gif create mode 100644 html/images/german.gif create mode 100644 html/images/leer.png create mode 100644 html/images/linkbg.png create mode 100755 html/images/logo.gif create mode 100644 html/images/menu_big.png create mode 100644 html/images/movie.png create mode 100644 html/images/new.png create mode 100644 html/images/newfolder.png create mode 100644 html/images/next.png create mode 100644 html/images/nocover.gif create mode 100644 html/images/notimers.png create mode 100644 html/images/oben.png create mode 100644 html/images/off.png create mode 100644 html/images/ok.png create mode 100644 html/images/on.png create mode 100644 html/images/openfoldericon.png create mode 100644 html/images/radio.png create mode 100644 html/images/record.png create mode 100644 html/images/record_blue.png create mode 100644 html/images/record_green.png create mode 100644 html/images/record_red.png create mode 100644 html/images/repeat.png create mode 100644 html/images/schnell_back.png create mode 100644 html/images/schnell_vor.png create mode 100644 html/images/spanish.gif create mode 100644 html/images/star.png create mode 100644 html/images/stardark.png create mode 100644 html/images/switch.png create mode 100644 html/images/timers.png create mode 100644 html/images/trans.gif create mode 100644 html/images/up.png create mode 100644 html/images/view_event.png create mode 100644 html/images/vor.png create mode 100644 html/images/xp/I.png create mode 100644 html/images/xp/L.png create mode 100644 html/images/xp/Lminus.png create mode 100644 html/images/xp/Lplus.png create mode 100644 html/images/xp/T.png create mode 100644 html/images/xp/Tminus.png create mode 100644 html/images/xp/Tplus.png create mode 100644 html/images/xp/file.png create mode 100644 html/images/xp/folder.png create mode 100644 html/images/xp/openfolder.png create mode 100644 html/images/xxv.gif create mode 100644 html/images/zurueck.png create mode 100644 html/index.tmpl create mode 100644 html/javascript/XHConn.js create mode 100644 html/javascript/coolmenus4.js create mode 100644 html/javascript/global.js create mode 100644 html/javascript/helptip.js create mode 100644 html/javascript/records.js create mode 100644 html/javascript/tabpane.js create mode 100644 html/javascript/tooltip.js create mode 100644 html/javascript/xtree.js create mode 100644 html/logger.tmpl create mode 100644 html/memory.tmpl create mode 120000 html/mlcopy.tmpl create mode 100644 html/mldisplay.tmpl create mode 100644 html/mledit.tmpl create mode 100644 html/mlgenres.tmpl create mode 120000 html/mlimport.tmpl create mode 100644 html/mlist.tmpl create mode 100644 html/mllist.tmpl create mode 100644 html/mllistmedias.tmpl create mode 100644 html/mlnavcontainer.tmpl create mode 100644 html/mlresearch.tmpl create mode 100644 html/mlsearch.tmpl create mode 100644 html/network.tmpl create mode 120000 html/next.tmpl create mode 100644 html/now.tmpl create mode 100644 html/program.tmpl create mode 100644 html/rdisplay.tmpl create mode 100644 html/report.tmpl create mode 100644 html/rlist.tmpl create mode 120000 html/rsearch.tmpl create mode 100644 html/schema.tmpl create mode 100644 html/search.tmpl create mode 100644 html/skin.cfg create mode 100644 html/style/coolmenus4.css create mode 100644 html/style/helptip.css create mode 100644 html/style/luna/tab.active.png create mode 100644 html/style/luna/tab.css create mode 100644 html/style/luna/tab.hover.png create mode 100644 html/style/luna/tab.png create mode 100644 html/style/style.css create mode 100644 html/style/xtree.css create mode 100644 html/tlist.tmpl create mode 100644 html/topten.tmpl create mode 120000 html/tsearch.tmpl create mode 100644 html/ulist.tmpl create mode 100644 html/vitals.tmpl create mode 100644 html/widgets/checkbox.tmpl create mode 100644 html/widgets/confirm.tmpl create mode 100644 html/widgets/date.tmpl create mode 100644 html/widgets/dir.tmpl create mode 100644 html/widgets/err.tmpl create mode 100644 html/widgets/file.tmpl create mode 100644 html/widgets/footer.tmpl create mode 100644 html/widgets/formEnd.tmpl create mode 100644 html/widgets/formStart.tmpl create mode 100644 html/widgets/hidden.tmpl create mode 100644 html/widgets/host.tmpl create mode 100644 html/widgets/integer.tmpl create mode 100644 html/widgets/link.tmpl create mode 100644 html/widgets/list.tmpl create mode 100644 html/widgets/littlemenu.tmpl create mode 100644 html/widgets/menu.tmpl create mode 100644 html/widgets/message.tmpl create mode 100644 html/widgets/password.tmpl create mode 100644 html/widgets/player.tmpl create mode 100644 html/widgets/radio.tmpl create mode 100644 html/widgets/redirect.tmpl create mode 100644 html/widgets/referer.tmpl create mode 100644 html/widgets/remote.tmpl create mode 100644 html/widgets/start.tmpl create mode 100644 html/widgets/string.tmpl create mode 100644 html/widgets/table.tmpl create mode 100644 html/widgets/url.tmpl create mode 100644 html/widgets/vtx.tmpl create mode 100644 html/widgets/wait.tmpl create mode 100755 install-debian.sh create mode 100755 install.sh create mode 100644 lib/Attribute/Handlers.pm create mode 100755 lib/Benchmark/Timer.pm create mode 100644 lib/Bundle/Xxv.pm create mode 100644 lib/CGI.pm create mode 100644 lib/CGI/Apache.pm create mode 100644 lib/CGI/Carp.pm create mode 100644 lib/CGI/Cookie.pm create mode 100644 lib/CGI/Fast.pm create mode 100644 lib/CGI/Pretty.pm create mode 100644 lib/CGI/Push.pm create mode 100644 lib/CGI/Switch.pm create mode 100644 lib/CGI/Util.pm create mode 100644 lib/Class/MakeMethods.pm create mode 100644 lib/Class/MakeMethods/Attribute.pm create mode 100644 lib/Class/MakeMethods/Autoload.pm create mode 100644 lib/Class/MakeMethods/Basic.pm create mode 100644 lib/Class/MakeMethods/Basic/Array.pm create mode 100644 lib/Class/MakeMethods/Basic/Global.pm create mode 100644 lib/Class/MakeMethods/Basic/Hash.pm create mode 100644 lib/Class/MakeMethods/Composite.pm create mode 100644 lib/Class/MakeMethods/Composite/Array.pm create mode 100644 lib/Class/MakeMethods/Composite/Global.pm create mode 100644 lib/Class/MakeMethods/Composite/Hash.pm create mode 100644 lib/Class/MakeMethods/Composite/Inheritable.pm create mode 100644 lib/Class/MakeMethods/Composite/Universal.pm create mode 100644 lib/Class/MakeMethods/Docs/Catalog.pod create mode 100644 lib/Class/MakeMethods/Docs/Changes.pod create mode 100644 lib/Class/MakeMethods/Docs/Examples.pod create mode 100644 lib/Class/MakeMethods/Docs/ReadMe.pod create mode 100644 lib/Class/MakeMethods/Docs/RelatedModules.pod create mode 100644 lib/Class/MakeMethods/Docs/ToDo.pod create mode 100644 lib/Class/MakeMethods/Emulator.pm create mode 100644 lib/Class/MakeMethods/Emulator/AccessorFast.pm create mode 100644 lib/Class/MakeMethods/Emulator/Inheritable.pm create mode 100644 lib/Class/MakeMethods/Emulator/MethodMaker.pm create mode 100644 lib/Class/MakeMethods/Emulator/Singleton.pm create mode 100644 lib/Class/MakeMethods/Emulator/Struct.pm create mode 100644 lib/Class/MakeMethods/Emulator/accessors.pm create mode 100644 lib/Class/MakeMethods/Emulator/mcoder.pm create mode 100644 lib/Class/MakeMethods/Evaled.pm create mode 100644 lib/Class/MakeMethods/Evaled/Hash.pm create mode 100644 lib/Class/MakeMethods/Standard.pm create mode 100644 lib/Class/MakeMethods/Standard/Array.pm create mode 100644 lib/Class/MakeMethods/Standard/Global.pm create mode 100644 lib/Class/MakeMethods/Standard/Hash.pm create mode 100644 lib/Class/MakeMethods/Standard/Inheritable.pm create mode 100644 lib/Class/MakeMethods/Standard/Universal.pm create mode 100644 lib/Class/MakeMethods/Template.pm create mode 100644 lib/Class/MakeMethods/Template/Array.pm create mode 100644 lib/Class/MakeMethods/Template/Class.pm create mode 100644 lib/Class/MakeMethods/Template/ClassInherit.pm create mode 100644 lib/Class/MakeMethods/Template/ClassName.pm create mode 100644 lib/Class/MakeMethods/Template/ClassVar.pm create mode 100644 lib/Class/MakeMethods/Template/Flyweight.pm create mode 100644 lib/Class/MakeMethods/Template/Generic.pm create mode 100644 lib/Class/MakeMethods/Template/Global.pm create mode 100644 lib/Class/MakeMethods/Template/Hash.pm create mode 100644 lib/Class/MakeMethods/Template/Inheritable.pm create mode 100644 lib/Class/MakeMethods/Template/InsideOut.pm create mode 100644 lib/Class/MakeMethods/Template/PackageVar.pm create mode 100644 lib/Class/MakeMethods/Template/Ref.pm create mode 100644 lib/Class/MakeMethods/Template/Scalar.pm create mode 100644 lib/Class/MakeMethods/Template/Static.pm create mode 100644 lib/Class/MakeMethods/Template/Struct.pm create mode 100644 lib/Class/MakeMethods/Template/StructBuiltin.pm create mode 100644 lib/Class/MakeMethods/Template/Universal.pm create mode 100644 lib/Class/MakeMethods/Utility/ArraySplicer.pm create mode 100644 lib/Class/MakeMethods/Utility/DiskCache.pm create mode 100644 lib/Class/MakeMethods/Utility/Inheritable.pm create mode 100644 lib/Class/MakeMethods/Utility/Ref.pm create mode 100644 lib/Class/MakeMethods/Utility/TextBuilder.pm create mode 100644 lib/Config/Tiny.pm create mode 100644 lib/Date/Manip.pm create mode 100644 lib/Digest/HMAC.pm create mode 100644 lib/Digest/HMAC_MD5.pm create mode 100644 lib/Digest/HMAC_SHA1.pm create mode 100644 lib/Event/File.pm create mode 100644 lib/Event/File/tail.pm create mode 100644 lib/GD/Graph/Data.pm create mode 100644 lib/GD/Graph/Error.pm create mode 100644 lib/GD/Graph/FAQ.pod create mode 100644 lib/GD/Graph/area.pm create mode 100644 lib/GD/Graph/axestype3d.pm create mode 100644 lib/GD/Graph/bars.pm create mode 100644 lib/GD/Graph/bars3d.pm create mode 100644 lib/GD/Graph/colour.pm create mode 100644 lib/GD/Graph/cylinder.pm create mode 100644 lib/GD/Graph/cylinder3d.pm create mode 100644 lib/GD/Graph/hbars.pm create mode 100644 lib/GD/Graph/lines.pm create mode 100644 lib/GD/Graph/lines3d.pm create mode 100644 lib/GD/Graph/linespoints.pm create mode 100644 lib/GD/Graph/mixed.pm create mode 100644 lib/GD/Graph/pie.pm create mode 100644 lib/GD/Graph/pie3d.pm create mode 100644 lib/GD/Graph/points.pm create mode 100644 lib/GD/Graph/utils.pm create mode 100644 lib/GD/Graph3d.pm create mode 100644 lib/HTML/TextToHTML.pm create mode 100644 lib/Locale/Maketext/Extract.pm create mode 100644 lib/Locale/Maketext/Extract/Run.pm create mode 100644 lib/Locale/Maketext/Lexicon.pm create mode 100644 lib/Locale/Maketext/Lexicon/Auto.pm create mode 100644 lib/Locale/Maketext/Lexicon/Gettext.pm create mode 100644 lib/Locale/Maketext/Lexicon/Msgcat.pm create mode 100644 lib/Locale/Maketext/Lexicon/Tie.pm create mode 100644 lib/MP3/Icecast.pm create mode 100644 lib/MP3/Info.pm create mode 100644 lib/Mail/SendEasy.pm create mode 100644 lib/Mail/SendEasy/AUTH.pm create mode 100644 lib/Mail/SendEasy/Base64.pm create mode 100644 lib/Mail/SendEasy/IOScalar.pm create mode 100644 lib/Mail/SendEasy/SMTP.pm create mode 100644 lib/MediaLibParser.pm create mode 100644 lib/MediaLibParser/DVDPalace.pm create mode 100644 lib/MediaLibParser/IMDb.pm create mode 100644 lib/Module/Reload.pm create mode 100644 lib/Net/Amazon.pm create mode 100644 lib/Net/Amazon/Attribute/Review.pm create mode 100644 lib/Net/Amazon/Attribute/ReviewSet.pm create mode 100644 lib/Net/Amazon/Property.pm create mode 100644 lib/Net/Amazon/Property/Book.pm create mode 100644 lib/Net/Amazon/Property/DVD.pm create mode 100644 lib/Net/Amazon/Property/Music.pm create mode 100644 lib/Net/Amazon/Request.pm create mode 100644 lib/Net/Amazon/Request/ASIN.pm create mode 100644 lib/Net/Amazon/Request/Artist.pm create mode 100644 lib/Net/Amazon/Request/Blended.pm create mode 100644 lib/Net/Amazon/Request/BrowseNode.pm create mode 100644 lib/Net/Amazon/Request/Exchange.pm create mode 100644 lib/Net/Amazon/Request/Keyword.pm create mode 100644 lib/Net/Amazon/Request/Manufacturer.pm create mode 100644 lib/Net/Amazon/Request/Power.pm create mode 100644 lib/Net/Amazon/Request/Seller.pm create mode 100644 lib/Net/Amazon/Request/Similar.pm create mode 100644 lib/Net/Amazon/Request/Sort.pm create mode 100644 lib/Net/Amazon/Request/TextStream.pm create mode 100644 lib/Net/Amazon/Request/UPC.pm create mode 100644 lib/Net/Amazon/Request/Wishlist.pm create mode 100644 lib/Net/Amazon/Response.pm create mode 100644 lib/Net/Amazon/Response/ASIN.pm create mode 100644 lib/Net/Amazon/Response/Artist.pm create mode 100644 lib/Net/Amazon/Response/Blended.pm create mode 100644 lib/Net/Amazon/Response/BrowseNode.pm create mode 100644 lib/Net/Amazon/Response/Exchange.pm create mode 100644 lib/Net/Amazon/Response/Keyword.pm create mode 100644 lib/Net/Amazon/Response/Manufacturer.pm create mode 100644 lib/Net/Amazon/Response/Power.pm create mode 100644 lib/Net/Amazon/Response/Seller.pm create mode 100644 lib/Net/Amazon/Response/Similar.pm create mode 100644 lib/Net/Amazon/Response/TextStream.pm create mode 100644 lib/Net/Amazon/Response/UPC.pm create mode 100644 lib/Net/Amazon/Response/Wishlist.pm create mode 100644 lib/Net/Amazon/Result/Seller.pm create mode 100644 lib/Net/Amazon/Result/Seller/Listing.pm create mode 100644 lib/Net/IP/Match/Regexp.pm create mode 100644 lib/Paths.pm create mode 100644 lib/Proc/Killfam.pm create mode 100755 lib/SOAP/Transport/HTTP/Event.pm create mode 100644 lib/Template.pm create mode 100644 lib/Template/Base.pm create mode 100644 lib/Template/Config.pm create mode 100644 lib/Template/Constants.pm create mode 100644 lib/Template/Context.pm create mode 100644 lib/Template/Directive.pm create mode 100644 lib/Template/Document.pm create mode 100644 lib/Template/Exception.pm create mode 100644 lib/Template/FAQ.pod create mode 100644 lib/Template/Filters.pm create mode 100644 lib/Template/Grammar.pm create mode 100644 lib/Template/Iterator.pm create mode 100644 lib/Template/Library/HTML.pod create mode 100644 lib/Template/Library/PostScript.pod create mode 100644 lib/Template/Library/Splash.pod create mode 100644 lib/Template/Manual.pod create mode 100644 lib/Template/Manual/Config.pod create mode 100644 lib/Template/Manual/Credits.pod create mode 100644 lib/Template/Manual/Directives.pod create mode 100644 lib/Template/Manual/Filters.pod create mode 100644 lib/Template/Manual/Internals.pod create mode 100644 lib/Template/Manual/Intro.pod create mode 100644 lib/Template/Manual/Plugins.pod create mode 100644 lib/Template/Manual/Refs.pod create mode 100644 lib/Template/Manual/Syntax.pod create mode 100644 lib/Template/Manual/VMethods.pod create mode 100644 lib/Template/Manual/Variables.pod create mode 100644 lib/Template/Manual/Views.pod create mode 100644 lib/Template/Modules.pod create mode 100644 lib/Template/Namespace/Constants.pm create mode 100644 lib/Template/Parser.pm create mode 100644 lib/Template/Plugin.pm create mode 100644 lib/Template/Plugin/Autoformat.pm create mode 100644 lib/Template/Plugin/CGI.pm create mode 100644 lib/Template/Plugin/DBI.pm create mode 100644 lib/Template/Plugin/Datafile.pm create mode 100644 lib/Template/Plugin/Date.pm create mode 100644 lib/Template/Plugin/Directory.pm create mode 100644 lib/Template/Plugin/Dumper.pm create mode 100644 lib/Template/Plugin/File.pm create mode 100644 lib/Template/Plugin/Filter.pm create mode 100644 lib/Template/Plugin/Format.pm create mode 100644 lib/Template/Plugin/GD/Constants.pm create mode 100644 lib/Template/Plugin/GD/Graph/area.pm create mode 100644 lib/Template/Plugin/GD/Graph/bars.pm create mode 100644 lib/Template/Plugin/GD/Graph/bars3d.pm create mode 100644 lib/Template/Plugin/GD/Graph/lines.pm create mode 100644 lib/Template/Plugin/GD/Graph/lines3d.pm create mode 100644 lib/Template/Plugin/GD/Graph/linespoints.pm create mode 100644 lib/Template/Plugin/GD/Graph/mixed.pm create mode 100644 lib/Template/Plugin/GD/Graph/pie.pm create mode 100644 lib/Template/Plugin/GD/Graph/pie3d.pm create mode 100644 lib/Template/Plugin/GD/Graph/points.pm create mode 100644 lib/Template/Plugin/GD/Image.pm create mode 100644 lib/Template/Plugin/GD/Polygon.pm create mode 100644 lib/Template/Plugin/GD/Text.pm create mode 100644 lib/Template/Plugin/GD/Text/Align.pm create mode 100644 lib/Template/Plugin/GD/Text/Wrap.pm create mode 100644 lib/Template/Plugin/HTML.pm create mode 100644 lib/Template/Plugin/Image.pm create mode 100644 lib/Template/Plugin/Iterator.pm create mode 100644 lib/Template/Plugin/Pod.pm create mode 100644 lib/Template/Plugin/Procedural.pm create mode 100644 lib/Template/Plugin/String.pm create mode 100644 lib/Template/Plugin/Table.pm create mode 100644 lib/Template/Plugin/URL.pm create mode 100644 lib/Template/Plugin/View.pm create mode 100644 lib/Template/Plugin/Wrap.pm create mode 100644 lib/Template/Plugin/XML/DOM.pm create mode 100644 lib/Template/Plugin/XML/RSS.pm create mode 100644 lib/Template/Plugin/XML/Simple.pm create mode 100644 lib/Template/Plugin/XML/Style.pm create mode 100644 lib/Template/Plugin/XML/XPath.pm create mode 100644 lib/Template/Plugins.pm create mode 100644 lib/Template/Provider.pm create mode 100644 lib/Template/Service.pm create mode 100644 lib/Template/Stash.pm create mode 100644 lib/Template/Stash/Context.pm create mode 100644 lib/Template/Stash/XS.pm create mode 100644 lib/Template/Test.pm create mode 100644 lib/Template/Tools/tpage.pod create mode 100644 lib/Template/Tools/ttree.pod create mode 100644 lib/Template/Tutorial.pod create mode 100644 lib/Template/Tutorial/Datafile.pod create mode 100644 lib/Template/Tutorial/Web.pod create mode 100644 lib/Template/View.pm create mode 100644 lib/Term/ReadLine/Perl.pm create mode 100644 lib/Term/ReadLine/readline.pm create mode 100644 lib/Text/ASCIITable.pm create mode 100644 lib/Text/ASCIITable/Wrap.pm create mode 100644 lib/Text/Wrap.pm create mode 100644 lib/Tools.pm create mode 100644 lib/URI.pm create mode 100644 lib/URI/Escape.pm create mode 100644 lib/URI/Heuristic.pm create mode 100644 lib/URI/QueryParam.pm create mode 100644 lib/URI/Split.pm create mode 100644 lib/URI/URL.pm create mode 100644 lib/URI/WithBase.pm create mode 100644 lib/URI/_foreign.pm create mode 100644 lib/URI/_generic.pm create mode 100644 lib/URI/_ldap.pm create mode 100644 lib/URI/_login.pm create mode 100644 lib/URI/_query.pm create mode 100644 lib/URI/_segment.pm create mode 100644 lib/URI/_server.pm create mode 100644 lib/URI/_userpass.pm create mode 100644 lib/URI/data.pm create mode 100644 lib/URI/file.pm create mode 100644 lib/URI/file/Base.pm create mode 100644 lib/URI/file/FAT.pm create mode 100644 lib/URI/file/Mac.pm create mode 100644 lib/URI/file/OS2.pm create mode 100644 lib/URI/file/QNX.pm create mode 100644 lib/URI/file/Unix.pm create mode 100644 lib/URI/file/Win32.pm create mode 100644 lib/URI/ftp.pm create mode 100644 lib/URI/gopher.pm create mode 100644 lib/URI/http.pm create mode 100644 lib/URI/https.pm create mode 100644 lib/URI/ldap.pm create mode 100644 lib/URI/ldapi.pm create mode 100644 lib/URI/ldaps.pm create mode 100644 lib/URI/mailto.pm create mode 100644 lib/URI/mms.pm create mode 100644 lib/URI/news.pm create mode 100644 lib/URI/nntp.pm create mode 100644 lib/URI/pop.pm create mode 100644 lib/URI/rlogin.pm create mode 100644 lib/URI/rsync.pm create mode 100644 lib/URI/rtsp.pm create mode 100644 lib/URI/rtspu.pm create mode 100644 lib/URI/sip.pm create mode 100644 lib/URI/sips.pm create mode 100644 lib/URI/snews.pm create mode 100644 lib/URI/ssh.pm create mode 100644 lib/URI/telnet.pm create mode 100644 lib/URI/tn3270.pm create mode 100644 lib/URI/urn.pm create mode 100644 lib/URI/urn/isbn.pm create mode 100644 lib/URI/urn/oid.pm create mode 100644 lib/XML/Dumper.pm create mode 100644 lib/XML/Simple.pm create mode 100644 lib/XML/Stream.pm create mode 100644 lib/XML/Stream/Namespace.pm create mode 100644 lib/XML/Stream/Node.pm create mode 100644 lib/XML/Stream/Parser.pm create mode 100644 lib/XML/Stream/Parser/DTD.pm create mode 100644 lib/XML/Stream/Tree.pm create mode 100644 lib/XML/Stream/XPath.pm create mode 100644 lib/XML/Stream/XPath/Op.pm create mode 100644 lib/XML/Stream/XPath/Query.pm create mode 100644 lib/XML/Stream/XPath/Value.pm create mode 100644 lib/XXV/MODULES/AUTOTIMER.pm create mode 100644 lib/XXV/MODULES/CHANNELS.pm create mode 100644 lib/XXV/MODULES/CHRONICLE.pm create mode 100644 lib/XXV/MODULES/CONFIG.pm create mode 100644 lib/XXV/MODULES/EPG.pm create mode 100644 lib/XXV/MODULES/EVENTS.pm create mode 100644 lib/XXV/MODULES/GRAB.pm create mode 100644 lib/XXV/MODULES/HTTPD.pm create mode 100644 lib/XXV/MODULES/INTERFACE.pm create mode 100644 lib/XXV/MODULES/LOGREAD.pm create mode 100644 lib/XXV/MODULES/MEDIALIB.pm create mode 100644 lib/XXV/MODULES/MUSIC.pm create mode 100644 lib/XXV/MODULES/RECORDS.pm create mode 100644 lib/XXV/MODULES/REMOTE.pm create mode 100644 lib/XXV/MODULES/REPORT.pm create mode 100644 lib/XXV/MODULES/ROBOT.pm create mode 100644 lib/XXV/MODULES/SHARE.pm create mode 100644 lib/XXV/MODULES/STATUS.pm create mode 100644 lib/XXV/MODULES/STREAM.pm create mode 100644 lib/XXV/MODULES/SVDRP.pm create mode 100644 lib/XXV/MODULES/TELNET.pm create mode 100644 lib/XXV/MODULES/TIMERS.pm create mode 100644 lib/XXV/MODULES/USER.pm create mode 100644 lib/XXV/MODULES/VTX.pm create mode 100644 lib/XXV/MODULES/WAPD.pm create mode 100644 lib/XXV/OUTPUT/Ajax.pm create mode 100644 lib/XXV/OUTPUT/Console.pm create mode 100644 lib/XXV/OUTPUT/Dump.pm create mode 100644 lib/XXV/OUTPUT/HTML/PUSH.pm create mode 100644 lib/XXV/OUTPUT/HTML/WAIT.pm create mode 100644 lib/XXV/OUTPUT/Html.pm create mode 100644 lib/XXV/OUTPUT/NEWS/JABBER.pm create mode 100644 lib/XXV/OUTPUT/NEWS/MAIL.pm create mode 100644 lib/XXV/OUTPUT/NEWS/RSS.pm create mode 100644 lib/XXV/OUTPUT/NEWS/VDR.pm create mode 100644 lib/XXV/OUTPUT/Wml.pm create mode 100644 locale/Makefile create mode 100644 locale/README create mode 100644 locale/de.po create mode 100644 locale/de/LC_MESSAGES/xxv.mo create mode 100755 locale/xgettext.pl create mode 100644 share/fonts/ttf-bitstream-vera/Vera.ttf create mode 100644 share/fonts/ttf-bitstream-vera/VeraBI.ttf create mode 100644 share/fonts/ttf-bitstream-vera/VeraBd.ttf create mode 100644 share/fonts/ttf-bitstream-vera/VeraIt.ttf create mode 100644 share/fonts/ttf-bitstream-vera/VeraMoBI.ttf create mode 100644 share/fonts/ttf-bitstream-vera/VeraMoBd.ttf create mode 100644 share/fonts/ttf-bitstream-vera/VeraMoIt.ttf create mode 100644 share/fonts/ttf-bitstream-vera/VeraMono.ttf create mode 100644 share/fonts/ttf-bitstream-vera/VeraSe.ttf create mode 100644 share/fonts/ttf-bitstream-vera/VeraSeBd.ttf create mode 100644 share/news/mail_010_header.tmpl create mode 100644 share/news/mail_050_content.tmpl create mode 100644 share/news/mail_090_footer.tmpl create mode 100644 share/vtx/black20.gif create mode 100644 share/vtx/black21.gif create mode 100644 share/vtx/black22.gif create mode 100644 share/vtx/black23.gif create mode 100644 share/vtx/black24.gif create mode 100644 share/vtx/black25.gif create mode 100644 share/vtx/black26.gif create mode 100644 share/vtx/black27.gif create mode 100644 share/vtx/black28.gif create mode 100644 share/vtx/black29.gif create mode 100644 share/vtx/black2A.gif create mode 100644 share/vtx/black2B.gif create mode 100644 share/vtx/black2C.gif create mode 100644 share/vtx/black2D.gif create mode 100644 share/vtx/black2E.gif create mode 100644 share/vtx/black2F.gif create mode 100644 share/vtx/black30.gif create mode 100644 share/vtx/black31.gif create mode 100644 share/vtx/black32.gif create mode 100644 share/vtx/black33.gif create mode 100644 share/vtx/black34.gif create mode 100644 share/vtx/black35.gif create mode 100644 share/vtx/black36.gif create mode 100644 share/vtx/black37.gif create mode 100644 share/vtx/black38.gif create mode 100644 share/vtx/black39.gif create mode 100644 share/vtx/black3A.gif create mode 100644 share/vtx/black3B.gif create mode 100644 share/vtx/black3C.gif create mode 100644 share/vtx/black3D.gif create mode 100644 share/vtx/black3E.gif create mode 100644 share/vtx/black3F.gif create mode 100644 share/vtx/black60.gif create mode 100644 share/vtx/black61.gif create mode 100644 share/vtx/black62.gif create mode 100644 share/vtx/black63.gif create mode 100644 share/vtx/black64.gif create mode 100644 share/vtx/black65.gif create mode 100644 share/vtx/black66.gif create mode 100644 share/vtx/black67.gif create mode 100644 share/vtx/black68.gif create mode 100644 share/vtx/black69.gif create mode 100644 share/vtx/black6A.gif create mode 100644 share/vtx/black6B.gif create mode 100644 share/vtx/black6C.gif create mode 100644 share/vtx/black6D.gif create mode 100644 share/vtx/black6E.gif create mode 100644 share/vtx/black6F.gif create mode 100644 share/vtx/black70.gif create mode 100644 share/vtx/black71.gif create mode 100644 share/vtx/black72.gif create mode 100644 share/vtx/black73.gif create mode 100644 share/vtx/black74.gif create mode 100644 share/vtx/black75.gif create mode 100644 share/vtx/black76.gif create mode 100644 share/vtx/black77.gif create mode 100644 share/vtx/black78.gif create mode 100644 share/vtx/black79.gif create mode 100644 share/vtx/black7A.gif create mode 100644 share/vtx/black7B.gif create mode 100644 share/vtx/black7C.gif create mode 100644 share/vtx/black7D.gif create mode 100644 share/vtx/black7E.gif create mode 100644 share/vtx/black7F.gif create mode 100644 share/vtx/blue20.gif create mode 100644 share/vtx/blue21.gif create mode 100644 share/vtx/blue22.gif create mode 100644 share/vtx/blue23.gif create mode 100644 share/vtx/blue24.gif create mode 100644 share/vtx/blue25.gif create mode 100644 share/vtx/blue26.gif create mode 100644 share/vtx/blue27.gif create mode 100644 share/vtx/blue28.gif create mode 100644 share/vtx/blue29.gif create mode 100644 share/vtx/blue2A.gif create mode 100644 share/vtx/blue2B.gif create mode 100644 share/vtx/blue2C.gif create mode 100644 share/vtx/blue2D.gif create mode 100644 share/vtx/blue2E.gif create mode 100644 share/vtx/blue2F.gif create mode 100644 share/vtx/blue30.gif create mode 100644 share/vtx/blue31.gif create mode 100644 share/vtx/blue32.gif create mode 100644 share/vtx/blue33.gif create mode 100644 share/vtx/blue34.gif create mode 100644 share/vtx/blue35.gif create mode 100644 share/vtx/blue36.gif create mode 100644 share/vtx/blue37.gif create mode 100644 share/vtx/blue38.gif create mode 100644 share/vtx/blue39.gif create mode 100644 share/vtx/blue3A.gif create mode 100644 share/vtx/blue3B.gif create mode 100644 share/vtx/blue3C.gif create mode 100644 share/vtx/blue3D.gif create mode 100644 share/vtx/blue3E.gif create mode 100644 share/vtx/blue3F.gif create mode 100644 share/vtx/blue60.gif create mode 100644 share/vtx/blue61.gif create mode 100644 share/vtx/blue62.gif create mode 100644 share/vtx/blue63.gif create mode 100644 share/vtx/blue64.gif create mode 100644 share/vtx/blue65.gif create mode 100644 share/vtx/blue66.gif create mode 100644 share/vtx/blue67.gif create mode 100644 share/vtx/blue68.gif create mode 100644 share/vtx/blue69.gif create mode 100644 share/vtx/blue6A.gif create mode 100644 share/vtx/blue6B.gif create mode 100644 share/vtx/blue6C.gif create mode 100644 share/vtx/blue6D.gif create mode 100644 share/vtx/blue6E.gif create mode 100644 share/vtx/blue6F.gif create mode 100644 share/vtx/blue70.gif create mode 100644 share/vtx/blue71.gif create mode 100644 share/vtx/blue72.gif create mode 100644 share/vtx/blue73.gif create mode 100644 share/vtx/blue74.gif create mode 100644 share/vtx/blue75.gif create mode 100644 share/vtx/blue76.gif create mode 100644 share/vtx/blue77.gif create mode 100644 share/vtx/blue78.gif create mode 100644 share/vtx/blue79.gif create mode 100644 share/vtx/blue7A.gif create mode 100644 share/vtx/blue7B.gif create mode 100644 share/vtx/blue7C.gif create mode 100644 share/vtx/blue7D.gif create mode 100644 share/vtx/blue7E.gif create mode 100644 share/vtx/blue7F.gif create mode 100644 share/vtx/cyan20.gif create mode 100644 share/vtx/cyan21.gif create mode 100644 share/vtx/cyan22.gif create mode 100644 share/vtx/cyan23.gif create mode 100644 share/vtx/cyan24.gif create mode 100644 share/vtx/cyan25.gif create mode 100644 share/vtx/cyan26.gif create mode 100644 share/vtx/cyan27.gif create mode 100644 share/vtx/cyan28.gif create mode 100644 share/vtx/cyan29.gif create mode 100644 share/vtx/cyan2A.gif create mode 100644 share/vtx/cyan2B.gif create mode 100644 share/vtx/cyan2C.gif create mode 100644 share/vtx/cyan2D.gif create mode 100644 share/vtx/cyan2E.gif create mode 100644 share/vtx/cyan2F.gif create mode 100644 share/vtx/cyan30.gif create mode 100644 share/vtx/cyan31.gif create mode 100644 share/vtx/cyan32.gif create mode 100644 share/vtx/cyan33.gif create mode 100644 share/vtx/cyan34.gif create mode 100644 share/vtx/cyan35.gif create mode 100644 share/vtx/cyan36.gif create mode 100644 share/vtx/cyan37.gif create mode 100644 share/vtx/cyan38.gif create mode 100644 share/vtx/cyan39.gif create mode 100644 share/vtx/cyan3A.gif create mode 100644 share/vtx/cyan3B.gif create mode 100644 share/vtx/cyan3C.gif create mode 100644 share/vtx/cyan3D.gif create mode 100644 share/vtx/cyan3E.gif create mode 100644 share/vtx/cyan3F.gif create mode 100644 share/vtx/cyan60.gif create mode 100644 share/vtx/cyan61.gif create mode 100644 share/vtx/cyan62.gif create mode 100644 share/vtx/cyan63.gif create mode 100644 share/vtx/cyan64.gif create mode 100644 share/vtx/cyan65.gif create mode 100644 share/vtx/cyan66.gif create mode 100644 share/vtx/cyan67.gif create mode 100644 share/vtx/cyan68.gif create mode 100644 share/vtx/cyan69.gif create mode 100644 share/vtx/cyan6A.gif create mode 100644 share/vtx/cyan6B.gif create mode 100644 share/vtx/cyan6C.gif create mode 100644 share/vtx/cyan6D.gif create mode 100644 share/vtx/cyan6E.gif create mode 100644 share/vtx/cyan6F.gif create mode 100644 share/vtx/cyan70.gif create mode 100644 share/vtx/cyan71.gif create mode 100644 share/vtx/cyan72.gif create mode 100644 share/vtx/cyan73.gif create mode 100644 share/vtx/cyan74.gif create mode 100644 share/vtx/cyan75.gif create mode 100644 share/vtx/cyan76.gif create mode 100644 share/vtx/cyan77.gif create mode 100644 share/vtx/cyan78.gif create mode 100644 share/vtx/cyan79.gif create mode 100644 share/vtx/cyan7A.gif create mode 100644 share/vtx/cyan7B.gif create mode 100644 share/vtx/cyan7C.gif create mode 100644 share/vtx/cyan7D.gif create mode 100644 share/vtx/cyan7E.gif create mode 100644 share/vtx/cyan7F.gif create mode 100644 share/vtx/green20.gif create mode 100644 share/vtx/green21.gif create mode 100644 share/vtx/green22.gif create mode 100644 share/vtx/green23.gif create mode 100644 share/vtx/green24.gif create mode 100644 share/vtx/green25.gif create mode 100644 share/vtx/green26.gif create mode 100644 share/vtx/green27.gif create mode 100644 share/vtx/green28.gif create mode 100644 share/vtx/green29.gif create mode 100644 share/vtx/green2A.gif create mode 100644 share/vtx/green2B.gif create mode 100644 share/vtx/green2C.gif create mode 100644 share/vtx/green2D.gif create mode 100644 share/vtx/green2E.gif create mode 100644 share/vtx/green2F.gif create mode 100644 share/vtx/green30.gif create mode 100644 share/vtx/green31.gif create mode 100644 share/vtx/green32.gif create mode 100644 share/vtx/green33.gif create mode 100644 share/vtx/green34.gif create mode 100644 share/vtx/green35.gif create mode 100644 share/vtx/green36.gif create mode 100644 share/vtx/green37.gif create mode 100644 share/vtx/green38.gif create mode 100644 share/vtx/green39.gif create mode 100644 share/vtx/green3A.gif create mode 100644 share/vtx/green3B.gif create mode 100644 share/vtx/green3C.gif create mode 100644 share/vtx/green3D.gif create mode 100644 share/vtx/green3E.gif create mode 100644 share/vtx/green3F.gif create mode 100644 share/vtx/green60.gif create mode 100644 share/vtx/green61.gif create mode 100644 share/vtx/green62.gif create mode 100644 share/vtx/green63.gif create mode 100644 share/vtx/green64.gif create mode 100644 share/vtx/green65.gif create mode 100644 share/vtx/green66.gif create mode 100644 share/vtx/green67.gif create mode 100644 share/vtx/green68.gif create mode 100644 share/vtx/green69.gif create mode 100644 share/vtx/green6A.gif create mode 100644 share/vtx/green6B.gif create mode 100644 share/vtx/green6C.gif create mode 100644 share/vtx/green6D.gif create mode 100644 share/vtx/green6E.gif create mode 100644 share/vtx/green6F.gif create mode 100644 share/vtx/green70.gif create mode 100644 share/vtx/green71.gif create mode 100644 share/vtx/green72.gif create mode 100644 share/vtx/green73.gif create mode 100644 share/vtx/green74.gif create mode 100644 share/vtx/green75.gif create mode 100644 share/vtx/green76.gif create mode 100644 share/vtx/green77.gif create mode 100644 share/vtx/green78.gif create mode 100644 share/vtx/green79.gif create mode 100644 share/vtx/green7A.gif create mode 100644 share/vtx/green7B.gif create mode 100644 share/vtx/green7C.gif create mode 100644 share/vtx/green7D.gif create mode 100644 share/vtx/green7E.gif create mode 100644 share/vtx/green7F.gif create mode 100644 share/vtx/magenta20.gif create mode 100644 share/vtx/magenta21.gif create mode 100644 share/vtx/magenta22.gif create mode 100644 share/vtx/magenta23.gif create mode 100644 share/vtx/magenta24.gif create mode 100644 share/vtx/magenta25.gif create mode 100644 share/vtx/magenta26.gif create mode 100644 share/vtx/magenta27.gif create mode 100644 share/vtx/magenta28.gif create mode 100644 share/vtx/magenta29.gif create mode 100644 share/vtx/magenta2A.gif create mode 100644 share/vtx/magenta2B.gif create mode 100644 share/vtx/magenta2C.gif create mode 100644 share/vtx/magenta2D.gif create mode 100644 share/vtx/magenta2E.gif create mode 100644 share/vtx/magenta2F.gif create mode 100644 share/vtx/magenta30.gif create mode 100644 share/vtx/magenta31.gif create mode 100644 share/vtx/magenta32.gif create mode 100644 share/vtx/magenta33.gif create mode 100644 share/vtx/magenta34.gif create mode 100644 share/vtx/magenta35.gif create mode 100644 share/vtx/magenta36.gif create mode 100644 share/vtx/magenta37.gif create mode 100644 share/vtx/magenta38.gif create mode 100644 share/vtx/magenta39.gif create mode 100644 share/vtx/magenta3A.gif create mode 100644 share/vtx/magenta3B.gif create mode 100644 share/vtx/magenta3C.gif create mode 100644 share/vtx/magenta3D.gif create mode 100644 share/vtx/magenta3E.gif create mode 100644 share/vtx/magenta3F.gif create mode 100644 share/vtx/magenta60.gif create mode 100644 share/vtx/magenta61.gif create mode 100644 share/vtx/magenta62.gif create mode 100644 share/vtx/magenta63.gif create mode 100644 share/vtx/magenta64.gif create mode 100644 share/vtx/magenta65.gif create mode 100644 share/vtx/magenta66.gif create mode 100644 share/vtx/magenta67.gif create mode 100644 share/vtx/magenta68.gif create mode 100644 share/vtx/magenta69.gif create mode 100644 share/vtx/magenta6A.gif create mode 100644 share/vtx/magenta6B.gif create mode 100644 share/vtx/magenta6C.gif create mode 100644 share/vtx/magenta6D.gif create mode 100644 share/vtx/magenta6E.gif create mode 100644 share/vtx/magenta6F.gif create mode 100644 share/vtx/magenta70.gif create mode 100644 share/vtx/magenta71.gif create mode 100644 share/vtx/magenta72.gif create mode 100644 share/vtx/magenta73.gif create mode 100644 share/vtx/magenta74.gif create mode 100644 share/vtx/magenta75.gif create mode 100644 share/vtx/magenta76.gif create mode 100644 share/vtx/magenta77.gif create mode 100644 share/vtx/magenta78.gif create mode 100644 share/vtx/magenta79.gif create mode 100644 share/vtx/magenta7A.gif create mode 100644 share/vtx/magenta7B.gif create mode 100644 share/vtx/magenta7C.gif create mode 100644 share/vtx/magenta7D.gif create mode 100644 share/vtx/magenta7E.gif create mode 100644 share/vtx/magenta7F.gif create mode 100644 share/vtx/red20.gif create mode 100644 share/vtx/red21.gif create mode 100644 share/vtx/red22.gif create mode 100644 share/vtx/red23.gif create mode 100644 share/vtx/red24.gif create mode 100644 share/vtx/red25.gif create mode 100644 share/vtx/red26.gif create mode 100644 share/vtx/red27.gif create mode 100644 share/vtx/red28.gif create mode 100644 share/vtx/red29.gif create mode 100644 share/vtx/red2A.gif create mode 100644 share/vtx/red2B.gif create mode 100644 share/vtx/red2C.gif create mode 100644 share/vtx/red2D.gif create mode 100644 share/vtx/red2E.gif create mode 100644 share/vtx/red2F.gif create mode 100644 share/vtx/red30.gif create mode 100644 share/vtx/red31.gif create mode 100644 share/vtx/red32.gif create mode 100644 share/vtx/red33.gif create mode 100644 share/vtx/red34.gif create mode 100644 share/vtx/red35.gif create mode 100644 share/vtx/red36.gif create mode 100644 share/vtx/red37.gif create mode 100644 share/vtx/red38.gif create mode 100644 share/vtx/red39.gif create mode 100644 share/vtx/red3A.gif create mode 100644 share/vtx/red3B.gif create mode 100644 share/vtx/red3C.gif create mode 100644 share/vtx/red3D.gif create mode 100644 share/vtx/red3E.gif create mode 100644 share/vtx/red3F.gif create mode 100644 share/vtx/red60.gif create mode 100644 share/vtx/red61.gif create mode 100644 share/vtx/red62.gif create mode 100644 share/vtx/red63.gif create mode 100644 share/vtx/red64.gif create mode 100644 share/vtx/red65.gif create mode 100644 share/vtx/red66.gif create mode 100644 share/vtx/red67.gif create mode 100644 share/vtx/red68.gif create mode 100644 share/vtx/red69.gif create mode 100644 share/vtx/red6A.gif create mode 100644 share/vtx/red6B.gif create mode 100644 share/vtx/red6C.gif create mode 100644 share/vtx/red6D.gif create mode 100644 share/vtx/red6E.gif create mode 100644 share/vtx/red6F.gif create mode 100644 share/vtx/red70.gif create mode 100644 share/vtx/red71.gif create mode 100644 share/vtx/red72.gif create mode 100644 share/vtx/red73.gif create mode 100644 share/vtx/red74.gif create mode 100644 share/vtx/red75.gif create mode 100644 share/vtx/red76.gif create mode 100644 share/vtx/red77.gif create mode 100644 share/vtx/red78.gif create mode 100644 share/vtx/red79.gif create mode 100644 share/vtx/red7A.gif create mode 100644 share/vtx/red7B.gif create mode 100644 share/vtx/red7C.gif create mode 100644 share/vtx/red7D.gif create mode 100644 share/vtx/red7E.gif create mode 100644 share/vtx/red7F.gif create mode 100644 share/vtx/white20.gif create mode 100644 share/vtx/white21.gif create mode 100644 share/vtx/white22.gif create mode 100644 share/vtx/white23.gif create mode 100644 share/vtx/white24.gif create mode 100644 share/vtx/white25.gif create mode 100644 share/vtx/white26.gif create mode 100644 share/vtx/white27.gif create mode 100644 share/vtx/white28.gif create mode 100644 share/vtx/white29.gif create mode 100644 share/vtx/white2A.gif create mode 100644 share/vtx/white2B.gif create mode 100644 share/vtx/white2C.gif create mode 100644 share/vtx/white2D.gif create mode 100644 share/vtx/white2E.gif create mode 100644 share/vtx/white2F.gif create mode 100644 share/vtx/white30.gif create mode 100644 share/vtx/white31.gif create mode 100644 share/vtx/white32.gif create mode 100644 share/vtx/white33.gif create mode 100644 share/vtx/white34.gif create mode 100644 share/vtx/white35.gif create mode 100644 share/vtx/white36.gif create mode 100644 share/vtx/white37.gif create mode 100644 share/vtx/white38.gif create mode 100644 share/vtx/white39.gif create mode 100644 share/vtx/white3A.gif create mode 100644 share/vtx/white3B.gif create mode 100644 share/vtx/white3C.gif create mode 100644 share/vtx/white3D.gif create mode 100644 share/vtx/white3E.gif create mode 100644 share/vtx/white3F.gif create mode 100644 share/vtx/white60.gif create mode 100644 share/vtx/white61.gif create mode 100644 share/vtx/white62.gif create mode 100644 share/vtx/white63.gif create mode 100644 share/vtx/white64.gif create mode 100644 share/vtx/white65.gif create mode 100644 share/vtx/white66.gif create mode 100644 share/vtx/white67.gif create mode 100644 share/vtx/white68.gif create mode 100644 share/vtx/white69.gif create mode 100644 share/vtx/white6A.gif create mode 100644 share/vtx/white6B.gif create mode 100644 share/vtx/white6C.gif create mode 100644 share/vtx/white6D.gif create mode 100644 share/vtx/white6E.gif create mode 100644 share/vtx/white6F.gif create mode 100644 share/vtx/white70.gif create mode 100644 share/vtx/white71.gif create mode 100644 share/vtx/white72.gif create mode 100644 share/vtx/white73.gif create mode 100644 share/vtx/white74.gif create mode 100644 share/vtx/white75.gif create mode 100644 share/vtx/white76.gif create mode 100644 share/vtx/white77.gif create mode 100644 share/vtx/white78.gif create mode 100644 share/vtx/white79.gif create mode 100644 share/vtx/white7A.gif create mode 100644 share/vtx/white7B.gif create mode 100644 share/vtx/white7C.gif create mode 100644 share/vtx/white7D.gif create mode 100644 share/vtx/white7E.gif create mode 100644 share/vtx/white7F.gif create mode 100644 share/vtx/yellow20.gif create mode 100644 share/vtx/yellow21.gif create mode 100644 share/vtx/yellow22.gif create mode 100644 share/vtx/yellow23.gif create mode 100644 share/vtx/yellow24.gif create mode 100644 share/vtx/yellow25.gif create mode 100644 share/vtx/yellow26.gif create mode 100644 share/vtx/yellow27.gif create mode 100644 share/vtx/yellow28.gif create mode 100644 share/vtx/yellow29.gif create mode 100644 share/vtx/yellow2A.gif create mode 100644 share/vtx/yellow2B.gif create mode 100644 share/vtx/yellow2C.gif create mode 100644 share/vtx/yellow2D.gif create mode 100644 share/vtx/yellow2E.gif create mode 100644 share/vtx/yellow2F.gif create mode 100644 share/vtx/yellow30.gif create mode 100644 share/vtx/yellow31.gif create mode 100644 share/vtx/yellow32.gif create mode 100644 share/vtx/yellow33.gif create mode 100644 share/vtx/yellow34.gif create mode 100644 share/vtx/yellow35.gif create mode 100644 share/vtx/yellow36.gif create mode 100644 share/vtx/yellow37.gif create mode 100644 share/vtx/yellow38.gif create mode 100644 share/vtx/yellow39.gif create mode 100644 share/vtx/yellow3A.gif create mode 100644 share/vtx/yellow3B.gif create mode 100644 share/vtx/yellow3C.gif create mode 100644 share/vtx/yellow3D.gif create mode 100644 share/vtx/yellow3E.gif create mode 100644 share/vtx/yellow3F.gif create mode 100644 share/vtx/yellow60.gif create mode 100644 share/vtx/yellow61.gif create mode 100644 share/vtx/yellow62.gif create mode 100644 share/vtx/yellow63.gif create mode 100644 share/vtx/yellow64.gif create mode 100644 share/vtx/yellow65.gif create mode 100644 share/vtx/yellow66.gif create mode 100644 share/vtx/yellow67.gif create mode 100644 share/vtx/yellow68.gif create mode 100644 share/vtx/yellow69.gif create mode 100644 share/vtx/yellow6A.gif create mode 100644 share/vtx/yellow6B.gif create mode 100644 share/vtx/yellow6C.gif create mode 100644 share/vtx/yellow6D.gif create mode 100644 share/vtx/yellow6E.gif create mode 100644 share/vtx/yellow6F.gif create mode 100644 share/vtx/yellow70.gif create mode 100644 share/vtx/yellow71.gif create mode 100644 share/vtx/yellow72.gif create mode 100644 share/vtx/yellow73.gif create mode 100644 share/vtx/yellow74.gif create mode 100644 share/vtx/yellow75.gif create mode 100644 share/vtx/yellow76.gif create mode 100644 share/vtx/yellow77.gif create mode 100644 share/vtx/yellow78.gif create mode 100644 share/vtx/yellow79.gif create mode 100644 share/vtx/yellow7A.gif create mode 100644 share/vtx/yellow7B.gif create mode 100644 share/vtx/yellow7C.gif create mode 100644 share/vtx/yellow7D.gif create mode 100644 share/vtx/yellow7E.gif create mode 100644 share/vtx/yellow7F.gif create mode 100644 wml/images/apply.wbm create mode 100644 wml/images/back.wbm create mode 100644 wml/images/delete.wbm create mode 100644 wml/images/edit.wbm create mode 100644 wml/images/find.wbm create mode 100644 wml/images/forward.wbm create mode 100644 wml/images/home.wbm create mode 100644 wml/images/movie.wbm create mode 100644 wml/images/new.wbm create mode 100644 wml/images/off.wbm create mode 100644 wml/images/on.wbm create mode 100644 wml/images/onoff.wbm create mode 100644 wml/images/record.wbm create mode 100644 wml/images/refresh.wbm create mode 100644 wml/images/watch.wbm create mode 100644 wml/images/xxv.wbm create mode 120000 wml/next.tmpl create mode 100644 wml/now.tmpl create mode 100644 wml/program.tmpl create mode 100644 wml/search.tmpl create mode 100644 wml/skin.cfg create mode 100644 wml/tlist.tmpl create mode 120000 wml/tsearch.tmpl create mode 100644 wml/wapd.tmpl create mode 100644 wml/widgets/checkbox.tmpl create mode 100644 wml/widgets/confirm.tmpl create mode 120000 wml/widgets/date.tmpl create mode 100644 wml/widgets/dir.tmpl create mode 100644 wml/widgets/err.tmpl create mode 100644 wml/widgets/file.tmpl create mode 100644 wml/widgets/footer.tmpl create mode 100644 wml/widgets/formEnd.tmpl create mode 100644 wml/widgets/formStart.tmpl create mode 100644 wml/widgets/hidden.tmpl create mode 100644 wml/widgets/host.tmpl create mode 100644 wml/widgets/integer.tmpl create mode 100644 wml/widgets/link.tmpl create mode 100644 wml/widgets/list.tmpl create mode 100644 wml/widgets/littlemenu.tmpl create mode 100644 wml/widgets/menu.tmpl create mode 100644 wml/widgets/message.tmpl create mode 100644 wml/widgets/password.tmpl create mode 100644 wml/widgets/radio.tmpl create mode 100644 wml/widgets/redirect.tmpl create mode 100644 wml/widgets/start.tmpl create mode 100644 wml/widgets/string.tmpl create mode 100644 wml/widgets/table.tmpl diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e1be477 --- /dev/null +++ b/Makefile @@ -0,0 +1,84 @@ +# +# Makefile +# +# $Id$ + +XXV = xxv +VERSION = 0.93 + +### The name of the distribution archive: + +ARCHIVE = $(XXV)-$(VERSION) +PACKAGE = $(ARCHIVE) +TMPDIR = /tmp + +### The subdirectories: + +### Targets: +INCLUDE = bin contrib doc etc html share lib locale wml README.txt Makefile install.sh +EXCLUDE = "*~" "*.bak" "*.org" "*.diff" "xxvd.pid" "$(XXV)-*.tgz" + + +clean: + @for i in $(EXCLUDE) ;\ + do \ + find -name "$$i" -exec rm -rf "{}" \; \ + || exit 1;\ + done + +tmpfolder: + @-rm -rf $(TMPDIR)/$(ARCHIVE) + @mkdir -p $(TMPDIR)/$(ARCHIVE) + +copyfiles: + @for i in $(INCLUDE) ;\ + do \ + cp -a $$i $(TMPDIR)/$(ARCHIVE) \ + || exit 1;\ + done + +removefiles: + @for i in $(EXCLUDE) ;\ + do \ + find $(TMPDIR)/$(ARCHIVE) -name "$$i" -exec rm -f "{}" \; \ + || exit 1;\ + done + @for i in $(EXCLUDEFOLDER) ;\ + do \ + find "$(TMPDIR)/$(ARCHIVE)/$$i" -exec rm -rf "{}" \; \ + || exit 1;\ + done + +compatiblesqldump: + @sed -e "s/ DEFAULT CHARSET=latin1//g" contrib/upgrade-xxv-db.sql > $(TMPDIR)/$(ARCHIVE)/contrib/upgrade-xxv-db.sql + +updateversion: + @sed -e "s/__VERSION__/$(VERSION)/g" bin/xxvd > $(TMPDIR)/$(ARCHIVE)/bin/xxvd + +updatesql: + @echo Please type the DB-Password for root: + @mysqldump -p -n -d --add-drop-table -p -u root xxv 1> ./contrib/upgrade-xxv-db.sql + +setpermission: + @find $(TMPDIR)/$(ARCHIVE) -type d -exec chmod 755 {} \; + @find $(TMPDIR)/$(ARCHIVE) -type f -exec chmod 644 {} \; + @chmod a+x $(TMPDIR)/$(ARCHIVE)/bin/xxvd + @chmod a+x $(TMPDIR)/$(ARCHIVE)/contrib/update-xxv + @chmod a+x $(TMPDIR)/$(ARCHIVE)/contrib/at-vdradmin2xxv.pl + @chmod a+x $(TMPDIR)/$(ARCHIVE)/locale/xgettext.pl + @chmod a+x $(TMPDIR)/$(ARCHIVE)/etc/xxvd + @chmod a+x $(TMPDIR)/$(ARCHIVE)/install.sh + +dist: tmpfolder\ + updatesql\ + copyfiles\ + removefiles\ + updateversion\ + compatiblesqldump\ + setpermission + @chown root.root -R $(TMPDIR)/$(ARCHIVE)/* + @tar czf $(PACKAGE).tgz --exclude=.svn -C $(TMPDIR) $(ARCHIVE) + @-rm -rf $(TMPDIR)/$(ARCHIVE) + @echo Distribution package created as $(PACKAGE).tgz + +all: dist diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..fbe3cdd --- /dev/null +++ b/README.txt @@ -0,0 +1,3 @@ +Please take a look in the doc/*.txt Files for all usefull stuff. +------------------ +Schaut bitte in das doc/*.txt Dateien für weiterführende Informationen. \ No newline at end of file diff --git a/bin/xxvd b/bin/xxvd new file mode 100755 index 0000000..43f26fc --- /dev/null +++ b/bin/xxvd @@ -0,0 +1,741 @@ +#!/usr/bin/perl -w +use warnings; +use strict; + +use FindBin qw($RealBin); + +my $TEMPLMOD; +my $START = time; + +# Test on Template Modul in normale Path +BEGIN { + eval ' require Template; require Template::Stash::XS; '; + $TEMPLMOD = ($@ ? 0 : 1); +} + +# Paths for debian installation +use lib "$RealBin/../lib"; + +my $PATHS = { + LOGFILE => "/var/log/xxvd.log", + PIDFILE => "/var/run/xxvd.pid", + LOCDIRNAME => "$RealBin/../locale", + MODPATH => "$RealBin/../lib/XXV/MODULES", + CFGFILE => "$RealBin/../etc/xxvd.cfg", + PRIVATE_CFGFILE => "$ENV{HOME}/.xxvd.cfg", + DOCPATH => "$RealBin/../doc", + PODPATH => "$RealBin/../doc", + HTMLDIR => "$RealBin/../", + FONTPATH => "$RealBin/../share/fonts/ttf-bitstream-vera", + VTXPATH => "$RealBin/../share/vtx", + NEWSMODS => "$RealBin/../lib/XXV/OUTPUT/NEWS", + NEWSTMPL => "$RealBin/../share/news", + CONTRIB => "$RealBin/../contrib", +}; +# ------------------------------- + +use Tools; +use File::Find; +use File::Basename; +use POSIX qw(locale_h); +use Cwd 'abs_path'; +use Locale::gettext; + +$|++; + +my $REV = &getRev() || (split(/ /, '$Id$'))[2]; +my $MODULES; +my $VERSION = '0.90'; +my $VDRVERSION = 0; +my $CLEANUP; +my $DBCACHE = {}; +my $AFTER = [0 ... 50]; +my $killer = 0; +my $version = 0; +my $verbose = 3; +my $nofork = 0; + +# ------------------ +sub module { +# ------------------ + my $args = { + Name => 'General', + Prereq => { + 'Event' => 'Event loop processing', + 'Getopt::Long' => 'Extended processing of command line options ', + 'Config::Tiny' => 'Read/Write .ini style files with as little code as possible', + 'DBI' => 'Database independent interface for Perl ', + 'DBD::mysql' => 'MySQL driver for the Perl5 Database Interface (DBI)', + 'Proc::Killfam' => 'kill a list of pids, and all their sub-children', + }, + Description => gettext('This is the main program xxvd.'), + Version => $VERSION, + Date => '24.11.2004', + Author => 'Frank Herrmann ', + Preferences => { + Language => { + description => gettext('Language for interface'), + type => 'list', + choices => [ + [gettext('English'), 'C'], # C Stand for nativ gettext language, and means en_US + [gettext('German'), 'de_DE'], + ], + default => 'C', + }, + DSN => { + description => gettext('Data source name for the connection to the data base'), + default => 'DBI:mysql:database=xxv;host=localhost;port=3306', + type => 'string', + required => gettext("This is required!"), + }, + USR => { + description => gettext('Username for data base access'), + default => 'xxv', + type => 'string', + required => gettext("This is required!"), + }, + PWD => { + description => gettext('Password for data base access'), + default => 'xxv', + type => 'password', + required => gettext("This is required!"), + check => sub{ + my $value = shift || return; + # If no password given the take the old password as default + if($value->[0] and $value->[0] ne $value->[1]) { + return undef, gettext("Field with 1st and 2nd password must be equal to confirm!"); + } else { + return $value->[0]; + } + }, + }, + initscript => { + description => gettext('Initialization script to restart xxv'), + default => '/etc/init.d/xxvd', + type => 'file', + required => gettext("This is required!"), + }, + }, + Commands => { + doc => { + description => gettext('Generate the documentation in doc directory.'), + short => 'dc', + callback => sub{ docu(@_) }, + Level => 'admin', + }, + more => { + description => gettext('Shows text files.'), + short => 'mo', + callback => sub{ more(@_) }, + Level => 'user', + }, + }, + }; + # Only as superuser + if(0 == $<) + { + $args->{'Commands'}->{'restart'} = { + description => gettext('Call initialization script to restart xxv system.'), + short => 'restart', + callback => sub{ restart(@_) }, + Level => 'admin', + }; + } + return $args; +} + +# THE MAIN PROGRAM --------------------------------- TOP +my @PARAMETER = @ARGV; + +# General ist'n spezi +$MODULES->{'XXV::MODULES::General'}->{MOD} = &module; + +# Try to use the Requirments +map { + eval "use $_"; + warn("\nCan not load Module: $_\nPlease install this module on your System:\nperl -MCPAN -e 'install $_'") if($@); +} keys %{$MODULES->{'XXV::MODULES::General'}->{MOD}->{Prereq}}; + + +# Options +GetOptions ( + "configfile=s" => \$PATHS->{DEFINED_CFGFILE}, # numeric + "logfile=s" => \$PATHS->{LOGFILE}, + "pidfile=s" => \$PATHS->{PIDFILE}, + "localedir=s" => \$PATHS->{LOCDIRNAME}, + "moduledir=s" => \$PATHS->{MODPATH}, + "docudir=s" => \$PATHS->{DOCPATH}, + "poddir=s" => \$PATHS->{PODPATH}, + "htmldir=s" => \$PATHS->{HTMLDIR}, + "fontdir=s" => \$PATHS->{FONTPATH}, + "vtxdir=s" => \$PATHS->{VTXPATH}, + "contrib=s" => \$PATHS->{CONTRIB}, + "newsmods=s" => \$PATHS->{NEWSMODS}, + "newstmpl=s" => \$PATHS->{NEWSTMPL}, + "kill" => \$killer, # kill old xxvd + "verbose=s" => \$verbose, # debug output level + "version" => \$version, # print version + "nofork" => \$nofork, # switch fork off, for better debugging +); + +# Strip last slash +foreach my $name (keys %$PATHS) { + $PATHS->{$name} =~ s/\/$//g + if(exists $PATHS->{$name} and $PATHS->{$name}); +} + +# Version information +if($version) { + printf "XXV -- (Xtreme eXtension for VDR)\nVersion: %s\n", &getVersion; + exit(0); +} + +# Check PID .. +if(! $killer and -e $PATHS->{PIDFILE}) { + printf "Sorry, but xxvd is running with PID %s !\n", load_file($PATHS->{PIDFILE}); + exit(1); +} elsif($killer and ! -e $PATHS->{PIDFILE}) { + printf "PID File %s does not exist!\n", $PATHS->{PIDFILE}; + &quit; +} elsif($killer and -e $PATHS->{PIDFILE}) { + my $oldpid = load_file($PATHS->{PIDFILE}); + &killfam(9, $oldpid); + printf "xxvd with pid %s killed\n", $oldpid; + &quit; +} + +# Go fork for deamon modus +unless($nofork) { + my($pid) = fork; + if($pid != 0) { + print("xxvd started with pid $pid.\n"); + save_file($PATHS->{PIDFILE}, $pid); + exit(0); + } +} + +# Load a config +my $CFGOBJ = Config::Tiny->new(); +my $cfgFile = &getConfigFile(); +my $Config = $CFGOBJ->read( $cfgFile ); +unless($Config){ + print sprintf("Can't read file with configuration '%s' : %s", $cfgFile, $CFGOBJ->errstr); + exit(1); +} + +# Install i18n system +&init_locale($Config, $PATHS); + +# Install logging +&init_logging($PATHS); + +# First log message +debug qq|--------------------------------------------------|; + +debug sprintf(qq|---- XXVD System %20s started ----|, &getVersion); +debug qq|--------------------------------------------------|; +debug sprintf('Verbose Level is set to %d', $verbose); + +my $cfgUsrFile = &getUsrConfigFile(); +if($cfgUsrFile ne $cfgFile) { + debug sprintf('Maybe 1st Start, used configuration : read from file "%s" write to file "%s"', $cfgFile, $cfgUsrFile); +} else { + debug sprintf('Use configuration file "%s"', $cfgUsrFile); +} + + +# Check templateModul +&init_template($TEMPLMOD); + +# Install the signal handler +&init_signal_handler($PATHS); + +# Connect the DB +my $DBH = &init_db_connect($Config) || die; + +# Ok initialize the moduls +&init($PATHS->{MODPATH}); + +&docu; + +my $starttime = time - $START; + +Event::loop(); + +# THE MAIN PROGRAM --------------------------------- END + +# ----- SUBS ---- + +# ------------------ +sub init { +# ------------------ + my $modules = shift || return error ('No Modules Path!' ); + my @mods = glob($modules.'/*.pm'); + + foreach my $module (reverse @mods) { + my $moduleName = 'XXV::MODULES::'.(split('\.',(split('/', $module))[-1]))[0]; + + # make an object for the module + eval "use $moduleName"; + error $@ if $@; + $MODULES->{$moduleName} = $moduleName->new( + -config => $Config, + -dbh => $DBH, + -paths => $PATHS, + ); + debug sprintf("Load Module %s = %s\n", + $moduleName, + (ref $MODULES->{$moduleName}) + ? $MODULES->{$moduleName}->{MOD}->{Version} + : 'Problem!'); + + } + &after(); + return $MODULES; +} + +# Routine um Callbacks zu registrieren und +# diese nach dem laden der Module zu starten +# ------------------ +sub after { +# ------------------ + my $cb = shift || 0; + my $log = shift || 0; + my $order = shift || 0; + + if($cb) { + if($order) { + error(sprintf("Callback %s : '%s' replace with '%s'",$order, + ($AFTER->[$order]->[1] ? $AFTER->[$order]->[1] : ""), + ($log ? $log : "") + )) + if(ref $AFTER->[$order] eq 'ARRAY'); + + $AFTER->[$order] = [$cb, $log]; + } else { + push(@$AFTER, [$cb, $log]); + } + } else { + foreach my $CB (@$AFTER) { + next unless(ref $CB eq 'ARRAY'); + debug $CB->[1] + if($CB->[1]); + &{$CB->[0]}() + if(ref $CB->[0] eq 'CODE'); + } + } +} + +# ------------------ +sub reconfigure { +# ------------------ + if(defined $Config->{General}->{Language} + and $Config->{General}->{Language} ne setlocale(LC_MESSAGES)) { + setlocale (LC_MESSAGES, "");# It's doesn't work without reset Language + setlocale (LC_MESSAGES, $Config->{General}->{Language}); + } +} + +# Folgende Calls sind möglich: +# main::toCleanUp('xpix', sub{}, 'logout'); # ein CB registrieren +# main::toCleanUp(undef, undef, 'logout'); # ein Cleanup vornehmen nur für logout +# main::toCleanUp(); # alle Cleanups durchführen +# main::toCleanUp('xpix', undef, 'delete'); # ein CleanUp loeschen +# main::toCleanUp('xpix', undef, 'exists'); # ein CleanUp prüfen +# main::toCleanUp('xpix'); # ein bestimmten CleanUp ausführen +# ------------------ +sub toCleanUp { +# ------------------ + my $name = shift || 0; + my $callback = shift || 0; + my $typ = shift || 'everything'; # everything, logout, delete + + if(not $name and not $callback) { + # Call the callbacks + foreach my $cbname (sort keys %$CLEANUP) { + if($typ eq 'everything') { + foreach my $t (sort keys %{$CLEANUP->{$cbname}}) { + $CLEANUP->{$cbname}->{$t}(); + } + } else { + $CLEANUP->{$cbname}->{$typ}() + if(exists $CLEANUP->{$cbname}->{$typ} and ref $CLEANUP->{$cbname}->{$typ} eq 'CODE'); + } + } + } elsif($name and not $callback and $typ eq 'delete') { + delete $CLEANUP->{$name}; + } elsif($name and not $callback and $typ eq 'exists') { + return exists $CLEANUP->{$name}; + } elsif($name and not $callback) { + foreach my $t (sort keys %{$CLEANUP->{$name}}) { + $CLEANUP->{$name}->{$t}(); + } + } else { + $CLEANUP->{$name}->{$typ} = $callback; + } +} + +# ------------------ +sub getDbh { +# ------------------ + my $dsn = shift || return error ('No DSN!' ); + my $usr = shift || return error ('No USR!' ); + my $pwd = shift || ''; + + my $dbh = DBI->connect($dsn, $usr, $pwd,{ + PrintError => 1, + AutoCommit => 1, + }); + + if($dbh) { + debug('Successfully connect to database: %s', $dsn); + $dbh->{'mysql_auto_reconnect'} = 1; + } else { + panic("Can't connect to database: %s :", $dsn, $DBI::errstr); + unlink $PATHS->{PIDFILE}; + &toCleanUp(); + exit(1); + } + + return $dbh; +} + +# ------------------ +sub addModule { +# ------------------ + my $name = shift || return error('No Modname!'); + my $modobj = shift || return error('No Modobject!'); + $MODULES->{$name} = $modobj; + return $MODULES; +} + + +# ------------------ +sub getModules { +# ------------------ + return $MODULES; +} + +# ------------------ +sub getModule { +# ------------------ + my $name = shift || return error ('No DSN!' ); + + my ($modname) = grep(/${name}$/, keys %$MODULES); + + return $MODULES->{$modname}; +} + +# ------------------ +sub getRev { +# ------------------ + my $sourcedir = $PATHS->{HTMLDIR}; + if(-d $sourcedir and -d $sourcedir.'/.svn' and `which svnversion` ne "") { + my $rev = `svnversion -n $sourcedir`; + return $rev; + } else { + return 0; + } +} + +# ------------------ +sub getGeneralConfig { +# ------------------ + return $Config->{General}; +} + + +# ------------------ +sub getStartTime { +# ------------------ + return $START; +} + + +# ------------------ +sub getVersion { +# ------------------ + return sprintf('%s(%s)', $VERSION, $REV); +} + +# ------------------ +sub getVdrVersion { +# ------------------ + my $ver = shift || return $VDRVERSION; + + # Transform 1.2.6 => 10206, 1.3.32 => 10332 + $VDRVERSION = int(sprintf("%02d%02d%02d",split(/\./,$ver))); + + return $ver; +} + +# ------------------ +sub getDBVersion { +# ------------------ + my $dbh = shift || return error('No DB Handle'); + + # Keine Versionstabelle? + unless(tableExists($dbh, 'VERSION')) { + $dbh->do("create table `VERSION` ( `Version` tinyint (4) DEFAULT '0' NOT NULL );"); + $dbh->do(sprintf("insert into `VERSION` ( `Version` ) values ( '%s' );", &getActualDbVersion())); + } + my $row = $dbh->selectrow_hashref('select * from VERSION'); + return $row->{Version}; +} + + +# ------------------ +sub getConfigFile { +# ------------------ + if(defined $PATHS->{DEFINED_CFGFILE} and -r $PATHS->{DEFINED_CFGFILE}) { # user defined file via comandline + return $PATHS->{DEFINED_CFGFILE}; + } elsif(-r $PATHS->{PRIVATE_CFGFILE}) { # Check for readable ~/.xxvd.cfg + return $PATHS->{PRIVATE_CFGFILE}; + } else { # used default values from standard file for first start + return $PATHS->{CFGFILE}; + } +} + +# ------------------ +sub getUsrConfigFile { +# ------------------ + if(defined $PATHS->{DEFINED_CFGFILE} and -w $PATHS->{DEFINED_CFGFILE}) { # user defined file via comandline + return $PATHS->{DEFINED_CFGFILE}; + } elsif(-w $PATHS->{PRIVATE_CFGFILE}) { # Check for writeable ~/.xxvd.cfg + return $PATHS->{PRIVATE_CFGFILE}; + } else { + return $PATHS->{CFGFILE}; # else fallback to standard file + } +} + +# ------------------ +sub quit { +# ------------------ + unlink $PATHS->{PIDFILE}; + &toCleanUp(); + exit(0); +} + +# ------------------ +sub docu { +# ------------------ + my $watcher = shift; + my $console = shift; + my $name = shift || 0; + + my $HTTPD = getModule("HTTPD"); + my $htmlRootDir = sprintf('%s/%s', $HTTPD->{paths}->{HTMLDIR}, $HTTPD->{HtmlRoot}); + + # create Template object + my $tt = Template->new( + START_TAG => '\<\?\%', # Tagstyle + END_TAG => '\%\?\>', # Tagstyle + INCLUDE_PATH => [ $htmlRootDir, $PATHS->{PODPATH},$PATHS->{DOCPATH} ], # or list ref + INTERPOLATE => 1, # expand "$var" in plain text + EVAL_PERL => 1, # evaluate Perl code blocks + ); + + my $target = $PATHS->{PODPATH}; + my $tmpl = 'docu.tmpl'; + my $mods = getModules; + + foreach my $mod (keys %$mods) { + next unless($mods->{$mod}->{MOD}->{Name}); + my $output = sprintf('%s/%s.pod', $target, $mods->{$mod}->{MOD}->{Name}); + $tt->process($tmpl, $mods->{$mod}->{MOD}, $output) + or return error(sprintf('Error in %s: %s', $mods->{$mod}->{MOD}->{Name}, $tt->error())); + } + + if(ref $console and $name) { + return $console->pod($name); + } elsif(ref $console) { + return $console->message(sprintf(gettext("Documentation is generated in '%s'."), $target)); + } else { + return debug(sprintf(gettext("Documentation is generated in '%s'."), $target) . "\n"); + } +} + +# ------------------ +sub more { +# ------------------ + my $watcher = shift; + my $console = shift; + my $name = shift || return error('No TxtFile given!'); + my $param = shift || {}; + + if(ref $console) { + return $console->txtfile($name, $param); + } +} + +# ------------------ +sub restart { +# ------------------ + my $watcher = shift; + my $console = shift; + + if(-x $Config->{General}->{initscript}) { + my $msg = sprintf(gettext("The xxv system will restart now. Please try a relogin in %d seconds."), $starttime); + $console->message($msg); + debug $msg; + $console->redirect({url => '/', wait => $starttime, parent => 'top'}) + if($console->typ eq 'HTML'); + my $initscript = $Config->{General}->{initscript}; + my $run = sprintf('echo "%s restart" | at now', $initscript); + + my $erg = `$run`; + } else { + $console->err(gettext("Can't restart xxv system ! Script for initialization is'nt executable.")); + } +} + +# ------------------ +sub getActualDbVersion { +# ------------------ + my $cmd = sprintf('%s/update-xxv', $PATHS->{CONTRIB}); + my ($aver) = (`$cmd -v`)[-1] =~ /\'(\d+)\'/; + return $aver; +} + +# ------------------ +sub checkDB { +# ------------------ + my $dbh = shift || return error('No DB Handle'); + my $dbversion = &getDBVersion($dbh); + my $aver = &getActualDbVersion(); + + unless($dbversion == $aver) { + return undef, sprintf(gettext(q| +------- !PROBLEM! ---------- +Upps, your Version from DB(%d) doesn't match +with the wished version from xxv-software-packet(%d). +Please go to contribdir 'cd %s' and start +'./update-xxv' to upgrade your xxv database! +------- !PROBLEM! ---------- +|), $dbversion, $aver, $PATHS->{CONTRIB});#' + } + return $dbversion; +} + +# ------------------ +sub init_locale { +# ------------------ + my $cfg = shift || return error('No Config Hash'); + my $pat = shift || return error('No Paths Hash'); + # TODO set to installed folder like /usr/share/locale + # set /usr/share/locale/de/LC_MESSAGES/xxv.mo + # Message catalogs will be expected at the pathnames dirname/locale/cate- + # gory/domainname.mo, where locale is a locale name and category is a + # locale facet such as LC_MESSAGES. + bindtextdomain ('xxv', abs_path($pat->{LOCDIRNAME})); + bind_textdomain_codeset('xxv', 'ISO-8859-15'); + textdomain ('xxv'); + if(defined $cfg->{General}->{Language}) { + setlocale (LC_MESSAGES, $cfg->{General}->{Language}); + } else { + setlocale (LC_MESSAGES, ''); #From environment like 'export LANG="fr_FR"' + } +} + +# ------------------ +sub init_logging { +# ------------------ + my $pat = shift || return error('No Paths Hash'); + + my $loggercnt = 0; + my $loggerfile = $pat->{LOGFILE}; + + # The output level + $Tools::VERBOSE = $verbose; + + # This will add a callback for log output + $Tools::LOG = sub{ + my $msg = shift; + + my ($errcode, $txt) = $msg =~ /ERR:(\d{3})\s+(.*)/si; + $errcode = 201 if(!$errcode); + chomp($txt); + + my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = + localtime(time); + my $tt = sprintf('%04d-%02d-%02d %02d:%02d:%02d', + $year+1900, $mon+1,$mday, $hour, $min, $sec ); + + open(LOGGER, ">>", $loggerfile) or return; + print LOGGER sprintf("%d (%d) [%s] %s\n",++$loggercnt, $errcode, $tt, $txt); + close LOGGER; + }; +} + +# ------------------ +sub init_template { +# ------------------ + my $TMPLMOD = shift || 0; + + # Test on Template Modul .... + if($TEMPLMOD) { + $Template::Config::STASH = 'Template::Stash::XS'; + debug gettext('Fast template support is on!'); + } else { + use Template; + warn gettext(qq| + +----- WARNING! ---- +Upps, you use a very slowly version from Template! +The better (and faster) way is to install the Template +Modul with Template::Stash::XS support: + +with cpan: + perl -MCPAN -e 'install Template' + (answer with yes '' for XS Support question) + +with debian: + apt-get install libtemplate-perl + +|); + } +} + +# ------------------ +sub init_signal_handler { +# ------------------ + my $pat = shift || return error('No Paths Hash'); + + # Signal stuff + $SIG{__WARN__} = sub{ error @_; }; + $SIG{__DIE__} = sub{ panic @_; }; + $SIG{INT} = \&quit; + $SIG{TERM} = \&quit; + $SIG{HUP} = sub{ + lg "Reconfiguration ... "; + $Config = Config::Tiny->read( $pat->{CFGFILE} ) + or return error('Problem to read the %s: %s', $pat->{CFGFILE}, $CFGOBJ->errstr); + my $configModule = getModule('CONFIG') + or return error('Can not load the Config module'); + $configModule->reconfigure; + }; + +} + +# ------------------ +sub init_db_connect { +# ------------------ + my $cfg = shift || return error('No Config Hash'); + + # Connect to Database + my $dbh = &getDbh( + $cfg->{General}->{DSN}, + $cfg->{General}->{USR}, + $cfg->{General}->{PWD}, + ) or return error 'Can not connect to Database'; + + # Test on compare Version from DB and Sourcepaket + my ($dbok, $dberr) = &checkDB($dbh); + error($dberr) unless($dbok); + + # Set DBH for Toolsmodule + $Tools::DBH = $dbh; + + return $dbh; +} + diff --git a/contrib/README b/contrib/README new file mode 100644 index 0000000..4640274 --- /dev/null +++ b/contrib/README @@ -0,0 +1,27 @@ +To create a empty database und create a mysql-useraccount, change on +file create-database.sql on all placed username 'xpix' and password 'xpix97' +to your our values. + +$ cat ./contrib/create-database.sql | mysql -u root + +Adjust your mysql-username and password also on xxvd.cfg +[General] +DSN=DBI:mysql:database=xxv;host=localhost;port=3306 +PWD=xpix97 +USR=xpix + + +-------------------------------------------------------------------------------- + +To upgrade database from prior release from xxv call 'update-xxv' +It's backup your own data like Autotimer or XXV-Useraccount. + +$ ./contrib/update-xxv + + +-------------------------------------------------------------------------------- + +To migrate autotimer from vdradmin to xxv call 'at-vdradmin2xxv.pl' +It's could use to export some data from xxv autotimer to vdradmin. + +$ ./contrib/at-vdradmin2xxv.pl /path/vdradmind.at diff --git a/contrib/at-vdradmin2xxv.pl b/contrib/at-vdradmin2xxv.pl new file mode 100755 index 0000000..6d41b55 --- /dev/null +++ b/contrib/at-vdradmin2xxv.pl @@ -0,0 +1,222 @@ +#!/usr/bin/perl -w +use strict; +use warnings; +use DBI; #Database independent interface for Perl +use DBD::mysql; #MySQL driver for the Perl5 Database Interface (DBI) +use Getopt::Std; + +my $db = "xxv"; +my $host = "localhost"; +my $port = "3306"; +my $usr = "root"; +my $pwd = ""; + + +my $Usage = qq{ +Import or Export Autotimer from XXV to or from a VDRAdmin file +Usage: $0 [options] file + +Options: + -H : Host name of the MySQL server (default: '$host') + -P : Port number of MySQL server (default: '$port') + -d : XXV database name (default: '$db') + -u : Username (default: '$usr') + -p : Password (default: '$pwd') + -e : Export to file (default: Import from file) + -h : Help + +}; + +use vars qw/ %opt /; +my $dbh; + +die $Usage if (!$ARGV[0] || !getopts("d:H:P:u:p:eh", \%opt) || $opt{h} ); + + +$db = $opt{d} if($opt{d}); +$host = $opt{H} if($opt{H}); +$port = $opt{P} if($opt{P}); +$usr = $opt{u} if($opt{u}); +$pwd = $opt{p} if($opt{p}); + +my $filename = "@ARGV"; + +# ------------------ +sub ChannelArray { +# ------------------ + my $field = shift || return undef; + my $sql = sprintf('select %s, POS from CHANNELS order by POS', $field); + my $erg = $dbh->selectall_arrayref($sql); + return $erg; +} + +# ------------------ +sub PosToChannel { +# ------------------ + my $pos = shift || return undef; + my $sql = sprintf('select Id from CHANNELS where POS = "%lu"', $pos); + my $erg = $dbh->selectall_arrayref($sql); + return $erg->[0][0]; +} + +# ------------------ +sub _insert { +# ------------------ + my $data = shift || return; + + if(ref $data eq 'HASH') { + my ($names, $vals, $kenn); + map { + push(@$names, $_); + push(@$vals, $data->{$_}), + push(@$kenn, '?'), + } sort keys %$data; + + my $sql = sprintf("REPLACE INTO AUTOTIMER (%s) VALUES (%s)", + join(', ', @$names), + join(', ', @$kenn), + ); + my $sth = $dbh->prepare( $sql ); + $sth->execute( @$vals ); + } else { + my $sth = $dbh->prepare('REPLACE INTO AUTOTIMER VALUES (?,?,?,?,?,?,?,?,?)'); + $sth->execute( @$data ); + } +} + +# ------------------ +# Name: autotimerimport +# Descr: Read a file for import autotimer export list. +# Usage: autotimerimport($filename); +# ------------------ +sub autotimerimport { + my $AT_FILENAME = shift || die("No filename to import! Use $0 'vdradmind.at'\n"); + + my $cnt = "0"; + open(AT_FILE, "$AT_FILENAME") || return die sprintf("Can't open file '%s' : %s\n",$AT_FILENAME,$!); + while() { + chomp; + next if ($_ eq ""); + + my($active, $pattern, $section, $start, $stop, $episode, $prio, + $lft, $channel, $directoy) = split(/\:/, $_); + + my $data; + $data->{Id} = 0; + if($active eq "1") { $data->{Activ} = 'y'; } + else { $data->{Activ} = 'n'; } + + my @vals; + $data->{Done} = 'timer'; + $data->{Search} = $pattern; + push(@vals, "title") + if($section & 1); + push(@vals, "subtitle") + if($section & 2); + push(@vals, "description") + if($section & 4); + $data->{InFields} = join(',', @vals); + if( $channel ne "") { + if (my $chid = &PosToChannel($channel)) { + $data->{Channels} = $chid; + } + } + $data->{Priority} = $prio; + $data->{Lifetime} = $lft; + $data->{Dir} = $directoy; + $data->{Start} = $start; + $data->{Stop} = $stop; + # autotimerimport don't support episode, i belief "1" means File = title~subtitle / "0" means File = title + # $data->{Episode} = $episode; + + &_insert($data); + ++$cnt; + } + close (AT_FILE); + print STDERR sprintf("%d Autotimer read from file %s.\n",$cnt,$AT_FILENAME); + + return 0; +} + +# ------------------ +# Name: autotimerexport +# Descr: Read autotimer from database and save this to a export file. +# Usage: autotimerexport($filename); +# ------------------ +sub autotimerexport { + my $AT_FILENAME = shift || die("No filename to export! Use $0 -e 'vdradmind.at'\n"); + + die sprintf("File to store autotimer '%s' already exist! The file can't be overwritten. Please remove the file manually.\n",$AT_FILENAME) + if(-e $AT_FILENAME); + + my $sql = "select Activ, Search, InFields, Channels, Dir, Start, Stop, Priority, Lifetime from AUTOTIMER order by Id"; + my $atlist = $dbh->selectall_arrayref($sql); + + die "No autotimer data are to export available!\n" + if((!$atlist) || (scalar $atlist <= 0)); + + my $cnt = "0"; + open(AT_FILE, ">$AT_FILENAME") || die sprintf("Can't open file '%s' : %s\n",$AT_FILENAME,$!); + foreach my $data (@$atlist) { + if($data->[1] ne "" and $data->[2] ne "") { + + my $active = "0"; + my $pattern = $data->[1]; + my $section = "0"; + my $start = ""; + my $stop = ""; + my $episode = "0"; # autotimerexport don't support episode, i belief "1" means File = title~subtitle / "0" means File = title + my $prio = ""; + my $lft = ""; + my $channel = ""; + my $directoy = ""; + + $active = "1" if($data->[0] eq "y"); + + $section |= 1 if ($data->[2]=~/^.*title.*$/); + $section |= 2 if ($data->[2]=~/^.*subtitle.*$/); + $section |= 4 if ($data->[2]=~/^.*description.*$/); + + if( $data->[3]) { + foreach my $ch (@{&ChannelArray('Id')}) { + if ($data->[3] eq $ch->[0]) { # vdradmin suppport only one Channel + $channel = $ch->[1]; + last; + } + } + } + + $directoy = $data->[4] if($data->[4]); + $start = $data->[5] if($data->[5] and $data->[5] ne $data->[6]); # Exclude if start and stop if same value e.g. 0000 + $stop = $data->[6] if($data->[6] and $data->[5] ne $data->[6]); + $prio = $data->[7] if($data->[7]); + $lft = $data->[8] if($data->[8]); + + print AT_FILE sprintf("%s:%s:%s:%s:%s:%s:%s:%s:%s:%s\n", + $active,$pattern,$section,$start,$stop,$episode,$prio,$lft,$channel,$directoy) + || die sprintf("Can't write file '%s' : %s\n",$AT_FILENAME,$!); + ++$cnt; + } + } + close (AT_FILE); + + print STDERR sprintf("%d Autotimer write to file %s\n",$cnt,$AT_FILENAME); + + return 0; +} + + +$dbh = DBI->connect("DBI:mysql:database=$db;host=$host;port=$port", $usr, $pwd,{ + PrintError => 1, + AutoCommit => 1, +}) || die $DBI::errstr; + +exit 1 + unless($dbh); + +exit &autotimerexport($filename) + if($opt{e}); +exit &autotimerimport($filename) + if(!$opt{e}); + + diff --git a/contrib/chronicle-remove-duplicate.pl b/contrib/chronicle-remove-duplicate.pl new file mode 100755 index 0000000..2902107 --- /dev/null +++ b/contrib/chronicle-remove-duplicate.pl @@ -0,0 +1,105 @@ +#!/usr/bin/perl -w +use strict; +use warnings; +use DBI; #Database independent interface for Perl +use DBD::mysql; #MySQL driver for the Perl5 Database Interface (DBI) +use Getopt::Std; + +my $db = "xxv"; +my $host = "localhost"; +my $port = "3306"; +my $usr = "root"; +my $pwd = ""; + + +my $Usage = qq{ +this script search and remove duplicates from CHRONICLE. +Duplicates should never occurrence, but it's some time possible. +e.g. after migration from mysql 4.0 to 5.0. + +Usage: $0 [options] + +Options: + -H : Host name of the MySQL server (default: '$host') + -P : Port number of MySQL server (default: '$port') + -d : XXV database name (default: '$db') + -u : Username (default: '$usr') + -p : Password (default: '$pwd') + -q : Be quiet + -h : Help + +}; + +use vars qw/ %opt /; +my $dbh; + +die $Usage if (!getopts("d:H:P:u:p:hq", \%opt) || $opt{h} ); + + +$db = $opt{d} if($opt{d}); +$host = $opt{H} if($opt{H}); +$port = $opt{P} if($opt{P}); +$usr = $opt{u} if($opt{u}); +$pwd = $opt{p} if($opt{p}); + +# ------------------ +# dump_duplicates +# ------------------ +sub dump_duplicates { + +# my $sth = $dbh->prepare('select id,title,channel_id FROM CHRONICLE') + my $sth = $dbh->prepare('select id,title,channel_id FROM CHRONICLE WHERE id IN (SELECT id FROM TMPCHRONICLE)') + or die "Couldn't prepare dump statement: " . $dbh->errstr; + my @data; + + $sth->execute() + or die "Couldn't execute dump statement: " . $sth->errstr; + + while (@data = $sth->fetchrow_array()) { + print sprintf("%3d: %20s %s\n",$data[0],$data[2],$data[1]); + } + + if ($sth->rows == 0) { + print "There none duplicates found.\n"; + } +} +# ------------------ +# search and remove duplicates from CHRONICLE +# ------------------ +sub remove_duplicates { + + $dbh->do(qq|DROP TABLE IF EXISTS TMPCHRONICLE|) + || die "Couldn't drop temporary table: ". $dbh->errstr; + $dbh->do(qq| + CREATE TEMPORARY TABLE TMPCHRONICLE + SELECT min(id) id + FROM CHRONICLE + GROUP BY title,channel_id,starttime,duration + HAVING count(*) > 1 + |) || die "Couldn't create temporary table: ". $dbh->errstr; + + &dump_duplicates() if(! $opt{q}); + + $dbh->do(qq|DELETE FROM CHRONICLE WHERE id IN (SELECT id FROM TMPCHRONICLE)|) + || die "Couldn't delete duplicates from temporary table: ". $dbh->errstr; + + $dbh->do(qq|DROP TABLE IF EXISTS TMPCHRONICLE|) + || die "Couldn't drop temporary table: ". $dbh->errstr; + + $dbh->disconnect; + + return 0; +} + +$dbh = DBI->connect("DBI:mysql:database=$db;host=$host;port=$port", $usr, $pwd,{ + PrintError => 1, + AutoCommit => 1, +}) || die $DBI::errstr; + +exit 1 + unless($dbh); + +exit &remove_duplicates(); + + + diff --git a/contrib/create-database.sql b/contrib/create-database.sql new file mode 100644 index 0000000..8c31b90 --- /dev/null +++ b/contrib/create-database.sql @@ -0,0 +1,22 @@ +-- +-- Current Database: mysql +-- +use mysql; + +CREATE DATABASE IF NOT EXISTS xxv; + +use xxv; + +-- Create a mysql-Account : Adjust User and Password here and add this to xxvd.cfg +-- [General] +-- DSN=DBI:mysql:database=xxv;host=localhost;port=3306 +-- PWD=password +-- USR=username + +-- The first line is useful for granting access to user xxv on all computers in a network. +/* grant all privileges on xxv.* to username@'%' IDENTIFIED BY 'password'; */ + +-- Grant access to user xxv on the local machine with password 'xxv' +grant all privileges on xxv.* to xxv@localhost IDENTIFIED BY 'xxv'; + +flush privileges; diff --git a/contrib/export-data.sql b/contrib/export-data.sql new file mode 100644 index 0000000..d863159 --- /dev/null +++ b/contrib/export-data.sql @@ -0,0 +1,10 @@ +-- +-- Store Table from Database xxv to files +-- + +select * INTO OUTFILE '/tmp/autotimer.sav' from AUTOTIMER; +select * INTO OUTFILE '/tmp/user.sav' from USER; +select * INTO OUTFILE '/tmp/chronicle.sav' from CHRONICLE; +select * INTO OUTFILE '/tmp/medialib_actors.sav' from MEDIALIB_ACTORS; +select * INTO OUTFILE '/tmp/medialib_videodata.sav' from MEDIALIB_VIDEODATA; +select * INTO OUTFILE '/tmp/medialib_videogenre.sav' from MEDIALIB_VIDEOGENRE; diff --git a/contrib/import-data.sql b/contrib/import-data.sql new file mode 100644 index 0000000..fbad5e8 --- /dev/null +++ b/contrib/import-data.sql @@ -0,0 +1,17 @@ +-- +-- Load files to Database xxv +-- + +DELETE from AUTOTIMER; +DELETE from CHRONICLE; +DELETE from USER; +DELETE from MEDIALIB_ACTORS; +DELETE from MEDIALIB_VIDEODATA; +DELETE from MEDIALIB_VIDEOGENRE; + +load data infile '/tmp/autotimer.sav' into table AUTOTIMER; +load data infile '/tmp/user.sav' into table USER; +load data infile '/tmp/chronicle.sav' into table CHRONICLE; +load data infile '/tmp/medialib_actors.sav' into table MEDIALIB_ACTORS; +load data infile '/tmp/medialib_videodata.sav' into table MEDIALIB_VIDEODATA; +load data infile '/tmp/medialib_videogenre.sav' into table MEDIALIB_VIDEOGENRE; diff --git a/contrib/update-xxv b/contrib/update-xxv new file mode 100755 index 0000000..ec51119 --- /dev/null +++ b/contrib/update-xxv @@ -0,0 +1,283 @@ +#!/bin/bash +# +# Update XXV's database +# +# Usage: update-xxv [OPTIONS] +# +# Options: -b : Make a backup first to .gz +# -h : Host name of the MySQL server (default: localhost) +# -P : Port number of MySQL server +# -d : XXV database name (default: xxv) +# -u : Username (default: root) +# -p : Password (default: no password) +# -a : Ask for password +# -f : Force upgrade, do not check version +# -v : Display actual Version +# -h : Help + + +# Increment the version number each time the database changes! +# +actualVersion=25 + +# Specify tables to export before and import after update +# +tables='AUTOTIMER USER CHRONICLE MEDIALIB_ACTORS MEDIALIB_VIDEODATA MEDIALIB_VIDEOGENRE' + +showTitle() +{ + echo + echo 'update-xxv' + echo '----------' + echo +} + +showHelp() +{ + echo 'Usage: update-xxv [-b] [-h hostname] [-P port] [-d database]' + echo ' [-u user] [-p password]' + echo + echo '-b : Make a backup first to .gz' + echo '-H : Host name of the MySQL server (default: localhost)' + echo '-P : Port number of MySQL server' + echo '-d : XXV database name (default: xxv)' + echo '-u : Username (default: root)' + echo '-p : Password (default: no password)' + echo '-a : Ask for password' + echo '-f : Force upgrade, do not check version' + echo '-v : Display actual version' + echo '-h : Help' +} + +showCommandLineHint() +{ + echo + echo 'Hint: You might need to overwrite the defaults for the database' + echo 'server, the database name or the user name and password.' + echo + echo 'See update-xxv -h for a list of available options.' + echo +} + +showError() +{ + echo "Error: $*" >&2 +} + +showInfo() +{ + echo "Info: $*" +} + +setDefaults() +{ + [ -z $isDoBackup ] && isDoBackup='false' + [ -z $host ] && host='localhost' + [ -z $database ] && database='xxv' + [ -z $user ] && user='root' + [ -z $isForceUpdate ] && isForceUpdate='false' + [ -z $askPassword ] && askPassword='false' +} + +buildMysqlParams() +{ + mysqlParams="--host=$host --user=$user" + if [ $askPassword == 'true' ] ; then + mysqlParams="$mysqlParams -p" + else + if [ -n "$password" ] ; then + mysqlParams="$mysqlParams --password='$password'" + fi + fi + if [ -n "$port" ] ; then + mysqlParams="$mysqlParams --port=$port" + fi +} + +checkXxv() +{ + if pgrep xxvd >/dev/null 2>&1 ; then + showError 'XXV is still running, please stop XXV first!' + exit 1 + fi +} + +checkServer() +{ + showInfo 'Checking Server' + if ! eval mysql $mysqlParams /dev/null 2>&1 ; then + showError "Can not connect to mysql server on '$host' !" + showCommandLineHint + exit 1 + fi +} + +checkDatabase() +{ + showInfo 'Checking Database' + if ! eval mysql $mysqlParams -f -B -e '"show databases;"' | \ + grep -e "^$database$" > /dev/null 2>&1 ; then + showError "Can not access database '$database'" + showCommandLineHint + exit 1 + fi +} + +exportDb() +{ + showInfo 'Saving Data' + for table in $tables ; do + savFile="$exportDir/$table.sav" + if ! eval mysql $mysqlParams -f -B $database -e \ + "\"select * into outfile '$savFile' from $table;\"" ; then + showError "Can't save table '$table'" + fi + done +} + +importDb() +{ + showInfo 'Restoring Data' + for table in $tables ; do + savFile="$exportDir/$table.sav" + if ! eval mysql $mysqlParams -f -B $database -e \ + "\"load data infile '$savFile' into table $table;\"" ; then + showError "Can't load table '$table'" + exit 1 + fi + done +} + +updateDb() +{ + showInfo 'Updating Database' + if ! eval mysql $mysqlParams -f -B $database < upgrade-xxv-db.sql ; then + showError 'Update failed!' ; + exit 1 + fi +} + +getActualVersion() +{ + showInfo "Retrieving actual version: '$actualVersion'"; +} + +getVersion() +{ + showInfo 'Retrieving current version' + version=`eval mysql $mysqlParams -f -B -s $database -e \ + "\"select Version from VERSION;\"" 2>/dev/null` +} + +updateVersion() +{ + showInfo 'Updateing Version' + if ! eval mysql $mysqlParams -f -B $database -e \ + "\"insert into VERSION (Version) VALUES($actualVersion);\"" ; then + showError 'Could not set new version number!!!' + exit 1 + fi +} + +# +# main() +# + +showTitle + +# parse parameters +while [ $# -ge 1 ] ; do + case $1 in + -b) + backupTarget=$2 ; shift + ;; + -H) + host=$2 ; shift + ;; + -P) + port=$2 ; shift + ;; + -d) + database=$2 ; shift + ;; + -u) + user=$2 ; shift + ;; + -p) + password=$2 ; shift + ;; + -a) + askPassword='true' + ;; + -f) + isForceUpdate='true' + ;; + -v) + getActualVersion + exit 1; + ;; + *) + showHelp + exit 1 + ;; + esac + + shift +done + +# check if XXV is still running +checkXxv + +# set defaults and build mysql command line +setDefaults +buildMysqlParams + +# check the database +checkServer +checkDatabase + +# retrieve version and check if update should be performed +getVersion +[ -z $version ] && version=0 +showInfo "current database version: $version" +showInfo "new database version: $actualVersion" + +if [ $actualVersion -eq $version ] ; then + showInfo 'Database is up to date - no need to update' + if [ $isForceUpdate == 'true' ] ;then + showInfo 'As requested, the update will be forced!' + else + exit 0 + fi +fi +if [ $actualVersion -lt $version ] ; then + showError 'Database is more actual than the version you want to update to.' + showError 'Database downgrades are not advisable!' + if [ $isForceUpdate == 'true' ] ;then + showInfo 'As requested, a downgrade will be forced anyway!' + else + exit 1 + fi +fi + +# backup +if [ ! -z $backupTarget ] ; then + showInfo 'Performing backup...' + mysqldump $mysqlParams $database | gzip >"$backupTarget.gz" 2>/dev/null + if [ $? -ne 0 ] ; then + showError 'Backup failed!!!' + exit 1 + fi +fi + +# now actually perform the update +showInfo 'Starting update...' +exportDir=/tmp/xxv-update.$$ +mkdir $exportDir +chmod a+rwx $exportDir +exportDb +updateDb +importDb +updateVersion +showInfo 'Update successful' +rm -rf $exportDir diff --git a/contrib/upgrade-xxv-db.sql b/contrib/upgrade-xxv-db.sql new file mode 100644 index 0000000..f8e075a --- /dev/null +++ b/contrib/upgrade-xxv-db.sql @@ -0,0 +1,304 @@ +-- MySQL dump 10.10 +-- +-- Host: localhost Database: xxv +-- ------------------------------------------------------ +-- Server version 5.0.30-Debian_3 + +-- +-- Table structure for table `AUTOTIMER` +-- + +DROP TABLE IF EXISTS `AUTOTIMER`; +CREATE TABLE `AUTOTIMER` ( + `Id` int(11) unsigned NOT NULL auto_increment, + `Activ` enum('y','n') default 'y', + `Done` set('timer','recording','chronicle') NOT NULL default 'timer', + `Search` text NOT NULL, + `InFields` set('title','subtitle','description') NOT NULL, + `Channels` text, + `Start` char(4) default '0000', + `Stop` char(4) default '0000', + `MinLength` tinyint(4) default NULL, + `Priority` tinyint(2) default NULL, + `Lifetime` tinyint(2) default NULL, + `Dir` text, + `VPS` enum('y','n') default 'n', + `prevminutes` tinyint(4) default NULL, + `afterminutes` tinyint(4) default NULL, + `Weekdays` set('Mon','Tue','Wed','Thu','Fri','Sat','Sun') default NULL, + `startdate` datetime default NULL, + `stopdate` datetime default NULL, + `count` int(11) default NULL, + PRIMARY KEY (`Id`) +) TYPE=MyISAM; + +-- +-- Table structure for table `CHANNELGROUPS` +-- + +DROP TABLE IF EXISTS `CHANNELGROUPS`; +CREATE TABLE `CHANNELGROUPS` ( + `Id` int(11) NOT NULL auto_increment, + `Name` varchar(100) default 'unknown', + `Counter` int(11) default '0', + PRIMARY KEY (`Id`) +) TYPE=MyISAM; + +-- +-- Table structure for table `CHANNELS` +-- + +DROP TABLE IF EXISTS `CHANNELS`; +CREATE TABLE `CHANNELS` ( + `Id` varchar(100) NOT NULL, + `Name` varchar(100) NOT NULL default '', + `Frequency` int(11) NOT NULL default '0', + `Parameters` varchar(100) default '', + `Source` varchar(100) default NULL, + `Srate` int(11) default '0', + `VPID` varchar(100) default '', + `APID` varchar(100) default '', + `TPID` varchar(100) default '', + `CA` varchar(100) default '', + `SID` int(11) default '0', + `NID` int(11) default '0', + `TID` int(11) default '0', + `RID` int(11) default '0', + `GRP` int(11) default '0', + `POS` int(11) NOT NULL, + PRIMARY KEY (`Id`) +) TYPE=MyISAM; + +-- +-- Table structure for table `CHRONICLE` +-- + +DROP TABLE IF EXISTS `CHRONICLE`; +CREATE TABLE `CHRONICLE` ( + `id` int(10) unsigned NOT NULL auto_increment, + `hash` varchar(16) NOT NULL default '', + `title` text NOT NULL, + `channel_id` varchar(100) NOT NULL default '', + `starttime` datetime NOT NULL default '0000-00-00 00:00:00', + `duration` int(11) NOT NULL default '0', + PRIMARY KEY (`id`), + UNIQUE KEY `hash` (`hash`) +) TYPE=MyISAM; + +-- +-- Table structure for table `EPG` +-- + +DROP TABLE IF EXISTS `EPG`; +CREATE TABLE `EPG` ( + `eventid` bigint(20) unsigned NOT NULL default '0', + `title` text NOT NULL, + `subtitle` text, + `description` text, + `channel_id` varchar(100) NOT NULL default '', + `starttime` datetime NOT NULL default '0000-00-00 00:00:00', + `duration` int(11) NOT NULL default '0', + `tableid` tinyint(4) default '0', + `image` text, + `version` tinyint(3) default '0', + `video` varchar(100) default '', + `audio` varchar(255) default '', + `addtime` datetime NOT NULL default '0000-00-00 00:00:00', + `vpstime` datetime default '0000-00-00 00:00:00', + PRIMARY KEY (`eventid`), + KEY `starttime` (`starttime`), + KEY `channel_id` (`channel_id`) +) TYPE=MyISAM; + +-- +-- Table structure for table `MEDIALIB_ACTORS` +-- + +DROP TABLE IF EXISTS `MEDIALIB_ACTORS`; +CREATE TABLE `MEDIALIB_ACTORS` ( + `name` varchar(255) NOT NULL default '', + `actorid` varchar(15) NOT NULL default '', + `imgurl` varchar(255) NOT NULL default '', + `checked` timestamp NOT NULL, + PRIMARY KEY (`name`) +) TYPE=MyISAM; + +-- +-- Table structure for table `MEDIALIB_VIDEODATA` +-- + +DROP TABLE IF EXISTS `MEDIALIB_VIDEODATA`; +CREATE TABLE `MEDIALIB_VIDEODATA` ( + `id` int(10) unsigned NOT NULL auto_increment, + `md5` varchar(32) default NULL, + `title` varchar(255) default NULL, + `subtitle` varchar(255) default NULL, + `language` varchar(255) default NULL, + `diskid` varchar(15) default NULL, + `comment` varchar(255) default NULL, + `disklabel` varchar(32) default NULL, + `imdbID` varchar(15) default NULL, + `year` year(4) default NULL, + `imgurl` varchar(255) default NULL, + `director` varchar(255) default NULL, + `actors` text, + `runtime` int(10) unsigned default NULL, + `country` varchar(255) default NULL, + `plot` text, + `filename` varchar(255) default NULL, + `filesize` int(16) unsigned default NULL, + `filedate` datetime default NULL, + `audio_codec` varchar(255) default NULL, + `video_codec` varchar(255) default NULL, + `video_width` int(10) unsigned default NULL, + `video_height` int(10) unsigned default NULL, + `istv` tinyint(1) unsigned NOT NULL default '0', + `lastupdate` timestamp NOT NULL, + `seen` tinyint(1) unsigned NOT NULL default '0', + `mediatype` int(10) unsigned NOT NULL default '0', + `custom1` varchar(255) default NULL, + `custom2` varchar(255) default NULL, + `custom3` varchar(255) default NULL, + `custom4` varchar(255) default NULL, + `created` datetime default NULL, + `owner_id` int(11) NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `seen` (`seen`), + KEY `title_idx` (`title`), + KEY `diskid_idx` (`diskid`), + KEY `mediatype` (`mediatype`,`istv`), + FULLTEXT KEY `actors_idx` (`actors`), + FULLTEXT KEY `comment` (`comment`) +) TYPE=MyISAM; + +-- +-- Table structure for table `MEDIALIB_VIDEOGENRE` +-- + +DROP TABLE IF EXISTS `MEDIALIB_VIDEOGENRE`; +CREATE TABLE `MEDIALIB_VIDEOGENRE` ( + `video_id` int(10) unsigned NOT NULL default '0', + `genre_id` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`video_id`,`genre_id`) +) TYPE=MyISAM; + +-- +-- Table structure for table `MUSIC` +-- + +DROP TABLE IF EXISTS `MUSIC`; +CREATE TABLE `MUSIC` ( + `Id` int(11) unsigned NOT NULL auto_increment, + `FILE` text NOT NULL, + `ARTIST` varchar(128) default 'unknown', + `ALBUM` varchar(128) default 'unknown', + `TITLE` varchar(128) default 'unknown', + `COMMENT` varchar(128) default NULL, + `TRACKNUM` varchar(10) default '0', + `YEAR` smallint(4) unsigned default NULL, + `GENRE` varchar(128) default NULL, + `BITRATE` smallint(4) unsigned default NULL, + `FREQUENCY` varchar(4) default NULL, + `SECS` int(11) NOT NULL, + PRIMARY KEY (`Id`) +) TYPE=MyISAM; + +-- +-- Table structure for table `OLDEPG` +-- + +DROP TABLE IF EXISTS `OLDEPG`; +CREATE TABLE `OLDEPG` ( + `eventid` bigint(20) unsigned NOT NULL default '0', + `title` text NOT NULL, + `subtitle` text, + `description` text, + `channel_id` varchar(100) NOT NULL default '', + `starttime` datetime NOT NULL default '0000-00-00 00:00:00', + `duration` int(11) NOT NULL default '0', + `tableid` tinyint(4) default '0', + `image` text, + `version` tinyint(3) default '0', + `video` varchar(100) default '', + `audio` varchar(255) default '', + `addtime` datetime NOT NULL default '0000-00-00 00:00:00', + `vpstime` datetime default '0000-00-00 00:00:00', + PRIMARY KEY (`eventid`), + KEY `starttime` (`starttime`), + KEY `channel_id` (`channel_id`) +) TYPE=MyISAM; + +-- +-- Table structure for table `RECORDS` +-- + +DROP TABLE IF EXISTS `RECORDS`; +CREATE TABLE `RECORDS` ( + `eventid` bigint(20) unsigned NOT NULL, + `RecordId` int(11) unsigned NOT NULL, + `RecordMD5` varchar(32) NOT NULL, + `Path` text NOT NULL, + `Prio` tinyint(4) NOT NULL, + `Lifetime` tinyint(4) NOT NULL, + `State` tinyint(4) NOT NULL, + `Marks` text, + `Type` enum('TV','RADIO','UNKNOWN') default 'TV', + `addtime` timestamp NOT NULL, + PRIMARY KEY (`eventid`), + UNIQUE KEY `eventid` (`eventid`) +) TYPE=MyISAM; + +-- +-- Table structure for table `TIMERS` +-- + +DROP TABLE IF EXISTS `TIMERS`; +CREATE TABLE `TIMERS` ( + `Id` int(11) unsigned NOT NULL, + `Status` char(1) default '1', + `ChannelID` varchar(100) NOT NULL default '', + `Day` varchar(20) default '-------', + `Start` int(11) unsigned default NULL, + `Stop` int(11) unsigned default NULL, + `Priority` tinyint(2) default NULL, + `Lifetime` tinyint(2) default NULL, + `File` text, + `Summary` text, + `NextStartTime` datetime default NULL, + `NextStopTime` datetime default NULL, + `Collision` varchar(100) default '0', + `eventid` bigint(20) unsigned default '0', + `eventstarttime` datetime default NULL, + `eventduration` int(10) unsigned default '0', + `AutotimerId` int(11) unsigned default '0', + `addtime` timestamp NOT NULL, + `Checked` char(1) default '0', + PRIMARY KEY (`Id`) +) TYPE=MyISAM; + +-- +-- Table structure for table `USER` +-- + +DROP TABLE IF EXISTS `USER`; +CREATE TABLE `USER` ( + `Id` int(11) unsigned NOT NULL auto_increment, + `Name` varchar(100) NOT NULL default '', + `Password` varchar(100) NOT NULL, + `Level` set('admin','user','guest') NOT NULL, + `Prefs` varchar(100) default '', + `UserPrefs` varchar(100) default '', + `Deny` set('tlist','alist','rlist','mlist','tedit','aedit','redit','remote','stream','cedit','media') default NULL, + `MaxLifeTime` tinyint(2) default '0', + `MaxPriority` tinyint(2) default '0', + PRIMARY KEY (`Id`) +) TYPE=MyISAM; + +-- +-- Table structure for table `VERSION` +-- + +DROP TABLE IF EXISTS `VERSION`; +CREATE TABLE `VERSION` ( + `Version` tinyint(4) NOT NULL default '0' +) TYPE=MyISAM; diff --git a/default b/default new file mode 120000 index 0000000..724f4d4 --- /dev/null +++ b/default @@ -0,0 +1 @@ +html \ No newline at end of file diff --git a/doc/CHANGELOG.txt b/doc/CHANGELOG.txt new file mode 100644 index 0000000..9da2826 --- /dev/null +++ b/doc/CHANGELOG.txt @@ -0,0 +1,1415 @@ +0.90 (testing) + + * VTX: In der VTX-Seite vorhandene URL (www...) sind jetzt mit wählbaren Verweisen hinterlegt. + * TIMERS: BUG[181] Es wird eine Warnung angezeigt wenn der Festplattenplatz nicht ausreicht um den Event aufzunehmen. + * RECORDS: BUG[182] Aufnahmen können jetzt auch rekursiv gelöscht werden. + * REMOTE: Monitor ausblendbar (Über Einstellungen vor einstellbar) + * display/rdisplay: REQUEST[229] Link zu Titelsuche mit imdb/ofdb. + * EPG: Bug[205] Bei Konflikten wird jetzt im title angezeigt, mit welchen Timer dieser im Konflikt steht. + * schema.tmpl: Laufender Timer färbt die Eventbox grün + * EPG: Bug[218] Epg Daten werden jetzt über den SVDRP Socket gelesen + * EPG: Bug[218] Epg Daten werden mit DB verglichen und bei Bedarf ersetzt + * USER: Request[194] Zusätzliche Benutzereinschränkung, per Stream[Livestream],Remote[Umschalten] + * AUTOTIMER: Kein eigenständiger einstellbarer Prüfintervall mehr, nur wenn sich die EPG Daten ändern, wird automatisch auf AT geprüft + * AUTOTIMER: Request[223] Datenbank basierte DONE Liste für Serienaufnahmen. + !!! NEUE DB VERSION 23 !!! + + Done y/n durch seperate Auswahl für timer/recordings/chronicle ersetzt + * AUTOTIMER: Request[241] VDRADMIN-Import/Export als sicherheitsrelevantes Feature in eigenen Skript ausgelagert './contrib/at-vdradmin2xxv.pl' + * AUTOTIMER: Request[206] Suchen nach Cast, Category usw in Autotimer + * HTTPD, TELNET, INTERFACE, MUSIC, WAPD: Request[242] IP-Adresse für Server bindbar gemacht. + Neuer Parameter 'Interface' - Default : 0.0.0.0 Server lauscht an allen Netzwerkanschlüssen. + * EPG: erestart - Update des EPG mit Fortschrittsbalken + * WAIT: Anzeige der Restzeit + * EPG: schema für Direktanwahl mit Uhrzeit im HH:MM Format aufrufbar + * TIMER: Anzeige Beschreibung per Tooltip ermöglicht + * RECORDS: Anzeige Beschreibung per Tooltip ermöglicht + * TIMER: Option "Timer justieren, wenn EPG Eintrag verändert wurde" per Setup deaktivierbar gemacht + * RECORDS: redit/info.vdr nicht mehr in in Rohform bearbeiten sondern separate Eingabefelder für die jeweiligen Einträge (Beschreibung, Kanal ...) + * RECORDS: Request[196] Anzeige der Startzeit der Aufnahmen + * EPG/TIMER/RECORDS: Request[259] Anzeige der EPG-Beschreibung als Tooltip (per AJAX) + * AUTOTIMER/EPG/RECORDS: Request[187] Suche erweitert mit Logik Operatoren (AND, OR, AND NOT) + * HTTPD: Default HTML-Template Dir. Wenn ein Template im skin nicht gefunden wird, wird automatisch das defdir benutzt. + * Ajax.pm : Support JSON Format + * contrib/chronicle-remove-duplicate.pl Skript zum Entfernen von doppelte Einträge. (z.B. nach dem Update von mysql 4.0 auf 5.0) + * MUSIC: Request[235] Cover werden ebenfalls aus den MP3 Ordner verwenden. + * MUSIC: Neues Kommando(mgetfile) für direktes Abspielen/-Streamen der Datei. + * USER: Medienbibliothek in USER Verwaltung per deny:media selektiv sperrbar. + * AUTOTIMER/TIMER: Statusabfrage beim toggle per AJAX ermöglicht + * main: Reihenfolge des Systemstart reorganisiert + * Update von AUTOTIMER/CHRONICLE werden nicht mehr per zyklischen Timer, + sondern direkt von EPG/RECORDS aufgerufen, nur noch wenn sich Daten geändert haben. + * SVDRP: Timeout einstellbar gemacht + * RECORDS: Aktualisieren der Aufnahmen extrem beschleunigt, nur geänderte Aufnahmen werden neu eingelesen bzw. nur der Status in DB aktualisiert. + * Suchfunktion um 'Suggest' via Ajax Feature erweitert + * Erstellung von Vorschaubilder mittels vdr2jpeg berücksichtigt Schnittmarken + * Ausgabe der Versionsnummer im Statusheader der HTML Response + * RECORDS : Verwalten der Aufnahmen mit eindeutiger ID Request[251] + * RECORDS/rdisplay : Starten des Schnittprozess im VDR + * HTTPD: Formulardaten per POST-Request verarbeiten + +* Fixes + * HTML: Sonderzeichen werden jetzt rekursiv im Daten- sowie Parameterhash korrekt ersetzt. + * HTML: entities für templates deaktiviert. + !!! Achtung, da jetzt grundsätzlich alle Daten mit entities bearbeitet werden + !!! müssen alle entities aus den Skins raus. + * HTML/widget/string: 'readonly'-Daten nicht mehr als Formulardaten senden + * RECORDS: Meldung 'Kann x Aufnahmen nicht zuordnen' informativer gemacht - Bug[209] + * RECORDS: Nur Aufnahmen in Verzeichnissen mit '*.rec' einlesen (ignorieren von gelöschten Aufnahmen '*.del') + * docu.tmpl: Datum aktualisiert + * MUSIC: Obwohl Modul inaktiv wurde Datenbankverbindung und Socket geöffnet + * MUSIC: Symbolische Linkschleifen (Link-Loops) führten in MP3::Icecast::add_directory + zu einer Endlosschleife (berichtet von Karsten Müller) + * HTML: Einstellungen > CONFIG - Abschnitt CONFIG existiert nicht in der Konfiguration Bug[207] + * AT/EPG/RECORDS/TIMER/USER : Initialisierung der Module abbrechen wenn keine Verbindung zur Datenbank existiert. + * Generell/restart: Neustart - nur verfügbar wenn XXV als root läuft Bug[201] + * STREAM: BUG[193] Playlisten für Videoaufnahmen in EXTM3U Format (Frank Enderle) + * RECORDS: Aufnahme mit gleichen Titel und aufeinander folgendem Zeitraum, wurden als nur eine Aufnahme angezeigt + * alist/topten: BUG[210] Kanäle wurden nicht angezeigt. + * RECORDS: Request[244] Lesbares Datumsformat für Datenbankfelder + * EPG: Bug[217] erestart - redirect produzierte Fehlermeldung ERROR : I don't understand the command '' + * EPG: Bug[218] EPG Events die nicht mehr vom vdr erwähnt wurden, werden jetzt gelöscht + * RECORDS: Redundante Datenfelder entfernt + * STREAM: BUG[246] Aufbau des Pfad für Windowsfreigaben, die über einen Laufwerksbuchstaben gebunden sind. + * AUTOTIMER: BUG[231] Parameter prevminutes und afterminutes ließen sich nicht auf 0 stellen + Tipp: Werden die Fehler leer gelassen, wird der Defaultwert der Timer verwendet. + * EPG: Abgelaufene EPG Einträge standen nicht mehr für "display" zur Verfügung. + * CHRONICLE: Bug[252] Can't locate object method "status" via package + * SHARE: Bug[221] Anzahl der Meldung "syntax error at /usr/lib/perl5/XML/Parser.pm" reduziert + * MUSIC: Bug[253] Fehlerausgabe bei Inaktivität des Moduls verhindern + * EPG: Bug[249] Speicherbedarf beim Einlesen der EPG Daten reduziert + * HTML: Nur das erste Widget hatte Daten per HTML Encodierung (Timer mit Quote (") waren nicht möglich) + * TIMER: Optimierung - Timer justieren, wenn EPG Eintrag verändert wurde + * TIMER: Optimierung - Zuordnung EPG Eintrag, zum Timer + * CHANNELS: Fehlermeldung beim Auswahl der bekannten CA im Log verhindert. + * MUSIC: Bug[266] Streaming im Classic Mode funktionierte nicht mehr. + * main: Die Meldung 'Successfully connect to' kann auch, wenn keine Verbindung zur Datenbank aufgenommen werden konnte. + * AUTOTIMER: Globales Exclude der Kanäle nur noch nutzen, wenn der jeweilige Autotimer keinen Kanal zur Suche verwendet. + * topten: Ausgabe des Startzeitpunkt im Lokalen Datumsformat + * wait: ServerPush nicht bei MSIE ausgeben. + * MUSIC: getcovers redseliger gemacht. + * EPG: next: zeigte VPS Zeiten nicht an. + * STREAM/MUSIC: Playlist mit Dateinamen und Dateiendung *.m3u senden. + * schema: Navigation zwischen den Programmgruppen sprang ein Tag in die Zukunft. + * HTTPD: Probleme mit Dateinamen die ein '-' enthielten. + * Warnmeldungen behoben "Use of uninitialized value in sprintf at ..." + + bei Logging bei --verbose=5 ohne aktiven User, + + docu.tmpl + * HTTPD: Logging aller relevanten Informationen in eine Zeile zusammengefasst. + * AUTOTIMER: Auf Auswahl des Wochentags nur prüfen, wenn nicht die gesamte Woche aktiv ist + * Status: Dateisysteme mit "/" im Name des Device wurden graphisch nicht angezeigt + * MUSIC im 'Muggle' Mode + + mlist: Anzeige des Genre des Titel fehlte + + mrefresh: Titel wurden nur hinzugefügt, veraltete aber nie aus der DB entfernt. + + mlist: Suche nach Genre jetzt kompatibel zur Definition nach GiantDisc + (Pop (md) findet auch Subgenre Acoustic (mda), Synth Pop (mdb) ...) + * REPORT: Bug[267] News::Mail - Daten unvollständig + * HTTPD: Hardcodiertes Protokoll für AJAX Request entfernt + * MUSIC(classic): Datenbankfeld für Jahreszahl und Bitrate zu klein. + * HTTPD: pureperl entfernt und durch checkvalue ersetzt. + * CONFIG: Default Intervalle vergrößert um Systemlast zu reduzieren + * Log: Bei verbose=5 wurde falsches Modul, als aufrufendes Modul angezeigt + * SVDRP: Komplett überarbeitet, um mittels Timeout, ein Blockieren der Kommunikation zum VDR zu verhindern. + * LOG: Bug[272] Nach logrotate wurden keine neue Logdatei erstellt. + * EPG/AUTOTIMER Aufbau von Suchabfrage optimiert + * TIMER: Bug[237] Link zum Bearbeiten von Autotimer aus Timerliste hatte falsche ID + * USER: Logout nur Anzeigen wenn USER::active + * USER: Username nur Anzeigen, wenn USER::active und NoAuth nicht zutrifft. + * VTX: Übergabe der Parameter zum Widget zu den anderen Modulen angeglichen + * CHANNELS: Bei DVB-C(PVR) mit Transponderfrequenz unter 100MHz wurde ChannelID falsch generiert. + * EPG: Zugriff auch auf inaktive Timer über die zugehörigen EPG Einträge ermöglicht, bisher wurde ein neuer Timer angeboten. + * Skins: Datumsaugabe abhängig von den aktiven Ländereinstellungen ausgeben. + * STATUS: Bug[248] SCSI-Festplatten wurden nicht in der Hardwareliste angezeigt. + * Suche per ( ) ? schlug fehl + * Nicht alle Schnittpunkte der marks.vdr wurde eingelesen + * Vorschaubilder werden aus der gesamten Aufnahme erstellt + * Keine Mehrfachanzeige des Logindialogs, bei Abbruch des Loginvorganges + erscheint sofort eine Meldung "Zugang verboten" + * Überprüftung der Datenbanktabellen robuster gemacht (Defekte Tabellen ohne "Userdaten" werden gelöscht) + +0.80 (stable): +-------------------------------------------------------------------------------- +* Fixes: + * EPG/search: Bug[191] SQL-Fehler bei Suche nach Sendungen in einem Sender ohne Suchtext + * EPG: Funktion epurge entfernt. + * SVDRP : xxv versuchte auf einem geschlossenen Socket zu lesen. + * EPG: tvm2vdr images wurden nicht angezeigt. + * EPG: nicht alle tvm2vdr images wurden angezeigt. + * xxvd: Meldung 'GoodBye' entfernt. + * html: Bugfix[189] Bei Gruppenwechsel in now wurde die Zeit nicht übergeben + * locale: gettext-Ausgabe in Format ISO-8859-15 unabhängig der Umgebungsvariablen + * rlist/rsearch: Anzeige der freien Kapazität + * music: Wiedergabe ohne Proxy per Javascript unter IE schlägt fehlt + - Fehlermeldung: 'length' ist NULL oder kein Objekt (berichtet von Andreas Wellmann) + * RECORDS: Freien Kapazität inkorrekt berechnet + * Tools: typo im regex (DANKE an Malte) + + +0.72 (beta): +-------------------------------------------------------------------------------- +* Fixes: + * docu.tmpl: nicht nur im POD, sondern auch im DOCU und SKIN Verzeichnis suchen + * STREAM: mime-typ editbar gemacht, für Livestream/Wiedergabe Mime-Typ default: video/x-mpegurl, + zur korrekten Unterscheidung zum Streaming von Musik (audio/x-mpegurl) + * AUTOTIMER/TIMER: bei vom Autotimer angelegten, aber manuell modifizierte Timern + wurden vom AUTOTIMER permanent die Modifizierungen überschrieben. + * MUSIC: muggle-Database/Streaming funktioniert nicht, Path zur Datei fehlte + * SVDRP: Entfernen des EVENT-Logging für SVDRP Commands, um Rekursion über NEWS::VDR zu verhindern. + * Anpassung von getVdrVersion an VDR maintenance patch 1.4.0-1 + * install.sh Bug[183] (Ronny Kornexl) + + Modus "force" für Installation der Module hinzugefügt + + Typo doc/INSTALL + + install.sh Datenbankname wird aus etc/xxvd.cfg.example übernommen bzw. lässt sich per Parameter ändern. + + Weitere Optionen hinzugefügt, um per eigenen Wrapper etc/xxvd.cfg umzuschreiben (Details im install.sh) + * SVDRP: Rekursion über NEWS::VDR entfernt. + + Es wird kein Connect vorgenommen falls der socket noch offen ist. + * SHARE: TopTen Daten werden im Intervall und beim Start gecacht. + * SHARE: SOAP wird nur konnektiert wenn active gesetzt ist. + * bin/xxvd : Version auf 0.72 geändert + + +0.71 (beta): +-------------------------------------------------------------------------------- +* Feature: + * now/next Ausgabe mit CHANNELSGROUPS - FEATUREREQUEST[145] + * HTTPD: Skinsauswahl sortieren + * GRAB Image mit VDR1.3.38 + * AUTOTIMER: FEATUREREQUEST[146] neues Kommando asearch + * html: FEATUREREQUEST[147] day mit weekdays + * global: etc/xxvd.cfg nach etc/xxvd.cfg.example umbennant wegen FEATUREREQUEST[150] + * Installationsscript "install.sh" hinzugefügt + * RECORDS: Serverpush auch nach rdelete und redit FEATUREREQUEST[153] + * CHANNELS: getChannelType('Channelid') gibt den Type des Channels zurück('TV', 'RADIO') + * RECORDS: Neue Spalte in Tabelle Records (type) + * RECORDS: Radioaufnahmen werden bei videoPreview übersprungen (Danke Torsten/WarEagle) + * EVENTS: Neues Modul um eine Eventdatenbank zu erstellen FEATUREREQUEST[126] + * ALLMODULES: Neuer Parameter im modulePrefs 'RegEvent', Erläuterungen stehen in + AUTOTIMER->ModuleEigenschaften + * SHARE: Neues Modul für das Managment zum SOAP-Server (XXV-Server s.u.) + * Tools: neue routine getDataById($id, $table, 'Id'), macht einfach ein + select * from tabname where keyname = id + * AUTOTIMER: Der Abschnitt Module->RegEvent wurde noch um die + Optionen 'Match' sowie 'Actions' erweitert. + * RECORDS: Anzeige der Gesamt(abspiel)zeit + * TIMER: An 1.3.44 angepasst, im AUX-Feld wird nur noch das Autotimer ID gespeichert, + die Beschreibung kommt zum Aufnahmezeitpunkt aus dem EPG + wird aber bei Editieren des Timer als zusätzliche Beschreibung "schreibgeschützt" angezeigt + * EVENTS: Handling abgeschlossen. Es gibt ein neuen Logger mit dem Namen event, + dieser wird geparst und nach entsprechenden + Matches gesucht die xxv signalisieren eine Message an die NEWS::* zu schicken. + * AUTOTIMER: Falls eine Verbindung zur SOAP-DB exisitiert werden die programmierten Timer + automatisch bewertet und gespeichert. + * Tools: neue Routine getDataByTable + * TIMERS : Event wenn neue Timer auftauchen die keine Autotimer sind + * TIMERS : Tuning beim suchen nach nextepgid, alte Daten werden weiter verwendet. + * TIMERS : Neues Feld in Table 'checked'. *** DB Update *** ver. 16 + * STATUS : Featurerequest[152] Option damit statt der Tortengrafiken auch eine + Tabelle angezeigt werden kann. + * STATUS : Featurerequest[152] Die gemounteten Filesysteme werden jetzt mit angezeigt. + * MUSIC : Featurerequest[38] Angefangen das Musicmodul muggle kompatibel zu machen. + * MUSIC : Featurerequest[38] Aktualisieren mit mugglei. + * MUSIC : Featurerequest[38] Auch das streamen der Titel funktioniert jetzt mit muggle. + * NEWS::RSS : zusätzlicher Parameter (...?cmd=request&data=rss&__version=2) bei Request + zur Auslieferung von RSS Feeds in Version 1.0 o. 2.0 + * MUSIC : Coverdaten werden jetzt per Amazon Webdienst geholt. + Umstellung der Benennung von album.jpg nach artist-album.jpg für mehr Eindeutigkeit. + * SHARE : Neue Funktion TopTen: Stellt die 10 beliebtesten Sendungen in einer Tabelle dar. + * EPG : Audio- und Videoinformationen werden jetzt mit abgespeichert und angezeigt + * INTERFACE : Ist jetzt ein SOAP Server der durch dritte Programme genutzt werden kann + * rdisplay : Anzeige des Kanal auf dem die Aufnahme getätigt wurde. + * SHARE : Design for TopTenTable + * TIMERS : Neuer Event 'toogleTimer' jetzt auch mit 'on|off' auswertung -> und gefixt + * EPG,AUTOTIMER: VPSPatch von Malte. VPS-Zeiten werden übernommen falls VPS genuzt wird (DANKE Malte Schroeder!!) + !!! NEUE DB VERSION 20 !!! + * EPG : Advanced Search mode! + * AUTOTIMER : Suche erweitert um Sonderzeichen '&', hiermit kann man nach txt UND txt suchen. + * EPG : Advanced Search mode erweitert um Channel und mindestlaenge. + * HTTPD : Bugfix[177] Neuer Parameter Proxy für weitergeleitete calls (Danke Andreas Freund!) + * RECORDS: Reduzierung der Festplattenaktivitäten beim Aktualisierung im Hintergrund. + Aufnahmeverzeichnis wird nur noch neueingelesen, wenn VDR eine veränderte Aufnahmeliste meldet. + * bin/xxvd : Version auf 0.71 geändert + * EPG : Proxy entfernt und Lösung von Bugfix[177] eingecheckt (DANKE Andreas Freud) + * default : JS-Lösung von Bugfix[177] eingecheckt (DANKE Andreas Freud) + * NEWS : News für neue Beta 0.71 + + +* Fixes : + * etc/xxvd.cfg.example an vanilla vdr Installation angepasst, + * etc/xxvd.cfg.example Portnummer 8001 für TELNET (8081),INTERFACE(8082) angepasst um überschneidung mit vdradmin zu vermeiden + * next: Progressbar mit 100% ausgeblendet + * STATUS : df dran gehindert das es auch im NFS nachschaut + * EPG : imdb wieder rausgeschmissen ;) + * xxvd: Priorität der Suche der xxvd.cfg geordnet. 1. per configfile <--> 2. ~/.xxvd.cfg <--> 3. $RealBin/../etc/xxvd.cfg + Anzeige des verwendeten Dateinamen von xxvd.cfg im Logfile + * MUSIC: im Javascript MUSIC::PROXY in URL eingefügt siehe cmd=mplaylist ... &binary=1 + * RECORDS: keine Preview erstellung für Aufnahmen mit (') + * REMOTE/cmd: Ausgabe der hardcodierte HTMLTAGS auf param.tags umgestellt + * xxvd: Ermittlung der Revision mit svnversion (Falsche Ausgaben mit SVN 1.3) + * RECORDS: Redesign der Aufnahme- Dateizuordnung + * RECORDS: Fehlerhafte Meldung wenn Aufnahmen mit %-Zeichen nicht zugeordneten werden konnten + * STATUS: Tabelle war fehlerhaft am Anfang + * AUTOTIMER: Aufräumen beendet + * AUTOTIMER: FEATUREREQUEST Sendungen ausschliessen die mit gleichem Daten auf einem anderen Sender erscheinen + * TIMERS: Done hatte nicht funktioniert wenn 2 neue Timer in einem Durchgang gefunden wurden. + * HTML: Progressbalken per Server-Push wird jetzt Browserabhängig nur noch bei Mozilla-Derviaten und IE angezeigt BUG[153] + * redit: Änderungen des Descriptionfeldes der Aufnahme wurden nicht in Datenbank neueingelesen + * RECORDS: Für Aufnahme mit Singlequote ' bzw '%' im Subtitel wurden permanent Vorschaubilder erstellt. + * RECORDS: Bug[149/157] Verhindern des wiederholten versuchen Vorschaubilder zuerstellen. + xxvd_mplayer.log wird jetzt im jeweiligen Verzeichnis der Vorschaubilder abgelegt. + und es werden maximale zwei Durchläufe durchgeführt, um auch alle Vorschaubilder für gerade gestartete Aufnahme zu erhalten. + deshalb heissen die Logdatei jetzt jeweils preview_1st.log und preview_2nd.log + * RECORDS: Fehler in Vorschaubilderbehandlung Kommandostapel wurde nach fork nicht geleert + * GRAB: Erweiterte Fehlerbehandlung falls GRAB des Bildes fehlschlägt + * RSS: Ausgabe des Eventdatum, nach Dublin Core + * CHANNELS: Erste Zeile mit Gruppe wurde nicht erkannt, a'la :@1 TV Sender + * RECORDS: Der Beschreibungstext wurde bei (|)-Umbruch abgeschnitten + * AUTOTIMER: Es wurden noch ein paar alte Zeitformatroutinen benutzt. + * EVENT: Aktiviert/Deaktivbar gemacht + * EVENT: Ausgaben in Logdatei umgeleitet + * CONFIG: Eingabe von "0" zulassen, und nicht mehr mit Default überschreiben. + * AUTOTIMER: Lifetime mit '0' zulassen + * SHARE: Wenn Server nicht erreichbar, dann nur Fehlermeldung! + * SHARE: Wenn ein Level gesetzt wurde muss dieser in dem Hash ebenfalls gesetzt werden. + * Skin: Anzeige des Levels in default und xstyle eingebaut. + * STATUS: Bugfix[151] Panikmeldung bei gemounteten CDROM, mounts mit cdfs und iso9660 werden ignoriert + * TIMERS: Keine Events für neue Timer beim Neustart + * Records: vdr2jpeg scheint manchmal seine Arbeit nicht fertig zu machen ;) In manchen Ordnern liegen Filesysteme + die ungefähr so aussehen: tmp-vdr2jpeg-74d5b3fe07.jpg Deswegen auch ab und zu fehlende Bilder ... gefixt. + * EPG: Bugfix[161] epgrestart gefixt. + * NEWS::RSS : RSS Entrys werden jetzt richtig angezeigt. + * xxvd : Use of uninitialized value in substitution (s///) at /root/XXV/bin/xxvd line 180 ... fixed + * Timers: Bugfix[163] Falsche Zuordnung der events in der Timerlist. + * AUTOTIMER: Bugfix[164] Aus Sicherheitsgründen beim Autotimerexport verhindern das Dateien überschreiben werden. + und Warnung ausgeben wenn Liste der Autotimer leer ist. + * MUSIC : Genres auswahl funktioniert jetzt + * EPG : Bugfix in getId routine. + * SHARE : Falsche Reihenfolge der Parameter + * MUSIC : ständige Fehlermeldung bei muggle und STATUS + * DB Stuktur Datentypen überarbeitet. *** DB Update *** ver. 18 + * SHARE : XXV stirbt ohne Internetverbindung, selbst wenn SHARE inaktiv ist + * Tools : Bugfix[168] Doszeilenumbrüche beim abspeichern. + * RECORDS : Bugfix[166] Aufnahme: 'titel', konnte nicht nach 'titel~serientitel' umbenannt werden. + * RECORDS : Bugfix im gemäß VDR im VFAT Modus '.' am Ende von Directoryname mit #2E kodieren. + * AUTOTIMER : Bugfix[170] Umlaute in sql statement. + * MUSIC : Bugfix[167] Fehlermeldung und abbruch des Starts wenn GiantDisc DB nicht erreichbar. + * EPG : EPG Ids in allen Tabellen auf bigint geändert. !!! NEUE DB VERSION 19 !!! + * MUSIC : Reconnect bei ändern des muggle wertes. + * MUSIC : mlist(muggle) nur die Genres anzeigen, die auch mit Titeln hinterlegt sind. + * RECORDS: Nur die zweite von aufeinanderfolgende Aufnahme mit gleichem Titel wurde angezeigt. + * MUSIC : default in YEAR war falsch. !!! NEUE DB VERSION 21 !!! + * RECORDS : typo in deleteRecordEvent. + * SHARE : Wenn der SOAP Server nicht erreichbar ist, stürtzte xxv ab. + * TIMERS : Beim 2. Refresh der Timerdaten werden die Sendungen bewertet und zum Server geschickt. + * USERS : Bugfix[154] Temporäre Dateien werden unter / abgelegt, wenn Modul Users inaktiv + * SHARE : Bugfix[175] Es wurden weniger als die ersten 10 angezeigt. + * AUTOTIMER : Bugfix vom Autotimer werden keine Timer mehr mit VPS-Flag erzeugt (Danke Malte!) + +* Others : + * XXV-Server : ist per subversion erreichbar (Projekt XXV-Server) + * Dieser Server wird erstmal zu Testzwecken bei mir zu Hause laufen. + * Er baut komplett auf das SOAP Protokoll auf und ist z.Zt. für die automatische + Bewertung der EPG-Einträge vorgesehen. Siehe auch FEATUREREQUEST[126], die Daten werden + anonym gespeichert und erscheinen später als Sternchen ;) neben der Sendung. In XXV hab ich + es noch nicht eingebaut, da ich das Teil erstmal unter Last teste. + Jedenfalls schafft er ca. 5000 calls/sec, das sollte erstmal reichen. + * Hier einige Ideen noch dazu: + - globale EPG Datenbank: XXV wäre in der Lage seine EPG-Daten mit dem Server abzugleichen, falls der + Server weniger Informationen zu der Sendung hat kann XXV die fehlenden Daten schicken. Natürlich gehts + auch andersrum, XXV holt sich dir Mehrinformationen vom Server. Dadurch würde es schon reichen wenn einer + mehr Informationen zu einer Sendung hat und die xxv's aktualisieren sich automatisch. + - TopTen: Man könnte sich die TopTen der nächsten Tage als Liste anzeigen lassen (Viele Bewertungen mit Hoher Punktzahl) + um keine Sendung mehr zu verpassen. + - Guess: XXV könnte in Verbindung mit dem Server schätzen welche Sendungen dem root gefallen könnten und bei Bedarf + Sendungen empfehlen. + +0.60 (stable) +-------------------------------------------------------------------------------- +* Fixes : + * configedit: Sortierung der Questions case insensitiv (Active erscheint damit immer als erste Option) + * HTTPD: 403/404-Fehlermeldung ohne doppelten footer ausliefern + * REPORT/RSS: alternativen link des rssfeed nur bei aktivem Modul report anbieten + * CHANNELS: Anlegen von neuen Kanälen schlägt fehl + * CHANNELS: SVDRP Fehlermeldung werden per err-Widget ausgegeben + * mini-install.sh : Developer script zum schnellen Installieren auf anderen Maschinen + \-> NICHT STARTEN, es sei denn ihr wisst was ihr tut ;) + * TIMERS : kleiner Fehler wenn keine Timer programmiert wurden + * contrib/upgrade-xxv-db.sql : AUTOTIMER, VPS auf default 'n' gestellt (Tobias Grimm) *** DB Update + * Changelog reorder (Wolfgang Rohdewald) + * stream: Html-Footer wurde bei livestream playlist mitgeliefert + * Html.pm: in Templates nutzbare routine getModule + * CONFIG.pm : neue Methode realModNames + * MUSIC : kein Parameter host mehr, wird jetzt von STREAM genommen + +0.52 (release candidate) +-------------------------------------------------------------------------------- +* Fixes : + * xxvd : neue Version in Vorbereitung der stable! + * a-/tedit : Genauer Überprüfung der Eingabe Parameter + * rdisplay.tmpl : Fehler beim Löschen von Aufnahmen + * NEWS::MAIL : Änderungen an user sowie passwort waren unwirksam. + * NEWS::JABBER : Kommt beim Start kein connect zustande so stürzte xxv komplett ab. + * AUTOTIMER : Classic mode (DIR~TITLE~SUBTILE) funktionierte nicht + * EPG : Fulltext index wieder rausgenommen, da bei insert die cpu last zu hoch war. *** DB Update notwendig + * TELNET : Bugfix(144) ReadLine wird jetzt auf explizit Perl Interface eingestellt. + * html : Bugfix(143) Sortiersymbole durch Bilder ersetzt. + * VTX: Zeichen 0x7F wurde falsch dargestellt + * CHANNELS : clist.tmpl - Schalter zum umschalten ([S]). + + + +0.50 (beta fixes 1-4) +-------------------------------------------------------------------------------- +* Neue Feature: + * Autotimer : den Parameter exclude so abgeändert das nur noch angeben werden muss das + z.B. 'POS > 50' ist und in die Kanalliste nicht aufgenommen wird. + * Das hat den Vorteil das man nicht ewig auf das Autotimer-Formular warten muss (bei mir > 30s). + LEIDER WIRD DIE ALTE EINSTELLUNG 'POS1,POS2,POS3,...' DURCH 'POS > 50' ERSETZT! + Das muss leider sein, damit der autotimer-parser nicht dadrüber stolpert. + BITTE DEN WERT NACH EINEM UPDATE BEI EUCH ANPASSEN! + + * HTTPD : incl. "Expires" Header + * main::DBCache : simpler Cachemechanismus um z.B. 'schema'-Abfragen zu beschleunigen. + * search.tmpl : Jetzt werden hier auch die Konflikte mit vorhanden Timern per Ajax dargestellt. + * HTTPD : neuer Parameter Debug, ist dieser == 'y' dann wird die Debugconsole im Browser angezeigt. + * LOGREAD : neue Methode tail, zum auslesen einer bestimmter Anzahl von Zeilen eines Logs + +* Fixes : + * Status : Bugfix(113) Tortendiagramme in Status::Filesystem sind teilweise falsch (Joachim Wilke) + * VTX : Option 'legacy'/'packed' syncron zur Beschreibung sortiert + * TELNET/rupdate : Ausgabe einer falsche Anzahl von Aufnahmen + * AUTOTIMER : Bugfix(117) Erstellen von Autotimern für Kanäle möglich, die von Autotimersuche ausgeschlossen wurden + * MUSIC : Falsche Anzeige der Abspielzeit von Titeln >= 1 Std. + * NEWS::RSS : Sonderzeichen als Entities kodieren + * WAPD: Anpassung nach Vorschlägen von http://www.validome.org/validate + * All : Bugfix(111) Die Tabellenüberschriften wurden nicht übersetzt. + * html - tlist : Bugfix(118) Nach Löschen von Timern erschien Navigation doppelt. + * html - alist : Bugfix(118) Nach Löschen von AutoTimern erschien Navigation doppelt. + * USER : mehr Doku und Standardweg zum Beschreiben von Methoden innerhalb der Plugins. + * html : Javascript und Styles werden extra geladen. + * html - display : Fix wg. localisierung. + * aedit/uedit : Fehlende Übersetzung der Auswahlfelder implementiert. + * AUTOTIMER : Spagetticode aufgeräumt ;) + * REMOTE : default pfad zu commands.conf angepasst (Tobias Grimm) + * contrib/update-xxv : user und host-Parameter wurden nicht verwendet (Tobias Grimm) + * *.pm : default pfade debian typisch geändert (Tobias Grimm) + * bin/xxvd : und wieder mal ein neuer Parameter --poddir (Tobias Grimm) + * html : Bugfix(122) es konnten keine Timer,Autotimer,User usw. unter Firefox gelöscht werden. + * widgets : neues Standardtemplate referer.tmpl + * Tools : fix in der int routine, komma vergessen, deswegen die übergrossen Durations in den Records + * Tools : entities ist jetzt fest in Tools.pm integriert + * NEWS::RSS : Html-Footer wurde bei rss feed mitgeliefert + * Console : Bugfix(119) Sooo, jetzt haben wir auch Tabellen an den Stellen wo sie vorkommen sollen. ;) + * all : unklassifizierte warn-Meldungen den Leveln panic/error/lg zugeordnet + * tools : permantentes dumpen des Call-Stacks unterbunden + * Whene creating the database tables, set actual db version instead of "1" + * now: Failed with parameter as time like 12:00 + * NEWS::Mail - from adresse ist konfigurierbar (wilderigel) + * html : *.tmpl - alle Berechnungen von 600 -> 06:00 wird jetzt von fmttime in Tools.pm erledigt + * now.tmpl : Bugfix(127) neue Autotimer werden nur erstellt, wenn keine Startzeit angegeben wird ... gefixt (Sledge Hammer) + * tlist.tmpl : Fehler, wenn man einen Timer löschen wollte ... gefixt. + * footer.tmpl : Debuggingbox, die die letzten Logeinträge sowie den Variablenstamm des Templates anzeigt. + * Tools : kleine Benchroutine hinzugefügt + * CHANNELS : in ChannelArray und ChannelGroupsArray kann jetzt als 2. Parameter ein where-klausel mit angegeben werden. + * MUSIC : bei der Playliste wurde noch der HTML-Footer mit gesendet. + * HTML : Fehlermeldungen erscheinen jetzt wieder korrekt (s.a.Bug(127)) + * NEWS::Jabber : Es wird jetzt grundsätzlich zuerst eine Verbindung zum jabberserver aufgebaut und nach dem + Senden der Message die Verbindung wieder unterbrochen. $j->Connected war unzuverlässig. + * NEWS::Mail : Wird der Parameter interval geändert, so wird dieser sofort in dem laufenden Event übernommen. + * NEWS::Mail : Neuer Paramter from_address zum festlegen der reply email adresse. + + + +0.50 (alpha) +-------------------------------------------------------------------------------- +* Fixes : + * RECORDS : nice wird jetzt korrekt angegeben mit 'nice -n 19' Danke steffx + * xxvd : Bei einer exportierten Version gabs eine Fehlermeldung + ('/lab/vdr-1.3.34_new/tools/xxv-0.50' is not a working copy) + * NEWS::TiMER : News Message bei start eines timers hatte nicht funktioniert + * etc/xxvd : Parameter --moduledir nachgerüstet + * Makefile : mit sed das sqldump kompatibel zu 3.xx bearbeitet + * Html : pod2html.tmp files werden jetzt nach /tmp geschrieben + * RECORDS : Bugfix(107) Parameter für Frames wurde mit Nachkommastelle an das Previewcmd übergeben. + * RECORDS : Bugfix(107) Bei VDR mit Recording Length Patch wurde, die Aufnahmedauer falsch berechnet + und damit versagte die Vorschaubilderzeugung bei kurzen Aufnahme (Ingo Göppert) + * WAIT : für Telnet deaktiviert, und so umgestellt das so früh wie möglich der erste Screen angezeigt wird und + zur Performencesteigerung nur noch ein Push per Sekunde gesendet wird, sonst wäre bei + großer Anzahl von Aufnahmen, Musikstücken oder Autotimer der Waiter nur eine zusätzlich Bremse. + * CONFIG : Bugfix(112) Tabelle der Daten nach abvspeichern deaktiviert, da sonst die Passwörter im Klartext + angezeigt wurden. Danke an Joachim Wilke. + * bin/xxvd : Bugfix(110) Richtige Fehlermeldung bei Syntax Error in der Config. + + + +0.45 (develop only, no public release) +-------------------------------------------------------------------------------- +* Neue Feature :our $DUMPSTACK = 0; + * Alle: Prioritäten festgelegt: für Interaktion = high und Jobs = low + * General : Neue Funktion (restart) um xxv vom webinterface aus neu zu starten - + * Grab : Neuer Parameter:vpos um Schrift im Grabimage zu positionieren + * CHANNELS : Gruppen hinzugefügt + * USER : Bug(50) MaxLifetime und Prio für User + * EPG : Bug(46) Previewimages in epg.display anzeigen + * Unter Einstellungen->Epg kann man den Pfad zu den previewimages angeben. + * Falls ein Bild vorhanden ist wird dieses in einem zusätzlichen Feld in + * EPG.image eingeschrieben. + * USER : Bug(69) IP Authentication in User + * HTTPD : Bug(79) Übertragung mit gzip (wieder zurückgenommen, hatte nicht funktioniert) + * Schema : rote Linie um die aktuelle Zeitposition besser zu erfassen + * HTTPD/mlist: Bug(35) ToDo: Coverbilder des MP3 Plugins für Albumvorschau nutzbar, durch konfigurierbares Verzeichnis + * VTX: Suchfunktion mit Highlighting der Fundstelle + * RECORDS/AUTOTIMER : Bug(37) Fortschrittsbalken (Server-Push) für Update + * HTTPD : Unterstützung von gepackten Websites (GZIP) + * xxvd : Bei der Routine "After" kann jetzt über das dritte Argument die Reihenfolge angegeben werden. + * TIMERS: Timer werden jetzt über das svdrp interface eingelesen + * MUSIC: Bug(81) Alben und Interpreten sind verlinkt + * CHANNELS/cedit: Reihenfolge der Kanäle editierbar (aber VDR 1.3.32) + * Schema/Now/Next : wird jetzt nach den ChannelGroups angezeigt + * General : Neuer Befehl more zum Anzeigen der Textfiles - + * LOGREAD : Neuer Befehl logger zum Anzeigen der Logfiles - + * html : neu Template logger.tmpl mit helptip.js und helptip.css + * menu : neuer Tree Loginfo mit den Logs: xxvd.log, xxvd_mplayer.log und syslog + * menu : neuer Tree Documentation mit den Files: $SOURCEDIR/*.txt + * General : komplett neues loginterface, in Zukunft kann der Entwickler zwischen folgenden Levels unterscheiden: + * debug : wird mit errorcode 250 (harmlos) ausgegeben + * lg : wird mit errorcode 202 (harmlos) ausgegeben + * warn : wird mit errorcode 305 (achtung) ausgegeben + * error : wird mit errorcode 501 (problem) ausgegeben + * panic : wird mit errorcode 550 (absturz) ausgegeben + * General : dadurch hat sich das Logfileformat ein wenig geändert: + * z.B.: "29 (201) [03:24:55] Dokumentation wurde in '/root/XXV/doc' generiert" + - (Count)(Errorcode)(Zeit) (Message) + * xxvd : neuer Parameter --verbose = [0 .. 5] - + * verbose = 0: Keine Ausgabe + * verbose = 1: panic und error Ausgabe + * verbose = 2: debug,panic und error Ausgabe + * verbose = 3: warn,debug,panic und error Ausgabe + * verbose = 5: alle Informationen werden ausgegeben (kann sehr viel werden :) + * verbose > 5: alle Informationen werden mit Stacktrace ausgegeben (kann sehr sehr viel werden :) + * MUSIC : mcovers neuer parameter (force) zum trotzdem einlesen aller Covers wenn gewollt + * OUTPUT : Ayax.pm erste Version von Ajax eingebaut + * EPG (Bug93): display, now, program und search ... + * per Ajax werden die Links für aufnahme gekennzeichnet um Konflikte gleich darzustellen. + * im title wird dann die Timernumber erwähnt. + * geht leider noch nicht im IE ;( + * Tutorial : Neues Tutorial zum Nutzen des Ajax Features + * REPORT : Neues NEWS::MAIL Modul und NEWS::RSS Modul + * diese Module befinden sich ab jetzt in dem Ordner $SOURCEDIR/lib/XXV/OUTPUT/NEWS/*.pm + * diese Module benutzen eigene Widgets die ab jetzt unter $SOURCEDIR/share/news/*.tmpl liegen + * für RSS muss XML::RSS nachinstalliert werden + + perl -MCPAN -e "install XML::RSS" + + perl -MCPAN -e "install Digest::HMAC_MD5" + + apt-get install libxml-rss-perl + * Einstellungen können in allen Interfaces unter Einstellungen -> NEWS::* vorgenommen werden. + * den RSS Feed kann man sich mit http://vdr:8080/?cmd=request&data=rss in einem beliebigen RSS-Reader anschauen + * die Mail kann man sich mit http://vdr:8080/?cmd=request&data=mail im Browser anschauen + * General : Testen der aktuellen Dbversion eingebaut - + * zusätzliche Option in bin/xxvd --contrib - + * zusätzliche Option in bin/xxvd --newstmpl + * zusätzliche Option in bin/xxvd --newsmods + * html : Search - how much lines found in title + * REPORT : News message beim laden von Report + * RECORDS : Neuer Befehl rplay um eine aufnahme im vdr anzuspielen + * REPORT : Url wird schon in ->news zusammengestellt + * NEWS::* : Unter Preferences::level kann festgelegt werden welche News man auf diesem Kanal sehen möchte + * NEWS::* : Wenn active == 'n' dann wird das Modul nicht geladen + * NEWS::RSS : zusätzlicher searchlink eingebaut + * NEWS::JABBER : Neues News Modul um News als jabber messages zu senden + * NEWS::VDR : Neues News Modul um News an vdr mittels Svdrp mesg zu senden + * NEWS::* : Neuer Punkt unter MOD->{Prereq} + * hier werden die Module aufgelistet die installiert sein müssen damit das Modul läuft + * Beispiel in NEWS::MAIL: + * Prereq => {'Mail::SendEasy' => 'SMTP Protocol module to connect and send emails', ... }, + * wird nach und nach auch in die anderen Module mit rein kommen + * ist ebenfalls in der doc/docu.tmpl für die pods integriert + * Einstellungen : Bei host, file, dir wird jetzt direkt Über Ajax geprüft ob die + Files vorhanden sind oder der host erreichbar ist. + * die Checkroutine befindet sich in der global.js unter dem Namen checkValue + * die widgets file, dir, host wurden mit dem Checkframework ergänzt + * All : in allen Modulen wurde jetzt der Prereq Eintrag ergänzt, + * Dadurch sieht man sofort beim Starten, ob noch Module fehlen und wie man die letztendlich installiert + * Die Module die nicht dabei sind werden als Standardmodule bei Perl mitgeliefert (File::* z.B.) + * NEWS::Event : Zum startzeitpunkt eines Timers wird eine Message mit Level 25 an die NEWS Module geschickt + * NEWS::Event : Neue Kanäle werden mit Level 50 gemeldet + * NEWS::Event : Meldung wenn die Festplatten weniger als 10% platz frei haben mit Level 75. + * Skins : Sollte ein File GENERICTYP mit einem entsprechenden Eintrag (z.B. 'application/vnd.mozilla.xul+xml') im root + des Skins vorhanden sein. Wird bei allen HTTP-Headern dieser als Type eingesetzt. Ausser beim startfile + (index.tmpl o. index.html) sowie den anderen nichttemplatefiles. + * xxvd : neuer Parameter --nofork fürs debugging, xxvd forkt sich dann nicht mehr wenn dieser Parameter gesetzt wurde + * xxvd : verbose parameter auf default Level 3 gestellt. + * HTTPD : unzip - Uncompress Files in gz format. + * Console : Texthandling für more im Telnetinterface gespeichert. + +* Fixes : + * TIMER : Statt neu erstellen eines fehlerhaften Timers wird dieser jetzt nur noch modifiziert. + * USER : Telnet interface an IP Auth angepasst + * USER : Warnung ausgeben, falls ein User versucht eine IP ohne Range anzugeben. + * EPG/display : Wochentage für Start/Stop der Sendung werden übersetzt + * HTTP/MUSIC/RECORDS/STATUS: Verzeichnis Preview aufgelöst und Modulweise konfigurierbar außerhalb der Skins verlagert (/var/cache/xxv/...) + * Unter Einstellungen-> + * MUSIC => coverimages (/var/cache/xxv/covers) + * RECORDS => previewimages (/var/cache/xxv/preview) + * USER(STATUS) => tempimages (/var/cache/xxv/temp) + * VTX/images : in ein gemeinsames Verzeichnis zusammemgefasst, damit nicht jeder Skin diese mitliefern muss. + * Verzeichnis mit VTX Bildern per Kommandozeilenoption einstellbar + default xxvd --vtxdir=$XXVBINDIR/../share/vtx + * VTX einzelnen falsche Zeichen ausgeblendet + * STATUS : Anzeige des PCI Buses nur wenn /proc/pci vorhanden ist + * STATUS : Dateisystem mit '-' wie /dev/mapper/mylvm-lvol0 wurde nicht angezeigt + * Templates : statt user.name nur user + * AUTOTIMER: Timer-Beschreibung werden nachgeführt(erweitert), + wenn sich der EPG-Text ändert. (nur wenn ~#AT[xx]) vorhanden ist) + * WAPD: Funktionell leicht erweitert + * Datenmenge von Listen (einstellbar per skin.cfg) auf 5 Cards pro Durchgang reduziert + * Grundmenge der widgets angelegt + * EPG now/+next/+program/+search + * Timer tnew/tedit/tdelete + * getestet mit wmlbrowser(Mozillaplugin)/ Klondike WAP Browser/ Opera/ www.wapsilon.com + offene Probleme (Patch willkommen) : + - bei Opera8.0 - falsche Vorauswahl in Selectfeldern (ivalue = Item * 1) + - Caching der Eingabefelder muss noch deaktiviert werden... + bzw. deren WML-Page-Variablen beim Laden des Formular zurückgesetzt werden + - Browserrequest produziert Unknown Request: + * TIMERS: doppeltes einlesen der timerdaten bei list und ttoggle, fehlerhaftes verfahlten (Bug 83) + * Html.pm : Es wird die interne c-Engine von Template genutzt (doppelt so schnell) + * es wird eine entsprechende Warnung im Log ausgegeben wenn die langsame (mitgelieferte) Version + von Template genutzt wird. + * getCheckTimer übernimmt VPS Status + * WAPD Bitmap Dateiendung auf wbm geändert + * STREAM : Entfernen des ffserver stream gedöns + * NEWS.txt : kleinere Änderungen + * html/rlist : Title und subtitle sind in der tabellendarstellung auch verlinkt + * html/rlist : Title und subtitle mit truncate gekürzt + * General : 'log' auf 'lg' umbenannt + * MUSIC : wenn alle covers schon vorhanden waren, spielte das getcovers verrückt + * REPORT : RSS wieder rausgenommen + * REMOTE : Bug 95: Das Darstellen des GRAB Bildes schlägt fehl. + * General : Bug 94: Version wird jetzt mit Revision dargestellt: Version: 0.45(473). + * General: Die Revisionsnummer wird jetzt von subversion geliefert. + * Falls keine Subversion system vorhanden ist wird die letzte + Revision von xxvd angezeigt. + * NEWS::MAIL - vorgegebene replyadresse geändert da vom Server abgelehnt. + * EPG/Schema: Bug(86) - Längere Sendungen mit gleichen Endzeitpunkt wie das Zeitfenster wurden nicht angezeigt + * EPG/AUTOTIMER: Bug(100) - Suchterm mit '+' ergab keine Übereinstimmung + * HTTPD/WAPD: Keine Hardcordieren HTML-Ausgabe von HTML-Fehlermeldung mehr, Ersatz durch native Skinsausgabe + * HTTPD : HTTPD Statusmeldung auch als Titelzeile (404 File not found) + * General : Alle txt files nach doc/*.txt verschoben und eine README mit enstprechenden Hinweis im root gelassen. + * NEWS::RSS : Dates auf standard international time umgestellt. + * Tools : Stacktrace wird ausgegeben wenn $STACK gesetzt ist. + * NEWS::RSS : leere Logmessages. + * General : Starttime wird genauer berechnet. + * TELNET : Bug(100) telnet lies sich nicht mehr aufrufen. + * Tools : Ausgabe des stackTrace verfeinert + * General : Ausgabe des warnings wird ignoriert wenn ein eval die Ursache war + * General : Ausgabe des warnings immer mit stacktrace + * Tools : an debug,error sowie panic kann jetzt ein sprintf construct übergeben werden: + * z.B.: error('User %s has no permissions', $user) + * bin/xxvd : Spagetticode aufgeräumt und alles in subroutinen eingebaut + * doc/doc.tmpl : Ausgabe etwas verbessert und an die NEWS::* Module angepasst + * General : überflüssige PerlModule gelöscht + * NEWS::* : Fehlerhandling bei send + * General : jede Menge Aufräumarbeiten ;) + * schema : etwas aufgeräumt + * html : Einige Eingabefelder wieder auf Normalgrösse gebracht ;) + * NEWS::* : Bugfix(104) und verbesserung der active/noactive Einstellungen ;) + * General : Bugfix(105) Revision wird über svn info bestimmt ohne online zu gehen. + * RECORDS : Handling eingebaut wenn lt. vdr keine Recordfiles verfügbar sind. + * Einstellungen : Die Einträge sollten jetzt alphabetisch sortiert ausgegeben werden. + * Modules : Fehlerhandling stringenter bei allen IO::Socket's + * bin/xxvd : VERSION Tabelle wird erstellt, falls diese nicht vorhanden ist. + + + +0.43: (develop only, no public release) +-------------------------------------------------------------------------------- +* Neue Feature : + * GRAB : Im Vorschaubild können jetzt auch der title u.a. der gerade laufenden Sendung + eingeblendet werden. + * EPG : Neue Routine NowOnChannel um die gerade aktuelle Sendung auf einem Kanal zu erhalten. + * xxvd : (after) Statusmeldung wird im Log ausgegeben, wenn ein after-callback gestartet wird + * CHANNELS : Neues Feld GRP in Channels mit Id von CHANNELGROUPS + * CHANNELS : Speichern der Channelgruppen in neuer Tabelle + * RECORDS: TODO[36] Markierung von neuen Aufnahmen + * CHANNELS : Kommandos zum Bearbeiten von Kanaldaten (cnew,cedit,cdelete) + * REMOTE : neue Funktion cmd und cmdlist zum auslesen und ausführen der commands.conf + * RECORDS/AUTOTIMER : Listen sortierbar + * Autotimer: Erweiterung der Donelist => um bereits aufgenommene Sendungen + * USER: Gruppen Kommando können gezielt verweigert, bzw. dadurch einfach Benutzerbezogen ausgeblendet werden + tlist => Timer betrachten (ta,tl) + alist => Autotimer betrachten (as,al) + rlist => Aufnahme betrachten (rl,rd,rs,pre,stt,sts) + mlist => Musik (ml ...) + tedit => Timer editieren (te,td,tn,tt,tu) + aedit => Autotimer editieren (an,ae,ax,ai,at,ad,au) + redit => Aufnahme editieren (re,rr,ru) + remote => Fernbedienung (r,sw,gr,gd,lst) + * HTML:neues command , gibt true zurück wenn es erlaubt ist, + wird in dem menu template (help.tmpl) angewendet um inactive kommandos zu verstecken + * Vollständige Umstellung des WML/HTML Template nach dem Elemente nach Userlevel ein- und ausgeblendet werden. + (IF userlevel > xx => IF allow('cmd')) damit werden jetzt inaktive Elemente auch ausgeblendet. + * Template Variable userlevel entfernt. + * USER:kompletter rewrite der commands check routinen, es reicht jetzt ein + $user->checkCommand('delt') + * HTML:question - an alle widgets können zusätzliche tags gesendet werden + (param => {tags => ['disbabled','class=inactive', ...]}) + * html: nach logout, komplett refresh des Interfaces + * html: im Footer wird jetzt der eingeloggte User angezeigt + * ALL: RefereUrls werden beachtet (timerlist -> autotimeredit -> timerlist) + * General: Restart des gesamten XXV Systems mit dem cmd restart + * USER: neues cmd (uprefs) mit Usereigenen Settings sowie Passwortänderung + * USER: UserPrefs werden vor AdminPrefs gesetzt + * CHANNELS: neues Wigdet clist zum Editeren von Kanälen + * VTX: Per Preferenzen deaktivbar + +* Fixes : + * xxvd : DB autoreconnect auf on geschaltet + * HTTPD, WML, ... : Anpassungen an das neue Userhandling, siehe letzten Fix in Telnet. + * TELNET : Wenn ein User eingeloggt war, kam kein Loginscreen in der nächsten Session. + Der User-Hash wird jetzt immer in der Console mit abgespeichert und gilt nur für eine Session. + * EPG : (readData) Fehlermeldung entfernt bei NoLine + * MUSIC : (mrefresh) Fehlermeldung bei nicht vorhandenen Verzeichniss + * MUSIC : (mrefresh) Sollten keine files gefunden werden wird mit Fehlermeldung reagiert + * WAPD: now/tlist liefern nicht valides WML 1.1, mit http://www.validome.org/validate behoben (wilderigel) + * EPG/TIMER/RECORDS: Integeroverflow in EventID => Alle ID Felder auf int(16) unsigned erweitert + * sprintf-Ausgabe von IDs per unsigned int (docschneider) + * HTTPD/mlist: Anzeige von Covern mit 'Sonderzeichen' im Titel + * remote: kleines Speedup, nicht mehr automatisch nach jedem Tastendruck, eine Screenshot holen + * html/rlist: Mehrfaches Löschen von Aufnahmen im Template verfügbar gemacht. + * AUTOTIMER : Bug[16] Löschen von AT mit Singlequote (') nicht möglich (Sledge Hammer) + * AUTOTIMER : Bug[72] : Man kann eine Startzeit angeben ohne das XXV meckert das es keine Endzeit gibt + * HTML : Dokumentationsdarstellung wieder hergestellt + * RECORDS Laufende Aufnahme wurden in rlist nicht angezeigt + * RECORDS Bug[25] Behandlung von Aufnahmen ohne Subtitel ( ../_/*.rec) verändert um rekursive Listen anzeige zu verhinden. + * WAPD: Startseite index.tmpl in wapd.tmpl umbenannt, damit die Skinauswahl mit HTTPD nicht durcheinander kommt, + und Fehlbedienungen verhindert werden (PeterD) + * RECORDS Bug[26] Aufnahmen - Übersicht Plattennutzung, verwendet jetzt offizelle Werte des VDR. + * RECORDS Bug[70] XXV erkennt Aufnahmen bei VDR 1.3.26 nicht + * Config: Bug[71] Beispiel etc/xxvd.cfg aktualisiert und von c't an Standard angepasst. + * Music: Import zeigte falsche Anzahl an neuen Dateien an. + * Remote: Initialisierung des Modules schlägt fehl wenn commands.conf nicht existiert oder definiert ist. + * User: Inaktive Userverwaltung wurde nicht bei "checkCommand" berücksichtigt ( aktive != Aktive ) + * User: Bug[68] Betrieb bei inaktiver Userverwaltung unmöglich. + * Timer: Zeilenumbrüche aus Timertitel entfernt, VDR mag dies nicht in SVDRP Protokoll + * Alles: Basis-Berechtigungsgruppen [ guest (Betrachten),user (Editieren),admin (Verwalten) ] an einigen Stellen korrigiert + * RECORDS: in NoVFAT Modus wurden Aufnahmen mit Symbolen von regulären Ausdrücken nicht erkannt ( +,*,[,],{,} ) + * RECORDS: unnötige Warnmeldung falls erste Aufnahmenzuordnungsversuch fehlschlägt entfernt. + * Einsatz HTML:command erstellt Nachrichtenschauer im log als unpriviligiert User. + nur noch aktive Rechteverletzungen des Users werden als Logeinträgen vermerkt. + * SVDRP: mehrere Commandos werden in einem Durchgang an svdrp geschickt + * VTX: Bug[75] Nonregluäre Seiten wurden im Index merkt (wilderigel) + * RECORDS: Ausgabe einer passenden Fehlermeldung falls eine Leseberechtung des Aufnahmeverzeichnisses fehlt, und dadurch die Zuordnung fehlschlägt + * rdisplay: Darstellung der Schnittmarken korrigiert + + + + + +0.42 (stable) +-------------------------------------------------------------------------------- + * Fix: RECORDS: Bug[54] Geschnittene Aufnahmen tauchen in xxv::records nicht auf + * Fix: RECORDS: Bug[46] Previewbild Erzeugung berücksichtigt beim MPlayer nur 001.vdr + * Fix: contrib/create-database.sql legt jetzt auch dem MYSQL-Account für Datenbank xxv an. + * Fix: telnet/uedit: Bug[51] Änderung/Eingabe vom Passwort nicht möglich, + telnet/uedit: Unveränderte Übernahme des alten Passwort wie in HTML nicht möglicht + * Fix: rdelete: Mehrfaches Löschen in reverser Reihenfolge, + Überprüfung ob ID überhaupt in DB vorhanden, + Sicherheitsabfrage für Telnet hinzugefügt + * Fix: ttoggle/tdelete: Funktionell vereinheitlicht, doppelte SQL-Abfrage entfernt. + * Fix: httpd: Standard-Skin wurde in der Konfigurationsauswahl nicht mehr angezeigt. (index.tmpl als Startseite) + * Fix: html-msg: alle Zeilen einer svdrp-Ausgaben wurden in eine gemeinsame Zeile zusammengefasst + +0.41 (1.fixed stable) +-------------------------------------------------------------------------------- + * Feature: SVDRP: mehrere Kommandos können jetzt bei SVDRP command abgesetzt werden + $svdrp->commando('delt 1', 'delt 2', ...); # rufe alle auf einemal auf + + * Feature: SVDRP: mehrere Kommandos können mit queue_cmds gesammelt werden und mit einem Kommando aufgerufen werden: + $svdrp->queue_cmds('delt 1'); # schick ein Cmd in die queue + $svdrp->queue_cmds('delt 2'); # schick das nächste Cmd in die queue + print $svdrp->queue_cmds('COUNT'); # Gibt '2' aus (2 Kommandos in der queue + $erg = $svdrp->queue_cmds('CALL'); # Ruft alle Kommandos in der Queue auf. + $console->msg($erg, $svdrp->err); # Pseudiwidget das bei einem Fehler $console->err aufruft. + + * Feature: SVDRP: Parsen der Ausgabe von SVDRP und farblicher Hinweis für den User wenn ein Fehler auftritt + $console->msg($erg, $svdrp->err); # Pseudiwidget das bei einem Fehler $console->err aufruft. + + * Feature: HTML: bei question können jetzt auch Parameter für das Widget mitgegeben werden + * Fix: RECORDS: ab sofort werden auch die info.vdr berücksichtigt + * Fix: tlist: Nach Wiederholungen suchen hat bei autogetimten timern nicht geklappt + * Feature: RECORDS: Speichert jetzt auch die Description in OldEpg ab + +0.40 (stable candiate) +-------------------------------------------------------------------------------- + * Fix/Feature: rlist: Aufnahmen werden vollständig nach Ordnerstuktur gruppiert, nicht mehr nur die erste Ebene + * Fix/Feature: alist: Autotimer werden nach Suchtext sortiert (vorgeschlagen von Wilderigel). + + + +0.35 (alpha) +-------------------------------------------------------------------------------- + + * Fix: TIMERS/tlist: Mehrere DVB Karten und deren Kollisionserkennung verbessert. + * Fix: RECORDS: Anzeige der Previewbilder auf gewählte Anzahl begrenzt, auch wenn mehr Bilder im Verzeichnis liegen + * Fix: xxv: wenn System-$CONFIGFILE (z.B. /etc/xxvd.cfg) schreibbar, wird dieses verwendet sonst ~/.xxvd.cfg + * Fix: Config: Warnmeldungen falls xxvd.cfg nicht schreibbar + * Fix: Timer: Bug[10] Timer wurden mit nicht aktiv Status angezeigt wenn sie mit vdradmin erzeugt wurden. + +0.33 (develop) +-------------------------------------------------------------------------------- + * Feature: xxv: Usereigenes Configfile in ~/.xxvd.cfg + * Feature: xxv: neues upgrade-xxv skript zum updaten der Datenbank von Tobias Grimm + * Fix: EPG: schema, etliche Darstellungsfehler von Hulk gefixt + * Fix: TIMERS: tlist, konflikte richtig dargestellt (Hulk) + * Feature: STREAM: neues Kommando: playrecord (rid) neuer Parameter: netvideo. + Ist abgeschaut von dem ct'vdradmin, falls man sein videodir per samba + oder nfs eingebunden hat und dieses unter Einstellungen->STREAM->netvideo + eingetragen hat (z.B. '\\vdr\video' o. 'V:' o. '/netz/vdr', kann man sich + hier die Aufnahme mit seinem favoriten player anschauen. + * Feature: STREAM: neues Kommando: livestream (cpos). + Damit kann man sich (streamdev vorausgesetzt) den gewünschten Kanal auf + dem Clientrechner anschauen. + * Feature: EPG: Neue tabellarische Ansicht (schema) + * Feature: RECORDS: Zusammenfassung aller Bearbeitungsschritte zu einem Kommando + * Fix: search: BUG[15] Suche Ergebnis Tag falsch + * Fix: HTTPD: Bug[12] Wenn man sich mit Logout abmeldet, kann man sich in den erscheinenden Userdialog nicht mehr anmelden. (Wilderigel) + * Fix: RECORDS: Vorschaubild vom mplayer skaliert nach aspect ratio des Films (erstes Frames is massgeben) + * Fix: RECORDS: mplayer Reduzierung der Logmeldungen im Protokoll + * Fix: RECORDS: Kommando Aufruf von vdr2jpeg zum erhalt es aspect ratio geändert, Achtung! vdr2jpeg-Update auf 0.0.7 notwendig + * Fix: RECORDS: Aufnahmen mit '?' wurden nicht angezeigt + * Fix: RECORDS: Löschen von summary.vdr/marks.vdr nicht möglich + * Fix: RECORDS: Geänderte summary.vdr wurde in rdisplay nicht angezeigt + * Fix: STATUS: IDE Cache-Größe der Laufwerke in MB (Sledge Hammer) + * Fix: RECORDS: insert useless 'mysql_insertid' entfernt + * Fix: RECORDS: rdescredit fehlende marks.vdr wurde mit falscher Fehlermeldung quittiert. (HFlor) + * Fix: RECORDS: summary.vdr und marks.vdr liessen sich nachträglich anlegen. (HFlor) + * Feature: CHANNELS: filterCA als Auswahlliste konfigurierbar + * Feature: Versionsnummer von xxv in den Oberflächen (neue variable in den templates 'version') + * Fix: GRAB: Version von GD wird geprüft und entsprechende Routinen aufgerufen + * Feature: Versionsnummer im comment der Tabellen untergebracht + * Feature: EPG: Anzeige des demnächsten laufenden Programmes + * Feature: Sprache der Benutzeroberfläche ist "one the fly" umschaltbar. + * Feature: TIMERS: Mehrere DVB Karten werden ünterstützt und bei der Collisionserkennung berücksichtigt. + * Feature: REPORT: Neues Modul um Reports zu erzeugen und diese dann auch per mail zu verschicken. + * Fix: AUTOTIMER: AutotimerId wird im timer mit abgespeichert. + * Fix: TIMER: AutotimerId in table eingebaut. + * Fix: TIMER: timestamp in table eingebaut. + * Fix: ROBOT: Automatischen Interval rausgenommen. + * Fix: ROBOT: Jobs wurden nicht geloescht. + * Fix: html: Header wird jetzt mit embedded style sowie js ausgegeben, dadurch xxv schneller. + * Fix: WAIT: Style sowie javascript werden jetzt korrekt eingebunden. + * Fix: MUSIC: Suchen mit Enter funktioniert nicht. (wilderigel) + * Fix: RECORDS: Bei eingebundenen Video partitionen wird deren Speicherplatz in rlist angezeigt. + * Fix: GRAB: Das er nur dann grabben tut wenn der RemoteScreen angezeigt wird. + * Fix: GRAB: Export des per GD manipulierten Bildes in der gewählten JPEG-Qualität. + * Fix: GRAB: GD2 erstellte Bilder sind palettebasiert. + * Fix: GRAB: Ungenutzte Parameter Intervall entfernt. + +0.32 (develop) +-------------------------------------------------------------------------------- + * Fix: EPG: Parameter für Laufzeiten nach "periods" umbenannt, um Verwechslungen mit timers zu vermeiden + und in EPG/now.tmpl, als Parameter wieder eingefügt. + * Fix: USER: Standard user xxv wurde mit einem Standardskin in Prefs erstellt. (xpix) + * Fix: MUSIC: intervall für getCovers rausgenommen. User muss diesen Vorgang manuell starten. (xpix) + * Feature: TIMER: Timer werden in Ihrer Start sowie Endzeit nachgezogen falls sich diese im EPG verändern (xpix) + * Feature: html: timer kann editiert werden in running Now (xpix) + * Feature: html: Epg EIntrag werden bei runnningNow hervorgehoben falls ein timer dafür läuft (xpix) + * Fix: MUSIC: mrefresh gelöschte Dateien wurden nicht aus der DB ausgetragen (Hulk) + * Fix: TIMER: Veraltete Timern mit VPS wurden nicht gelöscht. (Hulk) + * Fix: TIMER: Neue Timer ließen sich sich nicht inaktiv bzw. VPS anlegen. (Hulk) + * Fix: HTTPD: Meldung über inactive Module etwas erweitert (Dejuh) + * Fix: AUTOTIMER: Wekkdays war auf NOT NULL gesetzt, dadurch gabs Probleme beim alten Import (Hulk) + * Feature: AUTOTIMER: Nur an bestimmten Wochentagen suchen lassen. + +0.31 (develop) +-------------------------------------------------------------------------------- + * Fix: now.tmpl: 2x 19% und 101% (HFlor) + * Fix: Bundle: GD::Graph und GD::Graph3D ergänzt + * Fix: MUSIC: list Anzeige von Titel mit Hochkomma,&,/,: schlägt fehl (wilderigel) + * Fix: TIMER: Timer mit Priorität/Lebenszeit von 0 wurden mit default Werten gespeichert. (wilderigel) + +0.30 (develop) +-------------------------------------------------------------------------------- + * Fix: MUSIC: Suche nach cover an das neue Webdesign von allofmp3.com angepasst + * Feature: MUSIC: Redirect zur mlist nach CoverScan + + + * Fix: HTTP: HTTP-Header hatten doppelten Status 200/ bzw 200+401 + * Fix: HTTP: ohne Login wurden trotz Abbruch Daten ausgeliefert + * Fix: HTTP: abfragen von nicht existierenden Daten werden mit Status 404 quittiert + + * Feature: CHANNELS: clist - Tabelle sortierbar + + * Fix: TIMERS: Unterstützung des Datumsformat (vdr >= 1.3.23) + * Fix: STREAM: Pfad zum Record muss gequoted werden. + + * Feature: add NEWS.txt + + * Feature: alist.tmpl: Menupunkte für im und export der Autotimerdaten. + * Feature: Redirect nach Autotimer löschen anch alist. + * Feature: STREAM: dynamic Read von den Configfiles + * Feature: HTTPD: dynamic Read von den Skinsdir + * Feature: STREAM: neuer Parameter serverlog + + * Feature: de.po um die fehlenden Übersetzungen ergänzt. + * Feature: in allen Templates (html) die gettext routine eingesetzt. + * Feature: Makefile: globbt jetzt alle *.pm und html/*.tmpl sowie html/widgets/*.html durch. Somit ist es + möglich, auch bei den Templates eine Lokalisierung zu erreichen () + * Feature: EPG: runningNow versteht jetzt auch unixtime + * Feature: EPG: runningNow,program können im Skin wie search EPG.description ausgeben, ermöglicht Ausgabe des Skins like vdradmin + * Feature: now.tmpl: Now Zeit kann jetzt auch per input field dargestellt werden. + * Feature: style.css: Hintergundfarbe ändert sich bei focus im Input-, Textarea- sowie Selectfield + * Fix: EPG,TIMERS: UNIX_TIMESTAMP statt englisches Datum im sql Statement für tlist,tsearch,program,search () um das Datum im jeweiligen lokalen Format auszugeben. + * Fix: CHANNELS: Logo Handling wieder rausgenommen ... zu sehr verhaspelt ;) + * Fix: list.tmpl: Wenn nur ein listeintrag ausgewählt wurde gibts probleme + * Fix: GRAB: temp filename wurde immer länger ;) + * Fix: now.tmpl: Percent jetzt als tabellen, jetzt stellt es auch der IE richtig dar. + * Fix: all templates: mit dos2unix bearbeitet. + + * Fix: Bundle::Xxv ergänzt um Proc::Killfam und GD + * Fix: Standardfonts von xxv/html/fonts nach xxv/fonts verschoben, um sie in anderen Skins zu nutzen + - neuer xxvd parameter fontdir. z.B. nutzbar Debian xxvd -fontdir=/usr/share/fonts/truetype/ + - Auswahlliste der gefundenen Fonts genutzt in GRAB / Status + - alle hardcodierten Fonts im template memory/filesys/network/vitals durch param.font ersetzt + * Fix: Kein richtiger Returnwert wenn modul deaktiviert wird. + * Fix: CHANNELS: XXV Kanalnummern falsch importiert, wenn in der Channels.conf Abschnitte mit + neuen Nummernbereichen (z.B. ":@20 Regionalprogramme" ) versehen werden. (Ranga) + + * Feature: Startseite im Skin kann über index.tmpl definiert werden + - template erhält Parameter 'start' mit gewählter Startseite + * Feature: program: Bei Aufruf ohne Parameter, wird die erste gültige Sender der Kanalliste gewählt + - template erhält Parameter 'current' mit aktueller Senderwahl + * Fix: uedit: Überprüfung auf undefinierten Wert des zweiten Feldes beim parsen von password.tmpl + * Feature: RECORDS Serien werden in Gruppen zusammengefasst dargestellt (poetter) + + * Update: Autotimer: Reinclude ExtendedEPG (Siehe 0.16/0.16b Anpassungen an tvmovie in Autotimer (Friedhelm)) + * Update: WAPD, Initialimplementierung der Startseite (index.WML) und (tlist) TODO: Vervollständigung des WML-Template + * Feature: Running Now, Program Guide, Timers, ... Channel Logos (eventuell ein/ausschaltbar in Preferences) + (Die Pfade zu den Logos werden erstmal in die Channeltable mit eingetragen) + * Feature: niedrigere Aufnahmeprioritäten für User einstellbar + (Kann mit den Prefs Schalter vorbelegt werden TIMERS::Priority=30) + * Feature: Dienste an sowie ausschaltbar machen (in fast allen Modulen gilt active = (y|n) + * Feature: GRAB: 3D Effekt bei ttf fonts + * Fix: GRAB: neues bild /tmp/name_text.jpg wenn text angeschaltet ist + * Fix: tlist.tmpl: Timer wurden nicht verlinkt auf EPG Events + + * Feature: GRAB: neue Parameter imgfontsize, imgfont + * Feature: Config (file|dir): Nur wenn required definiert ist wird auf vorhandensein von file|dir getestet + * Fix: Console (file|dir): nachgerüstet + + * Feature: Anzeige des aktuellen Kanals (Senderlogo sieht man ja nicht immer) + - wird ins Remote bild mit eingezeichnet ;) + - kann durch Grab:imgtext eingestellt werden + - als variablen stehen z.Zt. nur channel zur Verfügung + * Feature: Added html/fonts directory to svn + * Fix: RECORDS: Löschen der alten Previewimages hatte nicht funktioniert + * Fix: list.tmpl: Kanalasuwahl war incorrect + * Fix: table.tmpl: Kosmetische Änderung + * Fix: tlist.tmpl: Link zum EPG Eintrag war incoreect + + * Feature: remote.tmpl: Der Interval des refreshes lässt sich jetzt einstellen. + * Feature: Programm Guide, extra search feld für sendung suche auf dem channel. + * Feature: Beim Autotimer-Update wird die EPG-Fundstelle nur die ChannelID angezeigt, + ich vermisse eine zusätzliche Anzeige des Sendernamen. + * Feature: Autotimer - Einstellung - exclude: Exclude-Kanalliste für um bestimme Kanäle bei Autotimern auzuschließen. + * Feature: Beim Autotimer-Update wird die EPG-Fundstelle nur die ChannelID angezeigt, ich vermisse eine + zusätzliche Anzeige des Sendernamen + * Feature: Timer: die Priorität des Timer in Konfliktkonflikten kennzeichnen + * Fix: Channel Auswahl bei Autotimer war fehlerhaft + * Feature: Der Parameter der entscheidet wie lange eine Aufnahme lebt, + sollte angezeigt und nachträglich veränderbar sein. + Realisierbar ist dies durch umbenennen des Aufnahmeunterverzeichnisses... + von /video/vdr/%Projekt:_Peacemaker/2005-01-22.22:35.50.14.rec + nach /video/vdr/%Projekt:_Peacemaker/2005-01-22.22:35.50.99.rec + + * Feature: Die Standardroutine deleteDir ist jetzt in Tools integriert und steht somit in allen Modulen zur Verfügung. + * Feature: html Skin, fast überall automatische Weiterleitung eingebaut. + * Feature: Neue Routine main::toCleanUp! Hier können die Module bei beenden des xxv oder Logout bestimmte Callbacks ausführen + um z.B. temporäre Dateien wegzuräumen. + + * Feature: Neue Templates: vital.tmpl, network.tmpl, memory.tmpl, filesys.tmpl + * Feature: STATUS: Liniengraphen und pies bei memory, network und filesys. Hiermit kann man den + Zustand der Maschine in letzter Zeit (Parameter: history) prüfen. Speicherverbrauch, Last usw. + * Feature: STATUS: Bestimmte Daten werden alle (Parameter: interval) Sekunden für einen + bestimmten Zeitraum gespeichert und können später ausgewertet werden. + * Feature: rlist.tmpl: Free/Used als pie3dGraphimage + * Feature: HTML: Es können jetzt temporäre Bilder erstellt werden (html/temp//image.png) + aus den Templates heraus. Eignet sich für PiCharts u.a. + Example: + + + + * Feature: neuer Parameter (previewcount).Wieviel Previewbilder sollen erstellt werden. + * Feature: xxv2jpeg integriert. + + * Fix: TIMERS: tlist-> tsearch Ausgabe aneinander angeglichen + + * Feature: Die Marks einer Aufnahme können bearbeitet werden. (rmarksedit) + * Fix: CHANNNELS: RID wurde nicht Korrekt geparst. (rmarksedit) + + * Feature: Die Description der Aufnahme sollte bearbeitet werden können, und auch als summary.vdr + gespeichert werden. (rdescredit) + + * Feature: Timer: list-> Anzeige der Wochentage + * Fix: Autotimer: list-> Anzeige beim Löschen eines Autotimers zeigte den kanal statt den Namen an + + * Feature: Autotimer/Timer: aedit/tedit-> Channel wählt nur anhand des Name die Selection aus, nicht anhand der POS + * Fix: TIMERS: new Timer, channel wurde im Pulldownmenu nicht richtig angezeigt(CatweazelG) + * Fix: RECORDS: transalte um ß erweitert(CatweazelG) + + * Fix: Bei Aufnahmen, wo die Recordzeit kleiner als 5min ist, werden keine Marks angezeigt. + * Feature: eine schöne übersichtliche tabellarische Datenausgabe bei Records (Einstellung == No MPlayer) + + * Feature: Autotimer können bestimmen ob Timer mit VPS und eigenem Vor- und Nachlaufangelegt werden + * Fix: Update der Table RECORDS funktionierte nicht + + * Feature: Inaktive Timer nach Ablauf loeschen! (Nur Autotimer!) + * Fix: Absturz und immenser Speicherverbrauch nach Coversuche + + * Feature: TIMERS: Timer verbinden mit einer EpgId -> getNextEpgId + * Feature: TIMERS: tlist an getNextEpgId angepasst + * Feature: Bei den timern hätte ich gerne die EPG beschreibung zum Timer. + * Feature: EPG: program,display,search > events mit Timer werden gekennzeichnet + * Feature: Anzeige der aktuell laufenden Timer, ähnlich dem der Anzeige im tlist + + * Feature: HTTPD: neuer Parameter StartPage um die Startseite zu konfigurieren. + * Feature: Anzeigen der Schnittmarken zu den einzelnen Records + * Feature: Records: Anzeige "xx% Discspace Used" + + * Feature: Einstellungen an User binden (z.B. Skins) + * Feature: Wie erfolgt im HTTPD ein Logout? Neues cmd logout in HTTP Interface.(xpix) + * Fix: USER: Password wurde wieder verschluesselt nach edit(xpix) + + * Feature: New Robot Modul, see in Documentation.(xpix) + * Feature: Robot Modul take new Covers from Internet.(xpix) + * Feature: Music: new Parameter Hostname in Config.(wilderigel) + * Feature: Music: new Parameter Interval to refresh the MusicDb.(xpix) + * Feature: Music: new command mcovers to get album covers.(xpix) + * Feature: Channels: update wird ausgeführt wenn der User es will.(xpix) + * Feature: HTML: Processbar.(xpix) + * Fix: radio.tmpl: Vergleich hatte nicht gestimmt + * Fix: USER: nach einem Edit war der User immer auf guestlevel + * Fix: bin/xxvd: --kill killt auch die Kinderprozesse + * Fix: Unterstützung von Timer mit VPS-Status (>= VDR 1.3.5) + + + + + +0.20 (stable) +-------------------------------------------------------------------------------- + * Stable Version 0.20 + +0.17l (Countdown zur Stable Version 0.20 ;) + * Fix: kleine kosmetische änderungen von Hulk (locale und backtolist links) + +0.17k (Countdown zur Stable Version 0.20 ;) + * Feature: CONFIG: neues command configget (cg) + * Fix: AUTOTIMER: Suchen über Mitternachtsgrenze gefixt (endlich!!) (wilderigel) + * Fix: html: Anpassungen von wilderigel für ApacheProxy (gandalf) + * Fix: RECORDS: follow symbolic links angepasst (gandalf) + * Fix: INTERFACE: Jede Menge anpassungen um third party Tools laufen lassen zu können. (xpix) + +0.17i + * Fix: logs: Beispiel für logrotate in etc/logrotate.d/xxvd (gandalf) + * Fix: RECORDS: Previews werden jetzt in einem fork einzeln abgearbeitet (wilderigel u.a. ;) + * Fix: MANPAGE: --version aktualisiert (Tobias Grimm) + * Fix: HTTPD: findskins scheint nicht zu funktionieren, find konnte keine symbolischen Links auflösen(xpix) + +0.17h + * Fix: RECORDS: nice -19 bei mplayer (wilderigel) + * Fix: RECORDS: OLDEPG eventid > 1000000000 (Hulk) + * Fix: TIMERS: Back to timer list, after edit (xpix) + * Fix: EPG: runningNow zeigte noch die Vergangenheit an wenn die gewählte Zeit kleiner als now war(freeze) + * Fix: HTTPD: findskins scheint nicht zu funktionieren(Habib) + * Fix: CHANNELS: gibt es eine Überschneidung mit dem AUTOPID-Patch (Hulk) + * Fix: CHANNELS: Zeilenumbruch in RID entfernt (Xpix) + * Fix: TELNET: nach erfolglosem login ist der telnet server abgestürtzt (wilderigel) + + +0.17g + * Fix: Makefile: Versionsnummer wird beim maken eingesetzt (Hulk) + * Fix: RECORDS: Kleiner Fix in übersetzung.(wilderigel) + * Fix: RECORDS: Es wurden manchmal weniger als 3 Previewbilder erstellt.(xpix) + * Fix: AUTOTIMER: Fix in autotimer für finden von timern über mitternachtgrenze.(xpix) + * Fix: General: locale angepasst (Ronny Kornexl) + * Fix: General: runscript angepasst(Hulk) + * Fix: Channels: wenn eine SID doppelt ist, wird diese vom VDR um eine weiter Nummer (lt. vdr-5-manpage die RID) erweitert + * Fix: General: New commandline parameter --version (Xpix) + +0.17f + * Fix: RECORDS: Ausführlichere Fehlermeldung im Log wenn ein Record nicht gefunden wird.(xpix) + * Fix: RECORDS: rrsearch - Dort sollte natürlich auch die Zeitausgabe in "Sekunden" erfolgen. (Hulk) + * Fix: CONFIG: Config aufgeräumt.(xpix) + * Fix: RECORDS: Neue Option 'No Mplayer' zum deaktivieren der Previewvorschau. (Tobias) + * Fix: General: Rename von bin/xxvd.pl nach bin/xxvd. (Tobias) + * Fix: in STATUS.pm Zeile 238 fehlt noch ein scalar() um den zweiten gethostbyname-Aufruf (Tobias) + +0.17e + * Fix: RECORDS: Kleiner Fix in translate, endlich mit Hilfe von foobar, gandalf und wilderigel sowie Hulk den Fehler in tyranslate gefunden. + * Fix: RECORDS: Datum der Records war 1970. (Xpix) + +0.17d + * Fix: RECORDS: rrename wurde auf das neue vfat Handling umgestellt(Xpix) + * Fix: RECORDS: Es wird versucht mit beiden Translate versionen (vfat = default und das Gegenteil) die Records zu lesen(Xpix) + * Fix: RECORDS: Anzeige der Dauer etwas schicker (Hulk) + * Fix: RECORDS: Testen ob file überhaupt existiert und dann size ermitteln (xpix) + +0.17c + * Fix: CHANNELS: VDR man 5 states that the third field is TID when (NID != 0 && TID != 0), otherwise frequency (A. Hannula) + * Fix: RECORDS: Was lange wärt ... Überarbeitung der videoInfo Routine zum ermitteln der Länge eines Record (Hulk) + +0.17b + * Fix: RECORDS: 24 Problem von wilderigel und gandalf (Hulk) + * Fix: RECORDS: Statt vdrsync wird du eingesetzt und anhand der Grösse die Laufzeit des Videos berechnet (Hulk) + * Fix: EPG: DBD::mysql::st execute failed: Column 'channel_id' cannot be null .... + +0.17a + * Fix: REMOTE: Taste 0 jetzt aktiv (Translate 'Null' => 0) (gandalf) + * Fix: RECORDS: Aufnahmelänge wird jetzt mit vdrsync gelesen. Neuer PrefEintrag 'vdrsync'! (Hulk) + (Falls keine Längen angezeigt werden, bitte eine ausgabe von vdrsync.pl $recorddir an mich schicken!) + + +0.17 + * Fix: STATUS: Falsche Kapazität bei der Hardware anzeige (ide) + * Fix: EPG:Regelmässiges epurge einbauen. + * Fix: RECORDS:Versuch ohne gepatchten vdr die Laenge eines records anhand der mtime des index.vdr + files herauszubekommen. + * Fix: RECORDS:Preview images werden als extra process erstellt. + * Fix: CONFIG:Doppelte ausgabe bei config speichern vermeiden. (Hulk) + * Fix: AUTOTIMER:Ich habe ein Problem mit den Autotimern: Im vdradmin hatte ich Timer mit Startzeit 22:00 und + Endzeit 03:00 (halt irgendwann nachts). Wenn ich die so eingebe, dann werden sie vom xxv + nicht gefunden. + +0.16e + * Fix: Bessere Warnings wenn wichtige Dateien fehlen + * Fix: Pfade koennen jetzt auch ueber die Kommandozeile übergeben werden. + + +0.16d + * Fix: Endlich! Keine Warnings mehr bei Readline! + * Fix: Für DebianPaket, alle Pfade sind jetzt an einer Stelle. Die ersten Zeilen in xxvd.pl. + * Fix: Bessere Localisierung, dank an Hulk! + +0.16c + * Feature: Anpassen der Logging Ausgabe (abschalten von Talking on session / Opened new http session ) + * Feature: skin Verzeichnisse automatisch als Liste in config anzeigen + * Fix: Es gibt zwei neue Widget (dir.tmpl/file.tmpl), diese pruefen die Angaben für Verzeichniss- sowie + Pfadangaben, ob diese Datein oder Pfade überhaupt existieren (diese müssten in die bestehenden Skins + kopiert werden. + * Fix: Skins werden jetzt beim Start gesucht und dann per Pulldownmenu angeboten. Dabei wird ein Skin anhand des + favicon.ico files erkannt. Ab jetzt wird nur noch der DirName angegeben also '../stone' -> 'stone'. + (bitte denkt dran Eure alte xxvd.cfg dementsprechend abzuaendern: + [HTTPD] -> HtmlRoot=html) + * Fix: Leichtere Einstellung des mplayer alt/neu als Pulldownmenu. + (bitte denkt dran Eure alte xxvd.cfg dementsprechend abzuaendern: + [RECORDS] -> "mplayercommand=MPlayer1.0pre5" oder "mplayercommand=MPlayer1.0pre6") + * Fix: channels.conf kommen mit extra spalte (noscan), wird ignoriert (Danke frix!) + * Fix: Autotimer ignorierte unter bestimmten Umstaenden die done Liste. + * Fix: geloeschte mp3's werden nicht in der DB geloescht. + * Fix: GPL File fehlt. + +0.16b + * Fix: vergisst aber leider, das PID-File zu löschen, weswegen xxv sich beim nächsten Versuch weigert, zu starten. + Vorher muss man das PID-File löschen. (sn123py) + * Fix: Patch von Friedhelm wieder rausgenommen da die Autotimerfunktion so dann nicht mehr funktioniert hatte. + +0.16a + * Fix: Wenn xxv auf eine leere DB startet, dann versuchte Timers auf Channels zuzugreifen(Morone) + +0.16 (start der Betaphase bis 0.19) + * Feature: Anpassungen an tvmovie in Autotimer (Friedhelm) + * Fix: DOCU: docu.tmpl ist jetzt im unterverzeichniss doc + * Fix: AUTOTIMER: Telnet/aedit, bei falscher Kanal wahl : Dieser Kanal 'test' existiert nicht! [ARRAY(0x8e59334)] + * Fix: AUTOTIMER: Telnet/aedit, undef von Kanal/Zeit/Mindestlänge nicht möglich (0 => defaultwert) + (Hulk, das hast du schon gefixt oder?) + * Fix: HTML: question 'list.tmpl' : Immer ein leere Option anfang, warum ? + * Unklar: html/help.tmpl + Can't locate object method "timers" via package "XXV::MODULES::EPG" at lib/Template/Stash.pm line 650. + (Kann ignoriert werden ... ) + * Fix: TELNET: Fehlermeldung beim Start im Log => use READLINE=> Term/ReadLine/Gnu.pm, Term/ReadLine/Perl.pm + (Kann ignoriert werden ... ) + * Fix: AUTOTIMER: Telnet/aedit, undef von Kanal/Zeit/Mindestlänge nicht möglich (0 => defaultwert) + * Fix: Records: 'select min(eventid)-1 from OLDEPG', Schlägt fehl wenn OLDEPG leer ist, liefert eventid = 0 für alle Aufnahmen + * Fix: Telnet: Login sollte sofort erscheinen und nicht erst nach der Eingabe eines Befehls + * Fix: EPG: Dummy Eintrag mit "No Title" (schien schon gefixt zu sein) + * Fix: Es scheint ein Leak zu geben. Nach ca. 7 Tagen waechst xxv auf 200MB --> EPG.pm => epurge + +0.14g + * Feature: EPG: program/list Ausgabe Wochentags mit Tag und Montag + * Feature: search,msearch,tsearch,tsearch verwenden den selben Suchfunktionen und damit Syntax wie Autotimer "foo,-bar" + * Fix EPG: Kurzfilm,-Kurzschluss => AUTOTIMER Exlude-Suche funktioniert nicht wie erwartet mit aktiven EPG.description wenn Feld == NULL => default deshalb ("") + * Fix: Skin: global.js Zeile 34 / Fehler: document.forms[0].elements[i] has no properties (Quadratkugel) + * Fix CHANNELS.pm filterCA per default deaktiviert (Thorsten Gehrig/steffx) + * Fix: xxvd.cfg Defaultwert der Sprache, ohne Fehlermeldung LANGUAGE=English + * Fix: xxvd.cfg Telnet-Port steht auf 8003 und ist lt. Dok. 8001 (Thorsten Gehrig) + * Fix CHANNELS.pm filterCA erkannte multible Filter nicht (Thorsten Gehrig) + * Fix CHANNELS.pm Access Field hatte falschen Datentyp int(11), es gibt CA Felder die Komma getrennt mehrere Werte haben. + * Fix CHANNELS.pm Aktualiserung der nach Änderung der channels.conf wurde nicht erkannt. + * Fix RECORDS: Mag kein ' in Titel => DBD::mysql::db selectrow_hashref failed: You have an error in your SQL syntax. ... near 's Cut)%'' at line 435. + * Fix RECORDS: Wenn Verzeichnis unerkannt, logeintrag => DBD::mysql::st execute failed: Column 'Path' cannot be null at lib/XXV/MODULES/RECORDS.pm line 270 (Thorsten Gehrig) + +0.14f + * Feature: CHANNELS: Konfigurierbarer Filter für das Namensfeld, (default "short,long;provider" ) + vdr 1.2.6 (Format "" or "long"). it show also all parts + vdr 1.3.10 (Format "short,long") + vdr 1.3.12 (Format "short,long;provider") + vdr 1.3.?? (Format "provider;short,long") + vdr 1.3.18 (Format "short,long;provider") +0.14e + * Feature: CHANNELS: Konfigurierbarer Filter für das CommonAccess Feld, Default: 0,1,2,3,4,32001 => 0=FTA, 1-4 DVB-Card,32001 Analogplugin (Komma getrennt) [ersetzt das confirm y/n für Verschlüsste Kanäle] + * Feature: RECORDS: rsearch: Ermöglicht das Suchen nach Aufnahme (-titel,-subtitel,-beschreibung) + * Feature: TIMERS: ttoggle: jetzt wie bei tdelete auch für mehrere Timer gleichzeitig möglich + * Fix: CHANNELS: Support für Analogplugin (ChannelID hat Format C-0-Freq-NID) (steffx) + * Fix: CHANNELS: cmd=cu Ausgabe der korrekten Anzahl bei "Schreibe 99 Kanäle in Datenbank." + * Fix: AUTOTIMER: aedit: Falsche Wert bei Lifetime, Fehler aus 0.014x + * Fix: AUTOTIMER: aedit: Start/Stop werden nur noch angezeigt wenn sie auch definiert wurden + * Fix: AUTOTIMER: aupdate: Start/Stop werden jetzt separat als Bedingung gewertet. + * Fix: AUTOTIMER: anew scannt nur noch den neuen AutotimerTimer, nicht mehr alle + * Fix: Timer: tnew: Neue Timer ohne EPG werden mit Status/Day/Start/Stop werden mit Defaultwerten initialisiert + * Fix: TIMER: HTML/tnew/eventid Use of uninitialized value in substitution (s///) at lib/XXV/MODULES/TIMERS.pm line 281. + * Fix: EPG/TIMER: search/tsearch, suche nach Texten mit Singlequote ' + * Fix: Console: Bearbeiten von Strings z.B. Telnet/aedit Start/Stopzeit im Format 'HH:MM' [CODE(0x8e63370)] + * Fix: Console: Bearbeiten von Listen z.B. Telnet/tedit Can't use string ("KABEL1") as an ARRAY ref while "strict refs" in use at lib/XXV/OUTPUT/Console.pm line 194, line 10. + * Fix: Übersetzung, lib/XXV/OUTPUT/*.pm sind jetzt auch lokalisiert + * Fix: "Unknown Request:" Ausgabe statt auf Konsole jetzt im Log + +0.14d + * Feature: Config: Alle gefunden Übersetzungen werden jetzt als Auswahlliste in Config:General angezeigt. + * Feature: EPG: display zeigt auch Eintrage aus OLDEPG an + * Develop: script prepare/convert-translation durch locale/Makefile ersetzt + * Develop: locale/Makefile: Für weitere Sprachen erweitert, jetzt fehlt nur die Lokaliserung der "*.po" Dateien + * Fix: TIMERS: Neue Timer über EPG werden im Skin auch als default als aktiv markiert timer->{Status} angepasst (Schönheitsfehler) + * Fix: TIMERS: Unterstützung von Aufnahmetiteln mit Doppelpunkten (Norad) + * Fix: RECORDS: SearchEpgId berücksichtigte subtitle nicht, und lieferte damit falsche eventid + * Fix: RECORDS: Falsche Jahreszahl, MTIME != Aufnahmezeit (z.B. Aufnahme 31.12.2004 => Schnitt XX.XX.2005 => 31.12.2005) => parse 2005-01-16.04:35.88.99.rec + * Fix: RECORDS: rdisplay zeigt jetzt die richtige Startzeit an (vorher Stunde:Monat) + * Fix: TELNET: Bei schliessen der Telnetsession - print() on closed filehandle GEN10 at /usr/lib/perl/5.8/IO/Handle.pm line 147. + * Fix: VTX: Setzen der Anfangsseite im Template auf die Erste verhandene Seite im VTX-Index + * Fix: VTX: Argument " " isn't numeric in int at lib/XXV/MODULES/VTX.pm line 970. + * Fix: Use of uninitialized value in substitution (s///) at lib/XXV/OUTPUT/Html.pm line 201. + * Fix: Undefined subroutine &Template::Plugin::File::getpwuid at called at Template/Plugin/File.pm line 104. + +0.14c + * Skin: Html/wml: Neue Variable im Template "basedir" zum Testen im Skin auf Existenz des Previewbildes, um im Fehler Alternative zu ermöglichen + * Skin: Html/wml: Neue Variable im Template "userlevel" um Anmeldeabhängig das Template zu anzupassen (guest = Editieren ausblenden) + * Fix: TELNET/HTTPD/WAPD: cmd=help : es werden nur die Kommandos aufgelistet werden, für die der jeweilige anmeldete User berechtigt ist. + * Fix: TELNET/HTTPD/WAPD: widget/formstart.tmpl Reihenfolge der Überschrift korrigiert von

nach

+ * Fix: RECORDS: Aufnahmetabelle wurde beim Start immer verworfen + * Fix: RECORDS: reinclude RecordStart on rlist + * Fix: DOC: Dokumentationsgeneration schreibt nach xxv/bin => fix: setzen des Ausgabeverzeichnisses pod2html --cachedir=/tmp + * Fix: User: allowCommand sperrt Kommandoausführung wenn Anwenderauthentifizierung deaktiviert ist + * Fix: Telnet: Anwenderauthentifizierung war nicht deaktiviert, obwohl dies konfiguriert war + * Fix: Telnet: Berechtigung der Kommandos bye => admin, reload => user + * Fix: Telnet: Kommando bye funktioniert nicht + * Fix: Übersetzung weiter vervollständig + +0.14b + * Feature: Autotimer: Mindestlaufzeit(mike) + * Feature: RECORDS: Standardskin mit überlick als Thumbnaillist (xpix) + * Feature: USER: User Modul deaktivieren koennen (poetter) + * Feature: RECORDS: Extra Parameter mplayercommand für Optionstring wg. Parameteränderung im mplayer ab pre6 (poetter) + * Fix: USER: man konnte sich anmelden wie man wollte, Zugang wurde gewaehrt (dido) + * Fix: REMOTE: sollte als guest gesperrt werden. (Mindesten die RC-Buttons) (andreas) + * Fix: ist es Absicht das im Useraccount keine Autotimer editiert werden können? (andreas) + * Fix: tupdate ist direkt nur als Admin möglich (andreas) + * Fix: cmd=remote&data=Volume+ , funktioniert nicht (andreas) + * Fix: Übersetzung vervollständig (andreas) + +0.13 + * Feature: USER: Edit, delete and create User. The default user is 'xxv' with password 'xxv' (xpix) + * Feature: USER: Usermodul zur Authentifizierung. (xpix) + * Feature: MUSIC: Datenbank wird nur bei mrefresh geupdatet oder wenn die DB leer ist! (leifg) + * Feature: TIMER & AUTOTIMER: Default Lifetime und Priority ist jetzt konfigurierbar! (Andreas) + * Feature: MUSIC: Search funktion (msearch) eingebaut! (Andreas) + * Fix: MUSIC: DB Connect stirbt beim abspielen eines Titels (xpix & andreas) + * Fix: CHANNELS: parsen an die neue Channels.conf V1.3.x angepasst(xpix) + * Fix: HTTP: echte Headerfunktion von cgi lib(xpix) + * Fix: TIMERS: damit Timerkonflikte bei unterschiedlichen Sources ignoriert werden (Andreas) + * Fix: RECORDS: Rename Funktion wahr fehlerhaft! (Andreas) + * Fix: RECORDS: es kann auch keine reccmds.conf auf dem System existieren! (BlackKing) + * Fix: MUSIC: URI::Escape hatte im lib Ordner gefehlt! (BlackKing) + * Fix: TELNET: Term::Readline::Perl hatte im lib Ordner gefehlt! (xpix) + + +0.12 + * Feature: WAPD Server vorbereitet(!) fuer unimatrix, OHNE FUNKTION! + * Feature: Timer werden nur noch als ueberlappend gekennzeichnet, wenn sie nicht auf dem gleichen + Transponder liegen + * Feature: NEU: Music Plugin: Icecast Server, Managment, Playlists usw. + * Feature: MENU: Dhtml Hir.Menu um schneller auf die Funtionen zugreifen zu koennen + * Feature: NEU: STATUS Module (space, record ...). Hier wird alles angezeigt was relevant + fuer die linux maschine ist. Die Daten koennen spaeter besser dargestellt werden, + erstaml "nur" Tabellen. + * Feature: Records: Aufnahmen koennen jetzt mit entsprechenden Commands aus der reccmds.conf + im interface aufgerufen werden. z.B. (Mark for DVD-Writer) (xpix) + * Feature: Autotimer suchen mit Ausschluss Search: Enterprise, -Voyager (xpix) + * Feature: Alle Module langsam Language faehig machen (andreas & xpix) + * Feature: Switch mit Channelnamen + * Feature: In now und program werden jetzt auch die Subtitle angezeigt wenn vorhanden(Andreas) + * Feature: Bei den Autotimern die Anordnung von title und subtitle den User ueberlassen. (emanuel) + * Feature: Records: Extra logfile fuer mplayer + * Fix: Subtitle und title werden in den Records wie vom user angegeben + als oldepg abgespeichert (andreas) + * Fix: Records: Scheinbar wurden die Previewfiles mehrfach und doppelt erstellt, was eine lange + Wartezeit nach rupdate ergab. (andreas) + * Fix: Autotimer sucht jetzt wenn start und stop angegeben wurde nur noch nach + Sendungsbegin zwischen start und stop. (mike) + * Fix: Rename funktioniert nicht bei den Records die mit der Serienfuntion (Andreas) + * Fix: Fehlerhafte Eintraege nach mehreren Restarts, EPG Daten werden (erstmal) + bei restart geloescht.(xpix) + +0.11 + * Feature: Html/Preferences wird jetzt ein Link zur Doku des Modules angezeigt. + * Feature: das help commando unter Telnet kann jetzt auch mit dem Namen eines Modules + aufgerufen werden, dann werden nur die commands angezeigt die das Modul beinhaltet. + Also z.B. 'help vtx'. + * Feature: Dokumentation wird jetzt automatisch generiert(xpix). + * Feature: Neues Kommando 'doc', dieses erstellt doku files aller Module + in dem Directory doc/*.pod. Ausserdem kann man sich mit 'doc modulname' die + entsprechende Dokumentation ansehen :) + * Feature: Configscreen fuer General. + * Feature: Neues Widget: password. + * Feature: Preferences: Einen Skinwechsel "on the fly" moeglich machen + * Feature: Autotimer: mit atoggle(at) kann jetzt ein AT deaktiviert o. aktiviert werden. (xpix) + * Feature: Autotimer list: nicht aktive AT werden jetzt gekennzeichnet. (xpix) + * Feature: VTX ist jetzt perl only (Andreas) + * Feature: StartStop Skript einbauen + * Feature: Multilingualer Unterstützung in den Modulen (vorerst nur VTX).(Dank an Andreas) + * Feature: Timer die Konflikte erzeugen, kenntlich machen.(xpix) + * Feature: Timer Liste Channels verlinkt auf program. (xpix) + * Feature: Autotimer Liste angepasst. (xpix) + * Feature: Autotimer mit Start und Stop Zeiten. (Emanuel) + * Feature: Timer die deaktiviert sind kenntlich machen.(xpix) + * Feature: Records werden jetzt je nach VFAT=0|1 beim kompilieren sicher gefunden.(andreas) + * Feature: Records werden jetzt auch bei symlink verarbeitet.(andreas) + * Fix: Mplayer vorschau angepasst fuer mehr Previews.(andreas) + * Fix: Loeschen der Timer -> redirect in Status Frame und Liste anzeigen.(xpix) + +0.10 + * Feature: Timer die gerade aufgenommen werden, kenntlich machen.(xpix) + * Feature: RECORDS: Umbennenen von Records (andreas) + * Feature: Es existiert jetzt ein globales Javascriptfile $htmlRoot/javascript/global.js.(xpix) + * Feature: CHANNELS: Neue Option mit/ohne encrypted channels (andreas) + * Feature: TIMERS: Delete Dialog verbessert (xpix) + * Feature: Html: neues Template redirect aufrufen mit $console->redirect('url', 'timeout in sec') (xpix) + * Feature: Html: neue routine browser fuer metadaten (Referer usw...) (xpix) + * Feature: Ausgabe Module: neue routine typ, gibt den typ zurueck (HTML, TELNET, ...) (xpix) + * Fix: RECORDS:253 Regex fuer records geht immer noch net richtig(andreas). + * Fix: Andere Loeschmethode bei Previewimages (hulk, wastl) + +0.09: + * Feature: PreviewImages der Aufnahme (ersten 5min) in RECORDS (braucht mplayer) + * Feature: Es wäre sehr praktisch wenn die Ausgabe der Timer, nach zeitlichen Reihenfolge und + nicht nach Datenbankposition erfolgt.(andreas) + (puhh eine harte Nuss, aber geloest ;) + * Feature: Timer die neu legt werden (auch über Autotimer) sollten eine + definierbaren Vor- und Nachlauf bekommen.(andreas) + * Feature: Ebenfalls sehr sinnvoll würde ich es finden wenn die Ausgabe des Timerstart und Endzeiten im + besser lesbaren HH:MM Format erfolgt.(andreas) + * Feature: fuer die menuepunkte 'running now' und 'program guide' + waere ein button/link 'update epg now' oder so zu empfehlen.(wastl) + (Da der EPG Scan je nach rechnerleistung eine Weile braucht muss aber hier + mit einigen Minuten gerechnet werden, bevor man die neuen Daten sieht!) + * Fix: Loeschen der alten EPG daten nach einem tag (configurierbar) + wenn sie nicht in der record liste sind. + * Fix: Nun endlich, das favicon.ico ist da ;) Wer da mal ein schoeneres bauen moechte? + Alle Virtuellen Pinselschwinger sind herzlich willkommen ;) + * Fix: für "Records" (rupdate) muss wohl ein Patch im VDR aktiv sein, der bei "LSTR" + zusätzlich die Abspiellänge liefert..., mit einen normalen ungepatchten VDR werden keine Aufnahmen erkannt. + Das Format hier : 250-5 07.08 02:55 Titel~Subtitle + (bitte testen, ich hab hier leider nur einen gepatchten vdr) + + +0.08: + * Feature: RECORDS Module (delete, rename and command to record) + - nur teilweise fertig! + * Feature: Reconfiguration beim HUP Signal + * Feature: CONFIG Module (change online cfg) + * Feature: display.tmpl add a record link + * Feature: EPG: now: mit Zeitangaben + - in now koennen jetzt Datenangaben gemacht werden wie '20:15' oder 'tomorrow 15:00' + - Syntax: http://search.cpan.org/~sbeck/DateManip-5.42a/Manip.pod + * Fix: EPG, laut andreas gehen EPG Infos verloren da die epgID nicht unique von Sender zu Sender ist + - epg id ist jetzt SID.EPGID also zb. sid = 28007 und epgid = 57011 ergibt eine epgid: 2800757011 + * Fix: EPG: Daten werden sofort nach dem Start repariert + * Fix: EPG: Scheinbar werden Daten direkt in epg.data geaendert (ohne tail) + - alle x Stunden einen Fullscan machen + - neuer Config eintrag restart in stunden fuer restart + +0.07: + * Fix: Channels: clist: Suchfeld von id auf Name geaendert, somit + kann man jetzt nur bestimmte Sender sich auflisten lassen: + clist Erste + * Fix: VTX: Andreas hat noch wichtige Bugfixes eingebaut! + Dadurch wurde die Konfiguration unter dem Bereich VTX erweitert. + Eingesetzter Cachemodus des VDR-osdteletext-Plugins + "legacy" + > für ältere Versionen bis osdteletext-0.3.2 + (für das traditionelle "one-file-per-page" System.) + "packed" + > für neuere Versionen ab osdteletext-0.4.0 + (default, für das "one-file-for-a-few-pages" System.) + + * Fix: EPG: der befehl 'program' kann jetzt entweder mit dem Name + oder der Positionsnummer aufgerufen werden. Danke an Markus! + * Feature: Remote: Livebild refresht wenn der User ein Funktion aktiviert + * Feature: Remote: Livebild refresht jetzt alle 5 Sekunden + * Feature: HTML: Etliche Anpassungen der einzelnen Templates + * Feature: Autotimer werden nach dem Speichervorganfort gesucht + * Feature: Outputmodule: neues Widget Checkbox + * Feature: Outputmodule: neues Widget multiple Liste + * Feature: Autotimer selektiv fuer bestimmte Kanaele (Andreas) + * Feature: Remote: neues command switch. + * Feature: Screenshot refreshen wenn Remotetaste gedrueckt. + * Fix: Echte HTTP Header + * Fix: Autotimerliste werden die channels mit namen angezeigt + +0.06: + * Fix: Numerische Channelauswahl in program (danke an AB) + * Fix: Standard Telnetport ist jetzt 8005 + +0.06: + * Feature: Link zu add timer in timer und autotimer web interface + * Feature: Refresh der Daten in channels und timer wenn entsprechende Dateien geaendert worden sind. + * Fix: Keine Fehlermeldung wenn falsche URLs aufgerufen wurden. + * Fix: Interface wieder hergestellt, hatte sich verhalten wie TelnetServer. + +0.05: + * Feature: PID Handling usw. + * Feature: Neues Plugin REMOTE + * Fix: Logging ist jetzt unbuffered + * Fix: VTX: Handling von subpages verbessert (danke Andreas) + +0.04: + * Feature: Neue HTML Templates fuer Webinterface + * Feature: Messages und warnings gehen jetzt in ein Logfile (xxvd.cfg: General/LOGFILE) + * Feature: PID wird jetzt abgespeichert (xxvd.cfg: General/PIDFILE) + * Feature: xxvd forkt sich und gibt die PID aus + * Feature: Sinnvollere Anzeigen bei vielen Funktionen (display, now etc.pp) + * Feature: Neues Videotext Plugin (VTX) + Einen grossen Dank an Andreas Brachold der dieses Plugin entwickelt hat! + * Fix: Bei neuem Timer mit EPG Daten als defaults kam xxv voellig durcheinander + * Fix: Die Position der Channels fing erst bei 2 an zu zaehlen + * Fix: Tempfiles (grab) werden jetzt wirklich geloescht + * Fix: Endlosschleife wenn die Ports mit nmap gescannt wurden + (danke an nibbana der den Fehler endeckt hat) + +0.03: + * Feature: Neue HTML Templates fuer Webinterface + * Feature: Bevor ein neuer EPG Eintrag gespeichert wird, werden alte mit gleichem Channel und Starttime geloescht + * Feature: Neues Plugin GRAB, liest Livebild per svdrp Interface vom VDR und zeigt es an. (nur HTTPD) + * Fix: Timers - es konnte kein MDMDFSS@2004-01-01 eingegegen werden. + * Fix: Timers - unnoetiger Zeilenumbruch bei Summary + * Fix: Timers - yes/no Antwort hatte falsches Default(0/1) + +0.02: + * Fix: SQL Error wenn kein title definiert ist + * Fix: Wenn Autotimer oder Timer editiert, dann wurde ein neuer angelegt + * Fix: Fehler im Messagehandling unter Console + +0.01: + * First Version diff --git a/doc/COPYING.txt b/doc/COPYING.txt new file mode 100644 index 0000000..223ede7 --- /dev/null +++ b/doc/COPYING.txt @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/doc/LIESMICH.txt b/doc/LIESMICH.txt new file mode 100644 index 0000000..f889a9c --- /dev/null +++ b/doc/LIESMICH.txt @@ -0,0 +1,65 @@ +Hallo Freunde, + +nun habe ich meine Androhung war gemacht und ein erstes Framework +für XXV (Xtreme eXtension for Vdr) wahr gemacht. Natürlich brauche ich einige +Tester da dieses Projekt ziemlich umfangreich ist. Schön wäre es auch wenn +diejenigen ein wenig Perl können um vielleicht mir bei den Plugins zu helfen. + +Meldet Euch einfach per Mail bei mir wenn Ihr interessiert seid ! + +Aber vorerst ... einige Erklärungen was eigentlich XXV ist ;) + +Wie ja einige von Euch wissen, habe ich früher ja viel am vdradmin gearbeitet. +Durch diese Arbeit kam am Ende der vdradmin BigPatch raus ... +letztendlich war es aber nur eine Krücke um den vorhandenen vdradmin zu erweitern. + +Bei dieser Arbeit an dem Patch schwebte mir immer eine einfachere Lösung vor +die wesentlich strukturierter und einfacher zu erweitern ist. +Es soll ein zentraler Dienst existieren bei dem verschiedene Ports offen sind +und diese verschiedene Services bedienen können. Einen zusätzlichen port +über ein Plugin einzurichten, sollte genauso einfach sein, wie auch einen +bestimmten Service bereit zu stellen. Das schreiben eines Plugins geht sehr +schnell da der Input (Vdr, DB usw) sowie der Output (Telnet, HTTP, ... ) +generisch realisiert wurde. +Es soll also z.B. möglich sein, mit einer TelnetConsole, HttpBrowser, +WapTelefon, etc. pp. einen Autotimer einzutragen. Dieser sollte wesentlich +schneller die EPG-Daten durchsuchen können (MySQL-Datenbank) und über ein +Interface dem vdr den neuen Timer mitteilt. Dabei wird natürlich auch dem +singleModus des SVdrP Rechnung getragen und nur ein Befehl abgesendet und +sofort wieder der Port geschlossen, damit andere Programme wieder auf den +svdrp zugreifen können. + +Lange Rede kurzer Sinn, hier ein kleiner Überblick der derzeitigen Features: + +- komplett in Perl realsiert +- sehr generisches Frontend +- Plugin system +- Datenbank Unterstützung +- Epg-Daten werden regelmässig geparst und eingetragen +- sehr einfaches pluginkonzept für zukünftige Erweiterungen +- mehrere Services aus einem Dienst (Telnet, HTTP, ...) +- Dump-Interface für externe Programme + +Realisiert wurde das alles dem Event Modul und natürlich eine MySQL Datenbank, +die alle Daten (timers, epg, channels) aufnimmt und sich damit auch wunderbar +die Sachen reorganisieren lassen. + +Eine Anleitung zum Installieren und ausführlichere Beschreibung findet ihr unter: + +http://www.vdr-wiki.de/wiki/index.php/Xxv + +Legal stuff +----------- + + (c) Copyright 2004-2006 Frank Herrmann / Berlin. + All rights reserved. + + Written by Frank Herrmann and + Andreas Brachold . + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + The complete text of the license is found in the file COPYING. diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..7b65192 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,71 @@ +# +# Makefile to generate help pages +# + +man = xxvd.1 +html = xxvd.html +pdf = xxvd.pdf +txt = xxvd.txt + + +%.1: %.sgml + @docbook2x-man --to-stdout $< > $@ + +#%.1: %.sgml +# @docbook-to-man $< > $@ + +%.texi: %.sgml + @docbook2x-texi --to-stdout $< > $@ + +%.html: %.texi + @texi2html $< + +%.pdf: %.texi + @texi2pdf $< -o $@ + +#%.txt: %.1 +# @groff -a -man -Tascii $< > $@ + +# +# generate html files +# +html: $(html) + + +# +# generate pdf files +# +pdf: $(pdf) + + +# +# generate man files +# +man: $(man) + +# +# generate plain ascii files +# +#text: $(txt) + +# +# generate all files +# +all: help + +# +# clean generated files +# +clean: + @rm -f $(txt) $(man) $(pdf) $(html) + +# +# End user targets +# +help: + @echo "----------- documentation make targets --------------" + @echo "man: generate manpages (requires: docbook2x-man)" + @echo "pdf: generate pdf (requires: docbook2x-texi, texi2pdf)" + @echo "html: generate html (requires: docbook2x-texi, texi2html)" +# @echo "text: generate text (requires: docbook2x-man, groff)" + diff --git a/doc/NEWS.txt b/doc/NEWS.txt new file mode 100644 index 0000000..048f74b --- /dev/null +++ b/doc/NEWS.txt @@ -0,0 +1,871 @@ +27.06.2006 06:00 + +[ANNOUNCE] XXV Stable version 0.80 + +Nun denn, endlich ist es soweit. Leider hatte ich mein VDR System mit der c't +5.0 Installation zerschossen und musste erstmal nach einer besseren Alternative +suchen. VDR4YOU war letztendlich eine sehr gute Wahl, falls jemand den Autoren +kennt ... eine kurze Mail wäre nett ;) + +Es gibt einen neuen Skin der alle Funktionen beinhaltet und auch eine Übersicht +darstellt die an den Spaltenübersichten der Tv-Zeitschriften angehlehnt ist. +Dieser wird in Zukunft auch der Standardskin werden, falls ich es noch einmal +hinbekomme das er in allen Browsern gut dargestellt wird. + +http://www.xpix.de/downloads/xxv/xxv-xstyle-0.4.tgz + +Wie immer könnt Ihr diese Version unter folgender URL runterladen: + +http://www.xpix.de/downloads/xxv/?M=D + +Natürlich werden wir weiterhin die brandneuen Versionen als subversion +repository Euch zur Verfügung stellen. Mit einem installiertem subversion ist es +ziemlich leicht an diese Versionen ranzukommen: + +# Checkout: +svn co http://sonne.bandt.net/repos/XXV + +# Update +cd $SOURCEDIR +svn up + +# Changelog +svn log + +Wir werden auch wieder unsere allseits beliebte Wunschthread bauen und hoffen +das Ihr Euch da rege dran beteiligt, dieser wird in den nächsten Tagen auf vdr +-portal.de gestartet. + +XXV 0.80 lief bei mir jetzt seit 4 Wochen sehr stabil. Hier noch einmal eine +Liste mit den erwähnenswerten Neuerungen: + +* AUTOTIMER : + Suche erweitert um Sonderzeichen '&', hiermit kann man nach txt UND txt + suchen. Da es kein explizites UND in dem Suchmechanismus gab, kann + man jetzt dies mit einem '&' Zeichen kennzeichnen. Z.b. Planet + Wissen, &Computer würde nach 'Planet Wissen' UND 'Computer' + suchen. + +* SHARE: Globale Bewertungsdatenbank + Wenn ein Timer programmiert wird, so werden dessen Eckdaten (EPGid sowie + Stopzeit) an eine globale Datenbank per SOAP weitergeleitet. Diese DB + kann von jedem XXV User abgefragt werden, somit kann man sich die TopTen + der am meisten programmierten Timer anzeigen lassen und nach shauen ob + man nicht vielleicht eine wichtige Sendung verpassen würde. Natürlich + unterscheiden sich die Events je nachdem ob man Kabel, Terrestrisch oder + Satellit benutzt, je nachdem zu welcher Gruppe man gehört bekommt man + auch nur diese Daten angezeigt. Also ein Satellit benutzer kann nicht + die TopTen der Kabelnutzer sehen. + + Natürlich kann man diese Funktion jederzeit ausschalten. + + Der Server läuft (noch) im Betastatus, es kann also sein das die Daten + mal nicht angezeigt werden. Sollte nicht so oft vorkommen, aber wir + ändern ab und zu da noch was. + +* CHANNELS: Channel liste und Edit Funktion. + Man kann sich jetzt in XXV die Channels anzeigen lassen und + entsprechende Einträge editieren. + +* EPG : Advanced Search mode! + Hier kann man auch nach dem Typ der Sendung suchen (DolbyDigital, 16:9). + Leider funktioniert das nur wenn man erweiterte EPG Infos benutzt, z.B. + Tvinfo usw. + +* EPG,AUTOTIMER: VPSPatch von Malte. + VPS-Zeiten werden übernommen falls VPS genuzt wird (DANKE Malte Schroeder!!) + +* EPG: Ausgabe mit CHANNELSGROUPS - FEATUREREQUEST[145] + +* EVENTS: Neues Modul um eine Eventdatenbank zu erstellen FEATUREREQUEST[126] + Events werden in den einzelnen Modulen eingetragen. Hiermit kann der + Modulprogrmmierer festlegen wann ein Event per Jabber, RSS, Mail an den + Nutzer geschickt werden soll. + +* INTERFACE : Ist jetzt ein SOAP Server. + Das Interface für ThirdParty Programme wurde auf SOAP umgestellt. + +* Installationsscript "install.sh" hinzugefügt + Alpha, mit diesem Skript kann man schnell (falls kein Debian zur + Hand) das XXV auf einem Linuxsystem installieren. + +* MUSIC : + Coverdaten werden jetzt per Amazon Webdienst geholt. Natürlich werden hier + meist nur die Mainstream-Sachen gefunden ;) + + XXV versucht die GiantDisc DB zu kontaktieren falls diese unter + Einstellungen->Music->Muggle eingetragen wurde. Falls das nicht der Fall + ist, wird eine eigene Musikdatenbank erstellt. + +* NEWS::RSS : + zusätzlicher Parameter (...?cmd=request&data=rss&__version=2) für RSS 2.0 + +* RECORDS: + Anzeige der Gesamt(abspiel)zeit + Radioaufnahmen werden bei videoPreview übersprungen (Danke Torsten/WarEagle) + Reduzierung der Festplattenaktivitäten beim Aktualisierung im Hintergrund. + Serverpush auch nach rdelete und redit FEATUREREQUEST[153] + +* STATUS : + Featurerequest[152] Die gemounteten Filesysteme werden jetzt mit angezeigt. + Featurerequest[152] Option damit statt der Tortengrafiken eine normale + Texttabelle angezeigt wird. + +* TIMERS: + An 1.3.44 angepasst, im AUX-Feld wird nur noch das Autotimer ID gespeichert, + Event wenn neue Timer auftauchen die keine Autotimer sind + Neuer Event 'toogleTimer' jetzt auch mit 'on|off' auswertung -> und gefixt + +------------------------------------------------------------------------------ + + +10.05.2006 06:00 + +[ANNOUNCE] XXV Beta version 0.71 + +Dies ist die offizielle Betaversion von XXV in Vorbereitung der Stable (0.8x) +die dann hoffentlich zeitgleich mit der offiziellen Stable vom VDR (1.40) +erscheinen wird. + +Wir haben sehr viele Bugfixes und Anpassungen eingebaut und ausführlich getestet. + +Es gibt einen neuen Skin der alle Funktionen beinhaltet und auch eine Übersicht +darstellt die an den Spaltenübersichten der Tv-Zeitschriften angehlehnt ist. +Dieser wird in Zukunft auch der Standardskin werden, falls ich es noch einmal +hinbekomme das er in allen Browsern gut dargestellt wird. + +http://www.xpix.de/downloads/xxv/xxv-xstyle-0.2.tgz + +Wie immer könnt Ihr diese Version unter folgender URL runterladen: + +http://www.xpix.de/downloads/xxv/?M=D + +Natürlich werden wir weiterhin die brandneuen Versionen als subversion +repository Euch zur Verfügung stellen. Mit einem installiertem subversion ist es +ziemlich leicht an diese Versionen ranzukommen: + +# Checkout: +svn co http://sonne.bandt.net/repos/XXV + +# Update +cd $SOURCEDIR +svn up + +# Changelog +svn log + +Wir werden auch wieder unsere allseits beliebte Wunschthread bauen und hoffen +das Ihr Euch da rege dran beteiligt, dieser wird am Ende der Betaphase (ca. 2 +Wochen) erscheinen. + + +Hier die Neuerungen: + + * AUTOTIMER : + Suche erweitert um Sonderzeichen '&', hiermit kann man nach txt UND txt + suchen. Da es kein explizites UND in dem Suchmechanismus gab, kann + man jetzt dies mit einem '&' Zeichen kennzeichnen. Z.b. Planet + Wissen, &Computer würde nach 'Planet Wissen' UND 'Computer' + suchen. + + * SHARE: Globale Bewertungsdatenbank + Wenn ein Timer programmiert wird, so werden dessen Eckdaten (EPGid sowie + Stopzeit) an eine globale Datenbank per SOAP weitergeleitet. Diese DB + kann von jedem XXV User abgefragt werden, somit kann man sich die TopTen + der am meisten programmierten Timer anzeigen lassen und nach shauen ob + man nicht vielleicht eine wichtige Sendung verpassen würde. Natürlich + unterscheiden sich die Events je nachdem ob man Kabel, Terrestrisch oder + Satellit benutzt, je nachdem zu welcher Gruppe man gehört bekommt man + auch nur diese Daten angezeigt. Also ein Satellit benutzer kann nicht + die TopTen der Kabelnutzer sehen. + + Natürlich kann man diese Funktion jederzeit ausschalten. + + Der Server läuft (noch) im Betastatus, es kann also sein das die Daten + mal nicht angezeigt werden. Sollte nicht so oft vorkommen, aber wir + ändern ab und zu da noch was. + + * CHANNELS: Channel liste und Edit Funktion. + Man kann sich jetzt in XXV die Channels anzeigen lassen und + entsprechende Einträge editieren. + + * EPG : Advanced Search mode! + Hier kann man auch nach dem Typ der Sendung suchen (DolbyDigital, 16:9). + Leider funktioniert das nur wenn man erweiterte EPG Infos benutzt, z.B. + Tvinfo usw. + + * EPG,AUTOTIMER: VPSPatch von Malte. + VPS-Zeiten werden übernommen falls VPS genuzt wird (DANKE Malte Schroeder!!) + + * EPG: Ausgabe mit CHANNELSGROUPS - FEATUREREQUEST[145] + + * EVENTS: Neues Modul um eine Eventdatenbank zu erstellen FEATUREREQUEST[126] + Events werden in den einzelnen Modulen eingetragen. Hiermit kann der + Modulprogrmmierer festlegen wann ein Event per Jabber, RSS, Mail an den + Nutzer geschickt werden soll. + + * INTERFACE : Ist jetzt ein SOAP Server. + Das Interface für ThirdParty Programme wurde auf SOAP umgestellt. + + * Installationsscript "install.sh" hinzugefügt + Alpha, mit diesem Skript kann man schnell (falls kein Debian zur + Hand) das XXV auf einem Linuxsystem installieren. + + * MUSIC : + Coverdaten werden jetzt per Amazon Webdienst geholt. Natürlich werden hier meist + nur die Mainstream-Sachen gefunden ;) + + XXV versucht die GiantDisc DB zu kontaktieren falls diese unter + Einstellungen->Music->Muggle eingetragen wurde. Falls das nicht der Fall + ist, wird eine eigene Musikdatenbank erstellt. + + * NEWS::RSS : + zusätzlicher Parameter (...?cmd=request&data=rss&__version=2) für RSS 2.0 + + * RECORDS: + Anzeige der Gesamt(abspiel)zeit + Radioaufnahmen werden bei videoPreview übersprungen (Danke Torsten/WarEagle) + Reduzierung der Festplattenaktivitäten beim Aktualisierung im Hintergrund. + Serverpush auch nach rdelete und redit FEATUREREQUEST[153] + + * STATUS : + Featurerequest[152] Die gemounteten Filesysteme werden jetzt mit angezeigt. + Featurerequest[152] Option damit statt der Tortengrafiken eine normale Texttabelle angezeigt wird. + + * TIMERS: + An 1.3.44 angepasst, im AUX-Feld wird nur noch das Autotimer ID gespeichert, + Event wenn neue Timer auftauchen die keine Autotimer sind + Neuer Event 'toogleTimer' jetzt auch mit 'on|off' auswertung -> und gefixt + + + +------------------------------------------------------------------------------ + +31.12.2005 06:00 + +[ANNOUNCE] XXV Stable version 0.60 + +Gerade noch rechtzeitig zum Ende des Jahres können wir endlich die neue XXV +Stable Version freigeben. Es gab noch einige Fixes und ein paar kosmetische +Änderungen im Code. Ansonsten läuft XXV sehr stabil, hier auf meinem System im +24/7 Betrieb über einen Monat ohne Probleme. + +Wie immer könnt Ihr diese Version unter folgender URL runterladen: + +http://www.xpix.de/downloads/xxv/?M=D + +[ANNOUNCE] XXV Skin xstyle + +Sozusagen als nachträgliches Weihnachtsgeschenk habe ich mich endlich an einen +neuen Skin gesetzt, der das Ziel hat nur durch CSS Anweisungen XXV in einem +neuen Design erscheinen zu lassen. Zukünftige SkinDesigner brauchen dann nur +noch die *.css sowie die Bilder austauschen. Natürlich arbeite ich noch ein +wenig an dem Skin, aber eine erste Version ist schon mal fertig. + +http://www.xpix.de/downloads/xxv/xxv-xstyle-0.1.tgz + +Zur Zeit sieht es in dem xstyle dir noch ein wenig wie Kraut und Rüben aus, also +nicht schimpfen! ;) + +Das Archiv einfach laden, entpacken und unter Einstellungen -> HTTPD -> HtmlRoot +auf 'xstyle' einstellen. Evtl. danach einmal F5 im Browser aktivieren und das +wars. + +Ich wünsche Euch viel Spass damit und hoffe das wir im nächsten Jahr genauso +erfolgreich wie in den letzten unseren VDR tunen. + +xpix + +------------------------------------------------------------------------------ + +07.10.2005 22:35 + +[ANNOUNCE] XXV Betaversion 0.50 + +lange hatte es gedauert. Nachdem wir den schönen Sommer genossen haben, wurde es +auch langsam Zeit eine neue Version von XXV als Beta zu veröffentlichen. Die +Versionsnummer ist ab jetzt die 0.50, diese bereitet die stable Version 0.60 +vor, die dann auch hoffentlich zeitgleich mit der 1.4 vom vdr zusammentrifft. + +Wie immer könnt Ihr diese Version unter folgender URL runterladen: + +http://www.xpix.de/downloads/xxv/?M=D + +Natürlich werden wir weiterhin die brandneuen Versionen als subversion +repository Euch zur Verfügung stellen. Mit einem installiertem subversion ist es +ziemlich leicht an diese Versionen ranzukommen: + +# Checkout: +svn co http://sonne.bandt.net/repos/XXV + +# Update +cd $SOURCEDIR +svn up + +# Changelog +svn log + +Wir werden aber wieder unsere allseits beliebte Wunschthread bauen und hoffen +das Ihr Euch da rege dran beteiligt, dieser wird am Ende der Betaphase (ca. 2 Wochen) +erscheinen. + +Es gibt auch einige Änderungen in dem Bughandling, da sich die Threads in vdr +-portal.de immer Grössen erreichen die uns als Entwickler dann schon manchmal +peinlich sind, haben wir ein Bugzilla System eingerichtet. + +http://sonne.bandt.net/bugzilla/ + +IHR SEID ALLE AUFGERUFEN EUCH IN DIESEM SYSTEM REGISTRIEREN ZU LASSEN. + +Die Vorteile liegen auf der Hand, kein Bug wird jemals verloren gehen! Ihr könnt +selber entscheiden wann ein Bug wirklich als gefixt gilt (und uns damit auch +ziemlich ärgern ;). + +ALSO WER SICH SICH REGISTRIEREN LASSEN MÖCHTE, DER SCHREIBT MIR +EINFACH EINE EMAIL AN XPIX(AT)XPIX(DOT)DE UND ER BEKOMMT EINEN ZUGANG. + +Ausserdem werden wir Eure Wünsche ebenfalls als ToDo's in diesem System +eintragen, so das ihr da auch ein Auge drauf haben könnt. + +Hier nochmal einen kurzen Auszug was xxv eigentlich überhaupt ist: + +*xxv ist ein zentraler Dienst zur Administrierung des VDR und dessen Umgebung, +bei dem verschiedene Ports offen sind und diese verschiedene Services bedienen +können.* + +*Einen zusätzlichen Port über ein Plugin einzurichten sollte genauso einfach +sein, wie auch einen bestimmten Service bereitzustellen. Das Schreiben eines +Plugins geht sehr schnell, da der Input (Vdr, DB usw) sowie der Output (Telnet, +HTTP, ... ) generisch realisiert wurde. Es soll also z.B. möglich sein, mit +einer TelnetConsole, HttpBrowser, WapTelefon, etc. einen Autotimer einzutragen. +Dieser sollte wesentlich schneller die EPG-Daten durchsuchen können (MySQL +-Datenbank) und über ein Interface dem VDR den neuen Timer mitteilen. Dabei wird +natürlich auch dem singleModus des SVdrP Rechnung getragen und nur ein Befehl +abgesendet. Danach wird der Port sofort wieder geschlossen, damit andere +Programme wieder auf den svdrp zugreifen können.* + +WIR MOECHTEN EUCH ALLE BITTEN AN DEM BETATEST TEILZUNEHMEN UND UNS DIE BUGS +UM DIE OHREN ZU HAUEN. NUR SO KANN XXV RICHTIG GUT WERDEN! + +Hier noch ein paar sehr wichtige Links: + +* Was gibts für neue Features? +Hier werden alle Features ausführlich beschrieben und wurden mit Screenshots +untermalt ;) +http://xpix.dieserver.de/content/vdr/xxv/b_284_artikel.shtml + +* Wie installiere ich xxv? +Diese Seite ist z.Zt. die offizielle Manualpage, alle Fragen zur Installation +und wie man xxv zum laufen bekommt sind hier Schritt für Schritt beschrieben. +Wenn ihr also xxv das erste Mal installiert dann solltet ihr hier auf jeden Fall +anfangen: +http://www.vdr-wiki.de/wiki/index.php/Xxv + +* Wo bekomm ich die (absolut) aktuelle Version per subversion her? +http://www.vdr-wiki.de/wiki/index.php/Xxv#Subversion_checkout + +* Wo bekomm ich die (fast) aktuelle Version per Download her? +http://www.xpix.de/downloads/xxv + +So jetzt wünschen wir Euch viel Spass mit der BetaVersion von xxv + +xpix und hulk + + +------------------------------------------------------------------------------ + +20.05.2005 21:10 + +Hallo Freunde, + +Nun ist es endlich geschafft! Xxv ist soweit um in die nächste Betatestphase +zu gehen. Wir bereiten jetzt die Version 0.40 vor ... das heisst das wir ab sofort +keine Features mehr annehmen. Zur Zeit ist die aktuelle Versionsnummer 0.35. + +http://www.xpix.de/downloads/xxv/?M=D + +Wir werden aber wieder unsere allseits beliebte Wunschthread bauen und hoffen +das Ihr Euch da rege dran beteiligt, dieser wird am Ende der Betaphase (ca. 2 Wochen) +erscheinen. + +Es gibt auch einige Änderungen in dem Bughandling, da sich die Threads in vdr +-portal.de immer Grössen erreichen die uns als Entwickler dann schon manchmal +peinlich sind, haben wir ein Bugzilla System eingerichtet. + +IHR SEID ALLE AUFGERUFEN EUCH IN DIESEM SYSTEM REGISTRIEREN ZU LASSEN. + +Die Vorteile liegen auf der Hand, kein Bug wird jemals verloren gehen! Ihr könnt +selber entscheiden wann ein Bug wirklich als gefixt gilt (und uns damit auch +ziemlich ärgern ;). + +ALSO WER SICH SICH REGISTRIEREN LASSEN MÖCHTE, DER SCHREIBT MIR +EINFACH EINE EMAIL AN XPIX(AT)XPIX(DOT)DE UND ER BEKOMMT EINEN ZUGANG, +SOWIE DIE URL VON UNSEREM BUGZILLA SYSTEM. + +Ausserdem werden wir Eure Wünsche ebenfalls als ToDo's in diesem System +eintragen, so das ihr da auch ein Auge drauf haben könnt. + +Hier nochmal einen kurzen Auszug was xxv eigentlich überhaupt ist: + +*xxv ist ein zentraler Dienst zur Administrierung des VDR und dessen Umgebung, +bei dem verschiedene Ports offen sind und diese verschiedene Services bedienen +können.* + +*Einen zusätzlichen Port über ein Plugin einzurichten sollte genauso einfach +sein, wie auch einen bestimmten Service bereitzustellen. Das Schreiben eines +Plugins geht sehr schnell, da der Input (Vdr, DB usw) sowie der Output (Telnet, +HTTP, ... ) generisch realisiert wurde. Es soll also z.B. möglich sein, mit +einer TelnetConsole, HttpBrowser, WapTelefon, etc. einen Autotimer einzutragen. +Dieser sollte wesentlich schneller die EPG-Daten durchsuchen können (MySQL +-Datenbank) und über ein Interface dem VDR den neuen Timer mitteilen. Dabei wird +natürlich auch dem singleModus des SVdrP Rechnung getragen und nur ein Befehl +abgesendet. Danach wird der Port sofort wieder geschlossen, damit andere +Programme wieder auf den svdrp zugreifen können.* + + +WIR MOECHTEN EUCH ALLE BITTEN AN DEM BETATEST TEILZUNEHMEN UND UNS DIE BUGS +UM DIE OHREN ZU HAUEN. NUR SO KANN XXV RICHTIG GUT WERDEN! + +Hier noch ein paar sehr wichtige Links: + +* Was gibts für neue Features? +Hier werden alle Features ausführlich beschrieben und wurden mit Screenshots +untermalt ;) +http://xpix.dieserver.de/content/vdr/xxv/b_280_artikel.shtml + +* Wie installiere ich xxv? +Diese Seite ist z.Zt. die offizielle Manualpage, alle Fragen zur Installation +und wie man xxv zum laufen bekommt sind hier Schritt für Schritt beschrieben. +Wenn ihr also xxv das erste Mal installiert dann solltet ihr hier auf jeden Fall +anfangen: +http://www.vdr-wiki.de/wiki/index.php/Xxv + +* Wo bekomm ich die (absolut) aktuelle Version per subversion her? +http://www.vdr-wiki.de/wiki/index.php/Xxv#Subversion_checkout + +* Wo bekomm ich die (fast) aktuelle Version per Download her? +http://www.xpix.de/downloads/xxv + +* Wo wurde die Alphaversion diskutiert +http://www.vdr-portal.de/board/thread.php?threadid=32684 + +Dieser Thread hier ist hauptsächlich für Bugfixes gedacht und sollte auch so +verstanden werden. + +So jetzt wünschen wir Euch viel Spass mit der BetaVersion von xxv + +xpix und hulk + +================================================================================= +01.05.2005 20:15 +Hallo Freunde, + +nun ist es mal wieder soweit!!! Wir haben die nächste Dev Version - 0.30 endlich fertig. +Einige neue Funktionen sind dazu gekommen, einige Bugs haben wir (hoffentlich) +endgültig getilgt. Viele Eurer Vorschläge haben wir versucht zu verwirklichen +und andere mussten wir leider entweder canceln oder in die nächste Version schieben. +Entsprechende Informationen könnt Ihr der CHANGELOG.txt entnehmen. + + +================================================================================ +Die übliche Warnung: DIES IST EINE ALPHAVERSION, BENUTZUNG AUF EIGENE GEFAHR! +================================================================================ + +Das diese Version etwas länger hat auf sich warten lassen hat verschiedene Gründe. + + +NEW FEATURES +================================================================================ + +Neben den hunderten kleinen und grossen Bugfixes, gibt es natürlich auch neue Funktionen: + + +RECORDS: + +* Eine übersichtliche Tabellendarstellung, wenn die Einstellung Previewcommand + auf 'Keines' eingestellt ist. Logischerweise versucht xxv in dem Fall + auch nicht Previewimages darzustellen. + + +STREAM (neu): + +* Endlich!! Mein Traum war es schon immer, das ich eine Aufnahme mir direkt im + Browser anschauen kann! Dafür habe ich das neue Modul STREAM geschrieben. + Dieses ist aber vorerst nur eine Studie!! XXV benutzt den ffserver + sowie ffmpeg Version 0.4.8 um die entsprechende Aufnahme zu repacken und + diese dann über das Netz an den Browser zu schicken. + Ein embedded Windows Media Player stellt dann diesen Stream dar. + So meine Idealvorstellung :) + +Die Probleme dabei: + + 1. xxv muss auf einer Maschine > 1.5 Ghz laufen, da der onthefly streamer eine Menge Power braucht + 2. FFMpeg MUSS in der Version 0.4.8 installiert sein! 0.4.9 funktioniert leider nicht, + da der ffserver nicht an die neue Version von ffmpeg angepasst wurde! + 3. Der Stream läuft sehr ruckelnd auf meiner 1.8 GHz Maschine! + + Wie könnt ihr uns helfen damit wir die Probleme in den Griff bekommen?!: + + Experimentiert bitte mal mit den Einstellungen unter $SOURCEDIR/XXV/streamcfg rum. + Ihr könnt hier neue Testdateien erstellen und diese dann live ausprobieren. So wirds gemacht: + + 1. Erstellt eine eigene Testdatei in dem Verzeichniss $SOURCEDIR/XXV/streamcfg mit dem Namen ..cfg: + vdr:~# nano $SOURCEDIR/XXV/streamcfg/myStream.asf.cfg + + 2. Schreibt z.B. folgenden Inhalt: + #-----------8<----------------- + # Muss unbedingt den gleichen Namen wie die Datei haben (.) + Feed xxvd.ffm # Dieses nicht verändern! + Format mp4 # Ab hier könnt ihr Eurer Kreativität freien Lauf lassen + AudioBitRate 64 + VideoFrameRate 15 + VideoSize cif + VideoBitRate 256 + VideoGopSize 30 + VideoCodec mpeg4 + AudioCodec pcm_s16le + StartSendOnKey + + #-----------8<----------------- + + Mehr Informationen über den genauen Syntax der Konfigurationsdatei erfahrt ihr hier: + http://ffmpeg.sourceforge.net/ffserver-doc.html + + Wenn ihr wissen wollt welche Codecs Euch auf Eurem System zur Verfügung stehen dann ruft folgendes auf: + ffmpeg -formats + Output audio/video file formats: mpeg vcd vob mpegts crc image imagepipe ac3 h263 m4v h264 mpeg1video mjpeg s16le s16be + u16le u16be s8 u8 mulaw alaw rawvideo null mp2 mp3 rm asf asf_stream avi wav swf au gif mov 3gp mp4 mpjpeg singlejpeg dv + flv yuv4mpegpipe ogg ffm audio_device nut rtp + Input audio/video file formats: mpeg mpegts image imagepipe ac3 h263 m4v h264 mpegvideo mjpeg s16le s16be u16le u16be + s8 u8 mulaw alaw rawvideo mp3 rm asf avi wav swf au gif mov dv 4xm flv psxstr RoQ ipmovie wc3movie yuv4mpegpipe ogg + ffm video4linux audio_device dv1394 nut rtsp redir sdp rtp + Output image formats: + pbm pgm ppm pam pgmyuv yuv png jpeg gif + Input image formats: + pnm pam pgmyuv yuv png jpeg gif + Codecs: + Encoders: ac3 mp2 mp3 vorbis mpeg1video mpeg2video h263 h263p flv rv10 mpeg4 msmpeg4v1 msmpeg4v2 msmpeg4 wmv1 + wmv2 mjpeg ljpeg huffyuv asv1 asv2 ffv1 rawvideo pcm_s16le pcm_s16be pcm_u16le pcm_u16be pcm_s8 pcm_u8 + pcm_alaw pcm_mulaw adpcm_ima_qt adpcm_ima_wav adpcm_ima_dk3 adpcm_ima_dk4 adpcm_ms adpcm_4xm + Decoders: vorbis rawvideo h263 mpeg4 msmpeg4v1 msmpeg4v2 msmpeg4 wmv1 wmv2 h263i flv rv10 svq1 + svq3 wmav1 wmav2 indeo3 aac mpeg4aac mpeg1video mpeg2video dvvideo dvaudio mjpeg mjpegb mp2 mp3 mace3 mace6 + huffyuv ffv1 cyuv h264 vp3 asv1 asv2 vcr1 cljr 4xm mdec roqvideo interplayvideo xan_wc3 real_144 real_288 + roq_dpcm interplay_dpcm xan_dpcm pcm_s16le pcm_s16be pcm_u16le pcm_u16be pcm_s8 pcm_u8 pcm_alaw pcm_mulaw + adpcm_ima_qt adpcm_ima_wav adpcm_ima_dk3 adpcm_ima_dk4 adpcm_ms adpcm_4xm + Supported file protocols: file: pipe: udp: rtp: tcp: http: + Frame size, frame rate abbreviations: ntsc pal qntsc qpal sntsc spal film ntsc-film sqcif qcif cif 4cif + Motion estimation methods: zero(fastest) full(slowest) log phods epzs(default) x1 + + 3. Wenn ihr Eure änderungen gespeichert habt, wechselt in das Webinterface und stellt Euren neuen Stream unter + Einstellungen -> Stream -> Serverconf + ein. + + 4. Anschliessend wechselt Ihr zur Aufnahmenliste und wählt eine Aufnahme aus. Dort klickt ihr dann auf den Link + "Watch Record" oder "Aufnahme anzeigen" + + 5. Falls irgend etwas nicht funktioniert solltet Ihr Euch das entsprechende Logfile anschauen + vdr:~# tail -f /var/log/xxvd*.log + + Eure Erfahrungen, Rechnerdaten (CPU) und Configfiles könnt ihr mir gerne + unter www.vdr-portal.de als pn an xpix zukommen lassen. + Wir sind an Euren Ergebnissen SEHR INTERESSIERT und wollen die besten Vorschläge + als Default in den nächsten Versionen von xxv aufnehmen. + + + +MUSIC: + +* WebInterface: Viele User hatten ja mehr als 1000 MP3 Titel auf ihrem vdr rumlungern, + so das damit das Javascript Konzept absolut nicht damit klar kam. Das neue Interface + ist nun reines html und zum Glück auch wesentlich schneller im Seitenaufbau. + +* GTag die Covers als ImageFiles aus dem Internet zu saugen. + Wir nutzen dafür ein Perl Modul WWW::Mechanize, das auch natürlich zusätzlich + installiert werden muss. Dieses Modul emuliert einen Webuser, der ganz normal + seinen Suchbegriff(Albumnamen, Erscheinungsjahr) auf der Suchseite des allseits + berühmen Musikportals www.allofmp3.com eingibt und dann das Ergebniss nach den + entsprechenden Albumcover durchsucht und dieses letztendlich auf den vdr lädt. + Diese Cover werden dann im Musicinterface mit angezeigt. + +HTTP: + +* Eine Processbar wird angezeigt wenn Prozesse gestartet werden die etwas länger + dauern (Musik neu einlesen, getCovers) +* Es kann jetzt eine Startseite unter Preferences -> HTTPD -> StartPage individuell + festgelegt werden, (Jetzt läuft, Programm, Autotimer, ...) + +EPG: + +* Events werden gesondert gekennzeichnet, wenn diese als Timer aufgezeichnet werden. + +TIMER: + +* Timer referenzieren jetzt auf Ihren EPG Eintrag, falls dieser vorhanden ist. +* Inactive Timer werden jetzt gelöscht falls diese mehr als einen Monat in der + Zukunft liegen. Es kam öfters vor, das ein Timer per Autotimer programmiert + wurde, dieser wurde wegen Desinteresse deaktiviert. + Wenn der Timer abgelaufen war, tauchte er automatisch genau einen Monat später + wieder in der Liste auf. Diese "Timerleichen" mussten dann immer mühsam von Hand + gelöscht werden. + Das passiert jetzt automatisch wenn TIMERS -> Einstellungen -> Deactive auf 'yes' gesetzt ist. + +AUTOTIMER: + +* Autotimer können bestimmen ob Timer mit VPS und eigenem Vor- und Nachlauf angelegt werden. +* Bei einem Update werden jetzt zusätzlich auch die Channelnamen der gefundenen Events angezeigt. +* Autotimer - Einstellung - exclude: Exclude-Kanalliste um für bestimme Kanäle + die Suche nach Events generell auszuschliessen. + +ROBOT (neu): + +* Neues Modul zum automatsichem Surfen sowie Downloaden der xxv relevanten Daten. + Siehe auch MUSIC:GetCovers in diesem Dokument. + +USER: + +* Bestimmte Parameter können jetzt bei dem User eingestellt werden. + Dabei nutzen wir ein generisches System, wenn zum Beispiel der User xpix + nur den Skin Snow sehen möchte kann man das in den Usereinstellungen unter + 'Prefs' mit 'HTTPD::HtmlRoot=snow' sehr schön einstellen. + Natürlich kann man auch alle anderen Parameter der Module dem User zuteilen, + z.B. möchten wir zusätzlich, das der User xpix nur Timer definieren darf, + deren Priorität lediglich bei 30 liegt. Das würde dann so aussehen: + + HTTPD::HtmlRoot=snow, TIMERS::Priority=30 + + Der Syntax lautet also 'Modulename::Parameter=Wert, Modulename::Parameter=Wert, ...' ... + wenn der User xpix auch nur als Level=User eingestellt ist, kann man somit + verhindern das dieser seine Einstellungen ändert. + +* Der User kann jetzt auch einen Logout vornehmen. + +RECORDS: + +* Es werden jetzt die Schnittmarken grafisch in der Recordübersicht dargestellt. +* Viele Eigenschaften des Records sind jetzt editierbar. + (Marks, Lifetime, Priorität,...) +* Hulk (Andreas) hat sich dem leidigen und wesentlich unperformanten Weg der + Previewbilderstellung angenommen und ein sehr schlankes C Programm + nahmens 'vdr2jpeg' geschrieben. Dieses Programm tut im Grunde nichts + anderes als Previewbilder bei bestimmten Marken zu erstellen. + Dieses wir natürlich auch von xxv unterstützt und kann + per "svn co http://bandt.dyndns.org/repos/vdr2jpeg" geholt werden. + Nähere Angaben zur Installation könnt ihr in der README Datei des Programmpaketes nachlesen. +* Serien, oder Aufnahmen die in einen Gruppenordner zusammengefasst sind, + werden in rlist als Ordner angezeigt. + +STATUS: + +* Ein besonders nettes Feature, es werden jetzt Graphen erstellt + welche die Speicherauslastung sowie die Last eines bestimmten Zeitraumes + (Einstellungen -> Status -> History) darstellen. + Das Besondere daran, die Grafiken werden aus den Templates heraus erstellt, + so das jeder geneigte Skinprogrammierer seine eigenen Grafiken bei Bedarf + erstellen kann. In dem HTML Skin kann man das sehr schön unter Status sehen. + +EPG: + +* Es kann jetzt auch innerhalb eines Senders nach Events gesucht werden. + +REMOTE: + +* Der Intervall kann jetzt onthefly eingestellt werden +* In dem grabbed Screen werden jetzt zusätzliche Informationen mit + eingezeichnet. (z.Zt.Sendernamen) Die Anzeige kann man unter + Einstellungen -> GRAB-> Imgtext einstellen. Ausserdem hat man unter 'Font' + die Möglichkeit den Zeichensatz sowie dessen Grösse unter 'Imgfontsize' einzustellen. + +Global: + +* Fast alle Module können in Ihrer Funktion deaktiviert werden + (Einstellungen -> ModName -> Active = 'no'). +* Die Templates sind jetzt ebenfalls lokaliert und übersetzbar, das heisst + der Skinprogrammierer kann über die gettext Routine auf die Übersetzungsdatenbank + zugreifen. + +Skin:html + +* Die Tabellen von timerlist sowie now,program werden jetzt nach Wochentagen gruppiert. +* Fast überall wurden automatische redirects eingebaut, z.B. Timer editiert -> Timerlist +* Timer die einen Konflikt mit einem anderen Timer haben, werden jetzt besonders hervorgehoben. + Timer die eine höhere Priorität haben werden braun gekennzeichnet. + Timer die eine kleinere Priorität als der andere haben werden rot dargestellt. + + + +INSTALLATION +================================================================================ + +Wir unterstützen ab sofort Subversion, das heisst also für Euch das auf Eurem +System subversion installiert sein sollte. Wie Subversion-Clients auf +Eurem System installiert werden könnt Ihr hier nachlesen: + + http://subversion.tigris.org/project_packages.html + + +* Download + + cd $SOURCEDIR + svn co http://bandt.dyndns.org/repos/XXV + + + +* Detailierte Anleitung für Download, Checkout, UPDATE 0.20 -> 0.30 +================================================================================ + +* xxvd stoppen + vdr:~# /etc/init.d/xxvd stop + +* Download des Reposity + + vdr:~# cd $SOURCEDIR + vdr:~# svn co http://bandt.dyndns.org/repos/XXV + +* Eventuell /etc/init.d/xxvd an das neue Installationsverzeichnis anpassen + und anschliessend neustarten + + vdr:~# /etc/init.d/xxvd start + +* Logfile anschauen: + + vdr:~# cat /var/log/xxvd.log + + bzw. + + vdr:~# tail -f /var/log/xxvd.log + + +Sollten im Logfile irgendwelche Fehlermeldungen wg. fehlender Module auftauchen, +so solltet ihr diese Nachinstallieren. Wer nicht mehr weiss wie das geht, +das wiki wird Dir helfen: + +http://www.vdr-wiki.de/wiki/index.php/Xxv#Perl_Module + + + +Da einige Tabellen auf Eurem System nicht mehr dem aktuellen Stand entsprechen, +solltet ihr alle Tabellen löschen und xxv diese dann bei einem Restart neu einrichten lassen. +Dazu sichern wir zuerst die Autotimer/Accounts und löscht anschliessend alle Tabellen: + ++ Dies kann mit dem beigefügtem Upgrade Script erfolgen +-------------------------------------------------------------------------------- +* In diesem Script muss eventuell der Datenbankname angepasst werden, + falls die Datenbank nicht xxv heisst. + +* Altes xxv beenden: + vdr:~# /etc/init.d/xxvd stop + +* Datenbank aktualiseren: + + vdr:~# cd $SOURCEDIR/XXV/contrib + vdr:~# ./upgrade-xxv.sh + Enter password: + +* xxv aktualiseren und anschliessen neustarten: + vdr:~# /etc/init.d/xxvd start + +--------------- + + ++ oder manuell nach folgender Anleitung +-------------------------------------------------------------------------------- + +* Altes xxv beenden: + vdr:~# /etc/init.d/xxvd stop + +* Autotimer und Accounts sichern: + vdr:~/XXV# mysql -h localhost -u USERNAME -p xxv + Enter password: + Reading table information for completion of table and column names + ... + mysql> select * INTO OUTFILE '/tmp/autotimer.sav' from AUTOTIMER; + Query OK, 10 rows affected (0.11 sec) + mysql> select * INTO OUTFILE '/tmp/user.sav' from USER; + Query OK, 2 rows affected (0.07 sec) + +* Alle Tabellen von xxv löschen (wir löschen einfach die gesamte Datenbank und erstellen Sie wieder): + mysql> drop database xxv; + Query OK, 24 rows affected (0.07 sec) + + mysql> create database xxv; + Query OK, 1 row affected (0.06 sec) + + mysql> quit + Bye + +* Neues xxv starten, damit werden alle Datenbanken angelegt werden + vdr:~# /etc/init.d/xxvd start + +* Logfile anschauen ob xxvd auch ohne Störung läuft + tail -f /var/log/xxvd.log + +* Autotimer und Accounts importieren: + vdr:~/XXV# mysql -h localhost -u USERNAME -p xxv + Enter password: + Reading table information for completion of table and column names + ... + + + mysql> load data infile '/tmp/autotimer.sav' into table AUTOTIMER; + Query OK, 10 rows affected (0.11 sec) + + mysql> load data infile '/tmp/user.sav' into table USER; + Query OK, 2 rows affected (0.07 sec) + + mysql> quit + Bye + +--------------- + ++ das Sichern der Autotimer ist auch im vdradmin Format per Im-& Export + per Telnet oder Webinterface möglich, allerdings unterstützt dieses Datenformat + nicht alle XXV-Feature +-------------------------------------------------------------------------------- + +* Autotimer exportieren: + per Telnet: + ae /tmp/autotimer.sav + + oder per Webinterface: + http://vdr:8080/?cmd=ae&data=/tmp/autotimer.sav + +* Autotimer importieren: + per Telnet: + ai /tmp/autotimer.sav + + oder per Webinterface: + http://vdr:8080/?cmd=ai&data=/tmp/autotimer.sav + +--------------- + + +* Späteres Update des Reposity +================================================================================ + Die Entwicklung weiter und wenn Ihr später eine aktualisierte Version + vom Server ziehen wollt, dann macht ein Update der geänderten Dateien + + vdr:~# cd $SOURCEDIR/XXV + vdr:~# svn up + vdr:~# /etc/init.d/xxvd restart + + +* Zusätzliche Skins +================================================================================ + + Der aktuelle Entwicklerstand der Skins stone, snow, blue, deltab ist + ebenfalls als Reposity verfügbar + + vdr:~# cd $SOURCEDIR + vdr:~# svn co http://bandt.dyndns.org/repos/XXV-Skins + + bzw. zum späteren aktualisierten + + vdr:~# cd $SOURCEDIR/XXV-Skins + vdr:~# svn up + + um diese Skins nutzen können, müssen sie entweder parallel zum XXV-html Skin + kopiert werden. Oder einfach mit /etc/init.d/xxvd dieses Verzeichnis als + per Parameter --htmldir=$SOURCEDIR/XXV-Skins definiert werden, dieser Parameter + ist ebenfalls in der man-Page beschrieben. (man $SOURCEDIR/doc/xxvd.man) + + diff --git a/doc/README.txt b/doc/README.txt new file mode 100644 index 0000000..96d9733 --- /dev/null +++ b/doc/README.txt @@ -0,0 +1,65 @@ +Electronically translated, still another correction of the grammar and orthography needs +---------------------------------------------------------------------------------------- +Hello friends, + +now has I mean menace was made and a first Framework for XXV (Xtreme eXtension for Vdr) +made true. Naturally need I unite testers this project there is rather extensive. +Over perhaps it would be beautiful even if those little Perl can me with the Plugins help. + +To you are simply by Mail to me if you announce interested ! + +But for the time being... some explanations which actually XXV is;) + +As know some from you, I worked in former times much to vdradmin. +By this work came at the end as vdradmin "BigPatch" ... +finally it however only one sprag was to be extended by the existing vdradmin. + +With this work on the Patch me a simpler solution floated before substantially +structure and more simply to always extend is. It is to be able to serve a +central service to exist with that different of haven is open and these +different services. An additional haven over a Plugin to furnish, +should be just as simple, as placing also a certain service ready. +Write a Plugins goes very fast there the input (Vdr, railways etc.) +as well as the output (telnet, HTTP...) generically was realized. + +It should be e.g. possible thus to register with a telnet CONSOLE, HttpBrowser, +WapPhone, etc. pp. an autotimer. This should be able to scan substantially +faster the EPG data (MySQL data base) and over an interface vdr the new timer + communicates. Naturally also is considered to the single mode of the SVdrP +and only one instruction is mailed and again the haven is closed immediately, +so that other programs can access again svdrp. + +Long speech short sense, here a small overview of the present functions: + + * completely in Perl realizes + * very generic front-end + * Plugin system + * Data base support + * Epg data are regularly parsed and registered + * very simple Plugin concept for future extensions + * several services from a service (Telnet, HTTP, ...) + * Dump interface for external programs + +That was realized everything the Event module and naturally a MySQL data base, +which takes up all data (timer, epg, channels) and thereby also marvelously +the things to be reorganized to be able.. + +A guidance for installing and description in more detail find it under: + +http://www.linuxtv.org/vdrwiki/index.php/Xxv + +Legal stuff +----------- + + (c) Copyright 2004-2005 Frank Herrmann / Berlin. + All rights reserved. + + Written by Frank Herrmann and + Andreas Brachold . + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + The complete text of the license is found in the file COPYING. diff --git a/doc/TODO.txt b/doc/TODO.txt new file mode 100644 index 0000000..1db426c --- /dev/null +++ b/doc/TODO.txt @@ -0,0 +1,13 @@ +Featurerequest (ToDo DevVersion >= 0.50): + +* Zeitintensive Aufgaben sollten vorher den sysload prüfen (blafasel) +* Coverbilder im mp3 Verzeichnis für Albumvorschau nutzen. (wilderigel) +* Autotimer sollte auch die Aufnahmen beim suchen berücksichtigen (Karsten) +* EPG-Bilder von tvmovie2vdr nutzen (sledgehammer) +* Advances Search Dialog (sledgehammer) +* commands.conf mit zur Verfügung stellen (xpix) +* Echtes Telnetinterface mitr history usw. (xpix) +* Eigenschaften MaxLifetime und MaxPrio bei Usern (wilderigel) +* Server-Push für weitere langsame Vorgänge (Hulk) + + diff --git a/doc/TUTORIAL.txt.gz b/doc/TUTORIAL.txt.gz new file mode 100644 index 0000000..36e8f9c Binary files /dev/null and b/doc/TUTORIAL.txt.gz differ diff --git a/doc/docu.tmpl b/doc/docu.tmpl new file mode 100644 index 0000000..aee6b15 --- /dev/null +++ b/doc/docu.tmpl @@ -0,0 +1,99 @@ +=head1 NAME + + +XXV::MODULES:: + + + + + +=head1 SYNOPSIS + + + use + my $auto = ->new( + -config => \$Config, + -dbh => \$DBH, + -realbin=> \$RealBin, + ); + + + ./bin/xxvd [--kill] [--configfile file] [--docu targetdir] + + + +=head1 VERSION + + - + +=head1 DESCRIPTION + + + +=head1 CONFIGURATION + +=over 4 + + + +=item + + + +=over 4 + +=item * default: + +=item * type: + +=item * required: + +=back + + + +=back + +=head1 COMMANDS + +=over 4 + + + +=item * () + + + + + +=back + +=head1 REQUIREMENTS + +=over 4 + + + +=item * + + + + + +=back + +=head1 SEE ALSO + +XXV + +=head1 AUTHOR + +Copyright (C) , . All rights reserved. + +=cut diff --git a/doc/xxvd.1 b/doc/xxvd.1 new file mode 100644 index 0000000..79176c6 --- /dev/null +++ b/doc/xxvd.1 @@ -0,0 +1,94 @@ +.TH xxvd 1 "July 14, 2007" +.SH NAME +XXV \- (Xtreme eXtension for VDR) provides a central service to administer VDR +.SH SYNOPSIS +\fBxxvd\fR [\fB\-\-configfile=\fR \fBFILE\fR] [\fB\-\-logfile=\fR \fBFILE\fR] [\fB\-\-pidfile=\fR \fBFILE\fR] [\fB\-\-localedir=\fR \fBDIR\fR] [\fB\-\-moduledir=\fR \fBDIR\fR] [\fB\-\-docudir=\fR \fBDIR\fR] [\fB\-\-poddir=\fR \fBDIR\fR] [\fB\-\-htmldir=\fR \fBDIR\fR] [\fB\-\-fontdir=\fR \fBDIR\fR] [\fB\-\-vtxdir=\fR \fBDIR\fR] [\fB\-\-newsmods=\fR \fBDIR\fR] [\fB\-\-newstmpl=\fR \fBDIR\fR] [\fB\-\-kill\fR] [\fB\-\-verbose=\fR \fBLEVEL\fR] [\fB\-\-version\fR] [\fB\-\-nofork\fR] +.SH DESCRIPTION +\fBxxvd\fR is daemon behind XXV. +XXV provides a central service to administer VDR, it's contain +a http daemon, a telnet server and a WAP server among other services. +And is extendable by plugins and skins. XXV allows to manage +timers, auto timers, channels, recordings and much more provided by VDR +.SH OPTIONS +.TP +\-\-configfile=\fIFILE\fR +Use \fBFILE\fR as config file for XXV. +The config file is modified by XXV, so it shall not be read\-only. +.TP +\-\-logfile=\fIFILE\fR. +Output all log messages to \fBFILE\fR. +.TP +\-\-pidfile=\fIFILE\fR +Write process id of \fBxxvd\fR daemon to \fBFILE\fR. +.TP +\-\-localedir=\fIDIR\fR +Search for locales in \fBDIR\fR. +\fBDIR\fR should contain the typical locales structure +with XXV's translations. (eg. de/LC_MESSAGES/xxv.mo) +.TP +\-\-moduledir=\fIDIR\fR +Search for modules (plugins) in \fBDIR\fR. +.TP +\-\-docudir=\fIDIR\fR +Directory \fBDIR\fR with template files used for generate documentation. +.TP +\-\-poddir=\fIDIR\fR +Generate the selfdocumentation files in \fBDIR\fR. +Documentation files are generated by XXV, so it shall be writable. +.TP +\-\-htmldir=\fIDIR\fR +XXV searchs for it's html templates in \fBDIR\fR. +Each subdirectory in \fBDIR\fR is seen as a set of +templates (Skin). +.TP +\-\-fontdir=\fIDIR\fR +XXV searchs usable fonts in \fBDIR\fR. +.TP +\-\-vtxdir=\fIDIR\fR +XXV module VTX use font images from \fBDIR\fR. +.TP +\-\-contrib=\fIDIR\fR +XXV use some external scripts in \fBDIR\fR. +.TP +\-\-newsmods=\fIDIR\fR +\fBxxvd\fR search for news modules (news plugins) in \fBDIR\fR. +.TP +\-\-newstmpl=\fIDIR\fR +XXV searches for news templates in \fBDIR\fR. +.TP +\-\-kill +Kill daemon \fBxxvd\fR. +.TP +\-\-verbose=\fILEVEL\fR +Select the verbose \fILEVEL\fR of the logged +messages of XXV. +.RS +.TP 0.2i +\(bu +0 \- Don't log messages +.TP 0.2i +\(bu +1 \- Errors only +.TP 0.2i +\(bu +2 \- Messages depends user action +.TP 0.2i +\(bu +3 \- More events +.TP 0.2i +\(bu +5 \- Lots of messages +.TP 0.2i +\(bu +>5 \- Messages with dump of caller stack +.RE +.TP +\-\-version +Display the version number and exit. +.TP +\-\-nofork +Debug mode: don't fork to the background. +.SH AUTHOR +This manual page was written by Tobias Grimm. +.PP +(July 14, 2007) diff --git a/doc/xxvd.sgml b/doc/xxvd.sgml new file mode 100644 index 0000000..3cdaa87 --- /dev/null +++ b/doc/xxvd.sgml @@ -0,0 +1,213 @@ + +Tobias"> + Grimm"> + + &date;"> + 1"> + tg@e-tobi.net"> + + xxvd"> + + + Debian"> + GNU"> + GPL"> + ] +> + + + +
&dhemail;
+ &dhfirstname; &dhsurname; + + 2005 - 2007 + &dhusername; + + &dhdate; +
+ &dhucpackage; &dhsection; + + &dhpackage; + (Xtreme eXtension for VDR) provides a central service to administer VDR + + + + xxvd + FILE + FILE + FILE + DIR + DIR + DIR + DIR + DIR + DIR + DIR + DIR + DIR + + LEVEL + + + + + + DESCRIPTION + + &dhucpackage; is daemon behind &dhpackage;. + &dhpackage; provides a central service to administer VDR, it's contain + a http daemon, a telnet server and a WAP server among other services. + And is extendable by plugins and skins. &dhpackage; allows to manage + timers, auto timers, channels, recordings and much more provided by VDR + + + OPTIONS + + + --configfile=FILE + + Use FILE as config file for &dhpackage;. + The config file is modified by &dhpackage;, so it shall not be read-only. + + + + --logfile=FILE. + + Output all log messages to FILE. + + + + --pidfile=FILE + + Write process id of &dhucpackage; daemon to FILE. + + + + --localedir=DIR + + Search for locales in DIR. + DIR should contain the typical locales structure + with &dhpackage;'s translations. (eg. de/LC_MESSAGES/xxv.mo) + + + + --moduledir=DIR + + Search for modules (plugins) in DIR. + + + + --docudir=DIR + + Directory DIR with template files used for generate documentation. + + + + --poddir=DIR + + Generate the selfdocumentation files in DIR. + Documentation files are generated by &dhpackage;, so it shall be writable. + + + + --htmldir=DIR + + &dhpackage; searchs for it's html templates in DIR. + Each subdirectory in DIR is seen as a set of + templates (Skin). + + + + --fontdir=DIR + + &dhpackage; searchs usable fonts in DIR. + + + + --vtxdir=DIR + + &dhpackage; module VTX use font images from DIR. + + + + --contrib=DIR + + &dhpackage; use some external scripts in DIR. + + + + --newsmods=DIR + + &dhucpackage; search for news modules (news plugins) in DIR. + + + + --newstmpl=DIR + + &dhpackage; searches for news templates in DIR. + + + + --kill + + Kill daemon &dhucpackage;. + + + + --verbose=LEVEL + + Select the verbose LEVEL of the logged + messages of &dhpackage;. + + + 0 - Don't log messages + 1 - Errors only + 2 - Messages depends user action + 3 - More events + 5 - Lots of messages + >5 - Messages with dump of caller stack + + + + + --version + + Display the version number and exit. + + + + --nofork + + Debug mode: don't fork to the background. + + + + + + AUTHOR + This manual page was written by &dhusername;<&dhemail;>. + (&date;) + +
+ + + + diff --git a/etc/logrotate.d/xxvd b/etc/logrotate.d/xxvd new file mode 100644 index 0000000..467df50 --- /dev/null +++ b/etc/logrotate.d/xxvd @@ -0,0 +1,8 @@ +/var/log/xxvd.log { + compress + rotate 99 + size=+4096k + notifempty + missingok + copytruncate +} diff --git a/etc/xxvd b/etc/xxvd new file mode 100755 index 0000000..8ec5d5c --- /dev/null +++ b/etc/xxvd @@ -0,0 +1,85 @@ +#!/bin/sh +# +# xxvd Start/Stop the xxvd daemon. +# +# chkconfig: 2345 90 11 +# description: xxvd is a telnet/http config \ +# server, for ther DVB Settop box vdr program. \ +# \ +# \ +# . +# processname: xxvd +# config: xxvd.cfg +# +# to Setup, where is xxvd located +# In welchem Ordner befindet sich bin/xxvd +FOLDER="/root/XXV" + + +# Run as noprivileged user, else set empty +RUNAS="root" + +# Which translation is used +LANGUAGE="de_DE@euro"; + +# See how we were called. +PROG="bin/xxvd" + +MODPATH="$FOLDER/lib/XXV/MODULES" +CONFIG="$FOLDER/etc/xxvd.cfg" +PIDFILE="/var/run/xxvd.pid" +HTMLDIR="$FOLDER/" +DOCUDIR="$FOLDER/doc/" +PODDIR="$FOLDER/doc/" +LOGFILE="/var/log/xxvd.log" +CONTRIB="$FOLDER/contrib" +NEWSMODS="$FOLDER/lib/XXV/OUTPUT/NEWS" +NEWSTMPL="$FOLDER/share/news" +VERBOSE="3" + +OPTIONS="--configfile $CONFIG \ + --logfile $LOGFILE \ + --pidfile $PIDFILE \ + --docudir $DOCUDIR \ + --poddir $PODDIR \ + --htmldir $HTMLDIR \ + --contrib $CONTRIB \ + --newsmods $NEWSMODS \ + --newstmpl $NEWSTMPL \ + --moduledir $MODPATH \ + --verbose $VERBOSE" + +start() { + echo -n "Start $PROG: " + su - $RUNAS -c "export LANG="$LANGUAGE";cd $FOLDER;nice -n 10 ./$PROG $OPTIONS" +} + +stop() { + echo -n "Stop $PROG: " + su - $RUNAS -c "export LANG="$LANGUAGE";cd $FOLDER;./$PROG --kill $OPTIONS" +} + +restart() { + stop + start +} + +case "$1" in + start) + start + exit 0; + ;; + stop) + stop + exit 0; + ;; + restart) + restart + exit 0; + ;; + *) + echo $"Usage: $0 {start|stop|status|restart}" + exit 1 +esac + +exit $? diff --git a/etc/xxvd.cfg.example b/etc/xxvd.cfg.example new file mode 100644 index 0000000..f78ff7f --- /dev/null +++ b/etc/xxvd.cfg.example @@ -0,0 +1,158 @@ +[AUTOTIMER] +active=y +exclude=POS > 50 + +[CHANNELS] +empty=n +file=/video/channels.conf +filterCA=0,1,2,3,4 +interval=10800 +stripCH=short,long;provider + +[CHRONICLE] +active=y +interval=7200 + +[EPG] +epgimages=/var/cache/xxv/epgimages +interval=3600 +periods=12:00,18:00,20:20,22:00,23:00,00:00,02:00,04:00 +timeframe=2 + +[GRAB] +file=/tmp/live.jpg +font=VeraBI.ttf +imgfontsize=12 +imgquality=90 +imgtext=[?- i = channel.split(" ") -?][[? i.shift ?]] [? i.join(" ") ?]: [? event.Title ?] +vpos=20 +xsize=480 +ysize=360 + +[General] +DSN=DBI:mysql:database=xxv;host=localhost;port=3306 +Language=de_DE +PWD=xxv +USR=xxv +initscript=/etc/init.d/xxvd + +[HTTPD] +Clients=1000 +HtmlRoot=html +Port=8080 +StartPage=schema +active=y + +[INTERFACE] +Clients=5 +Port=8082 +active=y + +[LOGREAD] +active=y +rows=100 +syslog=/var/log/syslog +tail=/usr/bin/tail + +[MUSIC] +active=y +clients=5 +coverimages=/var/cache/xxv/cover +path=/music +port=8100 +proxy= + +[NEWS::JABBER] +active=n +level=1 +passwd=password +receiveUser=receiveUser@example.com +user=newsxxv@example.com + +[NEWS::MAIL] +active=n +address=xxv@example.com +interval=6 +level=1 +smtp=smtp.example.com +spwd=password +susr=user + +[NEWS::RSS] +active=y +level=1 + +[NEWS::VDR] +active=y +level=1 + +[RECORDS] +commandfile=/video/reccmds.conf +interval=1800 +previewbinary=/usr/bin/vdr2jpeg +previewcommand=vdr2jpeg +previewcount=5 +previewimages=/var/cache/xxv/preview +previewlistthumbs=n +vfat=y +videodir=/video + +[REMOTE] +active=y +commands=/video/commands.conf + +[REPORT] +active=y +host=localhost +interval=6 + +[ROBOT] +active=y + +[STATUS] +active=y +dfBinary=/bin/df +font=VeraBI.ttf +history=1 +interval=60 +wcBinary=/usr/bin/wc +whoBinary=/usr/bin/who + +[STREAM] +host=192.168.0.23 +netvideo=\\192.168.0.23\video + +[SVDRP] +VdrHost=localhost +VdrPort=2001 + +[TELNET] +Clients=5 +Port=8081 +active=y + +[TIMERS] +DVBCards=1 +Lifetime=50 +Priority=50 +afterminutes=5 +deactive=y +interval=1800 +prevminutes=1 + +[USER] +active=y +noAuth=192.168.0.0/24, 127.0.0.1/32 +tempimages=/var/cache/xxv/temp +withAuth=192.168.1.0/24 + +[VTX] +active=y +cache=packed +dir=/vtx + +[WAPD] +Clients=5 +Port=8085 +WMLRoot=wml +active=y diff --git a/html/alist.tmpl b/html/alist.tmpl new file mode 100644 index 0000000..9d0f3c1 --- /dev/null +++ b/html/alist.tmpl @@ -0,0 +1,84 @@ + +

+ + +[] + +', '?cmd=asearch&data=')"> + +[] + +

+ +

+ + + + + + + + + + + + + + + + + + + bgcolor='#F5F5F5'> + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + " + href="?cmd=aedit&data=">[] + + + " + href="javascript:sure(document.Autotimer, ' : ','?cmd=adelete&data=')"> + [] + + + + + + + [] + + [] + + + +
diff --git a/html/asearch.tmpl b/html/asearch.tmpl new file mode 120000 index 0000000..5671c2a --- /dev/null +++ b/html/asearch.tmpl @@ -0,0 +1 @@ +alist.tmpl \ No newline at end of file diff --git a/html/bloecke/event_links.tmpl b/html/bloecke/event_links.tmpl new file mode 100644 index 0000000..b618f6b --- /dev/null +++ b/html/bloecke/event_links.tmpl @@ -0,0 +1,28 @@ +
+ + + +]" /> + +]" /> + +]" name='recordlink' id='' /> + + + ]" /> + + + + ]" /> + + 2 ? 'Dolby' : 'Stereo') %?> + + ]" /> + + +
diff --git a/html/bloecke/links.tmpl b/html/bloecke/links.tmpl new file mode 100644 index 0000000..67fdf8b --- /dev/null +++ b/html/bloecke/links.tmpl @@ -0,0 +1,9 @@ + +
+ +
+ % +
+ +
+ \ No newline at end of file diff --git a/html/bloecke/percentbar.tmpl b/html/bloecke/percentbar.tmpl new file mode 100644 index 0000000..f8b17fe --- /dev/null +++ b/html/bloecke/percentbar.tmpl @@ -0,0 +1,21 @@ + + +
+ +
+ +
+ 200 %?> +
+ % +
+ +
diff --git a/html/bloecke/stars.tmpl b/html/bloecke/stars.tmpl new file mode 100644 index 0000000..196da4e --- /dev/null +++ b/html/bloecke/stars.tmpl @@ -0,0 +1,4 @@ + + + + diff --git a/html/bloecke/tooltip.tmpl b/html/bloecke/tooltip.tmpl new file mode 100644 index 0000000..44788fa --- /dev/null +++ b/html/bloecke/tooltip.tmpl @@ -0,0 +1,12 @@ + + " + onmouseover="ttpreq(this, ' + 0 %?>~ + ',, );" + > diff --git a/html/clist.tmpl b/html/clist.tmpl new file mode 100644 index 0000000..c864fae --- /dev/null +++ b/html/clist.tmpl @@ -0,0 +1,157 @@ + + + 1 %?> + + + + + + + + + + + + + + + + + " IF cgi.param('__sortby') == row %?> + + + + " IF cgi.param('__sortby') == row %?> + " IF cgi.param('__sortby') == row && cgi.param('__desc') == 0 %?> + + " IF cgi.param('__sortby') == row && cgi.param('__desc') == 0 %?> + " IF cgi.param('__sortby') == row && cgi.param('__desc') == 1 %?> + + " IF cgi.param('__sortby') == row && cgi.param('__desc') == 1 %?> + + + +">[S]  + +">[E]  + + + : \'\' ?','?cmd=cdelete&data=')" + title="" >[D] + + + + + > + + + + + + + + + + . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + : "" + +

+

+

+ + + + [] + + + + + [] + + + : + + value="" /> +
+

+ +

+ []  + []  + []  + ', + '','cdelete',document.clist)"> + [] + +

+ + + + 1 %?> + +
+ + + + + + + + + + + + + + + + + + + + + + +
+
+ + diff --git a/html/cmdlist.tmpl b/html/cmdlist.tmpl new file mode 100644 index 0000000..54e48ce --- /dev/null +++ b/html/cmdlist.tmpl @@ -0,0 +1,38 @@ +

+ + +

+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + ').replace('\n', '
') %?>
+ +
+

+ diff --git a/html/display.tmpl b/html/display.tmpl new file mode 100644 index 0000000..fca8970 --- /dev/null +++ b/html/display.tmpl @@ -0,0 +1,85 @@ + + + +

+ + + + + + + + + + + 100 %?> + + + + + + + + + 100 %?> + + + + + + + + + + + + + +
+ [] + + [] + + [] + + +
+ + [] + + + [] + +
+ + + + + %d%%") %?> + + + + + +
= 19 ? text : " ") %?>
+
+ + + + + + + +   + +  ( ) + +   + +
diff --git a/html/favicon.ico b/html/favicon.ico new file mode 100644 index 0000000..6a4fe16 Binary files /dev/null and b/html/favicon.ico differ diff --git a/html/filesys.tmpl b/html/filesys.tmpl new file mode 100644 index 0000000..8806b08 --- /dev/null +++ b/html/filesys.tmpl @@ -0,0 +1,76 @@ + label, + pie_height => 6, + axislabelclr => 'black', + shadow => 1, + ); + my_graph.set_title_font(param.font,8); + my_graph.set_value_font(param.font,8); + my_graph.set_label_font(param.font,6); + + file = writefile("status_filesys_${name}.gif", my_graph.plot(d).gif ); + statusfiles.push(file); + END; + END; +END; +%?> + + +

+ + + + + + + + 0 %?> + + + + + + + + 0 %?> + + +
+ +
+ + + + + + + + + + + + + + +
+ diff --git a/html/help.tmpl b/html/help.tmpl new file mode 100644 index 0000000..65daa5f --- /dev/null +++ b/html/help.tmpl @@ -0,0 +1,127 @@ + + + + + + +

+

+ + : +
+ diff --git a/html/images/16_9Screen.png b/html/images/16_9Screen.png new file mode 100644 index 0000000..6b81670 Binary files /dev/null and b/html/images/16_9Screen.png differ diff --git a/html/images/1_stars.png b/html/images/1_stars.png new file mode 100644 index 0000000..f06010f Binary files /dev/null and b/html/images/1_stars.png differ diff --git a/html/images/2_stars.png b/html/images/2_stars.png new file mode 100644 index 0000000..905316f Binary files /dev/null and b/html/images/2_stars.png differ diff --git a/html/images/3_stars.png b/html/images/3_stars.png new file mode 100644 index 0000000..1783294 Binary files /dev/null and b/html/images/3_stars.png differ diff --git a/html/images/4_3Screen.png b/html/images/4_3Screen.png new file mode 100644 index 0000000..737016e Binary files /dev/null and b/html/images/4_3Screen.png differ diff --git a/html/images/4_stars.png b/html/images/4_stars.png new file mode 100644 index 0000000..9be4448 Binary files /dev/null and b/html/images/4_stars.png differ diff --git a/html/images/5_stars.png b/html/images/5_stars.png new file mode 100644 index 0000000..5ba2ed7 Binary files /dev/null and b/html/images/5_stars.png differ diff --git a/html/images/I.png b/html/images/I.png new file mode 100644 index 0000000..e8512fb Binary files /dev/null and b/html/images/I.png differ diff --git a/html/images/L.png b/html/images/L.png new file mode 100644 index 0000000..eb334ed Binary files /dev/null and b/html/images/L.png differ diff --git a/html/images/Lminus.png b/html/images/Lminus.png new file mode 100644 index 0000000..f7c43c0 Binary files /dev/null and b/html/images/Lminus.png differ diff --git a/html/images/Lplus.png b/html/images/Lplus.png new file mode 100644 index 0000000..848ec2f Binary files /dev/null and b/html/images/Lplus.png differ diff --git a/html/images/T.png b/html/images/T.png new file mode 100644 index 0000000..3017325 Binary files /dev/null and b/html/images/T.png differ diff --git a/html/images/Tminus.png b/html/images/Tminus.png new file mode 100644 index 0000000..2260e42 Binary files /dev/null and b/html/images/Tminus.png differ diff --git a/html/images/Tplus.png b/html/images/Tplus.png new file mode 100644 index 0000000..2c8d8f4 Binary files /dev/null and b/html/images/Tplus.png differ diff --git a/html/images/arrow.down.png b/html/images/arrow.down.png new file mode 100644 index 0000000..675d84b Binary files /dev/null and b/html/images/arrow.down.png differ diff --git a/html/images/arrow.right.png b/html/images/arrow.right.png new file mode 100644 index 0000000..79abee5 Binary files /dev/null and b/html/images/arrow.right.png differ diff --git a/html/images/asc.png b/html/images/asc.png new file mode 100644 index 0000000..80b153f Binary files /dev/null and b/html/images/asc.png differ diff --git a/html/images/at.png b/html/images/at.png new file mode 100644 index 0000000..4201164 Binary files /dev/null and b/html/images/at.png differ diff --git a/html/images/back.png b/html/images/back.png new file mode 100644 index 0000000..9627bbb Binary files /dev/null and b/html/images/back.png differ diff --git a/html/images/back_big.png b/html/images/back_big.png new file mode 100644 index 0000000..024e4e4 Binary files /dev/null and b/html/images/back_big.png differ diff --git a/html/images/bar_green.png b/html/images/bar_green.png new file mode 100644 index 0000000..c7ace12 Binary files /dev/null and b/html/images/bar_green.png differ diff --git a/html/images/bar_red.png b/html/images/bar_red.png new file mode 100644 index 0000000..4086f57 Binary files /dev/null and b/html/images/bar_red.png differ diff --git a/html/images/blank.png b/html/images/blank.png new file mode 100644 index 0000000..cee9cd3 Binary files /dev/null and b/html/images/blank.png differ diff --git a/html/images/delete.png b/html/images/delete.png new file mode 100644 index 0000000..a495dad Binary files /dev/null and b/html/images/delete.png differ diff --git a/html/images/desc.png b/html/images/desc.png new file mode 100644 index 0000000..675d84b Binary files /dev/null and b/html/images/desc.png differ diff --git a/html/images/dolby.png b/html/images/dolby.png new file mode 100644 index 0000000..6eb9a4c Binary files /dev/null and b/html/images/dolby.png differ diff --git a/html/images/down.png b/html/images/down.png new file mode 100644 index 0000000..39c9c30 Binary files /dev/null and b/html/images/down.png differ diff --git a/html/images/edit.png b/html/images/edit.png new file mode 100644 index 0000000..12700d6 Binary files /dev/null and b/html/images/edit.png differ diff --git a/html/images/english.gif b/html/images/english.gif new file mode 100644 index 0000000..c2eedfc Binary files /dev/null and b/html/images/english.gif differ diff --git a/html/images/exit.png b/html/images/exit.png new file mode 100644 index 0000000..19df8c4 Binary files /dev/null and b/html/images/exit.png differ diff --git a/html/images/file.png b/html/images/file.png new file mode 100644 index 0000000..a20c6fa Binary files /dev/null and b/html/images/file.png differ diff --git a/html/images/foldericon.png b/html/images/foldericon.png new file mode 100644 index 0000000..2684748 Binary files /dev/null and b/html/images/foldericon.png differ diff --git a/html/images/french.gif b/html/images/french.gif new file mode 100644 index 0000000..3886d93 Binary files /dev/null and b/html/images/french.gif differ diff --git a/html/images/german.gif b/html/images/german.gif new file mode 100644 index 0000000..dbd8ea7 Binary files /dev/null and b/html/images/german.gif differ diff --git a/html/images/leer.png b/html/images/leer.png new file mode 100644 index 0000000..7a50497 Binary files /dev/null and b/html/images/leer.png differ diff --git a/html/images/linkbg.png b/html/images/linkbg.png new file mode 100644 index 0000000..cc6a456 Binary files /dev/null and b/html/images/linkbg.png differ diff --git a/html/images/logo.gif b/html/images/logo.gif new file mode 100755 index 0000000..37f43f5 Binary files /dev/null and b/html/images/logo.gif differ diff --git a/html/images/menu_big.png b/html/images/menu_big.png new file mode 100644 index 0000000..e378030 Binary files /dev/null and b/html/images/menu_big.png differ diff --git a/html/images/movie.png b/html/images/movie.png new file mode 100644 index 0000000..0c24571 Binary files /dev/null and b/html/images/movie.png differ diff --git a/html/images/new.png b/html/images/new.png new file mode 100644 index 0000000..8aa9166 Binary files /dev/null and b/html/images/new.png differ diff --git a/html/images/newfolder.png b/html/images/newfolder.png new file mode 100644 index 0000000..0695da8 Binary files /dev/null and b/html/images/newfolder.png differ diff --git a/html/images/next.png b/html/images/next.png new file mode 100644 index 0000000..c3bb0e8 Binary files /dev/null and b/html/images/next.png differ diff --git a/html/images/nocover.gif b/html/images/nocover.gif new file mode 100644 index 0000000..81cd60e Binary files /dev/null and b/html/images/nocover.gif differ diff --git a/html/images/notimers.png b/html/images/notimers.png new file mode 100644 index 0000000..dd8d629 Binary files /dev/null and b/html/images/notimers.png differ diff --git a/html/images/oben.png b/html/images/oben.png new file mode 100644 index 0000000..72a9633 Binary files /dev/null and b/html/images/oben.png differ diff --git a/html/images/off.png b/html/images/off.png new file mode 100644 index 0000000..6eda545 Binary files /dev/null and b/html/images/off.png differ diff --git a/html/images/ok.png b/html/images/ok.png new file mode 100644 index 0000000..f4e67f0 Binary files /dev/null and b/html/images/ok.png differ diff --git a/html/images/on.png b/html/images/on.png new file mode 100644 index 0000000..98e0765 Binary files /dev/null and b/html/images/on.png differ diff --git a/html/images/openfoldericon.png b/html/images/openfoldericon.png new file mode 100644 index 0000000..15fcd56 Binary files /dev/null and b/html/images/openfoldericon.png differ diff --git a/html/images/radio.png b/html/images/radio.png new file mode 100644 index 0000000..e877c02 Binary files /dev/null and b/html/images/radio.png differ diff --git a/html/images/record.png b/html/images/record.png new file mode 100644 index 0000000..03bf621 Binary files /dev/null and b/html/images/record.png differ diff --git a/html/images/record_blue.png b/html/images/record_blue.png new file mode 100644 index 0000000..4201164 Binary files /dev/null and b/html/images/record_blue.png differ diff --git a/html/images/record_green.png b/html/images/record_green.png new file mode 100644 index 0000000..03bf621 Binary files /dev/null and b/html/images/record_green.png differ diff --git a/html/images/record_red.png b/html/images/record_red.png new file mode 100644 index 0000000..748388b Binary files /dev/null and b/html/images/record_red.png differ diff --git a/html/images/repeat.png b/html/images/repeat.png new file mode 100644 index 0000000..b92f130 Binary files /dev/null and b/html/images/repeat.png differ diff --git a/html/images/schnell_back.png b/html/images/schnell_back.png new file mode 100644 index 0000000..6d27e6f Binary files /dev/null and b/html/images/schnell_back.png differ diff --git a/html/images/schnell_vor.png b/html/images/schnell_vor.png new file mode 100644 index 0000000..708c5f6 Binary files /dev/null and b/html/images/schnell_vor.png differ diff --git a/html/images/spanish.gif b/html/images/spanish.gif new file mode 100644 index 0000000..6fdede8 Binary files /dev/null and b/html/images/spanish.gif differ diff --git a/html/images/star.png b/html/images/star.png new file mode 100644 index 0000000..5e76158 Binary files /dev/null and b/html/images/star.png differ diff --git a/html/images/stardark.png b/html/images/stardark.png new file mode 100644 index 0000000..edea55d Binary files /dev/null and b/html/images/stardark.png differ diff --git a/html/images/switch.png b/html/images/switch.png new file mode 100644 index 0000000..4191979 Binary files /dev/null and b/html/images/switch.png differ diff --git a/html/images/timers.png b/html/images/timers.png new file mode 100644 index 0000000..585622d Binary files /dev/null and b/html/images/timers.png differ diff --git a/html/images/trans.gif b/html/images/trans.gif new file mode 100644 index 0000000..35d42e8 Binary files /dev/null and b/html/images/trans.gif differ diff --git a/html/images/up.png b/html/images/up.png new file mode 100644 index 0000000..6dd9846 Binary files /dev/null and b/html/images/up.png differ diff --git a/html/images/view_event.png b/html/images/view_event.png new file mode 100644 index 0000000..04601b5 Binary files /dev/null and b/html/images/view_event.png differ diff --git a/html/images/vor.png b/html/images/vor.png new file mode 100644 index 0000000..346d0de Binary files /dev/null and b/html/images/vor.png differ diff --git a/html/images/xp/I.png b/html/images/xp/I.png new file mode 100644 index 0000000..e8512fb Binary files /dev/null and b/html/images/xp/I.png differ diff --git a/html/images/xp/L.png b/html/images/xp/L.png new file mode 100644 index 0000000..eb334ed Binary files /dev/null and b/html/images/xp/L.png differ diff --git a/html/images/xp/Lminus.png b/html/images/xp/Lminus.png new file mode 100644 index 0000000..bba1a31 Binary files /dev/null and b/html/images/xp/Lminus.png differ diff --git a/html/images/xp/Lplus.png b/html/images/xp/Lplus.png new file mode 100644 index 0000000..727889b Binary files /dev/null and b/html/images/xp/Lplus.png differ diff --git a/html/images/xp/T.png b/html/images/xp/T.png new file mode 100644 index 0000000..3017325 Binary files /dev/null and b/html/images/xp/T.png differ diff --git a/html/images/xp/Tminus.png b/html/images/xp/Tminus.png new file mode 100644 index 0000000..ca8745a Binary files /dev/null and b/html/images/xp/Tminus.png differ diff --git a/html/images/xp/Tplus.png b/html/images/xp/Tplus.png new file mode 100644 index 0000000..64bc9da Binary files /dev/null and b/html/images/xp/Tplus.png differ diff --git a/html/images/xp/file.png b/html/images/xp/file.png new file mode 100644 index 0000000..a723c74 Binary files /dev/null and b/html/images/xp/file.png differ diff --git a/html/images/xp/folder.png b/html/images/xp/folder.png new file mode 100644 index 0000000..7b6835d Binary files /dev/null and b/html/images/xp/folder.png differ diff --git a/html/images/xp/openfolder.png b/html/images/xp/openfolder.png new file mode 100644 index 0000000..c8292f4 Binary files /dev/null and b/html/images/xp/openfolder.png differ diff --git a/html/images/xxv.gif b/html/images/xxv.gif new file mode 100644 index 0000000..b46df28 Binary files /dev/null and b/html/images/xxv.gif differ diff --git a/html/images/zurueck.png b/html/images/zurueck.png new file mode 100644 index 0000000..39a65bd Binary files /dev/null and b/html/images/zurueck.png differ diff --git a/html/index.tmpl b/html/index.tmpl new file mode 100644 index 0000000..513203e --- /dev/null +++ b/html/index.tmpl @@ -0,0 +1,15 @@ + + + + +XXV - User:<?% user %?> + + + + + + + + + diff --git a/html/javascript/XHConn.js b/html/javascript/XHConn.js new file mode 100644 index 0000000..537b555 --- /dev/null +++ b/html/javascript/XHConn.js @@ -0,0 +1,41 @@ +/** XHRequest based on ** + ** XHConn - Simple XMLHTTP Interface - bfults@gmail.com - 2005-04-08 ** + ** Code licensed under Creative Commons Attribution-ShareAlike License ** + ** http://creativecommons.org/licenses/by-sa/2.0/ **/ + +function XHRequest() +{ + var xmlhttp, bComplete = false; + try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } + catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } + catch (e) { try { xmlhttp = new XMLHttpRequest(); } + catch (e) { xmlhttp = false; }}} + if (!xmlhttp) + return null; + + this.connect = function(sRequest, fnDone, sData) + { + if (!xmlhttp) return false; + bComplete = false; + + try { + xmlhttp.open("GET", sRequest, true); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && !bComplete) + { + bComplete = true; + fnDone(xmlhttp, sData); + } + }; + xmlhttp.send(null); + } catch(z) { alert(z); return false; } + return true; + }; + return this; +} + +var ajaxconn = new XHRequest(); + +if (!ajaxconn) + alert("XMLHTTP not available. Try a newer/better browser."); diff --git a/html/javascript/coolmenus4.js b/html/javascript/coolmenus4.js new file mode 100644 index 0000000..a8692fc --- /dev/null +++ b/html/javascript/coolmenus4.js @@ -0,0 +1,427 @@ +/************************************************************ +Coolmenus Beta 4.06 - Copyright Thomas Brattli - www.dhtmlcentral.com +Last updated: 11.13.02 + +v4.06 - with basic frame support +*************************************************************/ +/*Browsercheck object*/ +function cm_bwcheck(){ + //In theory we should use object detection, but this script needs work-arounds for almost every browser... + this.ver=navigator.appVersion + this.agent=navigator.userAgent.toLowerCase() + this.dom=document.getElementById?1:0 + this.ns4=(!this.dom && document.layers)?1:0; + this.op=window.opera + this.moz=(this.agent.indexOf("gecko")>-1 || window.sidebar) + this.ie=this.agent.indexOf("msie")>-1 && !this.op + if(this.op){ + this.op5=(this.agent.indexOf("opera 5")>-1 || this.agent.indexOf("opera/5")>-1) + this.op6=(this.agent.indexOf("opera 6")>-1 || this.agent.indexOf("opera/6")>-1) + this.op7=this.dom&&!this.op5&&!this.op6 //So all higher opera versions will use it + }else if(this.moz) this.ns6 = 1 + else if(this.ie){ + this.ie4 = !this.dom && document.all + this.ie5 = (this.agent.indexOf("msie 5")>-1) + this.ie55 = (this.ie5 && this.agent.indexOf("msie 5.5")>-1) + this.ie6 = this.dom && !this.ie4 && !this.ie5 && ! this.ie55 + } + this.mac=(this.agent.indexOf("mac")>-1) + this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.op5 || this.op6 || this.op7) + this.usedom= this.ns6||this.op7//Use dom creation + this.reuse = this.ie||this.op7||this.usedom //Reuse layers + this.px=this.dom&&!this.op5?"px":"" + return this +} +var bw=new cm_bwcheck() +/*Variable declaration*/ +var cmpage +/*Crossbrowser objects functions*/ +function cm_message(txt){alert(txt); return false} +function cm_makeObj(obj,nest,o,doc){ //Changed in v4.05 + if(!doc) doc=document + if(bw.usedom&&o) this.evnt=o + else{nest=(!nest) ? "doc.":'doc.layers.'+nest+'.' + this.evnt=bw.dom? doc.getElementById(obj): + bw.ie4?doc.all[obj]:bw.ns4?eval(nest+"layers." +obj):0; + } + if(!this.evnt) return cm_message('The layer does not exist ('+obj+')' + +'- \nIf your using Netscape please check the nesting of your tags (on the entire page)\nNest:'+nest) + this.css=bw.dom||bw.ie4?this.evnt.style:this.evnt; this.ok=0 + this.ref=bw.dom||bw.ie4?doc:this.css.document; + this.obj = obj + "Object"; eval(this.obj + "=this"); + this.x=0; this.y=0; this.w=0; this.h=0; this.vis=0; return this +} +cm_makeObj.prototype.moveIt = function(x,y){this.x=x;this.y=y; this.css.left=x+bw.px;this.css.top=y+bw.px} +cm_makeObj.prototype.showIt = function(o){this.css.visibility="visible"; this.vis=1; if(bw.op5&&this.arr){ this.arr.showIt(); }}//alert('showing arrow')}} +cm_makeObj.prototype.hideIt = function(no){this.css.visibility="hidden"; this.vis=0;} +cm_makeObj.prototype.clipTo = function(t,r,b,l,setwidth){ +this.w=r; this.h=b; if(bw.ns4){this.css.clip.top=t;this.css.clip.right=r; this.css.clip.bottom=b;this.css.clip.left=l +}else{if(t<0)t=0;if(r<0)r=0;if(b<0)b=0;if(b<0)b=0; this.css.clip="rect("+t+bw.px+","+r+bw.px+","+b+bw.px+","+l+bw.px+")"; +if(setwidth){if(bw.op5||bw.op6){this.css.pixelWidth=r; this.css.pixelHeight=b;}else{this.css.width=r+bw.px; this.css.height=b+bw.px;}}}} +function cm_active(on,h){ + if(this.o.arr) on?this.o.arr.hideIt():bw.op5?this.o.arr.showIt():this.o.arr.css.visibility="inherit" + if(bw.reuse||bw.usedom){ + if(!this.img2) this.o.evnt.className=on?this.cl2:this.cl + else this.o.ref.images["img"+this.name].src=on?this.img2.src:this.img1.src; //Changed v4.05 + if(on && bw.ns6){this.o.hideIt(); this.o.css.visibility='inherit' }; //netscape 6 bug fix + }else{ + if(!this.img2){ if(on) this.o.over.showIt(); else this.o.over.hideIt(); + }else this.o.ref.images["img"+this.name].src=on?this.img2.src:this.img1.src; + }this.isactive=on?1:0 +} +/***Pageobject **/ +function cm_page(frame){ //Changed v4.05 + if(!frame) frame = self + this.x=0; this.x2 =(!bw.ie)?frame.innerWidth:frame.document.body.offsetWidth-20; + this.y=0; this.orgy=this.y2= (!bw.ie)?frame.innerHeight:frame.document.body.offsetHeight-6; + this.x50=this.x2/2; this.y50=this.y2/2; return this +} +/***check positions**/ +function cm_cp(num,w,minus){ + if(num){if(num.toString().indexOf("%")!=-1){var t = w?cmpage.x2:cmpage.y2; num=parseInt((t*parseFloat(num)/100)) + if(minus) num-=minus }else num=eval(num);} else num=0; return num +} +/**Level object**/ +function cm_makeLevel(){//changed 4.06 + var c=this, a=arguments; c.width=a[0]||null; c.height=a[1]||null; + c.regClass=a[2]||null; c.overClass=a[3]||null; c.borderX=a[4]>-1?a[4]:null; + c.borderY=a[5]>-1?a[5]:null; c.borderClass=a[6]||null; c.rows=a[7]>-1?a[7]:null; + c.align=a[8]||null; c.offsetX=a[9]||null; c.offsetY=a[10]||null; c.arrow=a[11]||null; + c.arrowWidth=a[12]||null; c.arrowHeight=a[13]||null; c.roundBorder=a[14]||null; return c +} +/***Making the main menu object**/ +function makeCM(name){ //Changed v4.06 + var c=this; c.mc=0; c.name = name; c.m=new Array(); c.scrollY=-1; c.level=new Array(); c.l=new Array(); c.tim=100; c.isresized=0; + c.isover=0; c.zIndex=100; c.frameStartLevel=1; c.bar=0; c.z=0; c.totw=0; c.toth=0; c.maxw=0; c.maxh=0; cmpage = new cm_page(); c.constructed = 0; + return this +}//events +makeCM.prototype.onshow=""; makeCM.prototype.onhide=""; makeCM.prototype.onconstruct=""; +/***Creating layers**/ +function cm_divCreate(id,cl,txt,w,c,app,ex,txt2){ + if(bw.usedom){var div=document.createElement("DIV"); div.className=cl; div.id=id; + if(txt) div.innerHTML=txt; if(app){app.appendChild(div); return div} + if(w) document.body.appendChild(div); return div + }else{var dstr='
',0,1) + }str+='
'; + if(l==0){if(arrow)str+=m.d3=cm_divCreate(id+'_a','clCMAbs','',0,1,d1); str+=""} + str+="\n"; if(!bw.reuse){m.txt=null; m.d2=null; m.d3=null;} + if(bw.usedom){ if(l==0) document.body.appendChild(d1); str=''} + return str +} +/***get align num from text (better to evaluate numbers later)**/ +function cm_checkalign(a){ + switch(a){ + case "right": return 1; break; case "left": return 2; break; + case "bottom": return 3; break; case "top": return 4; break; + case "righttop": return 5; break; case "lefttop": return 6; break; + case "bottomleft": return 7; break; case "topleft": return 8; break; + }return null +} +/**Making each individual menu **/ +makeCM.prototype.makeMenu=function(name,parent,txt,lnk,targ,w,h,img1,img2,cl,cl2,align,rows,nolink,onclick,onmouseover,onmouseout){ + var c = this; if(!name) name = c.name+""+c.mc; var p = parent!=""&&parent&&c.m[parent]?parent:0; + if(c.mc==0){ + //Added 4.07 - bug(?) in opera 7 - you cannot dom-add layers created in one document to another one (or so it seems) - so turn of usedom + if(bw.op7 && this.frames) bw.usedom=0 + var tmp=location.href; + if(tmp.indexOf('file:')>-1||tmp.charAt(1)==':') c.root=c.offlineRoot; else c.root=c.onlineRoot + if(c.useBar){if(!c.barBorderClass) c.barBorderClass=c.barClass; c.bar1 = cm_divCreate(c.name+'bbar_0',c.barClass,'',0,1); + c.bar = cm_divCreate(c.name+'bbar',c.barBorderClass,'',1,1,0,0,c.bar1); if(bw.usedom) c.bar.appendChild(c.bar1); + }}var create=1,img,arrow; var m = c.m[name] = new Object(); m.name=name; m.subs=new Array(); m.parent=p; m.arnum=0; m.arr=0 + var l = m.lev = p?c.m[p].lev+1:0; c.mc++; m.hide=0; + if(l>=c.l.length){ + var p1,p2=0; if(l>=c.level.length) p1=c.l[c.level.length-1]; + else p1=c.level[l]; c.l[l]=new Array(); if(!p2) p2=c.l[l-1] + if(l!=0){ if(isNaN(p1.align)) p1["align"]=cm_checkalign(p1.align) + for(var i in p1){if(i!="str"&&i!="m"){if(p1[i]==null) c.l[l][i]=p2[i]; else c.l[l][i]=p1[i] }} + }else{c.l[l]=c.level[0]; c.l[l].align=cm_checkalign(c.l[l].align)} + c.l[l]["str"]=''; c.l[l].m=new Array(); if(!c.l[l].borderClass) c.l[l].borderClass=c.l[l].regClass + c.l[l].app=0; c.l[l].max=0; c.l[l].arnum=0; c.l[l].o=new Array(); c.l[l].arr=new Array() + c.level[l]=p1=p2=null + if(l!=0) c.l[l].str=c.l[l].app=cm_divCreate(c.name+ '_' +l+'_0',c.l[l].borderClass,'') + }if(p){p = c.m[p]; p.subs[p.subs.length]=name; + if(p.subs.length==1&&c.l[l-1].arrow){ p.arr=1; + if(p.parent){c.m[p.parent].arnum++ + if(c.m[p.parent].arnum>c.l[l-1].arnum){ + c.l[l-1].str+=c.l[l-1].arr[c.l[l-1].arnum]=cm_divCreate(c.name+ '_a' +(l-1)+'_'+c.l[l-1].arnum,'clCMAbs','',0,1,c.l[l-1].app); c.l[l-1].arnum++ + }}}if(bw.reuse) if(p.subs.length>c.l[l].max) c.l[l].max = p.subs.length; else create=0 + }m.rows=rows>-1?rows:c.l[l].rows; m.w=cm_cp(w||c.l[l].width,1); m.h=cm_cp(h||c.l[l].height,0); m.txt=txt; m.lnk=lnk; + if(align) align=cm_checkalign(align); m.align=align||c.l[l].align; m.cl=cl=cl||c.l[l].regClass; + m.targ=targ; m.cl2=cl2||c.l[l].overClass; m.create=create; m.mover=onmouseover; m.mout=onmouseout; + m.onclck=onclick; m.active = cm_active; m.isactive=0; m.nolink=nolink + if(create) c.l[l].m[c.l[l].m.length]=name + if(img1){m.img1 = new Image(); m.img1.src=c.root+img1; if(!img2) img2=img1; m.img2 = new Image(); m.img2.src=c.root+img2; + m.cl="clCMAbs"; m.txt=''; if(!bw.reuse&&!nolink) m.txt = '';; + m.txt+='c.maxw) c.maxw=m.w; if(m.h>c.maxh) c.maxh=m.h; c.totw+=c.pxBetween+m.w+c.l[0].borderX;c.toth+=c.pxBetween+m.h+c.l[0].borderY} + if(lnk && !onmouseover){ + var path=lnk.indexOf("mailto:")>-1||lnk.indexOf("http://")>-1?"":c.root + m.mover="self.status='"+path+m.lnk+"'" + if(!m.mout) m.mout=""; m.mout+=";self.status='';" + } +} +/**Getting x/y coords for subs **/ +makeCM.prototype.getcoords=function(m,bx,by,x,y,maxw,maxh,ox,oy){ + var a=m.align; x+=m.o.x; y+=m.o.y + switch(a){ + case 1: x+=m.w+bx; break; case 2: x-=maxw+bx; break; + case 3: y+=m.h+by; break; case 4: y-=maxh+by; break; + case 5: x-=maxw+bx; y-=maxh-m.h; break; + case 6: x+=m.w+bx; y-=maxh-m.h; break; + case 7: y+=m.h+by; x-=maxw-m.w; break; + case 8: y-=maxh+by; x-=maxw-m.w+bx; break; + }//Added v4.05 + if(m.lev==this.frameStartLevel-1 && this.frames){ + switch(a){ + case 1: x=0; break; + case 2: x=this.cmpage.x2-maxw; break; + case 3: y=0; break; + case 4: y-=maxh+by; break; + case 5: x-=maxw+bx; y-=maxh-m.h; break; + case 6: x+=m.w+bx; y-=maxh-m.h; break; + case 7: y+=m.h+by; x-=maxw-m.w; break; + case 8: y-=maxh+by; x-=maxw-m.w+bx; break; + } + } + m.subx=x + ox; m.suby=y + oy +} +/**Showing sub elements**/ +makeCM.prototype.showsub=function(el){ //Changed v4.06 + var c=this,pm=c.m[el],m,o,nl + if(!pm.b||(c.isresized&&pm.lev>0)) pm.b=c.l[pm.lev].b; c.isover=1 + clearTimeout(c.tim); + var ln=pm.subs.length,l=pm.lev+1 + if(c.l[pm.lev].a==el&&l!=c.l.length && !c.openOnClick){if(c.l[pm.lev+1].a) c.hidesub(l+1,el); return} + c.hidesub(l,el); if(pm.mover) eval(pm.mover); if(!pm.isactive) pm.active(1); + c.l[pm.lev].a = el; if(ln==0) return; + if(c.openOnClick && !c.clicked) return//Added v4.06 + if(!c.l[l].b) return //Added v4.05 + var b = c.l[l].b, bx=c.l[l].borderX, by=c.l[l].borderY, rows=pm.rows + var rb=c.l[l].roundBorder;//added 4.06 + var x=bx+rb,y=by+rb,maxw=0,maxh=0,cn=0; b.hideIt() + for(var i=0;imaxw) maxw=m.w; maxh=y} + else{x+=m.w+bx; if(m.h>maxh) maxh=m.h; maxw=x;} + o.css.visibility="inherit"; if(bw.op5||bw.op6) o.showIt() + }else{o = c.m[c.l[l].m[i]].o; o.hideIt();} } + if(!rows) maxw+=bx*2+rb; else maxh+=by*2+rb; //changed 4.06 + if(rb){maxw+=rb; maxh+=rb}//added 4.06 + b.clipTo(0,maxw,maxh,0,1) + //Check frame scroll + if(c.chkscroll) c.chkscroll() //Added v4.05 - not the best solution + if(c.chkscroll||!pm.subx||!pm.suby||c.scrollY>-1||c.isresized) c.getcoords(pm,c.l[l-1].borderX,c.l[l-1].borderY,pm.b.x,pm.b.y,maxw,maxh,c.l[l-1].offsetX,c.l[l-1].offsetY) //Changed 4.06 + x=pm.subx; if(c.chkscroll&&l==c.frameStartLevel) pm.suby+=c.scrollY; y=pm.suby; b.moveIt(x,y); if(c.onshow) eval(c.onshow); b.showIt() +} +/**Hide sub elements **/ +makeCM.prototype.hidesub=function(l,el){ //Changed v4.05 + var c = this,tmp,m,i,j,hide + if(!l) {l=1; hide=1; c.clicked=0} + for(i=l-1;i0&&i>l-1) if(c.l[i].b) c.l[i].b.hideIt()//Changed v4.05 + if(c.l[i].a&&c.l[i].a!=el){ + m=c.m[c.l[i].a]; m.active(0,1); if(m.mout) eval(m.mout); c.l[i].a=0 + if(i>0&&i>l-1) if(bw.op5||bw.op6) for(j=0;jl){for(j=0;j0) this.body.appendChild(c.l[i].app) + if(!this.frames) c.l[i].str=null + }}c.z=c.zIndex+2 + for(i=st;i0){m.b = bobj; nest=i} + else{m.b = new cm_makeObj(c.name + "_"+name+"_0","",m.d1,this.doc); m.b.css.zIndex=c.z; m.b.clipTo(0,w+bx*2,h+by*2,0,1); nest=name} + id = c.name + "_"+name; nest=c.name + "_"+nest; + if(m.create){ + o=m.o=new cm_makeObj(id,nest+"_0",m.d2,this.doc); o.z=o.css.zIndex=c.z+1; if(bw.reuse){c.l[l].o[oc]=o; oc++}; + if(l==0&&m.img1) o.css.visibility='inherit'; if(bw.op5) o.showIt(); o.arr=0; + }if(!bw.reuse||l==0) o.clipTo(0,w,h,0,1); o.moveIt(bx,by); o.z=o.css.zIndex=c.z+2 + if(j"}} //Added 4.06 + c.makeObjects(nowrite); cmpage = new cm_page(); + var mpa,o,maxw=c.maxw,maxh=c.maxh,i,totw=c.totw,toth=c.toth,m,px=c.pxBetween + var bx=c.l[0].borderX,by=c.l[0].borderY,x=c.fromLeft,y=c.fromTop,mp=c.menuPlacement,rows=c.rows + if(rows){toth=maxh+by*2; totw=totw-px+bx;}else{totw=maxw+bx*2; toth=toth-px+by;} + switch(mp){ + case "center": x=cmpage.x2/2-totw/2; if(bw.ns4) x-=9; break; + case "right": x=cmpage.x2-totw; break; + case "bottom": case "bottomcenter": y=cmpage.y2-toth; if(mp=="bottomcenter") x=cmpage.x2/2-totw/2; break; + default: if(mp.toString().indexOf(",")>-1) mpa=1; break; + }for(var i=0;icmpage.x2+off || page2.y2>cmpage.orgy+off){ + if(bw.ie||bw.ns6||bw.op7||bw.ns4){ + cmpage=page2; this.isresized=1; + if(this.onresize) eval(this.onresize); this.construct(1); + if(this.onafterresize) eval(this.onafterresize); + }else{cm_inresize=1; location.reload()} + } +} +/**Onclick of an item**/ +makeCM.prototype.onclck=function(m){ //Changed v4.06 + m = this.m[m] + if(m.onclck) eval(m.onclck); + if(this.openOnClick && m.subs.length>0){ + this.clicked = 1; this.showsub(m.name); return + } + var lnk=m.lnk, targ=m.targ + if(lnk){ + if(lnk.indexOf("mailto")!=0 && lnk.indexOf("http")!=0) lnk=this.root+lnk + if(String(targ)=="undefined" || targ=="" || targ==0 || targ=="_self"){ + if(this.frames){ //Turning of all level 1 + vars + if(this.l[0].a){ + this.m[this.l[0].a].active(0,1) + this.l[0].a =0 + } + for(i=this.frameStartLevel;i 0) { + if(confirm(question + '\n' + txt.join("\n"))) { + tostatus('?cmd=' + cmd + '&data=' + ok.join('_')); + } + } else { + alert(warn); + } +} + +function Toggle(warn,form) { +// test on checked Boxes + ok = new Array; + txt = new Array; + x = 0; + for(var i=0;i 0) { + tostatus('?cmd=ttoggle&data=' + ok.join('_')); + } else { + alert(warn); + } +} + +function selAll(form, type) { +// check all Boxes + for(var i=0;i 0) { + var url = ""; + if(proxy != "") + url = proxy; + url = url + '?cmd=mplaylist&data=' + ok.join('_') + '&binary=1'; + location.href = url; + } else { + alert(warnmsg); + } +} + +/* -------------------- Widget Routines --------------- */ + +/* +- An AjaxCall to check for right values in HTML Widget +checkValue(inputObject, msgId, perlCall, wrongMessage, goodMessage); +checkValue(this, 'id', 'getip', 'host: %s is not exists!', 'ip address is %s') +*/ +function checkValue (valobj, msgname, cmd, wrongMsg, goodMsg) { + + var fnWhenDone = function (oXML, sData) { + var val = sData[0]; + var msg = sData[1]; + var wrongMsg = sData[2]; + var goodMsg = sData[3]; + + if(oXML.responseText.search('ERROR') > -1) { + msg.className = 'error'; + msg.innerHTML = wrongMsg.replace('%s', oXML.responseText); + } else { + msg.className = 'good'; + msg.innerHTML = goodMsg.replace('%s', oXML.responseText); + } + }; + + var inputvalue = valobj.value; + var msgobj = document.getElementById(msgname); + msgobj.innerHTML = 'Check value ...'; + + if(inputvalue) { + var url = "?cmd=checkvalue&data=" + cmd + ":" + inputvalue + "&ajax=text"; + var aconn = new XHRequest(); + if(!aconn) + return false; + return aconn.connect(url, fnWhenDone, [valobj, msgobj, wrongMsg, goodMsg]); + } +} diff --git a/html/javascript/helptip.js b/html/javascript/helptip.js new file mode 100644 index 0000000..6c129d4 --- /dev/null +++ b/html/javascript/helptip.js @@ -0,0 +1,240 @@ +/*----------------------------------------------------------------------------\ +| Help Tip 1.12 | +|-----------------------------------------------------------------------------| +| Created by Erik Arvidsson | +| (http://webfx.eae.net/contact.html#erik) | +| For WebFX (http://webfx.eae.net/) | +|-----------------------------------------------------------------------------| +| A tool tip like script that can be used for context help | +|-----------------------------------------------------------------------------| +| Copyright (c) 1999 - 2002 Erik Arvidsson | +|-----------------------------------------------------------------------------| +| This software is provided "as is", without warranty of any kind, express or | +| implied, including but not limited to the warranties of merchantability, | +| fitness for a particular purpose and noninfringement. In no event shall the | +| authors or copyright holders be liable for any claim, damages or other | +| liability, whether in an action of contract, tort or otherwise, arising | +| from, out of or in connection with the software or the use or other | +| dealings in the software. | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| This software is available under the three different licenses mentioned | +| below. To use this software you must chose, and qualify, for one of those. | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| The WebFX Non-Commercial License http://webfx.eae.net/license.html | +| Permits anyone the right to use the software in a non-commercial context | +| free of charge. | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| The WebFX Commercial license http://webfx.eae.net/commercial.html | +| Permits the license holder the right to use the software in a commercial | +| context. Such license must be specifically obtained, however it's valid for | +| any number of implementations of the licensed software. | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| GPL - The GNU General Public License http://www.gnu.org/licenses/gpl.txt | +| Permits anyone the right to use and modify the software without limitations | +| as long as proper credits are given and the original and modified source | +| code are included. Requires that the final product, software derivate from | +| the original source or any software utilizing a GPL component, such as | +| this, is also licensed under the GPL license. | +|-----------------------------------------------------------------------------| +| 2002-09-27 | | +| 2001-11-25 | Added a resize to the tooltip if the document width is too | +| | small. | +| 2002-05-19 | IE50 did not recognise the JS keyword undefined so the test | +| | for scroll support was updated to be IE50 friendly. | +| 2002-07-06 | Added flag to hide selects for IE | +| 2002-10-04 | (1.1) Restructured and made code more IE garbage collector | +| | friendly. This solved the most nasty memory leaks. Also added | +| | support for hiding the tooltip if ESC is pressed. | +| 2002-10-18 | Fixed verrical position in case of scrolled document. | +| 2002-12-02 | Mozilla bug workaround related to mousedown and move. | +|-----------------------------------------------------------------------------| +| Dependencies: helptip.css (To set up the CSS of the help-tooltip class) | +|-----------------------------------------------------------------------------| +| Usage: | +| | +| + + +

+

  +

+
+
[] +[ + ] + +

+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
bgcolor='#F5F5F5'> + + + + + + + + + + + +
diff --git a/html/memory.tmpl b/html/memory.tmpl new file mode 100644 index 0000000..bfc8fa6 --- /dev/null +++ b/html/memory.tmpl @@ -0,0 +1,105 @@ + label, + x_label_skip => steps, + x_long_ticks => 1, + + y_label => gettext('Memory usage in bytes'), + y_long_ticks => 1, + + line_width => 2, + box_axis => 1, + boxclr => '#FFFFCC', + fgclr => '#BBBBBB' + legend_placement => 'RD', + legend_spacing => 5, + ); + my_graph.set_title_font(param.font,10); + my_graph.set_y_label_font(param.font,10); + my_graph.set_x_label_font(param.font,10); + my_graph.set_x_axis_font(param.font,6); + my_graph.set_y_axis_font(param.font,6); + my_graph.set_legend( 'Swap', 'Active', 'Cached', 'Buffers'); + statusfiles.$name = writefile("status_${name}.gif", my_graph.plot(d).gif ); + END; + + # ------------------- Piegraph für Speicher + FILTER null; + name = 'memory_now'; + d2 = [ + ["Active ${data.Active}","Cached ${data.Cached}","Inactive ${data.Inactive}","MemFree ${data.MemFree}","Buffers ${data.Buffers}"], + [ data.Active, data.Cached, data.Inactive, data.MemFree, data.Buffers] + ]; + USE my_graph = GD.Graph.pie(400, 300); + label = gettext('Total Memory'); + label = "${label} ${data.MemTotal}"; + my_graph.set( + title => label, + axislabelclr => 'black', + pie_height => 25, + transparent => 0, + ); + my_graph.set_title_font(param.font,10); + my_graph.set_label_font(param.font,10); + my_graph.set_value_font(param.font,8); + statusfiles.$name = writefile("status_${name}.gif", my_graph.plot(d2).gif ); + END; + %?> + + +

+ + + + + + + + +
+ +
+ +
+ +
+

+ diff --git a/html/mlcopy.tmpl b/html/mlcopy.tmpl new file mode 120000 index 0000000..b15f879 --- /dev/null +++ b/html/mlcopy.tmpl @@ -0,0 +1 @@ +mledit.tmpl \ No newline at end of file diff --git a/html/mldisplay.tmpl b/html/mldisplay.tmpl new file mode 100644 index 0000000..01a125e --- /dev/null +++ b/html/mldisplay.tmpl @@ -0,0 +1,228 @@ + + +

: -

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +

+ + - + +

+
+ : + + + + + + : + + + + +
+ : + + + + + + $director" %?> + + + + + + : + + + + + + $language" %?> + + + + +
+ : + + + + + + $country" %?> + + + + + + : + + + + +
+ : + + + + + + : + + +    + : +    + +
+ : + + + + + + : + + + + +
+ : + + + + + + : + + +  x  + +
+ : + + + + + + : + + + + +
+ + : + + + + +   + +
+ :
+ ') %?> +
+ :
+ ') %?> +
+ :
+ + + + + + + + + +
+ + +   + +
+
diff --git a/html/mledit.tmpl b/html/mledit.tmpl new file mode 100644 index 0000000..4108a04 --- /dev/null +++ b/html/mledit.tmpl @@ -0,0 +1,206 @@ +

+ + + +

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ : + + +     +   + DVD-Palace (DE) + + +
+ : + + + + : + + +
+ : + + + + : + + +
+ : + + + + <?% gettext('german') %?> + + + <?% gettext('english') %?> + + + <?% gettext('french') %?> + + + <?% gettext('spanish') %?> + + + : + + +
+ : + + + + + +
+ : + + +
+ : + + +
+ : + + min +           + : + +
+ : + + + + : + + +
+ : + + bytes +
+ : + + +
+ : + + +
+ : + + +
+ : + + x + + + : + + +
: +
+ +
+ ' onfocus="document.library.cmd.value='mlsave'" onblur="document.library.cmd.value='mlresearch'"/>  +
+
diff --git a/html/mlgenres.tmpl b/html/mlgenres.tmpl new file mode 100644 index 0000000..4fdb73f --- /dev/null +++ b/html/mlgenres.tmpl @@ -0,0 +1,17 @@ + + + + + + + + + + + +
+ + 0 %?>checked="checked"/> + + +
diff --git a/html/mlimport.tmpl b/html/mlimport.tmpl new file mode 120000 index 0000000..b15f879 --- /dev/null +++ b/html/mlimport.tmpl @@ -0,0 +1 @@ +mledit.tmpl \ No newline at end of file diff --git a/html/mlist.tmpl b/html/mlist.tmpl new file mode 100644 index 0000000..9652c96 --- /dev/null +++ b/html/mlist.tmpl @@ -0,0 +1,104 @@ +

+ +
+ + + + + + + + + + +
+ : + + : +
+ : '>"> + + : +
+
+ + + +',document.musicform,'')"> +[] + +[] +[] + +
+[] +[] +[] + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
> +   +
> + <?% zeile.2 %?>  + +

Album:  [ album]

+

+ : ,  + : ,  + : ,  + :   +

+
+ + + +
diff --git a/html/mllist.tmpl b/html/mllist.tmpl new file mode 100644 index 0000000..fc728e1 --- /dev/null +++ b/html/mllist.tmpl @@ -0,0 +1,10 @@ +

+ + + + + diff --git a/html/mllistmedias.tmpl b/html/mllistmedias.tmpl new file mode 100644 index 0000000..e85f8be --- /dev/null +++ b/html/mllistmedias.tmpl @@ -0,0 +1,55 @@ + + + + + + + + + + + +
+ + + + + + +
+ + + + + + + + - + + +
+ + [ + + ; + + + + + $director" %?> + + + + ] +
+ + + ... + + + + +
+ +
+ \ No newline at end of file diff --git a/html/mlnavcontainer.tmpl b/html/mlnavcontainer.tmpl new file mode 100644 index 0000000..3ea27c2 --- /dev/null +++ b/html/mlnavcontainer.tmpl @@ -0,0 +1,110 @@ + + + +
+
+
+ +
diff --git a/html/mlresearch.tmpl b/html/mlresearch.tmpl new file mode 100644 index 0000000..a30dd98 --- /dev/null +++ b/html/mlresearch.tmpl @@ -0,0 +1,71 @@ +

+ + + + + + + +

+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + ') %?> + + +
+ + +   + + + + + + + + + + + + + +   + + +
diff --git a/html/mlsearch.tmpl b/html/mlsearch.tmpl new file mode 100644 index 0000000..b2e94d7 --- /dev/null +++ b/html/mlsearch.tmpl @@ -0,0 +1,52 @@ +

+ + + + + +
+ + + + + + + + + + +
+ : + + + :
+ +
+ +
+ + +
+ '/> +
+
+ + diff --git a/html/network.tmpl b/html/network.tmpl new file mode 100644 index 0000000..0f4538d --- /dev/null +++ b/html/network.tmpl @@ -0,0 +1,115 @@ + label, + x_label_skip => steps, + x_long_ticks => 1, + + y_label => gettext('Transfer in bytes'), + y_long_ticks => 1, + + line_width => 2, + box_axis => 1, + boxclr => '#FFFFCC', + fgclr => '#BBBBBB' + legend_placement => 'RD', + legend_spacing => 5, + ); + my_graph.set_title_font(param.font,10); + my_graph.set_y_label_font(param.font,10); + my_graph.set_x_label_font(param.font,10); + my_graph.set_x_axis_font(param.font,6); + my_graph.set_y_axis_font(param.font,6); + my_graph.set_legend( 'RxBytes', 'RxErrors', 'TxBytes', 'TxErrors'); + statusfiles.$iname = writefile("status_network_${iname}.gif", my_graph.plot(d).gif ); + END; + END; + %?> + + + +

+ + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+

+ diff --git a/html/next.tmpl b/html/next.tmpl new file mode 120000 index 0000000..dc903f9 --- /dev/null +++ b/html/next.tmpl @@ -0,0 +1 @@ +now.tmpl \ No newline at end of file diff --git a/html/now.tmpl b/html/now.tmpl new file mode 100644 index 0000000..170f667 --- /dev/null +++ b/html/now.tmpl @@ -0,0 +1,104 @@ + + +

+ + 2400; + t = date.format(cgi.param('data'), '%H:%M', locale); + day = date.format(cgi.param('data'), zeitformat, locale) ; + ELSIF cgi.param('data') && param.zeit; + t = date.format(param.zeit, '%H:%M', locale); + day = date.format(param.zeit, zeitformat, locale) ; + ELSE; + t = date.format(date.now, '%H:%M', locale); + day = date.format(date.now, zeitformat, locale) ; + now = 1; + END; +%?> +

+ + + + +   + +

+ + + + "> + " onclick="location.href='?cmd=erestart'"> +
+ + + + + + + + + + + + + + + + bgcolor='#F5F5F5'> + + + + + + 100 OR duration <= 0 %?> + + + + + + +
+ +
+ + [] + + []
+ + []
+ + + [] + +
+ + + +
+ +
+ + + + 100 ? 100 : per) %?> + + ${per}%%") %?> + + + + + +
19 ? text : " ") %?>
+
diff --git a/html/program.tmpl b/html/program.tmpl new file mode 100644 index 0000000..195fdb8 --- /dev/null +++ b/html/program.tmpl @@ -0,0 +1,107 @@ + + + + + + + + + + + +

 

+ + + + + + + + + + +
+ + + : +
+ + + [] + [] +
+ + + + + + + + + + + + + + + + + bgcolor='#F5F5F5'> + + + + + + + + + = 7; # Desc Field %?> + + + + + + + + + + + + +
+ +
+ [] + + [] + + [] + + +
+
+ + + + + + + 0 %?> +
+ + 0 %?> +
',' ') %?> + + +
+ diff --git a/html/rdisplay.tmpl b/html/rdisplay.tmpl new file mode 100644 index 0000000..0f31e28 --- /dev/null +++ b/html/rdisplay.tmpl @@ -0,0 +1,169 @@ +

:

+ + + + 7200 ? 500 : 400 %?> + + + + + + + + + + + + + + + + + + + + + +
+ : +
" src='/images/blank.png' width="" height=''>
- "> + secold; + bgcolor = (bgcolor == 'red' ? 'white' : 'red'); + percent = ((data.Duration - secold) / data.Duration) * width; + -%?> - ::" /> + +
+ + + + 1 %?> + + + + : :: + + + + 0;quest=data.SubTitle;END %?> + + + + + + + + + + + +
+ []  + + ?','?cmd=rdelete&data=')"> + [] +   + + + []  + + + []  + + + []  + + + []  + + + [] + + + [] + + +
+ + +
+ + + +
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 0 %?>" /> +
   +     -   + ( (60*5)%?>)
  +
+
  + +
  + : +
  + : +
  + : +
+
diff --git a/html/report.tmpl b/html/report.tmpl new file mode 100644 index 0000000..9606516 --- /dev/null +++ b/html/report.tmpl @@ -0,0 +1,43 @@ +

+ + +

+ :

+ + + + +

+ + 1 %?> + + + + + + + + + + + + + + + + + + +
+ + +
+ + +

+ diff --git a/html/rlist.tmpl b/html/rlist.tmpl new file mode 100644 index 0000000..5547b00 --- /dev/null +++ b/html/rlist.tmpl @@ -0,0 +1,269 @@ + + + + + + +

+ + + + + + 1 %?> + + + + :: + + + + + + + + + " width="200" title="" /> + + + + + +

+ 0; + sec = total mod 60; + min = total div 60 mod 60; + hour = total div 3600; + %?> + : + 0 %?>:: + + +
: + 0 %?>:: + +

+ + + + + + 1 %?> + + + + + + + + + + + + + + +
+ +
+ 0 %?> + " /> + + + +   0 %?> ()  ... +
+ +
+ + : ''" /> + +
+
+ + + +
+
+ + 0 %?>" /> + + +
  + + +
+ +
+ + + +
+      : +
+ + + + + + +

+ : "" +  () +

+ + +
+ []  + +', +'','rdelete',document.rlist)"> +[]  + + : + + value=''> +
+ + + + + " href="?cmd=rlist">[^] + + + + " href="?cmd=rlist">[^]  + " href="?cmd=rlist&data=">[<<] + +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + 1 %?> + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + 0 %?> + " /> + + + +   0 %?> ()  ... + + + + + + + + + + + + 0 %?>" />  + + + + + + + +
+ +
+ + + + + +  + + : + + + + + + +
+ + + + + 1 ? 2 : 1 ) %?> +
+ +
+ + 1 ? 2 : 1 ) %?> +
+ +
+
+ + + +
+[] +[] +[] + + + diff --git a/html/rsearch.tmpl b/html/rsearch.tmpl new file mode 120000 index 0000000..2e6f4df --- /dev/null +++ b/html/rsearch.tmpl @@ -0,0 +1 @@ +rlist.tmpl \ No newline at end of file diff --git a/html/schema.tmpl b/html/schema.tmpl new file mode 100644 index 0000000..38ad6d6 --- /dev/null +++ b/html/schema.tmpl @@ -0,0 +1,174 @@ + + + +
+

 
+      +

+ + + + + + + + + + + + + + + + + + + + + + + + + +bgcolor='#E5E5E5'> + + + + +
+ date.now %?> +  < + + + = Duration %?> +  > + +
  + param.zeitvon && date.now < param.zeitbis -%?> + +
+
 
+
+
+
+
+ + " + src='images/blank.png' + width="" + height='' /> + +
+ + + + oldend; + laenge = second_start - oldend; + percent = (laenge / Duration) * width; + ges = ges + percent; + -%?> + ' height=8 border=0 align='left' /> + width; + percent = width - ges; + END; + ges = ges + percent; + trun = percent / 10 | format('%d'); + IF dur < 300; + trun = 3; + + END; + -%?> + ", epgDesc ];desc=d.join("") %?> + + ' height=8 border=0 hspace=0 vspace=0 align='left' /> + +
+ +
+ + + +
+
+ + +  +  + -   + + + + + diff --git a/html/search.tmpl b/html/search.tmpl new file mode 100644 index 0000000..be3eed0 --- /dev/null +++ b/html/search.tmpl @@ -0,0 +1,131 @@ + + +

+ + + :  + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
:
: + checked>  + checked>  + checked>  +
: + checked>  + checked>  +
: + checked>  + checked>  + checked>  +
: + +
: + +
+ '>  + '>  +
+ + + 1 %?> + + + + + + + + + + + + + + + + bgcolor='#F5F5F5'> + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + +
+ + 0 %?> +
',' ') %?> + + +
+ +
+ diff --git a/html/skin.cfg b/html/skin.cfg new file mode 100644 index 0000000..375c631 --- /dev/null +++ b/html/skin.cfg @@ -0,0 +1,3 @@ + + + diff --git a/html/style/coolmenus4.css b/html/style/coolmenus4.css new file mode 100644 index 0000000..3832d60 --- /dev/null +++ b/html/style/coolmenus4.css @@ -0,0 +1,19 @@ +/* CoolMenus 4 - default styles - do not edit */ +.clCMAbs{position:absolute; visibility:hidden; left:0; top:0} +/* CoolMenus 4 - default styles - end */ + +/*Style for the background-bar*/ +.clBar{position:absolute; width:10; height:10; background-color:buttonface; layer-background-color:buttonface; visibility:hidden} +.clBarborder{position:absolute; visibility:hidden; background-color: #A0A0A0; layer-background-color:#A0A0A0} + +/*Styles for level 0*/ +.clLevel0,.clLevel0over{position:absolute; padding:2px; font-family:Tahoma, Verdan, Helvetica, Sans-Serfif; font-size:11px; text-decoration: none;} +.clLevel0{background-color:buttonface; layer-background-color:buttonface; color:black;} +.clLevel0over{background-color:buttonface; layer-background-color:buttonface; color:black; cursor:pointer; cursor:hand; border: 1px solid white } +.clLevel0border{position:absolute; visibility:hidden; background-color:white; layer-background-color:white} + +/*Styles for level 1*/ +.clLevel1, .clLevel1over{position:absolute; padding:2px; font-family:Tahoma, Verdan, Helvetica, Sans-Serfif; font-size:11px; text-decoration: none;} +.clLevel1{background-color:white; layer-background-color:white; color:black; } +.clLevel1over{background-color:Highlight; layer-background-color:Highlight; color:white; cursor:pointer; cursor:hand; border: 1px solid rgb(120,172,255);} +.clLevel1border{position:absolute; visibility:hidden; background-color:buttonface; layer-background-color:buttonface} diff --git a/html/style/helptip.css b/html/style/helptip.css new file mode 100644 index 0000000..2293abc --- /dev/null +++ b/html/style/helptip.css @@ -0,0 +1,36 @@ +/* + Notice that IE has a display problem if the help link is on + the last line of a container with no padding. If this is the + case increase the padding bottom to at least 1px +*/ + +a.helpLink { + color: Green; + text-decoration: none; + cursor: help; +} + +a.helpLink:hover { + color: Red; + text-decoration: none; +} + +.help-tooltip { + position: absolute; + width: 50%; + border: 1px Solid WindowFrame; + background: Infobackground; + color: InfoText; + font: StatusBar; + font: Status-Bar; + padding: 3px; + filter: progid:DXImageTransform.Microsoft.Shadow(color="#777777", Direction=135, Strength=3); + z-index: 10000; +} + + +.help-tooltip a, +.help-tooltip a:hover { + color: blue !important; + background: none; +} diff --git a/html/style/luna/tab.active.png b/html/style/luna/tab.active.png new file mode 100644 index 0000000..d85e7f6 Binary files /dev/null and b/html/style/luna/tab.active.png differ diff --git a/html/style/luna/tab.css b/html/style/luna/tab.css new file mode 100644 index 0000000..d8a4403 --- /dev/null +++ b/html/style/luna/tab.css @@ -0,0 +1,84 @@ +.dynamic-tab-pane-control.tab-pane { + position: relative; + width: 100%; /* width needed weird IE bug */ + margin-right: -2px; /* to make room for the shadow */ +} + +.dynamic-tab-pane-control .tab-row .tab { + + width: 70px; + height: 16px; + background-image: url( "tab.png" ); + + position: relative; + top: 0; + display: inline; + float: left; + overflow: hidden; + + cursor: Default; + + margin: 1px -1px 1px 2px; + padding: 2px 0px 0px 0px; + border: 0; + + z-index: 1; + font: 11px Tahoma; + white-space: nowrap; + text-align: center; +} + +.dynamic-tab-pane-control .tab-row .tab.selected { + width: 74px !important; + height: 18px !important; + background-image: url( "tab.active.png" ) !important; + background-repaet: no-repeat; + + border-bottom-width: 0; + z-index: 3; + padding: 2px 0 0px 0; + margin: 1px -3px -3px 0px; + top: -2px; + font: 11px Tahoma; +} + +.dynamic-tab-pane-control .tab-row .tab a { + font: 11px Tahoma; + color: Black; + text-decoration: none; + cursor: default; +} + +.dynamic-tab-pane-control .tab-row .tab.hover { + font: 11px Tahoma; + width: 70px; + height: 16px; + background-image: url( "tab.hover.png" ); + background-repaet: no-repeat; +} + + +.dynamic-tab-pane-control .tab-page { + clear: both; + border: 1px solid rgb( 145, 155, 156 ); + background: rgb( 252, 252, 254 ); + z-index: 2; + position: relative; + top: -2px; + + font: 11px Tahoma; + color: Black; + + filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr=#fffcfcfe, EndColorStr=#fff4f3ee, GradientType=0) + progid:DXImageTransform.Microsoft.Shadow(Color=#ff919899, Strength=2, Direction=135); + + /*244, 243, 238*/ + /* 145, 155, 156*/ + + padding: 10px; +} + +.dynamic-tab-pane-control .tab-row { + z-index: 1; + white-space: nowrap; +} \ No newline at end of file diff --git a/html/style/luna/tab.hover.png b/html/style/luna/tab.hover.png new file mode 100644 index 0000000..53de327 Binary files /dev/null and b/html/style/luna/tab.hover.png differ diff --git a/html/style/luna/tab.png b/html/style/luna/tab.png new file mode 100644 index 0000000..0f1fb78 Binary files /dev/null and b/html/style/luna/tab.png differ diff --git a/html/style/style.css b/html/style/style.css new file mode 100644 index 0000000..b01eaa0 --- /dev/null +++ b/html/style/style.css @@ -0,0 +1,225 @@ +body{ + font-family:Verdana, Arial, sans-serif; + font-size:80%; + border: #005199 1px dashed ; + color:#000064; + margin:10px; + padding:10px; +} + +/* Überschriften */ +h1 { font-size:1.3em;margin-top:0px;} +h2 { font-size:1.1em;} +h3 { font-size:1em; margin-top:0px; margin-bottom:0px;} +h4 { font-size:1em;} +h2,h4 { margin-top:0px;margin-bottom:0px; } +h1,h2,h3,h4 { color:#e88229;} + +/* Keine Rahmen um Grafiken als Link */ +a img {border-width:0px;} + +/* Standard Hyperlinks */ +a:link, a:visited, a:hover, a:active{ + text-decoration:none; + color:#005199; + background-color:inherit; +} +a:visited { color:#0075e3; } +a:hover, a:active { + color:#770; + text-decoration:underline; +} + +/* Tabelle auf den Referenzseiten */ +table { + font-size:1em; + border:1px solid #000000; + } +td,th { + vertical-align:top; + border: #eeeeee 1px solid; +} +th, .th{ + background-color:#efefef; + border: #eeeeee 1px solid; + padding:3px; + text-align:left; +} + +.tableheader{ + padding:3px; + text-align:left; +} + +/* funktioniert leider nur im neuesten Firefox fehlerfrei ;( +input:focus, textarea:focus, select:focus { + border: #FF0000 1px solid; + background-color:#ffff99; +} +*/ + +input[type~=text],input[type~=password] { + width : 200px; +} + +select { + width : 205px; +} + + +/* VTX */ +p.vtx{ + font-size:16px; + font-family:monospace; + white-space:nowrap; +} + +img.vtx{ + position:absolute; + z-index: 1; + width: 10px; + height: 19px; +} + +/* VTX Hyperlinks */ +a.vtx:link, a.vtx:visited, a.vtx:hover, a.vtx:active{ + text-decoration:none; + color:#00FF00; +} + +.footer { + font-size:0.6em; +} + +.timer_On { + color:green; +} + +.timer_Off{ + color:red; +} + +.menu{ + background-color:#efefef; + padding:10px; + text-align:left; +} + +.normal{ + color:#000064; + font-weight:normal; +} + +.refresh{ + color:#0000FF; + font-weight:normal; +} + +.deactive{ + color:#aaaaaa; +} + +.active{ + color:#00aa00; + font-weight:bold; +} + +.problem{ + color:#ff0000; +} + +.noproblem{ + color:#00AA00; +} + +.problemred{ + color:#ff0000; + font-weight:bold; +} + +.fastproblem{ + color:#990000; + font-weight:bold; +} + +.fastproblemgreen{ + font-weight:bold; +} + +.error{ + color:#ff0000; + font-weight:bold; +} + +.good{ + color:#009900; + font-weight:normal; +} + +.schema_normal{ + font-size:0.9em; + border:1px solid #666666; + border-right:0px; +} + +.schema_record_plan{ + font-size:0.9em; + font-weight:bold; + border:1px solid; + border-right:0px; +} + +.schema_record_now{ + font-size:0.9em; + font-weight:bold; + border:1px solid #006600; + border-right:0px; + background-color: #DDFFDD; +} + +.schema_record_conflict{ + font-size:0.9em; + font-weight:bold; + border:1px solid #006600; + border-right:0px; + background-color: #DDFFDD; +} + +.light{ + background-color: #F5F5F5; +} + +.dark{ + background-color: #EEEEEE; +} + + +#TOOLTIP { + position:absolute; + width: 400px; + top: 0px; + left: 0px; + z-index:5; + visibility:hidden; +} + +#ttwindow { + width: 400px; + font-size: 12px; + border:1px solid #666666; +} + +#ttwindow p.topic { + text-align: left; + font-weight: bold; + padding: 3px; + color: #000064; + background-color: #DDDDDD; + margin: 0px; +} + +#ttwindow p.description { + padding: 5px; + margin: 0px; + background-color: #ffffff; +} diff --git a/html/style/xtree.css b/html/style/xtree.css new file mode 100644 index 0000000..9764366 --- /dev/null +++ b/html/style/xtree.css @@ -0,0 +1,46 @@ +.webfx-tree-container { + margin: 0px; + padding: 0px; + font: icon; + white-space: nowrap; +} + +.webfx-tree-item { + padding: 0px; + margin: 0px; + font: icon; + color: WindowText; + white-space: nowrap; + height: 16px; +} + +.webfx-tree-item a, .webfx-tree-item a:active, .webfx-tree-item a:hover { + margin-left: 3px; + padding: 0px 2px 1px 2px; +} + +.webfx-tree-item a { + color: black; + text-decoration: none; +} + +.webfx-tree-item a:hover { + color: blue; + text-decoration: underline; +} + +.webfx-tree-item a:active { + background: highlight; + color: highlighttext; + text-decoration: none; +} + +.webfx-tree-item img { + vertical-align: middle; + border: 0px; +} + +.webfx-tree-icon { + width: 16px; + height: 16px; +} \ No newline at end of file diff --git a/html/tlist.tmpl b/html/tlist.tmpl new file mode 100644 index 0000000..ab5c825 --- /dev/null +++ b/html/tlist.tmpl @@ -0,0 +1,143 @@ + + + + + +

+ +

-

+ + + +[] + + +[] + +
+ + + +',document.TimerList)"> + [] + + + +', +'','tdelete',document.TimerList)"> + [] + +  + + : + + value=''> +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + bgcolor='#F5F5F5'> + + + + + + + + + + + + + + + + + + + + + + + + +
+ ">
[R]
+ + ">
[E]
+ + + : ','?cmd=tdelete&data=')" title="">
[D]
+ +
+ + + +  ">
[]
+ + + ">
(AT)

+ + ')">(!)
+ + [] + + + + +
+ ">
+
+ + +
+ + +
+ +
+ +
+ + + +
+ +
+ +
+[] +[] +[] + diff --git a/html/topten.tmpl b/html/topten.tmpl new file mode 100644 index 0000000..3d57a71 --- /dev/null +++ b/html/topten.tmpl @@ -0,0 +1,86 @@ + + + + +

+
+

+ + + + + +
+ + + + + + + + + + bgcolor='#F5F5F5'> + + + + + + + + + + + + + + + + + + + + + + + + + +
+ ' %?> + + + + + + + + 0 %?> +
+ + 0 %?> +
',' ') %?> + + +
+ + + + + +
diff --git a/html/tsearch.tmpl b/html/tsearch.tmpl new file mode 120000 index 0000000..d1d3655 --- /dev/null +++ b/html/tsearch.tmpl @@ -0,0 +1 @@ +tlist.tmpl \ No newline at end of file diff --git a/html/ulist.tmpl b/html/ulist.tmpl new file mode 100644 index 0000000..3081d7b --- /dev/null +++ b/html/ulist.tmpl @@ -0,0 +1,41 @@ + +

+ +[] +

+ + + + + + + + + + + + + + + bgcolor='#F5F5F5'> + + + + + + + + + + + + + +
+ " href="?cmd=uedit&data="> + []  + " + href="javascript:sure(document.UserList, ': ','?cmd=udelete&data=')"> + [] + +
diff --git a/html/vitals.tmpl b/html/vitals.tmpl new file mode 100644 index 0000000..7704065 --- /dev/null +++ b/html/vitals.tmpl @@ -0,0 +1,86 @@ + max; + max = utildata.nsort.last; + END; + IF userdata.nsort.last > max; + max = userdata.nsort.last; + END; + max = max + (max div 10) + 0.9 | format('%d'); + + # Data ... + d = [ + timestamps , + loaddata , + userdata , + utildata , + ]; + + USE my_graph = GD.Graph.lines(500,300); + + # Xsteps + steps = param.stack.size / 5 | format('%d'); + my_graph.set( + x_label_skip => steps, + x_long_ticks => 1, + + y_label => gettext('Average load'), + y_long_ticks => 1, + y_max_value => max, + + line_width => 2, + box_axis => 1, + boxclr => '#FFFFCC', + fgclr => '#BBBBBB' + legend_placement => 'RD', + legend_spacing => 5, + ); + my_graph.set_title_font(param.font,10); + my_graph.set_y_label_font(param.font,10); + my_graph.set_x_label_font(param.font,10); + my_graph.set_x_axis_font(param.font,6); + my_graph.set_y_axis_font(param.font,6); + my_graph.set_legend( 'Load (x10)', 'User', 'Util'); + statusfiles.load = writefile("status_${name}.gif", my_graph.plot(d).gif ); + END; + %?> + + +

+ + + + + + + + + + + +
+ +
+ +
+

+ diff --git a/html/widgets/checkbox.tmpl b/html/widgets/checkbox.tmpl new file mode 100644 index 0000000..631db79 --- /dev/null +++ b/html/widgets/checkbox.tmpl @@ -0,0 +1,17 @@ + + + + + + + + + + + " IF (c mod 3) == 0 %?> + + + +
>
+ + diff --git a/html/widgets/confirm.tmpl b/html/widgets/confirm.tmpl new file mode 100644 index 0000000..5bb046b --- /dev/null +++ b/html/widgets/confirm.tmpl @@ -0,0 +1,12 @@ + + + + + + + + + >  + > + + diff --git a/html/widgets/date.tmpl b/html/widgets/date.tmpl new file mode 100644 index 0000000..565d3f2 --- /dev/null +++ b/html/widgets/date.tmpl @@ -0,0 +1,32 @@ + + + + + + + + + >
+ + + onchange='ch_input(this.form.Weekday, this.form.)'> + + + diff --git a/html/widgets/dir.tmpl b/html/widgets/dir.tmpl new file mode 100644 index 0000000..fa41e1b --- /dev/null +++ b/html/widgets/dir.tmpl @@ -0,0 +1,20 @@ + + + + + + + + + onBlur="checkDir()">
+ + + + diff --git a/html/widgets/err.tmpl b/html/widgets/err.tmpl new file mode 100644 index 0000000..69f24a3 --- /dev/null +++ b/html/widgets/err.tmpl @@ -0,0 +1,2 @@ + +

') %?>


diff --git a/html/widgets/file.tmpl b/html/widgets/file.tmpl new file mode 100644 index 0000000..2c41fe4 --- /dev/null +++ b/html/widgets/file.tmpl @@ -0,0 +1,20 @@ + + + + + + + + + onBlur="checkFile()">
+ + + + diff --git a/html/widgets/footer.tmpl b/html/widgets/footer.tmpl new file mode 100644 index 0000000..ff0a5b6 --- /dev/null +++ b/html/widgets/footer.tmpl @@ -0,0 +1,60 @@ + + + +
+ +
+

Last Logs

+ + + + + +
+

+
+ +
+ +
+

Benchmark

+ + + 1000 %?> + + + + + + + + + + +
Summary:
+
+ +
+

Variables

+ +
+

+use Data::Dumper;
+print Dumper($stash->_dump_frame(5));
+        
+
+ +
+ +
+ + + +
+ + + + diff --git a/html/widgets/formEnd.tmpl b/html/widgets/formEnd.tmpl new file mode 100644 index 0000000..125126f --- /dev/null +++ b/html/widgets/formEnd.tmpl @@ -0,0 +1,11 @@ + +  + + +   +   + +   + + + diff --git a/html/widgets/formStart.tmpl b/html/widgets/formStart.tmpl new file mode 100644 index 0000000..8e5bb25 --- /dev/null +++ b/html/widgets/formStart.tmpl @@ -0,0 +1,10 @@ + + +

+ + + + '> + + + diff --git a/html/widgets/hidden.tmpl b/html/widgets/hidden.tmpl new file mode 100644 index 0000000..e641c54 --- /dev/null +++ b/html/widgets/hidden.tmpl @@ -0,0 +1,2 @@ + + diff --git a/html/widgets/host.tmpl b/html/widgets/host.tmpl new file mode 100644 index 0000000..cf90c8a --- /dev/null +++ b/html/widgets/host.tmpl @@ -0,0 +1,23 @@ + + + + + + diff --git a/html/widgets/integer.tmpl b/html/widgets/integer.tmpl new file mode 100644 index 0000000..bbde2c3 --- /dev/null +++ b/html/widgets/integer.tmpl @@ -0,0 +1,9 @@ + + + + + diff --git a/html/widgets/link.tmpl b/html/widgets/link.tmpl new file mode 100644 index 0000000..5ac989f --- /dev/null +++ b/html/widgets/link.tmpl @@ -0,0 +1,2 @@ + +[] diff --git a/html/widgets/list.tmpl b/html/widgets/list.tmpl new file mode 100644 index 0000000..452636b --- /dev/null +++ b/html/widgets/list.tmpl @@ -0,0 +1,38 @@ + + + + + + +
+
diff --git a/html/widgets/littlemenu.tmpl b/html/widgets/littlemenu.tmpl new file mode 100644 index 0000000..8ae191f --- /dev/null +++ b/html/widgets/littlemenu.tmpl @@ -0,0 +1,12 @@ + + + +

+ + + +" IF data.highlight == l.key %?> +[]  +" IF data.highlight == l.key %?> + +

diff --git a/html/widgets/menu.tmpl b/html/widgets/menu.tmpl new file mode 100644 index 0000000..41bfc5f --- /dev/null +++ b/html/widgets/menu.tmpl @@ -0,0 +1,21 @@ + + + +

 : 

+ + +
    + + + +
    • + +
+
    • + +
    • + + +
    +
  • +
diff --git a/html/widgets/message.tmpl b/html/widgets/message.tmpl new file mode 100644 index 0000000..aa52e9b --- /dev/null +++ b/html/widgets/message.tmpl @@ -0,0 +1,4 @@ + + +') %?>
+ diff --git a/html/widgets/password.tmpl b/html/widgets/password.tmpl new file mode 100644 index 0000000..2455ab1 --- /dev/null +++ b/html/widgets/password.tmpl @@ -0,0 +1,11 @@ + + + + + diff --git a/html/widgets/player.tmpl b/html/widgets/player.tmpl new file mode 100644 index 0000000..0a4db13 --- /dev/null +++ b/html/widgets/player.tmpl @@ -0,0 +1,20 @@ +
+ + + + + + + + + + + diff --git a/html/widgets/radio.tmpl b/html/widgets/radio.tmpl new file mode 100644 index 0000000..acd42f5 --- /dev/null +++ b/html/widgets/radio.tmpl @@ -0,0 +1,12 @@ + + + + + diff --git a/html/widgets/redirect.tmpl b/html/widgets/redirect.tmpl new file mode 100644 index 0000000..60f4e73 --- /dev/null +++ b/html/widgets/redirect.tmpl @@ -0,0 +1,4 @@ + + diff --git a/html/widgets/referer.tmpl b/html/widgets/referer.tmpl new file mode 100644 index 0000000..152158b --- /dev/null +++ b/html/widgets/referer.tmpl @@ -0,0 +1,8 @@ + + + &data='> + + '> + + + diff --git a/html/widgets/remote.tmpl b/html/widgets/remote.tmpl new file mode 100644 index 0000000..633537c --- /dev/null +++ b/html/widgets/remote.tmpl @@ -0,0 +1,134 @@ + + + + + + + + + + +
+
+ + + + + onBlur="checkHost()" + >
+ +
+ + + > +
+ + + + + + + + + + > + + + + + + + + + + + + + + + + + +
+ + + + >
+ title=''> +
+ + + + + >
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + "> + "> +
  
+ + + + +
  
">
  
+ "> + "> +
 
+ + "> +
+ + + diff --git a/html/widgets/start.tmpl b/html/widgets/start.tmpl new file mode 100644 index 0000000..909740c --- /dev/null +++ b/html/widgets/start.tmpl @@ -0,0 +1,29 @@ + + + + <?% IF param.title.defined;param.title;ELSE %?>XXV - <?% user %?><?% END %?> + + + + + + + + + + + + + + + + + + + + +
diff --git a/html/widgets/string.tmpl b/html/widgets/string.tmpl new file mode 100644 index 0000000..d531c32 --- /dev/null +++ b/html/widgets/string.tmpl @@ -0,0 +1,21 @@ + + + + + + + + + > + + + + 30) || param.type == 'text' %?> + + + > + + + + diff --git a/html/widgets/table.tmpl b/html/widgets/table.tmpl new file mode 100644 index 0000000..01d1303 --- /dev/null +++ b/html/widgets/table.tmpl @@ -0,0 +1,47 @@ +

+ + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameValue
+ + + + + + +
+ +
+

+ diff --git a/html/widgets/url.tmpl b/html/widgets/url.tmpl new file mode 100644 index 0000000..0b5b03b --- /dev/null +++ b/html/widgets/url.tmpl @@ -0,0 +1,16 @@ + + + + + + + + + >
+ + + diff --git a/html/widgets/vtx.tmpl b/html/widgets/vtx.tmpl new file mode 100644 index 0000000..9d3e2fd --- /dev/null +++ b/html/widgets/vtx.tmpl @@ -0,0 +1,45 @@ + + +

  +  1 && pages.last > 0 %?>/ +

+ +

+  1 && pages.last > 0 %?>/ +

+ + + + + + + + +
+ + + : +
+
+
+ + : +
+
+ " href="">[^][^]  + "href="">[<<][<<]  + "href="">[<][<]  + "href="">[>][>]  + "href="">[>>][>>] + + +
+ + + + + diff --git a/html/widgets/wait.tmpl b/html/widgets/wait.tmpl new file mode 100644 index 0000000..cc814c0 --- /dev/null +++ b/html/widgets/wait.tmpl @@ -0,0 +1,33 @@ + + + + XXV + + + + + + + + +
+

+ + + + + + + +
    % ()
+
+ + diff --git a/install-debian.sh b/install-debian.sh new file mode 100755 index 0000000..afd5c44 --- /dev/null +++ b/install-debian.sh @@ -0,0 +1,91 @@ +#!/bin/bash +# +# MiniInstall for xxv +# +# Usage: xxv + +XXVSOURCE=`pwd` + +lastchar() +{ + # return the last character of a string in $rval + if [ -z "$1" ]; then + # empty string + rval="" + return + fi + # wc puts some space behind the output this is why we need sed: + numofchar=`echo -n "$1" | wc -c | sed 's/ //g' ` + # now cut out the last char + rval=`echo -n "$1" | cut -b $numofchar` +} + +echo 'Install Manpage' +cp doc/xxvd.1 /usr/share/man/man1 + +echo 'Logrotate' +cp etc/logrotate.d/xxvd /etc/logrotate.d/xxvd + +if [ ! -e /usr/bin/vdr2jpeg ] ; then + echo 'install vdr2jpeg' + apt-get install vdr2jpeg +fi + +echo 'install PerlModules' +apt-get install libdbi-perl \ + libevent-perl \ + libgd-gd2-noxpm-perl \ + libgd-graph-perl \ + libgd-graph3d-perl \ + libgd-text-perl \ + libhtml-parser-perl \ + libhtml-tagset-perl \ + libhtml-template-perl \ + libhtml-tree-perl \ + liblocale-gettext-perl \ + libnet-telnet-perl \ + libterm-readkey-perl \ + liburi-perl \ + libwww-perl \ + liblog-log4perl-perl \ + libxml-simple-perl \ + libproc-process-perl \ + libio-zlib-perl \ + libnet-xmpp-perl \ + libterm-readline-gnu-perl \ + libxml-rss-perl \ + libsoap-lite-perl \ + libnet-amazon-perl \ + libjson-perl \ + libnet-telnet-perl + +echo 'start mysql server' +/etc/init.d/mysql start + +echo 'create Database' +cat contrib/create-database.sql | mysql -u root + +echo 'DB connectstring write in config' +echo '[General]' >> ~/.xxvd.cfg +echo 'DSN=DBI:mysql:database=xxv;host=localhost;port=3306' >> ~/.xxvd.cfg +echo 'PWD=xxv' >> ~/.xxvd.cfg +echo 'USR=xxv' >> ~/.xxvd.cfg + +echo 'create Startscript' +sed -e 's/FOLDER=\".+?\"/FOLDER=\"$XXVSOURCE\"/' etc/xxvd > /etc/init.d/xxvd +chmod 775 /etc/init.d/xxvd +RVV=`runlevel` +lastchar "$RVV" +ln -s /etc/init.d/xxvd "/etc/rc$rval.d/S90xxvd" + +echo 'Start XXV' +/etc/init.d/xxvd restart + +echo 'read the Logfile' +tail -f /var/log/xxvd.log + +echo 'Now you can call a browser to address:' +echo 'http://your_vdr:8080/' +echo 'have Fun' + + diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..16aa417 --- /dev/null +++ b/install.sh @@ -0,0 +1,463 @@ +#!/bin/sh +# +# Shell based installer of xxv +# +# use options like +# export PREFIX=/opt/xxv;./install.sh +# +# +# based on install.sh for vdradmin +# Copyright (c) 2003 Frank (xpix) Herrmann) +# Copyright (c) 2005 Andreas Mair +# Copyright (c) 2006 Andreas Brachold, Ronny Kornexl +# +################################################################################ +# ROOT should only used for testing, installing outside root folder +# please use PREFIX as destination for installing +ROOT=${ROOT:-""} + +################################################################################ +# use options like +# export PREFIX=/opt/xxv;./install.sh +# +PREFIX=${PREFIX:-$ROOT/usr/local} + +################################################################################ +# destination for installing +# +BINDIR=${BINDIR:-$PREFIX/bin} +LIBDIR=${LIBDIR:-$PREFIX/lib/xxv} +SHAREDIR=${SHAREDIR:-$PREFIX/share/xxv} +DOCDIR=${DOCDIR:-$PREFIX/share/xxv/doc} +CONTRIBDIR=${CONTRIBDIR:-$PREFIX/share/xxv/contrib} +LOCDIR=${LOCDIR:-$PREFIX/share/xxv/locale} +SKINDIR=${SKINDIR:-$PREFIX/share/xxv/skins} +MANDIR=${MANDIR:-$PREFIX/share/man/man1} + +################################################################################ +# some files +# +LOGDIR=${LOGDIR:-$ROOT/var/log} +PIDFILE=${PIDFILE:-$ROOT/var/run/xxvd.pid} +INITFILE=${INITFILE:-$ROOT/etc/init.d/xxvd} +ETCDIR=${ETCDIR:-$ROOT/etc/xxv} + +################################################################################ +# to adjust more options into xxvd.cfg +# +# e.g. : +# [CHANNELS] +# empty=y +# file=/etc/vdr/channels.conf +# [GRAB] +# file=/dev/shm/live.jpg +# +# use : +# export CHANNELS_empty=y \ +# CHANNELS_file=/etc/vdr/channels.conf \ +# GRAB_file=/dev/shm/live.jpg; \ +# ./install.sh +# +################################################################################ +# begin of scripting part ( below this line, aren't user options ) +# +LANGS="de" + + +PATH=$PATH:/sbin:/bin:/usr/sbin:/usr/bin + +function usage() +{ + echo "" + echo "usage: $(basename $0) [-h] [-p] [-u]" + echo "" + echo "Default action is install xxv." + echo -e "\t-h : This message." + echo -e "\t-p : check perl module." + echo -e "\t-u : uninstall xxv." + echo "" + exit 0 +} + +function killRunning() +{ + local KILLED=0 + ps a | grep xxvd | grep perl | grep -v grep | while read PID UNWANTED + do + KILLED=1 + kill $PID + done + + return $KILLED +} + +# $1 - the Perl module to check for. +function checkPerlModule() +{ + [ -z "$1" ] && return 1 + + local MODULE=$1 + local ALT_MODULE=$2 + local ALT_MESSAGE= + [ "$ALT_MODULE" ] && ALT_MESSAGE=" or $ALT_MODULE" + + echo -n "Checking for Perl module $MODULE$ALT_MESSAGE... " + perl -ce 'BEGIN{$0 =~ /(^.*\/)/; $BASENAME = $1; unshift(@INC, $BASENAME . "lib/");} use '$MODULE >/dev/null 2>&1 + if [ $? -eq 2 ]; then + if [ "$ALT_MODULE" ]; then + perl -ce 'BEGIN{$0 =~ /(^.*\/)/; $BASENAME = $1; unshift(@INC, $BASENAME . "lib/");} use '$ALT_MODULE >/dev/null 2>&1 + [ $? -eq 0 ] && echo " $ALT_MODULE found" && return 0 + fi + echo " MISSING" + read -p "Do you want to install $MODULE? (y)es/(f)orced/(N)ever : " + if [ "$REPLY" = "y" -o "$REPLY" = "Y" -o "$REPLY" = "yes" -o "$REPLY" = "j" ]; then + su -c "perl -MCPAN -e 'install '$MODULE" + elif [ "$REPLY" = "f" -o "$REPLY" = "F" -o "$REPLY" = "force" ]; then + su -c "perl -MCPAN -e 'force install '$MODULE" + fi + else + echo " found" + fi +} + +function perlModules() +{ + checkPerlModule Test::Simple +#-------------------- + checkPerlModule DBI + checkPerlModule DBD::mysql +#-------------------- + checkPerlModule Event + checkPerlModule MIME::Base64 + checkPerlModule Time::HiRes + checkPerlModule Locale::gettext + checkPerlModule Config::Tiny + checkPerlModule Net::Telnet +#-------------------- + checkPerlModule URI + checkPerlModule URI::file + checkPerlModule URI::URL + checkPerlModule Compress::Zlib + checkPerlModule HTML::Tagset + checkPerlModule HTML::Parser + checkPerlModule HTML::Form + checkPerlModule HTTP::Status + checkPerlModule HTTP::Daemon + checkPerlModule HTTP::Request + checkPerlModule LWP::UserAgent + checkPerlModule LWP + checkPerlModule WWW::Mechanize +#-------------------- + checkPerlModule Data::Random + checkPerlModule WWW::Mechanize::FormFiller +#-------------------- + checkPerlModule GD +#-------------------- + checkPerlModule Digest::SHA1 + checkPerlModule Digest::HMAC_MD5 + checkPerlModule Digest::MD5 + checkPerlModule Net::IP + checkPerlModule Net::DNS + checkPerlModule XML::Parser + checkPerlModule XML::RSS + checkPerlModule Math::BigInt::FastCalc + checkPerlModule JSON +#-------------------- + checkPerlModule Authen::SASL + checkPerlModule XML::Stream + checkPerlModule Net::XMPP +#-------------------- + checkPerlModule Proc::Killfam + checkPerlModule Proc::ProcessTable +#-------------------- + checkPerlModule Term::ReadLine::Gnu +#-------------------- + checkPerlModule Template +#-SHARE-------------- + checkPerlModule SOAP::Lite +#-MUSIC-------------- + checkPerlModule MP3::Icecast + checkPerlModule MP3::Info + checkPerlModule CGI + checkPerlModule LWP::Simple + checkPerlModule Net::Amazon + checkPerlModule Net::Amazon::Request::Artist +} + +function makeDir() +{ + [ -z "$1" ] && return 1 + local DIR=$1 + local MUST_CREATE=${2:-0} + if [ -e "$DIR" -a ! -d "$DIR" ]; then + echo "$DIR exists but is no directory!" + echo "Aborting..." + return 1 + elif [ -d $DIR -a $MUST_CREATE = 1 ]; then + echo "$DIR exists. Please remove it before calling install.sh!" + echo "Aborting..." + return 1 + fi + if [ ! -e "$DIR" ]; then + mkdir -p "$DIR" + if [ $? -ne 0 ]; then + echo "Failed to create directory $DIR!" + echo "Aborting..." + return 1 + fi + fi + + return 0 +} + +function doInstall() +{ + echo "" + echo "********* Installing xxv *************" + echo "" + + perlModules + + echo "" + echo "********* Copying files *************" + echo "" + + makeDir "$LIBDIR" 1 && cp -r lib/* "$LIBDIR" || exit 1 + makeDir "$SHAREDIR" 1 && cp -r share/* "$SHAREDIR" || exit 1 + makeDir "$DOCDIR" 1 && cp doc/CHANGELOG.txt doc/COPYING.txt doc/docu.tmpl doc/LIESMICH.txt doc/NEWS.txt doc/README.txt doc/TODO.txt doc/TUTORIAL.txt.gz "$DOCDIR" || exit 1 + makeDir "$CONTRIBDIR" 1 && cp -r contrib/* "$CONTRIBDIR" || exit 1 + makeDir "$SKINDIR" 1 && cp -r html wml "$SKINDIR" || exit 1 + (cd "$SKINDIR";ln -s html default) || exit 1 + makeDir "$MANDIR" && cp doc/xxvd.1 "$MANDIR" || exit 1 + makeDir "$BINDIR" || exit 1 + makeDir "$LOGDIR" || exit 1 + makeDir `dirname $PIDFILE` || exit 1 + makeDir "$ETCDIR" || exit 1 + makeDir `dirname $INITFILE` || exit 1 + + for lang in $LANGS + do + makeDir "$LOCDIR/$lang/LC_MESSAGES/" && install -m 644 "locale/$lang/LC_MESSAGES/xxv.mo" "$LOCDIR/$lang/LC_MESSAGES/xxv.mo" || exit 1 + done + + local RESTART= + [ ! -e "$BINDIR" ] && mkdir -p "$BINDIR" + if [ ! -d "$BINDIR" ]; then + echo "$BINDIR exists but is no directory!" + echo "Aborting..." + exit 1 + fi + + killRunning + if [ $? -ne 0 ] ; then + RESTART=1 + echo "Killed running xxv..." + fi + + echo "" + echo "********* Adjust Config *************" + echo "" + + echo "$BINDIR/xxvd" + + sed < "bin/xxvd" > "$BINDIR/xxvd" \ + -e "s:\$RealBin/../lib:${LIBDIR}:" \ + -e "s:/var/log/xxvd.log:${LOGDIR}/xxvd.log:" \ + -e "s:/var/run/xxvd.pid:${PIDFILE}:" \ + -e "s:\$RealBin/../locale:${LOCDIR}:" \ + -e "s:\$RealBin/../lib/XXV/MODULES:${LIBDIR}/XXV/MODULES:" \ + -e "s:\$RealBin/../lib/XXV/OUTPUT/NEWS:${LIBDIR}/XXV/OUTPUT/NEWS:" \ + -e "s:\$RealBin/../etc/xxvd.cfg:${ETCDIR}/xxvd.cfg:" \ + -e "s:\$RealBin/../doc:${DOCDIR}:" \ + -e "s:HTMLDIR => \"\$RealBin/../:HTMLDIR => \"${SKINDIR}:" \ + -e "s:\$RealBin/../share/fonts/ttf-bitstream-vera:${SHAREDIR}/fonts/ttf-bitstream-vera:" \ + -e "s:\$RealBin/../share/vtx:${SHAREDIR}/vtx:" \ + -e "s:\$RealBin/../share/news:${SHAREDIR}/news:" \ + -e "s:\$RealBin/../contrib:${CONTRIBDIR}:" + + [ ! -e "$INITFILE" -a "$INITFILE" != "false" ] && echo "$INITFILE" + + [ ! -e "$INITFILE" -a "$INITFILE" != "false" ] && sed < "etc/xxvd" > "$INITFILE" \ + -e "s:/root/XXV:${BINDIR}:" \ + -e "s:bin/xxvd:./xxvd:" \ + -e "s:\$FOLDER/lib/XXV/MODULES:${LIBDIR}/XXV/MODULES:" \ + -e "s:\$FOLDER/lib/XXV/OUTPUT/NEWS:${LIBDIR}/XXV/OUTPUT/NEWS:" \ + -e "s:\$FOLDER/etc/xxvd.cfg:${ETCDIR}/xxvd.cfg:" \ + -e "s:/var/run/xxvd.pid:${PIDFILE}:" \ + -e "s:HTMLDIR=\"\$FOLDER:HTMLDIR=\"${SKINDIR}:" \ + -e "s:\$FOLDER/doc:${DOCDIR}:" \ + -e "s:/var/log/xxvd.log:${LOGDIR}/xxvd.log:" \ + -e "s:\$FOLDER/contrib:${CONTRIBDIR}:" \ + -e "s:\$FOLDER/share/news:${SHAREDIR}/news:" + + echo "$ETCDIR/xxvd.cfg" + + [ ! -e "$ETCDIR/xxvd.cfg" ] && \ + while read i ; do + case $i in + [*) VAR=$(echo $i | tr a-z A-Z | tr -d :[]) + echo $i + ;; + *) case ${VAR}${i%%=*} in + GENERALDSN|GENERALUSR|GENERALPWD) + echo $i ; eval $i ; eval GENERAL_${i%%=*}=\${${i%%=*}##*=} ; continue + ;; + esac + eval VALUE=$(echo "\$${VAR}_${i}" | cut -d= -f1) + test -n "$VALUE" + case $? in + 0) echo "${i%%=*}=$VALUE" + ;; + *) echo $i + ;; + esac + ;; + esac + done < "etc/xxvd.cfg.example" > "$ETCDIR/xxvd.cfg" + + echo "" + echo "********* Create database *************" + echo "" + + mysql -u root -e " +use mysql; +CREATE DATABASE IF NOT EXISTS ${GENERAL_DSN}; +use ${GENERAL_DSN}; +grant all privileges on ${GENERAL_DSN}.* to ${GENERAL_USR}@localhost IDENTIFIED BY '${GENERAL_PWD}'; +flush privileges;" + + echo "" + echo "********* Check database *************" + echo "" + + "${CONTRIBDIR}/update-xxv" -d "${GENERAL_DSN}" + + echo "" + echo "********* Set permissions *************" + echo "" + + chmod a+x "$BINDIR/xxvd" + + if [ -e "$INITFILE" -a "$INITFILE" != "false" ]; then + + echo "" + echo "********* Set startscript *************" + echo "" + + chmod a+x "$INITFILE" + + RVV=`runlevel | cut -d " " -f 2` + makeDir "$ROOT/etc/rc$RVV.d" || exit 1 + ln -s "$INITFILE" "$ROOT/etc/rc$RVV.d/S90xxvd" + ln -s "$INITFILE" "$ROOT/etc/rc$RVV.d/K90xxvd" + + if [ "$RESTART" ]; then + echo "Restarting xxv..." + "$INITFILE" start + fi + fi + + echo "" + echo "" + echo "xxv has been installed!" + echo "" + if [ -z "$RESTART" ]; then + [ ! -e "$INITFILE" -a "$INITFILE" != "false" ] && \ + echo "*) run \"$INITFILE start\" to start xxv." + echo "*) open your browser with http://host:8080" + echo " login with xxv / xxv" + echo " and adjust all preferences for your system" + echo "*) and watch \"${LOGDIR}/xxvd.log\" for messages" + fi + exit 0 +} + +function doUninstall() +{ + echo "" + echo "********* Uninstalling xxv *************" + echo "" + + killRunning + if [ -d "$LIBDIR" ]; then + rm -rf "$LIBDIR" || echo "Can't remove $LIBDIR" + fi + if [ -d "$SHAREDIR" ]; then + rm -rf "$SHAREDIR" || echo "Can't remove $SHAREDIR" + fi + if [ -d "$DOCDIR" ]; then + rm -rf "$DOCDIR" || echo "Can't remove $DOCDIR" + fi + if [ -d "$CONTRIBDIR" ]; then + rm -rf "$CONTRIBDIR" || echo "Can't remove $CONTRIBDIR" + fi + if [ -d "$SKINDIR" ]; then + rm -rf "$SKINDIR" || echo "Can't remove $SKINDIR" + fi + if [ -e "$MANDIR/xxvd.1" ]; then + rm -f "$MANDIR/xxvd.1" || echo "Can't remove $MANDIR/xxvd.1" + fi + if [ -e "$BINDIR/xxvd" ]; then + rm -f "$BINDIR/xxvd" || echo "Can't remove $BINDIR/xxvd" + fi + if [ -e "$INITFILE" ]; then + rm -f "$INITFILE" || echo "Can't remove $INITFILE" + fi + + RVV=`runlevel | cut -d " " -f 2` + if [ -h "$ROOT/etc/rc$RVV.d/S90xxvd" ]; then + rm -f "$ROOT/etc/rc$RVV.d/S90xxvd" || echo "Can't remove $ROOT/etc/rc$RVV.d/S90xxvd" + fi + if [ -h "$ROOT/etc/rc$RVV.d/K90xxvd" ]; then + rm -f "$ROOT/etc/rc$RVV.d/K90xxvd" || echo "Can't remove $ROOT/etc/rc$RVV.d/K90xxvd" + fi + + if [ -e "$LOGDIR/xxvd.log" ]; then + rm -f "$LOGDIR/xxvd.log" || echo "Can't remove $LOGDIR/xxvd.log" + fi + if [ -e "$PIDFILE" ]; then + rm -f "$PIDFILE" || echo "Can't remove $PIDFILE" + fi + for lang in $LANGS + do + if [ -e "$LOCDIR/$lang/LC_MESSAGES/xxv.mo" ]; then + rm -f "$LOCDIR/$lang/LC_MESSAGES/xxv.mo" || echo "Can't remove $LOCDIR/$lang/LC_MESSAGES/xxv.mo" + fi + done + + echo "" + echo "xxv has been uninstalled!" + echo "" + if [ -d "$ETCDIR" ]; then + echo "Your configuration files located in $ETCDIR have NOT been deleted!" + echo "If you want to get rid of them, please delete them manually!" + echo "" + fi +} + +{ + +UNINSTALL= +PERL= +while [ "$1" ] +do + case $1 in + -u) UNINSTALL=1;; + -p) PERL=1;; + -h) usage;; + *) echo "Ignoring param \"$1\$.";; + esac + shift +done + +if [ $(basename $0) = "uninstall.sh" -o "$UNINSTALL" ]; then + doUninstall +elif [ "$PERL" ]; then + echo "" + echo "Only LISTING needed Perl modules..." + perlModules + echo "...done." +else + doInstall +fi +} # | tee -a install.log diff --git a/lib/Attribute/Handlers.pm b/lib/Attribute/Handlers.pm new file mode 100644 index 0000000..a26ed18 --- /dev/null +++ b/lib/Attribute/Handlers.pm @@ -0,0 +1,845 @@ +package Attribute::Handlers; +use 5.006; +use Carp; +use warnings; +$VERSION = '0.78'; +# $DB::single=1; + +my %symcache; +sub findsym { + my ($pkg, $ref, $type) = @_; + return $symcache{$pkg,$ref} if $symcache{$pkg,$ref}; + $type ||= ref($ref); + my $found; + foreach my $sym ( values %{$pkg."::"} ) { + return $symcache{$pkg,$ref} = \$sym + if *{$sym}{$type} && *{$sym}{$type} == $ref; + } +} + +my %validtype = ( + VAR => [qw[SCALAR ARRAY HASH]], + ANY => [qw[SCALAR ARRAY HASH CODE]], + "" => [qw[SCALAR ARRAY HASH CODE]], + SCALAR => [qw[SCALAR]], + ARRAY => [qw[ARRAY]], + HASH => [qw[HASH]], + CODE => [qw[CODE]], +); +my %lastattr; +my @declarations; +my %raw; +my %phase; +my %sigil = (SCALAR=>'$', ARRAY=>'@', HASH=>'%'); +my $global_phase = 0; +my %global_phases = ( + BEGIN => 0, + CHECK => 1, + INIT => 2, + END => 3, +); +my @global_phases = qw(BEGIN CHECK INIT END); + +sub _usage_AH_ { + croak "Usage: use $_[0] autotie => {AttrName => TieClassName,...}"; +} + +my $qual_id = qr/^[_a-z]\w*(::[_a-z]\w*)*$/i; + +sub import { + my $class = shift @_; + return unless $class eq "Attribute::Handlers"; + while (@_) { + my $cmd = shift; + if ($cmd =~ /^autotie((?:ref)?)$/) { + my $tiedata = ($1 ? '$ref, ' : '') . '@$data'; + my $mapping = shift; + _usage_AH_ $class unless ref($mapping) eq 'HASH'; + while (my($attr, $tieclass) = each %$mapping) { + $tieclass =~ s/^([_a-z]\w*(::[_a-z]\w*)*)(.*)/$1/is; + my $args = $3||'()'; + _usage_AH_ $class unless $attr =~ $qual_id + && $tieclass =~ $qual_id + && eval "use base $tieclass; 1"; + if ($tieclass->isa('Exporter')) { + local $Exporter::ExportLevel = 2; + $tieclass->import(eval $args); + } + $attr =~ s/__CALLER__/caller(1)/e; + $attr = caller()."::".$attr unless $attr =~ /::/; + eval qq{ + sub $attr : ATTR(VAR) { + my (\$ref, \$data) = \@_[2,4]; + my \$was_arrayref = ref \$data eq 'ARRAY'; + \$data = [ \$data ] unless \$was_arrayref; + my \$type = ref(\$ref)||"value (".(\$ref||"").")"; + (\$type eq 'SCALAR')? tie \$\$ref,'$tieclass',$tiedata + :(\$type eq 'ARRAY') ? tie \@\$ref,'$tieclass',$tiedata + :(\$type eq 'HASH') ? tie \%\$ref,'$tieclass',$tiedata + : die "Can't autotie a \$type\n" + } 1 + } or die "Internal error: $@"; + } + } + else { + croak "Can't understand $_"; + } + } +} +sub _resolve_lastattr { + return unless $lastattr{ref}; + my $sym = findsym @lastattr{'pkg','ref'} + or die "Internal error: $lastattr{pkg} symbol went missing"; + my $name = *{$sym}{NAME}; + warn "Declaration of $name attribute in package $lastattr{pkg} may clash with future reserved word\n" + if $^W and $name !~ /[A-Z]/; + foreach ( @{$validtype{$lastattr{type}}} ) { + *{"$lastattr{pkg}::_ATTR_${_}_${name}"} = $lastattr{ref}; + } + %lastattr = (); +} + +sub AUTOLOAD { + my ($class) = $AUTOLOAD =~ m/(.*)::/g; + $AUTOLOAD =~ m/_ATTR_(.*?)_(.*)/ or + croak "Can't locate class method '$AUTOLOAD' via package '$class'"; + croak "Attribute handler '$3' doesn't handle $2 attributes"; +} + +sub DESTROY {} + +my $builtin = qr/lvalue|method|locked|unique|shared/; + +sub _gen_handler_AH_() { + return sub { + _resolve_lastattr; + my ($pkg, $ref, @attrs) = @_; + foreach (@attrs) { + my ($attr, $data) = /^([a-z_]\w*)(?:[(](.*)[)])?$/is or next; + if ($attr eq 'ATTR') { + $data ||= "ANY"; + $raw{$ref} = $data =~ s/\s*,?\s*RAWDATA\s*,?\s*//; + $phase{$ref}{BEGIN} = 1 + if $data =~ s/\s*,?\s*(BEGIN)\s*,?\s*//; + $phase{$ref}{INIT} = 1 + if $data =~ s/\s*,?\s*(INIT)\s*,?\s*//; + $phase{$ref}{END} = 1 + if $data =~ s/\s*,?\s*(END)\s*,?\s*//; + $phase{$ref}{CHECK} = 1 + if $data =~ s/\s*,?\s*(CHECK)\s*,?\s*// + || ! keys %{$phase{$ref}}; + # Added for cleanup to not pollute next call. + (%lastattr = ()), + croak "Can't have two ATTR specifiers on one subroutine" + if keys %lastattr; + croak "Bad attribute type: ATTR($data)" + unless $validtype{$data}; + %lastattr=(pkg=>$pkg,ref=>$ref,type=>$data); + } + else { + my $handler = $pkg->can($attr); + next unless $handler; + my $decl = [$pkg, $ref, $attr, $data, + $raw{$handler}, $phase{$handler}]; + foreach my $gphase (@global_phases) { + _apply_handler_AH_($decl,$gphase) + if $global_phases{$gphase} <= $global_phase; + } + if ($global_phase != 0) { + # if _gen_handler_AH_ is being called after + # CHECK it's for a lexical, so make sure + # it didn't want to run anything later + + local $Carp::CarpLevel = 2; + carp "Won't be able to apply END handler" + if $phase{$handler}{END}; + } + else { + push @declarations, $decl + } + } + $_ = undef; + } + return grep {defined && !/$builtin/} @attrs; + } +} + +*{"MODIFY_${_}_ATTRIBUTES"} = _gen_handler_AH_ foreach @{$validtype{ANY}}; +push @UNIVERSAL::ISA, 'Attribute::Handlers' + unless grep /^Attribute::Handlers$/, @UNIVERSAL::ISA; + +sub _apply_handler_AH_ { + my ($declaration, $phase) = @_; + my ($pkg, $ref, $attr, $data, $raw, $handlerphase) = @$declaration; + return unless $handlerphase->{$phase}; + # print STDERR "Handling $attr on $ref in $phase with [$data]\n"; + my $type = ref $ref; + my $handler = "_ATTR_${type}_${attr}"; + my $sym = findsym($pkg, $ref); + $sym ||= $type eq 'CODE' ? 'ANON' : 'LEXICAL'; + no warnings; + my $evaled = !$raw && eval("package $pkg; no warnings; + local \$SIG{__WARN__}=sub{die}; [$data]"); + $data = ($evaled && $data =~ /^\s*\[/) ? [$evaled] + : ($evaled) ? $evaled + : [$data]; + $pkg->$handler($sym, + (ref $sym eq 'GLOB' ? *{$sym}{ref $ref}||$ref : $ref), + $attr, + (@$data>1? $data : $data->[0]), + $phase, + ); + return 1; +} + +{ + no warnings 'void'; + CHECK { + $global_phase++; + _resolve_lastattr; + _apply_handler_AH_($_,'CHECK') foreach @declarations; + } + + INIT { + $global_phase++; + _apply_handler_AH_($_,'INIT') foreach @declarations + } +} + +END { $global_phase++; _apply_handler_AH_($_,'END') foreach @declarations } + +1; +__END__ + +=head1 NAME + +Attribute::Handlers - Simpler definition of attribute handlers + +=head1 VERSION + +This document describes version 0.78 of Attribute::Handlers, +released October 5, 2002. + +=head1 SYNOPSIS + + package MyClass; + require v5.6.0; + use Attribute::Handlers; + no warnings 'redefine'; + + + sub Good : ATTR(SCALAR) { + my ($package, $symbol, $referent, $attr, $data) = @_; + + # Invoked for any scalar variable with a :Good attribute, + # provided the variable was declared in MyClass (or + # a derived class) or typed to MyClass. + + # Do whatever to $referent here (executed in CHECK phase). + ... + } + + sub Bad : ATTR(SCALAR) { + # Invoked for any scalar variable with a :Bad attribute, + # provided the variable was declared in MyClass (or + # a derived class) or typed to MyClass. + ... + } + + sub Good : ATTR(ARRAY) { + # Invoked for any array variable with a :Good attribute, + # provided the variable was declared in MyClass (or + # a derived class) or typed to MyClass. + ... + } + + sub Good : ATTR(HASH) { + # Invoked for any hash variable with a :Good attribute, + # provided the variable was declared in MyClass (or + # a derived class) or typed to MyClass. + ... + } + + sub Ugly : ATTR(CODE) { + # Invoked for any subroutine declared in MyClass (or a + # derived class) with an :Ugly attribute. + ... + } + + sub Omni : ATTR { + # Invoked for any scalar, array, hash, or subroutine + # with an :Omni attribute, provided the variable or + # subroutine was declared in MyClass (or a derived class) + # or the variable was typed to MyClass. + # Use ref($_[2]) to determine what kind of referent it was. + ... + } + + + use Attribute::Handlers autotie => { Cycle => Tie::Cycle }; + + my $next : Cycle(['A'..'Z']); + + +=head1 DESCRIPTION + +This module, when inherited by a package, allows that package's class to +define attribute handler subroutines for specific attributes. Variables +and subroutines subsequently defined in that package, or in packages +derived from that package may be given attributes with the same names as +the attribute handler subroutines, which will then be called in one of +the compilation phases (i.e. in a C, C, C, or C +block). + +To create a handler, define it as a subroutine with the same name as +the desired attribute, and declare the subroutine itself with the +attribute C<:ATTR>. For example: + + package LoudDecl; + use Attribute::Handlers; + + sub Loud :ATTR { + my ($package, $symbol, $referent, $attr, $data, $phase) = @_; + print STDERR + ref($referent), " ", + *{$symbol}{NAME}, " ", + "($referent) ", "was just declared ", + "and ascribed the ${attr} attribute ", + "with data ($data)\n", + "in phase $phase\n"; + } + +This creates a handler for the attribute C<:Loud> in the class LoudDecl. +Thereafter, any subroutine declared with a C<:Loud> attribute in the class +LoudDecl: + + package LoudDecl; + + sub foo: Loud {...} + +causes the above handler to be invoked, and passed: + +=over + +=item [0] + +the name of the package into which it was declared; + +=item [1] + +a reference to the symbol table entry (typeglob) containing the subroutine; + +=item [2] + +a reference to the subroutine; + +=item [3] + +the name of the attribute; + +=item [4] + +any data associated with that attribute; + +=item [5] + +the name of the phase in which the handler is being invoked. + +=back + +Likewise, declaring any variables with the C<:Loud> attribute within the +package: + + package LoudDecl; + + my $foo :Loud; + my @foo :Loud; + my %foo :Loud; + +will cause the handler to be called with a similar argument list (except, +of course, that C<$_[2]> will be a reference to the variable). + +The package name argument will typically be the name of the class into +which the subroutine was declared, but it may also be the name of a derived +class (since handlers are inherited). + +If a lexical variable is given an attribute, there is no symbol table to +which it belongs, so the symbol table argument (C<$_[1]>) is set to the +string C<'LEXICAL'> in that case. Likewise, ascribing an attribute to +an anonymous subroutine results in a symbol table argument of C<'ANON'>. + +The data argument passes in the value (if any) associated with the +attribute. For example, if C<&foo> had been declared: + + sub foo :Loud("turn it up to 11, man!") {...} + +then the string C<"turn it up to 11, man!"> would be passed as the +last argument. + +Attribute::Handlers makes strenuous efforts to convert +the data argument (C<$_[4]>) to a useable form before passing it to +the handler (but see L<"Non-interpretive attribute handlers">). +For example, all of these: + + sub foo :Loud(till=>ears=>are=>bleeding) {...} + sub foo :Loud(['till','ears','are','bleeding']) {...} + sub foo :Loud(qw/till ears are bleeding/) {...} + sub foo :Loud(qw/my, ears, are, bleeding/) {...} + sub foo :Loud(till,ears,are,bleeding) {...} + +causes it to pass C<['till','ears','are','bleeding']> as the handler's +data argument. However, if the data can't be parsed as valid Perl, then +it is passed as an uninterpreted string. For example: + + sub foo :Loud(my,ears,are,bleeding) {...} + sub foo :Loud(qw/my ears are bleeding) {...} + +cause the strings C<'my,ears,are,bleeding'> and C<'qw/my ears are bleeding'> +respectively to be passed as the data argument. + +If the attribute has only a single associated scalar data value, that value is +passed as a scalar. If multiple values are associated, they are passed as an +array reference. If no value is associated with the attribute, C is +passed. + + +=head2 Typed lexicals + +Regardless of the package in which it is declared, if a lexical variable is +ascribed an attribute, the handler that is invoked is the one belonging to +the package to which it is typed. For example, the following declarations: + + package OtherClass; + + my LoudDecl $loudobj : Loud; + my LoudDecl @loudobjs : Loud; + my LoudDecl %loudobjex : Loud; + +causes the LoudDecl::Loud handler to be invoked (even if OtherClass also +defines a handler for C<:Loud> attributes). + + +=head2 Type-specific attribute handlers + +If an attribute handler is declared and the C<:ATTR> specifier is +given the name of a built-in type (C, C, C, or C), +the handler is only applied to declarations of that type. For example, +the following definition: + + package LoudDecl; + + sub RealLoud :ATTR(SCALAR) { print "Yeeeeow!" } + +creates an attribute handler that applies only to scalars: + + + package Painful; + use base LoudDecl; + + my $metal : RealLoud; # invokes &LoudDecl::RealLoud + my @metal : RealLoud; # error: unknown attribute + my %metal : RealLoud; # error: unknown attribute + sub metal : RealLoud {...} # error: unknown attribute + +You can, of course, declare separate handlers for these types as well +(but you'll need to specify C to do it quietly): + + package LoudDecl; + use Attribute::Handlers; + no warnings 'redefine'; + + sub RealLoud :ATTR(SCALAR) { print "Yeeeeow!" } + sub RealLoud :ATTR(ARRAY) { print "Urrrrrrrrrr!" } + sub RealLoud :ATTR(HASH) { print "Arrrrrgggghhhhhh!" } + sub RealLoud :ATTR(CODE) { croak "Real loud sub torpedoed" } + +You can also explicitly indicate that a single handler is meant to be +used for all types of referents like so: + + package LoudDecl; + use Attribute::Handlers; + + sub SeriousLoud :ATTR(ANY) { warn "Hearing loss imminent" } + +(I.e. C is a synonym for C<:ATTR>). + + +=head2 Non-interpretive attribute handlers + +Occasionally the strenuous efforts Attribute::Handlers makes to convert +the data argument (C<$_[4]>) to a useable form before passing it to +the handler get in the way. + +You can turn off that eagerness-to-help by declaring +an attribute handler with the keyword C. For example: + + sub Raw : ATTR(RAWDATA) {...} + sub Nekkid : ATTR(SCALAR,RAWDATA) {...} + sub Au::Naturale : ATTR(RAWDATA,ANY) {...} + +Then the handler makes absolutely no attempt to interpret the data it +receives and simply passes it as a string: + + my $power : Raw(1..100); # handlers receives "1..100" + +=head2 Phase-specific attribute handlers + +By default, attribute handlers are called at the end of the compilation +phase (in a C block). This seems to be optimal in most cases because +most things that can be defined are defined by that point but nothing has +been executed. + +However, it is possible to set up attribute handlers that are called at +other points in the program's compilation or execution, by explicitly +stating the phase (or phases) in which you wish the attribute handler to +be called. For example: + + sub Early :ATTR(SCALAR,BEGIN) {...} + sub Normal :ATTR(SCALAR,CHECK) {...} + sub Late :ATTR(SCALAR,INIT) {...} + sub Final :ATTR(SCALAR,END) {...} + sub Bookends :ATTR(SCALAR,BEGIN,END) {...} + +As the last example indicates, a handler may be set up to be (re)called in +two or more phases. The phase name is passed as the handler's final argument. + +Note that attribute handlers that are scheduled for the C phase +are handled as soon as the attribute is detected (i.e. before any +subsequently defined C blocks are executed). + + +=head2 Attributes as C interfaces + +Attributes make an excellent and intuitive interface through which to tie +variables. For example: + + use Attribute::Handlers; + use Tie::Cycle; + + sub UNIVERSAL::Cycle : ATTR(SCALAR) { + my ($package, $symbol, $referent, $attr, $data, $phase) = @_; + $data = [ $data ] unless ref $data eq 'ARRAY'; + tie $$referent, 'Tie::Cycle', $data; + } + + # and thereafter... + + package main; + + my $next : Cycle('A'..'Z'); # $next is now a tied variable + + while (<>) { + print $next; + } + +Note that, because the C attribute receives its arguments in the +C<$data> variable, if the attribute is given a list of arguments, C<$data> +will consist of a single array reference; otherwise, it will consist of the +single argument directly. Since Tie::Cycle requires its cycling values to +be passed as an array reference, this means that we need to wrap +non-array-reference arguments in an array constructor: + + $data = [ $data ] unless ref $data eq 'ARRAY'; + +Typically, however, things are the other way around: the tieable class expects +its arguments as a flattened list, so the attribute looks like: + + sub UNIVERSAL::Cycle : ATTR(SCALAR) { + my ($package, $symbol, $referent, $attr, $data, $phase) = @_; + my @data = ref $data eq 'ARRAY' ? @$data : $data; + tie $$referent, 'Tie::Whatever', @data; + } + + +This software pattern is so widely applicable that Attribute::Handlers +provides a way to automate it: specifying C<'autotie'> in the +C statement. So, the cycling example, +could also be written: + + use Attribute::Handlers autotie => { Cycle => 'Tie::Cycle' }; + + # and thereafter... + + package main; + + my $next : Cycle(['A'..'Z']); # $next is now a tied variable + + while (<>) { + print $next; + +Note that we now have to pass the cycling values as an array reference, +since the C mechanism passes C a list of arguments as a list +(as in the Tie::Whatever example), I as an array reference (as in +the original Tie::Cycle example at the start of this section). + +The argument after C<'autotie'> is a reference to a hash in which each key is +the name of an attribute to be created, and each value is the class to which +variables ascribed that attribute should be tied. + +Note that there is no longer any need to import the Tie::Cycle module -- +Attribute::Handlers takes care of that automagically. You can even pass +arguments to the module's C subroutine, by appending them to the +class name. For example: + + use Attribute::Handlers + autotie => { Dir => 'Tie::Dir qw(DIR_UNLINK)' }; + +If the attribute name is unqualified, the attribute is installed in the +current package. Otherwise it is installed in the qualifier's package: + + package Here; + + use Attribute::Handlers autotie => { + Other::Good => Tie::SecureHash, # tie attr installed in Other:: + Bad => Tie::Taxes, # tie attr installed in Here:: + UNIVERSAL::Ugly => Software::Patent # tie attr installed everywhere + }; + +Autoties are most commonly used in the module to which they actually tie, +and need to export their attributes to any module that calls them. To +facilitiate this, Attribute::Handlers recognizes a special "pseudo-class" -- +C<__CALLER__>, which may be specified as the qualifier of an attribute: + + package Tie::Me::Kangaroo:Down::Sport; + + use Attribute::Handlers autotie => { '__CALLER__::Roo' => __PACKAGE__ }; + +This causes Attribute::Handlers to define the C attribute in the package +that imports the Tie::Me::Kangaroo:Down::Sport module. + +Note that it is important to quote the __CALLER__::Roo identifier because +a bug in perl 5.8 will refuse to parse it and cause an unknown error. + +=head3 Passing the tied object to C + +Occasionally it is important to pass a reference to the object being tied +to the TIESCALAR, TIEHASH, etc. that ties it. + +The C mechanism supports this too. The following code: + + use Attribute::Handlers autotieref => { Selfish => Tie::Selfish }; + my $var : Selfish(@args); + +has the same effect as: + + tie my $var, 'Tie::Selfish', @args; + +But when C<"autotieref"> is used instead of C<"autotie">: + + use Attribute::Handlers autotieref => { Selfish => Tie::Selfish }; + my $var : Selfish(@args); + +the effect is to pass the C call an extra reference to the variable +being tied: + + tie my $var, 'Tie::Selfish', \$var, @args; + + + +=head1 EXAMPLES + +If the class shown in L were placed in the MyClass.pm +module, then the following code: + + package main; + use MyClass; + + my MyClass $slr :Good :Bad(1**1-1) :Omni(-vorous); + + package SomeOtherClass; + use base MyClass; + + sub tent { 'acle' } + + sub fn :Ugly(sister) :Omni('po',tent()) {...} + my @arr :Good :Omni(s/cie/nt/); + my %hsh :Good(q/bye) :Omni(q/bus/); + + +would cause the following handlers to be invoked: + + # my MyClass $slr :Good :Bad(1**1-1) :Omni(-vorous); + + MyClass::Good:ATTR(SCALAR)( 'MyClass', # class + 'LEXICAL', # no typeglob + \$slr, # referent + 'Good', # attr name + undef # no attr data + 'CHECK', # compiler phase + ); + + MyClass::Bad:ATTR(SCALAR)( 'MyClass', # class + 'LEXICAL', # no typeglob + \$slr, # referent + 'Bad', # attr name + 0 # eval'd attr data + 'CHECK', # compiler phase + ); + + MyClass::Omni:ATTR(SCALAR)( 'MyClass', # class + 'LEXICAL', # no typeglob + \$slr, # referent + 'Omni', # attr name + '-vorous' # eval'd attr data + 'CHECK', # compiler phase + ); + + + # sub fn :Ugly(sister) :Omni('po',tent()) {...} + + MyClass::UGLY:ATTR(CODE)( 'SomeOtherClass', # class + \*SomeOtherClass::fn, # typeglob + \&SomeOtherClass::fn, # referent + 'Ugly', # attr name + 'sister' # eval'd attr data + 'CHECK', # compiler phase + ); + + MyClass::Omni:ATTR(CODE)( 'SomeOtherClass', # class + \*SomeOtherClass::fn, # typeglob + \&SomeOtherClass::fn, # referent + 'Omni', # attr name + ['po','acle'] # eval'd attr data + 'CHECK', # compiler phase + ); + + + # my @arr :Good :Omni(s/cie/nt/); + + MyClass::Good:ATTR(ARRAY)( 'SomeOtherClass', # class + 'LEXICAL', # no typeglob + \@arr, # referent + 'Good', # attr name + undef # no attr data + 'CHECK', # compiler phase + ); + + MyClass::Omni:ATTR(ARRAY)( 'SomeOtherClass', # class + 'LEXICAL', # no typeglob + \@arr, # referent + 'Omni', # attr name + "" # eval'd attr data + 'CHECK', # compiler phase + ); + + + # my %hsh :Good(q/bye) :Omni(q/bus/); + + MyClass::Good:ATTR(HASH)( 'SomeOtherClass', # class + 'LEXICAL', # no typeglob + \%hsh, # referent + 'Good', # attr name + 'q/bye' # raw attr data + 'CHECK', # compiler phase + ); + + MyClass::Omni:ATTR(HASH)( 'SomeOtherClass', # class + 'LEXICAL', # no typeglob + \%hsh, # referent + 'Omni', # attr name + 'bus' # eval'd attr data + 'CHECK', # compiler phase + ); + + +Installing handlers into UNIVERSAL, makes them...err..universal. +For example: + + package Descriptions; + use Attribute::Handlers; + + my %name; + sub name { return $name{$_[2]}||*{$_[1]}{NAME} } + + sub UNIVERSAL::Name :ATTR { + $name{$_[2]} = $_[4]; + } + + sub UNIVERSAL::Purpose :ATTR { + print STDERR "Purpose of ", &name, " is $_[4]\n"; + } + + sub UNIVERSAL::Unit :ATTR { + print STDERR &name, " measured in $_[4]\n"; + } + +Let's you write: + + use Descriptions; + + my $capacity : Name(capacity) + : Purpose(to store max storage capacity for files) + : Unit(Gb); + + + package Other; + + sub foo : Purpose(to foo all data before barring it) { } + + # etc. + + +=head1 DIAGNOSTICS + +=over + +=item C + +An attribute handler was specified with an C<:ATTR(I)>, but the +type of referent it was defined to handle wasn't one of the five permitted: +C, C, C, C, or C. + +=item C + +A handler for attributes of the specified name I defined, but not +for the specified type of declaration. Typically encountered whe trying +to apply a C attribute handler to a subroutine, or a C +attribute handler to some other type of variable. + +=item C + +A handler for an attributes with an all-lowercase name was declared. An +attribute with an all-lowercase name might have a meaning to Perl +itself some day, even though most don't yet. Use a mixed-case attribute +name, instead. + +=item C + +You just can't, okay? +Instead, put all the specifications together with commas between them +in a single C)>. + +=item C + +You can only declare autoties for types C<"SCALAR">, C<"ARRAY">, and +C<"HASH">. They're the only things (apart from typeglobs -- which are +not declarable) that Perl can tie. + +=item C + +Something is rotten in the state of the program. An attributed +subroutine ceased to exist between the point it was declared and the point +at which its attribute handler(s) would have been called. + +=item C + +You have defined an END handler for an attribute that is being applied +to a lexical variable. Since the variable may not be available during END +this won't happen. + +=back + +=head1 AUTHOR + +Damian Conway (damian@conway.org) + +=head1 BUGS + +There are undoubtedly serious bugs lurking somewhere in code this funky :-) +Bug reports and other feedback are most welcome. + +=head1 COPYRIGHT + + Copyright (c) 2001, Damian Conway. All Rights Reserved. + This module is free software. It may be used, redistributed + and/or modified under the same terms as Perl itself. diff --git a/lib/Benchmark/Timer.pm b/lib/Benchmark/Timer.pm new file mode 100755 index 0000000..624289b --- /dev/null +++ b/lib/Benchmark/Timer.pm @@ -0,0 +1,618 @@ +# ======================================================================== +# Benchmark::Timer - Perl code benchmarking tool +# David Coppit +# +# This program contains embedded documentation in Perl POD (Plain Old +# Documentation) format. Search for the string "=head1" in this document +# to find documentation snippets, or use "perldoc" to read it; utilities +# like "pod2man" and "pod2html" can reformat as well. +# +# Copyright(c) 2004 David Coppit +# Copyright(c) 2000-2001 Andrew Ho. +# +# ======================================================================== + +=head1 NAME + +Benchmark::Timer - Benchmarking with statistical confidence + +=head1 SYNOPSIS + + # Non-statistical usage + use Benchmark::Timer; + $t = Benchmark::Timer->new(skip => 1); + + for(1 .. 1000) { + $t->start('tag'); + &long_running_operation(); + $t->stop('tag'); + } + print $t->report; + + # -------------------------------------------------------------------- + + # Statistical usage + use Benchmark::Timer; + $t = Benchmark::Timer->new(skip => 1, confidence => 97.5, error => 2); + + while($t->need_more_samples('tag')) { + $t->start('tag'); + &long_running_operation(); + $t->stop('tag'); + } + print $t->report; + +=head1 DESCRIPTION + +The Benchmark::Timer class allows you to time portions of code +conveniently, as well as benchmark code by allowing timings of repeated +trials. It is perfect for when you need more precise information about the +running time of portions of your code than the Benchmark module will give +you, but don't want to go all out and profile your code. + +The methodology is simple; create a Benchmark::Timer object, and wrap portions +of code that you want to benchmark with C and C method calls. +You can supply a tag to those methods if you plan to time multiple portions of +code. If you provide error and confidence values, you can also use +C to determine, statistically, whether you need to +collect more data. + +After you have run your code, you can obtain information about the running +time by calling the C method, or get a descriptive benchmark report +by calling C. If you run your code over multiple trials, the +average time is reported. This is wonderful for benchmarking time-critical +portions of code in a rigorous way. You can also optionally choose to skip any +number of initial trials to cut down on initial case irregularities. + +=head1 METHODS + +In all of the following methods, C<$tag> refers to the user-supplied name of +the code being timed. Unless otherwise specified, $tag defaults to the tag of +the last call to C, or "_default" if C was not previously +called with a tag. + +=over 4 + +=cut + + +# ------------------------------------------------------------------------ +# Package setup + +package Benchmark::Timer; +require 5.005; +use strict; + +use Carp; +use Time::HiRes qw( gettimeofday tv_interval ); + +use vars qw($VERSION); +$VERSION = sprintf "%d.%02d%02d", q/0.71.0/ =~ /(\d+)/g; + +use constant BEFORE => 0; +use constant ELAPSED => 1; +use constant LASTTAG => 2; +use constant TAGS => 3; +use constant SKIP => 4; +use constant MINIMUM => 5; +use constant SKIPCOUNT => 6; +use constant CONFIDENCE => 7; +use constant ERROR => 8; +use constant STAT => 9; + +# ------------------------------------------------------------------------ +# Constructor + +=item $t = Benchmark::Timer->new( [options] ); + +Constructor for the Benchmark::Timer object; returns a reference to a +timer object. Takes the following named arguments: + +=over 4 + +=item skip + +The number of trials (if any) to skip before recording timing information. + +=item minimum + +The minimum number of trials to run. + +=item error + +A percentage between 0 and 100 which indicates how much error you are willing +to tolerate in the average time measured by the benchmark. For example, a +value of 1 means that you want the reported average time to be within 1% of +the real average time. C will use this value to determine +when it is okay to stop collecting data. + +If you specify an error you must also specify a confidence. + +=item confidence + +A percentage between 0 and 100 which indicates how confident you want to be in +the error measured by the benchmark. For example, a value of 97.5 means that +you want to be 97.5% confident that the real average time is within the error +margin you have specified. C will use this value to +compute the estimated error for the collected data, so that it can determine +when it is okay to stop. + +If you specify a confidence you must also specify an error. + +=back + +=cut + +sub new { + my $class = shift; + my $self = []; + bless $self, $class; + return $self->reset(@_); +} + + +# ------------------------------------------------------------------------ +# Public methods + +=item $t->reset; + +Reset the timer object to the pristine state it started in. +Erase all memory of tags and any previously accumulated timings. +Returns a reference to the timer object. It takes the same arguments +the constructor takes. + +=cut + +sub reset { + my $self = shift; + my %args = @_; + + $self->[BEFORE] = {}; # [ gettimeofday ] storage + $self->[ELAPSED] = {}; # elapsed fractional seconds + $self->[LASTTAG] = undef; # what the last tag was + $self->[TAGS] = []; # keep list of tags in order seen + $self->[SKIP] = 0; # how many samples to skip + $self->[MINIMUM] = 1; # the minimum number of trails to run + $self->[SKIPCOUNT] = {}; # trial skip storage + delete $self->[CONFIDENCE]; # confidence factor + delete $self->[ERROR]; # allowable error + delete $self->[STAT]; # stat objects for each tag + + if(exists $args{skip}) { + croak 'argument skip must be a non-negative integer' + unless defined $args{skip} + and $args{skip} !~ /\D/ + and int $args{skip} == $args{skip}; + $self->[SKIP] = $args{skip}; + delete $args{skip}; + } + + if(exists $args{minimum}) { + croak 'argument minimum must be a non-negative integer' + unless defined $args{minimum} + and $args{minimum} !~ /\D/ + and int $args{minimum} == $args{minimum}; + croak 'argument minimum must greater than or equal to skip' + unless defined $args{minimum} + and $args{minimum} >= $self->[SKIP]; + $self->[MINIMUM] = $args{minimum}; + delete $args{minimum}; + } + + my $confidence_is_valid = + (defined $args{confidence} + and $args{confidence} =~ /^\d*\.?\d*$/ + and $args{confidence} > 0 + and $args{confidence} < 100); + + my $error_is_valid = + (defined $args{error} + and $args{error} =~ /^\d*\.?\d*$/ + and $args{error} > 0 + and $args{error} < 100); + + if ($confidence_is_valid && !$error_is_valid || + !$confidence_is_valid && $error_is_valid) + { + carp 'you must specify both confidence and error' + } + elsif ($confidence_is_valid && $error_is_valid) + { + $self->[CONFIDENCE] = $args{confidence}; + delete $args{confidence}; + + $self->[ERROR] = $args{error}; + delete $args{error}; + + # Demand load the module we need. We could just + # require people to install it... + croak 'Could not load the Statistics::PointEstimation module' + unless eval "require Statistics::PointEstimation"; + } + + if(%args) { + carp 'skipping unknown arguments'; + } + + return $self; +} + + +=item $t->start($tag); + +Record the current time so that when C is called, we can calculate an +elapsed time. + +=cut + +# In this routine we try hard to make the [ gettimeofday ] take place +# as late as possible to minimize Heisenberg problems. :) + +sub start { + my $self = shift; + my $tag = shift || $self->[LASTTAG] || '_default'; + $self->[LASTTAG] = $tag; + if(exists $self->[SKIPCOUNT]->{$tag}) { + if($self->[SKIPCOUNT]->{$tag} > 1) { + $self->[SKIPCOUNT]->{$tag}--; + } else { + $self->[SKIPCOUNT]->{$tag} = 0; + push @{$self->[BEFORE]->{$tag}}, [ gettimeofday ]; + } + } else { + push @{$self->[TAGS]}, $tag; + $self->[SKIPCOUNT]->{$tag} = $self->[SKIP] + 1; + if($self->[SKIPCOUNT]->{$tag} > 1) { + $self->[SKIPCOUNT]->{$tag}--; + } else { + $self->[SKIPCOUNT]->{$tag} = 0; + $self->[BEFORE]->{$tag} = [ [ gettimeofday ] ] + } + } +} + + +=item $t->stop($tag); + +Record timing information. If $tag is supplied, it must correspond to one +given to a previously called C call. It returns the elapsed time in +milliseconds. C croaks if the timer gets out of sync (e.g. the number +of Cs does not match the number of Cs.) + +=cut + +sub stop { + my $after = [ gettimeofday ]; # minimize overhead + my $self = shift; + my $tag = shift || $self->[LASTTAG] || '_default'; + + croak 'must call $t->start($tag) before $t->stop($tag)' + unless exists $self->[SKIPCOUNT]->{$tag}; + + return if $self->[SKIPCOUNT]->{$tag} > 0; + + my $i = exists $self->[ELAPSED]->{$tag} ? + scalar @{$self->[ELAPSED]->{$tag}} : 0; + my $before = $self->[BEFORE]->{$tag}->[$i]; + croak 'timer out of sync' unless defined $before; + + # Create a stats object if we need to + if (defined $self->[CONFIDENCE] && !defined $self->[STAT]->{$tag}) + { + $self->[STAT]->{$tag} = Statistics::PointEstimation->new; + $self->[STAT]->{$tag}->set_significance($self->[CONFIDENCE]); + } + + my $elapsed = tv_interval($before, $after); + + if($i > 0) { + push @{$self->[ELAPSED]->{$tag}}, $elapsed; + } else { + $self->[ELAPSED]->{$tag} = [ $elapsed ]; + } + + $self->[STAT]->{$tag}->add_data($elapsed) + if defined $self->[STAT]->{$tag}; + + return $elapsed; +} + + +=item $t->need_more_samples($tag); + +Compute the estimated error in the average of the data collected thus far, and +return true if that error exceeds the user-specified error. If a $tag is +supplied, it must correspond to one given to a previously called C +call. + +This routine assumes that the data are normally distributed. + +=cut + +sub need_more_samples { + my $self = shift; + my $tag = shift || $self->[LASTTAG] || '_default'; + + carp 'You must set the confidence and error in order to use need_more_samples' + unless defined $self->[CONFIDENCE]; + + # In case this function is called before any trials are run + return 1 + if !defined $self->[STAT]->{$tag} || + $self->[STAT]->{$tag}->count < $self->[MINIMUM]; + + # For debugging +# printf STDERR "Average: %.5f +/- %.5f, Samples: %d\n", +# $self->[STAT]->{$tag}->mean(), $self->[STAT]->{$tag}->delta(), +# $self->[STAT]->{$tag}->count; +# printf STDERR "Percent Error: %.5f > %.5f\n", +# $self->[STAT]->{$tag}->delta() / $self->[STAT]->{$tag}->mean() * 100, +# $self->[ERROR]; + + return (($self->[STAT]->{$tag}->delta() / $self->[STAT]->{$tag}->mean() * 100) > + $self->[ERROR]); +} + + +=item $t->report($tag); + +Returns a string containing a simple report on the collected timings for $tag. +This report contains the number of trials run, the total time taken, and, if +more than one trial was run, the average time needed to run one trial and +error information. C will complain (via a warning) if a tag is +still active. + +=cut + +sub report { + my $self = shift; + my $tag = shift || $self->[LASTTAG] || '_default'; + + unless(exists $self->[ELAPSED]->{$tag}) { + carp join ' ', 'tag', $tag, 'still running'; + return; + } + + return $self->_report($tag); +} + + +=item $t->reports; + +In a scalar context, returns a string containing a simple report on the +collected timings for all tags. The report is a concatenation of the +individual tag reports, in the original tag order. In an list context, returns +a hash keyed by tag and containing reports for each tag. The return value is +actually an array, so that the original tag order is preserved if you assign +to an array instead of a hash. C will complain (via a warning) if a +tag is still active. + + +=cut + +sub reports { + my $self = shift; + + if (wantarray) + { + my @reports; + + foreach my $tag (@{$self->[TAGS]}) { + push @reports, $tag; + push @reports, $self->report($tag); + } + + return @reports; + } + else + { + my $report = ''; + + foreach my $tag (@{$self->[TAGS]}) { + $report .= $self->report($tag); + } + + return $report; + } +} + + +sub _report { + my $self = shift; + my $tag = shift; + + unless(exists $self->[ELAPSED]->{$tag}) { + return "Tag $tag is still running or has not completed its skipped runs, skipping\n"; + } + + my $report = ''; + + my @times = @{$self->[ELAPSED]->{$tag}}; + my $n = scalar @times; + my $total = 0; $total += $_ foreach @times; + + if ($n == 1) + { + $report .= sprintf "\%d trial of \%s (\%s total)\n", + $n, $tag, timestr($total); + } + else + { + $report .= sprintf "\%d trials of \%s (\%s total), \%s/trial\n", + $n, $tag, timestr($total), timestr($total / $n); + } + + if (defined $self->[STAT]->{$tag}) + { + my $delta = 0; + $delta = $self->[STAT]->{$tag}->delta() + if defined $self->[STAT]->{$tag}->delta(); + + $report .= sprintf "Error: +/- \%.5f with \%s confidence\n", + $delta, $self->[CONFIDENCE]; + } + + return $report; +} + + +=item $t->result($tag); + +Return the time it took for $tag to elapse, or the mean time it took for $tag +to elapse once, if $tag was used to time code more than once. C will +complain (via a warning) if a tag is still active. + +=cut + +sub result { + my $self = shift; + my $tag = shift || $self->[LASTTAG] || '_default'; + unless(exists $self->[ELAPSED]->{$tag}) { + carp join ' ', 'tag', $tag, 'still running'; + return; + } + my @times = @{$self->[ELAPSED]->{$tag}}; + my $total = 0; $total += $_ foreach @times; + return $total / @times; +} + + +=item $t->results; + +Returns the timing data as a hash keyed on tags where each value is +the time it took to run that code, or the average time it took, +if that code ran more than once. In scalar context it returns a reference +to that hash. The return value is actually an array, so that the original +tag order is preserved if you assign to an array instead of a hash. + +=cut + +sub results { + my $self = shift; + my @results; + foreach my $tag (@{$self->[TAGS]}) { + push @results, $tag; + push @results, $self->result($tag); + } + return wantarray ? @results : \@results; +} + + +=item $t->data($tag), $t->data; + +These methods are useful if you want to recover the full internal timing +data to roll your own reports. + +If called with a $tag, returns the raw timing data for that $tag as +an array (or a reference to an array if called in scalar context). This is +useful for feeding to something like the Statistics::Descriptive package. + +If called with no arguments, returns the raw timing data as a hash keyed +on tags, where the values of the hash are lists of timings for that +code. In scalar context, it returns a reference to that hash. As with +C, the data is internally represented as an array so you can +recover the original tag order by assigning to an array instead of a hash. + +=cut + +sub data { + my $self = shift; + my $tag = shift; + my @results; + if($tag) { + if(exists $self->[ELAPSED]->{$tag}) { + @results = @{$self->[ELAPSED]->{$tag}}; + } else { + @results = (); + } + } else { + @results = map { ( $_ => $self->[ELAPSED]->{$_} || [] ) } + @{$self->[TAGS]}; + } + return wantarray ? @results : \@results; +} + + +# ------------------------------------------------------------------------ +# Internal utility subroutines + +# timestr($sec) takes a floating-point number of seconds and formats +# it in a sensible way, commifying large numbers of seconds, and +# converting to milliseconds if it makes sense. Since Time::HiRes has +# at most microsecond resolution, no attempt is made to convert into +# anything below that. A unit string is appended to the number. + +sub timestr { + my $sec = shift; + my $retstr; + if($sec >= 1_000) { + $retstr = commify(int $sec) . 's'; + } elsif($sec >= 1) { + $retstr = sprintf $sec == int $sec ? '%ds' : '%0.3fs', $sec; + } elsif($sec >= 0.001) { + my $ms = $sec * 1_000; + $retstr = sprintf $ms == int $ms ? '%dms' : '%0.3fms', $ms; + } elsif($sec >= 0.000001) { + $retstr = sprintf '%dus', $sec * 1_000_000; + } else { + # I'll have whatever real-time OS she's having + $retstr = $sec . 's'; + } + $retstr; +} + + +# commify($num) inserts a grouping comma according to en-US standards +# for numbers larger than 1000. For example, the integer 123456 would +# be written 123,456. Any fractional part is left untouched. + +sub commify { + my $num = shift; + return unless $num =~ /\d/; + return $num if $num < 1_000; + + my $ip = int $num; + my($fp) = ($num =~ /\.(\d+)/); + + $ip =~ s/(\d\d\d)$/,$1/; + 1 while $ip =~ s/(\d)(\d\d\d),/$1,$2,/; + + return $fp ? join '.', $ip, $fp : $ip; +} + + +# ------------------------------------------------------------------------ +# Finish up the POD. + +=back + +=head1 BUGS + +Benchmarking is an inherently futile activity, fraught with uncertainty +not dissimilar to that experienced in quantum mechanics. But things are a +little better if you apply statistics. + +=head1 SEE ALSO + +L, L, L, L + +=head1 AUTHOR + +The original code (written before April 20, 2001) was written by Andrew Ho +Eandrew@zeuscat.comE, and is copyright (c) 2000-2001 Andrew Ho. +Versions up to 0.5 are distributed under the same terms as Perl. + +Maintenance of this module is now being done by David Coppit +Edavid@coppit.orgE. + +=cut + + +# ------------------------------------------------------------------------ +# Return true for a valid Perl include + +1; + + +# ======================================================================== +__END__ diff --git a/lib/Bundle/Xxv.pm b/lib/Bundle/Xxv.pm new file mode 100644 index 0000000..411e679 --- /dev/null +++ b/lib/Bundle/Xxv.pm @@ -0,0 +1,81 @@ +package Bundle::Xxv; +use strict; +use warnings; + +$VERSION = '0.04'; + +1; + +__END__ + +=head1 NAME + +Bundle::Xxv - A bundle to install various xxv related modules + +=head1 SYNOPSIS + + mkdir -p ~/.cpan/Bundle + cp Bundle/Xxv.pm ~/.cpan/Bundle + perl -MCPAN -e 'install Bundle::Xxv' + +=head1 CONTENTS + +Test::Simple - Test package to test varios funktion +DBI - Database package for perl +DBD::mysql - Database driver to connect over DBI +Config::Tiny +Event - the great famos Event libary +MIME::Base64 - Code library to encrypt and decrypt Strings +Time::HiRes - High Resolutin timer +Locale::gettext - Localization in perl +Net::Telnet +URI +URI::file +URI::URL +Compress::Zlib - for compressed output +HTML::Tagset +HTML::Parser +HTML::Form +HTTP::Status +HTTP::Daemon +HTTP::Request +LWP::UserAgent +LWP +WWW::Mechanize - for Robot Module +Data::Random +WWW::Mechanize::FormFiller +GD - GD Image library +Digest::SHA1 +Digest::HMAC_MD5 +Digest::MD5 +Net::IP +Net::DNS +XML::Parser +XML::RSS - create an rss feed +Math::BigInt::FastCalc +Authen::SASL +XML::Stream +Net::XMPP - create an Jabber message +Proc::Killfam - killall for Perl +Proc::ProcessTable +Term::ReadLine::Gnu - Better Support for telnet interface +Template +SOAP::Lite +MP3::Icecast +MP3::Info +CGI +LWP::Simple +Net::Amazon +Net::Amazon::Request::Artist +JSON - Parse and convert to JSON (JavaScript Object Notation) + + +=head1 DESCRIPTION + +This is a bundle of xxv related modules. + +=head1 AUTHOR + +Frank Herrmann Expix at xpix dot deE + +=cut diff --git a/lib/CGI.pm b/lib/CGI.pm new file mode 100644 index 0000000..148b861 --- /dev/null +++ b/lib/CGI.pm @@ -0,0 +1,7318 @@ +package CGI; +require 5.004; +use Carp 'croak'; + +# See the bottom of this file for the POD documentation. Search for the +# string '=head'. + +# You can run this file through either pod2man or pod2html to produce pretty +# documentation in manual or html file format (these utilities are part of the +# Perl 5 distribution). + +# Copyright 1995-1998 Lincoln D. Stein. All rights reserved. +# It may be used and modified freely, but I do request that this copyright +# notice remain attached to the file. You may modify this module as you +# wish, but if you redistribute a modified version, please attach a note +# listing the modifications you have made. + +# The most recent version and complete docs are available at: +# http://stein.cshl.org/WWW/software/CGI/ + +$CGI::revision = '$Id: CGI.pm,v 1.165 2004/04/12 20:37:26 lstein Exp $'; +$CGI::VERSION=3.05; + +# HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES. +# UNCOMMENT THIS ONLY IF YOU KNOW WHAT YOU'RE DOING. +# $CGITempFile::TMPDIRECTORY = '/usr/tmp'; +use CGI::Util qw(rearrange make_attributes unescape escape expires ebcdic2ascii ascii2ebcdic); + +#use constant XHTML_DTD => ['-//W3C//DTD XHTML Basic 1.0//EN', +# 'http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd']; + +use constant XHTML_DTD => ['-//W3C//DTD XHTML 1.0 Transitional//EN', + 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd']; + +{ + local $^W = 0; + $TAINTED = substr("$0$^X",0,0); +} + +$MOD_PERL = 0; # no mod_perl by default +@SAVED_SYMBOLS = (); + +# >>>>> Here are some globals that you might want to adjust <<<<<< +sub initialize_globals { + # Set this to 1 to enable copious autoloader debugging messages + $AUTOLOAD_DEBUG = 0; + + # Set this to 1 to generate XTML-compatible output + $XHTML = 1; + + # Change this to the preferred DTD to print in start_html() + # or use default_dtd('text of DTD to use'); + $DEFAULT_DTD = [ '-//W3C//DTD HTML 4.01 Transitional//EN', + 'http://www.w3.org/TR/html4/loose.dtd' ] ; + + # Set this to 1 to enable NOSTICKY scripts + # or: + # 1) use CGI qw(-nosticky) + # 2) $CGI::nosticky(1) + $NOSTICKY = 0; + + # Set this to 1 to enable NPH scripts + # or: + # 1) use CGI qw(-nph) + # 2) CGI::nph(1) + # 3) print header(-nph=>1) + $NPH = 0; + + # Set this to 1 to enable debugging from @ARGV + # Set to 2 to enable debugging from STDIN + $DEBUG = 1; + + # Set this to 1 to make the temporary files created + # during file uploads safe from prying eyes + # or do... + # 1) use CGI qw(:private_tempfiles) + # 2) CGI::private_tempfiles(1); + $PRIVATE_TEMPFILES = 0; + + # Set this to 1 to cause files uploaded in multipart documents + # to be closed, instead of caching the file handle + # or: + # 1) use CGI qw(:close_upload_files) + # 2) $CGI::close_upload_files(1); + # Uploads with many files run out of file handles. + # Also, for performance, since the file is already on disk, + # it can just be renamed, instead of read and written. + $CLOSE_UPLOAD_FILES = 0; + + # Set this to a positive value to limit the size of a POSTing + # to a certain number of bytes: + $POST_MAX = -1; + + # Change this to 1 to disable uploads entirely: + $DISABLE_UPLOADS = 0; + + # Automatically determined -- don't change + $EBCDIC = 0; + + # Change this to 1 to suppress redundant HTTP headers + $HEADERS_ONCE = 0; + + # separate the name=value pairs by semicolons rather than ampersands + $USE_PARAM_SEMICOLONS = 1; + + # Do not include undefined params parsed from query string + # use CGI qw(-no_undef_params); + $NO_UNDEF_PARAMS = 0; + + # Other globals that you shouldn't worry about. + undef $Q; + $BEEN_THERE = 0; + $DTD_PUBLIC_IDENTIFIER = ""; + undef @QUERY_PARAM; + undef %EXPORT; + undef $QUERY_CHARSET; + undef %QUERY_FIELDNAMES; + + # prevent complaints by mod_perl + 1; +} + +# ------------------ START OF THE LIBRARY ------------ + +*end_form = \&endform; + +# make mod_perlhappy +initialize_globals(); + +# FIGURE OUT THE OS WE'RE RUNNING UNDER +# Some systems support the $^O variable. If not +# available then require() the Config library +unless ($OS) { + unless ($OS = $^O) { + require Config; + $OS = $Config::Config{'osname'}; + } +} +if ($OS =~ /^MSWin/i) { + $OS = 'WINDOWS'; +} elsif ($OS =~ /^VMS/i) { + $OS = 'VMS'; +} elsif ($OS =~ /^dos/i) { + $OS = 'DOS'; +} elsif ($OS =~ /^MacOS/i) { + $OS = 'MACINTOSH'; +} elsif ($OS =~ /^os2/i) { + $OS = 'OS2'; +} elsif ($OS =~ /^epoc/i) { + $OS = 'EPOC'; +} elsif ($OS =~ /^cygwin/i) { + $OS = 'CYGWIN'; +} else { + $OS = 'UNIX'; +} + +# Some OS logic. Binary mode enabled on DOS, NT and VMS +$needs_binmode = $OS=~/^(WINDOWS|DOS|OS2|MSWin|CYGWIN)/; + +# This is the default class for the CGI object to use when all else fails. +$DefaultClass = 'CGI' unless defined $CGI::DefaultClass; + +# This is where to look for autoloaded routines. +$AutoloadClass = $DefaultClass unless defined $CGI::AutoloadClass; + +# The path separator is a slash, backslash or semicolon, depending +# on the paltform. +$SL = { + UNIX => '/', OS2 => '\\', EPOC => '/', CYGWIN => '/', + WINDOWS => '\\', DOS => '\\', MACINTOSH => ':', VMS => '/' + }->{$OS}; + +# This no longer seems to be necessary +# Turn on NPH scripts by default when running under IIS server! +# $NPH++ if defined($ENV{'SERVER_SOFTWARE'}) && $ENV{'SERVER_SOFTWARE'}=~/IIS/; +$IIS++ if defined($ENV{'SERVER_SOFTWARE'}) && $ENV{'SERVER_SOFTWARE'}=~/IIS/; + +# Turn on special checking for Doug MacEachern's modperl +if (exists $ENV{MOD_PERL}) { + eval "require mod_perl"; + # mod_perl handlers may run system() on scripts using CGI.pm; + # Make sure so we don't get fooled by inherited $ENV{MOD_PERL} + if (defined $mod_perl::VERSION) { + if ($mod_perl::VERSION >= 1.99) { + $MOD_PERL = 2; + require Apache::Response; + require Apache::RequestRec; + require Apache::RequestUtil; + require APR::Pool; + } else { + $MOD_PERL = 1; + require Apache; + } + } +} + +# Turn on special checking for ActiveState's PerlEx +$PERLEX++ if defined($ENV{'GATEWAY_INTERFACE'}) && $ENV{'GATEWAY_INTERFACE'} =~ /^CGI-PerlEx/; + +# Define the CRLF sequence. I can't use a simple "\r\n" because the meaning +# of "\n" is different on different OS's (sometimes it generates CRLF, sometimes LF +# and sometimes CR). The most popular VMS web server +# doesn't accept CRLF -- instead it wants a LR. EBCDIC machines don't +# use ASCII, so \015\012 means something different. I find this all +# really annoying. +$EBCDIC = "\t" ne "\011"; +if ($OS eq 'VMS') { + $CRLF = "\n"; +} elsif ($EBCDIC) { + $CRLF= "\r\n"; +} else { + $CRLF = "\015\012"; +} + +if ($needs_binmode) { + $CGI::DefaultClass->binmode(\*main::STDOUT); + $CGI::DefaultClass->binmode(\*main::STDIN); + $CGI::DefaultClass->binmode(\*main::STDERR); +} + +%EXPORT_TAGS = ( + ':html2'=>['h1'..'h6',qw/p br hr ol ul li dl dt dd menu code var strong em + tt u i b blockquote pre img a address cite samp dfn html head + base body Link nextid title meta kbd start_html end_html + input Select option comment charset escapeHTML/], + ':html3'=>[qw/div table caption th td TR Tr sup Sub strike applet Param + embed basefont style span layer ilayer font frameset frame script small big Area Map/], + ':html4'=>[qw/abbr acronym bdo col colgroup del fieldset iframe + ins label legend noframes noscript object optgroup Q + thead tbody tfoot/], + ':netscape'=>[qw/blink fontsize center/], + ':form'=>[qw/textfield textarea filefield password_field hidden checkbox checkbox_group + submit reset defaults radio_group popup_menu button autoEscape + scrolling_list image_button start_form end_form startform endform + start_multipart_form end_multipart_form isindex tmpFileName uploadInfo URL_ENCODED MULTIPART/], + ':cgi'=>[qw/param upload path_info path_translated url self_url script_name cookie Dump + raw_cookie request_method query_string Accept user_agent remote_host content_type + remote_addr referer server_name server_software server_port server_protocol virtual_port + virtual_host remote_ident auth_type http append + save_parameters restore_parameters param_fetch + remote_user user_name header redirect import_names put + Delete Delete_all url_param cgi_error/], + ':ssl' => [qw/https/], + ':cgi-lib' => [qw/ReadParse PrintHeader HtmlTop HtmlBot SplitParam Vars/], + ':html' => [qw/:html2 :html3 :html4 :netscape/], + ':standard' => [qw/:html2 :html3 :html4 :form :cgi/], + ':push' => [qw/multipart_init multipart_start multipart_end multipart_final/], + ':all' => [qw/:html2 :html3 :netscape :form :cgi :internal :html4/] + ); + +# to import symbols into caller +sub import { + my $self = shift; + + # This causes modules to clash. + undef %EXPORT_OK; + undef %EXPORT; + + $self->_setup_symbols(@_); + my ($callpack, $callfile, $callline) = caller; + + # To allow overriding, search through the packages + # Till we find one in which the correct subroutine is defined. + my @packages = ($self,@{"$self\:\:ISA"}); + foreach $sym (keys %EXPORT) { + my $pck; + my $def = ${"$self\:\:AutoloadClass"} || $DefaultClass; + foreach $pck (@packages) { + if (defined(&{"$pck\:\:$sym"})) { + $def = $pck; + last; + } + } + *{"${callpack}::$sym"} = \&{"$def\:\:$sym"}; + } +} + +sub compile { + my $pack = shift; + $pack->_setup_symbols('-compile',@_); +} + +sub expand_tags { + my($tag) = @_; + return ("start_$1","end_$1") if $tag=~/^(?:\*|start_|end_)(.+)/; + my(@r); + return ($tag) unless $EXPORT_TAGS{$tag}; + foreach (@{$EXPORT_TAGS{$tag}}) { + push(@r,&expand_tags($_)); + } + return @r; +} + +#### Method: new +# The new routine. This will check the current environment +# for an existing query string, and initialize itself, if so. +#### +sub new { + my($class,@initializer) = @_; + my $self = {}; + + bless $self,ref $class || $class || $DefaultClass; + if (ref($initializer[0]) + && (UNIVERSAL::isa($initializer[0],'Apache') + || + UNIVERSAL::isa($initializer[0],'Apache::RequestRec') + )) { + $self->r(shift @initializer); + } + if (ref($initializer[0]) + && (UNIVERSAL::isa($initializer[0],'CODE'))) { + $self->upload_hook(shift @initializer, shift @initializer); + } + if ($MOD_PERL) { + $self->r(Apache->request) unless $self->r; + my $r = $self->r; + if ($MOD_PERL == 1) { + $r->register_cleanup(\&CGI::_reset_globals); + } + else { + # XXX: once we have the new API + # will do a real PerlOptions -SetupEnv check + $r->subprocess_env unless exists $ENV{REQUEST_METHOD}; + $r->pool->cleanup_register(\&CGI::_reset_globals); + } + undef $NPH; + } + $self->_reset_globals if $PERLEX; + $self->init(@initializer); + return $self; +} + +# We provide a DESTROY method so that we can ensure that +# temporary files are closed (via Fh->DESTROY) before they +# are unlinked (via CGITempFile->DESTROY) because it is not +# possible to unlink an open file on Win32. We explicitly +# call DESTROY on each, rather than just undefing them and +# letting Perl DESTROY them by garbage collection, in case the +# user is still holding any reference to them as well. +sub DESTROY { + my $self = shift; + foreach my $href (values %{$self->{'.tmpfiles'}}) { + $href->{hndl}->DESTROY if defined $href->{hndl}; + $href->{name}->DESTROY if defined $href->{name}; + } +} + +sub r { + my $self = shift; + my $r = $self->{'.r'}; + $self->{'.r'} = shift if @_; + $r; +} + +sub upload_hook { + my ($self,$hook,$data) = self_or_default(@_); + $self->{'.upload_hook'} = $hook; + $self->{'.upload_data'} = $data; +} + +#### Method: param +# Returns the value(s)of a named parameter. +# If invoked in a list context, returns the +# entire list. Otherwise returns the first +# member of the list. +# If name is not provided, return a list of all +# the known parameters names available. +# If more than one argument is provided, the +# second and subsequent arguments are used to +# set the value of the parameter. +#### +sub param { + my($self,@p) = self_or_default(@_); + return $self->all_parameters unless @p; + my($name,$value,@other); + + # For compatibility between old calling style and use_named_parameters() style, + # we have to special case for a single parameter present. + if (@p > 1) { + ($name,$value,@other) = rearrange([NAME,[DEFAULT,VALUE,VALUES]],@p); + my(@values); + + if (substr($p[0],0,1) eq '-') { + @values = defined($value) ? (ref($value) && ref($value) eq 'ARRAY' ? @{$value} : $value) : (); + } else { + foreach ($value,@other) { + push(@values,$_) if defined($_); + } + } + # If values is provided, then we set it. + if (@values) { + $self->add_parameter($name); + $self->{$name}=[@values]; + } + } else { + $name = $p[0]; + } + + return unless defined($name) && $self->{$name}; + return wantarray ? @{$self->{$name}} : $self->{$name}->[0]; +} + +sub self_or_default { + return @_ if defined($_[0]) && (!ref($_[0])) &&($_[0] eq 'CGI'); + unless (defined($_[0]) && + (ref($_[0]) eq 'CGI' || UNIVERSAL::isa($_[0],'CGI')) # slightly optimized for common case + ) { + $Q = $CGI::DefaultClass->new unless defined($Q); + unshift(@_,$Q); + } + return wantarray ? @_ : $Q; +} + +sub self_or_CGI { + local $^W=0; # prevent a warning + if (defined($_[0]) && + (substr(ref($_[0]),0,3) eq 'CGI' + || UNIVERSAL::isa($_[0],'CGI'))) { + return @_; + } else { + return ($DefaultClass,@_); + } +} + +######################################## +# THESE METHODS ARE MORE OR LESS PRIVATE +# GO TO THE __DATA__ SECTION TO SEE MORE +# PUBLIC METHODS +######################################## + +# Initialize the query object from the environment. +# If a parameter list is found, this object will be set +# to an associative array in which parameter names are keys +# and the values are stored as lists +# If a keyword list is found, this method creates a bogus +# parameter list with the single parameter 'keywords'. + +sub init { + my $self = shift; + my($query_string,$meth,$content_length,$fh,@lines) = ('','','',''); + + my $initializer = shift; # for backward compatibility + local($/) = "\n"; + + # set autoescaping on by default + $self->{'escape'} = 1; + + # if we get called more than once, we want to initialize + # ourselves from the original query (which may be gone + # if it was read from STDIN originally.) + if (defined(@QUERY_PARAM) && !defined($initializer)) { + foreach (@QUERY_PARAM) { + $self->param('-name'=>$_,'-value'=>$QUERY_PARAM{$_}); + } + $self->charset($QUERY_CHARSET); + $self->{'.fieldnames'} = {%QUERY_FIELDNAMES}; + return; + } + + $meth=$ENV{'REQUEST_METHOD'} if defined($ENV{'REQUEST_METHOD'}); + $content_length = defined($ENV{'CONTENT_LENGTH'}) ? $ENV{'CONTENT_LENGTH'} : 0; + + $fh = to_filehandle($initializer) if $initializer; + + # set charset to the safe ISO-8859-1 + $self->charset('ISO-8859-1'); + + METHOD: { + + # avoid unreasonably large postings + if (($POST_MAX > 0) && ($content_length > $POST_MAX)) { + # quietly read and discard the post + my $buffer; + my $max = $content_length; + while ($max > 0 && + (my $bytes = $MOD_PERL + ? $self->r->read($buffer,$max < 10000 ? $max : 10000) + : read(STDIN,$buffer,$max < 10000 ? $max : 10000) + )) { + $self->cgi_error("413 Request entity too large"); + last METHOD; + } + } + + # Process multipart postings, but only if the initializer is + # not defined. + if ($meth eq 'POST' + && defined($ENV{'CONTENT_TYPE'}) + && $ENV{'CONTENT_TYPE'}=~m|^multipart/form-data| + && !defined($initializer) + ) { + my($boundary) = $ENV{'CONTENT_TYPE'} =~ /boundary=\"?([^\";,]+)\"?/; + $self->read_multipart($boundary,$content_length); + last METHOD; + } + + # If initializer is defined, then read parameters + # from it. + if (defined($initializer)) { + if (UNIVERSAL::isa($initializer,'CGI')) { + $query_string = $initializer->query_string; + last METHOD; + } + if (ref($initializer) && ref($initializer) eq 'HASH') { + foreach (keys %$initializer) { + $self->param('-name'=>$_,'-value'=>$initializer->{$_}); + } + last METHOD; + } + + if (defined($fh) && ($fh ne '')) { + while (<$fh>) { + chomp; + last if /^=/; + push(@lines,$_); + } + # massage back into standard format + if ("@lines" =~ /=/) { + $query_string=join("&",@lines); + } else { + $query_string=join("+",@lines); + } + last METHOD; + } + + if (defined($fh) && ($fh ne '')) { + while (<$fh>) { + chomp; + last if /^=/; + push(@lines,$_); + } + # massage back into standard format + if ("@lines" =~ /=/) { + $query_string=join("&",@lines); + } else { + $query_string=join("+",@lines); + } + last METHOD; + } + + # last chance -- treat it as a string + $initializer = $$initializer if ref($initializer) eq 'SCALAR'; + $query_string = $initializer; + + last METHOD; + } + + # If method is GET or HEAD, fetch the query from + # the environment. + if ($meth=~/^(GET|HEAD)$/) { + if ($MOD_PERL) { + $query_string = $self->r->args; + } else { + $query_string = $ENV{'QUERY_STRING'} if defined $ENV{'QUERY_STRING'}; + $query_string ||= $ENV{'REDIRECT_QUERY_STRING'} if defined $ENV{'REDIRECT_QUERY_STRING'}; + } + last METHOD; + } + + if ($meth eq 'POST') { + $self->read_from_client(\$query_string,$content_length,0) + if $content_length > 0; + # Some people want to have their cake and eat it too! + # Uncomment this line to have the contents of the query string + # APPENDED to the POST data. + # $query_string .= (length($query_string) ? '&' : '') . $ENV{'QUERY_STRING'} if defined $ENV{'QUERY_STRING'}; + last METHOD; + } + + # If $meth is not of GET, POST or HEAD, assume we're being debugged offline. + # Check the command line and then the standard input for data. + # We use the shellwords package in order to behave the way that + # UN*X programmers expect. + if ($DEBUG) + { + my $cmdline_ret = read_from_cmdline(); + $query_string = $cmdline_ret->{'query_string'}; + if (defined($cmdline_ret->{'subpath'})) + { + $self->path_info($cmdline_ret->{'subpath'}); + } + } + } + +# YL: Begin Change for XML handler 10/19/2001 + if ($meth eq 'POST' + && defined($ENV{'CONTENT_TYPE'}) + && $ENV{'CONTENT_TYPE'} !~ m|^application/x-www-form-urlencoded| + && $ENV{'CONTENT_TYPE'} !~ m|^multipart/form-data| ) { + my($param) = 'POSTDATA' ; + $self->add_parameter($param) ; + push (@{$self->{$param}},$query_string); + undef $query_string ; + } +# YL: End Change for XML handler 10/19/2001 + + # We now have the query string in hand. We do slightly + # different things for keyword lists and parameter lists. + if (defined $query_string && length $query_string) { + if ($query_string =~ /[&=;]/) { + $self->parse_params($query_string); + } else { + $self->add_parameter('keywords'); + $self->{'keywords'} = [$self->parse_keywordlist($query_string)]; + } + } + + # Special case. Erase everything if there is a field named + # .defaults. + if ($self->param('.defaults')) { + $self->delete_all(); + } + + # Associative array containing our defined fieldnames + $self->{'.fieldnames'} = {}; + foreach ($self->param('.cgifields')) { + $self->{'.fieldnames'}->{$_}++; + } + + # Clear out our default submission button flag if present + $self->delete('.submit'); + $self->delete('.cgifields'); + + $self->save_request unless defined $initializer; +} + +# FUNCTIONS TO OVERRIDE: +# Turn a string into a filehandle +sub to_filehandle { + my $thingy = shift; + return undef unless $thingy; + return $thingy if UNIVERSAL::isa($thingy,'GLOB'); + return $thingy if UNIVERSAL::isa($thingy,'FileHandle'); + if (!ref($thingy)) { + my $caller = 1; + while (my $package = caller($caller++)) { + my($tmp) = $thingy=~/[\':]/ ? $thingy : "$package\:\:$thingy"; + return $tmp if defined(fileno($tmp)); + } + } + return undef; +} + +# send output to the browser +sub put { + my($self,@p) = self_or_default(@_); + $self->print(@p); +} + +# print to standard output (for overriding in mod_perl) +sub print { + shift; + CORE::print(@_); +} + +# get/set last cgi_error +sub cgi_error { + my ($self,$err) = self_or_default(@_); + $self->{'.cgi_error'} = $err if defined $err; + return $self->{'.cgi_error'}; +} + +sub save_request { + my($self) = @_; + # We're going to play with the package globals now so that if we get called + # again, we initialize ourselves in exactly the same way. This allows + # us to have several of these objects. + @QUERY_PARAM = $self->param; # save list of parameters + foreach (@QUERY_PARAM) { + next unless defined $_; + $QUERY_PARAM{$_}=$self->{$_}; + } + $QUERY_CHARSET = $self->charset; + %QUERY_FIELDNAMES = %{$self->{'.fieldnames'}}; +} + +sub parse_params { + my($self,$tosplit) = @_; + my(@pairs) = split(/[&;]/,$tosplit); + my($param,$value); + foreach (@pairs) { + ($param,$value) = split('=',$_,2); + next unless defined $param; + next if $NO_UNDEF_PARAMS and not defined $value; + $value = '' unless defined $value; + $param = unescape($param); + $value = unescape($value); + $self->add_parameter($param); + push (@{$self->{$param}},$value); + } +} + +sub add_parameter { + my($self,$param)=@_; + return unless defined $param; + push (@{$self->{'.parameters'}},$param) + unless defined($self->{$param}); +} + +sub all_parameters { + my $self = shift; + return () unless defined($self) && $self->{'.parameters'}; + return () unless @{$self->{'.parameters'}}; + return @{$self->{'.parameters'}}; +} + +# put a filehandle into binary mode (DOS) +sub binmode { + return unless defined($_[1]) && defined fileno($_[1]); + CORE::binmode($_[1]); +} + +sub _make_tag_func { + my ($self,$tagname) = @_; + my $func = qq( + sub $tagname { + my (\$q,\$a,\@rest) = self_or_default(\@_); + my(\$attr) = ''; + if (ref(\$a) && ref(\$a) eq 'HASH') { + my(\@attr) = make_attributes(\$a,\$q->{'escape'}); + \$attr = " \@attr" if \@attr; + } else { + unshift \@rest,\$a if defined \$a; + } + ); + if ($tagname=~/start_(\w+)/i) { + $func .= qq! return "<\L$1\E\$attr>";} !; + } elsif ($tagname=~/end_(\w+)/i) { + $func .= qq! return "<\L/$1\E>"; } !; + } else { + $func .= qq# + return \$XHTML ? "\L<$tagname\E\$attr />" : "\L<$tagname\E\$attr>" unless \@rest; + my(\$tag,\$untag) = ("\L<$tagname\E\$attr>","\L\E"); + my \@result = map { "\$tag\$_\$untag" } + (ref(\$rest[0]) eq 'ARRAY') ? \@{\$rest[0]} : "\@rest"; + return "\@result"; + }#; + } +return $func; +} + +sub AUTOLOAD { + print STDERR "CGI::AUTOLOAD for $AUTOLOAD\n" if $CGI::AUTOLOAD_DEBUG; + my $func = &_compile; + goto &$func; +} + +sub _compile { + my($func) = $AUTOLOAD; + my($pack,$func_name); + { + local($1,$2); # this fixes an obscure variable suicide problem. + $func=~/(.+)::([^:]+)$/; + ($pack,$func_name) = ($1,$2); + $pack=~s/::SUPER$//; # fix another obscure problem + $pack = ${"$pack\:\:AutoloadClass"} || $CGI::DefaultClass + unless defined(${"$pack\:\:AUTOLOADED_ROUTINES"}); + + my($sub) = \%{"$pack\:\:SUBS"}; + unless (%$sub) { + my($auto) = \${"$pack\:\:AUTOLOADED_ROUTINES"}; + eval "package $pack; $$auto"; + croak("$AUTOLOAD: $@") if $@; + $$auto = ''; # Free the unneeded storage (but don't undef it!!!) + } + my($code) = $sub->{$func_name}; + + $code = "sub $AUTOLOAD { }" if (!$code and $func_name eq 'DESTROY'); + if (!$code) { + (my $base = $func_name) =~ s/^(start_|end_)//i; + if ($EXPORT{':any'} || + $EXPORT{'-any'} || + $EXPORT{$base} || + (%EXPORT_OK || grep(++$EXPORT_OK{$_},&expand_tags(':html'))) + && $EXPORT_OK{$base}) { + $code = $CGI::DefaultClass->_make_tag_func($func_name); + } + } + croak("Undefined subroutine $AUTOLOAD\n") unless $code; + eval "package $pack; $code"; + if ($@) { + $@ =~ s/ at .*\n//; + croak("$AUTOLOAD: $@"); + } + } + CORE::delete($sub->{$func_name}); #free storage + return "$pack\:\:$func_name"; +} + +sub _selected { + my $self = shift; + my $value = shift; + return '' unless $value; + return $XHTML ? qq( selected="selected") : qq( selected); +} + +sub _checked { + my $self = shift; + my $value = shift; + return '' unless $value; + return $XHTML ? qq( checked="checked") : qq( checked); +} + +sub _reset_globals { initialize_globals(); } + +sub _setup_symbols { + my $self = shift; + my $compile = 0; + + # to avoid reexporting unwanted variables + undef %EXPORT; + + foreach (@_) { + $HEADERS_ONCE++, next if /^[:-]unique_headers$/; + $NPH++, next if /^[:-]nph$/; + $NOSTICKY++, next if /^[:-]nosticky$/; + $DEBUG=0, next if /^[:-]no_?[Dd]ebug$/; + $DEBUG=2, next if /^[:-][Dd]ebug$/; + $USE_PARAM_SEMICOLONS++, next if /^[:-]newstyle_urls$/; + $XHTML++, next if /^[:-]xhtml$/; + $XHTML=0, next if /^[:-]no_?xhtml$/; + $USE_PARAM_SEMICOLONS=0, next if /^[:-]oldstyle_urls$/; + $PRIVATE_TEMPFILES++, next if /^[:-]private_tempfiles$/; + $CLOSE_UPLOAD_FILES++, next if /^[:-]close_upload_files$/; + $EXPORT{$_}++, next if /^[:-]any$/; + $compile++, next if /^[:-]compile$/; + $NO_UNDEF_PARAMS++, next if /^[:-]no_undef_params$/; + + # This is probably extremely evil code -- to be deleted some day. + if (/^[-]autoload$/) { + my($pkg) = caller(1); + *{"${pkg}::AUTOLOAD"} = sub { + my($routine) = $AUTOLOAD; + $routine =~ s/^.*::/CGI::/; + &$routine; + }; + next; + } + + foreach (&expand_tags($_)) { + tr/a-zA-Z0-9_//cd; # don't allow weird function names + $EXPORT{$_}++; + } + } + _compile_all(keys %EXPORT) if $compile; + @SAVED_SYMBOLS = @_; +} + +sub charset { + my ($self,$charset) = self_or_default(@_); + $self->{'.charset'} = $charset if defined $charset; + $self->{'.charset'}; +} + +############################################################################### +################# THESE FUNCTIONS ARE AUTOLOADED ON DEMAND #################### +############################################################################### +$AUTOLOADED_ROUTINES = ''; # get rid of -w warning +$AUTOLOADED_ROUTINES=<<'END_OF_AUTOLOAD'; + +%SUBS = ( + +'URL_ENCODED'=> <<'END_OF_FUNC', +sub URL_ENCODED { 'application/x-www-form-urlencoded'; } +END_OF_FUNC + +'MULTIPART' => <<'END_OF_FUNC', +sub MULTIPART { 'multipart/form-data'; } +END_OF_FUNC + +'SERVER_PUSH' => <<'END_OF_FUNC', +sub SERVER_PUSH { 'multipart/x-mixed-replace;boundary="' . shift() . '"'; } +END_OF_FUNC + +'new_MultipartBuffer' => <<'END_OF_FUNC', +# Create a new multipart buffer +sub new_MultipartBuffer { + my($self,$boundary,$length) = @_; + return MultipartBuffer->new($self,$boundary,$length); +} +END_OF_FUNC + +'read_from_client' => <<'END_OF_FUNC', +# Read data from a file handle +sub read_from_client { + my($self, $buff, $len, $offset) = @_; + local $^W=0; # prevent a warning + return $MOD_PERL + ? $self->r->read($$buff, $len, $offset) + : read(\*STDIN, $$buff, $len, $offset); +} +END_OF_FUNC + +'delete' => <<'END_OF_FUNC', +#### Method: delete +# Deletes the named parameter entirely. +#### +sub delete { + my($self,@p) = self_or_default(@_); + my(@names) = rearrange([NAME],@p); + my @to_delete = ref($names[0]) eq 'ARRAY' ? @$names[0] : @names; + my %to_delete; + foreach my $name (@to_delete) + { + CORE::delete $self->{$name}; + CORE::delete $self->{'.fieldnames'}->{$name}; + $to_delete{$name}++; + } + @{$self->{'.parameters'}}=grep { !exists($to_delete{$_}) } $self->param(); + return; +} +END_OF_FUNC + +#### Method: import_names +# Import all parameters into the given namespace. +# Assumes namespace 'Q' if not specified +#### +'import_names' => <<'END_OF_FUNC', +sub import_names { + my($self,$namespace,$delete) = self_or_default(@_); + $namespace = 'Q' unless defined($namespace); + die "Can't import names into \"main\"\n" if \%{"${namespace}::"} == \%::; + if ($delete || $MOD_PERL || exists $ENV{'FCGI_ROLE'}) { + # can anyone find an easier way to do this? + foreach (keys %{"${namespace}::"}) { + local *symbol = "${namespace}::${_}"; + undef $symbol; + undef @symbol; + undef %symbol; + } + } + my($param,@value,$var); + foreach $param ($self->param) { + # protect against silly names + ($var = $param)=~tr/a-zA-Z0-9_/_/c; + $var =~ s/^(?=\d)/_/; + local *symbol = "${namespace}::$var"; + @value = $self->param($param); + @symbol = @value; + $symbol = $value[0]; + } +} +END_OF_FUNC + +#### Method: keywords +# Keywords acts a bit differently. Calling it in a list context +# returns the list of keywords. +# Calling it in a scalar context gives you the size of the list. +#### +'keywords' => <<'END_OF_FUNC', +sub keywords { + my($self,@values) = self_or_default(@_); + # If values is provided, then we set it. + $self->{'keywords'}=[@values] if @values; + my(@result) = defined($self->{'keywords'}) ? @{$self->{'keywords'}} : (); + @result; +} +END_OF_FUNC + +# These are some tie() interfaces for compatibility +# with Steve Brenner's cgi-lib.pl routines +'Vars' => <<'END_OF_FUNC', +sub Vars { + my $q = shift; + my %in; + tie(%in,CGI,$q); + return %in if wantarray; + return \%in; +} +END_OF_FUNC + +# These are some tie() interfaces for compatibility +# with Steve Brenner's cgi-lib.pl routines +'ReadParse' => <<'END_OF_FUNC', +sub ReadParse { + local(*in); + if (@_) { + *in = $_[0]; + } else { + my $pkg = caller(); + *in=*{"${pkg}::in"}; + } + tie(%in,CGI); + return scalar(keys %in); +} +END_OF_FUNC + +'PrintHeader' => <<'END_OF_FUNC', +sub PrintHeader { + my($self) = self_or_default(@_); + return $self->header(); +} +END_OF_FUNC + +'HtmlTop' => <<'END_OF_FUNC', +sub HtmlTop { + my($self,@p) = self_or_default(@_); + return $self->start_html(@p); +} +END_OF_FUNC + +'HtmlBot' => <<'END_OF_FUNC', +sub HtmlBot { + my($self,@p) = self_or_default(@_); + return $self->end_html(@p); +} +END_OF_FUNC + +'SplitParam' => <<'END_OF_FUNC', +sub SplitParam { + my ($param) = @_; + my (@params) = split ("\0", $param); + return (wantarray ? @params : $params[0]); +} +END_OF_FUNC + +'MethGet' => <<'END_OF_FUNC', +sub MethGet { + return request_method() eq 'GET'; +} +END_OF_FUNC + +'MethPost' => <<'END_OF_FUNC', +sub MethPost { + return request_method() eq 'POST'; +} +END_OF_FUNC + +'TIEHASH' => <<'END_OF_FUNC', +sub TIEHASH { + my $class = shift; + my $arg = $_[0]; + if (ref($arg) && UNIVERSAL::isa($arg,'CGI')) { + return $arg; + } + return $Q ||= $class->new(@_); +} +END_OF_FUNC + +'STORE' => <<'END_OF_FUNC', +sub STORE { + my $self = shift; + my $tag = shift; + my $vals = shift; + my @vals = index($vals,"\0")!=-1 ? split("\0",$vals) : $vals; + $self->param(-name=>$tag,-value=>\@vals); +} +END_OF_FUNC + +'FETCH' => <<'END_OF_FUNC', +sub FETCH { + return $_[0] if $_[1] eq 'CGI'; + return undef unless defined $_[0]->param($_[1]); + return join("\0",$_[0]->param($_[1])); +} +END_OF_FUNC + +'FIRSTKEY' => <<'END_OF_FUNC', +sub FIRSTKEY { + $_[0]->{'.iterator'}=0; + $_[0]->{'.parameters'}->[$_[0]->{'.iterator'}++]; +} +END_OF_FUNC + +'NEXTKEY' => <<'END_OF_FUNC', +sub NEXTKEY { + $_[0]->{'.parameters'}->[$_[0]->{'.iterator'}++]; +} +END_OF_FUNC + +'EXISTS' => <<'END_OF_FUNC', +sub EXISTS { + exists $_[0]->{$_[1]}; +} +END_OF_FUNC + +'DELETE' => <<'END_OF_FUNC', +sub DELETE { + $_[0]->delete($_[1]); +} +END_OF_FUNC + +'CLEAR' => <<'END_OF_FUNC', +sub CLEAR { + %{$_[0]}=(); +} +#### +END_OF_FUNC + +#### +# Append a new value to an existing query +#### +'append' => <<'EOF', +sub append { + my($self,@p) = @_; + my($name,$value) = rearrange([NAME,[VALUE,VALUES]],@p); + my(@values) = defined($value) ? (ref($value) ? @{$value} : $value) : (); + if (@values) { + $self->add_parameter($name); + push(@{$self->{$name}},@values); + } + return $self->param($name); +} +EOF + +#### Method: delete_all +# Delete all parameters +#### +'delete_all' => <<'EOF', +sub delete_all { + my($self) = self_or_default(@_); + my @param = $self->param(); + $self->delete(@param); +} +EOF + +'Delete' => <<'EOF', +sub Delete { + my($self,@p) = self_or_default(@_); + $self->delete(@p); +} +EOF + +'Delete_all' => <<'EOF', +sub Delete_all { + my($self,@p) = self_or_default(@_); + $self->delete_all(@p); +} +EOF + +#### Method: autoescape +# If you want to turn off the autoescaping features, +# call this method with undef as the argument +'autoEscape' => <<'END_OF_FUNC', +sub autoEscape { + my($self,$escape) = self_or_default(@_); + my $d = $self->{'escape'}; + $self->{'escape'} = $escape; + $d; +} +END_OF_FUNC + + +#### Method: version +# Return the current version +#### +'version' => <<'END_OF_FUNC', +sub version { + return $VERSION; +} +END_OF_FUNC + +#### Method: url_param +# Return a parameter in the QUERY_STRING, regardless of +# whether this was a POST or a GET +#### +'url_param' => <<'END_OF_FUNC', +sub url_param { + my ($self,@p) = self_or_default(@_); + my $name = shift(@p); + return undef unless exists($ENV{QUERY_STRING}); + unless (exists($self->{'.url_param'})) { + $self->{'.url_param'}={}; # empty hash + if ($ENV{QUERY_STRING} =~ /=/) { + my(@pairs) = split(/[&;]/,$ENV{QUERY_STRING}); + my($param,$value); + foreach (@pairs) { + ($param,$value) = split('=',$_,2); + $param = unescape($param); + $value = unescape($value); + push(@{$self->{'.url_param'}->{$param}},$value); + } + } else { + $self->{'.url_param'}->{'keywords'} = [$self->parse_keywordlist($ENV{QUERY_STRING})]; + } + } + return keys %{$self->{'.url_param'}} unless defined($name); + return () unless $self->{'.url_param'}->{$name}; + return wantarray ? @{$self->{'.url_param'}->{$name}} + : $self->{'.url_param'}->{$name}->[0]; +} +END_OF_FUNC + +#### Method: Dump +# Returns a string in which all the known parameter/value +# pairs are represented as nested lists, mainly for the purposes +# of debugging. +#### +'Dump' => <<'END_OF_FUNC', +sub Dump { + my($self) = self_or_default(@_); + my($param,$value,@result); + return '
    ' unless $self->param; + push(@result,"
      "); + foreach $param ($self->param) { + my($name)=$self->escapeHTML($param); + push(@result,"
    • $param
    • "); + push(@result,"
        "); + foreach $value ($self->param($param)) { + $value = $self->escapeHTML($value); + $value =~ s/\n/
        \n/g; + push(@result,"
      • $value
      • "); + } + push(@result,"
      "); + } + push(@result,"
    "); + return join("\n",@result); +} +END_OF_FUNC + +#### Method as_string +# +# synonym for "dump" +#### +'as_string' => <<'END_OF_FUNC', +sub as_string { + &Dump(@_); +} +END_OF_FUNC + +#### Method: save +# Write values out to a filehandle in such a way that they can +# be reinitialized by the filehandle form of the new() method +#### +'save' => <<'END_OF_FUNC', +sub save { + my($self,$filehandle) = self_or_default(@_); + $filehandle = to_filehandle($filehandle); + my($param); + local($,) = ''; # set print field separator back to a sane value + local($\) = ''; # set output line separator to a sane value + foreach $param ($self->param) { + my($escaped_param) = escape($param); + my($value); + foreach $value ($self->param($param)) { + print $filehandle "$escaped_param=",escape("$value"),"\n"; + } + } + foreach (keys %{$self->{'.fieldnames'}}) { + print $filehandle ".cgifields=",escape("$_"),"\n"; + } + print $filehandle "=\n"; # end of record +} +END_OF_FUNC + + +#### Method: save_parameters +# An alias for save() that is a better name for exportation. +# Only intended to be used with the function (non-OO) interface. +#### +'save_parameters' => <<'END_OF_FUNC', +sub save_parameters { + my $fh = shift; + return save(to_filehandle($fh)); +} +END_OF_FUNC + +#### Method: restore_parameters +# A way to restore CGI parameters from an initializer. +# Only intended to be used with the function (non-OO) interface. +#### +'restore_parameters' => <<'END_OF_FUNC', +sub restore_parameters { + $Q = $CGI::DefaultClass->new(@_); +} +END_OF_FUNC + +#### Method: multipart_init +# Return a Content-Type: style header for server-push +# This has to be NPH on most web servers, and it is advisable to set $| = 1 +# +# Many thanks to Ed Jordan for this +# contribution, updated by Andrew Benham (adsb@bigfoot.com) +#### +'multipart_init' => <<'END_OF_FUNC', +sub multipart_init { + my($self,@p) = self_or_default(@_); + my($boundary,@other) = rearrange([BOUNDARY],@p); + $boundary = $boundary || '------- =_aaaaaaaaaa0'; + $self->{'separator'} = "$CRLF--$boundary$CRLF"; + $self->{'final_separator'} = "$CRLF--$boundary--$CRLF"; + $type = SERVER_PUSH($boundary); + return $self->header( + -nph => 0, + -type => $type, + (map { split "=", $_, 2 } @other), + ) . "WARNING: YOUR BROWSER DOESN'T SUPPORT THIS SERVER-PUSH TECHNOLOGY." . $self->multipart_end; +} +END_OF_FUNC + + +#### Method: multipart_start +# Return a Content-Type: style header for server-push, start of section +# +# Many thanks to Ed Jordan for this +# contribution, updated by Andrew Benham (adsb@bigfoot.com) +#### +'multipart_start' => <<'END_OF_FUNC', +sub multipart_start { + my(@header); + my($self,@p) = self_or_default(@_); + my($type,@other) = rearrange([TYPE],@p); + $type = $type || 'text/html'; + push(@header,"Content-Type: $type"); + + # rearrange() was designed for the HTML portion, so we + # need to fix it up a little. + foreach (@other) { + # Don't use \s because of perl bug 21951 + next unless my($header,$value) = /([^ \r\n\t=]+)=\"?(.+?)\"?$/; + ($_ = $header) =~ s/^(\w)(.*)/$1 . lc ($2) . ': '.$self->unescapeHTML($value)/e; + } + push(@header,@other); + my $header = join($CRLF,@header)."${CRLF}${CRLF}"; + return $header; +} +END_OF_FUNC + + +#### Method: multipart_end +# Return a MIME boundary separator for server-push, end of section +# +# Many thanks to Ed Jordan for this +# contribution +#### +'multipart_end' => <<'END_OF_FUNC', +sub multipart_end { + my($self,@p) = self_or_default(@_); + return $self->{'separator'}; +} +END_OF_FUNC + + +#### Method: multipart_final +# Return a MIME boundary separator for server-push, end of all sections +# +# Contributed by Andrew Benham (adsb@bigfoot.com) +#### +'multipart_final' => <<'END_OF_FUNC', +sub multipart_final { + my($self,@p) = self_or_default(@_); + return $self->{'final_separator'} . "WARNING: YOUR BROWSER DOESN'T SUPPORT THIS SERVER-PUSH TECHNOLOGY." . $CRLF; +} +END_OF_FUNC + + +#### Method: header +# Return a Content-Type: style header +# +#### +'header' => <<'END_OF_FUNC', +sub header { + my($self,@p) = self_or_default(@_); + my(@header); + + return "" if $self->{'.header_printed'}++ and $HEADERS_ONCE; + + my($type,$status,$cookie,$target,$expires,$nph,$charset,$attachment,$p3p,@other) = + rearrange([['TYPE','CONTENT_TYPE','CONTENT-TYPE'], + 'STATUS',['COOKIE','COOKIES'],'TARGET', + 'EXPIRES','NPH','CHARSET', + 'ATTACHMENT','P3P'],@p); + + $nph ||= $NPH; + if (defined $charset) { + $self->charset($charset); + } else { + $charset = $self->charset; + } + + # rearrange() was designed for the HTML portion, so we + # need to fix it up a little. + foreach (@other) { + # Don't use \s because of perl bug 21951 + next unless my($header,$value) = /([^ \r\n\t=]+)=\"?(.+?)\"?$/; + ($_ = $header) =~ s/^(\w)(.*)/"\u$1\L$2" . ': '.$self->unescapeHTML($value)/e; + } + + $type ||= 'text/html' unless defined($type); + $type .= "; charset=$charset" if $type ne '' and $type =~ m!^text/! and $type !~ /\bcharset\b/ and $charset ne ''; + + # Maybe future compatibility. Maybe not. + my $protocol = $ENV{SERVER_PROTOCOL} || 'HTTP/1.0'; + push(@header,$protocol . ' ' . ($status || '200 OK')) if $nph; + push(@header,"Server: " . &server_software()) if $nph; + + push(@header,"Status: $status") if $status; + push(@header,"Window-Target: $target") if $target; + if ($p3p) { + $p3p = join ' ',@$p3p if ref($p3p) eq 'ARRAY'; + push(@header,qq(P3P: policyref="/w3c/p3p.xml", CP="$p3p")); + } + # push all the cookies -- there may be several + if ($cookie) { + my(@cookie) = ref($cookie) && ref($cookie) eq 'ARRAY' ? @{$cookie} : $cookie; + foreach (@cookie) { + my $cs = UNIVERSAL::isa($_,'CGI::Cookie') ? $_->as_string : $_; + push(@header,"Set-Cookie: $cs") if $cs ne ''; + } + } + # if the user indicates an expiration time, then we need + # both an Expires and a Date header (so that the browser is + # uses OUR clock) + push(@header,"Expires: " . expires($expires,'http')) + if $expires; + push(@header,"Date: " . expires(0,'http')) if $expires || $cookie || $nph; + push(@header,"Pragma: no-cache") if $self->cache(); + push(@header,"Content-Disposition: attachment; filename=\"$attachment\"") if $attachment; + push(@header,map {ucfirst $_} @other); + push(@header,"Content-Type: $type") if $type ne ''; + my $header = join($CRLF,@header)."${CRLF}${CRLF}"; + if ($MOD_PERL and not $nph) { + $self->r->send_cgi_header($header); + return ''; + } + return $header; +} +END_OF_FUNC + + +#### Method: cache +# Control whether header() will produce the no-cache +# Pragma directive. +#### +'cache' => <<'END_OF_FUNC', +sub cache { + my($self,$new_value) = self_or_default(@_); + $new_value = '' unless $new_value; + if ($new_value ne '') { + $self->{'cache'} = $new_value; + } + return $self->{'cache'}; +} +END_OF_FUNC + + +#### Method: redirect +# Return a Location: style header +# +#### +'redirect' => <<'END_OF_FUNC', +sub redirect { + my($self,@p) = self_or_default(@_); + my($url,$target,$status,$cookie,$nph,@other) = + rearrange([[LOCATION,URI,URL],TARGET,STATUS,['COOKIE','COOKIES'],NPH],@p); + $status = '302 Moved' unless defined $status; + $url ||= $self->self_url; + my(@o); + foreach (@other) { tr/\"//d; push(@o,split("=",$_,2)); } + unshift(@o, + '-Status' => $status, + '-Location'=> $url, + '-nph' => $nph); + unshift(@o,'-Target'=>$target) if $target; + unshift(@o,'-Type'=>''); + my @unescaped; + unshift(@unescaped,'-Cookie'=>$cookie) if $cookie; + return $self->header((map {$self->unescapeHTML($_)} @o),@unescaped); +} +END_OF_FUNC + + +#### Method: start_html +# Canned HTML header +# +# Parameters: +# $title -> (optional) The title for this HTML document (-title) +# $author -> (optional) e-mail address of the author (-author) +# $base -> (optional) if set to true, will enter the BASE address of this document +# for resolving relative references (-base) +# $xbase -> (optional) alternative base at some remote location (-xbase) +# $target -> (optional) target window to load all links into (-target) +# $script -> (option) Javascript code (-script) +# $no_script -> (option) Javascript +END + ; + my($other) = @other ? " @other" : ''; + push(@result,""); + return join("\n",@result); +} +END_OF_FUNC + +### Method: _style +# internal method for generating a CSS style section +#### +'_style' => <<'END_OF_FUNC', +sub _style { + my ($self,$style) = @_; + my (@result); + my $type = 'text/css'; + + my $cdata_start = $XHTML ? "\n\n" : " -->\n"; + + my @s = ref($style) eq 'ARRAY' ? @$style : $style; + + for my $s (@s) { + if (ref($s)) { + my($src,$code,$verbatim,$stype,$foo,@other) = + rearrange([qw(SRC CODE VERBATIM TYPE FOO)], + ('-foo'=>'bar', + ref($s) eq 'ARRAY' ? @$s : %$s)); + $type = $stype if $stype; + my $other = @other ? join ' ',@other : ''; + + if (ref($src) eq "ARRAY") # Check to see if the $src variable is an array reference + { # If it is, push a LINK tag for each one + foreach $src (@$src) + { + push(@result,$XHTML ? qq() + : qq()) if $src; + } + } + else + { # Otherwise, push the single -src, if it exists. + push(@result,$XHTML ? qq() + : qq() + ) if $src; + } + if ($verbatim) { + my @v = ref($verbatim) eq 'ARRAY' ? @$verbatim : $verbatim; + push(@result, "") foreach @v; + } + my @c = ref($code) eq 'ARRAY' ? @$code : $code if $code; + push(@result,style({'type'=>$type},"$cdata_start\n$_\n$cdata_end")) foreach @c; + + } else { + my $src = $s; + push(@result,$XHTML ? qq() + : qq()); + } + } + @result; +} +END_OF_FUNC + +'_script' => <<'END_OF_FUNC', +sub _script { + my ($self,$script) = @_; + my (@result); + + my (@scripts) = ref($script) eq 'ARRAY' ? @$script : ($script); + foreach $script (@scripts) { + my($src,$code,$language); + if (ref($script)) { # script is a hash + ($src,$code,$language, $type) = + rearrange([SRC,CODE,LANGUAGE,TYPE], + '-foo'=>'bar', # a trick to allow the '-' to be omitted + ref($script) eq 'ARRAY' ? @$script : %$script); + # User may not have specified language + $language ||= 'JavaScript'; + unless (defined $type) { + $type = lc $language; + # strip '1.2' from 'javascript1.2' + $type =~ s/^(\D+).*$/text\/$1/; + } + } else { + ($src,$code,$language, $type) = ('',$script,'JavaScript', 'text/javascript'); + } + + my $comment = '//'; # javascript by default + $comment = '#' if $type=~/perl|tcl/i; + $comment = "'" if $type=~/vbscript/i; + + my ($cdata_start,$cdata_end); + if ($XHTML) { + $cdata_start = "$comment"; + } else { + $cdata_start = "\n\n"; + } + my(@satts); + push(@satts,'src'=>$src) if $src; + push(@satts,'language'=>$language) unless defined $type; + push(@satts,'type'=>$type); + $code = "$cdata_start$code$cdata_end" if defined $code; + push(@result,script({@satts},$code || '')); + } + @result; +} +END_OF_FUNC + +#### Method: end_html +# End an HTML document. +# Trivial method for completeness. Just returns "" +#### +'end_html' => <<'END_OF_FUNC', +sub end_html { + return ""; +} +END_OF_FUNC + + +################################ +# METHODS USED IN BUILDING FORMS +################################ + +#### Method: isindex +# Just prints out the isindex tag. +# Parameters: +# $action -> optional URL of script to run +# Returns: +# A string containing a tag +'isindex' => <<'END_OF_FUNC', +sub isindex { + my($self,@p) = self_or_default(@_); + my($action,@other) = rearrange([ACTION],@p); + $action = qq/ action="$action"/ if $action; + my($other) = @other ? " @other" : ''; + return $XHTML ? "" : ""; +} +END_OF_FUNC + + +#### Method: startform +# Start a form +# Parameters: +# $method -> optional submission method to use (GET or POST) +# $action -> optional URL of script to run +# $enctype ->encoding to use (URL_ENCODED or MULTIPART) +'startform' => <<'END_OF_FUNC', +sub startform { + my($self,@p) = self_or_default(@_); + + my($method,$action,$enctype,@other) = + rearrange([METHOD,ACTION,ENCTYPE],@p); + + $method = $self->escapeHTML(lc($method) || 'post'); + $enctype = $self->escapeHTML($enctype || &URL_ENCODED); + if (defined $action) { + $action = $self->escapeHTML($action); + } + else { + $action = $self->escapeHTML($self->url(-absolute=>1,-path=>1)); + if (exists $ENV{QUERY_STRING} && length($ENV{QUERY_STRING})>0) { + $action .= "?".$self->escapeHTML($ENV{QUERY_STRING},1); + } + } + $action = qq(action="$action"); + my($other) = @other ? " @other" : ''; + $self->{'.parametersToAdd'}={}; + return qq/
    \n/; +} +END_OF_FUNC + + +#### Method: start_form +# synonym for startform +'start_form' => <<'END_OF_FUNC', +sub start_form { + &startform; +} +END_OF_FUNC + +'end_multipart_form' => <<'END_OF_FUNC', +sub end_multipart_form { + &endform; +} +END_OF_FUNC + +#### Method: start_multipart_form +# synonym for startform +'start_multipart_form' => <<'END_OF_FUNC', +sub start_multipart_form { + my($self,@p) = self_or_default(@_); + if (defined($param[0]) && substr($param[0],0,1) eq '-') { + my(%p) = @p; + $p{'-enctype'}=&MULTIPART; + return $self->startform(%p); + } else { + my($method,$action,@other) = + rearrange([METHOD,ACTION],@p); + return $self->startform($method,$action,&MULTIPART,@other); + } +} +END_OF_FUNC + + +#### Method: endform +# End a form +'endform' => <<'END_OF_FUNC', +sub endform { + my($self,@p) = self_or_default(@_); + if ( $NOSTICKY ) { + return wantarray ? ("
    ") : "\n"; + } else { + return wantarray ? ("
    ",$self->get_fields,"
    ","") : + "
    ".$self->get_fields ."
    \n"; + } +} +END_OF_FUNC + + +'_textfield' => <<'END_OF_FUNC', +sub _textfield { + my($self,$tag,@p) = self_or_default(@_); + my($name,$default,$size,$maxlength,$override,@other) = + rearrange([NAME,[DEFAULT,VALUE,VALUES],SIZE,MAXLENGTH,[OVERRIDE,FORCE]],@p); + + my $current = $override ? $default : + (defined($self->param($name)) ? $self->param($name) : $default); + + $current = defined($current) ? $self->escapeHTML($current,1) : ''; + $name = defined($name) ? $self->escapeHTML($name) : ''; + my($s) = defined($size) ? qq/ size="$size"/ : ''; + my($m) = defined($maxlength) ? qq/ maxlength="$maxlength"/ : ''; + my($other) = @other ? " @other" : ''; + # this entered at cristy's request to fix problems with file upload fields + # and WebTV -- not sure it won't break stuff + my($value) = $current ne '' ? qq(value="$current") : ''; + return $XHTML ? qq() + : qq(); +} +END_OF_FUNC + +#### Method: textfield +# Parameters: +# $name -> Name of the text field +# $default -> Optional default value of the field if not +# already defined. +# $size -> Optional width of field in characaters. +# $maxlength -> Optional maximum number of characters. +# Returns: +# A string containing a field +# +'textfield' => <<'END_OF_FUNC', +sub textfield { + my($self,@p) = self_or_default(@_); + $self->_textfield('text',@p); +} +END_OF_FUNC + + +#### Method: filefield +# Parameters: +# $name -> Name of the file upload field +# $size -> Optional width of field in characaters. +# $maxlength -> Optional maximum number of characters. +# Returns: +# A string containing a field +# +'filefield' => <<'END_OF_FUNC', +sub filefield { + my($self,@p) = self_or_default(@_); + $self->_textfield('file',@p); +} +END_OF_FUNC + + +#### Method: password +# Create a "secret password" entry field +# Parameters: +# $name -> Name of the field +# $default -> Optional default value of the field if not +# already defined. +# $size -> Optional width of field in characters. +# $maxlength -> Optional maximum characters that can be entered. +# Returns: +# A string containing a field +# +'password_field' => <<'END_OF_FUNC', +sub password_field { + my ($self,@p) = self_or_default(@_); + $self->_textfield('password',@p); +} +END_OF_FUNC + +#### Method: textarea +# Parameters: +# $name -> Name of the text field +# $default -> Optional default value of the field if not +# already defined. +# $rows -> Optional number of rows in text area +# $columns -> Optional number of columns in text area +# Returns: +# A string containing a tag +# +'textarea' => <<'END_OF_FUNC', +sub textarea { + my($self,@p) = self_or_default(@_); + + my($name,$default,$rows,$cols,$override,@other) = + rearrange([NAME,[DEFAULT,VALUE],ROWS,[COLS,COLUMNS],[OVERRIDE,FORCE]],@p); + + my($current)= $override ? $default : + (defined($self->param($name)) ? $self->param($name) : $default); + + $name = defined($name) ? $self->escapeHTML($name) : ''; + $current = defined($current) ? $self->escapeHTML($current) : ''; + my($r) = $rows ? qq/ rows="$rows"/ : ''; + my($c) = $cols ? qq/ cols="$cols"/ : ''; + my($other) = @other ? " @other" : ''; + return qq{}; +} +END_OF_FUNC + + +#### Method: button +# Create a javascript button. +# Parameters: +# $name -> (optional) Name for the button. (-name) +# $value -> (optional) Value of the button when selected (and visible name) (-value) +# $onclick -> (optional) Text of the JavaScript to run when the button is +# clicked. +# Returns: +# A string containing a tag +#### +'button' => <<'END_OF_FUNC', +sub button { + my($self,@p) = self_or_default(@_); + + my($label,$value,$script,@other) = rearrange([NAME,[VALUE,LABEL], + [ONCLICK,SCRIPT]],@p); + + $label=$self->escapeHTML($label); + $value=$self->escapeHTML($value,1); + $script=$self->escapeHTML($script); + + my($name) = ''; + $name = qq/ name="$label"/ if $label; + $value = $value || $label; + my($val) = ''; + $val = qq/ value="$value"/ if $value; + $script = qq/ onclick="$script"/ if $script; + my($other) = @other ? " @other" : ''; + return $XHTML ? qq() + : qq(); +} +END_OF_FUNC + + +#### Method: submit +# Create a "submit query" button. +# Parameters: +# $name -> (optional) Name for the button. +# $value -> (optional) Value of the button when selected (also doubles as label). +# $label -> (optional) Label printed on the button(also doubles as the value). +# Returns: +# A string containing a tag +#### +'submit' => <<'END_OF_FUNC', +sub submit { + my($self,@p) = self_or_default(@_); + + my($label,$value,@other) = rearrange([NAME,[VALUE,LABEL]],@p); + + $label=$self->escapeHTML($label); + $value=$self->escapeHTML($value,1); + + my $name = $NOSTICKY ? '' : ' name=".submit"'; + $name = qq/ name="$label"/ if defined($label); + $value = defined($value) ? $value : $label; + my $val = ''; + $val = qq/ value="$value"/ if defined($value); + my($other) = @other ? " @other" : ''; + return $XHTML ? qq() + : qq(); +} +END_OF_FUNC + + +#### Method: reset +# Create a "reset" button. +# Parameters: +# $name -> (optional) Name for the button. +# Returns: +# A string containing a tag +#### +'reset' => <<'END_OF_FUNC', +sub reset { + my($self,@p) = self_or_default(@_); + my($label,$value,@other) = rearrange(['NAME',['VALUE','LABEL']],@p); + $label=$self->escapeHTML($label); + $value=$self->escapeHTML($value,1); + my ($name) = ' name=".reset"'; + $name = qq/ name="$label"/ if defined($label); + $value = defined($value) ? $value : $label; + my($val) = ''; + $val = qq/ value="$value"/ if defined($value); + my($other) = @other ? " @other" : ''; + return $XHTML ? qq() + : qq(); +} +END_OF_FUNC + + +#### Method: defaults +# Create a "defaults" button. +# Parameters: +# $name -> (optional) Name for the button. +# Returns: +# A string containing a tag +# +# Note: this button has a special meaning to the initialization script, +# and tells it to ERASE the current query string so that your defaults +# are used again! +#### +'defaults' => <<'END_OF_FUNC', +sub defaults { + my($self,@p) = self_or_default(@_); + + my($label,@other) = rearrange([[NAME,VALUE]],@p); + + $label=$self->escapeHTML($label,1); + $label = $label || "Defaults"; + my($value) = qq/ value="$label"/; + my($other) = @other ? " @other" : ''; + return $XHTML ? qq() + : qq//; +} +END_OF_FUNC + + +#### Method: comment +# Create an HTML +# Parameters: a string +'comment' => <<'END_OF_FUNC', +sub comment { + my($self,@p) = self_or_CGI(@_); + return ""; +} +END_OF_FUNC + +#### Method: checkbox +# Create a checkbox that is not logically linked to any others. +# The field value is "on" when the button is checked. +# Parameters: +# $name -> Name of the checkbox +# $checked -> (optional) turned on by default if true +# $value -> (optional) value of the checkbox, 'on' by default +# $label -> (optional) a user-readable label printed next to the box. +# Otherwise the checkbox name is used. +# Returns: +# A string containing a field +#### +'checkbox' => <<'END_OF_FUNC', +sub checkbox { + my($self,@p) = self_or_default(@_); + + my($name,$checked,$value,$label,$override,@other) = + rearrange([NAME,[CHECKED,SELECTED,ON],VALUE,LABEL,[OVERRIDE,FORCE]],@p); + + $value = defined $value ? $value : 'on'; + + if (!$override && ($self->{'.fieldnames'}->{$name} || + defined $self->param($name))) { + $checked = grep($_ eq $value,$self->param($name)) ? $self->_checked(1) : ''; + } else { + $checked = $self->_checked($checked); + } + my($the_label) = defined $label ? $label : $name; + $name = $self->escapeHTML($name); + $value = $self->escapeHTML($value,1); + $the_label = $self->escapeHTML($the_label); + my($other) = @other ? " @other" : ''; + $self->register_parameter($name); + return $XHTML ? qq{$the_label} + : qq{$the_label}; +} +END_OF_FUNC + + +#### Method: checkbox_group +# Create a list of logically-linked checkboxes. +# Parameters: +# $name -> Common name for all the check boxes +# $values -> A pointer to a regular array containing the +# values for each checkbox in the group. +# $defaults -> (optional) +# 1. If a pointer to a regular array of checkbox values, +# then this will be used to decide which +# checkboxes to turn on by default. +# 2. If a scalar, will be assumed to hold the +# value of a single checkbox in the group to turn on. +# $linebreak -> (optional) Set to true to place linebreaks +# between the buttons. +# $labels -> (optional) +# A pointer to an associative array of labels to print next to each checkbox +# in the form $label{'value'}="Long explanatory label". +# Otherwise the provided values are used as the labels. +# Returns: +# An ARRAY containing a series of fields +#### +'checkbox_group' => <<'END_OF_FUNC', +sub checkbox_group { + my($self,@p) = self_or_default(@_); + + my($name,$values,$defaults,$linebreak,$labels,$attributes,$rows,$columns, + $rowheaders,$colheaders,$override,$nolabels,@other) = + rearrange([NAME,[VALUES,VALUE],[DEFAULTS,DEFAULT], + LINEBREAK,LABELS,ATTRIBUTES,ROWS,[COLUMNS,COLS], + ROWHEADERS,COLHEADERS, + [OVERRIDE,FORCE],NOLABELS],@p); + + my($checked,$break,$result,$label); + + my(%checked) = $self->previous_or_default($name,$defaults,$override); + + if ($linebreak) { + $break = $XHTML ? "
    " : "
    "; + } + else { + $break = ''; + } + $name=$self->escapeHTML($name); + + # Create the elements + my(@elements,@values); + + @values = $self->_set_values_and_labels($values,\$labels,$name); + + my($other) = @other ? " @other" : ''; + foreach (@values) { + $checked = $self->_checked($checked{$_}); + $label = ''; + unless (defined($nolabels) && $nolabels) { + $label = $_; + $label = $labels->{$_} if defined($labels) && defined($labels->{$_}); + $label = $self->escapeHTML($label); + } + my $attribs = $self->_set_attributes($_, $attributes); + $_ = $self->escapeHTML($_,1); + push(@elements,$XHTML ? qq(${label}${break}) + : qq/${label}${break}/); + } + $self->register_parameter($name); + return wantarray ? @elements : join(' ',@elements) + unless defined($columns) || defined($rows); + $rows = 1 if $rows && $rows < 1; + $cols = 1 if $cols && $cols < 1; + return _tableize($rows,$columns,$rowheaders,$colheaders,@elements); +} +END_OF_FUNC + +# Escape HTML -- used internally +'escapeHTML' => <<'END_OF_FUNC', +sub escapeHTML { + # hack to work around earlier hacks + push @_,$_[0] if @_==1 && $_[0] eq 'CGI'; + my ($self,$toencode,$newlinestoo) = CGI::self_or_default(@_); + return undef unless defined($toencode); + return $toencode if ref($self) && !$self->{'escape'}; + $toencode =~ s{&}{&}gso; + $toencode =~ s{<}{<}gso; + $toencode =~ s{>}{>}gso; + if ($DTD_PUBLIC_IDENTIFIER =~ /[^X]HTML 3\.2/i) { + # $quot; was accidentally omitted from the HTML 3.2 DTD -- see + # / + # . + $toencode =~ s{"}{"}gso; + } + else { + $toencode =~ s{"}{"}gso; + } + my $latin = uc $self->{'.charset'} eq 'ISO-8859-1' || + uc $self->{'.charset'} eq 'WINDOWS-1252'; + if ($latin) { # bug in some browsers + $toencode =~ s{'}{'}gso; + $toencode =~ s{\x8b}{‹}gso; + $toencode =~ s{\x9b}{›}gso; + if (defined $newlinestoo && $newlinestoo) { + $toencode =~ s{\012}{ }gso; + $toencode =~ s{\015}{ }gso; + } + } + return $toencode; +} +END_OF_FUNC + +# unescape HTML -- used internally +'unescapeHTML' => <<'END_OF_FUNC', +sub unescapeHTML { + # hack to work around earlier hacks + push @_,$_[0] if @_==1 && $_[0] eq 'CGI'; + my ($self,$string) = CGI::self_or_default(@_); + return undef unless defined($string); + my $latin = defined $self->{'.charset'} ? $self->{'.charset'} =~ /^(ISO-8859-1|WINDOWS-1252)$/i + : 1; + # thanks to Randal Schwartz for the correct solution to this one + $string=~ s[&(.*?);]{ + local $_ = $1; + /^amp$/i ? "&" : + /^quot$/i ? '"' : + /^gt$/i ? ">" : + /^lt$/i ? "<" : + /^#(\d+)$/ && $latin ? chr($1) : + /^#x([0-9a-f]+)$/i && $latin ? chr(hex($1)) : + $_ + }gex; + return $string; +} +END_OF_FUNC + +# Internal procedure - don't use +'_tableize' => <<'END_OF_FUNC', +sub _tableize { + my($rows,$columns,$rowheaders,$colheaders,@elements) = @_; + $rowheaders = [] unless defined $rowheaders; + $colheaders = [] unless defined $colheaders; + my($result); + + if (defined($columns)) { + $rows = int(0.99 + @elements/$columns) unless defined($rows); + } + if (defined($rows)) { + $columns = int(0.99 + @elements/$rows) unless defined($columns); + } + + # rearrange into a pretty table + $result = ""; + my($row,$column); + unshift(@$colheaders,'') if @$colheaders && @$rowheaders; + $result .= "" if @{$colheaders}; + foreach (@{$colheaders}) { + $result .= ""; + } + for ($row=0;$row<$rows;$row++) { + $result .= ""; + $result .= "" if @$rowheaders; + for ($column=0;$column<$columns;$column++) { + $result .= "" + if defined($elements[$column*$rows + $row]); + } + $result .= ""; + } + $result .= "
    $_
    $rowheaders->[$row]" . $elements[$column*$rows + $row] . "
    "; + return $result; +} +END_OF_FUNC + + +#### Method: radio_group +# Create a list of logically-linked radio buttons. +# Parameters: +# $name -> Common name for all the buttons. +# $values -> A pointer to a regular array containing the +# values for each button in the group. +# $default -> (optional) Value of the button to turn on by default. Pass '-' +# to turn _nothing_ on. +# $linebreak -> (optional) Set to true to place linebreaks +# between the buttons. +# $labels -> (optional) +# A pointer to an associative array of labels to print next to each checkbox +# in the form $label{'value'}="Long explanatory label". +# Otherwise the provided values are used as the labels. +# Returns: +# An ARRAY containing a series of fields +#### +'radio_group' => <<'END_OF_FUNC', +sub radio_group { + my($self,@p) = self_or_default(@_); + + my($name,$values,$default,$linebreak,$labels,$attributes, + $rows,$columns,$rowheaders,$colheaders,$override,$nolabels,@other) = + rearrange([NAME,[VALUES,VALUE],DEFAULT,LINEBREAK,LABELS,ATTRIBUTES, + ROWS,[COLUMNS,COLS], + ROWHEADERS,COLHEADERS, + [OVERRIDE,FORCE],NOLABELS],@p); + my($result,$checked); + + if (!$override && defined($self->param($name))) { + $checked = $self->param($name); + } else { + $checked = $default; + } + my(@elements,@values); + @values = $self->_set_values_and_labels($values,\$labels,$name); + + # If no check array is specified, check the first by default + $checked = $values[0] unless defined($checked) && $checked ne ''; + $name=$self->escapeHTML($name); + + my($other) = @other ? " @other" : ''; + foreach (@values) { + my($checkit) = $checked eq $_ ? qq/ checked="checked"/ : ''; + my($break); + if ($linebreak) { + $break = $XHTML ? "
    " : "
    "; + } + else { + $break = ''; + } + my($label)=''; + unless (defined($nolabels) && $nolabels) { + $label = $_; + $label = $labels->{$_} if defined($labels) && defined($labels->{$_}); + $label = $self->escapeHTML($label,1); + } + my $attribs = $self->_set_attributes($_, $attributes); + $_=$self->escapeHTML($_); + push(@elements,$XHTML ? qq(${label}${break}) + : qq/${label}${break}/); + } + $self->register_parameter($name); + return wantarray ? @elements : join(' ',@elements) + unless defined($columns) || defined($rows); + return _tableize($rows,$columns,$rowheaders,$colheaders,@elements); +} +END_OF_FUNC + + +#### Method: popup_menu +# Create a popup menu. +# Parameters: +# $name -> Name for all the menu +# $values -> A pointer to a regular array containing the +# text of each menu item. +# $default -> (optional) Default item to display +# $labels -> (optional) +# A pointer to an associative array of labels to print next to each checkbox +# in the form $label{'value'}="Long explanatory label". +# Otherwise the provided values are used as the labels. +# Returns: +# A string containing the definition of a popup menu. +#### +'popup_menu' => <<'END_OF_FUNC', +sub popup_menu { + my($self,@p) = self_or_default(@_); + + my($name,$values,$default,$labels,$attributes,$override,@other) = + rearrange([NAME,[VALUES,VALUE],[DEFAULT,DEFAULTS],LABELS, + ATTRIBUTES,[OVERRIDE,FORCE]],@p); + my($result,$selected); + + if (!$override && defined($self->param($name))) { + $selected = $self->param($name); + } else { + $selected = $default; + } + $name=$self->escapeHTML($name); + my($other) = @other ? " @other" : ''; + + my(@values); + @values = $self->_set_values_and_labels($values,\$labels,$name); + + $result = qq/"; + return $result; +} +END_OF_FUNC + + +#### Method: optgroup +# Create a optgroup. +# Parameters: +# $name -> Label for the group +# $values -> A pointer to a regular array containing the +# values for each option line in the group. +# $labels -> (optional) +# A pointer to an associative array of labels to print next to each item +# in the form $label{'value'}="Long explanatory label". +# Otherwise the provided values are used as the labels. +# $labeled -> (optional) +# A true value indicates the value should be used as the label attribute +# in the option elements. +# The label attribute specifies the option label presented to the user. +# This defaults to the content of the \n/; + foreach (@values) { + if (/_set_attributes($_, $attributes); + my($label) = $_; + $label = $labels->{$_} if defined($labels) && defined($labels->{$_}); + $label=$self->escapeHTML($label); + my($value)=$self->escapeHTML($_,1); + $result .= $labeled ? $novals ? "$label\n" + : "$label\n" + : $novals ? "$label\n" + : "$label\n"; + } + } + $result .= ""; + return $result; +} +END_OF_FUNC + + +#### Method: scrolling_list +# Create a scrolling list. +# Parameters: +# $name -> name for the list +# $values -> A pointer to a regular array containing the +# values for each option line in the list. +# $defaults -> (optional) +# 1. If a pointer to a regular array of options, +# then this will be used to decide which +# lines to turn on by default. +# 2. Otherwise holds the value of the single line to turn on. +# $size -> (optional) Size of the list. +# $multiple -> (optional) If set, allow multiple selections. +# $labels -> (optional) +# A pointer to an associative array of labels to print next to each checkbox +# in the form $label{'value'}="Long explanatory label". +# Otherwise the provided values are used as the labels. +# Returns: +# A string containing the definition of a scrolling list. +#### +'scrolling_list' => <<'END_OF_FUNC', +sub scrolling_list { + my($self,@p) = self_or_default(@_); + my($name,$values,$defaults,$size,$multiple,$labels,$attributes,$override,@other) + = rearrange([NAME,[VALUES,VALUE],[DEFAULTS,DEFAULT], + SIZE,MULTIPLE,LABELS,ATTRIBUTES,[OVERRIDE,FORCE]],@p); + + my($result,@values); + @values = $self->_set_values_and_labels($values,\$labels,$name); + + $size = $size || scalar(@values); + + my(%selected) = $self->previous_or_default($name,$defaults,$override); + my($is_multiple) = $multiple ? qq/ multiple="multiple"/ : ''; + my($has_size) = $size ? qq/ size="$size"/: ''; + my($other) = @other ? " @other" : ''; + + $name=$self->escapeHTML($name); + $result = qq/"; + $self->register_parameter($name); + return $result; +} +END_OF_FUNC + + +#### Method: hidden +# Parameters: +# $name -> Name of the hidden field +# @default -> (optional) Initial values of field (may be an array) +# or +# $default->[initial values of field] +# Returns: +# A string containing a +#### +'hidden' => <<'END_OF_FUNC', +sub hidden { + my($self,@p) = self_or_default(@_); + + # this is the one place where we departed from our standard + # calling scheme, so we have to special-case (darn) + my(@result,@value); + my($name,$default,$override,@other) = + rearrange([NAME,[DEFAULT,VALUE,VALUES],[OVERRIDE,FORCE]],@p); + + my $do_override = 0; + if ( ref($p[0]) || substr($p[0],0,1) eq '-') { + @value = ref($default) ? @{$default} : $default; + $do_override = $override; + } else { + foreach ($default,$override,@other) { + push(@value,$_) if defined($_); + } + } + + # use previous values if override is not set + my @prev = $self->param($name); + @value = @prev if !$do_override && @prev; + + $name=$self->escapeHTML($name); + foreach (@value) { + $_ = defined($_) ? $self->escapeHTML($_,1) : ''; + push @result,$XHTML ? qq() + : qq(); + } + return wantarray ? @result : join('',@result); +} +END_OF_FUNC + + +#### Method: image_button +# Parameters: +# $name -> Name of the button +# $src -> URL of the image source +# $align -> Alignment style (TOP, BOTTOM or MIDDLE) +# Returns: +# A string containing a +#### +'image_button' => <<'END_OF_FUNC', +sub image_button { + my($self,@p) = self_or_default(@_); + + my($name,$src,$alignment,@other) = + rearrange([NAME,SRC,ALIGN],@p); + + my($align) = $alignment ? " align=\U\"$alignment\"" : ''; + my($other) = @other ? " @other" : ''; + $name=$self->escapeHTML($name); + return $XHTML ? qq() + : qq//; +} +END_OF_FUNC + + +#### Method: self_url +# Returns a URL containing the current script and all its +# param/value pairs arranged as a query. You can use this +# to create a link that, when selected, will reinvoke the +# script with all its state information preserved. +#### +'self_url' => <<'END_OF_FUNC', +sub self_url { + my($self,@p) = self_or_default(@_); + return $self->url('-path_info'=>1,'-query'=>1,'-full'=>1,@p); +} +END_OF_FUNC + + +# This is provided as a synonym to self_url() for people unfortunate +# enough to have incorporated it into their programs already! +'state' => <<'END_OF_FUNC', +sub state { + &self_url; +} +END_OF_FUNC + + +#### Method: url +# Like self_url, but doesn't return the query string part of +# the URL. +#### +'url' => <<'END_OF_FUNC', +sub url { + my($self,@p) = self_or_default(@_); + my ($relative,$absolute,$full,$path_info,$query,$base) = + rearrange(['RELATIVE','ABSOLUTE','FULL',['PATH','PATH_INFO'],['QUERY','QUERY_STRING'],'BASE'],@p); + my $url; + $full++ if $base || !($relative || $absolute); + + my $path = $self->path_info; + my $script_name = $self->script_name; + + # for compatibility with Apache's MultiViews + if (exists($ENV{REQUEST_URI})) { + my $index; + $script_name = unescape($ENV{REQUEST_URI}); + $script_name =~ s/\?.+$//s; # strip query string + # and path + if (exists($ENV{PATH_INFO})) { + my $encoded_path = unescape($ENV{PATH_INFO}); + $script_name =~ s/\Q$encoded_path\E$//i; + } + } + + if ($full) { + my $protocol = $self->protocol(); + $url = "$protocol://"; + my $vh = http('x_forwarded_host') || http('host'); + if ($vh) { + $url .= $vh; + } else { + $url .= server_name(); + my $port = $self->server_port; + $url .= ":" . $port + unless (lc($protocol) eq 'http' && $port == 80) + || (lc($protocol) eq 'https' && $port == 443); + } + return $url if $base; + $url .= $script_name; + } elsif ($relative) { + ($url) = $script_name =~ m!([^/]+)$!; + } elsif ($absolute) { + $url = $script_name; + } + + $url .= $path if $path_info and defined $path; + $url .= "?" . $self->query_string if $query and $self->query_string; + $url = '' unless defined $url; + $url =~ s/([^a-zA-Z0-9_.%;&?\/\\:+=~-])/sprintf("%%%02X",ord($1))/eg; + return $url; +} + +END_OF_FUNC + +#### Method: cookie +# Set or read a cookie from the specified name. +# Cookie can then be passed to header(). +# Usual rules apply to the stickiness of -value. +# Parameters: +# -name -> name for this cookie (optional) +# -value -> value of this cookie (scalar, array or hash) +# -path -> paths for which this cookie is valid (optional) +# -domain -> internet domain in which this cookie is valid (optional) +# -secure -> if true, cookie only passed through secure channel (optional) +# -expires -> expiry date in format Wdy, DD-Mon-YYYY HH:MM:SS GMT (optional) +#### +'cookie' => <<'END_OF_FUNC', +sub cookie { + my($self,@p) = self_or_default(@_); + my($name,$value,$path,$domain,$secure,$expires) = + rearrange([NAME,[VALUE,VALUES],PATH,DOMAIN,SECURE,EXPIRES],@p); + + require CGI::Cookie; + + # if no value is supplied, then we retrieve the + # value of the cookie, if any. For efficiency, we cache the parsed + # cookies in our state variables. + unless ( defined($value) ) { + $self->{'.cookies'} = CGI::Cookie->fetch + unless $self->{'.cookies'}; + + # If no name is supplied, then retrieve the names of all our cookies. + return () unless $self->{'.cookies'}; + return keys %{$self->{'.cookies'}} unless $name; + return () unless $self->{'.cookies'}->{$name}; + return $self->{'.cookies'}->{$name}->value if defined($name) && $name ne ''; + } + + # If we get here, we're creating a new cookie + return undef unless defined($name) && $name ne ''; # this is an error + + my @param; + push(@param,'-name'=>$name); + push(@param,'-value'=>$value); + push(@param,'-domain'=>$domain) if $domain; + push(@param,'-path'=>$path) if $path; + push(@param,'-expires'=>$expires) if $expires; + push(@param,'-secure'=>$secure) if $secure; + + return new CGI::Cookie(@param); +} +END_OF_FUNC + +'parse_keywordlist' => <<'END_OF_FUNC', +sub parse_keywordlist { + my($self,$tosplit) = @_; + $tosplit = unescape($tosplit); # unescape the keywords + $tosplit=~tr/+/ /; # pluses to spaces + my(@keywords) = split(/\s+/,$tosplit); + return @keywords; +} +END_OF_FUNC + +'param_fetch' => <<'END_OF_FUNC', +sub param_fetch { + my($self,@p) = self_or_default(@_); + my($name) = rearrange([NAME],@p); + unless (exists($self->{$name})) { + $self->add_parameter($name); + $self->{$name} = []; + } + + return $self->{$name}; +} +END_OF_FUNC + +############################################### +# OTHER INFORMATION PROVIDED BY THE ENVIRONMENT +############################################### + +#### Method: path_info +# Return the extra virtual path information provided +# after the URL (if any) +#### +'path_info' => <<'END_OF_FUNC', +sub path_info { + my ($self,$info) = self_or_default(@_); + if (defined($info)) { + $info = "/$info" if $info ne '' && substr($info,0,1) ne '/'; + $self->{'.path_info'} = $info; + } elsif (! defined($self->{'.path_info'}) ) { + $self->{'.path_info'} = defined($ENV{'PATH_INFO'}) ? + $ENV{'PATH_INFO'} : ''; + + # hack to fix broken path info in IIS + $self->{'.path_info'} =~ s/^\Q$ENV{'SCRIPT_NAME'}\E// if $IIS; + + } + return $self->{'.path_info'}; +} +END_OF_FUNC + + +#### Method: request_method +# Returns 'POST', 'GET', 'PUT' or 'HEAD' +#### +'request_method' => <<'END_OF_FUNC', +sub request_method { + return $ENV{'REQUEST_METHOD'}; +} +END_OF_FUNC + +#### Method: content_type +# Returns the content_type string +#### +'content_type' => <<'END_OF_FUNC', +sub content_type { + return $ENV{'CONTENT_TYPE'}; +} +END_OF_FUNC + +#### Method: path_translated +# Return the physical path information provided +# by the URL (if any) +#### +'path_translated' => <<'END_OF_FUNC', +sub path_translated { + return $ENV{'PATH_TRANSLATED'}; +} +END_OF_FUNC + + +#### Method: query_string +# Synthesize a query string from our current +# parameters +#### +'query_string' => <<'END_OF_FUNC', +sub query_string { + my($self) = self_or_default(@_); + my($param,$value,@pairs); + foreach $param ($self->param) { + my($eparam) = escape($param); + foreach $value ($self->param($param)) { + $value = escape($value); + next unless defined $value; + push(@pairs,"$eparam=$value"); + } + } + foreach (keys %{$self->{'.fieldnames'}}) { + push(@pairs,".cgifields=".escape("$_")); + } + return join($USE_PARAM_SEMICOLONS ? ';' : '&',@pairs); +} +END_OF_FUNC + + +#### Method: accept +# Without parameters, returns an array of the +# MIME types the browser accepts. +# With a single parameter equal to a MIME +# type, will return undef if the browser won't +# accept it, 1 if the browser accepts it but +# doesn't give a preference, or a floating point +# value between 0.0 and 1.0 if the browser +# declares a quantitative score for it. +# This handles MIME type globs correctly. +#### +'Accept' => <<'END_OF_FUNC', +sub Accept { + my($self,$search) = self_or_CGI(@_); + my(%prefs,$type,$pref,$pat); + + my(@accept) = split(',',$self->http('accept')); + + foreach (@accept) { + ($pref) = /q=(\d\.\d+|\d+)/; + ($type) = m#(\S+/[^;]+)#; + next unless $type; + $prefs{$type}=$pref || 1; + } + + return keys %prefs unless $search; + + # if a search type is provided, we may need to + # perform a pattern matching operation. + # The MIME types use a glob mechanism, which + # is easily translated into a perl pattern match + + # First return the preference for directly supported + # types: + return $prefs{$search} if $prefs{$search}; + + # Didn't get it, so try pattern matching. + foreach (keys %prefs) { + next unless /\*/; # not a pattern match + ($pat = $_) =~ s/([^\w*])/\\$1/g; # escape meta characters + $pat =~ s/\*/.*/g; # turn it into a pattern + return $prefs{$_} if $search=~/$pat/; + } +} +END_OF_FUNC + + +#### Method: user_agent +# If called with no parameters, returns the user agent. +# If called with one parameter, does a pattern match (case +# insensitive) on the user agent. +#### +'user_agent' => <<'END_OF_FUNC', +sub user_agent { + my($self,$match)=self_or_CGI(@_); + return $self->http('user_agent') unless $match; + return $self->http('user_agent') =~ /$match/i; +} +END_OF_FUNC + + +#### Method: raw_cookie +# Returns the magic cookies for the session. +# The cookies are not parsed or altered in any way, i.e. +# cookies are returned exactly as given in the HTTP +# headers. If a cookie name is given, only that cookie's +# value is returned, otherwise the entire raw cookie +# is returned. +#### +'raw_cookie' => <<'END_OF_FUNC', +sub raw_cookie { + my($self,$key) = self_or_CGI(@_); + + require CGI::Cookie; + + if (defined($key)) { + $self->{'.raw_cookies'} = CGI::Cookie->raw_fetch + unless $self->{'.raw_cookies'}; + + return () unless $self->{'.raw_cookies'}; + return () unless $self->{'.raw_cookies'}->{$key}; + return $self->{'.raw_cookies'}->{$key}; + } + return $self->http('cookie') || $ENV{'COOKIE'} || ''; +} +END_OF_FUNC + +#### Method: virtual_host +# Return the name of the virtual_host, which +# is not always the same as the server +###### +'virtual_host' => <<'END_OF_FUNC', +sub virtual_host { + my $vh = http('x_forwarded_host') || http('host') || server_name(); + $vh =~ s/:\d+$//; # get rid of port number + return $vh; +} +END_OF_FUNC + +#### Method: remote_host +# Return the name of the remote host, or its IP +# address if unavailable. If this variable isn't +# defined, it returns "localhost" for debugging +# purposes. +#### +'remote_host' => <<'END_OF_FUNC', +sub remote_host { + return $ENV{'REMOTE_HOST'} || $ENV{'REMOTE_ADDR'} + || 'localhost'; +} +END_OF_FUNC + + +#### Method: remote_addr +# Return the IP addr of the remote host. +#### +'remote_addr' => <<'END_OF_FUNC', +sub remote_addr { + return $ENV{'REMOTE_ADDR'} || '127.0.0.1'; +} +END_OF_FUNC + + +#### Method: script_name +# Return the partial URL to this script for +# self-referencing scripts. Also see +# self_url(), which returns a URL with all state information +# preserved. +#### +'script_name' => <<'END_OF_FUNC', +sub script_name { + return $ENV{'SCRIPT_NAME'} if defined($ENV{'SCRIPT_NAME'}); + # These are for debugging + return "/$0" unless $0=~/^\//; + return $0; +} +END_OF_FUNC + + +#### Method: referer +# Return the HTTP_REFERER: useful for generating +# a GO BACK button. +#### +'referer' => <<'END_OF_FUNC', +sub referer { + my($self) = self_or_CGI(@_); + return $self->http('referer'); +} +END_OF_FUNC + + +#### Method: server_name +# Return the name of the server +#### +'server_name' => <<'END_OF_FUNC', +sub server_name { + return $ENV{'SERVER_NAME'} || 'localhost'; +} +END_OF_FUNC + +#### Method: server_software +# Return the name of the server software +#### +'server_software' => <<'END_OF_FUNC', +sub server_software { + return $ENV{'SERVER_SOFTWARE'} || 'cmdline'; +} +END_OF_FUNC + +#### Method: virtual_port +# Return the server port, taking virtual hosts into account +#### +'virtual_port' => <<'END_OF_FUNC', +sub virtual_port { + my($self) = self_or_default(@_); + my $vh = $self->http('x_forwarded_host') || $self->http('host'); + if ($vh) { + return ($vh =~ /:(\d+)$/)[0] || '80'; + } else { + return $self->server_port(); + } +} +END_OF_FUNC + +#### Method: server_port +# Return the tcp/ip port the server is running on +#### +'server_port' => <<'END_OF_FUNC', +sub server_port { + return $ENV{'SERVER_PORT'} || 80; # for debugging +} +END_OF_FUNC + +#### Method: server_protocol +# Return the protocol (usually HTTP/1.0) +#### +'server_protocol' => <<'END_OF_FUNC', +sub server_protocol { + return $ENV{'SERVER_PROTOCOL'} || 'HTTP/1.0'; # for debugging +} +END_OF_FUNC + +#### Method: http +# Return the value of an HTTP variable, or +# the list of variables if none provided +#### +'http' => <<'END_OF_FUNC', +sub http { + my ($self,$parameter) = self_or_CGI(@_); + return $ENV{$parameter} if $parameter=~/^HTTP/; + $parameter =~ tr/-/_/; + return $ENV{"HTTP_\U$parameter\E"} if $parameter; + my(@p); + foreach (keys %ENV) { + push(@p,$_) if /^HTTP/; + } + return @p; +} +END_OF_FUNC + +#### Method: https +# Return the value of HTTPS +#### +'https' => <<'END_OF_FUNC', +sub https { + local($^W)=0; + my ($self,$parameter) = self_or_CGI(@_); + return $ENV{HTTPS} unless $parameter; + return $ENV{$parameter} if $parameter=~/^HTTPS/; + $parameter =~ tr/-/_/; + return $ENV{"HTTPS_\U$parameter\E"} if $parameter; + my(@p); + foreach (keys %ENV) { + push(@p,$_) if /^HTTPS/; + } + return @p; +} +END_OF_FUNC + +#### Method: protocol +# Return the protocol (http or https currently) +#### +'protocol' => <<'END_OF_FUNC', +sub protocol { + local($^W)=0; + my $self = shift; + return 'https' if uc($self->https()) eq 'ON'; + return 'https' if $self->server_port == 443; + my $prot = $self->server_protocol; + my($protocol,$version) = split('/',$prot); + return "\L$protocol\E"; +} +END_OF_FUNC + +#### Method: remote_ident +# Return the identity of the remote user +# (but only if his host is running identd) +#### +'remote_ident' => <<'END_OF_FUNC', +sub remote_ident { + return $ENV{'REMOTE_IDENT'}; +} +END_OF_FUNC + + +#### Method: auth_type +# Return the type of use verification/authorization in use, if any. +#### +'auth_type' => <<'END_OF_FUNC', +sub auth_type { + return $ENV{'AUTH_TYPE'}; +} +END_OF_FUNC + + +#### Method: remote_user +# Return the authorization name used for user +# verification. +#### +'remote_user' => <<'END_OF_FUNC', +sub remote_user { + return $ENV{'REMOTE_USER'}; +} +END_OF_FUNC + + +#### Method: user_name +# Try to return the remote user's name by hook or by +# crook +#### +'user_name' => <<'END_OF_FUNC', +sub user_name { + my ($self) = self_or_CGI(@_); + return $self->http('from') || $ENV{'REMOTE_IDENT'} || $ENV{'REMOTE_USER'}; +} +END_OF_FUNC + +#### Method: nosticky +# Set or return the NOSTICKY global flag +#### +'nosticky' => <<'END_OF_FUNC', +sub nosticky { + my ($self,$param) = self_or_CGI(@_); + $CGI::NOSTICKY = $param if defined($param); + return $CGI::NOSTICKY; +} +END_OF_FUNC + +#### Method: nph +# Set or return the NPH global flag +#### +'nph' => <<'END_OF_FUNC', +sub nph { + my ($self,$param) = self_or_CGI(@_); + $CGI::NPH = $param if defined($param); + return $CGI::NPH; +} +END_OF_FUNC + +#### Method: private_tempfiles +# Set or return the private_tempfiles global flag +#### +'private_tempfiles' => <<'END_OF_FUNC', +sub private_tempfiles { + my ($self,$param) = self_or_CGI(@_); + $CGI::PRIVATE_TEMPFILES = $param if defined($param); + return $CGI::PRIVATE_TEMPFILES; +} +END_OF_FUNC +#### Method: close_upload_files +# Set or return the close_upload_files global flag +#### +'close_upload_files' => <<'END_OF_FUNC', +sub close_upload_files { + my ($self,$param) = self_or_CGI(@_); + $CGI::CLOSE_UPLOAD_FILES = $param if defined($param); + return $CGI::CLOSE_UPLOAD_FILES; +} +END_OF_FUNC + + +#### Method: default_dtd +# Set or return the default_dtd global +#### +'default_dtd' => <<'END_OF_FUNC', +sub default_dtd { + my ($self,$param,$param2) = self_or_CGI(@_); + if (defined $param2 && defined $param) { + $CGI::DEFAULT_DTD = [ $param, $param2 ]; + } elsif (defined $param) { + $CGI::DEFAULT_DTD = $param; + } + return $CGI::DEFAULT_DTD; +} +END_OF_FUNC + +# -------------- really private subroutines ----------------- +'previous_or_default' => <<'END_OF_FUNC', +sub previous_or_default { + my($self,$name,$defaults,$override) = @_; + my(%selected); + + if (!$override && ($self->{'.fieldnames'}->{$name} || + defined($self->param($name)) ) ) { + grep($selected{$_}++,$self->param($name)); + } elsif (defined($defaults) && ref($defaults) && + (ref($defaults) eq 'ARRAY')) { + grep($selected{$_}++,@{$defaults}); + } else { + $selected{$defaults}++ if defined($defaults); + } + + return %selected; +} +END_OF_FUNC + +'register_parameter' => <<'END_OF_FUNC', +sub register_parameter { + my($self,$param) = @_; + $self->{'.parametersToAdd'}->{$param}++; +} +END_OF_FUNC + +'get_fields' => <<'END_OF_FUNC', +sub get_fields { + my($self) = @_; + return $self->CGI::hidden('-name'=>'.cgifields', + '-values'=>[keys %{$self->{'.parametersToAdd'}}], + '-override'=>1); +} +END_OF_FUNC + +'read_from_cmdline' => <<'END_OF_FUNC', +sub read_from_cmdline { + my($input,@words); + my($query_string); + my($subpath); + if ($DEBUG && @ARGV) { + @words = @ARGV; + } elsif ($DEBUG > 1) { + require "shellwords.pl"; + print STDERR "(offline mode: enter name=value pairs on standard input; press ^D or ^Z when done)\n"; + chomp(@lines = ); # remove newlines + $input = join(" ",@lines); + @words = &shellwords($input); + } + foreach (@words) { + s/\\=/%3D/g; + s/\\&/%26/g; + } + + if ("@words"=~/=/) { + $query_string = join('&',@words); + } else { + $query_string = join('+',@words); + } + if ($query_string =~ /^(.*?)\?(.*)$/) + { + $query_string = $2; + $subpath = $1; + } + return { 'query_string' => $query_string, 'subpath' => $subpath }; +} +END_OF_FUNC + +##### +# subroutine: read_multipart +# +# Read multipart data and store it into our parameters. +# An interesting feature is that if any of the parts is a file, we +# create a temporary file and open up a filehandle on it so that the +# caller can read from it if necessary. +##### +'read_multipart' => <<'END_OF_FUNC', +sub read_multipart { + my($self,$boundary,$length) = @_; + my($buffer) = $self->new_MultipartBuffer($boundary,$length); + return unless $buffer; + my(%header,$body); + my $filenumber = 0; + while (!$buffer->eof) { + %header = $buffer->readHeader; + + unless (%header) { + $self->cgi_error("400 Bad request (malformed multipart POST)"); + return; + } + + my($param)= $header{'Content-Disposition'}=~/ name="([^;]*)"/; + $param .= $TAINTED; + + # Bug: Netscape doesn't escape quotation marks in file names!!! + my($filename) = $header{'Content-Disposition'}=~/ filename="([^;]*)"/; + # Test for Opera's multiple upload feature + my($multipart) = ( defined( $header{'Content-Type'} ) && + $header{'Content-Type'} =~ /multipart\/mixed/ ) ? + 1 : 0; + + # add this parameter to our list + $self->add_parameter($param); + + # If no filename specified, then just read the data and assign it + # to our parameter list. + if ( ( !defined($filename) || $filename eq '' ) && !$multipart ) { + my($value) = $buffer->readBody; + $value .= $TAINTED; + push(@{$self->{$param}},$value); + next; + } + + my ($tmpfile,$tmp,$filehandle); + UPLOADS: { + # If we get here, then we are dealing with a potentially large + # uploaded form. Save the data to a temporary file, then open + # the file for reading. + + # skip the file if uploads disabled + if ($DISABLE_UPLOADS) { + while (defined($data = $buffer->read)) { } + last UPLOADS; + } + + # set the filename to some recognizable value + if ( ( !defined($filename) || $filename eq '' ) && $multipart ) { + $filename = "multipart/mixed"; + } + + # choose a relatively unpredictable tmpfile sequence number + my $seqno = unpack("%16C*",join('',localtime,values %ENV)); + for (my $cnt=10;$cnt>0;$cnt--) { + next unless $tmpfile = new CGITempFile($seqno); + $tmp = $tmpfile->as_string; + last if defined($filehandle = Fh->new($filename,$tmp,$PRIVATE_TEMPFILES)); + $seqno += int rand(100); + } + die "CGI open of tmpfile: $!\n" unless defined $filehandle; + $CGI::DefaultClass->binmode($filehandle) if $CGI::needs_binmode + && defined fileno($filehandle); + + # if this is an multipart/mixed attachment, save the header + # together with the body for later parsing with an external + # MIME parser module + if ( $multipart ) { + foreach ( keys %header ) { + print $filehandle "$_: $header{$_}${CRLF}"; + } + print $filehandle "${CRLF}"; + } + + my ($data); + local($\) = ''; + my $totalbytes; + while (defined($data = $buffer->read)) { + if (defined $self->{'.upload_hook'}) + { + $totalbytes += length($data); + &{$self->{'.upload_hook'}}($filename ,$data, $totalbytes, $self->{'.upload_data'}); + } + print $filehandle $data; + } + + # back up to beginning of file + seek($filehandle,0,0); + + ## Close the filehandle if requested this allows a multipart MIME + ## upload to contain many files, and we won't die due to too many + ## open file handles. The user can access the files using the hash + ## below. + close $filehandle if $CLOSE_UPLOAD_FILES; + $CGI::DefaultClass->binmode($filehandle) if $CGI::needs_binmode; + + # Save some information about the uploaded file where we can get + # at it later. + $self->{'.tmpfiles'}->{fileno($filehandle)}= { + hndl => $filehandle, + name => $tmpfile, + info => {%header}, + }; + push(@{$self->{$param}},$filehandle); + } + } +} +END_OF_FUNC + +'upload' =><<'END_OF_FUNC', +sub upload { + my($self,$param_name) = self_or_default(@_); + my @param = grep(ref && fileno($_), $self->param($param_name)); + return unless @param; + return wantarray ? @param : $param[0]; +} +END_OF_FUNC + +'tmpFileName' => <<'END_OF_FUNC', +sub tmpFileName { + my($self,$filename) = self_or_default(@_); + return $self->{'.tmpfiles'}->{fileno($filename)}->{name} ? + $self->{'.tmpfiles'}->{fileno($filename)}->{name}->as_string + : ''; +} +END_OF_FUNC + +'uploadInfo' => <<'END_OF_FUNC', +sub uploadInfo { + my($self,$filename) = self_or_default(@_); + return $self->{'.tmpfiles'}->{fileno($filename)}->{info}; +} +END_OF_FUNC + +# internal routine, don't use +'_set_values_and_labels' => <<'END_OF_FUNC', +sub _set_values_and_labels { + my $self = shift; + my ($v,$l,$n) = @_; + $$l = $v if ref($v) eq 'HASH' && !ref($$l); + return $self->param($n) if !defined($v); + return $v if !ref($v); + return ref($v) eq 'HASH' ? keys %$v : @$v; +} +END_OF_FUNC + +# internal routine, don't use +'_set_attributes' => <<'END_OF_FUNC', +sub _set_attributes { + my $self = shift; + my($element, $attributes) = @_; + return '' unless defined($attributes->{$element}); + $attribs = ' '; + foreach my $attrib (keys %{$attributes->{$element}}) { + (my $clean_attrib = $attrib) =~ s/^-//; + $attribs .= "@{[lc($clean_attrib)]}=\"$attributes->{$element}{$attrib}\" "; + } + $attribs =~ s/ $//; + return $attribs; +} +END_OF_FUNC + +'_compile_all' => <<'END_OF_FUNC', +sub _compile_all { + foreach (@_) { + next if defined(&$_); + $AUTOLOAD = "CGI::$_"; + _compile(); + } +} +END_OF_FUNC + +); +END_OF_AUTOLOAD +; + +######################################################### +# Globals and stubs for other packages that we use. +######################################################### + +################### Fh -- lightweight filehandle ############### +package Fh; +use overload + '""' => \&asString, + 'cmp' => \&compare, + 'fallback'=>1; + +$FH='fh00000'; + +*Fh::AUTOLOAD = \&CGI::AUTOLOAD; + +$AUTOLOADED_ROUTINES = ''; # prevent -w error +$AUTOLOADED_ROUTINES=<<'END_OF_AUTOLOAD'; +%SUBS = ( +'asString' => <<'END_OF_FUNC', +sub asString { + my $self = shift; + # get rid of package name + (my $i = $$self) =~ s/^\*(\w+::fh\d{5})+//; + $i =~ s/%(..)/ chr(hex($1)) /eg; + return $i.$CGI::TAINTED; +# BEGIN DEAD CODE +# This was an extremely clever patch that allowed "use strict refs". +# Unfortunately it relied on another bug that caused leaky file descriptors. +# The underlying bug has been fixed, so this no longer works. However +# "strict refs" still works for some reason. +# my $self = shift; +# return ${*{$self}{SCALAR}}; +# END DEAD CODE +} +END_OF_FUNC + +'compare' => <<'END_OF_FUNC', +sub compare { + my $self = shift; + my $value = shift; + return "$self" cmp $value; +} +END_OF_FUNC + +'new' => <<'END_OF_FUNC', +sub new { + my($pack,$name,$file,$delete) = @_; + _setup_symbols(@SAVED_SYMBOLS) if @SAVED_SYMBOLS; + require Fcntl unless defined &Fcntl::O_RDWR; + (my $safename = $name) =~ s/([':%])/ sprintf '%%%02X', ord $1 /eg; + my $fv = ++$FH . $safename; + my $ref = \*{"Fh::$fv"}; + $file =~ m!^([a-zA-Z0-9_ \'\":/.\$\\-]+)$! || return; + my $safe = $1; + sysopen($ref,$safe,Fcntl::O_RDWR()|Fcntl::O_CREAT()|Fcntl::O_EXCL(),0600) || return; + unlink($safe) if $delete; + CORE::delete $Fh::{$fv}; + return bless $ref,$pack; +} +END_OF_FUNC + +'DESTROY' => <<'END_OF_FUNC', +sub DESTROY { + my $self = shift; + close $self; +} +END_OF_FUNC + +); +END_OF_AUTOLOAD + +######################## MultipartBuffer #################### +package MultipartBuffer; + +use constant DEBUG => 0; + +# how many bytes to read at a time. We use +# a 4K buffer by default. +$INITIAL_FILLUNIT = 1024 * 4; +$TIMEOUT = 240*60; # 4 hour timeout for big files +$SPIN_LOOP_MAX = 2000; # bug fix for some Netscape servers +$CRLF=$CGI::CRLF; + +#reuse the autoload function +*MultipartBuffer::AUTOLOAD = \&CGI::AUTOLOAD; + +# avoid autoloader warnings +sub DESTROY {} + +############################################################################### +################# THESE FUNCTIONS ARE AUTOLOADED ON DEMAND #################### +############################################################################### +$AUTOLOADED_ROUTINES = ''; # prevent -w error +$AUTOLOADED_ROUTINES=<<'END_OF_AUTOLOAD'; +%SUBS = ( + +'new' => <<'END_OF_FUNC', +sub new { + my($package,$interface,$boundary,$length) = @_; + $FILLUNIT = $INITIAL_FILLUNIT; + $CGI::DefaultClass->binmode($IN); # if $CGI::needs_binmode; # just do it always + + # If the user types garbage into the file upload field, + # then Netscape passes NOTHING to the server (not good). + # We may hang on this read in that case. So we implement + # a read timeout. If nothing is ready to read + # by then, we return. + + # Netscape seems to be a little bit unreliable + # about providing boundary strings. + my $boundary_read = 0; + if ($boundary) { + + # Under the MIME spec, the boundary consists of the + # characters "--" PLUS the Boundary string + + # BUG: IE 3.01 on the Macintosh uses just the boundary -- not + # the two extra hyphens. We do a special case here on the user-agent!!!! + $boundary = "--$boundary" unless CGI::user_agent('MSIE\s+3\.0[12];\s*Mac|DreamPassport'); + + } else { # otherwise we find it ourselves + my($old); + ($old,$/) = ($/,$CRLF); # read a CRLF-delimited line + $boundary = ; # BUG: This won't work correctly under mod_perl + $length -= length($boundary); + chomp($boundary); # remove the CRLF + $/ = $old; # restore old line separator + $boundary_read++; + } + + my $self = {LENGTH=>$length, + BOUNDARY=>$boundary, + INTERFACE=>$interface, + BUFFER=>'', + }; + + $FILLUNIT = length($boundary) + if length($boundary) > $FILLUNIT; + + my $retval = bless $self,ref $package || $package; + + # Read the preamble and the topmost (boundary) line plus the CRLF. + unless ($boundary_read) { + while ($self->read(0)) { } + } + die "Malformed multipart POST: data truncated\n" if $self->eof; + + return $retval; +} +END_OF_FUNC + +'readHeader' => <<'END_OF_FUNC', +sub readHeader { + my($self) = @_; + my($end); + my($ok) = 0; + my($bad) = 0; + + local($CRLF) = "\015\012" if $CGI::OS eq 'VMS' || $CGI::EBCDIC; + + do { + $self->fillBuffer($FILLUNIT); + $ok++ if ($end = index($self->{BUFFER},"${CRLF}${CRLF}")) >= 0; + $ok++ if $self->{BUFFER} eq ''; + $bad++ if !$ok && $self->{LENGTH} <= 0; + # this was a bad idea + # $FILLUNIT *= 2 if length($self->{BUFFER}) >= $FILLUNIT; + } until $ok || $bad; + return () if $bad; + + #EBCDIC NOTE: translate header into EBCDIC, but watch out for continuation lines! + + my($header) = substr($self->{BUFFER},0,$end+2); + substr($self->{BUFFER},0,$end+4) = ''; + my %return; + + if ($CGI::EBCDIC) { + warn "untranslated header=$header\n" if DEBUG; + $header = CGI::Util::ascii2ebcdic($header); + warn "translated header=$header\n" if DEBUG; + } + + # See RFC 2045 Appendix A and RFC 822 sections 3.4.8 + # (Folding Long Header Fields), 3.4.3 (Comments) + # and 3.4.5 (Quoted-Strings). + + my $token = '[-\w!\#$%&\'*+.^_\`|{}~]'; + $header=~s/$CRLF\s+/ /og; # merge continuation lines + + while ($header=~/($token+):\s+([^$CRLF]*)/mgox) { + my ($field_name,$field_value) = ($1,$2); + $field_name =~ s/\b(\w)/uc($1)/eg; #canonicalize + $return{$field_name}=$field_value; + } + return %return; +} +END_OF_FUNC + +# This reads and returns the body as a single scalar value. +'readBody' => <<'END_OF_FUNC', +sub readBody { + my($self) = @_; + my($data); + my($returnval)=''; + + #EBCDIC NOTE: want to translate returnval into EBCDIC HERE + + while (defined($data = $self->read)) { + $returnval .= $data; + } + + if ($CGI::EBCDIC) { + warn "untranslated body=$returnval\n" if DEBUG; + $returnval = CGI::Util::ascii2ebcdic($returnval); + warn "translated body=$returnval\n" if DEBUG; + } + return $returnval; +} +END_OF_FUNC + +# This will read $bytes or until the boundary is hit, whichever happens +# first. After the boundary is hit, we return undef. The next read will +# skip over the boundary and begin reading again; +'read' => <<'END_OF_FUNC', +sub read { + my($self,$bytes) = @_; + + # default number of bytes to read + $bytes = $bytes || $FILLUNIT; + + # Fill up our internal buffer in such a way that the boundary + # is never split between reads. + $self->fillBuffer($bytes); + + my $boundary_start = $CGI::EBCDIC ? CGI::Util::ebcdic2ascii($self->{BOUNDARY}) : $self->{BOUNDARY}; + my $boundary_end = $CGI::EBCDIC ? CGI::Util::ebcdic2ascii($self->{BOUNDARY}.'--') : $self->{BOUNDARY}.'--'; + + # Find the boundary in the buffer (it may not be there). + my $start = index($self->{BUFFER},$boundary_start); + + warn "boundary=$self->{BOUNDARY} length=$self->{LENGTH} start=$start\n" if DEBUG; + # protect against malformed multipart POST operations + die "Malformed multipart POST\n" unless ($start >= 0) || ($self->{LENGTH} > 0); + + + #EBCDIC NOTE: want to translate boundary search into ASCII here. + + # If the boundary begins the data, then skip past it + # and return undef. + if ($start == 0) { + + # clear us out completely if we've hit the last boundary. + if (index($self->{BUFFER},$boundary_end)==0) { + $self->{BUFFER}=''; + $self->{LENGTH}=0; + return undef; + } + + # just remove the boundary. + substr($self->{BUFFER},0,length($boundary_start))=''; + $self->{BUFFER} =~ s/^\012\015?//; + return undef; + } + + my $bytesToReturn; + if ($start > 0) { # read up to the boundary + $bytesToReturn = $start-2 > $bytes ? $bytes : $start; + } else { # read the requested number of bytes + # leave enough bytes in the buffer to allow us to read + # the boundary. Thanks to Kevin Hendrick for finding + # this one. + $bytesToReturn = $bytes - (length($boundary_start)+1); + } + + my $returnval=substr($self->{BUFFER},0,$bytesToReturn); + substr($self->{BUFFER},0,$bytesToReturn)=''; + + # If we hit the boundary, remove the CRLF from the end. + return ($bytesToReturn==$start) + ? substr($returnval,0,-2) : $returnval; +} +END_OF_FUNC + + +# This fills up our internal buffer in such a way that the +# boundary is never split between reads +'fillBuffer' => <<'END_OF_FUNC', +sub fillBuffer { + my($self,$bytes) = @_; + return unless $self->{LENGTH}; + + my($boundaryLength) = length($self->{BOUNDARY}); + my($bufferLength) = length($self->{BUFFER}); + my($bytesToRead) = $bytes - $bufferLength + $boundaryLength + 2; + $bytesToRead = $self->{LENGTH} if $self->{LENGTH} < $bytesToRead; + + # Try to read some data. We may hang here if the browser is screwed up. + my $bytesRead = $self->{INTERFACE}->read_from_client(\$self->{BUFFER}, + $bytesToRead, + $bufferLength); + warn "bytesToRead=$bytesToRead, bufferLength=$bufferLength, buffer=$self->{BUFFER}\n" if DEBUG; + $self->{BUFFER} = '' unless defined $self->{BUFFER}; + + # An apparent bug in the Apache server causes the read() + # to return zero bytes repeatedly without blocking if the + # remote user aborts during a file transfer. I don't know how + # they manage this, but the workaround is to abort if we get + # more than SPIN_LOOP_MAX consecutive zero reads. + if ($bytesRead == 0) { + die "CGI.pm: Server closed socket during multipart read (client aborted?).\n" + if ($self->{ZERO_LOOP_COUNTER}++ >= $SPIN_LOOP_MAX); + } else { + $self->{ZERO_LOOP_COUNTER}=0; + } + + $self->{LENGTH} -= $bytesRead; +} +END_OF_FUNC + + +# Return true when we've finished reading +'eof' => <<'END_OF_FUNC' +sub eof { + my($self) = @_; + return 1 if (length($self->{BUFFER}) == 0) + && ($self->{LENGTH} <= 0); + undef; +} +END_OF_FUNC + +); +END_OF_AUTOLOAD + +#################################################################################### +################################## TEMPORARY FILES ################################# +#################################################################################### +package CGITempFile; + +sub find_tempdir { + undef $TMPDIRECTORY; + $SL = $CGI::SL; + $MAC = $CGI::OS eq 'MACINTOSH'; + my ($vol) = $MAC ? MacPerl::Volumes() =~ /:(.*)/ : ""; + unless ($TMPDIRECTORY) { + @TEMP=("${SL}usr${SL}tmp","${SL}var${SL}tmp", + "C:${SL}temp","${SL}tmp","${SL}temp", + "${vol}${SL}Temporary Items", + "${SL}WWW_ROOT", "${SL}SYS\$SCRATCH", + "C:${SL}system${SL}temp"); + unshift(@TEMP,$ENV{'TMPDIR'}) if defined $ENV{'TMPDIR'}; + + # this feature was supposed to provide per-user tmpfiles, but + # it is problematic. + # unshift(@TEMP,(getpwuid($<))[7].'/tmp') if $CGI::OS eq 'UNIX'; + # Rob: getpwuid() is unfortunately UNIX specific. On brain dead OS'es this + # : can generate a 'getpwuid() not implemented' exception, even though + # : it's never called. Found under DOS/Win with the DJGPP perl port. + # : Refer to getpwuid() only at run-time if we're fortunate and have UNIX. + # unshift(@TEMP,(eval {(getpwuid($>))[7]}).'/tmp') if $CGI::OS eq 'UNIX' and $> != 0; + + foreach (@TEMP) { + do {$TMPDIRECTORY = $_; last} if -d $_ && -w _; + } + } + $TMPDIRECTORY = $MAC ? "" : "." unless $TMPDIRECTORY; +} + +find_tempdir(); + +$MAXTRIES = 5000; + +# cute feature, but overload implementation broke it +# %OVERLOAD = ('""'=>'as_string'); +*CGITempFile::AUTOLOAD = \&CGI::AUTOLOAD; + +sub DESTROY { + my($self) = @_; + $$self =~ m!^([a-zA-Z0-9_ \'\":/.\$\\-]+)$! || return; + my $safe = $1; # untaint operation + unlink $safe; # get rid of the file +} + +############################################################################### +################# THESE FUNCTIONS ARE AUTOLOADED ON DEMAND #################### +############################################################################### +$AUTOLOADED_ROUTINES = ''; # prevent -w error +$AUTOLOADED_ROUTINES=<<'END_OF_AUTOLOAD'; +%SUBS = ( + +'new' => <<'END_OF_FUNC', +sub new { + my($package,$sequence) = @_; + my $filename; + find_tempdir() unless -w $TMPDIRECTORY; + for (my $i = 0; $i < $MAXTRIES; $i++) { + last if ! -f ($filename = sprintf("${TMPDIRECTORY}${SL}CGItemp%d",$sequence++)); + } + # check that it is a more-or-less valid filename + return unless $filename =~ m!^([a-zA-Z0-9_ \'\":/.\$\\-]+)$!; + # this used to untaint, now it doesn't + # $filename = $1; + return bless \$filename; +} +END_OF_FUNC + +'as_string' => <<'END_OF_FUNC' +sub as_string { + my($self) = @_; + return $$self; +} +END_OF_FUNC + +); +END_OF_AUTOLOAD + +package CGI; + +# We get a whole bunch of warnings about "possibly uninitialized variables" +# when running with the -w switch. Touch them all once to get rid of the +# warnings. This is ugly and I hate it. +if ($^W) { + $CGI::CGI = ''; + $CGI::CGI=<'words', + -values=>['eenie','meenie','minie','moe'], + -defaults=>['eenie','minie']), p, + "What's your favorite color? ", + popup_menu(-name=>'color', + -values=>['red','green','blue','chartreuse']),p, + submit, + end_form, + hr; + + if (param()) { + print "Your name is",em(param('name')),p, + "The keywords are: ",em(join(", ",param('words'))),p, + "Your favorite color is ",em(param('color')), + hr; + } + +=head1 ABSTRACT + +This perl library uses perl5 objects to make it easy to create Web +fill-out forms and parse their contents. This package defines CGI +objects, entities that contain the values of the current query string +and other state variables. Using a CGI object's methods, you can +examine keywords and parameters passed to your script, and create +forms whose initial values are taken from the current query (thereby +preserving state information). The module provides shortcut functions +that produce boilerplate HTML, reducing typing and coding errors. It +also provides functionality for some of the more advanced features of +CGI scripting, including support for file uploads, cookies, cascading +style sheets, server push, and frames. + +CGI.pm also provides a simple function-oriented programming style for +those who don't need its object-oriented features. + +The current version of CGI.pm is available at + + http://www.genome.wi.mit.edu/ftp/pub/software/WWW/cgi_docs.html + ftp://ftp-genome.wi.mit.edu/pub/software/WWW/ + +=head1 DESCRIPTION + +=head2 PROGRAMMING STYLE + +There are two styles of programming with CGI.pm, an object-oriented +style and a function-oriented style. In the object-oriented style you +create one or more CGI objects and then use object methods to create +the various elements of the page. Each CGI object starts out with the +list of named parameters that were passed to your CGI script by the +server. You can modify the objects, save them to a file or database +and recreate them. Because each object corresponds to the "state" of +the CGI script, and because each object's parameter list is +independent of the others, this allows you to save the state of the +script and restore it later. + +For example, using the object oriented style, here is how you create +a simple "Hello World" HTML page: + + #!/usr/local/bin/perl -w + use CGI; # load CGI routines + $q = new CGI; # create new CGI object + print $q->header, # create the HTTP header + $q->start_html('hello world'), # start the HTML + $q->h1('hello world'), # level 1 header + $q->end_html; # end the HTML + +In the function-oriented style, there is one default CGI object that +you rarely deal with directly. Instead you just call functions to +retrieve CGI parameters, create HTML tags, manage cookies, and so +on. This provides you with a cleaner programming interface, but +limits you to using one CGI object at a time. The following example +prints the same page, but uses the function-oriented interface. +The main differences are that we now need to import a set of functions +into our name space (usually the "standard" functions), and we don't +need to create the CGI object. + + #!/usr/local/bin/perl + use CGI qw/:standard/; # load standard CGI routines + print header, # create the HTTP header + start_html('hello world'), # start the HTML + h1('hello world'), # level 1 header + end_html; # end the HTML + +The examples in this document mainly use the object-oriented style. +See HOW TO IMPORT FUNCTIONS for important information on +function-oriented programming in CGI.pm + +=head2 CALLING CGI.PM ROUTINES + +Most CGI.pm routines accept several arguments, sometimes as many as 20 +optional ones! To simplify this interface, all routines use a named +argument calling style that looks like this: + + print $q->header(-type=>'image/gif',-expires=>'+3d'); + +Each argument name is preceded by a dash. Neither case nor order +matters in the argument list. -type, -Type, and -TYPE are all +acceptable. In fact, only the first argument needs to begin with a +dash. If a dash is present in the first argument, CGI.pm assumes +dashes for the subsequent ones. + +Several routines are commonly called with just one argument. In the +case of these routines you can provide the single argument without an +argument name. header() happens to be one of these routines. In this +case, the single argument is the document type. + + print $q->header('text/html'); + +Other such routines are documented below. + +Sometimes named arguments expect a scalar, sometimes a reference to an +array, and sometimes a reference to a hash. Often, you can pass any +type of argument and the routine will do whatever is most appropriate. +For example, the param() routine is used to set a CGI parameter to a +single or a multi-valued value. The two cases are shown below: + + $q->param(-name=>'veggie',-value=>'tomato'); + $q->param(-name=>'veggie',-value=>['tomato','tomahto','potato','potahto']); + +A large number of routines in CGI.pm actually aren't specifically +defined in the module, but are generated automatically as needed. +These are the "HTML shortcuts," routines that generate HTML tags for +use in dynamically-generated pages. HTML tags have both attributes +(the attribute="value" pairs within the tag itself) and contents (the +part between the opening and closing pairs.) To distinguish between +attributes and contents, CGI.pm uses the convention of passing HTML +attributes as a hash reference as the first argument, and the +contents, if any, as any subsequent arguments. It works out like +this: + + Code Generated HTML + ---- -------------- + h1()

    + h1('some','contents');

    some contents

    + h1({-align=>left});

    + h1({-align=>left},'contents');

    contents

    + +HTML tags are described in more detail later. + +Many newcomers to CGI.pm are puzzled by the difference between the +calling conventions for the HTML shortcuts, which require curly braces +around the HTML tag attributes, and the calling conventions for other +routines, which manage to generate attributes without the curly +brackets. Don't be confused. As a convenience the curly braces are +optional in all but the HTML shortcuts. If you like, you can use +curly braces when calling any routine that takes named arguments. For +example: + + print $q->header( {-type=>'image/gif',-expires=>'+3d'} ); + +If you use the B<-w> switch, you will be warned that some CGI.pm argument +names conflict with built-in Perl functions. The most frequent of +these is the -values argument, used to create multi-valued menus, +radio button clusters and the like. To get around this warning, you +have several choices: + +=over 4 + +=item 1. + +Use another name for the argument, if one is available. +For example, -value is an alias for -values. + +=item 2. + +Change the capitalization, e.g. -Values + +=item 3. + +Put quotes around the argument name, e.g. '-values' + +=back + +Many routines will do something useful with a named argument that it +doesn't recognize. For example, you can produce non-standard HTTP +header fields by providing them as named arguments: + + print $q->header(-type => 'text/html', + -cost => 'Three smackers', + -annoyance_level => 'high', + -complaints_to => 'bit bucket'); + +This will produce the following nonstandard HTTP header: + + HTTP/1.0 200 OK + Cost: Three smackers + Annoyance-level: high + Complaints-to: bit bucket + Content-type: text/html + +Notice the way that underscores are translated automatically into +hyphens. HTML-generating routines perform a different type of +translation. + +This feature allows you to keep up with the rapidly changing HTTP and +HTML "standards". + +=head2 CREATING A NEW QUERY OBJECT (OBJECT-ORIENTED STYLE): + + $query = new CGI; + +This will parse the input (from both POST and GET methods) and store +it into a perl5 object called $query. + +=head2 CREATING A NEW QUERY OBJECT FROM AN INPUT FILE + + $query = new CGI(INPUTFILE); + +If you provide a file handle to the new() method, it will read +parameters from the file (or STDIN, or whatever). The file can be in +any of the forms describing below under debugging (i.e. a series of +newline delimited TAG=VALUE pairs will work). Conveniently, this type +of file is created by the save() method (see below). Multiple records +can be saved and restored. + +Perl purists will be pleased to know that this syntax accepts +references to file handles, or even references to filehandle globs, +which is the "official" way to pass a filehandle: + + $query = new CGI(\*STDIN); + +You can also initialize the CGI object with a FileHandle or IO::File +object. + +If you are using the function-oriented interface and want to +initialize CGI state from a file handle, the way to do this is with +B. This will (re)initialize the +default CGI object from the indicated file handle. + + open (IN,"test.in") || die; + restore_parameters(IN); + close IN; + +You can also initialize the query object from an associative array +reference: + + $query = new CGI( {'dinosaur'=>'barney', + 'song'=>'I love you', + 'friends'=>[qw/Jessica George Nancy/]} + ); + +or from a properly formatted, URL-escaped query string: + + $query = new CGI('dinosaur=barney&color=purple'); + +or from a previously existing CGI object (currently this clones the +parameter list, but none of the other object-specific fields, such as +autoescaping): + + $old_query = new CGI; + $new_query = new CGI($old_query); + +To create an empty query, initialize it from an empty string or hash: + + $empty_query = new CGI(""); + + -or- + + $empty_query = new CGI({}); + +=head2 FETCHING A LIST OF KEYWORDS FROM THE QUERY: + + @keywords = $query->keywords + +If the script was invoked as the result of an search, the +parsed keywords can be obtained as an array using the keywords() method. + +=head2 FETCHING THE NAMES OF ALL THE PARAMETERS PASSED TO YOUR SCRIPT: + + @names = $query->param + +If the script was invoked with a parameter list +(e.g. "name1=value1&name2=value2&name3=value3"), the param() method +will return the parameter names as a list. If the script was invoked +as an script and contains a string without ampersands +(e.g. "value1+value2+value3") , there will be a single parameter named +"keywords" containing the "+"-delimited keywords. + +NOTE: As of version 1.5, the array of parameter names returned will +be in the same order as they were submitted by the browser. +Usually this order is the same as the order in which the +parameters are defined in the form (however, this isn't part +of the spec, and so isn't guaranteed). + +=head2 FETCHING THE VALUE OR VALUES OF A SINGLE NAMED PARAMETER: + + @values = $query->param('foo'); + + -or- + + $value = $query->param('foo'); + +Pass the param() method a single argument to fetch the value of the +named parameter. If the parameter is multivalued (e.g. from multiple +selections in a scrolling list), you can ask to receive an array. Otherwise +the method will return a single value. + +If a value is not given in the query string, as in the queries +"name1=&name2=" or "name1&name2", it will be returned as an empty +string. This feature is new in 2.63. + + +If the parameter does not exist at all, then param() will return undef +in a scalar context, and the empty list in a list context. + + +=head2 SETTING THE VALUE(S) OF A NAMED PARAMETER: + + $query->param('foo','an','array','of','values'); + +This sets the value for the named parameter 'foo' to an array of +values. This is one way to change the value of a field AFTER +the script has been invoked once before. (Another way is with +the -override parameter accepted by all methods that generate +form elements.) + +param() also recognizes a named parameter style of calling described +in more detail later: + + $query->param(-name=>'foo',-values=>['an','array','of','values']); + + -or- + + $query->param(-name=>'foo',-value=>'the value'); + +=head2 APPENDING ADDITIONAL VALUES TO A NAMED PARAMETER: + + $query->append(-name=>'foo',-values=>['yet','more','values']); + +This adds a value or list of values to the named parameter. The +values are appended to the end of the parameter if it already exists. +Otherwise the parameter is created. Note that this method only +recognizes the named argument calling syntax. + +=head2 IMPORTING ALL PARAMETERS INTO A NAMESPACE: + + $query->import_names('R'); + +This creates a series of variables in the 'R' namespace. For example, +$R::foo, @R:foo. For keyword lists, a variable @R::keywords will appear. +If no namespace is given, this method will assume 'Q'. +WARNING: don't import anything into 'main'; this is a major security +risk!!!! + +NOTE 1: Variable names are transformed as necessary into legal Perl +variable names. All non-legal characters are transformed into +underscores. If you need to keep the original names, you should use +the param() method instead to access CGI variables by name. + +NOTE 2: In older versions, this method was called B. As of version 2.20, +this name has been removed completely to avoid conflict with the built-in +Perl module B operator. + +=head2 DELETING A PARAMETER COMPLETELY: + + $query->delete('foo','bar','baz'); + +This completely clears a list of parameters. It sometimes useful for +resetting parameters that you don't want passed down between script +invocations. + +If you are using the function call interface, use "Delete()" instead +to avoid conflicts with Perl's built-in delete operator. + +=head2 DELETING ALL PARAMETERS: + + $query->delete_all(); + +This clears the CGI object completely. It might be useful to ensure +that all the defaults are taken when you create a fill-out form. + +Use Delete_all() instead if you are using the function call interface. + +=head2 DIRECT ACCESS TO THE PARAMETER LIST: + + $q->param_fetch('address')->[1] = '1313 Mockingbird Lane'; + unshift @{$q->param_fetch(-name=>'address')},'George Munster'; + +If you need access to the parameter list in a way that isn't covered +by the methods above, you can obtain a direct reference to it by +calling the B method with the name of the . This +will return an array reference to the named parameters, which you then +can manipulate in any way you like. + +You can also use a named argument style using the B<-name> argument. + +=head2 FETCHING THE PARAMETER LIST AS A HASH: + + $params = $q->Vars; + print $params->{'address'}; + @foo = split("\0",$params->{'foo'}); + %params = $q->Vars; + + use CGI ':cgi-lib'; + $params = Vars; + +Many people want to fetch the entire parameter list as a hash in which +the keys are the names of the CGI parameters, and the values are the +parameters' values. The Vars() method does this. Called in a scalar +context, it returns the parameter list as a tied hash reference. +Changing a key changes the value of the parameter in the underlying +CGI parameter list. Called in a list context, it returns the +parameter list as an ordinary hash. This allows you to read the +contents of the parameter list, but not to change it. + +When using this, the thing you must watch out for are multivalued CGI +parameters. Because a hash cannot distinguish between scalar and +list context, multivalued parameters will be returned as a packed +string, separated by the "\0" (null) character. You must split this +packed string in order to get at the individual values. This is the +convention introduced long ago by Steve Brenner in his cgi-lib.pl +module for Perl version 4. + +If you wish to use Vars() as a function, import the I<:cgi-lib> set of +function calls (also see the section on CGI-LIB compatibility). + +=head2 SAVING THE STATE OF THE SCRIPT TO A FILE: + + $query->save(FILEHANDLE) + +This will write the current state of the form to the provided +filehandle. You can read it back in by providing a filehandle +to the new() method. Note that the filehandle can be a file, a pipe, +or whatever! + +The format of the saved file is: + + NAME1=VALUE1 + NAME1=VALUE1' + NAME2=VALUE2 + NAME3=VALUE3 + = + +Both name and value are URL escaped. Multi-valued CGI parameters are +represented as repeated names. A session record is delimited by a +single = symbol. You can write out multiple records and read them +back in with several calls to B. You can do this across several +sessions by opening the file in append mode, allowing you to create +primitive guest books, or to keep a history of users' queries. Here's +a short example of creating multiple session records: + + use CGI; + + open (OUT,">>test.out") || die; + $records = 5; + foreach (0..$records) { + my $q = new CGI; + $q->param(-name=>'counter',-value=>$_); + $q->save(OUT); + } + close OUT; + + # reopen for reading + open (IN,"test.out") || die; + while (!eof(IN)) { + my $q = new CGI(IN); + print $q->param('counter'),"\n"; + } + +The file format used for save/restore is identical to that used by the +Whitehead Genome Center's data exchange format "Boulderio", and can be +manipulated and even databased using Boulderio utilities. See + + http://stein.cshl.org/boulder/ + +for further details. + +If you wish to use this method from the function-oriented (non-OO) +interface, the exported name for this method is B. + +=head2 RETRIEVING CGI ERRORS + +Errors can occur while processing user input, particularly when +processing uploaded files. When these errors occur, CGI will stop +processing and return an empty parameter list. You can test for +the existence and nature of errors using the I function. +The error messages are formatted as HTTP status codes. You can either +incorporate the error text into an HTML page, or use it as the value +of the HTTP status: + + my $error = $q->cgi_error; + if ($error) { + print $q->header(-status=>$error), + $q->start_html('Problems'), + $q->h2('Request not processed'), + $q->strong($error); + exit 0; + } + +When using the function-oriented interface (see the next section), +errors may only occur the first time you call I. Be ready +for this! + +=head2 USING THE FUNCTION-ORIENTED INTERFACE + +To use the function-oriented interface, you must specify which CGI.pm +routines or sets of routines to import into your script's namespace. +There is a small overhead associated with this importation, but it +isn't much. + + use CGI ; + +The listed methods will be imported into the current package; you can +call them directly without creating a CGI object first. This example +shows how to import the B and B +methods, and then use them directly: + + use CGI 'param','header'; + print header('text/plain'); + $zipcode = param('zipcode'); + +More frequently, you'll import common sets of functions by referring +to the groups by name. All function sets are preceded with a ":" +character as in ":html3" (for tags defined in the HTML 3 standard). + +Here is a list of the function sets you can import: + +=over 4 + +=item B<:cgi> + +Import all CGI-handling methods, such as B, B +and the like. + +=item B<:form> + +Import all fill-out form generating methods, such as B. + +=item B<:html2> + +Import all methods that generate HTML 2.0 standard elements. + +=item B<:html3> + +Import all methods that generate HTML 3.0 elements (such as +, and ). + +=item B<:html4> + +Import all methods that generate HTML 4 elements (such as +, and ). + +=item B<:netscape> + +Import all methods that generate Netscape-specific HTML extensions. + +=item B<:html> + +Import all HTML-generating shortcuts (i.e. 'html2' + 'html3' + +'netscape')... + +=item B<:standard> + +Import "standard" features, 'html2', 'html3', 'html4', 'form' and 'cgi'. + +=item B<:all> + +Import all the available methods. For the full list, see the CGI.pm +code, where the variable %EXPORT_TAGS is defined. + +=back + +If you import a function name that is not part of CGI.pm, the module +will treat it as a new HTML tag and generate the appropriate +subroutine. You can then use it like any other HTML tag. This is to +provide for the rapidly-evolving HTML "standard." For example, say +Microsoft comes out with a new tag called (which causes the +user's desktop to be flooded with a rotating gradient fill until his +machine reboots). You don't need to wait for a new version of CGI.pm +to start using it immediately: + + use CGI qw/:standard :html3 gradient/; + print gradient({-start=>'red',-end=>'blue'}); + +Note that in the interests of execution speed CGI.pm does B use +the standard L syntax for specifying load symbols. This may +change in the future. + +If you import any of the state-maintaining CGI or form-generating +methods, a default CGI object will be created and initialized +automatically the first time you use any of the methods that require +one to be present. This includes B, B, +B and the like. (If you need direct access to the CGI +object, you can find it in the global variable B<$CGI::Q>). By +importing CGI.pm methods, you can create visually elegant scripts: + + use CGI qw/:standard/; + print + header, + start_html('Simple Script'), + h1('Simple Script'), + start_form, + "What's your name? ",textfield('name'),p, + "What's the combination?", + checkbox_group(-name=>'words', + -values=>['eenie','meenie','minie','moe'], + -defaults=>['eenie','moe']),p, + "What's your favorite color?", + popup_menu(-name=>'color', + -values=>['red','green','blue','chartreuse']),p, + submit, + end_form, + hr,"\n"; + + if (param) { + print + "Your name is ",em(param('name')),p, + "The keywords are: ",em(join(", ",param('words'))),p, + "Your favorite color is ",em(param('color')),".\n"; + } + print end_html; + +=head2 PRAGMAS + +In addition to the function sets, there are a number of pragmas that +you can import. Pragmas, which are always preceded by a hyphen, +change the way that CGI.pm functions in various ways. Pragmas, +function sets, and individual functions can all be imported in the +same use() line. For example, the following use statement imports the +standard set of functions and enables debugging mode (pragma +-debug): + + use CGI qw/:standard -debug/; + +The current list of pragmas is as follows: + +=over 4 + +=item -any + +When you I, then any method that the query object +doesn't recognize will be interpreted as a new HTML tag. This allows +you to support the next I Netscape or Microsoft HTML +extension. This lets you go wild with new and unsupported tags: + + use CGI qw(-any); + $q=new CGI; + print $q->gradient({speed=>'fast',start=>'red',end=>'blue'}); + +Since using any causes any mistyped method name +to be interpreted as an HTML tag, use it with care or not at +all. + +=item -compile + +This causes the indicated autoloaded methods to be compiled up front, +rather than deferred to later. This is useful for scripts that run +for an extended period of time under FastCGI or mod_perl, and for +those destined to be crunched by Malcom Beattie's Perl compiler. Use +it in conjunction with the methods or method families you plan to use. + + use CGI qw(-compile :standard :html3); + +or even + + use CGI qw(-compile :all); + +Note that using the -compile pragma in this way will always have +the effect of importing the compiled functions into the current +namespace. If you want to compile without importing use the +compile() method instead: + + use CGI(); + CGI->compile(); + +This is particularly useful in a mod_perl environment, in which you +might want to precompile all CGI routines in a startup script, and +then import the functions individually in each mod_perl script. + +=item -nosticky + +This makes CGI.pm not generating the hidden fields .submit +and .cgifields. It is very useful if you don't want to +have the hidden fields appear in the querystring in a GET method. +For example, a search script generated this way will have +a very nice url with search parameters for bookmarking. + +=item -no_undef_params + +This keeps CGI.pm from including undef params in the parameter list. + +=item -no_xhtml + +By default, CGI.pm versions 2.69 and higher emit XHTML +(http://www.w3.org/TR/xhtml1/). The -no_xhtml pragma disables this +feature. Thanks to Michalis Kabrianis for this +feature. + +If start_html()'s -dtd parameter specifies an HTML 2.0 or 3.2 DTD, +XHTML will automatically be disabled without needing to use this +pragma. + +=item -nph + +This makes CGI.pm produce a header appropriate for an NPH (no +parsed header) script. You may need to do other things as well +to tell the server that the script is NPH. See the discussion +of NPH scripts below. + +=item -newstyle_urls + +Separate the name=value pairs in CGI parameter query strings with +semicolons rather than ampersands. For example: + + ?name=fred;age=24;favorite_color=3 + +Semicolon-delimited query strings are always accepted, but will not be +emitted by self_url() and query_string() unless the -newstyle_urls +pragma is specified. + +This became the default in version 2.64. + +=item -oldstyle_urls + +Separate the name=value pairs in CGI parameter query strings with +ampersands rather than semicolons. This is no longer the default. + +=item -autoload + +This overrides the autoloader so that any function in your program +that is not recognized is referred to CGI.pm for possible evaluation. +This allows you to use all the CGI.pm functions without adding them to +your symbol table, which is of concern for mod_perl users who are +worried about memory consumption. I when +I<-autoload> is in effect, you cannot use "poetry mode" +(functions without the parenthesis). Use I rather +than I
    , or add something like I +to the top of your script. + +=item -no_debug + +This turns off the command-line processing features. If you want to +run a CGI.pm script from the command line to produce HTML, and you +don't want it to read CGI parameters from the command line or STDIN, +then use this pragma: + + use CGI qw(-no_debug :standard); + +=item -debug + +This turns on full debugging. In addition to reading CGI arguments +from the command-line processing, CGI.pm will pause and try to read +arguments from STDIN, producing the message "(offline mode: enter +name=value pairs on standard input)" features. + +See the section on debugging for more details. + +=item -private_tempfiles + +CGI.pm can process uploaded file. Ordinarily it spools the uploaded +file to a temporary directory, then deletes the file when done. +However, this opens the risk of eavesdropping as described in the file +upload section. Another CGI script author could peek at this data +during the upload, even if it is confidential information. On Unix +systems, the -private_tempfiles pragma will cause the temporary file +to be unlinked as soon as it is opened and before any data is written +into it, reducing, but not eliminating the risk of eavesdropping +(there is still a potential race condition). To make life harder for +the attacker, the program chooses tempfile names by calculating a 32 +bit checksum of the incoming HTTP headers. + +To ensure that the temporary file cannot be read by other CGI scripts, +use suEXEC or a CGI wrapper program to run your script. The temporary +file is created with mode 0600 (neither world nor group readable). + +The temporary directory is selected using the following algorithm: + + 1. if the current user (e.g. "nobody") has a directory named + "tmp" in its home directory, use that (Unix systems only). + + 2. if the environment variable TMPDIR exists, use the location + indicated. + + 3. Otherwise try the locations /usr/tmp, /var/tmp, C:\temp, + /tmp, /temp, ::Temporary Items, and \WWW_ROOT. + +Each of these locations is checked that it is a directory and is +writable. If not, the algorithm tries the next choice. + +=back + +=head2 SPECIAL FORMS FOR IMPORTING HTML-TAG FUNCTIONS + +Many of the methods generate HTML tags. As described below, tag +functions automatically generate both the opening and closing tags. +For example: + + print h1('Level 1 Header'); + +produces + +

    Level 1 Header

    + +There will be some times when you want to produce the start and end +tags yourself. In this case, you can use the form start_I +and end_I, as in: + + print start_h1,'Level 1 Header',end_h1; + +With a few exceptions (described below), start_I and +end_I functions are not generated automatically when you +I. However, you can specify the tags you want to generate +I functions for by putting an asterisk in front of their +name, or, alternatively, requesting either "start_I" or +"end_I" in the import list. + +Example: + + use CGI qw/:standard *table start_ul/; + +In this example, the following functions are generated in addition to +the standard ones: + +=over 4 + +=item 1. start_table() (generates a
    tag) + +=item 2. end_table() (generates a
    tag) + +=item 3. start_ul() (generates a
      tag) + +=item 4. end_ul() (generates a
    tag) + +=back + +=head1 GENERATING DYNAMIC DOCUMENTS + +Most of CGI.pm's functions deal with creating documents on the fly. +Generally you will produce the HTTP header first, followed by the +document itself. CGI.pm provides functions for generating HTTP +headers of various types as well as for generating HTML. For creating +GIF images, see the GD.pm module. + +Each of these functions produces a fragment of HTML or HTTP which you +can print out directly so that it displays in the browser window, +append to a string, or save to a file for later use. + +=head2 CREATING A STANDARD HTTP HEADER: + +Normally the first thing you will do in any CGI script is print out an +HTTP header. This tells the browser what type of document to expect, +and gives other optional information, such as the language, expiration +date, and whether to cache the document. The header can also be +manipulated for special purposes, such as server push and pay per view +pages. + + print $query->header; + + -or- + + print $query->header('image/gif'); + + -or- + + print $query->header('text/html','204 No response'); + + -or- + + print $query->header(-type=>'image/gif', + -nph=>1, + -status=>'402 Payment required', + -expires=>'+3d', + -cookie=>$cookie, + -charset=>'utf-7', + -attachment=>'foo.gif', + -Cost=>'$2.00'); + +header() returns the Content-type: header. You can provide your own +MIME type if you choose, otherwise it defaults to text/html. An +optional second parameter specifies the status code and a human-readable +message. For example, you can specify 204, "No response" to create a +script that tells the browser to do nothing at all. + +The last example shows the named argument style for passing arguments +to the CGI methods using named parameters. Recognized parameters are +B<-type>, B<-status>, B<-expires>, and B<-cookie>. Any other named +parameters will be stripped of their initial hyphens and turned into +header fields, allowing you to specify any HTTP header you desire. +Internal underscores will be turned into hyphens: + + print $query->header(-Content_length=>3002); + +Most browsers will not cache the output from CGI scripts. Every time +the browser reloads the page, the script is invoked anew. You can +change this behavior with the B<-expires> parameter. When you specify +an absolute or relative expiration interval with this parameter, some +browsers and proxy servers will cache the script's output until the +indicated expiration date. The following forms are all valid for the +-expires field: + + +30s 30 seconds from now + +10m ten minutes from now + +1h one hour from now + -1d yesterday (i.e. "ASAP!") + now immediately + +3M in three months + +10y in ten years time + Thursday, 25-Apr-1999 00:40:33 GMT at the indicated time & date + +The B<-cookie> parameter generates a header that tells the browser to provide +a "magic cookie" during all subsequent transactions with your script. +Netscape cookies have a special format that includes interesting attributes +such as expiration time. Use the cookie() method to create and retrieve +session cookies. + +The B<-nph> parameter, if set to a true value, will issue the correct +headers to work with a NPH (no-parse-header) script. This is important +to use with certain servers that expect all their scripts to be NPH. + +The B<-charset> parameter can be used to control the character set +sent to the browser. If not provided, defaults to ISO-8859-1. As a +side effect, this sets the charset() method as well. + +The B<-attachment> parameter can be used to turn the page into an +attachment. Instead of displaying the page, some browsers will prompt +the user to save it to disk. The value of the argument is the +suggested name for the saved file. In order for this to work, you may +have to set the B<-type> to "application/octet-stream". + +The B<-p3p> parameter will add a P3P tag to the outgoing header. The +parameter can be an arrayref or a space-delimited string of P3P tags. +For example: + + print header(-p3p=>[qw(CAO DSP LAW CURa)]); + print header(-p3p=>'CAO DSP LAW CURa'); + +In either case, the outgoing header will be formatted as: + + P3P: policyref="/w3c/p3p.xml" cp="CAO DSP LAW CURa" + +=head2 GENERATING A REDIRECTION HEADER + + print $query->redirect('http://somewhere.else/in/movie/land'); + +Sometimes you don't want to produce a document yourself, but simply +redirect the browser elsewhere, perhaps choosing a URL based on the +time of day or the identity of the user. + +The redirect() function redirects the browser to a different URL. If +you use redirection like this, you should B print out a header as +well. + +You should always use full URLs (including the http: or ftp: part) in +redirection requests. Relative URLs will not work correctly. + +You can also use named arguments: + + print $query->redirect(-uri=>'http://somewhere.else/in/movie/land', + -nph=>1, + -status=>301); + +The B<-nph> parameter, if set to a true value, will issue the correct +headers to work with a NPH (no-parse-header) script. This is important +to use with certain servers, such as Microsoft IIS, which +expect all their scripts to be NPH. + +The B<-status> parameter will set the status of the redirect. HTTP +defines three different possible redirection status codes: + + 301 Moved Permanently + 302 Found + 303 See Other + +The default if not specified is 302, which means "moved temporarily." +You may change the status to another status code if you wish. Be +advised that changing the status to anything other than 301, 302 or +303 will probably break redirection. + +=head2 CREATING THE HTML DOCUMENT HEADER + + print $query->start_html(-title=>'Secrets of the Pyramids', + -author=>'fred@capricorn.org', + -base=>'true', + -target=>'_blank', + -meta=>{'keywords'=>'pharaoh secret mummy', + 'copyright'=>'copyright 1996 King Tut'}, + -style=>{'src'=>'/styles/style1.css'}, + -BGCOLOR=>'blue'); + +After creating the HTTP header, most CGI scripts will start writing +out an HTML document. The start_html() routine creates the top of the +page, along with a lot of optional information that controls the +page's appearance and behavior. + +This method returns a canned HTML header and the opening tag. +All parameters are optional. In the named parameter form, recognized +parameters are -title, -author, -base, -xbase, -dtd, -lang and -target +(see below for the explanation). Any additional parameters you +provide, such as the Netscape unofficial BGCOLOR attribute, are added +to the tag. Additional parameters must be proceeded by a +hyphen. + +The argument B<-xbase> allows you to provide an HREF for the tag +different from the current location, as in + + -xbase=>"http://home.mcom.com/" + +All relative links will be interpreted relative to this tag. + +The argument B<-target> allows you to provide a default target frame +for all the links and fill-out forms on the page. B +See the Netscape documentation on frames for details of how to +manipulate this. + + -target=>"answer_window" + +All relative links will be interpreted relative to this tag. +You add arbitrary meta information to the header with the B<-meta> +argument. This argument expects a reference to an associative array +containing name/value pairs of meta information. These will be turned +into a series of header tags that look something like this: + + + + +To create an HTTP-EQUIV type of tag, use B<-head>, described +below. + +The B<-style> argument is used to incorporate cascading stylesheets +into your code. See the section on CASCADING STYLESHEETS for more +information. + +The B<-lang> argument is used to incorporate a language attribute into +the tag. For example: + + print $q->start_html(-lang=>'fr-CA'); + +The default if not specified is "en-US" for US English, unless the +-dtd parameter specifies an HTML 2.0 or 3.2 DTD, in which case the +lang attribute is left off. You can force the lang attribute to left +off in other cases by passing an empty string (-lang=>''). + +The B<-encoding> argument can be used to specify the character set for +XHTML. It defaults to iso-8859-1 if not specified. + +You can place other arbitrary HTML elements to the section with the +B<-head> tag. For example, to place the rarely-used element in the +head section, use this: + + print start_html(-head=>Link({-rel=>'next', + -href=>'http://www.capricorn.com/s2.html'})); + +To incorporate multiple HTML elements into the section, just pass an +array reference: + + print start_html(-head=>[ + Link({-rel=>'next', + -href=>'http://www.capricorn.com/s2.html'}), + Link({-rel=>'previous', + -href=>'http://www.capricorn.com/s1.html'}) + ] + ); + +And here's how to create an HTTP-EQUIV tag: + + print start_html(-head=>meta({-http_equiv => 'Content-Type', + -content => 'text/html'})) + + +JAVASCRIPTING: The B<-script>, B<-noScript>, B<-onLoad>, +B<-onMouseOver>, B<-onMouseOut> and B<-onUnload> parameters are used +to add Netscape JavaScript calls to your pages. B<-script> should +point to a block of text containing JavaScript function definitions. +This block will be placed within a \n"; + warningsToBrowser(1); # re-enable warnings + +Note: In this respect warningsToBrowser() differs fundamentally from +fatalsToBrowser(), which you should never call yourself! + +=head1 OVERRIDING THE NAME OF THE PROGRAM + +CGI::Carp includes the name of the program that generated the error or +warning in the messages written to the log and the browser window. +Sometimes, Perl can get confused about what the actual name of the +executed program was. In these cases, you can override the program +name that CGI::Carp will use for all messages. + +The quick way to do that is to tell CGI::Carp the name of the program +in its use statement. You can do that by adding +"name=cgi_carp_log_name" to your "use" statement. For example: + + use CGI::Carp qw(name=cgi_carp_log_name); + +. If you want to change the program name partway through the program, +you can use the C function instead. It is not +exported by default, you must import it explicitly by saying + + use CGI::Carp qw(set_progname); + +Once you've done that, you can change the logged name of the program +at any time by calling + + set_progname(new_program_name); + +You can set the program back to the default by calling + + set_progname(undef); + +Note that this override doesn't happen until after the program has +compiled, so any compile-time errors will still show up with the +non-overridden program name + +=head1 CHANGE LOG + +1.05 carpout() added and minor corrections by Marc Hedlund + on 11/26/95. + +1.06 fatalsToBrowser() no longer aborts for fatal errors within + eval() statements. + +1.08 set_message() added and carpout() expanded to allow for FileHandle + objects. + +1.09 set_message() now allows users to pass a code REFERENCE for + really custom error messages. croak and carp are now + exported by default. Thanks to Gunther Birznieks for the + patches. + +1.10 Patch from Chris Dean (ctdean@cogit.com) to allow + module to run correctly under mod_perl. + +1.11 Changed order of > and < escapes. + +1.12 Changed die() on line 217 to CORE::die to avoid B<-w> warning. + +1.13 Added cluck() to make the module orthogonal with Carp. + More mod_perl related fixes. + +1.20 Patch from Ilmari Karonen (perl@itz.pp.sci.fi): Added + warningsToBrowser(). Replaced tags with
     in
    +     fatalsToBrowser() output.
    +
    +1.23 ineval() now checks both $^S and inspects the message for the "eval" pattern
    +     (hack alert!) in order to accomodate various combinations of Perl and
    +     mod_perl.
    +
    +1.24 Patch from Scott Gifford (sgifford@suspectclass.com): Add support
    +     for overriding program name.
    +
    +1.26 Replaced CORE::GLOBAL::die with the evil $SIG{__DIE__} because the
    +     former isn't working in some people's hands.  There is no such thing
    +     as reliable exception handling in Perl.
    +
    +1.27 Replaced tell STDOUT with bytes=tell STDOUT.
    +
    +=head1 AUTHORS
    +
    +Copyright 1995-2002, Lincoln D. Stein.  All rights reserved.  
    +
    +This library is free software; you can redistribute it and/or modify
    +it under the same terms as Perl itself.
    +
    +Address bug reports and comments to: lstein@cshl.org
    +
    +=head1 SEE ALSO
    +
    +Carp, CGI::Base, CGI::BasePlus, CGI::Request, CGI::MiniSvr, CGI::Form,
    +CGI::Response
    +    if (defined($CGI::Carp::PROGNAME)) 
    +    {
    +      $file = $CGI::Carp::PROGNAME;
    +    }
    +
    +=cut
    +
    +require 5.000;
    +use Exporter;
    +#use Carp;
    +BEGIN { 
    +  require Carp; 
    +  *CORE::GLOBAL::die = \&CGI::Carp::die;
    +}
    +
    +use File::Spec;
    +
    +@ISA = qw(Exporter);
    +@EXPORT = qw(confess croak carp);
    +@EXPORT_OK = qw(carpout fatalsToBrowser warningsToBrowser wrap set_message set_progname cluck ^name= die);
    +
    +$main::SIG{__WARN__}=\&CGI::Carp::warn;
    +
    +$CGI::Carp::VERSION    = '1.28';
    +$CGI::Carp::CUSTOM_MSG = undef;
    +
    +
    +# fancy import routine detects and handles 'errorWrap' specially.
    +sub import {
    +    my $pkg = shift;
    +    my(%routines);
    +    my(@name);
    +  
    +    if (@name=grep(/^name=/,@_))
    +      {
    +        my($n) = (split(/=/,$name[0]))[1];
    +        set_progname($n);
    +        @_=grep(!/^name=/,@_);
    +      }
    +
    +    grep($routines{$_}++,@_,@EXPORT);
    +    $WRAP++ if $routines{'fatalsToBrowser'} || $routines{'wrap'};
    +    $WARN++ if $routines{'warningsToBrowser'};
    +    my($oldlevel) = $Exporter::ExportLevel;
    +    $Exporter::ExportLevel = 1;
    +    Exporter::import($pkg,keys %routines);
    +    $Exporter::ExportLevel = $oldlevel;
    +    $main::SIG{__DIE__} =\&CGI::Carp::die if $routines{'fatalsToBrowser'};
    +#    $pkg->export('CORE::GLOBAL','die');
    +}
    +
    +# These are the originals
    +sub realwarn { CORE::warn(@_); }
    +sub realdie { CORE::die(@_); }
    +
    +sub id {
    +    my $level = shift;
    +    my($pack,$file,$line,$sub) = caller($level);
    +    my($dev,$dirs,$id) = File::Spec->splitpath($file);
    +    return ($file,$line,$id);
    +}
    +
    +sub stamp {
    +    my $time = scalar(localtime);
    +    my $frame = 0;
    +    my ($id,$pack,$file,$dev,$dirs);
    +    if (defined($CGI::Carp::PROGNAME)) {
    +        $id = $CGI::Carp::PROGNAME;
    +    } else {
    +        do {
    +  	  $id = $file;
    +	  ($pack,$file) = caller($frame++);
    +        } until !$file;
    +    }
    +    ($dev,$dirs,$id) = File::Spec->splitpath($id);
    +    return "[$time] $id: ";
    +}
    +
    +sub set_progname {
    +    $CGI::Carp::PROGNAME = shift;
    +    return $CGI::Carp::PROGNAME;
    +}
    +
    +
    +sub warn {
    +    my $message = shift;
    +    my($file,$line,$id) = id(1);
    +    $message .= " at $file line $line.\n" unless $message=~/\n$/;
    +    _warn($message) if $WARN;
    +    my $stamp = stamp;
    +    $message=~s/^/$stamp/gm;
    +    realwarn $message;
    +}
    +
    +sub _warn {
    +    my $msg = shift;
    +    if ($EMIT_WARNINGS) {
    +	# We need to mangle the message a bit to make it a valid HTML
    +	# comment.  This is done by substituting similar-looking ISO
    +	# 8859-1 characters for <, > and -.  This is a hack.
    +	$msg =~ tr/<>-/\253\273\255/;
    +	chomp $msg;
    +	print STDOUT "\n";
    +    } else {
    +	push @WARNINGS, $msg;
    +    }
    +}
    +
    +
    +# The mod_perl package Apache::Registry loads CGI programs by calling
    +# eval.  These evals don't count when looking at the stack backtrace.
    +sub _longmess {
    +    my $message = Carp::longmess();
    +    $message =~ s,eval[^\n]+(ModPerl|Apache)/Registry\w*\.pm.*,,s
    +        if exists $ENV{MOD_PERL};
    +    return $message;
    +}
    +
    +sub ineval {
    +  (exists $ENV{MOD_PERL} ? 0 : $^S) || _longmess() =~ /eval [\{\']/m
    +}
    +
    +sub die {
    +  my ($arg,@rest) = @_;
    +  realdie ($arg,@rest) if ineval();
    +
    +  if (!ref($arg)) {
    +    $arg = join("", ($arg,@rest));
    +    my($file,$line,$id) = id(1);
    +    $arg .= " at $file line $line." unless $arg=~/\n$/;
    +    &fatalsToBrowser($arg) if $WRAP;
    +    if (($arg =~ /\n$/) || !exists($ENV{MOD_PERL})) {
    +      my $stamp = stamp;
    +      $arg=~s/^/$stamp/gm;
    +    }
    +    if ($arg !~ /\n$/) {
    +      $arg .= "\n";
    +    }
    +  }
    +  realdie $arg;
    +}
    +
    +sub set_message {
    +    $CGI::Carp::CUSTOM_MSG = shift;
    +    return $CGI::Carp::CUSTOM_MSG;
    +}
    +
    +sub confess { CGI::Carp::die Carp::longmess @_; }
    +sub croak   { CGI::Carp::die Carp::shortmess @_; }
    +sub carp    { CGI::Carp::warn Carp::shortmess @_; }
    +sub cluck   { CGI::Carp::warn Carp::longmess @_; }
    +
    +# We have to be ready to accept a filehandle as a reference
    +# or a string.
    +sub carpout {
    +    my($in) = @_;
    +    my($no) = fileno(to_filehandle($in));
    +    realdie("Invalid filehandle $in\n") unless defined $no;
    +    
    +    open(SAVEERR, ">&STDERR");
    +    open(STDERR, ">&$no") or 
    +	( print SAVEERR "Unable to redirect STDERR: $!\n" and exit(1) );
    +}
    +
    +sub warningsToBrowser {
    +    $EMIT_WARNINGS = @_ ? shift : 1;
    +    _warn(shift @WARNINGS) while $EMIT_WARNINGS and @WARNINGS;
    +}
    +
    +# headers
    +sub fatalsToBrowser {
    +  my($msg) = @_;
    +  $msg=~s/&/&/g;
    +  $msg=~s/>/>/g;
    +  $msg=~s/$ENV{SERVER_ADMIN})] :
    +      "this site's webmaster";
    +  my ($outer_message) = <Software error:
    +
    $msg
    +

    +$outer_message +

    +END + ; + + if ($mod_perl) { + require mod_perl; + if ($mod_perl::VERSION >= 1.99) { + $mod_perl = 2; + require Apache::RequestRec; + require Apache::RequestIO; + require Apache::RequestUtil; + require APR::Pool; + require ModPerl::Util; + require Apache::Response; + } + my $r = Apache->request; + # If bytes have already been sent, then + # we print the message out directly. + # Otherwise we make a custom error + # handler to produce the doc for us. + if ($r->bytes_sent) { + $r->print($mess); + $mod_perl == 2 ? ModPerl::Util::exit(0) : $r->exit; + } else { + # MSIE won't display a custom 500 response unless it is >512 bytes! + if ($ENV{HTTP_USER_AGENT} =~ /MSIE/) { + $mess = "\n$mess"; + } + $r->custom_response(500,$mess); + } + } else { + my $bytes_written = eval{tell STDOUT}; + if (defined $bytes_written && $bytes_written > 0) { + print STDOUT $mess; + } + else { + print STDOUT "Content-type: text/html\n\n"; + print STDOUT $mess; + } + } + + warningsToBrowser(1); # emit warnings before dying +} + +# Cut and paste from CGI.pm so that we don't have the overhead of +# always loading the entire CGI module. +sub to_filehandle { + my $thingy = shift; + return undef unless $thingy; + return $thingy if UNIVERSAL::isa($thingy,'GLOB'); + return $thingy if UNIVERSAL::isa($thingy,'FileHandle'); + if (!ref($thingy)) { + my $caller = 1; + while (my $package = caller($caller++)) { + my($tmp) = $thingy=~/[\':]/ ? $thingy : "$package\:\:$thingy"; + return $tmp if defined(fileno($tmp)); + } + } + return undef; +} + +1; diff --git a/lib/CGI/Cookie.pm b/lib/CGI/Cookie.pm new file mode 100644 index 0000000..27a93c5 --- /dev/null +++ b/lib/CGI/Cookie.pm @@ -0,0 +1,478 @@ +package CGI::Cookie; + +# See the bottom of this file for the POD documentation. Search for the +# string '=head'. + +# You can run this file through either pod2man or pod2html to produce pretty +# documentation in manual or html file format (these utilities are part of the +# Perl 5 distribution). + +# Copyright 1995-1999, Lincoln D. Stein. All rights reserved. +# It may be used and modified freely, but I do request that this copyright +# notice remain attached to the file. You may modify this module as you +# wish, but if you redistribute a modified version, please attach a note +# listing the modifications you have made. + +$CGI::Cookie::VERSION='1.24'; + +use CGI::Util qw(rearrange unescape escape); +use overload '""' => \&as_string, + 'cmp' => \&compare, + 'fallback'=>1; + +# Turn on special checking for Doug MacEachern's modperl +my $MOD_PERL = 0; +if (exists $ENV{MOD_PERL}) { + eval "require mod_perl"; + if (defined $mod_perl::VERSION) { + if ($mod_perl::VERSION >= 1.99) { + $MOD_PERL = 2; + require Apache::RequestUtil; + } else { + $MOD_PERL = 1; + require Apache; + } + } +} + +# fetch a list of cookies from the environment and +# return as a hash. the cookies are parsed as normal +# escaped URL data. +sub fetch { + my $class = shift; + my $raw_cookie = get_raw_cookie(@_) or return; + return $class->parse($raw_cookie); +} + +# Fetch a list of cookies from the environment or the incoming headers and +# return as a hash. The cookie values are not unescaped or altered in any way. + sub raw_fetch { + my $class = shift; + my $raw_cookie = get_raw_cookie(@_) or return; + my %results; + my($key,$value); + + my(@pairs) = split("; ?",$raw_cookie); + foreach (@pairs) { + s/\s*(.*?)\s*/$1/; + if (/^([^=]+)=(.*)/) { + $key = $1; + $value = $2; + } + else { + $key = $_; + $value = ''; + } + $results{$key} = $value; + } + return \%results unless wantarray; + return %results; +} + +sub get_raw_cookie { + my $r = shift; + $r ||= eval { Apache->request() } if $MOD_PERL; + if ($r) { + $raw_cookie = $r->headers_in->{'Cookie'}; + } else { + if ($MOD_PERL && !exists $ENV{REQUEST_METHOD}) { + die "Run $r->subprocess_env; before calling fetch()"; + } + $raw_cookie = $ENV{HTTP_COOKIE} || $ENV{COOKIE}; + } +} + + +sub parse { + my ($self,$raw_cookie) = @_; + my %results; + + my(@pairs) = split("; ?",$raw_cookie); + foreach (@pairs) { + s/\s*(.*?)\s*/$1/; + my($key,$value) = split("=",$_,2); + + # Some foreign cookies are not in name=value format, so ignore + # them. + next if !defined($value); + my @values = (); + if ($value ne '') { + @values = map unescape($_),split(/[&;]/,$value.'&dmy'); + pop @values; + } + $key = unescape($key); + # A bug in Netscape can cause several cookies with same name to + # appear. The FIRST one in HTTP_COOKIE is the most recent version. + $results{$key} ||= $self->new(-name=>$key,-value=>\@values); + } + return \%results unless wantarray; + return %results; +} + +sub new { + my $class = shift; + $class = ref($class) if ref($class); + my($name,$value,$path,$domain,$secure,$expires) = + rearrange([NAME,[VALUE,VALUES],PATH,DOMAIN,SECURE,EXPIRES],@_); + + # Pull out our parameters. + my @values; + if (ref($value)) { + if (ref($value) eq 'ARRAY') { + @values = @$value; + } elsif (ref($value) eq 'HASH') { + @values = %$value; + } + } else { + @values = ($value); + } + + bless my $self = { + 'name'=>$name, + 'value'=>[@values], + },$class; + + # IE requires the path and domain to be present for some reason. + $path ||= "/"; + # however, this breaks networks which use host tables without fully qualified + # names, so we comment it out. + # $domain = CGI::virtual_host() unless defined $domain; + + $self->path($path) if defined $path; + $self->domain($domain) if defined $domain; + $self->secure($secure) if defined $secure; + $self->expires($expires) if defined $expires; +# $self->max_age($expires) if defined $expires; + return $self; +} + +sub as_string { + my $self = shift; + return "" unless $self->name; + + my(@constant_values,$domain,$path,$expires,$max_age,$secure); + + push(@constant_values,"domain=$domain") if $domain = $self->domain; + push(@constant_values,"path=$path") if $path = $self->path; + push(@constant_values,"expires=$expires") if $expires = $self->expires; + push(@constant_values,"max-age=$max_age") if $max_age = $self->max_age; + push(@constant_values,"secure") if $secure = $self->secure; + + my($key) = escape($self->name); + my($cookie) = join("=",$key,join("&",map escape($_),$self->value)); + return join("; ",$cookie,@constant_values); +} + +sub compare { + my $self = shift; + my $value = shift; + return "$self" cmp $value; +} + +# accessors +sub name { + my $self = shift; + my $name = shift; + $self->{'name'} = $name if defined $name; + return $self->{'name'}; +} + +sub value { + my $self = shift; + my $value = shift; + if (defined $value) { + my @values; + if (ref($value)) { + if (ref($value) eq 'ARRAY') { + @values = @$value; + } elsif (ref($value) eq 'HASH') { + @values = %$value; + } + } else { + @values = ($value); + } + $self->{'value'} = [@values]; + } + return wantarray ? @{$self->{'value'}} : $self->{'value'}->[0] +} + +sub domain { + my $self = shift; + my $domain = shift; + $self->{'domain'} = $domain if defined $domain; + return $self->{'domain'}; +} + +sub secure { + my $self = shift; + my $secure = shift; + $self->{'secure'} = $secure if defined $secure; + return $self->{'secure'}; +} + +sub expires { + my $self = shift; + my $expires = shift; + $self->{'expires'} = CGI::Util::expires($expires,'cookie') if defined $expires; + return $self->{'expires'}; +} + +sub max_age { + my $self = shift; + my $expires = shift; + $self->{'max-age'} = CGI::Util::expire_calc($expires)-time() if defined $expires; + return $self->{'max-age'}; +} + +sub path { + my $self = shift; + my $path = shift; + $self->{'path'} = $path if defined $path; + return $self->{'path'}; +} + +1; + +=head1 NAME + +CGI::Cookie - Interface to Netscape Cookies + +=head1 SYNOPSIS + + use CGI qw/:standard/; + use CGI::Cookie; + + # Create new cookies and send them + $cookie1 = new CGI::Cookie(-name=>'ID',-value=>123456); + $cookie2 = new CGI::Cookie(-name=>'preferences', + -value=>{ font => Helvetica, + size => 12 } + ); + print header(-cookie=>[$cookie1,$cookie2]); + + # fetch existing cookies + %cookies = fetch CGI::Cookie; + $id = $cookies{'ID'}->value; + + # create cookies returned from an external source + %cookies = parse CGI::Cookie($ENV{COOKIE}); + +=head1 DESCRIPTION + +CGI::Cookie is an interface to Netscape (HTTP/1.1) cookies, an +innovation that allows Web servers to store persistent information on +the browser's side of the connection. Although CGI::Cookie is +intended to be used in conjunction with CGI.pm (and is in fact used by +it internally), you can use this module independently. + +For full information on cookies see + + http://www.ics.uci.edu/pub/ietf/http/rfc2109.txt + +=head1 USING CGI::Cookie + +CGI::Cookie is object oriented. Each cookie object has a name and a +value. The name is any scalar value. The value is any scalar or +array value (associative arrays are also allowed). Cookies also have +several optional attributes, including: + +=over 4 + +=item B<1. expiration date> + +The expiration date tells the browser how long to hang on to the +cookie. If the cookie specifies an expiration date in the future, the +browser will store the cookie information in a disk file and return it +to the server every time the user reconnects (until the expiration +date is reached). If the cookie species an expiration date in the +past, the browser will remove the cookie from the disk file. If the +expiration date is not specified, the cookie will persist only until +the user quits the browser. + +=item B<2. domain> + +This is a partial or complete domain name for which the cookie is +valid. The browser will return the cookie to any host that matches +the partial domain name. For example, if you specify a domain name +of ".capricorn.com", then Netscape will return the cookie to +Web servers running on any of the machines "www.capricorn.com", +"ftp.capricorn.com", "feckless.capricorn.com", etc. Domain names +must contain at least two periods to prevent attempts to match +on top level domains like ".edu". If no domain is specified, then +the browser will only return the cookie to servers on the host the +cookie originated from. + +=item B<3. path> + +If you provide a cookie path attribute, the browser will check it +against your script's URL before returning the cookie. For example, +if you specify the path "/cgi-bin", then the cookie will be returned +to each of the scripts "/cgi-bin/tally.pl", "/cgi-bin/order.pl", and +"/cgi-bin/customer_service/complain.pl", but not to the script +"/cgi-private/site_admin.pl". By default, the path is set to "/", so +that all scripts at your site will receive the cookie. + +=item B<4. secure flag> + +If the "secure" attribute is set, the cookie will only be sent to your +script if the CGI request is occurring on a secure channel, such as SSL. + +=back + +=head2 Creating New Cookies + + $c = new CGI::Cookie(-name => 'foo', + -value => 'bar', + -expires => '+3M', + -domain => '.capricorn.com', + -path => '/cgi-bin/database', + -secure => 1 + ); + +Create cookies from scratch with the B method. The B<-name> and +B<-value> parameters are required. The name must be a scalar value. +The value can be a scalar, an array reference, or a hash reference. +(At some point in the future cookies will support one of the Perl +object serialization protocols for full generality). + +B<-expires> accepts any of the relative or absolute date formats +recognized by CGI.pm, for example "+3M" for three months in the +future. See CGI.pm's documentation for details. + +B<-domain> points to a domain name or to a fully qualified host name. +If not specified, the cookie will be returned only to the Web server +that created it. + +B<-path> points to a partial URL on the current server. The cookie +will be returned to all URLs beginning with the specified path. If +not specified, it defaults to '/', which returns the cookie to all +pages at your site. + +B<-secure> if set to a true value instructs the browser to return the +cookie only when a cryptographic protocol is in use. + +=head2 Sending the Cookie to the Browser + +Within a CGI script you can send a cookie to the browser by creating +one or more Set-Cookie: fields in the HTTP header. Here is a typical +sequence: + + my $c = new CGI::Cookie(-name => 'foo', + -value => ['bar','baz'], + -expires => '+3M'); + + print "Set-Cookie: $c\n"; + print "Content-Type: text/html\n\n"; + +To send more than one cookie, create several Set-Cookie: fields. + +If you are using CGI.pm, you send cookies by providing a -cookie +argument to the header() method: + + print header(-cookie=>$c); + +Mod_perl users can set cookies using the request object's header_out() +method: + + $r->headers_out->set('Set-Cookie' => $c); + +Internally, Cookie overloads the "" operator to call its as_string() +method when incorporated into the HTTP header. as_string() turns the +Cookie's internal representation into an RFC-compliant text +representation. You may call as_string() yourself if you prefer: + + print "Set-Cookie: ",$c->as_string,"\n"; + +=head2 Recovering Previous Cookies + + %cookies = fetch CGI::Cookie; + +B returns an associative array consisting of all cookies +returned by the browser. The keys of the array are the cookie names. You +can iterate through the cookies this way: + + %cookies = fetch CGI::Cookie; + foreach (keys %cookies) { + do_something($cookies{$_}); + } + +In a scalar context, fetch() returns a hash reference, which may be more +efficient if you are manipulating multiple cookies. + +CGI.pm uses the URL escaping methods to save and restore reserved characters +in its cookies. If you are trying to retrieve a cookie set by a foreign server, +this escaping method may trip you up. Use raw_fetch() instead, which has the +same semantics as fetch(), but performs no unescaping. + +You may also retrieve cookies that were stored in some external +form using the parse() class method: + + $COOKIES = `cat /usr/tmp/Cookie_stash`; + %cookies = parse CGI::Cookie($COOKIES); + +If you are in a mod_perl environment, you can save some overhead by +passing the request object to fetch() like this: + + CGI::Cookie->fetch($r); + +=head2 Manipulating Cookies + +Cookie objects have a series of accessor methods to get and set cookie +attributes. Each accessor has a similar syntax. Called without +arguments, the accessor returns the current value of the attribute. +Called with an argument, the accessor changes the attribute and +returns its new value. + +=over 4 + +=item B + +Get or set the cookie's name. Example: + + $name = $c->name; + $new_name = $c->name('fred'); + +=item B + +Get or set the cookie's value. Example: + + $value = $c->value; + @new_value = $c->value(['a','b','c','d']); + +B is context sensitive. In a list context it will return +the current value of the cookie as an array. In a scalar context it +will return the B value of a multivalued cookie. + +=item B + +Get or set the cookie's domain. + +=item B + +Get or set the cookie's path. + +=item B + +Get or set the cookie's expiration time. + +=back + + +=head1 AUTHOR INFORMATION + +Copyright 1997-1998, Lincoln D. Stein. All rights reserved. + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + +Address bug reports and comments to: lstein@cshl.org + +=head1 BUGS + +This section intentionally left blank. + +=head1 SEE ALSO + +L, L + +=cut diff --git a/lib/CGI/Fast.pm b/lib/CGI/Fast.pm new file mode 100644 index 0000000..43b8709 --- /dev/null +++ b/lib/CGI/Fast.pm @@ -0,0 +1,230 @@ +package CGI::Fast; + +# See the bottom of this file for the POD documentation. Search for the +# string '=head'. + +# You can run this file through either pod2man or pod2html to produce pretty +# documentation in manual or html file format (these utilities are part of the +# Perl 5 distribution). + +# Copyright 1995,1996, Lincoln D. Stein. All rights reserved. +# It may be used and modified freely, but I do request that this copyright +# notice remain attached to the file. You may modify this module as you +# wish, but if you redistribute a modified version, please attach a note +# listing the modifications you have made. + +# The most recent version and complete docs are available at: +# http://www.genome.wi.mit.edu/ftp/pub/software/WWW/cgi_docs.html +# ftp://ftp-genome.wi.mit.edu/pub/software/WWW/ +$CGI::Fast::VERSION='1.05'; + +use CGI; +use FCGI; +@ISA = ('CGI'); + +# workaround for known bug in libfcgi +while (($ignore) = each %ENV) { } + +# override the initialization behavior so that +# state is NOT maintained between invocations +sub save_request { + # no-op +} + +# If ENV{FCGI_SOCKET_PATH} is specified, we maintain a FCGI Request handle +# in this package variable. +use vars qw($Ext_Request); +BEGIN { + # If ENV{FCGI_SOCKET_PATH} is given, explicitly open the socket, + # and keep the request handle around from which to call Accept(). + if ($ENV{FCGI_SOCKET_PATH}) { + my $path = $ENV{FCGI_SOCKET_PATH}; + my $backlog = $ENV{FCGI_LISTEN_QUEUE} || 100; + my $socket = FCGI::OpenSocket( $path, $backlog ); + $Ext_Request = FCGI::Request( \*STDIN, \*STDOUT, \*STDERR, + \%ENV, $socket, 1 ); + } +} + +# New is slightly different in that it calls FCGI's +# accept() method. +sub new { + my ($self, $initializer, @param) = @_; + unless (defined $initializer) { + if ($Ext_Request) { + return undef unless $Ext_Request->Accept() >= 0; + } else { + return undef unless FCGI::accept() >= 0; + } + } + return $CGI::Q = $self->SUPER::new($initializer, @param); +} + +1; + +=head1 NAME + +CGI::Fast - CGI Interface for Fast CGI + +=head1 SYNOPSIS + + use CGI::Fast qw(:standard); + $COUNTER = 0; + while (new CGI::Fast) { + print header; + print start_html("Fast CGI Rocks"); + print + h1("Fast CGI Rocks"), + "Invocation number ",b($COUNTER++), + " PID ",b($$),".", + hr; + print end_html; + } + +=head1 DESCRIPTION + +CGI::Fast is a subclass of the CGI object created by +CGI.pm. It is specialized to work well with the Open Market +FastCGI standard, which greatly speeds up CGI scripts by +turning them into persistently running server processes. Scripts +that perform time-consuming initialization processes, such as +loading large modules or opening persistent database connections, +will see large performance improvements. + +=head1 OTHER PIECES OF THE PUZZLE + +In order to use CGI::Fast you'll need a FastCGI-enabled Web +server. Open Market's server is FastCGI-savvy. There are also +freely redistributable FastCGI modules for NCSA httpd 1.5 and Apache. +FastCGI-enabling modules for Microsoft Internet Information Server and +Netscape Communications Server have been announced. + +In addition, you'll need a version of the Perl interpreter that has +been linked with the FastCGI I/O library. Precompiled binaries are +available for several platforms, including DEC Alpha, HP-UX and +SPARC/Solaris, or you can rebuild Perl from source with patches +provided in the FastCGI developer's kit. The FastCGI Perl interpreter +can be used in place of your normal Perl without ill consequences. + +You can find FastCGI modules for Apache and NCSA httpd, precompiled +Perl interpreters, and the FastCGI developer's kit all at URL: + + http://www.fastcgi.com/ + +=head1 WRITING FASTCGI PERL SCRIPTS + +FastCGI scripts are persistent: one or more copies of the script +are started up when the server initializes, and stay around until +the server exits or they die a natural death. After performing +whatever one-time initialization it needs, the script enters a +loop waiting for incoming connections, processing the request, and +waiting some more. + +A typical FastCGI script will look like this: + + #!/usr/local/bin/perl # must be a FastCGI version of perl! + use CGI::Fast; + &do_some_initialization(); + while ($q = new CGI::Fast) { + &process_request($q); + } + +Each time there's a new request, CGI::Fast returns a +CGI object to your loop. The rest of the time your script +waits in the call to new(). When the server requests that +your script be terminated, new() will return undef. You can +of course exit earlier if you choose. A new version of the +script will be respawned to take its place (this may be +necessary in order to avoid Perl memory leaks in long-running +scripts). + +CGI.pm's default CGI object mode also works. Just modify the loop +this way: + + while (new CGI::Fast) { + &process_request; + } + +Calls to header(), start_form(), etc. will all operate on the +current request. + +=head1 INSTALLING FASTCGI SCRIPTS + +See the FastCGI developer's kit documentation for full details. On +the Apache server, the following line must be added to srm.conf: + + AddType application/x-httpd-fcgi .fcgi + +FastCGI scripts must end in the extension .fcgi. For each script you +install, you must add something like the following to srm.conf: + + FastCgiServer /usr/etc/httpd/fcgi-bin/file_upload.fcgi -processes 2 + +This instructs Apache to launch two copies of file_upload.fcgi at +startup time. + +=head1 USING FASTCGI SCRIPTS AS CGI SCRIPTS + +Any script that works correctly as a FastCGI script will also work +correctly when installed as a vanilla CGI script. However it will +not see any performance benefit. + +=head1 EXTERNAL FASTCGI SERVER INVOCATION + +FastCGI supports a TCP/IP transport mechanism which allows FastCGI scripts to run +external to the webserver, perhaps on a remote machine. To configure the +webserver to connect to an external FastCGI server, you would add the following +to your srm.conf: + + FastCgiExternalServer /usr/etc/httpd/fcgi-bin/file_upload.fcgi -host sputnik:8888 + +Two environment variables affect how the C object is created, +allowing C to be used as an external FastCGI server. (See C +documentation for C for more information.) + +=over + +=item FCGI_SOCKET_PATH + +The address (TCP/IP) or path (UNIX Domain) of the socket the external FastCGI +script to which bind an listen for incoming connections from the web server. + +=item FCGI_LISTEN_QUEUE + +Maximum length of the queue of pending connections. + +=back + +For example: + + #!/usr/local/bin/perl # must be a FastCGI version of perl! + use CGI::Fast; + &do_some_initialization(); + $ENV{FCGI_SOCKET_PATH} = "sputnik:8888"; + $ENV{FCGI_LISTEN_QUEUE} = 100; + while ($q = new CGI::Fast) { + &process_request($q); + } + +=head1 CAVEATS + +I haven't tested this very much. + +=head1 AUTHOR INFORMATION + +Copyright 1996-1998, Lincoln D. Stein. All rights reserved. + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + +Address bug reports and comments to: lstein@cshl.org + +=head1 BUGS + +This section intentionally left blank. + +=head1 SEE ALSO + +L, L + +=cut diff --git a/lib/CGI/Pretty.pm b/lib/CGI/Pretty.pm new file mode 100644 index 0000000..d824a02 --- /dev/null +++ b/lib/CGI/Pretty.pm @@ -0,0 +1,275 @@ +package CGI::Pretty; + +# See the bottom of this file for the POD documentation. Search for the +# string '=head'. + +# You can run this file through either pod2man or pod2html to produce pretty +# documentation in manual or html file format (these utilities are part of the +# Perl 5 distribution). + +use strict; +use CGI (); + +$CGI::Pretty::VERSION = '1.08'; +$CGI::DefaultClass = __PACKAGE__; +$CGI::Pretty::AutoloadClass = 'CGI'; +@CGI::Pretty::ISA = qw( CGI ); + +initialize_globals(); + +sub _prettyPrint { + my $input = shift; + return if !$$input; + return if !$CGI::Pretty::LINEBREAK || !$CGI::Pretty::INDENT; + +# print STDERR "'", $$input, "'\n"; + + foreach my $i ( @CGI::Pretty::AS_IS ) { + if ( $$input =~ m{}si ) { + my ( $a, $b, $c ) = $$input =~ m{(.*)(<$i[\s/>].*?)(.*)}si; + next if !$b; + $a ||= ""; + $c ||= ""; + + _prettyPrint( \$a ) if $a; + _prettyPrint( \$c ) if $c; + + $b ||= ""; + $$input = "$a$b$c"; + return; + } + } + $$input =~ s/$CGI::Pretty::LINEBREAK/$CGI::Pretty::LINEBREAK$CGI::Pretty::INDENT/g; +} + +sub comment { + my($self,@p) = CGI::self_or_CGI(@_); + + my $s = "@p"; + $s =~ s/$CGI::Pretty::LINEBREAK/$CGI::Pretty::LINEBREAK$CGI::Pretty::INDENT/g if $CGI::Pretty::LINEBREAK; + + return $self->SUPER::comment( "$CGI::Pretty::LINEBREAK$CGI::Pretty::INDENT$s$CGI::Pretty::LINEBREAK" ) . $CGI::Pretty::LINEBREAK; +} + +sub _make_tag_func { + my ($self,$tagname) = @_; + + # As Lincoln as noted, the last else clause is VERY hairy, and it + # took me a while to figure out what I was trying to do. + # What it does is look for tags that shouldn't be indented (e.g. PRE) + # and makes sure that when we nest tags, those tags don't get + # indented. + # For an example, try print td( pre( "hello\nworld" ) ); + # If we didn't care about stuff like that, the code would be + # MUCH simpler. BTW: I won't claim to be a regular expression + # guru, so if anybody wants to contribute something that would + # be quicker, easier to read, etc, I would be more than + # willing to put it in - Brian + + my $func = qq" + sub $tagname {"; + + $func .= q' + shift if $_[0] && + (ref($_[0]) && + (substr(ref($_[0]),0,3) eq "CGI" || + UNIVERSAL::isa($_[0],"CGI"))); + my($attr) = ""; + if (ref($_[0]) && ref($_[0]) eq "HASH") { + my(@attr) = make_attributes(shift()||undef,1); + $attr = " @attr" if @attr; + }'; + + if ($tagname=~/start_(\w+)/i) { + $func .= qq! + return "<\L$1\E\$attr>\$CGI::Pretty::LINEBREAK";} !; + } elsif ($tagname=~/end_(\w+)/i) { + $func .= qq! + return "<\L/$1\E>\$CGI::Pretty::LINEBREAK"; } !; + } else { + $func .= qq# + return ( \$CGI::XHTML ? "<\L$tagname\E\$attr />" : "<\L$tagname\E\$attr>" ) . + \$CGI::Pretty::LINEBREAK unless \@_; + my(\$tag,\$untag) = ("<\L$tagname\E\$attr>","\E"); + + my \%ASIS = map { lc("\$_") => 1 } \@CGI::Pretty::AS_IS; + my \@args; + if ( \$CGI::Pretty::LINEBREAK || \$CGI::Pretty::INDENT ) { + if(ref(\$_[0]) eq 'ARRAY') { + \@args = \@{\$_[0]} + } else { + foreach (\@_) { + \$args[0] .= \$_; + \$args[0] .= \$CGI::Pretty::LINEBREAK if \$args[0] !~ /\$CGI::Pretty::LINEBREAK\$/ && 0; + chomp \$args[0] if exists \$ASIS{ "\L$tagname\E" }; + + \$args[0] .= \$" if \$args[0] !~ /\$CGI::Pretty::LINEBREAK\$/ && 1; + } + chop \$args[0]; + } + } + else { + \@args = ref(\$_[0]) eq 'ARRAY' ? \@{\$_[0]} : "\@_"; + } + + my \@result; + if ( exists \$ASIS{ "\L$tagname\E" } ) { + \@result = map { "\$tag\$_\$untag\$CGI::Pretty::LINEBREAK" } + \@args; + } + else { + \@result = map { + chomp; + my \$tmp = \$_; + CGI::Pretty::_prettyPrint( \\\$tmp ); + \$tag . \$CGI::Pretty::LINEBREAK . + \$CGI::Pretty::INDENT . \$tmp . \$CGI::Pretty::LINEBREAK . + \$untag . \$CGI::Pretty::LINEBREAK + } \@args; + } + local \$" = "" if \$CGI::Pretty::LINEBREAK || \$CGI::Pretty::INDENT; + return "\@result"; + }#; + } + + return $func; +} + +sub start_html { + return CGI::start_html( @_ ) . $CGI::Pretty::LINEBREAK; +} + +sub end_html { + return CGI::end_html( @_ ) . $CGI::Pretty::LINEBREAK; +} + +sub new { + my $class = shift; + my $this = $class->SUPER::new( @_ ); + + if ($CGI::MOD_PERL) { + my $r = Apache->request; + if ($CGI::MOD_PERL == 1) { + $r->register_cleanup(\&CGI::Pretty::_reset_globals); + } + else { + $r->pool->cleanup_register(\&CGI::Pretty::_reset_globals); + } + } + $class->_reset_globals if $CGI::PERLEX; + + return bless $this, $class; +} + +sub initialize_globals { + # This is the string used for indentation of tags + $CGI::Pretty::INDENT = "\t"; + + # This is the string used for seperation between tags + $CGI::Pretty::LINEBREAK = $/; + + # These tags are not prettify'd. + @CGI::Pretty::AS_IS = qw( a pre code script textarea td ); + + 1; +} +sub _reset_globals { initialize_globals(); } + +1; + +=head1 NAME + +CGI::Pretty - module to produce nicely formatted HTML code + +=head1 SYNOPSIS + + use CGI::Pretty qw( :html3 ); + + # Print a table with a single data element + print table( TR( td( "foo" ) ) ); + +=head1 DESCRIPTION + +CGI::Pretty is a module that derives from CGI. It's sole function is to +allow users of CGI to output nicely formatted HTML code. + +When using the CGI module, the following code: + print table( TR( td( "foo" ) ) ); + +produces the following output: +
    foo
    + +If a user were to create a table consisting of many rows and many columns, +the resultant HTML code would be quite difficult to read since it has no +carriage returns or indentation. + +CGI::Pretty fixes this problem. What it does is add a carriage +return and indentation to the HTML code so that one can easily read +it. + + print table( TR( td( "foo" ) ) ); + +now produces the following output: + + + + +
    + foo +
    + + +=head2 Tags that won't be formatted + +The and
     tags are not formatted.  If these tags were formatted, the
    +user would see the extra indentation on the web browser causing the page to
    +look different than what would be expected.  If you wish to add more tags to
    +the list of tags that are not to be touched, push them onto the C<@AS_IS> array:
    +
    +    push @CGI::Pretty::AS_IS,qw(CODE XMP);
    +
    +=head2 Customizing the Indenting
    +
    +If you wish to have your own personal style of indenting, you can change the
    +C<$INDENT> variable:
    +
    +    $CGI::Pretty::INDENT = "\t\t";
    +
    +would cause the indents to be two tabs.
    +
    +Similarly, if you wish to have more space between lines, you may change the
    +C<$LINEBREAK> variable:
    +
    +    $CGI::Pretty::LINEBREAK = "\n\n";
    +
    +would create two carriage returns between lines.
    +
    +If you decide you want to use the regular CGI indenting, you can easily do 
    +the following:
    +
    +    $CGI::Pretty::INDENT = $CGI::Pretty::LINEBREAK = "";
    +
    +=head1 BUGS
    +
    +This section intentionally left blank.
    +
    +=head1 AUTHOR
    +
    +Brian Paulsen , with minor modifications by
    +Lincoln Stein  for incorporation into the CGI.pm
    +distribution.
    +
    +Copyright 1999, Brian Paulsen.  All rights reserved.
    +
    +This library is free software; you can redistribute it and/or modify
    +it under the same terms as Perl itself.
    +
    +Bug reports and comments to Brian@ThePaulsens.com.  You can also write
    +to lstein@cshl.org, but this code looks pretty hairy to me and I'm not
    +sure I understand it!
    +
    +=head1 SEE ALSO
    +
    +L
    +
    +=cut
    diff --git a/lib/CGI/Push.pm b/lib/CGI/Push.pm
    new file mode 100644
    index 0000000..8356c60
    --- /dev/null
    +++ b/lib/CGI/Push.pm
    @@ -0,0 +1,328 @@
    +package CGI::Push;
    +
    +# See the bottom of this file for the POD documentation.  Search for the
    +# string '=head'.
    +
    +# You can run this file through either pod2man or pod2html to produce pretty
    +# documentation in manual or html file format (these utilities are part of the
    +# Perl 5 distribution).
    +
    +# Copyright 1995-2000, Lincoln D. Stein.  All rights reserved.
    +# It may be used and modified freely, but I do request that this copyright
    +# notice remain attached to the file.  You may modify this module as you
    +# wish, but if you redistribute a modified version, please attach a note
    +# listing the modifications you have made.
    +
    +# The most recent version and complete docs are available at:
    +#   http://stein.cshl.org/WWW/software/CGI/
    +
    +$CGI::Push::VERSION='1.04';
    +use CGI;
    +use CGI::Util 'rearrange';
    +@ISA = ('CGI');
    +
    +$CGI::DefaultClass = 'CGI::Push';
    +$CGI::Push::AutoloadClass = 'CGI';
    +
    +# add do_push() and push_delay() to exported tags
    +push(@{$CGI::EXPORT_TAGS{':standard'}},'do_push','push_delay');
    +
    +sub do_push {
    +    my ($self,@p) = CGI::self_or_default(@_);
    +
    +    # unbuffer output
    +    $| = 1;
    +    srand;
    +    my ($random) = sprintf("%08.0f",rand()*1E8);
    +    my ($boundary) = "----=_NeXtPaRt$random";
    +
    +    my (@header);
    +    my ($type,$callback,$delay,$last_page,$cookie,$target,$expires,$nph,$handle,@other) = rearrange([TYPE,NEXT_PAGE,DELAY,LAST_PAGE,[COOKIE,COOKIES],TARGET,EXPIRES,NPH,HANDLE],@p);
    +    $type = 'text/html' unless $type;
    +    $callback = \&simple_counter unless $callback && ref($callback) eq 'CODE';
    +    $delay = 1 unless defined($delay);
    +    $self->push_delay($delay);
    +    $nph = 1 unless defined($nph);
    +    $handle = \*STDOUT unless defined($handle);
    +
    +sdf;kjsdlfsdfkl
    +
    +    my(@o);
    +    foreach (@other) { push(@o,split("=")); }
    +    push(@o,'-Target'=>$target) if defined($target);
    +    push(@o,'-Cookie'=>$cookie) if defined($cookie);
    +    push(@o,'-Type'=>"multipart/x-mixed-replace;boundary=\"$boundary\"");
    +    push(@o,'-Server'=>"CGI.pm Push Module") if $nph;
    +    push(@o,'-Status'=>'200 OK');
    +    push(@o,'-nph'=>1) if $nph;
    +    $handle->print($self->header(@o));
    +
    +    $boundary = "$CGI::CRLF--$boundary";
    +
    +    $handle->print("WARNING: YOUR BROWSER DOESN'T SUPPORT THIS SERVER-PUSH TECHNOLOGY.${boundary}$CGI::CRLF");
    +
    +    my (@contents) = &$callback($self,++$COUNTER);
    +
    +    # now we enter a little loop
    +    while (1) {
    +        $handle->print("Content-type: ${type}$CGI::CRLF$CGI::CRLF") unless $type =~ /^dynamic|heterogeneous$/i;
    +        $handle->print(@contents);
    +        @contents = &$callback($self,++$COUNTER);
    +        if ((@contents) && defined($contents[0])) {
    +            $handle->print("${boundary}$CGI::CRLF");
    +            do_sleep($self->push_delay()) if $self->push_delay();
    +        } else {
    +            if ($last_page && ref($last_page) eq 'CODE') {
    +                $handle->print("${boundary}$CGI::CRLF");
    +                do_sleep($self->push_delay()) if $self->push_delay();
    +                $handle->print("Content-type: ${type}$CGI::CRLF$CGI::CRLF") unless $type =~ /^dynamic|heterogeneous$/i;
    +                $handle->print(&$last_page($self,$COUNTER));
    +            }
    +            $handle->print("${boundary}--$CGI::CRLF");
    +            last;
    +        }
    +    }
    +    $handle->print("WARNING: YOUR BROWSER DOESN'T SUPPORT THIS SERVER-PUSH TECHNOLOGY.${boundary}$CGI::CRLF");
    +}
    +
    +sub simple_counter {
    +    my ($self,$count) = @_;
    +    return $self->start_html("CGI::Push Default Counter"),
    +           $self->h1("CGI::Push Default Counter"),
    +           "This page has been updated ",$self->strong($count)," times.",
    +           $self->hr(),
    +           $self->a({'-href'=>'http://www.genome.wi.mit.edu/ftp/pub/software/WWW/cgi_docs.html'},'CGI.pm home page'),
    +           $self->end_html;
    +}
    +
    +sub do_sleep {
    +    my $delay = shift;
    +    if ( ($delay >= 1) && ($delay!~/\./) ){
    +        sleep($delay);
    +    } else {
    +        select(undef,undef,undef,$delay);
    +    }
    +}
    +
    +sub push_delay {
    +    my ($self,$delay) = CGI::self_or_default(@_);
    +    return defined($delay) ? $self->{'.delay'} =
    +        $delay : $self->{'.delay'};
    +}
    +
    +1;
    +
    +=head1 NAME
    +
    +CGI::Push - Simple Interface to Server Push
    +
    +=head1 SYNOPSIS
    +
    +    use CGI::Push qw(:standard);
    +
    +    do_push(-next_page=>\&next_page,
    +            -last_page=>\&last_page,
    +            -delay=>0.5);
    +
    +    sub next_page {
    +        my($q,$counter) = @_;
    +        return undef if $counter >= 10;
    +        return start_html('Test'),
    +               h1('Visible'),"\n",
    +               "This page has been called ", strong($counter)," times",
    +               end_html();
    +    }
    +
    +    sub last_page {
    +        my($q,$counter) = @_;
    +        return start_html('Done'),
    +               h1('Finished'),
    +               strong($counter - 1),' iterations.',
    +               end_html;
    +    }
    +
    +=head1 DESCRIPTION
    +
    +CGI::Push is a subclass of the CGI object created by CGI.pm.  It is
    +specialized for server push operations, which allow you to create
    +animated pages whose content changes at regular intervals.
    +
    +You provide CGI::Push with a pointer to a subroutine that will draw
    +one page.  Every time your subroutine is called, it generates a new
    +page.  The contents of the page will be transmitted to the browser
    +in such a way that it will replace what was there beforehand.  The
    +technique will work with HTML pages as well as with graphics files,
    +allowing you to create animated GIFs.
    +
    +Only Netscape Navigator supports server push.  Internet Explorer
    +browsers do not.
    +
    +=head1 USING CGI::Push
    +
    +CGI::Push adds one new method to the standard CGI suite, do_push().
    +When you call this method, you pass it a reference to a subroutine
    +that is responsible for drawing each new page, an interval delay, and
    +an optional subroutine for drawing the last page.  Other optional
    +parameters include most of those recognized by the CGI header()
    +method.
    +
    +You may call do_push() in the object oriented manner or not, as you
    +prefer:
    +
    +    use CGI::Push;
    +    $q = new CGI::Push;
    +    $q->do_push(-next_page=>\&draw_a_page);
    +
    +        -or-
    +
    +    use CGI::Push qw(:standard);
    +    do_push(-next_page=>\&draw_a_page);
    +
    +Parameters are as follows:
    +
    +=over 4
    +
    +=item -next_page
    +
    +    do_push(-next_page=>\&my_draw_routine);
    +
    +This required parameter points to a reference to a subroutine responsible for
    +drawing each new page.  The subroutine should expect two parameters
    +consisting of the CGI object and a counter indicating the number
    +of times the subroutine has been called.  It should return the
    +contents of the page as an B of one or more items to print.
    +It can return a false value (or an empty array) in order to abort the
    +redrawing loop and print out the final page (if any)
    +
    +    sub my_draw_routine {
    +        my($q,$counter) = @_;
    +        return undef if $counter > 100;
    +        return start_html('testing'),
    +               h1('testing'),
    +               "This page called $counter times";
    +    }
    +
    +You are of course free to refer to create and use global variables
    +within your draw routine in order to achieve special effects.
    +
    +=item -last_page
    +
    +This optional parameter points to a reference to the subroutine
    +responsible for drawing the last page of the series.  It is called
    +after the -next_page routine returns a false value.  The subroutine
    +itself should have exactly the same calling conventions as the
    +-next_page routine.
    +
    +=item -type
    +
    +This optional parameter indicates the content type of each page.  It
    +defaults to "text/html".  Normally the module assumes that each page
    +is of a homogenous MIME type.  However if you provide either of the
    +magic values "heterogeneous" or "dynamic" (the latter provided for the
    +convenience of those who hate long parameter names), you can specify
    +the MIME type -- and other header fields -- on a per-page basis.  See
    +"heterogeneous pages" for more details.
    +
    +=item -delay
    +
    +This indicates the delay, in seconds, between frames.  Smaller delays
    +refresh the page faster.  Fractional values are allowed.
    +
    +B
    +
    +=item -cookie, -target, -expires, -nph
    +
    +These have the same meaning as the like-named parameters in
    +CGI::header().
    +
    +If not specified, -nph will default to 1 (as needed for many servers, see below).
    +
    +=back
    +
    +=head2 Heterogeneous Pages
    +
    +Ordinarily all pages displayed by CGI::Push share a common MIME type.
    +However by providing a value of "heterogeneous" or "dynamic" in the
    +do_push() -type parameter, you can specify the MIME type of each page
    +on a case-by-case basis.
    +
    +If you use this option, you will be responsible for producing the
    +HTTP header for each page.  Simply modify your draw routine to
    +look like this:
    +
    +    sub my_draw_routine {
    +        my($q,$counter) = @_;
    +        return header('text/html'),   # note we're producing the header here
    +               start_html('testing'),
    +               h1('testing'),
    +               "This page called $counter times";
    +    }
    +
    +You can add any header fields that you like, but some (cookies and
    +status fields included) may not be interpreted by the browser.  One
    +interesting effect is to display a series of pages, then, after the
    +last page, to redirect the browser to a new URL.  Because redirect()
    +does b work, the easiest way is with a -refresh header field,
    +as shown below:
    +
    +    sub my_draw_routine {
    +        my($q,$counter) = @_;
    +        return undef if $counter > 10;
    +        return header('text/html'),   # note we're producing the header here
    +               start_html('testing'),
    +               h1('testing'),
    +               "This page called $counter times";
    +    }
    +
    +    sub my_last_page {
    +        return header(-refresh=>'5; URL=http://somewhere.else/finished.html',
    +                      -type=>'text/html'),
    +               start_html('Moved'),
    +               h1('This is the last page'),
    +               'Goodbye!'
    +               hr,
    +               end_html;
    +    }
    +
    +=head2 Changing the Page Delay on the Fly
    +
    +If you would like to control the delay between pages on a page-by-page
    +basis, call push_delay() from within your draw routine.  push_delay()
    +takes a single numeric argument representing the number of seconds you
    +wish to delay after the current page is displayed and before
    +displaying the next one.  The delay may be fractional.  Without
    +parameters, push_delay() just returns the current delay.
    +
    +=head1 INSTALLING CGI::Push SCRIPTS
    +
    +Server push scripts must be installed as no-parsed-header (NPH)
    +scripts in order to work correctly on many servers.  On Unix systems,
    +this is most often accomplished by prefixing the script's name with "nph-".
    +Recognition of NPH scripts happens automatically with WebSTAR and
    +Microsoft IIS.  Users of other servers should see their documentation
    +for help.
    +
    +Apache web server from version 1.3b2 on does not need server
    +push scripts installed as NPH scripts: the -nph parameter to do_push()
    +may be set to a false value to disable the extra headers needed by an
    +NPH script.
    +
    +=head1 AUTHOR INFORMATION
    +
    +Copyright 1995-1998, Lincoln D. Stein.  All rights reserved.
    +
    +This library is free software; you can redistribute it and/or modify
    +it under the same terms as Perl itself.
    +
    +Address bug reports and comments to: lstein@cshl.org
    +
    +=head1 BUGS
    +
    +This section intentionally left blank.
    +
    +=head1 SEE ALSO
    +
    +L, L
    +
    +=cut
    +
    diff --git a/lib/CGI/Switch.pm b/lib/CGI/Switch.pm
    new file mode 100644
    index 0000000..b8cc9ef
    --- /dev/null
    +++ b/lib/CGI/Switch.pm
    @@ -0,0 +1,27 @@
    +use CGI;
    +
    +$VERSION = '1.00';
    +
    +1;
    +
    +__END__
    +
    +=head1 NAME
    +
    +CGI::Switch - Backward compatibility module for defunct CGI::Switch
    +
    +=head1 SYNOPSIS
    +
    +Do not use this module.  It is deprecated.
    +
    +=head1 ABSTRACT
    +
    +=head1 DESCRIPTION
    +
    +=head1 AUTHOR INFORMATION
    +
    +=head1 BUGS
    +
    +=head1 SEE ALSO
    +
    +=cut
    diff --git a/lib/CGI/Util.pm b/lib/CGI/Util.pm
    new file mode 100644
    index 0000000..6af42de
    --- /dev/null
    +++ b/lib/CGI/Util.pm
    @@ -0,0 +1,317 @@
    +package CGI::Util;
    +
    +use strict;
    +use vars qw($VERSION @EXPORT_OK @ISA $EBCDIC @A2E @E2A);
    +require Exporter;
    +@ISA = qw(Exporter);
    +@EXPORT_OK = qw(rearrange make_attributes unescape escape 
    +		expires ebcdic2ascii ascii2ebcdic);
    +
    +$VERSION = '1.5';
    +
    +$EBCDIC = "\t" ne "\011";
    +# (ord('^') == 95) for codepage 1047 as on os390, vmesa
    +@A2E = (
    +   0,  1,  2,  3, 55, 45, 46, 47, 22,  5, 21, 11, 12, 13, 14, 15,
    +  16, 17, 18, 19, 60, 61, 50, 38, 24, 25, 63, 39, 28, 29, 30, 31,
    +  64, 90,127,123, 91,108, 80,125, 77, 93, 92, 78,107, 96, 75, 97,
    + 240,241,242,243,244,245,246,247,248,249,122, 94, 76,126,110,111,
    + 124,193,194,195,196,197,198,199,200,201,209,210,211,212,213,214,
    + 215,216,217,226,227,228,229,230,231,232,233,173,224,189, 95,109,
    + 121,129,130,131,132,133,134,135,136,137,145,146,147,148,149,150,
    + 151,152,153,162,163,164,165,166,167,168,169,192, 79,208,161,  7,
    +  32, 33, 34, 35, 36, 37,  6, 23, 40, 41, 42, 43, 44,  9, 10, 27,
    +  48, 49, 26, 51, 52, 53, 54,  8, 56, 57, 58, 59,  4, 20, 62,255,
    +  65,170, 74,177,159,178,106,181,187,180,154,138,176,202,175,188,
    + 144,143,234,250,190,160,182,179,157,218,155,139,183,184,185,171,
    + 100,101, 98,102, 99,103,158,104,116,113,114,115,120,117,118,119,
    + 172,105,237,238,235,239,236,191,128,253,254,251,252,186,174, 89,
    +  68, 69, 66, 70, 67, 71,156, 72, 84, 81, 82, 83, 88, 85, 86, 87,
    + 140, 73,205,206,203,207,204,225,112,221,222,219,220,141,142,223
    +	 );
    +@E2A = (
    +   0,  1,  2,  3,156,  9,134,127,151,141,142, 11, 12, 13, 14, 15,
    +  16, 17, 18, 19,157, 10,  8,135, 24, 25,146,143, 28, 29, 30, 31,
    + 128,129,130,131,132,133, 23, 27,136,137,138,139,140,  5,  6,  7,
    + 144,145, 22,147,148,149,150,  4,152,153,154,155, 20, 21,158, 26,
    +  32,160,226,228,224,225,227,229,231,241,162, 46, 60, 40, 43,124,
    +  38,233,234,235,232,237,238,239,236,223, 33, 36, 42, 41, 59, 94,
    +  45, 47,194,196,192,193,195,197,199,209,166, 44, 37, 95, 62, 63,
    + 248,201,202,203,200,205,206,207,204, 96, 58, 35, 64, 39, 61, 34,
    + 216, 97, 98, 99,100,101,102,103,104,105,171,187,240,253,254,177,
    + 176,106,107,108,109,110,111,112,113,114,170,186,230,184,198,164,
    + 181,126,115,116,117,118,119,120,121,122,161,191,208, 91,222,174,
    + 172,163,165,183,169,167,182,188,189,190,221,168,175, 93,180,215,
    + 123, 65, 66, 67, 68, 69, 70, 71, 72, 73,173,244,246,242,243,245,
    + 125, 74, 75, 76, 77, 78, 79, 80, 81, 82,185,251,252,249,250,255,
    +  92,247, 83, 84, 85, 86, 87, 88, 89, 90,178,212,214,210,211,213,
    +  48, 49, 50, 51, 52, 53, 54, 55, 56, 57,179,219,220,217,218,159
    +	 );
    +
    +if ($EBCDIC && ord('^') == 106) { # as in the BS2000 posix-bc coded character set
    +     $A2E[91] = 187;   $A2E[92] = 188;  $A2E[94] = 106;  $A2E[96] = 74;
    +     $A2E[123] = 251;  $A2E[125] = 253; $A2E[126] = 255; $A2E[159] = 95;
    +     $A2E[162] = 176;  $A2E[166] = 208; $A2E[168] = 121; $A2E[172] = 186;
    +     $A2E[175] = 161;  $A2E[217] = 224; $A2E[219] = 221; $A2E[221] = 173;
    +     $A2E[249] = 192;
    +
    +     $E2A[74] = 96;   $E2A[95] = 159;  $E2A[106] = 94;  $E2A[121] = 168;
    +     $E2A[161] = 175; $E2A[173] = 221; $E2A[176] = 162; $E2A[186] = 172;
    +     $E2A[187] = 91;  $E2A[188] = 92;  $E2A[192] = 249; $E2A[208] = 166;
    +     $E2A[221] = 219; $E2A[224] = 217; $E2A[251] = 123; $E2A[253] = 125;
    +     $E2A[255] = 126;
    +   }
    +elsif ($EBCDIC && ord('^') == 176) { # as in codepage 037 on os400
    +  $A2E[10] = 37;  $A2E[91] = 186;  $A2E[93] = 187; $A2E[94] = 176;
    +  $A2E[133] = 21; $A2E[168] = 189; $A2E[172] = 95; $A2E[221] = 173;
    +
    +  $E2A[21] = 133; $E2A[37] = 10;  $E2A[95] = 172; $E2A[173] = 221;
    +  $E2A[176] = 94; $E2A[186] = 91; $E2A[187] = 93; $E2A[189] = 168;
    +}
    +
    +# Smart rearrangement of parameters to allow named parameter
    +# calling.  We do the rearangement if:
    +# the first parameter begins with a -
    +sub rearrange {
    +    my($order,@param) = @_;
    +    return () unless @param;
    +
    +    if (ref($param[0]) eq 'HASH') {
    +	@param = %{$param[0]};
    +    } else {
    +	return @param 
    +	    unless (defined($param[0]) && substr($param[0],0,1) eq '-');
    +    }
    +
    +    # map parameters into positional indices
    +    my ($i,%pos);
    +    $i = 0;
    +    foreach (@$order) {
    +	foreach (ref($_) eq 'ARRAY' ? @$_ : $_) { $pos{lc($_)} = $i; }
    +	$i++;
    +    }
    +
    +    my (@result,%leftover);
    +    $#result = $#$order;  # preextend
    +    while (@param) {
    +	my $key = lc(shift(@param));
    +	$key =~ s/^\-//;
    +	if (exists $pos{$key}) {
    +	    $result[$pos{$key}] = shift(@param);
    +	} else {
    +	    $leftover{$key} = shift(@param);
    +	}
    +    }
    +
    +    push (@result,make_attributes(\%leftover,1)) if %leftover;
    +    @result;
    +}
    +
    +sub make_attributes {
    +    my $attr = shift;
    +    return () unless $attr && ref($attr) && ref($attr) eq 'HASH';
    +    my $escape = shift || 0;
    +    my(@att);
    +    foreach (keys %{$attr}) {
    +	my($key) = $_;
    +	$key=~s/^\-//;     # get rid of initial - if present
    +
    +	# old way: breaks EBCDIC!
    +	# $key=~tr/A-Z_/a-z-/; # parameters are lower case, use dashes
    +
    +	($key="\L$key") =~ tr/_/-/; # parameters are lower case, use dashes
    +
    +	my $value = $escape ? simple_escape($attr->{$_}) : $attr->{$_};
    +	push(@att,defined($attr->{$_}) ? qq/$key="$value"/ : qq/$key/);
    +    }
    +    return @att;
    +}
    +
    +sub simple_escape {
    +  return unless defined(my $toencode = shift);
    +  $toencode =~ s{&}{&}gso;
    +  $toencode =~ s{<}{<}gso;
    +  $toencode =~ s{>}{>}gso;
    +  $toencode =~ s{\"}{"}gso;
    +# Doesn't work.  Can't work.  forget it.
    +#  $toencode =~ s{\x8b}{‹}gso;
    +#  $toencode =~ s{\x9b}{›}gso;
    +  $toencode;
    +}
    +
    +sub utf8_chr {
    +        my $c = shift(@_);
    +
    +        if ($c < 0x80) {
    +                return sprintf("%c", $c);
    +        } elsif ($c < 0x800) {
    +                return sprintf("%c%c", 0xc0 | ($c >> 6), 0x80 | ($c & 0x3f));
    +        } elsif ($c < 0x10000) {
    +                return sprintf("%c%c%c",
    +                                           0xe0 |  ($c >> 12),
    +                                           0x80 | (($c >>  6) & 0x3f),
    +                                           0x80 | ( $c          & 0x3f));
    +        } elsif ($c < 0x200000) {
    +                return sprintf("%c%c%c%c",
    +                                           0xf0 |  ($c >> 18),
    +                                           0x80 | (($c >> 12) & 0x3f),
    +                                           0x80 | (($c >>  6) & 0x3f),
    +                                           0x80 | ( $c          & 0x3f));
    +        } elsif ($c < 0x4000000) {
    +                return sprintf("%c%c%c%c%c",
    +                                           0xf8 |  ($c >> 24),
    +                                           0x80 | (($c >> 18) & 0x3f),
    +                                           0x80 | (($c >> 12) & 0x3f),
    +                                           0x80 | (($c >>  6) & 0x3f),
    +                                           0x80 | ( $c          & 0x3f));
    +
    +        } elsif ($c < 0x80000000) {
    +                return sprintf("%c%c%c%c%c%c",
    +                                           0xfc |  ($c >> 30),
    +                                           0x80 | (($c >> 24) & 0x3f),
    +                                           0x80 | (($c >> 18) & 0x3f),
    +                                           0x80 | (($c >> 12) & 0x3f),
    +                                           0x80 | (($c >> 6)  & 0x3f),
    +                                           0x80 | ( $c          & 0x3f));
    +        } else {
    +                return utf8_chr(0xfffd);
    +        }
    +}
    +
    +# unescape URL-encoded data
    +sub unescape {
    +  shift() if @_ > 1 and (ref($_[0]) || (defined $_[1] && $_[0] eq $CGI::DefaultClass));
    +  my $todecode = shift;
    +  return undef unless defined($todecode);
    +  $todecode =~ tr/+/ /;       # pluses become spaces
    +    $EBCDIC = "\t" ne "\011";
    +    if ($EBCDIC) {
    +      $todecode =~ s/%([0-9a-fA-F]{2})/chr $A2E[hex($1)]/ge;
    +    } else {
    +      $todecode =~ s/%(?:([0-9a-fA-F]{2})|u([0-9a-fA-F]{4}))/
    +	defined($1)? chr hex($1) : utf8_chr(hex($2))/ge;
    +    }
    +  return $todecode;
    +}
    +
    +# URL-encode data
    +sub escape {
    +  shift() if @_ > 1 and ( ref($_[0]) || (defined $_[1] && $_[0] eq $CGI::DefaultClass));
    +  my $toencode = shift;
    +  return undef unless defined($toencode);
    +  # force bytes while preserving backward compatibility -- dankogai
    +  $toencode = pack("C*", unpack("C*", $toencode));
    +    if ($EBCDIC) {
    +      $toencode=~s/([^a-zA-Z0-9_.-])/uc sprintf("%%%02x",$E2A[ord($1)])/eg;
    +    } else {
    +      $toencode=~s/([^a-zA-Z0-9_.-])/uc sprintf("%%%02x",ord($1))/eg;
    +    }
    +  return $toencode;
    +}
    +
    +# This internal routine creates date strings suitable for use in
    +# cookies and HTTP headers.  (They differ, unfortunately.)
    +# Thanks to Mark Fisher for this.
    +sub expires {
    +    my($time,$format) = @_;
    +    $format ||= 'http';
    +
    +    my(@MON)=qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec/;
    +    my(@WDAY) = qw/Sun Mon Tue Wed Thu Fri Sat/;
    +
    +    # pass through preformatted dates for the sake of expire_calc()
    +    $time = expire_calc($time);
    +    return $time unless $time =~ /^\d+$/;
    +
    +    # make HTTP/cookie date string from GMT'ed time
    +    # (cookies use '-' as date separator, HTTP uses ' ')
    +    my($sc) = ' ';
    +    $sc = '-' if $format eq "cookie";
    +    my($sec,$min,$hour,$mday,$mon,$year,$wday) = gmtime($time);
    +    $year += 1900;
    +    return sprintf("%s, %02d$sc%s$sc%04d %02d:%02d:%02d GMT",
    +                   $WDAY[$wday],$mday,$MON[$mon],$year,$hour,$min,$sec);
    +}
    +
    +# This internal routine creates an expires time exactly some number of
    +# hours from the current time.  It incorporates modifications from 
    +# Mark Fisher.
    +sub expire_calc {
    +    my($time) = @_;
    +    my(%mult) = ('s'=>1,
    +                 'm'=>60,
    +                 'h'=>60*60,
    +                 'd'=>60*60*24,
    +                 'M'=>60*60*24*30,
    +                 'y'=>60*60*24*365);
    +    # format for time can be in any of the forms...
    +    # "now" -- expire immediately
    +    # "+180s" -- in 180 seconds
    +    # "+2m" -- in 2 minutes
    +    # "+12h" -- in 12 hours
    +    # "+1d"  -- in 1 day
    +    # "+3M"  -- in 3 months
    +    # "+2y"  -- in 2 years
    +    # "-3m"  -- 3 minutes ago(!)
    +    # If you don't supply one of these forms, we assume you are
    +    # specifying the date yourself
    +    my($offset);
    +    if (!$time || (lc($time) eq 'now')) {
    +        $offset = 0;
    +    } elsif ($time=~/^\d+/) {
    +        return $time;
    +    } elsif ($time=~/^([+-]?(?:\d+|\d*\.\d*))([mhdMy]?)/) {
    +        $offset = ($mult{$2} || 1)*$1;
    +    } else {
    +        return $time;
    +    }
    +    return (time+$offset);
    +}
    +
    +sub ebcdic2ascii {
    +  my $data = shift;
    +  $data =~ s/(.)/chr $E2A[ord($1)]/ge;
    +  $data;
    +}
    +
    +sub ascii2ebcdic {
    +  my $data = shift;
    +  $data =~ s/(.)/chr $A2E[ord($1)]/ge;
    +  $data;
    +}
    +
    +1;
    +
    +__END__
    +
    +=head1 NAME
    +
    +CGI::Util - Internal utilities used by CGI module
    +
    +=head1 SYNOPSIS
    +
    +none
    +
    +=head1 DESCRIPTION
    +
    +no public subroutines
    +
    +=head1 AUTHOR INFORMATION
    +
    +Copyright 1995-1998, Lincoln D. Stein.  All rights reserved.  
    +
    +This library is free software; you can redistribute it and/or modify
    +it under the same terms as Perl itself.
    +
    +Address bug reports and comments to: lstein@cshl.org.  When sending
    +bug reports, please provide the version of CGI.pm, the version of
    +Perl, the name and version of your Web server, and the name and
    +version of the operating system you are using.  If the problem is even
    +remotely browser dependent, please provide information about the
    +affected browers as well.
    +
    +=head1 SEE ALSO
    +
    +L
    +
    +=cut
    diff --git a/lib/Class/MakeMethods.pm b/lib/Class/MakeMethods.pm
    new file mode 100644
    index 0000000..2865a4c
    --- /dev/null
    +++ b/lib/Class/MakeMethods.pm
    @@ -0,0 +1,1520 @@
    +### Class::MakeMethods
    +  # Copyright 2002, 2003 Matthew Simon Cavalletto
    +  # See documentation, license, and other information after _END_.
    +
    +package Class::MakeMethods;
    +
    +require 5.00307; # for the UNIVERSAL::isa method.
    +use strict;
    +use Carp;
    +
    +use vars qw( $VERSION );
    +$VERSION = 1.010;
    +
    +use vars qw( %CONTEXT %DIAGNOSTICS );
    +
    +########################################################################
    +### MODULE IMPORT: import(), _import_version()
    +########################################################################
    +
    +sub import {
    +  my $class = shift;
    +
    +  if ( scalar @_ and $_[0] =~ m/^\d/ ) {
    +    $class->_import_version( shift );
    +  }
    +  
    +  if ( scalar @_ == 1 and $_[0] eq '-isasubclass' ) {
    +    shift;
    +    my $target_class = ( caller )[0];
    +    no strict;
    +    push @{"$target_class\::ISA"}, $class;
    +  }
    +  
    +  $class->make( @_ ) if ( scalar @_ );
    +}
    +
    +sub _import_version {
    +  my $class = shift;
    +  my $wanted = shift;
    +  
    +  no strict;
    +  my $version = ${ $class.'::VERSION '};
    +  
    +  # If passed a version number, ensure that we measure up.
    +  # Based on similar functionality in Exporter.pm
    +  if ( ! $version or $version < $wanted ) {
    +    my $file = "$class.pm";
    +    $file =~ s!::!/!g;
    +    $file = $INC{$file} ? " ($INC{$file})" : '';
    +    _diagnostic('mm_version_fail', $class, $wanted, $version || '(undef)', $file);
    +  }
    +}
    +
    +########################################################################
    +### METHOD GENERATION: make()
    +########################################################################
    +
    +sub make {
    +  local $CONTEXT{MakerClass} = shift;
    +  
    +  # Find the first class in the caller() stack that's not a subclass of us 
    +  local $CONTEXT{TargetClass};
    +  my $i = 0;
    +  do {
    +    $CONTEXT{TargetClass} = ( caller($i ++) )[0];
    +  } while UNIVERSAL::isa($CONTEXT{TargetClass}, __PACKAGE__ );
    +  
    +  my @methods;
    +  
    +  # For compatibility with 5.004, which fails to splice use's constant @_
    +  my @declarations = @_; 
    +  
    +  if (@_ % 2) { _diagnostic('make_odd_args', $CONTEXT{MakerClass}); }
    +  while ( scalar @declarations ) {
    +    # The list passed to import should alternate between the names of the
    +    # meta-method to call to generate the methods, and arguments to it.
    +    my ($name, $args) = splice(@declarations, 0, 2);
    +    unless ( defined $name ) {
    +      croak "Undefined name";
    +    }
    +    
    +    # Leading dash on the first argument of a pair means it's a
    +    # global/general option to be stored in CONTEXT.
    +    if ( $name =~ s/^\-// ) {
    +      
    +      # To prevent difficult-to-predict retroactive behaviour, start by
    +      # flushing any pending methods before letting settings take effect
    +      if ( scalar @methods ) { 
    +	_install_methods( $CONTEXT{MakerClass}, @methods );
    +	@methods = ();
    +      }
    +      
    +      if ( $name eq 'MakerClass' ) {
    +	# Switch base package for remainder of args
    +	$CONTEXT{MakerClass} = _find_subclass($CONTEXT{MakerClass}, $args);
    +      } else {
    +	$CONTEXT{$name} = $args;
    +      }
    +      
    +      next;
    +    }
    +    
    +    # Argument normalization
    +    my @args = (
    +      ! ref($args) ? split(' ', $args) : # If a string, it is split on spaces.
    +      ref($args) eq 'ARRAY' ? (@$args) : # If an arrayref, use its contents.
    +      ( $args )     			 # If a hashref, it is used directly
    +    );
    +
    +    # If the type argument contains an array of method types, do the first
    +    # now, and put the others back in the queue to be processed subsequently.
    +    if ( ref($name) eq 'ARRAY' ) {	
    +      ($name, my @name) = @$name;	
    +      unshift @declarations, map { $_=>[@args] } @name;
    +    }
    +    
    +    # If the type argument contains space characters, use the first word
    +    # as the type, and prepend the remaining items to the argument list.
    +    if ( $name =~ /\s/ ) {
    +      my @items = split ' ', $name;
    +      $name = shift( @items );
    +      unshift @args, @items;
    +    }
    +    
    +    # If name contains a colon or double colon, treat the preceeding part 
    +    # as the subclass name but only for this one set of methods.
    +    local $CONTEXT{MakerClass} = _find_subclass($CONTEXT{MakerClass}, $1)
    +		if ($name =~ s/^(.*?)\:{1,2}(\w+)$/$2/);
    +    
    +    # Meta-method invocation via named_method or direct method call
    +    my @results = (
    +	$CONTEXT{MakerClass}->can('named_method') ? 
    +			$CONTEXT{MakerClass}->named_method( $name, @args ) : 
    +	$CONTEXT{MakerClass}->can($name) ?
    +			$CONTEXT{MakerClass}->$name( @args ) : 
    +	    croak "Can't generate $CONTEXT{MakerClass}->$name() methods"
    +    );
    +    # warn "$CONTEXT{MakerClass} $name - ", join(', ', @results) . "\n";
    +    
    +    ### A method-generator may be implemented in any of the following ways:
    +    
    +    # SELF-CONTAINED: It may return nothing, if there are no methods
    +    # to install, or if it has installed the methods itself.
    +    # (We also accept a single false value, for backward compatibility 
    +    # with generators that are written as foreach loops, which return ''!)
    +    if ( ! scalar @results or scalar @results == 1 and ! $results[0] ) { } 
    +    
    +    # ALIAS: It may return a string containing a meta-method type to run 
    +    # instead. Put the arguments back in the queue and go through again.
    +    elsif ( scalar @results == 1 and ! ref $results[0]) {
    +      unshift @declarations, $results[0], \@args;
    +    } 
    +    
    +    # REWRITER: It may return one or more array reference containing a meta-
    +    # method type and arguments which should be created to complete this 
    +    # request. Put the arguments back in the queue and go through again.
    +    elsif ( ! grep { ref $_ ne 'ARRAY' } @results ) {
    +      unshift @declarations, ( map { shift(@$_), $_ } @results );
    +    } 
    +    
    +    # CODE REFS: It may provide a list of name, code pairs to install
    +    elsif ( ! scalar @results % 2 and ! ref $results[0] ) {
    +      push @methods, @results;
    +    } 
    +    
    +    # GENERATOR OBJECT: It may return an object reference which will construct
    +    # the relevant methods.
    +    elsif ( UNIVERSAL::can( $results[0], 'make_methods' ) ) {
    +      push @methods, ( shift @results )->make_methods(@results, @args);
    +    } 
    +    
    +    else {
    +      _diagnostic('make_bad_meta', $name, join(', ', map "'$_'", @results));
    +    }
    +  }
    +  
    +  _install_methods( $CONTEXT{MakerClass}, @methods );
    +  
    +  return;
    +}
    +
    +########################################################################
    +### DECLARATION PARSING: _get_declarations()
    +########################################################################
    +
    +sub _get_declarations {
    +  my $class = shift;
    +  
    +  my @results;
    +  my %defaults;
    +  
    +  while (scalar @_) {
    +    my $m_name = shift @_;
    +    if ( ! defined $m_name or ! length $m_name ) {
    +      _diagnostic('make_empty') 
    +    }
    +
    +    # Various forms of default parameters
    +    elsif ( substr($m_name, 0, 1) eq '-' ) {
    +      if ( substr($m_name, 1, 1) ne '-' ) {
    +	# Parse default values in the format "-param => value"
    +	$defaults{ substr($m_name, 1) } = shift @_;
    +      } elsif ( length($m_name) == 2 ) {
    +	# Parse hash of default values in the format "-- => { ... }"
    +	ref($_[0]) eq 'HASH' or _diagnostic('make_unsupported', $m_name.$_[0]);
    +	%defaults = ( %defaults, %{ shift @_ } );
    +      } else {
    +	# Parse "special" arguments in the format "--foobar"
    +	$defaults{ '--' } .= $m_name;
    +      }
    +    }
    +    
    +    # Parse string and string-then-hash declarations
    +    elsif ( ! ref $m_name ) {  
    +      if ( scalar @_ and ref $_[0] eq 'HASH' and ! exists $_[0]->{'name'} ) {
    +	push @results, { %defaults, 'name' => $m_name, %{ shift @_ } };
    +      } else {
    +	push @results, { %defaults, 'name' => $m_name };
    +      }
    +    } 
    +    
    +    # Parse hash-only declarations
    +    elsif ( ref $m_name eq 'HASH' ) {
    +      if ( length $m_name->{'name'} ) {
    +	push @results, { %defaults, %$m_name };
    +      } else {
    +	_diagnostic('make_noname');
    +      }
    +    }
    +    
    +    # Normalize: If we've got an array of names, replace it with those names 
    +    elsif ( ref $m_name eq 'ARRAY' ) {
    +      my @items = @{ $m_name };
    +      # If array is followed by an params hash, each one gets the same params
    +      if ( scalar @_ and ref $_[0] eq 'HASH' and ! exists $_[0]->{'name'} ) {
    +	my $params = shift;
    +	@items = map { $_, $params } @items
    +      }
    +      unshift @_, @items;
    +      next;
    +    }
    +    
    +    else {
    +      _diagnostic('make_unsupported', $m_name);
    +    }
    +    
    +  }
    +  
    +  return @results;
    +}
    +
    +########################################################################
    +### FUNCTION INSTALLATION: _install_methods()
    +########################################################################
    +
    +sub _install_methods {
    +  my ($class, %methods) = @_;
    +  
    +  no strict 'refs';
    +  
    +  # print STDERR "CLASS: $class\n";
    +  my $package = $CONTEXT{TargetClass};
    +  
    +  my ($name, $code);
    +  while (($name, $code) = each %methods) {
    +    
    +    # Skip this if the target package already has a function by the given name.
    +    next if ( ! $CONTEXT{ForceInstall} and 
    +				defined *{$package. '::'. $name}{CODE} );
    +   
    +    if ( ! ref $code ) {
    +      local $SIG{__DIE__};
    +      local $^W;
    +      my $coderef = eval $code;
    +      if ( $@ ) {
    +	_diagnostic('inst_eval_syntax', $name, $@, $code);
    +      } elsif ( ref $coderef ne 'CODE' ) {
    +	_diagnostic('inst_eval_result', $name, $coderef, $code);
    +      }
    +      $code = $coderef;
    +    } elsif ( ref $code ne 'CODE' ) {
    +      _diagnostic('inst_result', $name, $code);
    +    }
    +    
    +    # Add the code refence to the target package
    +    # _diagnostic('debug_install', $package, $name, $code);
    +    local $^W = 0 if ( $CONTEXT{ForceInstall} );
    +    *{$package . '::' . $name} = $code;
    +
    +  }
    +  return;
    +}
    +
    +########################################################################
    +### SUBCLASS LOADING: _find_subclass()
    +########################################################################
    +
    +# $pckg = _find_subclass( $class, $optional_package_name );
    +sub _find_subclass {
    +  my $class = shift; 
    +  my $package = shift or die "No package for _find_subclass";
    +  
    +  $package =  $package =~ s/^::// ? $package :
    +		"Class::MakeMethods::$package";
    +  
    +  (my $file = $package . '.pm' ) =~ s|::|/|go;
    +  return $package if ( $::INC{ $file } );
    +  
    +  no strict 'refs';
    +  return $package if ( @{$package . '::ISA'} );
    +  
    +  local $SIG{__DIE__} = '';
    +  eval { require $file };
    +  $::INC{ $package } = $::INC{ $file };
    +  if ( $@ ) { _diagnostic('mm_package_fail', $package, $@) }
    +  
    +  return $package
    +}
    +
    +########################################################################
    +### CONTEXT: _context(), %CONTEXT
    +########################################################################
    +
    +sub _context {
    +  my $class = shift; 
    +  return %CONTEXT if ( ! scalar @_ );
    +  my $key = shift;
    +  return $CONTEXT{$key} if ( ! scalar @_ );
    +  $CONTEXT{$key} = shift;
    +}
    +
    +BEGIN {
    +  $CONTEXT{Debug} ||= 0;
    +}
    +
    +########################################################################
    +### DIAGNOSTICS: _diagnostic(), %DIAGNOSTICS
    +########################################################################
    +
    +sub _diagnostic {
    +  my $case = shift;
    +  my $message = $DIAGNOSTICS{$case};
    +  $message =~ s/\A\s*\((\w)\)\s*//;
    +  my $severity = $1 || 'I';
    +  if ( $severity eq 'Q' ) {
    +    carp( sprintf( $message, @_ ) ) if ( $CONTEXT{Debug} );
    +  } elsif ( $severity eq 'W' ) {
    +    carp( sprintf( $message, @_ ) ) if ( $^W );
    +  } elsif ( $severity eq 'F' ) {
    +    croak( sprintf( $message, @_ ) )
    +  } else {
    +    confess( sprintf( $message, @_ ) )
    +  }
    +}
    +
    +
    +BEGIN { %DIAGNOSTICS = (
    +
    +  ### BASE CLASS DIAGNOSTICS
    +  
    +  # _diagnostic('debug_install', $package, $name, $code)
    +  debug_install => q|(W) Installing function %s::%s (%s)|,
    +  
    +  # _diagnostic('make_odd_args', $CONTEXT{MakerClass})
    +  make_odd_args => q|(F) Odd number of arguments passed to %s method generator|,
    +  
    +  # _diagnostic('make_bad_meta', $name, join(', ', map "'$_'", @results)
    +  make_bad_meta => q|(I) Unexpected return value from method constructor %s: %s|,
    +  
    +  # _diagnostic('inst_eval_syntax', $name, $@, $code)
    +  inst_eval_syntax => q|(I) Unable to compile generated method %s(): %s| . 
    +      qq|\n  (There's probably a syntax error in this generated code.)\n%s\n|,
    +  
    +  # _diagnostic('inst_eval_result', $name, $coderef, $code)
    +  inst_eval_result => q|(I) Unexpected return value from compilation of %s(): '%s'| . 
    +      qq|\n  (This generated code should have returned a code ref.)\n%s\n|,
    +  
    +  # _diagnostic('inst_result', $name, $code)
    +  inst_result => q|(I) Unable to install code for %s() method: '%s'|,
    +  
    +  # _diagnostic('mm_package_fail', $package, $@)
    +  mm_package_fail => q|(F) Unable to dynamically load %s: %s|,
    +  
    +  # _diagnostic('mm_version_fail', $class, $wanted, $version || '(undef)
    +  mm_version_fail => q|(F) %s %s required--this is only version %s%s|,
    +  
    +  ### STANDARD SUBCLASS DIAGNOSTICS
    +  
    +  # _diagnostic('make_empty')
    +  make_empty => q|(F) Can't parse meta-method declaration: argument is empty or undefined|,
    +  
    +  # _diagnostic('make_noname')
    +  make_noname => q|(F) Can't parse meta-method declaration: missing name attribute.| . 
    +      qq|\n  (Perhaps a trailing attributes hash has become separated from its name?)|,
    +  
    +  # _diagnostic('make_unsupported', $m_name)
    +  make_unsupported => q|(F) Can't parse meta-method declaration: unsupported declaration type '%s'|,
    +  
    +  ### TEMPLATE SUBCLASS DIAGNOSTICS 
    +    # ToDo: Should be moved to the Class::MakeMethods::Template package
    +  
    +  debug_declaration => q|(Q) Meta-method declaration parsed: %s|,
    +  debug_make_behave => q|(Q) Building meta-method behavior %s: %s(%s)|,
    +  mmdef_not_interpretable => qq|(I) Not an interpretable meta-method: '%s'| .
    +      qq|\n  (Perhaps a meta-method attempted to import from a non-templated meta-method?)|,
    +  make_bad_modifier => q|(F) Can't parse meta-method declaration: unknown option for %s: %s|,
    +  make_bad_behavior => q|(F) Can't make method %s(): template specifies unknown behavior '%s'|,
    +  behavior_mod_unknown => q|(F) Unknown modification to %s behavior: -%s|,
    +  debug_template_builder => qq|(Q) Template interpretation for %s:\n%s|.
    +      qq|\n---------\n%s\n---------\n|,
    +  debug_template => q|(Q) Parsed template '%s': %s|,
    +  debug_eval_builder => q|(Q) Compiling behavior builder '%s':| . qq|\n%s|,
    +  make_behavior_mod => q|(F) Can't apply modifiers (%s) to code behavior %s|,
    +  behavior_eval => q|(I) Class::MakeMethods behavior compilation error: %s| . 
    +      qq|\n  (There's probably a syntax error in the below code.)\n%s|,
    +  tmpl_unkown => q|(F) Can't interpret meta-method template: unknown template name '%s'|,
    +  tmpl_empty => q|(F) Can't interpret meta-method template: argument is empty or undefined|,
    +  tmpl_unsupported => q|(F) Can't interpret meta-method template: unsupported template type '%s'|,
    +) }
    +
    +1;
    +
    +__END__
    +
    +
    +=head1 NAME
    +
    +Class::MakeMethods - Generate common types of methods
    +
    +
    +=head1 SYNOPSIS
    +
    +  # Generates methods for your object when you "use" it.
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Hash (
    +    'new'       => 'new',
    +    'scalar'    => 'foo',
    +    'scalar'    => 'bar',
    +  );
    +  
    +  # The generated methods can be called just like normal ones
    +  my $obj = MyObject->new( foo => "Foozle", bar => "Bozzle" );
    +  print $obj->foo();
    +  $obj->bar("Barbados");
    +
    +
    +=head1 DESCRIPTION
    +
    +The Class::MakeMethods framework allows Perl class developers to
    +quickly define common types of methods. When a module Cs
    +Class::MakeMethods or one of its subclasses, it can select from a
    +variety of supported method types, and specify a name for each
    +method desired. The methods are dynamically generated and installed
    +in the calling package.
    +
    +Construction of the individual methods is handled by subclasses.
    +This delegation approach allows for a wide variety of method-generation
    +techniques to be supported, each by a different subclass. Subclasses
    +can also be added to provide support for new types of methods.
    +
    +Over a dozen subclasses are available, including implementations of
    +a variety of different method-generation techniques. Each subclass
    +generates several types of methods, with some supporting their own
    +open-eneded extension syntax, for hundreds of possible combinations
    +of method types.
    +
    +
    +=head1 GETTING STARTED
    +
    +=head2 Motivation
    +
    +  "Make easy things easier."
    +
    +This module addresses a problem encountered in object-oriented
    +development wherein numerous methods are defined which differ only
    +slightly from each other.
    +
    +A common example is accessor methods for hash-based object attributes,
    +which allow you to get and set the value $self-E{'foo'} by
    +calling a method $self-Efoo().
    +
    +These methods are generally quite simple, requiring only a couple
    +of lines of Perl, but in sufficient bulk, they can cut down on the
    +maintainability of large classes.
    +
    +Class::MakeMethods allows you to simply declare those methods to
    +be of a predefined type, and it generates and installs the necessary
    +methods in your package at compile-time.
    +
    +=head2 A Contrived Example
    +
    +Object-oriented Perl code is widespread -- you've probably seen code like the below a million times:
    +
    +  my $obj = MyStruct->new( foo=>"Foozle", bar=>"Bozzle" );
    +  if ( $obj->foo() =~ /foo/i ) {
    +    $obj->bar("Barbados!");
    +  }
    +  print $obj->summary();
    +
    +(If this doesn't look familiar, take a moment to read L
    +and you'll soon learn more than's good for you.)
    +
    +Typically, this involves creating numerous subroutines that follow
    +a handful of common patterns, like constructor methods and accessor
    +methods. The classic example is accessor methods for hash-based
    +object attributes, which allow you to get and set the value
    +I-E{I} by calling a method I-EI().
    +These methods are generally quite simple, requiring only a couple
    +of lines of Perl, but in sufficient bulk, they can cut down on the
    +maintainability of large classes.
    +
    +Here's a possible implementation for the class whose interface is
    +shown above:
    +
    +  package MyStruct;
    +  
    +  sub new {
    +    my $callee = shift;
    +    my $self = bless { @_ }, (ref $callee || $callee);
    +    return $self;
    +  }
    +
    +  sub foo {
    +    my $self = shift;
    +    if ( scalar @_ ) {
    +      $self->{'foo'} = shift();
    +    } else {
    +      $self->{'foo'}
    +    }
    +  }
    +
    +  sub bar {
    +    my $self = shift;
    +    if ( scalar @_ ) {
    +      $self->{'bar'} = shift();
    +    } else {
    +      $self->{'bar'}
    +    }
    +  }
    +
    +  sub summary {
    +    my $self = shift;
    +    join(', ', map { "\u$_: " . $self->$_() } qw( foo bar ) )
    +  }
    +
    +Note in particular that the foo and bar methods are almost identical,
    +and that the new method could be used for almost any class; this
    +is precisely the type of redundancy Class::MakeMethods addresses.
    +
    +Class::MakeMethods allows you to simply declare those methods to
    +be of a predefined type, and it generates and installs the necessary
    +methods in your package at compile-time.
    +
    +Here's the equivalent declaration for that same basic class:
    +
    +  package MyStruct;
    +  use Class::MakeMethods::Standard::Hash (
    +    'new'       => 'new',
    +    'scalar'    => 'foo',
    +    'scalar'    => 'bar',
    +  );
    +  
    +  sub summary {
    +    my $self = shift;
    +    join(', ', map { "\u$_: " . $self->$_() } qw( foo bar ) )
    +  }
    +
    +This is the basic purpose of Class::MakeMethods: The "boring" pieces
    +of code have been replaced by succinct declarations, placing the
    +focus on the "unique" or "custom" pieces.
    +
    +=head2 Finding the Method Types You Need
    +
    +Once you've grasped the basic idea -- simplifying repetitive code
    +by generating and installing methods on demand -- the remaining
    +complexity basically boils down to figuring out which arguments to
    +pass to generate the specific methods you want.
    +
    +Unfortunately, this is not a trivial task, as there are dozens of
    +different types of methods that can be generated, each with a
    +variety of options, and several alternative ways to write each
    +method declaration. You may prefer to start by just finding a few
    +examples that you can modify to accomplish your immediate needs,
    +and defer investigating all of the extras until you're ready to
    +take a closer look.
    +
    +=head2 Other Documentation
    +
    +The remainder of this document focuses on points of usage that are
    +common across all subclasses, and describes how to create your own
    +subclasses.
    +
    +If this is your first exposure to Class::MakeMethods, you may want
    +to skim over the rest of this document, then take a look at the
    +examples and one or two of the method-generating subclasses to get
    +a more concrete sense of typical usage, before returning to the
    +details presented below.
    +
    +=over 4
    +
    +=item *
    +
    +A collection of sample uses is available in
    +L.
    +
    +=item *
    +
    +Some of the most common object and class methods are available from 
    +L,
    +L and
    +L.
    +
    +=item *
    +
    +If you need a bit more flexibility, see L
    +for method generators which offer more customization options,
    +including pre- and post-method callback hooks.
    +
    +=item *
    +
    +For the largest collection of methods and options, see
    +L, which uses a system of dynamic
    +code generation to allow endless variation.
    +
    +=item *
    +
    +A listing of available method types from each of the different
    +subclasses is provided in L.
    +
    +=back
    +
    +=head1 CLASS ARCHITECTURE
    +
    +Because there are so many common types of methods one might wish
    +to generate, the Class::MakeMethods framework provides an extensible
    +system based on subclasses.
    +
    +When your code requests a method, the MakeMethods base class performs
    +some standard argument parsing, delegates the construction of the
    +actual method to the appropriate subclass, and then installs whatever
    +method the subclass returns.
    +
    +=head2 The MakeMethods Base Class
    +
    +The Class::MakeMethods package defines a superclass for method-generating
    +modules, and provides a calling convention, on-the-fly subclass
    +loading, and subroutine installation that will be shared by all
    +subclasses.
    +
    +The superclass also lets you generate several different types of
    +methods in a single call, and will automatically load named subclasses
    +the first time they're used.
    +
    +=head2 The Method Generator Subclasses
    +
    +The type of method that gets created is controlled by the specific
    +subclass and generator function you request. For example,
    +C has a generator function
    +C, which is responsible for generating simple scalar-accessor
    +methods for blessed-hash objects.
    +
    +Each generator function specified is passed the arguments specifying
    +the method the caller wants, and produces a closure or eval-able
    +sequence of Perl statements representing the ready-to-install
    +function.
    +
    +=head2 Included Subclasses
    +
    +Because each subclass defines its own set of method types and
    +customization options, a key step is to find your way to the
    +appropriate subclasses.
    +
    +=over 4 
    +
    +=item Standard (See L.)
    +
    +Generally you will want to begin with the Standard::Hash subclass,
    +to create constructor and accessor methods for working with
    +blessed-hash objects (or you might choose the Standard::Array
    +subclass instead).  The Standard::Global subclass provides methods
    +for class data shared by all objects in a class.
    +
    +Each Standard method declaration can optionally include a hash of
    +associated parameters, which allows you to tweak some of the
    +characteristics of the methods. Subroutines are bound as closures
    +to a hash of each method's name and parameters. Standard::Hash and
    +Standard::Array provide object constructor and accessors. The
    +Standard::Global provides for static data shared by all instances
    +and subclasses, while the data for Standard::Inheritable methods
    +trace the inheritance tree to find values, and can be overriden
    +for any subclass or instance.
    +
    +=item Composite (See L.)
    +
    +For additional customization options, check out the Composite
    +subclasses, which allow you to select from a more varied set of
    +implementations and which allow you to adjust any specific method
    +by adding your own code-refs to be run before or after it.
    +
    +Subroutines are bound as closures to a hash of each method's name
    +and optional additional data, and to one or more subroutine references
    +which make up the composite behavior of the method. Composite::Hash
    +and Composite::Array provide object constructor and accessors. The
    +Composite::Global provides for static data shared by all instances
    +and subclasses, while the data for Composite::Inheritable methods
    +can be overriden for any subclass or instance.
    +
    +=item Template (See L.)
    +
    +The Template subclasses provide an open-ended structure for objects
    +that assemble Perl code on the fly into cachable closure-generating
    +subroutines; if the method you need isn't included, you can extend
    +existing methods by re-defining just the snippet of code that's
    +different.
    +
    +Class::MakeMethods::Template extends MakeMethods with a text
    +templating system that can assemble Perl code fragments into a
    +desired subroutine. The code for generated methods is eval'd once
    +for each type, and then repeatedly bound as closures to method-specific
    +data for better performance.
    +
    +Templates for dozens of types of constructor, accessor, and mutator
    +methods are included, ranging from from the mundane (constructors
    +and value accessors for hash and array slots) to the esoteric
    +(inheritable class data and "inside-out" accessors with external
    +indexes).
    +
    +=item Basic (See L.)
    +
    +The Basic subclasses provide stripped down method generators with
    +no configurable options, for minimal functionality (and minimum
    +overhead).
    +
    +Subroutines are bound as closures to the name of each method.
    +Basic::Hash and Basic::Array provide simple object constructors
    +and accessors. Basic::Global provides basic global-data accessors.
    +
    +=item Emulators (See L.)
    +
    +In several cases, Class::MakeMethods provides functionality closely
    +equivalent to that of an existing module, and it is simple to map
    +the existing module's interface to that of Class::MakeMethods.
    +
    +Emulators are included for Class::MethodMaker, Class::Accessor::Fast,
    +Class::Data::Inheritable, Class::Singleton, and Class::Struct, each
    +of which passes the original module's test suite, usually requiring
    +only that the name of the module be changed.
    +
    +=item Extending
    +
    +Class::MakeMethods can be extended by creating subclasses that
    +define additional method-generation functions. Callers can then
    +specify the name of your subclass and generator function in their
    +C statements and your function will be
    +invoked to produce the required closures. See L for
    +more information.
    +
    +=back
    +
    +=head2 Naming Convention for Generated Method Types
    +
    +Method generation functions in this document are often referred to using the 'I:I' or 'I::I:I' naming conventions. As you will see, these are simply the names of Perl packages and the names of functions that are contained in those packages.
    +
    +The included subclasses are grouped into several major groups, so the names used by the included subclasses and method types reflect three axes of variation, "I::I:I":
    +
    +=over 4
    +
    +=item Maker Group
    +
    +Each group shares a similar style of technical implementation and level of complexity. For example, the C packages are all simple, while the C packages all support pre- and post-conditions.
    +
    +(For a listing of the four main groups of included subclasses, see L<"/Included Subclasses">.)
    +
    +=item Maker Subclass
    +
    +Each subclass generates methods for a similar level of scoping or underlying object type. For example, the C<*::Hash> packages all make methods for objects based on blessed hashes, while the C<*::Global> packages make methods that access class-wide data that will be shared between all objects in a class.
    +
    +=item Method Type
    +
    +Each method type produces a similar type of constructor or accessor. For examples, the C<*:new> methods are all constructors, while the C<::scalar> methods are all accessors that allow you to get and set a single scalar value.
    +
    +=back
    +
    +Bearing that in mind, you should be able to guess the intent of many of the method types based on their names alone; when you see "Standard::Hash:scalar" you can read it as "a type of method to access a I value stored in a I-based object, with a I implementation style" and know that it's going to call the scalar() function in the Class::MakeMethods::Standard::Hash package to generate the requested method.
    +
    +
    +=head1 USAGE
    +
    +The supported method types, and the kinds of arguments they expect, vary from subclass to subclass; see the documentation of each subclass for details. 
    +
    +However, the features described below are applicable to all subclasses.
    +
    +=head2 Invocation
    +
    +Methods are dynamically generated and installed into the calling
    +package when you C or one of its
    +subclasses, or if you later call Cmake(...)>.
    +
    +The arguments to C or C should be pairs of a generator
    +type name and an associated array of method-name arguments to pass to
    +the generator. 
    +
    +=over 4
    +
    +=item *
    +
    +use Class::MakeMethods::I ( 
    +    'I' => [ I ], I<...>
    +  );
    +
    +=item *
    +
    +Class::MakeMethods::I->make ( 
    +    'I' => [ I ], I<...>
    +  );
    +
    +=back
    +
    +You may select a specific subclass of Class::MakeMethods for
    +a single generator-type/argument pair by prefixing the type name
    +with a subclass name and a colon.
    +
    +=over 4
    +
    +=item *
    +
    +use Class::MakeMethods ( 
    +    'I:I' => [ I ], I<...>
    +  );
    +
    +=item *
    +
    +Class::MakeMethods->make ( 
    +    'I:I' => [ I ], I<...>
    +  );
    +
    +=back
    +
    +The difference between C and C is primarily one of precedence; the C keyword acts as a BEGIN block, and is thus evaluated before C would be. (See L for additional discussion of this issue.)
    +
    +=head2 Alternative Invocation
    +
    +If you want methods to be declared at run-time when a previously-unknown
    +method is invoked, see L.
    +
    +=over 4
    +
    +=item *
    +
    +use Class::MakeMethods::Autoload 'I:I';
    +
    +=back
    +
    +If you are using Perl version 5.6 or later, see
    +L for an additional declaration
    +syntax for generated methods.
    +
    +=over 4
    +
    +=item *
    +
    +use Class::MakeMethods::Attribute 'I';
    +
    +sub I :MakeMethod('I' => I);
    +
    +=back
    +
    +=head2 About Precedence
    +
    +Rather than passing the method declaration arguments when you C one of these packages, you may instead pass them to a subsequent call to the class method C. 
    +
    +The difference between C and C is primarily one of precedence; the C keyword acts as a BEGIN block, and is thus evaluated before C would be. In particular, a C at the top of a file will be executed before any subroutine declarations later in the file have been seen, whereas a C at the same point in the file will not. 
    +
    +By default, Class::MakeMethods will not install generated methods over any pre-existing methods in the target class. To override this you can pass C<-ForceInstall =E 1> as initial arguments to C or C. 
    +
    +If the same method is declared multiple times, earlier calls to
    +C or C win over later ones, but within each call,
    +later declarations superceed earlier ones.
    +
    +Here are some examples of the results of these precedence rules:
    +
    +  # 1 - use, before
    +  use Class::MakeMethods::Standard::Hash (
    +    'scalar'=>['baz'] # baz() not seen yet, so we generate, install
    +  );
    +  sub baz { 1 } # Subsequent declaration overwrites it, with warning
    +  
    +  # 2 - use, after
    +  sub foo { 1 }
    +  use Class::MakeMethods::Standard::Hash (
    +    'scalar'=>['foo'] # foo() is already declared, so has no effect
    +  );
    +  
    +  # 3 - use, after, Force
    +  sub bar { 1 }
    +  use Class::MakeMethods::Standard::Hash ( 
    +      -ForceInstall => 1, # Set flag for following methods...
    +    'scalar' => ['bar']   # ... now overwrites pre-existing bar()
    +  );
    +  
    +  # 4 - make, before
    +  Class::MakeMethods::Standard::Hash->make(
    +    'scalar'=>['blip'] # blip() is already declared, so has no effect
    +  );
    +  sub blip { 1 } # Although lower than make(), this "happens" first
    +  
    +  # 5 - make, after, Force
    +  sub ping { 1 } 
    +  Class::MakeMethods::Standard::Hash->make(
    +      -ForceInstall => 1, # Set flag for following methods...
    +    'scalar' => ['ping']  # ... now overwrites pre-existing ping()
    +  );
    +
    +=head2 Global Options
    +
    +Global options may be specified as an argument pair with a leading hyphen. (This distinguishes them from type names, which must be valid Perl subroutine names, and thus will never begin with a hyphen.) 
    +
    +use Class::MakeMethods::I ( 
    +    '-I' => I,
    +    'I' => [ I ], I<...>
    +  );
    +
    +Option settings apply to all subsequent method declarations within a single C or C call.
    +
    +The below options allow you to control generation and installation of the requested methods. (Some subclasses may support additional options; see their documentation for details.)
    +
    +=over 4 
    +
    +=item -TargetClass
    +
    +By default, the methods are installed in the first package in the caller() stack that is not a Class::MakeMethods subclass; this is generally the package in which your use or make statement was issued. To override this you can pass C<-TargetClass =E I> as initial arguments to C or C. 
    +
    +This allows you to construct or modify classes "from the outside":
    +
    +  package main;
    +  
    +  use Class::MakeMethods::Basic::Hash( 
    +    -TargetClass => 'MyWidget',
    +    'new' => ['create'],
    +    'scalar' => ['foo', 'bar'],
    +  );
    +  
    +  $o = MyWidget->new( foo => 'Foozle' );
    +  print $o->foo();
    +
    +=item -MakerClass
    +
    +By default, meta-methods are looked up in the package you called
    +use or make on.
    +
    +You can override this by passing the C<-MakerClass> flag, which
    +allows you to switch packages for the remainder of the meta-method
    +types and arguments.
    +
    +use Class::MakeMethods ( 
    +    '-MakerClass'=>'I', 
    +    'I' => [ I ] 
    +  );
    +
    +When specifying the MakerClass, you may provide either the trailing
    +part name of a subclass inside of the C
    +namespace, or a full package name prefixed by C<::>. 
    +
    +For example, the following four statements are equivalent ways of
    +declaring a Basic::Hash scalar method named 'foo':
    +
    +  use Class::MakeMethods::Basic::Hash ( 
    +    'scalar' => [ 'foo' ] 
    +  );
    +  
    +  use Class::MakeMethods ( 
    +    'Basic::Hash:scalar' => [ 'foo' ] 
    +  );
    +  
    +  use Class::MakeMethods ( 
    +    '-MakerClass'=>'Basic::Hash', 
    +    'scalar' =>  [ 'foo' ] 
    +  );
    +  
    +  use Class::MakeMethods ( 
    +    '-MakerClass'=>'::Class::MakeMethods::Basic::Hash', 
    +    'scalar' =>  [ 'foo' ] 
    +  );
    +
    +=item -ForceInstall
    +
    +By default, Class::MakeMethods will not install generated methods over any pre-existing methods in the target class. To override this you can pass C<-ForceInstall =E 1> as initial arguments to C or C. 
    +
    +Note that the C keyword acts as a BEGIN block, so a C at the top of a file will be executed before any subroutine declarations later in the file have been seen. (See L for additional discussion of this issue.)
    +
    +=back
    +
    +=head2 Mixing Method Types
    +
    +A single calling class can combine generated methods from different MakeMethods subclasses. In general, the only mixing that's problematic is combinations of methods which depend on different underlying object types, like using *::Hash and *::Array methods together -- the methods will be generated, but some of them  are guaranteed to fail when called, depending on whether your object happens to be a blessed hashref or arrayref. 
    +
    +For example, it's common to mix and match various *::Hash methods, with a scattering of Global or Inheritable methods:
    +
    +  use Class::MakeMethods (
    +    'Basic::Hash:scalar'      => 'foo',
    +    'Composite::Hash:scalar'  => [ 'bar' => { post_rules => [] } ],
    +    'Standard::Global:scalar' => 'our_shared_baz'
    +  );
    +
    +=head2 Declaration Syntax
    +
    +The following types of Simple declarations are supported:
    +
    +=over 4
    +
    +=item *
    +
    +I => 'I'
    +
    +=item *
    +
    +I => 'I I...'
    +
    +=item *
    +
    +I => [ 'I', 'I', ...]
    +
    +=back
    +
    +For a list of the supported values of I, see
    +L, or the documentation
    +for each subclass.
    +
    +For each method name you provide, a subroutine of the indicated
    +type will be generated and installed under that name in your module.
    +
    +Method names should start with a letter, followed by zero or more
    +letters, numbers, or underscores.
    +
    +=head2 Argument Normalization
    +
    +The following expansion rules are applied to argument pairs to
    +enable the use of simple strings instead of arrays of arguments.
    +
    +=over 4
    +
    +=item *
    +
    +Each type can be followed by a single meta-method definition, or by a
    +reference to an array of them.
    +
    +=item *
    +
    +If the argument is provided as a string containing spaces, it is
    +split and each word is treated as a separate argument.
    +
    +=item *
    +
    +It the meta-method type string contains spaces, it is split and
    +only the first word is used as the type, while the remaining words
    +are placed at the front of the argument list.
    +
    +=back
    +
    +For example, the following statements are equivalent ways of
    +declaring a pair of Basic::Hash scalar methods named 'foo' and 'bar':
    +
    +  use Class::MakeMethods::Basic::Hash ( 
    +    'scalar' => [ 'foo', 'bar' ], 
    +  );
    +  
    +  use Class::MakeMethods::Basic::Hash ( 
    +    'scalar' => 'foo', 
    +    'scalar' => 'bar', 
    +  );
    +  
    +  use Class::MakeMethods::Basic::Hash ( 
    +    'scalar' => 'foo bar', 
    +  );
    +  
    +  use Class::MakeMethods::Basic::Hash ( 
    +    'scalar foo' => 'bar', 
    +  );
    +
    +(The last of these is clearly a bit peculiar and potentially misleading if used as shown, but it enables advanced subclasses to provide convenient formatting for declarations with  defaults or modifiers, such as C<'Template::Hash:scalar --private' =E 'foo'>, discussed elsewhere.)
    +
    +=head2 Parameter Syntax
    +
    +The Standard syntax also provides several ways to optionally
    +associate a hash of additional parameters with a given method
    +name. 
    +
    +=over 4
    +
    +=item *
    +
    +I => [ 
    +    'I' => { I=>I... }, I<...>
    +  ]
    +
    +A hash of parameters to use just for this method name. 
    +
    +(Note: to prevent confusion with self-contained definition hashes,
    +described below, parameter hashes following a method name must not
    +contain the key C<'name'>.)
    +
    +=item *
    +
    +I => [ 
    +    [ 'I', 'I', ... ] => { I=>I... }
    +  ]
    +
    +Each of these method names gets a copy of the same set of parameters.
    +
    +=item *
    +
    +I => [ 
    +    { 'name'=>'I', I=>I... }, I<...>
    +  ]
    +
    +By including the reserved parameter C<'name'>, you create a self-contained declaration with that name and any associated hash values.
    +
    +=back
    +
    +Simple declarations, as shown in the prior section, are treated as if they had an empty parameter hash.
    +
    +=head2 Default Parameters
    +
    +A set of default parameters to be used for several declarations
    +may be specified using any of the following types of arguments to
    +a method generator call:
    +
    +=over 4
    +
    +=item * 
    +
    +I => [ 
    +    '-I' => 'I', 'I', 'I', I<...>
    +  ]
    +
    +Set a default value for the specified parameter to be passed to all subsequent declarations.
    +
    +=item * 
    +
    +I => [ 
    +    '--' => { 'I' => 'I', ... }, 'I', 'I', I<...>
    +  ]
    +
    +Set default values for one or more parameters to be passed to all subsequent declarations. Equivalent to a series of '-I' => 'I' pairs for each pair in the referenced hash.
    +
    +=item * 
    +
    +I => [ 
    +    '--I', 'I', 'I', I<...>
    +  ]
    +
    +Appends to the default value for a special parameter named "--". This parameter is currently only used by some subclasses; for details see L
    +
    +=back
    +
    +Parameters set in these ways are passed to each declaration that
    +follows it until the end of the method-generator argument array,
    +or until overridden by another declaration. Parameters specified
    +in a hash for a specific method name, as discussed above, will
    +override the defaults of the same name for that particular method.
    +
    +
    +=head1 DIAGNOSTICS
    +
    +The following warnings and errors may be produced when using
    +Class::MakeMethods to generate methods. (Note that this list does not
    +include run-time messages produced by calling the generated methods.)
    +
    +These messages are classified as follows (listed in increasing order of
    +desperation): 
    +
    +    (Q) A debugging message, only shown if $CONTEXT{Debug} is true
    +    (W) A warning.
    +    (D) A deprecation.
    +    (F) A fatal error in caller's use of the module.
    +    (I) An internal problem with the module or subclasses.
    +
    +Portions of the message which may vary are denoted with a %s.
    +
    +=over 4
    +
    +=item Can't interpret meta-method template: argument is empty or
    +undefined
    +
    +(F)
    +
    +=item Can't interpret meta-method template: unknown template name
    +'%s'
    +
    +(F)
    +
    +=item Can't interpret meta-method template: unsupported template
    +type '%s'
    +
    +(F)
    +
    +=item Can't make method %s(): template specifies unknown behavior
    +'%s'
    +
    +(F)
    +
    +=item Can't parse meta-method declaration: argument is empty or
    +undefined
    +
    +(F) You passed an undefined value or an empty string in the list
    +of meta-method declarations to use or make.
    +
    +=item Can't parse meta-method declaration: missing name attribute.
    +
    +(F) You included an hash-ref-style meta-method declaration that
    +did not include the required name attribute. You may have meant
    +this to be an attributes hash for a previously specified name, but
    +if so we were unable to locate it.
    +
    +=item Can't parse meta-method declaration: unknown template name
    +'%s'
    +
    +(F) You included a template specifier of the form C<'-I'>
    +in a the list of meta-method declaration, but that template is not
    +available.
    +
    +=item Can't parse meta-method declaration: unsupported declaration
    +type '%s'
    +
    +(F) You included an unsupported type of value in a list of meta-method
    +declarations.
    +
    +=item Compilation error: %s
    +
    +(I)
    +
    +=item Not an interpretable meta-method: '%s'
    +
    +(I)
    +
    +=item Odd number of arguments passed to %s make
    +
    +(F) You specified an odd number of arguments in a call to use or
    +make.  The arguments should be key => value pairs.
    +
    +=item Unable to compile generated method %s(): %s
    +
    +(I) The install_methods subroutine attempted to compile a subroutine
    +by calling eval on a provided string, which failed for the indicated
    +reason, usually some type of Perl syntax error.
    +
    +=item Unable to dynamically load $package: $%s
    +
    +(F)
    +
    +=item Unable to install code for %s() method: '%s'
    +
    +(I) The install_methods subroutine was passed an unsupported value
    +as the code to install for the named method.
    +
    +=item Unexpected return value from compilation of %s(): '%s'
    +
    +(I) The install_methods subroutine attempted to compile a subroutine
    +by calling eval on a provided string, but the eval returned something
    +other than than the code ref we expect.
    +
    +=item Unexpected return value from meta-method constructor %s: %s
    +
    +(I) The requested method-generator was invoked, but it returned an unacceptable value.
    +
    +=back
    +
    +
    +=head1 EXTENDING
    +
    +Class::MakeMethods can be extended by creating subclasses that
    +define additional meta-method types. Callers then select your
    +subclass using any of the several techniques described above.
    +
    +=head2 Creating A Subclass
    +
    +The begining of a typical extension might look like the below:
    +
    +  package My::UpperCaseMethods;
    +  use strict;
    +  use Class::MakeMethods '-isasubclass';
    +  
    +  sub my_method_type { ... }
    +
    +You can name your subclass anything you want; it does not need to
    +begin with Class::MakeMethods.
    +
    +The '-isasubclass' flag is a shortcut that automatically puts
    +Class::MakeMethods into your package's @ISA array so that it will
    +inherit the import() and make() class methods. If you omit this
    +flag, you will need to place the superclass in your @ISA explicitly.
    +
    +Typically, the subclass should B inherit from Exporter; both
    +Class::MakeMethods and Exporter are based on inheriting an import
    +class method, and getting a subclass to support both would require
    +additional effort.
    +
    +=head2 Naming Method Types
    +
    +Each type of method that can be generated is defined in a subroutine
    +of the same name. You can give your meta-method type any name that
    +is a legal subroutine identifier.
    +
    +(Names begining with an underscore, and the names C and
    +C, are reserved for internal use by Class::MakeMethods.)
    +
    +If you plan on distributing your extension, you may wish to follow
    +the "Naming Convention for Generated Method Types" described above
    +to facilitate reuse by others.
    +
    +=head2 Implementation Options
    +
    +Each method generation subroutine can be implemented in any one of
    +the following ways:
    +
    +=over 4
    +
    +=item *
    +
    +Subroutine Generation
    +
    +Returns a list of subroutine name/code pairs.
    +
    +The code returned may either be a coderef, or a string containing
    +Perl code that can be evaled and will return a coderef. If the eval
    +fails, or anything other than a coderef is returned, then
    +Class::MakeMethods croaks.
    +
    +For example a simple sub-class with a method type upper_case_get_set
    +that generates an accessor method for each argument provided might
    +look like this:
    +
    +  package My::UpperCaseMethods;
    +  use Class::MakeMethods '-isasubclass';
    +  
    +  sub uc_scalar {
    +    my $class = shift;
    +    map { 
    +      my $name = $_;
    +      $name => sub {
    +	my $self = shift;
    +	if ( scalar @_ ) { 
    +	  $self->{ $name } = uc( shift ) 
    +	} else {
    +	  $self->{ $name };
    +	}
    +      }
    +    } @_;
    +  }
    +
    +Callers could then generate these methods as follows:
    +
    +  use My::UpperCaseMethods ( 'uc_scalar' => 'foo' );
    +
    +=item *
    +
    +Aliasing
    +
    +Returns a string containing a different meta-method type to use
    +for those same arguments.
    +
    +For example a simple sub-class that defines a method type stored_value
    +might look like this:
    +
    +  package My::UpperCaseMethods;
    +  use Class::MakeMethods '-isasubclass';
    +
    +  sub regular_scalar { return 'Basic::Hash:scalar' }
    +
    +And here's an example usage:
    +
    +  use My::UpperCaseMethods ( 'regular_scalar' => [ 'foo' ] );
    +
    +=item *
    +
    +Rewriting
    +
    +Returns one or more array references with different meta-method
    +types and arguments to use.
    +
    +For example, the below meta-method definition reviews the name of
    +each method it's passed and creates different types of meta-methods
    +based on whether the declared name is in all upper case:
    +
    +  package My::UpperCaseMethods;
    +  use Class::MakeMethods '-isasubclass';
    +
    +  sub auto_detect { 
    +    my $class = shift;
    +    my @rewrite = ( [ 'Basic::Hash:scalar' ], 
    +		    [ '::My::UpperCaseMethods:uc_scalar' ] );
    +    foreach ( @_ ) {
    +      my $name_is_uppercase = ( $_ eq uc($_) ) ? 1 : 0;
    +      push @{ $rewrite[ $name_is_uppercase ] }, $_
    +    }
    +    return @rewrite;
    +  }
    +
    +The following invocation would then generate a regular scalar accessor method foo, and a uc_scalar method BAR:
    +
    +  use My::UpperCaseMethods ( 'auto_detect' => [ 'foo', 'BAR' ] );
    +
    +=item * 
    +
    +Generator Object
    +
    +Returns an object with a method named make_methods which will be responsible for returning subroutine name/code pairs. 
    +
    +See L for an example.
    +
    +=item *
    +
    +Self-Contained
    +
    +Your code may do whatever it wishes, and return an empty list.
    +
    +=back
    +
    +=head2 Access to Options
    +
    +Global option values are available through the _context() class method at the time that method generation is being performed.
    +
    +  package My::Maker;
    +  sub my_methodtype {
    +    my $class = shift;
    +    warn "Installing in " . $class->_context('TargetClass');
    +    ...
    +  }
    +
    +=over 4
    +
    +=item *
    +
    +TargetClass
    +
    +Class into which code should be installed.
    +
    +=item *
    +
    +MakerClass
    +
    +Which subclass of Class::MakeMethods will generate the methods?
    +
    +=item *
    +
    +ForceInstall
    +
    +Controls whether generated methods will be installed over pre-existing methods in the target package.
    +
    +=back
    +
    +
    +=head1 SEE ALSO
    +
    +=head2 License and Support
    +
    +For distribution, installation, support, copyright and license 
    +information, see L.
    +
    +=head2 Package Documentation
    +
    +A collection of sample uses is available in
    +L.
    +
    +See the documentation for each family of subclasses:
    +
    +=over 4
    +
    +=item *
    +
    +L
    +
    +=item *
    +
    +L
    +
    +=item *
    +
    +L
    +
    +=item *
    +
    +L
    +
    +=back
    +
    +A listing of available method types from each of the different subclasses
    +is provided in L.
    +
    +=head2 Related Modules
    +
    +For a brief survey of the numerous modules on CPAN which offer some type
    +of method generation, see L.
    +
    +In several cases, Class::MakeMethods provides functionality closely
    +equivalent to that of an existing module, and emulator modules are provided
    +to map the existing module's interface to that of Class::MakeMethods.
    +See L for more information.
    +
    +If you have used Class::MethodMaker, you will note numerous similarities
    +between the two.  Class::MakeMethods is based on Class::MethodMaker, but
    +has been substantially revised in order to provide a range of new features.
    +Backward compatibility and conversion documentation is provded in
    +L.
    +
    +=head2 Perl Docs
    +
    +See L for a quick introduction to objects for beginners.  For
    +an extensive discussion of various approaches to class construction, see
    +L and L (called L in the most recent
    +versions of Perl).
    +
    +See L, point 4 for more information on
    +closures. (FWIW, I think there's a big opportunity for a "perlfunt" podfile
    +bundled with Perl in the tradition of "perlboot" and "perltoot", exploring
    +the utility of function references, callbacks, closures, and
    +continuations... There are a bunch of useful references available, but
    +not a good overview of how they all interact in a Perlish way.)
    +
    +=cut
    diff --git a/lib/Class/MakeMethods/Attribute.pm b/lib/Class/MakeMethods/Attribute.pm
    new file mode 100644
    index 0000000..b8fe71d
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Attribute.pm
    @@ -0,0 +1,143 @@
    +package Class::MakeMethods::Attribute;
    +
    +require 5.006;
    +use strict;
    +use Carp;
    +use Attribute::Handlers;
    +
    +use Class::MakeMethods;
    +use Class::MakeMethods::Utility::Inheritable 'get_vvalue';
    +
    +our $VERSION = 1.005;
    +
    +our %DefaultMaker;
    +
    +sub import {
    +  my $class = shift;
    +
    +  if ( scalar @_ and $_[0] =~ m/^\d/ ) {
    +    Class::MakeMethods::_import_version( $class, shift );
    +  }
    +  
    +  if ( scalar @_ == 1 ) {
    +    my $target_class = ( caller(0) )[0];
    +    $DefaultMaker{ $target_class } = shift;
    +  }
    +}
    +
    +sub UNIVERSAL::MakeMethod :ATTR(CODE) {
    +  my ($package, $symbol, $referent, $attr, $data) = @_;
    +  if ( $symbol eq 'ANON' or $symbol eq 'LEXICAL' ) {
    +    croak "Can't apply MakeMethod attribute to $symbol declaration."
    +  }
    +  if ( ! $data ) {
    +    croak "No method type provided for MakeMethod attribute."
    +  }
    +  my $symname = *{$symbol}{NAME};
    +  if ( ref $data eq 'ARRAY' ) {
    +    local $_ = shift @$data;
    +    $symname = [ @$data, $symname ];
    +    $data = $_;
    +  }
    +  unless ( $DefaultMaker{$package} ) {
    +    local $_ = get_vvalue( \%DefaultMaker, $package );
    +    $DefaultMaker{$package} = $_ if ( $_ );
    +  }
    +  Class::MakeMethods->make( 
    +    -TargetClass => $package,
    +    -ForceInstall => 1, 
    +    ( $DefaultMaker{$package} ? ('-MakerClass'=>$DefaultMaker{$package}) : () ),
    +    $data => $symname
    +  );
    +}
    +
    +1;
    +
    +__END__
    +
    +=head1 NAME
    +
    +Class::MakeMethods::Attribute - Declare generated subs with attribute syntax
    +
    +=head1 SYNOPSIS
    +
    +  package MyObject;
    +  use Class::MakeMethods::Attribute 'Standard::Hash';
    +  
    +  sub new    :MakeMethod('new');
    +  sub foo    :MakeMethod('scalar');
    +  sub bar    :MakeMethod('scalar', { hashkey => 'bar_data' });
    +  sub debug  :MakeMethod('Standard::Global:scalar');
    +
    +=head1 DESCRIPTION
    +
    +This package allows common types of methods to be generated via a subroutine attribute declaration. (Available in Perl 5.6 and later.)
    +
    +Adding the :MakeMethod() attribute to a subroutine declaration causes Class::MakeMethods to create and install a subroutine based on the parameters given to the :MakeMethod attribute.
    +
    +You can declare a default method-generation class by passing the name of a MakeMethods subclass in the use Class::MakeMethods::Attribute statement. This default method-generation class will also apply as the default to any subclasses declared at compile time. If no default method-generation class is selected, you will need to fully-qualify all method type declarations.
    +
    +=head1 EXAMPLE
    +
    +Here's a typical use of Class::MakeMethods::Attribute:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Attribute 'Standard::Hash';
    +  
    +  sub new    :MakeMethod('new');
    +  sub foo    :MakeMethod('scalar');
    +  sub bar    :MakeMethod('scalar', { hashkey => 'bar_data' });
    +  sub debug  :MakeMethod('Standard::Global:scalar');
    +
    +  package MySubclass;
    +  use base 'MyObject';
    +
    +  sub bazzle :MakeMethod('scalar');
    +
    +This is equivalent to the following explicit Class::MakeMethods invocations:
    +
    +  package MyObject;
    +  
    +  use Class::MakeMethods ( 
    +    -MakerClass => 'Standard::Hash',
    +    new => 'new',
    +    scalar => 'foo',
    +    scalar => [ 'ba', { hashkey => 'bar_data' } ],
    +    'Standard::Global:scalar' => 'debug',
    +  );
    +  
    +  package MySubclass;
    +  use base 'MyObject';
    +  
    +  use Class::MakeMethods ( 
    +    -MakerClass => 'Standard::Hash',
    +    scalar => 'bazzle',
    +  );
    +
    +=head1 DIAGNOSTICS
    +
    +The following warnings and errors may be produced when using
    +Class::MakeMethods::Attribute to generate methods. (Note that this
    +list does not include run-time messages produced by calling the
    +generated methods, or the standard messages produced by
    +Class::MakeMethods.)
    +
    +=over
    +
    +=item Can't apply MakeMethod attribute to %s declaration.
    +
    +You can not use the C<:MakeMethod> attribute with lexical or anonymous subroutine declarations. 
    +
    +=item No method type provided for MakeMethod attribute.
    +
    +You called C<:MakeMethod()> without the required method-type argument.
    +
    +=back
    +
    +=head1 SEE ALSO
    +
    +See L byÊDamian Conway.
    +
    +See L for general information about this distribution. 
    +
    +=cut
    diff --git a/lib/Class/MakeMethods/Autoload.pm b/lib/Class/MakeMethods/Autoload.pm
    new file mode 100644
    index 0000000..ab1a6ca
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Autoload.pm
    @@ -0,0 +1,182 @@
    +package Class::MakeMethods::Autoload;
    +
    +use strict;
    +use Carp;
    +require Exporter;
    +
    +use Class::MakeMethods;
    +use Class::MakeMethods::Utility::Inheritable 'get_vvalue';
    +
    +use vars qw( $VERSION @ISA @EXPORT_OK );
    +
    +$VERSION = 1.000;
    +@ISA = qw(Exporter);
    +@EXPORT_OK = qw( AUTOLOAD );
    +
    +########################################################################
    +
    +use vars qw( $AUTOLOAD %DefaultType );
    +
    +sub import {
    +  my $class = shift;
    +  my $target_class = ( caller(0) )[0];
    +  
    +  if ( scalar @_ and $_[0] =~ m/^\d/ ) {
    +    Class::MakeMethods::_import_version( $class, shift );
    +  }
    +  
    +  if ( scalar @_ == 1 ) {
    +    $DefaultType{ $target_class } = shift;
    +  }
    +  
    +  __PACKAGE__->Exporter::export_to_level(1, $class, 'AUTOLOAD');
    +}
    +
    +sub AUTOLOAD {
    +  my $sym = $AUTOLOAD;
    +  my ($package, $func) = ($sym =~ /(.*)::([^:]+)$/);
    +  
    +  unless ( $DefaultType{$package} ) {
    +    local $_ = get_vvalue( \%DefaultType, $package );
    +    $DefaultType{$package} = $_ if ( $_ );
    +  }
    +  
    +  my $type = $DefaultType{$package} 
    +      or croak(__PACKAGE__ . ": No default method type for $package; can't auto-generate $func");
    +  
    +  if ( ref $type eq 'HASH' ) { 
    +    my $n_type = $type->{ $func } ||
    +	( map $type->{$_}, grep { $func =~ m/\A$_\Z/ } sort { length($b) <=> length($a) } keys %$type )[0] ||
    +	$type->{ '' } 
    +      or croak(__PACKAGE__ . ": Can't find best match for '$func' in type map (" . join(', ', keys %$type ) . ")");
    +    $type = $n_type;
    +  } elsif ( ref $type eq 'CODE' ) {
    +    $type = &$type( $func )
    +      or croak(__PACKAGE__ . ": Can't find match for '$func' in type map ($type)");
    +  }
    +  
    +  # warn "Autoload $func ($type)";
    +  Class::MakeMethods->make( 
    +    -TargetClass => $package,
    +    -ForceInstall => 1, 
    +    $type => $func
    +  );
    +  
    +  if ( my $sub = $package->can( $func ) ) {
    +    goto &$sub;
    +  } else {
    +    croak(__PACKAGE__ . ": Construction of $type method ${package}::$func failed to produce usable method")
    +  }
    +}
    +
    +1;
    +
    +__END__
    +
    +=head1 NAME
    +
    +Class::MakeMethods::Autoload - Declare generated subs with AUTOLOAD
    +
    +=head1 SYNOPSIS
    +
    +  package MyObject;
    +  use Class::MakeMethods::Autoload 'Standard::Hash::scalar';
    +  
    +  package main;
    +  my $obj = bless {}, 'MyObject';
    +  
    +  $obj->foo("Foozle");
    +  print $obj->foo();
    +
    +=head1 DESCRIPTION
    +
    +This package provides a generate-on-demand interface to Class::MakeMethods. 
    +
    +When your class uses this package, it imports an AUTOLOAD function that resolves missing methods by using Class::MakeMethods to generate and install a standard type of method.
    +
    +You must specify the type of method to be generated by passing a single argument to your use Class::MakeMethods::Autoload statement, which can take any of these forms:
    +
    +=over 4
    +
    +=item *
    +
    +A Class::MakeMethods generator name and method type.
    +
    +Here are three examples:
    +
    +  use Class::MakeMethods::Autoload 'Standard::Hash:scalar';
    +  
    +  use Class::MakeMethods::Autoload 'Basic::Universal::no_op';
    +  
    +  use Class::MakeMethods::Autoload 
    +		'::Class::MakeMethod::Composite::Global:array';
    +
    +=item *
    +
    +A reference to a subroutine which will be called for each requested function name and which is expected to return the name of the method generator to use.
    +
    +Here's a contrived example which generates scalar accessors for methods except those with a digit in their name, which are treated as globals.
    +
    +  use Class::MakeMethods::Autoload sub { 
    +    my $name = shift;
    +    ( $name =~ /\d/ ) ? 'Standard::Global::scalar' 
    +		      : 'Standard::Hash::scalar'
    +  };
    +
    +=item *
    +
    +A reference to a hash which defines which method type to use based on the name of the requested method. If a key exists which is an exact match for the requested function name, the associated value is used; otherwise, each of the keys is used as a regular expression, and the value of the first one that matches the function name is used. (For regular expression matching, the keys are tested in reverse length order, longest to shortest.)
    +
    +Here's an example which provides a new() constructor, a DESTROY() method that does nothing, and a wildcard match that provides scalar accessors for all other Autoloaded methods:
    +
    +  use Class::MakeMethods::Autoload { 
    +    'new'     => 'Standard::Hash::new', 
    +    '.*'      => 'Standard::Hash::scalar',
    +    'DESTROY' => 'Standard::Universal::no_op',
    +  };
    +
    +Here's a more sophisticated example which causes all-upper-case method names to be generated as globals, those with a leading upper-case letter to be generated as inheritable data methods, and others to be normal accessors:
    +
    +  use Class::MakeMethods::Autoload { 
    +    'new'     => 'Standard::Hash::new', 
    +    '.*'      => 'Standard::Hash::scalar',
    +    '[A-Z].*' => 'Standard::Inheritable::scalar',
    +    '[A-Z0-9]+' => 'Standard::Global::scalar',
    +    'DESTROY' => 'Standard::Universal::no_op',
    +  };
    +
    +=back
    +
    +=head1 DIAGNOSTICS
    +
    +The following warnings and errors may be produced when using
    +Class::MakeMethods::Attribute to generate methods. (Note that this
    +list does not include run-time messages produced by calling the
    +generated methods, or the standard messages produced by
    +Class::MakeMethods.)
    +
    +=over
    +
    +=item No default method type; can't autoload
    +
    +You must declare a default method type, generally by passing its
    +name to a C statement, prior to
    +autoloading any methods.
    +
    +=item Construction of %s method %s failed to produce usable method
    +
    +Indicates that Autoload succesfully called Class::MakeMethods->make
    +to generate the requested method, but afterwards was not able to
    +invoke the generated method. You may have selected an incompatible
    +method type, or the method may not have been installed sucesfully.
    +
    +=back
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +For distribution, installation, support, copyright and license 
    +information, see L.
    +
    +=cut
    diff --git a/lib/Class/MakeMethods/Basic.pm b/lib/Class/MakeMethods/Basic.pm
    new file mode 100644
    index 0000000..f893f5b
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Basic.pm
    @@ -0,0 +1,98 @@
    +package Class::MakeMethods::Basic;
    +
    +use Class::MakeMethods '-isasubclass';
    +
    +$VERSION = 1.000;
    +
    +1;
    +
    +__END__
    +
    +########################################################################
    +
    +=head1 NAME
    +
    +Class::MakeMethods::Basic - Make really simple methods
    +
    +
    +=head1 SYNOPSIS
    +
    +  package MyObject;
    +  use Class::MakeMethods::Basic::Hash (
    +    'new'     => [ 'new' ],
    +    'scalar'  => [ 'foo', 'bar' ]
    +  );
    +
    +  package main;   
    + 
    +  my $obj = MyObject->new( foo => "Foozle", bar => "Bozzle" );
    +  print $obj->foo();
    +  $obj->bar("Barbados");
    +
    +
    +=head1 DESCRIPTION
    +
    +This document describes the various subclasses of Class::MakeMethods
    +included under the Basic::* namespace, and the method types each
    +one provides.
    +
    +The Basic subclasses provide stripped-down method-generation implementations. 
    +
    +Subroutines are generated as closures bound to each method name.
    +
    +=head2 Calling Conventions
    +
    +When you C a subclass of this package, the method declarations you provide
    +as arguments cause subroutines to be generated and installed in
    +your module. You can also omit the arguments to C and instead make methods
    +at runtime by passing the declarations to a subsequent call to
    +C.
    +
    +You may include any number of declarations in each call to C
    +or C. If methods with the same name already exist, earlier
    +calls to C or C win over later ones, but within each
    +call, later declarations superceed earlier ones.
    +
    +You can install methods in a different package by passing C<-TargetClass =E I> as your first arguments to C or C. 
    +
    +See L for more details.
    +
    +=head2 Declaration Syntax
    +
    +The following types of declarations are supported:
    +
    +=over 4
    +
    +=item *
    +
    +I => 'I'
    +
    +=item *
    +
    +I => 'I I...'
    +
    +=item *
    +
    +I => [ 'I', 'I', ...]
    +
    +=back
    +
    +For a list of the supported values of I, see
    +L, or the documentation
    +for each subclass.
    +
    +For each method name you provide, a subroutine of the indicated
    +type will be generated and installed under that name in your module.
    +
    +Method names should start with a letter, followed by zero or more
    +letters, numbers, or underscores.
    +
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +For distribution, installation, support, copyright and license 
    +information, see L.
    +
    +=cut
    diff --git a/lib/Class/MakeMethods/Basic/Array.pm b/lib/Class/MakeMethods/Basic/Array.pm
    new file mode 100644
    index 0000000..c537866
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Basic/Array.pm
    @@ -0,0 +1,422 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Basic::Array - Basic array methods
    +
    +=head1 SYNOPSIS
    +
    +  package MyObject;
    +  use Class::MakeMethods::Basic::Array (
    +    new => 'new',
    +    scalar => [ 'foo', 'bar' ],
    +    array => 'my_list',
    +    hash => 'my_index',
    +  );
    +  ...
    +  
    +  # Constructor
    +  my $obj = MyObject->new( foo => 'Foozle' );
    +  
    +  # Scalar Accessor
    +  print $obj->foo();
    +  
    +  $obj->bar('Barbados');
    +  print $obj->bar();
    +  
    +  # Array accessor
    +  $obj->my_list(0 => 'Foozle', 1 => 'Bang!');
    +  print $obj->my_list(1);
    +  
    +  # Hash accessor
    +  $obj->my_index('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  print $obj->my_index('foo');
    +
    +
    +=head1 DESCRIPTION
    +
    +The Basic::Array subclass of MakeMethods provides a basic
    +constructor and accessors for blessed-array object instances.
    +
    +=head2 Calling Conventions
    +
    +When you C this package, the method names you provide
    +as arguments cause subroutines to be generated and installed in
    +your module.
    +
    +See L for a summary, or L for full details.
    +
    +=head2 Declaration Syntax
    +
    +To declare methods, pass in pairs of a method-type name followed
    +by one or more method names. Valid method-type names for this
    +package are listed in L<"METHOD GENERATOR TYPES">.
    +
    +See L for more
    +syntax information.
    +
    +=cut
    +
    +package Class::MakeMethods::Basic::Array;
    +
    +$VERSION = 1.000;
    +use strict;
    +use Class::MakeMethods '-isasubclass';
    +
    +########################################################################
    +
    +=head2 About Positional Accessors
    +
    +Each accessor method claims the next available spot in the array
    +to store its value in.
    +
    +The mapping between method names and array positions is stored in
    +a hash named %FIELDS in the target package. When the first positional
    +accessor is defined for a package, its %FIELDS are initialized by
    +searching its inheritance tree.
    +
    +B: Subclassing packages that use positional accessors is
    +somewhat fragile, since you may end up with two distinct methods
    +assigned to the same position. Specific cases to avoid are:
    +
    +=over 4
    +
    +=item *
    +
    +If you inherit from more than one class with positional accessors,
    +the positions used by the two sets of methods will overlap.
    +
    +=item *
    +
    +If your superclass adds additional positional accessors after you
    +declare your first, they will overlap yours.
    +
    +=back
    +
    +=cut
    +
    +sub _array_index {
    +  my $class = shift;
    +  my $name = shift;
    +  no strict;
    +  local $^W = 0;
    +  if ( ! scalar %{$class . "::FIELDS"} ) {
    +    my @classes = @{$class . "::ISA"};
    +    my @fields;
    +    while ( @classes ) {
    +      my $superclass = shift @classes;
    +      if ( scalar %{$superclass . "::FIELDS"} ) {
    +	push @fields, %{$superclass . "::FIELDS"};
    +      } else {
    +	unshift @classes, @{$superclass . "::ISA"}
    +      }
    +    }
    +    %{$class . "::FIELDS"} = @fields
    +  }
    +  my $field_hash = \%{$class . "::FIELDS"};
    +  $field_hash->{$name} or $field_hash->{$name} = scalar keys %$field_hash
    +}
    +
    +########################################################################
    +
    +=head1 METHOD GENERATOR TYPES
    +
    +=head2 new - Constructor
    +
    +For each method name passed, returns a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +If called as a class method, makes a new array and blesses it into that class.
    +
    +=item *
    +
    +If called on an array-based instance, makes a copy of it and blesses the copy into the same class as the original instance.
    +
    +=item *
    +
    +If passed a list of method-value pairs, calls each named method with the associated value as an argument. 
    +
    +=item *
    +
    +Returns the new instance.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Basic::Array (
    +    new => 'new',
    +  );
    +  ...
    +  
    +  # Bare constructor
    +  my $empty = MyObject->new();
    +  
    +  # Constructor with initial sequence of method calls
    +  my $obj = MyObject->new( foo => 'Foozle', bar => 'Barbados' );
    +  
    +  # Copy with overriding sequence of method calls
    +  my $copy = $obj->new( bar => 'Bob' );
    +
    +=cut
    +
    +sub new {
    +  my $class = shift;
    +  map { 
    +    my $name = $_;
    +    $name => sub {
    +      my $callee = shift;
    +      my $self = ref($callee) ? bless( [@$callee], ref($callee) ) 
    +			      : bless( [], $callee );
    +      while ( scalar @_ ) {
    +	my $method = shift;
    +	$self->$method( shift );
    +      }
    +      return $self;
    +    }
    +  } @_;
    +}
    +
    +########################################################################
    +
    +=head2 scalar - Instance Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on an array-based instance.
    +
    +=item *
    +
    +Determines the array position associated with the method name, and uses that as an index into each instance to access the related value.
    +
    +=item *
    +
    +If called without any arguments returns the current value (or undef).
    +
    +=item *
    +
    +If called with an argument, stores that as the value, and returns it, 
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Basic::Array (
    +    scalar => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  $obj->foo('Foozle');
    +  
    +  # Retrieve value
    +  print $obj->foo;
    +
    +=cut
    +
    +sub scalar {
    +  my $class = shift;
    +  map { 
    +    my $name = $_;
    +    my $index = _array_index( $class->_context('TargetClass'), $name );
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar @_ ) {
    +	$self->[$index] = shift;
    +      } else {
    +	$self->[$index];
    +      }
    +    }
    +  } @_;
    +}
    +
    +########################################################################
    +
    +=head2 array - Instance Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on an array-based instance.
    +
    +=item *
    +
    +Determines the array position associated with the method name, and uses that as an index into each instance to access the related value.
    +
    +=item * 
    +
    +The value for each instance will be a reference to an array (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the current array-ref value (or undef).
    +
    +=item *
    +
    +If called with one argument, uses that argument as an index to retrieve from the referenced array, and returns that value (or undef). If the single argument is an array ref, then a slice of the referenced array is returned.
    +
    +=item *
    +
    +If called with a list of index-value pairs, stores the value at the given index in the referenced array. If the instance's value was previously undefined, a new array is autovivified. The current value in each position will be overwritten, and later arguments with the same index will override earlier ones. Returns the current array-ref value.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Basic::Array (
    +    array => 'bar',
    +  );
    +  ...
    +  
    +  # Set values by position
    +  $obj->bar(0 => 'Foozle', 1 => 'Bang!');
    +  
    +  # Positions may be overwritten, and in any order
    +  $obj->bar(2 => 'And Mash', 1 => 'Blah!');
    +  
    +  # Retrieve value by position
    +  print $obj->bar(1);
    +  
    +  # Retrieve slice of values by position
    +  print join(', ', $obj->bar( [0, 2] ) );
    +  
    +  # Direct access to referenced array
    +  print scalar @{ $obj->bar() };
    +  
    +  # Reset the array contents to empty
    +  @{ $obj->bar() } = ();
    +
    +=cut
    +
    +sub array {
    +  my $class = shift;
    +  map { 
    +    my $name = $_;
    +    my $index = _array_index( $class->_context('TargetClass'), $name );
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar(@_) == 0 ) {
    +	return $self->[$index];
    +      } elsif ( scalar(@_) == 1 ) {
    +	return $self->[$index]->[ shift() ];
    +      } elsif ( scalar(@_) % 2 ) {
    +	Carp::croak "Odd number of items in assigment to $name";
    +      } else {
    +	while ( scalar(@_) ) {
    +	  my $k = shift();
    +	  $self->[$index]->[ $k ] = shift();
    +	}
    +	return $self->[$index];
    +      }
    +    }
    +  } @_;
    +}
    +
    +########################################################################
    +
    +=head2 hash - Instance Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on an array-based instance.
    +
    +=item *
    +
    +Determines the array position associated with the method name, and uses that as an index into each instance to access the related value.
    +
    +=item * 
    +
    +The value for each instance will be a reference to a hash (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the current hash-ref value (or undef).
    +
    +=item *
    +
    +If called with one argument, uses that argument as an index to retrieve from the referenced hash, and returns that value (or undef). If the single argument is an array ref, then a slice of the referenced hash is returned.
    +
    +=item *
    +
    +If called with a list of key-value pairs, stores the value under the given key in the referenced hash. If the instance's value was previously undefined, a new hash is autovivified. The current value under each key will be overwritten, and later arguments with the same key will override earlier ones. Returns the current hash-ref value.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Basic::Array (
    +    hash => 'baz',
    +  );
    +  ...
    +  
    +  # Set values by key
    +  $obj->baz('foo' => 'Foozle', 'bar' => 'Bang!');
    +  
    +  # Values may be overwritten, and in any order
    +  $obj->baz('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  
    +  # Retrieve value by key
    +  print $obj->baz('foo');
    +  
    +  # Retrieve slice of values by position
    +  print join(', ', $obj->baz( ['foo', 'bar'] ) );
    +  
    +  # Direct access to referenced hash
    +  print keys %{ $obj->baz() };
    +  
    +  # Reset the hash contents to empty
    +  @{ $obj->baz() } = ();
    +
    +=cut
    +
    +sub hash {
    +  my $class = shift;
    +  map { 
    +    my $name = $_;
    +    my $index = _array_index( $class->_context('TargetClass'), $name );
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar(@_) == 0 ) {
    +	return $self->[$index];
    +      } elsif ( scalar(@_) == 1 ) {
    +	return $self->[$index]->{ shift() };
    +      } elsif ( scalar(@_) % 2 ) {
    +	Carp::croak "Odd number of items in assigment to $name";
    +      } else {
    +	while ( scalar(@_) ) {
    +	  my $k = shift();
    +	  $self->[$index]->{ $k } = shift();
    +	}
    +	return $self->[$index];
    +      }
    +    }
    +  } @_;
    +}
    +
    +########################################################################
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +=cut
    +
    +1;
    diff --git a/lib/Class/MakeMethods/Basic/Global.pm b/lib/Class/MakeMethods/Basic/Global.pm
    new file mode 100644
    index 0000000..21116c4
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Basic/Global.pm
    @@ -0,0 +1,298 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Basic::Global - Basic shared methods
    +
    +=head1 SYNOPSIS
    +
    +  package MyObject;
    +  use Class::MakeMethods::Basic::Global (
    +    scalar => [ 'foo', 'bar' ],
    +    array => 'my_list',
    +    hash => 'my_index',
    +  );
    +  ....
    +  
    +  # Store and retrieve global values
    +  MyObject->foo('Foobar');
    +  print MyObject->foo();
    +  
    +  # All instances of your class access the same values
    +  $my_object->bar('Barbados'); 
    +  print $other_one->bar(); 
    +  
    +  # Array accessor
    +  MyObject->my_list(0 => 'Foozle', 1 => 'Bang!');
    +  print MyObject->my_list(1);
    +  
    +  # Hash accessor
    +  MyObject->my_index('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  print MyObject->my_index('foo');
    +
    +
    +=head1 DESCRIPTION
    +
    +The Basic::Global subclass of MakeMethods provides basic accessors for data shared by an entire class, sometimes called "static" or "class data."
    +
    +=head2 Calling Conventions
    +
    +When you C this package, the method names you provide
    +as arguments cause subroutines to be generated and installed in
    +your module.
    +
    +See L for a summary, or L for full details.
    +
    +=head2 Declaration Syntax
    +
    +To declare methods, pass in pairs of a method-type name followed
    +by one or more method names. Valid method-type names for this
    +package are listed in L<"METHOD GENERATOR TYPES">.
    +
    +See L for more
    +syntax information.
    +
    +=cut
    +
    +package Class::MakeMethods::Basic::Global;
    +
    +$VERSION = 1.000;
    +use Class::MakeMethods '-isasubclass';
    +
    +########################################################################
    +
    +=head1 METHOD GENERATOR TYPES
    +
    +=head2 scalar - Shared Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class method, or equivalently, on any object instance.
    +
    +=item *
    +
    +Stores a global value accessible only through this method.
    +
    +=item *
    +
    +If called without any arguments returns the current value.
    +
    +=item *
    +
    +If called with an argument, stores that as the value, and returns it, 
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Basic::Hash (
    +    scalar => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  MyObject->foo('Foozle');
    +  
    +  # Retrieve value
    +  print MyObject->foo;
    +
    +=cut
    +
    +sub scalar {
    +  my $class = shift;
    +  map { 
    +    my $name = $_;
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar @_ ) {
    +	$value = shift;
    +      } else {
    +	$value;
    +      }
    +    }
    +  } @_;
    +}
    +
    +########################################################################
    +
    +=head2 array - Shared Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class method, or equivalently, on any object instance.
    +
    +=item *
    +
    +Stores a global value accessible only through this method.
    +
    +=item * 
    +
    +The value will be a reference to an array (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the current array-ref value (or undef).
    +
    +=item *
    +
    +If called with one argument, uses that argument as an index to retrieve from the referenced array, and returns that value (or undef). If the single argument is an array ref, then a slice of the referenced array is returned.
    +
    +=item *
    +
    +If called with a list of index-value pairs, stores the value at the given index in the referenced array. If the value was previously undefined, a new array is autovivified. The current value in each position will be overwritten, and later arguments with the same index will override earlier ones. Returns the current array-ref value.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Basic::Hash (
    +    array => 'bar',
    +  );
    +  ...
    +  
    +  # Set values by position
    +  $obj->bar(0 => 'Foozle', 1 => 'Bang!');
    +  
    +  # Positions may be overwritten, and in any order
    +  $obj->bar(2 => 'And Mash', 1 => 'Blah!');
    +  
    +  # Retrieve value by position
    +  print $obj->bar(1);
    +  
    +  # Retrieve slice of values by position
    +  print join(', ', $obj->bar( [0, 2] ) );
    +  
    +  # Direct access to referenced array
    +  print scalar @{ $obj->bar() };
    +  
    +  # Reset the array contents to empty
    +  @{ $obj->bar() } = ();
    +
    +=cut
    +
    +sub array {
    +  my $class = shift;
    +  map { 
    +    my $name = $_;
    +    my $value = [];
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar(@_) == 1 ) {
    +	my $index = shift;
    +	ref($index) ? @{$value}[ @$index ] : $value->[ $index ];
    +      } elsif ( scalar(@_) % 2 ) {
    +	Carp::croak "Odd number of items in assigment to $name";
    +      } else {
    +	while ( scalar(@_) ) {
    +	  $value->[ shift() ] = shift();
    +	}
    +	return $value;
    +      }
    +    }
    +  } @_;
    +}
    +
    +########################################################################
    +
    +=head2 hash - Shared Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class method, or equivalently, on any object instance.
    +
    +=item *
    +
    +Stores a global value accessible only through this method.
    +
    +=item * 
    +
    +The value will be a reference to a hash (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the current hash-ref value (or undef).
    +
    +=item *
    +
    +If called with one argument, uses that argument as an index to retrieve from the referenced hash, and returns that value (or undef). If the single argument is an array ref, then a slice of the referenced hash is returned.
    +
    +=item *
    +
    +If called with a list of key-value pairs, stores the value under the given key in the referenced hash. If the value was previously undefined, a new hash is autovivified. The current value under each key will be overwritten, and later arguments with the same key will override earlier ones. Returns the current hash-ref value.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Basic::Hash (
    +    hash => 'baz',
    +  );
    +  ...
    +  
    +  # Set values by key
    +  $obj->baz('foo' => 'Foozle', 'bar' => 'Bang!');
    +  
    +  # Values may be overwritten, and in any order
    +  $obj->baz('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  
    +  # Retrieve value by key
    +  print $obj->baz('foo');
    +  
    +  # Retrieve slice of values by position
    +  print join(', ', $obj->baz( ['foo', 'bar'] ) );
    +  
    +  # Direct access to referenced hash
    +  print keys %{ $obj->baz() };
    +  
    +  # Reset the hash contents to empty
    +  @{ $obj->baz() } = ();
    +
    +=cut
    +
    +sub hash {
    +  my $class = shift;
    +  map { 
    +    my $name = $_;
    +    my $value = {};
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar(@_) == 1 ) {
    +	my $index = shift;
    +	ref($index) ? @{$value}{ @$index } : $value->{ $index };
    +      } elsif ( scalar(@_) % 2 ) {
    +	Carp::croak "Odd number of items in assigment to $name";
    +      } else {
    +	while ( scalar(@_) ) {
    +	  my $key = shift;
    +	  $value->{ $key } = shift();
    +	}
    +	$value;
    +      }
    +    }
    +  } @_;
    +}
    +
    +########################################################################
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +=cut
    +
    +1;
    diff --git a/lib/Class/MakeMethods/Basic/Hash.pm b/lib/Class/MakeMethods/Basic/Hash.pm
    new file mode 100644
    index 0000000..7a55106
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Basic/Hash.pm
    @@ -0,0 +1,362 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Basic::Hash - Basic hash methods
    +
    +
    +=head1 SYNOPSIS
    +
    +  package MyObject;
    +  use Class::MakeMethods::Basic::Hash (
    +    new => 'new',
    +    scalar => [ 'foo', 'bar' ],
    +    array => 'my_list',
    +    hash => 'my_index',
    +  );
    +  ...
    +  
    +  # Constructor
    +  my $obj = MyObject->new( foo => 'Foozle' );
    +  
    +  # Scalar Accessor
    +  print $obj->foo();
    +  
    +  $obj->bar('Barbados'); 
    +  print $obj->bar();
    +  
    +  # Array accessor
    +  $obj->my_list(0 => 'Foozle', 1 => 'Bang!');
    +  print $obj->my_list(1);
    +  
    +  # Hash accessor
    +  $obj->my_index('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  print $obj->my_index('foo');
    +
    +
    +=head1 DESCRIPTION
    +
    +The Basic::Hash subclass of MakeMethods provides a basic constructor and accessors for blessed-hash object instances.
    +
    +=head2 Calling Conventions
    +
    +When you C this package, the method names you provide
    +as arguments cause subroutines to be generated and installed in
    +your module.
    +
    +See L for a summary, or L for full details.
    +
    +=head2 Declaration Syntax
    +
    +To declare methods, pass in pairs of a method-type name followed
    +by one or more method names. Valid method-type names for this
    +package are listed in L<"METHOD GENERATOR TYPES">.
    +
    +See L for more
    +syntax information.
    +
    +
    +=cut
    +
    +package Class::MakeMethods::Basic::Hash;
    +
    +$VERSION = 1.000;
    +use strict;
    +use Class::MakeMethods '-isasubclass';
    +
    +########################################################################
    +
    +=head1 METHOD GENERATOR TYPES
    +
    +=head2 new - Constructor
    +
    +For each method name passed, returns a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +If called as a class method, makes a new hash and blesses it into that class.
    +
    +=item *
    +
    +If called on a hash-based instance, makes a copy of it and blesses the copy into the same class as the original instance.
    +
    +=item *
    +
    +If passed a list of key-value pairs, appends them to the new hash. These arguments override any copied values, and later arguments with the same name will override earlier ones.
    +
    +=item *
    +
    +Returns the new instance.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Basic::Hash (
    +    new => 'new',
    +  );
    +  ...
    +  
    +  # Bare constructor
    +  my $empty = MyObject->new();
    +  
    +  # Constructor with initial values
    +  my $obj = MyObject->new( foo => 'Foozle', bar => 'Barbados' );
    +  
    +  # Copy with overriding value
    +  my $copy = $obj->new( bar => 'Bob' );
    +
    +=cut
    +
    +sub new {
    +  my $class = shift;
    +  map { 
    +    my $name = $_;
    +    $name => sub {
    +      my $callee = shift;
    +      if ( ref $callee ) {
    +	bless { %$callee, @_ }, ref $callee;
    +      } else {
    +	bless { @_ }, $callee;
    +      }
    +    }
    +  } @_;
    +}
    +
    +########################################################################
    +
    +=head2 scalar - Instance Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on a hash-based instance.
    +
    +=item *
    +
    +Uses the method name as a hash key to access the related value for each instance.
    +
    +=item *
    +
    +If called without any arguments returns the current value.
    +
    +=item *
    +
    +If called with an argument, stores that as the value, and returns it, 
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Basic::Hash (
    +    scalar => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  $obj->foo('Foozle');
    +  
    +  # Retrieve value
    +  print $obj->foo;
    +
    +=cut
    +
    +sub scalar {
    +  my $class = shift;
    +  map { 
    +    my $name = $_;
    +    $name => sub {
    +      if ( scalar @_ > 1 ) {
    +	$_[0]->{$name} = $_[1];
    +      } else {
    +	$_[0]->{$name};
    +      }
    +    }
    +  } @_;
    +}
    +
    +########################################################################
    +
    +=head2 array - Instance Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on a hash-based instance.
    +
    +=item *
    +
    +Uses the method name as a hash key to access the related value for each instance.
    +
    +=item * 
    +
    +The value for each instance will be a reference to an array (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the current array-ref value (or undef).
    +
    +=item *
    +
    +If called with one argument, uses that argument as an index to retrieve from the referenced array, and returns that value (or undef). 
    +
    +=item *
    +
    +If called with a list of index-value pairs, stores the value at the given index in the referenced array. If the instance's value was previously undefined, a new array is autovivified. The current value in each position will be overwritten, and later arguments with the same index will override earlier ones. Returns the current array-ref value.
    +
    +=back
    +
    +Sample declaration and usage:
    +  
    +  package MyObject;
    +  use Class::MakeMethods::Basic::Hash (
    +    array => 'bar',
    +  );
    +  ...
    +  
    +  # Set values by position
    +  $obj->bar(0 => 'Foozle', 1 => 'Bang!');
    +  
    +  # Positions may be overwritten, and in any order
    +  $obj->bar(2 => 'And Mash', 1 => 'Blah!');
    +  
    +  # Retrieve value by position
    +  print $obj->bar(1);
    +    
    +  # Direct access to referenced array
    +  print scalar @{ $obj->bar() };
    +  
    +  # Reset the array contents to empty
    +  @{ $obj->bar() } = ();
    +
    +=cut
    +
    +sub array {
    +  my $class = shift;
    +  map { 
    +    my $name = $_;
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar(@_) == 0 ) {
    +	return $self->{$name};
    +      } elsif ( scalar(@_) == 1 ) {
    +	$self->{$name}->[ shift() ];
    +      } elsif ( scalar(@_) % 2 ) {
    +	Carp::croak "Odd number of items in assigment to $name";
    +      } else {
    +	while ( scalar(@_) ) {
    +	  my $key = shift();
    +	  $self->{$name}->[ $key ] = shift();
    +	}
    +	return $self->{$name};
    +      }
    +    }
    +  } @_;
    +}
    +
    +########################################################################
    +
    +=head2 hash - Instance Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on a hash-based instance.
    +
    +=item *
    +
    +Uses the method name as a hash key to access the related value for each instance.
    +
    +=item * 
    +
    +The value for each instance will be a reference to a hash (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the current hash-ref value (or undef).
    +
    +=item *
    +
    +If called with one argument, uses that argument as an index to retrieve from the referenced hash, and returns that value (or undef). 
    +
    +=item *
    +
    +If called with a list of key-value pairs, stores the value under the given key in the referenced hash. If the instance's value was previously undefined, a new hash is autovivified. The current value under each key will be overwritten, and later arguments with the same key will override earlier ones. Returns the current hash-ref value.
    +
    +=back
    +
    +Sample declaration and usage:
    +  
    +  package MyObject;
    +  use Class::MakeMethods::Basic::Hash (
    +    hash => 'baz',
    +  );
    +  ...
    +  
    +  # Set values by key
    +  $obj->baz('foo' => 'Foozle', 'bar' => 'Bang!');
    +  
    +  # Values may be overwritten, and in any order
    +  $obj->baz('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  
    +  # Retrieve value by key
    +  print $obj->baz('foo');
    +  
    +  # Direct access to referenced hash
    +  print keys %{ $obj->baz() };
    +  
    +  # Reset the hash contents to empty
    +  @{ $obj->baz() } = ();
    +
    +=cut
    +
    +sub hash {
    +  my $class = shift;
    +  map { 
    +    my $name = $_;
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar(@_) == 0 ) {
    +	return $self->{$name};
    +      } elsif ( scalar(@_) == 1 ) {
    +	$self->{$name}->{ shift() };
    +      } elsif ( scalar(@_) % 2 ) {
    +	Carp::croak "Odd number of items in assigment to $name";
    +      } else {
    +	while ( scalar(@_) ) {
    +	  $self->{$name}->{ shift() } = shift();
    +	}
    +	return $self->{$name};
    +      }
    +    }
    +  } @_;
    +}
    +
    +########################################################################
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +See L for equivalent functionality
    +based on blessed arrays. If all access to your object is through
    +constructors and accessors declared using this package, and your
    +class will not be extensively subclassed, consider switching to
    +Basic::Array to minimize resource consumption.
    +
    +=cut
    +
    +1;
    diff --git a/lib/Class/MakeMethods/Composite.pm b/lib/Class/MakeMethods/Composite.pm
    new file mode 100644
    index 0000000..902c235
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Composite.pm
    @@ -0,0 +1,218 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Composite - Make extensible compound methods
    +
    +
    +=head1 SYNOPSIS
    +
    +  package MyObject;
    +  use Class::MakeMethods::Composite::Hash (
    +    new => 'new',
    +    scalar => [ 'foo', 'bar' ],
    +    array => 'my_list',
    +    hash => 'my_index',
    +  );
    +
    +
    +=head1 DESCRIPTION
    +
    +This document describes the various subclasses of Class::MakeMethods
    +included under the Composite::* namespace, and the method types each
    +one provides.
    +
    +The Composite subclasses provide a parameterized set of method-generation
    +implementations.
    +
    +Subroutines are generated as closures bound to a hash containing
    +the method name and additional parameters, including the arrays of subroutine references that will provide the method's functionality.
    +
    +
    +=head2 Calling Conventions
    +
    +When you C this package, the method names you provide
    +as arguments cause subroutines to be generated and installed in
    +your module.
    +
    +See L for more information.
    +
    +=head2 Declaration Syntax
    +
    +To declare methods, pass in pairs of a method-type name followed
    +by one or more method names. 
    +
    +Valid method-type names for this package are listed in L<"METHOD
    +GENERATOR TYPES">.
    +
    +See L and L for more information.
    +
    +=cut
    +
    +package Class::MakeMethods::Composite;
    +
    +$VERSION = 1.000;
    +use strict;
    +use Class::MakeMethods '-isasubclass';
    +use Carp;
    +
    +########################################################################
    +
    +=head2 About Composite Methods
    +
    +The methods generated by Class::MakeMethods::Composite are assembled
    +from groups of "fragment" subroutines, each of which provides some
    +aspect of the method's behavior.
    +
    +You can add pre- and post- operations to any composite method.
    +
    +  package MyObject;
    +  use Class::MakeMethods::Composite::Hash (
    +    new => 'new',
    +    scalar => [ 
    +      'foo' => { 
    +	'pre_rules' => [ 
    +	  sub {
    +	    # Don't automatically convert list to array-ref
    +	    croak "Too many arguments" if ( scalar @_ > 2 );
    +	  }
    +	],
    +	'post_rules' => [ 
    +	  sub {
    +	    # Don't let anyone see my credit card number!
    +	    ${(pop)->{result}} =~ s/\d{13,16}/****/g;
    +	  }
    +	],
    +      }
    +    ],
    +  );
    +
    +=cut
    +
    +use vars qw( $Method );
    +
    +sub CurrentMethod {
    +  $Method;
    +}
    +
    +sub CurrentResults {
    +  my $package = shift;
    +  if ( ! scalar @_ ) {
    +    ( ! $Method->{result} ) 	          ? () :
    +    ( ref($Method->{result}) eq 'ARRAY' ) ? @{$Method->{result}} :  
    +					    ${$Method->{result}};
    +  } elsif ( scalar @_ == 1) {
    +    my $value = shift;
    +    $Method->{result} = \$value; 
    +    $value
    +  } else {
    +    my @value = @_;
    +    $Method->{result} = \@value;
    +    @value;
    +  }
    +}
    +
    +sub _build_composite {
    +  my $class = shift;
    +  my $fragments = shift;
    +  map { 
    +    my $method = $_;
    +    my @fragments = @{ $fragments->{''} };
    +    foreach my $flagname ( grep $method->{$_}, qw/ permit modifier / ) {
    +      my $value = $method->{$flagname};
    +      my $fragment = $fragments->{$value}
    +		or croak "Unsupported $flagname flag '$value'";
    +      push @fragments, @$fragment;
    +    }
    +    _bind_composite( $method, @fragments );
    +  } $class->_get_declarations(@_)
    +}
    +
    +sub _assemble_fragments {
    +  my $method = shift;
    +  my @fragments = @_;
    +  while ( scalar @fragments ) {
    +    my ($rule, $sub) = splice( @fragments, 0, 2 );
    +    if ( $rule =~ s/\A\+// ) {
    +      unshift @{$method->{"${rule}_rules"}}, $sub  
    +    } elsif ( $rule =~ s/\+\Z// ) {
    +      push @{$method->{"${rule}_rules"}}, $sub  
    +    } elsif ( $rule =~ /\A\w+\Z/ ) {
    +      @{$method->{"${rule}_rules"}} = $sub;
    +    } else { 	
    +      croak "Unsupported rule type '$rule'"
    +    }
    +  }
    +}
    +
    +sub _bind_composite {
    +  my $method = shift;
    +  _assemble_fragments( $method, @_ );
    +  if ( my $subs = $method->{"init_rules"} ) {
    +    foreach my $sub ( @$subs ) {
    +      &$sub( $method );
    +    }
    +  }
    +  $method->{name} => sub {
    +    local $Method = $method;
    +    local $Method->{args} = [ @_ ];
    +    local $Method->{result};    
    +    local $Method->{scratch};
    +    # Strange but true: you can local a hash-value in hash that's not 
    +    # a package variable. Confirmed in in 5.004, 5.005, 5.6.0.
    +
    +    local $Method->{wantarray} = wantarray;
    +
    +    if ( my $subs = $Method->{"pre_rules"} ) {
    +      foreach my $sub ( @$subs ) {
    +	&$sub( @{$Method->{args}}, $Method );
    +      }
    +    }
    +    
    +    my $subs = $Method->{"do_rules"} 
    +	or Carp::confess("No operations provided for $Method->{name}");
    +    if ( ! defined $Method->{wantarray} ) {
    +      foreach my $sub ( @$subs ) {
    +	last if $Method->{result};
    +	&$sub( @{$Method->{args}}, $Method );	
    +      }
    +    } elsif ( ! $Method->{wantarray} ) {
    +      foreach my $sub ( @$subs ) {
    +	last if $Method->{result};
    +	my $value = &$sub( @{$Method->{args}}, $Method );
    +	if ( defined $value ) { 
    +	  $Method->{result} = \$value;
    +	}
    +      }
    +    } else {
    +      foreach my $sub ( @$subs ) {
    +	last if $Method->{result};
    +	my @value = &$sub( @{$Method->{args}}, $Method );
    +	if ( scalar @value ) { 
    +	  $Method->{result} = \@value;
    +	}
    +      }
    +    }
    +    
    +    if ( my $subs = $Method->{"post_rules"} ) {
    +      foreach my $sub ( @$subs ) {
    +	&$sub( @{$Method->{args}}, $Method );
    +      }
    +    }
    +    
    +    ( ! $Method->{result} ) 	          ? () :
    +    ( ref($Method->{result}) eq 'ARRAY' ) ? @{$Method->{result}} :  
    +					    ${$Method->{result}};
    +  }
    +}
    +
    +########################################################################
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +For distribution, installation, support, copyright and license 
    +information, see L.
    +
    +=cut
    +
    +1;
    diff --git a/lib/Class/MakeMethods/Composite/Array.pm b/lib/Class/MakeMethods/Composite/Array.pm
    new file mode 100644
    index 0000000..fe04eba
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Composite/Array.pm
    @@ -0,0 +1,794 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Composite::Array - Basic array methods
    +
    +=head1 SYNOPSIS
    +
    +  package MyObject;
    +  use Class::MakeMethods::Composite::Array (
    +    new => 'new',
    +    scalar => [ 'foo', 'bar' ],
    +    array => 'my_list',
    +    hash => 'my_index',
    +  );
    +  ...
    +  
    +  my $obj = MyObject->new( foo => 'Foozle' );
    +  print $obj->foo();
    +  
    +  $obj->bar('Barbados');
    +  print $obj->bar();
    +  
    +  $obj->my_list(0 => 'Foozle', 1 => 'Bang!');
    +  print $obj->my_list(1);
    +  
    +  $obj->my_index('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  print $obj->my_index('foo');
    +
    +=head1 DESCRIPTION
    +
    +The Composite::Array suclass of MakeMethods provides a basic
    +constructor and accessors for blessed-array object instances.
    +
    +=head2 Class::MakeMethods Calling Conventions
    +
    +When you C this package, the method declarations you provide
    +as arguments cause subroutines to be generated and installed in
    +your module.
    +
    +You can also omit the arguments to C and instead make methods
    +at runtime by passing the declarations to a subsequent call to
    +C.
    +
    +You may include any number of declarations in each call to C
    +or C. If methods with the same name already exist, earlier
    +calls to C or C win over later ones, but within each
    +call, later declarations superceed earlier ones.
    +
    +You can install methods in a different package by passing C<-TargetClass =E I> as your first arguments to C or C. 
    +
    +See L for more details.
    +
    +=head2 Class::MakeMethods::Basic Declaration Syntax
    +
    +The following types of Basic declarations are supported:
    +
    +=over 4
    +
    +=item *
    +
    +I => "I"
    +
    +=item *
    +
    +I => "I I..."
    +
    +=item *
    +
    +I => [ "I", "I", ...]
    +
    +=back
    +
    +See the "METHOD GENERATOR TYPES" section below for a list of the supported values of I.
    +
    +For each method name you provide, a subroutine of the indicated
    +type will be generated and installed under that name in your module.
    +
    +Method names should start with a letter, followed by zero or more
    +letters, numbers, or underscores.
    +
    +=head2 Class::MakeMethods::Composite Declaration Syntax
    +
    +The Composite syntax also provides several ways to optionally
    +associate a hash of additional parameters with a given method
    +name. 
    +
    +=over 4
    +
    +=item *
    +
    +I => [ "I" => { I=>I... }, ... ]
    +
    +A hash of parameters to use just for this method name. 
    +
    +(Note: to prevent confusion with self-contained definition hashes,
    +described below, parameter hashes following a method name must not
    +contain the key 'name'.)
    +
    +=item *
    +
    +I => [ [ "I", "I", ... ] => { I=>I... } ]
    +
    +Each of these method names gets a copy of the same set of parameters.
    +
    +=item *
    +
    +I => [ { "name"=>"I", I=>I... }, ... ]
    +
    +By including the reserved parameter C, you create a self
    +contained declaration with that name and any associated hash values.
    +
    +=back
    +
    +Basic declarations, as described above, are treated as having an empty parameter hash.
    +
    +=cut
    +
    +package Class::MakeMethods::Composite::Array;
    +
    +$VERSION = 1.000;
    +use strict;
    +use Class::MakeMethods::Composite '-isasubclass';
    +
    +########################################################################
    +
    +=head2 Positional Accessors and %FIELDS
    +
    +Each accessor method is assigned the next available array index at
    +which to store its value.
    +
    +The mapping between method names and array positions is stored in
    +a hash named %FIELDS in the declaring package. When a package
    +declares its first positional accessor, its %FIELDS are initialized
    +by searching its inheritance tree.
    +
    +B: Subclassing packages that use positional accessors is
    +somewhat fragile, since you may end up with two distinct methods assigned to the same position. Specific cases to avoid are:
    +
    +=over 4
    +
    +=item *
    +
    +If you inherit from more than one class with positional accessors,
    +the positions used by the two sets of methods will overlap.
    +
    +=item *
    +
    +If your superclass adds additional positional accessors after you
    +declare your first, they will overlap yours.
    +
    +=back
    +
    +=cut
    +
    +sub _array_index {
    +  my $class = shift;
    +  my $name = shift;
    +  no strict;
    +  local $^W = 0;
    +  if ( ! scalar %{$class . "::FIELDS"} ) {
    +    my @classes = @{$class . "::ISA"};
    +    my @fields;
    +    while ( @classes ) {
    +      my $superclass = shift @classes;
    +      if ( scalar %{$superclass . "::FIELDS"} ) {
    +	push @fields, %{$superclass . "::FIELDS"};
    +      } else {
    +	unshift @classes, @{$superclass . "::ISA"}
    +      }
    +    }
    +    %{$class . "::FIELDS"} = @fields
    +  }
    +  my $field_hash = \%{$class . "::FIELDS"};
    +  $field_hash->{$name} or $field_hash->{$name} = scalar keys %$field_hash
    +}
    +
    +########################################################################
    +
    +=head1 METHOD GENERATOR TYPES
    +
    +=head2 new - Constructor
    +
    +For each method name passed, returns a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Has a reference to a sample item to copy. This defaults to a reference to an empty array, but you may override this with the C<'defaults' => I> method parameter. 
    +
    +=item *
    +
    +If called as a class method, makes a new array containing values from the sample item, and blesses it into that class.
    +
    +=item *
    +
    +If called on an array-based instance, makes a copy of it and blesses the copy into the same class as the original instance.
    +
    +=item *
    +
    +If passed a list of method-value pairs, calls each named method with the associated value as an argument. 
    +
    +=item *
    +
    +Returns the new instance.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Composite::Array (
    +    new => 'new',
    +  );
    +  ...
    +  
    +  # Bare constructor
    +  my $empty = MyObject->new();
    +  
    +  # Constructor with initial sequence of method calls
    +  my $obj = MyObject->new( foo => 'Foozle', bar => 'Barbados' );
    +  
    +  # Copy with overriding sequence of method calls
    +  my $copy = $obj->new( bar => 'Bob' );
    +
    +=cut
    +
    +use vars qw( %ConstructorFragments );
    +
    +sub new {
    +  (shift)->_build_composite( \%ConstructorFragments, @_ );
    +}
    +
    +%ConstructorFragments = (
    +  '' => [
    +    '+init' => sub {
    +	my $method = pop @_;
    +	$method->{target_class} ||= $Class::MethodMaker::CONTEXT{TargetClass};
    +	$method->{defaults} ||= [];
    +      },
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $obj = ref($self) ? bless( [ @$self ], ref $self ) 
    +			     : bless( { @[$method->{defaults}] }, $self );
    +	@_ = %{$_[0]} 
    +		if ( scalar @_ == 1 and ref $_[0] eq 'HASH' );
    +	while ( scalar @_ ) {
    +	  my $method = shift @_;
    +	  $obj->$method( shift @_ );
    +	}
    +	$obj;
    +      },
    +  ],
    +  'with_values' => [
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	@_ = @[$_[0]] 
    +		if ( scalar @_ == 1 and ref $_[0] eq 'ARRAY' );
    +	bless( [ @_ ], ref($self) || $self );
    +      }
    +  ],
    +);
    +
    +########################################################################
    +
    +=head2 new_with_values - Constructor
    +
    +For each method name passed, returns a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class method, or (equivalently) on any existing object of that class. 
    +
    +=item *
    +
    +Creates an array, blesses it into the class, and returns the new instance.
    +
    +=item *
    +
    +If no arguments are provided, the returned array will be empty. If passed a single array-ref argument, copies its contents into the new array. If called with multiple arguments, copies them into the new array. (Note that this is a "shallow" copy, not a "deep" clone.)
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Composite::Array (
    +    new => 'new',
    +  );
    +  ...
    +  
    +  # Bare constructor
    +  my $empty = MyObject->new();
    +  
    +  # Constructor with initial sequence of method calls
    +  my $obj = MyObject->new( foo => 'Foozle', bar => 'Barbados' );
    +  
    +  # Copy with overriding sequence of method calls
    +  my $copy = $obj->new( bar => 'Bob' );
    +
    +=cut
    +
    +########################################################################
    +
    +=head2 scalar - Instance Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on an array-based instance.
    +
    +=item *
    +
    +Determines the array position associated with the method name, and uses that as an index into each instance to access the related value. This defaults to the next available slot in %FIELDS, but you may override this with the C<'array_index' => I> method parameter, or by pre-filling the contents of %FIELDS. 
    +
    +=item *
    +
    +If called without any arguments returns the current value (or undef).
    +
    +=item *
    +
    +If called with an argument, stores that as the value, and returns it, 
    +
    +=item * 
    +
    +If called with multiple arguments, stores a reference to a new array with those arguments as contents, and returns that array reference.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Composite::Array (
    +    scalar => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  $obj->foo('Foozle');
    +  
    +  # Retrieve value
    +  print $obj->foo;
    +
    +=cut
    +
    +use vars qw( %ScalarFragments );
    +
    +sub scalar {
    +  (shift)->_build_composite( \%ScalarFragments, @_ );
    +}
    +
    +%ScalarFragments = (
    +  '' => [
    +    '+init' => sub {
    +	my ($method) = @_;
    +	$method->{target_class} ||= $Class::MethodMaker::CONTEXT{TargetClass};
    +	$method->{array_index} ||= 
    +		_array_index( $method->{target_class}, $name );
    +      },
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	if ( scalar(@_) == 0 ) {
    +	  $self->[$method->{array_index}];
    +	} elsif ( scalar(@_) == 1 ) {
    +	  $self->[$method->{array_index}] = shift;
    +	} else {
    +	  $self->[$method->{array_index}] = [@_];
    +	}
    +      },
    +  ],
    +  'rw' => [],
    +  'p' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	unless ( UNIVERSAL::isa((caller(1))[0], $method->{target_class}) ) {
    +	  croak "Method $method->{name} is protected";
    +	}
    +      },
    +  ],
    +  'pp' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	unless ( (caller(1))[0] eq $method->{target_class} ) {
    +	  croak "Method $method->{name} is private";
    +	}
    +      },
    +  ],
    +  'pw' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	unless ( @$args == 0 or UNIVERSAL::isa((caller(1))[0], $method->{target_class}) ) {
    +	  croak "Method $method->{name} is write-protected";
    +	}
    +      },
    +  ],
    +  'ppw' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	unless ( @$args == 0 or (caller(1))[0] eq $method->{target_class} ) {
    +	  croak "Method $method->{name} is write-private";
    +	}
    +      },
    +  ],
    +  'r' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	@$args = ();
    +      },
    +  ],
    +  'ro' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	unless ( @$args == 0 ) {
    +	  croak("Method $method->{name} is read-only");
    +	}
    +      },
    +  ],
    +  'wo' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	if ( @$args == 0 ) {
    +	  croak("Method $method->{name} is write-only");
    +	}
    +      },
    +  ],
    +  'return_original' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	$method->{scratch}{return_original} = $self->[$method->{array_index}];
    +      },
    +    '+post' => sub { 
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	$method->{result} = \{ $method->{scratch}{return_original} };
    +      },
    +  ],
    +);
    +
    +########################################################################
    +
    +=head2 array - Instance Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on an array-based instance.
    +
    +=item *
    +
    +Determines the array position associated with the method name, and uses that as an index into each instance to access the related value. This defaults to the next available slot in %FIELDS, but you may override this with the C<'array_index' => I> method parameter, or by pre-filling the contents of %FIELDS. 
    +
    +=item * 
    +
    +The value for each instance will be a reference to an array (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the current array-ref value (or undef).
    +
    +=item *
    +
    +If called with a single non-ref argument, uses that argument as an index to retrieve from the referenced array, and returns that value (or undef).
    +
    +=item *
    +
    +If called with a single array ref argument, uses that list to return a slice of the referenced array.
    +
    +=item *
    +
    +If called with a list of argument pairs, each with a non-ref index and an associated value, stores the value at the given index in the referenced array. If the instance's value was previously undefined, a new array is autovivified. The current value in each position will be overwritten, and later arguments with the same index will override earlier ones. Returns the current array-ref value.
    +
    +=item *
    +
    +If called with a list of argument pairs, each with the first item being a reference to an array of up to two numbers, loops over each pair and uses those numbers to splice the value array. 
    +
    +The first controlling number is the position at which the splice will begin. Zero will start before the first item in the list. Negative numbers count backwards from the end of the array. 
    +
    +The second number is the number of items to be removed from the list. If it is omitted, or undefined, or zero, no items are removed. If it is a positive integer, that many items will be returned.
    +
    +If both numbers are omitted, or are both undefined, they default to containing the entire value array.
    +
    +If the second argument is undef, no values will be inserted; if it is a non-reference value, that one value will be inserted; if it is an array-ref, its values will be copied.
    +
    +The method returns the items that removed from the array, if any.
    +
    +=back
    +
    +Sample declaration and usage:
    +  
    +  package MyObject;
    +  use Class::MakeMethods::Composite::Array (
    +    array => 'bar',
    +  );
    +  ...
    +  
    +  # Clear and set contents of list
    +  print $obj->bar([ 'Spume', 'Frost' ] );  
    +  
    +  # Set values by position
    +  $obj->bar(0 => 'Foozle', 1 => 'Bang!');
    +  
    +  # Positions may be overwritten, and in any order
    +  $obj->bar(2 => 'And Mash', 1 => 'Blah!');
    +  
    +  # Retrieve value by position
    +  print $obj->bar(1);
    +  
    +  # Direct access to referenced array
    +  print scalar @{ $obj->bar() };
    +
    +There are also calling conventions for slice and splice operations:
    +
    +  # Retrieve slice of values by position
    +  print join(', ', $obj->bar( undef, [0, 2] ) );
    +  
    +  # Insert an item at position in the array
    +  $obj->bar([3], 'Potatoes' );  
    +  
    +  # Remove 1 item from position 3 in the array
    +  $obj->bar([3, 1], undef );  
    +  
    +  # Set a new value at position 2, and return the old value 
    +  print $obj->bar([2, 1], 'Froth' );
    +
    +=cut
    +
    +
    +use vars qw( %ArrayFragments );
    +
    +sub array {
    +  (shift)->_build_composite( \%ArrayFragments, @_ );
    +}
    +
    +%ArrayFragments = (
    +  '' => [
    +    '+init' => sub {
    +	my ($method) = @_;
    +	$method->{target_class} ||= $Class::MethodMaker::CONTEXT{TargetClass};
    +	$method->{array_index} ||= 
    +		_array_index( $method->{target_class}, $name );
    +      },
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	if ( scalar(@$args) == 0 ) {
    +	  if ( $method->{auto_init} and 
    +			! defined $self->[$method->{array_index}] ) {
    +	    $self->[$method->{array_index}] = [];
    +	  }
    +	  wantarray ? @{ $self->[$method->{array_index}] } : $self->[$method->{array_index}];
    +	} elsif ( scalar(@_) == 1 and ref $_[0] eq 'ARRAY' ) {
    +	  $self->[$method->{array_index}] = [ @{ $_[0] } ];
    +	  wantarray ? @{ $self->[$method->{array_index}] } : $self->[$method->{array_index}];
    +	} else {
    +	  $self->[$method->{array_index}] ||= [];
    +	  Class::MakeMethods::Composite::__array_ops( 
    +		$self->[$method->{array_index}], @$args );
    +	}
    +      },
    +  ],
    +);
    +
    +########################################################################
    +
    +=head2 hash - Instance Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on an array-based instance.
    +
    +=item *
    +
    +Determines the array position associated with the method name, and uses that as an index into each instance to access the related value. This defaults to the next available slot in %FIELDS, but you may override this with the C<'array_index' => I> method parameter, or by pre-filling the contents of %FIELDS. 
    +
    +=item * 
    +
    +The value for each instance will be a reference to a hash (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the contents of the hash in list context, or a hash reference in scalar context (or undef).
    +
    +=item *
    +
    +If called with one non-ref argument, uses that argument as an index to retrieve from the referenced hash, and returns that value (or undef).
    +
    +=item *
    +
    +If called with one array-ref argument, uses the contents of that array to retrieve a slice of the referenced hash.
    +
    +=item *
    +
    +If called with one hash-ref argument, sets the contents of the referenced hash to match that provided.
    +
    +=item *
    +
    +If called with a list of key-value pairs, stores the value under the given key in the referenced hash. If the instance's value was previously undefined, a new hash is autovivified. The current value under each key will be overwritten, and later arguments with the same key will override earlier ones. Returns the contents of the hash in list context, or a hash reference in scalar context.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Composite::Array (
    +    hash => 'baz',
    +  );
    +  ...
    +  
    +  # Set values by key
    +  $obj->baz('foo' => 'Foozle', 'bar' => 'Bang!');
    +  
    +  # Values may be overwritten, and in any order
    +  $obj->baz('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  
    +  # Retrieve value by key
    +  print $obj->baz('foo');
    +  
    +  # Retrive slice of values by position
    +  print join(', ', $obj->baz( ['foo', 'bar'] ) );
    +  
    +  # Direct access to referenced hash
    +  print keys %{ $obj->baz() };
    +  
    +  # Reset the hash contents to empty
    +  @{ $obj->baz() } = ();
    +
    +=cut
    +
    +
    +use vars qw( %HashFragments );
    +
    +sub hash {
    +  (shift)->_build_composite( \%HashFragments, @_ );
    +}
    +
    +%HashFragments = (
    +  '' => [
    +    '+init' => sub {
    +	my ($method) = @_;
    +	$method->{hash_key} ||= $_->{name};
    +      },
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	if ( scalar(@$args) == 0 ) {
    +	  if ( $method->{auto_init} and ! defined $self->[$method->{array_index}] ) {
    +	    $self->[$method->{array_index}] = {};
    +	  }
    +	  wantarray ? %{ $self->[$method->{array_index}] } : $self->[$method->{array_index}];
    +	} elsif ( scalar(@$args) == 1 ) {
    +	  if ( ref($_[0]) eq 'HASH' ) {
    +	    %{$self->[$method->{array_index}]} = %{$_[0]};
    +	  } elsif ( ref($_[0]) eq 'ARRAY' ) {
    +	    return @{$self->[$method->{array_index}]}{ @{$_[0]} }
    +	  } else {
    +	    return $self->[$method->{array_index}]->{ $_[0] }
    +	  }
    +	} elsif ( scalar(@$args) % 2 ) {
    +	  croak "Odd number of items in assigment to $method->{name}";
    +	} else {
    +	  while ( scalar(@$args) ) {
    +	    my $key = shift @$args;
    +	    $self->[$method->{array_index}]->{ $key} = shift @$args;
    +	  }
    +	  wantarray ? %{ $self->[$method->{array_index}] } : $self->[$method->{array_index}];
    +	}
    +      },
    +  ],
    +);
    +
    +########################################################################
    +
    +=head2 object - Instance Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on an array-based instance.
    +
    +=item *
    +
    +Determines the array position associated with the method name, and uses that as an index into each instance to access the related value. This defaults to the next available slot in %FIELDS, but you may override this with the C<'array_index' => I> method parameter, or by pre-filling the contents of %FIELDS. 
    +
    +=item * 
    +
    +The value for each instance will be a reference to an object (or undef).
    +
    +=item *
    +
    +If called without any arguments returns the current value.
    +
    +=item *
    +
    +If called with an argument, stores that as the value, and returns it, 
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Composite::Hash (
    +    object => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  $obj->foo( Foozle->new() );
    +  
    +  # Retrieve value
    +  print $obj->foo;
    +
    +=cut
    +
    +use vars qw( %ObjectFragments );
    +
    +sub object {
    +  (shift)->_build_composite( \%ObjectFragments, @_ );
    +}
    +
    +%ObjectFragments = (
    +  '' => [
    +    '+init' => sub {
    +	my ($method) = @_;
    +	$method->{hash_key} ||= $_->{name};
    +      },
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift;
    +	if ( scalar @_ ) {
    +	  my $value = shift;
    +	  if ( $method->{class} and ! UNIVERSAL::isa( $value, $method->{class} ) ) {
    +	    croak "Wrong argument type ('$value') in assigment to $method->{name}";
    +	  }
    +	  $self->[$method->{array_index}] = $value;
    +	} else {
    +	  if ( $method->{auto_init} and ! defined $self->[$method->{array_index}] ) {
    +	    my $class = $method->{class} 
    +				or die "Can't auto_init without a class";
    +	    my $new_method = $method->{new_method} || 'new';
    +	    $self->[$method->{array_index}] = $class->$new_method();
    +	  }
    +	  $self->[$method->{array_index}];
    +	}
    +      },
    +  ],
    +);
    +
    +########################################################################
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +=cut
    +
    +1;
    diff --git a/lib/Class/MakeMethods/Composite/Global.pm b/lib/Class/MakeMethods/Composite/Global.pm
    new file mode 100644
    index 0000000..cf9af0b
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Composite/Global.pm
    @@ -0,0 +1,588 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Composite::Global - Global data
    +
    +=head1 SYNOPSIS
    +
    +  package MyClass;
    +  use Class::MakeMethods::Composite::Global (
    +    scalar => [ 'foo' ],
    +    array  => [ 'my_list' ],
    +    hash   => [ 'my_index' ],
    +  );
    +  ...
    +  
    +  MyClass->foo( 'Foozle' );
    +  print MyClass->foo();
    +
    +  print MyClass->new(...)->foo(); # same value for any instance
    +  print MySubclass->foo();        # ... and for any subclass
    +  
    +  MyClass->my_list(0 => 'Foozle', 1 => 'Bang!');
    +  print MyClass->my_list(1);
    +  
    +  MyClass->my_index('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  print MyClass->my_index('foo');
    +
    +
    +=head1 DESCRIPTION
    +
    +The Composite::Global suclass of MakeMethods provides basic accessors for shared data.
    +
    +=head2 Class::MakeMethods Calling Interface
    +
    +When you C this package, the method declarations you provide
    +as arguments cause subroutines to be generated and installed in
    +your module.
    +
    +You can also omit the arguments to C and instead make methods
    +at runtime by passing the declarations to a subsequent call to
    +C.
    +
    +You may include any number of declarations in each call to C
    +or C. If methods with the same name already exist, earlier
    +calls to C or C win over later ones, but within each
    +call, later declarations superceed earlier ones.
    +
    +You can install methods in a different package by passing C<-TargetClass =E I> as your first arguments to C or C. 
    +
    +See L for more details.
    +
    +=head2 Class::MakeMethods::Basic Declaration Syntax
    +
    +The following types of Basic declarations are supported:
    +
    +=over 4
    +
    +=item *
    +
    +I => "I"
    +
    +=item *
    +
    +I => "I I..."
    +
    +=item *
    +
    +I => [ "I", "I", ...]
    +
    +=back
    +
    +See the "METHOD GENERATOR TYPES" section below for a list of the supported values of I.
    +
    +For each method name you provide, a subroutine of the indicated
    +type will be generated and installed under that name in your module.
    +
    +Method names should start with a letter, followed by zero or more
    +letters, numbers, or underscores.
    +
    +=head2 Class::MakeMethods::Composite Declaration Syntax
    +
    +The Composite syntax also provides several ways to optionally
    +associate a hash of additional parameters with a given method
    +name. 
    +
    +=over 4
    +
    +=item *
    +
    +I => [ "I" => { I=>I... }, ... ]
    +
    +A hash of parameters to use just for this method name. 
    +
    +(Note: to prevent confusion with self-contained definition hashes,
    +described below, parameter hashes following a method name must not
    +contain the key 'name'.)
    +
    +=item *
    +
    +I => [ [ "I", "I", ... ] => { I=>I... } ]
    +
    +Each of these method names gets a copy of the same set of parameters.
    +
    +=item *
    +
    +I => [ { "name"=>"I", I=>I... }, ... ]
    +
    +By including the reserved parameter C, you create a self-contained declaration with that name and any associated hash values.
    +
    +=back
    +
    +Basic declarations, as described above, are given an empty parameter hash.
    +
    +=cut
    +
    +package Class::MakeMethods::Composite::Global;
    +
    +$VERSION = 1.000;
    +use strict;
    +use Class::MakeMethods::Composite '-isasubclass';
    +
    +########################################################################
    +
    +=head1 METHOD GENERATOR TYPES
    +
    +=head2 scalar - Global Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class method, or on any instance or subclass, and behaves identically regardless of what it was called on.
    +
    +=item *
    +
    +If called without any arguments returns the current value.
    +
    +=item *
    +
    +If called with an argument, stores that as the value, and returns it, 
    +
    +=item * 
    +
    +If called with multiple arguments, stores a reference to a new array with those arguments as contents, and returns that array reference.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyClass;
    +  use Class::MakeMethods::Composite::Global (
    +    scalar => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  MyClass->foo('Foozle');
    +  
    +  # Retrieve value
    +  print MyClass->foo;
    +
    +=cut
    +
    +use vars qw( %ScalarFragments );
    +
    +sub scalar {
    +  (shift)->_build_composite( \%ScalarFragments, @_ );
    +}
    +
    +%ScalarFragments = (
    +  '' => [
    +    '+init' => sub {
    +	my ($method) = @_;
    +	$method->{target_class} ||= $Class::MethodMaker::CONTEXT{TargetClass};
    +	$method->{array_index} ||= 
    +		_array_index( $method->{target_class}, $name );
    +      },
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	if ( scalar(@_) == 0 ) {
    +	  $method->{global_data};
    +	} elsif ( scalar(@_) == 1 ) {
    +	  $method->{global_data} = shift;
    +	} else {
    +	  $method->{global_data} = [@_];
    +	}
    +      },
    +  ],
    +  'rw' => [],
    +  'p' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	unless ( UNIVERSAL::isa((caller(1))[0], $method->{target_class}) ) {
    +	  croak "Method $method->{name} is protected";
    +	}
    +      },
    +  ],
    +  'pp' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	unless ( (caller(1))[0] eq $method->{target_class} ) {
    +	  croak "Method $method->{name} is private";
    +	}
    +      },
    +  ],
    +  'pw' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	unless ( @$args == 0 or UNIVERSAL::isa((caller(1))[0], $method->{target_class}) ) {
    +	  croak "Method $method->{name} is write-protected";
    +	}
    +      },
    +  ],
    +  'ppw' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	unless ( @$args == 0 or (caller(1))[0] eq $method->{target_class} ) {
    +	  croak "Method $method->{name} is write-private";
    +	}
    +      },
    +  ],
    +  'r' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	@{$method->{args}} = ($self) if ( scalar @_ );
    +      },
    +  ],
    +  'ro' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	unless ( @$args == 0 ) {
    +	  croak("Method $method->{name} is read-only");
    +	}
    +      },
    +  ],
    +  'wo' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	if ( @$args == 0 ) {
    +	  croak("Method $method->{name} is write-only");
    +	}
    +      },
    +  ],
    +  'return_original' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	$method->{scratch}{return_original} = $method->{global_data};
    +      },
    +    '+post' => sub { 
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	$method->{result} = \{ $method->{scratch}{return_original} };
    +      },
    +  ],
    +);
    +
    +########################################################################
    +
    +=head2 array - Global Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class method, or on any instance or subclass, and behaves identically regardless of what it was called on.
    +
    +=item * 
    +
    +The global value will be a reference to an array (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the current array-ref value (or undef).
    +
    +
    +=item *
    +
    +If called with a single non-ref argument, uses that argument as an index to retrieve from the referenced array, and returns that value (or undef).
    +
    +=item *
    +
    +If called with a single array ref argument, uses that list to return a slice of the referenced array.
    +
    +=item *
    +
    +If called with a list of argument pairs, each with a non-ref index and an associated value, stores the value at the given index in the referenced array. If the global value was previously undefined, a new array is autovivified. The current value in each position will be overwritten, and later arguments with the same index will override earlier ones. Returns the current array-ref value.
    +
    +=item *
    +
    +If called with a list of argument pairs, each with the first item being a reference to an array of up to two numbers, loops over each pair and uses those numbers to splice the value array. 
    +
    +The first controlling number is the position at which the splice will begin. Zero will start before the first item in the list. Negative numbers count backwards from the end of the array. 
    +
    +The second number is the number of items to be removed from the list. If it is omitted, or undefined, or zero, no items are removed. If it is a positive integer, that many items will be returned.
    +
    +If both numbers are omitted, or are both undefined, they default to containing the entire value array.
    +
    +If the second argument is undef, no values will be inserted; if it is a non-reference value, that one value will be inserted; if it is an array-ref, its values will be copied.
    +
    +The method returns the items that removed from the array, if any.
    +
    +=back
    +
    +Sample declaration and usage:
    +  
    +  package MyClass;
    +  use Class::MakeMethods::Composite::Global (
    +    array => 'bar',
    +  );
    +  ...
    +  
    +  # Clear and set contents of list
    +  print MyClass->bar([ 'Spume', 'Frost' ] );  
    +  
    +  # Set values by position
    +  MyClass->bar(0 => 'Foozle', 1 => 'Bang!');
    +  
    +  # Positions may be overwritten, and in any order
    +  MyClass->bar(2 => 'And Mash', 1 => 'Blah!');
    +  
    +  # Retrieve value by position
    +  print MyClass->bar(1);
    +  
    +  # Direct access to referenced array
    +  print scalar @{ MyClass->bar() };
    +
    +There are also calling conventions for slice and splice operations:
    +
    +  # Retrieve slice of values by position
    +  print join(', ', MyClass->bar( undef, [0, 2] ) );
    +  
    +  # Insert an item at position in the array
    +  MyClass->bar([3], 'Potatoes' );  
    +  
    +  # Remove 1 item from position 3 in the array
    +  MyClass->bar([3, 1], undef );  
    +  
    +  # Set a new value at position 2, and return the old value 
    +  print MyClass->bar([2, 1], 'Froth' );
    +
    +=cut
    +
    +
    +use vars qw( %ArrayFragments );
    +
    +sub array {
    +  (shift)->_build_composite( \%ArrayFragments, @_ );
    +}
    +
    +%ArrayFragments = (
    +  '' => [
    +    '+init' => sub {
    +	my ($method) = @_;
    +	$method->{hash_key} ||= $_->{name};
    +      },
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	if ( scalar(@$args) == 0 ) {
    +	  if ( $method->{auto_init} and 
    +			! defined $method->{global_data} ) {
    +	    $method->{global_data} = [];
    +	  }
    +	  wantarray ? @{ $method->{global_data} } : $method->{global_data}
    +	} elsif ( scalar(@_) == 1 and ref $_[0] eq 'ARRAY' ) {
    +	  $method->{global_data} = [ @{ $_[0] } ];
    +	  wantarray ? @{ $method->{global_data} } : $method->{global_data}
    +	} else {
    +	  $method->{global_data} ||= [];
    +	  Class::MakeMethods::Composite::__array_ops( 
    +		$method->{global_data}, @$args );
    +	}
    +      },
    +  ],
    +);
    +
    +########################################################################
    +
    +=head2 hash - Global Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class method, or on any instance or subclass, and behaves identically regardless of what it was called on.
    +
    +=item * 
    +
    +The global value will be a reference to a hash (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the contents of the hash in list context, or a hash reference in scalar context (or undef).
    +
    +=item *
    +
    +If called with one non-ref argument, uses that argument as an index to retrieve from the referenced hash, and returns that value (or undef).
    +
    +=item *
    +
    +If called with one array-ref argument, uses the contents of that array to retrieve a slice of the referenced hash.
    +
    +=item *
    +
    +If called with one hash-ref argument, sets the contents of the referenced hash to match that provided.
    +
    +=item *
    +
    +If called with a list of key-value pairs, stores the value under the given key in the referenced hash. If the global value was previously undefined, a new hash is autovivified. The current value under each key will be overwritten, and later arguments with the same key will override earlier ones. Returns the contents of the hash in list context, or a hash reference in scalar context.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyClass;
    +  use Class::MakeMethods::Composite::Global (
    +    hash => 'baz',
    +  );
    +  ...
    +  
    +  # Set values by key
    +  MyClass->baz('foo' => 'Foozle', 'bar' => 'Bang!');
    +  
    +  # Values may be overwritten, and in any order
    +  MyClass->baz('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  
    +  # Retrieve value by key
    +  print MyClass->baz('foo');
    +  
    +  # Retrive slice of values by position
    +  print join(', ', MyClass->baz( ['foo', 'bar'] ) );
    +  
    +  # Direct access to referenced hash
    +  print keys %{ MyClass->baz() };
    +  
    +  # Reset the hash contents to empty
    +  @{ MyClass->baz() } = ();
    +
    +=cut
    +
    +use vars qw( %HashFragments );
    +
    +sub hash {
    +  (shift)->_build_composite( \%HashFragments, @_ );
    +}
    +
    +%HashFragments = (
    +  '' => [
    +    '+init' => sub {
    +	my ($method) = @_;
    +	$method->{hash_key} ||= $_->{name};
    +      },
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	if ( scalar(@$args) == 0 ) {
    +	  if ( $method->{auto_init} and ! defined $method->{global_data} ) {
    +	    $method->{global_data} = {};
    +	  }
    +	  wantarray ? %{ $method->{global_data} } : $method->{global_data};
    +	} elsif ( scalar(@$args) == 1 ) {
    +	  if ( ref($_[0]) eq 'HASH' ) {
    +	    %{$method->{global_data}} = %{$_[0]};
    +	  } elsif ( ref($_[0]) eq 'ARRAY' ) {
    +	    return @{$method->{global_data}}{ @{$_[0]} }
    +	  } else {
    +	    return $method->{global_data}->{ $_[0] }
    +	  }
    +	} elsif ( scalar(@$args) % 2 ) {
    +	  croak "Odd number of items in assigment to $method->{name}";
    +	} else {
    +	  while ( scalar(@$args) ) {
    +	    my $key = shift @$args;
    +	    $method->{global_data}->{ $key} = shift @$args;
    +	  }
    +	  wantarray ? %{ $method->{global_data} } : $method->{global_data};
    +	}
    +      },
    +  ],
    +);
    +
    +########################################################################
    +
    +=head2 object - Global Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class method, or on any instance or subclass, and behaves identically regardless of what it was called on.
    +
    +=item * 
    +
    +The global value will be a reference to an object (or undef).
    +
    +=item *
    +
    +If called without any arguments returns the current value.
    +
    +=item *
    +
    +If called with an argument, stores that as the value, and returns it, 
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyClass;
    +  use Class::MakeMethods::Composite::Global (
    +    object => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  MyClass->foo( Foozle->new() );
    +  
    +  # Retrieve value
    +  print MyClass->foo;
    +
    +=cut
    +
    +use vars qw( %ObjectFragments );
    +
    +sub object {
    +  (shift)->_build_composite( \%ObjectFragments, @_ );
    +}
    +
    +%ObjectFragments = (
    +  '' => [
    +    '+init' => sub {
    +	my ($method) = @_;
    +	$method->{hash_key} ||= $_->{name};
    +      },
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift;
    +	if ( scalar @_ ) {
    +	  my $value = shift;
    +	  if ( $method->{class} and ! UNIVERSAL::isa( $value, $method->{class} ) ) {
    +	    croak "Wrong argument type ('$value') in assigment to $method->{name}";
    +	  }
    +	  $method->{global_data} = $value;
    +	} else {
    +	  if ( $method->{auto_init} and ! defined $method->{global_data} ) {
    +	    my $class = $method->{class} 
    +				or die "Can't auto_init without a class";
    +	    my $new_method = $method->{new_method} || 'new';
    +	    $method->{global_data} = $class->$new_method();
    +	  }
    +	  $method->{global_data};
    +	}
    +      },
    +  ],
    +);
    +
    +########################################################################
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +=cut
    +
    +1;
    diff --git a/lib/Class/MakeMethods/Composite/Hash.pm b/lib/Class/MakeMethods/Composite/Hash.pm
    new file mode 100644
    index 0000000..969bdd0
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Composite/Hash.pm
    @@ -0,0 +1,719 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Composite::Hash - Composite hash methods
    +
    +=head1 SYNOPSIS
    +
    +  package MyObject;
    +  use Class::MakeMethods::Composite::Hash (
    +    new => 'new',
    +    scalar => [ 'foo', 'bar' ],
    +    array => 'my_list',
    +    hash => 'my_index',
    +  );
    +  ...
    +  
    +  my $obj = MyObject->new( foo => 'Foozle' );
    +  print $obj->foo();
    +  
    +  $obj->bar('Barbados'); 
    +  print $obj->bar();
    +  
    +  $obj->my_list(0 => 'Foozle', 1 => 'Bang!');
    +  print $obj->my_list(1);
    +  
    +  $obj->my_index('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  print $obj->my_index('foo');
    +
    +=head1 DESCRIPTION
    +
    +The Composite::Hash suclass of MakeMethods provides a basic constructor and accessors for blessed-hash object instances.
    +
    +=head2 Class::MakeMethods Calling Interface
    +
    +When you C this package, the method declarations you provide
    +as arguments cause subroutines to be generated and installed in
    +your module.
    +
    +You can also omit the arguments to C and instead make methods
    +at runtime by passing the declarations to a subsequent call to
    +C.
    +
    +You may include any number of declarations in each call to C
    +or C. If methods with the same name already exist, earlier
    +calls to C or C win over later ones, but within each
    +call, later declarations superceed earlier ones.
    +
    +You can install methods in a different package by passing C<-TargetClass =E I> as your first arguments to C or C. 
    +
    +See L for more details.
    +
    +=head2 Class::MakeMethods::Basic Declaration Syntax
    +
    +The following types of Basic declarations are supported:
    +
    +=over 4
    +
    +=item *
    +
    +I => "I"
    +
    +=item *
    +
    +I => "I I..."
    +
    +=item *
    +
    +I => [ "I", "I", ...]
    +
    +=back
    +
    +See the "METHOD GENERATOR TYPES" section below for a list of the supported values of I.
    +
    +For each method name you provide, a subroutine of the indicated
    +type will be generated and installed under that name in your module.
    +
    +Method names should start with a letter, followed by zero or more
    +letters, numbers, or underscores.
    +
    +=head2 Class::MakeMethods::Composite Declaration Syntax
    +
    +The Composite syntax also provides several ways to optionally
    +associate a hash of additional parameters with a given method
    +name. 
    +
    +=over 4
    +
    +=item *
    +
    +I => [ "I" => { I=>I... }, ... ]
    +
    +A hash of parameters to use just for this method name. 
    +
    +(Note: to prevent confusion with self-contained definition hashes,
    +described below, parameter hashes following a method name must not
    +contain the key 'name'.)
    +
    +=item *
    +
    +I => [ [ "I", "I", ... ] => { I=>I... } ]
    +
    +Each of these method names gets a copy of the same set of parameters.
    +
    +=item *
    +
    +I => [ { "name"=>"I", I=>I... }, ... ]
    +
    +By including the reserved parameter C, you create a self-contained declaration with that name and any associated hash values.
    +
    +=back
    +
    +Basic declarations, as described above, are given an empty parameter hash.
    +
    +=cut
    +
    +package Class::MakeMethods::Composite::Hash;
    +
    +$VERSION = 1.000;
    +use strict;
    +use Class::MakeMethods::Composite '-isasubclass';
    +use Carp;
    +
    +########################################################################
    +
    +=head1 METHOD GENERATOR TYPES
    +
    +=head2 new - Constructor
    +
    +For each method name passed, returns a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Has a reference to a sample item to copy. This defaults to a reference to an empty hash, but you may override this with the C<'defaults' =E I>  method parameter. 
    +
    +=item *
    +
    +If called as a class method, makes a new hash and blesses it into that class.
    +
    +=item *
    +
    +If called on a hash-based instance, makes a copy of it and blesses the copy into the same class as the original instance.
    +
    +=item *
    +
    +If passed a list of key-value pairs, appends them to the new hash. These arguments override any copied values, and later arguments with the same name will override earlier ones.
    +
    +=item *
    +
    +Returns the new instance.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Composite::Hash (
    +    new => 'new',
    +  );
    +  ...
    +  
    +  # Bare constructor
    +  my $empty = MyObject->new();
    +  
    +  # Constructor with initial values
    +  my $obj = MyObject->new( foo => 'Foozle', bar => 'Barbados' );
    +  
    +  # Copy with overriding value
    +  my $copy = $obj->new( bar => 'Bob' );
    +
    +=cut
    +
    +=head2 new --with_values - Constructor
    +
    +For each method name passed, returns a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class method, or (equivalently) on any existing object of that class. 
    +
    +=item *
    +
    +Creates a hash, blesses it into the class, and returns the new instance.
    +
    +=item *
    +
    +If no arguments are provided, the returned hash will be empty. If passed a single hash-ref argument, copies its contents into the new hash. If called with multiple arguments, treats them as key-value pairs, and copies them into the new hash. (Note that this is a "shallow" copy, not a "deep" clone.)
    +
    +=back
    +
    +=cut
    +
    +use vars qw( %ConstructorFragments );
    +
    +sub new {
    +  (shift)->_build_composite( \%ConstructorFragments, @_ );
    +}
    +
    +%ConstructorFragments = (
    +  '' => [
    +    '+init' => sub {
    +	my $method = pop @_;
    +	$method->{target_class} ||= $Class::MethodMaker::CONTEXT{TargetClass};
    +	$method->{defaults} ||= {};
    +      },
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $obj = ref($self) ? bless( { %$self }, ref $self ) 
    +			     : bless( { %{$method->{defaults}} }, $self );
    +	@_ = %{$_[0]} 
    +		if ( scalar @_ == 1 and ref $_[0] eq 'HASH' );
    +	while ( scalar @_ ) {
    +	  my $method = shift @_;
    +	  my $value = shift @_;
    +	  $obj->$method( $value );
    +	}
    +	$obj;
    +      },
    +  ],
    +  'with_values' => [
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	@_ = %{$_[0]} 
    +		if ( scalar @_ == 1 and ref $_[0] eq 'HASH' );
    +	bless( { @_ }, ref($self) || $self );
    +      }
    +  ],
    +);
    +
    +########################################################################
    +
    +=head2 scalar - Instance Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on a hash-based instance.
    +
    +=item *
    +
    +Has a specific hash key to use to access the related value for each instance.
    +This defaults to the method name, but you may override this with the C<'hash_key' => I> method parameter. 
    +
    +=item *
    +
    +If called without any arguments returns the current value.
    +
    +=item *
    +
    +If called with an argument, stores that as the value, and returns it.
    +
    +=item * 
    +
    +If called with multiple arguments, stores a reference to a new array with those arguments as contents, and returns that array reference.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Composite::Hash (
    +    scalar => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  $obj->foo('Foozle');
    +  
    +  # Retrieve value
    +  print $obj->foo;
    +
    +=cut
    +
    +use vars qw( %ScalarFragments );
    +
    +sub scalar {
    +  (shift)->_build_composite( \%ScalarFragments, @_ );
    +}
    +
    +%ScalarFragments = (
    +  '' => [
    +    '+init' => sub {
    +	my ($method) = @_;
    +	$method->{hash_key} ||= $method->{name};
    +	$method->{target_class} ||= $Class::MethodMaker::CONTEXT{TargetClass};
    +      },
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	if ( scalar(@_) == 0 ) {
    +	  $self->{$method->{hash_key}};
    +	} elsif ( scalar(@_) == 1 ) {
    +	  $self->{$method->{hash_key}} = shift;
    +	} else {
    +	  $self->{$method->{hash_key}} = [@_];
    +	}
    +      },
    +  ],
    +  'rw' => [],
    +  'p' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	unless ( UNIVERSAL::isa((caller(1))[0], $method->{target_class}) ) {
    +	  croak "Method $method->{name} is protected";
    +	}
    +      },
    +  ],
    +  'pp' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	unless ( (caller(1))[0] eq $method->{target_class} ) {
    +	  croak "Method $method->{name} is private";
    +	}
    +      },
    +  ],
    +  'pw' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	unless ( @$args == 0 or UNIVERSAL::isa((caller(1))[0], $method->{target_class}) ) {
    +	  croak "Method $method->{name} is write-protected";
    +	}
    +      },
    +  ],
    +  'ppw' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	unless ( @$args == 0 or (caller(1))[0] eq $method->{target_class} ) {
    +	  croak "Method $method->{name} is write-private";
    +	}
    +      },
    +  ],
    +  'r' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	@$args = ();
    +      },
    +  ],
    +  'ro' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	unless ( @$args == 0 ) {
    +	  croak("Method $method->{name} is read-only");
    +	}
    +      },
    +  ],
    +  'wo' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	if ( @$args == 0 ) {
    +	  croak("Method $method->{name} is write-only");
    +	}
    +      },
    +  ],
    +  'return_original' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	$method->{scratch}{return_original} = $self->{$method->{hash_key}};
    +      },
    +    '+post' => sub { 
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	${ $method->{result} } = $method->{scratch}{return_original};
    +      },
    +  ],
    +);
    +
    +########################################################################
    +
    +=head2 array - Instance Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on a hash-based instance.
    +
    +=item *
    +
    +Has a specific hash key to use to access the related value for each instance.
    +This defaults to the method name, but you may override this with the C<'hash_key' => I> method parameter. 
    +
    +=item * 
    +
    +The value for each instance will be a reference to an array (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the current array-ref value (or undef).
    +
    +
    +=item *
    +
    +If called with a single non-ref argument, uses that argument as an index to retrieve from the referenced array, and returns that value (or undef).
    +
    +=item *
    +
    +If called with a single array ref argument, uses that list to return a slice of the referenced array.
    +
    +=item *
    +
    +If called with a list of argument pairs, each with a non-ref index and an associated value, stores the value at the given index in the referenced array. If the instance's value was previously undefined, a new array is autovivified. The current value in each position will be overwritten, and later arguments with the same index will override earlier ones. Returns the current array-ref value.
    +
    +=item *
    +
    +If called with a list of argument pairs, each with the first item being a reference to an array of up to two numbers, loops over each pair and uses those numbers to splice the value array. 
    +
    +The first controlling number is the position at which the splice will begin. Zero will start before the first item in the list. Negative numbers count backwards from the end of the array. 
    +
    +The second number is the number of items to be removed from the list. If it is omitted, or undefined, or zero, no items are removed. If it is a positive integer, that many items will be returned.
    +
    +If both numbers are omitted, or are both undefined, they default to containing the entire value array.
    +
    +If the second argument is undef, no values will be inserted; if it is a non-reference value, that one value will be inserted; if it is an array-ref, its values will be copied.
    +
    +The method returns the items that removed from the array, if any.
    +
    +=back
    +
    +Sample declaration and usage:
    +  
    +  package MyObject;
    +  use Class::MakeMethods::Composite::Hash (
    +    array => 'bar',
    +  );
    +  ...
    +  
    +  # Clear and set contents of list
    +  print $obj->bar([ 'Spume', 'Frost' ] );  
    +  
    +  # Set values by position
    +  $obj->bar(0 => 'Foozle', 1 => 'Bang!');
    +  
    +  # Positions may be overwritten, and in any order
    +  $obj->bar(2 => 'And Mash', 1 => 'Blah!');
    +  
    +  # Retrieve value by position
    +  print $obj->bar(1);
    +  
    +  # Direct access to referenced array
    +  print scalar @{ $obj->bar() };
    +
    +There are also calling conventions for slice and splice operations:
    +
    +  # Retrieve slice of values by position
    +  print join(', ', $obj->bar( undef, [0, 2] ) );
    +  
    +  # Insert an item at position in the array
    +  $obj->bar([3], 'Potatoes' );  
    +  
    +  # Remove 1 item from position 3 in the array
    +  $obj->bar([3, 1], undef );  
    +  
    +  # Set a new value at position 2, and return the old value 
    +  print $obj->bar([2, 1], 'Froth' );
    +
    +=cut
    +
    +use vars qw( %ArrayFragments );
    +
    +sub array {
    +  (shift)->_build_composite( \%ArrayFragments, @_ );
    +}
    +
    +%ArrayFragments = (
    +  '' => [
    +    '+init' => sub {
    +	my ($method) = @_;
    +	$method->{hash_key} ||= $_->{name};
    +      },
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	if ( scalar(@$args) == 0 ) {
    +	  if ( $method->{auto_init} and 
    +			! defined $self->{$method->{hash_key}} ) {
    +	    $self->{$method->{hash_key}} = [];
    +	  }
    +	  wantarray ? @{ $self->{$method->{hash_key}} } : $self->{$method->{hash_key}};
    +	} elsif ( scalar(@_) == 1 and ref $_[0] eq 'ARRAY' ) {
    +	  $self->{$method->{hash_key}} = [ @{ $_[0] } ];
    +	  wantarray ? @{ $self->{$method->{hash_key}} } : $self->{$method->{hash_key}};
    +	} else {
    +	  $self->{$method->{hash_key}} ||= [];
    +	  array_splicer( $self->{$method->{hash_key}}, @$args );
    +	}
    +      },
    +  ],
    +);
    +
    +########################################################################
    +
    +=head2 hash - Instance Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on a hash-based instance.
    +
    +=item *
    +
    +Has a specific hash key to use to access the related value for each instance.
    +This defaults to the method name, but you may override this with the C<'hash_key' => I> method parameter. 
    +
    +=item * 
    +
    +The value for each instance will be a reference to a hash (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the contents of the hash in list context, or a hash reference in scalar context (or undef).
    +
    +=item *
    +
    +If called with one non-ref argument, uses that argument as an index to retrieve from the referenced hash, and returns that value (or undef).
    +
    +=item *
    +
    +If called with one array-ref argument, uses the contents of that array to retrieve a slice of the referenced hash.
    +
    +=item *
    +
    +If called with one hash-ref argument, sets the contents of the referenced hash to match that provided.
    +
    +=item *
    +
    +If called with a list of key-value pairs, stores the value under the given key in the referenced hash. If the instance's value was previously undefined, a new hash is autovivified. The current value under each key will be overwritten, and later arguments with the same key will override earlier ones. Returns the contents of the hash in list context, or a hash reference in scalar context.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Composite::Hash (
    +    hash => 'baz',
    +  );
    +  ...
    +  
    +  # Set values by key
    +  $obj->baz('foo' => 'Foozle', 'bar' => 'Bang!');
    +  
    +  # Values may be overwritten, and in any order
    +  $obj->baz('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  
    +  # Retrieve value by key
    +  print $obj->baz('foo');
    +  
    +  # Retrive slice of values by position
    +  print join(', ', $obj->baz( ['foo', 'bar'] ) );
    +  
    +  # Direct access to referenced hash
    +  print keys %{ $obj->baz() };
    +  
    +  # Reset the hash contents to empty
    +  @{ $obj->baz() } = ();
    +
    +=cut
    +
    +use vars qw( %HashFragments );
    +
    +sub hash {
    +  (shift)->_build_composite( \%HashFragments, @_ );
    +}
    +
    +%HashFragments = (
    +  '' => [
    +    '+init' => sub {
    +	my ($method) = @_;
    +	$method->{hash_key} ||= $_->{name};
    +      },
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $args = \@_;
    +	if ( scalar(@$args) == 0 ) {
    +	  if ( $method->{auto_init} and ! defined $self->{$method->{hash_key}} ) {
    +	    $self->{$method->{hash_key}} = {};
    +	  }
    +	  wantarray ? %{ $self->{$method->{hash_key}} } : $self->{$method->{hash_key}};
    +	} elsif ( scalar(@$args) == 1 ) {
    +	  if ( ref($_[0]) eq 'HASH' ) {
    +	    %{$self->{$method->{hash_key}}} = %{$_[0]};
    +	  } elsif ( ref($_[0]) eq 'ARRAY' ) {
    +	    return @{$self->{$method->{hash_key}}}{ @{$_[0]} }
    +	  } else {
    +	    return $self->{$method->{hash_key}}->{ $_[0] }
    +	  }
    +	} elsif ( scalar(@$args) % 2 ) {
    +	  croak "Odd number of items in assigment to $method->{name}";
    +	} else {
    +	  while ( scalar(@$args) ) {
    +	    my $key = shift @$args;
    +	    $self->{$method->{hash_key}}->{ $key} = shift @$args;
    +	  }
    +	  wantarray ? %{ $self->{$method->{hash_key}} } : $self->{$method->{hash_key}};
    +	}
    +      },
    +  ],
    +);
    +
    +########################################################################
    +
    +=head2 object - Instance Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on a hash-based instance.
    +
    +=item *
    +
    +Has a specific hash key to use to access the related value for each instance.
    +This defaults to the method name, but you may override this with the C<'hash_key' => I> method parameter. 
    +
    +=item * 
    +
    +The value for each instance will be a reference to an object (or undef).
    +
    +=item *
    +
    +If called without any arguments returns the current value.
    +
    +=item *
    +
    +If called with an argument, stores that as the value, and returns it, 
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Composite::Hash (
    +    object => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  $obj->foo( Foozle->new() );
    +  
    +  # Retrieve value
    +  print $obj->foo;
    +
    +=cut
    +
    +use vars qw( %ObjectFragments );
    +
    +sub object {
    +  (shift)->_build_composite( \%ObjectFragments, @_ );
    +}
    +
    +%ObjectFragments = (
    +  '' => [
    +    '+init' => sub {
    +	my ($method) = @_;
    +	$method->{hash_key} ||= $_->{name};
    +      },
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift;
    +	if ( scalar @_ ) {
    +	  my $value = shift;
    +	  if ( $method->{class} and ! UNIVERSAL::isa( $value, $method->{class} ) ) {
    +	    croak "Wrong argument type ('$value') in assigment to $method->{name}";
    +	  }
    +	  $self->{$method->{hash_key}} = $value;
    +	} else {
    +	  if ( $method->{auto_init} and ! defined $self->{$method->{hash_key}} ) {
    +	    my $class = $method->{class} 
    +				or die "Can't auto_init without a class";
    +	    my $new_method = $method->{new_method} || 'new';
    +	    $self->{$method->{hash_key}} = $class->$new_method();
    +	  }
    +	  $self->{$method->{hash_key}};
    +	}
    +      },
    +  ],
    +);
    +
    +########################################################################
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +=cut
    +
    +1;
    diff --git a/lib/Class/MakeMethods/Composite/Inheritable.pm b/lib/Class/MakeMethods/Composite/Inheritable.pm
    new file mode 100644
    index 0000000..ca4be3e
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Composite/Inheritable.pm
    @@ -0,0 +1,613 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Composite::Inheritable - Overridable data
    +
    +=head1 SYNOPSIS
    +
    +  package MyClass;
    +
    +  use Class::MakeMethods( 'Composite::Inheritable:scalar' => 'foo' );
    +  # We now have an accessor method for an "inheritable" scalar value
    +  
    +  MyClass->foo( 'Foozle' );   # Set a class-wide value
    +  print MyClass->foo();	      # Retrieve class-wide value
    +  
    +  my $obj = MyClass->new(...);
    +  print $obj->foo();          # All instances "inherit" that value...
    +  
    +  $obj->foo( 'Foible' );      # until you set a value for an instance.
    +  print $obj->foo();          # This now finds object-specific value.
    +  ...
    +  
    +  package MySubClass;
    +  @ISA = 'MyClass';
    +  
    +  print MySubClass->foo();    # Intially same as superclass,
    +  MySubClass->foo('Foobar');  # but overridable per subclass,
    +  print $subclass_obj->foo(); # and shared by its instances
    +  $subclass_obj->foo('Fosil');# until you override them... 
    +  ...
    +  
    +  # Similar behaviour for hashes and arrays is currently incomplete
    +  package MyClass;
    +  use Class::MakeMethods::Composite::Inheritable (
    +    array => 'my_list',
    +    hash => 'my_index',
    +  );
    +  
    +  MyClass->my_list(0 => 'Foozle', 1 => 'Bang!');
    +  print MyClass->my_list(1);
    +  
    +  MyClass->my_index('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  print MyClass->my_index('foo');
    +
    +
    +=head1 DESCRIPTION
    +
    +The MakeMethods subclass provides accessor methods that search an inheritance tree to find a value. This allows you to set a shared or default value for a given class, optionally override it in a subclass, and then optionally override it on a per-instance basis. 
    +
    +Note that all MakeMethods methods are inheritable, in the sense that they work as expected for subclasses. These methods are different in that the I accessed by each method can be inherited or overridden in each subclass or instance. See L< Class::MakeMethods::Utility::Inheritable> for more about this type of "inheritable" or overridable" data.
    +
    +
    +=head2 Class::MakeMethods Calling Interface
    +
    +When you C this package, the method declarations you provide
    +as arguments cause subroutines to be generated and installed in
    +your module.
    +
    +See L for more information.
    +
    +=head2 Class::MakeMethods::Standard Declaration Syntax
    +
    +To declare methods, pass in pairs of a method-type name followed
    +by one or more method names. 
    +
    +See the "METHOD GENERATOR TYPES" section below for a list of the supported values of I.
    +
    +See L and L for more information.
    +
    +=cut
    +
    +package Class::MakeMethods::Composite::Inheritable;
    +
    +$VERSION = 1.000;
    +use strict;
    +use Carp;
    +
    +use Class::MakeMethods::Composite '-isasubclass';
    +use Class::MakeMethods::Utility::Inheritable qw(get_vvalue set_vvalue find_vself );
    +
    +########################################################################
    +
    +=head1 METHOD GENERATOR TYPES
    +
    +=head2 scalar - Overrideable Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class or instance method, on the declaring class or any subclass. 
    +
    +=item *
    +
    +If called without any arguments returns the current value for the callee. If the callee has not had a value defined for this method, searches up from instance to class, and from class to superclass, until a callee with a value is located.
    +
    +=item *
    +
    +If called with an argument, stores that as the value associated with the callee, whether instance or class, and returns it, 
    +
    +=item * 
    +
    +If called with multiple arguments, stores a reference to a new array with those arguments as contents, and returns that array reference.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyClass;
    +  use Class::MakeMethods::Composite::Inheritable (
    +    scalar => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  MyClass->foo('Foozle');
    +  
    +  # Retrieve value
    +  print MyClass->foo;
    +
    +=cut
    +
    +use vars qw( %ScalarFragments );
    +
    +sub scalar {
    +  (shift)->_build_composite( \%ScalarFragments, @_ );
    +}
    +
    +%ScalarFragments = (
    +  '' => [
    +    '+init' => sub {
    +	my ($method) = @_;
    +	$method->{target_class} ||= $Class::MethodMaker::CONTEXT{TargetClass};
    +	$method->{data} ||= {};
    +      },
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;	
    +	if ( scalar(@_) == 0 ) {
    +	  return get_vvalue($method->{data}, $self);
    +	} else {
    +	  my $value = (@_ == 1 ? $_[0] : [@_]);
    +	  set_vvalue($method->{data}, $self, $value);
    +	}
    +      },
    +  ],
    +  'rw' => [],
    +  'p' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	unless ( UNIVERSAL::isa((caller(1))[0], $method->{target_class}) ) {
    +	  croak "Method $method->{name} is protected";
    +	}
    +      },
    +  ],
    +  'pp' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	unless ( (caller(1))[0] eq $method->{target_class} ) {
    +	  croak "Method $method->{name} is private";
    +	}
    +      },
    +  ],
    +  'pw' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	unless ( @_ == 0 or UNIVERSAL::isa((caller(1))[0], $method->{target_class}) ) {
    +	  croak "Method $method->{name} is write-protected";
    +	}
    +      },
    +  ],
    +  'ppw' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	unless ( @_ == 0 or (caller(1))[0] eq $method->{target_class} ) {
    +	  croak "Method $method->{name} is write-private";
    +	}
    +      },
    +  ],
    +  'r' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	@{ $method->{args} } = ();
    +      },
    +  ],
    +  'ro' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	unless ( @_ == 0 ) {
    +	  croak("Method $method->{name} is read-only");
    +	}
    +      },
    +  ],
    +  'wo' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	if ( @_ == 0 ) {
    +	  croak("Method $method->{name} is write-only");
    +	}
    +      },
    +  ],
    +  'return_original' => [ 
    +    '+pre' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	my $v_self = find_vself($method->{data}, $self);
    +	$method->{scratch}{return_original} = 
    +					$v_self ? $method->{data}{$v_self} : ();
    +      },
    +    '+post' => sub { 
    +	my $method = pop @_;
    +	$method->{result} = \{ $method->{scratch}{return_original} };
    +      },
    +  ],
    +);
    +
    +########################################################################
    +
    +=head2 array - Overrideable Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class method, or on any instance or subclass, Must be called on a hash-based instance.
    +
    +=item * 
    +
    +The class value will be a reference to an array (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the current array-ref value (or undef).
    +
    +
    +=item *
    +
    +If called with a single non-ref argument, uses that argument as an index to retrieve from the referenced array, and returns that value (or undef).
    +
    +=item *
    +
    +If called with a single array ref argument, uses that list to return a slice of the referenced array.
    +
    +=item *
    +
    +If called with a list of argument pairs, each with a non-ref index and an associated value, stores the value at the given index in the referenced array. If the class value was previously undefined, a new array is autovivified. The current value in each position will be overwritten, and later arguments with the same index will override earlier ones. Returns the current array-ref value.
    +
    +=item *
    +
    +If called with a list of argument pairs, each with the first item being a reference to an array of up to two numbers, loops over each pair and uses those numbers to splice the value array. 
    +
    +The first controlling number is the position at which the splice will begin. Zero will start before the first item in the list. Negative numbers count backwards from the end of the array. 
    +
    +The second number is the number of items to be removed from the list. If it is omitted, or undefined, or zero, no items are removed. If it is a positive integer, that many items will be returned.
    +
    +If both numbers are omitted, or are both undefined, they default to containing the entire value array.
    +
    +If the second argument is undef, no values will be inserted; if it is a non-reference value, that one value will be inserted; if it is an array-ref, its values will be copied.
    +
    +The method returns the items that removed from the array, if any.
    +
    +=back
    +
    +Sample declaration and usage:
    +  
    +  package MyClass;
    +  use Class::MakeMethods::Composite::Inheritable (
    +    array => 'bar',
    +  );
    +  ...
    +  
    +  # Clear and set contents of list
    +  print MyClass->bar([ 'Spume', 'Frost' ] );  
    +  
    +  # Set values by position
    +  MyClass->bar(0 => 'Foozle', 1 => 'Bang!');
    +  
    +  # Positions may be overwritten, and in any order
    +  MyClass->bar(2 => 'And Mash', 1 => 'Blah!');
    +  
    +  # Retrieve value by position
    +  print MyClass->bar(1);
    +  
    +  # Direct access to referenced array
    +  print scalar @{ MyClass->bar() };
    +
    +There are also calling conventions for slice and splice operations:
    +
    +  # Retrieve slice of values by position
    +  print join(', ', MyClass->bar( undef, [0, 2] ) );
    +  
    +  # Insert an item at position in the array
    +  MyClass->bar([3], 'Potatoes' );  
    +  
    +  # Remove 1 item from position 3 in the array
    +  MyClass->bar([3, 1], undef );  
    +  
    +  # Set a new value at position 2, and return the old value 
    +  print MyClass->bar([2, 1], 'Froth' );
    +
    +B 
    +
    +=cut
    +
    +use vars qw( %ArrayFragments );
    +
    +sub array {
    +  (shift)->_build_composite( \%ArrayFragments, @_ );
    +}
    +
    +%ArrayFragments = (
    +  '' => [
    +    '+init' => sub {
    +	my ($method) = @_;
    +	$method->{hash_key} ||= $_->{name};
    +	$method->{data} ||= {};
    +      },
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	
    +	if ( scalar(@_) == 0 ) {
    +	  my $v_self = find_vself($method->{data}, $self);
    +	  my $value = $v_self ? $method->{data}{$v_self} : ();
    +	  if ( $method->{auto_init} and ! $value ) {
    +	    $value = $method->{data}{$self} = [];
    +	  }
    +	  ( ! $value ) ? () : wantarray ? @$value : $value;
    +	  
    +	} elsif ( scalar(@_) == 1 and ref $_[0] eq 'ARRAY' ) {
    +	  $method->{data}{$self} = [ @{ $_[0] } ];
    +	  wantarray ? @{ $method->{data}{$self} } : $method->{data}{$self}
    +	  
    +	} else {
    +	  if ( ! exists $method->{data}{$self} ) {
    +	    my $v_self = find_vself($method->{data}, $self);
    +	    $method->{data}{$self} = [ $v_self ? @{$method->{data}{$v_self}} : () ];
    +	  }
    +	  return array_splicer( $method->{data}{$self}, @_ );
    +	}
    +      },
    +  ],
    +);
    +
    +########################################################################
    +
    +=head2 hash - Overrideable Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class method, or on any instance or subclass, Must be called on a hash-based instance.
    +
    +=item * 
    +
    +The class value will be a reference to a hash (or undef).
    +
    +=item *
    +
    +If called without any arguments returns the contents of the hash in list context, or a hash reference in scalar context for the callee. If the callee has not had a value defined for this method, searches up from instance to class, and from class to superclass, until a callee with a value is located.
    +
    +=item *
    +
    +If called with one non-ref argument, uses that argument as an index to retrieve from the referenced hash, and returns that value (or undef). If the callee has not had a value defined for this method, searches up from instance to class, and from class to superclass, until a callee with a value is located. 
    +
    +=item *
    +
    +If called with one array-ref argument, uses the contents of that array to retrieve a slice of the referenced hash. If the callee has not had a value defined for this method, searches up from instance to class, and from class to superclass, until a callee with a value is located. 
    +
    +=item *
    +
    +If called with one hash-ref argument, sets the contents of the referenced hash to match that provided.
    +
    +=item *
    +
    +If called with a list of key-value pairs, stores the value under the given key in the hash associated with the callee, whether instance or class. If the callee did not previously have a hash-ref value associated with it, searches up instance to class, and from class to superclass, until a callee with a value is located, and copies that hash before making the assignments. The current value under each key will be overwritten, and later arguments with the same key will override earlier ones. Returns the contents of the hash in list context, or a hash reference in scalar context.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyClass;
    +  use Class::MakeMethods::Composite::Inheritable (
    +    hash => 'baz',
    +  );
    +  ...
    +  
    +  # Set values by key
    +  MyClass->baz('foo' => 'Foozle', 'bar' => 'Bang!');
    +  
    +  # Values may be overwritten, and in any order
    +  MyClass->baz('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  
    +  # Retrieve value by key
    +  print MyClass->baz('foo');
    +  
    +  # Retrive slice of values by position
    +  print join(', ', MyClass->baz( ['foo', 'bar'] ) );
    +  
    +  # Direct access to referenced hash
    +  print keys %{ MyClass->baz() };
    +  
    +  # Reset the hash contents to empty
    +  @{ MyClass->baz() } = ();
    +
    +B 
    +
    +=cut
    +
    +use vars qw( %HashFragments );
    +
    +sub hash {
    +  (shift)->_build_composite( \%HashFragments, @_ );
    +}
    +
    +%HashFragments = (
    +  '' => [
    +    '+init' => sub {
    +	my ($method) = @_;
    +	$method->{hash_key} ||= $_->{name};
    +	$method->{data} ||= {};
    +      },
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	
    +	if ( scalar(@_) == 0 ) {
    +	  my $value = get_vvalue($method->{data}, $self);
    +	  if ( $method->{auto_init} and ! $value ) {
    +	    $value = set_vvalue( $method->{data}, $self, {} );
    +	  }
    +	  wantarray ? %$value : $value;
    +	} elsif ( scalar(@_) == 1 ) {
    +	  if ( ref($_[0]) eq 'HASH' ) {
    +	    %{$method->{data}{$self}} = %{$_[0]};
    +	  } elsif ( ref($_[0]) eq 'ARRAY' ) {
    +	    my $v_self = find_vself($method->{data}, $self) or return;
    +	    return @{ $method->{data}{$v_self} }{ @{$_[0]} }
    +	  } else {
    +	    my $v_self = find_vself($method->{data}, $self) or return;
    +	    return $method->{data}{$v_self}{ $_[0] }
    +	  }
    +
    +	} elsif ( scalar(@_) % 2 ) {
    +	  Carp::croak "Odd number of items in assigment to $method->{name}";
    +	} else {
    +	  if ( ! exists $method->{data}{$self} ) {
    +	    my $v_self = find_vself($method->{data}, $self);
    +	    $method->{data}{$self} = { $v_self ? %{ $method->{data}{$v_self} } : () };
    +	  }
    +	  while ( scalar(@_) ) {
    +	    my $key = shift();
    +	    $method->{data}{$self}->{ $key } = shift();
    +	  }
    +	  wantarray ? %{$method->{data}{$self}} : $method->{data}{$self};
    +	}
    +      },
    +  ],
    +);
    +
    +########################################################################
    +
    +=head2 hook - Overrideable array of subroutines
    +
    +A hook method is called from the outside as a normal method. However, internally, it contains an array of subroutine references, each of which are called in turn to produce the method's results.
    +
    +Subroutines may be added to the hook's array by calling it with a blessed subroutine reference, as shown below. Subroutines may be added on a class-wide basis or on an individual object. 
    +
    +You might want to use this type of method to provide an easy way for callbacks to be registered.
    +
    +  package MyClass;
    +  use Class::MakeMethods::Composite::Inheritable ( 'hook' => 'init' );
    +  
    +  MyClass->init( Class::MakeMethods::Composite::Inheritable->Hook( sub { 
    +      my $callee = shift;
    +      warn "Init...";
    +  } );
    +  
    +  my $obj = MyClass->new;
    +  $obj->init();
    +
    +=cut
    +
    +use vars qw( %HookFragments );
    +
    +sub hook {
    +  (shift)->_build_composite( \%HookFragments, @_ );
    +}
    +
    +%HookFragments = (
    +  '' => [
    +    '+init' => sub {
    +	my ($method) = @_;
    +	$method->{data} ||= {};
    +      },
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $self = shift @_;
    +	
    +	if ( scalar(@_) and 
    +	    ref($_[0]) eq 'Class::MakeMethods::Composite::Inheritable::Hook' ) {
    +	  if ( ! exists $method->{data}{$self} ) {
    +	    my $v_self = find_vself($method->{data}, $self);
    +	    $method->{data}{$self} = [ $v_self ? @{ $method->{data}{$v_self} } : () ];
    +	  }
    +	  push @{ $method->{data}{$self} }, map $$_, @_;
    +	} else {
    +	  my $v_self = find_vself($method->{data}, $self);
    +	  my $subs = $v_self ? $method->{data}{$v_self} : ();
    +	  my @subs = ( ( ! $subs ) ? () : @$subs );
    +	  
    +	  if ( ! defined $method->{wantarray} ) {
    +	    foreach my $sub ( @subs ) {
    +	      &$sub( @{$method->{args}} );	
    +	    }
    +	  } elsif ( ! $method->{wantarray} ) {
    +	    foreach my $sub ( @subs ) {
    +	      my $value = &$sub( @{$method->{args}} );
    +	      if ( defined $value ) { 
    +		$method->{result} = \$value;
    +	      }
    +	    }
    +	  } else {
    +	    foreach my $sub ( @subs ) {
    +	      my @value = &$sub( @{$method->{args}} );
    +	      if ( scalar @value ) { 
    +		push @{ $method->{result} }, @value;
    +	      }
    +	    }
    +	  }
    +	  
    +	}
    +	return Class::MakeMethods::Composite->CurrentResults();
    +      },
    +  ],
    +);
    +
    +sub Hook (&) { 
    +  my $package = shift;
    +  my $sub = shift;
    +  bless \$sub, 'Class::MakeMethods::Composite::Inheritable::Hook';
    +}
    +
    +########################################################################
    +
    +=head2 object - Overrideable Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class method, or on any instance or subclass, Must be called on a hash-based instance.
    +
    +=item * 
    +
    +The class value will be a reference to an object (or undef).
    +
    +=item *
    +
    +If called without any arguments returns the current value for the callee. If the callee has not had a value defined for this method, searches up from instance to class, and from class to superclass, until a callee with a value is located.
    +
    +=item *
    +
    +If called with an argument, stores that as the value associated with the callee, whether instance or class, and returns it, 
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyClass;
    +  use Class::MakeMethods::Composite::Inheritable (
    +    object => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  MyClass->foo( Foozle->new() );
    +  
    +  # Retrieve value
    +  print MyClass->foo;
    +
    +B 
    +
    +=cut
    +
    +sub object { } 
    +
    +########################################################################
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +=cut
    +
    +1;
    diff --git a/lib/Class/MakeMethods/Composite/Universal.pm b/lib/Class/MakeMethods/Composite/Universal.pm
    new file mode 100644
    index 0000000..e53e76d
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Composite/Universal.pm
    @@ -0,0 +1,150 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Composite::Universal - Composite Method Tricks
    +
    +=head1 SYNOPSIS
    +
    +  Class::MakeMethods::Composite::Universal->make_patch(
    +    -TargetClass => 'SomeClass::OverYonder',
    +    name => 'foo',
    +    pre_rules => [ 
    +      sub { 
    +	my $method = pop; 
    +	warn "Arguments for foo:", @_ 
    +      } 
    +    ]
    +    post_rules => [ 
    +      sub { 
    +	warn "Result of foo:", Class::MakeMethods::Composite->CurrentResults 
    +      } 
    +    ]
    +  );
    +
    +=head1 DESCRIPTION
    +
    +The Composite::Universal suclass of MakeMethods provides some generally-applicable types of methods based on Class::MakeMethods::Composite.
    +
    +=cut
    +
    +package Class::MakeMethods::Composite::Universal;
    +
    +$VERSION = 1.000;
    +use strict;
    +use Class::MakeMethods::Composite '-isasubclass';
    +use Carp;
    +
    +########################################################################
    +
    +=head1 METHOD GENERATOR TYPES
    +
    +=head2 patch
    +
    +The patch ruleset generates composites whose core behavior is based on an existing subroutine.
    +
    +Here's a sample usage:
    +
    +  sub foo {
    +    my $count = shift;
    +    return 'foo' x $count;
    +  }
    +  
    +  Class::MakeMethods::Composite::Universal->make(
    +    -ForceInstall => 1,
    +    patch => {
    +      name => 'foo',
    +      pre_rules => [
    +	sub { 
    +	  my $method = pop @_;
    +	  if ( ! scalar @_ ) {
    +	    @{ $method->{args} } = ( 2 );
    +	  }
    +	},
    +	sub { 
    +	  my $method = pop @_;
    +	  my $count = shift;
    +	  if ( $count > 99 ) {
    +	    Carp::confess "Won't foo '$count' -- that's too many!"
    +	  }
    +	},
    +      ],
    +      post_rules => [
    +	sub { 
    +	  my $method = pop @_;
    +	  if ( ref $method->{result} eq 'SCALAR' ) {
    +	    ${ $method->{result} } =~ s/oof/oozle-f/g;
    +	  } elsif ( ref $method->{result} eq 'ARRAY' ) {
    +	    map { s/oof/oozle-f/g } @{ $method->{result} };
    +	  }
    +	} 
    +      ],
    +    },
    +  );
    +
    +=cut
    +
    +use vars qw( %PatchFragments );
    +
    +sub patch {
    +  (shift)->_build_composite( \%PatchFragments, @_ );
    +}
    +
    +%PatchFragments = (
    +  '' => [
    +    '+init' => sub {
    +	my $method = pop @_;
    +	my $origin = ( $Class::MethodMaker::CONTEXT{TargetClass} || '' ) . 
    +			'::' . $method->{name};
    +	no strict 'refs';
    +	$method->{patch_original} = *{ $origin }{CODE}
    +	    or croak "No subroutine $origin() to patch";  
    +      },
    +    'do' => sub {
    +	my $method = pop @_;
    +	my $sub = $method->{patch_original};
    +	&$sub( @_ );
    +      },
    +  ],
    +);
    +
    +=head2 make_patch
    +
    +A convenient wrapper for C and the C method generator.
    +
    +Provides the '-ForceInstall' flag, which is required to ensure that the patched subroutine replaces the original.
    +
    +For example, one could add logging to an existing method as follows:
    +
    +  Class::MakeMethods::Composite::Universal->make_patch(
    +    -TargetClass => 'SomeClass::OverYonder',
    +    name => 'foo',
    +    pre_rules => [ 
    +      sub { 
    +	my $method = pop; 
    +	warn "Arguments for foo:", @_ 
    +      } 
    +    ]
    +    post_rules => [ 
    +      sub { 
    +	warn "Result of foo:", Class::MakeMethods::Composite->CurrentResults 
    +      } 
    +    ]
    +  );
    +
    +=cut
    +
    +sub make_patch {
    +  (shift)->make( -ForceInstall => 1, patch => { @_ } );
    +}
    +
    +
    +########################################################################
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +=cut
    +
    +1;
    diff --git a/lib/Class/MakeMethods/Docs/Catalog.pod b/lib/Class/MakeMethods/Docs/Catalog.pod
    new file mode 100644
    index 0000000..ba17349
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Docs/Catalog.pod
    @@ -0,0 +1,888 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Docs::Catalog - List of Makable Method Types
    +
    +
    +=head1 DESCRIPTION
    +
    +This document lists the various subclasses of Class::MakeMethods included
    +in this distribution, and the method types each one provides. 
    +
    +See the documentation for each implementation for more details
    +about the features it provides.
    +
    +For each class, a parenthetical comment indicates whether the methods it generates are applicable to individual blessed objects (Instances), to class data (Global), or both (Any)
    +=head2 Scoping
    +
    +The final part of the name of a method-generating subclass typically indicates the scope or applicability of the methods it generates
    +
    +=over 4
    +
    +=item Hash
    +
    +For object instances based on blessed hashes with named values.
    +
    +=item Array
    +
    +For object instances based on blessed arrays with positional values.
    +
    +=item Scalar
    +
    +For object instances based on blessed scalars with a single value.
    +
    +=item InsideOut
    +
    +For any object instance regardless of underlying data type.
    +
    +=item Ref
    +
    +For any object instance regardless of underlying data type.
    +
    +=item Inheritable
    +
    +For data which can be set at the class, subclass, or instance level.
    +
    +=item Class
    +
    +For class data shared by all instances but different for each subclass
    +
    +=item ClassVar
    +
    +For class data shared by all instances but different for each subclass
    +
    +=item ClassInherit
    +
    +For class data shared by all instances but different for each subclass
    +
    +=item Global
    +
    +For global data shared by a class and all its instances and subclasses
    +
    +=item PackageVar
    +
    +For global data shared by a class and all its instances and subclasses
    +
    +=item Universal
    +
    +# General method types that are widely applicable
    +
    +=back
    +
    +=head2 Summary Charts
    +
    +This table shows which scopes are available in each generator family:
    +
    +  SCOPING          Basic      Standard   Evaled     Composite  Template
    +  Hash               +          +          +          +          +
    +  Array              +          +                     +          +
    +  Scalar                                                         +
    +  InsideOut                                                      +
    +  Ref                                                            +
    +  Inheritable                   +                     +          +
    +  Class                                                          +
    +  ClassVar                                                       +
    +  ClassInherit                                                   +
    +  Global             +          +                     +          +
    +  PackageVar                                                     +
    +  Universal                                           +          +
    +
    +This table shows which types of methods are typically available in each generator family:
    +
    +  METHOD           Basic      Standard   Evaled     Composite  Template
    +  new                +          +                     +          +          
    +
    +  scalar             +          +                     +          +
    +  string                                                         +
    +  string_index                                                   +
    +  number                                                         +
    +  boolean                                                        +
    +  boolean_index                                                  +
    +  bits                                                           +
    +
    +  array              +          +                     +          +
    +  struct                                                         +
    +
    +  hash               +          +                     +          +
    +  hash_of_arrays                                                 +
    +  tiedhash                                                       +
    +
    +  object             +                                +          +
    +  instance                                                       +
    +  array_of_objects                                               +
    +
    +  code                                                           +
    +  code_or_scalar                                                 +
    +
    +
    +=head1 BASIC CLASSES
    +
    +=head2 Basic::Hash (Instances)
    +
    +Methods for objects based on blessed hashes. See L for details.
    +
    +=over 4
    +
    +=item *
    +
    +new: create and copy instances
    +
    +=item *
    +
    +scalar: get and set scalar values in each instance
    +
    +=item *
    +
    +array: get and set values stored in an array refered to in each
    +instance
    +
    +=item *
    +
    +hash: get and set values in a hash refered to in each instance
    +
    +=back
    +
    +=head2 Basic::Array (Instances)
    +
    +Methods for manipulating positional values in arrays. See L for details.
    +
    +=over 4
    +
    +=item *
    +
    +new: create and copy instances
    +
    +=item *
    +
    +scalar: get and set scalar values in each instance
    +
    +=item *
    +
    +array: get and set values stored in an array refered to in each
    +instance
    +
    +=item *
    +
    +hash: get and set values in a hash refered to in each instance
    +
    +=back
    +
    +=head2 Basic::Global (Global)
    +
    +Global methods are not instance-dependent; calling them by class
    +name or from any instance or subclass will consistently access the
    +same value. See L for details.
    +
    +=over 4
    +
    +=item *
    +
    +scalar: get and set a global scalar value
    +
    +=item *
    +
    +array: get and set values in a global array
    +
    +=item *
    +
    +hash: get and set values in a global hash
    +
    +=back
    +
    +
    +=head1 STANDARD CLASSES
    +
    +=head2 Standard::Hash (Instances)
    +
    +Methods for objects based on blessed hashes. See L for details.
    +
    +=over 4
    +
    +=item *
    +
    +new: create and copy instances
    +
    +=item *
    +
    +scalar: get and set scalar values in each instance
    +
    +=item *
    +
    +array: get and set values stored in an array refered to in each
    +instance
    +
    +=item *
    +
    +hash: get and set values in a hash refered to in each instance
    +
    +=item *
    +
    +object: access an object refered to by each instance
    +
    +=back
    +
    +=head2 Standard::Array (Instances)
    +
    +Methods for manipulating positional values in arrays. See L for details.
    +
    +=over 4
    +
    +=item *
    +
    +new: create and copy instances
    +
    +=item *
    +
    +scalar: get and set scalar values in each instance
    +
    +=item *
    +
    +array: get and set values stored in an array refered to in each
    +instance
    +
    +=item *
    +
    +hash: get and set values in a hash refered to in each instance
    +
    +=item *
    +
    +object: access an object refered to by each instance
    +
    +=back
    +
    +=head2 Standard::Global (Global)
    +
    +Methods for manipulating global data. See L for details.
    +
    +=over 4
    +
    +=item *
    +
    +scalar: get and set global scalar
    +
    +=item *
    +
    +array: get and set values stored in a global array
    +
    +=item *
    +
    +hash: get and set values in a global hash
    +
    +=item *
    +
    +object: global access to an object ref
    +
    +=back
    +
    +
    +=head2 Standard::Inheritable (Any)
    +
    +Methods for manipulating data which may be overridden per class or instance. Uses external data storage, so it works with objects of any underlying data type.  See L for details.
    +
    +=over 4
    +
    +=item *
    +
    +scalar: get and set scalar values for each instance or class
    +
    +=back
    +
    +
    +=head1 COMPOSITE CLASSES
    +
    +=head2 Composite::Hash (Instances)
    +
    +Methods for objects based on blessed hashes. See L for details.
    +
    +=over 4
    +
    +=item *
    +
    +new: create and copy instances
    +
    +=item *
    +
    +scalar: get and set scalar values in each instance
    +
    +=item *
    +
    +array: get and set values stored in an array refered to in each
    +instance
    +
    +=item *
    +
    +hash: get and set values in a hash refered to in each instance
    +
    +=item *
    +
    +object: access an object refered to by each instance
    +
    +=back
    +
    +=head2 Composite::Array (Instances)
    +
    +Methods for manipulating positional values in arrays. See L for details.
    +
    +=over 4
    +
    +=item *
    +
    +new: create and copy instances
    +
    +=item *
    +
    +scalar: get and set scalar values in each instance
    +
    +=item *
    +
    +array: get and set values stored in an array refered to in each
    +instance
    +
    +=item *
    +
    +hash: get and set values in a hash refered to in each instance
    +
    +=item *
    +
    +object: access an object refered to by each instance
    +
    +=back
    +
    +=head2 Composite::Global (Global)
    +
    +Methods for manipulating global data. See L for details.
    +
    +=over 4
    +
    +=item *
    +
    +scalar: get and set global scalar
    +
    +=item *
    +
    +array: get and set values stored in a global array
    +
    +=item *
    +
    +hash: get and set values in a global hash
    +
    +=item *
    +
    +object: global access to an object ref
    +
    +=back
    +
    +
    +=head2 Composite::Inheritable (Any)
    +
    +Methods for manipulating data which may be overridden per class or instance. Uses external data storage, so it works with objects of any underlying data type.  See L for details.
    +
    +=over 4
    +
    +=item *
    +
    +scalar: get and set scalar values for each instance or class
    +
    +=item *
    +
    +hook: create a subroutine intended to have operations added to it
    +
    +=back
    +
    +
    +=head2 Composite::Universal (Any)
    +
    +Methods for padding pre- and post-conditions to any class. See L for details.
    +
    +=over 4
    +
    +=item *
    +
    +patch: add pre and post operations to an existing subroutine
    +
    +=back
    +
    +
    +=head1 TEMPLATE CLASSES
    +
    +=head2 Template::Universal (Any)
    +
    +Meta-methods for any type of object. See L.
    +
    +=over 4
    +
    +=item *
    +
    +no_op - a method with an empty body
    +
    +=item *
    +
    +croak - a method which will croak if called
    +
    +=item *
    +
    +method_init - calls other methods from a list of method name => argument pairs
    +
    +=item *
    +
    +forward_methods - delegates to an object provided by another method
    +
    +=back
    +
    +=head2 Template::Ref (Any Instance)
    +
    +Methods for deep copies and comparisons. See L.
    +
    +=over 4
    +
    +=item *
    +
    +clone: make a deep copy of an object instance
    +
    +=item *
    +
    +prototype: make new objects by cloning a typical instance
    +
    +=item *
    +
    +compare: compare one object to another
    +
    +=back
    +
    +
    +=head2 Template::Generic (Abstract)
    +
    +The remaining subclasses inherit a similar collection of templates from Template::Generic, and provide a different type of scoping or binding for the functionality defined by the Generic template. See L for details.
    +
    +
    +=head2 Template::Hash (Instances)
    +
    +The most commonly used implementation, for objects based on blessed hashes. See L.
    +
    +=over 4
    +
    +=item *
    +
    +new: create and copy instances
    +
    +=item *
    +
    +scalar: get and set scalar values in each instance
    +
    +=item *
    +
    +string: get and set string values in each instance
    +
    +=item *
    +
    +number: get and set numeric values in each instance
    +
    +=item *
    +
    +boolean: get and set boolean values in each instance
    +
    +=item *
    +
    +bits: get and set boolean values stored in a single value in each
    +instance
    +
    +=item *
    +
    +array: get and set values stored in an array refered to in each
    +instance
    +
    +=item *
    +
    +struct - methods for acccessing values which are stored by
    +position in an array
    +
    +=item *
    +
    +hash: get and set values in a hash refered to in each instance
    +
    +=item *
    +
    +tiedhash: get and set values in a tied hash refered to in each
    +instance
    +
    +=item *
    +
    +hash_of_arrays: for references to hashes of arrays contained in each
    +instance
    +
    +=item *
    +
    +object: set or access a reference to an object contained in each
    +instance
    +
    +=item *
    +
    +array_of_objects: manipulate an array of object references within in
    +each instance
    +
    +=item *
    +
    +code: set or call a function reference contained in each instance
    +
    +=back
    +
    +
    +=head2 Template::Array (Instances)
    +
    +Methods for manipulating positional values in arrays. See L.
    +
    +=over 4
    +
    +=item *
    +
    +new: create and copy array instances
    +
    +=item *
    +
    +scalar: get and set scalar values in a given array position
    +
    +=item *
    +
    +string: get and set string values in a given array position
    +
    +=item *
    +
    +number: get and set numeric values in a given array position
    +
    +=item *
    +
    +boolean: get and set boolean values in a given array position
    +
    +=item *
    +
    +builtin_isa: generates a wrapper around some builtin function,
    +cacheing the results in the object and providing a by-name interface
    +
    +=back
    +
    +
    +
    +=head2 Template::Scalar (Instances)
    +
    +For objects based on blessed scalars.  See L.
    +
    +Note that these objects can generally only have one value accessor method, as all such accessors will refer to the same value.
    +
    +=over 4
    +
    +=item *
    +
    +new: create and copy instances
    +
    +=item *
    +
    +scalar: get and set scalar values in each instance
    +
    +=item *
    +
    +string: get and set a string value in each instance
    +
    +=item *
    +
    +number: get and set a numeric value in each instance
    +
    +=item *
    +
    +boolean: get and set a boolean value in each instance
    +
    +=item *
    +
    +bits: get and set boolean values stored in a single value in each
    +instance
    +
    +=item *
    +
    +code: set or call a function reference contained in each instance
    +
    +=back
    +
    +
    +=head2 Template::InsideOut (Instances)
    +
    +Stores values for objects in an external location hashed by identity. See L.
    +
    +Note that while the below constructor creates and returns scalar
    +references, accessor methods can be created with this implementation
    +for use with any type of object.
    +
    +=over 4
    +
    +=item *
    +
    +new: create and copy instances
    +
    +=item *
    +
    +scalar: get and set scalar values associated with each instance
    +
    +=item *
    +
    +string: get and set string values associated with each instance
    +
    +=item *
    +
    +string_index: get and set string values associated with each
    +instance, and maintain an index of instances by value
    +
    +=item *
    +
    +number: get and set numeric values associated with each instance
    +
    +=item *
    +
    +boolean: get and set boolean values associated with each instance
    +
    +=item *
    +
    +boolean_index: get and set boolean values associated with each instance, and maintain a list of items which have the flag set
    +
    +=item *
    +
    +bits: get and set boolean values stored in a single value associated with each
    +instance
    +
    +=item *
    +
    +array: get and set values stored in an array associated with each
    +instance
    +
    +=item *
    +
    +hash: get and set values in a hash associated with each instance
    +
    +=item *
    +
    +code: set or call a function reference associated with each instance
    +
    +=back
    +
    +
    +=head2 Template::Global (Global)
    +
    +Global methods are not instance-dependent; calling them by class
    +name or from any instance will consistently access the same value.  See L.
    +
    +=over 4
    +
    +=item *
    +
    +scalar: get and set a global scalar value
    +
    +=item *
    +
    +string: get and set a global string value
    +
    +=item *
    +
    +number: get and set a global number value
    +
    +=item *
    +
    +boolean: get and set a global boolean value
    +
    +=item *
    +
    +array: get and set values in a global array
    +
    +=item *
    +
    +hash: get and set values in a global hash
    +
    +=item *
    +
    +tiedhash: get and set values in a global tied hash
    +
    +=item *
    +
    +hash_of_arrays: get and set values in a global hash of arrays
    +
    +=item *
    +
    +object: set and access a global reference to an object
    +
    +=item *
    +
    +instance: set and access a global reference to an object of the declaring class
    +
    +=item *
    +
    +code: set and access a global reference to a subroutine.
    +
    +=back
    +
    +
    +=head2 Template::PackageVar (Global)
    +
    +PackageVar methods access a variable in the declaring package. Thus,
    +they have the same effect as Static methods, while keeping their
    +value accessible via the symbol table.  See L.
    +
    +=over 4
    +
    +=item *
    +
    +scalar: get and set a global scalar value
    +
    +=item *
    +
    +string: get and set a global string value
    +
    +=item *
    +
    +number: get and set a global number value
    +
    +=item *
    +
    +boolean: get and set a global boolean value
    +
    +=item *
    +
    +array: get and set values in a global array
    +
    +=item *
    +
    +hash: get and set values in a global hash
    +
    +=back
    +
    +
    +=head2 Template::Class (Global)
    +
    +Class methods are similar to Static methods, except that each subclass and its instances will access a distinct value. See L.
    +
    +=over 4
    +
    +=item *
    +
    +scalar: get and set a class-specific scalar value
    +
    +=item *
    +
    +string: get and set a class-specific string value
    +
    +=item *
    +
    +number: get and set a class-specific number value
    +
    +=item *
    +
    +boolean: get and set a class-specific boolean value
    +
    +=item *
    +
    +array: get and set values in a class-specific array
    +
    +=item *
    +
    +hash: get and set values in a class-specific hash
    +
    +=back
    +
    +
    +=head2 Template::ClassVar (Global)
    +
    +ClassVar methods access a variable in the package on which they
    +are called.  Thus, they have the same effect as Class methods,
    +while keeping their value accessible via the symbol table, like
    +PackageVar. See L.
    +
    +=over 4
    +
    +=item *
    +
    +scalar: get and set a class-specific scalar value
    +
    +=item *
    +
    +string: get and set a class-specific string value
    +
    +=item *
    +
    +number: get and set a class-specific number value
    +
    +=item *
    +
    +boolean: get and set a class-specific boolean value
    +
    +=item *
    +
    +array: get and set values in a class-specific array
    +
    +=item *
    +
    +hash: get and set values in a class-specific hash
    +
    +=back
    +
    +
    +=head2 Template::ClassInherit (Global)
    +
    +ClassInherit methods are an intermediate point between Static and Class methods; subclasses inherit their superclass's value until they set their own value, after which they become distinct. See L.
    +
    +=over 4
    +
    +=item *
    +
    +scalar: get and set an inheritable class-specific scalar value
    +
    +=item *
    +
    +string: get and set an inheritable class-specific string value
    +
    +=item *
    +
    +number: get and set an inheritable class-specific number value
    +
    +=item *
    +
    +boolean: get and set an inheritable class-specific boolean value
    +
    +=item *
    +
    +array: get and set values in an inheritable class-specific array
    +
    +=item *
    +
    +hash: get and set values in an inheritable class-specific hash
    +
    +=back
    +
    +
    +=head2 Template::Inheritable (Any)
    +
    +Methods for manipulating data which may be overridden per class or instance. Uses external data storage, so it works with objects of any underlying data type.  See L for details.
    +
    +=over 4
    +
    +=item *
    +
    +scalar: get and set scalar values for each instance or class
    +
    +=item *
    +
    +string: get and set string values for each instance or class
    +
    +=item *
    +
    +number: get and set numeric values for each instance or class
    +
    +=item *
    +
    +boolean: get and set boolean values for each instance or class
    +
    +=item *
    +
    +hash: get and set values in a hash refered to in each instance
    +
    +=back
    +
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +=cut
    diff --git a/lib/Class/MakeMethods/Docs/Changes.pod b/lib/Class/MakeMethods/Docs/Changes.pod
    new file mode 100644
    index 0000000..8b01f0a
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Docs/Changes.pod
    @@ -0,0 +1,661 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Docs::Changes - History of Class::MakeMethods
    +
    +=head1 SYNOPSIS
    +
    +Revision history for Class::MakeMethods.
    +
    +=head1 CHANGES
    +
    +=head2 Version 1.010
    +
    +=over 4
    +
    +=item 2004/09/06
    +
    +Moved get_declarations() and associated documentation from Standard module to superclass.
    +
    +=item 2004/09/03
    +
    +Developed test.pl test harness with recursive file search to fix Windows "command line too long" errors.
    +
    +=item 2004/09/01
    +
    +Moved Template::TextBuilder and Template::DiskCache into Utility:: namespace.
    +
    +Added support for defaults with -- and -param to Standard get_declarations().
    +
    +=item 2004/08/12
    +
    +Began testing and integrating tied-value patches from Dominique Dumont.
    +
    +=item 2004/04/27
    +
    +Added method types to Evaled::Hash.
    +
    +=item 2004/04/23
    +
    +Added skeleton of a new Evaled::Hash class.
    +
    +=back
    +
    +=head2 Version 1.009
    +
    +=over 4
    +
    +=item 2003/09/25
    +
    +Added Emulator::mcoder and compatibility tests.
    +
    +Released to CPAN as Class-MakeMethods-1.009.tar.gz.
    +
    +=item 2003/09/22
    +
    +Added support for lvalue methods to Template and Template::Generic. Added a few tests to demonstrate they're working. Added an example to Docs::Examples.
    +
    +Added Emulator::accessors and compatibility tests.
    +
    +Minor documentation improvements.
    +
    +=back
    +
    +=head2 Version 1.008
    +
    +=over 4
    +
    +=item 2003/09/05
    +
    +Adjusted layout of test directories in another attempt to solve a MakeMaker/shell-glob issue on Windows that was preventing make test from running correctly. 
    +
    +Removed Template::PseudoHash, since this package never really worked, as pointed out by a question from Mike Castle. Management of array-based objects can be handled by any of the existing ::Array subclasses, and support for pseudo-hashes would not provide any useful new capabilities.
    +
    +Added support for "Template::Universal:forward_methods -delegate" and "Template::Generic:object --soft_delegate" based on a suggestion from Peter Chen. Extended behavior of Template -subs handling to make it easy to add such functionality in the future.
    +
    +Released to CPAN as Class-MakeMethods-1.008.tar.gz.
    +
    +=item 2003/09/02
    +
    +Adjusted DESTROY behavior of Template::InsideOut and cleaned up documentation.
    +
    +=back
    +
    +=head2 Version 1.007
    +
    +=over 4
    +
    +=item 2003/09/01
    +
    +Made Template definitions automatically import their class's generic
    +definitions, if present. This eliminates the need for Generic
    +subclasses to explicitly redeclare every method it inherits, and
    +should obviate the "missing declaration" problems referenced below.
    +
    +Updated the names of several Template subclasses, with stubs at
    +the old names for backwards compatibility: Flyweight becomes
    +InsideOut, Static becomes Global, and Struct becomes Array.
    +
    +Added Template::Inheritable and basic tests for it.
    +
    +Eliminated use of legacy Test.pm from remaining tests, except for
    +MethodMaker emulation.
    +
    +Rearranged test directories in an effort to avoid a reported bug
    +with the test path of t/*/*.t under Windows.
    +
    +Released to CPAN as Class-MakeMethods-1.007.tar.gz.
    +
    +=item 2003/08/27
    +
    +Added section to Class::MakeMethods/EXTENDING documentation based
    +on question from Terrence Brannon.
    +
    +=item 2003/02/07
    +
    +Fixed missing declaration of Template::Hash:instance, reported via RT.
    +
    +=back
    +
    +=head2 Version 1.006
    +
    +=over 4
    +
    +=item 2003/01/26
    +
    +Additional documentation touch-ups. Moved miscellaneous POD files into the Docs directory.
    +
    +Added new test scripts from Class-MethodMaker-1.08, although we
    +don't yet pass them. In particular, I need to add support for the
    +new method types added in 1.04: tie_scalar, tie_list, object_tie_list,
    +object_tie_hash
    +
    +Also need to compare against the changes included in Class-MethodMaker-1.09 and 1.10, which don't seem to include any new test code, but do include functionality changes.
    +
    +=item 2002/12/12
    +
    +Re-integrated Template and Emulator packages; the separate distribution
    +turned out to be a hastle rather than a convenience. However, in
    +order to keep test scripts for each subsystem separate, I'm now
    +using a Makefile.PL attribute to specify a two-level deep directory
    +tree of test scripts; I hope this doesn't break on Windows...
    +
    +Fixed possible "use of undefined as a reference" problem in
    +Standard::*::array method generators, reported by Jared Rhine.
    +
    +Tried to improve documentation, based on feedback from Jared Rhine.
    +Expunged ReadMe.pod. Extracted method catalogs into Catalog.pod.
    +Moved examples to new Example.pod, although that underlines how
    +few examples there are.
    +
    +=back
    +
    +
    +=head2 Version 1.005
    +
    +=over 4
    +
    +=item 2002/06/06
    +
    +Added Autoload interface.
    +
    +Modifed Attribute interface to add "inheritable" default logic for
    +Maker class parameter. (Suggested by Malcolm Cook.)
    +
    +Fixed typo in documentation for Standard::Universal. (Spotted by
    +Malcolm Cook.)
    +
    +=back
    +
    +
    +=head2 Version 1.004
    +
    +=over 4
    +
    +=item 2002/03/23
    +
    +Released to CPAN as Class-MakeMethods-1.004.tar.gz.
    +
    +=item 2002/03/16
    +
    +Allow double-colons between package name and method generator name.
    +
    +=item 2002/02/19
    +
    +Fixed related use of undef in Standard::*:hash methods.
    +
    +=item 2002/02/14
    +
    +Adjusted Standard::*:hash methods to avoid assuming that the hashref
    +already exists.
    +
    +=item 2002/02/07
    +
    +Added missing *_reset => clear to Template number --counter interface.
    +
    +=item 2002/02/02
    +
    +Adjusted error message in Utility::ArraySplicer
    +
    +=item 2002/01/26
    +
    +Applied small documentation corrections suggested by Adam Spiers.
    +
    +Added Standard::Universal:alias.
    +
    +=back
    +
    +=head2 Version 1.003
    +
    +=over 4
    +
    +=item 2002/01/24
    +
    +Folded "Getting Started Guide" POD into main module documentation.
    +
    +Renamed Utility::TakeName to Emulator.
    +
    +Split Template and Emulator packages into their own distributions.
    +
    +B This means that to fully upgrade you must retrieve
    +all three of these files:
    +
    +  Class-MakeMethods-1.003.tar.gz 
    +  Class-MakeMethods-Template-1.003.tar.gz 
    +  Class-MakeMethods-Emulator-1.003.tar.gz 
    +
    +Of course, if you're not using the Template or Emulator classes,
    +there's no need to download them...
    +
    +
    +=item 2002/01/21
    +
    +Started bumping sub-version numbers and not using sub-sub-versions,
    +to shorten distribution names and more closely match standard
    +practice.
    +
    +Added Composite::Inheritable:hook and matching test. Added
    +Composite->CurrentResults method to easily access, update composite
    +method results.
    +
    +=back
    +
    +=head2 Version 1.000.*
    +
    +=over 4
    +
    +=item v1.000.16 - 2002/01/21
    +
    +Released to CPAN as v1.000.016.
    +
    +=item v1.000.16 - 2002/01/20
    +
    +Adjusted the hash and array methods in the Standard::* and Composite::*
    +packages to properly accept a set-contents call with a single
    +reference argument, and to return contents rather than ref in list
    +context.
    +
    +=item v1.000.16 - 2002/01/14
    +
    +Fixed a subtle bug in a test script inherited from Class::MethodMaker:
    +4_Template_hash_hash_array.t and 7_MethodMaker_hash_of_lists.t both
    +relied on "keys %hash" returning the keys in a particular order,
    +which *almost* always worked, but caused failures on one or more
    +Perl version/platform combinations.
    +
    +
    +=item v1.000.15 - 2002/01/14
    +
    +Released to CPAN as v1.000.015.
    +
    +=item v1.000.15 - 2002/01/12
    +
    +Renamed Basic::Static to Basic::Global for consistency with Standard
    +and Composite. Hopefully, there aren't many users of this module
    +yet; please accept my apologies if this breaks your code.
    +
    +Eliminated "local @_ = ...", which appears to cause a scoping
    +problem on Perl 5.6. Thanks to Adam Spiers for a thorough bug
    +report. (See http://www.perlmonks.org/index.pl?node_id=138370 for
    +details.)
    +
    +Extended Template::Generic to support "array --get_set_ref" method
    +style requested by Adam Spiers.
    +
    +Various documentation tweaks, including feedback from Adam Spiers:
    +Adjusted documentation to downplay Basic::* modules as a starting
    +point, in favor of Standard::* ones. Trimmed out some duplicated
    +documentation in favor of more "See LE...E" links. Adjusted
    +documentation of *::Inheritable packages in an attempt to clarify
    +the way in which the inheritance tree is searched for a value.
    +
    +Factored out common code from Standard::Inheritable and
    +Composite::Inheritable to new module, Utility::Inheritable. Factored
    +out common code from Standard::Hash and Standard::Array to new
    +module, Utility::ArraySplicer. Factored out common code from
    +Template::Universal to new module, Utility::Ref. Renamed
    +Emulator::TakeName to Utility::TakeName (this is internal use only,
    +so there should be no public impact).
    +
    +
    +=item v1.000.15 - 2001/12/01
    +
    +Adjusted Template::Universal's code for _CALL_METHODS_FROM_HASH_,
    +to ensure that method/arg pairs are called in order they were passed
    +in.
    +
    +=item v1.000.15 - 2001/07/04, 2001/07/19
    +
    +Minor additions to documentation of various method types.
    +
    +
    +=item v1.000.14 - 2001/07/01
    +
    +Released as v1.000.014.
    +
    +
    +=item v1.000.14 - 2001/06/25, 2001/06/29, 2001/07/01
    +
    +Removed Makefile rule from Makefile.PL to avoid warnings when used
    +with recent versions of ExtUtils::MakeMaker, which also define a
    +similar rule. (Based on bug report from Ron Savage.)
    +
    +Fixed test failure for machines with P5.6 but no Attribute::Handlers.
    +(Reported by Ron Savage, Jay Lawrence.)
    +
    +Added Template::Flyweight:string_index. (But still needs test
    +script.)
    +
    +Added Standard::Universal. (But still needs test scripts.)
    +
    +Minor touch-ups to ReadMe and Guide documentation.
    +
    +
    +=item v1.000.13 - 2001/05/16, 2001/05/18, 2001/05/20, 2001/06/02, 2001/06/22, 2001/06/24
    +
    +To date, this module has been circulated under several provisional
    +names: it was originally floated as a possible version-2 rewrite
    +of Class::MethodMaker, then renamed to Class::Methods when it forked
    +from that project, and then briefly to Class::MethodGenerator.
    +(Note that it can be surprisingly difficult to comply with both of
    +these L guidelines: "To be portable each component of
    +a module name should be limited   to 11 characters. [...] Always
    +try to use two or more whole words.") In the end, I selected
    +Class::MakeMethods, as it is two whole words, and is reminiscent
    +of Class::MethodMaker without being confusing (I hope!), and I
    +believe this issue is now settled.
    +
    +Standardized syntax for global options; renamed -implementation to
    +-MakerClass and -target_class to -TargetClass. Moved $TargetClass
    +and other context information into %CONTEXT with _context accessor.
    +Added ForceInstall.
    +
    +Completed re-simplification of build directories; we're back to a
    +single Makefile, which avoids a warning in P5.6.0.
    +
    +Added Attribute interface for use with P5.6 and later, based on
    +Attribute::Handlers.
    +
    +Renamed "Simple" subclasses to "Basic". Added documentation and
    +initial tests.
    +
    +Added Standard subclasses with parameter parsing and more powerful
    +accessors.
    +
    +Modified Emulator::Struct to use Standard::* methods. Found struct
    +test from P5.7, and added auto_init functionality to match.
    +
    +Added Composite::* subclasses. 
    +
    +Added Emulator::AccessorFast.
    +
    +Added Class::MakeMethods::Guide with introduction and examples.
    +
    +Continued clean-up effort on Template documentation. Renamed Template
    +"attributes" to "method parameters" to avoid confusion with Perl
    +attributes. Retitled Template naming rules from "templates" to
    +"interfaces".
    +
    +Changed initialization code expressions of Template::Class in hopes
    +of P5.6.1 compatibility. (Problem reported by M Schwern.)
    +
    +Added 'Template::Generic:new --and_then_init' based on feedback
    +from Jay Lawrence.
    +
    +=back
    +
    +=head2 Early 1.000 versions
    +
    +=over 4
    +
    +=item v1.000.12 - 2001/05/14
    +
    +Renamed module to Class::MethodGenerator, although naming questions
    +remain.
    +
    +Moved Template subclasses into Template::* namespace. Simplified
    +build directory and makefile structure.
    +
    +Changed initialization code expressions of Template::PackageVar,
    +ClassVar for P5.6.0 compatibility. (Reported by M Schwern.)
    +
    +
    +=item v1.000.11 - 2001/05/07, 2001/05/12
    +
    +Eliminated Bundle file. Moved general documentation to cm_base.
    +
    +Renamed Class::Methods::Base to Class::Methods::Generator.
    +
    +Extracted code for Template declarations to new Class::Methods::Template
    +module. Extracted disk-caching to new Template::DiskCache module.
    +Moved TextBuilder into the Template:: tree.
    +
    +Moved _namespace_capture code to new package
    +Class::Methods::Emulator::TakeName.
    +
    +Added Simple::Hash subclass.
    +
    +
    +=item v1.000.10 - 2001/04/26, 2001/05/02, 2001/05/04
    +
    +Moved _namespace_capture and _namespace_release to Class::Methods::Base.
    +
    +Additional doc tweakage. Moved ReadMe documentation to
    +Bundle::ClassMethods. Merged Extending documentation into Base.
    +
    +Removed spurious uses of -default => 'default' in templates.
    +
    +Added new ClassInherit subclass and Emulator::Inheritable.
    +
    +Expunged Index subclass in favor of boolean_index and string_index
    +types on Generic.
    +
    +Moved Struct:builtin_isa type to new package, StructBuiltin.
    +
    +Refactored code templating function as Class::Methods::Base::TextBuilder.
    +
    +
    +=item v1.000.9 - 2001/03/24
    +
    +Reversed sense of - and --, as it was in 1.000.1.
    +
    +Separated source files into separate directories with distinct
    +Makefiles and test hierarchies. This should clarify the boundaries
    +between the core method-generation code, the common constructor/accessor
    +methods, and the various emulator and experimental packages.
    +
    +
    +=item v1.000.8 - 2001/01/19
    +
    +Following receipt of a suggestion to fork from the maintainer of
    +Class::MethodMaker, renamed packge from Class::MethodMaker v2.0 to
    +Class::Methods v1.000.
    +
    +Adjusted documentation to reflect fork, although additional cleanup
    +is still needed.
    +
    +Moved backward compatibility to Emulator::MethodMaker subclass.
    +
    +Added Generic -compatibility array index_* and hash_of_arrays *_last
    +and *_set methods to match changes in Class::MethodMaker v1.02.
    +Added Emulator::MethodMaker support for the '-static' flag. The
    +emulator now completely satisfies the enclosed test suites, from
    +Class::MethodMaker v0.92 and v1.02.
    +
    +
    +=item v1.000.7 - 2001/01/05, 2001/01/06, 2001/01/07
    +
    +Moved core code and internal code to Internals.pm. MethodMaker.pm
    +now contains only some require statements and the general user
    +guide documentation.
    +
    +Moved ReadMe.pod, Changes.pod, and ToDo.pod into MethodMaker
    +directory. Separated Catalog.pod, Extending.pod, RelatedModules.pod.
    +
    +Included version 1 docs as Class::Methods::OriginalDocs; minor
    +revisions for clarity.
    +
    +Renamed Package subclass to PackageVar, Class to ClassVar.
    +
    +Added Emulation::Struct subclass.
    +
    +Added support for shifting targets with make( -target_class =>
    +Package, ... ).
    +
    +Extended ClassName subclass to handle requiring, rather than creating
    +subclases.
    +
    +
    +=item v1.000.6 - 2000/12/29, 2001/01/02, 2001/01/04
    +
    +Restored -sugar import option for compatibility with earlier
    +versions.
    +
    +Added plural names to "Generic:hash -compatibility" to support
    +v0.92 usage.
    +
    +Replaced use of substr(..., 0, 1) with ... =~ s/^-// for P5.004
    +compatibility; problem found by Scott Godin.
    +
    +Copy @_ before splicing and pushing on to it for P5.004 compatibility.
    +
    +Expunged duplicate lines from Generic.pm's array_of_objects; found
    +by Ron Savage.
    +
    +Renamed Hash.pm's delete and exists behaviors to avoid possible
    +run-time import conflict with Generic.pm's behaviors; failure
    +reported by Ron Savage.
    +
    +Added _STATIC_ATTR_{return_value_undefined} attributes to Generic
    +string and number to allow overrides of this functionality.
    +
    +Minor doc touchups and expanded examples section.
    +
    +
    +=item v1.000.5 - 2000/11/28, 2000/12/16, 2000/12/28
    +
    +Added Universal -warn_calls modifier.
    +
    +Folded various pod files together into main module's inline
    +documentation.  Updated catalog of existing implementations in
    +documentation.  Added pointers to some tutorials and books which
    +discuss Class::Methods.
    +
    +Standardized naming of test scripts.
    +
    +Can now specify default template name, via -default=>"foo".
    +
    +
    +=item v1.000.4 - 2000/11/22
    +
    +Separated string, number, and boolean from the Generic scalar
    +methods.
    +
    +Provide _disk_cache to shortcut the lengthy _interpret_text_builder
    +process.
    +
    +Fixes to ClassName implementation.
    +
    +Change to forward methods to provide better error messages when
    +object is empty.
    +
    +
    +=item v1.000.3 - 2000/11/03
    +
    +Rearranged documentation into separate files in the pod/ directory.
    +
    +Collapsed find_target_class and make functionality into import;
    +moved support for the old functions to the Compatibility module.
    +
    +Adjusted tests to generally use standard syntax, and not Compatibility
    +hooks.
    +
    +
    +=item v1.000.2.1 - 2000/10/23
    +
    +Moved commonly-accessible information to Universal.
    +
    +Added block{...} replacement for enhanced behavior templating.
    +
    +Added modifier mechanism to support -private and -protected.
    +
    +May need to be able to specify import ordering so that modifiers
    +are applied in the right order. This hasn't bit me yet, but it's
    +there. Darn.
    +
    +
    +=item v1.000.2 - 2000/10/22
    +
    +Completed generalization of Generic methods from Static and Hash.
    +Rewrote ClassVar and PackageVar to use Generic framework.
    +
    +Attribute expansion can now substitute values besides name, using
    +*{attr}.
    +
    +Added _diagnostics function and documentation of all failure
    +messages.
    +
    +Added SEE ALSO section to documentation, brief review of Class::*
    +on CPAN.  Stumbled across Damian Conway's very nice Class::Contract
    +module.
    +
    +Added Scalar and Flyweight implementations.
    +
    +
    +=item v1.000.1.1 - 2000/10/21
    +
    +Rolled back change from yesterday; can still pick templates like
    +'-java'.  Allow attributes to be specified as '--foo'=>'bar' or
    +'--'=>{foo=>'bar'}
    +
    +Automated caching for meta-method definition hashes.
    +
    +Generalized several Static and Hash interfaces into Generic templates.
    +Added Static:array and Static:code support.
    +
    +Allow global -import to set default sources for templates, exprs,
    +behaviors.
    +
    +
    +=item v1.000.1 - 2000/10/19
    +
    +Support inheritance of templates between meta-methods with -import.
    +
    +Made "template" an attribute, rather than a special state variable.
    +
    +Allow any attribute to be specified as -foo=>'bar'.  Changed
    +selection of standard templates from '-java' to '--java'.
    +
    +Initial support for string-eval behaviors and code_exprs, and
    +Generic.pm
    +
    +
    +=item v1.000.0 - 2000/10/14, 2000/10/15
    +
    +Completed initial pass of full rewrite.
    +
    +Assorted cleanup of syntax and documentation.
    +
    +Moved Hash, Static, and Index implementations into separate packages.
    +
    +
    +=item v0.9.3 - 2000/09/30
    +
    +Refactored subclass_name and class_registry.
    +
    +Folded in some misc improvements from Class::MethodMaker 1.0.
    +
    +
    +=item v0.97x - 2000/08/04 to 2000/08/13
    +
    +Forked from Class::MethodMaker 0.96. Substantial rewrite started
    +
    +Created build_meta_method and refactored many methods to use it.
    +
    +Added new_hash, hash_init, new_from_prototype.
    +
    +Extended arg format. Added -template=>behavior_name. Added support
    +for array-of-names arguments.
    +
    +Performance tuning. Additional refactoring to support AutoSplit
    +functionality.
    +
    +Also folded in some older changes and additions from Evolution's
    +internal collection of MethodMaker subclasses:
    +
    +=back
    +
    +=head2 Class::MethodMaker::Extensions
    +
    +Change notes from unreleased collection of extensions to Class::MethodMaker that were later folded into Class::MakeMethods:
    +
    +  2000/01/12 Added set_foo, clear_foo to class_var hashes.
    +  1999/07/27 Added subclass_name.
    +  1999/04/15 Changed class_var to use symbol table lookups, not eval "".
    +  1999/04/05 Changed determine_once to check again if undefined.
    +  1999/03/25 Added singleton method.
    +  1998/09/18 Finished integration of class_registry handlers.
    +  1998/07/31 Added class_var and classnames handlers.
    +  1998/06/12 Added lookup handlers.
    +  1998/05/09 Created no_op and determine_once method groups.
    +
    +=cut
    diff --git a/lib/Class/MakeMethods/Docs/Examples.pod b/lib/Class/MakeMethods/Docs/Examples.pod
    new file mode 100644
    index 0000000..787ace7
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Docs/Examples.pod
    @@ -0,0 +1,554 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Docs::Examples - Sample Declarations and Usage
    +
    +=head1 EXAMPLES
    +
    +The following examples indicate some of the capabilities of
    +Class::MakeMethods. 
    +
    +=head2 A Contrived Example
    +
    +Object-oriented Perl code is widespread -- you've probably seen code like the below a million times:
    +
    +  my $obj = MyStruct->new( foo=>"Foozle", bar=>"Bozzle" );
    +  if ( $obj->foo() =~ /foo/i ) {
    +    $obj->bar("Barbados!");
    +  }
    +
    +Here's a possible implementation for the class whose interface is
    +shown above:
    +
    +  package MyStruct;
    +  
    +  sub new {
    +    my $callee = shift;
    +    my $self = bless { @_ }, (ref $callee || $callee);
    +    return $self;
    +  }
    +
    +  sub foo {
    +    my $self = shift;
    +    if ( scalar @_ ) {
    +      $self->{'foo'} = shift();
    +    } else {
    +      $self->{'foo'}
    +    }
    +  }
    +
    +  sub bar {
    +    my $self = shift;
    +    if ( scalar @_ ) {
    +      $self->{'bar'} = shift();
    +    } else {
    +      $self->{'bar'}
    +    }
    +  }
    +
    +Class::MakeMethods allows you to simply declare those methods to
    +be of a predefined type, and it generates and installs the necessary
    +methods in your package at compile-time.
    +
    +Here's the equivalent declaration for that same basic class:
    +
    +  package MyStruct;
    +  use Class::MakeMethods::Standard::Hash (
    +    'new'       => 'new',
    +    'scalar'    => 'foo',
    +    'scalar'    => 'bar',
    +  );
    +
    +=head2 A Typical Example
    +
    +The following example shows a common case of constructing a class with several types of accessor methods
    +
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Hash (
    +    new => 'new',
    +    scalar => [ 'foo', 'bar' ],
    +    array => 'my_list',
    +    hash => 'my_index',
    +  );
    +
    +This class now has a constructor named new, two scalar accessors named foo and bar, and a pair of reference accessors named my_list and my_index. Typical usage of the class might include calls like the following:
    +
    +  my $obj = MyObject->new( foo => 'Foozle' );
    +  print $obj->foo();
    +  
    +  $obj->bar('Barbados'); 
    +  print $obj->bar();
    +  
    +  $obj->my_list(0 => 'Foozle', 1 => 'Bang!');
    +  print $obj->my_list(1);
    +  
    +  $obj->my_index('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  print $obj->my_index('foo');
    +
    +=head2 Lvalue Accessors
    +
    +The Template subclasses support an optional "--lvalue" modifer that causes your accessors method to be marked as returning an lvalue which can be assigned to. (This feature is only available on Perl 5.6 or later.)
    +
    +  package MyStruct;
    +  use Class::MakeMethods::Template::Hash (
    +    'new'                   => 'new',
    +    'scalar --get --lvalue' => 'foo',
    +    'array --get --lvalue'  => 'bar',
    +  );
    +
    +  $obj->foo = "Foozle";
    +  print $obj->foo;
    +
    +  $obj->bar = ( 'baz', 'beep', 'boop' );
    +  print $obj->bar->[1]; # beep
    +
    +=head2 String and Numeric Accessors
    +
    +In addition to the C accessor supported by the C classes, the Template subclasses also provide specialized accessors that can facilitate the use of specific types of data.
    +
    +For example, we could declare the following class to hold information
    +about available Perl packages:
    +
    +  package MyVersionInfo;
    +  use Class::MakeMethods::Template::Hash (
    +    'new'     => 'new',
    +    'string'  => 'package',
    +    'number'  => 'version',
    +  );
    +
    +  sub summary {
    +    my $self = shift;
    +    return $self->package() . " is at version " . $self->version()
    +  }
    +
    +You could use this class as follows:
    +
    +  package main;
    +  use MyVersionInfo;
    +  
    +  my $obj = MyVersionInfo->new( package=>"Class::MakeMethods");
    +  $obj->version( 2.0 );
    +  print $obj->summary();
    +
    +These accessors will provide a bit of diagnostic type checking;
    +an attempt to call C<$obj-Eversion("foo")> will cause your
    +program to croak.
    +
    +
    +=head2 String Concatenation Interface
    +
    +The following defines a get_concat method C, and specifies
    +a string to use when joining additional values when this method is
    +called.
    +
    +  use Class::MakeMethods::Template::Hash
    +    'string' => [ '--get_concat', 'i', { join => ' - ' } ];
    +
    +(See L for information about the C C interface.)
    +
    +
    +=head2 Access Control Example
    +
    +The following defines a secret_password method, which will croak
    +if it is called from outside of the declaring package.
    +
    +  use Class::MakeMethods::Composite::Hash
    +    'scalar' => [ 'secret_password' => { permit => 'pp' } ];
    +
    +(See L for information
    +about the C modifier.)
    +
    +For template classes, the same thing is accomplished with '--private':
    +
    +  use Class::MakeMethods::Template::Hash
    +    'scalar' => [ '--private', 'secret_password' ];
    +
    +(See L for information
    +about the C modifier.)
    +
    +
    +=head2 Lazy-Init Interface
    +
    +Templapte scalar accessors declared with the "init_and_get" interface
    +can be used for "memoization" or lazy-evaluation for object
    +attributes. If the current accessor value is undefined, they will
    +first call a user-provided init_* method and save its value.
    +
    +  package MyWidget;
    +  use Class::MakeMethods::Template::Hash (
    +    'new --with_values' => [ 'new' ],
    +    'scalar --init_and_get' => [ 'foo', 'count', 'result' ],
    +  );
    +  
    +  sub init_foo { 
    +    return 'foofle';
    +  }
    +  
    +  sub init_count {
    +    return '3';
    +  }
    +  
    +  sub init_result {
    +    my $self = shift;
    +    return $self->foo x $self->count;
    +  }
    +  ...
    +  
    +  my $widget = MyWidget->new();
    +  print $widget->result; # output: fooflefooflefoofle
    +  
    +  # if values are predefined, the init methods are not used
    +  my $other_widget = MyWidget->new( foo => 'bar', count => 2 );
    +  print $widget->result; # output: barbar  
    +
    +(See L for more information about
    +C. This interface is also supported by all of Generic's
    +subclasses, so you can add lazy-init methods for global data, class
    +data, array objects, etc. Unfortunately, to date it is only supported
    +for scalar-value accessors...)
    +
    +
    +=head2 Helper Methods
    +
    +Template methods often include similarly-named "helper" methods. For example, specifying the "--with_clear" interface for Template::*:scalar methods creates an extra method for each accessor x named clear_x.
    +
    +  package MyClass;
    +  use Class::MakeMethods::Template::Hash('scalar --with_clear' => 'foo');
    +
    +  my $obj = MyClass->new;
    +  $obj->foo(23);
    +  $obj->clear_foo;
    +  print $obj->foo();
    +
    +
    +=head2 Reference Accessor and Helper Methods
    +
    +For references to arrays and hashes, the Template subclasses provide
    +accessors with extra "helper methods" to facilitate method-based
    +interaction.
    +
    +Here's a class whose instances each store a string and an array
    +reference, along with a method to search the directories:
    +
    +  package MySearchPath;
    +  use Class::MakeMethods::Template::Hash (
    +    'new'     => 'new',
    +    'string'  => 'name',
    +    'array'   => 'directories',
    +  );
    +  
    +  sub search {
    +    my $self = shift; 
    +    my $target = shift;
    +    foreach my $dir ( $self->directories ) {
    +      my $candidate = $dir . '/' . $target;
    +      return $candidate if ( -e $candidate );
    +    }
    +    return;
    +  }
    +
    +Note that the directories accessor returns the contents of the
    +array when called in a list context, making it easier to loop over.
    +
    +And here's a sample usage:
    +
    +  package main;
    +  use MySearchPath;
    +  
    +  my $libs = MySearchPath->new( name=>"libs", directories=>['/usr/lib'] );
    +  $libs->push_directories( '/usr/local/lib' );
    +  
    +  print "Searching in " . $libs->count_directories() . "directories.\n";
    +  foreach ( 'libtiff', 'libjpeg' ) {
    +    my $file = $libs->search("$_.so"); 
    +    print "Checking $_: " . ( $file || 'not found' ) . "\n";
    +  }
    +
    +Note the use of the push_* and count_* "helper" accessor methods,
    +which are defined by default for all 'Template::*:array' declarations.
    +
    +Consult L for more information about
    +the available types of reference accessors, and the various methods
    +they define.
    +
    +
    +=head2 Object Accessors
    +
    +There's also a specialized accessor for object references:
    +
    +  package MyStruct;
    +  use Class::MakeMethods::Template::Hash (
    +    'new'    => 'new',
    +    'object' => [ 'widget' => {class=>'MyWidgetClass', delegate=>"twiddle"} ],
    +  );
    +
    +(Note that the C and C values specified above are
    +method parameters, which provide additional information about the
    +C declaration; see L<"Standard Declaration Syntax"> for more information.)
    +
    +The above declaration creates methods equivalent to the following:
    +
    +  package MyStruct;
    +
    +  sub widget {
    +    my $self = shift;
    +    if ( scalar @_ ) { 
    +      if (ref $_[0] and UNIVERSAL::isa($_[0], 'MyWidgetClass')) { 
    +	$self->{widget} = shift;
    +      } else {
    +	$self->{widget} = MyWidgetClass->new(@_);
    +      }
    +    } else {
    +      return $self->{widget};
    +    }
    +  }
    +  
    +  sub clear_widget {
    +    my $self = shift;
    +    $self->{widget} = undef;
    +  }
    +  
    +  sub twiddle { 
    +    my $self = shift;
    +    my $obj = $self->widget() 
    +      or Carp::croak("Can't forward twiddle because widget is empty");
    +    $obj->twiddle(@_) 
    +  } 
    +
    +
    +=head2 Mixing Object and Global Methods
    +
    +Here's a package declaration using two of the included subclasses, C, for creating and accessing hash-based objects, and C, for simple global-value accessors:
    +
    +  package MyQueueItem;
    +  
    +  use Class::MakeMethods::Standard::Hash (
    +    new => { name => 'new', defaults=>{ foo => 'Foozle' } },
    +    scalar => [ 'foo', 'bar' ],
    +    hash => 'history'
    +  );
    +  
    +  use Class::MakeMethods::Basic::Global (
    +    scalar => 'Debug',
    +    array  => 'InQueue',
    +  );
    +  
    +  sub AddQueueItem {
    +    my $class = shift;
    +    my $instance = shift;
    +    $instance->history('AddQueueItem' => time());
    +    $class->InQueue([0, 0], $instance);    
    +  }
    +  
    +  sub GetQueueItem {
    +    my $class = shift;
    +    $class->InQueue([0, 1], []) or $class->new
    +  }
    +
    +=head2 Adding Custom Initialization to Constructors
    +
    +Frequently you'll want to provide some custom code to initialize new objects of your class. Most of the C<*:new> constructor methods provides a way to ensure that this code is consistently called every time a new instance is created.
    +
    +=over 4
    +
    +=item Composite::Hash:new { post_rules => [] }
    +
    +The Composite classes allow you to add pre- and post-operations to any method, so you can pass in a code-ref to be executed after the new() method.
    +
    +  package MyClass;
    +  
    +  sub new_post_init {
    +    my $self = ${(pop)->{result}}; # get result of original new()
    +    length($self->foo) or $self->foo('FooBar');   # default value
    +    warn "Initialized new object '$self'";       
    +  }
    +  
    +  use Class::MakeMethods (
    +    'Composite::Hash:new' => [
    +	'new' => { post_rules=>[ \&new_post_init ] } 
    +    ],
    +    'Composite::Hash:scalar' => 'foo;,
    +  );
    +  ... 
    +  package main;
    +  my $self = MyClass->new( foo => 'Foozle' )
    +
    +=item Template::Hash:new --and_then_init
    +
    +Use 'Template::Hash:new --and_then_init', which will first create the object and initialize it with the provided values, and then call an init() method on the new object before returning it.
    +
    +  package MyClass;
    +  use Class::MakeMethods::Template::Hash (
    +    'new --and_then_init' => 'new'
    +    'string'  => 'foo'
    +  );
    +  sub init {
    +    my $self = shift;
    +    length($self->foo) or $self->foo('FooBar');   # default value
    +    warn "Initialized new object '$self'";       
    +  }
    +  ... 
    +  package main;
    +  my $self = MyClass->new( foo => 'Foozle' )
    +
    +=item Template::Hash:new --with_init
    +
    +If you don't want your constructor to use the default hash-of-method-names style of initialization, use 'Template::Hash:new --with_init', which will create an empty object, pass its arguments to the init() method on the new object, and then return it.
    +
    +  package MyClass;
    +  use Class::MakeMethods::Template::Hash (
    +    'new --with_init' => 'new'
    +    'string'  => 'foo'
    +  );
    +  sub init {
    +    my $self = shift;
    +    $self->foo( shift || 'FooBar' ); # init with arg or default
    +    warn "Initialized new object '$self'";       
    +  }
    +  ... 
    +  package main;
    +  my $self = MyClass->new( 'Foozle' )
    +
    +=back
    +
    +Some additional notes about these constructors:
    +
    +=over 4
    +
    +=item * 
    +
    +The C methods allow you to specify a name for your method other than C by passing the C parameter:
    +
    +  use Class::MakeMethods::Template::Hash (
    +    'new --and_then_init' => [ 
    +	'new' => { init_method =>  'my_init' } 
    +    ],
    +  );
    +
    +=item * 
    +
    +If you know that you're not going to have a complex class hierarchy, you can reduce resource consumption a bit by changing the above declarations from "*::Hash" to "*::Array" so your objects end up as blessed arrays rather than blessed hashes.
    +
    +=back
    +
    +
    +=head2 Changing Method Names
    +
    +The Template subclasses allow you to control the names assigned to
    +the methods you generate by selecting from several naming interfaces.
    +
    +For example, the accessors declared above use a default, Perl-ish
    +style interface, in which a single method can be called without an
    +argument to retrieve the value, or with an argument to set it.
    +However, you can also select a more Java-like syntax, with separate
    +get* and set* methods, by including the '--java' template specification:
    +
    +  package MyStruct;
    +  use Class::MakeMethods::Template::Hash (
    +    'new'     => 'new',
    +    'scalar'  => '--java Foo',
    +  );
    +
    +(Note that the declaration of Foo could also have been written as
    +C<'scalar --java' =E 'Foo'> or C<'scalar' =E ['--java',
    +'Foo']>, or C<'scalar' =E [ 'foo' => { 'interface'=>'java' }
    +], all of which are interpreted identically; see the
    +L section on "Argument Normalization" for
    +details.)
    +
    +Usage of this accessor would then be as follows:
    +
    +  package main;
    +  use MyStruct;
    +  
    +  my $obj = MyStruct->new( setFoo => "Foozle" );
    +  print $obj->getFoo();
    +  $obj->setFoo("Bozzle");
    +
    +
    +=head2 Selecting Specific Helper Methods
    +
    +You can use the ability to specify interfaces to select specific helper methods rather than getting the default collection. 
    +
    +For example, let's say you wanted to use a Template::Hash:array, but you only wanted two methods to be installed in your class, a foo() accessor and a shift_foo() mutator. Any of the below combinations of syntax should do the trick:
    +
    +  use Class::MakeMethods::Template::Hash
    +    'array' => [
    +      'foo' => { interface=>{'foo'=>'get_set', 'shift_foo'=>'shift'} },
    +    ];
    +
    +If you're going to have a lot of methods with the same interface, you could pre-declare a named interface once and use it repeatedly:
    +
    +  BEGIN {
    +    require Class::MakeMethods::Template::Hash;
    +    Class::MakeMethods::Template::Hash->named_method('array')->
    +        {'interface'}->{'my_get_set_shift'} =
    +            { '*'=>'get_set', 'shift_*'=>'shift' };
    +  }
    +
    +  use Class::MakeMethods::Template::Hash
    +    'array --my_get_set_shift' => [ 'foo', 'bar' ];
    +
    +
    +=head2 Tree Structure Example
    +
    +In this example we will create a pair of classes with references
    +to other objects.
    +
    +The first class is a single-value data object implemented as a
    +reference to a scalar.
    +
    +  package MyTreeData;
    +  use Class::MakeMethods::Template::Scalar (
    +    'new'     => 'new',
    +    'string'  => 'value',
    +  );
    +
    +The second class defines a node in a tree, with a constructor, an
    +accessor for a data object from the class above, and accessors for
    +a list of child nodes.
    +
    +  package MyTreeNode;
    +  use Class::MakeMethods::Template::Hash (
    +    'new'     => 'new',
    +    'object -class MyTreeData'  => 'data',
    +    'array_of_objects -class MyTreeNode' => 'children',
    +  );
    +  
    +  sub depth_first_data {
    +    my $self = shift;
    +    return $self->data, map { $_->depth_first_data() } $self->children;
    +  }
    +
    +Here's a sample of how the above classes could be used in a program.
    +
    +  package main;
    +  use MyTreeData;
    +  use MyTreeNode;
    +
    +  my $node = MyTreeNode->new( 
    +      data => { value=>'data1' }, 
    +      children => [ { value=>'data3' } ] 
    +  );
    +  $node->push_children( MyTreeNode->new( data => { value=>'data2' } ) );
    +  
    +  foreach my $data ( $node->depth_first_data ) {
    +    print $data->value();
    +  }
    +
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +=head2 Annotated Tutorials
    +
    +Ron Savage has posted a pair of annotated examples, linked to below.
    +Each demonstrates building a class with MakeMethods, and each
    +includes scads of comments that walk you through the logic and
    +demonstrate how the various methods work together.
    +
    +  http://savage.net.au/Perl-tutorials.html
    +  http://savage.net.au/Perl-tutorials/tut-33.tgz
    +  http://savage.net.au/Perl-tutorials/tut-34.tgz
    +
    +=cut
    diff --git a/lib/Class/MakeMethods/Docs/ReadMe.pod b/lib/Class/MakeMethods/Docs/ReadMe.pod
    new file mode 100644
    index 0000000..6fd7890
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Docs/ReadMe.pod
    @@ -0,0 +1,279 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Docs::ReadMe - About Class::MakeMethods 
    +
    +
    +=head1 DESCRIPTION
    +
    +This is an updated release of Class::MakeMethods, for distribution through
    +CPAN.
    +
    +This distribution includes the Class::MakeMethods::Template and
    +Class::MakeMethods::Emulator modules which were packaged sepearately in some
    +previous releases.
    +
    +
    +=head1 MOTIVATION
    +
    +By passing arguments to "use Class::MakeMethods ..." statements, you can
    +select from a library of hundreds of common types of methods, which are
    +dynamically installed as subroutines in your module, simplifying the code
    +for your class.
    +
    +
    +=head1 DISTRIBUTION AND INSTALLATION
    +
    +=head2 Version
    +
    +This is Class::MakeMethods v1.010, intended for general use.
    +
    +This module's CPAN registration should read:
    +
    +  Name            DSLIP  Description
    +  --------------  -----  ---------------------------------------------
    +  Class::
    +  ::MakeMethods   RdpOp  Generate common types of methods
    +
    +=head2 Prerequisites
    +
    +In general, this module should work with Perl 5.003 or later,
    +without requring any modules beyond the core Perl distribution.
    +
    +The following optional feature may not be available on some platforms:
    +
    +=over 4
    +
    +=item *
    +
    +Class::MakeMethods::Attribute: The C<:MakeMethod> subroutine
    +attribute requires Perl version 5.6 and the Attribute::Handlers
    +module (from CPAN).
    +
    +=item *
    +
    +Class::MakeMethods::Template C<--lvalue>: The lvalue modifier
    +provided by the Template generator subclasses will only work on
    +Perl version 5.6 or later.
    +
    +=item *
    +
    +Some third-party tests used to check the compliance of Emulator modules
    +require Test::More and will be automatically skipped on machines which do
    +not have this installed.
    +
    +=back
    +
    +=head2 Installation
    +
    +You should be able to install this module using the CPAN shell interface:
    +
    +  perl -MCPAN -e 'install Class::MakeMethods'
    +
    +Alternately, you may retrieve this package from CPAN or from the author's site:
    +
    +=over 2
    +
    +=item *
    +
    +http://search.cpan.org/~evo/
    +
    +=item *
    +
    +http://www.cpan.org/modules/by-authors/id/E/EV/EVO
    +
    +=item *
    +
    +http://www.evoscript.org/Class-MakeMethods/dist/
    +
    +=back
    +
    +After downloading the distribution, follow the normal procedure to unpack and install it, using the commands shown below or their local equivalents on your system:
    +
    +  tar xzf Class-MakeMethods-*.tar.gz
    +  cd Class-MakeMethods-*
    +  perl Makefile.PL
    +  make test && sudo make install
    +
    +Thanks to the kind generosity of other members of the Perl community,
    +this distribution is also available repackaged in the FreeBSD
    +"ports" and Linux RPM formats. This may simplify installation for
    +some users, but be aware that these alternate distributions may
    +lag a few versions behind the latest release on CPAN.
    +
    +=over 2
    +
    +=item *
    +
    +http://www.freebsd.org/cgi/ports.cgi?query=Class-MakeMethods
    +
    +=item *
    +
    +http://www.rpmfind.net/linux/rpm2html/search.php?query=perl-Class-MakeMethods
    +
    +=back
    +
    +=head2 Tested Platforms
    +
    +This release has been tested succesfully on the following platforms:
    +
    +  5.6.1 on darwin
    +
    +Earlier releases have also tested OK on the following platforms:
    +
    +  IP30-R12000-irix
    +  OpenBSD.i386-openbsd
    +  i386-freebsd / i386-freebsd-thread-multi
    +  i386-linux
    +  i386-netbsd / i386-netbsd-thread-multi
    +  i586-linux / i586-linux-thread-multi-ld
    +  i686-linux / i686-pld-linux-thread-multi
    +  ia64-linux
    +  ppc-linux
    +  sparc-linux
    +  sparc-netbsd
    +  sun4-solaris
    +
    +Some earlier versions failed to "make test" on MSWin32, although
    +a forced installation would still work; that problem should be
    +fixed in the most recent releases.
    +
    +You may also review the current test results from CPAN-Testers:
    +
    +=over 2
    +
    +=item *
    +
    +http://testers.cpan.org/show/Class-MakeMethods.html
    +
    +=back
    +
    +=head1 SUPPORT
    +
    +=head2 Release Status
    +
    +This module has been used in a variety of production systems and
    +has been available on CPAN for over two years, with several other
    +distributions dependant on it, so it would be fair to say that it
    +is fully released. 
    +
    +However, while the commonly-used portions are well tested, some of
    +the more obscure combinations of options are less so, and new bug
    +reports do trickle in occasionally. If you do encounter any problems,
    +please inform the author and I'll endeavor to patch them promptly.
    +
    +Additional features have been outlined for future development, but
    +the intent is support these by adding more options to the declaration
    +interface, while maintaining backward compatibility.
    +
    +See L for other outstanding issues
    +and development plans.
    +
    +=head2 Support
    +
    +If you have questions or feedback about this module, please feel
    +free to contact the author at the below address. Although there is
    +no formal support program, I do attempt to answer email promptly. 
    +
    +I would be particularly interested in any suggestions towards
    +improving the documentation and correcting any Perl-version or platform
    +dependencies, as well as general feedback and suggested additions.
    +
    +Bug reports that contain a failing test case are greatly appreciated,
    +and suggested patches will be promptly considered for inclusion in
    +future releases.
    +
    +To report bugs via the CPAN web tracking system, go to 
    +C or send mail 
    +to C, replacing C<#> with C<@>.
    +
    +=head2 Community
    +
    +If you've found this module useful or have feedback about your
    +experience with it, consider sharing your opinion with other Perl
    +users by posting your comment to CPAN's ratings system:
    +
    +=over 2
    +
    +=item *
    +
    +http://cpanratings.perl.org/rate/?distribution=Class-MakeMethods
    +
    +=back
    +
    +For more general discussion, you may wish to post a message on PerlMonks or the comp.lang.perl.misc newsgroup:
    +
    +=over 2
    +
    +=item *
    +
    +http://www.perlmonks.org/index.pl?node=Seekers%20of%20Perl%20Wisdom
    +
    +=item *
    +
    +http://groups.google.com/groups?group=comp.lang.perl.misc
    +
    +=back
    +
    +
    +=head1 CREDITS AND COPYRIGHT
    +
    +=head2 Author
    +
    +Developed by Matthew Simon Cavalletto at Evolution Softworks. 
    +More free Perl software is available at C.
    +
    +You may contact the author directly at C or C. 
    +
    +=head2 Feedback and Suggestions 
    +
    +Thanks to the following people for bug reports, suggestions, and other feedback:
    +
    +  Martyn J. Pearce
    +  Scott R. Godin
    +  Ron Savage
    +  Jay Lawrence
    +  Adam Spiers
    +  Malcolm Cook
    +  Terrence Brannon
    +  Jared Rhine
    +  Peter Chen
    +  Mike Castle
    +
    +=head2 Source Material
    +
    +This package was inspired by the ground-breaking original closure-generating method maker module:
    +
    +  Class::MethodMaker, by Peter Seibel.
    +
    +Additional inspiration, cool tricks, and blocks of useful code for
    +this module were extracted from the following CPAN modules:
    +
    +  Class::Accessor, by Michael G Schwern 
    +  Class::Contract, by Damian Conway
    +  Class::SelfMethods, by Toby Everett
    +
    +=head2 Copyright
    +
    +Copyright 2002, 2003 Matthew Simon Cavalletto. 
    +
    +Portions copyright 1998, 1999, 2000, 2001 Evolution Online Systems, Inc.
    +
    +Based on Class::MethodMaker, originally developed by Peter Seibel. Portions Copyright 1996 Organic Online. Portions Copyright 2000 Martyn J. Pearce. 
    +
    +Class::MakeMethods::Emulator::accessors is based on accessors. Portions by Steve Purkis.
    +
    +Class::MakeMethods::Emulator::AccessorFast is based on Class::Accessor::Fast. Portions Copyright 2000 Michael G Schwern.
    +
    +Class::MakeMethods::Emulator::Inheritable is based on Class::Data::Inheritable. Portions Copyright 2000 Damian Conway and Michael G Schwern.
    +
    +Class::MakeMethods::Emulator::mcoder is based on mcoder. Portions Copyright 2003 by Salvador Fandiño.
    +
    +Class::MakeMethods::Emulator::Singleton is based on Class::Singleton, by Andy Wardley. Portions Copyright 1998 Canon Research Centre Europe Ltd. 
    +
    +Class::MakeMethods::Utility::Ref is based on Ref.pm. Portions Copyright 1994 David Muir Sharnoff.
    +
    +=head2 License
    +
    +You may use, modify, and distribute this software under the same terms as Perl.
    +
    +=cut
    diff --git a/lib/Class/MakeMethods/Docs/RelatedModules.pod b/lib/Class/MakeMethods/Docs/RelatedModules.pod
    new file mode 100644
    index 0000000..93ef930
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Docs/RelatedModules.pod
    @@ -0,0 +1,962 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Docs::RelatedModules - Survey of Class Builders
    +
    +
    +=head1 SYNOPSIS
    +
    +  http://search.cpan.org/search?mode=module&query=Class
    +
    +
    +=head1 DESCRIPTION
    +
    +There are a variety of modules on CPAN dedicated to the purpose of
    +generating common constructor and accessor methods. Below, I survey
    +several of these, summarizing some basic features and technical
    +approaches, and comparing them to Class::MakeMethods and other
    +modules.
    +
    +
    +=head2 Caution
    +
    +B Please consult the
    +documentation from a current version of each module for more specific
    +details.  Corrections and clarifications would by welcomed by the author at the email address below.
    +
    +
    +=head2 Points of Comparison
    +
    +In general, I compared the following characteristics:
    +
    +=over 4
    +
    +=item Distribution
    +
    +Is it included with Perl, or on CPAN? Is it being actively maintained?
    +
    +=item Usage
    +
    +How do you go about declaring your class's methods?
    +
    +=item Mechanism
    +
    +How are they generated and delivered?
    +
    +=item Instance type
    +
    +Are the objects of your class blessed hashes, or something else?
    +
    +=item Core Methods
    +
    +Does the module provide a constructor and basic accessors? Are there specialized methods for hash-ref, array-ref, and object-ref accessors?
    +
    +=item Extensible
    +
    +Can you subclass the package to create new types of methods, or is there some other way to extend it?
    +
    +=item Other Methods
    +
    +Other types of methods provided.
    +
    +=item Emulator
    +
    +Does Class::MakeMethods provide a drop-in replacement for this module?
    +
    +=item Comments
    +
    +Other characteristics or features of note.
    +
    +=back
    +
    +
    +=head1 RELATED MODULES 
    +
    +=head2 accessors
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN. Uploaded Sep 2003.
    +
    +=item Comments
    +
    +I have not yet reviewed this module in detail.
    +
    +=item Example
    +
    +  package MyObject;
    +  use accessors qw( foo bar baz );
    +
    +=back
    +
    +=head2 Attribute::Property
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN.
    +
    +=item Comments
    +
    +I have not yet reviewed this module in detail.
    +
    +=back
    +
    +
    +=head2 Class::Accessor
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN. Last update 4/01.
    +
    +=item Usage
    +
    +Inherit and call function with declaration arguments 
    +
    +=item Mechanism
    +
    +Generates and installs closures
    +
    +=item Instance Type
    +
    +Hash.
    +
    +=item Subclasses Cleanly
    +
    +Cleanly.
    +
    +=item Standard Methods
    +
    +Scalar accessors.
    +
    +=item Extensible
    +
    +Yes.
    +
    +=item Comments
    +
    +Accessor methods call overwritable Cget(I)> and
    +Cset(I, I)> methods.
    +
    +Also includes Class::Accessor::Fast, which creates direct hash keys accessors without calling get and set methods.
    +
    +=item Emulator
    +
    +Yes, but only for the Fast variation; see Class::MakeMethods::Emulator::AccessorFast.
    +
    +=item Example
    +
    +  package MyObject;
    +  @ISA = qw(Class::Accessor);
    +  MyObject->mk_accessors(qw( simple ordered mapping obj_ref ));
    +
    +=back
    +
    +
    +=head2 Class::Class
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN. Last update 1/00.
    +
    +=item Usage
    +
    +Inherit and fill %MEMBERS hash; methods created when first object is created
    +
    +=item Mechanism
    +
    +Generates and installs closures
    +
    +=item Instance Type
    +
    +Hash.
    +
    +=item Subclasses Cleanly
    +
    +Yes.
    +
    +=item Standard Methods
    +
    +Constructor and various accessors.
    +
    +=item Extensible
    +
    +No.
    +
    +=item Example
    +
    +Usage is similar to Class::Struct:
    +
    +  package MyObject;
    +  use Class::Class; 
    +  @ISA = qw(Class::Class);
    +  %MEMBERS = ( 
    +    simple  => '$',
    +    ordered => '@',
    +    mapping => '%',
    +    obj_ref => 'FooObject' 
    +  ); 
    +
    +=item Other Method Types
    +
    +Provides a polymorph() method that is similar to Class::Method's "ClassName:class_name -require".
    +
    +=back
    +
    +
    +=head2 Class::Constructor
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN. Last update 11/01.
    +
    +=item Usage
    +
    +Inherit and call function with declaration arguments 
    +
    +=item Mechanism
    +
    +Generates and installs closures
    +
    +=item Instance Type
    +
    +Hash.
    +
    +=item Subclasses Cleanly
    +
    +Cleanly.
    +
    +=item Standard Methods
    +
    +Hash constructor, with bells.
    +
    +=item Extensible
    +
    +No.
    +
    +=item Emulator
    +
    +No, but possible.
    +
    +=item Example
    +
    +  package MyObject;
    +  @ISA = qw(Class::Constructor);
    +  MyObject->mk_constructor( Name => 'new' );
    +
    +=back
    +
    +
    +=head2 Class::Classgen
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN. Last update 12/00.
    +
    +=item Usage
    +
    +Pre-processor run against declaration files. 
    +
    +=item Mechanism
    +
    +Assembles and saves code file
    +
    +=item Instance Type
    +
    +Hash.
    +
    +=item Subclasses Cleanly
    +
    +Yes. (I think.)
    +
    +=item Standard Methods
    +
    +Constructor and various accessors.
    +
    +=item Extensible
    +
    +No. (I think.)
    +
    +=item Example
    +
    +  header:
    +      package MyObject;
    +  variables:
    +      $simple
    +      @ordered
    +      %mapping
    +      $obj_ref
    +
    +=back
    +
    +
    +=head2 Class::Contract
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN. Last update 5/01.
    +
    +=item Usage
    +
    +Call function with declaration arguments 
    +
    +=item Mechanism
    +
    +Generates and installs closures
    +
    +=item Instance Type
    +
    +Scalar reference with external data storage.
    +
    +=item Subclasses Cleanly
    +
    +Yes.
    +
    +=item Standard Methods
    +
    +Constructor and various accessors.
    +
    +=item Extensible
    +
    +Yes. (I think.)
    +
    +=item Comments
    +
    +Supports pre- and post-conditions, class invariants, and other
    +software engineering goodies.
    +
    +=item Example
    +
    +  package MyObject;
    +  use Class::Contract;
    +  contract {
    +    ctor 'new';
    +    attr 'simple'  => SCALAR;
    +    attr 'ordered' => ARRAY;  
    +    attr 'mapping' => HASH;   
    +    attr 'obj_ref' => 'FooObject';   
    +  }
    +
    +=back
    +
    +
    +=head2 Class::Data::Inheritable
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN. Last update 4/00.
    +
    +=item Usage
    +
    +Inherit and call function with declaration arguments 
    +
    +=item Mechanism
    +
    +Generates and installs closures
    +
    +=item Instance Type
    +
    +Class data, with inheritance.
    +
    +=item Subclasses Cleanly
    +
    +Yes, specifically.
    +
    +=item Standard Methods
    +
    +Scalar accessors.
    +
    +=item Extensible
    +
    +No.
    +
    +=item Example
    +
    +Usage is similar to Class::Accessor:
    +
    +  package MyObject;
    +  @ISA = qw(Class::Data::Inheritable);
    +  MyObject->mk_classdata(qw( simple ordered mapping obj_ref ));
    +
    +=item Emulator
    +
    +Yes, Class::MakeMethods::Emulator::Inheritable, passes original test suite.
    +
    +=back
    +
    +
    +=head2 Class::Delegate
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN. Uploaded 12/0.
    +
    +=item Comments
    +
    +I have not yet reviewed this module in detail.
    +
    +=back
    +
    +=head2 Class::Delegation
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN. Uploaded 12/01.
    +
    +=item Comments
    +
    +I have not yet reviewed this module in detail.
    +
    +=back
    +
    +=head2 Class::Generate
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN. Last update 11/00. 
    +
    +=item Usage
    +
    +Call function with declaration arguments 
    +
    +=item Mechanism
    +
    +Assembles and evals code string, or saves code file.
    +
    +=item Instance Type
    +
    +Hash.
    +
    +=item Subclasses Cleanly
    +
    +Yes.
    +
    +=item Standard Methods
    +
    +Constructor and accessors (scalar, array, hash, object, object array, etc).
    +
    +=item Extensible
    +
    +Unknown.
    +
    +=item Comments
    +
    +Handles private/protected limitations, pre and post conditions,
    +assertions, and more.
    +
    +=item Example
    +
    +Usage is similar to Class::Struct:
    +
    +  package MyObject;
    +  use Class::Generate;
    +  class MyObject => [ 
    +    simple  => '$',
    +    ordered => '@',
    +    mapping => '%',
    +    obj_ref => 'FooObject' 
    +  ]; 
    +
    +=back
    +
    +=head2 Class::Hook
    +
    +=item Distribution
    +
    +CPAN. Uploaded 12/01.
    +
    +=item Comments
    +
    +I have not yet reviewed this module in detail.
    +
    +
    +=head2 Class::Holon
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN. Experimental/Alpha release 07/2001. 
    +
    +=item Instance Type
    +
    +Hash, array, or flyweight-index.
    +
    +=item Subclasses Cleanly
    +
    +No. (I think.)
    +
    +=item Standard Methods
    +
    +Constructor and scalar accessors; flywieght objects also get scalar mutator methods.
    +
    +=item Extensible
    +
    +No. (I think.)
    +
    +=item Comments
    +
    +I'm not sure I understand the intent of this module; perhaps future versions will make this clearer....
    +
    +=back
    +
    +
    +=head2 Class::MethodMaker
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN. Last update 1/01. 
    +
    +=item Usage
    +
    +Import, or call function, with declaration arguments 
    +
    +=item Mechanism
    +
    +Generates and installs closures
    +
    +=item Instance Type
    +
    +Hash, Static.
    +
    +=item Subclasses Cleanly
    +
    +Yes.
    +
    +=item Standard Methods
    +
    +Constructor and various accessors.
    +
    +=item Extensible
    +
    +Yes.
    +
    +=item Example
    +
    +Usage is similar to Class::MakeMethods:
    +
    +  package MyObject;
    +  use Class::MethodMaker (
    +    new     =>   'new',
    +    get_set =>   'simple',
    +    list    =>   'ordered',
    +    hash    =>   'mapping',
    +    object  => [ 'FooObject' => 'obj_ref' ],
    +  );
    +
    +=item Emulator
    +
    +Yes, Class::MakeMethods::Emulator::MethodMaker, passes original test suite.
    +
    +=back
    +
    +
    +=head2 Class::MakeMethods
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN.
    +
    +=item Usage
    +
    +Import, or call function, with declaration arguments; or if desired, make methods on-demand with Autoload, or declare subroutines with a special Attribute.
    +
    +=item Mechanism
    +
    +Generates and installs closures
    +
    +=item Instance Type
    +
    +Hash, Array, Scalar, Static, Class data, others.
    +
    +=item Subclasses Cleanly
    +
    +Yes.
    +
    +=item Standard Methods
    +
    +Constructor and various accessors.
    +
    +=item Extensible
    +
    +Yes.
    +
    +=item Example
    +
    +Usage is similar to Class::MethodMaker:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Hash (
    +    new    =>   'new',
    +    scalar =>   'simple',
    +    array  =>   'ordered',
    +    hash   =>   'mapping',
    +    object => [ 'obj_ref', { class=>'FooObject' } ],
    +  );
    +
    +=back
    +
    +
    +=head2 Class::Maker
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN. Last update 7/02.
    +
    +=item Usage
    +
    +Call function with declaration arguments.
    +
    +=item Mechanism
    +
    +Generates and installs closures (I think).
    +
    +=item Instance Type
    +
    +Hash (I think).
    +
    +=item Subclasses Cleanly
    +
    +Unknown.
    +
    +=item Standard Methods
    +
    +Constructor and various scalar and reference accessors.
    +
    +=item Extensible
    +
    +Unknown.
    +
    +=item Comments
    +
    +I haven't yet reviewed this module closely.
    +
    +=back
    +
    +
    +=head2 Class::SelfMethods
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN. Last update 2/00.
    +
    +=item Usage
    +
    +Inherit; methods created via AUTOLOAD
    +
    +=item Mechanism
    +
    +Generates and installs closures (I think)
    +
    +=item Instance Type
    +
    +Hash.
    +
    +=item Subclasses Cleanly
    +
    +Yes.
    +
    +=item Standard Methods
    +
    +Constructor and scalar/code accessors (see Comments).
    +
    +=item Extensible
    +
    +No.
    +
    +=item Comments
    +
    +Individual objects may be assigned a subroutine that will be called as a method on subsequent accesses. If an instance does not have a value for a given accessor, looks for a method defined with a leading underscore.
    +
    +=back
    +
    +
    +=head2 Class::Struct
    +
    +=over 4
    +
    +=item Distribution
    +
    +Included in the standard Perl distribution. Replaces Class::Template.
    +
    +=item Usage
    +
    +Call function with declaration arguments 
    +
    +=item Mechanism
    +
    +Assembles and evals code string
    +
    +=item Instance Type
    +
    +Hash or Array
    +
    +=item Subclasses Cleanly
    +
    +No.
    +
    +=item Standard Methods
    +
    +Constructor and various accessors.
    +
    +=item Extensible
    +
    +No.
    +
    +  package MyObject;
    +  use Class::Struct;
    +  struct( 
    +    simple  => '$',
    +    ordered => '@',
    +    mapping => '%',
    +    obj_ref => 'FooObject' 
    +  );
    +
    +=item Emulator
    +
    +Yes, Class::MakeMethods::Emulator::Struct.
    +
    +=back
    +
    +
    +=head2 Class::StructTemplate
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN. Last update 12/00. 
    +
    +No documentation available.
    +
    +=item Usage
    +
    +Unknown.
    +
    +=item Mechanism
    +
    +Unknown.
    +
    +=back
    +
    +
    +=head2 Class::Template
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN. Out of date.
    +
    +=item Usage
    +
    +Call function with declaration arguments (I think)
    +
    +=item Mechanism
    +
    +Assembles and evals code string (I think)
    +
    +=item Instance Type
    +
    +Hash.
    +
    +=item Subclasses Cleanly
    +
    +Yes. (I think.)
    +
    +=item Standard Methods
    +
    +Constructor and various accessors.
    +
    +=item Extensible
    +
    +No. (I think.)
    +
    +=item Example
    +
    +Usage is similar to Class::Struct:
    +
    +  package MyObject;
    +  use Class::Template;
    +  members MyObject { 
    +    simple  => '$',
    +    ordered => '@',
    +    mapping => '%',
    +    obj_ref => 'FooObject' 
    +  };
    +
    +=back
    +
    +
    +=head2 Class::Virtual
    +
    +Generates methods that fail with a message indicating that they were not implemented by the subclass. (Cf. 'Template::Universal:croak -abstract'.)
    +
    +Also provides a list of abstract methods that have not been implemented by a subclass.
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN. Last update 3/01.
    +
    +=item Extensible
    +
    +Unknown.
    +
    +=item Mechanism
    +
    +Uses Class::Data::Inheritable and installs additional closures.
    +
    +=back
    +
    +
    +=head2 CodeGen::PerlBean
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN. 
    +
    +=item Usage
    +
    +Call function with declaration arguments.
    +
    +=item Mechanism
    +
    +Generates and writes source code to a file.
    +
    +=item Instance Type
    +
    +Hash (I think).
    +
    +=item Subclasses Cleanly
    +
    +Unknown.
    +
    +=item Standard Methods
    +
    +Constructor and various scalar and reference accessors.
    +
    +=item Extensible
    +
    +Unknown.
    +
    +=item Comments
    +
    +I haven't yet reviewed this module closely.
    +
    +=back
    +
    +
    +=head2 HTML::Mason::MethodMaker
    +
    +=over 4
    +
    +=item Distribution
    +
    +CPAN. 
    +
    +=item Usage
    +
    +Package import with declaration arguments
    +
    +=item Mechanism
    +
    +Generates and installs closures
    +
    +=item Instance Type
    +
    +Hash.
    +
    +=item Standard Methods
    +
    +Scalar accessors.
    +
    +=item Extensible
    +
    +No.
    +
    +=item Example
    +
    +  use HTML::Mason::MethodMaker ( 
    +    read_write => [ qw( simple ordered mapping obj_ref ) ] 
    +  );
    +
    +=back
    +
    +
    +=head1 TO DO
    +
    +The following modules are relevant but have not yet been cataloged above.
    +
    +=head2 Attribute::Property
    +
    +=head2 Class::Accessor::Chained
    +
    +=head2 Class::Accessor::Lvalue
    +
    +=head2 Class::Accessor::Ref
    +
    +=head2 Class::AutoClass
    +
    +=head2 Class::Builder
    +
    +=head2 Class::Member
    +
    +=head2 Class::Trigger
    +
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +
    +=head1 CREDITS AND COPYRIGHT
    +
    +=head2 Developed By
    +
    +  M. Simon Cavalletto, simonm@cavalletto.org
    +  Evolution Softworks, www.evoscript.org
    +
    +=head2 Copyright
    +
    +Copyright 2002 Matthew Simon Cavalletto. 
    +
    +Portions copyright 2000, 2001 Evolution Online Systems, Inc.
    +
    +=head2 License
    +
    +You may use, modify, and distribute this document under the same terms as Perl.
    +
    +=cut
    diff --git a/lib/Class/MakeMethods/Docs/ToDo.pod b/lib/Class/MakeMethods/Docs/ToDo.pod
    new file mode 100644
    index 0000000..312bdc0
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Docs/ToDo.pod
    @@ -0,0 +1,296 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Docs::ToDo - Ideas, problems, and suggestions
    +
    +
    +=head1 SYNOPSIS
    +
    +There are lots of things that could be done to improve this module.
    +
    +
    +=head1 DISTRIBUTION ISSUES
    +
    +Issues about the distribution and supporting files, rather than the code:
    +
    +=head2 Documentation
    +
    +=over 4
    +
    +=item *
    +
    +Make sure that the documentation is broken up into appropriately-sized
    +chunks, and that people will know which section to look at.
    +
    +=item *
    +
    +As user questions arrive, add the answers as documentation points or examples.
    +
    +=item *
    +
    +Assemble annotated examples and tutorials, and either link to or distribute them.
    +
    +=item *
    +
    +Finish overhauling Template documentation.
    +
    +=item * 
    +
    +Include Global and InsideOut uses in the EXAMPLES section
    +
    +=item *
    +
    +Template Internals: Finish documenting disk-based meta-method code-caching. 
    +
    +=back
    +
    +=head2 Tests
    +
    +=over 4
    +
    +=item *
    +
    +Use Devel::Coverage to measure test coverage, and fill in missing
    +cases.
    +
    +=item *
    +
    +Finish tests for Standard and Composite modules.
    +
    +=back
    +
    +
    +=head1 GENERAL ISSUES
    +
    +=over 4
    +
    +=item *
    +
    +It does not appear to be possible to assign subroutine names to
    +closures within Perl. As a result, debugging output from Carp and
    +similar sources will show all generated methods as "ANON()" rather
    +than "YourClass::methodname()".
    +
    +UPDATE: There now seem to be fixes for this which should be integrated: See the new Sub::Name module and http://perlmonks.org/index.pl?node_id=304883
    +
    +=item *
    +
    +For scalar methods (and others) it would be nice to have a simple
    +bounds-checking interface to approve or reject (with an exception)
    +new values that were passed in.
    +
    +As pointed out by Terrence Brannon, the right interface to
    +adopt is probably that of Attribute::Types:
    +
    +  use Class::MakeMethods::Standard::Hash (
    +    'scalar' => [ 'count' => { TYPE => 'INTEGER' } ],
    +    'scalar' => [ 'name' => { TYPE => qr/^[A-Z]\w*$/ } ],
    +    'scalar' => [ 'account' => { TYPE => &checksum_account_number } ]
    +  );
    +
    +=item *
    +
    +Improve use of _diagnostic hooks for debugging. Add various "(Q)"
    +debug diagnostics.
    +
    +=item *
    +
    +Finish building Inheritable array and object accessors.
    +
    +=item *
    +
    +Finish building Composite::* packages.
    +
    +=item *
    +
    +Resolve DESTROY-time issues with Standard::Inheritable, Composite::Inheritable, and Template::InsideOut.
    +
    +=item *
    +
    +Add slice and splice functionality to Standard::*:hash and Composite::*:hash.
    +
    +=back
    +
    +
    +=head1 TEMPLATE CLASSES
    +
    +=head2 Template::Generic 
    +
    +=over 4
    +
    +=item *
    +
    +Allow untyped object accesors if C attribute is not set.
    +(Suggested in Jan-01 NY Perl Seminar discussion.)
    +
    +=item *
    +
    +Standardize naming templates for array, hash, other method types. 
    +
    +Deprecate verb_x methods? Or at last make them consistently available both ways.
    +
    +Make list methods consistent with hash_of_lists methods, in action, and
    +in name (x_verb).  Also for others (e.g., set_ clear_ boolean)
    +
    +=item *
    +
    +Should default object template provide auto-create behavior on ->get()?
    +
    +=item *
    +
    +Generalize the "Generic:scalar -init_and_get" interface to support 
    +memoizing values for other accessor types.
    +
    +=item *
    +
    +Consider adding hash each and array iterator methods, using a closure 
    +to provide iteration.
    +
    +=item *
    +
    +Add support for tied arrays & scalars, a la tiedhash
    +
    +=item *
    +
    +Add string_multiple_index.
    +
    +=item *
    +
    +Extend index methods to support weak indexes with WeakRef. Perhaps
    +just have it accept a hash ref to use as the index, and then allow
    +people to pass in tied hashes?
    +
    +=item *
    +
    +Maybe make private or protected method croak if they were called by a
    +method_init method which was called by an outside package.
    +
    +Not entirely clear what the right semantics or security precautions are here... 
    +
    +=back
    +
    +
    +=head2 Template::Generic Subclasses
    +
    +=over 4
    +
    +=item *
    +
    +Finish building code_or_scalar meta-method.
    +
    +=item * 
    +
    +Finish building Class::MakeMethods::ClassInherit subclass.
    +
    +Need to work out how to capture changes for non-scalar values. For
    +example, if a subclass inherits an array accessor and then pops
    +it, is there some way to provide them with copy-on-write?
    +
    +=item *
    +
    +Add enumerated string/number type.
    +
    +Provide helper methods with map of associated values (ex $o->port
    += 80 ... $o->port_readable eq 'HTTP' ). Cf. code for earlier
    +unpublished 'lookup' method type.
    +
    +=item *
    +
    +For StructBuiltin:
    +
    +Add -fatal flag to die if core func returns false / undef
    +Add call method to recall method with alternative arguments.
    +Add -nocall flag to not call core func on new.
    +
    +=item *
    +
    +Replace ClassName:static_hash_classname with Class:indexed_string.
    +
    +=back
    +
    +
    +=head2 Template Internals
    +
    +=over 4
    +
    +=item *
    +
    +Figure out which modules, if any, should actually be using AutoLoader.
    +Probably just Template::Generic?
    +
    +=item *
    +
    +Give users a way to do meta-method code-caching in Perl library
    +hierarchy, rather than in /tmp/auto or other user-specified
    +directory..
    +
    +Provide mechanism for pre-generating these at install time.
    +
    +Perhaps load these via do, rather than open/read/eval?
    +
    +Perhaps pre-generate expanded libs with all of the -imports resolved?
    +
    +=item *
    +
    +Support generating code files and loading them as needed.
    +
    +This would be similar to Class::Classgen, except that we'd do the
    +generation at run-time the first time it was required, rather than
    +in a separate pass.
    +
    +For example, given the following declaration:
    +
    +  package Foo::Bar;
    +  Class::MakeMethods::Template::Hash->import(-codecache=>'auto', scalar=>'foo');
    +
    +We should be able to write out the following file:
    +
    +  cat 'auto/Foo/Bar/methods-line-2.pl'
    +  # NOTE: Generated for Foo::Bar by the Class::MakeMethods module.
    +  # Changes made here will be lost when Foo::Bar is modified.
    +  package Foo::Bar;
    +  sub foo {
    +    my $self = shift;
    +    if ( scalar @_ ) {
    +      $self->{'foo'} = shift();
    +    }
    +    $self->{'foo'}
    +  }
    +
    +Then on subsequent uses, we can just re-load the generated code:
    +
    +  require "auto/Foo/Bar/methods-line-2.pl";
    +
    +To do this, we need to:
    +
    +=over 4
    +
    +=item *
    +
    +Provide an option to select this if desired; maybe ... 
    +import('-cache' => 'auto/', ...)?
    +
    +=item *
    +
    +Figure out which directory we can/should write into.
    +
    +=item *
    +
    +Re-evaluate the textual code templates, without generating the
    +closures. Substitute in any _STATIC_ATTR_ values. Make other _ATTR_
    +values point to some public lookup table or package scalar.
    +
    +=item *
    +
    +Notice if the source file (or Class::MakeMethods modules) has
    +been updated more recently than the generated file.
    +
    +=back
    +
    +=back
    +
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +=cut
    diff --git a/lib/Class/MakeMethods/Emulator.pm b/lib/Class/MakeMethods/Emulator.pm
    new file mode 100644
    index 0000000..96786da
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Emulator.pm
    @@ -0,0 +1,165 @@
    +package Class::MakeMethods::Emulator;
    +
    +$VERSION = 1.009;
    +
    +########################################################################
    +### IMPORT BEHAVIOR: import(), _handle_namespace()
    +########################################################################
    +
    +@EXPORT_OK = qw( namespace_capture namespace_release );
    +sub import { 
    +  
    +  if ( scalar @_ == 2 and $_[1] eq '-isasubclass' ) {
    +    splice @_, 1, 1;
    +    my $target_class = ( caller )[0];
    +    no strict;
    +    push @{"$target_class\::ISA"}, $_[0];
    +  }
    +  
    +  if ( $_[0] eq __PACKAGE__ ) {
    +    require Exporter and goto &Exporter::import  # lazy Exporter
    +  }
    +}
    +
    +sub _handle_namespace {
    +  my $class = shift;
    +  my $emulation_target = shift;
    +  my $firstarg = shift or return;
    +  my $take = shift || '-take_namespace';
    +  my $release = shift || '-release_namespace';
    +  
    +  if ( $firstarg eq $take) {
    +    Class::MakeMethods::Emulator::namespace_capture($class, $emulation_target);
    +    return 1;
    +  } elsif ( $firstarg eq $release) {
    +    Class::MakeMethods::Emulator::namespace_release($class, $emulation_target);
    +    return 1;
    +  }
    +}
    +
    +########################################################################
    +### NAMESPACE MUNGING: _namespace_capture(), _namespace_release()
    +########################################################################
    +
    +sub namespace_capture {
    +  my $source_package = shift;
    +  my $target_package = shift;
    +
    +  # warn "Mapping $source_package over $target_package \n";
    +
    +  my $source_file = "$source_package.pm";
    +  $source_file =~ s{::}{/}g;
    +  
    +  my $target_file = "$target_package.pm";
    +  $target_file =~ s{::}{/}g;
    +  
    +  my $temp_package = $source_package . '::Target::' . $target_package;
    +  my $temp_file = "$temp_package.pm";
    +  $temp_file =~ s{::}{/}g;
    +  
    +  no strict;
    +  unless ( ${$temp_package . "::TargetCaptured"} ++ ) {
    +    *{$temp_package . "::"} = *{$target_package . "::"};
    +    $::INC{$temp_file} = $::INC{$target_file};
    +  }
    +  *{$target_package . "::"} = *{$source_package . "::"};
    +  $::INC{$target_file} = $::INC{$source_file}
    +}
    +
    +sub namespace_release {
    +  my $source_package = shift;
    +  my $target_package = shift;
    +  
    +  my $target_file = "$target_package.pm";
    +  $target_file =~ s{::}{/}g;
    +  
    +  my $temp_package = $source_package . '::Target::' . $target_package;
    +  my $temp_file = "$temp_package.pm";
    +  $temp_file =~ s{::}{/}g;
    +  
    +  no strict;
    +  unless ( ${"${temp_package}::TargetCaptured"} ) {
    +    Carp::croak("Can't _namespace_release: -take_namespace not called yet.");
    +  }
    +  *{$target_package . "::"} = *{$temp_package. "::"};
    +  $::INC{$target_file} = $::INC{$temp_file};
    +}
    +
    +########################################################################
    +
    +1;
    +
    +__END__
    +
    +
    +=head1 NAME
    +
    +Class::MakeMethods::Emulator - Demonstrate class-generator equivalency
    +
    +
    +=head1 SYNOPSIS
    +
    +  # Equivalent to use Class::Singleton;
    +  use Class::MakeMethods::Emulator::Singleton; 
    +  
    +  # Equivalent to use Class::Struct;
    +  use Class::MakeMethods::Emulator::Struct; 
    +  struct ( ... );
    +  
    +  # Equivalent to use Class::MethodMaker( ... );
    +  use Class::MakeMethods::Emulator::MethodMaker( ... );
    +  
    +  # Equivalent to use base 'Class::Inheritable';
    +  use base 'Class::MakeMethods::Emulator::Inheritable';
    +  MyClass->mk_classdata( ... );
    +  
    +  # Equivalent to use base 'Class::AccessorFast';
    +  use base 'Class::MakeMethods::Emulator::AccessorFast';
    +  MyClass->mk_accessors(qw(this that whatever));
    +  
    +  # Equivalent to use accessors( ... );
    +  use Class::MakeMethods::Emulator::accessors( ... );
    +  
    +  # Equivalent to use mcoder( ... );
    +  use Class::MakeMethods::Emulator::mcoder( ... );
    +
    +
    +=head1 DESCRIPTION
    +
    +In several cases, Class::MakeMethods provides functionality closely
    +equivalent to that of an existing module, and it is simple to map
    +the existing module's interface to that of Class::MakeMethods.
    +
    +Class::MakeMethods::Emulator provides emulators for Class::MethodMaker,
    +Class::Accessor::Fast, Class::Data::Inheritable, Class::Singleton,
    +Class::Struct, accessors, and mcoder, each of which passes the
    +original module's test suite, usually requiring only the addition
    +of a a single line to each test, activating the emulation module.
    +
    +Beyond demonstrating compatibility, these emulators also generally
    +indicate the changes needed to switch to direct use of Class::MakeMethods
    +functionality, illustrate commonalities between the various modules,
    +and serve as a source for new ideas that can be integrated into
    +Class::MakeMethods.
    +
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L, and L from CPAN.
    +
    +See L, and L from CPAN.
    +
    +See L, and L from CPAN.
    +
    +See L, and L from CPAN.
    +
    +See L, and L from CPAN.
    +
    +See L, and L from CPAN.
    +
    +See L, and L from CPAN.
    +
    +=cut
    +
    diff --git a/lib/Class/MakeMethods/Emulator/AccessorFast.pm b/lib/Class/MakeMethods/Emulator/AccessorFast.pm
    new file mode 100644
    index 0000000..0f47e04
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Emulator/AccessorFast.pm
    @@ -0,0 +1,102 @@
    +package Class::MakeMethods::Emulator::AccessorFast;
    +
    +use strict;
    +use Class::MakeMethods::Composite::Hash;
    +use Class::MakeMethods::Emulator '-isasubclass';
    +
    +sub _emulator_target { 'Class::Accessor::Fast' }
    +
    +sub import {
    +  my $class = shift;  
    +  $class->_handle_namespace( $class->_emulator_target, $_[0] ) and shift;
    +}
    +
    +########################################################################
    +
    +sub mk_accessors {
    +  Class::MakeMethods::Composite::Hash->make(
    +    -TargetClass => (shift),
    +    'new' => { name => 'new', modifier => 'with_values' },
    +    'scalar' => [ map { 
    +	$_, 
    +	"_${_}_accessor", { 'hash_key' => $_ } 
    +    } @_ ],
    +  );
    +}
    +
    +sub mk_ro_accessors {
    +  Class::MakeMethods::Composite::Hash->make(
    +    -TargetClass => (shift),
    +    'new' => { name => 'new', modifier => 'with_values' },
    +    'scalar' => [ map { 
    +	$_, { permit => 'ro' }, 
    +	"_${_}_accessor", { 'hash_key' => $_, permit => 'ro' }
    +    } @_ ],
    +  );
    +}
    +
    +sub mk_wo_accessors {
    +  Class::MakeMethods::Composite::Hash->make(
    +    -TargetClass => (shift),
    +    'new' => { name => 'new', modifier => 'with_values' },
    +    'scalar' => [ map { 
    +	$_, { permit => 'wo' }, 
    +	"_${_}_accessor", { 'hash_key' => $_, permit => 'wo' } 
    +    } @_ ],
    +  );
    +}
    +
    +########################################################################
    +
    +1;
    +
    +__END__
    +
    +
    +=head1 NAME
    +
    +Class::MakeMethods::Emulator::AccessorFast - Emulate Class::Accessor::Fast
    +
    +
    +=head1 SYNOPSIS
    +
    +    package Foo;
    +    
    +    use base qw(Class::MakeMethods::Emulator::AccessorFast);
    +    Foo->mk_accessors(qw(this that whatever));
    +    
    +    # Meanwhile, in a nearby piece of code!
    +    # Emulator::AccessorFast provides new().
    +    my $foo = Foo->new;
    +    
    +    my $whatever = $foo->whatever;    # gets $foo->{whatever}
    +    $foo->this('likmi');              # sets $foo->{this} = 'likmi'
    +
    +
    +=head1 DESCRIPTION
    +
    +This module emulates the functionality of Class::Accessor::Fast, using Class::MakeMethods to generate similar methods.
    +
    +You may use it directly, as shown in the SYNOPSIS above, 
    +
    +Furthermore, you may call  C to alias the Class::Accessor::Fast namespace
    +to this package, and subsequent calls to the original package will
    +be transparently handled by this emulator. To remove the emulation
    +aliasing, call C.
    +
    +B This affects B subsequent uses of Class::Accessor::Fast
    +in your program, including those in other modules, and might cause
    +unexpected effects.
    +
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +See L for documentation of the original module.
    +
    +=cut
    diff --git a/lib/Class/MakeMethods/Emulator/Inheritable.pm b/lib/Class/MakeMethods/Emulator/Inheritable.pm
    new file mode 100644
    index 0000000..90b0a91
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Emulator/Inheritable.pm
    @@ -0,0 +1,162 @@
    +package Class::MakeMethods::Emulator::Inheritable;
    +
    +use strict;
    +
    +use Class::MakeMethods::Template::ClassInherit;
    +use Class::MakeMethods::Emulator qw( namespace_capture namespace_release );
    +
    +my $emulation_target = 'Class::Data::Inheritable';
    +
    +sub import {
    +  my $mm_class = shift;
    +  if ( scalar @_ and $_[0] =~ /^-take_namespace/ and shift) {
    +    namespace_capture(__PACKAGE__, $emulation_target);
    +  } elsif ( scalar @_ and $_[0] =~ /^-release_namespace/ and shift) {
    +    namespace_release(__PACKAGE__, $emulation_target);
    +  }
    +  # The fallback should really be to NEXT::import.
    +  $mm_class->SUPER::import( @_ );
    +}
    +
    +########################################################################
    +
    +sub mk_classdata {
    +  my $declaredclass = shift;
    +  my $attribute = shift;
    +  Class::MakeMethods::Template::ClassInherit->make( 
    +    -TargetClass => $declaredclass, 
    +    'scalar' => [ -interface => { '*'=>'get_set', '_*_accessor'=>'get_set' },
    +		  $attribute ],
    +  );
    +  if ( scalar @_ ) {
    +    $declaredclass->$attribute( @_ );
    +  }
    +}
    +
    +########################################################################
    +
    +1;
    +
    +__END__
    +
    +=head1 NAME
    +
    +Class::MakeMethods::Emulator::Inheritable - Emulate Class::Inheritable
    +
    +
    +=head1 SYNOPSIS
    +
    +  package Stuff;
    +  use base qw(Class::MakeMethods::Emulator::Inheritable);
    +
    +  # Set up DataFile as inheritable class data.
    +  Stuff->mk_classdata('DataFile');
    +
    +  # Declare the location of the data file for this class.
    +  Stuff->DataFile('/etc/stuff/data');
    +
    +
    +=head1 DESCRIPTION
    +
    +This module is an adaptor that provides emulatation of Class::Data::Inheritable by invoking similiar functionality provided by Class::MakeMethods::ClassInherit.
    +
    +The public interface provided by Class::MakeMethods::Emulator::Inheritable is identical to that of Class::Data::Inheritable. 
    +
    +Class::Data::Inheritable is for creating accessor/mutators to class
    +data.  That is, if you want to store something about your class as a
    +whole (instead of about a single object).  This data is then inherited
    +by your subclasses and can be overriden.
    +
    +=head1 USAGE
    +
    +As specified by L, clients should inherit from this module and then invoke the mk_classdata() method for each class method desired:
    +
    +  Class->mk_classdata($data_accessor_name);
    +
    +This is a class method used to declare new class data accessors.  A
    +new accessor will be created in the Class using the name from
    +$data_accessor_name.  
    +
    +  Class->mk_classdata($data_accessor_name, $initial_value);
    +
    +You may also pass a second argument to initialize the value.
    +
    +To facilitate overriding, mk_classdata creates an alias to the
    +accessor, _field_accessor().  So Suitcase() would have an alias
    +_Suitcase_accessor() that does the exact same thing as Suitcase().
    +This is useful if you want to alter the behavior of a single accessor
    +yet still get the benefits of inheritable class data.  For example.
    +
    +  sub Suitcase {
    +      my($self) = shift;
    +      warn "Fashion tragedy" if @_ and $_[0] eq 'Plaid';
    +
    +      $self->_Suitcase_accessor(@_);
    +  }
    +
    +
    +=head1 COMPATIBILITY
    +
    +Note that the internal implementation of Class::MakeMethods::ClassInherit does not match that of Class::Data::Inheritable. In particular, Class::Data::Inheritable installs new methods in subclasses when they first initialize their value, while 
    +
    +=head1 EXAMPLE
    +
    +The example provided by L is equally applicable to this emulator.
    +
    +  package Pere::Ubu;
    +  use base qw(Class::MakeMethods::Emulator::Inheritable);
    +  Pere::Ubu->mk_classdata('Suitcase');
    +
    +will generate the method Suitcase() in the class Pere::Ubu.
    +
    +This new method can be used to get and set a piece of class data.
    +
    +  Pere::Ubu->Suitcase('Red');
    +  $suitcase = Pere::Ubu->Suitcase;
    +
    +The interesting part happens when a class inherits from Pere::Ubu:
    +
    +  package Raygun;
    +  use base qw(Pere::Ubu);
    +  
    +  # Raygun's suitcase is Red.
    +  $suitcase = Raygun->Suitcase;
    +
    +Raygun inherits its Suitcase class data from Pere::Ubu.
    +
    +Inheritance of class data works analgous to method inheritance.  As
    +long as Raygun does not "override" its inherited class data (by using
    +Suitcase() to set a new value) it will continue to use whatever is set
    +in Pere::Ubu and inherit further changes:
    +
    +  # Both Raygun's and Pere::Ubu's suitcases are now Blue
    +  Pere::Ubu->Suitcase('Blue');
    +
    +However, should Raygun decide to set its own Suitcase() it has now
    +"overridden" Pere::Ubu and is on its own, just like if it had
    +overriden a method:
    +
    +  # Raygun has an orange suitcase, Pere::Ubu's is still Blue.
    +  Raygun->Suitcase('Orange');
    +
    +Now that Raygun has overridden Pere::Ubu futher changes by Pere::Ubu
    +no longer effect Raygun.
    +
    +  # Raygun still has an orange suitcase, but Pere::Ubu is using Samsonite.
    +  Pere::Ubu->Suitcase('Samsonite');
    +
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +See L for documentation of the original module.
    +
    +See L for a discussion of class data in Perl.
    +
    +See L and L for inheritable data methods. 
    +
    +=cut
    +
    diff --git a/lib/Class/MakeMethods/Emulator/MethodMaker.pm b/lib/Class/MakeMethods/Emulator/MethodMaker.pm
    new file mode 100644
    index 0000000..4956ba3
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Emulator/MethodMaker.pm
    @@ -0,0 +1,676 @@
    +package Class::MakeMethods::Emulator::MethodMaker;
    +
    +use Class::MakeMethods '-isasubclass';
    +require Class::MakeMethods::Emulator;
    +
    +$VERSION = 1.03;
    +
    +use strict;
    +
    +=head1 NAME
    +
    +Class::MakeMethods::Emulator::MethodMaker - Emulate Class::MethodMaker 
    +
    +
    +=head1 SYNOPSIS
    +
    +  package MyObject;
    +  use Class::MakeMethods::Emulator::MethodMaker( 
    +    new_with_init => 'new',
    +    get_set       => [ qw / foo bar baz / ];
    +  );
    +
    +  ... OR ...
    +
    +  package MyObject;
    +  use Class::MakeMethods::Emulator::MethodMaker '-take_namespace';
    +  use Class::MethodMaker ( 
    +    new_with_init => 'new',
    +    get_set       => [ qw / foo bar baz / ];
    +  );
    +
    +
    +=head1 DESCRIPTION
    +
    +This module provides emulation of Class::MethodMaker, using the Class::MakeMethods framework.
    +
    +Although originally based on Class::MethodMaker, the calling convention
    +for Class::MakeMethods differs in a variety of ways; most notably, the names
    +given to various types of methods have been changed, and the format for
    +specifying method attributes has been standardized. This package uses
    +the aliasing capability provided by Class::MakeMethods, defining methods
    +that modify the declaration arguments as necessary and pass them off to
    +various subclasses of Class::MakeMethods.
    +
    +
    +=head1 COMPATIBILITY
    +
    +Full compatibility is maintained with version 1.03; some of the
    +changes in versions 1.04 through 1.10 are not yet included.
    +
    +The test suite from Class::MethodMaker version 1.10 is included
    +with this package, in the t/emulator_class_methodmaker/ directory. 
    +The unsupported tests have names ending in ".todo".
    +
    +The tests are unchanged from those in the Class::MethodMaker
    +distribution, except for the substitution of
    +C in the place of
    +C.
    +
    +In cases where earlier distributions of Class::MethodMaker contained
    +a different version of a test, it is also included. (Note that
    +version 0.92's get_concat returned '' for empty values, but in
    +version 0.96 this was changed to undef; this emulator follows the
    +later behavior. To avoid "use of undefined value" warnings from
    +the 0.92 version of get_concat.t, that test has been modified by
    +appending a new flag after the name, C<'get_concat --noundef'>,
    +which restores the earlier behavior.)
    +
    +
    +=head1 USAGE
    +
    +There are several ways to call this emulation module:
    +
    +=over 4
    +
    +=item *
    +
    +Direct Access
    +
    +Replace occurances in your code of C with C.
    +
    +=item *
    +
    +Install Emulation
    +
    +If you C, the Class::MethodMaker namespace will be aliased to this package, and calls to the original package will be transparently handled by this emulator.
    +
    +To remove the emulation aliasing, call C.
    +
    +B This affects B subsequent uses of Class::MethodMaker in your program, including those in other modules, and might cause unexpected effects.
    +
    +=item *
    +
    +The -sugar Option
    +
    +Passing '-sugar' as the first argument in a use or import call will cause the 'methods' package to be declared as an alias to this one.
    +
    +This allows you to write declarations in the following manner.
    +
    +  use Class::MakeMethods::Emulator::MethodMaker '-sugar';
    +
    +  make methods
    +    get_set => [ qw / foo bar baz / ],
    +    list    => [ qw / a b c / ];
    +
    +B This feature is deprecated in Class::MethodMaker version 0.96 and later. 
    +
    +=back
    +
    +=cut
    +
    +my $emulation_target = 'Class::MethodMaker';
    +
    +sub import {
    +  my $mm_class = shift;
    +  
    +  if ( scalar @_ and $_[0] =~ /^-take_namespace/ and shift ) {
    +    Class::MakeMethods::Emulator::namespace_capture(__PACKAGE__, $emulation_target);
    +  } elsif ( scalar @_ and $_[0] =~ /^-release_namespace/ and shift ) {
    +    Class::MakeMethods::Emulator::namespace_release(__PACKAGE__, $emulation_target);
    +  }
    +  
    +  if ( scalar @_ and $_[0] eq '-sugar' and shift ) {
    +    Class::MakeMethods::Emulator::namespace_capture(__PACKAGE__, "methods");
    +  }
    +  
    +  $mm_class->make( @_ ) if ( scalar @_ );
    +}
    +
    +
    +=head1 METHOD CATALOG
    +
    +B The documentation below is derived from version 1.02 of
    +Class::MethodMaker. Class::MakeMethods::Emulator::MethodMaker
    +provides support for all of the features and examples shown below,
    +with no changes required.
    +
    +
    +=head1 CONSTRUCTOR METHODS
    +
    +=head2 new
    +
    +Equivalent to Class::MakeMethods 'Template::Hash:new --with_values'.
    +
    +=cut
    +
    +sub new 	  { return 'Template::Hash:new --with_values' }
    +
    +
    +=head2 new_with_init
    +
    +Equivalent to Class::MakeMethods 'Template::Hash:new --with_init'.
    +
    +=cut
    +
    +sub new_with_init { return 'Template::Hash:new --with_init' }
    +
    +
    +=head2 new_hash_init
    +
    +Equivalent to Class::MakeMethods 'Template::Hash:new --instance_with_methods'.
    +
    +=cut
    +
    +sub new_hash_init { return 'Template::Hash:new --instance_with_methods' }
    +
    +
    +=head2 new_with_args
    +
    +Equivalent to Class::MakeMethods 'Template::Hash:new --with_values'.
    +
    +=cut
    +
    +sub new_with_args { return 'Template::Hash:new --with_values' }
    +
    +
    +=head2 copy
    +
    +Equivalent to Class::MakeMethods 'Template::Hash:new --copy_with_values'.
    +
    +=cut
    +
    +sub copy 	  { return 'Template::Hash:new --copy_with_values' }
    +
    +
    +=head1 SCALAR ACCESSORS
    +
    +=head2 get_set
    +
    +Basically equivalent to Class::MakeMethods 'Template::Hash:scalar', except that various arguments are intercepted and converted into the parallel Class::MakeMethods::Template interface declarations.
    +
    +=cut
    +
    +my $scalar_interface = { '*'=>'get_set', 'clear_*'=>'clear' };
    +
    +sub get_set 	  { 
    +  shift and return [ 
    +    ( ( $_[0] and $_[0] eq '-static' and shift ) ? 'Template::Static:scalar' 
    +						 : 'Template::Hash:scalar' ), 
    +    '-interface' => $scalar_interface, 
    +    map { 
    +      ( ref($_) eq 'ARRAY' ) 
    +	? ( '-interface'=>{ 
    +	  ( $_->[0] ? ( $_->[0] => 'get_set' ) : () ),
    +	  ( $_->[1] ? ( $_->[1] => 'clear' ) : () ),
    +	  ( $_->[2] ? ( $_->[2] => 'get' ) : () ),
    +	  ( $_->[3] ? ( $_->[3] => 'set_return' ) : () ),
    +	} ) 
    +	: ($_ eq '-compatibility') 
    +	    ? ( '-interface', $scalar_interface ) 
    +	    : ($_ eq '-noclear') 
    +		? ( '-interface', 'default' ) 
    +		: ( /^-/ ? "-$_" : $_ ) 
    +    } @_ 
    +  ]
    +}
    +
    +
    +=head2 get_concat
    +
    +Equivalent to Class::MakeMethods 'Template::Hash:string' with a special interface declaration that provides the get_concat and clear behaviors.
    +
    +=cut
    +
    +my $get_concat_interface = { 
    +  '*'=>'get_concat', 'clear_*'=>'clear', 
    +  '-params'=>{ 'join' => '', 'return_value_undefined' => undef() } 
    +};
    +
    +my $old_get_concat_interface = { 
    +  '*'=>'get_concat', 'clear_*'=>'clear', 
    +  '-params'=>{ 'join' => '', 'return_value_undefined' => '' } 
    +};
    +
    +sub get_concat 	  { 
    +  shift and return [ 'Template::Hash:string', '-interface', 
    +	( $_[0] eq '--noundef' ? ( shift and $old_get_concat_interface ) 
    +			       : $get_concat_interface ), @_ ]
    +}
    +
    +=head2  counter
    +
    +Equivalent to Class::MakeMethods 'Template::Hash:number --counter'.
    +
    +=cut
    +
    +sub counter 	  { return 'Template::Hash:number --counter' }
    +
    +
    +=head1 OBJECT ACCESSORS
    +
    +Basically equivalent to Class::MakeMethods 'Template::Hash:object' with an declaration that provides the "delete_x" interface. Due to a difference in expected argument syntax, the incoming arguments are revised before being delegated to Template::Hash:object.
    +
    +=cut
    +
    +my $object_interface = { '*'=>'get_set_init', 'delete_*'=>'clear' };
    +
    +sub object 	  { 
    +  shift and return [ 
    +    'Template::Hash:object', 
    +    '-interface' => $object_interface, 
    +    _object_args(@_) 
    +  ] 
    +}
    +
    +sub _object_args {
    +  my @meta_methods;
    +  ! (@_ % 2) or Carp::croak("Odd number of arguments for object declaration");
    +  while ( scalar @_ ) {
    +    my ($class, $list) = (shift(), shift());
    +    push @meta_methods, map {
    +      (! ref $_) ? { name=> $_, class=>$class } 	
    + 	 	 : { name=> $_->{'slot'}, class=>$class, 
    +		    delegate=>( $_->{'forward'} || $_->{'comp_mthds'} ) }
    +    } ( ( ref($list) eq 'ARRAY' ) ? @$list : ($list) );
    +  }
    +  return @meta_methods;
    +}
    +
    +
    +=head2 object_list
    +
    +Basically equivalent to Class::MakeMethods 'Template::Hash:object_list' with an declaration that provides the relevant helper methods. Due to a difference in expected argument syntax, the incoming arguments are revised before being delegated to Template::Hash:object_list.
    +
    +=cut
    +
    +my $array_interface = { 
    +  '*'=>'get_push', 
    +  '*_set'=>'set_items', 'set_*'=>'set_items', 
    +  map( ('*_'.$_ => $_, $_.'_*' => $_ ), 
    +	qw( pop push unshift shift splice clear count ref index )),
    +};
    +
    +sub object_list { 
    +  shift and return [ 
    +    'Template::Hash:array_of_objects', 
    +    '-interface' => $array_interface, 
    +    _object_args(@_) 
    +  ];
    +}
    +
    +=head2 forward
    +
    +Basically equivalent to Class::MakeMethods 'Template::Universal:forward_methods'. Due to a difference in expected argument syntax, the incoming arguments are revised before being delegated to Template::Universal:forward_methods.
    +
    +  forward => [ comp => 'method1', comp2 => 'method2' ]
    +
    +Define pass-through methods for certain fields.  The above defines that
    +method C will be handled by component C, whilst method
    +C will be handled by component C.
    +
    +=cut
    +
    +sub forward {
    +  my $class = shift;
    +  my @results;
    +  while ( scalar @_ ) { 
    +    my ($comp, $method) = ( shift, shift );
    +    push @results, { name=> $method, target=> $comp };
    +  }
    +  [ 'forward_methods', @results ]
    +}
    +
    +
    +
    +=head1 REFERENCE ACCESSORS
    +
    +=head2 list
    +
    +Equivalent to Class::MakeMethods 'Template::Hash:array' with a custom method naming interface.
    +
    +=cut
    +
    +sub list { 
    +  shift and return [ 'Template::Hash:array', '-interface' => $array_interface, @_ ];
    +}
    +
    +
    +=head2 hash
    +
    +Equivalent to Class::MakeMethods 'Template::Hash:hash' with a custom method naming interface.
    +
    +=cut
    +
    +my $hash_interface = { 
    +  '*'=>'get_push', 
    +  '*s'=>'get_push', 
    +  'add_*'=>'get_set_items', 
    +  'add_*s'=>'get_set_items', 
    +  'clear_*'=>'delete', 
    +  'clear_*s'=>'delete', 
    +  map {'*_'.$_ => $_} qw(push set keys values exists delete tally clear),
    +};
    +
    +sub hash { 
    +  shift and return [ 'Template::Hash:hash', '-interface' => $hash_interface, @_ ];
    +}
    +
    +
    +=head2 tie_hash
    +
    +Equivalent to Class::MakeMethods 'Template::Hash:tiedhash' with a custom method naming interface.
    +
    +=cut
    +
    +sub tie_hash { 
    +  shift and return [ 'Template::Hash:tiedhash', '-interface' => $hash_interface, @_ ];
    +}
    +
    +=head2 hash_of_lists
    +
    +Equivalent to Class::MakeMethods 'Template::Hash:hash_of_arrays', or if the -static flag is present, to 'Template::Static:hash_of_arrays'.
    +
    +=cut
    +
    +sub hash_of_lists { 
    +  shift and return ( $_[0] and $_[0] eq '-static' and shift ) 
    +	? [ 'Template::Static:hash_of_arrays', @_ ]
    +	: [ 'Template::Hash:hash_of_arrays', @_ ]
    +}
    +
    +
    +=head1 STATIC ACCESSORS
    +
    +=head2 static_get_set
    +
    +Equivalent to Class::MakeMethods 'Template::Static:scalar' with a custom method naming interface.
    +
    +=cut
    +
    +sub static_get_set { 
    +  shift and return [ 'Template::Static:scalar', '-interface', $scalar_interface, @_ ] 
    +}
    +
    +=head2 static_list
    +
    +Equivalent to Class::MakeMethods 'Template::Static:array' with a custom method naming interface.
    +
    +=cut
    +
    +sub static_list { 
    +  shift and return [ 'Template::Static:array', '-interface' => $array_interface, @_ ];
    +}
    +
    +=head2 static_hash
    +
    +Equivalent to Class::MakeMethods 'Template::Static:hash' with a custom method naming interface.
    +
    +=cut
    +
    +sub static_hash { 
    +  shift and return [ 'Template::Static:hash', '-interface' => $hash_interface, @_ ];
    +}
    +
    +
    +=head1 GROUPED ACCESSORS
    +
    +=head2 boolean
    +
    +Equivalent to Class::MakeMethods 'Template::Static:bits' with a custom method naming interface.
    +
    +=cut
    +
    +my $bits_interface = { 
    +  '*'=>'get_set', 'set_*'=>'set_true', 'clear_*'=>'set_false',
    +  'bit_fields'=>'bit_names', 'bits'=>'bit_string', 'bit_dump'=>'bit_hash' 
    +};
    +
    +sub boolean 	  { 
    +  shift and return [ 'Template::Hash:bits', '-interface' => $bits_interface, @_ ];
    +}
    +
    +
    +=head2 grouped_fields
    +
    +Creates get/set methods like get_set but also defines a method which
    +returns a list of the slots in the group.
    +
    +  use Class::MakeMethods::Emulator::MethodMaker
    +    grouped_fields => [
    +      some_group => [ qw / field1 field2 field3 / ],
    +    ];
    +
    +Its argument list is parsed as a hash of group-name => field-list
    +pairs. Get-set methods are defined for all the fields and a method with
    +the name of the group is defined which returns the list of fields in the
    +group.
    +
    +=cut
    +
    +sub grouped_fields {
    +  my ($class, %args) = @_;
    +  my @methods;
    +  foreach (keys %args) {
    +    my @slots = @{ $args{$_} };
    +    push @methods, 
    +	$_, sub { @slots },
    +	$class->make( 'get_set', \@slots );
    +  }
    +  return @methods;
    +}
    +
    +=head2 struct
    +
    +Equivalent to Class::MakeMethods 'Template::Hash::struct'.
    +
    +B This feature is included but not documented in Class::MethodMaker version 1. 
    +
    +
    +=cut
    +
    +sub struct	  { return 'Template::Hash:struct' }
    +
    +
    +=head1 INDEXED ACCESSORS
    +
    +=head2 listed_attrib
    +
    +Equivalent to Class::MakeMethods 'Template::Flyweight:boolean_index' with a custom method naming interface.
    +
    +=cut
    +
    +sub listed_attrib   { 
    +  shift and return [ 'Template::Flyweight:boolean_index', '-interface' => { 
    +	  '*'=>'get_set', 'set_*'=>'set_true', 'clear_*'=>'set_false',
    +	  '*_objects'=>'find_true', }, @_ ]
    +}
    +
    +
    +=head2 key_attrib
    +
    +Equivalent to Class::MakeMethods 'Template::Hash:string_index'.
    +
    +=cut
    +
    +sub key_attrib      { return 'Template::Hash:string_index' }
    +
    +=head2 key_with_create
    +
    +Equivalent to Class::MakeMethods 'Template::Hash:string_index --find_or_new'.
    +
    +=cut
    +
    +sub key_with_create { return 'Template::Hash:string_index --find_or_new'}
    +
    +
    +=head1 CODE ACCESSORS
    +
    +=head2 code
    +
    +Equivalent to Class::MakeMethods 'Template::Hash:code'.
    +
    +=cut
    +
    +sub code 	  { return 'Template::Hash:code' }
    +
    +
    +=head2 method
    +
    +Equivalent to Class::MakeMethods 'Template::Hash:code --method'.
    +
    +=cut
    +
    +sub method 	  { return 'Template::Hash:code --method' }
    +
    +
    +=head2 abstract
    +
    +Equivalent to Class::MakeMethods 'Template::Universal:croak --abstract'.
    +
    +=cut
    +
    +sub abstract { return 'Template::Universal:croak --abstract' }
    +
    +
    +=head1 ARRAY CONSTRUCTOR AND ACCESSORS
    +
    +=head2 builtin_class (EXPERIMENTAL)
    +
    +Equivalent to Class::MakeMethods 'Template::StructBuiltin:builtin_isa' with a modified argument order.
    +
    +=cut
    +
    +sub builtin_class { 
    +  shift and return [ 'Template::StructBuiltin:builtin_isa', 
    +			'-new_function'=>(shift), @{(shift)} ]
    +}
    +
    +=head1 CONVERSION
    +
    +If you wish to convert your code from use of the Class::MethodMaker emulator to direct use of Class::MakeMethods, you will need to adjust the arguments specified in your C or C calls.
    +
    +Often this is simply a matter of replacing the names of aliased method-types listed below with the new equivalents.
    +
    +For example, suppose that you code contained the following declaration:
    +
    +  use Class::MethodMaker ( 
    +    counter => [ 'foo' ]
    +  );
    +
    +Consulting the listings below you can find that C is an alias for C and you could thus revise your declaration to read:
    +
    +  use Class::MakeMethods ( 
    +    'Hash:number --counter' => [ 'foo' ] 
    +  );
    +
    +However, note that those methods marked "(with custom interface)" below have a different default naming convention for helper methods in Class::MakeMethods, and you will need to either supply a similar interface or alter your module's calling interface. 
    +
    +Also note that the C, C, and C method types, marked "(with modified arguments)" below, require their arguments to be specified differently. 
    +
    +See L for more information about the default interfaces of these method types.
    +
    +
    +=head2 Hash methods
    +
    +The following equivalencies are declared for old meta-method names that are now handled by the Hash implementation:
    +
    +  new 		   'Template::Hash:new --with_values'
    +  new_with_init    'Template::Hash:new --with_init'
    +  new_hash_init    'Template::Hash:new --instance_with_methods'
    +  copy	 	   'Template::Hash:copy'
    +  get_set 	   'Template::Hash:scalar' (with custom interfaces)
    +  counter 	   'Template::Hash:number --counter'
    +  get_concat 	   'Template::Hash:string --get_concat' (with custom interface)
    +  boolean 	   'Template::Hash:bits' (with custom interface)
    +  list 		   'Template::Hash:array' (with custom interface)
    +  struct           'Template::Hash:struct'
    +  hash	 	   'Template::Hash:hash' (with custom interface)
    +  tie_hash 	   'Template::Hash:tiedhash' (with custom interface)
    +  hash_of_lists    'Template::Hash:hash_of_arrays'
    +  code 		   'Template::Hash:code'
    +  method 	   'Template::Hash:code --method'
    +  object 	   'Template::Hash:object' (with custom interface and modified arguments)
    +  object_list 	   'Template::Hash:array_of_objects' (with custom interface and modified arguments)
    +  key_attrib       'Template::Hash:string_index'
    +  key_with_create  'Template::Hash:string_index --find_or_new'
    +
    +=head2 Static methods
    +
    +The following equivalencies are declared for old meta-method names
    +that are now handled by the Static implementation:
    +
    +  static_get_set   'Template::Static:scalar' (with custom interface)
    +  static_hash      'Template::Static:hash' (with custom interface)
    +
    +=head2 Flyweight method
    +
    +The following equivalency is declared for the one old meta-method name
    +that us now handled by the Flyweight implementation:
    +
    +  listed_attrib   'Template::Flyweight:boolean_index'
    +
    +=head2 Struct methods
    +
    +The following equivalencies are declared for old meta-method names
    +that are now handled by the Struct implementation:
    +
    +  builtin_class   'Template::Struct:builtin_isa'
    +
    +=head2 Universal methods
    +
    +The following equivalencies are declared for old meta-method names
    +that are now handled by the Universal implementation:
    +
    +  abstract         'Template::Universal:croak --abstract'
    +  forward          'Template::Universal:forward_methods' (with modified arguments)
    +
    +
    +=head1 EXTENDING
    +
    +In order to enable third-party subclasses of MethodMaker to run under this emulator, several aliases or stub replacements are provided for internal Class::MethodMaker methods which have been eliminated or renamed.
    +
    +=over 4
    +
    +=item *
    +
    +install_methods - now simply return the desired methods
    +
    +=item *
    +
    +find_target_class - now passed in as the target_class attribute
    +
    +=item *
    +
    +ima_method_maker - no longer supported; use target_class instead
    +
    +=back
    +
    +=cut
    +
    +sub find_target_class { (shift)->_context('TargetClass') }
    +sub get_target_class { (shift)->_context('TargetClass') }
    +sub install_methods { (shift)->_install_methods(@_) }
    +sub ima_method_maker { 1 }
    +
    +
    +=head1 BUGS
    +
    +This module aims to provide a 100% compatible drop-in replacement for Class::MethodMaker; if you detect a difference when using this emulation, please inform the author. 
    +
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +See L for more information about the original module.
    +
    +A good introduction to Class::MethodMaker is provided by pages 222-234 of I, by Damian Conway (Manning, 1999).
    +
    +  http://www.browsebooks.com/Conway/ 
    +
    +=cut
    +
    +1;
    diff --git a/lib/Class/MakeMethods/Emulator/Singleton.pm b/lib/Class/MakeMethods/Emulator/Singleton.pm
    new file mode 100644
    index 0000000..c47ad9e
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Emulator/Singleton.pm
    @@ -0,0 +1,85 @@
    +package Class::MakeMethods::Emulator::Singleton;
    +
    +use strict;
    +require Class::MakeMethods::Emulator;
    +
    +my $emulation_target = 'Class::Singleton';
    +
    +sub import {
    +  my $mm_class = shift;
    +  if ( scalar @_ and $_[0] =~ /^-take_namespace/ and shift) {
    +    Class::MakeMethods::Emulator::namespace_capture(__PACKAGE__, $emulation_target);
    +  } elsif ( scalar @_ and $_[0] =~ /^-release_namespace/ and shift) {
    +    Class::MakeMethods::Emulator::namespace_release(__PACKAGE__, $emulation_target);
    +  }
    +  # The fallback should really be to NEXT::import.
    +  $mm_class->SUPER::import( @_ );
    +}
    +
    +########################################################################
    +
    +use Class::MakeMethods (
    +  'Template::Hash:new --with_values' => '_new_instance',
    +  'Template::ClassVar:instance --get_init' => [ 'instance', 
    +			{new_method=>'_new_instance', variable=>'_instance'} ]
    +);
    +
    +########################################################################
    +
    +1;
    +
    +__END__
    +
    +=head1 NAME
    +
    +Class::MakeMethods::Emulator::Singleton - Emulate Class::Singleton
    +
    +
    +=head1 SYNOPSIS
    +
    +  use Class::MakeMethods::Emulator::Singleton; 
    +  
    +  # returns a new instance
    +  my $one = Class::MakeMethods::Emulator::Singleton->instance();
    +
    +  # returns same instance
    +  my $two = Class::MakeMethods::Emulator::Singleton->instance();   
    +
    +
    +=head1 COMPATIBILITY
    +
    +This module emulates the functionality of Class::Singleton, using Class::MakeMethods to generate similar methods.
    +
    +You may use it directly, as shown in the SYNOPSIS above, 
    +
    +Furthermore, you may call  C to alias the Class::Singleton namespace to this package, and subsequent calls to the original package will be transparently handled by this emulator. To remove the emulation aliasing, call C.
    +
    +B This affects B subsequent uses of Class::Singleton in your program, including those in other modules, and might cause unexpected effects.
    +
    +
    +=head1 DESCRIPTION
    +
    +A Singleton describes an object class that can have only one instance
    +in any system.  An example of a Singleton might be a print spooler
    +or system registry.  This module implements a Singleton class from
    +which other classes can be derived.  By itself, the Class::Singleton
    +module does very little other than manage the instantiation of a
    +single object.  In deriving a class from Class::Singleton, your
    +module will inherit the Singleton instantiation method and can
    +implement whatever specific functionality is required.
    +
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +See L for documentation of the original module.
    +
    +For a description and discussion of the Singleton class, see 
    +"Design Patterns", Gamma et al, Addison-Wesley, 1995, ISBN 0-201-63361-2.
    +
    +See L and L for documentation of the created methods.
    +
    +=cut
    diff --git a/lib/Class/MakeMethods/Emulator/Struct.pm b/lib/Class/MakeMethods/Emulator/Struct.pm
    new file mode 100644
    index 0000000..4dad355
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Emulator/Struct.pm
    @@ -0,0 +1,154 @@
    +package Class::MakeMethods::Emulator::Struct;
    +
    +use strict;
    +
    +use Class::MakeMethods;
    +
    +use vars qw(@ISA @EXPORT);
    +require Exporter;
    +push @ISA, qw(Exporter);
    +@EXPORT = qw(struct);
    +
    +sub import {
    +  my $self = shift;
    +  
    +  if ( @_ == 0 ) {
    +    $self->export_to_level( 1, $self, @EXPORT );
    +  } elsif ( @_ == 1 ) {
    +    $self->export_to_level( 1, $self, @_ );
    +  } else {
    +    &struct;
    +  }
    +}
    +
    +########################################################################
    +
    +my %type_map = ( 
    +  '$' => 'scalar', 
    +  '@' => 'array', 
    +  '%' => 'hash',
    +  '_' => 'object',
    +);
    +
    +sub struct {
    +  my ($class, @decls);
    +  my $base_type = ref $_[1] ;
    +  if ( $base_type eq 'HASH' ) {
    +      $base_type = 'Standard::Hash';
    +      $class = shift;
    +      @decls = %{shift()};
    +      _usage_error() if @_;
    +  }
    +  elsif ( $base_type eq 'ARRAY' ) {
    +      $base_type = 'Standard::Array';
    +      $class = shift;
    +      @decls = @{shift()};
    +      _usage_error() if @_;
    +  }
    +  else {
    +      $base_type = 'Standard::Array';
    +      $class = (caller())[0];
    +      @decls = @_;
    +  }
    +  _usage_error() if @decls % 2 == 1;
    +  
    +  my @rewrite;
    +  while ( scalar @decls ) {
    +    my ($name, $type) = splice(@decls, 0, 2);
    +    push @rewrite, $type_map{$type} 
    +      ? ( $type_map{$type} => { 'name'=>$name, auto_init=>1 } )
    +      : ( $type_map{'_'}   => { 'name'=>$name, 'class'=>$type, auto_init=>1 } );
    +  }
    +  Class::MakeMethods->make( 
    +    -TargetClass => $class,
    +    -MakerClass => $base_type,
    +    "new" => 'new', 
    +     @rewrite
    +  );
    +}
    +
    +sub _usage_error {
    +  require Carp;
    +  Carp::confess "struct usage error";
    +}
    +
    +########################################################################
    +
    +1;
    +
    +__END__
    +
    +=head1 NAME
    +
    +Class::MakeMethods::Emulator::Struct - Emulate Class::Struct
    +
    +
    +=head1 SYNOPSIS
    +
    +  use Class::MakeMethods::Emulator::Struct; 
    +  
    +  struct ( 
    +      simple  => '$',
    +      ordered => '@', 
    +      mapping => '%',
    +      obj_ref => 'FooObject' 
    +  );
    +
    +
    +=head1 DESCRIPTION
    +
    +This module emulates the functionality of Class::Struct by munging the provided field-declaration arguments to match those expected by Class::MakeMethods.
    +
    +It supports the same four types of accessors, the choice of array-based or hash-based objects, and the choice of installing methods in the current package or a specified target. 
    +
    +
    +=head1 EXAMPLE
    +
    +The below three declarations create equivalent methods for a simple hash-based class with a constructor and four accessors.
    +
    +  use Class::Struct;
    +  struct ( 
    +      simple  => '$',
    +      ordered => '@', 
    +      mapping => '%',
    +      obj_ref => 'FooObject' 
    +  );
    +  
    +  use Class::MakeMethods::Emulator::Struct; 
    +  struct ( 
    +      simple  => '$',
    +      ordered => '@', 
    +      mapping => '%',
    +      obj_ref => 'FooObject' 
    +    );
    +  
    +  use Class::MakeMethods ( 
    +      -MakerClass		=> 'Standard::Array',
    +      'new'			=> 'new',
    +      'scalar'			=> 'simple',
    +      'array -auto_init 1'	=> 'ordered', 
    +      'hash -auto_init 1'	=> 'mapping',
    +      'object -auto_init 1'	=> '-class FooObject obj_ref' 
    +    );
    +
    +=head1 COMPATIBILITY
    +
    +This module aims to offer a "95% compatible" drop-in replacement for the core Class::Struct module for purposes of comparison and code migration. 
    +
    +The C test for the core Class::Struct module is included with this package. The test is unchanged except for the a direct substitution of this emulator's name in the place of the core module.
    +
    +However, there are numerous internal differences between the methods generated by the original Class::Struct and this emulator, and some existing code may not work correctly without modification. 
    +
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +See L for documentation of the original module.
    +
    +See L and L for documentation of the created methods.
    +
    +=cut
    +
    diff --git a/lib/Class/MakeMethods/Emulator/accessors.pm b/lib/Class/MakeMethods/Emulator/accessors.pm
    new file mode 100644
    index 0000000..69c3bb8
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Emulator/accessors.pm
    @@ -0,0 +1,122 @@
    +package Class::MakeMethods::Emulator::accessors;
    +
    +$VERSION = '0.02';
    +
    +use Class::MakeMethods::Emulator '-isasubclass';
    +use Class::MakeMethods::Template::Hash '-isasubclass';
    +
    +sub _emulator_target { 'accessors' }
    +sub _accessor_type { 'scalar --get_set_chain' }
    +
    +sub import {
    +  my $class = shift;
    +  
    +  $class->_handle_namespace( $class->_emulator_target, $_[0] ) and shift;
    +  
    +  foreach ( @_ ) { 
    +    die "invalid accessor - $_" unless ( /\A[a-z]\w+\z/i and 
    +					 $_ ne 'DESTROY' and $_ ne 'AUTOLOAD' )
    +  }
    +  
    +  $class->make($class->_accessor_type => [@_]);
    +}
    +
    +########################################################################
    +
    +package Class::MakeMethods::Emulator::accessors::chained;
    +@ISA = 'Class::MakeMethods::Emulator::accessors';
    +$INC{'Class/MakeMethods/Emulator/accessors/chained.pm'} = 
    +			$INC{'Class/MakeMethods/Emulator/accessors.pm'};
    +
    +sub _emulator_target { 'accessors::chained' }
    +sub _accessor_type { 'scalar --get_set_chain' }
    +
    +########################################################################
    +
    +package Class::MakeMethods::Emulator::accessors::classic;
    +@ISA = 'Class::MakeMethods::Emulator::accessors';
    +$INC{'Class/MakeMethods/Emulator/accessors/classic.pm'} = 
    +			$INC{'Class/MakeMethods/Emulator/accessors.pm'};
    +
    +sub _emulator_target { 'accessors::classic' }
    +sub _accessor_type { 'scalar' }
    +
    +########################################################################
    +
    +1;
    +
    +__END__
    +
    +
    +=head1 NAME
    +
    +Class::MakeMethods::Emulator::accessors - Emulate the accessors module
    +
    +
    +=head1 SYNOPSIS
    +
    +  package Foo;
    +  use Class::MakeMethods::Emulator::accessors qw( foo bar baz );
    +  
    +  my $obj = bless {}, 'Foo';
    +  
    +  # generates chaining accessors:
    +  $obj->foo( 'hello ' )
    +      ->bar( 'world' )
    +      ->baz( "!\n" );
    +  
    +  print $obj->foo, $obj->bar, $obj->baz;
    +
    +This module also defines subpackages for the classic and chaining subclasses:
    +
    +  package Bar;
    +  use Class::MakeMethods::Emulator::accessors;
    +  use Class::MakeMethods::Emulator::accessors::classic qw( foo bar baz );
    +
    +  my $obj = bless {}, 'Bar';
    +
    +  # always return the current value, even on set:
    +  $obj->foo( 'hello ' ) if $obj->bar( 'world' );
    +
    +  print $obj->foo, $obj->bar, $obj->baz( "!\n" );
    +
    +
    +=head1 DESCRIPTION
    +
    +This module emulates the functionality of the accessors module, using
    +Class::MakeMethods to generate similar methods. 
    +
    +In particular, the following lines are equivalent:
    +
    +  use accessors 'foo';
    +  use Class::MakeMethods::Template::Hash 'scalar --get_set_chain' => 'foo';
    +
    +  use accessors::chained 'foo';
    +  use Class::MakeMethods::Template::Hash 'scalar --get_set_chain' => 'foo';
    +
    +  use accessors::classic 'foo';
    +  use Class::MakeMethods::Template::Hash 'scalar' => 'foo';
    +
    +You may use this module directly, as shown in the SYNOPSIS above,
    +
    +Furthermore, you may call C to alias the accessors namespace to this package,
    +and subsequent calls to the original package will be transparently
    +handled by this emulator. To remove the emulation aliasing, call
    +C. 
    +The same mechanism is also available for the classic and chained subclasses.
    +
    +B This affects B subsequent uses of the accessors module in
    +your program, including those in other modules, and might cause
    +unexpected effects.
    +
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +See L for documentation of the original module.
    +
    +=cut
    diff --git a/lib/Class/MakeMethods/Emulator/mcoder.pm b/lib/Class/MakeMethods/Emulator/mcoder.pm
    new file mode 100644
    index 0000000..84ef034
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Emulator/mcoder.pm
    @@ -0,0 +1,116 @@
    +package Class::MakeMethods::Emulator::mcoder;
    +
    +$VERSION = '0.05';
    +
    +use Class::MakeMethods::Emulator '-isasubclass';
    +use Class::MakeMethods::Template '-isasubclass';
    +
    +########################################################################
    +
    +sub import {
    +  my $class = shift;
    +  ( my $target = $class ) =~ s/^Class::MakeMethods::Emulator:://;
    +  $class->_handle_namespace( $target, $_[0] ) and shift;
    +  $class->make( @_ ) if ( scalar @_ );
    +}
    +
    +
    +sub new        { 'Template::Hash::new --with_values' }
    +sub proxy      { 'Template::Universal:forward_methods -target' }
    +sub generic    { { '-import' => { 'Template::Hash:scalar' => '*' } } }
    +sub get        { { interface => { default => { '*'       =>'get' } } } }
    +sub set        { { interface => { default => { 'set_*'   =>'set' } } } }
    +sub undef      { { interface => { default => { 'undef_*' =>'clear' } } } }
    +sub delete     { { interface => { default => { 'delete_*'=>'hash_delete' } } } }
    +sub bool_set   { { interface => { default => { 'set_*'   =>'set_value' } },
    +		   '-import' => { 'Template::Hash:boolean' => '*' } } }
    +sub bool_unset { { interface => { default => { 'unset_*' =>'clear' } } } }
    +sub calculated { { interface => { default => { '*'       =>'get_init' } },
    +		   params    => { init_method=>'_calculate_*' } } }
    +
    +########################################################################
    +
    +foreach my $type ( qw( new get set proxy calculated ) ) {
    +  $INC{"Class/MakeMethods/Emulator/mcoder/$type.pm"} = 
    +			     $INC{"mcoder/$type.pm"} = __FILE__;
    +  *{__PACKAGE__ . "::${type}::import"} = sub {
    +    (shift) and (__PACKAGE__)->make( $type => [ @_ ] )
    +  };
    +}
    +
    +########################################################################
    +
    +1;
    +
    +__END__
    +
    +package Class::MakeMethods::Emulator::mcoder::get;
    +@ISA = 'Class::MakeMethods::Emulator::mcoder';
    +$INC{"Class/MakeMethods/Emulator/mcoder/get.pm"} = __FILE__;
    +sub import { goto &Class::MakeMethods::Emulator::mcoder::sub_import }
    +
    +package Class::MakeMethods::Emulator::mcoder::set;
    +@ISA = 'Class::MakeMethods::Emulator::mcoder';
    +$INC{"Class/MakeMethods/Emulator/mcoder/set.pm"} = __FILE__;
    +sub import { goto &Class::MakeMethods::Emulator::mcoder::sub_import }
    +
    +package Class::MakeMethods::Emulator::mcoder::proxy;
    +@ISA = 'Class::MakeMethods::Emulator::mcoder';
    +$INC{"Class/MakeMethods/Emulator/mcoder/proxy.pm"} = __FILE__;
    +sub import { goto &Class::MakeMethods::Emulator::mcoder::sub_import }
    +
    +
    +1;
    +
    +__END__
    +
    +=head1 NAME
    +
    +Class::MakeMethods::Emulator::mcoder - Emulate the mcoder module
    +
    +
    +=head1 SYNOPSIS
    +
    +  package MyClass;
    +
    +  use Class::MakeMethods::Emulator::mcoder 
    +           [qw(get set)] => [qw(color sound height)], 
    +           proxy => [qw(runner run walk stop)], 
    +           calculated => weight;
    +
    +  sub _calculate_weight { shift->ask_weight }
    +
    +
    +=head1 DESCRIPTION
    +
    +This module emulates the functionality of the mcoder module, using
    +Class::MakeMethods to generate similar methods. 
    +
    +For example, the following lines are equivalent:
    +
    +  use mcoder 'get' => 'foo';
    +  use mcoder::get 'foo';
    +  use Class::MakeMethods::Template::Hash 'scalar --get' => 'foo';
    +
    +You may use this module directly, as shown in the SYNOPSIS above,
    +or you may call C to alias the mcoder namespace to this package,
    +and subsequent calls to the original package will be transparently
    +handled by this emulator. To remove the emulation aliasing, call
    +C.
    +The same mechanism is also available for the "sugar" subclasses.
    +
    +B This affects B subsequent uses of the mcoder module in
    +your program, including those in other modules, and might cause
    +unexpected effects.
    +
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +See L< mcoder> for documentation of the original module.
    +
    +=cut
    diff --git a/lib/Class/MakeMethods/Evaled.pm b/lib/Class/MakeMethods/Evaled.pm
    new file mode 100644
    index 0000000..233c9c6
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Evaled.pm
    @@ -0,0 +1,97 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Evaled - Make methods with simple string evals
    +
    +
    +=head1 SYNOPSIS
    +
    +  package MyObject;
    +  use Class::MakeMethods::Evaled::Hash (
    +    new => 'new',
    +    scalar => [ 'foo', 'bar' ],
    +    array => 'my_list',
    +    hash => 'my_index',
    +  );
    +
    +
    +=head1 DESCRIPTION
    +
    +This document describes the various subclasses of Class::MakeMethods
    +included under the Evaled::* namespace, and the method types each
    +one provides.
    +
    +The Evaled subclasses generate methods using a simple string templating mechanism and basic string evals.
    +
    +
    +=head2 Calling Conventions
    +
    +When you C this package, the method names you provide
    +as arguments cause subroutines to be generated and installed in
    +your module.
    +
    +See L for more information.
    +
    +=head2 Declaration Syntax
    +
    +To declare methods, pass in pairs of a method-type name followed
    +by one or more method names. 
    +
    +Valid method-type names for this package are listed in L<"METHOD
    +GENERATOR TYPES">.
    +
    +See L and L for more information.
    +
    +=cut
    +
    +package Class::MakeMethods::Evaled;
    +
    +$VERSION = 1.000;
    +use strict;
    +use Carp;
    +
    +use Class::MakeMethods::Standard '-isasubclass';
    +use Class::MakeMethods::Utility::TextBuilder 'text_builder';
    +
    +########################################################################
    +
    +=head2 About Evaled Methods
    +
    +
    +=cut
    +
    +sub evaled_methods {
    +  my $class = shift;
    +  my $template = shift;
    +  my $package = $Class::MakeMethods::CONTEXT{TargetClass};
    +  my @declarations = $class->_get_declarations( @_ );
    +  my @code_chunks;
    +  foreach my $method ( @declarations ) {
    +    my $code = $template;
    +    $code =~ s/__(\w+?)__/$method->{lc $1}/eg;
    +
    +    # my $code = text_builder( $template, { 
    +    #   '__NAME__' => $method->{name}, 
    +    #   '__METHOD__{}' => $method, 
    +    #   '__CONTEXT__{}' => $Class::MakeMethods::CONTEXT,
    +    # } );
    +
    +    push @code_chunks, $code;
    +  }
    +  my $code = join( "\n", "package $package;", @code_chunks, "1;" );
    +  eval $code; 
    +  $@ and Class::MakeMethods::_diagnostic('inst_eval_syntax', 'from eval', $@, $code);
    +  return;
    +}
    +
    +########################################################################
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +For distribution, installation, support, copyright and license 
    +information, see L.
    +
    +=cut
    +
    +1;
    diff --git a/lib/Class/MakeMethods/Evaled/Hash.pm b/lib/Class/MakeMethods/Evaled/Hash.pm
    new file mode 100644
    index 0000000..e306c76
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Evaled/Hash.pm
    @@ -0,0 +1,349 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Evaled::Hash - Typical hash methods
    +
    +
    +=head1 SYNOPSIS
    +
    +  package MyObject;
    +  use Class::MakeMethods::Evaled::Hash (
    +    new => 'new',
    +    scalar => [ 'foo', 'bar' ],
    +    array => 'my_list',
    +    hash => 'my_index',
    +  );
    +  ...
    +  
    +  # Constructor
    +  my $obj = MyObject->new( foo => 'Foozle' );
    +  
    +  # Scalar Accessor
    +  print $obj->foo();
    +  
    +  $obj->bar('Barbados'); 
    +  print $obj->bar();
    +  
    +  # Array accessor
    +  $obj->my_list(0 => 'Foozle', 1 => 'Bang!');
    +  print $obj->my_list(1);
    +  
    +  # Hash accessor
    +  $obj->my_index('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  print $obj->my_index('foo');
    +
    +
    +=head1 DESCRIPTION
    +
    +The Evaled::Hash subclass of MakeMethods provides a simple constructor and accessors for blessed-hash object instances.
    +
    +=head2 Calling Conventions
    +
    +When you C this package, the method names you provide
    +as arguments cause subroutines to be generated and installed in
    +your module.
    +
    +See L for a summary, or L for full details.
    +
    +=head2 Declaration Syntax
    +
    +To declare methods, pass in pairs of a method-type name followed
    +by one or more method names. Valid method-type names for this
    +package are listed in L<"METHOD GENERATOR TYPES">.
    +
    +See L for more
    +syntax information.
    +
    +
    +=cut
    +
    +package Class::MakeMethods::Evaled::Hash;
    +
    +$VERSION = 1.000;
    +use strict;
    +use Class::MakeMethods::Evaled '-isasubclass';
    +
    +########################################################################
    +
    +=head1 METHOD GENERATOR TYPES
    +
    +=head2 new - Constructor
    +
    +For each method name passed, returns a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +If called as a class method, makes a new hash and blesses it into that class.
    +
    +=item *
    +
    +If called on a hash-based instance, makes a copy of it and blesses the copy into the same class as the original instance.
    +
    +=item *
    +
    +If passed a list of key-value pairs, appends them to the new hash. These arguments override any copied values, and later arguments with the same name will override earlier ones.
    +
    +=item *
    +
    +Returns the new instance.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Evaled::Hash (
    +    new => 'new',
    +  );
    +  ...
    +  
    +  # Bare constructor
    +  my $empty = MyObject->new();
    +  
    +  # Constructor with initial values
    +  my $obj = MyObject->new( foo => 'Foozle', bar => 'Barbados' );
    +  
    +  # Copy with overriding value
    +  my $copy = $obj->new( bar => 'Bob' );
    +
    +=cut
    +
    +sub new {
    +  (shift)->evaled_methods( q{
    +    sub __NAME__ {
    +      my $callee = shift;
    +      if ( ref $callee ) {
    +	bless { %$callee, @_ }, ref $callee;
    +      } else {
    +	bless { @_ }, $callee;
    +      }
    +    }
    +  }, @_ )
    +}
    +
    +########################################################################
    +
    +=head2 scalar - Instance Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on a hash-based instance.
    +
    +=item *
    +
    +Uses the method name as a hash key to access the related value for each instance.
    +
    +=item *
    +
    +If called without any arguments returns the current value.
    +
    +=item *
    +
    +If called with an argument, stores that as the value, and returns it, 
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Evaled::Hash (
    +    scalar => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  $obj->foo('Foozle');
    +  
    +  # Retrieve value
    +  print $obj->foo;
    +
    +=cut
    +
    +sub scalar {
    +  (shift)->evaled_methods( q{
    +    sub __NAME__ {
    +      my $self = shift;
    +      if ( scalar @_ ) {
    +	$self->{'__NAME__'} = shift;
    +      } else {
    +	$self->{'__NAME__'};
    +      }
    +    }
    +  }, @_ )
    +}
    +
    +########################################################################
    +
    +=head2 array - Instance Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on a hash-based instance.
    +
    +=item *
    +
    +Uses the method name as a hash key to access the related value for each instance.
    +
    +=item * 
    +
    +The value for each instance will be a reference to an array (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the current array-ref value (or undef).
    +
    +=item *
    +
    +If called with one argument, uses that argument as an index to retrieve from the referenced array, and returns that value (or undef). 
    +
    +=item *
    +
    +If called with a list of index-value pairs, stores the value at the given index in the referenced array. If the instance's value was previously undefined, a new array is autovivified. The current value in each position will be overwritten, and later arguments with the same index will override earlier ones. Returns the current array-ref value.
    +
    +=back
    +
    +Sample declaration and usage:
    +  
    +  package MyObject;
    +  use Class::MakeMethods::Evaled::Hash (
    +    array => 'bar',
    +  );
    +  ...
    +  
    +  # Set values by position
    +  $obj->bar(0 => 'Foozle', 1 => 'Bang!');
    +  
    +  # Positions may be overwritten, and in any order
    +  $obj->bar(2 => 'And Mash', 1 => 'Blah!');
    +  
    +  # Retrieve value by position
    +  print $obj->bar(1);
    +    
    +  # Direct access to referenced array
    +  print scalar @{ $obj->bar() };
    +  
    +  # Reset the array contents to empty
    +  @{ $obj->bar() } = ();
    +
    +=cut
    +
    +sub array {
    +  (shift)->evaled_methods( q{
    +    sub __NAME__ {
    +      my $self = shift;
    +      if ( scalar(@_) == 0 ) {
    +	return $self->{'__NAME__'};
    +      } elsif ( scalar(@_) == 1 ) {
    +	$self->{'__NAME__'}->[ shift() ];
    +      } elsif ( scalar(@_) % 2 ) {
    +	Carp::croak "Odd number of items in assigment to __NAME__";
    +      } else {
    +	while ( scalar(@_) ) {
    +	  my $key = shift();
    +	  $self->{'__NAME__'}->[ $key ] = shift();
    +	}
    +	return $self->{'__NAME__'};
    +      }
    +    }
    +  }, @_ )
    +}
    +
    +########################################################################
    +
    +=head2 hash - Instance Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on a hash-based instance.
    +
    +=item *
    +
    +Uses the method name as a hash key to access the related value for each instance.
    +
    +=item * 
    +
    +The value for each instance will be a reference to a hash (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the current hash-ref value (or undef).
    +
    +=item *
    +
    +If called with one argument, uses that argument as an index to retrieve from the referenced hash, and returns that value (or undef). 
    +
    +=item *
    +
    +If called with a list of key-value pairs, stores the value under the given key in the referenced hash. If the instance's value was previously undefined, a new hash is autovivified. The current value under each key will be overwritten, and later arguments with the same key will override earlier ones. Returns the current hash-ref value.
    +
    +=back
    +
    +Sample declaration and usage:
    +  
    +  package MyObject;
    +  use Class::MakeMethods::Evaled::Hash (
    +    hash => 'baz',
    +  );
    +  ...
    +  
    +  # Set values by key
    +  $obj->baz('foo' => 'Foozle', 'bar' => 'Bang!');
    +  
    +  # Values may be overwritten, and in any order
    +  $obj->baz('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  
    +  # Retrieve value by key
    +  print $obj->baz('foo');
    +  
    +  # Direct access to referenced hash
    +  print keys %{ $obj->baz() };
    +  
    +  # Reset the hash contents to empty
    +  @{ $obj->baz() } = ();
    +
    +=cut
    +
    +sub hash {
    +  (shift)->evaled_methods( q{
    +    sub __NAME__ {
    +      my $self = shift;
    +      if ( scalar(@_) == 0 ) {
    +	return $self->{'__NAME__'};
    +      } elsif ( scalar(@_) == 1 ) {
    +	$self->{'__NAME__'}->{ shift() };
    +      } elsif ( scalar(@_) % 2 ) {
    +	Carp::croak "Odd number of items in assigment to '__NAME__'";
    +      } else {
    +	while ( scalar(@_) ) {
    +	  $self->{'__NAME__'}->{ shift() } = shift();
    +	}
    +	return $self->{'__NAME__'};
    +      }
    +    }
    +  }, @_ )
    +}
    +
    +########################################################################
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +=cut
    +
    +1;
    diff --git a/lib/Class/MakeMethods/Standard.pm b/lib/Class/MakeMethods/Standard.pm
    new file mode 100644
    index 0000000..024049e
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Standard.pm
    @@ -0,0 +1,68 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Standard - Make common object accessors
    +
    +
    +=head1 SYNOPSIS
    +
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Hash (
    +    new => 'new',
    +    scalar => [ 'foo', 'bar' ],
    +    array => 'my_list',
    +    hash => 'my_index',
    +  );
    +
    +
    +=head1 DESCRIPTION
    +
    +This document describes the various subclasses of Class::MakeMethods
    +included under the Standard::* namespace, and the method types each
    +one provides.
    +
    +The Standard subclasses provide a parameterized set of method-generation
    +implementations.
    +
    +Subroutines are generated as closures bound to a hash containing
    +the method name and (optionally) additional parameters.
    +
    +
    +=head1 USAGE AND SYNTAX
    +
    +When you C a subclass of this package, the method declarations
    +you provide as arguments cause subroutines to be generated and
    +installed in your module. You can also omit the arguments to C
    +and instead make methods at runtime by passing the declarations to
    +a subsequent call to C.
    +
    +You may include any number of declarations in each call to C
    +or C. If methods with the same name already exist, earlier
    +calls to C or C win over later ones, but within each
    +call, later declarations superceed earlier ones.
    +
    +You can install methods in a different package by passing
    +C<-target_class =E I> as your first arguments to C
    +or C.
    +
    +See L for more details.
    +
    +=cut
    +
    +package Class::MakeMethods::Standard;
    +
    +$VERSION = 1.000;
    +use strict;
    +use Class::MakeMethods '-isasubclass';
    +
    +########################################################################
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +For distribution, installation, support, copyright and license 
    +information, see L.
    +
    +=cut
    +
    +1;
    diff --git a/lib/Class/MakeMethods/Standard/Array.pm b/lib/Class/MakeMethods/Standard/Array.pm
    new file mode 100644
    index 0000000..52c1b0b
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Standard/Array.pm
    @@ -0,0 +1,555 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Standard::Array - Methods for Array objects 
    +
    +=head1 SYNOPSIS
    +
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Array (
    +    new => 'new',
    +    scalar => [ 'foo', 'bar' ],
    +    array => 'my_list',
    +    hash => 'my_index',
    +  );
    +  ...
    +  
    +  my $obj = MyObject->new( foo => 'Foozle' );
    +  print $obj->foo();
    +  
    +  $obj->bar('Barbados');
    +  print $obj->bar();
    +  
    +  $obj->my_list(0 => 'Foozle', 1 => 'Bang!');
    +  print $obj->my_list(1);
    +  
    +  $obj->my_index('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  print $obj->my_index('foo');
    +
    +=head1 DESCRIPTION
    +
    +The Standard::Array suclass of MakeMethods provides a basic
    +constructor and accessors for blessed-array object instances.
    +
    +=head2 Calling Conventions
    +
    +When you C this package, the method names you provide
    +as arguments cause subroutines to be generated and installed in
    +your module.
    +
    +See L for more information.
    +
    +=head2 Declaration Syntax
    +
    +To declare methods, pass in pairs of a method-type name followed
    +by one or more method names. 
    +
    +Valid method-type names for this package are listed in L<"METHOD
    +GENERATOR TYPES">.
    +
    +See L and L for more information.
    +
    +=cut
    +
    +package Class::MakeMethods::Standard::Array;
    +
    +$VERSION = 1.000;
    +use strict;
    +use Class::MakeMethods::Standard '-isasubclass';
    +use Class::MakeMethods::Utility::ArraySplicer 'array_splicer';
    +
    +########################################################################
    +
    +=head2 Positional Accessors and %FIELDS
    +
    +Each accessor method is assigned the next available array index at
    +which to store its value.
    +
    +The mapping between method names and array positions is stored in
    +a hash named %FIELDS in the declaring package. When a package
    +declares its first positional accessor, its %FIELDS are initialized
    +by searching its inheritance tree.
    +
    +B: Subclassing packages that use positional accessors is
    +somewhat fragile, since you may end up with two distinct methods assigned to the same position. Specific cases to avoid are:
    +
    +=over 4
    +
    +=item *
    +
    +If you inherit from more than one class with positional accessors,
    +the positions used by the two sets of methods will overlap.
    +
    +=item *
    +
    +If your superclass adds additional positional accessors after you
    +declare your first, they will overlap yours.
    +
    +=back
    +
    +=cut
    +
    +sub _array_index {
    +  my $class = shift;
    +  my $name = shift;
    +  no strict;
    +  local $^W = 0;
    +  if ( ! scalar %{$class . "::FIELDS"} ) {
    +    my @classes = @{$class . "::ISA"};
    +    my @fields;
    +    while ( @classes ) {
    +      my $superclass = shift @classes;
    +      if ( scalar %{$superclass . "::FIELDS"} ) {
    +	push @fields, %{$superclass . "::FIELDS"};
    +      } else {
    +	unshift @classes, @{$superclass . "::ISA"}
    +      }
    +    }
    +    %{$class . "::FIELDS"} = @fields
    +  }
    +  my $field_hash = \%{$class . "::FIELDS"};
    +  $field_hash->{$name} or $field_hash->{$name} = scalar keys %$field_hash
    +}
    +
    +########################################################################
    +
    +=head1 METHOD GENERATOR TYPES
    +
    +=head2 new - Constructor
    +
    +For each method name passed, returns a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Has a reference to a sample item to copy. This defaults to a reference to an empty array, but you may override this with the C<'defaults' => I> method parameter. 
    +
    +=item *
    +
    +If called as a class method, makes a new array containing values from the sample item, and blesses it into that class.
    +
    +=item *
    +
    +If called on an array-based instance, makes a copy of it and blesses the copy into the same class as the original instance.
    +
    +=item *
    +
    +If passed a list of method-value pairs, calls each named method with the associated value as an argument. 
    +
    +=item *
    +
    +Returns the new instance.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Array (
    +    new => 'new',
    +  );
    +  ...
    +  
    +  # Bare constructor
    +  my $empty = MyObject->new();
    +  
    +  # Constructor with initial sequence of method calls
    +  my $obj = MyObject->new( foo => 'Foozle', bar => 'Barbados' );
    +  
    +  # Copy with overriding sequence of method calls
    +  my $copy = $obj->new( bar => 'Bob' );
    +
    +=cut
    +
    +sub new {
    +  my $class = shift;
    +  map { 
    +    my $name = $_->{name};
    +    my $defaults = $_->{defaults} || [];
    +    $name => sub {
    +      my $callee = shift;
    +      my $self = ref($callee) ? bless( [@$callee], ref($callee) ) 
    +			      : bless( [@$defaults],   $callee );
    +      while ( scalar @_ ) {
    +	my $method = shift;
    +	$self->$method( shift );
    +      }
    +      return $self;
    +    }
    +  } $class->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head2 scalar - Instance Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on an array-based instance.
    +
    +=item *
    +
    +Determines the array position associated with the method name, and uses that as an index into each instance to access the related value. This defaults to the next available slot in %FIELDS, but you may override this with the C<'array_index' => I> method parameter, or by pre-filling the contents of %FIELDS. 
    +
    +=item *
    +
    +If called without any arguments returns the current value (or undef).
    +
    +=item *
    +
    +If called with an argument, stores that as the value, and returns it, 
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Array (
    +    scalar => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  $obj->foo('Foozle');
    +  
    +  # Retrieve value
    +  print $obj->foo;
    +
    +=cut
    +
    +sub scalar {
    +  my $class = shift;
    +  map { 
    +    my $name = $_->{name};
    +    my $index = $_->{array_index} || 
    +		_array_index( $class->_context('TargetClass'), $name );
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar @_ ) {
    +	$self->[$index] = shift;
    +      } else {
    +	$self->[$index];
    +      }
    +    }
    +  } $class->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head2 array - Instance Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on an array-based instance.
    +
    +=item *
    +
    +Determines the array position associated with the method name, and uses that as an index into each instance to access the related value. This defaults to the next available slot in %FIELDS, but you may override this with the C<'array_index' => I> method parameter, or by pre-filling the contents of %FIELDS. 
    +
    +=item * 
    +
    +The value for each instance will be a reference to an array (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the current array-ref value (or undef).
    +
    +=item *
    +
    +If called with a single non-ref argument, uses that argument as an index to retrieve from the referenced array, and returns that value (or undef).
    +
    +=item *
    +
    +If called with a single array ref argument, uses that list to return a slice of the referenced array.
    +
    +=item *
    +
    +If called with a list of argument pairs, each with a non-ref index and an associated value, stores the value at the given index in the referenced array. If the instance's value was previously undefined, a new array is autovivified. The current value in each position will be overwritten, and later arguments with the same index will override earlier ones. Returns the current array-ref value.
    +
    +=item *
    +
    +If called with a list of argument pairs, each with the first item being a reference to an array of up to two numbers, loops over each pair and uses those numbers to splice the value array. 
    +
    +The first controlling number is the position at which the splice will begin. Zero will start before the first item in the list. Negative numbers count backwards from the end of the array. 
    +
    +The second number is the number of items to be removed from the list. If it is omitted, or undefined, or zero, no items are removed. If it is a positive integer, that many items will be returned.
    +
    +If both numbers are omitted, or are both undefined, they default to containing the entire value array.
    +
    +If the second argument is undef, no values will be inserted; if it is a non-reference value, that one value will be inserted; if it is an array-ref, its values will be copied.
    +
    +The method returns the items that removed from the array, if any.
    +
    +=back
    +
    +Sample declaration and usage:
    +  
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Array (
    +    array => 'bar',
    +  );
    +  ...
    +  
    +  # Clear and set contents of list
    +  print $obj->bar([ 'Spume', 'Frost' ] );  
    +  
    +  # Set values by position
    +  $obj->bar(0 => 'Foozle', 1 => 'Bang!');
    +  
    +  # Positions may be overwritten, and in any order
    +  $obj->bar(2 => 'And Mash', 1 => 'Blah!');
    +  
    +  # Retrieve value by position
    +  print $obj->bar(1);
    +  
    +  # Direct access to referenced array
    +  print scalar @{ $obj->bar() };
    +
    +There are also calling conventions for slice and splice operations:
    +
    +  # Retrieve slice of values by position
    +  print join(', ', $obj->bar( undef, [0, 2] ) );
    +  
    +  # Insert an item at position in the array
    +  $obj->bar([3], 'Potatoes' );  
    +  
    +  # Remove 1 item from position 3 in the array
    +  $obj->bar([3, 1], undef );  
    +  
    +  # Set a new value at position 2, and return the old value 
    +  print $obj->bar([2, 1], 'Froth' );
    +
    +=cut
    +
    +sub array {
    +  my $class = shift;
    +  map { 
    +    my $name = $_->{name};
    +    my $index = $_->{array_index} || 
    +		_array_index( $class->_context('TargetClass'), $name );
    +    my $init = $_->{auto_init};
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar(@_) == 0 ) {
    +	if ( $init and ! defined $self->[$index] ) {
    +	  $self->[$index] = [];
    +	}
    +	( ! $self->[$index] ) ? () : 
    +	( wantarray            ) ? @{ $self->[$index] } :
    +				   $self->[$index]
    +      } elsif ( scalar(@_) == 1 and ref $_[0] eq 'ARRAY' ) {
    +	$self->[$index] = [ @{ $_[0] } ];
    +	( ! $self->[$index] ) ? () : 
    +	( wantarray            ) ? @{ $self->[$index] } :
    +				   $self->[$index]
    +      } else {
    +	$self->[$index] ||= [];
    +	array_splicer( $self->[$index], @_ );
    +      }
    +    }
    +  } $class->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head2 hash - Instance Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on an array-based instance.
    +
    +=item *
    +
    +Determines the array position associated with the method name, and uses that as an index into each instance to access the related value. This defaults to the next available slot in %FIELDS, but you may override this with the C<'array_index' => I> method parameter, or by pre-filling the contents of %FIELDS. 
    +
    +
    +=item * 
    +
    +The value for each instance will be a reference to a hash (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the contents of the hash in list context, or a hash reference in scalar context (or undef).
    +
    +=item *
    +
    +If called with one argument, uses that argument as an index to retrieve from the referenced hash, and returns that value (or undef). If the single argument is an array ref, then a slice of the referenced hash is returned.
    +
    +=item *
    +
    +If called with a list of key-value pairs, stores the value under the given key in the referenced hash. If the instance's value was previously undefined, a new hash is autovivified. The current value under each key will be overwritten, and later arguments with the same key will override earlier ones. Returns the contents of the hash in list context, or a hash reference in scalar context.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Array (
    +    hash => 'baz',
    +  );
    +  ...
    +  
    +  # Set values by key
    +  $obj->baz('foo' => 'Foozle', 'bar' => 'Bang!');
    +  
    +  # Values may be overwritten, and in any order
    +  $obj->baz('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  
    +  # Retrieve value by key
    +  print $obj->baz('foo');
    +  
    +  # Retrive slice of values by position
    +  print join(', ', $obj->baz( ['foo', 'bar'] ) );
    +  
    +  # Direct access to referenced hash
    +  print keys %{ $obj->baz() };
    +  
    +  # Reset the hash contents to empty
    +  @{ $obj->baz() } = ();
    +
    +=cut
    +
    +sub hash {
    +  my $class = shift;
    +  map { 
    +    my $name = $_->{name};
    +    my $index = $_->{array_index} || 
    +		_array_index( $class->_context('TargetClass'), $name );
    +    my $init = $_->{auto_init};
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar(@_) == 0 ) {
    +	if ( $init and ! defined $self->[$index] ) {
    +	  $self->[$index] = {};
    +	}
    +	( ! $self->[$index] ) ? () : 
    +	( wantarray            ) ? %{ $self->[$index] } :
    +				   $self->[$index]
    +      } elsif ( scalar(@_) == 1 ) {
    +	if ( ref($_[0]) eq 'HASH' ) {
    +	  my $hash = shift;
    +	  $self->[$index] = { %$hash };
    +	} elsif ( ref($_[0]) eq 'ARRAY' ) {
    +	  return @{$self->[$index]}{ @{$_[0]} }
    +	} else {
    +	  return $self->[$index]->{ $_[0] }
    +	}
    +      } elsif ( scalar(@_) % 2 ) {
    +	Carp::croak "Odd number of items in assigment to $name";
    +      } else {
    +	while ( scalar(@_) ) {
    +	  my $key = shift();
    +	  $self->[$index]->{ $key } = shift();
    +	}
    +	( wantarray            ) ? %{ $self->[$index] } :
    +				   $self->[$index]
    +      }
    +    }
    +  } $class->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head2 object - Instance Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on an array-based instance.
    +
    +=item *
    +
    +Determines the array position associated with the method name, and uses that as an index into each instance to access the related value. This defaults to the next available slot in %FIELDS, but you may override this with the C<'array_index' => I> method parameter, or by pre-filling the contents of %FIELDS. 
    +
    +=item * 
    +
    +The value for each instance will be a reference to an object (or undef).
    +
    +=item *
    +
    +If called without any arguments returns the current value.
    +
    +=item *
    +
    +If called with an argument, stores that as the value, and returns it, 
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Hash (
    +    object => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  $obj->foo( Foozle->new() );
    +  
    +  # Retrieve value
    +  print $obj->foo;
    +
    +=cut
    +
    +sub object {
    +  my $class = shift;
    +  map { 
    +    my $name = $_->{name};
    +    my $index = $_->{array_index} || 
    +		_array_index( $class->_context('TargetClass'), $name );
    +    my $class = $_->{class};
    +    my $init = $_->{auto_init};
    +    if ( $init and ! $class ) { 
    +      Carp::croak("Use of auto_init requires value for class parameter") 
    +    }
    +    my $new_method = $_->{new_method} || 'new';
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar @_ ) {
    +	my $value = shift;
    +	if ( $class and ! UNIVERSAL::isa( $value, $class ) ) {
    +	  Carp::croak "Wrong argument type ('$value') in assigment to $name";
    +	}
    +	$self->[$index] = $value;
    +      } else {
    +	if ( $init and ! defined $self->[$index] ) {
    +	  $self->[$index] = $class->$new_method();
    +	} else {
    +	  $self->[$index];
    +	}
    +      }
    +    }
    +  } $class->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +See L for equivalent functionality
    +based on blessed hashes. If your module will be extensively
    +subclassed, consider switching to Standard::Hash to avoid the
    +subclassing concerns described above.
    +
    +=cut
    +
    +1;
    diff --git a/lib/Class/MakeMethods/Standard/Global.pm b/lib/Class/MakeMethods/Standard/Global.pm
    new file mode 100644
    index 0000000..9c1e48d
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Standard/Global.pm
    @@ -0,0 +1,405 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Standard::Global - Global data
    +
    +=head1 SYNOPSIS
    +
    +  package MyClass;
    +  use Class::MakeMethods::Standard::Global (
    +    scalar => [ 'foo' ],
    +    array  => [ 'my_list' ],
    +    hash   => [ 'my_index' ],
    +  );
    +  ...
    +  
    +  MyClass->foo( 'Foozle' );
    +  print MyClass->foo();
    +
    +  print MyClass->new(...)->foo(); # same value for any instance
    +  print MySubclass->foo();        # ... and for any subclass
    +  
    +  MyClass->my_list(0 => 'Foozle', 1 => 'Bang!');
    +  print MyClass->my_list(1);
    +  
    +  MyClass->my_index('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  print MyClass->my_index('foo');
    +
    +
    +=head1 DESCRIPTION
    +
    +The Standard::Global suclass of MakeMethods provides basic accessors for shared data.
    +
    +=head2 Calling Conventions
    +
    +When you C this package, the method names you provide
    +as arguments cause subroutines to be generated and installed in
    +your module.
    +
    +See L for more information.
    +
    +=head2 Declaration Syntax
    +
    +To declare methods, pass in pairs of a method-type name followed
    +by one or more method names. 
    +
    +Valid method-type names for this package are listed in L<"METHOD
    +GENERATOR TYPES">.
    +
    +See L and L for more information.
    +
    +=cut
    +
    +package Class::MakeMethods::Standard::Global;
    +
    +$VERSION = 1.000;
    +use strict;
    +use Class::MakeMethods::Standard '-isasubclass';
    +use Class::MakeMethods::Utility::ArraySplicer 'array_splicer';
    +
    +########################################################################
    +
    +=head1 METHOD GENERATOR TYPES
    +
    +=head2 scalar - Global Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class method, or on any instance or subclass, and behaves identically regardless of what it was called on.
    +
    +=item *
    +
    +If called without any arguments returns the current value.
    +
    +=item *
    +
    +If called with an argument, stores that as the value, and returns it, 
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyClass;
    +  use Class::MakeMethods::Standard::Global (
    +    scalar => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  MyClass->foo('Foozle');
    +  
    +  # Retrieve value
    +  print MyClass->foo;
    +
    +=cut
    +
    +sub scalar {
    +  map { 
    +    my $name = $_->{name};
    +    my $data;
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar(@_) == 0 ) {
    +	$data;
    +      } else {
    +	$data = shift;
    +      }
    +    }
    +  } (shift)->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head2 array - Global Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class method, or on any instance or subclass, and behaves identically regardless of what it was called on.
    +
    +=item * 
    +
    +The global value will be a reference to an array (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the current array-ref value (or undef).
    +
    +
    +=item *
    +
    +If called with a single non-ref argument, uses that argument as an index to retrieve from the referenced array, and returns that value (or undef).
    +
    +=item *
    +
    +If called with a single array ref argument, uses that list to return a slice of the referenced array.
    +
    +=item *
    +
    +If called with a list of argument pairs, each with a non-ref index and an associated value, stores the value at the given index in the referenced array. If the global value was previously undefined, a new array is autovivified. The current value in each position will be overwritten, and later arguments with the same index will override earlier ones. Returns the current array-ref value.
    +
    +=item *
    +
    +If called with a list of argument pairs, each with the first item being a reference to an array of up to two numbers, loops over each pair and uses those numbers to splice the value array. 
    +
    +The first controlling number is the position at which the splice will begin. Zero will start before the first item in the list. Negative numbers count backwards from the end of the array. 
    +
    +The second number is the number of items to be removed from the list. If it is omitted, or undefined, or zero, no items are removed. If it is a positive integer, that many items will be returned.
    +
    +If both numbers are omitted, or are both undefined, they default to containing the entire value array.
    +
    +If the second argument is undef, no values will be inserted; if it is a non-reference value, that one value will be inserted; if it is an array-ref, its values will be copied.
    +
    +The method returns the items that removed from the array, if any.
    +
    +=back
    +
    +Sample declaration and usage:
    +  
    +  package MyClass;
    +  use Class::MakeMethods::Standard::Global (
    +    array => 'bar',
    +  );
    +  ...
    +  
    +  # Clear and set contents of list
    +  print MyClass->bar([ 'Spume', 'Frost' ] );  
    +  
    +  # Set values by position
    +  MyClass->bar(0 => 'Foozle', 1 => 'Bang!');
    +  
    +  # Positions may be overwritten, and in any order
    +  MyClass->bar(2 => 'And Mash', 1 => 'Blah!');
    +  
    +  # Retrieve value by position
    +  print MyClass->bar(1);
    +  
    +  # Direct access to referenced array
    +  print scalar @{ MyClass->bar() };
    +
    +There are also calling conventions for slice and splice operations:
    +
    +  # Retrieve slice of values by position
    +  print join(', ', MyClass->bar( undef, [0, 2] ) );
    +  
    +  # Insert an item at position in the array
    +  MyClass->bar([3], 'Potatoes' );  
    +  
    +  # Remove 1 item from position 3 in the array
    +  MyClass->bar([3, 1], undef );  
    +  
    +  # Set a new value at position 2, and return the old value 
    +  print MyClass->bar([2, 1], 'Froth' );
    +
    +=cut
    +
    +sub array {
    +  map { 
    +    my $name = $_->{name};
    +    my $data;
    +    my $init = $_->{auto_init};
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar(@_) == 0 ) {
    +	if ( $init and ! defined $data ) {
    +	  $data = [];
    +	}
    +	! $data ? () : wantarray ? @$data : $data;
    +      } elsif ( scalar(@_) == 1 and ref $_[0] eq 'ARRAY' ) {
    +	$data = [ @{ $_[0] } ];
    +	wantarray ? @$data : $data;
    +      } else {
    +	$data ||= [];
    +	return array_splicer( $data, @_ );
    +      }
    +    }
    +  } (shift)->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head2 hash - Global Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class method, or on any instance or subclass, and behaves identically regardless of what it was called on.
    +
    +=item * 
    +
    +The global value will be a reference to a hash (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the contents of the hash in list context, or a hash reference in scalar context (or undef).
    +
    +=item *
    +
    +If called with one non-ref argument, uses that argument as an index to retrieve from the referenced hash, and returns that value (or undef).
    +
    +=item *
    +
    +If called with one array-ref argument, uses the contents of that array to retrieve a slice of the referenced hash.
    +
    +=item *
    +
    +If called with one hash-ref argument, sets the contents of the referenced hash to match that provided.
    +
    +=item *
    +
    +If called with a list of key-value pairs, stores the value under the given key in the referenced hash. If the global value was previously undefined, a new hash is autovivified. The current value under each key will be overwritten, and later arguments with the same key will override earlier ones. Returns the contents of the hash in list context, or a hash reference in scalar context.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyClass;
    +  use Class::MakeMethods::Standard::Global (
    +    hash => 'baz',
    +  );
    +  ...
    +  
    +  # Set values by key
    +  MyClass->baz('foo' => 'Foozle', 'bar' => 'Bang!');
    +  
    +  # Values may be overwritten, and in any order
    +  MyClass->baz('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  
    +  # Retrieve value by key
    +  print MyClass->baz('foo');
    +  
    +  # Retrive slice of values by position
    +  print join(', ', MyClass->baz( ['foo', 'bar'] ) );
    +  
    +  # Direct access to referenced hash
    +  print keys %{ MyClass->baz() };
    +  
    +  # Reset the hash contents to empty
    +  @{ MyClass->baz() } = ();
    +
    +=cut
    +
    +sub hash {
    +  map { 
    +    my $name = $_->{name};
    +    my $data;
    +    my $init = $_->{auto_init};
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar(@_) == 0 ) {
    +	if ( $init and ! defined $data ) {
    +	  $data = {};
    +	}
    +	! $data ? () : wantarray  ? %$data : $data
    +      } elsif ( scalar(@_) == 1 ) {
    +	if ( ref($_[0]) eq 'HASH' ) {
    +	  my $hash = shift;
    +	  $data = { %$hash };
    +	} elsif ( ref($_[0]) eq 'ARRAY' ) {
    +	  return @{$data}{ @{$_[0]} }
    +	} else {
    +	  return $data->{ $_[0] }
    +	}
    +      } elsif ( scalar(@_) % 2 ) {
    +	Carp::croak "Odd number of items in assigment to $name";
    +      } else {
    +	while ( scalar(@_) ) {
    +	  my $key = shift();
    +	  $data->{ $key } = shift();
    +	}
    +	wantarray ? %$data : $data;
    +      }
    +    }
    +  } (shift)->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head2 object - Global Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class method, or on any instance or subclass, and behaves identically regardless of what it was called on.
    +
    +=item * 
    +
    +The global value will be a reference to an object (or undef).
    +
    +=item *
    +
    +If called without any arguments returns the current value.
    +
    +=item *
    +
    +If called with an argument, stores that as the value, and returns it, 
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyClass;
    +  use Class::MakeMethods::Standard::Global (
    +    object => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  MyClass->foo( Foozle->new() );
    +  
    +  # Retrieve value
    +  print MyClass->foo;
    +
    +=cut
    +
    +sub object {
    +  map { 
    +    my $name = $_->{name};
    +    my $data;
    +    my $class = $_->{class};
    +    my $init = $_->{auto_init};
    +    if ( $init and ! $class ) { 
    +      Carp::croak("Use of auto_init requires value for class parameter") 
    +    }
    +    my $new_method = $_->{new_method} || 'new';
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar @_ ) {
    +	my $value = shift;
    +	if ( $class and ! UNIVERSAL::isa( $value, $class ) ) {
    +	  Carp::croak "Wrong argument type ('$value') in assigment to $name";
    +	}
    +	$data = $value;
    +      } else {
    +	if ( $init and ! defined $data ) {
    +	  $data = $class->$new_method();
    +	}
    +	$data;
    +      }
    +    }
    +  } (shift)->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +=cut
    +
    +1;
    diff --git a/lib/Class/MakeMethods/Standard/Hash.pm b/lib/Class/MakeMethods/Standard/Hash.pm
    new file mode 100644
    index 0000000..ba4f65b
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Standard/Hash.pm
    @@ -0,0 +1,501 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Standard::Hash - Standard hash methods
    +
    +=head1 SYNOPSIS
    +
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Hash (
    +    new => 'new',
    +    scalar => [ 'foo', 'bar' ],
    +    array => 'my_list',
    +    hash => 'my_index',
    +  );
    +  ...
    +  
    +  my $obj = MyObject->new( foo => 'Foozle' );
    +  print $obj->foo();
    +  
    +  $obj->bar('Barbados'); 
    +  print $obj->bar();
    +  
    +  $obj->my_list(0 => 'Foozle', 1 => 'Bang!');
    +  print $obj->my_list(1);
    +  
    +  $obj->my_index('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  print $obj->my_index('foo');
    +
    +=head1 DESCRIPTION
    +
    +The Standard::Hash suclass of MakeMethods provides a basic constructor and accessors for blessed-hash object instances.
    +
    +=head2 Calling Conventions
    +
    +When you C this package, the method names you provide
    +as arguments cause subroutines to be generated and installed in
    +your module.
    +
    +See L for more information.
    +
    +=head2 Declaration Syntax
    +
    +To declare methods, pass in pairs of a method-type name followed
    +by one or more method names. 
    +
    +Valid method-type names for this package are listed in L<"METHOD
    +GENERATOR TYPES">.
    +
    +See L and L for more information.
    +
    +=cut
    +
    +package Class::MakeMethods::Standard::Hash;
    +
    +$VERSION = 1.000;
    +use strict;
    +use Class::MakeMethods::Standard '-isasubclass';
    +use Class::MakeMethods::Utility::ArraySplicer 'array_splicer';
    +
    +########################################################################
    +
    +=head1 METHOD GENERATOR TYPES
    +
    +=head2 new - Constructor
    +
    +For each method name passed, returns a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Has a reference to a sample item to copy. This defaults to a reference to an empty hash, but you may override this with the C<'defaults' => I>  method parameter. 
    +
    +=item *
    +
    +If called as a class method, makes a new hash and blesses it into that class.
    +
    +=item *
    +
    +If called on a hash-based instance, makes a copy of it and blesses the copy into the same class as the original instance.
    +
    +=item *
    +
    +If passed a list of key-value pairs, appends them to the new hash. These arguments override any copied values, and later arguments with the same name will override earlier ones.
    +
    +=item *
    +
    +Returns the new instance.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Hash (
    +    new => 'new',
    +  );
    +  ...
    +  
    +  # Bare constructor
    +  my $empty = MyObject->new();
    +  
    +  # Constructor with initial values
    +  my $obj = MyObject->new( foo => 'Foozle', bar => 'Barbados' );
    +  
    +  # Copy with overriding value
    +  my $copy = $obj->new( bar => 'Bob' );
    +
    +=cut
    +
    +sub new {
    +  map { 
    +    my $name = $_->{name};
    +    my $defaults = $_->{defaults} || {};
    +    $name => sub {
    +      my $callee = shift;
    +      my $self = ref($callee) ? bless( { %$callee }, ref $callee ) 
    +			      : bless( { %$defaults },   $callee );
    +      while ( scalar @_ ) {
    +	my $method = shift;
    +	UNIVERSAL::can( $self, $method ) 
    +	  or Carp::croak("Can't call method '$method' in constructor for " . ( ref($callee) || $callee ));
    +	$self->$method( shift );
    +      }
    +      return $self;
    +    }
    +  } (shift)->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head2 scalar - Instance Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on a hash-based instance.
    +
    +=item *
    +
    +Has a specific hash key to use to access the related value for each instance.
    +This defaults to the method name, but you may override this with the C<'hash_key' => I> method parameter. 
    +
    +=item *
    +
    +If called without any arguments returns the current value.
    +
    +=item *
    +
    +If called with an argument, stores that as the value, and returns it, 
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Hash (
    +    scalar => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  $obj->foo('Foozle');
    +  
    +  # Retrieve value
    +  print $obj->foo;
    +
    +=cut
    +
    +sub scalar {
    +  map { 
    +    my $name = $_->{name};
    +    my $hash_key = $_->{hash_key} || $_->{name};
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar(@_) == 0 ) {
    +	$self->{$hash_key};
    +      } else {
    +	$self->{$hash_key} = shift;
    +      }
    +    }
    +  } (shift)->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head2 array - Instance Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on a hash-based instance.
    +
    +=item *
    +
    +Has a specific hash key to use to access the related value for each instance.
    +This defaults to the method name, but you may override this with the C<'hash_key' => I> method parameter. 
    +
    +=item * 
    +
    +The value for each instance will be a reference to an array (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the contents of the array in list context, or an array reference in scalar context (or undef).
    +
    +=item *
    +
    +If called with a single array ref argument, sets the contents of the array to match the contents of the provided one.
    +
    +=item *
    +
    +If called with a single numeric argument, uses that argument as an index to retrieve from the referenced array, and returns that value (or undef).
    +
    +=item *
    +
    +If called with a two arguments, the first undefined and the second an array ref argument, uses that array's contents as a list of indexes to return a slice of the referenced array.
    +
    +=item *
    +
    +If called with a list of argument pairs, each with a numeric index and an associated value, stores the value at the given index in the referenced array. If the instance's value was previously undefined, a new array is autovivified. The current value in each position will be overwritten, and later arguments with the same index will override earlier ones. Returns the current array-ref value.
    +
    +=item *
    +
    +If called with a list of argument pairs, each with the first item being a reference to an array of up to two numbers, loops over each pair and uses those numbers to splice the value array. 
    +
    +The first controlling number is the position at which the splice will begin. Zero will start before the first item in the list. Negative numbers count backwards from the end of the array. 
    +
    +The second number is the number of items to be removed from the list. If it is omitted, or undefined, or zero, no items are removed. If it is a positive integer, that many items will be returned.
    +
    +If both numbers are omitted, or are both undefined, they default to containing the entire value array.
    +
    +If the second argument is undef, no values will be inserted; if it is a non-reference value, that one value will be inserted; if it is an array-ref, its values will be copied.
    +
    +The method returns the items that removed from the array, if any.
    +
    +=back
    +
    +Sample declaration and usage:
    +  
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Hash (
    +    array => 'bar',
    +  );
    +  ...
    +  
    +  # Clear and set contents of list
    +  print $obj->bar([ 'Spume', 'Frost' ] );  
    +  
    +  # Set values by position
    +  $obj->bar(0 => 'Foozle', 1 => 'Bang!');
    +  
    +  # Positions may be overwritten, and in any order
    +  $obj->bar(2 => 'And Mash', 1 => 'Blah!');
    +  
    +  # Retrieve value by position
    +  print $obj->bar(1);
    +  
    +  # Direct access to referenced array
    +  print scalar @{ $obj->bar() };
    +
    +There are also calling conventions for slice and splice operations:
    +
    +  # Retrieve slice of values by position
    +  print join(', ', $obj->bar( undef, [0, 2] ) );
    +  
    +  # Insert an item at position in the array
    +  $obj->bar([3], 'Potatoes' );  
    +  
    +  # Remove 1 item from position 3 in the array
    +  $obj->bar([3, 1], undef );  
    +  
    +  # Set a new value at position 2, and return the old value 
    +  print $obj->bar([2, 1], 'Froth' );
    +
    +=cut
    +
    +sub array {
    +  map { 
    +    my $name = $_->{name};
    +    my $hash_key = $_->{hash_key} || $_->{name};
    +    my $init = $_->{auto_init};
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar(@_) == 0 ) {
    +	if ( $init and ! defined $self->{$hash_key} ) {
    +	  $self->{$hash_key} = [];
    +	}
    +	( ! $self->{$hash_key} ) ? () : 
    +	( wantarray            ) ? @{ $self->{$hash_key} } :
    +				   $self->{$hash_key}
    +      } elsif ( scalar(@_) == 1 and ref $_[0] eq 'ARRAY' ) {
    +	$self->{$hash_key} = [ @{ $_[0] } ];
    +	( ! $self->{$hash_key} ) ? () : 
    +	( wantarray            ) ? @{ $self->{$hash_key} } :
    +				   $self->{$hash_key}
    +      } else {
    +	$self->{$hash_key} ||= [];
    +	return array_splicer( $self->{$hash_key}, @_ );
    +      }
    +    }
    +  } (shift)->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head2 hash - Instance Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on a hash-based instance.
    +
    +=item *
    +
    +Has a specific hash key to use to access the related value for each instance.
    +This defaults to the method name, but you may override this with the C<'hash_key' => I> method parameter. 
    +
    +=item * 
    +
    +The value for each instance will be a reference to a hash (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the contents of the hash in list context, or a hash reference in scalar context (or undef).
    +
    +=item *
    +
    +If called with one non-ref argument, uses that argument as an index to retrieve from the referenced hash, and returns that value (or undef).
    +
    +=item *
    +
    +If called with one array-ref argument, uses the contents of that array to retrieve a slice of the referenced hash.
    +
    +=item *
    +
    +If called with one hash-ref argument, sets the contents of the referenced hash to match that provided.
    +
    +=item *
    +
    +If called with a list of key-value pairs, stores the value under the given key in the referenced hash. If the instance's value was previously undefined, a new hash is autovivified. The current value under each key will be overwritten, and later arguments with the same key will override earlier ones. Returns the contents of the hash in list context, or a hash reference in scalar context.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Hash (
    +    hash => 'baz',
    +  );
    +  ...
    +  
    +  # Set values by key
    +  $obj->baz('foo' => 'Foozle', 'bar' => 'Bang!');
    +  
    +  # Values may be overwritten, and in any order
    +  $obj->baz('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  
    +  # Retrieve value by key
    +  print $obj->baz('foo');
    +  
    +  # Retrive slice of values by position
    +  print join(', ', $obj->baz( ['foo', 'bar'] ) );
    +  
    +  # Direct access to referenced hash
    +  print keys %{ $obj->baz() };
    +  
    +  # Reset the hash contents to empty
    +  %{ $obj->baz() } = ();
    +
    +=cut
    +
    +sub hash {
    +  map { 
    +    my $name = $_->{name};
    +    my $hash_key = $_->{hash_key} || $_->{name};
    +    my $init = $_->{auto_init};
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar(@_) == 0 ) {
    +	if ( $init and ! defined $self->{$hash_key} ) {
    +	  $self->{$hash_key} = {};
    +	}
    +	( ! $self->{$hash_key} ) ? () : 
    +	( wantarray            ) ? %{ $self->{$hash_key} } :
    +				   $self->{$hash_key}
    +      } elsif ( scalar(@_) == 1 ) {
    +	if ( ref($_[0]) eq 'HASH' ) {
    +	  $self->{$hash_key} = { %{$_[0]} };
    +	} elsif ( ref($_[0]) eq 'ARRAY' ) {
    +	  return @{$self->{$hash_key}}{ @{$_[0]} }
    +	} else {
    +	  return $self->{$hash_key}->{ $_[0] }
    +	}
    +      } elsif ( scalar(@_) % 2 ) {
    +	Carp::croak "Odd number of items in assigment to $name";
    +      } else {
    +	while ( scalar(@_) ) {
    +	  my $key = shift();
    +	  $self->{$hash_key}->{ $key } = shift();
    +	}
    +	return $self->{$hash_key};
    +      }
    +    }
    +  } (shift)->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head2 object - Instance Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Must be called on a hash-based instance.
    +
    +=item *
    +
    +Has a specific hash key to use to access the related value for each instance.
    +This defaults to the method name, but you may override this with the C<'hash_key' => I> method parameter. 
    +
    +=item * 
    +
    +The value for each instance will be a reference to an object (or undef).
    +
    +=item *
    +
    +If called without any arguments returns the current value.
    +
    +=item *
    +
    +If called with an argument, stores that as the value, and returns it, 
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Hash (
    +    object => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  $obj->foo( Foozle->new() );
    +  
    +  # Retrieve value
    +  print $obj->foo;
    +
    +=cut
    +
    +sub object {
    +  map { 
    +    my $name = $_->{name};
    +    my $hash_key = $_->{hash_key} || $_->{name};
    +    my $class = $_->{class};
    +    my $init = $_->{auto_init};
    +    if ( $init and ! $class ) { 
    +      Carp::croak("Use of auto_init requires value for class parameter") 
    +    }
    +    my $new_method = $_->{new_method} || 'new';
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar @_ ) {
    +	my $value = shift;
    +	if ( $class and ! UNIVERSAL::isa( $value, $class ) ) {
    +	  Carp::croak "Wrong argument type ('$value') in assigment to $name";
    +	}
    +	$self->{$hash_key} = $value;
    +      } else {
    +	if ( $init and ! defined $self->{$hash_key} ) {
    +	  $self->{$hash_key} = $class->$new_method();
    +	}
    +	$self->{$hash_key};
    +      }
    +    }
    +  } (shift)->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +=cut
    +
    +1;
    diff --git a/lib/Class/MakeMethods/Standard/Inheritable.pm b/lib/Class/MakeMethods/Standard/Inheritable.pm
    new file mode 100644
    index 0000000..d1b72ac
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Standard/Inheritable.pm
    @@ -0,0 +1,428 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Standard::Inheritable - Overridable data
    +
    +=head1 SYNOPSIS
    +
    +  package MyClass;
    +
    +  use Class::MakeMethods( 'Standard::Inheritable:scalar' => 'foo' );
    +  # We now have an accessor method for an "inheritable" scalar value
    +  
    +  MyClass->foo( 'Foozle' );   # Set a class-wide value
    +  print MyClass->foo();	      # Retrieve class-wide value
    +  
    +  my $obj = MyClass->new(...);
    +  print $obj->foo();          # All instances "inherit" that value...
    +  
    +  $obj->foo( 'Foible' );      # until you set a value for an instance.
    +  print $obj->foo();          # This now finds object-specific value.
    +  ...
    +  
    +  package MySubClass;
    +  @ISA = 'MyClass';
    +  
    +  print MySubClass->foo();    # Intially same as superclass,
    +  MySubClass->foo('Foobar');  # but overridable per subclass,
    +  print $subclass_obj->foo(); # and shared by its instances
    +  $subclass_obj->foo('Fosil');# until you override them... 
    +  ...
    +  
    +  # Similar behaviour for hashes and arrays is currently incomplete
    +  package MyClass;
    +  use Class::MakeMethods::Standard::Inheritable (
    +    array => 'my_list',
    +    hash => 'my_index',
    +  );
    +  
    +  MyClass->my_list(0 => 'Foozle', 1 => 'Bang!');
    +  print MyClass->my_list(1);
    +  
    +  MyClass->my_index('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  print MyClass->my_index('foo');
    +
    +
    +=head1 DESCRIPTION
    +
    +The MakeMethods subclass provides accessor methods that search an inheritance tree to find a value. This allows you to set a shared or default value for a given class, optionally override it in a subclass, and then optionally override it on a per-instance basis. 
    +
    +Note that all MakeMethods methods are inheritable, in the sense that they work as expected for subclasses. These methods are different in that the I accessed by each method can be inherited or overridden in each subclass or instance. See L< Class::MakeMethods::Utility::Inheritable> for more about this type of "inheritable" or overridable" data.
    +
    +
    +=head2 Calling Conventions
    +
    +When you C this package, the method names you provide
    +as arguments cause subroutines to be generated and installed in
    +your module.
    +
    +See L for more information.
    +
    +=head2 Declaration Syntax
    +
    +To declare methods, pass in pairs of a method-type name followed
    +by one or more method names. 
    +
    +Valid method-type names for this package are listed in L<"METHOD
    +GENERATOR TYPES">.
    +
    +See L and L for more information.
    +
    +=cut
    +
    +package Class::MakeMethods::Standard::Inheritable;
    +
    +$VERSION = 1.000;
    +use strict;
    +
    +use Class::MakeMethods::Standard '-isasubclass';
    +use Class::MakeMethods::Utility::Inheritable qw(get_vvalue set_vvalue find_vself);
    +use Class::MakeMethods::Utility::ArraySplicer 'array_splicer';
    +
    +########################################################################
    +
    +=head1 METHOD GENERATOR TYPES
    +
    +=head2 scalar - Class-specific Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class or instance method, on the declaring class or any subclass. 
    +
    +=item *
    +
    +If called without any arguments returns the current value for the callee. If the callee has not had a value defined for this method, searches up from instance to class, and from class to superclass, until a callee with a value is located.
    +
    +=item *
    +
    +If called with an argument, stores that as the value associated with the callee, whether instance or class, and returns it, 
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyClass;
    +  use Class::MakeMethods::Standard::Inheritable (
    +    scalar => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  MyClass->foo('Foozle');
    +  
    +  # Retrieve value
    +  print MyClass->foo;
    +
    +=cut
    +
    +sub scalar {
    +  my $class = shift;
    +  map { 
    +    my $method = $_;
    +    my $name = $method->{name};
    +    $method->{data} ||= {};
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar(@_) == 0 ) {
    +	get_vvalue($method->{data}, $self);
    +      } else {
    +	my $value = shift;
    +	set_vvalue($method->{data}, $self, $value);
    +      }
    +    }
    +  } $class->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head2 array - Class-specific Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class method, or on any instance or subclass, Must be called on a hash-based instance.
    +
    +=item * 
    +
    +The class value will be a reference to an array (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the contents of the array in list context, or an array reference in scalar context (or undef).
    +
    +=item *
    +
    +If called with a single array ref argument, sets the contents of the array to match the contents of the provided one.
    +
    +=item *
    +
    +If called with a single numeric argument, uses that argument as an index to retrieve from the referenced array, and returns that value (or undef).
    +
    +=item *
    +
    +If called with a two arguments, the first undefined and the second an array ref argument, uses that array's contents as a list of indexes to return a slice of the referenced array.
    +
    +=item *
    +
    +If called with a list of argument pairs, each with a non-ref index and an associated value, stores the value at the given index in the referenced array. If the class value was previously undefined, a new array is autovivified. The current value in each position will be overwritten, and later arguments with the same index will override earlier ones. Returns the current array-ref value.
    +
    +=item *
    +
    +If called with a list of argument pairs, each with the first item being a reference to an array of up to two numbers, loops over each pair and uses those numbers to splice the value array. 
    +
    +The first controlling number is the position at which the splice will begin. Zero will start before the first item in the list. Negative numbers count backwards from the end of the array. 
    +
    +The second number is the number of items to be removed from the list. If it is omitted, or undefined, or zero, no items are removed. If it is a positive integer, that many items will be returned.
    +
    +If both numbers are omitted, or are both undefined, they default to containing the entire value array.
    +
    +If the second argument is undef, no values will be inserted; if it is a non-reference value, that one value will be inserted; if it is an array-ref, its values will be copied.
    +
    +The method returns the items that removed from the array, if any.
    +
    +=back
    +
    +Sample declaration and usage:
    +  
    +  package MyClass;
    +  use Class::MakeMethods::Standard::Inheritable (
    +    array => 'bar',
    +  );
    +  ...
    +  
    +  # Clear and set contents of list
    +  print MyClass->bar([ 'Spume', 'Frost' ] );  
    +  
    +  # Set values by position
    +  MyClass->bar(0 => 'Foozle', 1 => 'Bang!');
    +  
    +  # Positions may be overwritten, and in any order
    +  MyClass->bar(2 => 'And Mash', 1 => 'Blah!');
    +  
    +  # Retrieve value by position
    +  print MyClass->bar(1);
    +  
    +  # Direct access to referenced array
    +  print scalar @{ MyClass->bar() };
    +
    +There are also calling conventions for slice and splice operations:
    +
    +  # Retrieve slice of values by position
    +  print join(', ', MyClass->bar( undef, [0, 2] ) );
    +  
    +  # Insert an item at position in the array
    +  MyClass->bar([3], 'Potatoes' );  
    +  
    +  # Remove 1 item from position 3 in the array
    +  MyClass->bar([3, 1], undef );  
    +  
    +  # Set a new value at position 2, and return the old value 
    +  print MyClass->bar([2, 1], 'Froth' );
    +
    +=cut
    +
    +sub array {
    +  my $class = shift;
    +  map { 
    +    my $method = $_;
    +    my $name = $method->{name};
    +    $name => sub {
    +      my $self = shift;
    +
    +     if ( scalar(@_) == 0 ) {
    +	my $v_self = find_vself($method->{data}, $self);
    +	my $value = $v_self ? $method->{data}{$v_self} : ();
    +	if ( $method->{auto_init} and ! $value ) {
    +	  $value = $method->{data}{$self} = [];
    +	}
    +	! $value ? () : wantarray ? @$value : $value;
    +	
    +      } elsif ( scalar(@_) == 1 and ref $_[0] eq 'ARRAY' ) {
    +	$method->{data}{$self} = [ @{ $_[0] } ];
    +	wantarray ? @{ $method->{data}{$self} } : $method->{data}{$self}
    +	
    +      } else {
    +	if ( ! exists $method->{data}{$self} ) {
    +	  my $v_self = find_vself($method->{data}, $self);
    +	  $method->{data}{$self} = [ $v_self ? @$v_self : () ];
    +	}
    +	return array_splicer( $method->{data}{$self}, @_ );
    +      }
    +    } 
    +  } $class->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head2 hash - Class-specific Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class method, or on any instance or subclass, Must be called on a hash-based instance.
    +
    +=item * 
    +
    +The class value will be a reference to a hash (or undef).
    +
    +=item *
    +
    +If called without any arguments, returns the contents of the hash in list context, or a hash reference in scalar context. If the callee has not had a value defined for this method, searches up from instance to class, and from class to superclass, until a callee with a value is located.
    +
    +=item *
    +
    +If called with one non-ref argument, uses that argument as an index to retrieve from the referenced hash, and returns that value (or undef). If the callee has not had a value defined for this method, searches up from instance to class, and from class to superclass, until a callee with a value is located.
    +
    +=item *
    +
    +If called with one array-ref argument, uses the contents of that array to retrieve a slice of the referenced hash. If the callee has not had a value defined for this method, searches up from instance to class, and from class to superclass, until a callee with a value is located.
    +
    +=item *
    +
    +If called with one hash-ref argument, sets the contents of the referenced hash to match that provided.
    +
    +=item *
    +
    +If called with a list of key-value pairs, stores the value under the given key in the hash associated with the callee, whether instance or class. If the callee did not previously have a hash-ref value associated with it, searches up instance to class, and from class to superclass, until a callee with a value is located, and copies that hash before making the assignments. The current value under each key will be overwritten, and later arguments with the same key will override earlier ones. Returns the contents of the hash in list context, or a hash reference in scalar context.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyClass;
    +  use Class::MakeMethods::Standard::Inheritable (
    +    hash => 'baz',
    +  );
    +  ...
    +  
    +  # Set values by key
    +  MyClass->baz('foo' => 'Foozle', 'bar' => 'Bang!');
    +  
    +  # Values may be overwritten, and in any order
    +  MyClass->baz('broccoli' => 'Blah!', 'foo' => 'Fiddle');
    +  
    +  # Retrieve value by key
    +  print MyClass->baz('foo');
    +  
    +  # Retrive slice of values by position
    +  print join(', ', MyClass->baz( ['foo', 'bar'] ) );
    +  
    +  # Direct access to referenced hash
    +  print keys %{ MyClass->baz() };
    +  
    +  # Reset the hash contents to empty
    +  @{ MyClass->baz() } = ();
    +
    +B 
    +
    +=cut
    +
    +sub hash {
    +  my $class = shift;
    +  map { 
    +    my $method = $_;
    +    my $name = $method->{name};
    +    $name => sub {
    +      my $self = shift;
    +      if ( scalar(@_) == 0 ) {
    +	my $v_self = find_vself($method->{data}, $self);
    +	my $value = $v_self ? $method->{data}{$v_self} : ();
    +	if ( $method->{auto_init} and ! $value ) {
    +	  $value = $method->{data}{$self} = {};
    +	}
    +	! $value ? () : wantarray ? %$value : $value;
    +      } elsif ( scalar(@_) == 1 ) {
    +	if ( ref($_[0]) eq 'HASH' ) {
    +	  $method->{data}{$self} = { %{$_[0]} };
    +	} elsif ( ref($_[0]) eq 'ARRAY' ) {
    +	  my $v_self = find_vself($method->{data}, $self);
    +	  return unless $v_self;
    +	  return @{$method->{data}{$v_self}}{ @{$_[0]} } 
    +	} else {
    +	  my $v_self = find_vself($method->{data}, $self);
    +	  return unless $v_self;
    +	  return $method->{data}{$v_self}->{ $_[0] };
    +	}
    +      } elsif ( scalar(@_) % 2 ) {
    +	Carp::croak "Odd number of items in assigment to $method->{name}";
    +      } else {
    +	if ( ! exists $method->{data}{$self} ) {
    +	  my $v_self = find_vself($method->{data}, $self);
    +	  $method->{data}{$self} = { $v_self ? %$v_self : () };
    +	}
    +	while ( scalar(@_) ) {
    +	  my $key = shift();
    +	  $method->{data}{$self}->{ $key } = shift();
    +	}
    +	wantarray ? %{ $method->{data}{$self} } : $method->{data}{$self};
    +      }
    +    } 
    +  } $class->_get_declarations(@_)
    +} 
    +
    +########################################################################
    +
    +=head2 object - Class-specific Ref Accessor
    +
    +For each method name passed, uses a closure to generate a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +May be called as a class method, or on any instance or subclass, Must be called on a hash-based instance.
    +
    +=item * 
    +
    +The class value will be a reference to an object (or undef).
    +
    +=item *
    +
    +If called without any arguments returns the current value for the callee. If the callee has not had a value defined for this method, searches up from instance to class, and from class to superclass, until a callee with a value is located.
    +
    +=item *
    +
    +If called with an argument, stores that as the value associated with the callee, whether instance or class, and returns it, 
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyClass;
    +  use Class::MakeMethods::Standard::Inheritable (
    +    object => 'foo',
    +  );
    +  ...
    +  
    +  # Store value
    +  MyClass->foo( Foozle->new() );
    +  
    +  # Retrieve value
    +  print MyClass->foo;
    +
    +B 
    +
    +=cut
    +
    +sub object { }
    +
    +########################################################################
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +=cut
    +
    +1;
    diff --git a/lib/Class/MakeMethods/Standard/Universal.pm b/lib/Class/MakeMethods/Standard/Universal.pm
    new file mode 100644
    index 0000000..641b159
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Standard/Universal.pm
    @@ -0,0 +1,336 @@
    +=head1 NAME
    +
    +Class::MakeMethods::Standard::Universal - Generic Methods
    +
    +
    +=head1 SYNOPSIS
    +
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Universal (
    +    no_op => 'this',
    +    abstract => 'that',
    +    delegate => { name=>'play_music', target=>'instrument', method=>'play' },
    +  );
    +
    +
    +=head1 DESCRIPTION
    +
    +The Standard::Universal suclass of MakeMethods provides a [INCOMPLETE].
    +
    +=head2 Calling Conventions
    +
    +When you C this package, the method names you provide
    +as arguments cause subroutines to be generated and installed in
    +your module.
    +
    +See L for more information.
    +
    +=head2 Declaration Syntax
    +
    +To declare methods, pass in pairs of a method-type name followed
    +by one or more method names. 
    +
    +Valid method-type names for this package are listed in L<"METHOD
    +GENERATOR TYPES">.
    +
    +See L and L for more information.
    +
    +=cut
    +
    +package Class::MakeMethods::Standard::Universal;
    +
    +$VERSION = 1.000;
    +use strict;
    +use Carp;
    +use Class::MakeMethods::Standard '-isasubclass';
    +
    +########################################################################
    +
    +=head1 METHOD GENERATOR TYPES
    +
    +=head2 no_op - Placeholder
    +
    +For each method name passed, returns a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Does nothing.
    +
    +=back
    +
    +You might want to create and use such methods to provide hooks for
    +subclass activity.
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Universal (
    +    no_op => 'whatever',
    +  );
    +  ...
    +  
    +  # Doesn't do anything
    +  MyObject->whatever();
    +
    +=cut
    +
    +sub no_op {
    +  map { 
    +    my $method = $_;
    +    $method->{name} => sub { }
    +  } (shift)->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head2 abstract - Placeholder
    +
    +For each method name passed, returns a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Fails with an error message.
    +
    +=back
    +
    +This is intended to support the use of abstract methods, that must
    +be overidden in a useful subclass.
    +
    +If each subclass is expected to provide an implementation of a given method, using this abstract method will replace the generic error message below with the clearer, more explicit error message that follows it:
    +
    +  Can't locate object method "foo" via package "My::Subclass"
    +  The "foo" method is abstract and can not be called on My::Subclass
    +
    +However, note that the existence of this method will be detected by UNIVERSAL::can(), so it is not suitable for use in optional interfaces, for which you may wish to be able to detect whether the method is supported or not.
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Universal (
    +    abstract => 'whatever',
    +  );
    +  ...
    +  
    +  package MySubclass;
    +  sub whatever { ... }
    +  
    +  # Failure
    +  MyObject->whatever();
    +  
    +  # Success
    +  MySubclass->whatever();
    +
    +=cut
    +
    +sub abstract {
    +  map { 
    +    my $method = $_;
    +    $method->{name} => sub { 
    +      my $self = shift;
    +      my $class = ref($self) ? "a " . ref($self) . " object" : $self;
    +      croak("The $method->{name} method is abstract and can not be called on $class");
    +    }
    +  } (shift)->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head2 call_methods - Call methods by name
    +
    +For each method name passed, returns a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Accepts a hash of key-value pairs, or a reference to hash of such pairs. For each pair, the key is interpreted as the name of a method to call, and the value is the argument to be passed to that method.
    +
    +=back
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Universal (
    +    call_methods => 'init',
    +  );
    +  ...
    +  
    +  my $object = MyObject->new()
    +  $object->init( foo => 'Foozle', bar => 'Barbados' );
    +  
    +  # Equivalent to:
    +  $object->foo('Foozle');
    +  $object->bar('Barbados');
    +
    +=cut
    +
    +sub call_methods {
    +  map { 
    +    my $method = $_;
    +    $method->{name} => sub { 
    +      my $self = shift;
    +      local @_ = %{$_[0]} if ( scalar @_ == 1 and ref($_[0]) eq 'HASH');
    +      while (scalar @_) { 
    +	my $key = shift;
    +	$self->$key( shift ) 
    +      }
    +    }
    +  } (shift)->_get_declarations(@_)
    +}
    +
    +
    +########################################################################
    +
    +=head2 join_methods - Concatenate results of other methods
    +
    +For each method name passed, returns a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Has a list of other methods names as an arrayref in the 'methods' parameter. B.
    +
    +=item *
    +
    +When called, calls each of the named method on itself, in order, and returns the concatenation of their results.
    +
    +=item *
    +
    +If a 'join' parameter is provided it is included between each method result.
    +
    +=item *
    +
    +If the 'skip_blanks' parameter is omitted, or is provided with a true value, removes all undefined or empty-string values from the results.
    +
    +=back
    +
    +=cut
    +
    +sub join_methods {
    +  map { 
    +    my $method = $_;
    +    $method->{methods} or confess;
    +    $method->{join} = '' if ( ! defined $method->{join} );
    +    $method->{skip_blanks} = '1' if ( ! defined $method->{skip_blanks} );
    +    $method->{name} => sub { 
    +      my $self = shift;
    +      my $joiner = $method->{join};
    +      my @values =  map { $self->$_() } @{ $method->{methods} };
    +      @values = grep { defined and length } @values if ( $method->{skip_blanks} );
    +      join $joiner, @values;
    +    }
    +  } (shift)->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head2 alias - Call another method
    +
    +For each method name passed, returns a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Calls another method on the same callee.
    +
    +=back
    +
    +You might create such a method to extend or adapt your class' interface.
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Universal (
    +    alias => { name=>'click_here', target=>'complex_machinery' }
    +  );
    +  sub complex_machinery { ... }
    +  ...
    +  
    +  $myobj->click_here(...); # calls $myobj->complex_machinery(...)
    +
    +=cut
    +
    +sub alias {
    +  map { 
    +    my $method = $_;
    +    $method->{name} => sub { 
    +      my $self = shift;
    +      
    +      my $t_method = $method->{target} or confess("no target");
    +      my @t_args = $method->{target_args} ? @{$method->{target_args}} : ();
    +      
    +      $self->$t_method(@t_args, @_);
    +    }
    +  } (shift)->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head2 delegate - Use another object to provide method
    +
    +For each method name passed, returns a subroutine with the following characteristics:
    +
    +=over 4
    +
    +=item *
    +
    +Calls a method on self to retrieve another object, and then calls a method on that object and returns its value.
    +
    +=back
    +
    +You might want to create and use such methods to faciliate composition of objects from smaller objects.
    +
    +Sample declaration and usage:
    +
    +  package MyObject;
    +  use Class::MakeMethods::Standard::Universal (
    +    'Standard::Hash:object' => { name=>'instrument' },
    +    delegate => { name=>'play_music', target=>'instrument', method=>'play' }
    +  );
    +  ...
    +  
    +  my $object = MyObject->new();
    +  $object->instrument( MyInstrument->new );
    +  $object->play_music;
    +
    +=cut
    +
    +sub delegate {
    +  map { 
    +    my $method = $_;
    +    $method->{method} ||= $method->{name};
    +    $method->{name} => sub { 
    +      my $self = shift;
    +      
    +      my $t_method = $method->{target} or confess("no target");
    +      my @t_args = $method->{target_args} ? @{$method->{target_args}} : ();
    +      
    +      my $m_method = $method->{method} or confess("no method");
    +      my @m_args = $method->{method_args} ? @{$method->{method_args}} : ();
    +      push @m_args, $self if ( $method->{target_args_self} );
    +      
    +      my $obj = $self->$t_method( @t_args )
    +	or croak("Can't delegate $method->{name} because $t_method is empty");
    +      
    +      $obj->$m_method(@m_args, @_);
    +    }
    +  } (shift)->_get_declarations(@_)
    +}
    +
    +########################################################################
    +
    +=head1 SEE ALSO
    +
    +See L for general information about this distribution. 
    +
    +See L for more about this family of subclasses.
    +
    +=cut
    +
    +1;
    diff --git a/lib/Class/MakeMethods/Template.pm b/lib/Class/MakeMethods/Template.pm
    new file mode 100644
    index 0000000..d5cd8f5
    --- /dev/null
    +++ b/lib/Class/MakeMethods/Template.pm
    @@ -0,0 +1,1255 @@
    +package Class::MakeMethods::Template;
    +
    +use strict;
    +use Carp;
    +
    +use Class::MakeMethods '-isasubclass';
    +
    +use vars qw( $VERSION );
    +$VERSION = 1.008;
    +
    +sub _diagnostic { &Class::MakeMethods::_diagnostic }
    +
    +########################################################################
    +### TEMPLATE LOOKUP AND CACHING: named_method(), _definition()
    +########################################################################
    +
    +use vars qw( %TemplateCache );
    +
    +# @results = $class->named_method( $name, @arguments );
    +sub named_method {
    +  my $class = shift;
    +  my $name = shift;
    +  
    +  # Support direct access to cached Template information
    +  if (exists $TemplateCache{"$class\::$name"}) {
    +    return $TemplateCache{"$class\::$name"};
    +  }
    +  
    +  my @results = $class->$name( @_ );
    +  
    +  if ( scalar @results == 1 and ref $results[0] eq 'HASH' ) {
    +    # If this is a hash-definition format, cache the results for speed.
    +    my $def = $results[0];
    +    $TemplateCache{"$class\::$name"} = $def;
    +    _expand_definition($class, $name, $def);
    +    return $def;
    +  }
    +  
    +  return wantarray ? @results : $results[0];
    +}
    +
    +# $mm_def = _definition( $class, $target );
    +sub _definition {
    +  my ($class, $target) = @_;
    +  
    +  while ( ! ref $target ) {
    +    $target =~ s/\s.*//;
    +    
    +    # If method name contains a colon or double colon, call the method on the
    +    # indicated class.
    +    my $call_class = ( ( $target =~ s/^(.*)\:{1,2}// ) 
    +      ? Class::MakeMethods::_find_subclass($class, $1) : $class );
    +    $target = $call_class->named_method( $target );
    +  }
    +  _diagnostic('mmdef_not_interpretable', $target) 
    +	unless ( ref($target) eq 'HASH' or ref($target) eq __PACKAGE__ );
    +  
    +  return $target;
    +}
    +
    +########################################################################
    +### TEMPLATE INTERNALS: _expand_definition()
    +########################################################################
    +
    +sub _expand_definition {
    +  my ($class, $name, $mm_def) = @_;
    +  
    +  return $mm_def if $mm_def->{'-parsed'};
    +  
    +  $mm_def->{'template_class'} = $class;
    +  $mm_def->{'template_name'} = $name;
    +  
    +  # Allow definitions to import values from each other.
    +  my $importer;
    +  foreach $importer ( qw( interface params behavior code_expr modifier ) ) {
    +    my $rules = $mm_def->{$importer}->{'-import'} || $mm_def->{'-import'};
    +    my @rules = ( ref $rules eq 'HASH' ? %$rules : ref $rules eq 'ARRAY' ? @$rules : () );
    +    unshift @rules, '::' . $class . ':generic' => '*' if $class->can('generic');
    +    while ( 
    +      my ($source, $names) = splice @rules, 0, 2
    +    ) {
    +      my $mmi = _definition($class, $source);
    +      foreach ( ( $names eq '*' ) ? keys %{ $mmi->{$importer} } 
    +			: ( ref $names ) ? @{ $names } : ( $names ) ) {
    +	my $current = $mm_def->{$importer}{$_};
    +	my $import = $mmi->{$importer}{$_};
    +	if ( ! $current ) {
    +	  $mm_def->{$importer}{$_} = $import;
    +	} elsif ( ref($current) eq 'ARRAY' ) {
    +	  my @imports = ref($import) ? @$import : $import;
    +	  foreach my $imp ( @imports ) {
    +	    push @$current, $imp unless ( grep { $_ eq $imp } @$current );
    +	  }
    +	}
    +      }
    +    }
    +    delete $mm_def->{$importer}->{'-import'};
    +  }
    +  delete $mm_def->{'-import'};
    +  
    +  _describe_definition( $mm_def ) if $Class::MakeMethods::CONTEXT{Debug};
    +
    +  
    +  $mm_def->{'-parsed'} = "$_[1]";
    +  
    +  bless $mm_def, __PACKAGE__;
    +}
    +
    +sub _describe_definition {
    +  my $mm_def = shift;
    +  
    +  my $def_type = "$mm_def->{template_class}:$mm_def->{template_name}";
    +  warn "----\nMethods info for $def_type:\n";
    +  if ( $mm_def->{interface} ) {
    +    warn join '', "Templates: \n", map {
    +	"  $_: " . _describe_value($mm_def->{interface}{$_}) . "\n"
    +      } keys %{$mm_def->{interface}};
    +  }
    +  if ( $mm_def->{modifier} ) {
    +    warn join '', "Modifiers: \n", map {
    +	"  $_: " . _describe_value($mm_def->{modifier}{$_}) . "\n"
    +      } keys %{$mm_def->{modifier}};
    +  }
    +}
    +
    +sub _describe_value {
    +  my $value = $_[0];
    +  ref($value) eq 'ARRAY' ? join(', ', @$value) :
    +  ref($value) eq 'HASH'  ? join(', ', %$value) : 
    +				      "$value";
    +}
    +
    +########################################################################
    +### METHOD GENERATION: make_methods()
    +########################################################################
    +
    +sub make_methods {
    +  my $mm_def = shift;
    +  
    +  return unless ( scalar @_ );
    +  
    +  # Select default interface and initial method parameters
    +  my $defaults = { %{ ( $mm_def->{'params'} ||= {} ) } };
    +  $defaults->{'interface'} ||= $mm_def->{'interface'}{'-default'} || 'default';
    +  $defaults->{'target_class'} = $mm_def->_context('TargetClass');
    +  $defaults->{'template_class'} = $mm_def->{'template_class'};
    +  $defaults->{'template_name'} = $mm_def->{'template_name'};
    +  
    +  my %interface_cache;
    +  
    +  # Our return value is the accumulated list of method-name => method-sub pairs
    +  my @methods; 
    +
    +  while (scalar @_) {
    +
    +    ### PARSING ### Requires: $mm_def, $defaults, @_
    +    
    +    my $m_name = shift @_;
    +    _diagnostic('make_empty') unless ( defined $m_name and length $m_name );
    +    
    +    # Normalize: If we've got an array of names, replace it with those names 
    +    if ( ref $m_name eq 'ARRAY' ) {
    +      my @items = @{ $m_name };
    +      # If array is followed by a params hash, each one gets the same params
    +      if ( scalar @_ and ref $_[0] eq 'HASH' and ! exists $_[0]->{'name'} ) {
    +	my $params = shift;
    +	@items = map { $_, $params } @items
    +      }
    +      unshift @_, @items;
    +      next;
    +    }
    +    
    +    # Parse interfaces, modifiers and parameters
    +    if ( $m_name =~ s/^-// ) {
    +      if (  $m_name !~ s/^-// ) {
    +	# -param => value
    +	$defaults->{$m_name} = shift @_; 
    +      } else {
    +	if ( $m_name eq '' ) {
    +	  # '--' => { param => value ... }
    +	  %$defaults = ( %$defaults, %{ shift @_ } );
    +		
    +	} elsif ( exists $mm_def->{'interface'}{$m_name} ) {
    +	  # --interface
    +	  $defaults->{'interface'} = $m_name;
    +	
    +	} elsif ( exists $mm_def->{'modifier'}{$m_name} ) {
    +	  # --modifier
    +	  $defaults->{'modifier'} .= 
    +			    ( $defaults->{'modifier'} ? ' ' : '' ) . "-$m_name";
    +	
    +	} elsif ( exists $mm_def->{'behavior'}{$m_name} ) {
    +	  # --behavior as shortcut for single-method interface
    +	  $defaults->{'interface'} = $m_name;
    +	
    +	} else {
    +	  _diagnostic('make_bad_modifier', $mm_def->{'name'}, "--$m_name");
    +	}
    +      }
    +      next;
    +    }
    +    
    +    # Make a new meta-method hash
    +    my $m_info;
    +    
    +    # Parse string, string-then-hash, and hash-only meta-method parameters
    +    if ( ! ref $m_name ) {
    +      if ( scalar @_ and ref $_[0] eq 'HASH' and ! exists $_[0]->{'name'} ) {
    +	%$m_info = ( 'name' => $m_name, %{ shift @_ } );
    +      } else {
    +	$m_info = { 'name' => $m_name };
    +      }
    +    
    +    } elsif ( ref $m_name eq 'HASH' ) {
    +      unless ( exists $m_name->{'name'} and length $m_name->{'name'} ) {
    +	_diagnostic('make_noname');
    +      }
    +      $m_info = { %$m_name };
    +    
    +    } else {
    +      _diagnostic('make_unsupported', $m_name);
    +    }
    +    _diagnostic('debug_declaration', join(', ', map { defined $_ ? $_ : '(undef)' } %$m_info) );
    +
    +    ### INITIALIZATION ### Requires: $mm_def, $defaults, $m_info
    +    
    +    my $interface = (
    +      $interface_cache{ $m_info->{'interface'} || $defaults->{'interface'} } 
    +	||= _interpret_interface( $mm_def, $m_info->{'interface'} || $defaults->{'interface'} )
    +    );
    +    %$m_info = ( 
    +      %$defaults, 
    +      ( $interface->{-params} ? %{$interface->{-params}} : () ),
    +      %$m_info 
    +    );
    +
    +    
    +    # warn "Actual: " . Dumper( $m_info );
    +
    +
    +    # Expand * and *{...} strings.
    +    foreach (grep defined $m_info->{$_}, keys %$m_info) {
    +      $m_info->{$_} =~ s/\*(?:\{([^\}]+)?\})?/ $m_info->{ $1 || 'name' } /ge
    +    }
    +    if ( $m_info->{'modifier'} and $mm_def->{modifier}{-folding} ) {
    +      $m_info->{'modifier'} = _fold_modifiers( $m_info->{'modifier'}, 
    +			$mm_def->{modifier}{-folding} )
    +    }
    +    
    +    ### METHOD GENERATION ### Requires: $mm_def, $interface, $m_info
    +    
    +    # If the MM def provides an initialization "-init" call, run it.
    +    if ( local $_ = $mm_def->{'behavior'}->{'-init'} ) {
    +      push @methods, map $_->( $m_info ), (ref($_) eq 'ARRAY') ? @$_ : $_;
    +    }
    +    # Build Methods
    +    for ( grep { /^[^-]/ } keys %$interface ) { 
    +      my $function_name = $_;
    +      $function_name =~ s/\*/$m_info->{'name'}/g;
    +      
    +      my $behavior = $interface->{$_};
    +      
    +      # Fold in additional modifiers
    +      if ( $m_info->{'modifier'} ) { 
    +	if ( $behavior =~ /^\-/ and $mm_def->{modifier}{-folding} ) {
    +	  $behavior = $m_info->{'modifier'} = 
    +			_fold_modifiers( "$m_info->{'modifier'} $behavior", 
    +			    $mm_def->{modifier}{-folding} )
    +	} else {
    +	  $behavior = "$m_info->{'modifier'} $behavior";
    +	}
    +      }
    +
    +      my $builder = 
    +	( $mm_def->{'-behavior_cache'}{$behavior} ) ? 
    +	$mm_def->{'-behavior_cache'}{$behavior} : 
    +	( ref($mm_def->{'behavior'}{$behavior}) eq 'CODE' ) ? 
    +	$mm_def->{'behavior'}{$behavior} : 
    +_behavior_builder( $mm_def, $behavior, $m_info );
    +      
    +      my $method = &$builder( $m_info );
    +      
    +      _diagnostic('debug_make_behave', $behavior, $function_name, $method);
    +      push @methods, ($function_name => $method) if ($method);
    +    }
    +    
    +    # If the MM def provides a "-subs" call, for forwarding and other
    +    # miscelaneous "subsidiary" or "contained" methods, run it.
    +    if ( my $subs = $mm_def->{'behavior'}->{'-subs'} ) {
    +      my @subs = (ref($subs) eq 'ARRAY') ? @$subs : $subs;
    +      foreach my $sub ( @subs ) {
    +	my @results = $sub->($m_info);
    +	if ( scalar @results == 1 and ref($results[0]) eq 'HASH' ) {
    +	  # If it returns a hash of helper method types, check the method info
    +	  # for any matching names and call the corresponding method generator.
    +	  my $types = shift @results;
    +	  foreach my $type ( keys %$types ) {
    +	    my $names = $m_info->{$type} or next; 
    +	    my @names = ref($names) eq 'ARRAY' ? @$names : split(' ', $names);
    +	    my $generator = $types->{$type};
    +	    push @results, map { $_ => &$generator($m_info, $_) } @names;
    +	  }	
    +	}
    +	push @methods, @results;
    +      }
    +    }
    +    
    +    # If the MM def provides a "-register" call, for registering meta-method
    +    # information for run-time access, run it.
    +    if ( local $_ = $mm_def->{'behavior'}->{'-register'} ) {
    +      push @methods, map $_->( $m_info ), (ref($_) eq 'ARRAY') ? @$_ : $_;
    +    }
    +  }
    +  
    +  return @methods;
    +}
    +
    +# I'd like for the make_methods() sub to be simpler, and to take advantage
    +# of the standard _get_declarations parsing provided by the superclass.
    +# Sadly the below doesn't work, due to a few order-of-operations peculiarities 
    +# of parsing interfaces and modifiers, and their associated default paramters.
    +# Perhaps it might work if the processing of --options could be overridden with
    +# a callback sub, so that interfaces and their params can be parsed in order.
    +sub _x_get_declarations {	
    +  my $mm_def = shift;
    +
    +  my @declarations = $mm_def::SUPER->_get_declarations( @_ );
    +
    +  # use Data::Dumper;
    +  # warn "In: " . Dumper( \@_ );
    +  # warn "Auto: " . Dumper( \@declarations );
    +
    +  my %interface_cache;
    +
    +  while (scalar @declarations) {
    +    
    +    my $m_info = shift @declarations;
    +
    +    # Parse interfaces and modifiers
    +    my @specials = grep $_, split '--', ( delete $m_info->{'--'} || '' );
    +    foreach my $special ( @specials ) {
    +      if ( exists $mm_def->{'interface'}{$special} ) {
    +	# --interface
    +	$m_info->{'interface'} = $special;
    +      
    +      } elsif ( exists $mm_def->{'modifier'}{$special} ) {
    +	# --modifier
    +	$m_info->{'modifier'} .= 
    +			  ( $m_info->{'modifier'} ? ' ' : '' ) . "-$special";
    +      
    +      } elsif ( exists $mm_def->{'behavior'}{$special} ) {
    +	# --behavior as shortcut for single-method interface
    +	$m_info->{'interface'} = $special;
    +      
    +      } else {
    +	_diagnostic('make_bad_modifier', $mm_def->{'name'}, "--$special");
    +      }
    +    }
    +
    +    my $interface = (
    +	$interface_cache{ $m_info->{'interface'} } 
    +	  ||= _interpret_interface( $mm_def, $m_info->{'interface'} )
    +    );
    +    $m_info = { %$m_info, %{$interface->{-params}} } if $interface->{-params};
    +
    +    _diagnostic('debug_declaration', join(', ', map { defined $_ ? $_ : '(undef)' } %$m_info) );
    +    
    +    # warn "Updated: " . Dumper( $m_info );
    +  }
    +}
    +
    +########################################################################
    +### TEMPLATES: _interpret_interface()
    +########################################################################
    +
    +sub _interpret_interface {
    +  my ($mm_def, $interface) = @_;
    +  
    +  if ( ref $interface eq 'HASH' ) { 
    +    return $interface if exists $interface->{'-parsed'};
    +  } 
    +  elsif ( ! defined $interface or ! length $interface ) { 
    +    _diagnostic('tmpl_empty');
    +
    +  } 
    +  elsif ( ! ref $interface ) {
    +    if ( exists $mm_def->{'interface'}{ $interface } ) {
    +      if ( ! ref $mm_def->{'interface'}{ $interface } ) { 
    +	$mm_def->{'interface'}{ $interface } = 
    +				{ '*' => $mm_def->{'interface'}{ $interface } };
    +      }
    +    } elsif ( exists $mm_def->{'behavior'}{ $interface } ) {
    +      $mm_def->{'interface'}{ $interface } = { '*' => $interface };
    +    } else {
    +      _diagnostic('tmpl_unkown', $interface);
    +    }
    +    $interface = $mm_def->{'interface'}{ $interface };
    +    
    +    return $interface if exists $interface->{'-parsed'};
    +  }
    +  elsif ( ref $interface ne 'HASH' ) {
    +    _diagnostic('tmpl_unsupported', $interface);
    +  } 
    +  
    +  $interface->{'-parsed'} = "$_[1]";
    +  
    +  # Allow interface inheritance via -base specification
    +  if ( $interface->{'-base'} ) {
    +    for ( split ' ', $interface->{'-base'} ) {
    +      my $base = _interpret_interface( $mm_def, $_ );
    +      %$interface = ( %$base, %$interface );
    +    }
    +    delete $interface->{'-base'};
    +  }
    +  
    +  for (keys %$interface) {
    +    # Remove empty/undefined items.
    +    unless ( defined $interface->{$_} and length $interface->{$_} ) {
    +      delete $interface->{$_};
    +      next;
    +    }
    +  }
    +  # _diagnostic('debug_interface', $_[1], join(', ', %$interface ));
    +  
    +  return $interface;
    +}
    +
    +########################################################################
    +### BEHAVIORS AND MODIFIERS: _fold_modifiers(), _behavior_builder()
    +########################################################################
    +
    +sub _fold_modifiers {
    +  my $spec = shift;
    +  my $rules = shift;
    +  my %rules = @$rules;
    +  
    +  # Longest first, to prevent over-eager matching.
    +  my $rule = join '|', map "\Q$_\E", 
    +	sort { length($b) <=> length($a) } keys %rules;
    +  # Match repeatedly from the front.
    +  1 while ( $spec =~ s/($rule)/$rules{$1}/ );
    +  $spec =~ s/(^|\s)\s/$1/g;
    +  return $spec;
    +}
    +
    +sub _behavior_builder {
    +  my ( $mm_def, $behavior, $m_info ) = @_;
    +  
    +  # We're going to have to do some extra work here, so we'll cache the result
    +  my $builder;
    +  
    +  # Separate the modifiers
    +  my $core_behavior = $behavior;
    +  my @modifiers;
    +  while ( $core_behavior =~ s/\-(\w+)\s// ) { push @modifiers, $1 }
    +  
    +  # Find either the built-in or universal behavior template
    +  if ( $mm_def->{'behavior'}{$core_behavior} ) {
    +    $builder = $mm_def->{'behavior'}{$core_behavior};
    +  } else {
    +    my $universal = _definition('Class::MakeMethods::Template::Universal','generic');
    +    $builder = $universal->{'behavior'}{$core_behavior} 
    +  }
    +  
    +  # Otherwise we're hosed.
    +  $builder or _diagnostic('make_bad_behavior', $m_info->{'name'}, $behavior);
    +  
    +  if ( ! ref $builder ) {
    +    # If we've got a text template, pass it off for interpretation.
    +    my $code = ( ! $Class::MakeMethods::Utility::DiskCache::DiskCacheDir ) ?
    +      _interpret_text_builder($mm_def, $core_behavior, $builder, @modifiers) 
    +    : _disk_cache_builder($mm_def, $core_behavior, $builder, @modifiers);
    +    
    +    # _diagnostic('debug_eval_builder', $name, $code);
    +    local $^W unless $Class::MakeMethods::CONTEXT{Debug};
    +    $builder = eval $code;
    +    if ( $@ ) { _diagnostic('behavior_eval', $@, $code) }
    +    unless (ref $builder eq 'CODE') { _diagnostic('behavior_eval', $@, $code) }
    +  
    +  } elsif ( scalar @modifiers ) {
    +    # Can't modify code subs
    +    _diagnostic('make_behavior_mod', join(', ', @modifiers), $core_behavior);
    +  }
    +  
    +  $mm_def->{'-behavior_cache'}{$behavior} = $builder;
    +
    +  return $builder;
    +}
    +
    +########################################################################
    +### CODE EXPRESSIONS: _interpret_text_builder(), _disk_cache_builder()
    +########################################################################
    +
    +sub _interpret_text_builder {
    +  require Class::MakeMethods::Utility::TextBuilder;
    +  
    +  my ( $mm_def, $name, $code, @modifiers ) = @_;
    +  
    +  foreach ( @modifiers ) {
    +    exists $mm_def->{'modifier'}{$_} 
    +      or _diagnostic('behavior_mod_unknown', $name, $_);
    +  }
    +  
    +  my @exprs = grep { $_ } map { 
    +	$mm_def->{'modifier'}{ $_ }, 
    +	$mm_def->{'modifier'}{ "$_ $name" } || $mm_def->{'modifier'}{ "$_ *" }
    +      } ( '-all', ( scalar(@modifiers) ? @modifiers : '-default' ) );
    +  
    +  # Generic method template
    +  push @exprs, "return sub _SUB_ATTRIBS_ { \n  my \$self = shift;\n  * }";
    +  
    +  # Closure-generator
    +  push @exprs, "sub { my \$m_info = \$_[0]; * }";
    +  
    +  my $exprs = $mm_def->{code_expr};
    +  unshift @exprs, { 
    +	( map { $_=>$exprs->{$_} } grep /^[^-]/, keys %$exprs ),
    +	'_BEHAVIOR_{}' => $mm_def->{'behavior'},
    +	'_SUB_ATTRIBS_' => '',
    +  };
    +  
    +  my $result = Class::MakeMethods::Utility::TextBuilder::text_builder($code,
    +								       @exprs);
    +  
    +  my $modifier_string = join(' ', map "-$_", @modifiers);
    +  my $full_name = "$name ($mm_def->{template_class} $mm_def->{template_name}" .
    +		    ( $modifier_string ? " $modifier_string" : '' ) . ")";
    +  
    +  _diagnostic('debug_template_builder', $full_name, $code, $result);
    +  
    +  return $result;
    +}
    +
    +sub _disk_cache_builder { 
    +  require Class::MakeMethods::Utility::DiskCache;
    +  my ( $mm_def, $core_behavior, $builder, @modifiers ) = @_;
    +  
    +  Class::MakeMethods::Utility::DiskCache::disk_cache( 
    +    "$mm_def->{template_class}::$mm_def->{template_name}", 
    +    join('.', $core_behavior, @modifiers),
    +    \&_interpret_text_builder, ($mm_def, $core_behavior, $builder, @modifiers)
    +  );
    +}
    +
    +1;
    +
    +__END__
    +
    +
    +=head1 NAME
    +
    +Class::MakeMethods::Template - Extensible code templates 
    +
    +
    +=head1 SYNOPSIS
    +
    +  package MyObject;
    +  use Class::MakeMethods::Template::Hash (
    +    'new'       => 'new',
    +    'string'    => 'foo',
    +    'number'    => 'bar',
    +  );
    +   
    +  my $obj = MyObject->new( foo => "Foozle", bar => 23 );
    +  print $obj->foo();
    +  $obj->bar(42);
    +
    +
    +=head1 MOTIVATION
    +
    +If you compare the source code of some of the closure-generating
    +methods provided by other subclasses of Class::MakeMethods,
    +such as the C accessors provided by the various Standard::*
    +subclasses, you will notice a fair amount of duplication. This
    +module provides a way of assembling common pieces of code to
    +facilitate support the maintenance of much larger libraries of
    +generated methods.
    +
    +
    +=head1 DESCRIPTION
    +
    +This module extends the Class::MakeMethods framework by providing
    +an abstract superclass for extensible code-templating method
    +generators.
    +
    +Common types of methods are generalized into B