Compare commits
1 Commits
tk-8.6.6.0
...
xz
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60cae1c5a1 |
27
AUTHORS
Normal file
27
AUTHORS
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
Authors of XZ Utils
|
||||
===================
|
||||
|
||||
XZ Utils is developed and maintained by Lasse Collin
|
||||
<lasse.collin@tukaani.org>.
|
||||
|
||||
Major parts of liblzma are based on code written by Igor Pavlov,
|
||||
specifically the LZMA SDK <http://7-zip.org/sdk.html>. Without
|
||||
this code, XZ Utils wouldn't exist.
|
||||
|
||||
The SHA-256 implementation in liblzma is based on the code found from
|
||||
7-Zip <http://7-zip.org/>, which has a modified version of the SHA-256
|
||||
code found from Crypto++ <http://www.cryptopp.com/>. The SHA-256 code
|
||||
in Crypto++ was written by Kevin Springle and Wei Dai.
|
||||
|
||||
Some scripts have been adapted from gzip. The original versions
|
||||
were written by Jean-loup Gailly, Charles Levert, and Paul Eggert.
|
||||
Andrew Dudman helped adapting the scripts and their man pages for
|
||||
XZ Utils.
|
||||
|
||||
The GNU Autotools-based build system contains files from many authors,
|
||||
which I'm not trying to list here.
|
||||
|
||||
Several people have contributed fixes or reported bugs. Most of them
|
||||
are mentioned in the file THANKS.
|
||||
|
||||
65
COPYING
Normal file
65
COPYING
Normal file
@@ -0,0 +1,65 @@
|
||||
|
||||
XZ Utils Licensing
|
||||
==================
|
||||
|
||||
Different licenses apply to different files in this package. Here
|
||||
is a rough summary of which licenses apply to which parts of this
|
||||
package (but check the individual files to be sure!):
|
||||
|
||||
- liblzma is in the public domain.
|
||||
|
||||
- xz, xzdec, and lzmadec command line tools are in the public
|
||||
domain unless GNU getopt_long had to be compiled and linked
|
||||
in from the lib directory. The getopt_long code is under
|
||||
GNU LGPLv2.1+.
|
||||
|
||||
- The scripts to grep, diff, and view compressed files have been
|
||||
adapted from gzip. These scripts and their documentation are
|
||||
under GNU GPLv2+.
|
||||
|
||||
- All the documentation in the doc directory and most of the
|
||||
XZ Utils specific documentation files in other directories
|
||||
are in the public domain.
|
||||
|
||||
- Translated messages are in the public domain.
|
||||
|
||||
- The build system contains public domain files, and files that
|
||||
are under GNU GPLv2+ or GNU GPLv3+. None of these files end up
|
||||
in the binaries being built.
|
||||
|
||||
- Test files and test code in the tests directory, and debugging
|
||||
utilities in the debug directory are in the public domain.
|
||||
|
||||
- The extra directory may contain public domain files, and files
|
||||
that are under various free software licenses.
|
||||
|
||||
You can do whatever you want with the files that have been put into
|
||||
the public domain. If you find public domain legally problematic,
|
||||
take the previous sentence as a license grant. If you still find
|
||||
the lack of copyright legally problematic, you have too many
|
||||
lawyers.
|
||||
|
||||
As usual, this software is provided "as is", without any warranty.
|
||||
|
||||
If you copy significant amounts of public domain code from XZ Utils
|
||||
into your project, acknowledging this somewhere in your software is
|
||||
polite (especially if it is proprietary, non-free software), but
|
||||
naturally it is not legally required. Here is an example of a good
|
||||
notice to put into "about box" or into documentation:
|
||||
|
||||
This software includes code from XZ Utils <http://tukaani.org/xz/>.
|
||||
|
||||
The following license texts are included in the following files:
|
||||
- COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1
|
||||
- COPYING.GPLv2: GNU General Public License version 2
|
||||
- COPYING.GPLv3: GNU General Public License version 3
|
||||
|
||||
Note that the toolchain (compiler, linker etc.) may add some code
|
||||
pieces that are copyrighted. Thus, it is possible that e.g. liblzma
|
||||
binary wouldn't actually be in the public domain in its entirety
|
||||
even though it contains no copyrighted code from the XZ Utils source
|
||||
package.
|
||||
|
||||
If you have questions, don't hesitate to ask the author(s) for more
|
||||
information.
|
||||
|
||||
339
COPYING.GPLv2
Normal file
339
COPYING.GPLv2
Normal file
@@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) 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
|
||||
this service 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 make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. 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.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the 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 a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE 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.
|
||||
|
||||
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
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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 2 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, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision 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, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This 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.
|
||||
674
COPYING.GPLv3
Normal file
674
COPYING.GPLv3
Normal file
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
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.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
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
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
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
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
502
COPYING.LGPLv2.1
Normal file
502
COPYING.LGPLv2.1
Normal file
@@ -0,0 +1,502 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
7877
ChangeLog.2002
7877
ChangeLog.2002
File diff suppressed because it is too large
Load Diff
3653
ChangeLog.2004
3653
ChangeLog.2004
File diff suppressed because it is too large
Load Diff
5283
ChangeLog.2007
5283
ChangeLog.2007
File diff suppressed because it is too large
Load Diff
1234
Doxyfile.in
Normal file
1234
Doxyfile.in
Normal file
File diff suppressed because it is too large
Load Diff
554
INSTALL
Normal file
554
INSTALL
Normal file
@@ -0,0 +1,554 @@
|
||||
|
||||
XZ Utils Installation
|
||||
=====================
|
||||
|
||||
0. Preface
|
||||
1. Supported platforms
|
||||
1.1. Compilers
|
||||
1.2. Platform-specific notes
|
||||
1.2.1. AIX
|
||||
1.2.2. IRIX
|
||||
1.2.3. MINIX 3
|
||||
1.2.4. OpenVMS
|
||||
1.2.5. Solaris, OpenSolaris, and derivatives
|
||||
1.2.6. Tru64
|
||||
1.2.7. Windows
|
||||
1.2.8. DOS
|
||||
1.3. Adding support for new platforms
|
||||
2. configure options
|
||||
2.1. Static vs. dynamic linking of liblzma
|
||||
2.2. Optimizing xzdec and lzmadec
|
||||
3. xzgrep and other scripts
|
||||
3.1. Dependencies
|
||||
3.2. PATH
|
||||
4. Troubleshooting
|
||||
4.1. "No C99 compiler was found."
|
||||
4.2. "No POSIX conforming shell (sh) was found."
|
||||
4.3. configure works but build fails at crc32_x86.S
|
||||
4.4. Lots of warnings about symbol visibility
|
||||
4.5. "make check" fails
|
||||
4.6. liblzma.so (or similar) not found when running xz
|
||||
|
||||
|
||||
0. Preface
|
||||
----------
|
||||
|
||||
If you aren't familiar with building packages that use GNU Autotools,
|
||||
see the file INSTALL.generic for generic instructions before reading
|
||||
further.
|
||||
|
||||
If you are going to build a package for distribution, see also the
|
||||
file PACKAGERS. It contains information that should help making the
|
||||
binary packages as good as possible, but the information isn't very
|
||||
interesting to those making local builds for private use or for use
|
||||
in special situations like embedded systems.
|
||||
|
||||
|
||||
1. Supported platforms
|
||||
----------------------
|
||||
|
||||
XZ Utils are developed on GNU/Linux, but they should work on many
|
||||
POSIX-like operating systems like *BSDs and Solaris, and even on
|
||||
a few non-POSIX operating systems.
|
||||
|
||||
|
||||
1.1. Compilers
|
||||
|
||||
A C99 compiler is required to compile XZ Utils. If you use GCC, you
|
||||
need at least version 3.x.x. GCC version 2.xx.x doesn't support some
|
||||
C99 features used in XZ Utils source code, thus GCC 2 won't compile
|
||||
XZ Utils.
|
||||
|
||||
XZ Utils takes advantage of some GNU C extensions when building
|
||||
with GCC. Because these extensions are used only when building
|
||||
with GCC, it should be possible to use any C99 compiler.
|
||||
|
||||
|
||||
1.2. Platform-specific notes
|
||||
|
||||
1.2.1. AIX
|
||||
|
||||
If you use IBM XL C compiler, pass CC=xlc_r to configure. If
|
||||
you use CC=xlc instead, you must disable threading support
|
||||
with --disable-threads (usually not recommended).
|
||||
|
||||
|
||||
1.2.2. IRIX
|
||||
|
||||
MIPSpro 7.4.4m has been reported to produce broken code if using
|
||||
the -O2 optimization flag ("make check" fails). Using -O1 should
|
||||
work.
|
||||
|
||||
A problem has been reported when using shared liblzma. Passing
|
||||
--disable-shared to configure works around this. Alternatively,
|
||||
putting "-64" to CFLAGS to build a 64-bit version might help too.
|
||||
|
||||
|
||||
1.2.3. MINIX 3
|
||||
|
||||
The default install of MINIX 3 includes Amsterdam Compiler Kit (ACK),
|
||||
which doesn't support C99. Install GCC to compile XZ Utils.
|
||||
|
||||
MINIX 3.1.8 and older have bugs in /usr/include/stdint.h, which has
|
||||
to be patched before XZ Utils can be compiled correctly. See
|
||||
<http://gforge.cs.vu.nl/gf/project/minix/tracker/?action=TrackerItemEdit&tracker_item_id=537>.
|
||||
|
||||
MINIX 3.2.0 and later use a different libc and aren't affected by
|
||||
the above bug.
|
||||
|
||||
XZ Utils doesn't have code to detect the amount of physical RAM and
|
||||
number of CPU cores on MINIX 3.
|
||||
|
||||
See section 4.4 in this file about symbol visibility warnings (you
|
||||
may want to pass gl_cv_cc_visibility=no to configure).
|
||||
|
||||
|
||||
1.2.4. OpenVMS
|
||||
|
||||
XZ Utils can be built for OpenVMS, but the build system files
|
||||
are not included in the XZ Utils source package. The required
|
||||
OpenVMS-specific files are maintained by Jouk Jansen and can be
|
||||
downloaded here:
|
||||
|
||||
http://nchrem.tnw.tudelft.nl/openvms/software2.html#xzutils
|
||||
|
||||
|
||||
1.2.5. Solaris, OpenSolaris, and derivatives
|
||||
|
||||
The following linker error has been reported on some x86 systems:
|
||||
|
||||
ld: fatal: relocation error: R_386_GOTOFF: ...
|
||||
|
||||
This can be worked around by passing gl_cv_cc_visibility=no
|
||||
as an argument to the configure script.
|
||||
|
||||
test_scripts.sh in "make check" may fail if good enough tools are
|
||||
missing from PATH (/usr/xpg4/bin or /usr/xpg6/bin). See sections
|
||||
4.5 and 3.2 for more information.
|
||||
|
||||
|
||||
1.2.6. Tru64
|
||||
|
||||
If you try to use the native C compiler on Tru64 (passing CC=cc to
|
||||
configure), you may need the workaround mention in section 4.1 in
|
||||
this file (pass also ac_cv_prog_cc_c99= to configure).
|
||||
|
||||
|
||||
1.2.7. Windows
|
||||
|
||||
Building XZ Utils on Windows is supported under the following
|
||||
environments:
|
||||
|
||||
- MinGW-w64 + MSYS (32-bit and 64-bit x86): This is used
|
||||
for building the official binary packages for Windows.
|
||||
There is windows/build.bash to ease packaging XZ Utils with
|
||||
MinGW(-w64) + MSYS into a redistributable .zip or .7z file.
|
||||
See windows/INSTALL-MinGW.txt for more information.
|
||||
|
||||
- MinGW + MSYS (32-bit x86): I haven't recently tested this.
|
||||
|
||||
- Cygwin 1.7.35 and later: NOTE that using XZ Utils >= 5.2.0
|
||||
under Cygwin older than 1.7.35 can lead to DATA LOSS! If
|
||||
you must use an old Cygwin version, stick to XZ Utils 5.0.x
|
||||
which is safe under older Cygwin versions. You can check
|
||||
the Cygwin version with the command "cygcheck -V".
|
||||
|
||||
- Microsoft Visual Studio 2013 update 2 or later (MSVC for short):
|
||||
See windows/INSTALL-MSVC.txt for more information.
|
||||
|
||||
It may be possible to build liblzma with other toolchains too, but
|
||||
that will probably require writing a separate makefile. Building
|
||||
the command line tools with non-GNU toolchains will be harder than
|
||||
building only liblzma.
|
||||
|
||||
Even if liblzma is built with MinGW(-w64), the resulting DLL can
|
||||
be used by other compilers and linkers, including MSVC. See
|
||||
windows/README-Windows.txt for details.
|
||||
|
||||
|
||||
1.2.8. DOS
|
||||
|
||||
There is an experimental Makefile in the "dos" directory to build
|
||||
XZ Utils on DOS using DJGPP. Support for long file names (LFN) is
|
||||
needed. See dos/README for more information.
|
||||
|
||||
GNU Autotools based build hasn't been tried on DOS. If you try, I
|
||||
would like to hear if it worked.
|
||||
|
||||
|
||||
1.3. Adding support for new platforms
|
||||
|
||||
If you have written patches to make XZ Utils to work on previously
|
||||
unsupported platform, please send the patches to me! I will consider
|
||||
including them to the official version. It's nice to minimize the
|
||||
need of third-party patching.
|
||||
|
||||
One exception: Don't request or send patches to change the whole
|
||||
source package to C89. I find C99 substantially nicer to write and
|
||||
maintain. However, the public library headers must be in C89 to
|
||||
avoid frustrating those who maintain programs, which are strictly
|
||||
in C89 or C++.
|
||||
|
||||
|
||||
2. configure options
|
||||
--------------------
|
||||
|
||||
In most cases, the defaults are what you want. Many of the options
|
||||
below are useful only when building a size-optimized version of
|
||||
liblzma or command line tools.
|
||||
|
||||
--enable-encoders=LIST
|
||||
--disable-encoders
|
||||
Specify a comma-separated LIST of filter encoders to
|
||||
build. See "./configure --help" for exact list of
|
||||
available filter encoders. The default is to build all
|
||||
supported encoders.
|
||||
|
||||
If LIST is empty or --disable-encoders is used, no filter
|
||||
encoders will be built and also the code shared between
|
||||
encoders will be omitted.
|
||||
|
||||
Disabling encoders will remove some symbols from the
|
||||
liblzma ABI, so this option should be used only when it
|
||||
is known to not cause problems.
|
||||
|
||||
--enable-decoders=LIST
|
||||
--disable-decoders
|
||||
This is like --enable-encoders but for decoders. The
|
||||
default is to build all supported decoders.
|
||||
|
||||
--enable-match-finders=LIST
|
||||
liblzma includes two categories of match finders:
|
||||
hash chains and binary trees. Hash chains (hc3 and hc4)
|
||||
are quite fast but they don't provide the best compression
|
||||
ratio. Binary trees (bt2, bt3 and bt4) give excellent
|
||||
compression ratio, but they are slower and need more
|
||||
memory than hash chains.
|
||||
|
||||
You need to enable at least one match finder to build the
|
||||
LZMA1 or LZMA2 filter encoders. Usually hash chains are
|
||||
used only in the fast mode, while binary trees are used to
|
||||
when the best compression ratio is wanted.
|
||||
|
||||
The default is to build all the match finders if LZMA1
|
||||
or LZMA2 filter encoders are being built.
|
||||
|
||||
--enable-checks=LIST
|
||||
liblzma support multiple integrity checks. CRC32 is
|
||||
mandatory, and cannot be omitted. See "./configure --help"
|
||||
for exact list of available integrity check types.
|
||||
|
||||
liblzma and the command line tools can decompress files
|
||||
which use unsupported integrity check type, but naturally
|
||||
the file integrity cannot be verified in that case.
|
||||
|
||||
Disabling integrity checks may remove some symbols from
|
||||
the liblzma ABI, so this option should be used only when
|
||||
it is known to not cause problems.
|
||||
|
||||
--disable-xz
|
||||
--disable-xzdec
|
||||
--disable-lzmadec
|
||||
--disable-lzmainfo
|
||||
Don't build and install the command line tool mentioned
|
||||
in the option name.
|
||||
|
||||
NOTE: Disabling xz will skip some tests in "make check".
|
||||
|
||||
NOTE: If xzdec is disabled and lzmadec is left enabled,
|
||||
a dangling man page symlink lzmadec.1 -> xzdec.1 is
|
||||
created.
|
||||
|
||||
--disable-lzma-links
|
||||
Don't create symlinks for LZMA Utils compatibility.
|
||||
This includes lzma, unlzma, and lzcat. If scripts are
|
||||
installed, also lzdiff, lzcmp, lzgrep, lzegrep, lzfgrep,
|
||||
lzmore, and lzless will be omitted if this option is used.
|
||||
|
||||
--disable-scripts
|
||||
Don't install the scripts xzdiff, xzgrep, xzmore, xzless,
|
||||
and their symlinks.
|
||||
|
||||
--disable-doc
|
||||
Don't install the documentation files to $docdir
|
||||
(often /usr/doc/xz or /usr/local/doc/xz). Man pages
|
||||
will still be installed. The $docdir can be changed
|
||||
with --docdir=DIR.
|
||||
|
||||
--disable-assembler
|
||||
liblzma includes some assembler optimizations. Currently
|
||||
there is only assembler code for CRC32 and CRC64 for
|
||||
32-bit x86.
|
||||
|
||||
All the assembler code in liblzma is position-independent
|
||||
code, which is suitable for use in shared libraries and
|
||||
position-independent executables. So far only i386
|
||||
instructions are used, but the code is optimized for i686
|
||||
class CPUs. If you are compiling liblzma exclusively for
|
||||
pre-i686 systems, you may want to disable the assembler
|
||||
code.
|
||||
|
||||
--enable-unaligned-access
|
||||
Allow liblzma to use unaligned memory access for 16-bit
|
||||
and 32-bit loads and stores. This should be enabled only
|
||||
when the hardware supports this, i.e. when unaligned
|
||||
access is fast. Some operating system kernels emulate
|
||||
unaligned access, which is extremely slow. This option
|
||||
shouldn't be used on systems that rely on such emulation.
|
||||
|
||||
Unaligned access is enabled by default on x86, x86-64,
|
||||
and big endian PowerPC.
|
||||
|
||||
--enable-small
|
||||
Reduce the size of liblzma by selecting smaller but
|
||||
semantically equivalent version of some functions, and
|
||||
omit precomputed lookup tables. This option tends to
|
||||
make liblzma slightly slower.
|
||||
|
||||
Note that while omitting the precomputed tables makes
|
||||
liblzma smaller on disk, the tables are still needed at
|
||||
run time, and need to be computed at startup. This also
|
||||
means that the RAM holding the tables won't be shared
|
||||
between applications linked against shared liblzma.
|
||||
|
||||
This option doesn't modify CFLAGS to tell the compiler
|
||||
to optimize for size. You need to add -Os or equivalent
|
||||
flag(s) to CFLAGS manually.
|
||||
|
||||
--enable-assume-ram=SIZE
|
||||
On the most common operating systems, XZ Utils is able to
|
||||
detect the amount of physical memory on the system. This
|
||||
information is used by the options --memlimit-compress,
|
||||
--memlimit-decompress, and --memlimit when setting the
|
||||
limit to a percentage of total RAM.
|
||||
|
||||
On some systems, there is no code to detect the amount of
|
||||
RAM though. Using --enable-assume-ram one can set how much
|
||||
memory to assume on these systems. SIZE is given as MiB.
|
||||
The default is 128 MiB.
|
||||
|
||||
Feel free to send patches to add support for detecting
|
||||
the amount of RAM on the operating system you use. See
|
||||
src/common/tuklib_physmem.c for details.
|
||||
|
||||
--enable-threads=METHOD
|
||||
Threading support is enabled by default so normally there
|
||||
is no need to specify this option.
|
||||
|
||||
Supported values for METHOD:
|
||||
|
||||
yes Autodetect the threading method. If none
|
||||
is found, configure will give an error.
|
||||
|
||||
posix Use POSIX pthreads. This is the default
|
||||
except on Windows outside Cygwin.
|
||||
|
||||
win95 Use Windows 95 compatible threads. This
|
||||
is compatible with Windows XP and later
|
||||
too. This is the default for 32-bit x86
|
||||
Windows builds. The `win95' threading is
|
||||
incompatible with --enable-small.
|
||||
|
||||
vista Use Windows Vista compatible threads. The
|
||||
resulting binaries won't run on Windows XP
|
||||
or older. This is the default for Windows
|
||||
excluding 32-bit x86 builds (that is, on
|
||||
x86-64 the default is `vista').
|
||||
|
||||
no Disable threading support. This is the
|
||||
same as using --disable-threads.
|
||||
NOTE: If combined with --enable-small, the
|
||||
resulting liblzma won't be thread safe,
|
||||
that is, if a multi-threaded application
|
||||
calls any liblzma functions from more than
|
||||
one thread, something bad may happen.
|
||||
|
||||
--enable-symbol-versions
|
||||
Use symbol versioning for liblzma. This is enabled by
|
||||
default on GNU/Linux, other GNU-based systems, and
|
||||
FreeBSD.
|
||||
|
||||
--enable-debug
|
||||
This enables the assert() macro and possibly some other
|
||||
run-time consistency checks. It makes the code slower, so
|
||||
you normally don't want to have this enabled.
|
||||
|
||||
--enable-werror
|
||||
If building with GCC, make all compiler warnings an error,
|
||||
that abort the compilation. This may help catching bugs,
|
||||
and should work on most systems. This has no effect on the
|
||||
resulting binaries.
|
||||
|
||||
|
||||
2.1. Static vs. dynamic linking of liblzma
|
||||
|
||||
On 32-bit x86, linking against static liblzma can give a minor
|
||||
speed improvement. Static libraries on x86 are usually compiled as
|
||||
position-dependent code (non-PIC) and shared libraries are built as
|
||||
position-independent code (PIC). PIC wastes one register, which can
|
||||
make the code slightly slower compared to a non-PIC version. (Note
|
||||
that this doesn't apply to x86-64.)
|
||||
|
||||
If you want to link xz against static liblzma, the simplest way
|
||||
is to pass --disable-shared to configure. If you want also shared
|
||||
liblzma, run configure again and run "make install" only for
|
||||
src/liblzma.
|
||||
|
||||
|
||||
2.2. Optimizing xzdec and lzmadec
|
||||
|
||||
xzdec and lzmadec are intended to be relatively small instead of
|
||||
optimizing for the best speed. Thus, it is a good idea to build
|
||||
xzdec and lzmadec separately:
|
||||
|
||||
- To link the tools against static liblzma, pass --disable-shared
|
||||
to configure.
|
||||
|
||||
- To select somewhat size-optimized variant of some things in
|
||||
liblzma, pass --enable-small to configure.
|
||||
|
||||
- Tell the compiler to optimize for size instead of speed.
|
||||
E.g. with GCC, put -Os into CFLAGS.
|
||||
|
||||
- xzdec and lzmadec will never use multithreading capabilities of
|
||||
liblzma. You can avoid dependency on libpthread by passing
|
||||
--disable-threads to configure.
|
||||
|
||||
- There are and will be no translated messages for xzdec and
|
||||
lzmadec, so it is fine to pass also --disable-nls to configure.
|
||||
|
||||
- Only decoder code is needed, so you can speed up the build
|
||||
slightly by passing --disable-encoders to configure. This
|
||||
shouldn't affect the final size of the executables though,
|
||||
because the linker is able to omit the encoder code anyway.
|
||||
|
||||
If you have no use for xzdec or lzmadec, you can disable them with
|
||||
--disable-xzdec and --disable-lzmadec.
|
||||
|
||||
|
||||
3. xzgrep and other scripts
|
||||
---------------------------
|
||||
|
||||
3.1. Dependencies
|
||||
|
||||
POSIX shell (sh) and bunch of other standard POSIX tools are required
|
||||
to run the scripts. The configure script tries to find a POSIX
|
||||
compliant sh, but if it fails, you can force the shell by passing
|
||||
gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure
|
||||
script.
|
||||
|
||||
xzdiff (xzcmp/lzdiff/lzcmp) may use mktemp if it is available. As
|
||||
a fallback xzdiff will use mkdir to securely create a temporary
|
||||
directory. Having mktemp available is still recommended since the
|
||||
mkdir fallback method isn't as robust as mktemp is. The original
|
||||
mktemp can be found from <http://www.mktemp.org/>. On GNU, most will
|
||||
use the mktemp program from GNU coreutils instead of the original
|
||||
implementation. Both mktemp versions are fine.
|
||||
|
||||
In addition to using xz to decompress .xz files, xzgrep and xzdiff
|
||||
use gzip, bzip2, and lzop to support .gz, bz2, and .lzo files.
|
||||
|
||||
|
||||
3.2. PATH
|
||||
|
||||
The scripts assume that the required tools (standard POSIX utilities,
|
||||
mktemp, and xz) are in PATH; the scripts don't set the PATH themselves.
|
||||
Some people like this while some think this is a bug. Those in the
|
||||
latter group can easily patch the scripts before running the configure
|
||||
script by taking advantage of a placeholder line in the scripts.
|
||||
|
||||
For example, to make the scripts prefix /usr/bin:/bin to PATH:
|
||||
|
||||
perl -pi -e 's|^#SET_PATH.*$|PATH=/usr/bin:/bin:\$PATH|' \
|
||||
src/scripts/xz*.in
|
||||
|
||||
|
||||
4. Troubleshooting
|
||||
------------------
|
||||
|
||||
4.1. "No C99 compiler was found."
|
||||
|
||||
You need a C99 compiler to build XZ Utils. If the configure script
|
||||
cannot find a C99 compiler and you think you have such a compiler
|
||||
installed, set the compiler command by passing CC=/path/to/c99 as
|
||||
an argument to the configure script.
|
||||
|
||||
If you get this error even when you think your compiler supports C99,
|
||||
you can override the test by passing ac_cv_prog_cc_c99= as an argument
|
||||
to the configure script. The test for C99 compiler is not perfect (and
|
||||
it is not as easy to make it perfect as it sounds), so sometimes this
|
||||
may be needed. You will get a compile error if your compiler doesn't
|
||||
support enough C99.
|
||||
|
||||
|
||||
4.2. "No POSIX conforming shell (sh) was found."
|
||||
|
||||
xzgrep and other scripts need a shell that (roughly) conforms
|
||||
to POSIX. The configure script tries to find such a shell. If
|
||||
it fails, you can force the shell to be used by passing
|
||||
gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure
|
||||
script. Alternatively you can omit the installation of scripts and
|
||||
this error by passing --disable-scripts to configure.
|
||||
|
||||
|
||||
4.3. configure works but build fails at crc32_x86.S
|
||||
|
||||
The easy fix is to pass --disable-assembler to the configure script.
|
||||
|
||||
The configure script determines if assembler code can be used by
|
||||
looking at the configure triplet; there is currently no check if
|
||||
the assembler code can actually actually be built. The x86 assembler
|
||||
code should work on x86 GNU/Linux, *BSDs, Solaris, Darwin, MinGW,
|
||||
Cygwin, and DJGPP. On other x86 systems, there may be problems and
|
||||
the assembler code may need to be disabled with the configure option.
|
||||
|
||||
If you get this error when building for x86-64, you have specified or
|
||||
the configure script has misguessed your architecture. Pass the
|
||||
correct configure triplet using the --build=CPU-COMPANY-SYSTEM option
|
||||
(see INSTALL.generic).
|
||||
|
||||
|
||||
4.4. Lots of warnings about symbol visibility
|
||||
|
||||
On some systems where symbol visibility isn't supported, GCC may
|
||||
still accept the visibility options and attributes, which will make
|
||||
configure think that visibility is supported. This will result in
|
||||
many compiler warnings. You can avoid the warnings by forcing the
|
||||
visibility support off by passing gl_cv_cc_visibility=no as an
|
||||
argument to the configure script. This has no effect on the
|
||||
resulting binaries, but fewer warnings looks nicer and may allow
|
||||
using --enable-werror.
|
||||
|
||||
|
||||
4.5. "make check" fails
|
||||
|
||||
If the other tests pass but test_scripts.sh fails, then the problem
|
||||
is in the scripts in src/scripts. Comparing the contents of
|
||||
tests/xzgrep_test_output to tests/xzgrep_expected_output might
|
||||
give a good idea about problems in xzgrep. One possibility is that
|
||||
some tools are missing from the current PATH or the tools lack
|
||||
support for some POSIX features. This can happen at least on
|
||||
Solaris where the tools in /bin may be ancient but good enough
|
||||
tools are available in /usr/xpg4/bin or /usr/xpg6/bin. One fix
|
||||
for this problem is described in section 3.2 of this file.
|
||||
|
||||
If tests other than test_scripts.sh fail, a likely reason is that
|
||||
libtool links the test programs against an installed version of
|
||||
liblzma instead of the version that was just built. This is
|
||||
obviously a bug which seems to happen on some platforms.
|
||||
A workaround is to uninstall the old liblzma versions first.
|
||||
|
||||
If the problem isn't any of those described above, then it's likely
|
||||
a bug in XZ Utils or in the compiler. See the platform-specific
|
||||
notes in this file for possible known problems. Please report
|
||||
a bug if you cannot solve the problem. See README for contact
|
||||
information.
|
||||
|
||||
|
||||
4.6. liblzma.so (or similar) not found when running xz
|
||||
|
||||
If you installed the package with "make install" and get an error
|
||||
about liblzma.so (or a similarly named file) being missing, try
|
||||
running "ldconfig" to update the run-time linker cache (if your
|
||||
operating system has such a command).
|
||||
|
||||
365
INSTALL.generic
Normal file
365
INSTALL.generic
Normal file
@@ -0,0 +1,365 @@
|
||||
Installation Instructions
|
||||
*************************
|
||||
|
||||
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
|
||||
2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved. This file is offered as-is,
|
||||
without warranty of any kind.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
Briefly, the shell commands `./configure; make; make install' should
|
||||
configure, build, and install this package. The following
|
||||
more-detailed instructions are generic; see the `README' file for
|
||||
instructions specific to this package. Some packages provide this
|
||||
`INSTALL' file but do not implement all of the features documented
|
||||
below. The lack of an optional feature in a given package is not
|
||||
necessarily a bug. More recommendations for GNU packages can be found
|
||||
in *note Makefile Conventions: (standards)Makefile Conventions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file `config.log' containing compiler output (useful mainly for
|
||||
debugging `configure').
|
||||
|
||||
It can also use an optional file (typically called `config.cache'
|
||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||
the results of its tests to speed up reconfiguring. Caching is
|
||||
disabled by default to prevent problems with accidental use of stale
|
||||
cache files.
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point `config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file `configure.ac' (or `configure.in') is used to create
|
||||
`configure' by a program called `autoconf'. You need `configure.ac' if
|
||||
you want to change it or regenerate `configure' using a newer version
|
||||
of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system.
|
||||
|
||||
Running `configure' might take a while. While running, it prints
|
||||
some messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package, generally using the just-built uninstalled binaries.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation. When installing into a prefix owned by root, it is
|
||||
recommended that the package be configured and built as a regular
|
||||
user, and only the `make install' phase executed with root
|
||||
privileges.
|
||||
|
||||
5. Optionally, type `make installcheck' to repeat any self-tests, but
|
||||
this time using the binaries in their final installed location.
|
||||
This target does not install anything. Running this target as a
|
||||
regular user, particularly if the prior `make install' required
|
||||
root privileges, verifies that the installation completed
|
||||
correctly.
|
||||
|
||||
6. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
7. Often, you can also type `make uninstall' to remove the installed
|
||||
files again. In practice, not all packages have tested that
|
||||
uninstallation works correctly, even though it is required by the
|
||||
GNU Coding Standards.
|
||||
|
||||
8. Some packages, particularly those that use Automake, provide `make
|
||||
distcheck', which can by used by developers to test that all other
|
||||
targets like `make install' and `make uninstall' work correctly.
|
||||
This target is generally not run by end users.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. Run `./configure --help'
|
||||
for details on some of the pertinent environment variables.
|
||||
|
||||
You can give `configure' initial values for configuration parameters
|
||||
by setting variables in the command line or in the environment. Here
|
||||
is an example:
|
||||
|
||||
./configure CC=c99 CFLAGS=-g LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you can use GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'. This
|
||||
is known as a "VPATH" build.
|
||||
|
||||
With a non-GNU `make', it is safer to compile the package for one
|
||||
architecture at a time in the source code directory. After you have
|
||||
installed the package for one architecture, use `make distclean' before
|
||||
reconfiguring for another architecture.
|
||||
|
||||
On MacOS X 10.5 and later systems, you can create libraries and
|
||||
executables that work on multiple system types--known as "fat" or
|
||||
"universal" binaries--by specifying multiple `-arch' options to the
|
||||
compiler but only a single `-arch' option to the preprocessor. Like
|
||||
this:
|
||||
|
||||
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||
CPP="gcc -E" CXXCPP="g++ -E"
|
||||
|
||||
This is not guaranteed to produce working output in all cases, you
|
||||
may have to build one architecture at a time and combine the results
|
||||
using the `lipo' tool if you have problems.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' installs the package's commands under
|
||||
`/usr/local/bin', include files under `/usr/local/include', etc. You
|
||||
can specify an installation prefix other than `/usr/local' by giving
|
||||
`configure' the option `--prefix=PREFIX', where PREFIX must be an
|
||||
absolute file name.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
|
||||
PREFIX as the prefix for installing programs and libraries.
|
||||
Documentation and other data files still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=DIR' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them. In general, the
|
||||
default for these options is expressed in terms of `${prefix}', so that
|
||||
specifying just `--prefix' will affect all of the other directory
|
||||
specifications that were not explicitly provided.
|
||||
|
||||
The most portable way to affect installation locations is to pass the
|
||||
correct locations to `configure'; however, many packages provide one or
|
||||
both of the following shortcuts of passing variable assignments to the
|
||||
`make install' command line to change installation locations without
|
||||
having to reconfigure or recompile.
|
||||
|
||||
The first method involves providing an override variable for each
|
||||
affected directory. For example, `make install
|
||||
prefix=/alternate/directory' will choose an alternate location for all
|
||||
directory configuration variables that were expressed in terms of
|
||||
`${prefix}'. Any directories that were specified during `configure',
|
||||
but not in terms of `${prefix}', must each be overridden at install
|
||||
time for the entire installation to be relocated. The approach of
|
||||
makefile variable overrides for each directory variable is required by
|
||||
the GNU Coding Standards, and ideally causes no recompilation.
|
||||
However, some platforms have known limitations with the semantics of
|
||||
shared libraries that end up requiring recompilation when using this
|
||||
method, particularly noticeable in packages that use GNU Libtool.
|
||||
|
||||
The second method involves providing the `DESTDIR' variable. For
|
||||
example, `make install DESTDIR=/alternate/directory' will prepend
|
||||
`/alternate/directory' before all installation names. The approach of
|
||||
`DESTDIR' overrides is not required by the GNU Coding Standards, and
|
||||
does not work on platforms that have drive letters. On the other hand,
|
||||
it does better at avoiding recompilation issues, and works well even
|
||||
when some directory options were not specified in terms of `${prefix}'
|
||||
at `configure' time.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Some packages offer the ability to configure how verbose the
|
||||
execution of `make' will be. For these packages, running `./configure
|
||||
--enable-silent-rules' sets the default to minimal output, which can be
|
||||
overridden with `make V=1'; while running `./configure
|
||||
--disable-silent-rules' sets the default to verbose, which can be
|
||||
overridden with `make V=0'.
|
||||
|
||||
Particular systems
|
||||
==================
|
||||
|
||||
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
|
||||
CC is not installed, it is recommended to use the following options in
|
||||
order to use an ANSI C compiler:
|
||||
|
||||
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
|
||||
|
||||
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
|
||||
|
||||
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
|
||||
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
|
||||
a workaround. If GNU CC is not installed, it is therefore recommended
|
||||
to try
|
||||
|
||||
./configure CC="cc"
|
||||
|
||||
and if that doesn't work, try
|
||||
|
||||
./configure CC="cc -nodtk"
|
||||
|
||||
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
|
||||
directory contains several dysfunctional programs; working variants of
|
||||
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
|
||||
in your `PATH', put it _after_ `/usr/bin'.
|
||||
|
||||
On Haiku, software installed for all users goes in `/boot/common',
|
||||
not `/usr/local'. It is recommended to use the following options:
|
||||
|
||||
./configure --prefix=/boot/common
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' cannot figure out
|
||||
automatically, but needs to determine by the type of machine the package
|
||||
will run on. Usually, assuming the package is built to be run on the
|
||||
_same_ architectures, `configure' can figure that out, but if it prints
|
||||
a message saying it cannot guess the machine type, give it the
|
||||
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
OS
|
||||
KERNEL-OS
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the machine type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the option `--target=TYPE' to select the type of system they will
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the
|
||||
"host" platform (i.e., that on which the generated programs will
|
||||
eventually be run) with `--host=TYPE'.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Defining Variables
|
||||
==================
|
||||
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to `configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the `configure' command line, using `VAR=value'. For example:
|
||||
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
|
||||
causes the specified `gcc' to be used as the C compiler (unless it is
|
||||
overridden in the site shell script).
|
||||
|
||||
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
|
||||
an Autoconf bug. Until the bug is fixed you can use this workaround:
|
||||
|
||||
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||
|
||||
`configure' Invocation
|
||||
======================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--help'
|
||||
`-h'
|
||||
Print a summary of all of the options to `configure', and exit.
|
||||
|
||||
`--help=short'
|
||||
`--help=recursive'
|
||||
Print a summary of the options unique to this package's
|
||||
`configure', and exit. The `short' variant lists options used
|
||||
only in the top level, while the `recursive' variant lists options
|
||||
also present in any nested packages.
|
||||
|
||||
`--version'
|
||||
`-V'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||
disable caching.
|
||||
|
||||
`--config-cache'
|
||||
`-C'
|
||||
Alias for `--cache-file=config.cache'.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--prefix=DIR'
|
||||
Use DIR as the installation prefix. *note Installation Names::
|
||||
for more details, including other options available for fine-tuning
|
||||
the installation locations.
|
||||
|
||||
`--no-create'
|
||||
`-n'
|
||||
Run the configure checks, but stop before creating any output
|
||||
files.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
||||
|
||||
109
Makefile.am
Normal file
109
Makefile.am
Normal file
@@ -0,0 +1,109 @@
|
||||
##
|
||||
## Author: Lasse Collin
|
||||
##
|
||||
## This file has been put into the public domain.
|
||||
## You can do whatever you want with this file.
|
||||
##
|
||||
|
||||
# Use -n to prevent gzip from adding a timestamp to the .gz headers.
|
||||
GZIP_ENV = -9n
|
||||
|
||||
DIST_SUBDIRS = lib src po tests debug
|
||||
SUBDIRS =
|
||||
|
||||
if COND_GNULIB
|
||||
SUBDIRS += lib
|
||||
endif
|
||||
|
||||
SUBDIRS += src po tests
|
||||
|
||||
if COND_DOC
|
||||
dist_doc_DATA = \
|
||||
AUTHORS \
|
||||
COPYING \
|
||||
COPYING.GPLv2 \
|
||||
NEWS \
|
||||
README \
|
||||
THANKS \
|
||||
TODO \
|
||||
doc/faq.txt \
|
||||
doc/history.txt \
|
||||
doc/xz-file-format.txt \
|
||||
doc/lzma-file-format.txt
|
||||
|
||||
examplesdir = $(docdir)/examples
|
||||
dist_examples_DATA = \
|
||||
doc/examples/00_README.txt \
|
||||
doc/examples/01_compress_easy.c \
|
||||
doc/examples/02_decompress.c \
|
||||
doc/examples/03_compress_custom.c \
|
||||
doc/examples/04_compress_easy_mt.c \
|
||||
doc/examples/Makefile
|
||||
|
||||
examplesolddir = $(docdir)/examples_old
|
||||
dist_examplesold_DATA = \
|
||||
doc/examples_old/xz_pipe_comp.c \
|
||||
doc/examples_old/xz_pipe_decomp.c
|
||||
endif
|
||||
|
||||
EXTRA_DIST = \
|
||||
extra \
|
||||
dos \
|
||||
windows \
|
||||
macosx \
|
||||
autogen.sh \
|
||||
Doxyfile.in \
|
||||
COPYING.GPLv2 \
|
||||
COPYING.GPLv3 \
|
||||
COPYING.LGPLv2.1 \
|
||||
INSTALL.generic \
|
||||
PACKAGERS \
|
||||
build-aux/manconv.sh \
|
||||
build-aux/version.sh
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
# List of man pages to conver to PDF and plain text in the dist-hook target.
|
||||
manfiles = \
|
||||
src/xz/xz.1 \
|
||||
src/xzdec/xzdec.1 \
|
||||
src/lzmainfo/lzmainfo.1 \
|
||||
src/scripts/xzdiff.1 \
|
||||
src/scripts/xzgrep.1 \
|
||||
src/scripts/xzless.1 \
|
||||
src/scripts/xzmore.1
|
||||
|
||||
# Create ChangeLog from output of "git log --date=iso --stat".
|
||||
# Convert the man pages to PDF and plain text (ASCII only) formats.
|
||||
dist-hook:
|
||||
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
|
||||
( cd "$(srcdir)" && git log --date=iso --stat ) \
|
||||
> "$(distdir)/ChangeLog"; \
|
||||
fi
|
||||
if type groff > /dev/null 2>&1 && type ps2pdf > /dev/null 2>&1; then \
|
||||
dest="$(distdir)/doc/man" && \
|
||||
$(MKDIR_P) "$$dest/pdf-a4" "$$dest/pdf-letter" "$$dest/txt" && \
|
||||
for FILE in $(manfiles); do \
|
||||
BASE=`basename $$FILE .1` && \
|
||||
sh "$(srcdir)/build-aux/manconv.sh" pdf a4 \
|
||||
< "$(srcdir)/$$FILE" \
|
||||
> "$$dest/pdf-a4/$$BASE-a4.pdf" && \
|
||||
sh "$(srcdir)/build-aux/manconv.sh" pdf letter \
|
||||
< "$(srcdir)/$$FILE" \
|
||||
> "$$dest/pdf-letter/$$BASE-letter.pdf" && \
|
||||
sh "$(srcdir)/build-aux/manconv.sh" ascii \
|
||||
< "$(srcdir)/$$FILE" \
|
||||
> "$$dest/txt/$$BASE.txt"; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
# This works with GNU tar and gives cleaner package than normal 'make dist'.
|
||||
mydist:
|
||||
sh "$(srcdir)/src/liblzma/validate_map.sh"
|
||||
VERSION=$(VERSION); \
|
||||
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
|
||||
SNAPSHOT=`cd "$(srcdir)" && git describe --abbrev=4 | cut -b2-`; \
|
||||
test -n "$$SNAPSHOT" && VERSION=$$SNAPSHOT; \
|
||||
fi; \
|
||||
TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \
|
||||
$(MAKE) VERSION="$$VERSION" dist-gzip
|
||||
1079
Makefile.in
Normal file
1079
Makefile.in
Normal file
File diff suppressed because it is too large
Load Diff
505
NEWS
Normal file
505
NEWS
Normal file
@@ -0,0 +1,505 @@
|
||||
|
||||
XZ Utils Release Notes
|
||||
======================
|
||||
|
||||
5.2.2 (2015-09-29)
|
||||
|
||||
* Fixed bugs in QNX-specific code.
|
||||
|
||||
* Omitted the use of pipe2() even if it is available to avoid
|
||||
portability issues with some old Linux and glibc combinations.
|
||||
|
||||
* Updated German translation.
|
||||
|
||||
* Added project files to build static and shared liblzma (not the
|
||||
whole XZ Utils) with Visual Studio 2013 update 2 or later.
|
||||
|
||||
* Documented that threaded decompression hasn't been implemented
|
||||
yet. A 5.2.0 NEWS entry describing multi-threading support had
|
||||
incorrectly said "decompression" when it should have said
|
||||
"compression".
|
||||
|
||||
|
||||
5.2.1 (2015-02-26)
|
||||
|
||||
* Fixed a compression-ratio regression in fast mode of LZMA1 and
|
||||
LZMA2. The bug is present in 5.1.4beta and 5.2.0 releases.
|
||||
|
||||
* Fixed a portability problem in xz that affected at least OpenBSD.
|
||||
|
||||
* Fixed xzdiff to be compatible with FreeBSD's mktemp which differs
|
||||
from most other mktemp implementations.
|
||||
|
||||
* Changed CPU core count detection to use cpuset_getaffinity() on
|
||||
FreeBSD.
|
||||
|
||||
|
||||
5.2.0 (2014-12-21)
|
||||
|
||||
Since 5.1.4beta:
|
||||
|
||||
* All fixes from 5.0.8
|
||||
|
||||
* liblzma: Fixed lzma_stream_encoder_mt_memusage() when a preset
|
||||
was used.
|
||||
|
||||
* xzdiff: If mktemp isn't installed, mkdir will be used as
|
||||
a fallback to create a temporary directory. Installing mktemp
|
||||
is still recommended.
|
||||
|
||||
* Updated French, German, Italian, Polish, and Vietnamese
|
||||
translations.
|
||||
|
||||
Summary of fixes and new features added in the 5.1.x development
|
||||
releases:
|
||||
|
||||
* liblzma:
|
||||
|
||||
- Added support for multi-threaded compression. See the
|
||||
lzma_mt structure, lzma_stream_encoder_mt(), and
|
||||
lzma_stream_encoder_mt_memusage() in <lzma/container.h>,
|
||||
lzma_get_progress() in <lzma/base.h>, and lzma_cputhreads()
|
||||
in <lzma/hardware.h> for details.
|
||||
|
||||
- Made the uses of lzma_allocator const correct.
|
||||
|
||||
- Added lzma_block_uncomp_encode() to create uncompressed
|
||||
.xz Blocks using LZMA2 uncompressed chunks.
|
||||
|
||||
- Added support for LZMA_IGNORE_CHECK.
|
||||
|
||||
- A few speed optimizations were made.
|
||||
|
||||
- Added support for symbol versioning. It is enabled by default
|
||||
on GNU/Linux, other GNU-based systems, and FreeBSD.
|
||||
|
||||
- liblzma (not the whole XZ Utils) should now be buildable
|
||||
with MSVC 2013 update 2 or later using windows/config.h.
|
||||
|
||||
* xz:
|
||||
|
||||
- Fixed a race condition in the signal handling. It was
|
||||
possible that e.g. the first SIGINT didn't make xz exit
|
||||
if reading or writing blocked and one had bad luck. The fix
|
||||
is non-trivial, so as of writing it is unknown if it will be
|
||||
backported to the v5.0 branch.
|
||||
|
||||
- Multi-threaded compression can be enabled with the
|
||||
--threads (-T) option.
|
||||
[Fixed: This originally said "decompression".]
|
||||
|
||||
- New command line options in xz: --single-stream,
|
||||
--block-size=SIZE, --block-list=SIZES,
|
||||
--flush-timeout=TIMEOUT, and --ignore-check.
|
||||
|
||||
- xz -lvv now shows the minimum xz version that is required to
|
||||
decompress the file. Currently it is 5.0.0 for all supported
|
||||
.xz files except files with empty LZMA2 streams require 5.0.2.
|
||||
|
||||
* xzdiff and xzgrep now support .lzo files if lzop is installed.
|
||||
The .tzo suffix is also recognized as a shorthand for .tar.lzo.
|
||||
|
||||
|
||||
5.1.4beta (2014-09-14)
|
||||
|
||||
* All fixes from 5.0.6
|
||||
|
||||
* liblzma: Fixed the use of presets in threaded encoder
|
||||
initialization.
|
||||
|
||||
* xz --block-list and --block-size can now be used together
|
||||
in single-threaded mode. Previously the combination only
|
||||
worked in multi-threaded mode.
|
||||
|
||||
* Added support for LZMA_IGNORE_CHECK to liblzma and made it
|
||||
available in xz as --ignore-check.
|
||||
|
||||
* liblzma speed optimizations:
|
||||
|
||||
- Initialization of a new LZMA1 or LZMA2 encoder has been
|
||||
optimized. (The speed of reinitializing an already-allocated
|
||||
encoder isn't affected.) This helps when compressing many
|
||||
small buffers with lzma_stream_buffer_encode() and other
|
||||
similar situations where an already-allocated encoder state
|
||||
isn't reused. This speed-up is visible in xz too if one
|
||||
compresses many small files one at a time instead running xz
|
||||
once and giving all files as command-line arguments.
|
||||
|
||||
- Buffer comparisons are now much faster when unaligned access
|
||||
is allowed (configured with --enable-unaligned-access). This
|
||||
speeds up encoding significantly. There is arch-specific code
|
||||
for 32-bit and 64-bit x86 (32-bit needs SSE2 for the best
|
||||
results and there's no run-time CPU detection for now).
|
||||
For other archs there is only generic code which probably
|
||||
isn't as optimal as arch-specific solutions could be.
|
||||
|
||||
- A few speed optimizations were made to the SHA-256 code.
|
||||
(Note that the builtin SHA-256 code isn't used on all
|
||||
operating systems.)
|
||||
|
||||
* liblzma can now be built with MSVC 2013 update 2 or later
|
||||
using windows/config.h.
|
||||
|
||||
* Vietnamese translation was added.
|
||||
|
||||
|
||||
5.1.3alpha (2013-10-26)
|
||||
|
||||
* All fixes from 5.0.5
|
||||
|
||||
* liblzma:
|
||||
|
||||
- Fixed a deadlock in the threaded encoder.
|
||||
|
||||
- Made the uses of lzma_allocator const correct.
|
||||
|
||||
- Added lzma_block_uncomp_encode() to create uncompressed
|
||||
.xz Blocks using LZMA2 uncompressed chunks.
|
||||
|
||||
- Added support for native threads on Windows and the ability
|
||||
to detect the number of CPU cores.
|
||||
|
||||
* xz:
|
||||
|
||||
- Fixed a race condition in the signal handling. It was
|
||||
possible that e.g. the first SIGINT didn't make xz exit
|
||||
if reading or writing blocked and one had bad luck. The fix
|
||||
is non-trivial, so as of writing it is unknown if it will be
|
||||
backported to the v5.0 branch.
|
||||
|
||||
- Made the progress indicator work correctly in threaded mode.
|
||||
|
||||
- Threaded encoder now works together with --block-list=SIZES.
|
||||
|
||||
- Added preliminary support for --flush-timeout=TIMEOUT.
|
||||
It can be useful for (somewhat) real-time streaming. For
|
||||
now the decompression side has to be done with something
|
||||
else than the xz tool due to how xz does buffering, but this
|
||||
should be fixed.
|
||||
|
||||
|
||||
5.1.2alpha (2012-07-04)
|
||||
|
||||
* All fixes from 5.0.3 and 5.0.4
|
||||
|
||||
* liblzma:
|
||||
|
||||
- Fixed a deadlock and an invalid free() in the threaded encoder.
|
||||
|
||||
- Added support for symbol versioning. It is enabled by default
|
||||
on GNU/Linux, other GNU-based systems, and FreeBSD.
|
||||
|
||||
- Use SHA-256 implementation from the operating system if one is
|
||||
available in libc, libmd, or libutil. liblzma won't use e.g.
|
||||
OpenSSL or libgcrypt to avoid introducing new dependencies.
|
||||
|
||||
- Fixed liblzma.pc for static linking.
|
||||
|
||||
- Fixed a few portability bugs.
|
||||
|
||||
* xz --decompress --single-stream now fixes the input position after
|
||||
successful decompression. Now the following works:
|
||||
|
||||
echo foo | xz > foo.xz
|
||||
echo bar | xz >> foo.xz
|
||||
( xz -dc --single-stream ; xz -dc --single-stream ) < foo.xz
|
||||
|
||||
Note that it doesn't work if the input is not seekable
|
||||
or if there is Stream Padding between the concatenated
|
||||
.xz Streams.
|
||||
|
||||
* xz -lvv now shows the minimum xz version that is required to
|
||||
decompress the file. Currently it is 5.0.0 for all supported .xz
|
||||
files except files with empty LZMA2 streams require 5.0.2.
|
||||
|
||||
* Added an *incomplete* implementation of --block-list=SIZES to xz.
|
||||
It only works correctly in single-threaded mode and when
|
||||
--block-size isn't used at the same time. --block-list allows
|
||||
specifying the sizes of Blocks which can be useful e.g. when
|
||||
creating files for random-access reading.
|
||||
|
||||
|
||||
5.1.1alpha (2011-04-12)
|
||||
|
||||
* All fixes from 5.0.2
|
||||
|
||||
* liblzma fixes that will also be included in 5.0.3:
|
||||
|
||||
- A memory leak was fixed.
|
||||
|
||||
- lzma_stream_buffer_encode() no longer creates an empty .xz
|
||||
Block if encoding an empty buffer. Such an empty Block with
|
||||
LZMA2 data would trigger a bug in 5.0.1 and older (see the
|
||||
first bullet point in 5.0.2 notes). When releasing 5.0.2,
|
||||
I thought that no encoder creates this kind of files but
|
||||
I was wrong.
|
||||
|
||||
- Validate function arguments better in a few functions. Most
|
||||
importantly, specifying an unsupported integrity check to
|
||||
lzma_stream_buffer_encode() no longer creates a corrupt .xz
|
||||
file. Probably no application tries to do that, so this
|
||||
shouldn't be a big problem in practice.
|
||||
|
||||
- Document that lzma_block_buffer_encode(),
|
||||
lzma_easy_buffer_encode(), lzma_stream_encoder(), and
|
||||
lzma_stream_buffer_encode() may return LZMA_UNSUPPORTED_CHECK.
|
||||
|
||||
- The return values of the _memusage() functions are now
|
||||
documented better.
|
||||
|
||||
* Support for multithreaded compression was added using the simplest
|
||||
method, which splits the input data into blocks and compresses
|
||||
them independently. Other methods will be added in the future.
|
||||
The current method has room for improvement, e.g. it is possible
|
||||
to reduce the memory usage.
|
||||
|
||||
* Added the options --single-stream and --block-size=SIZE to xz.
|
||||
|
||||
* xzdiff and xzgrep now support .lzo files if lzop is installed.
|
||||
The .tzo suffix is also recognized as a shorthand for .tar.lzo.
|
||||
|
||||
* Support for short 8.3 filenames under DOS was added to xz. It is
|
||||
experimental and may change before it gets into a stable release.
|
||||
|
||||
|
||||
5.0.8 (2014-12-21)
|
||||
|
||||
* Fixed an old bug in xzgrep that affected OpenBSD and probably
|
||||
a few other operating systems too.
|
||||
|
||||
* Updated French and German translations.
|
||||
|
||||
* Added support for detecting the amount of RAM on AmigaOS/AROS.
|
||||
|
||||
* Minor build system updates.
|
||||
|
||||
|
||||
5.0.7 (2014-09-20)
|
||||
|
||||
* Fix regressions introduced in 5.0.6:
|
||||
|
||||
- Fix building with non-GNU make.
|
||||
|
||||
- Fix invalid Libs.private value in liblzma.pc which broke
|
||||
static linking against liblzma if the linker flags were
|
||||
taken from pkg-config.
|
||||
|
||||
|
||||
5.0.6 (2014-09-14)
|
||||
|
||||
* xzgrep now exits with status 0 if at least one file matched.
|
||||
|
||||
* A few minor portability and build system fixes
|
||||
|
||||
|
||||
5.0.5 (2013-06-30)
|
||||
|
||||
* lzmadec and liblzma's lzma_alone_decoder(): Support decompressing
|
||||
.lzma files that have less common settings in the headers
|
||||
(dictionary size other than 2^n or 2^n + 2^(n-1), or uncompressed
|
||||
size greater than 256 GiB). The limitations existed to avoid false
|
||||
positives when detecting .lzma files. The lc + lp <= 4 limitation
|
||||
still remains since liblzma's LZMA decoder has that limitation.
|
||||
|
||||
NOTE: xz's .lzma support or liblzma's lzma_auto_decoder() are NOT
|
||||
affected by this change. They still consider uncommon .lzma headers
|
||||
as not being in the .lzma format. Changing this would give way too
|
||||
many false positives.
|
||||
|
||||
* xz:
|
||||
|
||||
- Interaction of preset and custom filter chain options was
|
||||
made less illogical. This affects only certain less typical
|
||||
uses cases so few people are expected to notice this change.
|
||||
|
||||
Now when a custom filter chain option (e.g. --lzma2) is
|
||||
specified, all preset options (-0 ... -9, -e) earlier are on
|
||||
the command line are completely forgotten. Similarly, when
|
||||
a preset option is specified, all custom filter chain options
|
||||
earlier on the command line are completely forgotten.
|
||||
|
||||
Example 1: "xz -9 --lzma2=preset=5 -e" is equivalent to "xz -e"
|
||||
which is equivalent to "xz -6e". Earlier -e didn't put xz back
|
||||
into preset mode and thus the example command was equivalent
|
||||
to "xz --lzma2=preset=5".
|
||||
|
||||
Example 2: "xz -9e --lzma2=preset=5 -7" is equivalent to
|
||||
"xz -7". Earlier a custom filter chain option didn't make
|
||||
xz forget the -e option so the example was equivalent to
|
||||
"xz -7e".
|
||||
|
||||
- Fixes and improvements to error handling.
|
||||
|
||||
- Various fixes to the man page.
|
||||
|
||||
* xzless: Fixed to work with "less" versions 448 and later.
|
||||
|
||||
* xzgrep: Made -h an alias for --no-filename.
|
||||
|
||||
* Include the previously missing debug/translation.bash which can
|
||||
be useful for translators.
|
||||
|
||||
* Include a build script for Mac OS X. This has been in the Git
|
||||
repository since 2010 but due to a mistake in Makefile.am the
|
||||
script hasn't been included in a release tarball before.
|
||||
|
||||
|
||||
5.0.4 (2012-06-22)
|
||||
|
||||
* liblzma:
|
||||
|
||||
- Fix lzma_index_init(). It could crash if memory allocation
|
||||
failed.
|
||||
|
||||
- Fix the possibility of an incorrect LZMA_BUF_ERROR when a BCJ
|
||||
filter is used and the application only provides exactly as
|
||||
much output space as is the uncompressed size of the file.
|
||||
|
||||
- Fix a bug in doc/examples_old/xz_pipe_decompress.c. It didn't
|
||||
check if the last call to lzma_code() really returned
|
||||
LZMA_STREAM_END, which made the program think that truncated
|
||||
files are valid.
|
||||
|
||||
- New example programs in doc/examples (old programs are now in
|
||||
doc/examples_old). These have more comments and more detailed
|
||||
error handling.
|
||||
|
||||
* Fix "xz -lvv foo.xz". It could crash on some corrupted files.
|
||||
|
||||
* Fix output of "xz --robot -lv" and "xz --robot -lvv" which
|
||||
incorrectly printed the filename also in the "foo (x/x)" format.
|
||||
|
||||
* Fix exit status of "xzdiff foo.xz bar.xz".
|
||||
|
||||
* Fix exit status of "xzgrep foo binary_file".
|
||||
|
||||
* Fix portability to EBCDIC systems.
|
||||
|
||||
* Fix a configure issue on AIX with the XL C compiler. See INSTALL
|
||||
for details.
|
||||
|
||||
* Update French, German, Italian, and Polish translations.
|
||||
|
||||
|
||||
5.0.3 (2011-05-21)
|
||||
|
||||
* liblzma fixes:
|
||||
|
||||
- A memory leak was fixed.
|
||||
|
||||
- lzma_stream_buffer_encode() no longer creates an empty .xz
|
||||
Block if encoding an empty buffer. Such an empty Block with
|
||||
LZMA2 data would trigger a bug in 5.0.1 and older (see the
|
||||
first bullet point in 5.0.2 notes). When releasing 5.0.2,
|
||||
I thought that no encoder creates this kind of files but
|
||||
I was wrong.
|
||||
|
||||
- Validate function arguments better in a few functions. Most
|
||||
importantly, specifying an unsupported integrity check to
|
||||
lzma_stream_buffer_encode() no longer creates a corrupt .xz
|
||||
file. Probably no application tries to do that, so this
|
||||
shouldn't be a big problem in practice.
|
||||
|
||||
- Document that lzma_block_buffer_encode(),
|
||||
lzma_easy_buffer_encode(), lzma_stream_encoder(), and
|
||||
lzma_stream_buffer_encode() may return LZMA_UNSUPPORTED_CHECK.
|
||||
|
||||
- The return values of the _memusage() functions are now
|
||||
documented better.
|
||||
|
||||
* Fix command name detection in xzgrep. xzegrep and xzfgrep now
|
||||
correctly use egrep and fgrep instead of grep.
|
||||
|
||||
* French translation was added.
|
||||
|
||||
|
||||
5.0.2 (2011-04-01)
|
||||
|
||||
* LZMA2 decompressor now correctly accepts LZMA2 streams with no
|
||||
uncompressed data. Previously it considered them corrupt. The
|
||||
bug can affect applications that use raw LZMA2 streams. It is
|
||||
very unlikely to affect .xz files because no compressor creates
|
||||
.xz files with empty LZMA2 streams. (Empty .xz files are a
|
||||
different thing than empty LZMA2 streams.)
|
||||
|
||||
* "xz --suffix=.foo filename.foo" now refuses to compress the
|
||||
file due to it already having the suffix .foo. It was already
|
||||
documented on the man page, but the code lacked the test.
|
||||
|
||||
* "xzgrep -l foo bar.xz" works now.
|
||||
|
||||
* Polish translation was added.
|
||||
|
||||
|
||||
5.0.1 (2011-01-29)
|
||||
|
||||
* xz --force now (de)compresses files that have setuid, setgid,
|
||||
or sticky bit set and files that have multiple hard links.
|
||||
The man page had it documented this way already, but the code
|
||||
had a bug.
|
||||
|
||||
* gzip and bzip2 support in xzdiff was fixed.
|
||||
|
||||
* Portability fixes
|
||||
|
||||
* Minor fix to Czech translation
|
||||
|
||||
|
||||
5.0.0 (2010-10-23)
|
||||
|
||||
Only the most important changes compared to 4.999.9beta are listed
|
||||
here. One change is especially important:
|
||||
|
||||
* The memory usage limit is now disabled by default. Some scripts
|
||||
written before this change may have used --memory=max on xz command
|
||||
line or in XZ_OPT. THESE USES OF --memory=max SHOULD BE REMOVED
|
||||
NOW, because they interfere with user's ability to set the memory
|
||||
usage limit himself. If user-specified limit causes problems to
|
||||
your script, blame the user.
|
||||
|
||||
Other significant changes:
|
||||
|
||||
* Added support for XZ_DEFAULTS environment variable. This variable
|
||||
allows users to set default options for xz, e.g. default memory
|
||||
usage limit or default compression level. Scripts that use xz
|
||||
must never set or unset XZ_DEFAULTS. Scripts should use XZ_OPT
|
||||
instead if they need a way to pass options to xz via an
|
||||
environment variable.
|
||||
|
||||
* The compression settings associated with the preset levels
|
||||
-0 ... -9 have been changed. --extreme was changed a little too.
|
||||
It is now less likely to make compression worse, but with some
|
||||
files the new --extreme may compress slightly worse than the old
|
||||
--extreme.
|
||||
|
||||
* If a preset level (-0 ... -9) is specified after a custom filter
|
||||
chain options have been used (e.g. --lzma2), the custom filter
|
||||
chain will be forgotten. Earlier the preset options were
|
||||
completely ignored after custom filter chain options had been
|
||||
seen.
|
||||
|
||||
* xz will create sparse files when decompressing if the uncompressed
|
||||
data contains long sequences of binary zeros. This is done even
|
||||
when writing to standard output that is connected to a regular
|
||||
file and certain additional conditions are met to make it safe.
|
||||
|
||||
* Support for "xz --list" was added. Combine with --verbose or
|
||||
--verbose --verbose (-vv) for detailed output.
|
||||
|
||||
* I had hoped that liblzma API would have been stable after
|
||||
4.999.9beta, but there have been a couple of changes in the
|
||||
advanced features, which don't affect most applications:
|
||||
|
||||
- Index handling code was revised. If you were using the old
|
||||
API, you will get a compiler error (so it's easy to notice).
|
||||
|
||||
- A subtle but important change was made to the Block handling
|
||||
API. lzma_block.version has to be initialized even for
|
||||
lzma_block_header_decode(). Code that doesn't do it will work
|
||||
for now, but might break in the future, which makes this API
|
||||
change easy to miss.
|
||||
|
||||
* The major soname has been bumped to 5.0.0. liblzma API and ABI
|
||||
are now stable, so the need to recompile programs linking against
|
||||
liblzma shouldn't arise soon.
|
||||
|
||||
231
PACKAGERS
Normal file
231
PACKAGERS
Normal file
@@ -0,0 +1,231 @@
|
||||
|
||||
Information to packagers of XZ Utils
|
||||
====================================
|
||||
|
||||
0. Preface
|
||||
1. Package naming
|
||||
2. Package description
|
||||
3. License
|
||||
4. configure options
|
||||
5. Additional documentation
|
||||
6. Extra files
|
||||
7. Installing XZ Utils and LZMA Utils in parallel
|
||||
8. Example
|
||||
|
||||
|
||||
0. Preface
|
||||
----------
|
||||
|
||||
This document is meant for people who create and maintain XZ Utils
|
||||
packages for operating system distributions. The focus is on GNU/Linux
|
||||
systems, but most things apply to other systems too.
|
||||
|
||||
While the standard "configure && make DESTDIR=$PKG install" should
|
||||
give a pretty good package, there are some details which packagers
|
||||
may want to tweak.
|
||||
|
||||
Packagers should also read the INSTALL file.
|
||||
|
||||
|
||||
1. Package naming
|
||||
-----------------
|
||||
|
||||
The preferred name for the XZ Utils package is "xz", because that's
|
||||
the name of the upstream tarball. Naturally you may have good reasons
|
||||
to use some other name; I won't get angry about it. ;-) It's just nice
|
||||
to be able to point people to the correct package name without asking
|
||||
what distro they have.
|
||||
|
||||
If your distro policy is to split things into small pieces, here is
|
||||
one suggestion:
|
||||
|
||||
xz xz, xzdec, scripts (xzdiff, xzgrep, etc.), docs
|
||||
xz-lzma lzma, unlzma, lzcat, lzgrep etc. symlinks and
|
||||
lzmadec binary for compatibility with LZMA Utils
|
||||
liblzma liblzma.so.*
|
||||
liblzma-devel liblzma.so, liblzma.a, API headers
|
||||
|
||||
|
||||
2. Package description
|
||||
----------------------
|
||||
|
||||
Here is a suggestion which you may use as the package description.
|
||||
If you can use only one-line description, pick only the first line.
|
||||
Naturally, feel free to use some other description if you find it
|
||||
better, and maybe send it to me too.
|
||||
|
||||
Library and command line tools for XZ and LZMA compressed files
|
||||
|
||||
XZ Utils provide a general purpose data compression library
|
||||
and command line tools. The native file format is the .xz
|
||||
format, but also the legacy .lzma format is supported. The .xz
|
||||
format supports multiple compression algorithms, of which LZMA2
|
||||
is currently the primary algorithm. With typical files, XZ Utils
|
||||
create about 30 % smaller files than gzip.
|
||||
|
||||
If you are splitting XZ Utils into multiple packages, here are some
|
||||
suggestions for package descriptions:
|
||||
|
||||
xz:
|
||||
|
||||
Command line tools for XZ and LZMA compressed files
|
||||
|
||||
This package includes the xz compression tool and other command
|
||||
line tools from XZ Utils. xz has command line syntax similar to
|
||||
that of gzip. The native file format is the .xz format, but also
|
||||
the legacy .lzma format is supported. The .xz format supports
|
||||
multiple compression algorithms, of which LZMA2 is currently the
|
||||
primary algorithm. With typical files, XZ Utils create about 30 %
|
||||
smaller files than gzip.
|
||||
|
||||
Note that this package doesn't include the files needed for
|
||||
LZMA Utils 4.32.x compatibility. Install also the xz-lzma
|
||||
package to make XZ Utils emulate LZMA Utils 4.32.x.
|
||||
|
||||
xz-lzma:
|
||||
|
||||
LZMA Utils emulation with XZ Utils
|
||||
|
||||
This package includes executables and symlinks to make
|
||||
XZ Utils emulate lzma, unlzma, lzcat, and other command
|
||||
line tools found from the legacy LZMA Utils 4.32.x package.
|
||||
|
||||
liblzma:
|
||||
|
||||
Library for XZ and LZMA compressed files
|
||||
|
||||
liblzma is a general purpose data compression library with
|
||||
an API similar to that of zlib. liblzma supports multiple
|
||||
algorithms, of which LZMA2 is currently the primary algorithm.
|
||||
The native file format is .xz, but also the legacy .lzma
|
||||
format and raw streams (no headers at all) are supported.
|
||||
|
||||
This package includes the shared library.
|
||||
|
||||
liblzma-devel:
|
||||
|
||||
Library for XZ and LZMA compressed files
|
||||
|
||||
This package includes the API headers, static library, and
|
||||
other development files related to liblzma.
|
||||
|
||||
|
||||
3. License
|
||||
----------
|
||||
|
||||
If the package manager supports a license field, you probably should
|
||||
put GPLv2+ there (GNU GPL v2 or later). The interesting parts of
|
||||
XZ Utils are in the public domain, but some less important files
|
||||
ending up into the binary package are under GPLv2+. So it is simplest
|
||||
to just say GPLv2+ if you cannot specify "public domain and GPLv2+".
|
||||
|
||||
If you split XZ Utils into multiple packages as described earlier
|
||||
in this file, liblzma and liblzma-dev packages will contain only
|
||||
public domain code (from XZ Utils at least; compiler or linker may
|
||||
add some third-party code, which may be copyrighted).
|
||||
|
||||
|
||||
4. configure options
|
||||
--------------------
|
||||
|
||||
Unless you are building a package for a distribution that is meant
|
||||
only for embedded systems, don't use the following configure options:
|
||||
|
||||
--enable-debug
|
||||
--enable-encoders (*)
|
||||
--enable-decoders
|
||||
--enable-match-finders
|
||||
--enable-checks
|
||||
--enable-small (*)
|
||||
--disable-threads (*)
|
||||
|
||||
(*) These are OK when building xzdec and lzmadec as described
|
||||
in INSTALL.
|
||||
|
||||
xzdec and lzmadec don't provide any functionality that isn't already
|
||||
available in the xz tool. Shipping xzdec and lzmadec without size
|
||||
optimization and statically-linked liblzma isn't very useful. Doing
|
||||
that would give users the xzdec man page, which may make it easier
|
||||
for people to find out that such tools exists, but the executables
|
||||
wouldn't have any advantage over the full-featured xz.
|
||||
|
||||
|
||||
5. Additional documentation
|
||||
---------------------------
|
||||
|
||||
"make install" copies some additional documentation to $docdir
|
||||
(--docdir in configure). There is a copy of the GNU GPL v2, which
|
||||
can be replaced with a symlink if your distro ships with shared
|
||||
copies of the common license texts.
|
||||
|
||||
liblzma API is currently only documented using Doxygen tags in the
|
||||
API headers. It hasn't been tested much how good results Doxygen
|
||||
is able to make from the tags (e.g. Doxyfile might need tweaking,
|
||||
the tagging may need to be improved etc.), so it might be simpler
|
||||
to just let people read docs directly from the .h files for now,
|
||||
and also save quite a bit in package size at the same time.
|
||||
|
||||
|
||||
6. Extra files
|
||||
--------------
|
||||
|
||||
The "extra" directory contains some small extra tools or other files.
|
||||
The exact set of extra files can vary between XZ Utils releases. The
|
||||
extra files have only limited use or they are too dangerous to be
|
||||
put directly to $bindir (7z2lzma.sh is a good example, since it can
|
||||
silently create corrupt output if certain conditions are not met).
|
||||
|
||||
If you feel like it, you may copy the extra directory under the doc
|
||||
directory (e.g. /usr/share/doc/xz/extra). Maybe some people will find
|
||||
them useful. However, most people needing these tools probably are
|
||||
able to find them from the source package too.
|
||||
|
||||
The "debug" directory contains some tools that are useful only when
|
||||
hacking on XZ Utils. Don't package these tools.
|
||||
|
||||
|
||||
7. Installing XZ Utils and LZMA Utils in parallel
|
||||
-------------------------------------------------
|
||||
|
||||
XZ Utils and LZMA Utils 4.32.x can be installed in parallel by
|
||||
omitting the compatibility symlinks (lzma, unlzma, lzcat, lzgrep etc.)
|
||||
from the XZ Utils package. It's probably a good idea to still package
|
||||
the symlinks into a separate package so that users may choose if they
|
||||
want to use XZ Utils or LZMA Utils for handling .lzma files.
|
||||
|
||||
|
||||
8. Example
|
||||
----------
|
||||
|
||||
Here is an example for i686 GNU/Linux that
|
||||
- links xz and lzmainfo against shared liblzma;
|
||||
- links size-optimized xzdec and lzmadec against static liblzma
|
||||
while avoiding libpthread dependency;
|
||||
- includes only shared liblzma in the final package; and
|
||||
- copies also the "extra" directory to the package.
|
||||
|
||||
PKG=/tmp/xz-pkg
|
||||
tar xf xz-x.y.z.tar.gz
|
||||
cd xz-x.y.z
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--disable-static \
|
||||
--disable-xzdec \
|
||||
--disable-lzmadec \
|
||||
CFLAGS='-march=i686 -mtune=generic -O2'
|
||||
make
|
||||
make DESTDIR=$PKG install-strip
|
||||
make clean
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--disable-shared \
|
||||
--disable-nls \
|
||||
--disable-encoders \
|
||||
--enable-small \
|
||||
--disable-threads \
|
||||
CFLAGS='-march=i686 -mtune=generic -Os'
|
||||
make -C src/liblzma
|
||||
make -C src/xzdec
|
||||
make -C src/xzdec DESTDIR=$PKG install-strip
|
||||
cp -a extra $PKG/usr/share/doc/xz
|
||||
|
||||
323
README
323
README
@@ -1,41 +1,308 @@
|
||||
README: Tk
|
||||
This is the Tk 8.6.6 source distribution.
|
||||
http://sourceforge.net/projects/tcl/files/Tcl/
|
||||
You can get any source release of Tk from the URL above.
|
||||
|
||||
1. Introduction
|
||||
---------------
|
||||
XZ Utils
|
||||
========
|
||||
|
||||
This directory contains the sources and documentation for Tk, an X11
|
||||
toolkit implemented with the Tcl scripting language.
|
||||
0. Overview
|
||||
1. Documentation
|
||||
1.1. Overall documentation
|
||||
1.2. Documentation for command-line tools
|
||||
1.3. Documentation for liblzma
|
||||
2. Version numbering
|
||||
3. Reporting bugs
|
||||
4. Translating the xz tool
|
||||
5. Other implementations of the .xz format
|
||||
6. Contact information
|
||||
|
||||
For details on features, incompatibilities, and potential problems with
|
||||
this release, see the Tcl/Tk 8.6 Web page at
|
||||
|
||||
http://www.tcl.tk/software/tcltk/8.6.html
|
||||
0. Overview
|
||||
-----------
|
||||
|
||||
or refer to the "changes" file in this directory, which contains a
|
||||
historical record of all changes to Tk.
|
||||
XZ Utils provide a general-purpose data-compression library plus
|
||||
command-line tools. The native file format is the .xz format, but
|
||||
also the legacy .lzma format is supported. The .xz format supports
|
||||
multiple compression algorithms, which are called "filters" in the
|
||||
context of XZ Utils. The primary filter is currently LZMA2. With
|
||||
typical files, XZ Utils create about 30 % smaller files than gzip.
|
||||
|
||||
Tk is maintained, enhanced, and distributed freely by the Tcl community.
|
||||
Source code development and tracking of bug reports and feature requests
|
||||
takes place at:
|
||||
To ease adapting support for the .xz format into existing applications
|
||||
and scripts, the API of liblzma is somewhat similar to the API of the
|
||||
popular zlib library. For the same reason, the command-line tool xz
|
||||
has a command-line syntax similar to that of gzip.
|
||||
|
||||
http://core.tcl.tk/tk/
|
||||
When aiming for the highest compression ratio, the LZMA2 encoder uses
|
||||
a lot of CPU time and may use, depending on the settings, even
|
||||
hundreds of megabytes of RAM. However, in fast modes, the LZMA2 encoder
|
||||
competes with bzip2 in compression speed, RAM usage, and compression
|
||||
ratio.
|
||||
|
||||
with the Tcl Developer Xchange at:
|
||||
LZMA2 is reasonably fast to decompress. It is a little slower than
|
||||
gzip, but a lot faster than bzip2. Being fast to decompress means
|
||||
that the .xz format is especially nice when the same file will be
|
||||
decompressed very many times (usually on different computers), which
|
||||
is the case e.g. when distributing software packages. In such
|
||||
situations, it's not too bad if the compression takes some time,
|
||||
since that needs to be done only once to benefit many people.
|
||||
|
||||
http://www.tcl.tk/
|
||||
With some file types, combining (or "chaining") LZMA2 with an
|
||||
additional filter can improve the compression ratio. A filter chain may
|
||||
contain up to four filters, although usually only one or two are used.
|
||||
For example, putting a BCJ (Branch/Call/Jump) filter before LZMA2
|
||||
in the filter chain can improve compression ratio of executable files.
|
||||
|
||||
Tk is a freely available open source package. You can do virtually
|
||||
anything you like with it, such as modifying it, redistributing it,
|
||||
and selling it either in whole or in part. See the file
|
||||
"license.terms" for complete information.
|
||||
Since the .xz format allows adding new filter IDs, it is possible that
|
||||
some day there will be a filter that is, for example, much faster to
|
||||
compress than LZMA2 (but probably with worse compression ratio).
|
||||
Similarly, it is possible that some day there is a filter that will
|
||||
compress better than LZMA2.
|
||||
|
||||
2. See Tcl README
|
||||
XZ Utils doesn't support multithreaded compression or decompression
|
||||
yet. It has been planned though and taken into account when designing
|
||||
the .xz file format.
|
||||
|
||||
|
||||
1. Documentation
|
||||
----------------
|
||||
|
||||
1.1. Overall documentation
|
||||
|
||||
README This file
|
||||
|
||||
INSTALL.generic Generic install instructions for those not familiar
|
||||
with packages using GNU Autotools
|
||||
INSTALL Installation instructions specific to XZ Utils
|
||||
PACKAGERS Information to packagers of XZ Utils
|
||||
|
||||
COPYING XZ Utils copyright and license information
|
||||
COPYING.GPLv2 GNU General Public License version 2
|
||||
COPYING.GPLv3 GNU General Public License version 3
|
||||
COPYING.LGPLv2.1 GNU Lesser General Public License version 2.1
|
||||
|
||||
AUTHORS The main authors of XZ Utils
|
||||
THANKS Incomplete list of people who have helped making
|
||||
this software
|
||||
NEWS User-visible changes between XZ Utils releases
|
||||
ChangeLog Detailed list of changes (commit log)
|
||||
TODO Known bugs and some sort of to-do list
|
||||
|
||||
Note that only some of the above files are included in binary
|
||||
packages.
|
||||
|
||||
|
||||
1.2. Documentation for command-line tools
|
||||
|
||||
The command-line tools are documented as man pages. In source code
|
||||
releases (and possibly also in some binary packages), the man pages
|
||||
are also provided in plain text (ASCII only) and PDF formats in the
|
||||
directory "doc/man" to make the man pages more accessible to those
|
||||
whose operating system doesn't provide an easy way to view man pages.
|
||||
|
||||
|
||||
1.3. Documentation for liblzma
|
||||
|
||||
The liblzma API headers include short docs about each function
|
||||
and data type as Doxygen tags. These docs should be quite OK as
|
||||
a quick reference.
|
||||
|
||||
I have planned to write a bunch of very well documented example
|
||||
programs, which (due to comments) should work as a tutorial to
|
||||
various features of liblzma. No such example programs have been
|
||||
written yet.
|
||||
|
||||
For now, if you have never used liblzma, libbzip2, or zlib, I
|
||||
recommend learning the *basics* of the zlib API. Once you know that,
|
||||
it should be easier to learn liblzma.
|
||||
|
||||
http://zlib.net/manual.html
|
||||
http://zlib.net/zlib_how.html
|
||||
|
||||
|
||||
2. Version numbering
|
||||
--------------------
|
||||
|
||||
The version number format of XZ Utils is X.Y.ZS:
|
||||
|
||||
- X is the major version. When this is incremented, the library
|
||||
API and ABI break.
|
||||
|
||||
- Y is the minor version. It is incremented when new features
|
||||
are added without breaking the existing API or ABI. An even Y
|
||||
indicates a stable release and an odd Y indicates unstable
|
||||
(alpha or beta version).
|
||||
|
||||
- Z is the revision. This has a different meaning for stable and
|
||||
unstable releases:
|
||||
|
||||
* Stable: Z is incremented when bugs get fixed without adding
|
||||
any new features. This is intended to be convenient for
|
||||
downstream distributors that want bug fixes but don't want
|
||||
any new features to minimize the risk of introducing new bugs.
|
||||
|
||||
* Unstable: Z is just a counter. API or ABI of features added
|
||||
in earlier unstable releases having the same X.Y may break.
|
||||
|
||||
- S indicates stability of the release. It is missing from the
|
||||
stable releases, where Y is an even number. When Y is odd, S
|
||||
is either "alpha" or "beta" to make it very clear that such
|
||||
versions are not stable releases. The same X.Y.Z combination is
|
||||
not used for more than one stability level, i.e. after X.Y.Zalpha,
|
||||
the next version can be X.Y.(Z+1)beta but not X.Y.Zbeta.
|
||||
|
||||
|
||||
3. Reporting bugs
|
||||
-----------------
|
||||
|
||||
Please see the README file that comes with the associated Tcl release
|
||||
for more information. There are pointers there to extensive
|
||||
documentation. In addition, there are additional README files
|
||||
in the subdirectories of this distribution.
|
||||
Naturally it is easiest for me if you already know what causes the
|
||||
unexpected behavior. Even better if you have a patch to propose.
|
||||
However, quite often the reason for unexpected behavior is unknown,
|
||||
so here are a few things to do before sending a bug report:
|
||||
|
||||
1. Try to create a small example how to reproduce the issue.
|
||||
|
||||
2. Compile XZ Utils with debugging code using configure switches
|
||||
--enable-debug and, if possible, --disable-shared. If you are
|
||||
using GCC, use CFLAGS='-O0 -ggdb3'. Don't strip the resulting
|
||||
binaries.
|
||||
|
||||
3. Turn on core dumps. The exact command depends on your shell;
|
||||
for example in GNU bash it is done with "ulimit -c unlimited",
|
||||
and in tcsh with "limit coredumpsize unlimited".
|
||||
|
||||
4. Try to reproduce the suspected bug. If you get "assertion failed"
|
||||
message, be sure to include the complete message in your bug
|
||||
report. If the application leaves a coredump, get a backtrace
|
||||
using gdb:
|
||||
$ gdb /path/to/app-binary # Load the app to the debugger.
|
||||
(gdb) core core # Open the coredump.
|
||||
(gdb) bt # Print the backtrace. Copy & paste to bug report.
|
||||
(gdb) quit # Quit gdb.
|
||||
|
||||
Report your bug via email or IRC (see Contact information below).
|
||||
Don't send core dump files or any executables. If you have a small
|
||||
example file(s) (total size less than 256 KiB), please include
|
||||
it/them as an attachment. If you have bigger test files, put them
|
||||
online somewhere and include a URL to the file(s) in the bug report.
|
||||
|
||||
Always include the exact version number of XZ Utils in the bug report.
|
||||
If you are using a snapshot from the git repository, use "git describe"
|
||||
to get the exact snapshot version. If you are using XZ Utils shipped
|
||||
in an operating system distribution, mention the distribution name,
|
||||
distribution version, and exact xz package version; if you cannot
|
||||
repeat the bug with the code compiled from unpatched source code,
|
||||
you probably need to report a bug to your distribution's bug tracking
|
||||
system.
|
||||
|
||||
|
||||
4. Translating the xz tool
|
||||
--------------------------
|
||||
|
||||
The messages from the xz tool have been translated into a few
|
||||
languages. Before starting to translate into a new language, ask
|
||||
the author whether someone else hasn't already started working on it.
|
||||
|
||||
Test your translation. Testing includes comparing the translated
|
||||
output to the original English version by running the same commands
|
||||
in both your target locale and with LC_ALL=C. Ask someone to
|
||||
proof-read and test the translation.
|
||||
|
||||
Testing can be done e.g. by installing xz into a temporary directory:
|
||||
|
||||
./configure --disable-shared --prefix=/tmp/xz-test
|
||||
# <Edit the .po file in the po directory.>
|
||||
make -C po update-po
|
||||
make install
|
||||
bash debug/translation.bash | less
|
||||
bash debug/translation.bash | less -S # For --list outputs
|
||||
|
||||
Repeat the above as needed (no need to re-run configure though).
|
||||
|
||||
Note especially the following:
|
||||
|
||||
- The output of --help and --long-help must look nice on
|
||||
an 80-column terminal. It's OK to add extra lines if needed.
|
||||
|
||||
- In contrast, don't add extra lines to error messages and such.
|
||||
They are often preceded with e.g. a filename on the same line,
|
||||
so you have no way to predict where to put a \n. Let the terminal
|
||||
do the wrapping even if it looks ugly. Adding new lines will be
|
||||
even uglier in the generic case even if it looks nice in a few
|
||||
limited examples.
|
||||
|
||||
- Be careful with column alignment in tables and table-like output
|
||||
(--list, --list --verbose --verbose, --info-memory, --help, and
|
||||
--long-help):
|
||||
|
||||
* All descriptions of options in --help should start in the
|
||||
same column (but it doesn't need to be the same column as
|
||||
in the English messages; just be consistent if you change it).
|
||||
Check that both --help and --long-help look OK, since they
|
||||
share several strings.
|
||||
|
||||
* --list --verbose and --info-memory print lines that have
|
||||
the format "Description: %s". If you need a longer
|
||||
description, you can put extra space between the colon
|
||||
and %s. Then you may need to add extra space to other
|
||||
strings too so that the result as a whole looks good (all
|
||||
values start at the same column).
|
||||
|
||||
* The columns of the actual tables in --list --verbose --verbose
|
||||
should be aligned properly. Abbreviate if necessary. It might
|
||||
be good to keep at least 2 or 3 spaces between column headings
|
||||
and avoid spaces in the headings so that the columns stand out
|
||||
better, but this is a matter of opinion. Do what you think
|
||||
looks best.
|
||||
|
||||
- Be careful to put a period at the end of a sentence when the
|
||||
original version has it, and don't put it when the original
|
||||
doesn't have it. Similarly, be careful with \n characters
|
||||
at the beginning and end of the strings.
|
||||
|
||||
- Read the TRANSLATORS comments that have been extracted from the
|
||||
source code and included in xz.pot. If they suggest testing the
|
||||
translation with some type of command, do it. If testing needs
|
||||
input files, use e.g. tests/files/good-*.xz.
|
||||
|
||||
- When updating the translation, read the fuzzy (modified) strings
|
||||
carefully, and don't mark them as updated before you actually
|
||||
have updated them. Reading through the unchanged messages can be
|
||||
good too; sometimes you may find a better wording for them.
|
||||
|
||||
- If you find language problems in the original English strings,
|
||||
feel free to suggest improvements. Ask if something is unclear.
|
||||
|
||||
- The translated messages should be understandable (sometimes this
|
||||
may be a problem with the original English messages too). Don't
|
||||
make a direct word-by-word translation from English especially if
|
||||
the result doesn't sound good in your language.
|
||||
|
||||
In short, take your time and pay attention to the details. Making
|
||||
a good translation is not a quick and trivial thing to do. The
|
||||
translated xz should look as polished as the English version.
|
||||
|
||||
|
||||
5. Other implementations of the .xz format
|
||||
------------------------------------------
|
||||
|
||||
7-Zip and the p7zip port of 7-Zip support the .xz format starting
|
||||
from the version 9.00alpha.
|
||||
|
||||
http://7-zip.org/
|
||||
http://p7zip.sourceforge.net/
|
||||
|
||||
XZ Embedded is a limited implementation written for use in the Linux
|
||||
kernel, but it is also suitable for other embedded use.
|
||||
|
||||
http://tukaani.org/xz/embedded.html
|
||||
|
||||
|
||||
6. Contact information
|
||||
----------------------
|
||||
|
||||
If you have questions, bug reports, patches etc. related to XZ Utils,
|
||||
contact Lasse Collin <lasse.collin@tukaani.org> (in Finnish or English).
|
||||
I'm sometimes slow at replying. If you haven't got a reply within two
|
||||
weeks, assume that your email has got lost and resend it or use IRC.
|
||||
|
||||
You can find me also from #tukaani on Freenode; my nick is Larhzu.
|
||||
The channel tends to be pretty quiet, so just ask your question and
|
||||
someone may wake up.
|
||||
|
||||
|
||||
116
THANKS
Normal file
116
THANKS
Normal file
@@ -0,0 +1,116 @@
|
||||
|
||||
Thanks
|
||||
======
|
||||
|
||||
Some people have helped more, some less, but nevertheless everyone's help
|
||||
has been important. :-) In alphabetical order:
|
||||
- Mark Adler
|
||||
- H. Peter Anvin
|
||||
- Jeff Bastian
|
||||
- Nelson H. F. Beebe
|
||||
- Karl Berry
|
||||
- Anders F. Björklund
|
||||
- Emmanuel Blot
|
||||
- Martin Blumenstingl
|
||||
- Jakub Bogusz
|
||||
- Maarten Bosmans
|
||||
- Trent W. Buck
|
||||
- James Buren
|
||||
- David Burklund
|
||||
- Daniel Mealha Cabrita
|
||||
- Milo Casagrande
|
||||
- Marek Černocký
|
||||
- Tomer Chachamu
|
||||
- Gabi Davar
|
||||
- Chris Donawa
|
||||
- Andrew Dudman
|
||||
- Markus Duft
|
||||
- İsmail Dönmez
|
||||
- Robert Elz
|
||||
- Gilles Espinasse
|
||||
- Denis Excoffier
|
||||
- Michael Felt
|
||||
- Michael Fox
|
||||
- Mike Frysinger
|
||||
- Daniel Richard G.
|
||||
- Bill Glessner
|
||||
- Jason Gorski
|
||||
- Juan Manuel Guerrero
|
||||
- Diederik de Haas
|
||||
- Joachim Henke
|
||||
- Christian Hesse
|
||||
- Vincenzo Innocente
|
||||
- Peter Ivanov
|
||||
- Jouk Jansen
|
||||
- Jun I Jin
|
||||
- Per Øyvind Karlsen
|
||||
- Thomas Klausner
|
||||
- Richard Koch
|
||||
- Ville Koskinen
|
||||
- Jan Kratochvil
|
||||
- Christian Kujau
|
||||
- Stephan Kulow
|
||||
- Peter Lawler
|
||||
- James M Leddy
|
||||
- Hin-Tak Leung
|
||||
- Andraž 'ruskie' Levstik
|
||||
- Cary Lewis
|
||||
- Wim Lewis
|
||||
- Lorenzo De Liso
|
||||
- Bela Lubkin
|
||||
- Gregory Margo
|
||||
- Jim Meyering
|
||||
- Arkadiusz Miskiewicz
|
||||
- Conley Moorhous
|
||||
- Rafał Mużyło
|
||||
- Adrien Nader
|
||||
- Hongbo Ni
|
||||
- Jonathan Nieder
|
||||
- Andre Noll
|
||||
- Peter O'Gorman
|
||||
- Peter Pallinger
|
||||
- Rui Paulo
|
||||
- Igor Pavlov
|
||||
- Diego Elio Pettenò
|
||||
- Elbert Pol
|
||||
- Mikko Pouru
|
||||
- Trần Ngọc Quân
|
||||
- Pavel Raiskup
|
||||
- Ole André Vadla Ravnås
|
||||
- Robert Readman
|
||||
- Bernhard Reutner-Fischer
|
||||
- Eric S. Raymond
|
||||
- Cristian Rodríguez
|
||||
- Christian von Roques
|
||||
- Torsten Rupp
|
||||
- Jukka Salmi
|
||||
- Alexandre Sauvé
|
||||
- Benno Schulenberg
|
||||
- Andreas Schwab
|
||||
- Dan Shechter
|
||||
- Stuart Shelton
|
||||
- Brad Smith
|
||||
- Jonathan Stott
|
||||
- Dan Stromberg
|
||||
- Vincent Torri
|
||||
- Paul Townsend
|
||||
- Mohammed Adnène Trojette
|
||||
- Alexey Tourbin
|
||||
- Patrick J. Volkerding
|
||||
- Martin Väth
|
||||
- Adam Walling
|
||||
- Christian Weisgerber
|
||||
- Bert Wesarg
|
||||
- Fredrik Wikstrom
|
||||
- Ralf Wildenhues
|
||||
- Charles Wilson
|
||||
- Lars Wirzenius
|
||||
- Pilorz Wojciech
|
||||
- Ryan Young
|
||||
- Andreas Zieringer
|
||||
|
||||
Also thanks to all the people who have participated in the Tukaani project.
|
||||
|
||||
I have probably forgot to add some names to the above list. Sorry about
|
||||
that and thanks for your help.
|
||||
|
||||
111
TODO
Normal file
111
TODO
Normal file
@@ -0,0 +1,111 @@
|
||||
|
||||
XZ Utils To-Do List
|
||||
===================
|
||||
|
||||
Known bugs
|
||||
----------
|
||||
|
||||
The test suite is too incomplete.
|
||||
|
||||
If the memory usage limit is less than about 13 MiB, xz is unable to
|
||||
automatically scale down the compression settings enough even though
|
||||
it would be possible by switching from BT2/BT3/BT4 match finder to
|
||||
HC3/HC4.
|
||||
|
||||
XZ Utils compress some files significantly worse than LZMA Utils.
|
||||
This is due to faster compression presets used by XZ Utils, and
|
||||
can often be worked around by using "xz --extreme". With some files
|
||||
--extreme isn't enough though: it's most likely with files that
|
||||
compress extremely well, so going from compression ratio of 0.003
|
||||
to 0.004 means big relative increase in the compressed file size.
|
||||
|
||||
xz doesn't quote unprintable characters when it displays file names
|
||||
given on the command line.
|
||||
|
||||
tuklib_exit() doesn't block signals => EINTR is possible.
|
||||
|
||||
SIGTSTP is not handled. If xz is stopped, the estimated remaining
|
||||
time and calculated (de)compression speed won't make sense in the
|
||||
progress indicator (xz --verbose).
|
||||
|
||||
If liblzma has created threads and fork() gets called, liblzma
|
||||
code will break in the child process unless it calls exec() and
|
||||
doesn't touch liblzma.
|
||||
|
||||
|
||||
Missing features
|
||||
----------------
|
||||
|
||||
Add support for storing metadata in .xz files. A preliminary
|
||||
idea is to create a new Stream type for metadata. When both
|
||||
metadata and data are wanted in the same .xz file, two or more
|
||||
Streams would be concatenated.
|
||||
|
||||
The state stored in lzma_stream should be cloneable, which would
|
||||
be mostly useful when using a preset dictionary in LZMA2, but
|
||||
it may have other uses too. Compare to deflateCopy() in zlib.
|
||||
|
||||
Support LZMA_FINISH in raw decoder to indicate end of LZMA1 and
|
||||
other streams that don't have an end of payload marker.
|
||||
|
||||
Adjust dictionary size when the input file size is known.
|
||||
Maybe do this only if an option is given.
|
||||
|
||||
xz doesn't support copying extended attributes, access control
|
||||
lists etc. from source to target file.
|
||||
|
||||
Multithreaded compression:
|
||||
- Reduce memory usage of the current method.
|
||||
- Implement threaded match finders.
|
||||
- Implement pigz-style threading in LZMA2.
|
||||
|
||||
Multithreaded decompression
|
||||
|
||||
Buffer-to-buffer coding could use less RAM (especially when
|
||||
decompressing LZMA1 or LZMA2).
|
||||
|
||||
I/O library is not implemented (similar to gzopen() in zlib).
|
||||
It will be a separate library that supports uncompressed, .gz,
|
||||
.bz2, .lzma, and .xz files.
|
||||
|
||||
Support changing lzma_options_lzma.mode with lzma_filters_update().
|
||||
|
||||
Support LZMA_FULL_FLUSH for lzma_stream_decoder() to stop at
|
||||
Block and Stream boundaries.
|
||||
|
||||
lzma_strerror() to convert lzma_ret to human readable form?
|
||||
This is tricky, because the same error codes are used with
|
||||
slightly different meanings, and this cannot be fixed anymore.
|
||||
|
||||
Make it possible to adjust LZMA2 options in the middle of a Block
|
||||
so that the encoding speed vs. compression ratio can be optimized
|
||||
when the compressed data is streamed over network.
|
||||
|
||||
Improved BCJ filters. The current filters are small but they aren't
|
||||
so great when compressing binary packages that contain various file
|
||||
types. Specifically, they make things worse if there are static
|
||||
libraries or Linux kernel modules. The filtering could also be
|
||||
more effective (without getting overly complex), for example,
|
||||
streamable variant BCJ2 from 7-Zip could be implemented.
|
||||
|
||||
Filter that autodetects specific data types in the input stream
|
||||
and applies appropriate filters for the corrects parts of the input.
|
||||
Perhaps combine this with the BCJ filter improvement point above.
|
||||
|
||||
Long-range LZ77 method as a separate filter or as a new LZMA2
|
||||
match finder.
|
||||
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
More tutorial programs are needed for liblzma.
|
||||
|
||||
Document the LZMA1 and LZMA2 algorithms.
|
||||
|
||||
|
||||
Miscellaneous
|
||||
------------
|
||||
|
||||
Try to get the media type for .xz registered at IANA.
|
||||
|
||||
1228
aclocal.m4
vendored
Normal file
1228
aclocal.m4
vendored
Normal file
File diff suppressed because it is too large
Load Diff
22
autogen.sh
Normal file
22
autogen.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
# The result of using "autoreconf -fi" should be identical to using this
|
||||
# script. I'm leaving this script here just in case someone finds it useful.
|
||||
|
||||
set -e -x
|
||||
|
||||
${AUTOPOINT:-autopoint} -f
|
||||
${LIBTOOLIZE:-libtoolize} -c -f || glibtoolize -c -f
|
||||
${ACLOCAL:-aclocal} -I m4
|
||||
${AUTOCONF:-autoconf}
|
||||
${AUTOHEADER:-autoheader}
|
||||
${AUTOMAKE:-automake} -acf --foreign
|
||||
@@ -1,8 +0,0 @@
|
||||
#define error_width 17
|
||||
#define error_height 17
|
||||
static unsigned char error_bits[] = {
|
||||
0xf0, 0x0f, 0x00, 0x58, 0x15, 0x00, 0xac, 0x2a, 0x00, 0x16, 0x50, 0x00,
|
||||
0x2b, 0xa0, 0x00, 0x55, 0x40, 0x01, 0xa3, 0xc0, 0x00, 0x45, 0x41, 0x01,
|
||||
0x83, 0xc2, 0x00, 0x05, 0x45, 0x01, 0x03, 0xca, 0x00, 0x05, 0x74, 0x01,
|
||||
0x0a, 0xa8, 0x00, 0x14, 0x58, 0x00, 0xe8, 0x2f, 0x00, 0x50, 0x15, 0x00,
|
||||
0xa0, 0x0a, 0x00};
|
||||
@@ -1,6 +0,0 @@
|
||||
#define gray12_width 16
|
||||
#define gray12_height 16
|
||||
static unsigned char gray12_bits[] = {
|
||||
0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x22, 0x22,
|
||||
0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x88, 0x88,
|
||||
0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x88, 0x88};
|
||||
@@ -1,6 +0,0 @@
|
||||
#define gray25_width 16
|
||||
#define gray25_height 16
|
||||
static unsigned char gray25_bits[] = {
|
||||
0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22,
|
||||
0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22,
|
||||
0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22};
|
||||
@@ -1,6 +0,0 @@
|
||||
#define gray50_width 16
|
||||
#define gray50_height 16
|
||||
static unsigned char gray50_bits[] = {
|
||||
0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,
|
||||
0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,
|
||||
0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa};
|
||||
@@ -1,6 +0,0 @@
|
||||
#define gray75_width 16
|
||||
#define gray75_height 16
|
||||
static unsigned char gray75_bits[] = {
|
||||
0x77, 0x77, 0xdd, 0xdd, 0x77, 0x77, 0xdd, 0xdd, 0x77, 0x77, 0xdd, 0xdd,
|
||||
0x77, 0x77, 0xdd, 0xdd, 0x77, 0x77, 0xdd, 0xdd, 0x77, 0x77, 0xdd, 0xdd,
|
||||
0x77, 0x77, 0xdd, 0xdd, 0x77, 0x77, 0xdd, 0xdd};
|
||||
@@ -1,9 +0,0 @@
|
||||
#define hourglass_width 19
|
||||
#define hourglass_height 21
|
||||
static unsigned char hourglass_bits[] = {
|
||||
0xff, 0xff, 0x07, 0x55, 0x55, 0x05, 0xa2, 0x2a, 0x03, 0x66, 0x15, 0x01,
|
||||
0xa2, 0x2a, 0x03, 0x66, 0x15, 0x01, 0xc2, 0x0a, 0x03, 0x46, 0x05, 0x01,
|
||||
0x82, 0x0a, 0x03, 0x06, 0x05, 0x01, 0x02, 0x03, 0x03, 0x86, 0x05, 0x01,
|
||||
0xc2, 0x0a, 0x03, 0x66, 0x15, 0x01, 0xa2, 0x2a, 0x03, 0x66, 0x15, 0x01,
|
||||
0xa2, 0x2a, 0x03, 0x66, 0x15, 0x01, 0xa2, 0x2a, 0x03, 0xff, 0xff, 0x07,
|
||||
0xab, 0xaa, 0x02};
|
||||
@@ -1,5 +0,0 @@
|
||||
#define info_width 8
|
||||
#define info_height 21
|
||||
static unsigned char info_bits[] = {
|
||||
0x3c, 0x2a, 0x16, 0x2a, 0x14, 0x00, 0x00, 0x3f, 0x15, 0x2e, 0x14, 0x2c,
|
||||
0x14, 0x2c, 0x14, 0x2c, 0x14, 0x2c, 0xd7, 0xab, 0x55};
|
||||
@@ -1,9 +0,0 @@
|
||||
#define questhead_width 20
|
||||
#define questhead_height 22
|
||||
static unsigned char questhead_bits[] = {
|
||||
0xf8, 0x1f, 0x00, 0xac, 0x2a, 0x00, 0x56, 0x55, 0x00, 0xeb, 0xaf, 0x00,
|
||||
0xf5, 0x5f, 0x01, 0xfb, 0xbf, 0x00, 0x75, 0x5d, 0x01, 0xfb, 0xbe, 0x02,
|
||||
0x75, 0x5d, 0x05, 0xab, 0xbe, 0x0a, 0x55, 0x5f, 0x07, 0xab, 0xaf, 0x00,
|
||||
0xd6, 0x57, 0x01, 0xac, 0xab, 0x00, 0xd8, 0x57, 0x00, 0xb0, 0xaa, 0x00,
|
||||
0x50, 0x55, 0x00, 0xb0, 0x0b, 0x00, 0xd0, 0x17, 0x00, 0xb0, 0x0b, 0x00,
|
||||
0x58, 0x15, 0x00, 0xa8, 0x2a, 0x00};
|
||||
@@ -1,10 +0,0 @@
|
||||
#define question_width 17
|
||||
#define question_height 27
|
||||
static unsigned char question_bits[] = {
|
||||
0xf0, 0x0f, 0x00, 0x58, 0x15, 0x00, 0xac, 0x2a, 0x00, 0x56, 0x55, 0x00,
|
||||
0x2b, 0xa8, 0x00, 0x15, 0x50, 0x01, 0x0b, 0xa0, 0x00, 0x05, 0x60, 0x01,
|
||||
0x0b, 0xa0, 0x00, 0x05, 0x60, 0x01, 0x0b, 0xb0, 0x00, 0x00, 0x58, 0x01,
|
||||
0x00, 0xaf, 0x00, 0x80, 0x55, 0x00, 0xc0, 0x2a, 0x00, 0x40, 0x15, 0x00,
|
||||
0xc0, 0x02, 0x00, 0x40, 0x01, 0x00, 0xc0, 0x02, 0x00, 0x40, 0x01, 0x00,
|
||||
0xc0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xc0, 0x02, 0x00,
|
||||
0x40, 0x01, 0x00, 0xc0, 0x02, 0x00, 0x00, 0x01, 0x00};
|
||||
@@ -1,5 +0,0 @@
|
||||
#define warning_width 6
|
||||
#define warning_height 19
|
||||
static unsigned char warning_bits[] = {
|
||||
0x0c, 0x16, 0x2b, 0x15, 0x2b, 0x15, 0x2b, 0x16, 0x0a, 0x16, 0x0a, 0x16,
|
||||
0x0a, 0x00, 0x00, 0x1e, 0x0a, 0x16, 0x0a};
|
||||
347
build-aux/compile
Normal file
347
build-aux/compile
Normal file
@@ -0,0 +1,347 @@
|
||||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand '-c -o'.
|
||||
|
||||
scriptversion=2012-10-14.11; # UTC
|
||||
|
||||
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# 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 2, 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
nl='
|
||||
'
|
||||
|
||||
# We need space, tab and new line, in precisely that order. Quoting is
|
||||
# there to prevent tools from complaining about whitespace usage.
|
||||
IFS=" "" $nl"
|
||||
|
||||
file_conv=
|
||||
|
||||
# func_file_conv build_file lazy
|
||||
# Convert a $build file to $host form and store it in $file
|
||||
# Currently only supports Windows hosts. If the determined conversion
|
||||
# type is listed in (the comma separated) LAZY, no conversion will
|
||||
# take place.
|
||||
func_file_conv ()
|
||||
{
|
||||
file=$1
|
||||
case $file in
|
||||
/ | /[!/]*) # absolute file, and not a UNC file
|
||||
if test -z "$file_conv"; then
|
||||
# lazily determine how to convert abs files
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
file_conv=mingw
|
||||
;;
|
||||
CYGWIN*)
|
||||
file_conv=cygwin
|
||||
;;
|
||||
*)
|
||||
file_conv=wine
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $file_conv/,$2, in
|
||||
*,$file_conv,*)
|
||||
;;
|
||||
mingw/*)
|
||||
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
||||
;;
|
||||
cygwin/*)
|
||||
file=`cygpath -m "$file" || echo "$file"`
|
||||
;;
|
||||
wine/*)
|
||||
file=`winepath -w "$file" || echo "$file"`
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# func_cl_dashL linkdir
|
||||
# Make cl look for libraries in LINKDIR
|
||||
func_cl_dashL ()
|
||||
{
|
||||
func_file_conv "$1"
|
||||
if test -z "$lib_path"; then
|
||||
lib_path=$file
|
||||
else
|
||||
lib_path="$lib_path;$file"
|
||||
fi
|
||||
linker_opts="$linker_opts -LIBPATH:$file"
|
||||
}
|
||||
|
||||
# func_cl_dashl library
|
||||
# Do a library search-path lookup for cl
|
||||
func_cl_dashl ()
|
||||
{
|
||||
lib=$1
|
||||
found=no
|
||||
save_IFS=$IFS
|
||||
IFS=';'
|
||||
for dir in $lib_path $LIB
|
||||
do
|
||||
IFS=$save_IFS
|
||||
if $shared && test -f "$dir/$lib.dll.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.dll.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/$lib.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/lib$lib.a"; then
|
||||
found=yes
|
||||
lib=$dir/lib$lib.a
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS=$save_IFS
|
||||
|
||||
if test "$found" != yes; then
|
||||
lib=$lib.lib
|
||||
fi
|
||||
}
|
||||
|
||||
# func_cl_wrapper cl arg...
|
||||
# Adjust compile command to suit cl
|
||||
func_cl_wrapper ()
|
||||
{
|
||||
# Assume a capable shell
|
||||
lib_path=
|
||||
shared=:
|
||||
linker_opts=
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.[oO][bB][jJ])
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fo"$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fe"$file"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-I)
|
||||
eat=1
|
||||
func_file_conv "$2" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-I*)
|
||||
func_file_conv "${1#-I}" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-l)
|
||||
eat=1
|
||||
func_cl_dashl "$2"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-l*)
|
||||
func_cl_dashl "${1#-l}"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-L)
|
||||
eat=1
|
||||
func_cl_dashL "$2"
|
||||
;;
|
||||
-L*)
|
||||
func_cl_dashL "${1#-L}"
|
||||
;;
|
||||
-static)
|
||||
shared=false
|
||||
;;
|
||||
-Wl,*)
|
||||
arg=${1#-Wl,}
|
||||
save_ifs="$IFS"; IFS=','
|
||||
for flag in $arg; do
|
||||
IFS="$save_ifs"
|
||||
linker_opts="$linker_opts $flag"
|
||||
done
|
||||
IFS="$save_ifs"
|
||||
;;
|
||||
-Xlinker)
|
||||
eat=1
|
||||
linker_opts="$linker_opts $2"
|
||||
;;
|
||||
-*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
|
||||
func_file_conv "$1"
|
||||
set x "$@" -Tp"$file"
|
||||
shift
|
||||
;;
|
||||
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
|
||||
func_file_conv "$1" mingw
|
||||
set x "$@" "$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
if test -n "$linker_opts"; then
|
||||
linker_opts="-link$linker_opts"
|
||||
fi
|
||||
exec "$@" $linker_opts
|
||||
exit 1
|
||||
}
|
||||
|
||||
eat=
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand '-c -o'.
|
||||
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file 'INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "compile $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
|
||||
func_cl_wrapper "$@" # Doesn't return...
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
# So we strip '-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
ofile=$2
|
||||
;;
|
||||
*)
|
||||
set x "$@" -o "$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no '-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# '.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$@"
|
||||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
1421
build-aux/config.guess
vendored
Normal file
1421
build-aux/config.guess
vendored
Normal file
File diff suppressed because it is too large
Load Diff
672
build-aux/config.rpath
Normal file
672
build-aux/config.rpath
Normal file
@@ -0,0 +1,672 @@
|
||||
#! /bin/sh
|
||||
# Output a system dependent set of variables, describing how to set the
|
||||
# run time search path of shared libraries in an executable.
|
||||
#
|
||||
# Copyright 1996-2010 Free Software Foundation, Inc.
|
||||
# Taken from GNU libtool, 2001
|
||||
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# The first argument passed to this file is the canonical host specification,
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||
# or
|
||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
|
||||
# should be set by the caller.
|
||||
#
|
||||
# The set of defined variables is at the end of this script.
|
||||
|
||||
# Known limitations:
|
||||
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
|
||||
# than 256 bytes, otherwise the compiler driver will dump core. The only
|
||||
# known workaround is to choose shorter directory names for the build
|
||||
# directory and/or the installation directory.
|
||||
|
||||
# All known linkers require a `.a' archive for static linking (except MSVC,
|
||||
# which needs '.lib').
|
||||
libext=a
|
||||
shrext=.so
|
||||
|
||||
host="$1"
|
||||
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
|
||||
# Code taken from libtool.m4's _LT_CC_BASENAME.
|
||||
|
||||
for cc_temp in $CC""; do
|
||||
case $cc_temp in
|
||||
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
|
||||
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
|
||||
\-*) ;;
|
||||
*) break;;
|
||||
esac
|
||||
done
|
||||
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
|
||||
|
||||
# Code taken from libtool.m4's _LT_COMPILER_PIC.
|
||||
|
||||
wl=
|
||||
if test "$GCC" = yes; then
|
||||
wl='-Wl,'
|
||||
else
|
||||
case "$host_os" in
|
||||
aix*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
darwin*)
|
||||
case $cc_basename in
|
||||
xlc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
mingw* | cygwin* | pw32* | os2* | cegcc*)
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
newsos6)
|
||||
;;
|
||||
linux* | k*bsd*-gnu)
|
||||
case $cc_basename in
|
||||
ecc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
icc* | ifort*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
lf95*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
pgcc | pgf77 | pgf90)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
ccc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
como)
|
||||
wl='-lopt='
|
||||
;;
|
||||
*)
|
||||
case `$CC -V 2>&1 | sed 5q` in
|
||||
*Sun\ C*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
rdos*)
|
||||
;;
|
||||
solaris*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sunos4*)
|
||||
wl='-Qoption ld '
|
||||
;;
|
||||
sysv4 | sysv4.2uw2* | sysv4.3*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
;;
|
||||
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
unicos*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
uts4*)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
|
||||
|
||||
hardcode_libdir_flag_spec=
|
||||
hardcode_libdir_separator=
|
||||
hardcode_direct=no
|
||||
hardcode_minus_L=no
|
||||
|
||||
case "$host_os" in
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# FIXME: the MSVC++ port hasn't been tested in a loooong time
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
if test "$GCC" != yes; then
|
||||
with_gnu_ld=no
|
||||
fi
|
||||
;;
|
||||
interix*)
|
||||
# we just hope/assume this is gcc and not c89 (= MSVC++)
|
||||
with_gnu_ld=yes
|
||||
;;
|
||||
openbsd*)
|
||||
with_gnu_ld=no
|
||||
;;
|
||||
esac
|
||||
|
||||
ld_shlibs=yes
|
||||
if test "$with_gnu_ld" = yes; then
|
||||
# Set some defaults for GNU ld with shared library support. These
|
||||
# are reset later if shared libraries are not supported. Putting them
|
||||
# here allows them to be overridden if necessary.
|
||||
# Unlike libtool, we use -rpath here, not --rpath, since the documented
|
||||
# option of GNU ld is called -rpath, not --rpath.
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
case "$host_os" in
|
||||
aix[3-9]*)
|
||||
# On AIX/PPC, the GNU linker is very broken
|
||||
if test "$host_cpu" != ia64; then
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
|
||||
# that the semantics of dynamic libraries on AmigaOS, at least up
|
||||
# to version 4, is to share data among multiple programs linked
|
||||
# with the same dynamic library. Since this doesn't match the
|
||||
# behavior of shared libraries on other platforms, we cannot use
|
||||
# them.
|
||||
ld_shlibs=no
|
||||
;;
|
||||
beos*)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
interix[3-9]*)
|
||||
hardcode_direct=no
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
gnu* | linux* | k*bsd*-gnu)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
netbsd*)
|
||||
;;
|
||||
solaris*)
|
||||
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
|
||||
ld_shlibs=no
|
||||
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
|
||||
case `$LD -v 2>&1` in
|
||||
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
*)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sunos4*)
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
*)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if test "$ld_shlibs" = no; then
|
||||
hardcode_libdir_flag_spec=
|
||||
fi
|
||||
else
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
# Note: this linker hardcodes the directories in LIBPATH if there
|
||||
# are no directories specified by -L.
|
||||
hardcode_minus_L=yes
|
||||
if test "$GCC" = yes; then
|
||||
# Neither direct hardcoding nor static linking is supported with a
|
||||
# broken collect2.
|
||||
hardcode_direct=unsupported
|
||||
fi
|
||||
;;
|
||||
aix[4-9]*)
|
||||
if test "$host_cpu" = ia64; then
|
||||
# On IA64, the linker does run time linking by default, so we don't
|
||||
# have to do anything special.
|
||||
aix_use_runtimelinking=no
|
||||
else
|
||||
aix_use_runtimelinking=no
|
||||
# Test if we are trying to use run time linking or normal
|
||||
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
|
||||
# need to do runtime linking.
|
||||
case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
|
||||
for ld_flag in $LDFLAGS; do
|
||||
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
|
||||
aix_use_runtimelinking=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
hardcode_direct=yes
|
||||
hardcode_libdir_separator=':'
|
||||
if test "$GCC" = yes; then
|
||||
case $host_os in aix4.[012]|aix4.[012].*)
|
||||
collect2name=`${CC} -print-prog-name=collect2`
|
||||
if test -f "$collect2name" && \
|
||||
strings "$collect2name" | grep resolve_lib_name >/dev/null
|
||||
then
|
||||
# We have reworked collect2
|
||||
:
|
||||
else
|
||||
# We have old collect2
|
||||
hardcode_direct=unsupported
|
||||
hardcode_minus_L=yes
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_libdir_separator=
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
# Begin _LT_AC_SYS_LIBPATH_AIX.
|
||||
echo 'int main () { return 0; }' > conftest.c
|
||||
${CC} ${LDFLAGS} conftest.c -o conftest
|
||||
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
|
||||
}'`
|
||||
if test -z "$aix_libpath"; then
|
||||
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
|
||||
}'`
|
||||
fi
|
||||
if test -z "$aix_libpath"; then
|
||||
aix_libpath="/usr/lib:/lib"
|
||||
fi
|
||||
rm -f conftest.c conftest
|
||||
# End _LT_AC_SYS_LIBPATH_AIX.
|
||||
if test "$aix_use_runtimelinking" = yes; then
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
|
||||
else
|
||||
if test "$host_cpu" = ia64; then
|
||||
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
|
||||
else
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# see comment about different semantics on the GNU ld section
|
||||
ld_shlibs=no
|
||||
;;
|
||||
bsdi[45]*)
|
||||
;;
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec=' '
|
||||
libext=lib
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
hardcode_direct=no
|
||||
if test "$GCC" = yes ; then
|
||||
:
|
||||
else
|
||||
case $cc_basename in
|
||||
xlc*)
|
||||
;;
|
||||
*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
dgux*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
freebsd1*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
freebsd2.2*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
freebsd2*)
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
freebsd* | dragonfly*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
hpux9*)
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
hpux10*)
|
||||
if test "$with_gnu_ld" = no; then
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
fi
|
||||
;;
|
||||
hpux11*)
|
||||
if test "$with_gnu_ld" = no; then
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
case $host_cpu in
|
||||
hppa*64*|ia64*)
|
||||
hardcode_direct=no
|
||||
;;
|
||||
*)
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
netbsd*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
newsos6)
|
||||
hardcode_direct=yes
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
openbsd*)
|
||||
if test -f /usr/libexec/ld.so; then
|
||||
hardcode_direct=yes
|
||||
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
else
|
||||
case "$host_os" in
|
||||
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
os2*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
osf3*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
osf4* | osf5*)
|
||||
if test "$GCC" = yes; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
else
|
||||
# Both cc and cxx compiler support -rpath directly
|
||||
hardcode_libdir_flag_spec='-rpath $libdir'
|
||||
fi
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
solaris*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
sunos4*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
sysv4)
|
||||
case $host_vendor in
|
||||
sni)
|
||||
hardcode_direct=yes # is this really true???
|
||||
;;
|
||||
siemens)
|
||||
hardcode_direct=no
|
||||
;;
|
||||
motorola)
|
||||
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sysv4.3*)
|
||||
;;
|
||||
sysv4*MP*)
|
||||
if test -d /usr/nec; then
|
||||
ld_shlibs=yes
|
||||
fi
|
||||
;;
|
||||
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6*)
|
||||
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
|
||||
hardcode_libdir_separator=':'
|
||||
;;
|
||||
uts4*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Check dynamic linker characteristics
|
||||
# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
|
||||
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
|
||||
# only about the one the linker finds when passed -lNAME. This is the last
|
||||
# element of library_names_spec in libtool.m4, or possibly two of them if the
|
||||
# linker has special search rules.
|
||||
library_names_spec= # the last element of library_names_spec in libtool.m4
|
||||
libname_spec='lib$name'
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
library_names_spec='$libname.a'
|
||||
;;
|
||||
aix[4-9]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
amigaos*)
|
||||
library_names_spec='$libname.a'
|
||||
;;
|
||||
beos*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
bsdi[45]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
shrext=.dll
|
||||
library_names_spec='$libname.dll.a $libname.lib'
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
shrext=.dylib
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
dgux*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
freebsd1*)
|
||||
;;
|
||||
freebsd* | dragonfly*)
|
||||
case "$host_os" in
|
||||
freebsd[123]*)
|
||||
library_names_spec='$libname$shrext$versuffix' ;;
|
||||
*)
|
||||
library_names_spec='$libname$shrext' ;;
|
||||
esac
|
||||
;;
|
||||
gnu*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
case $host_cpu in
|
||||
ia64*)
|
||||
shrext=.so
|
||||
;;
|
||||
hppa*64*)
|
||||
shrext=.sl
|
||||
;;
|
||||
*)
|
||||
shrext=.sl
|
||||
;;
|
||||
esac
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
interix[3-9]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
library_names_spec='$libname$shrext'
|
||||
case "$host_os" in
|
||||
irix5* | nonstopux*)
|
||||
libsuff= shlibsuff=
|
||||
;;
|
||||
*)
|
||||
case $LD in
|
||||
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
|
||||
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
|
||||
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
|
||||
*) libsuff= shlibsuff= ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
linux*oldld* | linux*aout* | linux*coff*)
|
||||
;;
|
||||
linux* | k*bsd*-gnu)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
knetbsd*-gnu)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
netbsd*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
newsos6)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
nto-qnx*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
openbsd*)
|
||||
library_names_spec='$libname$shrext$versuffix'
|
||||
;;
|
||||
os2*)
|
||||
libname_spec='$name'
|
||||
shrext=.dll
|
||||
library_names_spec='$libname.a'
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
rdos*)
|
||||
;;
|
||||
solaris*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sunos4*)
|
||||
library_names_spec='$libname$shrext$versuffix'
|
||||
;;
|
||||
sysv4 | sysv4.3*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
uts4*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
esac
|
||||
|
||||
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
|
||||
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
|
||||
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
|
||||
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
|
||||
|
||||
# How to pass a linker flag through the compiler.
|
||||
wl="$escaped_wl"
|
||||
|
||||
# Static library suffix (normally "a").
|
||||
libext="$libext"
|
||||
|
||||
# Shared library suffix (normally "so").
|
||||
shlibext="$shlibext"
|
||||
|
||||
# Format of library name prefix.
|
||||
libname_spec="$escaped_libname_spec"
|
||||
|
||||
# Library names that the linker finds when passed -lNAME.
|
||||
library_names_spec="$escaped_library_names_spec"
|
||||
|
||||
# Flag to hardcode \$libdir into a binary during linking.
|
||||
# This must work even if \$libdir does not exist.
|
||||
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
|
||||
|
||||
# Whether we need a single -rpath flag with a separated argument.
|
||||
hardcode_libdir_separator="$hardcode_libdir_separator"
|
||||
|
||||
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
|
||||
# resulting binary.
|
||||
hardcode_direct="$hardcode_direct"
|
||||
|
||||
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
|
||||
# resulting binary.
|
||||
hardcode_minus_L="$hardcode_minus_L"
|
||||
|
||||
EOF
|
||||
1807
build-aux/config.sub
vendored
Normal file
1807
build-aux/config.sub
vendored
Normal file
File diff suppressed because it is too large
Load Diff
791
build-aux/depcomp
Normal file
791
build-aux/depcomp
Normal file
@@ -0,0 +1,791 @@
|
||||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2013-05-30.07; # UTC
|
||||
|
||||
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
|
||||
|
||||
# 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 2, 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||
as side-effects.
|
||||
|
||||
Environment variables:
|
||||
depmode Dependency tracking mode.
|
||||
source Source file read by 'PROGRAMS ARGS'.
|
||||
object Object file output by 'PROGRAMS ARGS'.
|
||||
DEPDIR directory where to store dependencies.
|
||||
depfile Dependency file to output.
|
||||
tmpdepfile Temporary file to use when outputting dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
# Get the directory component of the given path, and save it in the
|
||||
# global variables '$dir'. Note that this directory component will
|
||||
# be either empty or ending with a '/' character. This is deliberate.
|
||||
set_dir_from ()
|
||||
{
|
||||
case $1 in
|
||||
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
|
||||
*) dir=;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Get the suffix-stripped basename of the given path, and save it the
|
||||
# global variable '$base'.
|
||||
set_base_from ()
|
||||
{
|
||||
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
|
||||
}
|
||||
|
||||
# If no dependency file was actually created by the compiler invocation,
|
||||
# we still have to create a dummy depfile, to avoid errors with the
|
||||
# Makefile "include basename.Plo" scheme.
|
||||
make_dummy_depfile ()
|
||||
{
|
||||
echo "#dummy" > "$depfile"
|
||||
}
|
||||
|
||||
# Factor out some common post-processing of the generated depfile.
|
||||
# Requires the auxiliary global variable '$tmpdepfile' to be set.
|
||||
aix_post_process_depfile ()
|
||||
{
|
||||
# If the compiler actually managed to produce a dependency file,
|
||||
# post-process it.
|
||||
if test -f "$tmpdepfile"; then
|
||||
# Each line is of the form 'foo.o: dependency.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# $object: dependency.h
|
||||
# and one to simply output
|
||||
# dependency.h:
|
||||
# which is needed to avoid the deleted-header problem.
|
||||
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
|
||||
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
|
||||
} > "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
}
|
||||
|
||||
# A tabulation character.
|
||||
tab=' '
|
||||
# A newline character.
|
||||
nl='
|
||||
'
|
||||
# Character ranges might be problematic outside the C locale.
|
||||
# These definitions help.
|
||||
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
lower=abcdefghijklmnopqrstuvwxyz
|
||||
digits=0123456789
|
||||
alpha=${upper}${lower}
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||
depfile=${depfile-`echo "$object" |
|
||||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Avoid interferences from the environment.
|
||||
gccflag= dashmflag=
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
cygpath_u="cygpath -u -f -"
|
||||
if test "$depmode" = msvcmsys; then
|
||||
# This is just like msvisualcpp but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvisualcpp
|
||||
fi
|
||||
|
||||
if test "$depmode" = msvc7msys; then
|
||||
# This is just like msvc7 but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvc7
|
||||
fi
|
||||
|
||||
if test "$depmode" = xlc; then
|
||||
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
|
||||
gccflag=-qmakedep=gcc,-MF
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
|
||||
## the command line argument order; so add the flags where they
|
||||
## appear in depend2.am. Note that the slowdown incurred here
|
||||
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
|
||||
*) set fnord "$@" "$arg" ;;
|
||||
esac
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
done
|
||||
"$@"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
|
||||
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
|
||||
## (see the conditional assignment to $gccflag above).
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say). Also, it might not be
|
||||
## supported by the other compilers which use the 'gcc' depmode.
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
# The second -e expression handles DOS-style file names with drive
|
||||
# letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the "deleted header file" problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
## Some versions of gcc put a space before the ':'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well. hp depmode also adds that space, but also prefixes the VPATH
|
||||
## to the object. Take care to not repeat it in the output.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
sgi)
|
||||
if test "$libtool" = yes; then
|
||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||
else
|
||||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like '#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
|
||||
| tr "$nl" ' ' >> "$depfile"
|
||||
echo >> "$depfile"
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> "$depfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
xlc)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts '$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$base.u
|
||||
tmpdepfile3=$dir.libs/$base.u
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$dir$base.u
|
||||
tmpdepfile3=$dir$base.u
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
aix_post_process_depfile
|
||||
;;
|
||||
|
||||
tcc)
|
||||
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
|
||||
# FIXME: That version still under development at the moment of writing.
|
||||
# Make that this statement remains true also for stable, released
|
||||
# versions.
|
||||
# It will wrap lines (doesn't matter whether long or short) with a
|
||||
# trailing '\', as in:
|
||||
#
|
||||
# foo.o : \
|
||||
# foo.c \
|
||||
# foo.h \
|
||||
#
|
||||
# It will put a trailing '\' even on the last line, and will use leading
|
||||
# spaces rather than leading tabs (at least since its commit 0394caf7
|
||||
# "Emit spaces for -MD").
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
|
||||
# We have to change lines of the first kind to '$object: \'.
|
||||
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
|
||||
# And for each line of the second kind, we have to emit a 'dep.h:'
|
||||
# dummy dependency, to avoid the deleted-header problem.
|
||||
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
## The order of this option in the case statement is important, since the
|
||||
## shell code in configure will try each of these formats in the order
|
||||
## listed in this file. A plain '-MD' option would be understood by many
|
||||
## compilers, so we must ensure this comes after the gcc and icc options.
|
||||
pgcc)
|
||||
# Portland's C compiler understands '-MD'.
|
||||
# Will always output deps to 'file.d' where file is the root name of the
|
||||
# source file under compilation, even if file resides in a subdirectory.
|
||||
# The object file name does not affect the name of the '.d' file.
|
||||
# pgcc 10.2 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using '\' :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
set_dir_from "$object"
|
||||
# Use the source, not the object, to determine the base name, since
|
||||
# that's sadly what pgcc will do too.
|
||||
set_base_from "$source"
|
||||
tmpdepfile=$base.d
|
||||
|
||||
# For projects that build the same source file twice into different object
|
||||
# files, the pgcc approach of using the *source* file root name can cause
|
||||
# problems in parallel builds. Use a locking strategy to avoid stomping on
|
||||
# the same $tmpdepfile.
|
||||
lockdir=$base.d-lock
|
||||
trap "
|
||||
echo '$0: caught signal, cleaning up...' >&2
|
||||
rmdir '$lockdir'
|
||||
exit 1
|
||||
" 1 2 13 15
|
||||
numtries=100
|
||||
i=$numtries
|
||||
while test $i -gt 0; do
|
||||
# mkdir is a portable test-and-set.
|
||||
if mkdir "$lockdir" 2>/dev/null; then
|
||||
# This process acquired the lock.
|
||||
"$@" -MD
|
||||
stat=$?
|
||||
# Release the lock.
|
||||
rmdir "$lockdir"
|
||||
break
|
||||
else
|
||||
# If the lock is being held by a different process, wait
|
||||
# until the winning process is done or we timeout.
|
||||
while test -d "$lockdir" && test $i -gt 0; do
|
||||
sleep 1
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
fi
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
trap - 1 2 13 15
|
||||
if test $i -le 0; then
|
||||
echo "$0: failed to acquire lock after $numtries attempts" >&2
|
||||
echo "$0: check lockdir '$lockdir'" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp2)
|
||||
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
|
||||
# compilers, which have integrated preprocessors. The correct option
|
||||
# to use with these is +Maked; it writes dependencies to a file named
|
||||
# 'foo.d', which lands next to the object file, wherever that
|
||||
# happens to be.
|
||||
# Much of this is similar to the tru64 case; see comments there.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir.libs/$base.d
|
||||
"$@" -Wc,+Maked
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
"$@" +Maked
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||
# Add 'dependent.h:' lines.
|
||||
sed -ne '2,${
|
||||
s/^ *//
|
||||
s/ \\*$//
|
||||
s/$/:/
|
||||
p
|
||||
}' "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in 'foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# Libtool generates 2 separate objects for the 2 libraries. These
|
||||
# two compilations output dependencies in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
|
||||
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
# Same post-processing that is required for AIX mode.
|
||||
aix_post_process_depfile
|
||||
;;
|
||||
|
||||
msvc7)
|
||||
if test "$libtool" = yes; then
|
||||
showIncludes=-Wc,-showIncludes
|
||||
else
|
||||
showIncludes=-showIncludes
|
||||
fi
|
||||
"$@" $showIncludes > "$tmpdepfile"
|
||||
stat=$?
|
||||
grep -v '^Note: including file: ' "$tmpdepfile"
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
# The first sed program below extracts the file names and escapes
|
||||
# backslashes for cygpath. The second sed program outputs the file
|
||||
# name when reading, but also accumulates all include files in the
|
||||
# hold buffer in order to output them again at the end. This only
|
||||
# works with sed implementations that can handle large buffers.
|
||||
sed < "$tmpdepfile" -n '
|
||||
/^Note: including file: *\(.*\)/ {
|
||||
s//\1/
|
||||
s/\\/\\\\/g
|
||||
p
|
||||
}' | $cygpath_u | sort -u | sed -n '
|
||||
s/ /\\ /g
|
||||
s/\(.*\)/'"$tab"'\1 \\/p
|
||||
s/.\(.*\) \\/\1:/
|
||||
H
|
||||
$ {
|
||||
s/.*/'"$tab"'/
|
||||
G
|
||||
p
|
||||
}' >> "$depfile"
|
||||
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvc7msys)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove '-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for ':'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this sed invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no eat=no
|
||||
for arg
|
||||
do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
if test $eat = yes; then
|
||||
eat=no
|
||||
continue
|
||||
fi
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-arch)
|
||||
eat=yes ;;
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix=`echo "$object" | sed 's/^.*\././'`
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
# makedepend may prepend the VPATH from the source file name to the object.
|
||||
# No need to regex-escape $object, excess matching of '.' is harmless.
|
||||
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process the last invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed '1,2d' "$tmpdepfile" \
|
||||
| tr ' ' "$nl" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove '-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E \
|
||||
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
| sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E 2>/dev/null |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
|
||||
echo "$tab" >> "$depfile"
|
||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvcmsys)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2011-04-20.01; # UTC
|
||||
scriptversion=2013-12-25.23; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
@@ -35,25 +35,21 @@ scriptversion=2011-04-20.01; # UTC
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# 'make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
|
||||
tab=' '
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
IFS=" $tab$nl"
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
# Set DOITPROG to "echo" to test this script.
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit=${DOITPROG-}
|
||||
if test -z "$doit"; then
|
||||
doit_exec=exec
|
||||
else
|
||||
doit_exec=$doit
|
||||
fi
|
||||
doit_exec=${doit:-exec}
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
@@ -68,17 +64,6 @@ mvprog=${MVPROG-mv}
|
||||
rmprog=${RMPROG-rm}
|
||||
stripprog=${STRIPPROG-strip}
|
||||
|
||||
posix_glob='?'
|
||||
initialize_posix_glob='
|
||||
test "$posix_glob" != "?" || {
|
||||
if (set -f) 2>/dev/null; then
|
||||
posix_glob=
|
||||
else
|
||||
posix_glob=:
|
||||
fi
|
||||
}
|
||||
'
|
||||
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
@@ -97,7 +82,7 @@ dir_arg=
|
||||
dst_arg=
|
||||
|
||||
copy_on_change=false
|
||||
no_target_directory=
|
||||
is_target_a_directory=possibly
|
||||
|
||||
usage="\
|
||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
@@ -120,7 +105,6 @@ Options:
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-S $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
|
||||
@@ -138,45 +122,57 @@ while test $# -ne 0; do
|
||||
-d) dir_arg=true;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift;;
|
||||
shift;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
case $mode in
|
||||
*' '* | *' '* | *'
|
||||
'* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
case $mode in
|
||||
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift;;
|
||||
shift;;
|
||||
|
||||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-S) stripcmd="$stripprog $2"
|
||||
shift;;
|
||||
-t)
|
||||
is_target_a_directory=always
|
||||
dst_arg=$2
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-t) dst_arg=$2
|
||||
shift;;
|
||||
|
||||
-T) no_target_directory=true;;
|
||||
-T) is_target_a_directory=never;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# We allow the use of options -d and -T together, by making -d
|
||||
# take the precedence; this is for compatibility with GNU install.
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
if test -n "$dst_arg"; then
|
||||
echo "$0: target directory not allowed when installing a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
@@ -190,6 +186,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||
fi
|
||||
shift # arg
|
||||
dst_arg=$arg
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -198,11 +198,20 @@ if test $# -eq 0; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call `install-sh -d' without argument.
|
||||
# It's OK to call 'install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
if test $# -gt 1 || test "$is_target_a_directory" = always; then
|
||||
if test ! -d "$dst_arg"; then
|
||||
echo "$0: $dst_arg: Is not a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
do_exit='(exit $ret); exit $ret'
|
||||
trap "ret=129; $do_exit" 1
|
||||
@@ -219,16 +228,16 @@ if test -z "$dir_arg"; then
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
@@ -236,9 +245,9 @@ fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names starting with `-'.
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $src in
|
||||
-*) src=./$src;;
|
||||
-* | [=\(\)!]) src=./$src;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
@@ -260,51 +269,20 @@ do
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dst=$dst_arg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst;;
|
||||
esac
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
if test "$is_target_a_directory" = never; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstdir_status=0
|
||||
else
|
||||
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||
dstdir=`
|
||||
(dirname "$dst") 2>/dev/null ||
|
||||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X"$dst" : 'X\(//\)[^/]' \| \
|
||||
X"$dst" : 'X\(//\)$' \| \
|
||||
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||
echo X"$dst" |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)[^/].*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\).*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
s/.*/./; q'
|
||||
`
|
||||
|
||||
dstdir=`dirname "$dst"`
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
@@ -315,74 +293,74 @@ do
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||
umask=`umask`
|
||||
case $stripcmd.$umask in
|
||||
# Optimize common cases.
|
||||
*[2367][2367]) mkdir_umask=$umask;;
|
||||
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||
umask=`umask`
|
||||
case $stripcmd.$umask in
|
||||
# Optimize common cases.
|
||||
*[2367][2367]) mkdir_umask=$umask;;
|
||||
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
mkdir_umask=`expr $umask + 22 \
|
||||
- $umask % 100 % 40 + $umask % 20 \
|
||||
- $umask % 10 % 4 + $umask % 2
|
||||
`;;
|
||||
*) mkdir_umask=$umask,go-w;;
|
||||
esac
|
||||
*[0-7])
|
||||
mkdir_umask=`expr $umask + 22 \
|
||||
- $umask % 100 % 40 + $umask % 20 \
|
||||
- $umask % 10 % 4 + $umask % 2
|
||||
`;;
|
||||
*) mkdir_umask=$umask,go-w;;
|
||||
esac
|
||||
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
mkdir_mode=
|
||||
fi
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
posix_mkdir=false
|
||||
case $umask in
|
||||
*[123567][0-7][0-7])
|
||||
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||
;;
|
||||
*)
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||
posix_mkdir=false
|
||||
case $umask in
|
||||
*[123567][0-7][0-7])
|
||||
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||
;;
|
||||
*)
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||
|
||||
if (umask $mkdir_umask &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writeable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/d" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac;;
|
||||
if (umask $mkdir_umask &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/d" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
@@ -392,53 +370,51 @@ do
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix='/';;
|
||||
-*) prefix='./';;
|
||||
*) prefix='';;
|
||||
/*) prefix='/';;
|
||||
[-=\(\)!]*) prefix='./';;
|
||||
*) prefix='';;
|
||||
esac
|
||||
|
||||
eval "$initialize_posix_glob"
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
$posix_glob set -f
|
||||
set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
$posix_glob set +f
|
||||
set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test -z "$d" && continue
|
||||
test X"$d" = X && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask=$mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask=$mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -473,15 +449,12 @@ do
|
||||
|
||||
# If -C, don't bother to copy if it wouldn't change the file.
|
||||
if $copy_on_change &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
|
||||
eval "$initialize_posix_glob" &&
|
||||
$posix_glob set -f &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
set -f &&
|
||||
set X $old && old=:$2:$4:$5:$6 &&
|
||||
set X $new && new=:$2:$4:$5:$6 &&
|
||||
$posix_glob set +f &&
|
||||
|
||||
set +f &&
|
||||
test "$old" = "$new" &&
|
||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||
then
|
||||
@@ -494,24 +467,24 @@ do
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
{
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
fi || exit 1
|
||||
|
||||
11147
build-aux/ltmain.sh
Normal file
11147
build-aux/ltmain.sh
Normal file
File diff suppressed because it is too large
Load Diff
58
build-aux/manconv.sh
Normal file
58
build-aux/manconv.sh
Normal file
@@ -0,0 +1,58 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
###############################################################################
|
||||
#
|
||||
# Wrapper for GNU groff to convert man pages to a few formats
|
||||
#
|
||||
# Usage: manconv.sh FORMAT [PAPER_SIZE] < in.1 > out.suffix
|
||||
#
|
||||
# FORMAT can be ascii, utf8, ps, or pdf. PAPER_SIZE can be anything that
|
||||
# groff accepts, e.g. a4 or letter. See groff_font(5). PAPER_SIZE defaults
|
||||
# to a4 and is used only when FORMAT is ps (PostScript) or pdf.
|
||||
#
|
||||
# Multiple man pages can be given at once e.g. to create a single PDF file
|
||||
# with continuous page numbering.
|
||||
#
|
||||
###############################################################################
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
FORMAT=$1
|
||||
PAPER=${2-a4}
|
||||
|
||||
# Make PostScript and PDF output more readable:
|
||||
# - Use 11 pt font instead of the default 10 pt.
|
||||
# - Use larger paragraph spacing than the default 0.4v (man(7) only).
|
||||
FONT=11
|
||||
PD=0.8
|
||||
|
||||
SED_PD="
|
||||
/^\\.TH /s/\$/\\
|
||||
.PD $PD/
|
||||
s/^\\.PD\$/.PD $PD/"
|
||||
|
||||
case $FORMAT in
|
||||
ascii)
|
||||
groff -t -mandoc -Tascii | col -bx
|
||||
;;
|
||||
utf8)
|
||||
groff -t -mandoc -Tutf8 | col -bx
|
||||
;;
|
||||
ps)
|
||||
sed "$SED_PD" | groff -dpaper=$PAPER -t -mandoc \
|
||||
-rC1 -rS$FONT -Tps -P-p$PAPER
|
||||
;;
|
||||
pdf)
|
||||
sed "$SED_PD" | groff -dpaper=$PAPER -t -mandoc \
|
||||
-rC1 -rS$FONT -Tps -P-p$PAPER | ps2pdf - -
|
||||
;;
|
||||
*)
|
||||
echo 'Invalid arguments' >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
215
build-aux/missing
Normal file
215
build-aux/missing
Normal file
@@ -0,0 +1,215 @@
|
||||
#! /bin/sh
|
||||
# Common wrapper for a few potentially missing GNU programs.
|
||||
|
||||
scriptversion=2013-10-28.13; # UTC
|
||||
|
||||
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
|
||||
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# 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 2, 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try '$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case $1 in
|
||||
|
||||
--is-lightweight)
|
||||
# Used by our autoconf macros to check whether the available missing
|
||||
# script is modern enough.
|
||||
exit 0
|
||||
;;
|
||||
|
||||
--run)
|
||||
# Back-compat with the calling convention used by older automake.
|
||||
shift
|
||||
;;
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
|
||||
to PROGRAM being missing or too old.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal autoconf autoheader autom4te automake makeinfo
|
||||
bison yacc flex lex help2man
|
||||
|
||||
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
|
||||
'g' are ignored when checking the name.
|
||||
|
||||
Send bug reports to <bug-automake@gnu.org>."
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing $scriptversion (GNU Automake)"
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: unknown '$1' option"
|
||||
echo 1>&2 "Try '$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# Run the given program, remember its exit status.
|
||||
"$@"; st=$?
|
||||
|
||||
# If it succeeded, we are done.
|
||||
test $st -eq 0 && exit 0
|
||||
|
||||
# Also exit now if we it failed (or wasn't found), and '--version' was
|
||||
# passed; such an option is passed most likely to detect whether the
|
||||
# program is present and works.
|
||||
case $2 in --version|--help) exit $st;; esac
|
||||
|
||||
# Exit code 63 means version mismatch. This often happens when the user
|
||||
# tries to use an ancient version of a tool on a file that requires a
|
||||
# minimum version.
|
||||
if test $st -eq 63; then
|
||||
msg="probably too old"
|
||||
elif test $st -eq 127; then
|
||||
# Program was missing.
|
||||
msg="missing on your system"
|
||||
else
|
||||
# Program was found and executed, but failed. Give up.
|
||||
exit $st
|
||||
fi
|
||||
|
||||
perl_URL=http://www.perl.org/
|
||||
flex_URL=http://flex.sourceforge.net/
|
||||
gnu_software_URL=http://www.gnu.org/software
|
||||
|
||||
program_details ()
|
||||
{
|
||||
case $1 in
|
||||
aclocal|automake)
|
||||
echo "The '$1' program is part of the GNU Automake package:"
|
||||
echo "<$gnu_software_URL/automake>"
|
||||
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
|
||||
echo "<$gnu_software_URL/autoconf>"
|
||||
echo "<$gnu_software_URL/m4/>"
|
||||
echo "<$perl_URL>"
|
||||
;;
|
||||
autoconf|autom4te|autoheader)
|
||||
echo "The '$1' program is part of the GNU Autoconf package:"
|
||||
echo "<$gnu_software_URL/autoconf/>"
|
||||
echo "It also requires GNU m4 and Perl in order to run:"
|
||||
echo "<$gnu_software_URL/m4/>"
|
||||
echo "<$perl_URL>"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
give_advice ()
|
||||
{
|
||||
# Normalize program name to check for.
|
||||
normalized_program=`echo "$1" | sed '
|
||||
s/^gnu-//; t
|
||||
s/^gnu//; t
|
||||
s/^g//; t'`
|
||||
|
||||
printf '%s\n' "'$1' is $msg."
|
||||
|
||||
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
|
||||
case $normalized_program in
|
||||
autoconf*)
|
||||
echo "You should only need it if you modified 'configure.ac',"
|
||||
echo "or m4 files included by it."
|
||||
program_details 'autoconf'
|
||||
;;
|
||||
autoheader*)
|
||||
echo "You should only need it if you modified 'acconfig.h' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'autoheader'
|
||||
;;
|
||||
automake*)
|
||||
echo "You should only need it if you modified 'Makefile.am' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'automake'
|
||||
;;
|
||||
aclocal*)
|
||||
echo "You should only need it if you modified 'acinclude.m4' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'aclocal'
|
||||
;;
|
||||
autom4te*)
|
||||
echo "You might have modified some maintainer files that require"
|
||||
echo "the 'autom4te' program to be rebuilt."
|
||||
program_details 'autom4te'
|
||||
;;
|
||||
bison*|yacc*)
|
||||
echo "You should only need it if you modified a '.y' file."
|
||||
echo "You may want to install the GNU Bison package:"
|
||||
echo "<$gnu_software_URL/bison/>"
|
||||
;;
|
||||
lex*|flex*)
|
||||
echo "You should only need it if you modified a '.l' file."
|
||||
echo "You may want to install the Fast Lexical Analyzer package:"
|
||||
echo "<$flex_URL>"
|
||||
;;
|
||||
help2man*)
|
||||
echo "You should only need it if you modified a dependency" \
|
||||
"of a man page."
|
||||
echo "You may want to install the GNU Help2man package:"
|
||||
echo "<$gnu_software_URL/help2man/>"
|
||||
;;
|
||||
makeinfo*)
|
||||
echo "You should only need it if you modified a '.texi' file, or"
|
||||
echo "any other file indirectly affecting the aspect of the manual."
|
||||
echo "You might want to install the Texinfo package:"
|
||||
echo "<$gnu_software_URL/texinfo/>"
|
||||
echo "The spurious makeinfo call might also be the consequence of"
|
||||
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
|
||||
echo "want to install GNU make:"
|
||||
echo "<$gnu_software_URL/make/>"
|
||||
;;
|
||||
*)
|
||||
echo "You might have modified some files without having the proper"
|
||||
echo "tools for further handling them. Check the 'README' file, it"
|
||||
echo "often tells you about the needed prerequisites for installing"
|
||||
echo "this package. You may also peek at any GNU archive site, in"
|
||||
echo "case some other package contains this missing '$1' program."
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
give_advice "$1" | sed -e '1s/^/WARNING: /' \
|
||||
-e '2,$s/^/ /' >&2
|
||||
|
||||
# Propagate the correct exit status (expected to be 127 for a program
|
||||
# not found, 63 for a program that failed due to version mismatch).
|
||||
exit $st
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
24
build-aux/version.sh
Normal file
24
build-aux/version.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Get the version string from version.h and print it out without
|
||||
# trailing newline. This makes it suitable for use in configure.ac.
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
sed -n 's/LZMA_VERSION_STABILITY_ALPHA/alpha/
|
||||
s/LZMA_VERSION_STABILITY_BETA/beta/
|
||||
s/LZMA_VERSION_STABILITY_STABLE//
|
||||
s/^#define LZMA_VERSION_[MPS][AIT][AJNT][A-Z]* //p' \
|
||||
src/liblzma/api/lzma/version.h \
|
||||
| tr '\n' '|' \
|
||||
| sed 's/|/./; s/|/./; s/|//g' \
|
||||
| tr -d '\r\n'
|
||||
@@ -1,40 +0,0 @@
|
||||
This software is copyrighted by the Regents of the University of
|
||||
California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState
|
||||
Corporation, Apple Inc. and other parties. The following terms apply to
|
||||
all files associated with the software unless explicitly disclaimed in
|
||||
individual files.
|
||||
|
||||
The authors hereby grant permission to use, copy, modify, distribute,
|
||||
and license this software and its documentation for any purpose, provided
|
||||
that existing copyright notices are retained in all copies and that this
|
||||
notice is included verbatim in any distributions. No written agreement,
|
||||
license, or royalty fee is required for any of the authorized uses.
|
||||
Modifications to this software may be copyrighted by their authors
|
||||
and need not follow the licensing terms described here, provided that
|
||||
the new terms are clearly indicated on the first page of each file where
|
||||
they apply.
|
||||
|
||||
IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
|
||||
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
||||
ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
|
||||
DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
|
||||
IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
|
||||
NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
|
||||
MODIFICATIONS.
|
||||
|
||||
GOVERNMENT USE: If you are acquiring this software on behalf of the
|
||||
U.S. government, the Government shall have only "Restricted Rights"
|
||||
in the software and related documentation as defined in the Federal
|
||||
Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
|
||||
are acquiring the software on behalf of the Department of Defense, the
|
||||
software shall be classified as "Commercial Computer Software" and the
|
||||
Government shall have only "Restricted Rights" as defined in Clause
|
||||
252.227-7013 (b) (3) of DFARs. Notwithstanding the foregoing, the
|
||||
authors grant the U.S. Government and others acting in its behalf
|
||||
permission to use and distribute the software in accordance with the
|
||||
terms specified in this license.
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* stdlib.h --
|
||||
*
|
||||
* Declares facilities exported by the "stdlib" portion of the C library.
|
||||
* This file isn't complete in the ANSI-C sense; it only declares things
|
||||
* that are needed by Tcl. This file is needed even on many systems with
|
||||
* their own stdlib.h (e.g. SunOS) because not all stdlib.h files declare
|
||||
* all the procedures needed here (such as strtod).
|
||||
*
|
||||
* Copyright (c) 1991 The Regents of the University of California.
|
||||
* Copyright (c) 1994-1998 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution of
|
||||
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#ifndef _STDLIB
|
||||
#define _STDLIB
|
||||
|
||||
extern void abort(void);
|
||||
extern double atof(const char *string);
|
||||
extern int atoi(const char *string);
|
||||
extern long atol(const char *string);
|
||||
extern char * calloc(unsigned int numElements, unsigned int size);
|
||||
extern void exit(int status);
|
||||
extern int free(char *blockPtr);
|
||||
extern char * getenv(const char *name);
|
||||
extern char * malloc(unsigned int numBytes);
|
||||
extern void qsort(void *base, int n, int size, int (*compar)(
|
||||
const void *element1, const void *element2));
|
||||
extern char * realloc(char *ptr, unsigned int numBytes);
|
||||
extern double strtod(const char *string, char **endPtr);
|
||||
extern long strtol(const char *string, char **endPtr, int base);
|
||||
extern unsigned long strtoul(const char *string, char **endPtr, int base);
|
||||
|
||||
#endif /* _STDLIB */
|
||||
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* unistd.h --
|
||||
*
|
||||
* Macros, constants and prototypes for Posix conformance.
|
||||
*
|
||||
* Copyright 1989 Regents of the University of California Permission to use,
|
||||
* copy, modify, and distribute this software and its documentation for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies. The University of California makes
|
||||
* no representations about the suitability of this software for any purpose.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
#ifndef _UNISTD
|
||||
#define _UNISTD
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Strict POSIX stuff goes here. Extensions go down below, in the ifndef
|
||||
* _POSIX_SOURCE section.
|
||||
*/
|
||||
|
||||
extern void _exit(int status);
|
||||
extern int access(const char *path, int mode);
|
||||
extern int chdir(const char *path);
|
||||
extern int chown(const char *path, uid_t owner, gid_t group);
|
||||
extern int close(int fd);
|
||||
extern int dup(int oldfd);
|
||||
extern int dup2(int oldfd, int newfd);
|
||||
extern int execl(const char *path, ...);
|
||||
extern int execle(const char *path, ...);
|
||||
extern int execlp(const char *file, ...);
|
||||
extern int execv(const char *path, char **argv);
|
||||
extern int execve(const char *path, char **argv, char **envp);
|
||||
extern int execvpw(const char *file, char **argv);
|
||||
extern pid_t fork(void);
|
||||
extern char * getcwd(char *buf, size_t size);
|
||||
extern gid_t getegid(void);
|
||||
extern uid_t geteuid(void);
|
||||
extern gid_t getgid(void);
|
||||
extern int getgroups(int bufSize, int *buffer);
|
||||
extern pid_t getpid(void);
|
||||
extern uid_t getuid(void);
|
||||
extern int isatty(int fd);
|
||||
extern long lseek(int fd, long offset, int whence);
|
||||
extern int pipe(int *fildes);
|
||||
extern int read(int fd, char *buf, size_t size);
|
||||
extern int setgid(gid_t group);
|
||||
extern int setuid(uid_t user);
|
||||
extern unsigned sleep(unsigned seconds);
|
||||
extern char * ttyname(int fd);
|
||||
extern int unlink(const char *path);
|
||||
extern int write(int fd, const char *buf, size_t size);
|
||||
|
||||
#ifndef _POSIX_SOURCE
|
||||
extern char * crypt(const char *, const char *);
|
||||
extern int fchown(int fd, uid_t owner, gid_t group);
|
||||
extern int flock(int fd, int operation);
|
||||
extern int ftruncate(int fd, unsigned long length);
|
||||
extern int ioctl(int fd, int request, ...);
|
||||
extern int readlink(const char *path, char *buf, int bufsize);
|
||||
extern int setegid(gid_t group);
|
||||
extern int seteuidw(uid_t user);
|
||||
extern int setreuid(int ruid, int euid);
|
||||
extern int symlink(const char *, const char *);
|
||||
extern int ttyslot(void);
|
||||
extern int truncate(const char *path, unsigned long length);
|
||||
extern int vfork(void);
|
||||
#endif /* _POSIX_SOURCE */
|
||||
|
||||
#endif /* _UNISTD */
|
||||
485
config.h.in
Normal file
485
config.h.in
Normal file
@@ -0,0 +1,485 @@
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define if building universal (internal helper macro) */
|
||||
#undef AC_APPLE_UNIVERSAL_BUILD
|
||||
|
||||
/* How many MiB of RAM to assume if the real amount cannot be determined. */
|
||||
#undef ASSUME_RAM
|
||||
|
||||
/* Define to 1 if translation of program messages to the user's native
|
||||
language is requested. */
|
||||
#undef ENABLE_NLS
|
||||
|
||||
/* Define to 1 if bswap_16 is available. */
|
||||
#undef HAVE_BSWAP_16
|
||||
|
||||
/* Define to 1 if bswap_32 is available. */
|
||||
#undef HAVE_BSWAP_32
|
||||
|
||||
/* Define to 1 if bswap_64 is available. */
|
||||
#undef HAVE_BSWAP_64
|
||||
|
||||
/* Define to 1 if you have the <byteswap.h> header file. */
|
||||
#undef HAVE_BYTESWAP_H
|
||||
|
||||
/* Define to 1 if the system has the type `CC_SHA256_CTX'. */
|
||||
#undef HAVE_CC_SHA256_CTX
|
||||
|
||||
/* Define to 1 if you have the `CC_SHA256_Init' function. */
|
||||
#undef HAVE_CC_SHA256_INIT
|
||||
|
||||
/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
|
||||
CoreFoundation framework. */
|
||||
#undef HAVE_CFLOCALECOPYCURRENT
|
||||
|
||||
/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
|
||||
the CoreFoundation framework. */
|
||||
#undef HAVE_CFPREFERENCESCOPYAPPVALUE
|
||||
|
||||
/* Define to 1 if crc32 integrity check is enabled. */
|
||||
#undef HAVE_CHECK_CRC32
|
||||
|
||||
/* Define to 1 if crc64 integrity check is enabled. */
|
||||
#undef HAVE_CHECK_CRC64
|
||||
|
||||
/* Define to 1 if sha256 integrity check is enabled. */
|
||||
#undef HAVE_CHECK_SHA256
|
||||
|
||||
/* Define to 1 if you have the `clock_gettime' function. */
|
||||
#undef HAVE_CLOCK_GETTIME
|
||||
|
||||
/* Define to 1 if you have the <CommonCrypto/CommonDigest.h> header file. */
|
||||
#undef HAVE_COMMONCRYPTO_COMMONDIGEST_H
|
||||
|
||||
/* Define if the GNU dcgettext() function is already present or preinstalled.
|
||||
*/
|
||||
#undef HAVE_DCGETTEXT
|
||||
|
||||
/* Define to 1 if you have the declaration of `CLOCK_MONOTONIC', and to 0 if
|
||||
you don't. */
|
||||
#undef HAVE_DECL_CLOCK_MONOTONIC
|
||||
|
||||
/* Define to 1 if you have the declaration of `program_invocation_name', and
|
||||
to 0 if you don't. */
|
||||
#undef HAVE_DECL_PROGRAM_INVOCATION_NAME
|
||||
|
||||
/* Define to 1 if arm decoder is enabled. */
|
||||
#undef HAVE_DECODER_ARM
|
||||
|
||||
/* Define to 1 if armthumb decoder is enabled. */
|
||||
#undef HAVE_DECODER_ARMTHUMB
|
||||
|
||||
/* Define to 1 if delta decoder is enabled. */
|
||||
#undef HAVE_DECODER_DELTA
|
||||
|
||||
/* Define to 1 if ia64 decoder is enabled. */
|
||||
#undef HAVE_DECODER_IA64
|
||||
|
||||
/* Define to 1 if lzma1 decoder is enabled. */
|
||||
#undef HAVE_DECODER_LZMA1
|
||||
|
||||
/* Define to 1 if lzma2 decoder is enabled. */
|
||||
#undef HAVE_DECODER_LZMA2
|
||||
|
||||
/* Define to 1 if powerpc decoder is enabled. */
|
||||
#undef HAVE_DECODER_POWERPC
|
||||
|
||||
/* Define to 1 if sparc decoder is enabled. */
|
||||
#undef HAVE_DECODER_SPARC
|
||||
|
||||
/* Define to 1 if x86 decoder is enabled. */
|
||||
#undef HAVE_DECODER_X86
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if arm encoder is enabled. */
|
||||
#undef HAVE_ENCODER_ARM
|
||||
|
||||
/* Define to 1 if armthumb encoder is enabled. */
|
||||
#undef HAVE_ENCODER_ARMTHUMB
|
||||
|
||||
/* Define to 1 if delta encoder is enabled. */
|
||||
#undef HAVE_ENCODER_DELTA
|
||||
|
||||
/* Define to 1 if ia64 encoder is enabled. */
|
||||
#undef HAVE_ENCODER_IA64
|
||||
|
||||
/* Define to 1 if lzma1 encoder is enabled. */
|
||||
#undef HAVE_ENCODER_LZMA1
|
||||
|
||||
/* Define to 1 if lzma2 encoder is enabled. */
|
||||
#undef HAVE_ENCODER_LZMA2
|
||||
|
||||
/* Define to 1 if powerpc encoder is enabled. */
|
||||
#undef HAVE_ENCODER_POWERPC
|
||||
|
||||
/* Define to 1 if sparc encoder is enabled. */
|
||||
#undef HAVE_ENCODER_SPARC
|
||||
|
||||
/* Define to 1 if x86 encoder is enabled. */
|
||||
#undef HAVE_ENCODER_X86
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define to 1 if you have the `futimens' function. */
|
||||
#undef HAVE_FUTIMENS
|
||||
|
||||
/* Define to 1 if you have the `futimes' function. */
|
||||
#undef HAVE_FUTIMES
|
||||
|
||||
/* Define to 1 if you have the `futimesat' function. */
|
||||
#undef HAVE_FUTIMESAT
|
||||
|
||||
/* Define to 1 if you have the <getopt.h> header file. */
|
||||
#undef HAVE_GETOPT_H
|
||||
|
||||
/* Define to 1 if you have the `getopt_long' function. */
|
||||
#undef HAVE_GETOPT_LONG
|
||||
|
||||
/* Define if the GNU gettext() function is already present or preinstalled. */
|
||||
#undef HAVE_GETTEXT
|
||||
|
||||
/* Define if you have the iconv() function and it works. */
|
||||
#undef HAVE_ICONV
|
||||
|
||||
/* Define to 1 if you have the <immintrin.h> header file. */
|
||||
#undef HAVE_IMMINTRIN_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#undef HAVE_LIMITS_H
|
||||
|
||||
/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
|
||||
#undef HAVE_MBRTOWC
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 to enable bt2 match finder. */
|
||||
#undef HAVE_MF_BT2
|
||||
|
||||
/* Define to 1 to enable bt3 match finder. */
|
||||
#undef HAVE_MF_BT3
|
||||
|
||||
/* Define to 1 to enable bt4 match finder. */
|
||||
#undef HAVE_MF_BT4
|
||||
|
||||
/* Define to 1 to enable hc3 match finder. */
|
||||
#undef HAVE_MF_HC3
|
||||
|
||||
/* Define to 1 to enable hc4 match finder. */
|
||||
#undef HAVE_MF_HC4
|
||||
|
||||
/* Define to 1 if you have the <minix/sha2.h> header file. */
|
||||
#undef HAVE_MINIX_SHA2_H
|
||||
|
||||
/* Define to 1 if getopt.h declares extern int optreset. */
|
||||
#undef HAVE_OPTRESET
|
||||
|
||||
/* Define to 1 if you have the `posix_fadvise' function. */
|
||||
#undef HAVE_POSIX_FADVISE
|
||||
|
||||
/* Define to 1 if you have the `pthread_condattr_setclock' function. */
|
||||
#undef HAVE_PTHREAD_CONDATTR_SETCLOCK
|
||||
|
||||
/* Have PTHREAD_PRIO_INHERIT. */
|
||||
#undef HAVE_PTHREAD_PRIO_INHERIT
|
||||
|
||||
/* Define to 1 if you have the `SHA256Init' function. */
|
||||
#undef HAVE_SHA256INIT
|
||||
|
||||
/* Define to 1 if the system has the type `SHA256_CTX'. */
|
||||
#undef HAVE_SHA256_CTX
|
||||
|
||||
/* Define to 1 if you have the <sha256.h> header file. */
|
||||
#undef HAVE_SHA256_H
|
||||
|
||||
/* Define to 1 if you have the `SHA256_Init' function. */
|
||||
#undef HAVE_SHA256_INIT
|
||||
|
||||
/* Define to 1 if the system has the type `SHA2_CTX'. */
|
||||
#undef HAVE_SHA2_CTX
|
||||
|
||||
/* Define to 1 if you have the <sha2.h> header file. */
|
||||
#undef HAVE_SHA2_H
|
||||
|
||||
/* Define to 1 if optimizing for size. */
|
||||
#undef HAVE_SMALL
|
||||
|
||||
/* Define to 1 if stdbool.h conforms to C99. */
|
||||
#undef HAVE_STDBOOL_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if `st_atimensec' is a member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_ATIMENSEC
|
||||
|
||||
/* Define to 1 if `st_atimespec.tv_nsec' is a member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC
|
||||
|
||||
/* Define to 1 if `st_atim.st__tim.tv_nsec' is a member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC
|
||||
|
||||
/* Define to 1 if `st_atim.tv_nsec' is a member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
|
||||
|
||||
/* Define to 1 if `st_uatime' is a member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_UATIME
|
||||
|
||||
/* Define to 1 if you have the <sys/byteorder.h> header file. */
|
||||
#undef HAVE_SYS_BYTEORDER_H
|
||||
|
||||
/* Define to 1 if you have the <sys/endian.h> header file. */
|
||||
#undef HAVE_SYS_ENDIAN_H
|
||||
|
||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if the system has the type `uintptr_t'. */
|
||||
#undef HAVE_UINTPTR_T
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if you have the `utime' function. */
|
||||
#undef HAVE_UTIME
|
||||
|
||||
/* Define to 1 if you have the `utimes' function. */
|
||||
#undef HAVE_UTIMES
|
||||
|
||||
/* Define to 1 or 0, depending whether the compiler supports simple visibility
|
||||
declarations. */
|
||||
#undef HAVE_VISIBILITY
|
||||
|
||||
/* Define to 1 if you have the `wcwidth' function. */
|
||||
#undef HAVE_WCWIDTH
|
||||
|
||||
/* Define to 1 if the system has the type `_Bool'. */
|
||||
#undef HAVE__BOOL
|
||||
|
||||
/* Define to 1 if _mm_movemask_epi8 is available. */
|
||||
#undef HAVE__MM_MOVEMASK_EPI8
|
||||
|
||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Define to 1 when using POSIX threads (pthreads). */
|
||||
#undef MYTHREAD_POSIX
|
||||
|
||||
/* Define to 1 when using Windows Vista compatible threads. This uses features
|
||||
that are not available on Windows XP. */
|
||||
#undef MYTHREAD_VISTA
|
||||
|
||||
/* Define to 1 when using Windows 95 (and thus XP) compatible threads. This
|
||||
avoids use of features that were added in Windows Vista. */
|
||||
#undef MYTHREAD_WIN95
|
||||
|
||||
/* Define to 1 to disable debugging code. */
|
||||
#undef NDEBUG
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define to necessary symbol if this constant uses a non-standard name on
|
||||
your system. */
|
||||
#undef PTHREAD_CREATE_JOINABLE
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#undef SIZEOF_SIZE_T
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define to 1 if the number of available CPU cores can be detected with
|
||||
cpuset(2). */
|
||||
#undef TUKLIB_CPUCORES_CPUSET
|
||||
|
||||
/* Define to 1 if the number of available CPU cores can be detected with
|
||||
pstat_getdynamic(). */
|
||||
#undef TUKLIB_CPUCORES_PSTAT_GETDYNAMIC
|
||||
|
||||
/* Define to 1 if the number of available CPU cores can be detected with
|
||||
sysconf(_SC_NPROCESSORS_ONLN) or sysconf(_SC_NPROC_ONLN). */
|
||||
#undef TUKLIB_CPUCORES_SYSCONF
|
||||
|
||||
/* Define to 1 if the number of available CPU cores can be detected with
|
||||
sysctl(). */
|
||||
#undef TUKLIB_CPUCORES_SYSCTL
|
||||
|
||||
/* Define to 1 if the system supports fast unaligned access to 16-bit and
|
||||
32-bit integers. */
|
||||
#undef TUKLIB_FAST_UNALIGNED_ACCESS
|
||||
|
||||
/* Define to 1 if the amount of physical memory can be detected with
|
||||
_system_configuration.physmem. */
|
||||
#undef TUKLIB_PHYSMEM_AIX
|
||||
|
||||
/* Define to 1 if the amount of physical memory can be detected with
|
||||
getinvent_r(). */
|
||||
#undef TUKLIB_PHYSMEM_GETINVENT_R
|
||||
|
||||
/* Define to 1 if the amount of physical memory can be detected with
|
||||
getsysinfo(). */
|
||||
#undef TUKLIB_PHYSMEM_GETSYSINFO
|
||||
|
||||
/* Define to 1 if the amount of physical memory can be detected with
|
||||
pstat_getstatic(). */
|
||||
#undef TUKLIB_PHYSMEM_PSTAT_GETSTATIC
|
||||
|
||||
/* Define to 1 if the amount of physical memory can be detected with
|
||||
sysconf(_SC_PAGESIZE) and sysconf(_SC_PHYS_PAGES). */
|
||||
#undef TUKLIB_PHYSMEM_SYSCONF
|
||||
|
||||
/* Define to 1 if the amount of physical memory can be detected with sysctl().
|
||||
*/
|
||||
#undef TUKLIB_PHYSMEM_SYSCTL
|
||||
|
||||
/* Define to 1 if the amount of physical memory can be detected with Linux
|
||||
sysinfo(). */
|
||||
#undef TUKLIB_PHYSMEM_SYSINFO
|
||||
|
||||
/* Enable extensions on AIX 3, Interix. */
|
||||
#ifndef _ALL_SOURCE
|
||||
# undef _ALL_SOURCE
|
||||
#endif
|
||||
/* Enable GNU extensions on systems that have them. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# undef _GNU_SOURCE
|
||||
#endif
|
||||
/* Enable threading extensions on Solaris. */
|
||||
#ifndef _POSIX_PTHREAD_SEMANTICS
|
||||
# undef _POSIX_PTHREAD_SEMANTICS
|
||||
#endif
|
||||
/* Enable extensions on HP NonStop. */
|
||||
#ifndef _TANDEM_SOURCE
|
||||
# undef _TANDEM_SOURCE
|
||||
#endif
|
||||
/* Enable general extensions on Solaris. */
|
||||
#ifndef __EXTENSIONS__
|
||||
# undef __EXTENSIONS__
|
||||
#endif
|
||||
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||
# if defined __BIG_ENDIAN__
|
||||
# define WORDS_BIGENDIAN 1
|
||||
# endif
|
||||
#else
|
||||
# ifndef WORDS_BIGENDIAN
|
||||
# undef WORDS_BIGENDIAN
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Enable large inode numbers on Mac OS X 10.5. */
|
||||
#ifndef _DARWIN_USE_64_BIT_INODE
|
||||
# define _DARWIN_USE_64_BIT_INODE 1
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#undef _FILE_OFFSET_BITS
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
#undef _LARGE_FILES
|
||||
|
||||
/* Define to 1 if on MINIX. */
|
||||
#undef _MINIX
|
||||
|
||||
/* Define to 2 if the system does not provide POSIX.1 features except with
|
||||
this defined. */
|
||||
#undef _POSIX_1_SOURCE
|
||||
|
||||
/* Define to 1 if you need to in order for `stat' and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
||||
|
||||
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
|
||||
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
|
||||
#define below would cause a syntax error. */
|
||||
#undef _UINT32_T
|
||||
|
||||
/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
|
||||
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
|
||||
#define below would cause a syntax error. */
|
||||
#undef _UINT64_T
|
||||
|
||||
/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
|
||||
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
|
||||
#define below would cause a syntax error. */
|
||||
#undef _UINT8_T
|
||||
|
||||
/* Define to rpl_ if the getopt replacement functions and variables should be
|
||||
used. */
|
||||
#undef __GETOPT_PREFIX
|
||||
|
||||
/* Define to the type of a signed integer type of width exactly 32 bits if
|
||||
such a type exists and the standard includes do not define it. */
|
||||
#undef int32_t
|
||||
|
||||
/* Define to the type of a signed integer type of width exactly 64 bits if
|
||||
such a type exists and the standard includes do not define it. */
|
||||
#undef int64_t
|
||||
|
||||
/* Define to the type of an unsigned integer type of width exactly 16 bits if
|
||||
such a type exists and the standard includes do not define it. */
|
||||
#undef uint16_t
|
||||
|
||||
/* Define to the type of an unsigned integer type of width exactly 32 bits if
|
||||
such a type exists and the standard includes do not define it. */
|
||||
#undef uint32_t
|
||||
|
||||
/* Define to the type of an unsigned integer type of width exactly 64 bits if
|
||||
such a type exists and the standard includes do not define it. */
|
||||
#undef uint64_t
|
||||
|
||||
/* Define to the type of an unsigned integer type of width exactly 8 bits if
|
||||
such a type exists and the standard includes do not define it. */
|
||||
#undef uint8_t
|
||||
|
||||
/* Define to the type of an unsigned integer type wide enough to hold a
|
||||
pointer, if such a type exists, and if the system does not define it. */
|
||||
#undef uintptr_t
|
||||
842
configure.ac
Normal file
842
configure.ac
Normal file
@@ -0,0 +1,842 @@
|
||||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
# NOTE: Don't add useless checks. autoscan detects this and that, but don't
|
||||
# let it confuse you. For example, we don't care about checking for behavior
|
||||
# of malloc(), stat(), or lstat(), since we don't use those functions in
|
||||
# a way that would cause the problems the autoconf macros check.
|
||||
|
||||
AC_PREREQ([2.64])
|
||||
|
||||
AC_INIT([XZ Utils], m4_esyscmd([/bin/sh build-aux/version.sh]),
|
||||
[lasse.collin@tukaani.org], [xz], [http://tukaani.org/xz/])
|
||||
AC_CONFIG_SRCDIR([src/liblzma/common/common.h])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CONFIG_HEADER([config.h])
|
||||
|
||||
echo
|
||||
echo "$PACKAGE_STRING"
|
||||
|
||||
echo
|
||||
echo "System type:"
|
||||
# This is needed to know if assembler optimizations can be used.
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
# We do some special things on Windows (32-bit or 64-bit) builds.
|
||||
case $host_os in
|
||||
mingw* | cygwin | msys) is_w32=yes ;;
|
||||
*) is_w32=no ;;
|
||||
esac
|
||||
AM_CONDITIONAL([COND_W32], [test "$is_w32" = yes])
|
||||
|
||||
# We need to use $EXEEXT with $(LN_S) when creating symlinks to
|
||||
# executables. Cygwin is an exception to this, since it is recommended
|
||||
# that symlinks don't have the .exe suffix. To make this work, we
|
||||
# define LN_EXEEXT.
|
||||
#
|
||||
# MSYS2 is treated the same way as Cygwin. It uses plain "msys" like
|
||||
# the original MSYS when building MSYS/MSYS2-binaries. Hopefully this
|
||||
# doesn't break things for the original MSYS developers. Note that this
|
||||
# doesn't affect normal MSYS/MSYS2 users building non-MSYS/MSYS2 binaries
|
||||
# since in that case the $host_os is usually mingw32.
|
||||
case $host_os in
|
||||
cygwin | msys) LN_EXEEXT= ;;
|
||||
*) LN_EXEEXT='$(EXEEXT)' ;;
|
||||
esac
|
||||
AC_SUBST([LN_EXEEXT])
|
||||
|
||||
echo
|
||||
echo "Configure options:"
|
||||
AM_CFLAGS=
|
||||
|
||||
|
||||
#############
|
||||
# Debugging #
|
||||
#############
|
||||
|
||||
AC_MSG_CHECKING([if debugging code should be compiled])
|
||||
AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Enable debugging code.]),
|
||||
[], enable_debug=no)
|
||||
if test "x$enable_debug" = xyes; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_DEFINE([NDEBUG], [1], [Define to 1 to disable debugging code.])
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
|
||||
###########
|
||||
# Filters #
|
||||
###########
|
||||
|
||||
m4_define([SUPPORTED_FILTERS], [lzma1,lzma2,delta,x86,powerpc,ia64,arm,armthumb,sparc])dnl
|
||||
m4_define([SIMPLE_FILTERS], [x86,powerpc,ia64,arm,armthumb,sparc])
|
||||
m4_define([LZ_FILTERS], [lzma1,lzma2])
|
||||
|
||||
m4_foreach([NAME], [SUPPORTED_FILTERS],
|
||||
[enable_filter_[]NAME=no
|
||||
enable_encoder_[]NAME=no
|
||||
enable_decoder_[]NAME=no
|
||||
])dnl
|
||||
|
||||
AC_MSG_CHECKING([which encoders to build])
|
||||
AC_ARG_ENABLE([encoders], AS_HELP_STRING([--enable-encoders=LIST],
|
||||
[Comma-separated list of encoders to build. Default=all.
|
||||
Available encoders:]
|
||||
m4_translit(m4_defn([SUPPORTED_FILTERS]), [,], [ ])),
|
||||
[], [enable_encoders=SUPPORTED_FILTERS])
|
||||
enable_encoders=`echo "$enable_encoders" | sed 's/,/ /g'`
|
||||
if test "x$enable_encoders" = xno || test "x$enable_encoders" = x; then
|
||||
AC_MSG_RESULT([(none)])
|
||||
else
|
||||
for arg in $enable_encoders
|
||||
do
|
||||
case $arg in m4_foreach([NAME], [SUPPORTED_FILTERS], [
|
||||
NAME)
|
||||
enable_filter_[]NAME=yes
|
||||
enable_encoder_[]NAME=yes
|
||||
AC_DEFINE(HAVE_ENCODER_[]m4_toupper(NAME), [1],
|
||||
[Define to 1 if] NAME [encoder is enabled.])
|
||||
;;])
|
||||
*)
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([unknown filter: $arg])
|
||||
;;
|
||||
esac
|
||||
done
|
||||
AC_MSG_RESULT([$enable_encoders])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([which decoders to build])
|
||||
AC_ARG_ENABLE([decoders], AS_HELP_STRING([--enable-decoders=LIST],
|
||||
[Comma-separated list of decoders to build. Default=all.
|
||||
Available decoders are the same as available encoders.]),
|
||||
[], [enable_decoders=SUPPORTED_FILTERS])
|
||||
enable_decoders=`echo "$enable_decoders" | sed 's/,/ /g'`
|
||||
if test "x$enable_decoders" = xno || test "x$enable_decoders" = x; then
|
||||
AC_MSG_RESULT([(none)])
|
||||
else
|
||||
for arg in $enable_decoders
|
||||
do
|
||||
case $arg in m4_foreach([NAME], [SUPPORTED_FILTERS], [
|
||||
NAME)
|
||||
enable_filter_[]NAME=yes
|
||||
enable_decoder_[]NAME=yes
|
||||
AC_DEFINE(HAVE_DECODER_[]m4_toupper(NAME), [1],
|
||||
[Define to 1 if] NAME [decoder is enabled.])
|
||||
;;])
|
||||
*)
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([unknown filter: $arg])
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# LZMA2 requires that LZMA1 is enabled.
|
||||
test "x$enable_encoder_lzma2" = xyes && enable_encoder_lzma1=yes
|
||||
test "x$enable_decoder_lzma2" = xyes && enable_decoder_lzma1=yes
|
||||
|
||||
AC_MSG_RESULT([$enable_decoders])
|
||||
fi
|
||||
|
||||
if test "x$enable_encoder_lzma2$enable_encoder_lzma1" = xyesno \
|
||||
|| test "x$enable_decoder_lzma2$enable_decoder_lzma1" = xyesno; then
|
||||
AC_MSG_ERROR([LZMA2 requires that LZMA1 is also enabled.])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(COND_MAIN_ENCODER, test "x$enable_encoders" != xno && test "x$enable_encoders" != x)
|
||||
AM_CONDITIONAL(COND_MAIN_DECODER, test "x$enable_decoders" != xno && test "x$enable_decoders" != x)
|
||||
|
||||
m4_foreach([NAME], [SUPPORTED_FILTERS],
|
||||
[AM_CONDITIONAL(COND_FILTER_[]m4_toupper(NAME), test "x$enable_filter_[]NAME" = xyes)
|
||||
AM_CONDITIONAL(COND_ENCODER_[]m4_toupper(NAME), test "x$enable_encoder_[]NAME" = xyes)
|
||||
AM_CONDITIONAL(COND_DECODER_[]m4_toupper(NAME), test "x$enable_decoder_[]NAME" = xyes)
|
||||
])dnl
|
||||
|
||||
# The so called "simple filters" share common code.
|
||||
enable_filter_simple=no
|
||||
enable_encoder_simple=no
|
||||
enable_decoder_simple=no
|
||||
m4_foreach([NAME], [SIMPLE_FILTERS],
|
||||
[test "x$enable_filter_[]NAME" = xyes && enable_filter_simple=yes
|
||||
test "x$enable_encoder_[]NAME" = xyes && enable_encoder_simple=yes
|
||||
test "x$enable_decoder_[]NAME" = xyes && enable_decoder_simple=yes
|
||||
])dnl
|
||||
AM_CONDITIONAL(COND_FILTER_SIMPLE, test "x$enable_filter_simple" = xyes)
|
||||
AM_CONDITIONAL(COND_ENCODER_SIMPLE, test "x$enable_encoder_simple" = xyes)
|
||||
AM_CONDITIONAL(COND_DECODER_SIMPLE, test "x$enable_decoder_simple" = xyes)
|
||||
|
||||
# LZ-based filters share common code.
|
||||
enable_filter_lz=no
|
||||
enable_encoder_lz=no
|
||||
enable_decoder_lz=no
|
||||
m4_foreach([NAME], [LZ_FILTERS],
|
||||
[test "x$enable_filter_[]NAME" = xyes && enable_filter_lz=yes
|
||||
test "x$enable_encoder_[]NAME" = xyes && enable_encoder_lz=yes
|
||||
test "x$enable_decoder_[]NAME" = xyes && enable_decoder_lz=yes
|
||||
])dnl
|
||||
AM_CONDITIONAL(COND_FILTER_LZ, test "x$enable_filter_lz" = xyes)
|
||||
AM_CONDITIONAL(COND_ENCODER_LZ, test "x$enable_encoder_lz" = xyes)
|
||||
AM_CONDITIONAL(COND_DECODER_LZ, test "x$enable_decoder_lz" = xyes)
|
||||
|
||||
|
||||
#################
|
||||
# Match finders #
|
||||
#################
|
||||
|
||||
m4_define([SUPPORTED_MATCH_FINDERS], [hc3,hc4,bt2,bt3,bt4])
|
||||
|
||||
m4_foreach([NAME], [SUPPORTED_MATCH_FINDERS],
|
||||
[enable_match_finder_[]NAME=no
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([which match finders to build])
|
||||
AC_ARG_ENABLE([match-finders], AS_HELP_STRING([--enable-match-finders=LIST],
|
||||
[Comma-separated list of match finders to build. Default=all.
|
||||
At least one match finder is required for encoding with
|
||||
the LZMA1 and LZMA2 filters. Available match finders:]
|
||||
m4_translit(m4_defn([SUPPORTED_MATCH_FINDERS]), [,], [ ])), [],
|
||||
[enable_match_finders=SUPPORTED_MATCH_FINDERS])
|
||||
enable_match_finders=`echo "$enable_match_finders" | sed 's/,/ /g'`
|
||||
if test "x$enable_encoder_lz" = xyes ; then
|
||||
for arg in $enable_match_finders
|
||||
do
|
||||
case $arg in m4_foreach([NAME], [SUPPORTED_MATCH_FINDERS], [
|
||||
NAME)
|
||||
enable_match_finder_[]NAME=yes
|
||||
AC_DEFINE(HAVE_MF_[]m4_toupper(NAME), [1],
|
||||
[Define to 1 to enable] NAME [match finder.])
|
||||
;;])
|
||||
*)
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([unknown match finder: $arg])
|
||||
;;
|
||||
esac
|
||||
done
|
||||
AC_MSG_RESULT([$enable_match_finders])
|
||||
else
|
||||
AC_MSG_RESULT([(none because not building any LZ-based encoder)])
|
||||
fi
|
||||
|
||||
|
||||
####################
|
||||
# Integrity checks #
|
||||
####################
|
||||
|
||||
m4_define([SUPPORTED_CHECKS], [crc32,crc64,sha256])
|
||||
|
||||
m4_foreach([NAME], [SUPPORTED_CHECKS],
|
||||
[enable_check_[]NAME=no
|
||||
])dnl
|
||||
|
||||
AC_MSG_CHECKING([which integrity checks to build])
|
||||
AC_ARG_ENABLE([checks], AS_HELP_STRING([--enable-checks=LIST],
|
||||
[Comma-separated list of integrity checks to build.
|
||||
Default=all. Available integrity checks:]
|
||||
m4_translit(m4_defn([SUPPORTED_CHECKS]), [,], [ ])),
|
||||
[], [enable_checks=SUPPORTED_CHECKS])
|
||||
enable_checks=`echo "$enable_checks" | sed 's/,/ /g'`
|
||||
if test "x$enable_checks" = xno || test "x$enable_checks" = x; then
|
||||
AC_MSG_RESULT([(none)])
|
||||
else
|
||||
for arg in $enable_checks
|
||||
do
|
||||
case $arg in m4_foreach([NAME], [SUPPORTED_CHECKS], [
|
||||
NAME)
|
||||
enable_check_[]NAME=yes
|
||||
AC_DEFINE(HAVE_CHECK_[]m4_toupper(NAME), [1],
|
||||
[Define to 1 if] NAME
|
||||
[integrity check is enabled.])
|
||||
;;])
|
||||
*)
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([unknown integrity check: $arg])
|
||||
;;
|
||||
esac
|
||||
done
|
||||
AC_MSG_RESULT([$enable_checks])
|
||||
fi
|
||||
if test "x$enable_check_crc32" = xno ; then
|
||||
AC_MSG_ERROR([For now, the CRC32 check must always be enabled.])
|
||||
fi
|
||||
|
||||
m4_foreach([NAME], [SUPPORTED_CHECKS],
|
||||
[AM_CONDITIONAL(COND_CHECK_[]m4_toupper(NAME), test "x$enable_check_[]NAME" = xyes)
|
||||
])dnl
|
||||
|
||||
|
||||
###########################
|
||||
# Assembler optimizations #
|
||||
###########################
|
||||
|
||||
AC_MSG_CHECKING([if assembler optimizations should be used])
|
||||
AC_ARG_ENABLE([assembler], AS_HELP_STRING([--disable-assembler],
|
||||
[Do not use assembler optimizations even if such exist
|
||||
for the architecture.]),
|
||||
[], [enable_assembler=yes])
|
||||
if test "x$enable_assembler" = xyes; then
|
||||
enable_assembler=no
|
||||
case $host_os in
|
||||
# Darwin should work too but only if not creating universal
|
||||
# binaries. Solaris x86 could work too but I cannot test.
|
||||
linux* | *bsd* | mingw* | cygwin | msys | *djgpp*)
|
||||
case $host_cpu in
|
||||
i?86) enable_assembler=x86 ;;
|
||||
x86_64) enable_assembler=x86_64 ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $enable_assembler in
|
||||
x86 | x86_64 | no)
|
||||
AC_MSG_RESULT([$enable_assembler])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([--enable-assembler accepts only `yes', `no', `x86', or `x86_64'.])
|
||||
;;
|
||||
esac
|
||||
AM_CONDITIONAL(COND_ASM_X86, test "x$enable_assembler" = xx86)
|
||||
AM_CONDITIONAL(COND_ASM_X86_64, test "x$enable_assembler" = xx86_64)
|
||||
|
||||
|
||||
#####################
|
||||
# Size optimization #
|
||||
#####################
|
||||
|
||||
AC_MSG_CHECKING([if small size is preferred over speed])
|
||||
AC_ARG_ENABLE([small], AS_HELP_STRING([--enable-small],
|
||||
[Make liblzma smaller and a little slower.
|
||||
This is disabled by default to optimize for speed.]),
|
||||
[], [enable_small=no])
|
||||
if test "x$enable_small" = xyes; then
|
||||
AC_DEFINE([HAVE_SMALL], [1], [Define to 1 if optimizing for size.])
|
||||
elif test "x$enable_small" != xno; then
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([--enable-small accepts only `yes' or `no'])
|
||||
fi
|
||||
AC_MSG_RESULT([$enable_small])
|
||||
AM_CONDITIONAL(COND_SMALL, test "x$enable_small" = xyes)
|
||||
|
||||
|
||||
#############
|
||||
# Threading #
|
||||
#############
|
||||
|
||||
AC_MSG_CHECKING([if threading support is wanted])
|
||||
AC_ARG_ENABLE([threads], AS_HELP_STRING([--enable-threads=METHOD],
|
||||
[Supported METHODS are `yes', `no', `posix', `win95', and
|
||||
`vista'. The default is `yes'. Using `no' together with
|
||||
--enable-small makes liblzma thread unsafe.]),
|
||||
[], [enable_threads=yes])
|
||||
|
||||
if test "x$enable_threads" = xyes; then
|
||||
case $host_os in
|
||||
mingw*)
|
||||
case $host_cpu in
|
||||
i?86) enable_threads=win95 ;;
|
||||
*) enable_threads=vista ;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
enable_threads=posix
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
case $enable_threads in
|
||||
posix | win95 | vista)
|
||||
AC_MSG_RESULT([yes, $enable_threads])
|
||||
;;
|
||||
no)
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([--enable-threads only accepts `yes', `no', `posix', `win95', or `vista'])
|
||||
;;
|
||||
esac
|
||||
|
||||
# The Win95 threading lacks thread-safe one-time initialization function.
|
||||
# It's better to disallow it instead of allowing threaded but thread-unsafe
|
||||
# build.
|
||||
if test "x$enable_small$enable_threads" = xyeswin95; then
|
||||
AC_MSG_ERROR([--enable-threads=win95 and --enable-small cannot be
|
||||
used at the same time])
|
||||
fi
|
||||
|
||||
# We use the actual result a little later.
|
||||
|
||||
|
||||
#########################
|
||||
# Assumed amount of RAM #
|
||||
#########################
|
||||
|
||||
# We use 128 MiB as default, because it will allow decompressing files
|
||||
# created with "xz -9". It would be slightly safer to guess a lower value,
|
||||
# but most systems, on which we don't have any way to determine the amount
|
||||
# of RAM, will probably have at least 128 MiB of RAM.
|
||||
AC_MSG_CHECKING([how much RAM to assume if the real amount is unknown])
|
||||
AC_ARG_ENABLE([assume-ram], AS_HELP_STRING([--enable-assume-ram=SIZE],
|
||||
[If and only if the real amount of RAM cannot be determined,
|
||||
assume SIZE MiB. The default is 128 MiB. This affects the
|
||||
default memory usage limit.]),
|
||||
[], [enable_assume_ram=128])
|
||||
assume_ram_check=`echo "$enable_assume_ram" | tr -d 0123456789`
|
||||
if test -z "$enable_assume_ram" || test -n "$assume_ram_check"; then
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([--enable-assume-ram accepts only an integer argument])
|
||||
fi
|
||||
AC_MSG_RESULT([$enable_assume_ram MiB])
|
||||
AC_DEFINE_UNQUOTED([ASSUME_RAM], [$enable_assume_ram],
|
||||
[How many MiB of RAM to assume if the real amount cannot
|
||||
be determined.])
|
||||
|
||||
|
||||
#########################
|
||||
# Components to install #
|
||||
#########################
|
||||
|
||||
AC_ARG_ENABLE([xz], [AS_HELP_STRING([--disable-xz],
|
||||
[do not build the xz tool])],
|
||||
[], [enable_xz=yes])
|
||||
AM_CONDITIONAL([COND_XZ], [test x$enable_xz != xno])
|
||||
|
||||
AC_ARG_ENABLE([xzdec], [AS_HELP_STRING([--disable-xzdec],
|
||||
[do not build xzdec])],
|
||||
[], [enable_xzdec=yes])
|
||||
AM_CONDITIONAL([COND_XZDEC], [test x$enable_xzdec != xno])
|
||||
|
||||
AC_ARG_ENABLE([lzmadec], [AS_HELP_STRING([--disable-lzmadec],
|
||||
[do not build lzmadec
|
||||
(it exists primarily for LZMA Utils compatibility)])],
|
||||
[], [enable_lzmadec=yes])
|
||||
AM_CONDITIONAL([COND_LZMADEC], [test x$enable_lzmadec != xno])
|
||||
|
||||
AC_ARG_ENABLE([lzmainfo], [AS_HELP_STRING([--disable-lzmainfo],
|
||||
[do not build lzmainfo
|
||||
(it exists primarily for LZMA Utils compatibility)])],
|
||||
[], [enable_lzmainfo=yes])
|
||||
AM_CONDITIONAL([COND_LZMAINFO], [test x$enable_lzmainfo != xno])
|
||||
|
||||
AC_ARG_ENABLE([lzma-links], [AS_HELP_STRING([--disable-lzma-links],
|
||||
[do not create symlinks for LZMA Utils compatibility])],
|
||||
[], [enable_lzma_links=yes])
|
||||
AM_CONDITIONAL([COND_LZMALINKS], [test x$enable_lzma_links != xno])
|
||||
|
||||
AC_ARG_ENABLE([scripts], [AS_HELP_STRING([--disable-scripts],
|
||||
[do not install the scripts xzdiff, xzgrep, xzless, xzmore,
|
||||
and their symlinks])],
|
||||
[], [enable_scripts=yes])
|
||||
AM_CONDITIONAL([COND_SCRIPTS], [test x$enable_scripts != xno])
|
||||
|
||||
AC_ARG_ENABLE([doc], [AS_HELP_STRING([--disable-doc],
|
||||
[do not install documentation files to docdir
|
||||
(man pages will still be installed)])],
|
||||
[], [enable_doc=yes])
|
||||
AM_CONDITIONAL([COND_DOC], [test x$enable_doc != xno])
|
||||
|
||||
|
||||
#####################
|
||||
# Symbol versioning #
|
||||
#####################
|
||||
|
||||
AC_MSG_CHECKING([if library symbol versioning should be used])
|
||||
AC_ARG_ENABLE([symbol-versions], [AS_HELP_STRING([--enable-symbol-versions],
|
||||
[Use symbol versioning for liblzma. Enabled by default on
|
||||
GNU/Linux, other GNU-based systems, and FreeBSD.])],
|
||||
[], [enable_symbol_versions=auto])
|
||||
if test "x$enable_symbol_versions" = xauto; then
|
||||
case $host_os in
|
||||
# NOTE: Even if one omits -gnu on GNU/Linux (e.g.
|
||||
# i486-slackware-linux), configure will (via config.sub)
|
||||
# append -gnu (e.g. i486-slackware-linux-gnu), and this
|
||||
# test will work correctly.
|
||||
gnu* | *-gnu* | freebsd*)
|
||||
enable_symbol_versions=yes
|
||||
;;
|
||||
*)
|
||||
enable_symbol_versions=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
AC_MSG_RESULT([$enable_symbol_versions])
|
||||
AM_CONDITIONAL([COND_SYMVERS], [test "x$enable_symbol_versions" = xyes])
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Checks for programs.
|
||||
###############################################################################
|
||||
|
||||
echo
|
||||
gl_POSIX_SHELL
|
||||
if test -z "$POSIX_SHELL" && test "x$enable_scripts" = xyes ; then
|
||||
AC_MSG_ERROR([No POSIX conforming shell (sh) was found.])
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Initializing Automake:"
|
||||
|
||||
# We don't use "subdir-objects" yet because it breaks "make distclean" when
|
||||
# dependencies are enabled (as of Automake 1.14.1) due to this bug:
|
||||
# http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17354
|
||||
# The -Wno-unsupported is used to silence warnings about missing
|
||||
# "subdir-objects".
|
||||
AM_INIT_AUTOMAKE([1.12 foreign tar-v7 filename-length-max=99 serial-tests -Wno-unsupported])
|
||||
AC_PROG_LN_S
|
||||
|
||||
AC_PROG_CC_C99
|
||||
if test x$ac_cv_prog_cc_c99 = xno ; then
|
||||
AC_MSG_ERROR([No C99 compiler was found.])
|
||||
fi
|
||||
|
||||
AM_PROG_CC_C_O
|
||||
AM_PROG_AS
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
|
||||
case $enable_threads in
|
||||
posix)
|
||||
echo
|
||||
echo "POSIX threading support:"
|
||||
AX_PTHREAD([:]) dnl We don't need the HAVE_PTHREAD macro.
|
||||
LIBS="$LIBS $PTHREAD_LIBS"
|
||||
AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
dnl NOTE: PTHREAD_CC is ignored. It would be useful on AIX,
|
||||
dnl but it's tricky to get it right together with
|
||||
dnl AC_PROG_CC_C99. Thus, this is handled by telling the
|
||||
dnl user in INSTALL to set the correct CC manually.
|
||||
|
||||
AC_DEFINE([MYTHREAD_POSIX], [1],
|
||||
[Define to 1 when using POSIX threads (pthreads).])
|
||||
|
||||
# These are nice to have but not mandatory.
|
||||
#
|
||||
# FIXME: xz uses clock_gettime if it is available and can do
|
||||
# it even when threading is disabled. Moving this outside
|
||||
# of pthread detection may be undesirable because then
|
||||
# liblzma may get linked against librt even when librt isn't
|
||||
# needed by liblzma.
|
||||
OLD_CFLAGS=$CFLAGS
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
AC_SEARCH_LIBS([clock_gettime], [rt])
|
||||
AC_CHECK_FUNCS([clock_gettime pthread_condattr_setclock])
|
||||
AC_CHECK_DECLS([CLOCK_MONOTONIC], [], [], [[#include <time.h>]])
|
||||
CFLAGS=$OLD_CFLAGS
|
||||
;;
|
||||
win95)
|
||||
AC_DEFINE([MYTHREAD_WIN95], [1], [Define to 1 when using
|
||||
Windows 95 (and thus XP) compatible threads.
|
||||
This avoids use of features that were added in
|
||||
Windows Vista.])
|
||||
;;
|
||||
vista)
|
||||
AC_DEFINE([MYTHREAD_VISTA], [1], [Define to 1 when using
|
||||
Windows Vista compatible threads. This uses
|
||||
features that are not available on Windows XP.])
|
||||
;;
|
||||
esac
|
||||
AM_CONDITIONAL([COND_THREADS], [test "x$enable_threads" != xno])
|
||||
|
||||
echo
|
||||
echo "Initializing Libtool:"
|
||||
LT_PREREQ([2.2])
|
||||
LT_INIT([win32-dll])
|
||||
LT_LANG([Windows Resource])
|
||||
|
||||
# This is a bit wrong since it is possible to request that only some libs
|
||||
# are built as shared. Using that feature isn't so common though, and this
|
||||
# breaks only on Windows (at least for now) if the user enables only some
|
||||
# libs as shared.
|
||||
AM_CONDITIONAL([COND_SHARED], [test "x$enable_shared" != xno])
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Checks for libraries.
|
||||
###############################################################################
|
||||
|
||||
echo
|
||||
echo "Initializing gettext:"
|
||||
AM_GNU_GETTEXT_VERSION([0.18])
|
||||
AM_GNU_GETTEXT([external])
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Checks for header files.
|
||||
###############################################################################
|
||||
|
||||
echo
|
||||
echo "System headers and functions:"
|
||||
|
||||
# There is currently no workarounds in this package if some of
|
||||
# these headers are missing.
|
||||
AC_CHECK_HEADERS([fcntl.h limits.h sys/time.h],
|
||||
[],
|
||||
[AC_MSG_ERROR([Required header file(s) are missing.])])
|
||||
|
||||
# This allows the use of the intrinsic functions if they are available.
|
||||
AC_CHECK_HEADERS([immintrin.h])
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
###############################################################################
|
||||
|
||||
dnl We don't need these as long as we need a C99 compiler anyway.
|
||||
dnl AC_C_INLINE
|
||||
dnl AC_C_RESTRICT
|
||||
|
||||
AC_HEADER_STDBOOL
|
||||
|
||||
AC_TYPE_UINT8_T
|
||||
AC_TYPE_UINT16_T
|
||||
AC_TYPE_INT32_T
|
||||
AC_TYPE_UINT32_T
|
||||
AC_TYPE_INT64_T
|
||||
AC_TYPE_UINT64_T
|
||||
AC_TYPE_UINTPTR_T
|
||||
|
||||
AC_CHECK_SIZEOF([size_t])
|
||||
|
||||
# The command line tool can copy high resolution timestamps if such
|
||||
# information is available in struct stat. Otherwise one second accuracy
|
||||
# is used.
|
||||
AC_CHECK_MEMBERS([
|
||||
struct stat.st_atim.tv_nsec,
|
||||
struct stat.st_atimespec.tv_nsec,
|
||||
struct stat.st_atimensec,
|
||||
struct stat.st_uatime,
|
||||
struct stat.st_atim.st__tim.tv_nsec])
|
||||
|
||||
AC_SYS_LARGEFILE
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Checks for library functions.
|
||||
###############################################################################
|
||||
|
||||
# Gnulib replacements as needed
|
||||
gl_GETOPT
|
||||
|
||||
# Find the best function to set timestamps.
|
||||
AC_CHECK_FUNCS([futimens futimes futimesat utimes utime], [break])
|
||||
|
||||
# This is nice to have but not mandatory.
|
||||
AC_CHECK_FUNCS([posix_fadvise])
|
||||
|
||||
TUKLIB_PROGNAME
|
||||
TUKLIB_INTEGER
|
||||
TUKLIB_PHYSMEM
|
||||
TUKLIB_CPUCORES
|
||||
TUKLIB_MBSTR
|
||||
|
||||
# Check for system-provided SHA-256. At least the following is supported:
|
||||
#
|
||||
# OS Headers Library Type Function
|
||||
# FreeBSD sys/types.h + sha256.h libmd SHA256_CTX SHA256_Init
|
||||
# NetBSD sys/types.h + sha2.h SHA256_CTX SHA256_Init
|
||||
# OpenBSD sys/types.h + sha2.h SHA2_CTX SHA256Init
|
||||
# Solaris sys/types.h + sha2.h libmd SHA256_CTX SHA256Init
|
||||
# MINIX 3 sys/types.h + minix/sha2.h libutil SHA256_CTX SHA256_Init
|
||||
# Darwin CommonCrypto/CommonDigest.h CC_SHA256_CTX CC_SHA256_Init
|
||||
#
|
||||
# Note that Darwin's CC_SHA256_Update takes buffer size as uint32_t instead
|
||||
# of size_t.
|
||||
#
|
||||
# We don't check for e.g. OpenSSL or libgcrypt because we don't want
|
||||
# to introduce dependencies to other packages by default. Maybe such
|
||||
# libraries could be supported via additional configure options though.
|
||||
#
|
||||
if test "x$enable_check_sha256" = "xyes"; then
|
||||
# Test for Common Crypto before others, because Darwin has sha256.h
|
||||
# too and we don't want to use that, because on older versions it
|
||||
# uses OpenSSL functions, whose SHA256_Init is not guaranteed to
|
||||
# succeed.
|
||||
sha256_header_found=no
|
||||
AC_CHECK_HEADERS(
|
||||
[CommonCrypto/CommonDigest.h sha256.h sha2.h minix/sha2.h],
|
||||
[sha256_header_found=yes ; break])
|
||||
if test "x$sha256_header_found" = xyes; then
|
||||
AC_CHECK_TYPES([CC_SHA256_CTX, SHA256_CTX, SHA2_CTX], [], [],
|
||||
[[#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H
|
||||
# include <CommonCrypto/CommonDigest.h>
|
||||
#endif
|
||||
#ifdef HAVE_SHA256_H
|
||||
# include <sha256.h>
|
||||
#endif
|
||||
#ifdef HAVE_SHA2_H
|
||||
# include <sha2.h>
|
||||
#endif
|
||||
#ifdef HAVE_MINIX_SHA2_H
|
||||
# include <minix/sha2.h>
|
||||
#endif]])
|
||||
AC_SEARCH_LIBS([SHA256_Init], [md util])
|
||||
AC_SEARCH_LIBS([SHA256Init], [md])
|
||||
AC_CHECK_FUNCS([CC_SHA256_Init SHA256_Init SHA256Init],
|
||||
[break])
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL([COND_INTERNAL_SHA256],
|
||||
[test "x$ac_cv_func_SHA256_Init" != xyes \
|
||||
&& test "x$ac_cv_func_SHA256Init" != xyes \
|
||||
&& test "x$ac_cv_func_CC_SHA256_Init" != xyes])
|
||||
|
||||
# Check for SSE2 intrinsics.
|
||||
AC_CHECK_DECL([_mm_movemask_epi8],
|
||||
[AC_DEFINE([HAVE__MM_MOVEMASK_EPI8], [1],
|
||||
[Define to 1 if _mm_movemask_epi8 is available.])],
|
||||
[],
|
||||
[#ifdef HAVE_IMMINTRIN_H
|
||||
#include <immintrin.h>
|
||||
#endif])
|
||||
|
||||
|
||||
###############################################################################
|
||||
# If using GCC, set some additional AM_CFLAGS:
|
||||
###############################################################################
|
||||
|
||||
if test "$GCC" = yes ; then
|
||||
echo
|
||||
echo "GCC extensions:"
|
||||
fi
|
||||
|
||||
# Always do the visibility check but don't set AM_CFLAGS on Windows.
|
||||
# This way things get set properly even on Windows.
|
||||
gl_VISIBILITY
|
||||
if test -n "$CFLAG_VISIBILITY" && test "$is_w32" = no; then
|
||||
AM_CFLAGS="$AM_CFLAGS $CFLAG_VISIBILITY"
|
||||
fi
|
||||
|
||||
if test "$GCC" = yes ; then
|
||||
# Enable as much warnings as possible. These commented warnings won't
|
||||
# work for this package though:
|
||||
# * -Wunreachable-code breaks several assert(0) cases, which are
|
||||
# backed up with "return LZMA_PROG_ERROR".
|
||||
# * -Wcast-qual would break various things where we need a non-const
|
||||
# pointer although we don't modify anything through it.
|
||||
# * -Wcast-align breaks optimized CRC32 and CRC64 implementation
|
||||
# on some architectures (not on x86), where this warning is bogus,
|
||||
# because we take care of correct alignment.
|
||||
# * -Winline, -Wdisabled-optimization, -Wunsafe-loop-optimizations
|
||||
# don't seem so useful here; at least the last one gives some
|
||||
# warnings which are not bugs.
|
||||
for NEW_FLAG in \
|
||||
-Wall \
|
||||
-Wextra \
|
||||
-Wvla \
|
||||
-Wformat=2 \
|
||||
-Winit-self \
|
||||
-Wmissing-include-dirs \
|
||||
-Wstrict-aliasing \
|
||||
-Wfloat-equal \
|
||||
-Wundef \
|
||||
-Wshadow \
|
||||
-Wpointer-arith \
|
||||
-Wbad-function-cast \
|
||||
-Wwrite-strings \
|
||||
-Wlogical-op \
|
||||
-Waggregate-return \
|
||||
-Wstrict-prototypes \
|
||||
-Wold-style-definition \
|
||||
-Wmissing-prototypes \
|
||||
-Wmissing-declarations \
|
||||
-Wmissing-noreturn \
|
||||
-Wredundant-decls
|
||||
do
|
||||
AC_MSG_CHECKING([if $CC accepts $NEW_FLAG])
|
||||
OLD_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $NEW_FLAG -Werror"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE(
|
||||
[void foo(void); void foo(void) { }])], [
|
||||
AM_CFLAGS="$AM_CFLAGS $NEW_FLAG"
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
CFLAGS="$OLD_CFLAGS"
|
||||
done
|
||||
|
||||
AC_ARG_ENABLE([werror],
|
||||
AS_HELP_STRING([--enable-werror], [Enable -Werror to abort
|
||||
compilation on all compiler warnings.]),
|
||||
[], [enable_werror=no])
|
||||
if test "x$enable_werror" = "xyes"; then
|
||||
AM_CFLAGS="$AM_CFLAGS -Werror"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Create the makefiles and config.h
|
||||
###############################################################################
|
||||
|
||||
echo
|
||||
|
||||
# Don't build the lib directory at all if we don't need any replacement
|
||||
# functions.
|
||||
AM_CONDITIONAL([COND_GNULIB], test -n "$LIBOBJS")
|
||||
|
||||
# Add default AM_CFLAGS.
|
||||
AC_SUBST([AM_CFLAGS])
|
||||
|
||||
# This is needed for src/scripts.
|
||||
xz=`echo xz | sed "$program_transform_name"`
|
||||
AC_SUBST([xz])
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Doxyfile
|
||||
Makefile
|
||||
po/Makefile.in
|
||||
lib/Makefile
|
||||
src/Makefile
|
||||
src/liblzma/Makefile
|
||||
src/liblzma/api/Makefile
|
||||
src/xz/Makefile
|
||||
src/xzdec/Makefile
|
||||
src/lzmainfo/Makefile
|
||||
src/scripts/Makefile
|
||||
tests/Makefile
|
||||
debug/Makefile
|
||||
])
|
||||
AC_CONFIG_FILES([src/scripts/xzdiff], [chmod +x src/scripts/xzdiff])
|
||||
AC_CONFIG_FILES([src/scripts/xzgrep], [chmod +x src/scripts/xzgrep])
|
||||
AC_CONFIG_FILES([src/scripts/xzmore], [chmod +x src/scripts/xzmore])
|
||||
AC_CONFIG_FILES([src/scripts/xzless], [chmod +x src/scripts/xzless])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
# Some warnings
|
||||
if test x$tuklib_cv_physmem_method = xunknown; then
|
||||
echo
|
||||
echo "WARNING:"
|
||||
echo "No supported method to detect the amount of RAM."
|
||||
echo "Consider using --enable-assume-ram (if you didn't already)"
|
||||
echo "or make a patch to add support for this operating system."
|
||||
fi
|
||||
|
||||
if test x$tuklib_cv_cpucores_method = xunknown; then
|
||||
echo
|
||||
echo "WARNING:"
|
||||
echo "No supported method to detect the number of CPU cores."
|
||||
fi
|
||||
|
||||
if test "x$enable_threads$enable_small" = xnoyes; then
|
||||
echo
|
||||
echo "NOTE:"
|
||||
echo "liblzma will be thread unsafe due the combination"
|
||||
echo "of --disable-threads --enable-small."
|
||||
fi
|
||||
30
debug/Makefile.am
Normal file
30
debug/Makefile.am
Normal file
@@ -0,0 +1,30 @@
|
||||
##
|
||||
## Author: Lasse Collin
|
||||
##
|
||||
## This file has been put into the public domain.
|
||||
## You can do whatever you want with this file.
|
||||
##
|
||||
|
||||
EXTRA_DIST = \
|
||||
translation.bash
|
||||
|
||||
noinst_PROGRAMS = \
|
||||
repeat \
|
||||
sync_flush \
|
||||
full_flush \
|
||||
memusage \
|
||||
crc32 \
|
||||
known_sizes \
|
||||
hex2bin
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/common \
|
||||
-I$(top_srcdir)/src/liblzma/api
|
||||
|
||||
LDADD = $(top_builddir)/src/liblzma/liblzma.la
|
||||
|
||||
if COND_GNULIB
|
||||
LDADD += $(top_builddir)/lib/libgnu.a
|
||||
endif
|
||||
|
||||
LDADD += $(LTLIBINTL)
|
||||
704
debug/Makefile.in
Normal file
704
debug/Makefile.in
Normal file
@@ -0,0 +1,704 @@
|
||||
# Makefile.in generated by automake 1.15 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
noinst_PROGRAMS = repeat$(EXEEXT) sync_flush$(EXEEXT) \
|
||||
full_flush$(EXEEXT) memusage$(EXEEXT) crc32$(EXEEXT) \
|
||||
known_sizes$(EXEEXT) hex2bin$(EXEEXT)
|
||||
@COND_GNULIB_TRUE@am__append_1 = $(top_builddir)/lib/libgnu.a
|
||||
subdir = debug
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \
|
||||
$(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettext.m4 \
|
||||
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
|
||||
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
|
||||
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
|
||||
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
||||
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
|
||||
$(top_srcdir)/m4/posix-shell.m4 $(top_srcdir)/m4/progtest.m4 \
|
||||
$(top_srcdir)/m4/tuklib_common.m4 \
|
||||
$(top_srcdir)/m4/tuklib_cpucores.m4 \
|
||||
$(top_srcdir)/m4/tuklib_integer.m4 \
|
||||
$(top_srcdir)/m4/tuklib_mbstr.m4 \
|
||||
$(top_srcdir)/m4/tuklib_physmem.m4 \
|
||||
$(top_srcdir)/m4/tuklib_progname.m4 \
|
||||
$(top_srcdir)/m4/visibility.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
PROGRAMS = $(noinst_PROGRAMS)
|
||||
crc32_SOURCES = crc32.c
|
||||
crc32_OBJECTS = crc32.$(OBJEXT)
|
||||
crc32_LDADD = $(LDADD)
|
||||
am__DEPENDENCIES_1 =
|
||||
crc32_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \
|
||||
$(am__append_1) $(am__DEPENDENCIES_1)
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
am__v_lt_1 =
|
||||
full_flush_SOURCES = full_flush.c
|
||||
full_flush_OBJECTS = full_flush.$(OBJEXT)
|
||||
full_flush_LDADD = $(LDADD)
|
||||
full_flush_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \
|
||||
$(am__append_1) $(am__DEPENDENCIES_1)
|
||||
hex2bin_SOURCES = hex2bin.c
|
||||
hex2bin_OBJECTS = hex2bin.$(OBJEXT)
|
||||
hex2bin_LDADD = $(LDADD)
|
||||
hex2bin_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \
|
||||
$(am__append_1) $(am__DEPENDENCIES_1)
|
||||
known_sizes_SOURCES = known_sizes.c
|
||||
known_sizes_OBJECTS = known_sizes.$(OBJEXT)
|
||||
known_sizes_LDADD = $(LDADD)
|
||||
known_sizes_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \
|
||||
$(am__append_1) $(am__DEPENDENCIES_1)
|
||||
memusage_SOURCES = memusage.c
|
||||
memusage_OBJECTS = memusage.$(OBJEXT)
|
||||
memusage_LDADD = $(LDADD)
|
||||
memusage_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \
|
||||
$(am__append_1) $(am__DEPENDENCIES_1)
|
||||
repeat_SOURCES = repeat.c
|
||||
repeat_OBJECTS = repeat.$(OBJEXT)
|
||||
repeat_LDADD = $(LDADD)
|
||||
repeat_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \
|
||||
$(am__append_1) $(am__DEPENDENCIES_1)
|
||||
sync_flush_SOURCES = sync_flush.c
|
||||
sync_flush_OBJECTS = sync_flush.$(OBJEXT)
|
||||
sync_flush_LDADD = $(LDADD)
|
||||
sync_flush_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \
|
||||
$(am__append_1) $(am__DEPENDENCIES_1)
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
AM_V_CC = $(am__v_CC_@AM_V@)
|
||||
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
|
||||
am__v_CC_0 = @echo " CC " $@;
|
||||
am__v_CC_1 =
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = crc32.c full_flush.c hex2bin.c known_sizes.c memusage.c \
|
||||
repeat.c sync_flush.c
|
||||
DIST_SOURCES = crc32.c full_flush.c hex2bin.c known_sizes.c memusage.c \
|
||||
repeat.c sync_flush.c
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in \
|
||||
$(top_srcdir)/build-aux/depcomp README
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_CFLAGS = @AM_CFLAGS@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCAS = @CCAS@
|
||||
CCASDEPMODE = @CCASDEPMODE@
|
||||
CCASFLAGS = @CCASFLAGS@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GETOPT_H = @GETOPT_H@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GMSGFMT_015 = @GMSGFMT_015@
|
||||
GREP = @GREP@
|
||||
HAVE_VISIBILITY = @HAVE_VISIBILITY@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBINTL = @LIBINTL@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_EXEEXT = @LN_EXEEXT@
|
||||
LN_S = @LN_S@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGFMT_015 = @MSGFMT_015@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
POSIX_SHELL = @POSIX_SHELL@
|
||||
POSUB = @POSUB@
|
||||
PREFERABLY_POSIX_SHELL = @PREFERABLY_POSIX_SHELL@
|
||||
PTHREAD_CC = @PTHREAD_CC@
|
||||
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
|
||||
PTHREAD_LIBS = @PTHREAD_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
RC = @RC@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
XGETTEXT_015 = @XGETTEXT_015@
|
||||
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
ax_pthread_config = @ax_pthread_config@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
xz = @xz@
|
||||
EXTRA_DIST = \
|
||||
translation.bash
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/common \
|
||||
-I$(top_srcdir)/src/liblzma/api
|
||||
|
||||
LDADD = $(top_builddir)/src/liblzma/liblzma.la $(am__append_1) \
|
||||
$(LTLIBINTL)
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign debug/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign debug/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list || exit $$?; \
|
||||
test -n "$(EXEEXT)" || exit 0; \
|
||||
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list
|
||||
|
||||
crc32$(EXEEXT): $(crc32_OBJECTS) $(crc32_DEPENDENCIES) $(EXTRA_crc32_DEPENDENCIES)
|
||||
@rm -f crc32$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(crc32_OBJECTS) $(crc32_LDADD) $(LIBS)
|
||||
|
||||
full_flush$(EXEEXT): $(full_flush_OBJECTS) $(full_flush_DEPENDENCIES) $(EXTRA_full_flush_DEPENDENCIES)
|
||||
@rm -f full_flush$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(full_flush_OBJECTS) $(full_flush_LDADD) $(LIBS)
|
||||
|
||||
hex2bin$(EXEEXT): $(hex2bin_OBJECTS) $(hex2bin_DEPENDENCIES) $(EXTRA_hex2bin_DEPENDENCIES)
|
||||
@rm -f hex2bin$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(hex2bin_OBJECTS) $(hex2bin_LDADD) $(LIBS)
|
||||
|
||||
known_sizes$(EXEEXT): $(known_sizes_OBJECTS) $(known_sizes_DEPENDENCIES) $(EXTRA_known_sizes_DEPENDENCIES)
|
||||
@rm -f known_sizes$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(known_sizes_OBJECTS) $(known_sizes_LDADD) $(LIBS)
|
||||
|
||||
memusage$(EXEEXT): $(memusage_OBJECTS) $(memusage_DEPENDENCIES) $(EXTRA_memusage_DEPENDENCIES)
|
||||
@rm -f memusage$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(memusage_OBJECTS) $(memusage_LDADD) $(LIBS)
|
||||
|
||||
repeat$(EXEEXT): $(repeat_OBJECTS) $(repeat_DEPENDENCIES) $(EXTRA_repeat_DEPENDENCIES)
|
||||
@rm -f repeat$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(repeat_OBJECTS) $(repeat_LDADD) $(LIBS)
|
||||
|
||||
sync_flush$(EXEEXT): $(sync_flush_OBJECTS) $(sync_flush_DEPENDENCIES) $(EXTRA_sync_flush_DEPENDENCIES)
|
||||
@rm -f sync_flush$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(sync_flush_OBJECTS) $(sync_flush_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc32.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/full_flush.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hex2bin.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/known_sizes.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memusage.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repeat.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_flush.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-am
|
||||
TAGS: tags
|
||||
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: ctags-am
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscopelist: cscopelist-am
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(PROGRAMS)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \
|
||||
ctags-am distclean distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags tags-am uninstall uninstall-am
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
17
debug/README
Normal file
17
debug/README
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
Debug tools
|
||||
-----------
|
||||
|
||||
This directory contains a few tiny programs that may be helpful when
|
||||
debugging XZ Utils.
|
||||
|
||||
These tools are not meant to be installed. Often one needs to edit
|
||||
the source code a little to make the programs do the wanted things.
|
||||
If you don't know how these programs could help you, it is likely
|
||||
that they really are useless to you.
|
||||
|
||||
These aren't intended to be used as example programs. They take some
|
||||
shortcuts here and there, which correct programs should not do. Many
|
||||
possible errors (especially I/O errors) are ignored. Don't report
|
||||
bugs or send patches to fix this kind of bugs.
|
||||
|
||||
39
debug/crc32.c
Normal file
39
debug/crc32.c
Normal file
@@ -0,0 +1,39 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file crc32.c
|
||||
/// \brief Primitive CRC32 calculation tool
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
#include "lzma.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
uint32_t crc = 0;
|
||||
|
||||
do {
|
||||
uint8_t buf[BUFSIZ];
|
||||
const size_t size = fread(buf, 1, sizeof(buf), stdin);
|
||||
crc = lzma_crc32(buf, size, crc);
|
||||
} while (!ferror(stdin) && !feof(stdin));
|
||||
|
||||
//printf("%08" PRIX32 "\n", crc);
|
||||
|
||||
// I want it little endian so it's easy to work with hex editor.
|
||||
printf("%02" PRIX32 " ", crc & 0xFF);
|
||||
printf("%02" PRIX32 " ", (crc >> 8) & 0xFF);
|
||||
printf("%02" PRIX32 " ", (crc >> 16) & 0xFF);
|
||||
printf("%02" PRIX32 " ", crc >> 24);
|
||||
printf("\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
103
debug/full_flush.c
Normal file
103
debug/full_flush.c
Normal file
@@ -0,0 +1,103 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file full_flush.c
|
||||
/// \brief Encode files using LZMA_FULL_FLUSH
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
#include "lzma.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define CHUNK 64
|
||||
|
||||
|
||||
static lzma_stream strm = LZMA_STREAM_INIT;
|
||||
static FILE *file_in;
|
||||
|
||||
|
||||
static void
|
||||
encode(size_t size, lzma_action action)
|
||||
{
|
||||
uint8_t in[CHUNK];
|
||||
uint8_t out[CHUNK];
|
||||
lzma_ret ret;
|
||||
|
||||
do {
|
||||
if (strm.avail_in == 0 && size > 0) {
|
||||
const size_t amount = my_min(size, CHUNK);
|
||||
strm.avail_in = fread(in, 1, amount, file_in);
|
||||
strm.next_in = in;
|
||||
size -= amount; // Intentionally not using avail_in.
|
||||
}
|
||||
|
||||
strm.next_out = out;
|
||||
strm.avail_out = CHUNK;
|
||||
|
||||
ret = lzma_code(&strm, size == 0 ? action : LZMA_RUN);
|
||||
|
||||
if (ret != LZMA_OK && ret != LZMA_STREAM_END) {
|
||||
fprintf(stderr, "%s:%u: %s: ret == %d\n",
|
||||
__FILE__, __LINE__, __func__, ret);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
fwrite(out, 1, CHUNK - strm.avail_out, stdout);
|
||||
|
||||
} while (size > 0 || strm.avail_out == 0);
|
||||
|
||||
if ((action == LZMA_RUN && ret != LZMA_OK)
|
||||
|| (action != LZMA_RUN && ret != LZMA_STREAM_END)) {
|
||||
fprintf(stderr, "%s:%u: %s: ret == %d\n",
|
||||
__FILE__, __LINE__, __func__, ret);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
file_in = argc > 1 ? fopen(argv[1], "rb") : stdin;
|
||||
|
||||
|
||||
// Config
|
||||
lzma_options_lzma opt_lzma;
|
||||
if (lzma_lzma_preset(&opt_lzma, 1)) {
|
||||
fprintf(stderr, "preset failed\n");
|
||||
exit(1);
|
||||
}
|
||||
lzma_filter filters[LZMA_FILTERS_MAX + 1];
|
||||
filters[0].id = LZMA_FILTER_LZMA2;
|
||||
filters[0].options = &opt_lzma;
|
||||
filters[1].id = LZMA_VLI_UNKNOWN;
|
||||
|
||||
// Init
|
||||
if (lzma_stream_encoder(&strm, filters, LZMA_CHECK_CRC32) != LZMA_OK) {
|
||||
fprintf(stderr, "init failed\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// if (lzma_easy_encoder(&strm, 1)) {
|
||||
// fprintf(stderr, "init failed\n");
|
||||
// exit(1);
|
||||
// }
|
||||
|
||||
// Encoding
|
||||
encode(0, LZMA_FULL_FLUSH);
|
||||
encode(6, LZMA_FULL_FLUSH);
|
||||
encode(0, LZMA_FULL_FLUSH);
|
||||
encode(7, LZMA_FULL_FLUSH);
|
||||
encode(0, LZMA_FULL_FLUSH);
|
||||
encode(0, LZMA_FINISH);
|
||||
|
||||
// Clean up
|
||||
lzma_end(&strm);
|
||||
|
||||
return 0;
|
||||
}
|
||||
53
debug/hex2bin.c
Normal file
53
debug/hex2bin.c
Normal file
@@ -0,0 +1,53 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file hex2bin.c
|
||||
/// \brief Converts hexadecimal input strings to binary
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
static int
|
||||
getbin(int x)
|
||||
{
|
||||
if (x >= '0' && x <= '9')
|
||||
return x - '0';
|
||||
|
||||
if (x >= 'A' && x <= 'F')
|
||||
return x - 'A' + 10;
|
||||
|
||||
return x - 'a' + 10;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
while (true) {
|
||||
int byte = getchar();
|
||||
if (byte == EOF)
|
||||
return 0;
|
||||
if (!isxdigit(byte))
|
||||
continue;
|
||||
|
||||
const int digit = getchar();
|
||||
if (digit == EOF || !isxdigit(digit)) {
|
||||
fprintf(stderr, "Invalid input\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
byte = (getbin(byte) << 4) | getbin(digit);
|
||||
if (putchar(byte) == EOF) {
|
||||
perror(NULL);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
129
debug/known_sizes.c
Normal file
129
debug/known_sizes.c
Normal file
@@ -0,0 +1,129 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file known_sizes.c
|
||||
/// \brief Encodes .lzma Stream with sizes known in Block Header
|
||||
///
|
||||
/// The input file is encoded in RAM, and the known Compressed Size
|
||||
/// and/or Uncompressed Size values are stored in the Block Header.
|
||||
/// As of writing there's no such Stream encoder in liblzma.
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
#include "lzma.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/unistd.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
// Support file sizes up to 1 MiB. We use this for output space too, so files
|
||||
// close to 1 MiB had better compress at least a little or we have a buffer
|
||||
// overflow.
|
||||
#define BUFFER_SIZE (1U << 20)
|
||||
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
// Allocate the buffers.
|
||||
uint8_t *in = malloc(BUFFER_SIZE);
|
||||
uint8_t *out = malloc(BUFFER_SIZE);
|
||||
if (in == NULL || out == NULL)
|
||||
return 1;
|
||||
|
||||
// Fill the input buffer.
|
||||
const size_t in_size = fread(in, 1, BUFFER_SIZE, stdin);
|
||||
|
||||
// Filter setup
|
||||
lzma_options_lzma opt_lzma;
|
||||
if (lzma_lzma_preset(&opt_lzma, 1))
|
||||
return 1;
|
||||
|
||||
lzma_filter filters[] = {
|
||||
{
|
||||
.id = LZMA_FILTER_LZMA2,
|
||||
.options = &opt_lzma
|
||||
},
|
||||
{
|
||||
.id = LZMA_VLI_UNKNOWN
|
||||
}
|
||||
};
|
||||
|
||||
lzma_block block = {
|
||||
.check = LZMA_CHECK_CRC32,
|
||||
.compressed_size = BUFFER_SIZE, // Worst case reserve
|
||||
.uncompressed_size = in_size,
|
||||
.filters = filters,
|
||||
};
|
||||
|
||||
lzma_stream strm = LZMA_STREAM_INIT;
|
||||
if (lzma_block_encoder(&strm, &block) != LZMA_OK)
|
||||
return 1;
|
||||
|
||||
// Reserve space for Stream Header and Block Header. We need to
|
||||
// calculate the size of the Block Header first.
|
||||
if (lzma_block_header_size(&block) != LZMA_OK)
|
||||
return 1;
|
||||
|
||||
size_t out_size = LZMA_STREAM_HEADER_SIZE + block.header_size;
|
||||
|
||||
strm.next_in = in;
|
||||
strm.avail_in = in_size;
|
||||
strm.next_out = out + out_size;
|
||||
strm.avail_out = BUFFER_SIZE - out_size;
|
||||
|
||||
if (lzma_code(&strm, LZMA_FINISH) != LZMA_STREAM_END)
|
||||
return 1;
|
||||
|
||||
out_size += strm.total_out;
|
||||
|
||||
if (lzma_block_header_encode(&block, out + LZMA_STREAM_HEADER_SIZE)
|
||||
!= LZMA_OK)
|
||||
return 1;
|
||||
|
||||
lzma_index *idx = lzma_index_init(NULL);
|
||||
if (idx == NULL)
|
||||
return 1;
|
||||
|
||||
if (lzma_index_append(idx, NULL, block.header_size + strm.total_out,
|
||||
strm.total_in) != LZMA_OK)
|
||||
return 1;
|
||||
|
||||
if (lzma_index_encoder(&strm, idx) != LZMA_OK)
|
||||
return 1;
|
||||
|
||||
if (lzma_code(&strm, LZMA_RUN) != LZMA_STREAM_END)
|
||||
return 1;
|
||||
|
||||
out_size += strm.total_out;
|
||||
|
||||
lzma_end(&strm);
|
||||
|
||||
lzma_index_end(idx, NULL);
|
||||
|
||||
// Encode the Stream Header and Stream Footer. backwards_size is
|
||||
// needed only for the Stream Footer.
|
||||
lzma_stream_flags sf = {
|
||||
.backward_size = strm.total_out,
|
||||
.check = block.check,
|
||||
};
|
||||
|
||||
if (lzma_stream_header_encode(&sf, out) != LZMA_OK)
|
||||
return 1;
|
||||
|
||||
if (lzma_stream_footer_encode(&sf, out + out_size) != LZMA_OK)
|
||||
return 1;
|
||||
|
||||
out_size += LZMA_STREAM_HEADER_SIZE;
|
||||
|
||||
// Write out the file.
|
||||
fwrite(out, 1, out_size, stdout);
|
||||
|
||||
return 0;
|
||||
}
|
||||
51
debug/memusage.c
Normal file
51
debug/memusage.c
Normal file
@@ -0,0 +1,51 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file memusage.c
|
||||
/// \brief Calculates memory usage using lzma_memory_usage()
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
#include "lzma.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
lzma_options_lzma lzma = {
|
||||
.dict_size = (1U << 30) + (1U << 29),
|
||||
.lc = 3,
|
||||
.lp = 0,
|
||||
.pb = 2,
|
||||
.preset_dict = NULL,
|
||||
.preset_dict_size = 0,
|
||||
.mode = LZMA_MODE_NORMAL,
|
||||
.nice_len = 48,
|
||||
.mf = LZMA_MF_BT4,
|
||||
.depth = 0,
|
||||
};
|
||||
|
||||
/*
|
||||
lzma_options_filter filters[] = {
|
||||
{ LZMA_FILTER_LZMA1,
|
||||
(lzma_options_lzma *)&lzma_preset_lzma[6 - 1] },
|
||||
{ UINT64_MAX, NULL }
|
||||
};
|
||||
*/
|
||||
lzma_filter filters[] = {
|
||||
{ LZMA_FILTER_LZMA1, &lzma },
|
||||
{ UINT64_MAX, NULL }
|
||||
};
|
||||
|
||||
printf("Encoder: %10" PRIu64 " B\n",
|
||||
lzma_raw_encoder_memusage(filters));
|
||||
printf("Decoder: %10" PRIu64 " B\n",
|
||||
lzma_raw_decoder_memusage(filters));
|
||||
|
||||
return 0;
|
||||
}
|
||||
36
debug/repeat.c
Normal file
36
debug/repeat.c
Normal file
@@ -0,0 +1,36 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file repeat.c
|
||||
/// \brief Repeats given string given times
|
||||
///
|
||||
/// This program can be useful when debugging run-length encoder in
|
||||
/// the Subblock filter, especially the condition when repeat count
|
||||
/// doesn't fit into 28-bit integer.
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
if (argc != 3) {
|
||||
fprintf(stderr, "Usage: %s COUNT STRING\n", argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
unsigned long long count = strtoull(argv[1], NULL, 10);
|
||||
const size_t size = strlen(argv[2]);
|
||||
|
||||
while (count-- != 0)
|
||||
fwrite(argv[2], 1, size, stdout);
|
||||
|
||||
return !!(ferror(stdout) || fclose(stdout));
|
||||
}
|
||||
125
debug/sync_flush.c
Normal file
125
debug/sync_flush.c
Normal file
@@ -0,0 +1,125 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file sync_flush.c
|
||||
/// \brief Encode files using LZMA_SYNC_FLUSH
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "sysdefs.h"
|
||||
#include "lzma.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define CHUNK 64
|
||||
|
||||
|
||||
static lzma_stream strm = LZMA_STREAM_INIT;
|
||||
static FILE *file_in;
|
||||
|
||||
|
||||
static void
|
||||
encode(size_t size, lzma_action action)
|
||||
{
|
||||
uint8_t in[CHUNK];
|
||||
uint8_t out[CHUNK];
|
||||
lzma_ret ret;
|
||||
|
||||
do {
|
||||
if (strm.avail_in == 0 && size > 0) {
|
||||
const size_t amount = my_min(size, CHUNK);
|
||||
strm.avail_in = fread(in, 1, amount, file_in);
|
||||
strm.next_in = in;
|
||||
size -= amount; // Intentionally not using avail_in.
|
||||
}
|
||||
|
||||
strm.next_out = out;
|
||||
strm.avail_out = CHUNK;
|
||||
|
||||
ret = lzma_code(&strm, size == 0 ? action : LZMA_RUN);
|
||||
|
||||
if (ret != LZMA_OK && ret != LZMA_STREAM_END) {
|
||||
fprintf(stderr, "%s:%u: %s: ret == %d\n",
|
||||
__FILE__, __LINE__, __func__, ret);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
fwrite(out, 1, CHUNK - strm.avail_out, stdout);
|
||||
|
||||
} while (size > 0 || strm.avail_out == 0);
|
||||
|
||||
if ((action == LZMA_RUN && ret != LZMA_OK)
|
||||
|| (action != LZMA_RUN && ret != LZMA_STREAM_END)) {
|
||||
fprintf(stderr, "%s:%u: %s: ret == %d\n",
|
||||
__FILE__, __LINE__, __func__, ret);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
file_in = argc > 1 ? fopen(argv[1], "rb") : stdin;
|
||||
|
||||
// Config
|
||||
lzma_options_lzma opt_lzma = {
|
||||
.dict_size = 1U << 16,
|
||||
.lc = LZMA_LC_DEFAULT,
|
||||
.lp = LZMA_LP_DEFAULT,
|
||||
.pb = LZMA_PB_DEFAULT,
|
||||
.preset_dict = NULL,
|
||||
.mode = LZMA_MODE_NORMAL,
|
||||
.nice_len = 32,
|
||||
.mf = LZMA_MF_HC3,
|
||||
.depth = 0,
|
||||
};
|
||||
|
||||
lzma_options_delta opt_delta = {
|
||||
.dist = 16
|
||||
};
|
||||
|
||||
lzma_filter filters[LZMA_FILTERS_MAX + 1];
|
||||
filters[0].id = LZMA_FILTER_LZMA2;
|
||||
filters[0].options = &opt_lzma;
|
||||
filters[1].id = LZMA_VLI_UNKNOWN;
|
||||
|
||||
// Init
|
||||
if (lzma_stream_encoder(&strm, filters, LZMA_CHECK_CRC32) != LZMA_OK) {
|
||||
fprintf(stderr, "init failed\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Encoding
|
||||
encode(0, LZMA_SYNC_FLUSH);
|
||||
encode(6, LZMA_SYNC_FLUSH);
|
||||
encode(0, LZMA_SYNC_FLUSH);
|
||||
encode(7, LZMA_SYNC_FLUSH);
|
||||
encode(0, LZMA_SYNC_FLUSH);
|
||||
encode(0, LZMA_FINISH);
|
||||
|
||||
/*
|
||||
encode(53, LZMA_SYNC_FLUSH);
|
||||
opt_lzma.lc = 2;
|
||||
opt_lzma.lp = 1;
|
||||
opt_lzma.pb = 0;
|
||||
if (lzma_filters_update(&strm, filters) != LZMA_OK) {
|
||||
fprintf(stderr, "update failed\n");
|
||||
exit(1);
|
||||
}
|
||||
encode(404, LZMA_FINISH);
|
||||
*/
|
||||
|
||||
// Clean up
|
||||
lzma_end(&strm);
|
||||
|
||||
return 0;
|
||||
|
||||
// Prevent useless warnings so we don't need to have special CFLAGS
|
||||
// to disable -Werror.
|
||||
(void)opt_lzma;
|
||||
(void)opt_delta;
|
||||
}
|
||||
100
debug/translation.bash
Normal file
100
debug/translation.bash
Normal file
@@ -0,0 +1,100 @@
|
||||
#!/bin/bash
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Script to check output of some translated messages
|
||||
#
|
||||
# This should be useful for translators to check that the translated strings
|
||||
# look good. This doesn't make xz print all possible strings, but it should
|
||||
# cover most of the cases where mistakes can easily happen.
|
||||
#
|
||||
# Give the path and filename of the xz executable as an argument. If no
|
||||
# arguments are given, this script uses ../src/xz/xz (relative to the
|
||||
# location of this script).
|
||||
#
|
||||
# You may want to pipe the output of this script to less -S to view the
|
||||
# tables printed by xz --list on a 80-column terminal. On the other hand,
|
||||
# viewing the other messages may be better without -S.
|
||||
#
|
||||
###############################################################################
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
set -e
|
||||
|
||||
# If an argument was given, use it to set the location of the xz executable.
|
||||
unset XZ
|
||||
if [ -n "$1" ]; then
|
||||
XZ=$1
|
||||
[ "x${XZ:0:1}" != "x/" ] && XZ="$PWD/$XZ"
|
||||
fi
|
||||
|
||||
# Locate top_srcdir and go there.
|
||||
top_srcdir="$(cd -- "$(dirname -- "$0")" && cd .. && pwd)"
|
||||
cd -- "$top_srcdir"
|
||||
|
||||
# If XZ wasn't already set, use the default location.
|
||||
XZ=${XZ-"$PWD/src/xz/xz"}
|
||||
if [ "$(type -t "$XZ" || true)" != "file" ]; then
|
||||
echo "Give the location of the xz executable as an argument" \
|
||||
"to this script."
|
||||
exit 1
|
||||
fi
|
||||
XZ=$(type -p -- "$XZ")
|
||||
|
||||
# Print the xz version and locale information.
|
||||
echo "$XZ --version"
|
||||
"$XZ" --version
|
||||
echo
|
||||
if [ -d .git ] && type git > /dev/null 2>&1; then
|
||||
echo "Source code version in $PWD:"
|
||||
git describe --abbrev=4
|
||||
fi
|
||||
echo
|
||||
locale
|
||||
echo
|
||||
|
||||
# Make the test files directory the current directory.
|
||||
cd tests/files
|
||||
|
||||
# Put xz in PATH so that argv[0] stays short.
|
||||
PATH=${XZ%/*}:$PATH
|
||||
|
||||
# Some of the test commands are error messages and thus don't
|
||||
# return successfully.
|
||||
set +e
|
||||
|
||||
for CMD in \
|
||||
"xz --foobarbaz" \
|
||||
"xz --memlimit=123abcd" \
|
||||
"xz --memlimit=40MiB -6 /dev/null" \
|
||||
"xz --memlimit=0 --info-memory" \
|
||||
"xz --memlimit-compress=1234MiB --memlimit-decompress=50MiB --info-memory" \
|
||||
"xz --verbose --verbose /dev/null | cat" \
|
||||
"xz --lzma2=foobarbaz" \
|
||||
"xz --lzma2=foobarbaz=abcd" \
|
||||
"xz --lzma2=mf=abcd" \
|
||||
"xz --lzma2=preset=foobarbaz" \
|
||||
"xz --lzma2=mf=bt4,nice=2" \
|
||||
"xz --lzma2=nice=50000" \
|
||||
"xz --help" \
|
||||
"xz --long-help" \
|
||||
"xz --list good-*lzma2*" \
|
||||
"xz --list good-1-check*" \
|
||||
"xz --list --verbose good-*lzma2*" \
|
||||
"xz --list --verbose good-1-check*" \
|
||||
"xz --list --verbose --verbose good-*lzma2*" \
|
||||
"xz --list --verbose --verbose good-1-check*" \
|
||||
"xz --list --verbose --verbose unsupported-check.xz"
|
||||
do
|
||||
echo "-----------------------------------------------------------"
|
||||
echo
|
||||
echo "\$ $CMD"
|
||||
eval "$CMD"
|
||||
echo
|
||||
done 2>&1
|
||||
294
doc/3DBorder.3
294
doc/3DBorder.3
@@ -1,294 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1990-1993 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1998 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_Alloc3DBorderFromObj 3 8.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_Alloc3DBorderFromObj, Tk_Get3DBorder, Tk_Get3DBorderFromObj, Tk_Draw3DRectangle, Tk_Fill3DRectangle, Tk_Draw3DPolygon, Tk_Fill3DPolygon, Tk_3DVerticalBevel, Tk_3DHorizontalBevel, Tk_SetBackgroundFromBorder, Tk_NameOf3DBorder, Tk_3DBorderColor, Tk_3DBorderGC, Tk_Free3DBorderFromObj, Tk_Free3DBorder \- draw borders with three-dimensional appearance
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
Tk_3DBorder
|
||||
\fBTk_Alloc3DBorderFromObj(\fIinterp, tkwin, objPtr\fB)\fR
|
||||
.sp
|
||||
Tk_3DBorder
|
||||
\fBTk_Get3DBorder(\fIinterp, tkwin, colorName\fB)\fR
|
||||
.sp
|
||||
Tk_3DBorder
|
||||
\fBTk_Get3DBorderFromObj(\fItkwin, objPtr\fB)\fR
|
||||
.sp
|
||||
void
|
||||
\fBTk_Draw3DRectangle(\fItkwin, drawable, border, x, y, width, height, borderWidth, relief\fB)\fR
|
||||
.sp
|
||||
void
|
||||
\fBTk_Fill3DRectangle(\fItkwin, drawable, border, x, y, width, height, borderWidth, relief\fB)\fR
|
||||
.sp
|
||||
void
|
||||
\fBTk_Draw3DPolygon(\fItkwin, drawable, border, pointPtr, numPoints, polyBorderWidth, leftRelief\fB)\fR
|
||||
.sp
|
||||
void
|
||||
\fBTk_Fill3DPolygon(\fItkwin, drawable, border, pointPtr, numPoints, polyBorderWidth, leftRelief\fB)\fR
|
||||
.sp
|
||||
void
|
||||
\fBTk_3DVerticalBevel\fR(\fItkwin, drawable, border, x, y, width, height, leftBevel, relief\fB)\fR
|
||||
.sp
|
||||
void
|
||||
\fBTk_3DHorizontalBevel\fR(\fItkwin, drawable, border, x, y, width, height, leftIn, rightIn, topBevel, relief\fB)\fR
|
||||
.sp
|
||||
void
|
||||
\fBTk_SetBackgroundFromBorder(\fItkwin, border\fB)\fR
|
||||
.sp
|
||||
const char *
|
||||
\fBTk_NameOf3DBorder(\fIborder\fB)\fR
|
||||
.sp
|
||||
XColor *
|
||||
\fBTk_3DBorderColor(\fIborder\fB)\fR
|
||||
.sp
|
||||
GC *
|
||||
\fBTk_3DBorderGC(\fItkwin, border, which\fB)\fR
|
||||
.sp
|
||||
\fBTk_Free3DBorderFromObj(\fItkwin, objPtr\fB)\fR
|
||||
.sp
|
||||
\fBTk_Free3DBorder(\fIborder\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS "Tk_3DBorder" borderWidth
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for error reporting.
|
||||
.AP Tk_Window tkwin in
|
||||
Token for window (for all procedures except \fBTk_Get3DBorder\fR,
|
||||
must be the window for which the border was allocated).
|
||||
.AP Tcl_Obj *objPtr in
|
||||
Pointer to value whose value describes color corresponding to
|
||||
background (flat areas). Illuminated edges will be brighter than
|
||||
this and shadowed edges will be darker than this.
|
||||
.AP char *colorName in
|
||||
Same as \fIobjPtr\fR except value is supplied as a string rather
|
||||
than a value.
|
||||
.AP Drawable drawable in
|
||||
X token for window or pixmap; indicates where graphics are to be drawn.
|
||||
Must either be the X window for \fItkwin\fR or a pixmap with the
|
||||
same screen and depth as \fItkwin\fR.
|
||||
.AP Tk_3DBorder border in
|
||||
Token for border previously allocated in call to \fBTk_Get3DBorder\fR.
|
||||
.AP int x in
|
||||
X-coordinate of upper-left corner of rectangle describing border
|
||||
or bevel, in pixels.
|
||||
.AP int y in
|
||||
Y-coordinate of upper-left corner of rectangle describing border or
|
||||
bevel, in pixels.
|
||||
.AP int width in
|
||||
Width of rectangle describing border or bevel, in pixels.
|
||||
.AP int height in
|
||||
Height of rectangle describing border or bevel, in pixels.
|
||||
.AP int borderWidth in
|
||||
Width of border in pixels. Positive means border is inside rectangle
|
||||
given by \fIx\fR, \fIy\fR, \fIwidth\fR, \fIheight\fR, negative means
|
||||
border is outside rectangle.
|
||||
.AP int relief in
|
||||
Indicates 3-D position of interior of value relative to exterior;
|
||||
should be \fBTK_RELIEF_RAISED\fR, \fBTK_RELIEF_SUNKEN\fR, \fBTK_RELIEF_GROOVE\fR,
|
||||
\fBTK_RELIEF_SOLID\fR, or \fBTK_RELIEF_RIDGE\fR (may also be \fBTK_RELIEF_FLAT\fR
|
||||
for \fBTk_Fill3DRectangle\fR).
|
||||
.AP XPoint *pointPtr in
|
||||
Pointer to array of points describing the set of vertices in a polygon.
|
||||
The polygon need not be closed (it will be closed automatically if it
|
||||
is not).
|
||||
.AP int numPoints in
|
||||
Number of points at \fI*pointPtr\fR.
|
||||
.AP int polyBorderWidth in
|
||||
Width of border in pixels. If positive, border is drawn to left of
|
||||
trajectory given by \fIpointPtr\fR; if negative, border is drawn to
|
||||
right of trajectory. If \fIleftRelief\fR is \fBTK_RELIEF_GROOVE\fR or
|
||||
\fBTK_RELIEF_RIDGE\fR then the border is centered on the trajectory.
|
||||
.AP int leftRelief in
|
||||
Height of left side of polygon's path relative to right. \fBTK_RELIEF_RAISED\fR
|
||||
means left side should appear higher and \fBTK_RELIEF_SUNKEN\fR means right side
|
||||
should appear higher;
|
||||
\fBTK_RELIEF_GROOVE\fR and \fBTK_RELIEF_RIDGE\fR mean the obvious things.
|
||||
For \fBTk_Fill3DPolygon\fR, \fBTK_RELIEF_FLAT\fR may also be specified to
|
||||
indicate no difference in height.
|
||||
.AP int leftBevel in
|
||||
Non-zero means this bevel forms the left side of the value; zero means
|
||||
it forms the right side.
|
||||
.AP int leftIn in
|
||||
Non-zero means that the left edge of the horizontal bevel angles in,
|
||||
so that the bottom of the edge is farther to the right than
|
||||
the top.
|
||||
Zero means the edge angles out, so that the bottom is farther to the
|
||||
left than the top.
|
||||
.AP int rightIn in
|
||||
Non-zero means that the right edge of the horizontal bevel angles in,
|
||||
so that the bottom of the edge is farther to the left than the top.
|
||||
Zero means the edge angles out, so that the bottom is farther to the
|
||||
right than the top.
|
||||
.AP int topBevel in
|
||||
Non-zero means this bevel forms the top side of the value; zero means
|
||||
it forms the bottom side.
|
||||
.AP int which in
|
||||
Specifies which of the border's graphics contexts is desired.
|
||||
Must be \fBTK_3D_FLAT_GC\fR, \fBTK_3D_LIGHT_GC\fR, or \fBTK_3D_DARK_GC\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures provide facilities for drawing window borders in a
|
||||
way that produces a three-dimensional appearance.
|
||||
\fBTk_Alloc3DBorderFromObj\fR
|
||||
allocates colors and Pixmaps needed to draw a border in the window
|
||||
given by the \fItkwin\fR argument. The value of \fIobjPtr\fR
|
||||
is a standard Tk color name that determines the border colors.
|
||||
The color indicated by \fIobjPtr\fR will not actually be used in
|
||||
the border; it indicates the background color for the window
|
||||
(i.e. a color for flat surfaces).
|
||||
The illuminated portions of the border will appear brighter than indicated
|
||||
by \fIobjPtr\fR, and the shadowed portions of the border will appear
|
||||
darker than \fIobjPtr\fR.
|
||||
.PP
|
||||
\fBTk_Alloc3DBorderFromObj\fR returns a token that may be used in later calls
|
||||
to \fBTk_Draw3DRectangle\fR. If an error occurs in allocating information
|
||||
for the border (e.g. a bogus color name was given)
|
||||
then NULL is returned and an error message is left as the result of
|
||||
interpreter \fIinterp\fR.
|
||||
If it returns successfully, \fBTk_Alloc3DBorderFromObj\fR caches
|
||||
information about the return value in \fIobjPtr\fR, which speeds up
|
||||
future calls to \fBTk_Alloc3DBorderFromObj\fR with the same \fIobjPtr\fR
|
||||
and \fItkwin\fR.
|
||||
.PP
|
||||
\fBTk_Get3DBorder\fR is identical to \fBTk_Alloc3DBorderFromObj\fR except
|
||||
that the color is specified with a string instead of a value. This
|
||||
prevents \fBTk_Get3DBorder\fR from caching the return value, so
|
||||
\fBTk_Get3DBorder\fR is less efficient than \fBTk_Alloc3DBorderFromObj\fR.
|
||||
.PP
|
||||
\fBTk_Get3DBorderFromObj\fR returns the token for an existing border, given
|
||||
the window and color name used to create the border.
|
||||
\fBTk_Get3DBorderFromObj\fR does not actually create the border; it must
|
||||
already have been created with a previous call to
|
||||
\fBTk_Alloc3DBorderFromObj\fR or \fBTk_Get3DBorder\fR. The return
|
||||
value is cached in \fIobjPtr\fR, which speeds up
|
||||
future calls to \fBTk_Get3DBorderFromObj\fR with the same \fIobjPtr\fR
|
||||
and \fItkwin\fR.
|
||||
.PP
|
||||
Once a border structure has been created, \fBTk_Draw3DRectangle\fR may be
|
||||
invoked to draw the border.
|
||||
The \fItkwin\fR argument specifies the
|
||||
window for which the border was allocated, and \fIdrawable\fR
|
||||
specifies a window or pixmap in which the border is to be drawn.
|
||||
\fIDrawable\fR need not refer to the same window as \fItkwin\fR, but it
|
||||
must refer to a compatible
|
||||
pixmap or window: one associated with the same screen and with the
|
||||
same depth as \fItkwin\fR.
|
||||
The \fIx\fR, \fIy\fR, \fIwidth\fR, and
|
||||
\fIheight\fR arguments define the bounding box of the border region
|
||||
within \fIdrawable\fR (usually \fIx\fR and \fIy\fR are zero and
|
||||
\fIwidth\fR and \fIheight\fR are the dimensions of the window), and
|
||||
\fIborderWidth\fR specifies the number of pixels actually
|
||||
occupied by the border. The \fIrelief\fR argument indicates
|
||||
which of several three-dimensional effects is desired:
|
||||
\fBTK_RELIEF_RAISED\fR means that the interior of the rectangle should
|
||||
appear raised relative to the exterior of the rectangle, and
|
||||
\fBTK_RELIEF_SUNKEN\fR means that the interior should appear depressed.
|
||||
\fBTK_RELIEF_GROOVE\fR and \fBTK_RELIEF_RIDGE\fR mean that there should appear to be
|
||||
a groove or ridge around the exterior of the rectangle.
|
||||
.PP
|
||||
\fBTk_Fill3DRectangle\fR is somewhat like \fBTk_Draw3DRectangle\fR except
|
||||
that it first fills the rectangular area with the background color
|
||||
(one corresponding
|
||||
to the color used to create \fIborder\fR). Then it calls
|
||||
\fBTk_Draw3DRectangle\fR to draw a border just inside the outer edge of
|
||||
the rectangular area. The argument \fIrelief\fR indicates the desired
|
||||
effect (\fBTK_RELIEF_FLAT\fR means no border should be drawn; all that
|
||||
happens is to fill the rectangle with the background color).
|
||||
.PP
|
||||
The procedure \fBTk_Draw3DPolygon\fR may be used to draw more complex
|
||||
shapes with a three-dimensional appearance. The \fIpointPtr\fR and
|
||||
\fInumPoints\fR arguments define a trajectory, \fIpolyBorderWidth\fR
|
||||
indicates how wide the border should be (and on which side of the
|
||||
trajectory to draw it), and \fIleftRelief\fR indicates which side
|
||||
of the trajectory should appear raised. \fBTk_Draw3DPolygon\fR
|
||||
draws a border around the given trajectory using the colors from
|
||||
\fIborder\fR to produce a three-dimensional appearance. If the trajectory is
|
||||
non-self-intersecting, the appearance will be a raised or sunken
|
||||
polygon shape. The trajectory may be self-intersecting, although
|
||||
it's not clear how useful this is.
|
||||
.PP
|
||||
\fBTk_Fill3DPolygon\fR is to \fBTk_Draw3DPolygon\fR what
|
||||
\fBTk_Fill3DRectangle\fR is to \fBTk_Draw3DRectangle\fR: it fills
|
||||
the polygonal area with the background color from \fIborder\fR,
|
||||
then calls \fBTk_Draw3DPolygon\fR to draw a border around the
|
||||
area (unless \fIleftRelief\fR is \fBTK_RELIEF_FLAT\fR; in this case no
|
||||
border is drawn).
|
||||
.PP
|
||||
The procedures \fBTk_3DVerticalBevel\fR and \fBTk_3DHorizontalBevel\fR
|
||||
provide lower-level drawing primitives that are used by
|
||||
procedures such as \fBTk_Draw3DRectangle\fR.
|
||||
These procedures are also useful in their own right for drawing
|
||||
rectilinear border shapes.
|
||||
\fBTk_3DVerticalBevel\fR draws a vertical beveled edge, such as the
|
||||
left or right side of a rectangle, and \fBTk_3DHorizontalBevel\fR
|
||||
draws a horizontal beveled edge, such as the top or bottom of a
|
||||
rectangle.
|
||||
Each procedure takes \fIx\fR, \fIy\fR, \fIwidth\fR, and \fIheight\fR
|
||||
arguments that describe the rectangular area of the beveled edge
|
||||
(e.g., \fIwidth\fR is the border width for \fBTk_3DVerticalBevel\fR).
|
||||
The \fIleftBorder\fR and \fItopBorder\fR arguments indicate the
|
||||
position of the border relative to the
|
||||
.QW inside
|
||||
of the value, and
|
||||
\fIrelief\fR indicates the relief of the inside of the value relative
|
||||
to the outside.
|
||||
\fBTk_3DVerticalBevel\fR just draws a rectangular region.
|
||||
\fBTk_3DHorizontalBevel\fR draws a trapezoidal region to generate
|
||||
mitered corners; it should be called after \fBTk_3DVerticalBevel\fR
|
||||
(otherwise \fBTk_3DVerticalBevel\fR will overwrite the mitering in
|
||||
the corner).
|
||||
The \fIleftIn\fR and \fIrightIn\fR arguments to \fBTk_3DHorizontalBevel\fR
|
||||
describe the mitering at the corners; a value of 1 means that the bottom
|
||||
edge of the trapezoid will be shorter than the top, 0 means it will
|
||||
be longer.
|
||||
For example, to draw a rectangular border the top bevel should be
|
||||
drawn with 1 for both \fIleftIn\fR and \fIrightIn\fR, and the
|
||||
bottom bevel should be drawn with 0 for both arguments.
|
||||
.PP
|
||||
The procedure \fBTk_SetBackgroundFromBorder\fR will modify the background
|
||||
pixel and/or pixmap of \fItkwin\fR to produce a result compatible
|
||||
with \fIborder\fR. For color displays, the resulting background will
|
||||
just be the color specified when \fIborder\fR was created; for monochrome
|
||||
displays, the resulting background
|
||||
will be a light stipple pattern, in order to distinguish the background from
|
||||
the illuminated portion of the border.
|
||||
.PP
|
||||
Given a token for a border, the procedure \fBTk_NameOf3DBorder\fR
|
||||
will return the color name that was used to create the border.
|
||||
.PP
|
||||
The procedure \fBTk_3DBorderColor\fR returns the XColor structure
|
||||
that will be used for flat surfaces drawn for its \fIborder\fR
|
||||
argument by procedures like \fBTk_Fill3DRectangle\fR.
|
||||
The return value corresponds to the color name that was used to
|
||||
create the border.
|
||||
The XColor, and its associated pixel value, will remain allocated
|
||||
as long as \fIborder\fR exists.
|
||||
.PP
|
||||
The procedure \fBTk_3DBorderGC\fR returns one of the X graphics contexts
|
||||
that are used to draw the border.
|
||||
The argument \fIwhich\fR selects which one of the three possible GC's:
|
||||
\fBTK_3D_FLAT_GC\fR returns the context used for flat surfaces,
|
||||
\fBTK_3D_LIGHT_GC\fR returns the context for light shadows,
|
||||
and \fBTK_3D_DARK_GC\fR returns the context for dark shadows.
|
||||
.PP
|
||||
When a border is no longer needed, \fBTk_Free3DBorderFromObj\fR
|
||||
or \fBTk_Free3DBorder\fR should
|
||||
be called to release the resources associated with it.
|
||||
For \fBTk_Free3DBorderFromObj\fR the border to release is specified
|
||||
with the window and color name used to create the
|
||||
border; for \fBTk_Free3DBorder\fR the border to release is specified
|
||||
with the Tk_3DBorder token for the border.
|
||||
There should be exactly one call to \fBTk_Free3DBorderFromObj\fR or
|
||||
\fBTk_Free3DBorder\fR for each call to \fBTk_Alloc3DBorderFromObj\fR
|
||||
or \fBTk_Get3DBorder\fR.
|
||||
.SH KEYWORDS
|
||||
3D, background, border, color, depressed, illumination, value, polygon, raised, shadow, three-dimensional effect
|
||||
@@ -1,50 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1998-2000 by Scriptics Corporation.
|
||||
'\" All rights reserved.
|
||||
'\"
|
||||
.TH Tk_AddOption 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_AddOption \- Add an option to the option database
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
void
|
||||
\fBTk_AddOption\fR(\fItkwin, name, value, priority\fR)
|
||||
.SH ARGUMENTS
|
||||
.AP Tk_Window tkwin in
|
||||
Token for window.
|
||||
.AP "const char" *name in
|
||||
Multi-element name of option.
|
||||
.AP "const char" *value in
|
||||
Value of option.
|
||||
.AP int priority in
|
||||
Overall priority level to use for option.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
This procedure is invoked to add an option to the database
|
||||
associated with \fItkwin\fR's main window. \fIName\fR
|
||||
contains the option being specified and consists of names and/or
|
||||
classes separated by asterisks or dots, in the usual X format.
|
||||
\fIValue\fR contains the text string to associate with \fIname\fR;
|
||||
this value will be returned in calls to \fBTk_GetOption\fR.
|
||||
\fIPriority\fR specifies the priority of the value; when options are
|
||||
queried using \fBTk_GetOption\fR, the value with the highest priority
|
||||
is returned. \fIPriority\fR must be between 0 and \fBTK_MAX_PRIO\fR. Some
|
||||
common priority values are:
|
||||
.IP 20
|
||||
Used for default values hard-coded into widgets.
|
||||
.IP 40
|
||||
Used for options specified in application-specific startup files.
|
||||
.IP 60
|
||||
Used for options specified in user-specific defaults files, such as
|
||||
\fB.Xdefaults\fR, resource databases loaded into the X server, or
|
||||
user-specific startup files.
|
||||
.IP 80
|
||||
Used for options specified interactively after the application starts
|
||||
running.
|
||||
.SH KEYWORDS
|
||||
class, name, option, add
|
||||
153
doc/BindTable.3
153
doc/BindTable.3
@@ -1,153 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1994 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_CreateBindingTable 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_CreateBindingTable, Tk_DeleteBindingTable, Tk_CreateBinding, Tk_DeleteBinding, Tk_GetBinding, Tk_GetAllBindings, Tk_DeleteAllBindings, Tk_BindEvent \- invoke scripts in response to X events
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
Tk_BindingTable
|
||||
\fBTk_CreateBindingTable(\fIinterp\fB)\fR
|
||||
.sp
|
||||
\fBTk_DeleteBindingTable(\fIbindingTable\fB)\fR
|
||||
.sp
|
||||
unsigned long
|
||||
\fBTk_CreateBinding(\fIinterp, bindingTable, object, eventString, script, append\fB)\fR
|
||||
.sp
|
||||
int
|
||||
\fBTk_DeleteBinding(\fIinterp, bindingTable, object, eventString\fB)\fR
|
||||
.sp
|
||||
const char *
|
||||
\fBTk_GetBinding(\fIinterp, bindingTable, object, eventString\fB)\fR
|
||||
.sp
|
||||
\fBTk_GetAllBindings(\fIinterp, bindingTable, object\fB)\fR
|
||||
.sp
|
||||
\fBTk_DeleteAllBindings(\fIbindingTable, object\fB)\fR
|
||||
.sp
|
||||
\fBTk_BindEvent(\fIbindingTable, eventPtr, tkwin, numObjects, objectPtr\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_BindingTable bindingTable
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use when invoking bindings in binding table. Also
|
||||
used for returning results and errors from binding procedures.
|
||||
.AP Tk_BindingTable bindingTable in
|
||||
Token for binding table; must have been returned by some previous
|
||||
call to \fBTk_CreateBindingTable\fR.
|
||||
.AP ClientData object in
|
||||
Identifies object with which binding is associated.
|
||||
.AP "const char" *eventString in
|
||||
String describing event sequence.
|
||||
.AP "const char" *script in
|
||||
Tcl script to invoke when binding triggers.
|
||||
.AP int append in
|
||||
Non-zero means append \fIscript\fR to existing script for binding,
|
||||
if any; zero means replace existing script with new one.
|
||||
.AP XEvent *eventPtr in
|
||||
X event to match against bindings in \fIbindingTable\fR.
|
||||
.AP Tk_Window tkwin in
|
||||
Identifier for any window on the display where the event occurred.
|
||||
Used to find display-related information such as key maps.
|
||||
.AP int numObjects in
|
||||
Number of object identifiers pointed to by \fIobjectPtr\fR.
|
||||
.AP ClientData *objectPtr in
|
||||
Points to an array of object identifiers: bindings will be considered
|
||||
for each of these objects in order from first to last.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures provide a general-purpose mechanism for creating
|
||||
and invoking bindings.
|
||||
Bindings are organized in terms of \fIbinding tables\fR.
|
||||
A binding table consists of a collection of bindings plus a history
|
||||
of recent events.
|
||||
Within a binding table, bindings are associated with \fIobjects\fR.
|
||||
The meaning of an object is defined by clients of the binding package.
|
||||
For example, Tk keeps uses one binding table to hold all of the bindings
|
||||
created by the \fBbind\fR command.
|
||||
For this table, objects are pointers to strings such as window names, class
|
||||
names, or other binding tags such as \fBall\fR.
|
||||
Tk also keeps a separate binding table for each canvas widget, which manages
|
||||
bindings created by the canvas's \fBbind\fR widget command; within
|
||||
this table, an object is either a pointer to the internal structure for a
|
||||
canvas item or a Tk_Uid identifying a tag.
|
||||
.PP
|
||||
The procedure \fBTk_CreateBindingTable\fR creates a new binding
|
||||
table and associates \fIinterp\fR with it (when bindings in the
|
||||
table are invoked, the scripts will be evaluated in \fIinterp\fR).
|
||||
\fBTk_CreateBindingTable\fR returns a token for the table, which
|
||||
must be used in calls to other procedures such as \fBTk_CreateBinding\fR
|
||||
or \fBTk_BindEvent\fR.
|
||||
.PP
|
||||
\fBTk_DeleteBindingTable\fR frees all of the state associated
|
||||
with a binding table.
|
||||
Once it returns the caller should not use the \fIbindingTable\fR
|
||||
token again.
|
||||
.PP
|
||||
\fBTk_CreateBinding\fR adds a new binding to an existing table.
|
||||
The \fIobject\fR argument identifies the object with which the
|
||||
binding is to be associated, and it may be any one-word value.
|
||||
Typically it is a pointer to a string or data structure.
|
||||
The \fIeventString\fR argument identifies the event or sequence
|
||||
of events for the binding; see the documentation for the
|
||||
\fBbind\fR command for a description of its format.
|
||||
\fIscript\fR is the Tcl script to be evaluated when the binding
|
||||
triggers.
|
||||
\fIappend\fR indicates what to do if there already
|
||||
exists a binding for \fIobject\fR and \fIeventString\fR: if \fIappend\fR
|
||||
is zero then \fIscript\fR replaces the old script; if \fIappend\fR
|
||||
is non-zero then the new script is appended to the old one.
|
||||
\fBTk_CreateBinding\fR returns an X event mask for all the events
|
||||
associated with the bindings.
|
||||
This information may be useful to invoke \fBXSelectInput\fR to
|
||||
select relevant events, or to disallow the use of certain events
|
||||
in bindings.
|
||||
If an error occurred while creating the binding (e.g., \fIeventString\fR
|
||||
refers to a non-existent event), then 0 is returned and an error
|
||||
message is left as the result of interpreter \fIinterp\fR.
|
||||
.PP
|
||||
\fBTk_DeleteBinding\fR removes from \fIbindingTable\fR the
|
||||
binding given by \fIobject\fR and \fIeventString\fR, if
|
||||
such a binding exists.
|
||||
\fBTk_DeleteBinding\fR always returns \fBTCL_OK\fR.
|
||||
In some cases it may reset the interpreter result to the default
|
||||
empty value.
|
||||
.PP
|
||||
\fBTk_GetBinding\fR returns a pointer to the script associated
|
||||
with \fIeventString\fR and \fIobject\fR in \fIbindingTable\fR.
|
||||
If no such binding exists then NULL is returned and an error
|
||||
message is left as the result of interpreter \fIinterp\fR.
|
||||
.PP
|
||||
\fBTk_GetAllBindings\fR returns in \fIinterp\fR's result a list
|
||||
of all the event strings for which there are bindings in
|
||||
\fIbindingTable\fR associated with \fIobject\fR.
|
||||
If there are no bindings for \fIobject\fR, the result will be an empty
|
||||
string.
|
||||
.PP
|
||||
\fBTk_DeleteAllBindings\fR deletes all of the bindings in
|
||||
\fIbindingTable\fR that are associated with \fIobject\fR.
|
||||
.PP
|
||||
\fBTk_BindEvent\fR is called to process an event.
|
||||
It makes a copy of the event in an internal history list associated
|
||||
with the binding table, then it checks for bindings that match
|
||||
the event.
|
||||
\fBTk_BindEvent\fR processes each of the objects pointed to
|
||||
by \fIobjectPtr\fR in turn.
|
||||
For each object, it finds all the bindings that match the current
|
||||
event history, selects the most specific binding using the priority
|
||||
mechanism described in the documentation for \fBbind\fR,
|
||||
and invokes the script for that binding.
|
||||
If there are no matching bindings for a particular object, then
|
||||
the object is skipped.
|
||||
\fBTk_BindEvent\fR continues through all of the objects, handling
|
||||
exceptions such as errors, \fBbreak\fR, and \fBcontinue\fR as
|
||||
described in the documentation for \fBbind\fR.
|
||||
.SH KEYWORDS
|
||||
binding, event, object, script
|
||||
121
doc/CanvPsY.3
121
doc/CanvPsY.3
@@ -1,121 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_CanvasPs 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_CanvasPsY, Tk_CanvasPsBitmap, Tk_CanvasPsColor, Tk_CanvasPsFont, Tk_CanvasPsPath, Tk_CanvasPsStipple \- utility procedures for generating Postscript for canvases
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
double
|
||||
\fBTk_CanvasPsY\fR(\fIcanvas, canvasY\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTk_CanvasPsBitmap\fR(\fIinterp, canvas, bitmap, x, y, width, height\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTk_CanvasPsColor\fR(\fIinterp, canvas, colorPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTk_CanvasPsFont\fR(\fIinterp, canvas, tkFont\fR)
|
||||
.sp
|
||||
\fBTk_CanvasPsPath\fR(\fIinterp, canvas, coordPtr, numPoints\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTk_CanvasPsStipple\fR(\fIinterp, canvas, bitmap\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS "unsigned int" "numPoints"
|
||||
.AP Tk_Canvas canvas in
|
||||
A token that identifies a canvas widget for which Postscript is
|
||||
being generated.
|
||||
.AP double canvasY in
|
||||
Y-coordinate in the space of the canvas.
|
||||
.AP Tcl_Interp *interp in/out
|
||||
A Tcl interpreter; Postscript is appended to its result, or the
|
||||
result may be replaced with an error message.
|
||||
.AP Pixmap bitmap in
|
||||
Bitmap to use for generating Postscript.
|
||||
.AP int x in
|
||||
X-coordinate within \fIbitmap\fR of left edge of region to output.
|
||||
.AP int y in
|
||||
Y-coordinate within \fIbitmap\fR of top edge of region to output.
|
||||
.AP "int" width in
|
||||
Width of region of bitmap to output, in pixels.
|
||||
.AP "int" height in
|
||||
Height of region of bitmap to output, in pixels.
|
||||
.AP XColor *colorPtr in
|
||||
Information about color value to set in Postscript.
|
||||
.AP Tk_Font tkFont in
|
||||
Font for which Postscript is to be generated.
|
||||
.AP double *coordPtr in
|
||||
Pointer to an array of coordinates for one or more
|
||||
points specified in canvas coordinates.
|
||||
The order of values in \fIcoordPtr\fR is x1, y1, x2, y2, x3, y3,
|
||||
and so on.
|
||||
.AP int numPoints in
|
||||
Number of points at \fIcoordPtr\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures are called by canvas type managers to carry out
|
||||
common functions related to generating Postscript.
|
||||
Most of the procedures take a \fIcanvas\fR argument, which
|
||||
refers to a canvas widget for which Postscript is being
|
||||
generated.
|
||||
.PP
|
||||
\fBTk_CanvasPsY\fR takes as argument a y-coordinate in the space of
|
||||
a canvas and returns the value that should be used for that point
|
||||
in the Postscript currently being generated for \fIcanvas\fR.
|
||||
Y coordinates require transformation because Postscript uses an
|
||||
origin at the lower-left corner whereas X uses an origin at the
|
||||
upper-left corner.
|
||||
Canvas x coordinates can be used directly in Postscript without
|
||||
transformation.
|
||||
.PP
|
||||
\fBTk_CanvasPsBitmap\fR generates Postscript to describe a region
|
||||
of a bitmap.
|
||||
The Postscript is generated in proper image data format for Postscript,
|
||||
i.e., as data between angle brackets, one bit per pixel.
|
||||
The Postscript is appended to the result of interpreter \fIinterp\fR
|
||||
and \fBTCL_OK\fR is returned unless an error occurs, in which case
|
||||
\fBTCL_ERROR\fR is returned and the interpreter result is overwritten
|
||||
with an error message.
|
||||
.PP
|
||||
\fBTk_CanvasPsColor\fR generates Postscript to set the current color
|
||||
to correspond to its \fIcolorPtr\fR argument, taking into account any
|
||||
color map specified in the \fBpostscript\fR command.
|
||||
It appends the Postscript to the interpreter \fIinterp\fR's result and returns
|
||||
\fBTCL_OK\fR unless an error occurs, in which case \fBTCL_ERROR\fR is
|
||||
returned and the interpreter's result is overwritten with an error message.
|
||||
.PP
|
||||
\fBTk_CanvasPsFont\fR generates Postscript that sets the current font
|
||||
to match \fItkFont\fR as closely as possible.
|
||||
\fBTk_CanvasPsFont\fR takes into account any font map specified
|
||||
in the \fBpostscript\fR command, and it does
|
||||
the best it can at mapping X fonts to Postscript fonts.
|
||||
It appends the Postscript to interpreter \fIinterp\fR's result and
|
||||
returns \fBTCL_OK\fR unless an error occurs, in which case
|
||||
\fBTCL_ERROR\fR is returned and the interpreter's result is
|
||||
overwritten with an error message.
|
||||
.PP
|
||||
\fBTk_CanvasPsPath\fR generates Postscript to set the current path
|
||||
to the set of points given by \fIcoordPtr\fR and \fInumPoints\fR.
|
||||
It appends the resulting Postscript to the result of interpreter \fIinterp\fR.
|
||||
.PP
|
||||
\fBTk_CanvasPsStipple\fR generates Postscript that will fill the
|
||||
current path in stippled fashion.
|
||||
It uses \fIbitmap\fR as the stipple pattern and the current Postscript
|
||||
color; ones in the stipple bitmap are drawn in the current color, and
|
||||
zeroes are not drawn at all.
|
||||
The Postscript is appended to interpreter \fIinterp\fR's result and
|
||||
\fBTCL_OK\fR is returned, unless an error occurs, in which case
|
||||
\fBTCL_ERROR\fR is returned and the interpreter's result is
|
||||
overwritten with an error message.
|
||||
.SH KEYWORDS
|
||||
bitmap, canvas, color, font, path, Postscript, stipple
|
||||
158
doc/CanvTkwin.3
158
doc/CanvTkwin.3
@@ -1,158 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_CanvasTkwin 3 4.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_CanvasTkwin, Tk_CanvasGetCoord, Tk_CanvasDrawableCoords, Tk_CanvasSetStippleOrigin, Tk_CanvasWindowCoords, Tk_CanvasEventuallyRedraw, Tk_CanvasTagsOption \- utility procedures for canvas type managers
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
Tk_Window
|
||||
\fBTk_CanvasTkwin\fR(\fIcanvas\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTk_CanvasGetCoord\fR(\fIinterp, canvas, string, doublePtr\fR)
|
||||
.sp
|
||||
\fBTk_CanvasDrawableCoords\fR(\fIcanvas, x, y, drawableXPtr, drawableYPtr\fR)
|
||||
.sp
|
||||
\fBTk_CanvasSetStippleOrigin\fR(\fIcanvas, gc\fR)
|
||||
.sp
|
||||
\fBTk_CanvasWindowCoords\fR(\fIcanvas, x, y, screenXPtr, screenYPtr\fR)
|
||||
.sp
|
||||
\fBTk_CanvasEventuallyRedraw\fR(\fIcanvas, x1, y1, x2, y2\fR)
|
||||
.sp
|
||||
Tk_OptionParseProc *\fBTk_CanvasTagsParseProc\fR;
|
||||
.sp
|
||||
Tk_OptionPrintProc *\fBTk_CanvasTagsPrintProc\fR;
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_ItemType *drawableXPtr
|
||||
.AP Tk_Canvas canvas in
|
||||
A token that identifies a canvas widget.
|
||||
.AP Tcl_Interp *interp in/out
|
||||
Interpreter to use for error reporting.
|
||||
.AP "const char" *string in
|
||||
Textual description of a canvas coordinate.
|
||||
.AP double *doublePtr out
|
||||
Points to place to store a converted coordinate.
|
||||
.AP double x in
|
||||
An x coordinate in the space of the canvas.
|
||||
.AP double y in
|
||||
A y coordinate in the space of the canvas.
|
||||
.AP short *drawableXPtr out
|
||||
Pointer to a location in which to store an x coordinate in the space
|
||||
of the drawable currently being used to redisplay the canvas.
|
||||
.AP short *drawableYPtr out
|
||||
Pointer to a location in which to store a y coordinate in the space
|
||||
of the drawable currently being used to redisplay the canvas.
|
||||
.AP GC gc out
|
||||
Graphics context to modify.
|
||||
.AP short *screenXPtr out
|
||||
Points to a location in which to store the screen coordinate in the
|
||||
canvas window that corresponds to \fIx\fR.
|
||||
.AP short *screenYPtr out
|
||||
Points to a location in which to store the screen coordinate in the
|
||||
canvas window that corresponds to \fIy\fR.
|
||||
.AP int x1 in
|
||||
Left edge of the region that needs redisplay. Only pixels at or to
|
||||
the right of this coordinate need to be redisplayed.
|
||||
.AP int y1 in
|
||||
Top edge of the region that needs redisplay. Only pixels at or below
|
||||
this coordinate need to be redisplayed.
|
||||
.AP int x2 in
|
||||
Right edge of the region that needs redisplay. Only pixels to
|
||||
the left of this coordinate need to be redisplayed.
|
||||
.AP int y2 in
|
||||
Bottom edge of the region that needs redisplay. Only pixels above
|
||||
this coordinate need to be redisplayed.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures are called by canvas type managers to perform various
|
||||
utility functions.
|
||||
.PP
|
||||
\fBTk_CanvasTkwin\fR returns the Tk_Window associated with a particular
|
||||
canvas.
|
||||
.PP
|
||||
\fBTk_CanvasGetCoord\fR translates a string specification of a
|
||||
coordinate (such as \fB2p\fR or \fB1.6c\fR) into a double-precision
|
||||
canvas coordinate.
|
||||
If \fIstring\fR is a valid coordinate description then \fBTk_CanvasGetCoord\fR
|
||||
stores the corresponding canvas coordinate at *\fIdoublePtr\fR
|
||||
and returns \fBTCL_OK\fR.
|
||||
Otherwise it stores an error message in the interpreter result and
|
||||
returns \fBTCL_ERROR\fR.
|
||||
.PP
|
||||
\fBTk_CanvasDrawableCoords\fR is called by type managers during
|
||||
redisplay to compute where to draw things.
|
||||
Given \fIx\fR and \fIy\fR coordinates in the space of the
|
||||
canvas, \fBTk_CanvasDrawableCoords\fR computes the corresponding
|
||||
pixel in the drawable that is currently being used for redisplay;
|
||||
it returns those coordinates in *\fIdrawableXPtr\fR and *\fIdrawableYPtr\fR.
|
||||
This procedure should not be invoked except during redisplay.
|
||||
.PP
|
||||
\fBTk_CanvasSetStippleOrigin\fR is also used during redisplay.
|
||||
It sets the stipple origin in \fIgc\fR so that stipples drawn
|
||||
with \fIgc\fR in the current offscreen pixmap will line up
|
||||
with stipples drawn with origin (0,0) in the canvas's actual
|
||||
window.
|
||||
\fBTk_CanvasSetStippleOrigin\fR is needed in order to guarantee
|
||||
that stipple patterns line up properly when the canvas is
|
||||
redisplayed in small pieces.
|
||||
Redisplays are carried out in double-buffered fashion where a
|
||||
piece of the canvas is redrawn in an offscreen pixmap and then
|
||||
copied back onto the screen.
|
||||
In this approach the stipple origins in graphics contexts need to
|
||||
be adjusted during each redisplay to compensate for the position
|
||||
of the off-screen pixmap relative to the window.
|
||||
If an item is being drawn with stipples, its type manager typically
|
||||
calls \fBTk_CanvasSetStippleOrigin\fR just before using \fIgc\fR
|
||||
to draw something; after it is finished drawing, the type manager
|
||||
calls \fBXSetTSOrigin\fR to restore the origin in \fIgc\fR back to (0,0)
|
||||
(the restore is needed because graphics contexts are shared, so
|
||||
they cannot be modified permanently).
|
||||
.PP
|
||||
\fBTk_CanvasWindowCoords\fR is similar to \fBTk_CanvasDrawableCoords\fR
|
||||
except that it returns coordinates in the canvas's window on the
|
||||
screen, instead of coordinates in an off-screen pixmap.
|
||||
.PP
|
||||
\fBTk_CanvasEventuallyRedraw\fR may be invoked by a type manager
|
||||
to inform Tk that a portion of a canvas needs to be redrawn.
|
||||
The \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR arguments
|
||||
specify the region that needs to be redrawn, in canvas coordinates.
|
||||
Type managers rarely need to invoke \fBTk_CanvasEventuallyRedraw\fR,
|
||||
since Tk can normally figure out when an item has changed and make
|
||||
the redisplay request on its behalf (this happens, for example
|
||||
whenever Tk calls a \fIconfigureProc\fR or \fIscaleProc\fR).
|
||||
The only time that a type manager needs to call
|
||||
\fBTk_CanvasEventuallyRedraw\fR is if an item has changed on its own
|
||||
without being invoked through one of the procedures in its Tk_ItemType;
|
||||
this could happen, for example, in an image item if the image is
|
||||
modified using image commands.
|
||||
.PP
|
||||
\fBTk_CanvasTagsParseProc\fR and \fBTk_CanvasTagsPrintProc\fR are
|
||||
procedures that handle the \fB\-tags\fR option for canvas items.
|
||||
The code of a canvas type manager will not call these procedures
|
||||
directly, but will use their addresses to create a \fBTk_CustomOption\fR
|
||||
structure for the \fB\-tags\fR option. The code typically looks
|
||||
like this:
|
||||
.PP
|
||||
.CS
|
||||
static const Tk_CustomOption tagsOption = {Tk_CanvasTagsParseProc,
|
||||
Tk_CanvasTagsPrintProc, (ClientData) NULL
|
||||
};
|
||||
|
||||
static const Tk_ConfigSpec configSpecs[] = {
|
||||
...
|
||||
{TK_CONFIG_CUSTOM, "\-tags", NULL, NULL,
|
||||
NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
|
||||
...
|
||||
};
|
||||
.CE
|
||||
.SH KEYWORDS
|
||||
canvas, focus, item type, redisplay, selection, type manager
|
||||
@@ -1,100 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_CanvasTextInfo 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_CanvasTextInfo \- additional information for managing text items in canvases
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
Tk_CanvasTextInfo *
|
||||
\fBTk_CanvasGetTextInfo\fR(\fIcanvas\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_Canvas canvas
|
||||
.AP Tk_Canvas canvas in
|
||||
A token that identifies a particular canvas widget.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Textual canvas items are somewhat more complicated to manage than
|
||||
other items, due to things like the selection and the input focus.
|
||||
\fBTk_CanvasGetTextInfo\fR may be invoked by a type manager
|
||||
to obtain additional information needed for items that display text.
|
||||
The return value from \fBTk_CanvasGetTextInfo\fR is a pointer to
|
||||
a structure that is shared between Tk and all the items that display
|
||||
text.
|
||||
The structure has the following form:
|
||||
.CS
|
||||
typedef struct Tk_CanvasTextInfo {
|
||||
Tk_3DBorder \fIselBorder\fR;
|
||||
int \fIselBorderWidth\fR;
|
||||
XColor *\fIselFgColorPtr\fR;
|
||||
Tk_Item *\fIselItemPtr\fR;
|
||||
int \fIselectFirst\fR;
|
||||
int \fIselectLast\fR;
|
||||
Tk_Item *\fIanchorItemPtr\fR;
|
||||
int \fIselectAnchor\fR;
|
||||
Tk_3DBorder \fIinsertBorder\fR;
|
||||
int \fIinsertWidth\fR;
|
||||
int \fIinsertBorderWidth\fR;
|
||||
Tk_Item *\fIfocusItemPtr\fR;
|
||||
int \fIgotFocus\fR;
|
||||
int \fIcursorOn\fR;
|
||||
} \fBTk_CanvasTextInfo\fR;
|
||||
.CE
|
||||
The \fBselBorder\fR field identifies a Tk_3DBorder that should be
|
||||
used for drawing the background under selected text.
|
||||
\fIselBorderWidth\fR gives the width of the raised border around
|
||||
selected text, in pixels.
|
||||
\fIselFgColorPtr\fR points to an XColor that describes the foreground
|
||||
color to be used when drawing selected text.
|
||||
\fIselItemPtr\fR points to the item that is currently selected, or
|
||||
NULL if there is no item selected or if the canvas does not have the
|
||||
selection.
|
||||
\fIselectFirst\fR and \fIselectLast\fR give the indices of the first
|
||||
and last selected characters in \fIselItemPtr\fR, as returned by the
|
||||
\fIindexProc\fR for that item.
|
||||
\fIanchorItemPtr\fR points to the item that currently has the selection
|
||||
anchor; this is not necessarily the same as \fIselItemPtr\fR.
|
||||
\fIselectAnchor\fR is an index that identifies the anchor position
|
||||
within \fIanchorItemPtr\fR.
|
||||
\fIinsertBorder\fR contains a Tk_3DBorder to use when drawing the
|
||||
insertion cursor; \fIinsertWidth\fR gives the total width of the
|
||||
insertion cursor in pixels, and \fIinsertBorderWidth\fR gives the
|
||||
width of the raised border around the insertion cursor.
|
||||
\fIfocusItemPtr\fR identifies the item that currently has the input
|
||||
focus, or NULL if there is no such item.
|
||||
\fIgotFocus\fR is 1 if the canvas widget has the input focus and
|
||||
0 otherwise.
|
||||
\fIcursorOn\fR is 1 if the insertion cursor should be drawn in
|
||||
\fIfocusItemPtr\fR and 0 if it should not be drawn; this field
|
||||
is toggled on and off by Tk to make the cursor blink.
|
||||
.PP
|
||||
The structure returned by \fBTk_CanvasGetTextInfo\fR
|
||||
is shared between Tk and the type managers; typically the type manager
|
||||
calls \fBTk_CanvasGetTextInfo\fR once when an item is created and
|
||||
then saves the pointer in the item's record.
|
||||
Tk will update information in the Tk_CanvasTextInfo; for example,
|
||||
a \fBconfigure\fR widget command might change the \fIselBorder\fR
|
||||
field, or a \fBselect\fR widget command might change the \fIselectFirst\fR
|
||||
field, or Tk might change \fIcursorOn\fR in order to make the insertion
|
||||
cursor flash on and off during successive redisplays.
|
||||
.PP
|
||||
Type managers should treat all of the fields of the Tk_CanvasTextInfo
|
||||
structure as read-only, except for \fIselItemPtr\fR, \fIselectFirst\fR,
|
||||
\fIselectLast\fR, and \fIselectAnchor\fR.
|
||||
Type managers may change \fIselectFirst\fR, \fIselectLast\fR, and
|
||||
\fIselectAnchor\fR to adjust for insertions and deletions in the
|
||||
item (but only if the item is the current owner of the selection or
|
||||
anchor, as determined by \fIselItemPtr\fR or \fIanchorItemPtr\fR).
|
||||
If all of the selected text in the item is deleted, the item should
|
||||
set \fIselItemPtr\fR to NULL to indicate that there is no longer a
|
||||
selection.
|
||||
.SH KEYWORDS
|
||||
canvas, focus, insertion cursor, selection, selection anchor, text
|
||||
@@ -1,77 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1994 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_ClipboardClear 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_ClipboardClear, Tk_ClipboardAppend \- Manage the clipboard
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
int
|
||||
\fBTk_ClipboardClear\fR(\fIinterp, tkwin\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTk_ClipboardAppend\fR(\fIinterp, tkwin, target, format, buffer\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_ClipboardClear tkwin
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for reporting errors.
|
||||
.AP Tk_Window tkwin in
|
||||
Window that determines which display's clipboard to manipulate.
|
||||
.AP Atom target in
|
||||
Conversion type for this clipboard item; has same meaning as
|
||||
\fItarget\fR argument to \fBTk_CreateSelHandler\fR.
|
||||
.AP Atom format in
|
||||
Representation to use when data is retrieved; has same meaning as
|
||||
\fIformat\fR argument to \fBTk_CreateSelHandler\fR.
|
||||
.AP "const char" *buffer in
|
||||
Null terminated string containing the data to be appended to the clipboard.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These two procedures manage the clipboard for Tk.
|
||||
The clipboard is typically managed by calling \fBTk_ClipboardClear\fR
|
||||
once, then calling \fBTk_ClipboardAppend\fR to add data for any
|
||||
number of targets.
|
||||
.PP
|
||||
\fBTk_ClipboardClear\fR claims the CLIPBOARD selection and frees any
|
||||
data items previously stored on the clipboard in this application.
|
||||
It normally returns \fBTCL_OK\fR, but if an error occurs it returns
|
||||
\fBTCL_ERROR\fR and leaves an error message in interpreter
|
||||
\fIinterp\fR's result.
|
||||
\fBTk_ClipboardClear\fR must be called before a sequence of
|
||||
\fBTk_ClipboardAppend\fR calls can be issued.
|
||||
.PP
|
||||
\fBTk_ClipboardAppend\fR appends a buffer of data to the clipboard.
|
||||
The first buffer for a given \fItarget\fR determines the \fIformat\fR
|
||||
for that \fItarget\fR.
|
||||
Any successive appends for that \fItarget\fR must have
|
||||
the same format or an error will be returned.
|
||||
\fBTk_ClipboardAppend\fR returns \fBTCL_OK\fR if the buffer is
|
||||
successfully copied onto the clipboard. If the clipboard is not
|
||||
currently owned by the application, either
|
||||
because \fBTk_ClipboardClear\fR has not been called or because
|
||||
ownership of the clipboard has changed since the last call to
|
||||
\fBTk_ClipboardClear\fR,
|
||||
\fBTk_ClipboardAppend\fR returns \fBTCL_ERROR\fR and leaves an error
|
||||
message in the result of interpreter \fIinterp\fR.
|
||||
.PP
|
||||
In order to guarantee atomicity, no event handling should occur
|
||||
between \fBTk_ClipboardClear\fR and the following
|
||||
\fBTk_ClipboardAppend\fR calls (otherwise someone could retrieve
|
||||
a partially completed clipboard or claim ownership away from
|
||||
this application).
|
||||
.PP
|
||||
\fBTk_ClipboardClear\fR may invoke callbacks, including arbitrary
|
||||
Tcl scripts, as a result of losing the CLIPBOARD selection, so
|
||||
any calling function should take care to be re-entrant at the point
|
||||
\fBTk_ClipboardClear\fR is invoked.
|
||||
.SH KEYWORDS
|
||||
append, clipboard, clear, format, type
|
||||
@@ -1,38 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1992-1994 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_ClearSelection 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_ClearSelection \- Deselect a selection
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
\fBTk_ClearSelection\fR(\fItkwin, selection\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_Window tkwin
|
||||
.AP Tk_Window tkwin in
|
||||
The selection will be cleared from the display containing this
|
||||
window.
|
||||
.AP Atom selection in
|
||||
The name of selection to be cleared.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_ClearSelection\fR cancels the selection specified by the atom
|
||||
\fIselection\fR for the display containing \fItkwin\fR.
|
||||
The selection need not be in \fItkwin\fR itself or even in
|
||||
\fItkwin\fR's application.
|
||||
If there is a window anywhere on \fItkwin\fR's display that
|
||||
owns \fIselection\fR, the window will be notified and the
|
||||
selection will be cleared.
|
||||
If there is no owner for \fIselection\fR on the display, then the
|
||||
procedure has no effect.
|
||||
.SH KEYWORDS
|
||||
clear, selection
|
||||
631
doc/ConfigWidg.3
631
doc/ConfigWidg.3
@@ -1,631 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1990-1994 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_ConfigureWidget 3 4.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_ConfigureWidget, Tk_ConfigureInfo, Tk_ConfigureValue, Tk_FreeOptions \- process configuration options for widgets
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
int
|
||||
\fBTk_ConfigureWidget(\fIinterp, tkwin, specs, argc, argv, widgRec, flags\fB)\fR
|
||||
.sp
|
||||
int
|
||||
\fBTk_ConfigureInfo(\fIinterp, tkwin, specs, widgRec, argvName, flags\fB)\fR
|
||||
.sp
|
||||
int
|
||||
\fBTk_ConfigureValue(\fIinterp, tkwin, specs, widgRec, argvName, flags\fB)\fR
|
||||
.sp
|
||||
\fBTk_FreeOptions(\fIspecs, widgRec, display, flags\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS char *widgRec in/out
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for returning error messages.
|
||||
.AP Tk_Window tkwin in
|
||||
Window used to represent widget (needed to set up X resources).
|
||||
.AP "const Tk_ConfigSpec" *specs in
|
||||
Pointer to table specifying legal configuration options for this
|
||||
widget.
|
||||
.AP int argc in
|
||||
Number of arguments in \fIargv\fR.
|
||||
.AP "const char" **argv in
|
||||
Command-line options for configuring widget.
|
||||
.AP char *widgRec in/out
|
||||
Points to widget record structure. Fields in this structure get
|
||||
modified by \fBTk_ConfigureWidget\fR to hold configuration information.
|
||||
.AP int flags in
|
||||
If non-zero, then it specifies an OR-ed combination of flags that
|
||||
control the processing of configuration information.
|
||||
\fBTK_CONFIG_ARGV_ONLY\fR causes the option database and defaults to be
|
||||
ignored, and flag bits \fBTK_CONFIG_USER_BIT\fR and higher are used to
|
||||
selectively disable entries in \fIspecs\fR.
|
||||
.AP "type name" type in
|
||||
The name of the type of a widget record.
|
||||
.AP "field name" field in
|
||||
The name of a field in records of type \fItype\fR.
|
||||
.AP "const char" *argvName in
|
||||
The name used on Tcl command lines to refer to a particular option
|
||||
(e.g. when creating a widget or invoking the \fBconfigure\fR widget
|
||||
command). If non-NULL, then information is returned only for this
|
||||
option. If NULL, then information is returned for all available
|
||||
options.
|
||||
.AP Display *display in
|
||||
Display containing widget whose record is being freed; needed in
|
||||
order to free up resources.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Note: \fBTk_ConfigureWidget\fR should be replaced with the new
|
||||
\fBTcl_Obj\fR based API \fBTk_SetOptions\fR. The old interface is
|
||||
retained for backward compatibility.
|
||||
.PP
|
||||
\fBTk_ConfigureWidget\fR is called to configure various aspects of a
|
||||
widget, such as colors, fonts, border width, etc.
|
||||
It is intended as a convenience procedure to reduce the amount
|
||||
of code that must be written in individual widget managers to
|
||||
handle configuration information.
|
||||
It is typically
|
||||
invoked when widgets are created, and again when the \fBconfigure\fR
|
||||
command is invoked for a widget.
|
||||
Although intended primarily for widgets, \fBTk_ConfigureWidget\fR
|
||||
can be used in other situations where \fIargc-argv\fR information
|
||||
is to be used to fill in a record structure, such as configuring
|
||||
graphical elements for a canvas widget or entries of a menu.
|
||||
.PP
|
||||
\fBTk_ConfigureWidget\fR processes
|
||||
a table specifying the configuration options that are supported
|
||||
(\fIspecs\fR) and a collection of command-line arguments (\fIargc\fR and
|
||||
\fIargv\fR) to fill in fields of a record (\fIwidgRec\fR).
|
||||
It uses the option database and defaults specified in \fIspecs\fR
|
||||
to fill in fields of \fIwidgRec\fR that are not specified in \fIargv\fR.
|
||||
\fBTk_ConfigureWidget\fR normally returns the value \fBTCL_OK\fR; in this
|
||||
case it does not modify \fIinterp\fR.
|
||||
If an error
|
||||
occurs then \fBTCL_ERROR\fR is returned and \fBTk_ConfigureWidget\fR will
|
||||
leave an error message in interpreter \fIinterp\fR's result in the standard Tcl
|
||||
fashion.
|
||||
In the event of an error return, some of the fields of \fIwidgRec\fR
|
||||
could already have been set, if configuration information for them
|
||||
was successfully processed before the error occurred.
|
||||
The other fields will be set to reasonable initial values so that
|
||||
\fBTk_FreeOptions\fR can be called for cleanup.
|
||||
.PP
|
||||
The \fIspecs\fR array specifies the kinds of configuration options
|
||||
expected by the widget. Each of its entries specifies one configuration
|
||||
option and has the following structure:
|
||||
.CS
|
||||
typedef struct {
|
||||
int \fItype\fR;
|
||||
const char *\fIargvName\fR;
|
||||
const char *\fIdbName\fR;
|
||||
const char *\fIdbClass\fR;
|
||||
const char *\fIdefValue\fR;
|
||||
int \fIoffset\fR;
|
||||
int \fIspecFlags\fR;
|
||||
const Tk_CustomOption *\fIcustomPtr\fR;
|
||||
} \fBTk_ConfigSpec\fR;
|
||||
.CE
|
||||
The \fItype\fR field indicates what type of configuration option this is
|
||||
(e.g. \fBTK_CONFIG_COLOR\fR for a color value, or \fBTK_CONFIG_INT\fR for
|
||||
an integer value). The \fItype\fR field indicates how to use the
|
||||
value of the option (more on this below).
|
||||
The \fIargvName\fR field is a string such as
|
||||
.QW \-font
|
||||
or
|
||||
.QW \-bg ,
|
||||
which is compared with the values in \fIargv\fR (if \fIargvName\fR is
|
||||
NULL it means this is a grouped entry; see \fBGROUPED ENTRIES\fR below). The
|
||||
\fIdbName\fR and \fIdbClass\fR fields are used to look up a value
|
||||
for this option in the option database. The \fIdefValue\fR field
|
||||
specifies a default value for this configuration option if no
|
||||
value is specified in either \fIargv\fR or the option database.
|
||||
\fIOffset\fR indicates where in \fIwidgRec\fR to store information
|
||||
about this option, and \fIspecFlags\fR contains additional information
|
||||
to control the processing of this configuration option (see FLAGS
|
||||
below).
|
||||
The last field, \fIcustomPtr\fR, is only used if \fItype\fR is
|
||||
\fBTK_CONFIG_CUSTOM\fR; see CUSTOM OPTION TYPES below.
|
||||
.PP
|
||||
\fBTk_ConfigureWidget\fR first processes \fIargv\fR to see which
|
||||
(if any) configuration options are specified there. \fIArgv\fR
|
||||
must contain an even number of fields; the first of each pair
|
||||
of fields must match the \fIargvName\fR of some entry in \fIspecs\fR
|
||||
(unique abbreviations are acceptable),
|
||||
and the second field of the pair contains the value for that
|
||||
configuration option. If there are entries in \fIspec\fR for which
|
||||
there were no matching entries in \fIargv\fR,
|
||||
\fBTk_ConfigureWidget\fR uses the \fIdbName\fR and \fIdbClass\fR
|
||||
fields of the \fIspecs\fR entry to probe the option database; if
|
||||
a value is found, then it is used as the value for the option.
|
||||
Finally, if no entry is found in the option database, the
|
||||
\fIdefValue\fR field of the \fIspecs\fR entry is used as the
|
||||
value for the configuration option. If the \fIdefValue\fR is
|
||||
NULL, or if the \fBTK_CONFIG_DONT_SET_DEFAULT\fR bit is set in
|
||||
\fIflags\fR, then there is no default value and this \fIspecs\fR entry
|
||||
will be ignored if no value is specified in \fIargv\fR or the
|
||||
option database.
|
||||
.PP
|
||||
Once a string value has been determined for a configuration option,
|
||||
\fBTk_ConfigureWidget\fR translates the string value into a more useful
|
||||
form, such as a color if \fItype\fR is \fBTK_CONFIG_COLOR\fR or an integer
|
||||
if \fItype\fR is \fBTK_CONFIG_INT\fR. This value is then stored in the
|
||||
record pointed to by \fIwidgRec\fR. This record is assumed to
|
||||
contain information relevant to the manager of the widget; its exact
|
||||
type is unknown to \fBTk_ConfigureWidget\fR. The \fIoffset\fR field
|
||||
of each \fIspecs\fR entry indicates where in \fIwidgRec\fR to store
|
||||
the information about this configuration option. You should use the
|
||||
\fBTk_Offset\fR macro to generate \fIoffset\fR values (see below for
|
||||
a description of \fBTk_Offset\fR). The location indicated by
|
||||
\fIwidgRec\fR and \fIoffset\fR will be referred to as the
|
||||
.QW target
|
||||
in the descriptions below.
|
||||
.PP
|
||||
The \fItype\fR field of each entry in \fIspecs\fR determines what
|
||||
to do with the string value of that configuration option. The
|
||||
legal values for \fItype\fR, and the corresponding actions, are:
|
||||
.TP
|
||||
\fBTK_CONFIG_ACTIVE_CURSOR\fR
|
||||
The value
|
||||
must be an ASCII string identifying a cursor in a form
|
||||
suitable for passing to \fBTk_GetCursor\fR.
|
||||
The value is converted to a \fBTk_Cursor\fR by calling
|
||||
\fBTk_GetCursor\fR and the result is stored in the target.
|
||||
In addition, the resulting cursor is made the active cursor
|
||||
for \fItkwin\fR by calling \fBXDefineCursor\fR.
|
||||
If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value
|
||||
may be an empty string, in which case the target and \fItkwin\fR's
|
||||
active cursor will be set to \fBNone\fR.
|
||||
If the previous value of the target
|
||||
was not \fBNone\fR, then it is freed by passing it to \fBTk_FreeCursor\fR.
|
||||
.TP
|
||||
\fBTK_CONFIG_ANCHOR\fR
|
||||
The value must be an ASCII string identifying an anchor point in one of the ways
|
||||
accepted by \fBTk_GetAnchor\fR.
|
||||
The string is converted to a \fBTk_Anchor\fR by calling
|
||||
\fBTk_GetAnchor\fR and the result is stored in the target.
|
||||
.TP
|
||||
\fBTK_CONFIG_BITMAP\fR
|
||||
The value must be an ASCII string identifying a bitmap in a form
|
||||
suitable for passing to \fBTk_GetBitmap\fR. The value is converted
|
||||
to a \fBPixmap\fR by calling \fBTk_GetBitmap\fR and the result
|
||||
is stored in the target.
|
||||
If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value
|
||||
may be an empty string, in which case the target is set to \fBNone\fR.
|
||||
If the previous value of the target
|
||||
was not \fBNone\fR, then it is freed by passing it to \fBTk_FreeBitmap\fR.
|
||||
.TP
|
||||
\fBTK_CONFIG_BOOLEAN\fR
|
||||
The value must be an ASCII string specifying a boolean value. Any
|
||||
of the values
|
||||
.QW true ,
|
||||
.QW yes ,
|
||||
.QW on ,
|
||||
or
|
||||
.QW 1 ,
|
||||
or an abbreviation of one of these values, means true;
|
||||
any of the values
|
||||
.QW false ,
|
||||
.QW no ,
|
||||
.QW off ,
|
||||
or
|
||||
.QW 0 ,
|
||||
or an abbreviation of one of these values, means false.
|
||||
The target is expected to be an integer; for true values it will
|
||||
be set to 1 and for false values it will be set to 0.
|
||||
.TP
|
||||
\fBTK_CONFIG_BORDER\fR
|
||||
The value must be an ASCII string identifying a border color in a form
|
||||
suitable for passing to \fBTk_Get3DBorder\fR. The value is converted
|
||||
to a (\fBTk_3DBorder *\fR) by calling \fBTk_Get3DBorder\fR and the result
|
||||
is stored in the target.
|
||||
If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value
|
||||
may be an empty string, in which case the target will be set to NULL.
|
||||
If the previous value of the target
|
||||
was not NULL, then it is freed by passing it to \fBTk_Free3DBorder\fR.
|
||||
.TP
|
||||
\fBTK_CONFIG_CAP_STYLE\fR
|
||||
The value must be
|
||||
an ASCII string identifying a cap style in one of the ways
|
||||
accepted by \fBTk_GetCapStyle\fR.
|
||||
The string is converted to an integer value corresponding
|
||||
to the cap style by calling
|
||||
\fBTk_GetCapStyle\fR and the result is stored in the target.
|
||||
.TP
|
||||
\fBTK_CONFIG_COLOR\fR
|
||||
The value must be an ASCII string identifying a color in a form
|
||||
suitable for passing to \fBTk_GetColor\fR. The value is converted
|
||||
to an (\fBXColor *\fR) by calling \fBTk_GetColor\fR and the result
|
||||
is stored in the target.
|
||||
If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value
|
||||
may be an empty string, in which case the target will be set to \fBNone\fR.
|
||||
If the previous value of the target
|
||||
was not NULL, then it is freed by passing it to \fBTk_FreeColor\fR.
|
||||
.TP
|
||||
\fBTK_CONFIG_CURSOR\fR
|
||||
This option is identical to \fBTK_CONFIG_ACTIVE_CURSOR\fR except
|
||||
that the new cursor is not made the active one for \fItkwin\fR.
|
||||
.TP
|
||||
\fBTK_CONFIG_CUSTOM\fR
|
||||
This option allows applications to define new option types.
|
||||
The \fIcustomPtr\fR field of the entry points to a structure
|
||||
defining the new option type.
|
||||
See the section \fBCUSTOM OPTION TYPES\fR below for details.
|
||||
.TP
|
||||
\fBTK_CONFIG_DOUBLE\fR
|
||||
The value must be an ASCII floating-point number in
|
||||
the format accepted by \fBstrtol\fR. The string is converted
|
||||
to a \fBdouble\fR value, and the value is stored in the
|
||||
target.
|
||||
.TP
|
||||
\fBTK_CONFIG_END\fR
|
||||
Marks the end of the table. The last entry in \fIspecs\fR
|
||||
must have this type; all of its other fields are ignored and it
|
||||
will never match any arguments.
|
||||
.TP
|
||||
\fBTK_CONFIG_FONT\fR
|
||||
The value must be an ASCII string identifying a font in a form
|
||||
suitable for passing to \fBTk_GetFont\fR. The value is converted
|
||||
to a \fBTk_Font\fR by calling \fBTk_GetFont\fR and the result
|
||||
is stored in the target.
|
||||
If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value
|
||||
may be an empty string, in which case the target will be set to NULL.
|
||||
If the previous value of the target
|
||||
was not NULL, then it is freed by passing it to \fBTk_FreeFont\fR.
|
||||
.TP
|
||||
\fBTK_CONFIG_INT\fR
|
||||
The value must be an ASCII integer string
|
||||
in the format accepted by \fBstrtol\fR (e.g.
|
||||
.QW 0
|
||||
and
|
||||
.QW 0x
|
||||
prefixes may be used to specify octal or hexadecimal
|
||||
numbers, respectively). The string is converted to an integer
|
||||
value and the integer is stored in the target.
|
||||
.TP
|
||||
\fBTK_CONFIG_JOIN_STYLE\fR
|
||||
The value must be
|
||||
an ASCII string identifying a join style in one of the ways
|
||||
accepted by \fBTk_GetJoinStyle\fR.
|
||||
The string is converted to an integer value corresponding
|
||||
to the join style by calling
|
||||
\fBTk_GetJoinStyle\fR and the result is stored in the target.
|
||||
.TP
|
||||
\fBTK_CONFIG_JUSTIFY\fR
|
||||
The value must be
|
||||
an ASCII string identifying a justification method in one of the
|
||||
ways accepted by \fBTk_GetJustify\fR.
|
||||
The string is converted to a \fBTk_Justify\fR by calling
|
||||
\fBTk_GetJustify\fR and the result is stored in the target.
|
||||
.TP
|
||||
\fBTK_CONFIG_MM\fR
|
||||
The value must specify a screen distance in one of the forms acceptable
|
||||
to \fBTk_GetScreenMM\fR.
|
||||
The string is converted to double-precision floating-point distance
|
||||
in millimeters and the value is stored in the target.
|
||||
.TP
|
||||
\fBTK_CONFIG_PIXELS\fR
|
||||
The value must specify screen units in one of the forms acceptable
|
||||
to \fBTk_GetPixels\fR.
|
||||
The string is converted to an integer distance in pixels and the
|
||||
value is stored in the target.
|
||||
.TP
|
||||
\fBTK_CONFIG_RELIEF\fR
|
||||
The value must be an ASCII string identifying a relief in a form
|
||||
suitable for passing to \fBTk_GetRelief\fR. The value is converted
|
||||
to an integer relief value by calling \fBTk_GetRelief\fR and the result
|
||||
is stored in the target.
|
||||
.TP
|
||||
\fBTK_CONFIG_STRING\fR
|
||||
A copy
|
||||
of the value is made by allocating memory space with
|
||||
\fBTcl_Alloc\fR and copying the value into the dynamically-allocated
|
||||
space. A pointer to the new string is stored in the target.
|
||||
If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value
|
||||
may be an empty string, in which case the target will be set to NULL.
|
||||
If the previous value of the target was not NULL, then it is
|
||||
freed by passing it to \fBTcl_Free\fR.
|
||||
.TP
|
||||
\fBTK_CONFIG_SYNONYM\fR
|
||||
This \fItype\fR value identifies special entries in \fIspecs\fR that
|
||||
are synonyms for other entries. If an \fIargv\fR value matches the
|
||||
\fIargvName\fR of a \fBTK_CONFIG_SYNONYM\fR entry, the entry is not used
|
||||
directly. Instead, \fBTk_ConfigureWidget\fR searches \fIspecs\fR
|
||||
for another entry whose \fIargvName\fR is the same as the \fIdbName\fR
|
||||
field in the \fBTK_CONFIG_SYNONYM\fR entry; this new entry is used just
|
||||
as if its \fIargvName\fR had matched the \fIargv\fR value. The
|
||||
synonym mechanism allows multiple \fIargv\fR values to be used for
|
||||
a single configuration option, such as
|
||||
.QW \-background
|
||||
and
|
||||
.QW \-bg .
|
||||
.TP
|
||||
\fBTK_CONFIG_UID\fR
|
||||
The value is translated to a \fBTk_Uid\fR
|
||||
(by passing it to \fBTk_GetUid\fR). The resulting value
|
||||
is stored in the target.
|
||||
If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR and the value
|
||||
is an empty string then the target will be set to NULL.
|
||||
.TP
|
||||
\fBTK_CONFIG_WINDOW\fR
|
||||
The value must be a window path name. It is translated to a
|
||||
\fBTk_Window\fR token and the token is stored in the target.
|
||||
.SH "GROUPED ENTRIES"
|
||||
.PP
|
||||
In some cases it is useful to generate multiple resources from
|
||||
a single configuration value. For example, a color name might
|
||||
be used both to generate the background color for a widget (using
|
||||
\fBTK_CONFIG_COLOR\fR) and to generate a 3-D border to draw around the
|
||||
widget (using \fBTK_CONFIG_BORDER\fR). In cases like this it is possible
|
||||
to specify that several consecutive entries in \fIspecs\fR are to
|
||||
be treated as a group. The first entry is used to determine a value
|
||||
(using its \fIargvName\fR, \fIdbName\fR,
|
||||
\fIdbClass\fR, and \fIdefValue\fR fields). The value will be processed
|
||||
several times (one for each entry in the group), generating multiple
|
||||
different resources and modifying multiple targets within \fIwidgRec\fR.
|
||||
Each of the entries after the first must have a NULL value in its
|
||||
\fIargvName\fR field; this indicates that the entry is to be grouped
|
||||
with the entry that precedes it. Only the \fItype\fR and \fIoffset\fR
|
||||
fields are used from these follow-on entries.
|
||||
.SH "FLAGS"
|
||||
.PP
|
||||
The \fIflags\fR argument passed to \fBTk_ConfigureWidget\fR is used
|
||||
in conjunction with the \fIspecFlags\fR fields in the entries of \fIspecs\fR
|
||||
to provide additional control over the processing of configuration
|
||||
options. These values are used in three different ways as
|
||||
described below.
|
||||
.PP
|
||||
First, if the \fIflags\fR argument to \fBTk_ConfigureWidget\fR has
|
||||
the \fBTK_CONFIG_ARGV_ONLY\fR bit set (i.e., \fIflags\fR | \fBTK_CONFIG_ARGV_ONLY\fR != 0),
|
||||
then the option database and
|
||||
\fIdefValue\fR fields are not used. In this case, if an entry in
|
||||
\fIspecs\fR does not match a field in \fIargv\fR then nothing happens:
|
||||
the corresponding target is not modified. This feature is useful
|
||||
when the goal is to modify certain configuration options while
|
||||
leaving others in their current state, such as when a \fBconfigure\fR
|
||||
widget command is being processed.
|
||||
.PP
|
||||
Second, the \fIspecFlags\fR field of an entry in \fIspecs\fR may be used
|
||||
to control the processing of that entry. Each \fIspecFlags\fR
|
||||
field may consists of an OR-ed combination of the following values:
|
||||
.TP
|
||||
\fBTK_CONFIG_COLOR_ONLY\fR
|
||||
If this bit is set then the entry will only be considered if the
|
||||
display for \fItkwin\fR has more than one bit plane. If the display
|
||||
is monochromatic then this \fIspecs\fR entry will be ignored.
|
||||
.TP
|
||||
\fBTK_CONFIG_MONO_ONLY\fR
|
||||
If this bit is set then the entry will only be considered if the
|
||||
display for \fItkwin\fR has exactly one bit plane. If the display
|
||||
is not monochromatic then this \fIspecs\fR entry will be ignored.
|
||||
.TP
|
||||
\fBTK_CONFIG_NULL_OK\fR
|
||||
This bit is only relevant for some types of entries (see the
|
||||
descriptions of the various entry types above).
|
||||
If this bit is set, it indicates that an empty string value
|
||||
for the field is acceptable and if it occurs then the
|
||||
target should be set to NULL or \fBNone\fR, depending
|
||||
on the type of the target.
|
||||
This flag is typically used to allow a
|
||||
feature to be turned off entirely, e.g. set a cursor value to
|
||||
\fBNone\fR so that a window simply inherits its parent's cursor.
|
||||
If this bit is not set then empty strings are processed as strings,
|
||||
which generally results in an error.
|
||||
.TP
|
||||
\fBTK_CONFIG_DONT_SET_DEFAULT\fR
|
||||
If this bit is one, it means that the \fIdefValue\fR field of the
|
||||
entry should only be used for returning the default value in
|
||||
\fBTk_ConfigureInfo\fR.
|
||||
In calls to \fBTk_ConfigureWidget\fR no default will be supplied
|
||||
for entries with this flag set; it is assumed that the
|
||||
caller has already supplied a default value in the target location.
|
||||
This flag provides a performance optimization where it is expensive
|
||||
to process the default string: the client can compute the default
|
||||
once, save the value, and provide it before calling
|
||||
\fBTk_ConfigureWidget\fR.
|
||||
.TP
|
||||
\fBTK_CONFIG_OPTION_SPECIFIED\fR
|
||||
This bit is
|
||||
deprecated. It used to be set and cleared by \fBTk_ConfigureWidget\fR
|
||||
so that callers could detect what entries were specified in
|
||||
\fIargv\fR, but it was removed because it was inherently
|
||||
thread-unsafe. Code that wishes to detect what options were specified
|
||||
should use \fBTk_SetOptions\fR instead.
|
||||
.PP
|
||||
The \fBTK_CONFIG_MONO_ONLY\fR and \fBTK_CONFIG_COLOR_ONLY\fR flags are typically
|
||||
used to specify different default values for
|
||||
monochrome and color displays. This is done by creating two
|
||||
entries in \fIspecs\fR that are identical except for their
|
||||
\fIdefValue\fR and \fIspecFlags\fR fields. One entry should have
|
||||
the value \fBTK_CONFIG_MONO_ONLY\fR in its \fIspecFlags\fR and the
|
||||
default value for monochrome displays in its \fIdefValue\fR; the
|
||||
other entry should have the value \fBTK_CONFIG_COLOR_ONLY\fR in
|
||||
its \fIspecFlags\fR and the appropriate \fIdefValue\fR for
|
||||
color displays.
|
||||
.PP
|
||||
Third, it is possible to use \fIflags\fR and \fIspecFlags\fR
|
||||
together to selectively disable some entries. This feature is
|
||||
not needed very often. It is useful in cases where several
|
||||
similar kinds of widgets are implemented in one place. It allows
|
||||
a single \fIspecs\fR table to be created with all the configuration
|
||||
options for all the widget types. When processing a particular
|
||||
widget type, only entries relevant to that type will be used. This
|
||||
effect is achieved by setting the high-order bits (those in positions
|
||||
equal to or greater than \fBTK_CONFIG_USER_BIT\fR) in \fIspecFlags\fR
|
||||
values or in \fIflags\fR. In order for a particular entry in
|
||||
\fIspecs\fR to be used, its high-order bits must match exactly
|
||||
the high-order bits of the \fIflags\fR value passed to
|
||||
\fBTk_ConfigureWidget\fR. If a \fIspecs\fR table is being used
|
||||
for N different widget types, then N of the high-order bits will
|
||||
be used. Each \fIspecs\fR entry will have one of more of those
|
||||
bits set in its \fIspecFlags\fR field to indicate the widget types
|
||||
for which this entry is valid. When calling \fBTk_ConfigureWidget\fR,
|
||||
\fIflags\fR will have a single one of these bits set to select the
|
||||
entries for the desired widget type. For a working example of
|
||||
this feature, see the code in tkButton.c.
|
||||
.SH TK_OFFSET
|
||||
.PP
|
||||
The \fBTk_Offset\fR macro is provided as a safe way of generating
|
||||
the \fIoffset\fR values for entries in Tk_ConfigSpec structures.
|
||||
It takes two arguments: the name of a type of record, and the
|
||||
name of a field in that record. It returns the byte offset of
|
||||
the named field in records of the given type.
|
||||
.SH TK_CONFIGUREINFO
|
||||
.PP
|
||||
The \fBTk_ConfigureInfo\fR procedure may be used to obtain
|
||||
information about one or all of the options for a given widget.
|
||||
Given a token for a window (\fItkwin\fR), a table describing the
|
||||
configuration options for a class of widgets (\fIspecs\fR), a
|
||||
pointer to a widget record containing the current information for
|
||||
a widget (\fIwidgRec\fR), and a NULL \fIargvName\fR argument,
|
||||
\fBTk_ConfigureInfo\fR generates a string describing all of the
|
||||
configuration options for the window. The string is placed
|
||||
in interpreter \fIinterp\fR's result. Under normal circumstances
|
||||
it returns \fBTCL_OK\fR; if an error occurs then it returns \fBTCL_ERROR\fR
|
||||
and the interpreter's result will contain an error message.
|
||||
.PP
|
||||
If \fIargvName\fR is NULL, then the value left in
|
||||
the interpreter's result by \fBTk_ConfigureInfo\fR
|
||||
consists of a list of one or more entries, each of which describes
|
||||
one configuration option (i.e. one entry in \fIspecs\fR). Each
|
||||
entry in the list will contain either two or five values. If the
|
||||
corresponding entry in \fIspecs\fR has type \fBTK_CONFIG_SYNONYM\fR, then
|
||||
the list will contain two values: the \fIargvName\fR for the entry
|
||||
and the \fIdbName\fR (synonym name). Otherwise the list will contain
|
||||
five values: \fIargvName\fR, \fIdbName\fR, \fIdbClass\fR, \fIdefValue\fR,
|
||||
and current value. The current value is computed from the appropriate
|
||||
field of \fIwidgRec\fR by calling procedures like \fBTk_NameOfColor\fR.
|
||||
.PP
|
||||
If the \fIargvName\fR argument to \fBTk_ConfigureInfo\fR is non-NULL,
|
||||
then it indicates a single option, and information is returned only
|
||||
for that option. The string placed in the interpreter's result will be
|
||||
a list containing two or five values as described above; this will
|
||||
be identical to the corresponding sublist that would have been returned
|
||||
if \fIargvName\fR had been NULL.
|
||||
.PP
|
||||
The \fIflags\fR argument to \fBTk_ConfigureInfo\fR is used to restrict
|
||||
the \fIspecs\fR entries to consider, just as for \fBTk_ConfigureWidget\fR.
|
||||
.SH TK_CONFIGUREVALUE
|
||||
.PP
|
||||
\fBTk_ConfigureValue\fR takes arguments similar to \fBTk_ConfigureInfo\fR;
|
||||
instead of returning a list of values, it just returns the current value
|
||||
of the option given by \fIargvName\fR (\fIargvName\fR must not be NULL).
|
||||
The value is returned in interpreter \fIinterp\fR's result and \fBTCL_OK\fR is
|
||||
normally returned as the procedure's result.
|
||||
If an error occurs in \fBTk_ConfigureValue\fR (e.g., \fIargvName\fR is
|
||||
not a valid option name), \fBTCL_ERROR\fR is returned and an error message
|
||||
is left in the interpreter's result.
|
||||
This procedure is typically called to implement \fBcget\fR widget
|
||||
commands.
|
||||
.SH TK_FREEOPTIONS
|
||||
.PP
|
||||
The \fBTk_FreeOptions\fR procedure may be invoked during widget cleanup
|
||||
to release all of the resources associated with configuration options.
|
||||
It scans through \fIspecs\fR and for each entry corresponding to a
|
||||
resource that must be explicitly freed (e.g. those with
|
||||
type \fBTK_CONFIG_COLOR\fR), it frees the resource in the widget record.
|
||||
If the field in the widget record does not refer to a resource (e.g.
|
||||
it contains a null pointer) then no resource is freed for that
|
||||
entry.
|
||||
After freeing a resource, \fBTk_FreeOptions\fR sets the
|
||||
corresponding field of the widget record to null.
|
||||
.SH "CUSTOM OPTION TYPES"
|
||||
.PP
|
||||
Applications can extend the built-in configuration types with additional
|
||||
configuration types by writing procedures to parse and print options
|
||||
of the a type and creating a structure pointing to those procedures:
|
||||
.CS
|
||||
typedef struct Tk_CustomOption {
|
||||
Tk_OptionParseProc *\fIparseProc\fR;
|
||||
Tk_OptionPrintProc *\fIprintProc\fR;
|
||||
ClientData \fIclientData\fR;
|
||||
} \fBTk_CustomOption\fR;
|
||||
|
||||
typedef int \fBTk_OptionParseProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tk_Window \fItkwin\fR,
|
||||
char *\fIvalue\fR,
|
||||
char *\fIwidgRec\fR,
|
||||
int \fIoffset\fR);
|
||||
|
||||
typedef const char *\fBTk_OptionPrintProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
Tk_Window \fItkwin\fR,
|
||||
char *\fIwidgRec\fR,
|
||||
int \fIoffset\fR,
|
||||
Tcl_FreeProc **\fIfreeProcPtr\fR);
|
||||
.CE
|
||||
The Tk_CustomOption structure contains three fields, which are pointers
|
||||
to the two procedures and a \fIclientData\fR value to be passed to those
|
||||
procedures when they are invoked. The \fIclientData\fR value typically
|
||||
points to a structure containing information that is needed by the
|
||||
procedures when they are parsing and printing options.
|
||||
.PP
|
||||
The \fIparseProc\fR procedure is invoked by
|
||||
\fBTk_ConfigureWidget\fR to parse a string and store the resulting
|
||||
value in the widget record.
|
||||
The \fIclientData\fR argument is a copy of the \fIclientData\fR
|
||||
field in the Tk_CustomOption structure.
|
||||
The \fIinterp\fR argument points to a Tcl interpreter used for
|
||||
error reporting. \fITkwin\fR is a copy of the \fItkwin\fR argument
|
||||
to \fBTk_ConfigureWidget\fR. The \fIvalue\fR argument is a string
|
||||
describing the value for the option; it could have been specified
|
||||
explicitly in the call to \fBTk_ConfigureWidget\fR or it could
|
||||
come from the option database or a default.
|
||||
\fIValue\fR will never be a null pointer but it may point to
|
||||
an empty string.
|
||||
\fIRecordPtr\fR is the same as the \fIwidgRec\fR argument to
|
||||
\fBTk_ConfigureWidget\fR; it points to the start of the widget
|
||||
record to modify.
|
||||
The last argument, \fIoffset\fR, gives the offset in bytes from the start
|
||||
of the widget record to the location where the option value is to
|
||||
be placed. The procedure should translate the string to whatever
|
||||
form is appropriate for the option and store the value in the widget
|
||||
record. It should normally return \fBTCL_OK\fR, but if an error occurs
|
||||
in translating the string to a value then it should return \fBTCL_ERROR\fR
|
||||
and store an error message in interpreter \fIinterp\fR's result.
|
||||
.PP
|
||||
The \fIprintProc\fR procedure is called
|
||||
by \fBTk_ConfigureInfo\fR to produce a string value describing an
|
||||
existing option.
|
||||
Its \fIclientData\fR, \fItkwin\fR, \fIwidgRec\fR, and \fIoffset\fR
|
||||
arguments all have the same meaning as for Tk_OptionParseProc
|
||||
procedures.
|
||||
The \fIprintProc\fR procedure should examine the option whose value
|
||||
is stored at \fIoffset\fR in \fIwidgRec\fR, produce a string describing
|
||||
that option, and return a pointer to the string.
|
||||
If the string is stored in dynamically-allocated memory, then
|
||||
the procedure must set \fI*freeProcPtr\fR to the address of
|
||||
a procedure to call to free the string's memory; \fBTk_ConfigureInfo\fR
|
||||
will call this procedure when it is finished with the string.
|
||||
If the result string is stored in static memory then \fIprintProc\fR
|
||||
need not do anything with the \fIfreeProcPtr\fR argument.
|
||||
.PP
|
||||
Once \fIparseProc\fR and \fIprintProc\fR have been defined and a
|
||||
Tk_CustomOption structure has been created for them, options of this
|
||||
new type may be manipulated with Tk_ConfigSpec entries whose \fItype\fR
|
||||
fields are \fBTK_CONFIG_CUSTOM\fR and whose \fIcustomPtr\fR fields point
|
||||
to the Tk_CustomOption structure.
|
||||
.SH EXAMPLES
|
||||
.PP
|
||||
Although the explanation of \fBTk_ConfigureWidget\fR is fairly
|
||||
complicated, its actual use is pretty straightforward.
|
||||
The easiest way to get started is to copy the code
|
||||
from an existing widget.
|
||||
The library implementation of frames
|
||||
(tkFrame.c) has a simple configuration table, and the library
|
||||
implementation of buttons (tkButton.c) has a much more complex
|
||||
table that uses many of the fancy \fIspecFlags\fR mechanisms.
|
||||
.SH "SEE ALSO"
|
||||
Tk_SetOptions(3)
|
||||
.SH KEYWORDS
|
||||
anchor, bitmap, boolean, border, cap style, color, configuration options,
|
||||
cursor, custom, double, font, integer, join style, justify, millimeters,
|
||||
pixels, relief, synonym, uid
|
||||
147
doc/ConfigWind.3
147
doc/ConfigWind.3
@@ -1,147 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1990-1993 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_ConfigureWindow 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_ConfigureWindow, Tk_MoveWindow, Tk_ResizeWindow, Tk_MoveResizeWindow, Tk_SetWindowBorderWidth, Tk_ChangeWindowAttributes, Tk_SetWindowBackground, Tk_SetWindowBackgroundPixmap, Tk_SetWindowBorder, Tk_SetWindowBorderPixmap, Tk_SetWindowColormap, Tk_DefineCursor, Tk_UndefineCursor \- change window configuration or attributes
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
\fBTk_ConfigureWindow\fR(\fItkwin, valueMask, valuePtr\fR)
|
||||
.sp
|
||||
\fBTk_MoveWindow\fR(\fItkwin, x, y\fR)
|
||||
.sp
|
||||
\fBTk_ResizeWindow\fR(\fItkwin, width, height\fR)
|
||||
.sp
|
||||
\fBTk_MoveResizeWindow\fR(\fItkwin, x, y, width, height\fR)
|
||||
.sp
|
||||
\fBTk_SetWindowBorderWidth\fR(\fItkwin, borderWidth\fR)
|
||||
.sp
|
||||
\fBTk_ChangeWindowAttributes\fR(\fItkwin, valueMask, attsPtr\fR)
|
||||
.sp
|
||||
\fBTk_SetWindowBackground\fR(\fItkwin, pixel\fR)
|
||||
.sp
|
||||
\fBTk_SetWindowBackgroundPixmap\fR(\fItkwin, pixmap\fR)
|
||||
.sp
|
||||
\fBTk_SetWindowBorder\fR(\fItkwin, pixel\fR)
|
||||
.sp
|
||||
\fBTk_SetWindowBorderPixmap\fR(\fItkwin, pixmap\fR)
|
||||
.sp
|
||||
\fBTk_SetWindowColormap\fR(\fItkwin, colormap\fR)
|
||||
.sp
|
||||
\fBTk_DefineCursor\fR(\fItkwin, cursor\fR)
|
||||
.sp
|
||||
\fBTk_UndefineCursor\fR(\fItkwin\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS XSetWindowAttributes borderWidth
|
||||
.AP Tk_Window tkwin in
|
||||
Token for window.
|
||||
.AP "unsigned int" valueMask in
|
||||
OR-ed mask of values like \fBCWX\fR or \fBCWBorderPixel\fR,
|
||||
indicating which fields of \fI*valuePtr\fR or \fI*attsPtr\fR to use.
|
||||
.AP XWindowChanges *valuePtr in
|
||||
Points to a structure containing new values for the configuration
|
||||
parameters selected by \fIvalueMask\fR. Fields not selected
|
||||
by \fIvalueMask\fR are ignored.
|
||||
.AP int x in
|
||||
New x-coordinate for \fItkwin\fR's top left pixel (including
|
||||
border, if any) within tkwin's parent.
|
||||
.AP int y in
|
||||
New y-coordinate for \fItkwin\fR's top left pixel (including
|
||||
border, if any) within tkwin's parent.
|
||||
.AP "int" width in
|
||||
New width for \fItkwin\fR (interior, not including border).
|
||||
.AP "int" height in
|
||||
New height for \fItkwin\fR (interior, not including border).
|
||||
.AP "int" borderWidth in
|
||||
New width for \fItkwin\fR's border.
|
||||
.AP XSetWindowAttributes *attsPtr in
|
||||
Points to a structure containing new values for the attributes
|
||||
given by the \fIvalueMask\fR argument. Attributes not selected
|
||||
by \fIvalueMask\fR are ignored.
|
||||
.AP "unsigned long" pixel in
|
||||
New background or border color for window.
|
||||
.AP Pixmap pixmap in
|
||||
New pixmap to use for background or border of \fItkwin\fR. WARNING:
|
||||
cannot necessarily be deleted immediately, as for Xlib calls. See
|
||||
note below.
|
||||
.AP Colormap colormap in
|
||||
New colormap to use for \fItkwin\fR.
|
||||
.AP Tk_Cursor cursor in
|
||||
New cursor to use for \fItkwin\fR. If \fBNone\fR is specified, then
|
||||
\fItkwin\fR will not have its own cursor; it will use the cursor
|
||||
of its parent.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures are analogous to the X library procedures
|
||||
with similar names, such as \fBXConfigureWindow\fR. Each
|
||||
one of the above procedures calls the corresponding X procedure
|
||||
and also saves the configuration information in Tk's local
|
||||
structure for the window. This allows the information to
|
||||
be retrieved quickly by the application (using macros such
|
||||
as \fBTk_X\fR and \fBTk_Height\fR) without having to contact
|
||||
the X server. In addition, if no X window has actually been
|
||||
created for \fItkwin\fR yet, these procedures do not issue
|
||||
X operations or cause event handlers to be invoked; they save
|
||||
the information in Tk's local
|
||||
structure for the window; when the window is created later,
|
||||
the saved information will be used to configure the window.
|
||||
.PP
|
||||
See the X library documentation for details on what these
|
||||
procedures do and how they use their arguments.
|
||||
.PP
|
||||
In the procedures \fBTk_ConfigureWindow\fR, \fBTk_MoveWindow\fR,
|
||||
\fBTk_ResizeWindow\fR, \fBTk_MoveResizeWindow\fR, and
|
||||
\fBTk_SetWindowBorderWidth\fR,
|
||||
if \fItkwin\fR is an internal window then event handlers interested
|
||||
in configure events are invoked immediately, before the procedure
|
||||
returns. If \fItkwin\fR is a top-level window
|
||||
then the event handlers will be invoked later, after X has seen
|
||||
the request and returned an event for it.
|
||||
.PP
|
||||
Applications using Tk should never call procedures like
|
||||
\fBXConfigureWindow\fR directly; they should always use the
|
||||
corresponding Tk procedures.
|
||||
.PP
|
||||
The size and location of a window should only be modified by the
|
||||
appropriate geometry manager for that window and never by a window
|
||||
itself (but see \fBTk_MoveToplevelWindow\fR for moving a top-level
|
||||
window).
|
||||
.PP
|
||||
You may not use \fBTk_ConfigureWindow\fR to change the
|
||||
stacking order of a window (\fIvalueMask\fR may not contain the
|
||||
\fBCWSibling\fR or \fBCWStackMode\fR bits).
|
||||
To change the stacking order, use the procedure \fBTk_RestackWindow\fR.
|
||||
.PP
|
||||
The procedure \fBTk_SetWindowColormap\fR will automatically add
|
||||
\fItkwin\fR to the \fBTK_COLORMAP_WINDOWS\fR property of its
|
||||
nearest top-level ancestor if the new colormap is different from
|
||||
that of \fItkwin\fR's parent and \fItkwin\fR is not already in
|
||||
the \fBTK_COLORMAP_WINDOWS\fR property.
|
||||
.SH BUGS
|
||||
.PP
|
||||
\fBTk_SetWindowBackgroundPixmap\fR and \fBTk_SetWindowBorderPixmap\fR
|
||||
differ slightly from their Xlib counterparts in that the \fIpixmap\fR
|
||||
argument may not necessarily be deleted immediately after calling
|
||||
one of these procedures. This is because \fItkwin\fR's window
|
||||
may not exist yet at the time of the call, in which case \fIpixmap\fR
|
||||
is merely saved and used later when \fItkwin\fR's window is actually
|
||||
created. If you wish to delete \fIpixmap\fR, then call
|
||||
\fBTk_MakeWindowExist\fR first to be sure that \fItkwin\fR's window exists
|
||||
and \fIpixmap\fR has been passed to the X server.
|
||||
.PP
|
||||
A similar problem occurs for the \fIcursor\fR argument passed to
|
||||
\fBTk_DefineCursor\fR. The solution is the same as for pixmaps above:
|
||||
call \fBTk_MakeWindowExist\fR before freeing the cursor.
|
||||
.SH "SEE ALSO"
|
||||
Tk_MoveToplevelWindow, Tk_RestackWindow
|
||||
.SH KEYWORDS
|
||||
attributes, border, color, configure, height, pixel, pixmap, width, window, x, y
|
||||
@@ -1,47 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1990-1993 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_CoordsToWindow 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_CoordsToWindow \- Find window containing a point
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
Tk_Window
|
||||
\fBTk_CoordsToWindow\fR(\fIrootX, rootY, tkwin\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_Window tkwin
|
||||
.AP int rootX in
|
||||
X-coordinate (in root window coordinates).
|
||||
.AP int rootY in
|
||||
Y-coordinate (in root window coordinates).
|
||||
.AP Tk_Window tkwin in
|
||||
Token for window that identifies application.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_CoordsToWindow\fR locates the window that contains a given point.
|
||||
The point is specified in root coordinates with \fIrootX\fR and
|
||||
\fIrootY\fR (if a virtual-root window manager is in use then
|
||||
\fIrootX\fR and \fIrootY\fR are in the coordinate system of the
|
||||
virtual root window).
|
||||
The return value from the procedure is a token for the window that
|
||||
contains the given point.
|
||||
If the point is not in any window, or if the containing window
|
||||
is not in the same application as \fItkwin\fR, then NULL is
|
||||
returned.
|
||||
.PP
|
||||
The containing window is decided using the same rules that determine
|
||||
which window contains the mouse cursor: if a parent and a child both
|
||||
contain the point then the child gets preference, and if two siblings
|
||||
both contain the point then the highest one in the stacking order
|
||||
(i.e. the one that's visible on the screen) gets preference.
|
||||
.SH KEYWORDS
|
||||
containing, coordinates, root window
|
||||
@@ -1,64 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 2000 Ajuba Solutions.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_CreateClientMessageHandler 3 "8.4" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_CreateClientMessageHandler, Tk_DeleteClientMessageHandler \- associate procedure callback with ClientMessage type X events
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
\fBTk_CreateClientMessageHandler\fR(\fIproc\fR)
|
||||
.sp
|
||||
\fBTk_DeleteClientMessageHandler\fR(\fIproc\fR)
|
||||
.SH ARGUMENTS
|
||||
.AP Tk_ClientMessageProc *proc in
|
||||
Procedure to invoke whenever a ClientMessage X event occurs on any display.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_CreateClientMessageHandler\fR arranges for \fIproc\fR to be invoked
|
||||
in the future whenever a ClientMessage X event occurs that is not handled by
|
||||
\fBWM_PROTOCOL\fR. \fBTk_CreateClientMessageHandler\fR is intended for use
|
||||
by applications which need to watch X ClientMessage events, such as drag and
|
||||
drop applications.
|
||||
.PP
|
||||
The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR;
|
||||
this mechanism only works in programs that dispatch events
|
||||
through \fBTk_HandleEvent\fR (or through other Tk procedures that
|
||||
call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or
|
||||
\fBTk_MainLoop\fR).
|
||||
.PP
|
||||
\fIProc\fR should have arguments and result that match the
|
||||
type \fBTk_ClientMessageProc\fR:
|
||||
.CS
|
||||
typedef int \fBTk_ClientMessageProc\fR(
|
||||
Tk_Window \fItkwin\fR,
|
||||
XEvent *\fIeventPtr\fR);
|
||||
.CE
|
||||
The \fItkwin\fR parameter to \fIproc\fR is the Tk window which is
|
||||
associated with this event. \fIEventPtr\fR is a pointer to the X event.
|
||||
.PP
|
||||
Whenever an X ClientMessage event is processed by \fBTk_HandleEvent\fR,
|
||||
the \fIproc\fR is called if it was not handled as a \fBWM_PROTOCOL\fR.
|
||||
The return value from \fIproc\fR is normally 0.
|
||||
A non-zero return value indicates that the event is not to be handled
|
||||
further; that is, \fIproc\fR has done all processing that is to be
|
||||
allowed for the event.
|
||||
.PP
|
||||
If there are multiple ClientMessage event handlers, each one is called
|
||||
for each event, in the order in which they were established.
|
||||
.PP
|
||||
\fBTk_DeleteClientMessageHandler\fR may be called to delete a
|
||||
previously-created ClientMessage event handler: it deletes each handler it
|
||||
finds that matches the \fIproc\fR argument. If no such handler exists,
|
||||
then \fBTk_DeleteClientMessageHandler\fR returns without doing anything.
|
||||
Although Tk supports it, it's probably a bad idea to have more than one
|
||||
callback with the same \fIproc\fR argument.
|
||||
.SH KEYWORDS
|
||||
bind, callback, event, handler
|
||||
@@ -1,44 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 2007 ActiveState Software Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_InitConsoleChannels 3 8.5 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_InitConsoleChannels \- Install the console channels as standard channels
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
\fBTk_InitConsoleChannels\fR(\fIinterp\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *interp in
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter in which the console channels are created.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_InitConsoleChannels\fR is invoked to create a set of console
|
||||
channels and install them as the standard channels. All I/O on these
|
||||
channels will be discarded until \fBTk_CreateConsoleWindow\fR is
|
||||
called to attach the console to a text widget.
|
||||
.PP
|
||||
This function is for use by shell applications based on Tk, like
|
||||
\fBwish\fR, on platforms which have no standard channels in graphical
|
||||
mode, like Win32.
|
||||
.PP
|
||||
The \fIinterp\fR argument is the interpreter in which to create and
|
||||
install the console channels.
|
||||
.PP
|
||||
\fBNOTE:\fR If this function is used it has to be called before the
|
||||
first call to \fBTcl_RegisterChannel\fR, directly, or indirectly
|
||||
through other channel functions. Because otherwise the standard
|
||||
channels will be already initialized to the system defaults, which will
|
||||
be nonsensical for the case \fBTk_InitConsoleChannels\fR is for.
|
||||
.SH "SEE ALSO"
|
||||
console(n)
|
||||
.SH KEYWORDS
|
||||
standard channels, console
|
||||
140
doc/CrtErrHdlr.3
140
doc/CrtErrHdlr.3
@@ -1,140 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1990 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_CreateErrorHandler 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_CreateErrorHandler, Tk_DeleteErrorHandler \- handle X protocol errors
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
Tk_ErrorHandler
|
||||
\fBTk_CreateErrorHandler\fR(\fIdisplay, error, request, minor, proc, clientData\fR)
|
||||
.sp
|
||||
\fBTk_DeleteErrorHandler\fR(\fIhandler\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS "Tk_ErrorHandler" clientData
|
||||
.AP Display *display in
|
||||
Display whose errors are to be handled.
|
||||
.AP int error in
|
||||
Match only error events with this value in the \fIerror_code\fR
|
||||
field. If \-1, then match any \fIerror_code\fR value.
|
||||
.AP int request in
|
||||
Match only error events with this value in the \fIrequest_code\fR
|
||||
field. If \-1, then match any \fIrequest_code\fR value.
|
||||
.AP int minor in
|
||||
Match only error events with this value in the \fIminor_code\fR
|
||||
field. If \-1, then match any \fIminor_code\fR value.
|
||||
.AP Tk_ErrorProc *proc in
|
||||
Procedure to invoke whenever an error event is received for
|
||||
\fIdisplay\fR and matches \fIerror\fR, \fIrequest\fR, and \fIminor\fR.
|
||||
NULL means ignore any matching errors.
|
||||
.AP ClientData clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.AP Tk_ErrorHandler handler in
|
||||
Token for error handler to delete (return value from a previous
|
||||
call to \fBTk_CreateErrorHandler\fR).
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_CreateErrorHandler\fR arranges for a particular procedure
|
||||
(\fIproc\fR) to be called whenever certain protocol errors occur on a
|
||||
particular display (\fIdisplay\fR). Protocol errors occur when
|
||||
the X protocol is used incorrectly, such as attempting to map a window
|
||||
that does not exist. See the Xlib documentation for \fBXSetErrorHandler\fR
|
||||
for more information on the kinds of errors that can occur.
|
||||
For \fIproc\fR to be invoked
|
||||
to handle a particular error, five things must occur:
|
||||
.IP [1]
|
||||
The error must pertain to \fIdisplay\fR.
|
||||
.IP [2]
|
||||
Either the \fIerror\fR argument to \fBTk_CreateErrorHandler\fR
|
||||
must have been \-1, or the \fIerror\fR argument must match
|
||||
the \fIerror_code\fR field from the error event.
|
||||
.IP [3]
|
||||
Either the \fIrequest\fR argument to \fBTk_CreateErrorHandler\fR
|
||||
must have been \-1, or the \fIrequest\fR argument must match
|
||||
the \fIrequest_code\fR field from the error event.
|
||||
.IP [4]
|
||||
Either the \fIminor\fR argument to \fBTk_CreateErrorHandler\fR
|
||||
must have been \-1, or the \fIminor\fR argument must match
|
||||
the \fIminor_code\fR field from the error event.
|
||||
.IP [5]
|
||||
The protocol request to which the error pertains must have been
|
||||
made when the handler was active (see below for more information).
|
||||
.PP
|
||||
\fIProc\fR should have arguments and result that match the
|
||||
following type:
|
||||
.CS
|
||||
typedef int \fBTk_ErrorProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
XErrorEvent *\fIerrEventPtr\fR);
|
||||
.CE
|
||||
The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR
|
||||
argument given to \fBTcl_CreateErrorHandler\fR when the callback
|
||||
was created. Typically, \fIclientData\fR points to a data
|
||||
structure containing application-specific information that is
|
||||
needed to deal with the error. \fIErrEventPtr\fR is
|
||||
a pointer to the X error event.
|
||||
The procedure \fIproc\fR should return an integer value. If it
|
||||
returns 0 it means that \fIproc\fR handled the error completely and there
|
||||
is no need to take any other action for the error. If it returns
|
||||
non-zero it means \fIproc\fR was unable to handle the error.
|
||||
.PP
|
||||
If a value of NULL is specified for \fIproc\fR, all matching errors
|
||||
will be ignored: this will produce the same result as if a procedure
|
||||
had been specified that always returns 0.
|
||||
.PP
|
||||
If more than more than one handler matches a particular error, then
|
||||
they are invoked in turn. The handlers will be invoked in reverse
|
||||
order of creation: most recently declared handler first.
|
||||
If any handler returns 0, then subsequent (older) handlers will
|
||||
not be invoked. If no handler returns 0, then Tk invokes X's
|
||||
default error handler, which prints an error message and aborts the
|
||||
program. If you wish to have a default handler that deals with errors
|
||||
that no other handler can deal with, then declare it first.
|
||||
.PP
|
||||
The X documentation states that
|
||||
.QW "the error handler should not call any functions (directly or indirectly) on the display that will generate protocol requests or that will look for input events."
|
||||
This restriction applies to handlers declared by \fBTk_CreateErrorHandler\fR;
|
||||
disobey it at your own risk.
|
||||
.PP
|
||||
\fBTk_DeleteErrorHandler\fR may be called to delete a
|
||||
previously-created error handler. The \fIhandler\fR argument
|
||||
identifies the error handler, and should be a value returned by
|
||||
a previous call to \fBTk_CreateEventHandler\fR.
|
||||
.PP
|
||||
A particular error handler applies to errors resulting
|
||||
from protocol requests generated between
|
||||
the call to \fBTk_CreateErrorHandler\fR and the call to
|
||||
\fBTk_DeleteErrorHandler\fR. However, the actual callback
|
||||
to \fIproc\fR may not occur until after the \fBTk_DeleteErrorHandler\fR
|
||||
call, due to buffering in the client and server.
|
||||
If an error event pertains to
|
||||
a protocol request made just before calling \fBTk_DeleteErrorHandler\fR,
|
||||
then the error event may not have been processed
|
||||
before the \fBTk_DeleteErrorHandler\fR
|
||||
call. When this situation arises, Tk will save information about
|
||||
the handler and
|
||||
invoke the handler's \fIproc\fR later when the error event
|
||||
finally arrives.
|
||||
If an application wishes to delete an error handler and know
|
||||
for certain that all relevant errors have been processed,
|
||||
it should first call \fBTk_DeleteErrorHandler\fR and then
|
||||
call \fBXSync\fR; this will flush out any buffered requests and errors,
|
||||
but will result in a performance penalty because
|
||||
it requires communication to and from the X server. After the
|
||||
\fBXSync\fR call Tk is guaranteed not to call any error
|
||||
handlers deleted before the \fBXSync\fR call.
|
||||
.PP
|
||||
For the Tk error handling mechanism to work properly, it is essential
|
||||
that application code never calls \fBXSetErrorHandler\fR directly;
|
||||
applications should use only \fBTk_CreateErrorHandler\fR.
|
||||
.SH KEYWORDS
|
||||
callback, error, event, handler
|
||||
@@ -1,81 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1992-1994 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_CreateGenericHandler 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_CreateGenericHandler, Tk_DeleteGenericHandler \- associate procedure callback with all X events
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
\fBTk_CreateGenericHandler\fR(\fIproc, clientData\fR)
|
||||
.sp
|
||||
\fBTk_DeleteGenericHandler\fR(\fIproc, clientData\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS "Tk_GenericProc" clientData
|
||||
.AP Tk_GenericProc *proc in
|
||||
Procedure to invoke whenever any X event occurs on any display.
|
||||
.AP ClientData clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_CreateGenericHandler\fR arranges for \fIproc\fR to be
|
||||
invoked in the future whenever any X event occurs. This mechanism is
|
||||
\fInot\fR intended for dispatching X events on windows managed by Tk
|
||||
(you should use \fBTk_CreateEventHandler\fR for this purpose).
|
||||
\fBTk_CreateGenericHandler\fR is intended for other purposes, such
|
||||
as tracing X events, monitoring events on windows not owned by Tk,
|
||||
accessing X-related libraries that were not originally designed for
|
||||
use with Tk, and so on.
|
||||
.PP
|
||||
The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR;
|
||||
this mechanism only works in programs that dispatch events
|
||||
through \fBTk_HandleEvent\fR (or through other Tk procedures that
|
||||
call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or
|
||||
\fBTk_MainLoop\fR).
|
||||
.PP
|
||||
\fIProc\fR should have arguments and result that match the
|
||||
type \fBTk_GenericProc\fR:
|
||||
.CS
|
||||
typedef int \fBTk_GenericProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
XEvent *\fIeventPtr\fR);
|
||||
.CE
|
||||
The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR
|
||||
argument given to \fBTk_CreateGenericHandler\fR when the callback
|
||||
was created. Typically, \fIclientData\fR points to a data
|
||||
structure containing application-specific information about
|
||||
how to handle events.
|
||||
\fIEventPtr\fR is a pointer to the X event.
|
||||
.PP
|
||||
Whenever an X event is processed by \fBTk_HandleEvent\fR, \fIproc\fR
|
||||
is called. The return value from \fIproc\fR is normally 0.
|
||||
A non-zero return value indicates that the event is not to be handled
|
||||
further; that is, \fIproc\fR has done all processing that is to be
|
||||
allowed for the event.
|
||||
.PP
|
||||
If there are multiple generic event handlers, each one is called
|
||||
for each event, in the order in which they were established.
|
||||
.PP
|
||||
\fBTk_DeleteGenericHandler\fR may be called to delete a
|
||||
previously-created generic event handler: it deletes each handler
|
||||
it finds that matches the \fIproc\fR and \fIclientData\fR arguments. If
|
||||
no such handler exists, then \fBTk_DeleteGenericHandler\fR returns
|
||||
without doing anything. Although Tk supports it, it's probably
|
||||
a bad idea to have more than one callback with the same
|
||||
\fIproc\fR and \fIclientData\fR arguments.
|
||||
.PP
|
||||
Establishing a generic event handler does nothing to ensure that the
|
||||
process will actually receive the X events that the handler wants to
|
||||
process.
|
||||
For example, it is the caller's responsibility to invoke
|
||||
\fBXSelectInput\fR to select the desired events, if that is necessary.
|
||||
.SH KEYWORDS
|
||||
bind, callback, event, handler
|
||||
283
doc/CrtImgType.3
283
doc/CrtImgType.3
@@ -1,283 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1994 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1997 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_CreateImageType 3 8.5 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_CreateImageType, Tk_GetImageMasterData, Tk_InitImageArgs \- define new kind of image
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
\fBTk_CreateImageType\fR(\fItypePtr\fR)
|
||||
.sp
|
||||
ClientData
|
||||
\fBTk_GetImageMasterData\fR(\fIinterp, name, typePtrPtr\fR)
|
||||
.sp
|
||||
\fBTk_InitImageArgs\fR(\fIinterp, argc, argvPtr\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS "const Tk_ImageType" *typePtrPtr
|
||||
.AP "const Tk_ImageType" *typePtr in
|
||||
Structure that defines the new type of image.
|
||||
For Tk 8.4 and earlier this must be static: a
|
||||
pointer to this structure is retained by the image code.
|
||||
In Tk 8.5, this limitation was relaxed.
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter in which image was created.
|
||||
.AP "const char" *name in
|
||||
Name of existing image.
|
||||
.AP Tk_ImageType **typePtrPtr out
|
||||
Points to word in which to store a pointer to type information for
|
||||
the given image, if it exists.
|
||||
.AP int argc in
|
||||
Number of arguments
|
||||
.AP char ***argvPtr in/out
|
||||
Pointer to argument list
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_CreateImageType\fR is invoked to define a new kind of image.
|
||||
An image type corresponds to a particular value of the \fItype\fR
|
||||
argument for the \fBimage create\fR command. There may exist
|
||||
any number of different image types, and new types may be defined
|
||||
dynamically by calling \fBTk_CreateImageType\fR.
|
||||
For example, there might be one type for 2-color bitmaps,
|
||||
another for multi-color images, another for dithered images,
|
||||
another for video, and so on.
|
||||
.PP
|
||||
The code that implements a new image type is called an
|
||||
\fIimage manager\fR.
|
||||
It consists of a collection of procedures plus three different
|
||||
kinds of data structures.
|
||||
The first data structure is a Tk_ImageType structure, which contains
|
||||
the name of the image type and pointers to five procedures provided
|
||||
by the image manager to deal with images of this type:
|
||||
.CS
|
||||
typedef struct Tk_ImageType {
|
||||
const char *\fIname\fR;
|
||||
Tk_ImageCreateProc *\fIcreateProc\fR;
|
||||
Tk_ImageGetProc *\fIgetProc\fR;
|
||||
Tk_ImageDisplayProc *\fIdisplayProc\fR;
|
||||
Tk_ImageFreeProc *\fIfreeProc\fR;
|
||||
Tk_ImageDeleteProc *\fIdeleteProc\fR;
|
||||
} \fBTk_ImageType\fR;
|
||||
.CE
|
||||
The fields of this structure will be described in later subsections
|
||||
of this entry.
|
||||
.PP
|
||||
The second major data structure manipulated by an image manager
|
||||
is called an \fIimage master\fR; it contains overall information
|
||||
about a particular image, such as the values of the configuration
|
||||
options specified in an \fBimage create\fR command.
|
||||
There will usually be one of these structures for each
|
||||
invocation of the \fBimage create\fR command.
|
||||
.PP
|
||||
The third data structure related to images is an \fIimage instance\fR.
|
||||
There will usually be one of these structures for each usage of an
|
||||
image in a particular widget.
|
||||
It is possible for a single image to appear simultaneously
|
||||
in multiple widgets, or even multiple times in the same widget.
|
||||
Furthermore, different instances may be on different screens
|
||||
or displays.
|
||||
The image instance data structure describes things that may
|
||||
vary from instance to instance, such as colors and graphics
|
||||
contexts for redisplay.
|
||||
There is usually one instance structure for each \fB\-image\fR
|
||||
option specified for a widget or canvas item.
|
||||
.PP
|
||||
The following subsections describe the fields of a Tk_ImageType
|
||||
in more detail.
|
||||
.SS NAME
|
||||
.PP
|
||||
\fItypePtr->name\fR provides a name for the image type.
|
||||
Once \fBTk_CreateImageType\fR returns, this name may be used
|
||||
in \fBimage create\fR commands to create images of the new
|
||||
type.
|
||||
If there already existed an image type by this name then
|
||||
the new image type replaces the old one.
|
||||
.SS CREATEPROC
|
||||
.PP
|
||||
\fItypePtr->createProc\fR provides the address of a procedure for
|
||||
Tk to call whenever \fBimage create\fR is invoked to create
|
||||
an image of the new type.
|
||||
\fItypePtr->createProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef int \fBTk_ImageCreateProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
const char *\fIname\fR,
|
||||
int \fIobjc\fR,
|
||||
Tcl_Obj *const \fIobjv\fR[],
|
||||
const Tk_ImageType *\fItypePtr\fR,
|
||||
Tk_ImageMaster \fImaster\fR,
|
||||
ClientData *\fImasterDataPtr\fR);
|
||||
.CE
|
||||
The \fIinterp\fR argument is the interpreter in which the \fBimage\fR
|
||||
command was invoked, and \fIname\fR is the name for the new image,
|
||||
which was either specified explicitly in the \fBimage\fR command
|
||||
or generated automatically by the \fBimage\fR command.
|
||||
The \fIobjc\fR and \fIobjv\fR arguments describe all the configuration
|
||||
options for the new image (everything after the name argument to
|
||||
\fBimage\fR).
|
||||
The \fImaster\fR argument is a token that refers to Tk's information
|
||||
about this image; the image manager must return this token to
|
||||
Tk when invoking the \fBTk_ImageChanged\fR procedure.
|
||||
Typically \fIcreateProc\fR will parse \fIobjc\fR and \fIobjv\fR
|
||||
and create an image master data structure for the new image.
|
||||
\fIcreateProc\fR may store an arbitrary one-word value at
|
||||
*\fImasterDataPtr\fR, which will be passed back to the
|
||||
image manager when other callbacks are invoked.
|
||||
Typically the value is a pointer to the master data
|
||||
structure for the image.
|
||||
.PP
|
||||
If \fIcreateProc\fR encounters an error, it should leave an error
|
||||
message in the interpreter result and return \fBTCL_ERROR\fR; otherwise
|
||||
it should return \fBTCL_OK\fR.
|
||||
.PP
|
||||
\fIcreateProc\fR should call \fBTk_ImageChanged\fR in order to set the
|
||||
size of the image and request an initial redisplay.
|
||||
.SS GETPROC
|
||||
.PP
|
||||
\fItypePtr->getProc\fR is invoked by Tk whenever a widget
|
||||
calls \fBTk_GetImage\fR to use a particular image.
|
||||
This procedure must match the following prototype:
|
||||
.CS
|
||||
typedef ClientData \fBTk_ImageGetProc\fR(
|
||||
Tk_Window \fItkwin\fR,
|
||||
ClientData \fImasterData\fR);
|
||||
.CE
|
||||
The \fItkwin\fR argument identifies the window in which the
|
||||
image will be used and \fImasterData\fR is the value
|
||||
returned by \fIcreateProc\fR when the image master was created.
|
||||
\fIgetProc\fR will usually create a data structure for the new
|
||||
instance, including such things as the resources needed to
|
||||
display the image in the given window.
|
||||
\fIgetProc\fR returns a one-word token for the instance, which
|
||||
is typically the address of the instance data structure.
|
||||
Tk will pass this value back to the image manager when invoking
|
||||
its \fIdisplayProc\fR and \fIfreeProc\fR procedures.
|
||||
.SS DISPLAYPROC
|
||||
.PP
|
||||
\fItypePtr->displayProc\fR is invoked by Tk whenever an image needs
|
||||
to be displayed (i.e., whenever a widget calls \fBTk_RedrawImage\fR).
|
||||
\fIdisplayProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef void \fBTk_ImageDisplayProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
Display *\fIdisplay\fR,
|
||||
Drawable \fIdrawable\fR,
|
||||
int \fIimageX\fR,
|
||||
int \fIimageY\fR,
|
||||
int \fIwidth\fR,
|
||||
int \fIheight\fR,
|
||||
int \fIdrawableX\fR,
|
||||
int \fIdrawableY\fR);
|
||||
.CE
|
||||
The \fIinstanceData\fR will be the same as the value returned by
|
||||
\fIgetProc\fR when the instance was created.
|
||||
\fIdisplay\fR and \fIdrawable\fR indicate where to display the
|
||||
image; \fIdrawable\fR may be a pixmap rather than
|
||||
the window specified to \fIgetProc\fR (this is usually the case,
|
||||
since most widgets double-buffer their redisplay to get smoother
|
||||
visual effects).
|
||||
\fIimageX\fR, \fIimageY\fR, \fIwidth\fR, and \fIheight\fR
|
||||
identify the region of the image that must be redisplayed.
|
||||
This region will always be within the size of the image
|
||||
as specified in the most recent call to \fBTk_ImageChanged\fR.
|
||||
\fIdrawableX\fR and \fIdrawableY\fR indicate where in \fIdrawable\fR
|
||||
the image should be displayed; \fIdisplayProc\fR should display
|
||||
the given region of the image so that point (\fIimageX\fR, \fIimageY\fR)
|
||||
in the image appears at (\fIdrawableX\fR, \fIdrawableY\fR) in \fIdrawable\fR.
|
||||
.SS FREEPROC
|
||||
.PP
|
||||
\fItypePtr->freeProc\fR contains the address of a procedure that
|
||||
Tk will invoke when an image instance is released (i.e., when
|
||||
\fBTk_FreeImage\fR is invoked).
|
||||
This can happen, for example, when a widget is deleted or a image item
|
||||
in a canvas is deleted, or when the image displayed in a widget or
|
||||
canvas item is changed.
|
||||
\fIfreeProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef void \fBTk_ImageFreeProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
Display *\fIdisplay\fR);
|
||||
.CE
|
||||
The \fIinstanceData\fR will be the same as the value returned by
|
||||
\fIgetProc\fR when the instance was created, and \fIdisplay\fR
|
||||
is the display containing the window for the instance.
|
||||
\fIfreeProc\fR should release any resources associated with the
|
||||
image instance, since the instance will never be used again.
|
||||
.SS DELETEPROC
|
||||
.PP
|
||||
\fItypePtr->deleteProc\fR is a procedure that Tk invokes when an
|
||||
image is being deleted (i.e. when the \fBimage delete\fR command
|
||||
is invoked).
|
||||
Before invoking \fIdeleteProc\fR Tk will invoke \fIfreeProc\fR for
|
||||
each of the image's instances.
|
||||
\fIdeleteProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef void \fBTk_ImageDeleteProc\fR(
|
||||
ClientData \fImasterData\fR);
|
||||
.CE
|
||||
The \fImasterData\fR argument will be the same as the value
|
||||
stored in \fI*masterDataPtr\fR by \fIcreateProc\fR when the
|
||||
image was created.
|
||||
\fIdeleteProc\fR should release any resources associated with
|
||||
the image.
|
||||
.SH TK_GETIMAGEMASTERDATA
|
||||
.PP
|
||||
The procedure \fBTk_GetImageMasterData\fR may be invoked to retrieve
|
||||
information about an image. For example, an image manager can use this
|
||||
procedure to locate its image master data for an image.
|
||||
If there exists an image named \fIname\fR
|
||||
in the interpreter given by \fIinterp\fR, then \fI*typePtrPtr\fR is
|
||||
filled in with type information for the image (the \fItypePtr\fR value
|
||||
passed to \fBTk_CreateImageType\fR when the image type was registered)
|
||||
and the return value is the ClientData value returned by the
|
||||
\fIcreateProc\fR when the image was created (this is typically a
|
||||
pointer to the image master data structure). If no such image exists
|
||||
then NULL is returned and NULL is stored at \fI*typePtrPtr\fR.
|
||||
.SH "LEGACY INTERFACE SUPPORT"
|
||||
.PP
|
||||
In Tk 8.2 and earlier, the definition of \fBTk_ImageCreateProc\fR
|
||||
was incompatibly different, with the following prototype:
|
||||
.CS
|
||||
typedef int \fBTk_ImageCreateProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
char *\fIname\fR,
|
||||
int \fIargc\fR,
|
||||
char **\fIargv\fR,
|
||||
Tk_ImageType *\fItypePtr\fR,
|
||||
Tk_ImageMaster \fImaster\fR,
|
||||
ClientData *\fImasterDataPtr\fR);
|
||||
.CE
|
||||
Legacy programs and libraries dating from those days may still
|
||||
contain code that defines extended Tk image types using the old
|
||||
interface. The Tk header file will still support this legacy
|
||||
interface if the code is compiled with the macro \fBUSE_OLD_IMAGE\fR
|
||||
defined.
|
||||
.PP
|
||||
When the \fBUSE_OLD_IMAGE\fR legacy support is enabled, you may
|
||||
see the routine \fBTk_InitImageArgs\fR in use. This was a migration
|
||||
tool used to create stub-enabled extensions that could be loaded
|
||||
into interps containing all versions of Tk 8.1 and later. Tk 8.5 no longer
|
||||
provides this routine, but uses a macro to convert any attempted
|
||||
calls of this routine into an empty comment. Any stub-enabled
|
||||
extension providing an extended image type via the legacy interface
|
||||
that is compiled against Tk 8.5 headers and linked against the
|
||||
Tk 8.5 stub library will produce a file that can be loaded only
|
||||
into interps with Tk 8.5 or later; that is, the normal stub-compatibility
|
||||
rules. If a developer needs to generate from such code a file
|
||||
that is loadable into interps with Tk 8.4 or earlier, they must
|
||||
use Tk 8.4 headers and stub libraries to do so.
|
||||
.PP
|
||||
Any new code written today should not make use of the legacy
|
||||
interfaces. Expect their support to go away in Tk 9.
|
||||
.SH "SEE ALSO"
|
||||
Tk_ImageChanged, Tk_GetImage, Tk_FreeImage, Tk_RedrawImage, Tk_SizeOfImage
|
||||
.SH KEYWORDS
|
||||
image manager, image type, instance, master
|
||||
@@ -1,695 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1994-1995 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_CreateItemType 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_CreateItemType, Tk_GetItemTypes \- define new kind of canvas item
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
\fBTk_CreateItemType\fR(\fItypePtr\fR)
|
||||
.sp
|
||||
Tk_ItemType *
|
||||
\fBTk_GetItemTypes\fR()
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_ItemType *typePtr
|
||||
.AP Tk_ItemType *typePtr in
|
||||
Structure that defines the new type of canvas item.
|
||||
.BE
|
||||
.SH INTRODUCTION
|
||||
.PP
|
||||
\fBTk_CreateItemType\fR is invoked to define a new kind of canvas item
|
||||
described by the \fItypePtr\fR argument.
|
||||
An item type corresponds to a particular value of the \fItype\fR
|
||||
argument to the \fBcreate\fR widget command for canvases, and
|
||||
the code that implements a canvas item type is called a \fItype manager\fR.
|
||||
Tk defines several built-in item types, such as \fBrectangle\fR
|
||||
and \fBtext\fR and \fBimage\fR, but \fBTk_CreateItemType\fR
|
||||
allows additional item types to be defined.
|
||||
Once \fBTk_CreateItemType\fR returns, the new item type may be used
|
||||
in new or existing canvas widgets just like the built-in item
|
||||
types.
|
||||
.PP
|
||||
\fBTk_GetItemTypes\fR returns a pointer to the first in the list
|
||||
of all item types currently defined for canvases.
|
||||
The entries in the list are linked together through their
|
||||
\fInextPtr\fR fields, with the end of the list marked by a
|
||||
NULL \fInextPtr\fR.
|
||||
.PP
|
||||
You may find it easier to understand the rest of this manual entry
|
||||
by looking at the code for an existing canvas item type such as
|
||||
bitmap (in the file tkCanvBmap.c) or text (tkCanvText.c).
|
||||
The easiest way to create a new type manager is to copy the code
|
||||
for an existing type and modify it for the new type.
|
||||
.PP
|
||||
Tk provides a number of utility procedures for the use of canvas
|
||||
type managers, such as \fBTk_CanvasCoords\fR and \fBTk_CanvasPsColor\fR;
|
||||
these are described in separate manual entries.
|
||||
.SH "DATA STRUCTURES"
|
||||
.PP
|
||||
A type manager consists of a collection of procedures that provide a
|
||||
standard set of operations on items of that type.
|
||||
The type manager deals with three kinds of data
|
||||
structures.
|
||||
The first data structure is a Tk_ItemType; it contains
|
||||
information such as the name of the type and pointers to
|
||||
the standard procedures implemented by the type manager:
|
||||
.PP
|
||||
.CS
|
||||
typedef struct Tk_ItemType {
|
||||
const char *\fIname\fR;
|
||||
int \fIitemSize\fR;
|
||||
Tk_ItemCreateProc *\fIcreateProc\fR;
|
||||
const Tk_ConfigSpec *\fIconfigSpecs\fR;
|
||||
Tk_ItemConfigureProc *\fIconfigProc\fR;
|
||||
Tk_ItemCoordProc *\fIcoordProc\fR;
|
||||
Tk_ItemDeleteProc *\fIdeleteProc\fR;
|
||||
Tk_ItemDisplayProc *\fIdisplayProc\fR;
|
||||
int \fIalwaysRedraw\fR;
|
||||
Tk_ItemPointProc *\fIpointProc\fR;
|
||||
Tk_ItemAreaProc *\fIareaProc\fR;
|
||||
Tk_ItemPostscriptProc *\fIpostscriptProc\fR;
|
||||
Tk_ItemScaleProc *\fIscaleProc\fR;
|
||||
Tk_ItemTranslateProc *\fItranslateProc\fR;
|
||||
Tk_ItemIndexProc *\fIindexProc\fR;
|
||||
Tk_ItemCursorProc *\fIicursorProc\fR;
|
||||
Tk_ItemSelectionProc *\fIselectionProc\fR;
|
||||
Tk_ItemInsertProc *\fIinsertProc\fR;
|
||||
Tk_ItemDCharsProc *\fIdCharsProc\fR;
|
||||
Tk_ItemType *\fInextPtr\fR;
|
||||
} \fBTk_ItemType\fR;
|
||||
.CE
|
||||
.PP
|
||||
The fields of a Tk_ItemType structure are described in more detail
|
||||
later in this manual entry.
|
||||
When \fBTk_CreateItemType\fR is called, its \fItypePtr\fR
|
||||
argument must point to a structure with all of the fields initialized
|
||||
except \fInextPtr\fR, which Tk sets to link all the types together
|
||||
into a list.
|
||||
The structure must be in permanent memory (either statically
|
||||
allocated or dynamically allocated but never freed); Tk retains
|
||||
a pointer to this structure.
|
||||
.PP
|
||||
The second data structure manipulated by a type manager is an
|
||||
\fIitem record\fR.
|
||||
For each item in a canvas there exists one item record.
|
||||
All of the items of a given type generally have item records with
|
||||
the same structure, but different types usually have different
|
||||
formats for their item records.
|
||||
The first part of each item record is a header with a standard structure
|
||||
defined by Tk via the type Tk_Item; the rest of the item
|
||||
record is defined by the type manager.
|
||||
A type manager must define its item records with a Tk_Item as
|
||||
the first field.
|
||||
For example, the item record for bitmap items is defined as follows:
|
||||
.PP
|
||||
.CS
|
||||
typedef struct BitmapItem {
|
||||
Tk_Item \fIheader\fR;
|
||||
double \fIx\fR, \fIy\fR;
|
||||
Tk_Anchor \fIanchor\fR;
|
||||
Pixmap \fIbitmap\fR;
|
||||
XColor *\fIfgColor\fR;
|
||||
XColor *\fIbgColor\fR;
|
||||
GC \fIgc\fR;
|
||||
} \fBBitmapItem\fR;
|
||||
.CE
|
||||
.PP
|
||||
The \fIheader\fR substructure contains information used by Tk
|
||||
to manage the item, such as its identifier, its tags, its type,
|
||||
and its bounding box.
|
||||
The fields starting with \fIx\fR belong to the type manager:
|
||||
Tk will never read or write them.
|
||||
The type manager should not need to read or write any of the
|
||||
fields in the header except for four fields
|
||||
whose names are \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR.
|
||||
These fields give a bounding box for the items using integer
|
||||
canvas coordinates: the item should not cover any pixels
|
||||
with x-coordinate lower than \fIx1\fR or y-coordinate
|
||||
lower than \fIy1\fR, nor should it cover any pixels with
|
||||
x-coordinate greater than or equal to \fIx2\fR or y-coordinate
|
||||
greater than or equal to \fIy2\fR.
|
||||
It is up to the type manager to keep the bounding box up to
|
||||
date as the item is moved and reconfigured.
|
||||
.PP
|
||||
Whenever Tk calls a procedure in a type manager it passes in a pointer
|
||||
to an item record.
|
||||
The argument is always passed as a pointer to a Tk_Item; the type
|
||||
manager will typically cast this into a pointer to its own specific
|
||||
type, such as BitmapItem.
|
||||
.PP
|
||||
The third data structure used by type managers has type
|
||||
Tk_Canvas; it serves as an opaque handle for the canvas widget
|
||||
as a whole.
|
||||
Type managers need not know anything about the contents of this
|
||||
structure.
|
||||
A Tk_Canvas handle is typically passed in to the
|
||||
procedures of a type manager, and the type manager can pass the
|
||||
handle back to library procedures such as Tk_CanvasTkwin
|
||||
to fetch information about the canvas.
|
||||
.SH "TK_ITEMTYPE FIELDS"
|
||||
.SS NAME
|
||||
.PP
|
||||
This section and the ones that follow describe each of the fields
|
||||
in a Tk_ItemType structure in detail.
|
||||
The \fIname\fR field provides a string name for the item type.
|
||||
Once \fBTk_CreateImageType\fR returns, this name may be used
|
||||
in \fBcreate\fR widget commands to create items of the new
|
||||
type.
|
||||
If there already existed an item type by this name then
|
||||
the new item type replaces the old one.
|
||||
.SS "FLAGS (IN ALWAYSREDRAW)"
|
||||
.PP
|
||||
The \fItypePtr\->alwaysRedraw\fR field (so named for historic reasons)
|
||||
contains a collection of flag bits that modify how the canvas core interacts
|
||||
with the item. The following bits are defined:
|
||||
.TP
|
||||
\fB1\fR
|
||||
.
|
||||
Indicates that the item should always be redrawn when any part of the canvas
|
||||
is redrawn, rather than only when the bounding box of the item overlaps the
|
||||
area being redrawn. This is used by window items, for example, which need to
|
||||
unmap subwindows that are not on the screen.
|
||||
.TP
|
||||
\fBTK_CONFIG_OBJS\fR
|
||||
.
|
||||
Indicates that operations which would otherwise take a string (or array of
|
||||
strings) actually take a Tcl_Obj reference (or an array of such references).
|
||||
The operations to which this applies are the \fIconfigProc\fR, the
|
||||
\fIcoordProc\fR, the \fIcreateProc\fR, the \fIindexProc\fR and the
|
||||
\fIinsertProc\fR.
|
||||
.TP
|
||||
\fBTK_MOVABLE_POINTS\fR
|
||||
.VS 8.6
|
||||
Indicates that the item supports the \fIdCharsProc\fR, \fIindexProc\fR and
|
||||
\fIinsertProc\fR with the same semantics as Tk's built-in line and polygon
|
||||
types, and that hence individual coordinate points can be moved. Must not be
|
||||
set if any of the above methods is NULL.
|
||||
.VE 8.6
|
||||
.SS ITEMSIZE
|
||||
.PP
|
||||
\fItypePtr\->itemSize\fR gives the size in bytes of item records
|
||||
of this type, including the Tk_Item header.
|
||||
Tk uses this size to allocate memory space for items of the type.
|
||||
All of the item records for a given type must have the same size.
|
||||
If variable length fields are needed for an item (such as a list
|
||||
of points for a polygon), the type manager can allocate a separate
|
||||
object of variable length and keep a pointer to it in the item record.
|
||||
.SS CREATEPROC
|
||||
.PP
|
||||
\fItypePtr\->createProc\fR points to a procedure for
|
||||
Tk to call whenever a new item of this type is created.
|
||||
\fItypePtr\->createProc\fR must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTk_ItemCreateProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIobjc\fR,
|
||||
Tcl_Obj *const \fIobjv\fR[]);
|
||||
.CE
|
||||
.PP
|
||||
The \fIinterp\fR argument is the interpreter in which the canvas's
|
||||
\fBcreate\fR widget command was invoked, and \fIcanvas\fR is a
|
||||
handle for the canvas widget.
|
||||
\fIitemPtr\fR is a pointer to a newly-allocated item of
|
||||
size \fItypePtr\->itemSize\fR.
|
||||
Tk has already initialized the item's header (the first
|
||||
\fBsizeof(Tk_ItemType)\fR bytes).
|
||||
The \fIobjc\fR and \fIobjv\fR arguments describe all of the
|
||||
arguments to the \fBcreate\fR command after the \fItype\fR
|
||||
argument.
|
||||
Note that if \fBTK_CONFIG_OBJS\fR is not set in the
|
||||
\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually
|
||||
contain a pointer to an array of constant strings.
|
||||
For example, in the widget command:
|
||||
.PP
|
||||
.CS
|
||||
\fB\&.c create rectangle 10 20 50 50 \-fill black\fR
|
||||
.CE
|
||||
.PP
|
||||
\fIobjc\fR will be \fB6\fR and \fIobjv\fR[0] will contain the
|
||||
integer object \fB10\fR.
|
||||
.PP
|
||||
\fIcreateProc\fR should use \fIobjc\fR and \fIobjv\fR to initialize
|
||||
the type-specific parts of the item record and set an initial value
|
||||
for the bounding box in the item's header.
|
||||
It should return a standard Tcl completion code and leave an
|
||||
error message in the interpreter result if an error occurs.
|
||||
If an error occurs Tk will free the item record, so \fIcreateProc\fR
|
||||
must be sure to leave the item record in a clean state if it returns an error
|
||||
(e.g., it must free any additional memory that it allocated for
|
||||
the item).
|
||||
.SS CONFIGSPECS
|
||||
.PP
|
||||
Each type manager must provide a standard table describing its
|
||||
configuration options, in a form suitable for use with
|
||||
\fBTk_ConfigureWidget\fR.
|
||||
This table will normally be used by \fItypePtr\->createProc\fR
|
||||
and \fItypePtr\->configProc\fR, but Tk also uses it directly
|
||||
to retrieve option information in the \fBitemcget\fR and
|
||||
\fBitemconfigure\fR widget commands.
|
||||
\fItypePtr\->configSpecs\fR must point to the configuration table
|
||||
for this type.
|
||||
Note: Tk provides a custom option type \fBtk_CanvasTagsOption\fR
|
||||
for implementing the \fB\-tags\fR option; see an existing type
|
||||
manager for an example of how to use it in \fIconfigSpecs\fR.
|
||||
.SS CONFIGPROC
|
||||
.PP
|
||||
\fItypePtr\->configProc\fR is called by Tk whenever the
|
||||
\fBitemconfigure\fR widget command is invoked to change the
|
||||
configuration options for a canvas item.
|
||||
This procedure must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTk_ItemConfigureProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIobjc\fR,
|
||||
Tcl_Obj *const \fIobjv\fR[],
|
||||
int \fIflags\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIinterp\fR argument identifies the interpreter in which the
|
||||
widget command was invoked, \fIcanvas\fR is a handle for the canvas
|
||||
widget, and \fIitemPtr\fR is a pointer to the item being configured.
|
||||
\fIobjc\fR and \fIobjv\fR contain the configuration options.
|
||||
Note that if \fBTK_CONFIG_OBJS\fR is not set in the
|
||||
\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually
|
||||
contain a pointer to an array of constant strings.
|
||||
For example, if the following command is invoked:
|
||||
.PP
|
||||
.CS
|
||||
\fB\&.c itemconfigure 2 \-fill red \-outline black\fR
|
||||
.CE
|
||||
.PP
|
||||
\fIobjc\fR is \fB4\fR and \fIobjv\fR contains the string objects \fB\-fill\fR
|
||||
through \fBblack\fR.
|
||||
\fIobjc\fR will always be an even value.
|
||||
The \fIflags\fR argument contains flags to pass to \fBTk_ConfigureWidget\fR;
|
||||
currently this value is always \fBTK_CONFIG_ARGV_ONLY\fR when Tk
|
||||
invokes \fItypePtr\->configProc\fR, but the type manager's \fIcreateProc\fR
|
||||
procedure will usually invoke \fIconfigProc\fR with different flag values.
|
||||
.PP
|
||||
\fItypePtr\->configProc\fR returns a standard Tcl completion code and
|
||||
leaves an error message in the interpreter result if an error occurs.
|
||||
It must update the item's bounding box to reflect the new configuration
|
||||
options.
|
||||
.SS COORDPROC
|
||||
.PP
|
||||
\fItypePtr\->coordProc\fR is invoked by Tk to implement the \fBcoords\fR
|
||||
widget command for an item.
|
||||
It must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTk_ItemCoordProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIobjc\fR,
|
||||
Tcl_Obj *const \fIobjv\fR[]);
|
||||
.CE
|
||||
.PP
|
||||
The arguments \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR
|
||||
all have the standard meanings, and \fIobjc\fR and \fIobjv\fR
|
||||
describe the coordinate arguments.
|
||||
Note that if \fBTK_CONFIG_OBJS\fR is not set in the
|
||||
\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually
|
||||
contain a pointer to an array of constant strings.
|
||||
For example, if the following widget command is invoked:
|
||||
.PP
|
||||
.CS
|
||||
\fB\&.c coords 2 30 90\fR
|
||||
.CE
|
||||
.PP
|
||||
\fIobjc\fR will be \fB2\fR and \fBobjv\fR will contain the integer objects
|
||||
\fB30\fR and \fB90\fR.
|
||||
.PP
|
||||
The \fIcoordProc\fR procedure should process the new coordinates,
|
||||
update the item appropriately (e.g., it must reset the bounding
|
||||
box in the item's header), and return a standard Tcl completion
|
||||
code.
|
||||
If an error occurs, \fIcoordProc\fR must leave an error message in
|
||||
the interpreter result.
|
||||
.SS DELETEPROC
|
||||
.PP
|
||||
\fItypePtr\->deleteProc\fR is invoked by Tk to delete an item
|
||||
and free any resources allocated to it.
|
||||
It must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTk_ItemDeleteProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
Display *\fIdisplay\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual
|
||||
interpretations, and \fIdisplay\fR identifies the X display containing
|
||||
the canvas.
|
||||
\fIdeleteProc\fR must free up any resources allocated for the item,
|
||||
so that Tk can free the item record.
|
||||
\fIdeleteProc\fR should not actually free the item record; this will
|
||||
be done by Tk when \fIdeleteProc\fR returns.
|
||||
.SS "DISPLAYPROC"
|
||||
.PP
|
||||
\fItypePtr\->displayProc\fR is invoked by Tk to redraw an item
|
||||
on the screen.
|
||||
It must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTk_ItemDisplayProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
Display *\fIdisplay\fR,
|
||||
Drawable \fIdst\fR,
|
||||
int \fIx\fR,
|
||||
int \fIy\fR,
|
||||
int \fIwidth\fR,
|
||||
int \fIheight\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning.
|
||||
\fIdisplay\fR identifies the display containing the canvas, and
|
||||
\fIdst\fR specifies a drawable in which the item should be rendered;
|
||||
typically this is an off-screen pixmap, which Tk will copy into
|
||||
the canvas's window once all relevant items have been drawn.
|
||||
\fIx\fR, \fIy\fR, \fIwidth\fR, and \fIheight\fR specify a rectangular
|
||||
region in canvas coordinates, which is the area to be redrawn;
|
||||
only information that overlaps this area needs to be redrawn.
|
||||
Tk will not call \fIdisplayProc\fR unless the item's bounding box
|
||||
overlaps the redraw area, but the type manager may wish to use
|
||||
the redraw area to optimize the redisplay of the item.
|
||||
.PP
|
||||
Because of scrolling and the use of off-screen pixmaps for
|
||||
double-buffered redisplay, the item's coordinates in \fIdst\fR
|
||||
will not necessarily be the same as those in the canvas.
|
||||
\fIdisplayProc\fR should call \fBTk_CanvasDrawableCoords\fR
|
||||
to transform coordinates from those of the canvas to those
|
||||
of \fIdst\fR.
|
||||
.PP
|
||||
Normally an item's \fIdisplayProc\fR is only invoked if the item
|
||||
overlaps the area being displayed.
|
||||
However, if bit zero of \fItypePtr\->alwaysRedraw\fR is 1,
|
||||
(i.e.\|
|
||||
.QW "\fItypePtr\->alwaysRedraw & 1 == 1\fR" )
|
||||
then \fIdisplayProc\fR is invoked during every redisplay operation,
|
||||
even if the item does not overlap the area of redisplay; this is useful for
|
||||
cases such as window items, where the subwindow needs to be unmapped when it
|
||||
is off the screen.
|
||||
.SS POINTPROC
|
||||
.PP
|
||||
\fItypePtr\->pointProc\fR is invoked by Tk to find out how close
|
||||
a given point is to a canvas item.
|
||||
Tk uses this procedure for purposes such as locating the item
|
||||
under the mouse or finding the closest item to a given point.
|
||||
The procedure must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef double \fBTk_ItemPointProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
double *\fIpointPtr\fR);
|
||||
.CE
|
||||
.PP
|
||||
\fIcanvas\fR and \fIitemPtr\fR have the usual meaning.
|
||||
\fIpointPtr\fR points to an array of two numbers giving
|
||||
the x and y coordinates of a point.
|
||||
\fIpointProc\fR must return a real value giving the distance
|
||||
from the point to the item, or 0 if the point lies inside
|
||||
the item.
|
||||
.SS AREAPROC
|
||||
.PP
|
||||
\fItypePtr\->areaProc\fR is invoked by Tk to find out the relationship
|
||||
between an item and a rectangular area.
|
||||
It must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTk_ItemAreaProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
double *\fIrectPtr\fR);
|
||||
.CE
|
||||
.PP
|
||||
\fIcanvas\fR and \fIitemPtr\fR have the usual meaning.
|
||||
\fIrectPtr\fR points to an array of four real numbers;
|
||||
the first two give the x and y coordinates of the upper left
|
||||
corner of a rectangle, and the second two give the x and y
|
||||
coordinates of the lower right corner.
|
||||
\fIareaProc\fR must return \-1 if the item lies entirely outside
|
||||
the given area, 0 if it lies partially inside and partially
|
||||
outside the area, and 1 if it lies entirely inside the area.
|
||||
.SS POSTSCRIPTPROC
|
||||
.PP
|
||||
\fItypePtr\->postscriptProc\fR is invoked by Tk to generate
|
||||
Postscript for an item during the \fBpostscript\fR widget command.
|
||||
If the type manager is not capable of generating Postscript then
|
||||
\fItypePtr\->postscriptProc\fR should be NULL.
|
||||
The procedure must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTk_ItemPostscriptProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIprepass\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR arguments all have
|
||||
standard meanings; \fIprepass\fR will be described below.
|
||||
If \fIpostscriptProc\fR completes successfully, it should append
|
||||
Postscript for the item to the information in the interpreter result
|
||||
(e.g. by calling \fBTcl_AppendResult\fR, not \fBTcl_SetResult\fR)
|
||||
and return \fBTCL_OK\fR.
|
||||
If an error occurs, \fIpostscriptProc\fR should clear the result
|
||||
and replace its contents with an error message; then it should
|
||||
return \fBTCL_ERROR\fR.
|
||||
.PP
|
||||
Tk provides a collection of utility procedures to simplify
|
||||
\fIpostscriptProc\fR.
|
||||
For example, \fBTk_CanvasPsColor\fR will generate Postscript to set
|
||||
the current color to a given Tk color and \fBTk_CanvasPsFont\fR will
|
||||
set up font information.
|
||||
When generating Postscript, the type manager is free to change the
|
||||
graphics state of the Postscript interpreter, since Tk places
|
||||
\fBgsave\fR and \fBgrestore\fR commands around the Postscript for
|
||||
the item.
|
||||
The type manager can use canvas x coordinates directly in its Postscript,
|
||||
but it must call \fBTk_CanvasPsY\fR to convert y coordinates from
|
||||
the space of the canvas (where the origin is at the
|
||||
upper left) to the space of Postscript (where the origin is at the
|
||||
lower left).
|
||||
.PP
|
||||
In order to generate Postscript that complies with the Adobe Document
|
||||
Structuring Conventions, Tk actually generates Postscript in two passes.
|
||||
It calls each item's \fIpostscriptProc\fR in each pass.
|
||||
The only purpose of the first pass is to collect font information
|
||||
(which is done by \fBTk_CanvasPsFont\fR); the actual Postscript is
|
||||
discarded.
|
||||
Tk sets the \fIprepass\fR argument to \fIpostscriptProc\fR to 1
|
||||
during the first pass; the type manager can use \fIprepass\fR to skip
|
||||
all Postscript generation except for calls to \fBTk_CanvasPsFont\fR.
|
||||
During the second pass \fIprepass\fR will be 0, so the type manager
|
||||
must generate complete Postscript.
|
||||
.SS SCALEPROC
|
||||
.PP
|
||||
\fItypePtr\->scaleProc\fR is invoked by Tk to rescale a canvas item
|
||||
during the \fBscale\fR widget command.
|
||||
The procedure must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTk_ItemScaleProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
double \fIoriginX\fR,
|
||||
double \fIoriginY\fR,
|
||||
double \fIscaleX\fR,
|
||||
double \fIscaleY\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning.
|
||||
\fIoriginX\fR and \fIoriginY\fR specify an origin relative to which
|
||||
the item is to be scaled, and \fIscaleX\fR and \fIscaleY\fR give the
|
||||
x and y scale factors.
|
||||
The item should adjust its coordinates so that a point in the item
|
||||
that used to have coordinates \fIx\fR and \fIy\fR will have new
|
||||
coordinates \fIx\(fm\fR and \fIy\(fm\fR, where
|
||||
.PP
|
||||
.CS
|
||||
\fIx\(fm\fR = \fIoriginX\fR + \fIscaleX\fR \(mu (\fIx\fR \(mi \fIoriginX\fR)
|
||||
\fIy\(fm\fR = \fIoriginY\fR + \fIscaleY\fR \(mu (\fIy\fR \(mi \fIoriginY\fR)
|
||||
.CE
|
||||
.PP
|
||||
\fIscaleProc\fR must also update the bounding box in the item's
|
||||
header.
|
||||
.SS TRANSLATEPROC
|
||||
.PP
|
||||
\fItypePtr\->translateProc\fR is invoked by Tk to translate a canvas item
|
||||
during the \fBmove\fR widget command.
|
||||
The procedure must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTk_ItemTranslateProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
double \fIdeltaX\fR,
|
||||
double \fIdeltaY\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning,
|
||||
and \fIdeltaX\fR and \fIdeltaY\fR give the amounts that should be
|
||||
added to each x and y coordinate within the item.
|
||||
The type manager should adjust the item's coordinates and
|
||||
update the bounding box in the item's header.
|
||||
.SS INDEXPROC
|
||||
.PP
|
||||
\fItypePtr\->indexProc\fR is invoked by Tk to translate a string
|
||||
index specification into a numerical index, for example during the
|
||||
\fBindex\fR widget command.
|
||||
It is only relevant for item types that support indexable text or coordinates;
|
||||
\fItypePtr\->indexProc\fR may be specified as NULL for non-textual
|
||||
item types if they do not support detailed coordinate addressing.
|
||||
The procedure must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTk_ItemIndexProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
Tcl_Obj *\fIindexObj\fR,
|
||||
int *\fIindexPtr\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR arguments all
|
||||
have the usual meaning.
|
||||
\fIindexObj\fR contains a textual description of an index,
|
||||
and \fIindexPtr\fR points to an integer value that should be
|
||||
filled in with a numerical index.
|
||||
Note that if \fBTK_CONFIG_OBJS\fR is not set in the
|
||||
\fItypePtr\->alwaysRedraw\fR field, the \fIindexObj\fR parameter will
|
||||
actually contain a pointer to a constant string.
|
||||
It is up to the type manager to decide what forms of index
|
||||
are supported (e.g., numbers, \fBinsert\fR, \fBsel.first\fR,
|
||||
\fBend\fR, etc.).
|
||||
\fIindexProc\fR should return a Tcl completion code and set
|
||||
the interpreter result in the event of an error.
|
||||
.SS ICURSORPROC
|
||||
.PP
|
||||
\fItypePtr\->icursorProc\fR is invoked by Tk during
|
||||
the \fBicursor\fR widget command to set the position of the
|
||||
insertion cursor in a textual item.
|
||||
It is only relevant for item types that support an insertion cursor;
|
||||
\fItypePtr\->icursorProc\fR may be specified as NULL for item types
|
||||
that do not support an insertion cursor.
|
||||
The procedure must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTk_ItemCursorProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIindex\fR);
|
||||
.CE
|
||||
.PP
|
||||
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings, and
|
||||
\fIindex\fR is an index into the item's text, as returned by a
|
||||
previous call to \fItypePtr\->insertProc\fR.
|
||||
The type manager should position the insertion cursor in the
|
||||
item just before the character given by \fIindex\fR.
|
||||
Whether or not to actually display the insertion cursor is
|
||||
determined by other information provided by \fBTk_CanvasGetTextInfo\fR.
|
||||
.SS SELECTIONPROC
|
||||
.PP
|
||||
\fItypePtr\->selectionProc\fR is invoked by Tk during selection
|
||||
retrievals; it must return part or all of the selected text in
|
||||
the item (if any).
|
||||
It is only relevant for item types that support text;
|
||||
\fItypePtr\->selectionProc\fR may be specified as NULL for non-textual
|
||||
item types.
|
||||
The procedure must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTk_ItemSelectionProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIoffset\fR,
|
||||
char *\fIbuffer\fR,
|
||||
int \fImaxBytes\fR);
|
||||
.CE
|
||||
.PP
|
||||
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings.
|
||||
\fIoffset\fR is an offset in bytes into the selection where 0 refers
|
||||
to the first byte of the selection; it identifies
|
||||
the first character that is to be returned in this call.
|
||||
\fIbuffer\fR points to an area of memory in which to store the
|
||||
requested bytes, and \fImaxBytes\fR specifies the maximum number
|
||||
of bytes to return.
|
||||
\fIselectionProc\fR should extract up to \fImaxBytes\fR characters
|
||||
from the selection and copy them to \fImaxBytes\fR; it should
|
||||
return a count of the number of bytes actually copied, which may
|
||||
be less than \fImaxBytes\fR if there are not \fIoffset+maxBytes\fR bytes
|
||||
in the selection.
|
||||
.SS INSERTPROC
|
||||
.PP
|
||||
\fItypePtr\->insertProc\fR is invoked by Tk during
|
||||
the \fBinsert\fR widget command to insert new text or coordinates into a
|
||||
canvas item.
|
||||
It is only relevant for item types that support the \fBinsert\fR method;
|
||||
\fItypePtr\->insertProc\fR may be specified as NULL for other
|
||||
item types.
|
||||
The procedure must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTk_ItemInsertProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIindex\fR,
|
||||
Tcl_Obj *\fIobj\fR);
|
||||
.CE
|
||||
.PP
|
||||
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings.
|
||||
\fIindex\fR is an index into the item's text, as returned by a
|
||||
previous call to \fItypePtr\->insertProc\fR, and \fIobj\fR
|
||||
contains new text to insert just before the character given
|
||||
by \fIindex\fR.
|
||||
Note that if \fBTK_CONFIG_OBJS\fR is not set in the
|
||||
\fItypePtr\->alwaysRedraw\fR field, the \fIobj\fR parameter will
|
||||
actually contain a pointer to a constant string to be inserted.
|
||||
If the item supports modification of the coordinates list by this
|
||||
.PP
|
||||
The type manager should insert the text and recompute the bounding
|
||||
box in the item's header.
|
||||
.SS DCHARSPROC
|
||||
.PP
|
||||
\fItypePtr\->dCharsProc\fR is invoked by Tk during the \fBdchars\fR
|
||||
widget command to delete a range of text from a canvas item or a range of
|
||||
coordinates from a pathed item.
|
||||
It is only relevant for item types that support text;
|
||||
\fItypePtr\->dCharsProc\fR may be specified as NULL for non-textual
|
||||
item types that do not want to support coordinate deletion.
|
||||
The procedure must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTk_ItemDCharsProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIfirst\fR,
|
||||
int \fIlast\fR);
|
||||
.CE
|
||||
.PP
|
||||
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings.
|
||||
\fIfirst\fR and \fIlast\fR give the indices of the first and last bytes
|
||||
to be deleted, as returned by previous calls to \fItypePtr\->indexProc\fR.
|
||||
The type manager should delete the specified characters and update
|
||||
the bounding box in the item's header.
|
||||
.SH "SEE ALSO"
|
||||
Tk_CanvasPsY, Tk_CanvasTextInfo, Tk_CanvasTkwin
|
||||
.SH KEYWORDS
|
||||
canvas, focus, item type, selection, type manager
|
||||
@@ -1,270 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1994 The Australian National University
|
||||
'\" Copyright (c) 1994-1997 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" Author: Paul Mackerras (paulus@cs.anu.edu.au),
|
||||
'\" Department of Computer Science,
|
||||
'\" Australian National University.
|
||||
'\"
|
||||
.TH Tk_CreatePhotoImageFormat 3 8.5 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_CreatePhotoImageFormat \- define new file format for photo images
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
\fBTk_CreatePhotoImageFormat\fR(\fIformatPtr\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS "const Tk_PhotoImageFormat" *formatPtr
|
||||
.AP "const Tk_PhotoImageFormat" *formatPtr in
|
||||
Structure that defines the new file format.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_CreatePhotoImageFormat\fR is invoked to define a new file format
|
||||
for image data for use with photo images. The code that implements an
|
||||
image file format is called an image file format handler, or
|
||||
handler for short. The photo image code
|
||||
maintains a list of handlers that can be used to read and
|
||||
write data to or from a file. Some handlers may also
|
||||
support reading image data from a string or converting image data to a
|
||||
string format.
|
||||
The user can specify which handler to use with the \fB\-format\fR
|
||||
image configuration option or the \fB\-format\fR option to the
|
||||
\fBread\fR and \fBwrite\fR photo image subcommands.
|
||||
.PP
|
||||
An image file format handler consists of a collection of procedures
|
||||
plus a Tk_PhotoImageFormat structure, which contains the name of the
|
||||
image file format and pointers to six procedures provided by the
|
||||
handler to deal with files and strings in this format. The
|
||||
Tk_PhotoImageFormat structure contains the following fields:
|
||||
.CS
|
||||
typedef struct Tk_PhotoImageFormat {
|
||||
const char *\fIname\fR;
|
||||
Tk_ImageFileMatchProc *\fIfileMatchProc\fR;
|
||||
Tk_ImageStringMatchProc *\fIstringMatchProc\fR;
|
||||
Tk_ImageFileReadProc *\fIfileReadProc\fR;
|
||||
Tk_ImageStringReadProc *\fIstringReadProc\fR;
|
||||
Tk_ImageFileWriteProc *\fIfileWriteProc\fR;
|
||||
Tk_ImageStringWriteProc *\fIstringWriteProc\fR;
|
||||
} \fBTk_PhotoImageFormat\fR;
|
||||
.CE
|
||||
.PP
|
||||
The handler need not provide implementations of all six procedures.
|
||||
For example, the procedures that handle string data would not be
|
||||
provided for a format in which the image data are stored in binary,
|
||||
and could therefore contain null characters. If any procedure is not
|
||||
implemented, the corresponding pointer in the Tk_PhotoImageFormat
|
||||
structure should be set to NULL. The handler must provide the
|
||||
\fIfileMatchProc\fR procedure if it provides the \fIfileReadProc\fR
|
||||
procedure, and the \fIstringMatchProc\fR procedure if it provides the
|
||||
\fIstringReadProc\fR procedure.
|
||||
.SS NAME
|
||||
.PP
|
||||
\fIformatPtr->name\fR provides a name for the image type.
|
||||
Once \fBTk_CreatePhotoImageFormat\fR returns, this name may be used
|
||||
in the \fB\-format\fR photo image configuration and subcommand option.
|
||||
The manual page for the photo image (photo(n)) describes how image
|
||||
file formats are chosen based on their names and the value given to
|
||||
the \fB\-format\fR option. The first character of \fIformatPtr->name\fR
|
||||
must not be an uppercase character from the ASCII character set
|
||||
(that is, one of the characters \fBA\fR-\fBZ\fR). Such names are used
|
||||
only for legacy interface support (see below).
|
||||
.SS FILEMATCHPROC
|
||||
.PP
|
||||
\fIformatPtr->fileMatchProc\fR provides the address of a procedure for
|
||||
Tk to call when it is searching for an image file format handler
|
||||
suitable for reading data in a given file.
|
||||
\fIformatPtr->fileMatchProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef int \fBTk_ImageFileMatchProc\fR(
|
||||
Tcl_Channel \fIchan\fR,
|
||||
const char *\fIfileName\fR,
|
||||
Tcl_Obj *\fIformat\fR,
|
||||
int *\fIwidthPtr\fR,
|
||||
int *\fIheightPtr\fR,
|
||||
Tcl_Interp *\fIinterp\fR);
|
||||
.CE
|
||||
The \fIfileName\fR argument is the name of the file containing the
|
||||
image data, which is open for reading as \fIchan\fR. The
|
||||
\fIformat\fR argument contains the value given for the
|
||||
\fB\-format\fR option, or NULL if the option was not specified.
|
||||
If the data in the file appears to be in the format supported by this
|
||||
handler, the \fIformatPtr->fileMatchProc\fR procedure should store the
|
||||
width and height of the image in *\fIwidthPtr\fR and *\fIheightPtr\fR
|
||||
respectively, and return 1. Otherwise it should return 0.
|
||||
.SS STRINGMATCHPROC
|
||||
.PP
|
||||
\fIformatPtr->stringMatchProc\fR provides the address of a procedure for
|
||||
Tk to call when it is searching for an image file format handler for
|
||||
suitable for reading data from a given string.
|
||||
\fIformatPtr->stringMatchProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef int \fBTk_ImageStringMatchProc\fR(
|
||||
Tcl_Obj *\fIdata\fR,
|
||||
Tcl_Obj *\fIformat\fR,
|
||||
int *\fIwidthPtr\fR,
|
||||
int *\fIheightPtr\fR,
|
||||
Tcl_Interp *\fIinterp\fR);
|
||||
.CE
|
||||
The \fIdata\fR argument points to the object containing the image
|
||||
data. The \fIformat\fR argument contains the value given for
|
||||
the \fB\-format\fR option, or NULL if the option was not specified.
|
||||
If the data in the string appears to be in the format supported by
|
||||
this handler, the \fIformatPtr->stringMatchProc\fR procedure should
|
||||
store the width and height of the image in *\fIwidthPtr\fR and
|
||||
*\fIheightPtr\fR respectively, and return 1. Otherwise it should
|
||||
return 0.
|
||||
.SS FILEREADPROC
|
||||
.PP
|
||||
\fIformatPtr->fileReadProc\fR provides the address of a procedure for
|
||||
Tk to call to read data from an image file into a photo image.
|
||||
\fIformatPtr->fileReadProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef int \fBTk_ImageFileReadProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tcl_Channel \fIchan\fR,
|
||||
const char *\fIfileName\fR,
|
||||
Tcl_Obj *\fIformat\fR,
|
||||
PhotoHandle \fIimageHandle\fR,
|
||||
int \fIdestX\fR, int \fIdestY\fR,
|
||||
int \fIwidth\fR, int \fIheight\fR,
|
||||
int \fIsrcX\fR, int \fIsrcY\fR);
|
||||
.CE
|
||||
The \fIinterp\fR argument is the interpreter in which the command was
|
||||
invoked to read the image; it should be used for reporting errors.
|
||||
The image data is in the file named \fIfileName\fR, which is open for
|
||||
reading as \fIchan\fR. The \fIformat\fR argument contains the
|
||||
value given for the \fB\-format\fR option, or NULL if the option was
|
||||
not specified. The image data in the file, or a subimage of it, is to
|
||||
be read into the photo image identified by the handle
|
||||
\fIimageHandle\fR. The subimage of the data in the file is of
|
||||
dimensions \fIwidth\fR x \fIheight\fR and has its top-left corner at
|
||||
coordinates (\fIsrcX\fR,\fIsrcY\fR). It is to be stored in the photo
|
||||
image with its top-left corner at coordinates
|
||||
(\fIdestX\fR,\fIdestY\fR) using the \fBTk_PhotoPutBlock\fR procedure.
|
||||
The return value is a standard Tcl return value.
|
||||
.SS STRINGREADPROC
|
||||
.PP
|
||||
\fIformatPtr->stringReadProc\fR provides the address of a procedure for
|
||||
Tk to call to read data from a string into a photo image.
|
||||
\fIformatPtr->stringReadProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef int \fBTk_ImageStringReadProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tcl_Obj *\fIdata\fR,
|
||||
Tcl_Obj *\fIformat\fR,
|
||||
PhotoHandle \fIimageHandle\fR,
|
||||
int \fIdestX\fR, int \fIdestY\fR,
|
||||
int \fIwidth\fR, int \fIheight\fR,
|
||||
int \fIsrcX\fR, int \fIsrcY\fR);
|
||||
.CE
|
||||
The \fIinterp\fR argument is the interpreter in which the command was
|
||||
invoked to read the image; it should be used for reporting errors.
|
||||
The \fIdata\fR argument points to the image data in object form.
|
||||
The \fIformat\fR argument contains the
|
||||
value given for the \fB\-format\fR option, or NULL if the option was
|
||||
not specified. The image data in the string, or a subimage of it, is to
|
||||
be read into the photo image identified by the handle
|
||||
\fIimageHandle\fR. The subimage of the data in the string is of
|
||||
dimensions \fIwidth\fR x \fIheight\fR and has its top-left corner at
|
||||
coordinates (\fIsrcX\fR,\fIsrcY\fR). It is to be stored in the photo
|
||||
image with its top-left corner at coordinates
|
||||
(\fIdestX\fR,\fIdestY\fR) using the \fBTk_PhotoPutBlock\fR procedure.
|
||||
The return value is a standard Tcl return value.
|
||||
.SS FILEWRITEPROC
|
||||
.PP
|
||||
\fIformatPtr->fileWriteProc\fR provides the address of a procedure for
|
||||
Tk to call to write data from a photo image to a file.
|
||||
\fIformatPtr->fileWriteProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef int \fBTk_ImageFileWriteProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
const char *\fIfileName\fR,
|
||||
Tcl_Obj *\fIformat\fR,
|
||||
Tk_PhotoImageBlock *\fIblockPtr\fR);
|
||||
.CE
|
||||
The \fIinterp\fR argument is the interpreter in which the command was
|
||||
invoked to write the image; it should be used for reporting errors.
|
||||
The image data to be written are in memory and are described by the
|
||||
Tk_PhotoImageBlock structure pointed to by \fIblockPtr\fR; see the
|
||||
manual page FindPhoto(3) for details. The \fIfileName\fR argument
|
||||
points to the string giving the name of the file in which to write the
|
||||
image data. The \fIformat\fR argument contains the
|
||||
value given for the \fB\-format\fR option, or NULL if the option was
|
||||
not specified. The format string can contain extra characters
|
||||
after the name of the format. If appropriate, the
|
||||
\fIformatPtr->fileWriteProc\fR procedure may interpret these
|
||||
characters to specify further details about the image file.
|
||||
The return value is a standard Tcl return value.
|
||||
.SS STRINGWRITEPROC
|
||||
.PP
|
||||
\fIformatPtr->stringWriteProc\fR provides the address of a procedure for
|
||||
Tk to call to translate image data from a photo image into a string.
|
||||
\fIformatPtr->stringWriteProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef int \fBTk_ImageStringWriteProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tcl_Obj *\fIformat\fR,
|
||||
Tk_PhotoImageBlock *\fIblockPtr\fR);
|
||||
.CE
|
||||
The \fIinterp\fR argument is the interpreter in which the command was
|
||||
invoked to convert the image; it should be used for reporting errors.
|
||||
The image data to be converted are in memory and are described by the
|
||||
Tk_PhotoImageBlock structure pointed to by \fIblockPtr\fR; see the
|
||||
manual page FindPhoto(3) for details. The data for the string
|
||||
should be put in the interpreter \fIinterp\fR result.
|
||||
The \fIformat\fR argument contains the
|
||||
value given for the \fB\-format\fR option, or NULL if the option was
|
||||
not specified. The format string can contain extra characters
|
||||
after the name of the format. If appropriate, the
|
||||
\fIformatPtr->stringWriteProc\fR procedure may interpret these
|
||||
characters to specify further details about the image file.
|
||||
The return value is a standard Tcl return value.
|
||||
.SH "LEGACY INTERFACE SUPPORT"
|
||||
.PP
|
||||
In Tk 8.2 and earlier, the definition of all the function pointer
|
||||
types stored in fields of a \fBTk_PhotoImageFormat\fR struct were
|
||||
incompatibly different. Legacy programs and libraries dating from
|
||||
those days may still contain code that defines extended Tk photo image
|
||||
formats using the old interface. The Tk header file will still support
|
||||
this legacy interface if the code is compiled with the
|
||||
macro \fBUSE_OLD_IMAGE\fR defined. Alternatively, the legacy interfaces
|
||||
are used if the first character of \fIformatPtr->name\fR is an
|
||||
uppercase ASCII character (\fBA\fR-\fBZ\fR), and explicit casts
|
||||
are used to forgive the type mismatch. For example,
|
||||
.CS
|
||||
static Tk_PhotoImageFormat myFormat = {
|
||||
"MyFormat",
|
||||
(Tk_ImageFileMatchProc *) FileMatch,
|
||||
NULL,
|
||||
(Tk_ImageFileReadProc *) FileRead,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
.CE
|
||||
would define a minimal \fBTk_PhotoImageFormat\fR that operates provide
|
||||
only file reading capability, where \fBFileMatch\fR and \fBFileRead\fR
|
||||
are written according to the legacy interfaces of Tk 8.2 or earlier.
|
||||
.PP
|
||||
Any stub-enabled extension providing an extended photo image format
|
||||
via the legacy interface enabled by the \fBUSE_OLD_IMAGE\fR macro
|
||||
that is compiled against Tk 8.5 headers and linked against the
|
||||
Tk 8.5 stub library will produce a file that can be loaded only
|
||||
into interps with Tk 8.5 or later; that is, the normal stub-compatibility
|
||||
rules. If a developer needs to generate from such code a file
|
||||
that is loadable into interps with Tk 8.4 or earlier, they must
|
||||
use Tk 8.4 headers and stub libraries to do so.
|
||||
.PP
|
||||
Any new code written today should not make use of the legacy
|
||||
interfaces. Expect their support to go away in Tk 9.
|
||||
.SH "SEE ALSO"
|
||||
Tk_FindPhoto, Tk_PhotoPutBlock
|
||||
.SH KEYWORDS
|
||||
photo image, image file
|
||||
116
doc/CrtSelHdlr.3
116
doc/CrtSelHdlr.3
@@ -1,116 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1990-1994 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_CreateSelHandler 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_CreateSelHandler, Tk_DeleteSelHandler \- arrange to handle requests for a selection
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
\fBTk_CreateSelHandler\fR(\fItkwin, selection, target, proc, clientData, format\fR)
|
||||
.sp
|
||||
\fBTk_DeleteSelHandler\fR(\fItkwin, selection, target\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_SelectionProc clientData
|
||||
.AP Tk_Window tkwin in
|
||||
Window for which \fIproc\fR will provide selection information.
|
||||
.AP Atom selection in
|
||||
The name of the selection for which \fIproc\fR will provide
|
||||
selection information.
|
||||
.AP Atom target in
|
||||
Form in which \fIproc\fR can provide the selection (e.g. STRING
|
||||
or FILE_NAME). Corresponds to \fItype\fR arguments in \fBselection\fR
|
||||
commands.
|
||||
.AP Tk_SelectionProc *proc in
|
||||
Procedure to invoke whenever the selection is owned by \fItkwin\fR
|
||||
and the selection contents are requested in the format given by
|
||||
\fItarget\fR.
|
||||
.AP ClientData clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.AP Atom format in
|
||||
If the selection requestor is not in this process, \fIformat\fR determines
|
||||
the representation used to transmit the selection to its
|
||||
requestor.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_CreateSelHandler\fR arranges for a particular procedure
|
||||
(\fIproc\fR) to be called whenever \fIselection\fR is owned by
|
||||
\fItkwin\fR and the selection contents are requested in the
|
||||
form given by \fItarget\fR.
|
||||
\fITarget\fR should be one of
|
||||
the entries defined in the left column of Table 2 of the
|
||||
X Inter-Client Communication Conventions Manual (ICCCM) or
|
||||
any other form in which an application is willing to present
|
||||
the selection. The most common form is STRING.
|
||||
.PP
|
||||
\fIProc\fR should have arguments and result that match the
|
||||
type \fBTk_SelectionProc\fR:
|
||||
.CS
|
||||
typedef int \fBTk_SelectionProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
int \fIoffset\fR,
|
||||
char *\fIbuffer\fR,
|
||||
int \fImaxBytes\fR);
|
||||
.CE
|
||||
The \fIclientData\fR parameter to \fIproc\fR is a copy of the
|
||||
\fIclientData\fR argument given to \fBTk_CreateSelHandler\fR.
|
||||
Typically, \fIclientData\fR points to a data
|
||||
structure containing application-specific information that is
|
||||
needed to retrieve the selection. \fIOffset\fR specifies an
|
||||
offset position into the selection, \fIbuffer\fR specifies a
|
||||
location at which to copy information about the selection, and
|
||||
\fImaxBytes\fR specifies the amount of space available at
|
||||
\fIbuffer\fR. \fIProc\fR should place a NULL-terminated string
|
||||
at \fIbuffer\fR containing \fImaxBytes\fR or fewer characters
|
||||
(not including the terminating NULL), and it should return a
|
||||
count of the number of non-NULL characters stored at
|
||||
\fIbuffer\fR. If the selection no longer exists (e.g. it once
|
||||
existed but the user deleted the range of characters containing
|
||||
it), then \fIproc\fR should return \-1.
|
||||
.PP
|
||||
When transferring large selections, Tk will break them up into
|
||||
smaller pieces (typically a few thousand bytes each) for more
|
||||
efficient transmission. It will do this by calling \fIproc\fR
|
||||
one or more times, using successively higher values of \fIoffset\fR
|
||||
to retrieve successive portions of the selection. If \fIproc\fR
|
||||
returns a count less than \fImaxBytes\fR it means that the entire
|
||||
remainder of the selection has been returned. If \fIproc\fR's return
|
||||
value is \fImaxBytes\fR it means there may be additional information
|
||||
in the selection, so Tk must make another call to \fIproc\fR to
|
||||
retrieve the next portion.
|
||||
.PP
|
||||
\fIProc\fR always returns selection information in the form of a
|
||||
character string. However, the ICCCM allows for information to
|
||||
be transmitted from the selection owner to the selection requestor
|
||||
in any of several formats, such as a string, an array of atoms, an
|
||||
array of integers, etc. The \fIformat\fR argument to
|
||||
\fBTk_CreateSelHandler\fR indicates what format should be used to
|
||||
transmit the selection to its requestor (see the middle column of
|
||||
Table 2 of the ICCCM for examples). If \fIformat\fR is not
|
||||
STRING, then Tk will take the value returned by \fIproc\fR and divided
|
||||
it into fields separated by white space. If \fIformat\fR is ATOM,
|
||||
then Tk will return the selection as an array of atoms, with each
|
||||
field in \fIproc\fR's result treated as the name of one atom. For
|
||||
any other value of \fIformat\fR, Tk will return the selection as an
|
||||
array of 32-bit values where each field of \fIproc\fR's result is
|
||||
treated as a number and translated to a 32-bit value. In any event,
|
||||
the \fIformat\fR atom is returned to the selection requestor along
|
||||
with the contents of the selection.
|
||||
.PP
|
||||
If \fBTk_CreateSelHandler\fR is called when there already exists a
|
||||
handler for \fIselection\fR and \fItarget\fR on \fItkwin\fR, then the
|
||||
existing handler is replaced with a new one.
|
||||
.PP
|
||||
\fBTk_DeleteSelHandler\fR removes the handler given by \fItkwin\fR,
|
||||
\fIselection\fR, and \fItarget\fR, if such a handler exists.
|
||||
If there is no such handler then it has no effect.
|
||||
.SH KEYWORDS
|
||||
format, handler, selection, target
|
||||
146
doc/CrtWindow.3
146
doc/CrtWindow.3
@@ -1,146 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1990 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_CreateWindow 3 4.2 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_CreateWindow, Tk_CreateWindowFromPath, Tk_DestroyWindow, Tk_MakeWindowExist \- create or delete window
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
Tk_Window
|
||||
\fBTk_CreateWindow\fR(\fIinterp, parent, name, topLevScreen\fR)
|
||||
.sp
|
||||
Tk_Window
|
||||
\fBTk_CreateAnonymousWindow\fR(\fIinterp, parent, topLevScreen\fR)
|
||||
.sp
|
||||
Tk_Window
|
||||
\fBTk_CreateWindowFromPath\fR(\fIinterp, tkwin, pathName, topLevScreen\fR)
|
||||
.sp
|
||||
\fBTk_DestroyWindow\fR(\fItkwin\fR)
|
||||
.sp
|
||||
\fBTk_MakeWindowExist\fR(\fItkwin\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *topLevScreen
|
||||
.AP Tcl_Interp *interp out
|
||||
Tcl interpreter to use for error reporting. If no error occurs,
|
||||
then \fI*interp\fR is not modified.
|
||||
.AP Tk_Window parent in
|
||||
Token for the window that is to serve as the logical parent of
|
||||
the new window.
|
||||
.AP "const char" *name in
|
||||
Name to use for this window. Must be unique among all children of
|
||||
the same \fIparent\fR.
|
||||
.AP "const char" *topLevScreen in
|
||||
Has same format as \fIscreenName\fR. If NULL, then new window is
|
||||
created as an internal window. If non-NULL, new window is created as
|
||||
a top-level window on screen \fItopLevScreen\fR. If \fItopLevScreen\fR
|
||||
is an empty string
|
||||
.PQ ""
|
||||
then new window is created as top-level window of \fIparent\fR's screen.
|
||||
.AP Tk_Window tkwin in
|
||||
Token for window.
|
||||
.AP "const char" *pathName in
|
||||
Name of new window, specified as path name within application
|
||||
(e.g. \fB.a.b.c\fR).
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The procedures \fBTk_CreateWindow\fR,
|
||||
\fBTk_CreateAnonymousWindow\fR, and \fBTk_CreateWindowFromPath\fR
|
||||
are used to create new windows for
|
||||
use in Tk-based applications. Each of the procedures returns a token
|
||||
that can be used to manipulate the window in other calls to the Tk
|
||||
library. If the window could not be created successfully, then NULL
|
||||
is returned and the result of interpreter \fIinterp\fR is modified to
|
||||
hold an error message.
|
||||
.PP
|
||||
Tk supports two different kinds of windows: internal
|
||||
windows and top-level windows.
|
||||
An internal window is an interior window of a Tk application, such as a
|
||||
scrollbar or menu bar or button. A top-level window is one that is
|
||||
created as a child of a screen's root window, rather than as an
|
||||
interior window, but which is logically part of some existing main
|
||||
window. Examples of top-level windows are pop-up menus and dialog boxes.
|
||||
.PP
|
||||
New windows may be created by calling
|
||||
\fBTk_CreateWindow\fR. If the \fItopLevScreen\fR argument is
|
||||
NULL, then the new window will be an internal window. If
|
||||
\fItopLevScreen\fR is non-NULL, then the new window will be a
|
||||
top-level window: \fItopLevScreen\fR indicates the name of
|
||||
a screen and the new window will be created as a child of the
|
||||
root window of \fItopLevScreen\fR. In either case Tk will
|
||||
consider the new window to be the logical child of \fIparent\fR:
|
||||
the new window's path name will reflect this fact, options may
|
||||
be specified for the new window under this assumption, and so on.
|
||||
The only difference is that new X window for a top-level window
|
||||
will not be a child of \fIparent\fR's X window. For example, a pull-down
|
||||
menu's \fIparent\fR would be the button-like window used to invoke it,
|
||||
which would in turn be a child of the menu bar window. A dialog box might
|
||||
have the application's main window as its parent.
|
||||
.PP
|
||||
\fBTk_CreateAnonymousWindow\fR differs from \fBTk_CreateWindow\fR in
|
||||
that it creates an unnamed window. This window will be manipulatable
|
||||
only using C interfaces, and will not be visible to Tcl scripts. Both
|
||||
interior windows and top-level windows may be created with
|
||||
\fBTk_CreateAnonymousWindow\fR.
|
||||
.PP
|
||||
\fBTk_CreateWindowFromPath\fR offers an alternate way of specifying
|
||||
new windows. In \fBTk_CreateWindowFromPath\fR the new
|
||||
window is specified with a token for any window in the target
|
||||
application (\fItkwin\fR), plus a path name for the new window.
|
||||
It produces the same effect as \fBTk_CreateWindow\fR and allows
|
||||
both top-level and internal windows to be created, depending on
|
||||
the value of \fItopLevScreen\fR. In calls to \fBTk_CreateWindowFromPath\fR,
|
||||
as in calls to \fBTk_CreateWindow\fR, the parent of the new window
|
||||
must exist at the time of the call, but the new window must not
|
||||
already exist.
|
||||
.PP
|
||||
The window creation procedures do not
|
||||
actually issue the command to X to create a window.
|
||||
Instead, they create a local data structure associated with
|
||||
the window and defer the creation of the X window.
|
||||
The window will actually be created by the first call to
|
||||
\fBTk_MapWindow\fR. Deferred window creation allows various
|
||||
aspects of the window (such as its size, background color,
|
||||
etc.) to be modified after its creation without incurring
|
||||
any overhead in the X server. When the window is finally
|
||||
mapped all of the window attributes can be set while creating
|
||||
the window.
|
||||
.PP
|
||||
The value returned by a window-creation procedure is not the
|
||||
X token for the window (it cannot be, since X has not been
|
||||
asked to create the window yet). Instead, it is a token
|
||||
for Tk's local data structure for the window. Most
|
||||
of the Tk library procedures take Tk_Window tokens, rather
|
||||
than X identifiers. The actual
|
||||
X window identifier can be retrieved from the local
|
||||
data structure using the \fBTk_WindowId\fR macro; see
|
||||
the manual entry for \fBTk_WindowId\fR for details.
|
||||
.PP
|
||||
\fBTk_DestroyWindow\fR deletes a window and all the data
|
||||
structures associated with it, including any event handlers
|
||||
created with \fBTk_CreateEventHandler\fR. In addition,
|
||||
\fBTk_DestroyWindow\fR will delete any children of \fItkwin\fR
|
||||
recursively (where children are defined in the Tk sense, consisting
|
||||
of all windows that were created with the given window as \fIparent\fR).
|
||||
If \fItkwin\fR is an internal window, then event
|
||||
handlers interested in destroy events
|
||||
are invoked immediately. If \fItkwin\fR is a top-level or main window,
|
||||
then the event handlers will be invoked later, after X has seen
|
||||
the request and returned an event for it.
|
||||
.PP
|
||||
If a window has been created
|
||||
but has not been mapped, so no X window exists, it is
|
||||
possible to force the creation of the X window by
|
||||
calling \fBTk_MakeWindowExist\fR. This procedure issues
|
||||
the X commands to instantiate the window given by \fItkwin\fR.
|
||||
.SH KEYWORDS
|
||||
create, deferred creation, destroy, display, internal window,
|
||||
screen, top-level window, window
|
||||
@@ -1,31 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1995-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_DeleteImage 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_DeleteImage \- Destroy an image.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
\fBTk_DeleteImage\fR(\fIinterp, name\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *interp
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter for which the image was created.
|
||||
.AP "const char" *name in
|
||||
Name of the image.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_DeleteImage\fR deletes the image given by \fIinterp\fR
|
||||
and \fIname\fR, if there is one. All instances of that image
|
||||
will redisplay as empty regions. If the given image does not
|
||||
exist then the procedure has no effect.
|
||||
.SH KEYWORDS
|
||||
delete image, image manager
|
||||
@@ -1,36 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1995-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_DrawFocusHighlight 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_DrawFocusHighlight \- draw the traversal highlight ring for a widget
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
\fBTk_DrawFocusHighlight(\fItkwin, gc, width, drawable\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS "Tcl_Interp" *joinPtr
|
||||
.AP Tk_Window tkwin in
|
||||
Window for which the highlight is being drawn. Used to retrieve
|
||||
the window's dimensions, among other things.
|
||||
.AP GC gc in
|
||||
Graphics context to use for drawing the highlight.
|
||||
.AP int width in
|
||||
Width of the highlight ring, in pixels.
|
||||
.AP Drawable drawable in
|
||||
Drawable in which to draw the highlight; usually an offscreen
|
||||
pixmap for double buffering.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_DrawFocusHighlight\fR is a utility procedure that draws the
|
||||
traversal highlight ring for a widget.
|
||||
It is typically invoked by widgets during redisplay.
|
||||
.SH KEYWORDS
|
||||
focus, traversal highlight
|
||||
@@ -1,75 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1990 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_CreateEventHandler 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_CreateEventHandler, Tk_DeleteEventHandler \- associate procedure callback with an X event
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
\fBTk_CreateEventHandler\fR(\fItkwin, mask, proc, clientData\fR)
|
||||
.sp
|
||||
\fBTk_DeleteEventHandler\fR(\fItkwin, mask, proc, clientData\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS "unsigned long" clientData
|
||||
.AP Tk_Window tkwin in
|
||||
Token for window in which events may occur.
|
||||
.AP "unsigned long" mask in
|
||||
Bit-mask of events (such as \fBButtonPressMask\fR)
|
||||
for which \fIproc\fR should be called.
|
||||
.AP Tk_EventProc *proc in
|
||||
Procedure to invoke whenever an event in \fImask\fR occurs
|
||||
in the window given by \fItkwin\fR.
|
||||
.AP ClientData clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_CreateEventHandler\fR arranges for \fIproc\fR to be
|
||||
invoked in the future whenever one of the event types specified
|
||||
by \fImask\fR occurs in the window specified by \fItkwin\fR.
|
||||
The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR;
|
||||
this mechanism only works in programs that dispatch events
|
||||
through \fBTk_HandleEvent\fR (or through other Tk procedures that
|
||||
call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or
|
||||
\fBTk_MainLoop\fR).
|
||||
.PP
|
||||
\fIProc\fR should have arguments and result that match the
|
||||
type \fBTk_EventProc\fR:
|
||||
.CS
|
||||
typedef void \fBTk_EventProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
XEvent *\fIeventPtr\fR);
|
||||
.CE
|
||||
The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR
|
||||
argument given to \fBTk_CreateEventHandler\fR when the callback
|
||||
was created. Typically, \fIclientData\fR points to a data
|
||||
structure containing application-specific information about
|
||||
the window in which the event occurred. \fIEventPtr\fR is
|
||||
a pointer to the X event, which will be one of the ones
|
||||
specified in the \fImask\fR argument to \fBTk_CreateEventHandler\fR.
|
||||
.PP
|
||||
\fBTk_DeleteEventHandler\fR may be called to delete a
|
||||
previously-created event handler: it deletes the first handler
|
||||
it finds that is associated with \fItkwin\fR and matches the
|
||||
\fImask\fR, \fIproc\fR, and \fIclientData\fR arguments. If
|
||||
no such handler exists, then \fBTk_HandleEvent\fR returns
|
||||
without doing anything. Although Tk supports it, it's probably
|
||||
a bad idea to have more than one callback with the same \fImask\fR,
|
||||
\fIproc\fR, and \fIclientData\fR arguments.
|
||||
When a window is deleted all of its handlers will be deleted
|
||||
automatically; in this case there is no need to call
|
||||
\fBTk_DeleteEventHandler\fR.
|
||||
.PP
|
||||
If multiple handlers are declared for the same type of X event
|
||||
on the same window, then the handlers will be invoked in the
|
||||
order they were created.
|
||||
.SH KEYWORDS
|
||||
bind, callback, event, handler
|
||||
256
doc/FindPhoto.3
256
doc/FindPhoto.3
@@ -1,256 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1994 The Australian National University
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" Author: Paul Mackerras (paulus@cs.anu.edu.au),
|
||||
'\" Department of Computer Science,
|
||||
'\" Australian National University.
|
||||
'\"
|
||||
.TH Tk_FindPhoto 3 8.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_FindPhoto, Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock, Tk_PhotoGetImage, Tk_PhotoBlank, Tk_PhotoExpand, Tk_PhotoGetSize, Tk_PhotoSetSize \- manipulate the image data stored in a photo image.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
Tk_PhotoHandle
|
||||
\fBTk_FindPhoto\fR(\fIinterp, imageName\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTk_PhotoPutBlock\fR(\fIinterp, handle, blockPtr, x, y, width, height,\
|
||||
compRule\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTk_PhotoPutZoomedBlock\fR(\fIinterp, handle, blockPtr, x, y, width, height,\
|
||||
zoomX, zoomY, subsampleX, subsampleY, compRule\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTk_PhotoGetImage\fR(\fIhandle, blockPtr\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTk_PhotoBlank\fR(\fIhandle\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTk_PhotoExpand\fR(\fIinterp, handle, width, height\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTk_PhotoGetSize\fR(\fIhandle, widthPtr, heightPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTk_PhotoSetSize\fR(\fIinterp. handle, width, height\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_PhotoImageBlock window_path
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter in which image was created and in which error reporting is
|
||||
to be done.
|
||||
.AP "const char" *imageName in
|
||||
Name of the photo image.
|
||||
.AP Tk_PhotoHandle handle in
|
||||
Opaque handle identifying the photo image to be affected.
|
||||
.AP Tk_PhotoImageBlock *blockPtr in
|
||||
Specifies the address and storage layout of image data.
|
||||
.AP int x in
|
||||
Specifies the X coordinate where the top-left corner of the block is
|
||||
to be placed within the image.
|
||||
.AP int y in
|
||||
Specifies the Y coordinate where the top-left corner of the block is
|
||||
to be placed within the image.
|
||||
.AP int width in
|
||||
Specifies the width of the image area to be affected (for
|
||||
\fBTk_PhotoPutBlock\fR) or the desired image width (for
|
||||
\fBTk_PhotoExpand\fR and \fBTk_PhotoSetSize\fR).
|
||||
.AP int compRule in
|
||||
Specifies the compositing rule used when combining transparent pixels
|
||||
in a block of data with a photo image. Must be one of
|
||||
\fBTK_PHOTO_COMPOSITE_OVERLAY\fR (which puts the block of data over the top
|
||||
of the existing photo image, with the previous contents showing
|
||||
through in the transparent bits) or \fBTK_PHOTO_COMPOSITE_SET\fR (which
|
||||
discards the existing photo image contents in the rectangle covered by
|
||||
the data block.)
|
||||
.AP int height in
|
||||
Specifies the height of the image area to be affected (for
|
||||
\fBTk_PhotoPutBlock\fR) or the desired image height (for
|
||||
\fBTk_PhotoExpand\fR and \fBTk_PhotoSetSize\fR).
|
||||
.AP int *widthPtr out
|
||||
Pointer to location in which to store the image width.
|
||||
.AP int *heightPtr out
|
||||
Pointer to location in which to store the image height.
|
||||
.AP int subsampleX in
|
||||
Specifies the subsampling factor in the X direction for input
|
||||
image data.
|
||||
.AP int subsampleY in
|
||||
Specifies the subsampling factor in the Y direction for input
|
||||
image data.
|
||||
.AP int zoomX in
|
||||
Specifies the zoom factor to be applied in the X direction to pixels
|
||||
being written to the photo image.
|
||||
.AP int zoomY in
|
||||
Specifies the zoom factor to be applied in the Y direction to pixels
|
||||
being written to the photo image.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_FindPhoto\fR returns an opaque handle that is used to identify a
|
||||
particular photo image to the other procedures. The parameter is the
|
||||
name of the image, that is, the name specified to the \fBimage create
|
||||
photo\fR command, or assigned by that command if no name was specified.
|
||||
If \fIimageName\fR does not exist or is not a photo image,
|
||||
\fBTk_FindPhoto\fR returns NULL.
|
||||
.PP
|
||||
\fBTk_PhotoPutBlock\fR is used to supply blocks of image data to be
|
||||
displayed. The call affects an area of the image of size
|
||||
\fIwidth\fR x \fIheight\fR pixels, with its top-left corner at
|
||||
coordinates (\fIx\fR,\fIy\fR). All of \fIwidth\fR, \fIheight\fR,
|
||||
\fIx\fR, and \fIy\fR must be non-negative.
|
||||
If part of this area lies outside the
|
||||
current bounds of the image, the image will be expanded to include the
|
||||
area, unless the user has specified an explicit image size with the
|
||||
\fB\-width\fR and/or \fB\-height\fR widget configuration options
|
||||
(see photo(n)); in that
|
||||
case the area is silently clipped to the image boundaries.
|
||||
.PP
|
||||
The \fIblock\fR parameter is a pointer to a
|
||||
\fBTk_PhotoImageBlock\fR structure, defined as follows:
|
||||
.CS
|
||||
typedef struct {
|
||||
unsigned char *\fIpixelPtr\fR;
|
||||
int \fIwidth\fR;
|
||||
int \fIheight\fR;
|
||||
int \fIpitch\fR;
|
||||
int \fIpixelSize\fR;
|
||||
int \fIoffset\fR[4];
|
||||
} \fBTk_PhotoImageBlock\fR;
|
||||
.CE
|
||||
The \fIpixelPtr\fR field points to the first pixel, that is, the
|
||||
top-left pixel in the block.
|
||||
The \fIwidth\fR and \fIheight\fR fields specify the dimensions of the
|
||||
block of pixels. The \fIpixelSize\fR field specifies the address
|
||||
difference between two horizontally adjacent pixels. Often it is 3
|
||||
or 4, but it can have any value. The \fIpitch\fR field specifies the
|
||||
address difference between two vertically adjacent pixels. The
|
||||
\fIoffset\fR array contains the offsets from the address of a pixel
|
||||
to the addresses of the bytes containing the red, green, blue and alpha
|
||||
(transparency) components. These are normally 0, 1, 2 and 3, but can
|
||||
have other values, e.g., for images that are stored as separate red,
|
||||
green and blue planes.
|
||||
.PP
|
||||
The \fIcompRule\fR parameter to \fBTk_PhotoPutBlock\fR specifies a
|
||||
compositing rule that says what to do with transparent pixels. The
|
||||
value \fBTK_PHOTO_COMPOSITE_OVERLAY\fR says that the previous contents of
|
||||
the photo image should show through, and the value
|
||||
\fBTK_PHOTO_COMPOSITE_SET\fR says that the previous contents of the photo
|
||||
image should be completely ignored, and the values from the block be
|
||||
copied directly across. The behavior in Tk8.3 and earlier was
|
||||
equivalent to having \fBTK_PHOTO_COMPOSITE_OVERLAY\fR as a compositing rule.
|
||||
.PP
|
||||
The value given for the \fIwidth\fR and \fIheight\fR parameters to
|
||||
\fBTk_PhotoPutBlock\fR do not have to correspond to the values specified
|
||||
in \fIblock\fR. If they are smaller, \fBTk_PhotoPutBlock\fR extracts a
|
||||
sub-block from the image data supplied. If they are larger, the data
|
||||
given are replicated (in a tiled fashion) to fill the specified area.
|
||||
These rules operate independently in the horizontal and vertical
|
||||
directions.
|
||||
.PP
|
||||
\fBTk_PhotoPutBlock\fR normally returns \fBTCL_OK\fR, though if it cannot
|
||||
allocate sufficient memory to hold the resulting image, \fBTCL_ERROR\fR is
|
||||
returned instead and, if the \fIinterp\fR argument is non-NULL, an
|
||||
error message is placed in the interpreter's result.
|
||||
.PP
|
||||
\fBTk_PhotoPutZoomedBlock\fR works like \fBTk_PhotoPutBlock\fR except that
|
||||
the image can be reduced or enlarged for display. The
|
||||
\fIsubsampleX\fR and \fIsubsampleY\fR parameters allow the size of the
|
||||
image to be reduced by subsampling.
|
||||
\fBTk_PhotoPutZoomedBlock\fR will use only pixels from the input image
|
||||
whose X coordinates are multiples of \fIsubsampleX\fR, and whose Y
|
||||
coordinates are multiples of \fIsubsampleY\fR. For example, an image
|
||||
of 512x512 pixels can be reduced to 256x256 by setting
|
||||
\fIsubsampleX\fR and \fIsubsampleY\fR to 2.
|
||||
.PP
|
||||
The \fIzoomX\fR and \fIzoomY\fR parameters allow the image to be
|
||||
enlarged by pixel replication. Each pixel of the (possibly subsampled)
|
||||
input image will be written to a block \fIzoomX\fR pixels wide and
|
||||
\fIzoomY\fR pixels high of the displayed image. Subsampling and
|
||||
zooming can be used together for special effects.
|
||||
.PP
|
||||
\fBTk_PhotoGetImage\fR can be used to retrieve image data from a photo
|
||||
image. \fBTk_PhotoGetImage\fR fills
|
||||
in the structure pointed to by the \fIblockPtr\fR parameter with values
|
||||
that describe the address and layout of the image data that the
|
||||
photo image has stored internally. The values are valid
|
||||
until the image is destroyed or its size is changed.
|
||||
.PP
|
||||
It is possible to modify an image by writing directly to the data
|
||||
the \fIpixelPtr\fR field points to. The size of the image cannot be
|
||||
changed this way, though.
|
||||
Also, changes made by writing directly to \fIpixelPtr\fR will not be
|
||||
immediately visible, but only after a call to
|
||||
\fBTk_ImageChanged\fR or after an event that causes the interested
|
||||
widgets to redraw themselves.
|
||||
For these reasons usually it is preferable to make changes to
|
||||
a copy of the image data and write it back with
|
||||
\fBTk_PhotoPutBlock\fR or \fBTk_PhotoPutZoomedBlock\fR.
|
||||
.PP
|
||||
\fBTk_PhotoGetImage\fR returns 1 for compatibility with the
|
||||
corresponding procedure in the old photo widget.
|
||||
.PP
|
||||
\fBTk_PhotoBlank\fR blanks the entire area of the
|
||||
photo image. Blank areas of a photo image are transparent.
|
||||
.PP
|
||||
\fBTk_PhotoExpand\fR requests that the widget's image be expanded to be
|
||||
at least \fIwidth\fR x \fIheight\fR pixels in size. The width and/or
|
||||
height are unchanged if the user has specified an explicit image width
|
||||
or height with the \fB\-width\fR and/or \fB\-height\fR configuration
|
||||
options, respectively.
|
||||
If the image data
|
||||
are being supplied in many small blocks, it is more efficient to use
|
||||
\fBTk_PhotoExpand\fR or \fBTk_PhotoSetSize\fR at the beginning rather than
|
||||
allowing the image to expand in many small increments as image blocks
|
||||
are supplied.
|
||||
.PP
|
||||
\fBTk_PhotoExpand\fR normally returns \fBTCL_OK\fR, though if it cannot
|
||||
allocate sufficient memory to hold the resulting image, \fBTCL_ERROR\fR is
|
||||
returned instead and, if the \fIinterp\fR argument is non-NULL, an
|
||||
error message is placed in the interpreter's result.
|
||||
.PP
|
||||
\fBTk_PhotoSetSize\fR specifies the size of the image, as if the user
|
||||
had specified the given \fIwidth\fR and \fIheight\fR values to the
|
||||
\fB\-width\fR and \fB\-height\fR configuration options. A value of
|
||||
zero for \fIwidth\fR or \fIheight\fR does not change the image's width
|
||||
or height, but allows the width or height to be changed by subsequent
|
||||
calls to \fBTk_PhotoPutBlock\fR, \fBTk_PhotoPutZoomedBlock\fR or
|
||||
\fBTk_PhotoExpand\fR.
|
||||
.PP
|
||||
\fBTk_PhotoSetSize\fR normally returns \fBTCL_OK\fR, though if it cannot
|
||||
allocate sufficient memory to hold the resulting image, \fBTCL_ERROR\fR is
|
||||
returned instead and, if the \fIinterp\fR argument is non-NULL, an
|
||||
error message is placed in the interpreter's result.
|
||||
.PP
|
||||
\fBTk_PhotoGetSize\fR returns the dimensions of the image in
|
||||
*\fIwidthPtr\fR and *\fIheightPtr\fR.
|
||||
.SH PORTABILITY
|
||||
.PP
|
||||
In Tk 8.3 and earlier, \fBTk_PhotoPutBlock\fR and
|
||||
\fBTk_PhotoPutZoomedBlock\fR had different signatures. If you want to
|
||||
compile code that uses the old interface against 8.4 without updating
|
||||
your code, compile it with the flag
|
||||
-DUSE_COMPOSITELESS_PHOTO_PUT_BLOCK. Code linked using Stubs against
|
||||
older versions of Tk will continue to work.
|
||||
.PP
|
||||
In Tk 8.4, \fBTk_PhotoPutBlock\fR, \fBTk_PhotoPutZoomedBlock\fR,
|
||||
\fBTk_PhotoExpand\fR and \fBTk_PhotoSetSize\fR did not take an
|
||||
\fIinterp\fR argument or return any result code. If insufficient
|
||||
memory was available for an image, Tk would panic. This behaviour is
|
||||
still supported if you compile your extension with the additional flag
|
||||
-DUSE_PANIC_ON_PHOTO_ALLOC_FAILURE. Code linked using Stubs against
|
||||
older versions of Tk will continue to work.
|
||||
.SH CREDITS
|
||||
.PP
|
||||
The code for the photo image type was developed by Paul Mackerras,
|
||||
based on his earlier photo widget code.
|
||||
.SH KEYWORDS
|
||||
photo, image
|
||||
94
doc/FontId.3
94
doc/FontId.3
@@ -1,94 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_FontId 3 8.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_FontId, Tk_GetFontMetrics, Tk_PostscriptFontName \- accessor functions for
|
||||
fonts
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
Font
|
||||
\fBTk_FontId(\fItkfont\fB)\fR
|
||||
.sp
|
||||
\fBTk_GetFontMetrics(\fItkfont, fmPtr\fB)\fR
|
||||
.sp
|
||||
int
|
||||
\fBTk_PostscriptFontName(\fItkfont, dsPtr\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_FontMetrics *dsPtr
|
||||
.AP Tk_Font tkfont in
|
||||
Opaque font token being queried. Must have been returned by a previous
|
||||
call to \fBTk_GetFont\fR.
|
||||
.AP Tk_FontMetrics *fmPtr out
|
||||
Pointer to structure in which the font metrics for \fItkfont\fR will
|
||||
be stored. See \fBDATA STRUCTURES\fR below for details.
|
||||
.AP Tcl_DString *dsPtr out
|
||||
Pointer to an initialized \fBTcl_DString\fR to which the name of the
|
||||
Postscript font that corresponds to \fItkfont\fR will be appended.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Given a \fItkfont\fR, \fBTk_FontId\fR returns the token that should be
|
||||
selected into an XGCValues structure in order to construct a graphics
|
||||
context that can be used to draw text in the specified font.
|
||||
.PP
|
||||
\fBTk_GetFontMetrics\fR computes the ascent, descent, and linespace of the
|
||||
\fItkfont\fR in pixels and stores those values in the structure pointer to by
|
||||
\fIfmPtr\fR. These values can be used in computations such as to space
|
||||
multiple lines of text, to align the baselines of text in different
|
||||
fonts, and to vertically align text in a given region. See the
|
||||
documentation for the \fBfont\fR command for definitions of the terms
|
||||
ascent, descent, and linespace, used in font metrics.
|
||||
.PP
|
||||
\fBTk_PostscriptFontName\fR maps a \fItkfont\fR to the corresponding
|
||||
Postscript font name that should be used when printing. The return value
|
||||
is the size in points of the \fItkfont\fR and the Postscript font name is
|
||||
appended to \fIdsPtr\fR. \fIDsPtr\fR must refer to an initialized
|
||||
\fBTcl_DString\fR. Given a
|
||||
.QW reasonable
|
||||
Postscript printer, the
|
||||
following screen font families should print correctly:
|
||||
.IP
|
||||
\fBAvant Garde\fR, \fBArial\fR, \fBBookman\fR, \fBCourier\fR,
|
||||
\fBCourier New\fR, \fBGeneva\fR, \fBHelvetica\fR, \fBMonaco\fR,
|
||||
\fBNew Century Schoolbook\fR, \fBNew York\fR, \fBPalatino\fR, \fBSymbol\fR,
|
||||
\fBTimes\fR, \fBTimes New Roman\fR, \fBZapf Chancery\fR, and
|
||||
\fBZapf Dingbats\fR.
|
||||
.PP
|
||||
Any other font families may not print correctly because the computed
|
||||
Postscript font name may be incorrect or not exist on the printer.
|
||||
.SH "DATA STRUCTURES"
|
||||
.PP
|
||||
The \fBTk_FontMetrics\fR data structure is used by \fBTk_GetFontMetrics\fR to
|
||||
return information about a font and is defined as follows:
|
||||
.CS
|
||||
typedef struct Tk_FontMetrics {
|
||||
int \fIascent\fR;
|
||||
int \fIdescent\fR;
|
||||
int \fIlinespace\fR;
|
||||
} \fBTk_FontMetrics\fR;
|
||||
.CE
|
||||
.PP
|
||||
The \fIascent\fR field is the amount in pixels that the tallest
|
||||
letter sticks up above the baseline, plus any extra blank space added
|
||||
by the designer of the font.
|
||||
.PP
|
||||
The \fIdescent\fR is the largest amount in pixels that any letter
|
||||
sticks below the baseline, plus any extra blank space added by the
|
||||
designer of the font.
|
||||
.PP
|
||||
The \fIlinespace\fR is the sum of the ascent and descent. How far
|
||||
apart two lines of text in the same font should be placed so that none
|
||||
of the characters in one line overlap any of the characters in the
|
||||
other line.
|
||||
.SH "SEE ALSO"
|
||||
font(n), MeasureChar(3)
|
||||
.SH KEYWORDS
|
||||
font, measurement, Postscript
|
||||
@@ -1,48 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1990 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_FreeXId 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_FreeXId \- make X resource identifier available for reuse
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
\fBTk_FreeXId(\fIdisplay, id\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS Display *display out
|
||||
.AP Display *display in
|
||||
Display for which \fIid\fR was allocated.
|
||||
.AP XID id in
|
||||
Identifier of X resource (window, font, pixmap, cursor, graphics
|
||||
context, or colormap) that is no longer in use.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The default allocator for resource identifiers provided by Xlib is very
|
||||
simple-minded and does not allow resource identifiers to be re-used.
|
||||
If a long-running application reaches the end of the resource id
|
||||
space, it will generate an X protocol error and crash.
|
||||
Tk replaces the default id allocator with its own allocator, which
|
||||
allows identifiers to be reused.
|
||||
In order for this to work, \fBTk_FreeXId\fR must be called to
|
||||
tell the allocator about resources that have been freed.
|
||||
Tk automatically calls \fBTk_FreeXId\fR whenever it frees a
|
||||
resource, so if you use procedures like \fBTk_GetFont\fR,
|
||||
\fBTk_GetGC\fR, and \fBTk_GetPixmap\fR then you need not call
|
||||
\fBTk_FreeXId\fR.
|
||||
However, if you allocate resources directly from Xlib, for example
|
||||
by calling \fBXCreatePixmap\fR, then you should call \fBTk_FreeXId\fR
|
||||
when you call the corresponding Xlib free procedure, such as
|
||||
\fBXFreePixmap\fR.
|
||||
If you do not call \fBTk_FreeXId\fR then the resource identifier will
|
||||
be lost, which could cause problems if the application runs long enough
|
||||
to lose all of the available identifiers.
|
||||
.SH KEYWORDS
|
||||
resource identifier
|
||||
@@ -1,92 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1990-1994 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_GeometryRequest 3 "8.4" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_GeometryRequest, Tk_SetMinimumRequestSize, Tk_SetInternalBorder, Tk_SetInternalBorderEx \- specify desired geometry or internal border for a window
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
\fBTk_GeometryRequest\fR(\fItkwin, reqWidth, reqHeight\fR)
|
||||
.sp
|
||||
\fBTk_SetMinimumRequestSize\fR(\fItkwin, minWidth, minHeight\fR)
|
||||
.sp
|
||||
\fBTk_SetInternalBorder\fR(\fItkwin, width\fR)
|
||||
.sp
|
||||
\fBTk_SetInternalBorderEx\fR(\fItkwin, left, right, top, bottom\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS baseHeight clientData
|
||||
.AP Tk_Window tkwin in
|
||||
Window for which geometry is being requested.
|
||||
.AP int reqWidth in
|
||||
Desired width for \fItkwin\fR, in pixel units.
|
||||
.AP int reqHeight in
|
||||
Desired height for \fItkwin\fR, in pixel units.
|
||||
.AP int minWidth in
|
||||
Desired minimum requested width for \fItkwin\fR, in pixel units.
|
||||
.AP int minHeight in
|
||||
Desired minimum requested height for \fItkwin\fR, in pixel units.
|
||||
.AP int width in
|
||||
Space to leave for internal border for \fItkwin\fR, in pixel units.
|
||||
.AP int left in
|
||||
Space to leave for left side of internal border for \fItkwin\fR, in pixel units.
|
||||
.AP int right in
|
||||
Space to leave for right side of internal border for \fItkwin\fR, in pixel units.
|
||||
.AP int top in
|
||||
Space to leave for top side of internal border for \fItkwin\fR, in pixel units.
|
||||
.AP int bottom in
|
||||
Space to leave for bottom side of internal border for \fItkwin\fR, in pixel units.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_GeometryRequest\fR is called by widget code to indicate its
|
||||
preference for the dimensions of a particular window. The arguments
|
||||
to \fBTk_GeometryRequest\fR are made available to the geometry
|
||||
manager for the window, which then decides on the actual geometry
|
||||
for the window. Although geometry managers generally try to satisfy
|
||||
requests made to \fBTk_GeometryRequest\fR, there is no guarantee that
|
||||
this will always be possible. Widget code should not assume that
|
||||
a geometry request will be satisfied until it receives a
|
||||
\fBConfigureNotify\fR event indicating that the geometry change has
|
||||
occurred. Widget code should never call procedures like
|
||||
\fBTk_ResizeWindow\fR directly. Instead, it should invoke
|
||||
\fBTk_GeometryRequest\fR and leave the final geometry decisions to
|
||||
the geometry manager.
|
||||
.PP
|
||||
If \fItkwin\fR is a top-level window, then the geometry information
|
||||
will be passed to the window manager using the standard ICCCM protocol.
|
||||
.PP
|
||||
\fBTk_SetInternalBorder\fR is called by widget code to indicate that
|
||||
the widget has an internal border. This means that the widget draws
|
||||
a decorative border inside the window instead of using the standard
|
||||
X borders, which are external to the window's area. For example,
|
||||
internal borders are used to draw 3-D effects. \fIWidth\fR
|
||||
specifies the width of the border in pixels. Geometry managers will
|
||||
use this information to avoid placing any children of \fItkwin\fR
|
||||
overlapping the outermost \fIwidth\fR pixels of \fItkwin\fR's area.
|
||||
.PP
|
||||
\fBTk_SetInternalBorderEx\fR works like \fBTk_SetInternalBorder\fR
|
||||
but lets you specify different widths for different sides of the window.
|
||||
.PP
|
||||
\fBTk_SetMinimumRequestSize\fR is called by widget code to indicate
|
||||
that a geometry manager should request at least this size for the
|
||||
widget. This allows a widget to have some control over its size when
|
||||
a propagating geometry manager is used inside it.
|
||||
.PP
|
||||
The information specified in calls to \fBTk_GeometryRequest\fR,
|
||||
\fBTk_SetMinimumRequestSize\fR, \fBTk_SetInternalBorder\fR and
|
||||
\fBTk_SetInternalBorderEx\fR can be retrieved using the macros
|
||||
\fBTk_ReqWidth\fR, \fBTk_ReqHeight\fR, \fBTk_MinReqWidth\fR,
|
||||
\fBTk_MinReqHeight\fR, \fBTk_MinReqWidth\fR, \fBTk_InternalBorderLeft\fR,
|
||||
\fBTk_InternalBorderRight\fR, \fBTk_InternalBorderTop\fR and
|
||||
\fBTk_InternalBorderBottom\fR.
|
||||
See the \fBTk_WindowId\fR manual entry for details.
|
||||
.SH KEYWORDS
|
||||
geometry, request
|
||||
@@ -1,89 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1990 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1998 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_GetAnchorFromObj 3 8.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_GetAnchorFromObj, Tk_GetAnchor, Tk_NameOfAnchor \- translate between strings and anchor positions
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
int
|
||||
\fBTk_GetAnchorFromObj(\fIinterp, objPtr, anchorPtr\fB)\fR
|
||||
.sp
|
||||
int
|
||||
\fBTk_GetAnchor(\fIinterp, string, anchorPtr\fB)\fR
|
||||
.sp
|
||||
const char *
|
||||
\fBTk_NameOfAnchor(\fIanchor\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS "Tk_Anchor" *anchorPtr
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for error reporting, or NULL.
|
||||
.AP Tcl_Obj *objPtr in/out
|
||||
String value contains name of anchor point:
|
||||
.QW \fBn\fR ,
|
||||
.QW \fBne\fR ,
|
||||
.QW \fBe\fR ,
|
||||
.QW \fBse\fR ,
|
||||
.QW \fBs\fR ,
|
||||
.QW \fBsw\fR ,
|
||||
.QW \fBw\fR ,
|
||||
.QW \fBnw\fR ,
|
||||
or
|
||||
.QW \fBcenter\fR ;
|
||||
internal rep will be modified to cache corresponding Tk_Anchor. In the
|
||||
case of
|
||||
.QW \fBcenter\fR
|
||||
on input, a non-empty abbreviation of it may also be used on input.
|
||||
.AP "const char" *string in
|
||||
Same as \fIobjPtr\fR except description of anchor point is passed as
|
||||
a string.
|
||||
.AP int *anchorPtr out
|
||||
Pointer to location in which to store anchor position corresponding to
|
||||
\fIobjPtr\fR or \fIstring\fR.
|
||||
.AP Tk_Anchor anchor in
|
||||
Anchor position, e.g. \fBTCL_ANCHOR_CENTER\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_GetAnchorFromObj\fR places in \fI*anchorPtr\fR an anchor position
|
||||
(enumerated type \fBTk_Anchor\fR)
|
||||
corresponding to \fIobjPtr\fR's value. The result will be one of
|
||||
\fBTK_ANCHOR_N\fR, \fBTK_ANCHOR_NE\fR, \fBTK_ANCHOR_E\fR, \fBTK_ANCHOR_SE\fR,
|
||||
\fBTK_ANCHOR_S\fR, \fBTK_ANCHOR_SW\fR, \fBTK_ANCHOR_W\fR, \fBTK_ANCHOR_NW\fR,
|
||||
or \fBTK_ANCHOR_CENTER\fR.
|
||||
Anchor positions are typically used for indicating a point on an object
|
||||
that will be used to position the object, e.g. \fBTK_ANCHOR_N\fR means
|
||||
position the top center point of the object at a particular place.
|
||||
.PP
|
||||
Under normal circumstances the return value is \fBTCL_OK\fR and
|
||||
\fIinterp\fR is unused.
|
||||
If \fIstring\fR does not contain a valid anchor position
|
||||
or an abbreviation of one of these names, \fBTCL_ERROR\fR is returned,
|
||||
\fI*anchorPtr\fR is unmodified, and an error message is
|
||||
stored in \fIinterp\fR's result if \fIinterp\fR is not NULL.
|
||||
\fBTk_GetAnchorFromObj\fR caches information about the return
|
||||
value in \fIobjPtr\fR, which speeds up future calls to
|
||||
\fBTk_GetAnchorFromObj\fR with the same \fIobjPtr\fR.
|
||||
.PP
|
||||
\fBTk_GetAnchor\fR is identical to \fBTk_GetAnchorFromObj\fR except
|
||||
that the description of the anchor is specified with a string instead
|
||||
of an object. This prevents \fBTk_GetAnchor\fR from caching the
|
||||
return value, so \fBTk_GetAnchor\fR is less efficient than
|
||||
\fBTk_GetAnchorFromObj\fR.
|
||||
.PP
|
||||
\fBTk_NameOfAnchor\fR is the logical inverse of \fBTk_GetAnchor\fR.
|
||||
Given an anchor position such as \fBTK_ANCHOR_N\fR it returns a
|
||||
statically-allocated string corresponding to \fIanchor\fR.
|
||||
If \fIanchor\fR is not a legal anchor value, then
|
||||
.QW "unknown anchor position"
|
||||
is returned.
|
||||
.SH KEYWORDS
|
||||
anchor position
|
||||
296
doc/GetBitmap.3
296
doc/GetBitmap.3
@@ -1,296 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1990 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1998 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_AllocBitmapFromObj 3 8.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_AllocBitmapFromObj, Tk_GetBitmap, Tk_GetBitmapFromObj, Tk_DefineBitmap, Tk_NameOfBitmap, Tk_SizeOfBitmap, Tk_FreeBitmapFromObj, Tk_FreeBitmap \- maintain database of single-plane pixmaps
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
Pixmap
|
||||
\fBTk_AllocBitmapFromObj(\fIinterp, tkwin, objPtr\fB)\fR
|
||||
.sp
|
||||
Pixmap
|
||||
\fBTk_GetBitmap(\fIinterp, tkwin, info\fB)\fR
|
||||
.sp
|
||||
Pixmap
|
||||
\fBTk_GetBitmapFromObj(\fItkwin, objPtr\fB)\fR
|
||||
.sp
|
||||
int
|
||||
\fBTk_DefineBitmap(\fIinterp, name, source, width, height\fB)\fR
|
||||
.sp
|
||||
const char *
|
||||
\fBTk_NameOfBitmap(\fIdisplay, bitmap\fB)\fR
|
||||
.sp
|
||||
\fBTk_SizeOfBitmap(\fIdisplay, bitmap, widthPtr, heightPtr\fB)\fR
|
||||
.sp
|
||||
\fBTk_FreeBitmapFromObj(\fItkwin, objPtr\fB)\fR
|
||||
.sp
|
||||
\fBTk_FreeBitmap(\fIdisplay, bitmap\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS "unsigned long" *pixelPtr
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for error reporting; if NULL then no error message
|
||||
is left after errors.
|
||||
.AP Tk_Window tkwin in
|
||||
Token for window in which the bitmap will be used.
|
||||
.AP Tcl_Obj *objPtr in/out
|
||||
String value describes desired bitmap; internal rep will be
|
||||
modified to cache pointer to corresponding Pixmap.
|
||||
.AP "const char" *info in
|
||||
Same as \fIobjPtr\fR except description of bitmap is passed as a string and
|
||||
resulting Pixmap is not cached.
|
||||
.AP "const char" *name in
|
||||
Name for new bitmap to be defined.
|
||||
.AP "const void" *source in
|
||||
Data for bitmap, in standard bitmap format.
|
||||
Must be stored in static memory whose value will never change.
|
||||
.AP "int" width in
|
||||
Width of bitmap.
|
||||
.AP "int" height in
|
||||
Height of bitmap.
|
||||
.AP "int" *widthPtr out
|
||||
Pointer to word to fill in with \fIbitmap\fR's width.
|
||||
.AP "int" *heightPtr out
|
||||
Pointer to word to fill in with \fIbitmap\fR's height.
|
||||
.AP Display *display in
|
||||
Display for which \fIbitmap\fR was allocated.
|
||||
.AP Pixmap bitmap in
|
||||
Identifier for a bitmap allocated by \fBTk_AllocBitmapFromObj\fR or
|
||||
\fBTk_GetBitmap\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures manage a collection of bitmaps (one-plane pixmaps)
|
||||
being used by an application. The procedures allow bitmaps to be
|
||||
re-used efficiently, thereby avoiding server overhead, and also
|
||||
allow bitmaps to be named with character strings.
|
||||
.PP
|
||||
\fBTk_AllocBitmapFromObj\fR returns a Pixmap identifier for a bitmap
|
||||
that matches the description in \fIobjPtr\fR and is suitable for use
|
||||
in \fItkwin\fR. It re-uses an existing bitmap, if possible, and
|
||||
creates a new one otherwise. \fIObjPtr\fR's value must have one
|
||||
of the following forms:
|
||||
.TP 20
|
||||
\fB@\fIfileName\fR
|
||||
\fIFileName\fR must be the name of a file containing a bitmap
|
||||
description in the standard X11 format.
|
||||
.TP 20
|
||||
\fIname\fR
|
||||
\fIName\fR must be the name of a bitmap defined previously with
|
||||
a call to \fBTk_DefineBitmap\fR. The following names are pre-defined
|
||||
by Tk:
|
||||
.RS
|
||||
.TP 12
|
||||
\fBerror\fR
|
||||
The international
|
||||
.QW don't
|
||||
symbol: a circle with a diagonal line across it.
|
||||
.TP 12
|
||||
\fBgray75\fR
|
||||
75% gray: a checkerboard pattern where three out of four bits are on.
|
||||
.TP 12
|
||||
\fBgray50\fR
|
||||
50% gray: a checkerboard pattern where every other bit is on.
|
||||
.TP 12
|
||||
\fBgray25\fR
|
||||
25% gray: a checkerboard pattern where one out of every four bits is on.
|
||||
.TP 12
|
||||
\fBgray12\fR
|
||||
12.5% gray: a pattern where one-eighth of the bits are on, consisting of
|
||||
every fourth pixel in every other row.
|
||||
.TP 12
|
||||
\fBhourglass\fR
|
||||
An hourglass symbol.
|
||||
.TP 12
|
||||
\fBinfo\fR
|
||||
A large letter
|
||||
.QW i .
|
||||
.TP 12
|
||||
\fBquesthead\fR
|
||||
The silhouette of a human head, with a question mark in it.
|
||||
.TP 12
|
||||
\fBquestion\fR
|
||||
A large question-mark.
|
||||
.TP 12
|
||||
\fBwarning\fR
|
||||
A large exclamation point.
|
||||
.PP
|
||||
In addition, the following pre-defined names are available only on the
|
||||
\fBMacintosh\fR platform:
|
||||
.TP 12
|
||||
\fBdocument\fR
|
||||
A generic document.
|
||||
.TP 12
|
||||
\fBstationery\fR
|
||||
Document stationery.
|
||||
.TP 12
|
||||
\fBedition\fR
|
||||
The \fIedition\fR symbol.
|
||||
.TP 12
|
||||
\fBapplication\fR
|
||||
Generic application icon.
|
||||
.TP 12
|
||||
\fBaccessory\fR
|
||||
A desk accessory.
|
||||
.TP 12
|
||||
\fBfolder\fR
|
||||
Generic folder icon.
|
||||
.TP 12
|
||||
\fBpfolder\fR
|
||||
A locked folder.
|
||||
.TP 12
|
||||
\fBtrash\fR
|
||||
A trash can.
|
||||
.TP 12
|
||||
\fBfloppy\fR
|
||||
A floppy disk.
|
||||
.TP 12
|
||||
\fBramdisk\fR
|
||||
A floppy disk with chip.
|
||||
.TP 12
|
||||
\fBcdrom\fR
|
||||
A cd disk icon.
|
||||
.TP 12
|
||||
\fBpreferences\fR
|
||||
A folder with prefs symbol.
|
||||
.TP 12
|
||||
\fBquerydoc\fR
|
||||
A database document icon.
|
||||
.TP 12
|
||||
\fBstop\fR
|
||||
A stop sign.
|
||||
.TP 12
|
||||
\fBnote\fR
|
||||
A face with balloon words.
|
||||
.TP 12
|
||||
\fBcaution\fR
|
||||
A triangle with an exclamation point.
|
||||
.RE
|
||||
.LP
|
||||
Under normal conditions, \fBTk_AllocBitmapFromObj\fR
|
||||
returns an identifier for the requested bitmap. If an error
|
||||
occurs in creating the bitmap, such as when \fIobjPtr\fR refers
|
||||
to a non-existent file, then \fBNone\fR is returned and an error
|
||||
message is left in \fIinterp\fR's result if \fIinterp\fR is not
|
||||
NULL. \fBTk_AllocBitmapFromObj\fR caches information about the return
|
||||
value in \fIobjPtr\fR, which speeds up future calls to procedures
|
||||
such as \fBTk_AllocBitmapFromObj\fR and \fBTk_GetBitmapFromObj\fR.
|
||||
.PP
|
||||
\fBTk_GetBitmap\fR is identical to \fBTk_AllocBitmapFromObj\fR except
|
||||
that the description of the bitmap is specified with a string instead
|
||||
of an object. This prevents \fBTk_GetBitmap\fR from caching the
|
||||
return value, so \fBTk_GetBitmap\fR is less efficient than
|
||||
\fBTk_AllocBitmapFromObj\fR.
|
||||
.PP
|
||||
\fBTk_GetBitmapFromObj\fR returns the token for an existing bitmap, given
|
||||
the window and description used to create the bitmap.
|
||||
\fBTk_GetBitmapFromObj\fR does not actually create the bitmap; the bitmap
|
||||
must already have been created with a previous call to
|
||||
\fBTk_AllocBitmapFromObj\fR or \fBTk_GetBitmap\fR. The return
|
||||
value is cached in \fIobjPtr\fR, which speeds up
|
||||
future calls to \fBTk_GetBitmapFromObj\fR with the same \fIobjPtr\fR
|
||||
and \fItkwin\fR.
|
||||
.PP
|
||||
\fBTk_DefineBitmap\fR associates a name with
|
||||
in-memory bitmap data so that the name can be used in later
|
||||
calls to \fBTk_AllocBitmapFromObj\fR or \fBTk_GetBitmap\fR. The \fInameId\fR
|
||||
argument gives a name for the bitmap; it must not previously
|
||||
have been used in a call to \fBTk_DefineBitmap\fR.
|
||||
The arguments \fIsource\fR, \fIwidth\fR, and \fIheight\fR
|
||||
describe the bitmap.
|
||||
\fBTk_DefineBitmap\fR normally returns \fBTCL_OK\fR; if an error occurs
|
||||
(e.g. a bitmap named \fInameId\fR has already been defined) then
|
||||
\fBTCL_ERROR\fR is returned and an error message is left in
|
||||
interpreter \fIinterp\fR's result.
|
||||
Note: \fBTk_DefineBitmap\fR expects the memory pointed to by
|
||||
\fIsource\fR to be static: \fBTk_DefineBitmap\fR does not make
|
||||
a private copy of this memory, but uses the bytes pointed to
|
||||
by \fIsource\fR later in calls to \fBTk_AllocBitmapFromObj\fR or
|
||||
\fBTk_GetBitmap\fR.
|
||||
.PP
|
||||
Typically \fBTk_DefineBitmap\fR is used by \fB#include\fR-ing a
|
||||
bitmap file directly into a C program and then referencing
|
||||
the variables defined by the file.
|
||||
For example, suppose there exists a file \fBstip.bitmap\fR,
|
||||
which was created by the \fBbitmap\fR program and contains
|
||||
a stipple pattern.
|
||||
The following code uses \fBTk_DefineBitmap\fR to define a
|
||||
new bitmap named \fBfoo\fR:
|
||||
.CS
|
||||
Pixmap bitmap;
|
||||
#include "stip.bitmap"
|
||||
Tk_DefineBitmap(interp, "foo", stip_bits,
|
||||
stip_width, stip_height);
|
||||
\&...
|
||||
bitmap = Tk_GetBitmap(interp, tkwin, "foo");
|
||||
.CE
|
||||
This code causes the bitmap file to be read
|
||||
at compile-time and incorporates the bitmap information into
|
||||
the program's executable image. The same bitmap file could be
|
||||
read at run-time using \fBTk_GetBitmap\fR:
|
||||
.CS
|
||||
Pixmap bitmap;
|
||||
bitmap = Tk_GetBitmap(interp, tkwin, "@stip.bitmap");
|
||||
.CE
|
||||
The second form is a bit more flexible (the file could be modified
|
||||
after the program has been compiled, or a different string could be
|
||||
provided to read a different file), but it is a little slower and
|
||||
requires the bitmap file to exist separately from the program.
|
||||
.PP
|
||||
Tk maintains a database of all the bitmaps that are currently in use.
|
||||
Whenever possible, it will return an existing bitmap rather
|
||||
than creating a new one.
|
||||
When a bitmap is no longer used, Tk will release it automatically.
|
||||
This approach can substantially reduce server overhead, so
|
||||
\fBTk_AllocBitmapFromObj\fR and \fBTk_GetBitmap\fR should generally
|
||||
be used in preference to Xlib procedures like \fBXReadBitmapFile\fR.
|
||||
.PP
|
||||
The bitmaps returned by \fBTk_AllocBitmapFromObj\fR and \fBTk_GetBitmap\fR
|
||||
are shared, so callers should never modify them.
|
||||
If a bitmap must be modified dynamically, then it should be
|
||||
created by calling Xlib procedures such as \fBXReadBitmapFile\fR
|
||||
or \fBXCreatePixmap\fR directly.
|
||||
.PP
|
||||
The procedure \fBTk_NameOfBitmap\fR is roughly the inverse of
|
||||
\fBTk_GetBitmap\fR.
|
||||
Given an X Pixmap argument, it returns the textual description that was
|
||||
passed to \fBTk_GetBitmap\fR when the bitmap was created.
|
||||
\fIBitmap\fR must have been the return value from a previous
|
||||
call to \fBTk_AllocBitmapFromObj\fR or \fBTk_GetBitmap\fR.
|
||||
.PP
|
||||
\fBTk_SizeOfBitmap\fR returns the dimensions of its \fIbitmap\fR
|
||||
argument in the words pointed to by the \fIwidthPtr\fR and
|
||||
\fIheightPtr\fR arguments. As with \fBTk_NameOfBitmap\fR,
|
||||
\fIbitmap\fR must have been created by \fBTk_AllocBitmapFromObj\fR or
|
||||
\fBTk_GetBitmap\fR.
|
||||
.PP
|
||||
When a bitmap is no longer needed, \fBTk_FreeBitmapFromObj\fR or
|
||||
\fBTk_FreeBitmap\fR should be called to release it.
|
||||
For \fBTk_FreeBitmapFromObj\fR the bitmap to release is specified
|
||||
with the same information used to create it; for
|
||||
\fBTk_FreeBitmap\fR the bitmap to release is specified
|
||||
with its Pixmap token.
|
||||
There should be exactly one call to \fBTk_FreeBitmapFromObj\fR
|
||||
or \fBTk_FreeBitmap\fR for each call to \fBTk_AllocBitmapFromObj\fR or
|
||||
\fBTk_GetBitmap\fR.
|
||||
.SH BUGS
|
||||
.PP
|
||||
In determining whether an existing bitmap can be used to satisfy
|
||||
a new request, \fBTk_AllocBitmapFromObj\fR and \fBTk_GetBitmap\fR
|
||||
consider only the immediate value of the string description. For
|
||||
example, when a file name is passed to \fBTk_GetBitmap\fR,
|
||||
\fBTk_GetBitmap\fR will assume it is safe to re-use an existing
|
||||
bitmap created from the same file name: it will not check to
|
||||
see whether the file itself has changed, or whether the current
|
||||
directory has changed, thereby causing the name to refer to
|
||||
a different file.
|
||||
.SH KEYWORDS
|
||||
bitmap, pixmap
|
||||
@@ -1,64 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1990 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_GetCapStyle 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_GetCapStyle, Tk_NameOfCapStyle \- translate between strings and cap styles
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
int
|
||||
\fBTk_GetCapStyle(\fIinterp, string, capPtr\fB)\fR
|
||||
.sp
|
||||
const char *
|
||||
\fBTk_NameOfCapStyle(\fIcap\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS "Tcl_Interp" *capPtr
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for error reporting.
|
||||
.AP "const char" *string in
|
||||
String containing name of cap style \- one of
|
||||
.QW \fBbutt\fR ,
|
||||
.QW \fBprojecting\fR ,
|
||||
or
|
||||
.QW \fBround\fR
|
||||
\- or a unique abbreviation of one.
|
||||
.AP int *capPtr out
|
||||
Pointer to location in which to store X cap style corresponding to
|
||||
\fIstring\fR.
|
||||
.AP int cap in
|
||||
Cap style: one of \fBCapButt\fR, \fBCapProjecting\fR, or \fBCapRound\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_GetCapStyle\fR places in \fI*capPtr\fR the X cap style
|
||||
corresponding to \fIstring\fR.
|
||||
This will be one of the values
|
||||
\fBCapButt\fR, \fBCapProjecting\fR, or \fBCapRound\fR.
|
||||
Cap styles are typically used in X graphics contexts to indicate
|
||||
how the end-points of lines should be capped.
|
||||
See the X documentation for information on what each style
|
||||
implies.
|
||||
.PP
|
||||
Under normal circumstances the return value is \fBTCL_OK\fR and
|
||||
\fIinterp\fR is unused.
|
||||
If \fIstring\fR does not contain a valid cap style
|
||||
or an abbreviation of one of these names, then an error message is
|
||||
stored in interpreter \fIinterp\fR's result, \fBTCL_ERROR\fR is returned, and
|
||||
\fI*capPtr\fR is unmodified.
|
||||
.PP
|
||||
\fBTk_NameOfCapStyle\fR is the logical inverse of \fBTk_GetCapStyle\fR.
|
||||
Given a cap style such as \fBCapButt\fR it returns a
|
||||
statically-allocated string corresponding to \fIcap\fR.
|
||||
If \fIcap\fR is not a legal cap style, then
|
||||
.QW "unknown cap style"
|
||||
is returned.
|
||||
.SH KEYWORDS
|
||||
butt, cap style, projecting, round
|
||||
@@ -1,77 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1994 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_GetColormap 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_GetColormap, Tk_PreserveColormap, Tk_FreeColormap \- allocate and free colormaps
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
Colormap
|
||||
\fBTk_GetColormap(\fIinterp, tkwin, string\fB)\fR
|
||||
.sp
|
||||
\fBTk_PreserveColormap(\fIdisplay, colormap\fB)\fR
|
||||
.sp
|
||||
\fBTk_FreeColormap(\fIdisplay, colormap\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS "Colormap" colormap
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for error reporting.
|
||||
.AP Tk_Window tkwin in
|
||||
Token for window in which colormap will be used.
|
||||
.AP "const char" *string in
|
||||
Selects a colormap: either \fBnew\fR or the name of a window
|
||||
with the same screen and visual as \fItkwin\fR.
|
||||
.AP Display *display in
|
||||
Display for which \fIcolormap\fR was allocated.
|
||||
.AP Colormap colormap in
|
||||
Colormap to free or preserve; must have been returned by a previous
|
||||
call to \fBTk_GetColormap\fR or \fBTk_GetVisual\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures are used to manage colormaps.
|
||||
\fBTk_GetColormap\fR returns a colormap suitable for use in \fItkwin\fR.
|
||||
If its \fIstring\fR argument is \fBnew\fR then a new colormap is
|
||||
created; otherwise \fIstring\fR must be the name of another window
|
||||
with the same screen and visual as \fItkwin\fR, and the colormap from that
|
||||
window is returned.
|
||||
If \fIstring\fR does not make sense, or if it refers to a window on
|
||||
a different screen from \fItkwin\fR or with
|
||||
a different visual than \fItkwin\fR, then \fBTk_GetColormap\fR returns
|
||||
\fBNone\fR and leaves an error message in \fIinterp\fR's result.
|
||||
.PP
|
||||
\fBTk_PreserveColormap\fR increases the internal reference count for a
|
||||
colormap previously returned by \fBTk_GetColormap\fR, which allows the
|
||||
colormap to be stored in several locations without knowing which order
|
||||
they will be released.
|
||||
.PP
|
||||
\fBTk_FreeColormap\fR should be called when a colormap returned by
|
||||
\fBTk_GetColormap\fR is no longer needed.
|
||||
Tk maintains a reference count for each colormap returned by
|
||||
\fBTk_GetColormap\fR, so there should eventually be one call to
|
||||
\fBTk_FreeColormap\fR for each call to \fBTk_GetColormap\fR and each
|
||||
call to \fBTk_PreserveColormap\fR.
|
||||
When a colormap's reference count becomes zero, Tk releases the
|
||||
X colormap.
|
||||
.PP
|
||||
\fBTk_GetVisual\fR and \fBTk_GetColormap\fR work together, in that
|
||||
a new colormap created by \fBTk_GetVisual\fR may later be returned
|
||||
by \fBTk_GetColormap\fR.
|
||||
The reference counting mechanism for colormaps includes both procedures,
|
||||
so callers of \fBTk_GetVisual\fR must also call \fBTk_FreeColormap\fR
|
||||
to release the colormap.
|
||||
If \fBTk_GetColormap\fR is called with a \fIstring\fR value of
|
||||
\fBnew\fR then the resulting colormap will never
|
||||
be returned by \fBTk_GetVisual\fR; however, it can be used in other
|
||||
windows by calling \fBTk_GetColormap\fR with the original window's
|
||||
name as \fIstring\fR.
|
||||
.SH KEYWORDS
|
||||
colormap, visual
|
||||
176
doc/GetColor.3
176
doc/GetColor.3
@@ -1,176 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1990-1991 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1998 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_AllocColorFromObj 3 8.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_AllocColorFromObj, Tk_GetColor, Tk_GetColorFromObj, Tk_GetColorByValue, Tk_NameOfColor, Tk_FreeColorFromObj, Tk_FreeColor \- maintain database of colors
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
XColor *
|
||||
\fBTk_AllocColorFromObj(\fIinterp, tkwin, objPtr\fB)\fR
|
||||
.sp
|
||||
XColor *
|
||||
\fBTk_GetColor(\fIinterp, tkwin, name\fB)\fR
|
||||
.sp
|
||||
XColor *
|
||||
\fBTk_GetColorFromObj(\fItkwin, objPtr\fB)\fR
|
||||
.sp
|
||||
XColor *
|
||||
\fBTk_GetColorByValue(\fItkwin, prefPtr\fB)\fR
|
||||
.sp
|
||||
const char *
|
||||
\fBTk_NameOfColor(\fIcolorPtr\fB)\fR
|
||||
.sp
|
||||
GC
|
||||
\fBTk_GCForColor(\fIcolorPtr, drawable\fB)\fR
|
||||
.sp
|
||||
\fBTk_FreeColorFromObj(\fItkwin, objPtr\fB)\fR
|
||||
.sp
|
||||
\fBTk_FreeColor(\fIcolorPtr\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS "Tcl_Interp" *colorPtr
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for error reporting.
|
||||
.AP Tk_Window tkwin in
|
||||
Token for window in which color will be used.
|
||||
.AP Tcl_Obj *objPtr in/out
|
||||
String value describes desired color; internal rep will be
|
||||
modified to cache pointer to corresponding (XColor *).
|
||||
.AP char *name in
|
||||
Same as \fIobjPtr\fR except description of color is passed as a string and
|
||||
resulting (XColor *) is not cached.
|
||||
.AP XColor *prefPtr in
|
||||
Indicates red, green, and blue intensities of desired
|
||||
color.
|
||||
.AP XColor *colorPtr in
|
||||
Pointer to X color information. Must have been allocated by previous
|
||||
call to \fBTk_AllocColorFromObj\fR, \fBTk_GetColor\fR or
|
||||
\fBTk_GetColorByValue\fR, except when passed to \fBTk_NameOfColor\fR.
|
||||
.AP Drawable drawable in
|
||||
Drawable in which the result graphics context will be used. Must have
|
||||
same screen and depth as the window for which the color was allocated.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures manage the colors being used by a Tk application.
|
||||
They allow colors to be shared whenever possible, so that colormap
|
||||
space is preserved, and they pick closest available colors when
|
||||
colormap space is exhausted.
|
||||
.PP
|
||||
Given a textual description of a color, \fBTk_AllocColorFromObj\fR
|
||||
locates a pixel value that may be used to render the color
|
||||
in a particular window. The desired color is specified with a
|
||||
value whose string value must have one of the following forms:
|
||||
.TP 20
|
||||
\fIcolorname\fR
|
||||
Any of the valid textual names for a color defined in the
|
||||
server's color database file, such as \fBred\fR or \fBPeachPuff\fR.
|
||||
.TP 20
|
||||
\fB#\fIRGB\fR
|
||||
.TP 20
|
||||
\fB#\fIRRGGBB\fR
|
||||
.TP 20
|
||||
\fB#\fIRRRGGGBBB\fR
|
||||
.TP 20
|
||||
\fB#\fIRRRRGGGGBBBB\fR
|
||||
A numeric specification of the red, green, and blue intensities
|
||||
to use to display the color. Each \fIR\fR, \fIG\fR, or \fIB\fR
|
||||
represents a single hexadecimal digit. The four forms permit
|
||||
colors to be specified with 4-bit, 8-bit, 12-bit or 16-bit values.
|
||||
When fewer than 16 bits are provided for each color, they represent
|
||||
the most significant bits of the color, while the lower unfilled
|
||||
bits will be repeatedly replicated from the available higher bits.
|
||||
For example, #3a7 is the same as #3333aaaa7777.
|
||||
.PP
|
||||
\fBTk_AllocColorFromObj\fR returns a pointer to
|
||||
an XColor structure; the structure indicates the exact intensities of
|
||||
the allocated color (which may differ slightly from those requested,
|
||||
depending on the limitations of the screen) and a pixel value
|
||||
that may be used to draw with the color in \fItkwin\fR.
|
||||
If an error occurs in \fBTk_AllocColorFromObj\fR (such as an unknown
|
||||
color name) then NULL is returned and an error message is stored in
|
||||
\fIinterp\fR's result if \fIinterp\fR is not NULL.
|
||||
If the colormap for \fItkwin\fR is full, \fBTk_AllocColorFromObj\fR
|
||||
will use the closest existing color in the colormap.
|
||||
\fBTk_AllocColorFromObj\fR caches information about
|
||||
the return value in \fIobjPtr\fR, which speeds up future calls to procedures
|
||||
such as \fBTk_AllocColorFromObj\fR and \fBTk_GetColorFromObj\fR.
|
||||
.PP
|
||||
\fBTk_GetColor\fR is identical to \fBTk_AllocColorFromObj\fR except
|
||||
that the description of the color is specified with a string instead
|
||||
of a value. This prevents \fBTk_GetColor\fR from caching the
|
||||
return value, so \fBTk_GetColor\fR is less efficient than
|
||||
\fBTk_AllocColorFromObj\fR.
|
||||
.PP
|
||||
\fBTk_GetColorFromObj\fR returns the token for an existing color, given
|
||||
the window and description used to create the color.
|
||||
\fBTk_GetColorFromObj\fR does not actually create the color; the color
|
||||
must already have been created with a previous call to
|
||||
\fBTk_AllocColorFromObj\fR or \fBTk_GetColor\fR. The return
|
||||
value is cached in \fIobjPtr\fR, which speeds up
|
||||
future calls to \fBTk_GetColorFromObj\fR with the same \fIobjPtr\fR
|
||||
and \fItkwin\fR.
|
||||
.PP
|
||||
\fBTk_GetColorByValue\fR is similar to \fBTk_GetColor\fR except that
|
||||
the desired color is indicated with the \fIred\fR, \fIgreen\fR, and
|
||||
\fIblue\fR fields of the structure pointed to by \fIcolorPtr\fR.
|
||||
.PP
|
||||
This package maintains a database
|
||||
of all the colors currently in use.
|
||||
If the same color is requested multiple times from
|
||||
\fBTk_GetColor\fR or \fBTk_AllocColorFromObj\fR (e.g. by different
|
||||
windows), or if the
|
||||
same intensities are requested multiple times from
|
||||
\fBTk_GetColorByValue\fR, then existing pixel values will
|
||||
be re-used. Re-using an existing pixel avoids any interaction
|
||||
with the window server, which makes the allocation much more
|
||||
efficient. These procedures also provide a portable interface that
|
||||
works across all platforms. For this reason, you should generally use
|
||||
\fBTk_AllocColorFromObj\fR, \fBTk_GetColor\fR, or \fBTk_GetColorByValue\fR
|
||||
instead of lower level procedures like \fBXAllocColor\fR.
|
||||
.PP
|
||||
Since different calls to this package
|
||||
may return the same shared
|
||||
pixel value, callers should never change the color of a pixel
|
||||
returned by the procedures.
|
||||
If you need to change a color value dynamically, you should use
|
||||
\fBXAllocColorCells\fR to allocate the pixel value for the color.
|
||||
.PP
|
||||
The procedure \fBTk_NameOfColor\fR is roughly the inverse of
|
||||
\fBTk_GetColor\fR. If its \fIcolorPtr\fR argument was created
|
||||
by \fBTk_AllocColorFromObj\fR or \fBTk_GetColor\fR then the return value
|
||||
is the string that was used to create the
|
||||
color. If \fIcolorPtr\fR was created by a call to \fBTk_GetColorByValue\fR,
|
||||
or by any other mechanism, then the return value is a string
|
||||
that could be passed to \fBTk_GetColor\fR to return the same
|
||||
color. Note: the string returned by \fBTk_NameOfColor\fR is
|
||||
only guaranteed to persist until the next call to
|
||||
\fBTk_NameOfColor\fR.
|
||||
.PP
|
||||
\fBTk_GCForColor\fR returns a graphics context whose \fBforeground\fR
|
||||
field is the pixel allocated for \fIcolorPtr\fR and whose other fields
|
||||
all have default values.
|
||||
This provides an easy way to do basic drawing with a color.
|
||||
The graphics context is cached with the color and will exist only as
|
||||
long as \fIcolorPtr\fR exists; it is freed when the last reference
|
||||
to \fIcolorPtr\fR is freed by calling \fBTk_FreeColor\fR.
|
||||
.PP
|
||||
When a color is no longer needed \fBTk_FreeColorFromObj\fR or
|
||||
\fBTk_FreeColor\fR should be called to release it.
|
||||
For \fBTk_FreeColorFromObj\fR the color to release is specified
|
||||
with the same information used to create it; for
|
||||
\fBTk_FreeColor\fR the color to release is specified
|
||||
with a pointer to its XColor structure.
|
||||
There should be exactly one call to \fBTk_FreeColorFromObj\fR
|
||||
or \fBTk_FreeColor\fR for each call to \fBTk_AllocColorFromObj\fR,
|
||||
\fBTk_GetColor\fR, or \fBTk_GetColorByValue\fR.
|
||||
.SH KEYWORDS
|
||||
color, intensity, value, pixel value
|
||||
231
doc/GetCursor.3
231
doc/GetCursor.3
@@ -1,231 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1990 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1998 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_AllocCursorFromObj 3 8.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_AllocCursorFromObj, Tk_GetCursor, Tk_GetCursorFromObj, Tk_GetCursorFromData, Tk_NameOfCursor, Tk_FreeCursorFromObj, Tk_FreeCursor \- maintain database of cursors
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
Tk_Cursor
|
||||
\fBTk_AllocCursorFromObj(\fIinterp, tkwin, objPtr\fB)\fR
|
||||
.sp
|
||||
Tk_Cursor
|
||||
\fBTk_GetCursor(\fIinterp, tkwin, name\fB)\fR
|
||||
.sp
|
||||
Tk_Cursor
|
||||
\fBTk_GetCursorFromObj(\fItkwin, objPtr\fB)\fR
|
||||
.sp
|
||||
Tk_Cursor
|
||||
\fBTk_GetCursorFromData(\fIinterp, tkwin, source, mask, width, height, xHot, yHot, fg, bg\fB)\fR
|
||||
.sp
|
||||
const char *
|
||||
\fBTk_NameOfCursor(\fIdisplay, cursor\fB)\fR
|
||||
.sp
|
||||
\fBTk_FreeCursorFromObj(\fItkwin, objPtr\fB)\fR
|
||||
.sp
|
||||
\fBTk_FreeCursor(\fIdisplay, cursor\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS "unsigned long" *pixelPtr
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for error reporting.
|
||||
.AP Tk_Window tkwin in
|
||||
Token for window in which the cursor will be used.
|
||||
.AP Tcl_Obj *objPtr in/out
|
||||
Description of cursor; see below for possible values. Internal rep will be
|
||||
modified to cache pointer to corresponding Tk_Cursor.
|
||||
.AP char *name in
|
||||
Same as \fIobjPtr\fR except description of cursor is passed as a string and
|
||||
resulting Tk_Cursor is not cached.
|
||||
.AP "const char" *source in
|
||||
Data for cursor cursor, in standard cursor format.
|
||||
.AP "const char" *mask in
|
||||
Data for mask cursor, in standard cursor format.
|
||||
.AP "int" width in
|
||||
Width of \fIsource\fR and \fImask\fR.
|
||||
.AP "int" height in
|
||||
Height of \fIsource\fR and \fImask\fR.
|
||||
.AP "int" xHot in
|
||||
X-location of cursor hot-spot.
|
||||
.AP "int" yHot in
|
||||
Y-location of cursor hot-spot.
|
||||
.AP Tk_Uid fg in
|
||||
Textual description of foreground color for cursor.
|
||||
.AP Tk_Uid bg in
|
||||
Textual description of background color for cursor.
|
||||
.AP Display *display in
|
||||
Display for which \fIcursor\fR was allocated.
|
||||
.AP Tk_Cursor cursor in
|
||||
Opaque Tk identifier for cursor. If passed to \fBTk_FreeCursor\fR, must
|
||||
have been returned by some previous call to \fBTk_GetCursor\fR or
|
||||
\fBTk_GetCursorFromData\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures manage a collection of cursors
|
||||
being used by an application. The procedures allow cursors to be
|
||||
re-used efficiently, thereby avoiding server overhead, and also
|
||||
allow cursors to be named with character strings.
|
||||
.PP
|
||||
\fBTk_AllocCursorFromObj\fR takes as argument an object describing a
|
||||
cursor, and returns an opaque Tk identifier for a cursor corresponding
|
||||
to the description. It re-uses an existing cursor if possible and
|
||||
creates a new one otherwise. \fBTk_AllocCursorFromObj\fR caches
|
||||
information about the return value in \fIobjPtr\fR, which speeds up
|
||||
future calls to procedures such as \fBTk_AllocCursorFromObj\fR and
|
||||
\fBTk_GetCursorFromObj\fR. If an error occurs in creating the cursor,
|
||||
such as when \fIobjPtr\fR refers to a non-existent file, then \fBNone\fR
|
||||
is returned and an error message will be stored in \fIinterp\fR's result
|
||||
if \fIinterp\fR is not NULL. \fIObjPtr\fR must contain a standard Tcl
|
||||
list with one of the following forms:
|
||||
.TP
|
||||
\fIname\fR\0[\fIfgColor\fR\0[\fIbgColor\fR]]
|
||||
\fIName\fR is the name of a cursor in the standard X cursor cursor,
|
||||
i.e., any of the names defined in \fBcursorcursor.h\fR, without
|
||||
the \fBXC_\fR. Some example values are \fBX_cursor\fR, \fBhand2\fR,
|
||||
or \fBleft_ptr\fR. Appendix B of
|
||||
.QW "The X Window System"
|
||||
by Scheifler & Gettys has illustrations showing what each of these
|
||||
cursors looks like. If \fIfgColor\fR and \fIbgColor\fR are both
|
||||
specified, they give the foreground and background colors to use
|
||||
for the cursor (any of the forms acceptable to \fBTk_GetColor\fR
|
||||
may be used). If only \fIfgColor\fR is specified, then there
|
||||
will be no background color: the background will be transparent.
|
||||
If no colors are specified, then the cursor
|
||||
will use black for its foreground color and white for its background
|
||||
color.
|
||||
.RS
|
||||
.PP
|
||||
The Macintosh version of Tk supports all of the X cursors and
|
||||
will also accept any of the standard Mac cursors
|
||||
including \fBibeam\fR, \fBcrosshair\fR, \fBwatch\fR, \fBplus\fR, and
|
||||
\fBarrow\fR. In addition, Tk will load Macintosh cursor resources of
|
||||
the types \fBcrsr\fR (color) and \fBCURS\fR (black and white) by the
|
||||
name of the resource. The application and all its open
|
||||
dynamic library's resource files will be searched for the named
|
||||
cursor. If there are conflicts color cursors will always be loaded
|
||||
in preference to black and white cursors.
|
||||
.RE
|
||||
.TP
|
||||
\fB@\fIsourceName\0maskName\0fgColor\0bgColor\fR
|
||||
In this form, \fIsourceName\fR and \fImaskName\fR are the names of
|
||||
files describing cursors for the cursor's source bits and mask.
|
||||
Each file must be in standard X11 cursor format.
|
||||
\fIFgColor\fR and \fIbgColor\fR
|
||||
indicate the colors to use for the
|
||||
cursor, in any of the forms acceptable to \fBTk_GetColor\fR. This
|
||||
form of the command will not work on Macintosh or Windows computers.
|
||||
.TP
|
||||
\fB@\fIsourceName\0fgColor\fR
|
||||
This form is similar to the one above, except that the source is
|
||||
used as mask also. This means that the cursor's background is
|
||||
transparent. This form of the command will not work on Macintosh
|
||||
or Windows computers.
|
||||
.TP
|
||||
\fB@\fIsourceName\fR
|
||||
This form only works on Windows, and will load a Windows system
|
||||
cursor (\fB.ani\fR or \fB.cur\fR) from the file specified in
|
||||
\fIsourceName\fR.
|
||||
.PP
|
||||
\fBTk_GetCursor\fR is identical to \fBTk_AllocCursorFromObj\fR except
|
||||
that the description of the cursor is specified with a string instead
|
||||
of an object. This prevents \fBTk_GetCursor\fR from caching the
|
||||
return value, so \fBTk_GetCursor\fR is less efficient than
|
||||
\fBTk_AllocCursorFromObj\fR.
|
||||
.PP
|
||||
\fBTk_GetCursorFromObj\fR returns the token for an existing cursor, given
|
||||
the window and description used to create the cursor.
|
||||
\fBTk_GetCursorFromObj\fR does not actually create the cursor; the cursor
|
||||
must already have been created with a previous call to
|
||||
\fBTk_AllocCursorFromObj\fR or \fBTk_GetCursor\fR. The return
|
||||
value is cached in \fIobjPtr\fR, which speeds up
|
||||
future calls to \fBTk_GetCursorFromObj\fR with the same \fIobjPtr\fR
|
||||
and \fItkwin\fR.
|
||||
.PP
|
||||
\fBTk_GetCursorFromData\fR allows cursors to be created from
|
||||
in-memory descriptions of their source and mask cursors. \fISource\fR
|
||||
points to standard cursor data for the cursor's source bits, and
|
||||
\fImask\fR points to standard cursor data describing
|
||||
which pixels of \fIsource\fR are to be drawn and which are to be
|
||||
considered transparent. \fIWidth\fR and \fIheight\fR give the
|
||||
dimensions of the cursor, \fIxHot\fR and \fIyHot\fR indicate the
|
||||
location of the cursor's hot-spot (the point that is reported when
|
||||
an event occurs), and \fIfg\fR and \fIbg\fR describe the cursor's
|
||||
foreground and background colors textually (any of the forms
|
||||
suitable for \fBTk_GetColor\fR may be used). Typically, the
|
||||
arguments to \fBTk_GetCursorFromData\fR are created by including
|
||||
a cursor file directly into the source code for a program, as in
|
||||
the following example:
|
||||
.CS
|
||||
Tk_Cursor cursor;
|
||||
#include "source.cursor"
|
||||
#include "mask.cursor"
|
||||
cursor = Tk_GetCursorFromData(interp, tkwin, source_bits,
|
||||
mask_bits, source_width, source_height, source_x_hot,
|
||||
source_y_hot, Tk_GetUid("red"), Tk_GetUid("blue"));
|
||||
.CE
|
||||
.PP
|
||||
Under normal conditions \fBTk_GetCursorFromData\fR
|
||||
will return an identifier for the requested cursor. If an error
|
||||
occurs in creating the cursor then \fBNone\fR is returned and an error
|
||||
message will be stored in \fIinterp\fR's result.
|
||||
.PP
|
||||
\fBTk_AllocCursorFromObj\fR, \fBTk_GetCursor\fR, and
|
||||
\fBTk_GetCursorFromData\fR maintain a
|
||||
database of all the cursors they have created. Whenever possible,
|
||||
a call to \fBTk_AllocCursorFromObj\fR, \fBTk_GetCursor\fR, or
|
||||
\fBTk_GetCursorFromData\fR will
|
||||
return an existing cursor rather than creating a new one. This
|
||||
approach can substantially reduce server overhead, so the Tk
|
||||
procedures should generally be used in preference to Xlib procedures
|
||||
like \fBXCreateFontCursor\fR or \fBXCreatePixmapCursor\fR, which
|
||||
create a new cursor on each call. The Tk procedures are also more
|
||||
portable than the lower-level X procedures.
|
||||
.PP
|
||||
The procedure \fBTk_NameOfCursor\fR is roughly the inverse of
|
||||
\fBTk_GetCursor\fR. If its \fIcursor\fR argument was created
|
||||
by \fBTk_GetCursor\fR, then the return value is the \fIname\fR
|
||||
argument that was passed to \fBTk_GetCursor\fR to create the
|
||||
cursor. If \fIcursor\fR was created by a call to \fBTk_GetCursorFromData\fR,
|
||||
or by any other mechanism, then the return value is a hexadecimal string
|
||||
giving the X identifier for the cursor.
|
||||
Note: the string returned by \fBTk_NameOfCursor\fR is
|
||||
only guaranteed to persist until the next call to
|
||||
\fBTk_NameOfCursor\fR. Also, this call is not portable except for
|
||||
cursors returned by \fBTk_GetCursor\fR.
|
||||
.PP
|
||||
When a cursor returned by \fBTk_AllocCursorFromObj\fR, \fBTk_GetCursor\fR,
|
||||
or \fBTk_GetCursorFromData\fR
|
||||
is no longer needed, \fBTk_FreeCursorFromObj\fR or
|
||||
\fBTk_FreeCursor\fR should be called to release it.
|
||||
For \fBTk_FreeCursorFromObj\fR the cursor to release is specified
|
||||
with the same information used to create it; for
|
||||
\fBTk_FreeCursor\fR the cursor to release is specified
|
||||
with its Tk_Cursor token.
|
||||
There should be exactly one call to \fBTk_FreeCursor\fR for
|
||||
each call to \fBTk_AllocCursorFromObj\fR, \fBTk_GetCursor\fR,
|
||||
or \fBTk_GetCursorFromData\fR.
|
||||
.SH BUGS
|
||||
.PP
|
||||
In determining whether an existing cursor can be used to satisfy
|
||||
a new request, \fBTk_AllocCursorFromObj\fR, \fBTk_GetCursor\fR,
|
||||
and \fBTk_GetCursorFromData\fR
|
||||
consider only the immediate values of their arguments. For
|
||||
example, when a file name is passed to \fBTk_GetCursor\fR,
|
||||
\fBTk_GetCursor\fR will assume it is safe to re-use an existing
|
||||
cursor created from the same file name: it will not check to
|
||||
see whether the file itself has changed, or whether the current
|
||||
directory has changed, thereby causing the name to refer to
|
||||
a different file. Similarly, \fBTk_GetCursorFromData\fR assumes
|
||||
that if the same \fIsource\fR pointer is used in two different calls,
|
||||
then the pointers refer to the same data; it does not check to
|
||||
see if the actual data values have changed.
|
||||
.SH KEYWORDS
|
||||
cursor
|
||||
@@ -1,82 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1989-1993 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_GetDash 3 8.3 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_GetDash \- convert from string to valid dash structure.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
|
||||
int
|
||||
\fBTk_GetDash\fR(\fIinterp, string, dashPtr\fR)
|
||||
.fi
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_Dash *dashPtr
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for error reporting.
|
||||
.AP "const char" *string in
|
||||
Textual value to be converted.
|
||||
.AP Tk_Dash *dashPtr out
|
||||
Points to place to store the dash pattern
|
||||
value converted from \fIstring\fR. Must not be NULL.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedure parses the string and fills in the result in the
|
||||
Tk_Dash structure. The string can be a list of integers or a
|
||||
character string containing only
|
||||
.QW \fB.,-_\fR
|
||||
and spaces. If all
|
||||
goes well, \fBTCL_OK\fR is returned and a dash descriptor is stored
|
||||
in the variable pointed to by \fIdashPtr\fR.
|
||||
If \fIstring\fR does not have the
|
||||
proper syntax then \fBTCL_ERROR\fR is returned, an error message is left
|
||||
in the interpreter's result, and nothing is stored at *\fIdashPtr\fR.
|
||||
.PP
|
||||
The first possible syntax is a list of integers. Each element
|
||||
represents the number of pixels of a line segment. Only the odd
|
||||
segments are drawn using the
|
||||
.QW outline
|
||||
color. The other segments are drawn transparent.
|
||||
.PP
|
||||
The second possible syntax is a character list containing only
|
||||
5 possible characters
|
||||
.QW "\fB.,-_ \fR" .
|
||||
The space can be used
|
||||
to enlarge the space between other line elements, and can not
|
||||
occur in the first position of the string. Some examples:
|
||||
.PP
|
||||
.CS
|
||||
\-dash . = \-dash {2 4}
|
||||
\-dash - = \-dash {6 4}
|
||||
\-dash -. = \-dash {6 4 2 4}
|
||||
\-dash -.. = \-dash {6 4 2 4 2 4}
|
||||
\-dash {. } = \-dash {2 8}
|
||||
\-dash , = \-dash {4 4}
|
||||
.CE
|
||||
.PP
|
||||
The main difference between this syntax and the numeric is that it
|
||||
is shape-conserving. This means that all values in the dash
|
||||
list will be multiplied by the line width before display. This
|
||||
ensures that
|
||||
.QW .
|
||||
will always be displayed as a dot and
|
||||
.QW -
|
||||
always as a dash regardless of the line width.
|
||||
.PP
|
||||
On systems where only a limited set of dash patterns, the dash
|
||||
pattern will be displayed as the most close dash pattern that
|
||||
is available. For example, on Windows only the first 4 of the
|
||||
above examples are available; the last 2 examples will be
|
||||
displayed identically to the first one.
|
||||
.SH "SEE ALSO"
|
||||
canvas(n), Tk_CreateItemType(3)
|
||||
.SH KEYWORDS
|
||||
dash, conversion
|
||||
110
doc/GetFont.3
110
doc/GetFont.3
@@ -1,110 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1990-1992 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1998 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_AllocFontFromObj 3 8.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_AllocFontFromObj, Tk_GetFont, Tk_GetFontFromObj, Tk_NameOfFont, Tk_FreeFontFromObj, Tk_FreeFont \- maintain database of fonts
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
Tk_Font
|
||||
\fBTk_AllocFontFromObj(\fIinterp, tkwin, objPtr\fB)\fR
|
||||
.sp
|
||||
Tk_Font
|
||||
\fBTk_GetFont(\fIinterp, tkwin, string\fB)\fR
|
||||
.sp
|
||||
Tk_Font
|
||||
\fBTk_GetFontFromObj(\fItkwin, objPtr\fB)\fR
|
||||
.sp
|
||||
const char *
|
||||
\fBTk_NameOfFont(\fItkfont\fB)\fR
|
||||
.sp
|
||||
Tk_Font
|
||||
\fBTk_FreeFontFromObj(\fItkwin, objPtr\fB)\fR
|
||||
.sp
|
||||
void
|
||||
\fBTk_FreeFont(\fItkfont\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS "const char" *tkfont
|
||||
.AP "Tcl_Interp" *interp in
|
||||
Interpreter to use for error reporting. If \fBNULL\fR, then no error
|
||||
messages are left after errors.
|
||||
.AP Tk_Window tkwin in
|
||||
Token for window in which font will be used.
|
||||
.AP Tcl_Obj *objPtr in/out
|
||||
Gives name or description of font. See documentation
|
||||
for the \fBfont\fR command for details on acceptable formats.
|
||||
Internal rep will be modified to cache corresponding Tk_Font.
|
||||
.AP "const char" *string in
|
||||
Same as \fIobjPtr\fR except description of font is passed as a string and
|
||||
resulting Tk_Font is not cached.
|
||||
.AP Tk_Font tkfont in
|
||||
Opaque font token.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_AllocFontFromObj\fR finds the font indicated by \fIobjPtr\fR and
|
||||
returns a token that represents the font. The return value can be used
|
||||
in subsequent calls to procedures such as \fBTk_GetFontMetrics\fR,
|
||||
\fBTk_MeasureChars\fR, and \fBTk_FreeFont\fR. The Tk_Font token
|
||||
will remain valid until
|
||||
\fBTk_FreeFontFromObj\fR or \fBTk_FreeFont\fR is called to release it.
|
||||
\fIObjPtr\fR can contain either a symbolic name or a font description; see
|
||||
the documentation for the \fBfont\fR command for a description of the
|
||||
valid formats. If \fBTk_AllocFontFromObj\fR is unsuccessful (because,
|
||||
for example, \fIobjPtr\fR did not contain a valid font specification) then it
|
||||
returns \fBNULL\fR and leaves an error message in \fIinterp\fR's result
|
||||
if \fIinterp\fR is not \fBNULL\fR. \fBTk_AllocFontFromObj\fR caches
|
||||
information about the return
|
||||
value in \fIobjPtr\fR, which speeds up future calls to procedures
|
||||
such as \fBTk_AllocFontFromObj\fR and \fBTk_GetFontFromObj\fR.
|
||||
.PP
|
||||
\fBTk_GetFont\fR is identical to \fBTk_AllocFontFromObj\fR except
|
||||
that the description of the font is specified with a string instead
|
||||
of an object. This prevents \fBTk_GetFont\fR from caching the
|
||||
matching Tk_Font, so \fBTk_GetFont\fR is less efficient than
|
||||
\fBTk_AllocFontFromObj\fR.
|
||||
.PP
|
||||
\fBTk_GetFontFromObj\fR returns the token for an existing font, given
|
||||
the window and description used to create the font.
|
||||
\fBTk_GetFontFromObj\fR does not actually create the font; the font
|
||||
must already have been created with a previous call to
|
||||
\fBTk_AllocFontFromObj\fR or \fBTk_GetFont\fR. The return
|
||||
value is cached in \fIobjPtr\fR, which speeds up
|
||||
future calls to \fBTk_GetFontFromObj\fR with the same \fIobjPtr\fR
|
||||
and \fItkwin\fR.
|
||||
.PP
|
||||
\fBTk_AllocFontFromObj\fR and \fBTk_GetFont\fR maintain
|
||||
a database of all fonts they have allocated. If
|
||||
the same font is requested multiple times (e.g. by different
|
||||
windows or for different purposes), then a single Tk_Font will be
|
||||
shared for all uses. The underlying resources will be freed automatically
|
||||
when no-one is using the font anymore.
|
||||
.PP
|
||||
The procedure \fBTk_NameOfFont\fR is roughly the inverse of
|
||||
\fBTk_GetFont\fR. Given a \fItkfont\fR that was created by
|
||||
\fBTk_GetFont\fR (or \fBTk_AllocFontFromObj\fR), the return value is
|
||||
the \fIstring\fR argument that was
|
||||
passed to \fBTk_GetFont\fR to create the font. The string returned by
|
||||
\fBTk_NameOfFont\fR is only guaranteed to persist until the \fItkfont\fR
|
||||
is deleted. The caller must not modify this string.
|
||||
.PP
|
||||
When a font is no longer needed,
|
||||
\fBTk_FreeFontFromObj\fR or \fBTk_FreeFont\fR should be called to
|
||||
release it. For \fBTk_FreeFontFromObj\fR the font to release is specified
|
||||
with the same information used to create it; for
|
||||
\fBTk_FreeFont\fR the font to release is specified
|
||||
with its Tk_Font token. There should be
|
||||
exactly one call to \fBTk_FreeFontFromObj\fR or \fBTk_FreeFont\fR
|
||||
for each call to \fBTk_AllocFontFromObj\fR or \fBTk_GetFont\fR.
|
||||
.SH "SEE ALSO"
|
||||
Tk_FontId(3)
|
||||
.SH KEYWORDS
|
||||
font
|
||||
70
doc/GetGC.3
70
doc/GetGC.3
@@ -1,70 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1990 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_GetGC 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_GetGC, Tk_FreeGC \- maintain database of read-only graphics contexts
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
GC
|
||||
\fBTk_GetGC\fR(\fItkwin, valueMask, valuePtr\fR)
|
||||
.sp
|
||||
\fBTk_FreeGC(\fIdisplay, gc\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS "unsigned long" valueMask
|
||||
.AP Tk_Window tkwin in
|
||||
Token for window in which the graphics context will be used.
|
||||
.AP "unsigned long" valueMask in
|
||||
Mask of bits (such as \fBGCForeground\fR or \fBGCStipple\fR)
|
||||
indicating which fields of \fI*valuePtr\fR are valid.
|
||||
.AP XGCValues *valuePtr in
|
||||
Pointer to structure describing the desired values for the
|
||||
graphics context.
|
||||
.AP Display *display in
|
||||
Display for which \fIgc\fR was allocated.
|
||||
.AP GC gc in
|
||||
X identifier for graphics context that is no longer needed.
|
||||
Must have been allocated by \fBTk_GetGC\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_GetGC\fR and \fBTk_FreeGC\fR manage a collection of graphics contexts
|
||||
being used by an application. The procedures allow graphics contexts to be
|
||||
shared, thereby avoiding the server overhead that would be incurred
|
||||
if a separate GC were created for each use. \fBTk_GetGC\fR takes arguments
|
||||
describing the desired graphics context and returns an X identifier
|
||||
for a GC that fits the description. The graphics context that is returned
|
||||
will have default values in all of the fields not specified explicitly
|
||||
by \fIvalueMask\fR and \fIvaluePtr\fR.
|
||||
.PP
|
||||
\fBTk_GetGC\fR maintains a
|
||||
database of all the graphics contexts it has created. Whenever possible,
|
||||
a call to \fBTk_GetGC\fR will
|
||||
return an existing graphics context rather than creating a new one. This
|
||||
approach can substantially reduce server overhead, so \fBTk_GetGC\fR
|
||||
should generally be used in preference to the Xlib procedure
|
||||
\fBXCreateGC\fR, which creates a new graphics context on each call.
|
||||
.PP
|
||||
Since the return values of \fBTk_GetGC\fR
|
||||
are shared, callers should never modify the graphics contexts
|
||||
returned by \fBTk_GetGC\fR.
|
||||
If a graphics context must be modified dynamically, then it should be
|
||||
created by calling \fBXCreateGC\fR instead of \fBTk_GetGC\fR.
|
||||
.PP
|
||||
When a graphics context
|
||||
is no longer needed, \fBTk_FreeGC\fR should be called to release it.
|
||||
There should be exactly one call to \fBTk_FreeGC\fR for
|
||||
each call to \fBTk_GetGC\fR.
|
||||
When a graphics context is no longer in use anywhere (i.e. it has
|
||||
been freed as many times as it has been gotten) \fBTk_FreeGC\fR
|
||||
will release it to the X server and delete it from the database.
|
||||
.SH KEYWORDS
|
||||
graphics context
|
||||
@@ -1,22 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1998-2000 by Scriptics Corporation.
|
||||
'\" All rights reserved.
|
||||
'\"
|
||||
.TH Tk_GetHISTANCE 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_GetHINSTANCE \- retrieve the global application instance handle
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tkPlatDecls.h>\fR
|
||||
.sp
|
||||
HINSTANCE
|
||||
\fBTk_GetHINSTANCE\fR()
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_GetHINSTANCE\fR returns the Windows application instance handle
|
||||
for the Tk application. This function is only available on Windows platforms.
|
||||
.SH KEYWORDS
|
||||
identifier, instance
|
||||
@@ -1,36 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1998-2000 by Scriptics Corporation.
|
||||
'\" All rights reserved.
|
||||
'\"
|
||||
.TH HWND 3 8.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_GetHWND, Tk_AttachHWND \- manage interactions between the Windows handle and an X window
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tkPlatDecls.h>\fR
|
||||
.sp
|
||||
HWND
|
||||
\fBTk_GetHWND\fR(\fIwindow\fR)
|
||||
.sp
|
||||
Window
|
||||
\fBTk_AttachHWND\fR(\fItkwin, hwnd\fR)
|
||||
.SH ARGUMENTS
|
||||
.AP Window window in
|
||||
X token for window.
|
||||
.AP Tk_Window tkwin in
|
||||
Tk window for window.
|
||||
.AP HWND hwnd in
|
||||
Windows HWND for window.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_GetHWND\fR returns the Windows HWND identifier for X Windows
|
||||
window given by \fIwindow\fR.
|
||||
.PP
|
||||
\fBTk_AttachHWND\fR binds the Windows HWND identifier to the
|
||||
specified Tk_Window given by \fItkwin\fR. It returns an X Windows
|
||||
window that encapsulates the HWND.
|
||||
.SH KEYWORDS
|
||||
identifier, window
|
||||
130
doc/GetImage.3
130
doc/GetImage.3
@@ -1,130 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1994 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_GetImage 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_GetImage, Tk_RedrawImage, Tk_SizeOfImage, Tk_FreeImage \- use an image in a widget
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
Tk_Image
|
||||
\fBTk_GetImage\fR(\fIinterp, tkwin, name, changeProc, clientData\fR)
|
||||
.sp
|
||||
\fBTk_RedrawImage\fR(\fIimage, imageX, imageY, width, height, drawable, drawableX, drawableY\fR)
|
||||
.sp
|
||||
\fBTk_SizeOfImage\fR(\fIimage, widthPtr, heightPtr\fR)
|
||||
.sp
|
||||
\fBTk_FreeImage\fR(\fIimage\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_ImageChangedProc *changeProc
|
||||
.AP Tcl_Interp *interp in
|
||||
Place to leave error message.
|
||||
.AP Tk_Window tkwin in
|
||||
Window in which image will be used.
|
||||
.AP "const char" *name in
|
||||
Name of image.
|
||||
.AP Tk_ImageChangedProc *changeProc in
|
||||
Procedure for Tk to invoke whenever image content or size changes.
|
||||
.AP ClientData clientData in
|
||||
One-word value for Tk to pass to \fIchangeProc\fR.
|
||||
.AP Tk_Image image in
|
||||
Token for image instance; must have been returned by a previous
|
||||
call to \fBTk_GetImage\fR.
|
||||
.AP int imageX in
|
||||
X-coordinate of upper-left corner of region of image to redisplay
|
||||
(measured in pixels from the image's upper-left corner).
|
||||
.AP int imageY in
|
||||
Y-coordinate of upper-left corner of region of image to redisplay
|
||||
(measured in pixels from the image's upper-left corner).
|
||||
.AP "int" width (in)
|
||||
Width of region of image to redisplay.
|
||||
.AP "int" height (in)
|
||||
Height of region of image to redisplay.
|
||||
.AP Drawable drawable in
|
||||
Where to display image. Must either be window specified to
|
||||
\fBTk_GetImage\fR or a pixmap compatible with that window.
|
||||
.AP int drawableX in
|
||||
Where to display image in \fIdrawable\fR: this is the x-coordinate
|
||||
in \fIdrawable\fR where x-coordinate \fIimageX\fR of the image
|
||||
should be displayed.
|
||||
.AP int drawableY in
|
||||
Where to display image in \fIdrawable\fR: this is the y-coordinate
|
||||
in \fIdrawable\fR where y-coordinate \fIimageY\fR of the image
|
||||
should be displayed.
|
||||
.AP "int" widthPtr out
|
||||
Store width of \fIimage\fR (in pixels) here.
|
||||
.AP "int" heightPtr out
|
||||
Store height of \fIimage\fR (in pixels) here.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures are invoked by widgets that wish to display images.
|
||||
\fBTk_GetImage\fR is invoked by a widget when it first decides to
|
||||
display an image.
|
||||
\fIname\fR gives the name of the desired image and \fItkwin\fR
|
||||
identifies the window where the image will be displayed.
|
||||
\fBTk_GetImage\fR looks up the image in the table of existing
|
||||
images and returns a token for a new instance of the image.
|
||||
If the image does not exist then \fBTk_GetImage\fR returns NULL
|
||||
and leaves an error message in interpreter \fIinterp\fR's result.
|
||||
.PP
|
||||
When a widget wishes to actually display an image it must
|
||||
call \fBTk_RedrawImage\fR, identifying the image (\fIimage\fR),
|
||||
a region within the image to redisplay (\fIimageX\fR, \fIimageY\fR,
|
||||
\fIwidth\fR, and \fIheight\fR), and a place to display the
|
||||
image (\fIdrawable\fR, \fIdrawableX\fR, and \fIdrawableY\fR).
|
||||
Tk will then invoke the appropriate image manager, which will
|
||||
display the requested portion of the image before returning.
|
||||
.PP
|
||||
A widget can find out the dimensions of an image by calling
|
||||
\fBTk_SizeOfImage\fR: the width and height will be stored
|
||||
in the locations given by \fIwidthPtr\fR and \fIheightPtr\fR,
|
||||
respectively.
|
||||
.PP
|
||||
When a widget is finished with an image (e.g., the widget is
|
||||
being deleted or it is going to use a different image instead
|
||||
of the current one), it must call \fBTk_FreeImage\fR to
|
||||
release the image instance.
|
||||
The widget should never again use the image token after passing
|
||||
it to \fBTk_FreeImage\fR.
|
||||
There must be exactly one call to \fBTk_FreeImage\fR for each
|
||||
call to \fBTk_GetImage\fR.
|
||||
.PP
|
||||
If the contents or size of an image changes, then any widgets
|
||||
using the image will need to find out about the changes so that
|
||||
they can redisplay themselves.
|
||||
The \fIchangeProc\fR and \fIclientData\fR arguments to
|
||||
\fBTk_GetImage\fR are used for this purpose.
|
||||
\fIchangeProc\fR will be called by Tk whenever a change occurs
|
||||
in the image; it must match the following prototype:
|
||||
.CS
|
||||
typedef void \fBTk_ImageChangedProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
int \fIx\fR,
|
||||
int \fIy\fR,
|
||||
int \fIwidth\fR,
|
||||
int \fIheight\fR,
|
||||
int \fIimageWidth\fR,
|
||||
int \fIimageHeight\fR);
|
||||
.CE
|
||||
The \fIclientData\fR argument to \fIchangeProc\fR is the same as the
|
||||
\fIclientData\fR argument to \fBTk_GetImage\fR.
|
||||
It is usually a pointer to the widget record for the widget or
|
||||
some other data structure managed by the widget.
|
||||
The arguments \fIx\fR, \fIy\fR, \fIwidth\fR, and \fIheight\fR
|
||||
identify a region within the image that must be redisplayed;
|
||||
they are specified in pixels measured from the upper-left
|
||||
corner of the image.
|
||||
The arguments \fIimageWidth\fR and \fIimageHeight\fR give
|
||||
the image's (new) size.
|
||||
.SH "SEE ALSO"
|
||||
Tk_CreateImageType
|
||||
.SH KEYWORDS
|
||||
images, redisplay
|
||||
@@ -1,63 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1990 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tk_GetJoinStyle 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_GetJoinStyle, Tk_NameOfJoinStyle \- translate between strings and join styles
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
int
|
||||
\fBTk_GetJoinStyle(\fIinterp, string, joinPtr\fB)\fR
|
||||
.sp
|
||||
const char *
|
||||
\fBTk_NameOfJoinStyle(\fIjoin\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS "Tcl_Interp" *joinPtr
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for error reporting.
|
||||
.AP "const char" *string in
|
||||
String containing name of join style \- one of
|
||||
.QW \fBbevel\fR ,
|
||||
.QW \fBmiter\fR ,
|
||||
or
|
||||
.QW \fBround\fR
|
||||
\- or a unique abbreviation of one.
|
||||
.AP int *joinPtr out
|
||||
Pointer to location in which to store X join style corresponding to
|
||||
\fIstring\fR.
|
||||
.AP int join in
|
||||
Join style: one of \fBJoinBevel\fR, \fBJoinMiter\fR, \fBJoinRound\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_GetJoinStyle\fR places in \fI*joinPtr\fR the X join style
|
||||
corresponding to \fIstring\fR, which will be one of
|
||||
\fBJoinBevel\fR, \fBJoinMiter\fR, or \fBJoinRound\fR.
|
||||
Join styles are typically used in X graphics contexts to indicate
|
||||
how adjacent line segments should be joined together.
|
||||
See the X documentation for information on what each style
|
||||
implies.
|
||||
.PP
|
||||
Under normal circumstances the return value is \fBTCL_OK\fR and
|
||||
\fIinterp\fR is unused.
|
||||
If \fIstring\fR does not contain a valid join style
|
||||
or an abbreviation of one of these names, then an error message is
|
||||
stored in interpreter \fIinterp\fR's result, \fBTCL_ERROR\fR is returned, and
|
||||
\fI*joinPtr\fR is unmodified.
|
||||
.PP
|
||||
\fBTk_NameOfJoinStyle\fR is the logical inverse of \fBTk_GetJoinStyle\fR.
|
||||
Given a join style such as \fBJoinBevel\fR it returns a
|
||||
statically-allocated string corresponding to \fIjoin\fR.
|
||||
If \fIjoin\fR is not a legal join style, then
|
||||
.QW "unknown join style"
|
||||
is returned.
|
||||
.SH KEYWORDS
|
||||
bevel, join style, miter, round
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user