xd-3.22.09/CLASSES0000644000175000017500000000004512136471634011744 0ustar frankfbbcommand alternatives arbiter history xd-3.22.09/INSTALL0000644000175000017500000000401612043251703011745 0ustar frankfbbThese are the installation instructions for xd. Extensive Installation Instruction: =================================== License: This is free software according to the Gnu General Public License Copyright (c) 1994-NOW Frank B. Brokken (f.b.brokken@rug.nl) Preliminaries: -------------- You should use icmake to compile xd. Icmake may be obtained from http://icmake.sourceforge.net If you don't have icmake, you have to compile and link all sources by hand. No support for this case is provided here. To construct the man-page you need Yodl. Yodl can be obtained from http://yodl.sourceforge.net Both icmake and yodl are available as Debian linux packages, see www.debian.org --------------------------------------------------------------------------- Xd itself depends on the Bobcat library. Bobcat is found at http://bobcat.sourceforge.net. All prerequisites are also available as Debian Linux packages, see www.debian.org Installation Instructions: -------------------------- 1. All commands should be entered in the directory where the xd_XX.YY.ZZ.tar.gz archive unpacks to (i.e., xd-XX.YY.ZZ/). 2. Make sure you have the bobcat library and headers installed 3. Verify (and optionally modify) the directory locations in INSTALL.im (usually the default paths are fine) 4. Do (not necessarily as root): ./build program This creates tmp/bin/xd, and ./build man This creates tmp/man/xd.1 and tmp/manhtml/xdman.html 5. Do (now as root): to install the program xd itself: ./build install program to install the man-page: ./build install man to install the additional standard documentation: ./build install std 6. Read the man-page for useful bash- and/or tcsh aliases to be used with xd. Cleanup-instructions. --------------------- ./build distclean should cleanup all files created during the construction process of either program or man-page. Alternatively, remove the xd-XX.YY.ZZ directory extracted from xd_XX.YY.ZZ.tar.gz Frank B. Brokken xd-3.22.09/INSTALL.im0000644000175000017500000000176512043250514012360 0ustar frankfbb // Specify the name of the project: #define PROJECT "xd" // When defined, these overrule COMPILER and COMPILER_OPTIONS // COMPILER and COMPILER_OPTIONS are now obsolete // Instead of CXX and CXXFLAGS, CC and CFLAGS can be used. // Their #define values are overruled by identically named environment // variables. #define CXX "g++" // the compiler to use. #define CXXFLAGS "--std=c++0x -Wall -O2 -g" // the compiler options to use. #define LDFLAGS "" // flags passed to the linker // ========================================================================= // The following locations are overruled by `build install' arguments #define BINARY "/usr/bin/"${PROJECT} // the full path of the final program #define MAN "/usr/share/man/man1" // the directory whre the manual page is stored #define STD "/usr/share/doc/"${PROJECT} // the directory where the standard documentation is stored xd-3.22.09/LICENSE0000644000175000017500000010451312240364064011730 0ustar frankfbb GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, 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 them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If 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 convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU 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 Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state 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 program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . xd-3.22.09/README0000644000175000017500000000617311746473745011627 0ustar frankfbb =============================== XD by Frank B. Brokken =============================== Thank you for retrieving XD! ---------------------------- The XD program is a smart directory changer. In cases where you have to change directories, you probably often have enter long commands, like cd /usr/include/c++/4.3/i486-linux-gnu/bits For case like this, xd was developed. XD uses the initial characters of subdirectories to expand them for you. Instead of the above command, a simple xd uic4ib would be enough. The command may seem weird at first, but realize that you know where you wanted to go to: while telling yourself where you want to go to you simply enter the initial character of the directory you mumble to yourself. That's all. The program and its sources is distributed under the terms of the GNU General Public Licence. When xd is started without arguments you get something like: ====================================================================== xd by Frank B. Brokken (f.b.brokken@rug.nl) xd V3.00.0 1994-2008 Usage: xd [options] args Where: [options] - optional arguments (short options and default values between parentheses): --all (-a) - skip `ignore' specification in the configuration file --config-file (-c) - path to the config file to use ($HOME/.xdrc) --add-root - search expansions from / (if-empty) --directories - which directories to show? (all) --help (-h) - provide this help --start-at - where to start the search? (home) --version (-v) - show version information and terminate --verbose (-V) - show xd's actions in detail args - arguments, possibly containing directory separators [/-]. xd eXchanges Directories by interpreting the characters of its argument(s) as the initial characters of nested subdirectories. Multiple arguments or arguments separated by / or - define the initial characters of subsequently nested subdirectories. If the first argument starts with . expansion starts at the current directory; if it's 0 expansion starts in the user's home directory; if it's / expansion starts at the root; if it's a number (1 .. 9) expansion starts at parent ; otherwise expansion starts at the location defined by the configuration file When the specification results in multiple solutions, a final selection is requested from a displayed list of alternatives. Use 'man xd' or read the xdrc file provided with the distribution for details about xd's configuration file ====================================================================== This should help you out to configure xd to your needs. The man-page provides much more information about how to use xd. I hope you find xd useful and will enjoy using it. Frank. xd-3.22.09/TODO0000644000175000017500000000001011746473745011417 0ustar frankfbbnothing xd-3.22.09/VERSION0000644000175000017500000000006612240364025011766 0ustar frankfbb#define VERSION "3.22.09" #define YEARS "1994-2013" xd-3.22.09/VERSION.h0000644000175000017500000000010411746473745012231 0ustar frankfbb#include "VERSION" SUBST(_CurVers_)(VERSION) SUBST(_CurYrs_)(YEARS) xd-3.22.09/alternatives/0000755000175000017500000000000012240363550013417 5ustar frankfbbxd-3.22.09/alternatives/addignored.cc0000644000175000017500000000067211746473745016055 0ustar frankfbb#include "alternatives.ih" void Alternatives::addIgnored(string const &line, std::set &ignoreSet) { istringstream in(line); string path; in >> path >> path; // skip ignore, extract path // add a / unless the path ends in * or / if (*path.rbegin() != '*' && *path.rbegin() != '/') path += '/'; imsg << "ignoring " << path << endl; ignoreSet.insert(path); } xd-3.22.09/alternatives/globfilter.cc0000644000175000017500000000272312060632353016063 0ustar frankfbb#include "alternatives.ih" void Alternatives::globFilter(char const *entry, GlobContext &context) { imsg << "Inspecting `" << entry << "': "; // if a trailing / was removed reinstall it. string dirEntry(entry); if (*dirEntry.rbegin() != '/') dirEntry += '/'; if ( find_if( context.ignore.begin(), context.ignore.end(), [&](std::string const &ignore) { return matchIgnore(ignore, dirEntry.c_str()); } ) != context.ignore.end()) { imsg << "ignored" << endl; return; } string spec = entry; if // ignore the . nd .. directories ( spec.rfind("/.") == spec.length() - 2 || spec.rfind("/..") == spec.length() - 3 ) { imsg << "dot-directory" << endl; return; } Stat stat(entry); // check if the entry name (globbed) is equal to the true path name // if not, the globbed name is a link to the true path if (!context.alternatives.d_dirs && stat.path() != spec) { imsg << "symlink" << endl; return; } if ( context.stored.insert( pair(stat.inode(), stat.device()) ).second == false // entry already there ) { imsg << "already available" << endl; return; } imsg << "ACCEPTED" << endl; context.alternatives.add(entry); } xd-3.22.09/alternatives/globpattern.cc0000644000175000017500000000313512100226155016243 0ustar frankfbb#include "alternatives.ih" // abcd is handled as: // // 1. a*/ if existing: test bcd else leave. // // 1.1. a*/b* if existing: test cd else leave (etc). // // 2. ab*/ test cd (etc). // // but if a/bcd is entered: // // 1. a*/ if existing: test /bcd, else leave // // 1.1 a*/b* if existing: test cd, else leave (etc) // // 2. a/b: not tested // 3. a/bc: not tested // 4. a/bcd: not tested // // So: if the head contains a / it is not tested. // If the tail starts with /, that char is ignored. void Alternatives::globPattern(string pattern, string const &searchCmd, size_t idx, GlobContext &context) try { // create a pattern from pattern + initial substring string head = searchCmd.substr(0, idx); if (head.find('/') != string::npos) // ignore if head has a / throw false; // caught by globHead pattern += head; pattern += "*/"; // this pattern must exist Glob glob(Glob::DIRECTORY, pattern, Glob::NOSORT, Glob::DEFAULT); imsg << "Pattern `" << pattern << "', " << glob.size() << " matches" << endl; if (idx != searchCmd.length()) { string tail = searchCmd.substr(idx); globHead(pattern, tail[0] == '/' ? tail.substr(1) : tail, context); } else { for (auto entry: glob) globFilter(entry, context); } } catch (exception const &err) { imsg << "No pattern matching `" << pattern << "', pruning this branch" << endl; throw false; } xd-3.22.09/alternatives/alternativesdata.cc0000644000175000017500000000153111746473745017303 0ustar frankfbb#include "alternatives.ih" char const *Alternatives::s_merge[] = { "false", "true" }; char const *const *const Alternatives::s_mergeEnd = s_triState + sizeof(s_merge) / sizeof(char *); char const *Alternatives::s_triState[] = { "never", "if-empty", "always" }; char const *const *const Alternatives::s_triStateEnd = s_triState + sizeof(s_triState) / sizeof(char *); char const *Alternatives::s_startAt[] = { "root", "home", }; char const *const *const Alternatives::s_startAtEnd = s_startAt + sizeof(s_startAt) / sizeof(char *); char const *Alternatives::s_dirs[] = { "unique", "all", }; char const *const *const Alternatives::s_dirsEnd = s_dirs + sizeof(s_dirs) / sizeof(char *); char Alternatives::s_defaultConfig[] = ".xdrc"; // in $HOME xd-3.22.09/alternatives/order.cc0000644000175000017500000000024011746473745015057 0ustar frankfbb#include "alternatives.ih" void Alternatives::order() { if (not d_history.rotate()) return; rotate(begin(), begin() + d_nInHistory, end()); } xd-3.22.09/alternatives/globhead.cc0000644000175000017500000000045011746473745015514 0ustar frankfbb#include "alternatives.ih" void Alternatives::globHead(string const &initial, string searchCmd, GlobContext &context) try { for (size_t idx = 0; idx != searchCmd.length(); ) globPattern(initial, searchCmd, ++idx, context); } catch (bool headHasSlash) {} xd-3.22.09/alternatives/alternatives.ih0000644000175000017500000000040112240363231016431 0ustar frankfbb#include "alternatives.h" #include #include #include #include #include #include #include #include using namespace std; using namespace FBB; xd-3.22.09/alternatives/alternatives.h0000644000175000017500000000643512131262433016276 0ustar frankfbb#ifndef _INCLUDED_ALTERNATIVES_H_ #define _INCLUDED_ALTERNATIVES_H_ #include #include #include #include #include #include "../command/command.h" #include "../history/history.h" namespace FBB { class ArgConfig; } // If, when looking for /t*/m*/ps*/ the initial path /t*/m* does not exist // then there's no reason for inspecting /t*/mp*/s*/ as it won't exist either. // // In those cases the non-existing path is pruned (i.e., t*/m* is) an // subpatterns of the pruned path (e.g., t*/mp*) are not considered (and so: // not globbed) class Alternatives: public std::deque { private: std::string d_homeDir; FBB::ArgConfig &d_arg; bool d_separate; size_t d_nInHistory; bool d_home; // true: search from $HOME bool d_dirs; // true: search all dirs (also via links) enum TriState { FALSE, IF_EMPTY, TRUE }; TriState d_addRoot; // true: always also search /, ifEmpty: only if // search from $HOME fails Command d_command; History d_history; static char const *s_triState[]; static char const *const *const s_triStateEnd; static char const *s_startAt[]; static char const * const *const s_startAtEnd; static char const *s_dirs[]; static char const *const *const s_dirsEnd; static char const *s_merge[]; static char const *const *const s_mergeEnd; static char s_defaultConfig[]; public: Alternatives(); void viable(); void order(); void update(size_t idx); // size_t beginHistory() const; // size_t endHistory() const; size_t separateAt() const; private: static std::string getHome(); FBB::ArgConfig &configFile(); size_t set(char const *longKey, char const *const * const begin, char const *const *const end, size_t notFound); void getCwd(std::unique_ptr *dest); std::string determineInitialDirectory(); void globFrom(std::string initial); void add(char const *path); // also determines d_nPatterns struct GlobContext { Alternatives &alternatives; std::set > stored; std::set ignore; }; void glob(std::string initial, GlobContext &context); void generalizedGlob(std::string initial, GlobContext &context); void globHead(std::string const &initial, std::string searchCmd, GlobContext &context); void globPattern(std::string pattern, std::string const &searchCmd, size_t idx, GlobContext &context); static void globFilter(char const *entry, GlobContext &context); static void addIgnored(std::string const &line, std::set &ignoreSet); static bool matchIgnore(std::string const &ignore, char const *entry); }; inline void Alternatives::update(size_t index) { d_history.save((*this)[index]); } #endif xd-3.22.09/alternatives/configfile.cc0000644000175000017500000000110311746473745016050 0ustar frankfbb#include "alternatives.ih" ArgConfig &Alternatives::configFile() { ArgConfig &arg = ArgConfig::instance(); string confName; if (arg.option(&confName, 'c')) arg.open(confName); else { confName = d_homeDir + s_defaultConfig; Stat confStat(confName); if (confStat) { if (not confStat.mode() & Stat::UR) wmsg << "Can't read " << confName << endl; else arg.open(confName); } } imsg << "Configuration file: " << confName << endl; return arg; } xd-3.22.09/alternatives/generalizedglob.cc0000644000175000017500000000062611746473745017111 0ustar frankfbb#include "alternatives.ih" void Alternatives::generalizedGlob(string initial, GlobContext &context) { // create the command consisting of all cmd line args string searchCmd = d_command.accumulate(); searchCmd.resize(searchCmd.length() - 1); // remove trailing / imsg << "Merged search command: `" << searchCmd << '\'' << endl; globHead(initial, searchCmd, context); } xd-3.22.09/alternatives/alternatives.cc0000644000175000017500000000033311746473745016450 0ustar frankfbb#include "alternatives.ih" Alternatives::Alternatives() : d_homeDir(getHome()), d_arg(configFile()), d_separate(d_arg.option(0, "history-separate")), d_nInHistory(0), d_history(d_arg, d_homeDir) {} xd-3.22.09/alternatives/glob.cc0000644000175000017500000000115712100226155014647 0ustar frankfbb#include "alternatives.ih" void Alternatives::glob(string dir, GlobContext &context) try { for (auto &element: d_command) (dir += element) += "*/"; // add */ to each cmd arg dir.resize(dir.length() - 1); // remove trailing / imsg << "Passing `" << dir << "' to glob" << endl; // find matching elements Glob glob(Glob::DIRECTORY, dir, Glob::NOSORT, Glob::DEFAULT); for (auto entry: glob) globFilter(entry, context); // accept unique dirs. } catch (exception const &exc) {} xd-3.22.09/alternatives/separateat.cc0000644000175000017500000000042411746473745016101 0ustar frankfbb#include "alternatives.ih" size_t Alternatives::separateAt() const { if (not d_separate || d_nInHistory == size()) return UINT_MAX; return d_history.position() == History::TOP ? d_nInHistory : size() - d_nInHistory; } xd-3.22.09/alternatives/getcwd.cc0000644000175000017500000000034411746473745015226 0ustar frankfbb#include "alternatives.ih" void Alternatives::getCwd(unique_ptr *dest) { dest->reset(new char[PATH_MAX]); if (not realpath(".", dest->get())) fmsg << "Can't determine the current working dir." << endl; } xd-3.22.09/alternatives/gethome.cc0000644000175000017500000000067511746473745015410 0ustar frankfbb#include "alternatives.ih" string Alternatives::getHome() { string homeDir; char *cp = getenv("HOME"); // determine the homedir if (!cp) // save it homeDir = '/'; else { homeDir = cp; if (*homeDir.rbegin() != '/') homeDir += '/'; } // home set with ending / imsg << "Home directory: " << homeDir << endl; return homeDir; } xd-3.22.09/alternatives/add.cc0000644000175000017500000000031711746473745014501 0ustar frankfbb#include "alternatives.ih" void Alternatives::add(char const *entry) { if (not d_history.find(entry)) push_back(entry); else { push_front(entry); ++d_nInHistory; } } xd-3.22.09/alternatives/matchignore.cc0000644000175000017500000000055211746473745016252 0ustar frankfbb#include "alternatives.ih" bool Alternatives::matchIgnore(std::string const &ignore, char const *entry) { return *ignore.rbegin() != '*' ? // literal match required ignore == entry : // wildcard match of final * OK string(entry).find(ignore.substr(0, ignore.length() - 1)) == 0; } xd-3.22.09/alternatives/determineinitialdir.cc0000644000175000017500000000244111746473745017776 0ustar frankfbb#include "alternatives.ih" string Alternatives::determineInitialDirectory() { string cwd; unique_ptr buffer; bool rescan = false; switch (d_command.action()) { case Command::FROM_CONFIG: cwd = d_home ? d_homeDir : string("/"); rescan = true; break; case Command::FROM_HOME: cwd = d_homeDir; break; case Command::FROM_ROOT: cwd = "/"; break; case Command::FROM_CWD: getCwd(&buffer); cwd = buffer.get(); break; case Command::FROM_PARENT: getCwd(&buffer); cwd = buffer.get(); size_t pos = cwd.length(); for (size_t idx = d_command.parent(); pos && idx--; ) pos = cwd.rfind('/', pos - 1); if (pos > 0) cwd.resize(pos); else cwd = '/'; break; } if (d_addRoot != FALSE && (!d_home || !rescan)) { imsg << "Search does not start at the home dir: " "no additional search from the root" << endl; d_addRoot = FALSE; } imsg << "Resolved Cwd as: " << cwd << endl; if (*cwd.rbegin() != '/') // all dirs end in / cwd += '/'; return cwd; } xd-3.22.09/alternatives/viable.cc0000644000175000017500000000126611746473745015217 0ustar frankfbb#include "alternatives.ih" void Alternatives::viable() { d_home = set("start-at", s_startAt, s_startAtEnd, 1); d_dirs = set("directories", s_dirs, s_dirsEnd, 1); d_addRoot = static_cast (set("add-root", s_triState, s_triStateEnd, IF_EMPTY)); imsg << boolalpha << "Search from $HOME: " << d_home << '\n' << "Search all directories: " << d_dirs << '\n' << "Add root search if search from $HOME fails: " << s_triState[d_addRoot] << endl; globFrom(determineInitialDirectory()); sort(begin(), begin() + d_nInHistory); sort(begin() + d_nInHistory, end()); } xd-3.22.09/alternatives/set2.cc0000644000175000017500000000152411746473745014627 0ustar frankfbb#include "alternatives.ih" size_t Alternatives::set(char const *longKey, char const *const *const begin, char const *const *const end, size_t notFound) { string conf; if (!d_arg.option(&conf, longKey)) { imsg << "Option or config: No key `" << longKey << '\'' << endl; return notFound; } char const *const *const ret = find_if(begin, end, bind2nd(equal_to(), conf)); if (ret != end) { imsg << "Option or config `" << longKey << " " << conf << "' found" << endl; return ret - begin; } imsg << "`" << longKey << " " << conf << "' not supported. Using the default `" << begin[notFound] << "'." << endl; return notFound; } xd-3.22.09/alternatives/globfrom.cc0000644000175000017500000000131412043250474015535 0ustar frankfbb#include "alternatives.ih" void Alternatives::globFrom(string initial) { GlobContext context = {*this}; if (not d_arg.option('a')) { auto iters = d_arg.beginEndRE("^\\s*ignore\\s+\\S+\\s*$"); for (auto &line: ranger(iters.first, iters.second)) addIgnored(line, context.ignore); } void (Alternatives::*globFun)(string dir, GlobContext &context) = d_arg.option('g') && !d_arg.option(0, "traditional") ? &Alternatives::generalizedGlob : &Alternatives::glob; (this->*globFun)(initial, context); if (d_addRoot == TRUE || (size() == 0 && d_addRoot == IF_EMPTY)) (this->*globFun)("/", context); } xd-3.22.09/arbiter/0000755000175000017500000000000012131263415012344 5ustar frankfbbxd-3.22.09/arbiter/show.cc0000644000175000017500000000072411746473745013662 0ustar frankfbb#include "arbiter.ih" size_t Arbiter::show(size_t begin, char first, char last, size_t separateAt) const { size_t end = min(begin + last - first + 1, d_alternatives.size()); for (; begin != end; ++begin, ++first) { if (begin == separateAt) cerr << '\n'; cerr << setw(2) << first << ": " << d_alternatives[begin] << '\n'; } return begin; } xd-3.22.09/arbiter/setindex.cc0000644000175000017500000000075211746473745014526 0ustar frankfbb#include "arbiter.ih" void Arbiter::setIndex() { int c; OneKey oneKey; oneKey.verify(); c = oneKey.get(); // get the replay if (c == '0') d_index = 9; else if (isdigit(c)) d_index = c - '1'; else if (islower(c)) d_index = '9' - '0' + 1 + c - 'a'; else if (isupper(c)) d_index = '9' - '0' + 1 + 'z' - 'a' + 1 + c - 'A'; else throw 1; if (d_index > d_alternatives.size()) throw 1; } xd-3.22.09/arbiter/showalternatives.cc0000644000175000017500000000052011746473745016276 0ustar frankfbb#include "arbiter.ih" void Arbiter::showAlternatives() const { imsg << endl; size_t separateAt = d_alternatives.separateAt(); size_t begin = show(0, '1', '9', separateAt); begin = show(begin, '0', '0', separateAt); begin = show(begin, 'a', 'z', separateAt); begin = show(begin, 'A', 'Z', separateAt); } xd-3.22.09/arbiter/select.cc0000644000175000017500000000056611746473745014165 0ustar frankfbb#include "arbiter.ih" void Arbiter::select() { if (d_alternatives.size() == 0) throw 0; if (d_alternatives.size() == 1) { imsg << endl; d_index = 0; // forced selection: one option } else { showAlternatives(); setIndex(); } cout << d_alternatives[d_index] << endl; } xd-3.22.09/arbiter/decided.cc0000644000175000017500000000021311746473745014254 0ustar frankfbb#include "arbiter.ih" bool Arbiter::decided() const { d_alternatives.update(d_index); return d_index != d_alternatives.size(); } xd-3.22.09/arbiter/arbiter.cc0000644000175000017500000000021711746473745014327 0ustar frankfbb#include "arbiter.ih" Arbiter::Arbiter(Alternatives &alternatives) : d_index(alternatives.size()), d_alternatives(alternatives) {} xd-3.22.09/arbiter/arbiter.h0000644000175000017500000000100611746473745014166 0ustar frankfbb#ifndef _Arbiter_H_ #define _Arbiter_H_ #include #include "../alternatives/alternatives.h" class Arbiter { size_t d_index; Alternatives &d_alternatives; public: Arbiter(Alternatives &alternatives); void select(); bool decided() const; private: void showAlternatives() const; size_t show(size_t begin, char first, char last, size_t separateAt) const; void setIndex(); }; #endif xd-3.22.09/arbiter/arbiter.ih0000644000175000017500000000023411746473745014341 0ustar frankfbb#include "arbiter.h" #include #include #include #include using namespace std; using namespace FBB; xd-3.22.09/arguments.cc0000644000175000017500000000354711746473745013265 0ustar frankfbb#include "xd.ih" // program header file namespace // the anonymous namespace can be used here { ArgConfig::LongOption longOptions[] = { {"add-root", ArgConfig::Required}, {"directories", ArgConfig::Required}, {"start-at", ArgConfig::Required}, {"history", ArgConfig::Optional}, {"history-lifetime", ArgConfig::Required}, {"history-maxsize", ArgConfig::Required}, // history/load.cc {"history-separate", ArgConfig::None}, {"history-position", ArgConfig::Required}, // top, bottom {"traditional", ArgConfig::None}, {"all", 'a'}, {"config-file", 'c'}, {"help", 'h'}, {"generalized-search", 'g'}, {"version", 'v'}, {"verbose", 'V'}, }; ArgConfig::LongOption const *const longEnd = longOptions + sizeof(longOptions) / sizeof(ArgConfig::LongOption); } void arguments(int argc, char **argv) { char *last = argv[argc - 1]; // remove the / from the last size_t idx = strlen(last) - 1; // cmd line argument if (last[idx] == '/') last[idx] = 0; ArgConfig &arg = ArgConfig::initialize("ac:ghvV", longOptions, longEnd, argc, argv); arg.setCommentHandling(ArgConfig::RemoveComment); streambuf *buf = cout.rdbuf(cerr.rdbuf()); // make sure that try // versionHelp doesn't { // write to cout arg.versionHelp(usage, Icmbuild::version, 1); cout.rdbuf(buf); } catch(...) { cout.rdbuf(buf); throw; } imsg.reset(cerr); imsg.setActive(arg.option('V')); fmsg.reset(cerr); } xd-3.22.09/build0000755000175000017500000000457512043250514011752 0ustar frankfbb#!/usr/bin/icmake -qt/tmp/bisonc++ #include "icmconf" #include "icmake/setopt" #include "icmake/run" #include "icmake/md" #include "icmake/special" #include "icmake/clean" #include "icmake/manpage" #include "icmake/install" string g_cwd = chdir(""); // initial working directory void main(int argc, list argv) { string option; string strip; option = argv[1]; if (option == "clean") clean(0); if (option == "distclean") clean(1); if (option == "install") install(argv[2], argv[3]); if (option != "") special(); if (option == "sourceforge") exit(0); if (option == "man") manpage(); if (option == "library") { system("icmbuild library"); exit(0); } if (argv[2] == "strip") strip = "strip"; if (option == "program") { system("icmbuild program " + strip); exit(0); } if (option == "oxref") { system("icmbuild program " + strip); run("oxref -fxs tmp/lib" LIBRARY ".a > " PROJECT ".xref"); exit(0); } printf("Usage: build [-p] what\n" "Where `what' is one of:\n" " clean - clean up remnants of previous " "compilations\n" " distclean - clean + fully remove tmp/\n" " library - build " PROJECT "'s library\n" " man - build the man-page (requires Yodl)\n" " program [strip] - build " PROJECT " (optionally strip the\n" " executable)\n" " oxref [strip] - same a `program', also builds xref file\n" " using oxref\n" " install program [path] - install the program at `path'\n" " (by default below `" PROJECT "')\n" " install man [base] - install the man pages below `base'\n" " (by default below `" MAN "')\n" " install std [base] - install standard docs below `base'\n" " (by default below `" STD "')\n" " sourceforge - prepare sourceforge's index update\n" "\n" "If the environment variable DRYRUN is defined, no commands are\n" "actually executed\n" "\n" ); exit(1); } xd-3.22.09/build-depends0000644000175000017500000000016512043251703013357 0ustar frankfbbBuild-Depends: libbobcat-dev (>= 3.11.01), icmake (>= 7.19.00), g++ (>= 4.7.1), yodl (>= 3.00.0) xd-3.22.09/changelog0000644000175000017500000001475212240363703012601 0ustar frankfbbxd (3.22.09) * Added missing (since g++ 2.8.2) #include to alternatives.ih -- Frank B. Brokken Tue, 12 Nov 2013 09:33:03 +0100 xd (3.22.08) * Catching std::exceptions instead of FBB::Errno exceptions -- Frank B. Brokken Thu, 24 Jan 2013 13:42:22 +0100 xd (3.22.07) * Using Glob(Glob::DIRECTORY, ... to find directories -- Frank B. Brokken Mon, 29 Oct 2012 11:50:45 +0100 xd (3.22.06) * Added the build-depends file and updated the INSTALL file. -- Frank B. Brokken Sun, 28 Oct 2012 10:06:05 +0100 xd (3.22.05) * The following #defines in INSTALL.im can be overruled by defining identically named environment variables: CXX defines the name of the compiler to use. By default `g++' CXXFLAGS the options passed to the compiler. By default `-Wall --std=c++0x -O2 -g' LDFLAGS the options passed to the linker. By default no options are passed to the linker. -- Frank B. Brokken Wed, 18 Jul 2012 15:39:24 +0200 xd (3.22.04) * New upstream release, cosmetic changes (removed 3.22.03 headers again) -- Frank B. Brokken Thu, 10 May 2012 15:55:34 +0200 xd (3.22.03) * New version requires bobcat >= 3.00.00 -- Frank B. Brokken Thu, 03 May 2012 20:30:17 +0200 xd (3.22.02) * New version to link against bobcat 2.20.02, changes some for_eaches into range-based for-loops -- Frank B. Brokken Fri, 06 Jan 2012 08:55:35 +0100 xd (3.22.01) * `build' script now recognizes CXXFLAGS and LDFLAGS for, resp. g++ and ld flags. Default values are set in INSTALL.im, as before. -- Frank B. Brokken Sun, 26 Jun 2011 15:09:45 +0200 xd (3.22.00) * Replaced Bobcat's FnWrap* calls by lambda functions * The 'build' script now uses the -g option by default (set in INSTALL.im). To modify the g++ compilation options change the #define CPPOPT in INSTALL.im. By default it is set to "-O2 -g". To modify the flags `on the fly' set the environment variable CPPFLAGS, overruling CPPOPT. The option "-Wall" is always used and should not be altered. -- Frank B. Brokken Tue, 14 Jun 2011 21:06:15 +0200 xd (3.21.00) * The history retention mechanism has been simplified. Either the last x number of history lines are kept (using --history-maxsize) or the most recent history lines (as specified by --history-lifetime) are kept. * The selected choice is always given the current time stamp, so if a history is kept, in will always contain the most recently made choice. * The GPL is added to the tar.gz archive created by trunk/sourcetar * Superfluous icmake files (rebuild, manual) were removed. -- Frank B. Brokken Fri, 18 Feb 2011 15:23:45 +0100 xd (3.20.0) * Continuation patterns following a pattern not matching any file are pruned, speeding up XD's search process. * Added memory for previous selections, showing the popular alternatives matching a search pattern either at the beginning or at the end of the list of alternatives. Using history is optional, cf. the xd(1) man-page. * This version requires bobcat >= 2.10.0 -- Frank B. Brokken Fri, 17 Dec 2010 21:30:18 +0100 xd (3.12.0) * XD now requires Bobcat >= 2.09.00, using Bobcat's Mstream objects for message handling * Changed all fnwrap1c calls into fnwrap::unary calls -- Frank B. Brokken Fri, 29 Oct 2010 10:24:43 +0200 xd (3.11.0) * Generalized search didn't recognize plain directories to ignore unless a trailing * was appended. Now fixed. -- Frank B. Brokken Fri, 25 Sep 2009 22:27:31 +0200 xd (3.10.2) * Using compiler option --std=c++0x -- Frank B. Brokken Sun, 30 Aug 2009 11:47:49 +0200 xd (3.10.1) * XD's home directory now at http://xd-home.sourceforge.net/ -- Frank B. Brokken Sat, 28 Mar 2009 10:47:36 +0100 xd (3.10.0) * Implemented Generalized Directory Search (GDS) inserting directory separators at all possible positions of the search string. See the man-page for details. GDS use is optional. xd (3.00.1) * Minor modifications due to changes in Bobcat xd (3.00.0) * Complete rewrite of XD according to current views about C++ * This version is now formally offered to Debian Linux * Implemented 'ignore' and other directives and extended the earlier set of command line options. * Added a man-page. See the man page and xd's usage info shown when the program is started without arguments for details about how to use xd * The default configuration file is now ~/.xdrc * Current configuration defaults are: add-root if-empty directories all start-at home xd (2.13) * Made XD selfsupporting. libicce isn't required anymore. Adapted `build': now uses the -t argument xd (2.11) * Oops, embedded links weren't recognized in 2.10. Now the algorithm is modified so as to compare the inode/device information. What comes first is taken first: it may be the directory link. Apart from that: the same operational functionality as in 2.10. The line 'directories pure' should now be 'directories unique', but it's also the default, so it can safely be omitted. xd (2.10) * Solutions reducing to the same file (e.g., via links) are prevented by default. In order to get all solutions the line 'directories all' must be included in the xd.conf file. xd (2.09) * libicce.a is now containing the NonCanon etc. classes. The formerly used library libcclib.a. This library and the ICString.h, ICError.h, ARG.h, NonCanon.h and ConfigFile.h files (normally in /usr/local/include) can be removed. The functionality of xd has not been changed. xd (2.08) * from the $HOME directory fails. * In xd.conf this may be suppressed by entering a line containing extra no * Alternatively, the extra evaluation may be forced in addition to the standard evaluation (from the $HOME directory) if the line extra always is used in xd.conf * In the distribution, the xd.conf file is now expected in $HOME/.conf/xd/xd.conf * Prior to the compilation, this path may be set by altering XD_CONF_PATH in the file configure.h xd (2.07) * First Linux version. Previous versions were for MS-DOS xd-3.22.09/command/0000755000175000017500000000000011752457274012352 5ustar frankfbbxd-3.22.09/command/concatargs.cc0000644000175000017500000000041711746473745015013 0ustar frankfbb#include "command.ih" void Command::concatArgs() { ArgConfig &arg = ArgConfig::instance(); for_each( arg.argPointers(), arg.argPointers() + arg.nArgs(), [&](char const *arg) { (d_arguments += arg) += '/'; } ); } xd-3.22.09/command/command.ih0000644000175000017500000000026411746473745014320 0ustar frankfbb#include "command.h" #include #include #include #include #include using namespace std; using namespace FBB; xd-3.22.09/command/determineaction.cc0000644000175000017500000000227411746473745016044 0ustar frankfbb#include "command.ih" bool Command::determineAction() { switch (int ch = d_arguments[0]) // Interpret the first character { case '0': // from parent 0 or cwd d_action = FROM_CWD; break; case '.': // from HOME d_action = FROM_HOME; break; case '/': // explicitly from the root d_action = FROM_ROOT; break; // breaks remove the 1st char from args // start from a parent case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': d_parent = ch - '0'; d_action = FROM_PARENT; break; // other characters: 1st letter of directory default: { bool firstIsSeparator = (ch == '_'); if (firstIsSeparator) d_arguments.erase(0, 1); // remove the 1st char d_action = FROM_CONFIG; return firstIsSeparator; } } d_arguments.erase(0, 1); // remove the 1st (location) character return false; } xd-3.22.09/command/commanddata.cc0000644000175000017500000000042211746473745015133 0ustar frankfbb#include "command.ih" char const *Command::s_action[] = { "FROM_CONFIG", "FROM_HOME", "FROM_ROOT", "FROM_CWD", "FROM_PARENT" }; // separating parts of directory names: char const Command::s_separators[] = "/_"; xd-3.22.09/command/command.cc0000644000175000017500000000221111746473745014277 0ustar frankfbb#include "command.ih" Command::Command() : d_action(FROM_HOME), d_parent(0) { concatArgs(); bool subSpecs = determineAction(); String::split(this, d_arguments, s_separators); // When are the elements of the first argument changed into initial chars // of directory elements? // 1. if there is only one command line argument // 2. if the first argument is not to be interpreted as a name by itself // 3. if there's only one argument // Can't 2 and 3 be combined to: size() == 1 ? // if (!subSpecs && size() && ArgConfig::instance().nArgs() == 1) if (!subSpecs && size() == 1) { for_each( front().begin() + 1, front().end(), [&](char ch) { this->push_back(string(1, ch)); } ); front().resize(1); } if (ArgConfig::instance().option('V')) { cerr << "Parent nr: " << d_parent << "\n" "Action: " << s_action[d_action] << "\n" "Initial characters of directories: "; copy(begin(), end(), ostream_iterator(cerr, " ")); cerr << endl; } } xd-3.22.09/command/README.determineaction0000644000175000017500000000323311746473745016410 0ustar frankfbb// The following table is not maintained, currently. See the manpage for // more up-to-date info. // // ---------------------------------------------------------- // using sub-specifications // (/ and - separate subspecs) // ---------------------------------------------------------- // intention no yes // ---------------------------------------------------------- // from CWD .abc (11) ./a/bc (12) // ./abc // // from $HOME 0abc (21) 0/a/bc (22) // 0. (all .* dirs at $HOME) // // from / /abc (31) /a/bc (32) // / //abc // (/ sitches to the root directory only) // // from cwd's parent # #abc (41) #a/bc (42) // (#: [1-9]) #/abc // // from config abc (51) -abc (51) // (- can be used as a pattern indicator at the 1st position) // ---------------------------------------------------------- // // command[0] determines the initial cell: // 0 indicates from the current directory onward // . indicates subspecifications from $HOME // / indicates from the root // # (#: [1-9]) indicates specifications from parent # // other indicates from $HOME // // any / or - beyond command[0] automatically switches to // sub-specifications (the last / on command is not counted // here, as this one was added by Command() itself. xd-3.22.09/command/command.h0000644000175000017500000000343711746473745014154 0ustar frankfbb#ifndef _INCLUDED_COMMAND_H_ #define _INCLUDED_COMMAND_H_ #include #include // determine the command as received and the kind of action according to // the received pattern. class Command: public std::vector // stores the elements of the pattern { std::string d_arguments; static char const *s_action[]; static char const s_separators[]; // separating parts of nested dir // names public: // modify commanddata.cc if Action is modified enum Action // starting point as determined { // by the first arg-character FROM_CONFIG, // default: determined by config FROM_HOME, FROM_ROOT, FROM_CWD, FROM_PARENT, // relative to CWD }; private: Action d_action; size_t d_parent; public: Command(); std::string const &accumulate() const; size_t parent() const; Action action() const; private: void concatArgs(); // inline static void catArg(char const *arg, std::string &dest); bool determineAction(); // inline static void add(char ch, std::vector &cmd); }; inline size_t Command::parent() const { return d_parent; } inline Command::Action Command::action() const { return d_action; } //void Command::catArg(char const *arg, std::string &dest) //{ // dest += arg; // dest += '/'; //} //void Command::add(char ch, std::vector &cmd) //{ // cmd.push_back(std::string(1, ch)); //} inline std::string const &Command::accumulate() const { return d_arguments; } #endif xd-3.22.09/documentation/0000755000175000017500000000000011746473745013611 5ustar frankfbbxd-3.22.09/documentation/man/0000755000175000017500000000000012043251431014335 5ustar frankfbbxd-3.22.09/documentation/man/xd.yo0000644000175000017500000005247011746473745015360 0ustar frankfbbNOUSERMACRO(xd) includefile(../../release.yo) htmlbodyopt(text)(#27408B) htmlbodyopt(bgcolor)(#FFFAF0) whenhtml(mailto(Frank B. Brokken: f.b.brokken@rug.nl)) DEFINEMACRO(lsoption)(3)(\ bf(--ARG1)=tt(ARG3) (bf(-ARG2))\ ) DEFINEMACRO(laoption)(2)(\ bf(--ARG1)=tt(ARG2)\ ) DEFINEMACRO(loption)(1)(\ bf(--ARG1)\ ) DEFINEMACRO(soption)(1)(\ bf(-ARG1)\ ) DELETEMACRO(tt) DEFINEMACRO(tt)(1)(em(ARG1)) COMMENT( man-request, section, date, distribution file, general name) manpage(xd)(1)(_CurYrs_)(xd._CurVers_.tar.gz) (xd - fast directory changes) COMMENT( man-request, larger title ) manpagename(xd)(eXtra fast Directory changer) COMMENT( all other: add after () ) manpagesynopsis() bf(xd) [OPTIONS] tt(arguments) manpagedescription() The program bf(xd) is used to perform e+bf(X)tra fast bf(D)irectory changes. Usually to change a directory the user is required to enter a command like, e.g., tt(cd /usr/local/bin), possibly with the aid of shell completion. In many cases this is a tedious task: shell completion shows all entries, including files, when we're only interested in directories and the full specification of our intented directory may eventually require many keyboard actions. bf(Xd) was designed a long time ago (in the early 90s) to reduce the effort of changing a directory. Often we're well aware to which directory we want to change, and it's easy to produce the initial directory characters of that directory. E.g., if the intent is to tt(cd) to tt(/usr/local/bin), it's rather easy to produce the letters tt(ulb). bf(Xd) capitalizes on this capability. By providing the initial directory characters of directories bf(xd) will determine the proper expansion allowing you to change directories fast. So, entering the command tt(xd ulb) will result in the expansion tt(/usr/local/bin). Often life is not that easy. Often there are multiple expansions from a given set of initial characters. E.g., when entering tt(xd ulb) bf(xd) may find several alternatives. E.g., verb( 1: /usr/lib/base-config 2: /usr/lib/bonobo 3: /usr/lib/bonobo-activation 4: /usr/local/bin ) If these are the alternatives, this is exactly what bf(xd) will show you. Then, by simply pressing the tt(3) key (em(no) tt(Enter) key required) bf(xd) will produce the required tt(/usr/local/bin). Commands to bf(xd) can be specified so as to fine-tune bf(xd)'s behavior: itemization( it() By default (as specified by the configuration file, see below) expansions may start at the user's home directory or at the system's root directory. it() Initial character bf(/): If the first character of the command is tt(/) all expansions will be performed from the system's root directory. E.g., tt(xd /t) will result in tt(/tmp) but not in tt(/home/user/tmp). it() Initial character bf(.): If the first character of the command is tt(.) all expansions will be performed from the user's home directory. E.g., tt(xd .t) will result in tt(/home/user/tmp) but not in tt(/tmp) it() Initial character bf(0): If the first character of the command is tt(0), all expansions will start at the current working directory. In fact, this is a specialization of the following, more general form: it() Initial character bf(1..9): If the first character of the command is a digit between tt(1) and tt(9) all expansions will start at that parent directory level of the current working directory (up to the system's root directory). E.g., if the current working directory is tt(/usr/share/doc) then tt(xd 2lb) will offer the alterative tt(/usr/local/bin): two steps up, then look for directories starting with tt(l) and therein directories starting with tt(b). it() Separators (space, forward slash and underscore (tt( ), / and _)): sometimes it is clear that there are many alternatives and the intention is to reduce that number. By using a separator subsequently nested directories must start with the characters between the separators. E.g., tt(xd u l bi) will not produce the alternative tt(/usr/lib/base-config) anymore, since tt(base-config) does not start with tt(bi). In this case only tt(/usr/local/bin) is produced. Separators may be mixed (tt(xd u/l bi) is identical to tt(xd u l bi)). Since the tt(/) can also be used as a root-directory specification, a conflict is implied by a command like tt(xd /u l bi). This conflict is solved by given the initial character a higher precedence than the separator. Using the underscore (_) separator in this case is another way to solve the conflict (which in practice hardly ever occurs). ) If there's only one solution, bf(Xd) will write that directory to its standard output stream. If there are multiple solutions, a list of at most 62 alternatives (10 for the numbers 0..9, 26 for the letters a..z and 26 for the letters A..Z) will be written to the standard error stream from which the user may select an alternative by simply pressing the key associated with the selection of choice. If no selection is requested any other key may be pressed (e.g., the space bar or the tt(Enter) key). If there is no solutioon bf(xd) will write the text tt(No Solutions) to the standard error stream. When tt(xd) is given at least one argument, all its output is sent to the standard error stream, but for the selected directory name which is written to the standard output stream. If no selection is made or if the selection process is aborted a single dot is written to the standard output stream. Usually tt(xd) will be called by a shell alias, providing the tt(cd) command with bf(xd)'s output (see below at the bf(SHELL SCRIPTS) section) executing tt(cd `xd $*`). The default dot produced by bf(xd) will then prevent a unintended change of directory. If bf(xd) is called without arguments then em(usage) information is written to the standard error stream. bf(Xd) may be further configured using options and a configuration file, discussed in the bf(OPTIONS) and bf(CONFIGURATION FILE) sections below. manpagesection(GENERALIZED DIRECTORY SEARCH) Starting with version 3.10.0 bf(xd) also supports generalized directory search command processing (GDS). When GDS is requested separators are no longer required, and bf(xd) will find all posible alternatives resulting from all possible sequential combinations of the initial search command. GDS is activated either by specifying the tt(-g) command line flag or by entering tt(generalized-search) in bf(xd)'s configuration file. Alternatively, when the latter is specified then the tt(--traditional) command line option will suppress GDS. Under GDS each initial substring of the command to bf(xd) will be considered as the initial characters of a directory. E.g., if the command tt(xd tmps) is entered using GDS then directories matching the following search patterns will be found; itemization( it() tt(/t*/m*/p*/s*/) it() tt(/t*/m*/ps*/) it() tt(/t*/mp*/s*/) it() tt(/t*/mps*/) it() tt(/tm*/p*/s*/) it() tt(/tm*/ps*/) it() tt(/tmp*/s*/) it() tt(/tmps*/) ) Only the first of these will be considered under the traditional processing mode. Multiple command line arguments, the slash and the underscore can still be used with GDS in which case they force a directory change in the considered patterns. E.g., with the command tt(xd tm/ps) the following patterns will be considered: itemization( it() tt(/t*/m*/p*/s*/) it() tt(/t*/m*/ps*/) it() tt(/tm*/p*/s*/) it() tt(/tm*/ps*/) ) In this set all of the previous patterns showing the tt(...mp...) combination were dropped, as a directory change is forced between the tt(m) and tt(p) characters. manpagesection(RETURN VALUE) bf(Xd) returns 0 to the operating system unless an error occurs (e.g., when a non-existing configuration file is specified), or bf(xd)'s version or usage info is shown or requested. manpageoptions() If available, single letter options are listed between parentheses following their associated long-option variants. Single letter options require arguments if their associated long options require arguments as well. itemization( it() loption(add-root) tt(condition)nl() If the search starts at the user's home directory an additional search starting at the system's root directory may be performed as well, depending on the value specified for the tt(add-root) option. Alternatives are tt(never) (no additional search is performed); tt(if-empty) (an additional search is performed if the initial search did not yield any directory); or tt(always) (an additional search is always performed). There is also a configuration file directive tt(add-root) (see below). it() loption(all) soption(a)nl() If the configuration file (see below) contains tt(ignore) directives then these directives are ignored when computing the alternatives from which the user may select a directory to change to. it() lsoption(config-file)(c)(filename)nl() The name of an bf(xd) configuration file. By default bf(xd) will look for the file tt(.xdrc) in the user's home directory. The existence of the default file is optional. it() loption(directories) tt(inclusion)nl() Directories may be also be reached via symbolic links. The inclusion type tt(all) will add these symbolic links to the list of alternatives. The inclusion type tt(unique) will prevent the symbolic links from being added to the list of alternatives. There is also a configuration file directive tt(directives) (see below). it() loption(generalized-search) soption(g)nl() When this option is specified bf(xd) will use GDS unless the directive tt(traditional) is specified in the configuration file. it() loption(help) (soption(h))nl() Basic usage information is written to the standard error stream. it() loption(history) tt([filename])nl() A history of previously made choices is kept in the file tt(filename). If tt(--history) is specified, but the filename is left empty the history file tt($HOME/.xd.his) is used. This file should only be modified by tt(xd) itself. If you can't resist editing it then use the following example showing the format of the lines in the history file. verb( 1292596154 1 /home/frank/svn/xd/ ) The first field is the time (in seconds since the epoch) the entry was written, the second field is the number of times the entry has been selected and the third field is the associated path. it() loption(history-lifetime) tt(spec)nl() The lifetime of the entries in the history file. The specification consists of a number followed by tt(D, W, M) or tt(Y), representing, resp. days, weeks, months, or years. A month is considered a period of 30 days, a year a period of 365 days. If the specification is omitted a lifetime of tt(1M) (one month) is used. Entries older than tt(history-lifetime) are disregarded as history-items and are removed from the history file. it() loption(history-maxsize) tt(nr)nl() The maximum number of entries the history file may contain. By default there is no limit. When tt(history-maxsize) is specified and more than the maximum number of history items are found in the history file then the tt(nr) most popular choices are kept. Usually the cut-off point will be somewhere within a popularity category. In that case the most recently selected alternatives within that category are kept. it() loption(history-position) tt([top|bottom])nl() When specified alternatives found in the history will be displayed either at the top of the list or at the bottom of the list. If this option is omitted then the elements in the history will be intermixed with new alternatives. The next option tt(history-separate) is only used when this option is also specified. By merely specifying tt(history-position) the history items are shown at the top of the list. it() loption(history-separate)nl() When specified, a blank line is written between the items in the history and new alternatives (not previously selected). This option is only interpreted when the previous option is also specified. it() loption(start-at) tt(origin)nl() Defines the default start location of directory searches. Origin tt(home) results in all default searches to start at the user's home directory. Origin tt(root) results in searches to begin at the disk's root (tt(/)) directory. There is also a configuration file directive tt(start-at) (see below). it() loption(traditional)nl() When this option is specified bf(xd) will not use GDS but will use its traditional mode. It overrules a tt(generalized-search) directive specified in the configuration file as well as the tt(-g) option. it() loption(verbose) (soption(V))nl() More extensive information about the actions taken by the bf(xd) program is written to the standard error stream. it() loption(version) (soption(v))nl() bf(Xd)'s version number is written to the standard error stream. ) manpagesection(CONFGURATION FILE) The default configuration file is tt(.xdrc) in the user's home directory. It may be overruled by the program's tt(--debug) flag. Empty lines are ignored. Information at and beyond tt(#)-characters is interpreted as comment and is ignored as well. All directives in bf(xd) configuration files follow the pattern verb( directive value ) but for some directives tt(value) is optional. A line may at most contain one directive, but white space (including comment at the end of the line) is OK. The same directive may be specified multiple times, in which case the em(last) directive will be used (with the exception of the em(ignore) directive, see below). All directives are interpreted em(case sensitively). Non-empty lines not beginning with a recognized directive are silently ignored. The following directives can be used in the configuration file. Default values are shown between parentheses. itemization( it() bf(add-root) tt(when) (if-empty)nl() If the search starts at the user's home directory an additional search starting at the system's root directory may be performed as well, depending on the value specified for the tt(add-root) directive. nl() If tt(when) is specified as tt(always) then an additional search is always performed.nl() If it is specified as tt(if-empty) then an additional search is performed if the initial search (starting at the user's home directory) did not yield any directory.nl() If it is specified as tt(never) no additional search is performed.nl() This directive is overruled by the tt(---add-root) command line option. it() bf(directories) tt(which) (all)nl() Directories may be also be reached via symbolic links. The specification tt(all) will add these symbolic links to the list of alternatives. The specification tt(unique) will prevent the symbolic links from being added to the list of alternatives.nl() This directive is overruled by the tt(---directories) command line option. it() bf(generalized-search) nl() When this directive is specified bf(xd) will use GDS by default. it() bf(history) tt([filename])nl() A history of previously made choices is kept in the file tt(filename). If tt(history) is specified, but the filename is left empty the history file tt($HOME/.xd.his) is used. This file should only be modified by tt(xd) itself. If you can't resist editing it then use the following example showing the format of the lines in the history file. verb( 1292596154 1 /home/frank/svn/xd/ ) The first field is the time (in seconds since the epoch) the entry was written, the second field is the number of times the entry has been selected and the third field is the associated path. it() bf(history-lifetime) tt(spec)nl() The lifetime of the entries in the history file. The specification consists of a number followed by tt(D, W, M) or tt(Y), representing, resp. days, weeks, months, or years. A month is considered a period of 30 days, a year a period of 365 days. If the specification is omitted a lifetime of tt(1M) (one month) is used. Entries older than tt(history-lifetime) are disregarded as history-items and are removed from the history file. it() bf(history-maxsize) tt(nr)nl() The maximum number of entries the history file may contain. By default there is no limit. When tt(history-maxsize) is specified and more than the maximum number of history items are found in the history file then the tt(nr) latest choices are kept. Each previously made selection counts as one. If a new alternative is selected it always becomes an element in the history list. it() bf(history-position) tt([top|bottom])nl() When specified alternatives found in the history will be displayed either at the top of the list or at the bottom of the list. If this option is omitted then the elements in the history will be intermixed with new alternatives. The next directive tt(history-separate) is only used when this directive is also specified. By merely specifying tt(history-position) the history items are shown at the top of the list. it() bf(history-separate)nl() When specified, a blank line is written between the items in the history and new alternatives (not previously selected). This directive is only interpreted when the previous directive is also specified. it() bf(ignore) tt(path) nl() The configuration file may contain multiple tt(ignore) directives which are --different from the way other directives are handled-- all interpreted. Each tt(ignore) directive is followed by a path specification as shown in a list of alternatives produced by bf(xd) or an initial substring of such a path terminating in a tt(*) character. When bf(xd) encounters a path matching any of the tt(ignore) directives (with the tt(*) interpreted as `any further directory name' specification) it will not display that path in its list of alternatives. This directive is overruled by the tt(---all) command line option. it() bf(start-at) tt(value) (home) nl() Defines the default start location of directory searches. Values are tt(home) and tt(root). When tt(home) is specified all searches start at the user's home directory. When tt(root) is specified searches start at the disk's root (tt(/)) directory. If the directory is omitted or if another value is specified then the default is used, which is tt(home). This directive is overruled by the tt(---start-at) command line option. it() bf(traditional) nl() This directive may be used to request the use of bf(xd)'s traditional mode. It overrules the tt(-g) command line option and the tt(generalized-search) directive. ) ) manpagesection(SHELL SCRIPTS) Assuming bf(xd) is installed in tt(/usr/bin) scripts can be defined around bf(xd) for various shell programs. This allows the shell to change directories under control of bf(xd). To use bf(xd) with the bf(bash)(1)-shell, the following script can be used (to be added to, e.g., tt(.profile)): verb( xd() # function to do `cd` using `xd` { cd `/usr/bin/xd $*` } ) To use bf(xd) with the bf(tcsh)(1)-shell, the following alias can be added to, e.g., the tt(~/.alias) file: verb( alias xd 'cd `\xd \!*`' ) Having defined the tt(xd) alias or script tt(xd ...) commands will result in the automatic or selected change of the current working directory manpagesection(EXAMPLES) verb( xd ulb - all directories starting subsequently, with u, l and b origin is default, or specified in .xdrc as home or root xd 0t - all directories starting with t below the cwd xd 2t - all directories starting at the `grandparent' (2 steps up) of the cwd xd --start-at root t - all directories at the root starting with t xd .. - all directories starting with a dot in the cwd ) Assuming the following directories exist: verb( /usr/lib/bonobo /usr/lib/bonobo-activation /usr/local/bin ) then the following two tt(ignore) specifications in bf(xd)'s configuration file will result in ignoring the tt(bonobo) directory alternatives: First specification: verb( ignore /usr/lib/bonobo ignore /usr/lib/bonobo-activation ) Second specification: verb( ignore /usr/lib/bonobo* ) manpagefiles() itemization( it() bf($HOME/.xdrc): Default location of the configuration file it() tt(http://xd-home.sourceforge.net/): Home directory ) manpagebugs() None reported manpagesection(ABOUT xd) The program bf(xd) was initially (before 1994) written for the MS-DOS platform. In 1994 it was designed to work under Unix (Linux, AIX) and it was converted to bf(C++). The original bf(C++) code is still available (tt(https://oosix.icce.rug.nl/svnroot/xd/tags/start/xd/)) and is funny to look at as it is a remarkable illustration of bf(C++) code written by bf(C) programmers who had just learned about bf(C++). Versions tt(2.x) have been used until 2008, and in late August 2008 I rewrote bf(xd) completely, reflecting my current views about bf(C++), resulting in versions tt(3.x.y) and beyond. The tt(3.x.y) and later versions extensively use the facilities offered by the bf(bobcat)(7) library. manpagesection(ACKNOWLEDGEMENTS) GDS was added to bf(xd) following a suggestion by Bram Neijt (bram at neijt dot nl). manpageauthor() Frank B. Brokken (f.b.brokken@rug.nl). xd-3.22.09/history/0000755000175000017500000000000011752457274012435 5ustar frankfbbxd-3.22.09/history/load.cc0000644000175000017500000000113411746473745013666 0ustar frankfbb#include "history.ih" void History::load(string const &homeDir) { if (d_arg.option(&d_name, "history") && d_name.empty()) d_name = homeDir + s_defaultHistory; ifstream in(d_name); if (!in) { imsg << "History file `" << d_name << "' not readable" << endl; return; } imsg << "History file `" << d_name << '\'' << endl; for_each( istream_iterator(in), istream_iterator(), [&](HistoryInfo const &historyInfo) { maybeInsert(historyInfo, d_history, d_oldest); } ); } xd-3.22.09/history/history.h0000644000175000017500000000646311746473745014324 0ustar frankfbb#ifndef INCLUDED_HISTORY_ #define INCLUDED_HISTORY_ #include #include #include #include namespace FBB { class ArgConfig; } class History { public: enum Position { TOP, BOTTOM }; private: struct HistoryInfo { size_t time; size_t count; std::string path; HistoryInfo() = default; HistoryInfo(size_t time, size_t count, std::string const &path); }; friend std::istream &operator>>(std::istream &in, HistoryInfo &hl); friend std::ostream &operator<<(std::ostream &in, HistoryInfo const &hl); FBB::ArgConfig &d_arg; size_t d_now; // current time size_t d_oldest; Position d_position; // TOP or BOTTOM (TOP) std::string d_name; // name of the history file // (empty: no history used) std::vector d_history; static char s_defaultHistory[]; public: History(FBB::ArgConfig &arg, std::string const &homeDir); void setLocation(size_t nInHistory); void save(std::string const &choice); bool rotate() const; Position position() const; // see if a path is in the history bool find(std::string const &path) const; private: std::vector::const_iterator findIter( std::string const &path) const; void load(std::string const &homeDir); void setData(); static void maybeInsert(HistoryInfo const &historyInfo, std::vector &history, size_t now); static bool compareTimes(HistoryInfo const &first, HistoryInfo const &second); static bool compareCounts(HistoryInfo const &first, HistoryInfo const &second); // static bool findEntry(HistoryInfo const &history, // std::string const &entry); }; inline History::HistoryInfo::HistoryInfo(size_t time, size_t count, std::string const &path) : time(time), count(count), path(path) {} inline History::Position History::position() const { return d_position; } inline std::vector::const_iterator History::findIter( std::string const &path) const { return find_if( d_history.begin(), d_history.end(), [&](HistoryInfo const &history) { return history.path == path; } ); } inline bool History::find(std::string const &path) const { return findIter(path) != d_history.end(); } inline std::ostream &operator<<(std::ostream &out, History::HistoryInfo const &hi) { return out << hi.time << ' ' << hi.count << ' ' << hi.path; } inline bool History::rotate() const { return d_name.length() && d_position == BOTTOM; } #endif xd-3.22.09/history/comparecounts.cc0000644000175000017500000000047011746473745015633 0ustar frankfbb#include "history.ih" // called from load // true: first < second, smallest elements are put first // return false to put the largest elements first bool History::compareCounts(HistoryInfo const &first, HistoryInfo const &second) { return second.count < first.count; } xd-3.22.09/history/save.cc0000644000175000017500000000222211746473745013704 0ustar frankfbb#include "history.ih" void History::save(string const &choice) { if (d_name.empty()) // no history file in use return; ofstream out(d_name); if (!out) { imsg << "cannot write history file `" << d_name << '\'' << endl; return; } auto iter = findIter(choice); if (iter == d_history.end()) d_history.push_back(HistoryInfo(d_now, 1, choice)); else { HistoryInfo *info = const_cast(&*iter); ++info->count; info->time = d_now; } sort(d_history.begin(), d_history.end(), compareTimes); // stable_sort(d_history.begin(), d_history.end(), compareCounts); string value; size_t maxSize = d_arg.option(&value, "history-maxsize") ? A2x(value) : UINT_MAX; if (maxSize != UINT_MAX) { imsg << "Max. history size: " << maxSize << endl; if (d_history.size() > maxSize) d_history.resize(maxSize); } copy(d_history.begin(), d_history.end(), ostream_iterator(out, "\n")); } xd-3.22.09/history/history1.cc0000644000175000017500000000023211746473745014527 0ustar frankfbb#include "history.ih" History::History(ArgConfig &arg, string const &homeDir) : d_arg(arg), d_now(time(0)) { setData(); load(homeDir); } xd-3.22.09/history/history.ih0000644000175000017500000000054511746473745014470 0ustar frankfbb#include "history.h" #include #include #include #include #include using namespace std; using namespace FBB; // inline bool History::findEntry(HistoryInfo const &history, // string const &path) // { // return history.path == path; // } xd-3.22.09/history/setdata.cc0000644000175000017500000000224511746473745014400 0ustar frankfbb#include "history.ih" void History::setData() { string value; d_position = d_arg.option(&value, "history-position") && value == "bottom" ? BOTTOM : TOP; imsg << "History elements at the " << (d_position == TOP ? "top" : "bottom") << endl; if (not d_arg.option(&value, "history-lifetime")) { d_oldest = d_now - 24 * 60 * 60 * 30; // 1 month lifetime imsg << "History lifetime: 1M" << endl; return; } A2x a2x(value); d_oldest = a2x; if (a2x.lastFail()) { imsg << "Cannot determine history-lifetime " << value << ", using 1M" << endl; d_oldest = d_now - 24 * 60 * 60 * 30; // 1 month lifetime } else { int lastChar = toupper(*value.rbegin()); imsg << "History lifetime: " << d_oldest << static_cast(lastChar) << endl; d_oldest = d_now - d_oldest * 24 * 60 * 60 * ( lastChar == 'W' ? 7 : lastChar == 'M' ? 30 : lastChar == 'Y' ? 365 : 1 ); } } xd-3.22.09/history/historydata.cc0000644000175000017500000000012211746473745015276 0ustar frankfbb#include "history.ih" char History::s_defaultHistory[] = ".xd.his"; // in $HOME xd-3.22.09/history/comparetimes.cc0000644000175000017500000000025511746473745015442 0ustar frankfbb#include "history.ih" bool History::compareTimes(HistoryInfo const &first, HistoryInfo const &second) { return second.time < first.time; } xd-3.22.09/history/maybeinsert.cc0000644000175000017500000000040111746473745015265 0ustar frankfbb#include "history.ih" void History::maybeInsert(HistoryInfo const &hi, vector &history, size_t oldestTime) { if (hi.path.empty()) return; if (oldestTime <= hi.time) history.push_back(hi); } xd-3.22.09/history/infoopextract.cc0000644000175000017500000000052211746473745015634 0ustar frankfbb#include "history.ih" istream &operator>>(istream &in, History::HistoryInfo &hi) { if (getline(in, hi.path)) { istringstream ins(hi.path); if (ins >> hi.time >> hi.count && getline(ins, hi.path)) hi.path = String::trim(hi.path); else hi.path.clear(); } return in; } xd-3.22.09/icmake/0000755000175000017500000000000012043250514012143 5ustar frankfbbxd-3.22.09/icmake/md0000644000175000017500000000070611746473745012517 0ustar frankfbb// md: target should be a series of blank-delimited directories to be created // If an element is a whildcard, the directory will always be created, // using mkdir -p. // // uses: run() void md(string target) { int idx; list paths; string dir; paths = strtok(target, " "); for (idx = sizeof(paths); idx--; ) { dir = element(idx, paths); if (!exists(dir)) run("mkdir -p " + dir); } } xd-3.22.09/icmake/clean0000644000175000017500000000111412043250514013145 0ustar frankfbbvoid clean(int dist) { run("rm -rf " "build-stamp configure-stamp " "options/SKEL " "tmp/*.o" + " o */o release.yo tmp/lib*.a " "parser/grammar.output" ); if (dist) run("rm -rf tmp"); chdir("documentation"); run("rm -rf " "man/*.1 " "man/*.3* " "man/*.html " "manual/manual-stamp " "manual/*.html " "manual/invoking/usage " "manual/invoking/usage.txt " "usage/usage " ); exit(0); } xd-3.22.09/icmake/run0000644000175000017500000000033012043250514012666 0ustar frankfbbint g_dryrun = setOpt("", "DRYRUN") != ""; void runP(int testValue, string cmd) { if (g_dryrun) printf(cmd, "\n"); else system(testValue, cmd); } void run(string cmd) { runP(0, cmd); } xd-3.22.09/icmake/setopt0000644000175000017500000000034112043250514013402 0ustar frankfbbstring setOpt(string install_im, string envvar) { list optvar; string ret; optvar = getenv(envvar); if (optvar[0] == "1") ret = optvar[1]; else ret = install_im; return ret; } xd-3.22.09/icmake/special0000644000175000017500000000071312043250514013507 0ustar frankfbb//string g_skel; void special() { // g_skel = setOpt(SKEL, "SKEL"); // // if ("INSTALL.im" newer "options/SKEL") // run("echo \"#define _Skel_ \\\"" + g_skel + "\\\"\" > options/SKEL"); if (! exists("release.yo") || "VERSION" newer "release.yo") { system("touch version.cc"); run("gcc -E VERSION.h | grep -v '#' | sed 's/\\\"//g' > " "release.yo"); } } xd-3.22.09/icmake/install0000644000175000017500000000227512043250514013542 0ustar frankfbbstring setWhere(string where, string defaultWhere) { if (where == "") where = defaultWhere; md(where); return where; } void install(string what, string where) { string path; if (what == "program") { if (where == "") where = BINARY; path = get_path(where); if (path != "") md(path); printf(" INSTALLING the executable `", where, "'\n"); run("icmbuild install program " + where); exit(0); } if (what == "man") { where = setWhere(where, MAN); printf(" INSTALLING the manual page at `", where, "'\n"); run("gzip -9 < tmp/man/" PROJECT ".1 > " + where + "/" PROJECT ".1.gz"); exit(0); } if (what == "std") { where = setWhere(where, STD); printf(" INSTALLING the changelog at `", where, "\n"); run("gzip -9 < changelog > " + where + "/changelog.gz"); printf(" INSTALLING xdrc at `", where, "\n"); run("cp xdrc " + where); printf(" INSTALLING the html-manual page at `", where, "\n"); run("cp tmp/manhtml/" PROJECT "man.html " + where); exit(0); } exit(0); } xd-3.22.09/icmake/manpage0000644000175000017500000000066112043250514013501 0ustar frankfbb#define MANPAGE "../../tmp/man/" ${PROJECT} ".1" void manpage() { md("tmp/man tmp/manhtml"); chdir("documentation/man"); if (PROJECT ".yo" younger MANPAGE || "release.yo" younger MANPAGE) { run("yodl2man --no-warnings -o " MANPAGE " " PROJECT); run("yodl2html --no-warnings -o ../../tmp/manhtml/" PROJECT "man.html " PROJECT); } exit(0); } xd-3.22.09/icmconf0000644000175000017500000001056012043250514012255 0ustar frankfbb#include "INSTALL.im" // Inspect the following #defines. Change them to taste. If you don't // need a particular option, change its value into an empty string // For more information about this file: 'man 7 icmconf' // The final program and source containing main(): // =============================================== // define the name of the source containing main(): #define MAIN "xd.cc" // define any additional libraries the program may need: #define ADD_LIBRARIES "bobcat" // define any additional paths (other than the standard paths) the // additional libraries are located in: #define ADD_LIBRARY_PATHS "" // Should a lexical scanner be constructed? If so, define the subdirectory // containing the scanner's specification file and see below at the // scanner section for more defines #define SCANNER_DIR "" // Should a parser be constructed? If so, define the subdirectory // containing the parser's specification file and see below at the // parser section for more defines #define PARSER_DIR "" // ================== probably no configurations required below here ========= // Uncomment to relink the binary, even when no sources were // changed (this is useful if, e.g., a library was rebuilt) #define REFRESH // Defines related to the local libraries to create: // ================================================= // Uncomment to create a local library rather (when a binary program is // built it will be linked against the library rather than the individual // object modules). Change the lib's name at you own digression (don't use // lib or an extension like .a) #define LIBRARY "modules" #define SHAREDREQ "" // #defines used for compilation and linking: // ========================================== // Uncomment to clear the screen just before starting the compilation // process //#define CLS // Uncomment to use the ALL facility and a class dependency setup in the // CLASSES file. When a directory contains a file ALL (optionally rename // this filename by providing an alternative name) then all its sources // and all sources of all classes depending on it are also compiled. // Class dependencies are indicated by the class name (as the first // word on a line) optionally followed by additional class names, which // are the classes directly depending on the line's first class name. //#define USE_ALL "a" // define the pattern to locate sources in a directory: #define SOURCES "*.cc" // Some #defines, used to create parsers and lexical scanners // ========================================================== // Lexical Scanner section // ======================= // What is the program generating the lexical scanner? #define SCANGEN "flexc++" // Flags to provide SCANGEN with: #define SCANFLAGS "" // Name of the lexical scanner specification file #define SCANSPEC "lexer" // Specify additional lexer specification files using patterns // these files are (in)directly included by SCANSPEC //#define SCANFILES "" // Name of the file generated by the lexical scanner #define SCANOUT "lex.cc" // Parser section // ============== // What is the program generating a parser? #define PARSGEN "bisonc++" // Flags to provide PARSGEN with: #define PARSFLAGS "-V" // What is the grammar specification file? #define PARSSPEC "grammar" // Specify additional grammar specification files using patterns // these files are (in)directly included by PARSSPEC. Specify patterns // relative to PARSER_DIR #define PARSFILES "inc/*" // Name of the file generated by the parser generator containing the // parser function #define PARSOUT "parse.cc" // Additional defines, which normally require no modification // ========================================================== // should commands be echoed (ON) or not (OFF) ? #define USE_ECHO ON // Directory below this directory to contain temporary results #define TMP_DIR "tmp" // The extension of object modules: #define OBJ_EXT ".o" // Use the VERSION file #define USE_VERSION xd-3.22.09/usage.cc0000644000175000017500000000667311746473745012367 0ustar frankfbb// usage.cc #include "xd.ih" void usage(std::string const &progname) { cerr << "\n" << progname << " by " << Icmbuild::author << "\n" << progname << " V" << Icmbuild::version << " " << Icmbuild::year << "\n" "\n" "Usage: " << progname << " [options] args\n" "Where:\n" " [options] - optional arguments (short options and default values " "between\n" " parentheses):\n" " --all (-a) - skip `ignore' specification in the\n" " configuration file\n" " --config-file (-c) - path to the config file to use\n" " ($HOME/.xdrc)\n" " --add-root - search expansions from /\n" " (if-empty)\n" " --directories - which directories to show?\n" " (all)\n" " --generalized-search (-g) - use the GDS mode\n" " --help (-h) - provide this help\n" " --history - use to store info about choices\n" " (no history unless specified)\n" " --history-lifetime - specify the max. lifetime of previously " "made\n" " choices. Use [DWMY] for a lifetime\n" " of Days, Months, Weeks, or Years\n" " --history-position - where to put the previously made " "choices\n" " (TOP, BOTTOM)\n" " --history-maxsize - display at most " "previously\n" " made choices\n" " --history-separate - separate previously made choices from new\n" " ones by a blank line\n" " --start-at - where to start the search? (home)\n" " --traditional - use the traditional mode\n" " --version (-v) - show version information and terminate\n" " --verbose (-V) - show " << progname << "'s actions in " "detail\n" " args - arguments, possibly containing directory separators [/-].\n" "\n" << progname << " eXchanges Directories by interpreting the characters of its\n" "argument(s) as the initial characters of nested subdirectories.\n" "Multiple arguments or arguments separated by / or - define the\n" "initial characters of subsequently nested subdirectories.\n" "\n" "If the first argument starts with . expansion starts at the current\n" "directory; if it's 0 expansion starts in the user's home directory;\n" "if it's / expansion starts at the root; if it's a number (1 .. 9) \n" "expansion starts at parent ; otherwise expansion starts\n" "at the location defined by the configuration file\n" "\n" "When the specification results in multiple solutions, a final\n" "selection is requested from a displayed list of alternatives.\n" "\n" "Use 'man xd' or read the xdrc file provided with the distribution\n" "for details about " << progname << "'s configuration file\n" "\n"; } xd-3.22.09/version.cc0000644000175000017500000000033612240363574012722 0ustar frankfbb// version.cc #include "xd.ih" #include "VERSION" namespace Icmbuild { char version[] = VERSION; char year[] = YEARS; char author[] = "Frank B. Brokken (f.b.brokken@rug.nl)"; } xd-3.22.09/xd.cc0000644000175000017500000000165712136471704011656 0ustar frankfbb/* xd.cc A C++ main()-frame generated by cpp.im for xd.cc */ #include "xd.ih" // program header file int main(int argc, char **argv) try { arguments(argc, argv); Alternatives alternatives; alternatives.viable(); // select viable alternatives alternatives.order(); // history alternatives first or last Arbiter arbiter(alternatives); arbiter.select(); // make the selection return arbiter.decided() ? 0 : 1; // return 0 to the OS if the arbiter // did do its work } catch(exception const &err) // handle exceptions { cerr << err.what() << endl; cout << ".\n"; // to prevent a directory change return 1; } catch(int x) { if (x == 0) cerr << "No Solutions\n"; cout << ".\n"; return ArgConfig::instance().option("hv") ? 0 : x; } xd-3.22.09/xd.ih0000644000175000017500000000065512100226155011653 0ustar frankfbb#include #include #include #include #include #include #include "alternatives/alternatives.h" #include "arbiter/arbiter.h" namespace Icmbuild { extern char version[]; extern char year[]; extern char author[]; }; void arguments(int argc, char **argv); void usage(std::string const &progname); using namespace std; using namespace FBB; xd-3.22.09/xd.lsm0000644000175000017500000000240411746473745012070 0ustar frankfbbBegin2 Title = XD -- eXchange Directories Version = 2.11 Desc1 = XD is a program with which directory-changes can be Desc2 = easily realized, by providing XD with the initial Desc3 = characters of the diectory path you want to change to. Desc4 = Ambiguities are resolved interactively or explicitly Desc5 = in the directory-specification itself Author = Frank B. Brokken AuthorEmail = frank@icce.rug.nl Maintainer = Frank B. Brokken Site1 = ftp.icce.rug.nl Path1 = pub/unix File1 = xd.2.11.tar.gz FileSize1 = approx. 20 kB Site2 = sunsite.unc.edu Path2 = ?????????? File2 = xd.2.11.tar.gz FileSize2 = approx. 20 kB Site3 = tsx-11.mit.edu Path3 = ?????????? File3 = xd.2.11.tar.gz FileSize2 = approx. 20 kB Required1 = The provided build script is based on icmake, which can be Required2 = obtained from beatrix.icce.rug.nl, sunsite.unc.edu or Required3 = tsx-11.mit.edu. The (sources for the) required library libicce.a Required4 = and its header files are available on ftp.icce.rug.nl, /pub/unix CopyPolicy1 = GPL Keywords = Directory changing Entered = 03MAR95 EnteredBy = Frank B. Brokken CheckedEmail = frank@icce.rug.nl End xd-3.22.09/xd.xref0000644000175000017500000001754112043250514012223 0ustar frankfbboxref by Frank B. Brokken (f.b.brokken@rug.nl) oxref V0.90.10 2012 CREATED Wed, 18 Jul 2012 13:29:30 +0000 CROSS REFERENCE FOR: -fxs tmp/libmodules.a ---------------------------------------------------------------------- add(char const*) Full name: Alternatives::add(char const*) Source: add.cc Used By: globfilter.cc: Alternatives::globFilter(char const*, Alternatives::GlobContext&) addIgnored(std::string const&, std::set, std::allocator >&) Full name: Alternatives::addIgnored(std::string const&, std::set, std::allocator >&) Source: addignored.cc Used By: globfrom.cc: Alternatives::globFrom(std::string) author Full name: Icmbuild::author Source: version.cc Used By: usage.cc: usage(std::string const&) Command() Full name: Command::Command() Source: command.cc Used By: alternatives.cc: Alternatives::Alternatives() compareTimes(History::HistoryInfo const&, History::HistoryInfo const&) Full name: History::compareTimes(History::HistoryInfo const&, History::HistoryInfo const&) Source: comparetimes.cc Used By: save.cc: History::save(std::string const&) concatArgs() Full name: Command::concatArgs() Source: concatargs.cc Used By: command.cc: Command::Command() configFile() Full name: Alternatives::configFile() Source: configfile.cc Used By: alternatives.cc: Alternatives::Alternatives() determineAction() Full name: Command::determineAction() Source: determineaction.cc Used By: command.cc: Command::Command() determineInitialDirectory() Full name: Alternatives::determineInitialDirectory() Source: determineinitialdir.cc Used By: viable.cc: Alternatives::viable() generalizedGlob(std::string, Alternatives::GlobContext&) Full name: Alternatives::generalizedGlob(std::string, Alternatives::GlobContext&) Source: generalizedglob.cc Used By: globfrom.cc: Alternatives::globFrom(std::string) getCwd(std::unique_ptr >*) Full name: Alternatives::getCwd(std::unique_ptr >*) Source: getcwd.cc Used By: determineinitialdir.cc: Alternatives::determineInitialDirectory() getHome() Full name: Alternatives::getHome() Source: gethome.cc Used By: alternatives.cc: Alternatives::Alternatives() glob(std::string, Alternatives::GlobContext&) Full name: Alternatives::glob(std::string, Alternatives::GlobContext&) Source: glob.cc Used By: globfrom.cc: Alternatives::globFrom(std::string) globFilter(char const*, Alternatives::GlobContext&) Full name: Alternatives::globFilter(char const*, Alternatives::GlobContext&) Source: globfilter.cc Used By: glob.cc: Alternatives::glob(std::string, Alternatives::GlobContext&) globpattern.cc: Alternatives::globPattern(std::string, std::string const&, unsigned int, Alternatives::GlobContext&) globFrom(std::string) Full name: Alternatives::globFrom(std::string) Source: globfrom.cc Used By: viable.cc: Alternatives::viable() globHead(std::string const&, std::string, Alternatives::GlobContext&) Full name: Alternatives::globHead(std::string const&, std::string, Alternatives::GlobContext&) Source: globhead.cc Used By: generalizedglob.cc: Alternatives::generalizedGlob(std::string, Alternatives::GlobContext&) globpattern.cc: Alternatives::globPattern(std::string, std::string const&, unsigned int, Alternatives::GlobContext&) globPattern(std::string, std::string const&, unsigned int, Alternatives::GlobContext&) Full name: Alternatives::globPattern(std::string, std::string const&, unsigned int, Alternatives::GlobContext&) Source: globpattern.cc Used By: globhead.cc: Alternatives::globHead(std::string const&, std::string, Alternatives::GlobContext&) History(FBB::ArgConfig&, std::string const&) Full name: History::History(FBB::ArgConfig&, std::string const&) Source: history1.cc Used By: alternatives.cc: Alternatives::Alternatives() load(std::string const&) Full name: History::load(std::string const&) Source: load.cc Used By: history1.cc: History::History(FBB::ArgConfig&, std::string const&) matchIgnore(std::string const&, char const*) Full name: Alternatives::matchIgnore(std::string const&, char const*) Source: matchignore.cc Used By: globfilter.cc: Alternatives::globFilter(char const*, Alternatives::GlobContext&) maybeInsert(History::HistoryInfo const&, std::vector >&, unsigned int) Full name: History::maybeInsert(History::HistoryInfo const&, std::vector >&, unsigned int) Source: maybeinsert.cc Used By: load.cc: History::load(std::string const&) operator>>(std::istream&, History::HistoryInfo&) Full name: operator>>(std::istream&, History::HistoryInfo&) Source: infoopextract.cc Used By: load.cc: History::load(std::string const&) s_action Full name: Command::s_action Source: commanddata.cc Used By: command.cc: Command::Command() s_defaultConfig Full name: Alternatives::s_defaultConfig Source: alternativesdata.cc Used By: configfile.cc: Alternatives::configFile() s_defaultHistory Full name: History::s_defaultHistory Source: historydata.cc Used By: load.cc: History::load(std::string const&) s_dirs Full name: Alternatives::s_dirs Source: alternativesdata.cc Used By: viable.cc: Alternatives::viable() s_dirsEnd Full name: Alternatives::s_dirsEnd Source: alternativesdata.cc Used By: viable.cc: Alternatives::viable() s_separators Full name: Command::s_separators Source: commanddata.cc Used By: command.cc: Command::Command() s_startAt Full name: Alternatives::s_startAt Source: alternativesdata.cc Used By: viable.cc: Alternatives::viable() s_startAtEnd Full name: Alternatives::s_startAtEnd Source: alternativesdata.cc Used By: viable.cc: Alternatives::viable() s_triState Full name: Alternatives::s_triState Source: alternativesdata.cc Used By: viable.cc: Alternatives::viable() s_triStateEnd Full name: Alternatives::s_triStateEnd Source: alternativesdata.cc Used By: viable.cc: Alternatives::viable() save(std::string const&) Full name: History::save(std::string const&) Source: save.cc Used By: decided.cc: Arbiter::decided() const separateAt() const Full name: Alternatives::separateAt() const Source: separateat.cc Used By: showalternatives.cc: Arbiter::showAlternatives() const set(char const*, char const* const*, char const* const*, unsigned int) Full name: Alternatives::set(char const*, char const* const*, char const* const*, unsigned int) Source: set2.cc Used By: viable.cc: Alternatives::viable() setData() Full name: History::setData() Source: setdata.cc Used By: history1.cc: History::History(FBB::ArgConfig&, std::string const&) setIndex() Full name: Arbiter::setIndex() Source: setindex.cc Used By: select.cc: Arbiter::select() show(unsigned int, char, char, unsigned int) const Full name: Arbiter::show(unsigned int, char, char, unsigned int) const Source: show.cc Used By: showalternatives.cc: Arbiter::showAlternatives() const showAlternatives() const Full name: Arbiter::showAlternatives() const Source: showalternatives.cc Used By: select.cc: Arbiter::select() usage(std::string const&) Full name: usage(std::string const&) Source: usage.cc Used By: arguments.cc: arguments(int, char**) version Full name: Icmbuild::version Source: version.cc Used By: arguments.cc: arguments(int, char**) usage.cc: usage(std::string const&) year Full name: Icmbuild::year Source: version.cc Used By: usage.cc: usage(std::string const&) xd-3.22.09/xdrc0000644000175000017500000000564611746473745011636 0ustar frankfbb# XD configuration file example # Default location used by xd: $HOME/.xdrc # If you don't have a file $HOME/.xdrc and did not specify a configuration # file using the --config-file command line option then program defined # defaults (shown here as well) will be used. # All directives and values are interpreted case sensitively # When directives are provided repeatedly the last directive will be used # (except for ignore, which are all interpreted) # The program defined default is shown where applicable as a commented out # example # The add-root directive determines when to perform an additional search #starting from the root (/) directory: # always - an additional search is always performed. # if-empty - an additional search is performed if the initial search # did not yield any directory. # never - no additional search is performed. #add-root if-empty # The directories directive defines which directives are shown: # all - show all alternatives, including symbolic links (symlinks) # unique - do not show symlinks to directories #directories all # The ignore directives (multiple ignore directives are all interpreted) # defines directories that should not appear in alternative # lists. Specifications may end in a final *, indicating that all # directories matching the provided pattern will be ignored. # There is no default. Some exampes: # ignore /usr/lib/bonobo/ # ignore /usr/lib/bonobo-activation/ # or, using a wildcard: # ignore /usr/lib/bonobo* # The start-at directive defines the origin of the search: # home - start the search from the user's home dir. # root - start the search from the root (/) directory. #start-at home # Specify the name of the history file if a history of previously made # choices most be kept. If only the 'history' directive is specified the # history file will be $HOME/.xd.his # Remaining history- directives only have an effect if the 'history' # directive is also specified #history # Specify the maximum lifetime of history items. Use D(ays), W(eeks), # M(onths) or Y(ears), prefixed by a number. By default 1M is used #history-lifetime 1M # Specify the maximum size of the history. By default no limit. # The value shown serves as an example. #history-maxsize 10 # Specify the postion of the history items. When merely the directive is # specified the history items are shown at the top of the # list. Alternatively, use 'history-position bottom' #history-position top # When history-position is specified then 'history-separate' can be used to # insert a blank line between history items and new alternatives. history-separate # Multiple ignore specifications may be specified. Directories matching the # specification will not show up in the list of alternatives. Specifications # should end in a * #ignore /usr/lib/bonobo*