xd-3.23.04/CLASSES 0000644 0001750 0001750 00000000045 12605017655 012310 0 ustar frank frank command
alternatives
arbiter
history
xd-3.23.04/INSTALL 0000644 0001750 0001750 00000010074 12605017655 012324 0 ustar frank frank To install xd by hand instead of using a binary distribution perform
the following steps:
0. xd and its construction depends, in addition to the normally
standard available system software on specific software and versions
which is documented in the file `required'.
(If you compile the bobcat library yourself, note that xd does
not use the SSL, Milter and Xpointer classes; they may --as far as
xd is concerned-- be left out of the library by running
'./build light')
1. It is expected you use icmake for the package construction. For this a
top-level script (build) and support scripts in the ./icmake/
directory are available. By default, the 'build' script echoes the
commands it executes to the standard output stream. By specifying the
option -q (e.g., ./build -q ...) this is prevented, significantly
reducing the output generated by 'build'.
2. Inspect the values of the variables in the file INSTALL.im. Modify
these when necessary. The default skeleton filenames are compiled into
xd through the definitions in options/data.cc.
3. Run
./build program [strip]
to compile xd. The argument `strip' is optional and strips
symbolic information from the final executable.
4. If you installed Yodl then you can create the documentation:
./build man
builds the man-pages, and
./build manual
builds the manual.
5. Before installing the components of xd, consider defining the
environment variable XD, defining its value as the (preferably
absolute) filename of a file on which installed files and directories
are logged.
Defining the XD environment variable as ~/.xd usually
works well.
6. Run (probably as root)
./build install 'what' 'base'
to install. Here, 'what' specifies what you want to install.
Specify:
x, to install all components,
or specify a combination of:
a (additional documentation),
b (binary program),
d (standard documentation),
m (man-pages)
s (skeleton files)
u (user guide)
E.g., use
./build install bs 'base'
if you only want to be able to run bisonc++, and want it to be
installed below 'base'.
./build install's last argument 'base' is optional: the base directory
below which the requested files are installed. This base directory is
prepended to the paths #defined in the INSTALL.im file. If 'base' is
not specified, then INSTALL.im's #defined paths are used as-is.
When requesting non-existing elements (e.g., ./build install x was
requested, but the man-pages weren't constructed) then these
non-existing elements are silently ignored by the installation
process.
If the environment variable BISONCPP was defined when issuing the
`./build install ...' command then a log of all installed files is
written to the file indicated by the BISONCPP environment variable
(see also the next item).
Defining the BISONCPP environment variable as ~/.bisoncpp usually
works well.
7. Uninstalling previously installed components of Bisonc++ is easy if the
environment variable BISONCPP was defined before issuing the
`./build install ...' command. In that case, run the command
./build uninstall logfile
where 'logfile' is the file that was written by ./build install.
Modified files and non-empty directories are not removed, but the
logfile itself is removed following the uninstallation.
8. Following the installation nothing in the directory tree which contains
this file (i.e., INSTALL) is required for the proper functioning of
bisonc++, so consider removing it. If you only want to remove
left-over files from the build-process, just run
./build distclean
xd-3.23.04/INSTALL.im 0000644 0001750 0001750 00000000765 12635475177 012750 0 ustar frank frank #define PROJECT "xd"
#define CXX "g++"
#define CXXFLAGS "--std=c++14 -fdiagnostics-color=never -Wall -O2 -g"
#define LDFLAGS ""
#define CPOPTS
// ONLY USE ABSOLUTE DIRECTORY NAMES:
// the final program
#define BINARY "/usr/bin/"${PROJECT}
// the directory where the standard documentation is stored
#define DOC "/usr/share/doc/"${PROJECT}
// the directory where the manual page is stored
#define MAN "/usr/share/man/man1"
xd-3.23.04/LICENSE 0000644 0001750 0001750 00000104513 12635477355 012314 0 ustar frank frank 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.23.04/README 0000644 0001750 0001750 00000006173 12605017655 012160 0 ustar frank frank
===============================
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.23.04/TODO 0000644 0001750 0001750 00000000010 12605017655 011750 0 ustar frank frank nothing
xd-3.23.04/VERSION 0000644 0001750 0001750 00000000066 12635474174 012351 0 ustar frank frank #define VERSION "3.23.04"
#define YEARS "1994-2015"
xd-3.23.04/VERSION.h 0000644 0001750 0001750 00000000104 12605017655 012562 0 ustar frank frank #include "VERSION"
SUBST(_CurVers_)(VERSION)
SUBST(_CurYrs_)(YEARS)
xd-3.23.04/alternatives/ 0000755 0001750 0001750 00000000000 12605017655 013772 5 ustar frank frank xd-3.23.04/alternatives/alternatives.ih 0000644 0001750 0001750 00000000401 12605017655 017010 0 ustar frank frank #include "alternatives.h"
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
using namespace FBB;
xd-3.23.04/alternatives/gethome.cc 0000644 0001750 0001750 00000000675 12605017655 015741 0 ustar frank frank #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.23.04/alternatives/globfilter.cc 0000644 0001750 0001750 00000002723 12605017655 016436 0 ustar frank frank #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.23.04/alternatives/order.cc 0000644 0001750 0001750 00000000240 12605017655 015410 0 ustar frank frank #include "alternatives.ih"
void Alternatives::order()
{
if (not d_history.rotate())
return;
rotate(begin(), begin() + d_nInHistory, end());
}
xd-3.23.04/alternatives/glob.cc 0000644 0001750 0001750 00000001157 12605017655 015230 0 ustar frank frank #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.23.04/alternatives/alternativesdata.cc 0000644 0001750 0001750 00000001531 12605017655 017634 0 ustar frank frank #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.23.04/alternatives/matchignore.cc 0000644 0001750 0001750 00000000552 12605017655 016603 0 ustar frank frank #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.23.04/alternatives/addignored.cc 0000644 0001750 0001750 00000000672 12605017655 016406 0 ustar frank frank #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.23.04/alternatives/getcwd.cc 0000644 0001750 0001750 00000000344 12605017655 015557 0 ustar frank frank #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.23.04/alternatives/alternatives.h 0000644 0001750 0001750 00000006407 12605017655 016653 0 ustar frank frank #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 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 checkCase(std::string &head, size_t *idx) const;
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 &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.23.04/alternatives/checkcase.cc 0000644 0001750 0001750 00000000674 12605017655 016221 0 ustar frank frank #include "alternatives.ih"
void Alternatives::checkCase(string &head, size_t *idx) const
{
if ((d_arg.option('i') & 1) != 0) // even number of --icase specs
{
string mold("[..]");
int ch = head[*idx];
if (isalpha(ch))
{
mold[1] = tolower(ch);
mold[2] = toupper(ch);
head.replace(*idx, 1, mold);
*idx += 4;
return;
}
}
++*idx;
}
xd-3.23.04/alternatives/configfile.cc 0000644 0001750 0001750 00000001105 12605017655 016403 0 ustar frank frank #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.23.04/alternatives/add.cc 0000644 0001750 0001750 00000000317 12605017655 015032 0 ustar frank frank #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.23.04/alternatives/alternatives.cc 0000644 0001750 0001750 00000000333 12605017655 017001 0 ustar frank frank #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.23.04/alternatives/set2.cc 0000644 0001750 0001750 00000001524 12605017655 015160 0 ustar frank frank #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.23.04/alternatives/globfrom.cc 0000644 0001750 0001750 00000001314 12605017655 016107 0 ustar frank frank #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.23.04/alternatives/generalizedglob.cc 0000644 0001750 0001750 00000000626 12605017655 017442 0 ustar frank frank #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.23.04/alternatives/globhead.cc 0000644 0001750 0001750 00000000447 12605017655 016053 0 ustar frank frank #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.23.04/alternatives/globpattern.cc 0000644 0001750 0001750 00000003175 12605017655 016630 0 ustar frank frank #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 &searchCmd, size_t *idx,
GlobContext &context)
try
{
checkCase(searchCmd, idx);
// 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.23.04/alternatives/determineinitialdir.cc 0000644 0001750 0001750 00000002441 12605017655 020327 0 ustar frank frank #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.23.04/alternatives/separateat.cc 0000644 0001750 0001750 00000000424 12605017655 016432 0 ustar frank frank #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.23.04/alternatives/viable.cc 0000644 0001750 0001750 00000001272 12605017655 015545 0 ustar frank frank #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.23.04/arbiter/ 0000755 0001750 0001750 00000000000 12605017655 012721 5 ustar frank frank xd-3.23.04/arbiter/arbiter.cc 0000644 0001750 0001750 00000000217 12605017655 014660 0 ustar frank frank #include "arbiter.ih"
Arbiter::Arbiter(Alternatives &alternatives)
:
d_index(alternatives.size()),
d_alternatives(alternatives)
{}
xd-3.23.04/arbiter/show.cc 0000644 0001750 0001750 00000000724 12605017655 014213 0 ustar frank frank #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.23.04/arbiter/decided.cc 0000644 0001750 0001750 00000000213 12605017655 014605 0 ustar frank frank #include "arbiter.ih"
bool Arbiter::decided() const
{
d_alternatives.update(d_index);
return d_index != d_alternatives.size();
}
xd-3.23.04/arbiter/showalternatives.cc 0000644 0001750 0001750 00000000520 12605017655 016627 0 ustar frank frank #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.23.04/arbiter/arbiter.h 0000644 0001750 0001750 00000001006 12605017655 014517 0 ustar frank frank #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.23.04/arbiter/select.cc 0000644 0001750 0001750 00000000566 12605017655 014516 0 ustar frank frank #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.23.04/arbiter/arbiter.ih 0000644 0001750 0001750 00000000234 12605017655 014672 0 ustar frank frank #include "arbiter.h"
#include
#include
#include
#include
using namespace std;
using namespace FBB;
xd-3.23.04/arbiter/setindex.cc 0000644 0001750 0001750 00000000752 12605017655 015057 0 ustar frank frank #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.23.04/arguments.cc 0000644 0001750 0001750 00000003615 12605017655 013612 0 ustar frank frank #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'},
{"icase", 'i'},
{"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:gihvV",
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.23.04/build 0000755 0001750 0001750 00000007176 12605017655 012331 0 ustar frank frank #!/usr/bin/icmake -qt/tmp/xdbuild
#define LOGENV "XD"
string
g_logPath = getenv(LOGENV)[1],
g_cwd = chdir(""); // initial working directory, ends in /
int g_echo = ON;
#include "icmconf"
#include "icmake/cuteoln"
#include "icmake/backtick"
#include "icmake/setopt"
#include "icmake/run"
#include "icmake/md"
#include "icmake/findall"
#include "icmake/loginstall"
#include "icmake/logzip"
#include "icmake/logfile"
#include "icmake/uninstall"
#include "icmake/pathfile"
#include "icmake/precompileheaders"
#include "icmake/special"
#include "icmake/clean"
#include "icmake/manpage"
#include "icmake/install"
#include "icmake/github"
void main(int argc, list argv)
{
string option;
string strip;
int idx;
for (idx = sizeof(argv); idx--; )
{
if (argv[idx] == "-q")
{
g_echo = OFF;
argv -= (list)"-q";
}
else if (argv[idx] == "-P")
{
g_gch = 0;
argv -= (list)"-P";
}
}
echo(g_echo);
option = argv[1];
if (option == "clean")
clean(0);
if (option == "distclean")
clean(1);
if (option == "install")
install(argv[2], argv[3]);
if (option == "uninstall")
uninstall(argv[2]);
if (option != "")
special();
if (option == "github")
github();
if (option == "man")
manpage();
if (option == "library")
{
system("icmbuild library");
exit(0);
}
if (argv[2] == "strip")
strip = "strip";
if (option == "program")
{
precompileHeaders();
system("icmbuild program " + strip);
exit(0);
}
if (option == "oxref")
{
precompileHeaders();
system("icmbuild program " + strip);
run("oxref -fxs tmp/lib" LIBRARY ".a > " PROJECT ".xref");
exit(0);
}
printf("Usage: build [-q -P] what\n"
"Where\n"
" [-q]: run quietly, do not show executed commands\n"
" [-P]: do not use precompiled headers\n"
"`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 selection [base] - to install the software in the \n"
" locations defined in the INSTALL.im file,\n"
" optionally below base\n"
" selection can be\n"
" x, to install all components,\n"
" or a combination of:\n"
" b (binary program),\n"
" d (documentation),\n"
" m (man-pages)\n"
" uninstall logfile - remove files and empty directories listed\n"
" in the file 'logfile'\n"
" github - prepare github's gh-pages update\n"
" (internal use only)\n"
"\n"
"If the environment variable DRYRUN is defined, no commands are\n"
"actually executed\n"
"\n"
);
exit(1);
}
xd-3.23.04/build-depends 0000644 0001750 0001750 00000000165 12605017655 013735 0 ustar frank frank Build-Depends:
libbobcat-dev (>= 3.11.01),
icmake (>= 7.19.00),
g++ (>= 4.7.1),
yodl (>= 3.00.0)
xd-3.23.04/changelog 0000644 0001750 0001750 00000017365 12635474317 013164 0 ustar frank frank xd (3.23.04)
* Adapted the build scripts to icmake 8.00.04
* README.g++-5 now superfluous and removed.
-- Frank B. Brokken Sun, 20 Dec 2015 10:45:43 +0100
xd (3.23.03)
* Kevin Brodsky observed that the installation scripts used 'chdir' rather
than 'cd'. Fixed in this release.
* Kevin Brodsky also observed that the combined size of all precompiled
headers might exceed some disks capacities. The option -P was added to the
./build script to prevent the use of precompiled headers.
-- Frank B. Brokken Mon, 05 Oct 2015 21:28:25 +0200
xd (3.23.02)
* Modified the (un)installation procedures
-- Frank B. Brokken Fri, 02 Oct 2015 13:48:25 +0200
xd (3.23.01)
* Repaired a small flaw in the man-page
* Added the missing 'generalized-search' (cq. 'traditional') demo-entry to
the sample xdrc file
* Added the file 'required' summarizing the software which was used for
building xd.
-- Frank B. Brokken Mon, 19 Jan 2015 20:07:19 +0100
xd (3.23.00)
* Added --icase (-i) allowing case insensitive directory matching
* Changed compilation option --std=c++0x to --std=c++14
-- Frank B. Brokken Thu, 11 Dec 2014 13:14:01 +0100
xd (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.23.04/command/ 0000755 0001750 0001750 00000000000 12605017655 012707 5 ustar frank frank xd-3.23.04/command/README.determineaction 0000644 0001750 0001750 00000003233 12605017655 016741 0 ustar frank frank // 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.23.04/command/determineaction.cc 0000644 0001750 0001750 00000002274 12605017655 016375 0 ustar frank frank #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.23.04/command/command.cc 0000644 0001750 0001750 00000002211 12605017655 014630 0 ustar frank frank #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.23.04/command/concatargs.cc 0000644 0001750 0001750 00000000417 12605017655 015344 0 ustar frank frank #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.23.04/command/command.ih 0000644 0001750 0001750 00000000264 12605017655 014651 0 ustar frank frank #include "command.h"
#include
#include
#include
#include
#include
using namespace std;
using namespace FBB;
xd-3.23.04/command/command.h 0000644 0001750 0001750 00000003437 12605017655 014505 0 ustar frank frank #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.23.04/command/commanddata.cc 0000644 0001750 0001750 00000000422 12605017655 015464 0 ustar frank frank #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.23.04/documentation/ 0000755 0001750 0001750 00000000000 12605017655 014142 5 ustar frank frank xd-3.23.04/documentation/man/ 0000755 0001750 0001750 00000000000 12635474037 014721 5 ustar frank frank xd-3.23.04/documentation/man/xd.yo 0000644 0001750 0001750 00000055456 12635474037 015724 0 ustar frank frank NOUSERMACRO(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 possible 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(icase) soption(i)nl()
This option is used to specify case-insensitive pattern matching. E.g.,
specifying tt(xd /ub) returns the directory tt(/usr/bin), but not a directory
like tt(/UnSpecified/Books), which is returned by tt(xd /UB). However, tt(xd
-i /ub) (using any letter casing for the specification) returns both
directories. The option tt(icase) could of course be specified in the
configuration file, which which case case-insensitive matching is used by
default. In the latter case specifying tt(-i) as a command line option reverts
the matching procedure to case-sensitive directory matching. In general, when
an even number of em(icase) specifications is provided bf(xd) uses
case-sensitive directory matching, while an odd number of em(icase)
specifications results in case-insensitive directory matching.
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(--config-file) option.
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() loption(icase) soption(i)nl()
This specification is used to request case-insensitive pattern
matching. If this option is entered in the configuration file then specifying
tt(xd /ub) returns the directory tt(/usr/bin) as welll as a directory like
(assuming it exists) tt(/UnSpecified/Books). When specified in the
configuration file, the command-line option tt(-i) reverts the matching
procedure back to case-sensitive directory matching. In general, when an even
number of em(icase) specifications is provided bf(xd) uses case-sensitive
directory matching, while an odd number of em(icase) specifications results in
case-insensitive directory matching.
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 function
can be used (which could be added to, e.g., tt(.bash_login)):
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(https://fbb-git.github.io/xd/): 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.23.04/history/ 0000755 0001750 0001750 00000000000 12605017655 012772 5 ustar frank frank xd-3.23.04/history/history.ih 0000644 0001750 0001750 00000000545 12605017655 015021 0 ustar frank frank #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.23.04/history/maybeinsert.cc 0000644 0001750 0001750 00000000401 12605017655 015616 0 ustar frank frank #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.23.04/history/historydata.cc 0000644 0001750 0001750 00000000122 12605017655 015627 0 ustar frank frank #include "history.ih"
char History::s_defaultHistory[] = ".xd.his"; // in $HOME
xd-3.23.04/history/comparetimes.cc 0000644 0001750 0001750 00000000255 12605017655 015773 0 ustar frank frank #include "history.ih"
bool History::compareTimes(HistoryInfo const &first,
HistoryInfo const &second)
{
return second.time < first.time;
}
xd-3.23.04/history/setdata.cc 0000644 0001750 0001750 00000002245 12605017655 014731 0 ustar frank frank #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.23.04/history/infoopextract.cc 0000644 0001750 0001750 00000000522 12605017655 016165 0 ustar frank frank #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.23.04/history/history1.cc 0000644 0001750 0001750 00000000232 12605017655 015060 0 ustar frank frank #include "history.ih"
History::History(ArgConfig &arg, string const &homeDir)
:
d_arg(arg),
d_now(time(0))
{
setData();
load(homeDir);
}
xd-3.23.04/history/save.cc 0000644 0001750 0001750 00000002222 12605017655 014235 0 ustar frank frank #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.23.04/history/history.h 0000644 0001750 0001750 00000006463 12605017655 014655 0 ustar frank frank #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.23.04/history/comparecounts.cc 0000644 0001750 0001750 00000000470 12605017655 016164 0 ustar frank frank #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.23.04/history/load.cc 0000644 0001750 0001750 00000001134 12605017655 014217 0 ustar frank frank #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.23.04/icmake/ 0000755 0001750 0001750 00000000000 12635474111 012517 5 ustar frank frank xd-3.23.04/icmake/setopt 0000644 0001750 0001750 00000000341 12605017655 013761 0 ustar frank frank string 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.23.04/icmake/loginstall 0000644 0001750 0001750 00000001565 12635474111 014621 0 ustar frank frank // source and dest, absolute or reachable from g_cwd, should exist.
// files and links in source matching dest (if empty: all) are copied to dest
// and are logged in g_log
// Before they are logged, dest is created
void logInstall(string src, string pattern, string dest)
{
list entries;
int idx;
chdir(g_cwd);
md(dest);
src += "/";
dest += "/";
if (listlen(makelist(O_DIR, src)) == 0)
{
printf("Warning: ", src, " not found: can't install ", src, pattern,
" at ", dest, "\n");
return;
}
entries = findAll("f", src, pattern);
for (idx = listlen(entries); idx--; )
run("cp " + src + entries[idx] + " " + dest);
chdir(g_cwd);
entries = findAll("l", src, pattern);
for (idx = listlen(entries); idx--; )
run("cp " CPOPTS " " + src + entries[idx] + " " + dest);
}
xd-3.23.04/icmake/logzip 0000644 0001750 0001750 00000001656 12635474111 013756 0 ustar frank frank // names may be a series of files in src, not a wildcard.
// if it's empty then all files in src are used.
// the files are gzipped and logged in dest.
// src and dest do not have to end in /
void logZip(string src, string names, string dest)
{
list files;
int idx;
string file;
chdir(g_cwd);
md(dest);
dest += "/";
if (src != "")
{
if (listlen(makelist(O_DIR, src)) == 0)
{
printf("Warning: ", src, " not found: can't install ", src, names,
" at ", dest, "\n");
return;
}
chdir(src);
}
if (names == "")
files = makelist("*");
else
files = strtok(names, " ");
for (idx = listlen(files); idx--; )
{
file = files[idx];
run("gzip -n -9 < " + file + " > " + file + ".gz");
}
run("tar cf - *.gz | (cd " + g_cwd + "; cd " + dest + "; tar xf -)");
run("rm *.gz");
}
xd-3.23.04/icmake/clean 0000644 0001750 0001750 00000001140 12605017655 013523 0 ustar frank frank void 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 *.ih.gch */*.ih.gch");
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.23.04/icmake/logfile 0000644 0001750 0001750 00000000257 12605017655 014072 0 ustar frank frank void logFile(string srcdir, string src, string destdir, string dest)
{
chdir(g_cwd);
md(destdir);
run("cp " + srcdir + "/" + src + " " + destdir + "/" + dest);
}
xd-3.23.04/icmake/findall 0000644 0001750 0001750 00000001074 12635474111 014055 0 ustar frank frank // assuming we're in g_cwd, all entries of type 'type' matching source/pattern
// are returned w/o final \n
list findAll(string type, string source, string pattern)
{
string cmd;
list entries;
list ret;
int idx;
chdir(source);
cmd = "find ./ -mindepth 1 -maxdepth 1 -type " + type;
if (pattern != "")
pattern = "-name '" + pattern + "'";
entries = backtick(cmd + " " + pattern + " -printf \"%f\\n\"");
for (idx = listlen(entries); idx--; )
ret += (list)cutEoln(entries[idx]);
chdir(g_cwd);
return ret;
}
xd-3.23.04/icmake/manpage 0000644 0001750 0001750 00000000661 12605017655 014060 0 ustar frank frank #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.23.04/icmake/cuteoln 0000644 0001750 0001750 00000000233 12605017655 014114 0 ustar frank frank string cutEoln(string text)
{
int len;
len = strlen(text) - 1;
if (text[len] == "\n")
text = substr(text, 0, len);
return text;
}
xd-3.23.04/icmake/uninstall 0000644 0001750 0001750 00000000456 12605017655 014463 0 ustar frank frank void uninstall(string logfile)
{
int idx;
list entry;
string dir;
list line;
if (!exists(logfile))
{
printf("installation log file " + logfile + " not found\n");
exit(0);
}
run("icmake/remove " + logfile + " " + (string)g_echo);
exit(0);
}
xd-3.23.04/icmake/pathfile 0000644 0001750 0001750 00000000552 12605017655 014243 0 ustar frank frank list path_file(string path)
{
list ret;
int len;
int idx;
for (len = strlen(path), idx = len; idx--; )
{
if (path[idx] == "/")
{
ret =
(list)substr(path, 0, idx) + (list)substr(path, idx + 1, len);
return ret;
}
}
ret = (list)"" + (list)path;
return ret;
}
xd-3.23.04/icmake/github 0000644 0001750 0001750 00000000216 12605017655 013726 0 ustar frank frank void github()
{
run("cp -r release.yo tmp/manhtml/xdman.html ../../wip");
run("cp changelog ../../wip/changelog.txt");
exit(0);
}
xd-3.23.04/icmake/md 0000644 0001750 0001750 00000000740 12605017655 013046 0 ustar frank frank // 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;
if (!exists(target))
run("mkdir -p " + target);
else if (((int)stat(target)[0] & S_IFDIR) == 0)
{
printf(target + " exists, but is not a directory\n");
exit(1);
}
}
xd-3.23.04/icmake/log 0000755 0001750 0001750 00000000632 12605017655 013232 0 ustar frank frank #!/bin/bash
find tmp/install -type f -exec md5sum "{}" \; |
sed 's|tmp/install|'$1'|' > $2
find tmp/install -type l -exec printf "link %s\n" "{}" \; |
sed 's|tmp/install|'$1'|' >> $2
find tmp/install -type d -exec printf "dir %s\n" "{}" \; |
sed 's|tmp/install|'$1'|' >> $2
xd-3.23.04/icmake/remove 0000755 0001750 0001750 00000001170 12605017655 013744 0 ustar frank frank #!/bin/bash
g_echo=$2
rm_f()
{
[ $g_echo -ne 0 ] && echo rm $1
rm -f $1
}
rm_dir()
{
[ $g_echo -ne 0 ] && echo rmdir $1
rmdir --ignore-fail-on-non-empty -p $1
}
IFS="
"
for line in `cat $1`
do
field1=`echo $line | awk '{printf $1}'`
field2=`echo $line | awk '{printf $2}'`
if [ $field1 == "link" ] ; then
rm_f $field2
elif [ $field1 == "dir" ] ; then
rm_dir $field2
elif [ -e "$field2" ] ; then
if [ "$field1" != "`md5sum $field2 | awk '{printf $1}'`" ] ; then
echo $field2 changed, not removed
else
rm_f $field2
fi
fi
done
rm_f $1
xd-3.23.04/icmake/precompileheaders 0000644 0001750 0001750 00000001336 12635474111 016140 0 ustar frank frank string g_compiler;
int g_gch = 1;
void _precompile(string class)
{
string classIH;
classIH = class + ".ih";
if (classIH younger class + ".ih.gch")
run(g_compiler + " -x c++-header " + classIH);
}
void precompileHeaders()
{
int idx;
list classes;
string class;
if (!g_gch)
return;
classes = makelist(O_SUBDIR, "*");
g_compiler = setOpt(CXX, "CXX") + " " +
setOpt(CXXFLAGS, "CXXFLAGS") + " ";
_precompile("main"); // precompile the main program .ih file
for (idx = listlen(classes); idx--; )
{
class = classes[idx];
chdir(class);
_precompile(class);
chdir(g_cwd);
}
}
xd-3.23.04/icmake/special 0000644 0001750 0001750 00000000713 12605017655 014066 0 ustar frank frank //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.23.04/icmake/run 0000644 0001750 0001750 00000000330 12605017655 013245 0 ustar frank frank int 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.23.04/icmake/install 0000644 0001750 0001750 00000003344 12605017655 014117 0 ustar frank frank
void install(string request, string dest)
{
string target;
int components = 0;
list pathsplit;
string base;
base = "tmp/install/";
md(base);
if (request == "x")
components = 63;
else
{
if (strfind(request, "b") != -1)
components |= 2;
if (strfind(request, "d") != -1)
components |= 4;
if (strfind(request, "m") != -1)
components |= 8;
}
if (components & 2)
{
target = base + BINARY;
pathsplit = path_file(target);
printf(" installing the executable `", target, "'\n");
logFile("tmp/bin", "binary", pathsplit[0], pathsplit[1]);
}
if (components & (4 | 8))
{
target = base + DOC "/";
if (components & 4)
{
printf(" installing the changelog at `", target, "\n");
logZip("", "changelog", target );
printf(" INSTALLING xdrc at `", target, "\n");
logFile(".", "xdrc", target, "");
}
if (components & 8)
{
printf(" installing the html-manual pages at `", target, "\n");
logInstall("tmp/manhtml", "", target);
}
}
if (components & 8)
{
target = base + MAN "/";
printf(" installing the manual pages below `", target, "'\n");
logZip("tmp/man", "xd.1", target);
}
chdir(g_cwd);
if (dest == "")
dest = "/";
else
md(dest);
dest = cutEoln(backtick("realpath " + dest)[0]);
if (g_logPath != "")
backtick("icmake/log " + dest + " " + g_logPath);
run("tar cf - -Ctmp/install . | tar xf - -C" + dest);
printf("\n Installation completed\n");
exit(0);
}
xd-3.23.04/icmake/backtick 0000644 0001750 0001750 00000000160 12605017655 014215 0 ustar frank frank list backtick(string arg)
{
list ret;
echo(OFF);
ret = `arg`;
echo(g_echo);
return ret;
}
xd-3.23.04/icmconf 0000644 0001750 0001750 00000001365 12635475450 012643 0 ustar frank frank #include "INSTALL.im"
#define MAIN "xd.cc"
#define ADD_LIBRARIES "bobcat"
#define ADD_LIBRARY_PATHS ""
#define REFRESH
#define LIBRARY "modules"
#define SHAREDREQ ""
//#define CLS
//#define USE_ALL "a"
#define SOURCES "*.cc"
#define SCANNER_DIR ""
#define SCANGEN ""
#define SCANFLAGS ""
#define SCANSPEC ""
#define SCANOUT ""
#define PARSER_DIR ""
#define PARSGEN ""
#define PARSFLAGS ""
#define PARSSPEC ""
#define PARSFILES ""
#define PARSOUT ""
#define USE_ECHO ON
#define TMP_DIR "tmp"
#define OBJ_EXT ".o"
#define USE_VERSION
xd-3.23.04/required 0000644 0001750 0001750 00000000617 12635477346 013052 0 ustar frank frank This file lists non-standard software only. Thus, standard utilities like cp,
mv, sed, etc, etc, are not explicitly mentioned. Neither is the g++ compiler
explicitly mentioned, but a fairly recent one is assumed.
Required software for building XD:
----------------------------------
Build-Depends:
libbobcat-dev (>= 4.01.03)
icmake (>= 8.00.04)
yodl (>= 3.06.0)
xd-3.23.04/usage.cc 0000644 0001750 0001750 00000006673 12605017655 012720 0 ustar frank frank // 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.23.04/version.cc 0000644 0001750 0001750 00000000336 12605017655 013267 0 ustar frank frank // 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.23.04/xd.cc 0000644 0001750 0001750 00000001657 12605017655 012224 0 ustar frank frank /* 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.23.04/xd.ih 0000644 0001750 0001750 00000000655 12605017655 012234 0 ustar frank frank #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.23.04/xd.lsm 0000644 0001750 0001750 00000002404 12605017655 012421 0 ustar frank frank Begin2
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.23.04/xd.xref 0000644 0001750 0001750 00000027523 12605017655 012603 0 ustar frank frank oxref by Frank B. Brokken (f.b.brokken@rug.nl)
oxref V1.00.02 2012-2015
CREATED Fri, 02 Oct 2015 11:31:29 +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::__cxx11::basic_string, std::allocator > const&, std::set, std::allocator >, std::less, std::allocator > >, std::allocator, std::allocator > > >&)
Full name: Alternatives::addIgnored(std::__cxx11::basic_string, std::allocator > const&, std::set, std::allocator >, std::less, std::allocator > >, std::allocator, std::allocator > > >&)
Source: addignored.cc
Used By:
globfrom.cc: Alternatives::globFrom(std::__cxx11::basic_string, std::allocator >)
author
Full name: Icmbuild::author
Source: version.cc
Used By:
usage.cc: usage(std::__cxx11::basic_string, std::allocator > const&)
checkCase(std::__cxx11::basic_string, std::allocator >&, unsigned int*) const
Full name: Alternatives::checkCase(std::__cxx11::basic_string, std::allocator >&, unsigned int*) const
Source: checkcase.cc
Used By:
globpattern.cc: Alternatives::globPattern(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >&, unsigned int*, Alternatives::GlobContext&)
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::__cxx11::basic_string, std::allocator > 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()
cxx11]()
Full name: Alternatives::getHome[abi:cxx11]()
Source: gethome.cc
Used By:
alternatives.cc: Alternatives::Alternatives()
cxx11]()
Full name: Alternatives::determineInitialDirectory[abi:cxx11]()
Source: determineinitialdir.cc
Used By:
viable.cc: Alternatives::viable()
determineAction()
Full name: Command::determineAction()
Source: determineaction.cc
Used By:
command.cc: Command::Command()
generalizedGlob(std::__cxx11::basic_string, std::allocator >, Alternatives::GlobContext&)
Full name: Alternatives::generalizedGlob(std::__cxx11::basic_string, std::allocator >, Alternatives::GlobContext&)
Source: generalizedglob.cc
Used By:
globfrom.cc: Alternatives::globFrom(std::__cxx11::basic_string, std::allocator >)
getCwd(std::unique_ptr >*)
Full name: Alternatives::getCwd(std::unique_ptr >*)
Source: getcwd.cc
Used By:
determineinitialdir.cc: Alternatives::determineInitialDirectory[abi:cxx11]()
glob(std::__cxx11::basic_string, std::allocator >, Alternatives::GlobContext&)
Full name: Alternatives::glob(std::__cxx11::basic_string, std::allocator >, Alternatives::GlobContext&)
Source: glob.cc
Used By:
globfrom.cc: Alternatives::globFrom(std::__cxx11::basic_string, std::allocator >)
globFilter(char const*, Alternatives::GlobContext&)
Full name: Alternatives::globFilter(char const*, Alternatives::GlobContext&)
Source: globfilter.cc
Used By:
glob.cc: Alternatives::glob(std::__cxx11::basic_string, std::allocator >, Alternatives::GlobContext&)
globpattern.cc: Alternatives::globPattern(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >&, unsigned int*, Alternatives::GlobContext&)
globFrom(std::__cxx11::basic_string, std::allocator >)
Full name: Alternatives::globFrom(std::__cxx11::basic_string, std::allocator >)
Source: globfrom.cc
Used By:
viable.cc: Alternatives::viable()
globHead(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator >, Alternatives::GlobContext&)
Full name: Alternatives::globHead(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator >, Alternatives::GlobContext&)
Source: globhead.cc
Used By:
generalizedglob.cc: Alternatives::generalizedGlob(std::__cxx11::basic_string, std::allocator >, Alternatives::GlobContext&)
globpattern.cc: Alternatives::globPattern(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >&, unsigned int*, Alternatives::GlobContext&)
globPattern(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >&, unsigned int*, Alternatives::GlobContext&)
Full name: Alternatives::globPattern(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >&, unsigned int*, Alternatives::GlobContext&)
Source: globpattern.cc
Used By:
globhead.cc: Alternatives::globHead(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator >, Alternatives::GlobContext&)
History(FBB::ArgConfig&, std::__cxx11::basic_string, std::allocator > const&)
Full name: History::History(FBB::ArgConfig&, std::__cxx11::basic_string, std::allocator > const&)
Source: history1.cc
Used By:
alternatives.cc: Alternatives::Alternatives()
load(std::__cxx11::basic_string, std::allocator > const&)
Full name: History::load(std::__cxx11::basic_string, std::allocator > const&)
Source: load.cc
Used By:
history1.cc: History::History(FBB::ArgConfig&, std::__cxx11::basic_string, std::allocator > const&)
matchIgnore(std::__cxx11::basic_string, std::allocator > const&, char const*)
Full name: Alternatives::matchIgnore(std::__cxx11::basic_string, std::allocator > 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::__cxx11::basic_string, std::allocator > const&)
operator>>(std::istream&, History::HistoryInfo&)
Full name: operator>>(std::istream&, History::HistoryInfo&)
Source: infoopextract.cc
Used By:
load.cc: History::load(std::__cxx11::basic_string, std::allocator > 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::__cxx11::basic_string, std::allocator > 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::__cxx11::basic_string, std::allocator > const&)
Full name: History::save(std::__cxx11::basic_string, std::allocator > 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::__cxx11::basic_string, std::allocator > 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::__cxx11::basic_string, std::allocator > const&)
Full name: usage(std::__cxx11::basic_string, std::allocator > 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::__cxx11::basic_string, std::allocator > const&)
year
Full name: Icmbuild::year
Source: version.cc
Used By:
usage.cc: usage(std::__cxx11::basic_string, std::allocator > const&)
xd-3.23.04/xdrc 0000644 0001750 0001750 00000007006 12605017655 012157 0 ustar frank frank # 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 generalized-search (GDS) on is specified bf(xd) directory separators are
# no longer required, and xd finds all posible alternatives resulting from
# all possible sequential combinations of the initial search command.
# Directory separators are honored when specified, even when
# generalized-search is specified. However, they are *required* if
# generalized-search is not specified or (same thing) if
#traditional
# is instead specified.
generalized-search
# 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*
# The icase option is used to specify case-insensitive pattern matching. By
# default case sensitive pattern matching is used.
#icase