create repo
This commit is contained in:
commit
84895302fd
|
@ -0,0 +1 @@
|
|||
<https://www.gnu.org/software/gettext/manual/html_node/Users.html>
|
|
@ -0,0 +1,2 @@
|
|||
This builds in debian sid as of 19 January 2017.
|
||||
You might need to add '-lgmodule-2.0' to your link flags (LDFLAGS) to make this compile properly.
|
|
@ -0,0 +1,340 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
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 Library 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) 19yy <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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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) 19yy 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 Library General
|
||||
Public License instead of this License.
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,51 @@
|
|||
Just some tips if you're going to help with xchat code (patches etc):
|
||||
|
||||
* Use tabs, not spaces, to indent code.
|
||||
|
||||
* Use a tab size of 3 (most editors will let you choose this).
|
||||
Type :set ts=3 in vim/gvim.
|
||||
|
||||
* Try to stick to the same consistant coding style:
|
||||
|
||||
void
|
||||
routine (void)
|
||||
{
|
||||
if (function (a, b, c))
|
||||
{
|
||||
x = a + 1;
|
||||
}
|
||||
}
|
||||
|
||||
(vertically aligned braces, a space after if, while, functions etc).
|
||||
|
||||
* Don't use "//" C++ style comments, some compilers don't like them.
|
||||
|
||||
* When opening a file with unix level functions (open, read/write, close)
|
||||
as opposed to the C-level functions (fopen, fwrite/fread, fclose), use
|
||||
the OFLAGS macro. This makes sure it'll work on Win32 aswell as unix e.g:
|
||||
|
||||
fh = open ("file", OFLAGS | O_RDONLY);
|
||||
|
||||
* Use closesocket() for sockets, and close() for normal files.
|
||||
|
||||
* Don't read() from sockets, instead use recv().
|
||||
|
||||
* Please provide unified format diffs (run diff -u).
|
||||
|
||||
* Call your patch something more meaningfull than xchat.diff (I get a
|
||||
million of these files!).
|
||||
|
||||
* To make a really nice and clean patch, do something like this:
|
||||
|
||||
Have two directories, unpacked from the original archive:
|
||||
xchat-2.0.0/
|
||||
xchat-2.0.0p1/
|
||||
Then edit/compile the xchat-2.0.0p1 directory. When you're done, make
|
||||
a patch with:
|
||||
|
||||
cd xchat-2.0.0p1
|
||||
make distclean
|
||||
cd ..
|
||||
diff -urN xchat-2.0.0 xchat-2.0.0p1 > xchat-something.diff
|
||||
|
||||
If using nmake (Windows) replace "make distclean" with "nmake -f makefile.msc clean"
|
|
@ -0,0 +1,49 @@
|
|||
X-Chat Requirements:
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- GTK 2.6+ (it comes with your Linux)
|
||||
|
||||
Optional:
|
||||
|
||||
- Perl (http://www.perl.org)
|
||||
- Python (http://www.python.org)
|
||||
- TCL (http://tcl.activestate.com)
|
||||
- OpenSSL (http://www.openssl.org)
|
||||
|
||||
|
||||
|
||||
X-Chat Compiling and Installation:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Type this:
|
||||
|
||||
./configure
|
||||
make
|
||||
|
||||
Become root and type:
|
||||
|
||||
make install
|
||||
|
||||
|
||||
Other Options
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
To get a full list of compile options, type:
|
||||
|
||||
./configure --help
|
||||
|
||||
|
||||
If you do not have GNU Gettext installed, instead use:
|
||||
|
||||
./configure --disable-nls
|
||||
|
||||
|
||||
If you want to disable Perl you can do:
|
||||
|
||||
./configure --disable-perl
|
||||
|
||||
|
||||
If you want to install a smaller stripped binary (without debug) do:
|
||||
|
||||
make install-strip
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
COMPILING ON WIN32
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
It is not easy! Be warned! You need either one of these compilers:
|
||||
|
||||
* Mingw (http://www.mingw.org)
|
||||
* MS Visual C
|
||||
|
||||
Note: This source code is meant for Linux/Unix like systems. Compiling this for
|
||||
Windows will produce a below-par quality product. The official XChat for Windows
|
||||
is not built with this unix source code.
|
||||
|
||||
|
||||
Getting GTK
|
||||
~~~~~~~~~~~
|
||||
|
||||
You also need GTK+ 2.10 for win32. Altough the GTK packages from the GIMP
|
||||
website are larger and harder to install they work very well.
|
||||
|
||||
1) Get the following packages from:
|
||||
http://www.gimp.org/~tml/gimp/win32/downloads.html
|
||||
|
||||
- gtk+-2.4.3.tar.gz
|
||||
- gtk+-dev-2.4.3.tar.gz
|
||||
- dirent.zip
|
||||
- gettext-runtime-0.13.1.zip
|
||||
- gettext-tools-0.13.1.zip
|
||||
- atk-1.6.0.zip
|
||||
- atk-dev-1.6.0.zip
|
||||
- pango-1.4.0.zip
|
||||
- pango-dev-1.4.0.zip
|
||||
- libpng (http://gnuwin32.sourceforge.net/packages/libpng.htm) Binaries & Developer files.
|
||||
- GNU libiconv (Not source files)
|
||||
- glib-2.4.2.zip
|
||||
- glib-dev-2.4.2.zip
|
||||
- pkgconfig-0.15.zip
|
||||
- Zlib121-dll.zip
|
||||
|
||||
2) Extract all files to a suitable place such as c:\devtools
|
||||
|
||||
3) Windows 2000, XP & 2003 users:
|
||||
- Start->(Settings->)Control Panel->System Applet
|
||||
- Advanced Tab->Environment Variables
|
||||
- Under "User variables for <user>" append ";C:\devtools" to the end of the PATH Variable
|
||||
- Click Ok twice and close the Control Panel
|
||||
|
||||
For Windows 9x users your basicly on your own for now.
|
||||
|
||||
|
||||
Mingw
|
||||
~~~~~
|
||||
|
||||
I havn't tried this yet, but ./configure --disable-xlib would be a start.
|
||||
|
||||
|
||||
MS Visual C
|
||||
~~~~~~~~~~~
|
||||
|
||||
|
||||
1) Edit src\makeinc.msc
|
||||
|
||||
You need to change the variables GLIB, GTK and LIBS to point
|
||||
the correct paths for your harddrive. Use the program pkg-config
|
||||
to find this information.
|
||||
|
||||
a) paste the output of `pkg-config glib-2.0 --msvc-syntax --cflags`
|
||||
to the GLIB = ... line.
|
||||
|
||||
b) paste the output of `pkg-config gtk+-2.0 --msvc-syntax --cflags`
|
||||
to the GTK = ... line.
|
||||
|
||||
c) paste the output of `pkg-config gtk+-2.0 --msvc-syntax --libs`
|
||||
to the LIBS = ... line.
|
||||
|
||||
2) In MSVC's includes directory, copy io.h to unistd.h.
|
||||
|
||||
MS VC++ 6
|
||||
~~~~~~~~~
|
||||
|
||||
3) Download Platform SDK from http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
|
||||
(you only need Core SDK) - ~200 MB Download (Be warned).
|
||||
4) Open the build enviroment.
|
||||
|
||||
a) If your planning on developing modifications to the xchat code go:
|
||||
Start->Programs->Microsoft Platform SDK...->Open Build Enviroment...->(Choose OS)->... (Debug)
|
||||
|
||||
b) If your compiling just to use xchat and wish to no recieve debug messages:
|
||||
Start->Programs->Microsoft Platform SDK...->Open Build Enviroment...->(Choose OS)->... (Retail)
|
||||
5) Change directory into where you have download the xchat source to and type this:
|
||||
cd src
|
||||
nmake -f makefile.msc clean
|
||||
nmake -f makefile.msc
|
||||
6) Copy fe-gtk\xchat.exe to another place.
|
||||
MS VC++ 7 (.NET)
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
3) Open the Visual Studio .NET Command Prompt
|
||||
|
||||
4) Change directory into where you have download the xchat source to and type this:
|
||||
cd src
|
||||
nmake -f makefile.msc clean
|
||||
nmake -f makefile.msc
|
||||
5) Copy fe-gtk\xchat.exe to another place.
|
||||
|
||||
|
||||
Common problems:
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
* gdk-pixbuf-csource must be in PATH.
|
||||
FIX: See step 3 for setting up GTK
|
||||
|
||||
* You might need to install dirent.zip manually.
|
||||
FIX: Copy C:\devtools\include\dirent.h to C:\devtools\include\glib-2.0\dirent.h
|
||||
|
||||
* Include path to libintl.h should be in GLIB= (makeinc.msc).
|
||||
FIX: Copy C:\devtools\include\libintl.h to C:\devtools\include\glib-2.0\libintl.h
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
#SUBDIRS = po po intl src plugins
|
||||
SUBDIRS = po po src plugins
|
||||
|
||||
EXTRA_DIST = m4/ChangeLog autogen.sh HACKING INSTALL.w32 faq.html xchat.png \
|
||||
xchat.desktop xchat.spec config.h.w32 xchat.ico
|
||||
|
||||
icon_DATA = xchat.png
|
||||
icondir = $(datadir)/pixmaps
|
||||
|
||||
util_DATA = xchat.desktop
|
||||
utildir = $(datadir)/applications
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
|
@ -0,0 +1,966 @@
|
|||
# Makefile.in generated by automake 1.16.5 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2021 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@
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
|
||||
$(am__configure_deps) $(am__DIST_COMMON)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno config.status.lineno
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
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 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
|
||||
ctags-recursive dvi-recursive html-recursive info-recursive \
|
||||
install-data-recursive install-dvi-recursive \
|
||||
install-exec-recursive install-html-recursive \
|
||||
install-info-recursive install-pdf-recursive \
|
||||
install-ps-recursive install-recursive installcheck-recursive \
|
||||
installdirs-recursive pdf-recursive ps-recursive \
|
||||
tags-recursive uninstall-recursive
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(icondir)" "$(DESTDIR)$(utildir)"
|
||||
DATA = $(icon_DATA) $(util_DATA)
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
am__recursive_targets = \
|
||||
$(RECURSIVE_TARGETS) \
|
||||
$(RECURSIVE_CLEAN_TARGETS) \
|
||||
$(am__extra_recursive_targets)
|
||||
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
|
||||
cscope distdir distdir-am dist dist-all distcheck
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
|
||||
config.h.in
|
||||
# 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)`
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||
ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS README \
|
||||
compile config.guess config.rpath config.sub install-sh \
|
||||
ltmain.sh missing
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
if test -d "$(distdir)"; then \
|
||||
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -rf "$(distdir)" \
|
||||
|| { sleep 5 && rm -rf "$(distdir)"; }; \
|
||||
else :; fi
|
||||
am__post_remove_distdir = $(am__remove_distdir)
|
||||
am__relativize = \
|
||||
dir0=`pwd`; \
|
||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
||||
sed_rest='s,^[^/]*/*,,'; \
|
||||
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
|
||||
sed_butlast='s,/*[^/]*$$,,'; \
|
||||
while test -n "$$dir1"; do \
|
||||
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
|
||||
if test "$$first" != "."; then \
|
||||
if test "$$first" = ".."; then \
|
||||
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
|
||||
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
|
||||
else \
|
||||
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
|
||||
if test "$$first2" = "$$first"; then \
|
||||
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
|
||||
else \
|
||||
dir2="../$$dir2"; \
|
||||
fi; \
|
||||
dir0="$$dir0"/"$$first"; \
|
||||
fi; \
|
||||
fi; \
|
||||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
||||
done; \
|
||||
reldir="$$dir2"
|
||||
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
|
||||
GZIP_ENV = --best
|
||||
DIST_TARGETS = dist-bzip2 dist-gzip
|
||||
# Exists only to be overridden by the user if desired.
|
||||
AM_DISTCHECK_DVI_TARGET = dvi
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
|
||||
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCAS = @CCAS@
|
||||
CCASDEPMODE = @CCASDEPMODE@
|
||||
CCASFLAGS = @CCASFLAGS@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMMON_CFLAGS = @COMMON_CFLAGS@
|
||||
COMMON_LIBS = @COMMON_LIBS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CSCOPE = @CSCOPE@
|
||||
CTAGS = @CTAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DATADIR = @DATADIR@
|
||||
DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@
|
||||
DBUS_CFLAGS = @DBUS_CFLAGS@
|
||||
DBUS_LIBS = @DBUS_LIBS@
|
||||
DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GCONFTOOL = @GCONFTOOL@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GMSGFMT_015 = @GMSGFMT_015@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
GREP = @GREP@
|
||||
GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@
|
||||
GTKSPELL_LIBS = @GTKSPELL_LIBS@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
GUI_CFLAGS = @GUI_CFLAGS@
|
||||
GUI_LIBS = @GUI_LIBS@
|
||||
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@
|
||||
LIBSEXY_CFLAGS = @LIBSEXY_CFLAGS@
|
||||
LIBSEXY_LIBS = @LIBSEXY_LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
|
||||
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@
|
||||
PERL_CFLAGS = @PERL_CFLAGS@
|
||||
PERL_LDFLAGS = @PERL_LDFLAGS@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
PLUGIN_INCLUDES = @PLUGIN_INCLUDES@
|
||||
POSUB = @POSUB@
|
||||
PY_CFLAGS = @PY_CFLAGS@
|
||||
PY_LIBS = @PY_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
TCL_CFLAGS = @TCL_CFLAGS@
|
||||
TCL_LIBS = @TCL_LIBS@
|
||||
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@
|
||||
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@
|
||||
gdkpixbufcsourcepath = @gdkpixbufcsourcepath@
|
||||
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@
|
||||
perlpath = @perlpath@
|
||||
pkgconfigpath = @pkgconfigpath@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
pythonpath = @pythonpath@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sedpath = @sedpath@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
unamepath = @unamepath@
|
||||
xchatlibdir = @xchatlibdir@
|
||||
|
||||
#SUBDIRS = po po intl src plugins
|
||||
SUBDIRS = po po src plugins
|
||||
EXTRA_DIST = m4/ChangeLog autogen.sh HACKING INSTALL.w32 faq.html xchat.png \
|
||||
xchat.desktop xchat.spec config.h.w32 xchat.ico
|
||||
|
||||
icon_DATA = xchat.png
|
||||
icondir = $(datadir)/pixmaps
|
||||
util_DATA = xchat.desktop
|
||||
utildir = $(datadir)/applications
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
am--refresh: Makefile
|
||||
@:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
|
||||
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
$(am__cd) $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
config.h: stamp-h1
|
||||
@test -f $@ || rm -f stamp-h1
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
||||
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool config.lt
|
||||
install-iconDATA: $(icon_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(icon_DATA)'; test -n "$(icondir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(icondir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(icondir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-iconDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(icon_DATA)'; test -n "$(icondir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(icondir)'; $(am__uninstall_files_from_dir)
|
||||
install-utilDATA: $(util_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(util_DATA)'; test -n "$(utildir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(utildir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(utildir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(utildir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(utildir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-utilDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(util_DATA)'; test -n "$(utildir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(utildir)'; $(am__uninstall_files_from_dir)
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run 'make' without going through this Makefile.
|
||||
# To change the values of 'make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in 'config.status', edit 'config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run 'make');
|
||||
# (2) otherwise, pass the desired values on the 'make' command line.
|
||||
$(am__recursive_targets):
|
||||
@fail=; \
|
||||
if $(am__make_keepgoing); then \
|
||||
failcom='fail=yes'; \
|
||||
else \
|
||||
failcom='exit 1'; \
|
||||
fi; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-recursive
|
||||
TAGS: tags
|
||||
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
$(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-recursive
|
||||
|
||||
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"
|
||||
cscope: cscope.files
|
||||
test ! -s cscope.files \
|
||||
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
|
||||
clean-cscope:
|
||||
-rm -f cscope.files
|
||||
cscope.files: clean-cscope cscopelist
|
||||
cscopelist: cscopelist-recursive
|
||||
|
||||
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
|
||||
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
test -d "$(distdir)" || mkdir "$(distdir)"
|
||||
@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
|
||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
$(am__make_dryrun) \
|
||||
|| test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
||||
$(am__relativize); \
|
||||
new_distdir=$$reldir; \
|
||||
dir1=$$subdir; dir2="$(top_distdir)"; \
|
||||
$(am__relativize); \
|
||||
new_top_distdir=$$reldir; \
|
||||
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
|
||||
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
|
||||
($(am__cd) $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$new_top_distdir" \
|
||||
distdir="$$new_distdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
am__skip_mode_fix=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-test -n "$(am__skip_mode_fix)" \
|
||||
|| find "$(distdir)" -type d ! -perm -755 \
|
||||
-exec chmod u+rwx,go+rx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r "$(distdir)"
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
|
||||
$(am__post_remove_distdir)
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-lzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-xz: distdir
|
||||
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-zstd: distdir
|
||||
tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
@echo WARNING: "Support for distribution archives compressed with" \
|
||||
"legacy program 'compress' is deprecated." >&2
|
||||
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
@echo WARNING: "Support for shar distribution archives is" \
|
||||
"deprecated." >&2
|
||||
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
|
||||
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist dist-all:
|
||||
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.lz*) \
|
||||
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
|
||||
*.tar.xz*) \
|
||||
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
*.tar.zst*) \
|
||||
zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir)
|
||||
chmod u+w $(distdir)
|
||||
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
test -d $(distdir)/_build || exit 0; \
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& am__cwd=`pwd` \
|
||||
&& $(am__cd) $(distdir)/_build/sub \
|
||||
&& ../../configure \
|
||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
--srcdir=../.. --prefix="$$dc_install_base" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
|
||||
&& cd "$$am__cwd" \
|
||||
|| exit 1
|
||||
$(am__post_remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
||||
distuninstallcheck:
|
||||
@test -n '$(distuninstallcheck_dir)' || { \
|
||||
echo 'ERROR: trying to run $@ with an empty' \
|
||||
'$$(distuninstallcheck_dir)' >&2; \
|
||||
exit 1; \
|
||||
}; \
|
||||
$(am__cd) '$(distuninstallcheck_dir)' || { \
|
||||
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
|
||||
exit 1; \
|
||||
}; \
|
||||
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile $(DATA) config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(icondir)" "$(DESTDIR)$(utildir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
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-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-iconDATA install-utilDATA
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-iconDATA uninstall-utilDATA
|
||||
|
||||
.MAKE: $(am__recursive_targets) all install-am install-strip
|
||||
|
||||
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
|
||||
am--refresh check check-am clean clean-cscope clean-generic \
|
||||
clean-libtool cscope cscopelist-am ctags ctags-am dist \
|
||||
dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
|
||||
dist-xz dist-zip dist-zstd distcheck distclean \
|
||||
distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-tags distcleancheck distdir distuninstallcheck 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-iconDATA install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip install-utilDATA installcheck installcheck-am \
|
||||
installdirs installdirs-am maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
|
||||
uninstall-am uninstall-iconDATA uninstall-utilDATA
|
||||
|
||||
.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:
|
|
@ -0,0 +1,133 @@
|
|||
What is this repo?
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
This is Xchat 2.8.8, with all the Debian Jessie patches applied, as well
|
||||
as some fixes manually pulled from hexchat for building against OpenSSL
|
||||
1.1.0. The goal of my version of XChat is to keep it buildable on newer
|
||||
Linux/Unix/Cygwin systems than the last release of XChat is compatible
|
||||
with.
|
||||
|
||||
I do not just use Hexchat because I don't like some of the UI changes
|
||||
that it introduced.
|
||||
|
||||
As of the last update to this readme (21 January 2017), the final link
|
||||
of the xchat binary fails due to it needing '-lgmodule-2.0' added to its
|
||||
linking flags. Until this gets fixed in source (I'll need to learn about
|
||||
autoconf for that to happen, I think), it can be done manually by adding
|
||||
that flag to the Makefile or running the configure script with
|
||||
`LDFLAGS=-lgmodule-2.0` set as an environment variable.
|
||||
|
||||
With that caveat, it currently builds and runs in Debian Sid as of
|
||||
21 January 2017.
|
||||
|
||||
As of 26 May 2019, it still builds in FreeBSD stable with:
|
||||
|
||||
MAKE="gmake" LDFLAGS='-L/usr/local/lib -lgmodule-2.0' ./configure \
|
||||
--prefix=/usr/local --disable-dbus
|
||||
|
||||
...so we may still have some time ahead of us.
|
||||
|
||||
Original README contents are below.
|
||||
|
||||
X-Chat README
|
||||
~~~~~~~~~~~~~
|
||||
X-Chat ("xchat") Copyright (c) 1998-2010 By Peter Zelezny.
|
||||
|
||||
This program is released under the GPL v2 with the additional exemption
|
||||
that compiling, linking, and/or using OpenSSL is allowed. You may
|
||||
provide binary packages linked to the OpenSSL libraries, provided that
|
||||
all other requirements of the GPL are met.
|
||||
See file COPYING for details.
|
||||
|
||||
|
||||
What is it?
|
||||
~~~~~~~~~~~
|
||||
X-Chat is an IRC client for UNIX operating systems. I.R.C. is Internet
|
||||
Relay Chat, see http://irchelp.org for more information about IRC in
|
||||
general. Xchat runs on most BSD and POSIX compliant operating systems.
|
||||
|
||||
|
||||
Requirements:
|
||||
~~~~~~~~~~~~~
|
||||
* GTK+ 2.10 (this is available at http://www.gtk.org).
|
||||
|
||||
X-Chat is known to work on, at least:
|
||||
|
||||
* Linux
|
||||
* FreeBSD
|
||||
* OpenBSD
|
||||
* NetBSD
|
||||
* Solaris
|
||||
* AIX
|
||||
* IRIX
|
||||
* DEC/Compaq Tru64 UNIX
|
||||
* HP-UX 10.20 and 11
|
||||
* MacOS X
|
||||
* Windows XP/2000/Vista/7
|
||||
|
||||
|
||||
Notes for packagers:
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If you need your packages to work on i386, you don't need to compile with
|
||||
--disable-mmx, because it's also checked at run-time.
|
||||
|
||||
|
||||
Python Scripts:
|
||||
~~~~~~~~~~~~~~~
|
||||
Scripts for 1.8.x are not compatible, and a brand new interface has be
|
||||
written. Documentation can be found here: http://xchat.org/docs/.
|
||||
Consider using the Python interface for your scripts, it's a very nice
|
||||
API, allows for loading/unloading individual scripts, and gives you
|
||||
almost all the features of the C-Plugin API.
|
||||
|
||||
|
||||
Perl Scripts:
|
||||
~~~~~~~~~~~~~
|
||||
Scripts for 1.8.x are compatible with the following exceptions:
|
||||
|
||||
* IRC::command will not interpret %C, %B, %U etc.
|
||||
|
||||
* user_list and user_list_short:
|
||||
If a user has both op and voice, only the op flag will be 1.
|
||||
|
||||
* add_user_list/sub_user_list/clear_user_list
|
||||
These functions do nothing.
|
||||
|
||||
* notify_list
|
||||
Not implemented. Always returns an empty list.
|
||||
|
||||
* server_list
|
||||
Lists servers that are not connected aswell.
|
||||
|
||||
* Some print events may have new names and some were added.
|
||||
|
||||
* Text printed by scripts must now be UTF8.
|
||||
|
||||
* Text passed to scripts (via add_message_handler) will be encoded in UTF8.
|
||||
|
||||
|
||||
Autoloading Perl Scripts and Plugins
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
* X-Chat automatically loads, at startup:
|
||||
~/.xchat2/*.pl Perl scripts
|
||||
~/.xchat2/*.py Python scripts
|
||||
~/.xchat2/*.so Plugins
|
||||
$(libdir)/xchat/plugins/*.so plugins
|
||||
(this usually translates to /usr/lib/xchat/plugins/*.so)
|
||||
|
||||
|
||||
Control Codes:
|
||||
~~~~~~~~~~~~~~
|
||||
%% - A single percentage sign
|
||||
%C - Control-C (mIRC color code)
|
||||
%B - Bold Text
|
||||
%U - Underline Text
|
||||
%R - Reverse Text
|
||||
%O - Reset all Text attributes
|
||||
%XXX - ASCII XXX (where XXX is a decimal 3 digit number)
|
||||
(Eg: %007 sends a BEEP)
|
||||
|
||||
%Cforeground,background will produce a color code, eg: %C03,10
|
||||
|
||||
These are now disabled by default (see Settings > Prefs > Input Box).
|
||||
Instead you can insert the real codes via ctrl-k, ctrl-b and ctrl-o.
|
|
@ -0,0 +1,40 @@
|
|||
dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
|
||||
dnl
|
||||
dnl example
|
||||
dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
|
||||
dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
|
||||
|
||||
AC_DEFUN([AS_AC_EXPAND],
|
||||
[
|
||||
EXP_VAR=[$1]
|
||||
FROM_VAR=[$2]
|
||||
|
||||
dnl first expand prefix and exec_prefix if necessary
|
||||
prefix_save=$prefix
|
||||
exec_prefix_save=$exec_prefix
|
||||
|
||||
dnl if no prefix given, then use /usr/local, the default prefix
|
||||
if test "x$prefix" = "xNONE"; then
|
||||
prefix=$ac_default_prefix
|
||||
fi
|
||||
dnl if no exec_prefix given, then use prefix
|
||||
if test "x$exec_prefix" = "xNONE"; then
|
||||
exec_prefix=$prefix
|
||||
fi
|
||||
|
||||
full_var="$FROM_VAR"
|
||||
dnl loop until it doesn't change anymore
|
||||
while true; do
|
||||
new_full_var="`eval echo $full_var`"
|
||||
if test "x$new_full_var"="x$full_var"; then break; fi
|
||||
full_var=$new_full_var
|
||||
done
|
||||
|
||||
dnl clean up
|
||||
full_var=$new_full_var
|
||||
AC_SUBST([$1], "$full_var")
|
||||
|
||||
dnl restore prefix and exec_prefix
|
||||
prefix=$prefix_save
|
||||
exec_prefix=$exec_prefix_save
|
||||
])
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,112 @@
|
|||
#!/bin/bash
|
||||
have_automake=false
|
||||
|
||||
if automake --version < /dev/null > /dev/null 2>&1 ; then
|
||||
automake_version=`automake --version | grep 'automake (GNU automake)' | sed 's/^[^0-9]*\(.*\)/\1/'`
|
||||
case $automake_version in
|
||||
1.2*|1.3*|1.4|1.4*|1.5*|1.6*|1.7*|1.8*)
|
||||
;;
|
||||
*)
|
||||
have_automake=true
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if $have_automake ; then
|
||||
AUTOMAKE="automake"
|
||||
ACLOCAL="aclocal"
|
||||
else
|
||||
if automake-1.9 --version < /dev/null > /dev/null 2>&1 ; then
|
||||
AUTOMAKE="automake-1.9"
|
||||
ACLOCAL="aclocal-1.9"
|
||||
else
|
||||
echo "automake missing or too old. This requires atleast automake 1.9"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# ------ START GETTEXT ------
|
||||
|
||||
echo searching for GNU gettext intl directory...
|
||||
|
||||
dirs="/usr/share /usr/local/share /opt/share /usr /usr/local /opt /usr/gnu/share /opt/local /opt/local/share"
|
||||
found=0
|
||||
for try in $dirs; do
|
||||
echo -n " -> $try/gettext/po... "
|
||||
if test -d $try/gettext/po; then
|
||||
echo found it
|
||||
found=1
|
||||
break
|
||||
fi
|
||||
echo no
|
||||
done
|
||||
if test "$found" != 1; then
|
||||
echo ERROR: Cannot find gettext/po directory.
|
||||
echo ERROR: Install GNU gettext in /usr or /usr/local prefix.
|
||||
exit 7
|
||||
fi;
|
||||
|
||||
echo copying gettext files...
|
||||
if test -f $try/gettext/mkinstalldirs; then
|
||||
ln -s $try/gettext/mkinstalldirs mkinstalldirs
|
||||
fi
|
||||
#intldir="$try/gettext/intl"
|
||||
#if test ! -d intl; then
|
||||
# mkdir intl
|
||||
#fi
|
||||
olddir=`pwd`
|
||||
#cd $intldir
|
||||
#for file in *; do
|
||||
# if test $file != COPYING.LIB-2.0 && test $file != COPYING.LIB-2.1; then
|
||||
# rm -f $olddir/intl/$file
|
||||
# cp $intldir/$file $olddir/intl/
|
||||
# fi
|
||||
#done
|
||||
cp -f $try/gettext/po/Makefile.in.in ./po/
|
||||
#if test -f intl/plural.c; then
|
||||
# sleep 2
|
||||
# touch intl/plural.c
|
||||
#fi
|
||||
|
||||
# ------ END GETTEXT ------
|
||||
|
||||
|
||||
echo running $ACLOCAL...
|
||||
$ACLOCAL $ACLOCAL_FLAGS
|
||||
if test "$?" != "0"; then
|
||||
echo aclocal failed, stopping.
|
||||
exit 2
|
||||
fi
|
||||
echo running libtoolize...
|
||||
libtoolize --force
|
||||
if test "$?" != "0"; then
|
||||
echo libtoolize failed, stopping.
|
||||
exit 3
|
||||
fi
|
||||
echo running autoheader...
|
||||
autoheader
|
||||
if test "$?" != "0"; then
|
||||
echo autoheader failed, stopping.
|
||||
exit 4
|
||||
fi
|
||||
echo running $AUTOMAKE...
|
||||
$AUTOMAKE -a --foreign
|
||||
if test "$?" != "0"; then
|
||||
echo automake failed, stopping.
|
||||
exit 5
|
||||
fi
|
||||
echo running autoconf...
|
||||
autoconf
|
||||
if test "$?" != "0"; then
|
||||
echo autoconf failed, stopping.
|
||||
exit 6
|
||||
fi
|
||||
|
||||
echo if no errors occured, run ./configure --enable-maintainer-mode
|
||||
exit 0
|
||||
|
||||
#autogen.sh generates:
|
||||
# aclocal.m4 Makefile.in config.guess config.sub ltmain.sh
|
||||
# configure install-sh missing mkinstalldirs depcomp
|
||||
#
|
||||
#configure generates:
|
||||
# config.status libtool Makefile.in
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,182 @@
|
|||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Where services dir for DBUS is */
|
||||
#undef DBUS_SERVICES_DIR
|
||||
|
||||
/* Define to 1 if translation of program messages to the user's native
|
||||
language is requested. */
|
||||
#undef ENABLE_NLS
|
||||
|
||||
/* Gettext package name */
|
||||
#undef GETTEXT_PACKAGE
|
||||
|
||||
/* Define to 1 if you have the Mac OS X function
|
||||
CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */
|
||||
#undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES
|
||||
|
||||
/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in
|
||||
the CoreFoundation framework. */
|
||||
#undef HAVE_CFPREFERENCESCOPYAPPVALUE
|
||||
|
||||
/* Define if the GNU dcgettext() function is already present or preinstalled.
|
||||
*/
|
||||
#undef HAVE_DCGETTEXT
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the `dlopen' function. */
|
||||
#undef HAVE_DLOPEN
|
||||
|
||||
/* Define to 1 if you have the `getaddrinfo' function. */
|
||||
#undef HAVE_GETADDRINFO
|
||||
|
||||
/* 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 <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the `cposix' library (-lcposix). */
|
||||
#undef HAVE_LIBCPOSIX
|
||||
|
||||
/* Define to 1 if you have the `inet' library (-linet). */
|
||||
#undef HAVE_LIBINET
|
||||
|
||||
/* Define to 1 if you have the `net' library (-lnet). */
|
||||
#undef HAVE_LIBNET
|
||||
|
||||
/* Define to 1 if you have the `nsl' library (-lnsl). */
|
||||
#undef HAVE_LIBNSL
|
||||
|
||||
/* Define to 1 if you have the `resolv' library (-lresolv). */
|
||||
#undef HAVE_LIBRESOLV
|
||||
|
||||
/* Define to 1 if you have the `socket' library (-lsocket). */
|
||||
#undef HAVE_LIBSOCKET
|
||||
|
||||
/* Define to 1 if you have the `X11' library (-lX11). */
|
||||
#undef HAVE_LIBX11
|
||||
|
||||
/* Define to 1 if you have the `memrchr' function. */
|
||||
#undef HAVE_MEMRCHR
|
||||
|
||||
/* Define to 1 if you have the <openssl/ssl.h> header file. */
|
||||
#undef HAVE_OPENSSL_SSL_H
|
||||
|
||||
/* Define to 1 if you have the `snprintf' function. */
|
||||
#undef HAVE_SNPRINTF
|
||||
|
||||
/* Define to 1 if you have the <socks.h> header file. */
|
||||
#undef HAVE_SOCKS_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdio.h> header file. */
|
||||
#undef HAVE_STDIO_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 you have the `strtoull' function. */
|
||||
#undef HAVE_STRTOULL
|
||||
|
||||
/* Define to 1 if you have the <sys/ipc.h> header file. */
|
||||
#undef HAVE_SYS_IPC_H
|
||||
|
||||
/* Define to 1 if you have the <sys/shm.h> header file. */
|
||||
#undef HAVE_SYS_SHM_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/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if you have the `vsnprintf' function. */
|
||||
#undef HAVE_VSNPRINTF
|
||||
|
||||
/* Define to 1 if you have the <X11/Xft/Xft.h> header file. */
|
||||
#undef HAVE_X11_XFT_XFT_H
|
||||
|
||||
/* Define to 1 if the system uses lookupd */
|
||||
#undef LOOKUPD
|
||||
|
||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
||||
#undef LT_OBJDIR
|
||||
|
||||
#undef OLD_PERL
|
||||
|
||||
/* 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
|
||||
|
||||
#undef PREFIX
|
||||
|
||||
#undef SOCKS
|
||||
|
||||
/* Define to 1 if all of the C90 standard headers exist (not just the ones
|
||||
required in a freestanding environment). This macro is provided for
|
||||
backward compatibility; new code need not use it. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
#undef USE_DBUS
|
||||
|
||||
#undef USE_GTKSPELL
|
||||
|
||||
#undef USE_IPV6
|
||||
|
||||
#undef USE_LIBSEXY
|
||||
|
||||
#undef USE_MMX
|
||||
|
||||
#undef USE_MSPROXY
|
||||
|
||||
#undef USE_OPENSSL
|
||||
|
||||
#undef USE_PLUGIN
|
||||
|
||||
#undef USE_SHM
|
||||
|
||||
#undef USE_SIGACTION
|
||||
|
||||
#undef USE_XFT
|
||||
|
||||
#undef USE_XLIB
|
||||
|
||||
#undef USING_FREEBSD
|
||||
|
||||
#undef USING_LINUX
|
||||
|
||||
#undef XCHATLIBDIR
|
||||
|
||||
#undef XCHATSHAREDIR
|
||||
|
||||
#undef socklen_t
|
|
@ -0,0 +1,12 @@
|
|||
#define LOCALEDIR "./locale"
|
||||
#define ENABLE_NLS
|
||||
#define USE_GMODULE
|
||||
#define USE_PLUGIN
|
||||
#define PACKAGE_NAME "xchat"
|
||||
#define PACKAGE_VERSION "2.8.8-Unofficial"
|
||||
#define XCHATLIBDIR "."
|
||||
#define XCHATSHAREDIR "."
|
||||
#define OLD_PERL
|
||||
#ifndef USE_IPV6
|
||||
#define socklen_t int
|
||||
#endif
|
|
@ -0,0 +1,360 @@
|
|||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by XChat configure 2.8.8, which was
|
||||
generated by GNU Autoconf 2.71. Invocation command line was
|
||||
|
||||
$ ./configure
|
||||
|
||||
## --------- ##
|
||||
## Platform. ##
|
||||
## --------- ##
|
||||
|
||||
hostname = somejuan
|
||||
uname -m = x86_64
|
||||
uname -r = 4.15.0-112-generic
|
||||
uname -s = Linux
|
||||
uname -v = #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020
|
||||
|
||||
/usr/bin/uname -p = unknown
|
||||
/bin/uname -X = unknown
|
||||
|
||||
/bin/arch = unknown
|
||||
/usr/bin/arch -k = unknown
|
||||
/usr/convex/getsysinfo = unknown
|
||||
/usr/bin/hostinfo = unknown
|
||||
/bin/machine = unknown
|
||||
/usr/bin/oslevel = unknown
|
||||
/bin/universe = unknown
|
||||
|
||||
PATH: /home/jdaugherty/.ciao/build/bin/
|
||||
PATH: /home/jdaugherty/.ciaoroot/master/build/bin/
|
||||
PATH: /home/jdaugherty/.autojump/bin/
|
||||
PATH: /home/jdaugherty/bin/
|
||||
PATH: /home/jdaugherty/perl5/bin/
|
||||
PATH: /home/jdaugherty/perl5/bin/
|
||||
PATH: /home/jdaugherty/.local/bin/
|
||||
PATH: /home/jdaugherty/bin/
|
||||
PATH: /home/jdaugherty/.cabal/bin/
|
||||
PATH: /home/jdaugherty/.ghcup/bin/
|
||||
PATH: /home/jdaugherty/.nvm/versions/node/v16.2.0/bin/
|
||||
PATH: /home/jdaugherty/perl5/bin/
|
||||
PATH: /usr/local/sbin/
|
||||
PATH: /usr/local/bin/
|
||||
PATH: /usr/sbin/
|
||||
PATH: /usr/bin/
|
||||
PATH: /sbin/
|
||||
PATH: /bin/
|
||||
PATH: /usr/games/
|
||||
PATH: /usr/local/games/
|
||||
PATH: /snap/bin/
|
||||
PATH: /home/jdaugherty/.dotnet/tools/
|
||||
PATH: /home/jdaugherty/work/pl/logtalk/tools/lgtdoc/xml/
|
||||
PATH: /home/jdaugherty/work/pl/logtalk/scripts/
|
||||
PATH: /home/jdaugherty/work/pl/logtalk/integration/
|
||||
PATH: /home/jdaugherty/Android/Sdk/emulator/
|
||||
PATH: /home/jdaugherty/Android/Sdk/tools/
|
||||
PATH: /home/jdaugherty/Android/Sdk/tools/bin/
|
||||
PATH: /home/jdaugherty/Android/Sdk/platform-tools/
|
||||
|
||||
|
||||
## ----------- ##
|
||||
## Core tests. ##
|
||||
## ----------- ##
|
||||
|
||||
configure:2630: looking for aux files: config.rpath config.guess config.sub ltmain.sh compile missing install-sh
|
||||
configure:2643: trying ./
|
||||
configure:2672: ./config.rpath found
|
||||
configure:2672: ./config.guess found
|
||||
configure:2672: ./config.sub found
|
||||
configure:2654: ./install-sh found
|
||||
configure:2643: trying ./../
|
||||
configure:2643: trying ./../../
|
||||
configure:2696: error: cannot find required auxiliary files: ltmain.sh compile missing
|
||||
|
||||
## ---------------- ##
|
||||
## Cache variables. ##
|
||||
## ---------------- ##
|
||||
|
||||
ac_cv_env_CCASFLAGS_set=
|
||||
ac_cv_env_CCASFLAGS_value=
|
||||
ac_cv_env_CCAS_set=
|
||||
ac_cv_env_CCAS_value=
|
||||
ac_cv_env_CC_set=
|
||||
ac_cv_env_CC_value=
|
||||
ac_cv_env_CFLAGS_set=
|
||||
ac_cv_env_CFLAGS_value=
|
||||
ac_cv_env_CPPFLAGS_set=
|
||||
ac_cv_env_CPPFLAGS_value=
|
||||
ac_cv_env_CPP_set=
|
||||
ac_cv_env_CPP_value=
|
||||
ac_cv_env_DBUS_CFLAGS_set=
|
||||
ac_cv_env_DBUS_CFLAGS_value=
|
||||
ac_cv_env_DBUS_LIBS_set=
|
||||
ac_cv_env_DBUS_LIBS_value=
|
||||
ac_cv_env_GLIB_CFLAGS_set=
|
||||
ac_cv_env_GLIB_CFLAGS_value=
|
||||
ac_cv_env_GLIB_COMPILE_RESOURCES_set=
|
||||
ac_cv_env_GLIB_COMPILE_RESOURCES_value=
|
||||
ac_cv_env_GLIB_GENMARSHAL_set=
|
||||
ac_cv_env_GLIB_GENMARSHAL_value=
|
||||
ac_cv_env_GLIB_LIBS_set=
|
||||
ac_cv_env_GLIB_LIBS_value=
|
||||
ac_cv_env_GLIB_MKENUMS_set=
|
||||
ac_cv_env_GLIB_MKENUMS_value=
|
||||
ac_cv_env_GOBJECT_QUERY_set=
|
||||
ac_cv_env_GOBJECT_QUERY_value=
|
||||
ac_cv_env_GTKSPELL_CFLAGS_set=
|
||||
ac_cv_env_GTKSPELL_CFLAGS_value=
|
||||
ac_cv_env_GTKSPELL_LIBS_set=
|
||||
ac_cv_env_GTKSPELL_LIBS_value=
|
||||
ac_cv_env_LDFLAGS_set=set
|
||||
ac_cv_env_LDFLAGS_value=-lgmodule-2.0
|
||||
ac_cv_env_LIBSEXY_CFLAGS_set=
|
||||
ac_cv_env_LIBSEXY_CFLAGS_value=
|
||||
ac_cv_env_LIBSEXY_LIBS_set=
|
||||
ac_cv_env_LIBSEXY_LIBS_value=
|
||||
ac_cv_env_LIBS_set=
|
||||
ac_cv_env_LIBS_value=
|
||||
ac_cv_env_LT_SYS_LIBRARY_PATH_set=
|
||||
ac_cv_env_LT_SYS_LIBRARY_PATH_value=
|
||||
ac_cv_env_PKG_CONFIG_LIBDIR_set=
|
||||
ac_cv_env_PKG_CONFIG_LIBDIR_value=
|
||||
ac_cv_env_PKG_CONFIG_PATH_set=
|
||||
ac_cv_env_PKG_CONFIG_PATH_value=
|
||||
ac_cv_env_PKG_CONFIG_set=
|
||||
ac_cv_env_PKG_CONFIG_value=
|
||||
ac_cv_env_build_alias_set=
|
||||
ac_cv_env_build_alias_value=
|
||||
ac_cv_env_host_alias_set=
|
||||
ac_cv_env_host_alias_value=
|
||||
ac_cv_env_target_alias_set=
|
||||
ac_cv_env_target_alias_value=
|
||||
|
||||
## ----------------- ##
|
||||
## Output variables. ##
|
||||
## ----------------- ##
|
||||
|
||||
ACLOCAL=''
|
||||
AMDEPBACKSLASH=''
|
||||
AMDEP_FALSE=''
|
||||
AMDEP_TRUE=''
|
||||
AMTAR=''
|
||||
AM_BACKSLASH=''
|
||||
AM_DEFAULT_V=''
|
||||
AM_DEFAULT_VERBOSITY=''
|
||||
AM_V=''
|
||||
AR=''
|
||||
AUTOCONF=''
|
||||
AUTOHEADER=''
|
||||
AUTOMAKE=''
|
||||
AWK=''
|
||||
CC=''
|
||||
CCAS=''
|
||||
CCASDEPMODE=''
|
||||
CCASFLAGS=''
|
||||
CCDEPMODE=''
|
||||
CFLAGS=''
|
||||
COMMON_CFLAGS=''
|
||||
COMMON_LIBS=''
|
||||
CPP=''
|
||||
CPPFLAGS=''
|
||||
CSCOPE=''
|
||||
CTAGS=''
|
||||
CYGPATH_W=''
|
||||
DATADIR=''
|
||||
DBUS_BINDING_TOOL=''
|
||||
DBUS_CFLAGS=''
|
||||
DBUS_LIBS=''
|
||||
DBUS_SERVICES_DIR=''
|
||||
DEFS=''
|
||||
DEPDIR=''
|
||||
DLLTOOL=''
|
||||
DO_GCONF_FALSE=''
|
||||
DO_GCONF_TRUE=''
|
||||
DO_GTK_FALSE=''
|
||||
DO_GTK_TRUE=''
|
||||
DO_PERL_FALSE=''
|
||||
DO_PERL_TRUE=''
|
||||
DO_PLUGIN_FALSE=''
|
||||
DO_PLUGIN_TRUE=''
|
||||
DO_PYTHON_FALSE=''
|
||||
DO_PYTHON_TRUE=''
|
||||
DO_TCL_FALSE=''
|
||||
DO_TCL_TRUE=''
|
||||
DO_TEXT_FALSE=''
|
||||
DO_TEXT_TRUE=''
|
||||
DSYMUTIL=''
|
||||
DUMPBIN=''
|
||||
ECHO_C=''
|
||||
ECHO_N='-n'
|
||||
ECHO_T=''
|
||||
EGREP=''
|
||||
ETAGS=''
|
||||
EXEEXT=''
|
||||
FGREP=''
|
||||
FILECMD=''
|
||||
GCONFTOOL=''
|
||||
GETTEXT_MACRO_VERSION=''
|
||||
GETTEXT_PACKAGE=''
|
||||
GLIB_CFLAGS=''
|
||||
GLIB_COMPILE_RESOURCES=''
|
||||
GLIB_GENMARSHAL=''
|
||||
GLIB_LIBS=''
|
||||
GLIB_MKENUMS=''
|
||||
GMSGFMT=''
|
||||
GMSGFMT_015=''
|
||||
GOBJECT_QUERY=''
|
||||
GREP=''
|
||||
GTKSPELL_CFLAGS=''
|
||||
GTKSPELL_LIBS=''
|
||||
GTK_CFLAGS=''
|
||||
GTK_LIBS=''
|
||||
GUI_CFLAGS=''
|
||||
GUI_LIBS=''
|
||||
INSTALL_DATA=''
|
||||
INSTALL_PROGRAM=''
|
||||
INSTALL_SCRIPT=''
|
||||
INSTALL_STRIP_PROGRAM=''
|
||||
INTLLIBS=''
|
||||
INTL_MACOSX_LIBS=''
|
||||
LD=''
|
||||
LDFLAGS='-lgmodule-2.0'
|
||||
LIBICONV=''
|
||||
LIBINTL=''
|
||||
LIBOBJS=''
|
||||
LIBS=''
|
||||
LIBSEXY_CFLAGS=''
|
||||
LIBSEXY_LIBS=''
|
||||
LIBTOOL=''
|
||||
LIPO=''
|
||||
LN_S=''
|
||||
LTLIBICONV=''
|
||||
LTLIBINTL=''
|
||||
LTLIBOBJS=''
|
||||
LT_SYS_LIBRARY_PATH=''
|
||||
MAINT=''
|
||||
MAINTAINER_MODE_FALSE=''
|
||||
MAINTAINER_MODE_TRUE=''
|
||||
MAKEINFO=''
|
||||
MANIFEST_TOOL=''
|
||||
MKDIR_P=''
|
||||
MSGFMT=''
|
||||
MSGMERGE=''
|
||||
MSGMERGE_FOR_MSGFMT_OPTION=''
|
||||
NM=''
|
||||
NMEDIT=''
|
||||
OBJDUMP=''
|
||||
OBJEXT=''
|
||||
OTOOL64=''
|
||||
OTOOL=''
|
||||
PACKAGE=''
|
||||
PACKAGE_BUGREPORT='http://www.xchat.org/'
|
||||
PACKAGE_NAME='XChat'
|
||||
PACKAGE_STRING='XChat 2.8.8'
|
||||
PACKAGE_TARNAME='xchat'
|
||||
PACKAGE_URL=''
|
||||
PACKAGE_VERSION='2.8.8'
|
||||
PATH_SEPARATOR=':'
|
||||
PERL_CFLAGS=''
|
||||
PERL_LDFLAGS=''
|
||||
PKG_CONFIG=''
|
||||
PKG_CONFIG_LIBDIR=''
|
||||
PKG_CONFIG_PATH=''
|
||||
PLUGIN_INCLUDES=''
|
||||
POSUB=''
|
||||
PY_CFLAGS=''
|
||||
PY_LIBS=''
|
||||
RANLIB=''
|
||||
SED=''
|
||||
SET_MAKE=''
|
||||
SHELL='/bin/bash'
|
||||
STRIP=''
|
||||
TCL_CFLAGS=''
|
||||
TCL_LIBS=''
|
||||
USE_DBUS_FALSE=''
|
||||
USE_DBUS_TRUE=''
|
||||
USE_LIBSEXY_FALSE=''
|
||||
USE_LIBSEXY_TRUE=''
|
||||
USE_MMX_FALSE=''
|
||||
USE_MMX_TRUE=''
|
||||
USE_NLS=''
|
||||
USE_OPENSSL_FALSE=''
|
||||
USE_OPENSSL_TRUE=''
|
||||
VERSION=''
|
||||
XGETTEXT=''
|
||||
XGETTEXT_015=''
|
||||
XGETTEXT_EXTRA_OPTIONS=''
|
||||
ac_ct_AR=''
|
||||
ac_ct_CC=''
|
||||
ac_ct_DUMPBIN=''
|
||||
am__EXEEXT_FALSE=''
|
||||
am__EXEEXT_TRUE=''
|
||||
am__fastdepCCAS_FALSE=''
|
||||
am__fastdepCCAS_TRUE=''
|
||||
am__fastdepCC_FALSE=''
|
||||
am__fastdepCC_TRUE=''
|
||||
am__include=''
|
||||
am__isrc=''
|
||||
am__leading_dot=''
|
||||
am__nodep=''
|
||||
am__quote=''
|
||||
am__tar=''
|
||||
am__untar=''
|
||||
bindir='${exec_prefix}/bin'
|
||||
build=''
|
||||
build_alias=''
|
||||
build_cpu=''
|
||||
build_os=''
|
||||
build_vendor=''
|
||||
datadir='${datarootdir}'
|
||||
datarootdir='${prefix}/share'
|
||||
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
||||
dvidir='${docdir}'
|
||||
exec_prefix='NONE'
|
||||
gdkpixbufcsourcepath=''
|
||||
host=''
|
||||
host_alias=''
|
||||
host_cpu=''
|
||||
host_os=''
|
||||
host_vendor=''
|
||||
htmldir='${docdir}'
|
||||
includedir='${prefix}/include'
|
||||
infodir='${datarootdir}/info'
|
||||
install_sh=''
|
||||
libdir='${exec_prefix}/lib'
|
||||
libexecdir='${exec_prefix}/libexec'
|
||||
localedir='${datarootdir}/locale'
|
||||
localstatedir='${prefix}/var'
|
||||
mandir='${datarootdir}/man'
|
||||
mkdir_p=''
|
||||
oldincludedir='/usr/include'
|
||||
pdfdir='${docdir}'
|
||||
perlpath=''
|
||||
pkgconfigpath=''
|
||||
prefix='NONE'
|
||||
program_transform_name='s,x,x,'
|
||||
psdir='${docdir}'
|
||||
pythonpath=''
|
||||
runstatedir='${localstatedir}/run'
|
||||
sbindir='${exec_prefix}/sbin'
|
||||
sedpath=''
|
||||
sharedstatedir='${prefix}/com'
|
||||
sysconfdir='${prefix}/etc'
|
||||
target_alias=''
|
||||
unamepath=''
|
||||
xchatlibdir=''
|
||||
|
||||
## ----------- ##
|
||||
## confdefs.h. ##
|
||||
## ----------- ##
|
||||
|
||||
/* confdefs.h */
|
||||
#define PACKAGE_NAME "XChat"
|
||||
#define PACKAGE_TARNAME "xchat"
|
||||
#define PACKAGE_VERSION "2.8.8"
|
||||
#define PACKAGE_STRING "XChat 2.8.8"
|
||||
#define PACKAGE_BUGREPORT "http://www.xchat.org/"
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
configure: exit 1
|
|
@ -0,0 +1,684 @@
|
|||
#! /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-2020 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,'
|
||||
;;
|
||||
mingw* | cygwin* | pw32* | os2* | cegcc*)
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
case $cc_basename in
|
||||
ecc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
icc* | ifort*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
lf95*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
nagfor*)
|
||||
wl='-Wl,-Wl,,'
|
||||
;;
|
||||
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
ccc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
xl* | bgxl* | bgf* | mpixl*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
como)
|
||||
wl='-lopt='
|
||||
;;
|
||||
*)
|
||||
case `$CC -V 2>&1 | sed 5q` in
|
||||
*Sun\ F* | *Sun*Fortran*)
|
||||
wl=
|
||||
;;
|
||||
*Sun\ C*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
newsos6)
|
||||
;;
|
||||
*nto* | *qnx*)
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
rdos*)
|
||||
;;
|
||||
solaris*)
|
||||
case $cc_basename in
|
||||
f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
|
||||
wl='-Qoption ld '
|
||||
;;
|
||||
*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
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*)
|
||||
case "$host_cpu" in
|
||||
powerpc)
|
||||
;;
|
||||
m68k)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
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
|
||||
;;
|
||||
haiku*)
|
||||
;;
|
||||
interix[3-9]*)
|
||||
hardcode_direct=no
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-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*)
|
||||
case "$host_cpu" in
|
||||
powerpc)
|
||||
;;
|
||||
m68k)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
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 { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
dgux*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
freebsd2.[01]*)
|
||||
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=:
|
||||
;;
|
||||
*nto* | *qnx*)
|
||||
;;
|
||||
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*)
|
||||
case "$host_cpu" in
|
||||
powerpc*)
|
||||
library_names_spec='$libname$shrext' ;;
|
||||
m68k)
|
||||
library_names_spec='$libname.a' ;;
|
||||
esac
|
||||
;;
|
||||
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'
|
||||
;;
|
||||
freebsd[23].*)
|
||||
library_names_spec='$libname$shrext$versuffix'
|
||||
;;
|
||||
freebsd* | dragonfly*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
gnu*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
haiku*)
|
||||
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 | kopensolaris*-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'
|
||||
;;
|
||||
tpf*)
|
||||
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
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,829 @@
|
|||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT([XChat],[2.8.8],[http://www.xchat.org/],[xchat])
|
||||
|
||||
AC_PREREQ([2.71])
|
||||
AC_COPYRIGHT([Copyright (C) 1998-2010 Peter Zelezny])
|
||||
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_SRCDIR([configure.ac])
|
||||
|
||||
AM_INIT_AUTOMAKE([1.9 dist-bzip2 subdir-objects no-define])
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_CPP
|
||||
AM_PROG_AS
|
||||
AC_DISABLE_STATIC([])
|
||||
LT_INIT
|
||||
|
||||
dnl -----------------------------------------------------------
|
||||
dnl Language Support
|
||||
dnl -----------------------------------------------------------
|
||||
GETTEXT_PACKAGE=xchat
|
||||
AC_SUBST(GETTEXT_PACKAGE)
|
||||
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
|
||||
|
||||
ALL_LINGUAS="be ca cs de el es fi fr gl hu it ja kn ko lt mk nl pa pl pt ru sq sr sv th uk vi zh_CN zh_TW"
|
||||
AM_GNU_GETTEXT_VERSION(0.20)
|
||||
AM_GNU_GETTEXT([external])
|
||||
#USE_INCLUDED_LIBINTL="no"
|
||||
#AC_SUBST(USE_INCLUDED_LIBINTL)
|
||||
#BUILD_INCLUDED_LIBINTL="no"
|
||||
#AC_SUBST(BUILD_INCLUDED_LIBINTL)
|
||||
|
||||
dnl displaced from acconfig.h
|
||||
AH_VERBATIM([OLD_PERL],[#undef OLD_PERL])
|
||||
AH_VERBATIM([PREFIX],[#undef PREFIX])
|
||||
AH_VERBATIM([XCHATLIBDIR],[#undef XCHATLIBDIR])
|
||||
AH_VERBATIM([XCHATSHAREDIR],[#undef XCHATSHAREDIR])
|
||||
AH_VERBATIM([SOCKS],[#undef SOCKS])
|
||||
AH_VERBATIM([USE_MSPROXY],[#undef USE_MSPROXY])
|
||||
dnl AH_VERBATIM([USE_GNOME],[#undef USE_GNOME])
|
||||
AH_VERBATIM([USE_SHM],[#undef USE_SHM])
|
||||
AH_VERBATIM([USE_GTKSPELL],[#undef USE_GTKSPELL])
|
||||
AH_VERBATIM([USE_LIBSEXY],[#undef USE_LIBSEXY])
|
||||
AH_VERBATIM([USE_IPV6],[#undef USE_IPV6])
|
||||
AH_VERBATIM([USE_MMX],[#undef USE_MMX])
|
||||
AH_VERBATIM([USE_OPENSSL],[#undef USE_OPENSSL])
|
||||
AH_VERBATIM([USE_PLUGIN],[#undef USE_PLUGIN])
|
||||
AH_VERBATIM([USE_XFT],[#undef USE_XFT])
|
||||
AH_VERBATIM([USE_XLIB],[#undef USE_XLIB])
|
||||
AH_VERBATIM([USE_SIGACTION],[#undef USE_SIGACTION])
|
||||
AH_VERBATIM([USING_FREEBSD],[#undef USING_FREEBSD])
|
||||
AH_VERBATIM([USING_LINUX],[#undef USING_LINUX])
|
||||
AH_VERBATIM([socklen_t],[#undef socklen_t])
|
||||
AH_VERBATIM([USE_DBUS],[#undef USE_DBUS])
|
||||
|
||||
AC_PATH_PROG(sedpath, sed)
|
||||
if test "_$sedpath" = _; then
|
||||
AC_MSG_ERROR("Cannot find sed: I need it\!")
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(unamepath, uname)
|
||||
if test "_$unamepath" = _; then
|
||||
system="unknown"
|
||||
else
|
||||
AC_MSG_CHECKING(system type)
|
||||
system=`$unamepath -s`
|
||||
AC_MSG_RESULT($system)
|
||||
if test "$system" = "Linux"; then
|
||||
AC_DEFINE(USING_LINUX)
|
||||
fi
|
||||
if test "$system" = "FreeBSD"; then
|
||||
AC_DEFINE(USING_FREEBSD)
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** configure switches ***********************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
AC_ARG_ENABLE(socks,
|
||||
[ --enable-socks link with SOCKS5 library (default: no)],
|
||||
socks=$enableval, socks=no)
|
||||
|
||||
AC_ARG_ENABLE(ipv6,
|
||||
[ --enable-ipv6 enable IPv6 (default: no)],
|
||||
ipv6=$enableval, ipv6=no)
|
||||
|
||||
AC_ARG_ENABLE(xft,
|
||||
[ --enable-xft enable use of Xft directly (default: no)],
|
||||
xft=$enableval, xft=no)
|
||||
|
||||
AC_ARG_ENABLE(openssl,
|
||||
[ --enable-openssl[=PATH] enable use of openSSL],
|
||||
openssl=$enableval, openssl=yes)
|
||||
|
||||
AC_ARG_ENABLE(gtkfe,
|
||||
[ --disable-gtkfe disable building gtk frontend],
|
||||
gtkfe=$enableval, gtkfe=yes)
|
||||
|
||||
AC_ARG_ENABLE(textfe,
|
||||
[ --enable-textfe build the text frontend (default: no)],
|
||||
textfe=$enableval, textfe=no)
|
||||
|
||||
dnl AC_ARG_ENABLE(gnome,
|
||||
dnl [ --disable-gnome disable use of gnome],
|
||||
dnl gnome=$enableval, gnome=yes)
|
||||
|
||||
AC_ARG_ENABLE(xlib,
|
||||
[ --disable-xlib disable use of xlib (for non X11 systems)],
|
||||
xlib=$enableval, xlib=yes)
|
||||
|
||||
AC_ARG_ENABLE(python,
|
||||
[ --disable-python don't build the python plugin],
|
||||
python=$enableval, python=yes)
|
||||
|
||||
AC_ARG_ENABLE(perl,
|
||||
[ --disable-perl don't build the perl plugin],
|
||||
perl=$enableval, perl=yes)
|
||||
|
||||
AC_ARG_ENABLE(perl_old,
|
||||
[ --disable-perl_old no backwards compatibility for perl plugin],
|
||||
perl_old=$enableval, perl_old=yes)
|
||||
|
||||
AC_ARG_ENABLE(tcl,
|
||||
[ --enable-tcl[=PATH] directory with Tcl config file: tclConfig.sh],
|
||||
tcl=$enableval, tcl=yes)
|
||||
|
||||
AC_ARG_ENABLE(plugin,
|
||||
[ --disable-plugin disable plugin support],
|
||||
plugin=$enableval, plugin=yes)
|
||||
|
||||
AC_ARG_ENABLE(dbus,
|
||||
[ --disable-dbus disable DBUS support],
|
||||
dbus=$enableval, dbus=yes)
|
||||
|
||||
AC_ARG_ENABLE(mmx,
|
||||
[ --disable-mmx disable MMX assembly routines],
|
||||
mmx=$enableval, mmx=yes)
|
||||
|
||||
AC_ARG_ENABLE(shm,
|
||||
[ --enable-shm enable use of XShm for fast tinting (default: no)],
|
||||
shm=$enableval, shm=no)
|
||||
|
||||
AC_ARG_ENABLE(spell,
|
||||
[ --enable-spell=type enable spelling type: none static libsexy gtkspell],
|
||||
spell=$enableval, spell=libsexy)
|
||||
|
||||
AC_ARG_ENABLE(ntlm,
|
||||
[ --enable-ntlm enable Microsoft's NTLM auth (libntlm) library support (default: no)],
|
||||
ntlm=$enableval, ntlm=no)
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** GLIB *************************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
AM_PATH_GLIB_2_0(2.0.3, glib=yes, glib=no)
|
||||
if test "$glib" = no; then
|
||||
AC_MSG_ERROR("Cannot find glib")
|
||||
fi
|
||||
|
||||
COMMON_CFLAGS="$GLIB_CFLAGS"
|
||||
COMMON_LIBS="$GLIB_LIBS"
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** GTK **************************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
AM_PATH_GTK_2_0(2.10.0, havegtk=yes, havegtk=no)
|
||||
|
||||
if test "$havegtk" = no; then
|
||||
gtkfe=no
|
||||
echo
|
||||
echo Cannot find GTK\! Not building GTK FrontEnd.
|
||||
echo
|
||||
fi
|
||||
|
||||
if test "$gtkfe" != yes; then
|
||||
gnome=no
|
||||
COMMON_LIBS="$GLIB_LIBS"
|
||||
COMMON_CFLAGS="$GLIB_CFLAGS"
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** GNOME ************************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
GUI_LIBS="$GUI_LIBS $GTK_LIBS"
|
||||
GUI_CFLAGS="$GUI_CFLAGS $GTK_CFLAGS"
|
||||
|
||||
gnome=no
|
||||
#if test "$gnome" = yes; then
|
||||
# AC_PATH_PROG(pkgconfigpath, pkg-config)
|
||||
# AC_MSG_CHECKING(Gnome2 compile flags)
|
||||
# GNOME_CFLAGS="`$pkgconfigpath libgnome-2.0 --cflags 2>/dev/null`"
|
||||
# if test "_$GNOME_CFLAGS" = _ ; then
|
||||
# gnome=no
|
||||
# AC_MSG_RESULT([Gnome not found, building without it.])
|
||||
# else
|
||||
# GNOME_VER="`$pkgconfigpath libgnome-2.0 --modversion`"
|
||||
# GUI_LIBS="$GUI_LIBS `$pkgconfigpath libgnome-2.0 --libs`"
|
||||
# GUI_CFLAGS="$GUI_CFLAGS $GNOME_CFLAGS"
|
||||
# AC_DEFINE(USE_GNOME)
|
||||
# AC_MSG_RESULT(ok)
|
||||
# fi
|
||||
#fi
|
||||
|
||||
# GConf
|
||||
AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** XFT **************************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "$xft" = yes; then
|
||||
AC_PATH_PROG(pkgconfigpath, pkg-config)
|
||||
if $pkgconfigpath xft --exists; then
|
||||
GUI_CFLAGS="$GUI_CFLAGS `$pkgconfigpath xft --cflags`"
|
||||
GUI_LIBS="$GUI_LIBS `$pkgconfigpath xft --libs`"
|
||||
else
|
||||
xft=no
|
||||
oldCPPFLAGS=$CPPFLAGS
|
||||
CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
|
||||
AC_CHECK_HEADERS(X11/Xft/Xft.h, xft=yes)
|
||||
CPPFLAGS=$oldCPPFLAGS
|
||||
fi
|
||||
if test "$xft" = yes; then
|
||||
AC_DEFINE(USE_XFT)
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** XLIB *************************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "$xlib" = yes; then
|
||||
AC_DEFINE(USE_XLIB)
|
||||
if test "$system" = "SunOS"; then
|
||||
LIBS="$LIBS -L/usr/openwin/lib -lX11"
|
||||
else
|
||||
AC_CHECK_LIB(X11, XSetWMHints)
|
||||
fi
|
||||
else
|
||||
shm=no
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** PERL *************************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "$perl" = yes; then
|
||||
AC_PATH_PROG(perlpath, perl)
|
||||
AC_MSG_CHECKING(for Perl compile flags)
|
||||
PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null`
|
||||
if test "_$PERL_CFLAGS" = _ ; then
|
||||
AC_MSG_RESULT([not found, building without perl.])
|
||||
perl=no
|
||||
else
|
||||
PERL_LDFLAGS=`$perlpath -MExtUtils::Embed -e ldopts |$sedpath 's/-lgdbm //'`
|
||||
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-ldb //'`
|
||||
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lndbm //'`
|
||||
if test "$system" = "Linux"; then
|
||||
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lnsl //'`
|
||||
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lposix //'`
|
||||
fi
|
||||
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lc //'`
|
||||
AC_MSG_RESULT(ok)
|
||||
|
||||
# oldLIBS=$LIBS
|
||||
# LIBS="$LIBS $PERL_LDFLAGS"
|
||||
# AC_CHECK_FUNC(eval_pv)
|
||||
# AC_CHECK_FUNC(call_pv)
|
||||
# LIBS=$oldLIBS
|
||||
|
||||
AC_MSG_CHECKING(for perl >= 5.8.0)
|
||||
PERL_VER=`$perlpath -e 'print $]>= 5.008?"yes":"no"'`
|
||||
if test "$PERL_VER" = "yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_MSG_CHECKING(if perl plugin will be backward compatible)
|
||||
if test "$perl_old" = "yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(OLD_PERL)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
echo "perl version too old, building without perl."
|
||||
perl=no
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** PYTHON ***********************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "$python" = yes; then
|
||||
AC_PATH_PROG(pythonpath, python2)
|
||||
if test "_$pythonpath" = _ ; then
|
||||
AC_PATH_PROG(pythonpath, python)
|
||||
fi
|
||||
if test "_$pythonpath" = _ ; then
|
||||
python=no
|
||||
else
|
||||
AC_MSG_CHECKING(Python version)
|
||||
changequote(<<, >>)dnl
|
||||
PY_VER=`$pythonpath -c 'import distutils.sysconfig; print(distutils.sysconfig.get_config_vars("VERSION")[0]);'`
|
||||
PY_LIB=`$pythonpath -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(standard_lib=1));'`
|
||||
PY_INC=`$pythonpath -c 'import distutils.sysconfig; print(distutils.sysconfig.get_config_vars("INCLUDEPY")[0]);'`
|
||||
$pythonpath -c "import sys; map(int,sys.version[:3].split('.')) >= [2,2] or sys.exit(1)"
|
||||
changequote([, ])dnl
|
||||
AC_MSG_RESULT($PY_VER)
|
||||
if test "$?" != "1"; then
|
||||
AC_MSG_CHECKING(Python compile flags)
|
||||
PY_PREFIX=`$pythonpath -c 'import sys; print(sys.prefix)'`
|
||||
PY_EXEC_PREFIX=`$pythonpath -c 'import sys; print(sys.exec_prefix)'`
|
||||
if test -f $PY_INC/Python.h; then
|
||||
PY_LIBS="-L$PY_LIB/config -lpython$PY_VER -lpthread -lutil"
|
||||
PY_CFLAGS="-I$PY_INC"
|
||||
AC_MSG_RESULT(ok)
|
||||
else
|
||||
python=no
|
||||
AC_MSG_RESULT([Can't find Python.h])
|
||||
fi
|
||||
else
|
||||
echo "Python too old. Only 2.2 or above is supported."
|
||||
python=no
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** TCL **************************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
AC_MSG_CHECKING(for location of tclConfig.sh)
|
||||
dirs="$tcl /lib /usr/lib /usr/tcl/lib /usr/lib/tcl8.4 /usr/local/lib /usr/local/tcl-8.4/lib /usr/local/tcl/lib /opt/lib /usr/lib/tcl8.3"
|
||||
found=0
|
||||
if test "$tcl" != "no"; then
|
||||
tcl=no
|
||||
for try in $dirs; do
|
||||
if test -f $try/tclConfig.sh; then
|
||||
found=1
|
||||
. $try/tclConfig.sh
|
||||
TCL_LIBS="$TCL_LIB_SPEC $TCL_LIBS"
|
||||
TCL_CFLAGS="-I${TCL_PREFIX}/include $TCL_INCLUDE_SPEC"
|
||||
tcl=yes
|
||||
AC_MSG_RESULT($try/tclConfig.sh)
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test "$found" -eq 0 ; then
|
||||
AC_MSG_RESULT([tclConfig.sh not found - use the --enable-tcl option])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** IPv6 *************************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
dnl purely for Solaris
|
||||
AC_CHECK_FUNC(select, ,
|
||||
AC_CHECK_LIB(socket, select, ,
|
||||
AC_CHECK_LIB(nsl, select, ,
|
||||
AC_CHECK_LIB(inet, select, ,
|
||||
AC_CHECK_LIB(cposix, select, ,
|
||||
AC_CHECK_LIB(net, select, ,
|
||||
AC_MSG_WARN(i can not find select. you might need to help me)))))))
|
||||
AC_CHECK_LIB(socket, select)
|
||||
|
||||
if test "$ipv6" = yes; then
|
||||
AC_CHECK_FUNCS(getaddrinfo, have_getaddrinfo=yes)
|
||||
AC_MSG_CHECKING(whether to enable IPv6 support)
|
||||
if test "$have_getaddrinfo" = yes; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_IPV6)
|
||||
else
|
||||
ipv6=no
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** OPENSSL **********************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
retry=no
|
||||
if test "$openssl" != no; then
|
||||
AC_PATH_PROG(pkgconfigpath, pkg-config)
|
||||
AC_MSG_CHECKING(for openssl through pkg-config)
|
||||
if $pkgconfigpath openssl --exists; then
|
||||
CPPFLAGS="$CPPFLAGS `$pkgconfigpath openssl --cflags`"
|
||||
LIBS="$LIBS `$pkgconfigpath openssl --libs`"
|
||||
AC_DEFINE(USE_OPENSSL)
|
||||
AC_MSG_RESULT(yes)
|
||||
openssl=yes
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
retry=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$retry" = "yes"; then
|
||||
unset openssl_path ac_cv_lib_ssl_SSL_new ac_cv_header_openssl_ssl_h
|
||||
if test "$openssl" != yes; then
|
||||
openssl_path=$openssl
|
||||
fi
|
||||
openssl=no
|
||||
SAVED_LIBS=$LIBS
|
||||
LIBS="$LIBS -lcrypto"
|
||||
if test -n "$openssl_path"; then
|
||||
LIBS="-L$openssl_path/lib $LIBS"
|
||||
fi
|
||||
AC_CHECK_LIB(ssl, SSL_new, have_openssl=yes)
|
||||
LIBS=$SAVED_LIBS
|
||||
if test "$have_openssl" = yes; then
|
||||
SAVED_CPPFLAGS=$CPPFLAGS
|
||||
if test -n "$openssl_path"; then
|
||||
CPPFLAGS="-I$openssl_path/include $CPPFLAGS"
|
||||
fi
|
||||
AC_CHECK_HEADERS(openssl/ssl.h, have_openssl_h=yes)
|
||||
if test "$have_openssl_h" = yes; then
|
||||
openssl=yes
|
||||
AC_DEFINE(USE_OPENSSL)
|
||||
LIBS="$LIBS -lssl -lcrypto"
|
||||
if test -n "$openssl_path"; then
|
||||
LIBS="-L$openssl_path/lib $LIBS"
|
||||
fi
|
||||
else
|
||||
CPPFLAGS=$SAVED_CPPFLAGS
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** PLUGIN ***********************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "$plugin" = yes; then
|
||||
AC_CHECK_FUNCS(dlopen, have_dl=yes)
|
||||
if test "$have_dl" != yes; then
|
||||
AC_CHECK_LIB(dl, dlopen, have_dl=yes)
|
||||
if test "$have_dl" = yes; then
|
||||
LIBS="$LIBS -ldl"
|
||||
fi
|
||||
fi
|
||||
if test "$have_dl" = yes; then
|
||||
AC_DEFINE(USE_PLUGIN)
|
||||
AC_PATH_PROG(pkgconfigpath, pkg-config)
|
||||
RDYNAMIC_FLAGS="`$pkgconfigpath gmodule-2.0 --libs`"
|
||||
LIBS="$LIBS $RDYNAMIC_FLAGS"
|
||||
if test "$LD" = ""; then
|
||||
VS="`ld --help | grep version-script 2> /dev/null`"
|
||||
else
|
||||
VS="`$LD --help | grep version-script 2> /dev/null`"
|
||||
fi
|
||||
if test "$VS" != ""; then
|
||||
GUI_LIBS="$GUI_LIBS -Wl,--version-script,\$(srcdir)/../version-script"
|
||||
fi
|
||||
else
|
||||
plugin=no
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl #######################################################################
|
||||
dnl # Check for DBUS libraries
|
||||
dnl #######################################################################
|
||||
|
||||
if test "x$dbus" = "xyes" ; then
|
||||
PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60 dbus-glib-1 >= 0.60 gthread-2.0], dbus=yes, [
|
||||
AC_MSG_RESULT(no)
|
||||
dbus=no
|
||||
])
|
||||
AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool, no)
|
||||
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal, no)
|
||||
if test "x$DBUS_BINDING_TOOL" = "xno" || test "x$GLIB_GENMARSHAL" = "xno" || test "x$dbus" = "xno" ; then
|
||||
dbus="no"
|
||||
else
|
||||
COMMON_LIBS="$COMMON_LIBS $DBUS_LIBS"
|
||||
COMMON_CFLAGS="$COMMON_CFLAGS $DBUS_CFLAGS"
|
||||
AC_DEFINE(USE_DBUS)
|
||||
AS_AC_EXPAND(DATADIR, $datadir)
|
||||
|
||||
DBUS_SERVICES_DIR="$DATADIR/dbus-1/services"
|
||||
AC_SUBST(DBUS_SERVICES_DIR)
|
||||
AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir for DBUS is])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** SPELL ************************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "$spell" = "gtkspell" ; then
|
||||
PKG_CHECK_MODULES(GTKSPELL, gtkspell-2.0 >= 2.0.2, [], [
|
||||
AC_MSG_RESULT(no)
|
||||
spell=no
|
||||
])
|
||||
if test "$spell" != "no" ; then
|
||||
GUI_LIBS="$GUI_LIBS $GTKSPELL_LIBS"
|
||||
GUI_CFLAGS="$GUI_CFLAGS $GTKSPELL_CFLAGS"
|
||||
AC_DEFINE(USE_GTKSPELL)
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$spell" = "libsexy" ; then
|
||||
PKG_CHECK_MODULES([LIBSEXY], [libsexy >= 0.1.8], libsexy=yes, AC_MSG_RESULT(no))
|
||||
if test "$libsexy" = "yes" ; then
|
||||
GUI_LIBS="$GUI_LIBS $LIBSEXY_LIBS"
|
||||
GUI_CFLAGS="$GUI_CFLAGS $LIBSEXY_CFLAGS"
|
||||
AC_DEFINE(USE_LIBSEXY)
|
||||
else
|
||||
dnl use builtin static one
|
||||
spell="static"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$spell" = "static" ; then
|
||||
AC_DEFINE(USE_LIBSEXY)
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** CONDITIONALS *****************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
AM_CONDITIONAL(USE_OPENSSL, test "x$openssl" = "xyes")
|
||||
AM_CONDITIONAL(USE_LIBSEXY, test "x$spell" = "xstatic")
|
||||
AM_CONDITIONAL(DO_TEXT, test "x$textfe" = "xyes")
|
||||
AM_CONDITIONAL(DO_GTK, test "x$gtkfe" = "xyes")
|
||||
AM_CONDITIONAL(DO_PERL, test "x$perl" = "xyes")
|
||||
AM_CONDITIONAL(DO_PYTHON, test "x$python" = "xyes")
|
||||
AM_CONDITIONAL(DO_TCL, test "x$tcl" = "xyes")
|
||||
AM_CONDITIONAL(DO_PLUGIN, test "x$plugin" = "xyes")
|
||||
AM_CONDITIONAL(USE_DBUS, test "x$dbus" = "xyes")
|
||||
AM_CONDITIONAL(DO_GCONF, test "x$GCONFTOOL" != "xno")
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** SOCKS5 ***********************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "$socks" = yes; then
|
||||
socks=no
|
||||
AC_CHECK_LIB(socks5, SOCKSconnect, have_socks=yes)
|
||||
if test "$have_socks" = yes; then
|
||||
AC_CHECK_HEADERS(socks.h, have_socks_h=yes)
|
||||
if test "$have_socks_h" = yes; then
|
||||
socks=yes
|
||||
AC_DEFINE(SOCKS)
|
||||
LIBS="$LIBS -lsocks5"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** MS PROXY *********************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
have_ntlm="no"
|
||||
if test "x$ntlm" = "xyes" ; then
|
||||
have_ntlm="no"
|
||||
AC_CHECK_LIB(ntlm, ntlm_smb_encrypt, have_ntlm=yes)
|
||||
if test "$have_ntlm" = yes; then
|
||||
LIBS="$LIBS -lntlm"
|
||||
AC_DEFINE(USE_MSPROXY)
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** XShm *************************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "$shm" = yes; then
|
||||
oldl=$LIBS
|
||||
oldc=$CPPFLAGS
|
||||
LIBS="$LIBS `$pkgconfigpath --libs-only-L xft`"
|
||||
CPPFLAGS="$CPPFLAGS `$pkgconfigpath --cflags-only-I xft`"
|
||||
shm=no
|
||||
AC_CHECK_LIB(Xext, XShmAttach, shm=yes)
|
||||
if test "$shm" = yes; then
|
||||
shm=no
|
||||
AC_CHECK_HEADERS(sys/ipc.h, shm=yes)
|
||||
if test "$shm" = yes; then
|
||||
shm=no
|
||||
AC_CHECK_HEADERS(sys/shm.h, shm=yes)
|
||||
fi
|
||||
fi
|
||||
|
||||
LIBS=$oldl
|
||||
if test "$shm" = yes; then
|
||||
GUI_LIBS="$GUI_LIBS `$pkgconfigpath --libs-only-L xft` -lX11 -lXext"
|
||||
AC_DEFINE(USE_SHM)
|
||||
else
|
||||
CPPFLAGS=$oldc
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** MMX **************************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
dnl we don't need mmx on *this* machine, just i386, because
|
||||
dnl it's checked at runtime.
|
||||
if test "$mmx" = "yes"; then
|
||||
case $host_cpu in
|
||||
i386|i486|i586|i686|i786|k6|k7)
|
||||
mmx=yes
|
||||
;;
|
||||
*)
|
||||
mmx=no
|
||||
esac
|
||||
if test "$system" = "OpenBSD"; then
|
||||
dnl openbsd fails because mmx_cmod doesn't prefix its symbols with underscore.
|
||||
dnl xtext.o: Undefined symbol `_shade_ximage_15_mmx' referenced from text segment
|
||||
mmx=no
|
||||
fi
|
||||
if test "$mmx" = "yes"; then
|
||||
AC_DEFINE(USE_MMX)
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(USE_MMX, test "$mmx" = "yes")
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** GCC FLAGS ********************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
dnl Only use -Wall and -pipe if we have gcc
|
||||
if test "x$GCC" = "xyes"; then
|
||||
if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
|
||||
CFLAGS="$CFLAGS -Wall"
|
||||
fi
|
||||
if test "$system" = "Linux" -o "$system" = "FreeBSD"; then
|
||||
if test -z "`echo "$CFLAGS" | grep "\-pipe" 2> /dev/null`" ; then
|
||||
CFLAGS="$CFLAGS -pipe"
|
||||
fi
|
||||
fi
|
||||
if test -z "`echo "$CFLAGS" | grep "\-g " 2> /dev/null`" ; then
|
||||
CFLAGS="$CFLAGS -g"
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl does this compiler support -Wno-pointer-sign ?
|
||||
AC_MSG_CHECKING([if gcc accepts -Wno-pointer-sign ])
|
||||
|
||||
safe_CFLAGS=$CFLAGS
|
||||
CFLAGS="-Wno-pointer-sign"
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
|
||||
int main () { return 0 ; }
|
||||
]])],[
|
||||
no_pointer_sign=yes
|
||||
AC_MSG_RESULT([yes])
|
||||
],[
|
||||
no_pointer_sign=no
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
CFLAGS=$safe_CFLAGS
|
||||
|
||||
if test x$no_pointer_sign = xyes; then
|
||||
CFLAGS="$CFLAGS -Wno-pointer-sign"
|
||||
fi
|
||||
|
||||
dnl does this compiler support -funsigned-char ?
|
||||
AC_MSG_CHECKING([if gcc accepts -funsigned-char ])
|
||||
|
||||
safe_CFLAGS=$CFLAGS
|
||||
CFLAGS="-funsigned-char"
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
|
||||
int main () { return 0 ; }
|
||||
]])],[
|
||||
unsigned_char=yes
|
||||
AC_MSG_RESULT([yes])
|
||||
],[
|
||||
unsigned_char=no
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
CFLAGS=$safe_CFLAGS
|
||||
|
||||
if test x$unsigned_char = xyes; then
|
||||
CFLAGS="$CFLAGS -funsigned-char"
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** FUNCTIONS/LIBS/CFLAGS ********************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
AC_MSG_CHECKING(for modern sigaction)
|
||||
dnl libc5 on linux and FreeBSD 3.x doesn't have siginfo_t
|
||||
dnl and the sa_sigation field.
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], [[struct sigaction act;
|
||||
siginfo_t *si;
|
||||
act.sa_sigaction = 0;]])],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_SIGACTION)
|
||||
],[AC_MSG_RESULT(no)])
|
||||
|
||||
AC_PATH_PROG(gdkpixbufcsourcepath, gdk-pixbuf-csource)
|
||||
AC_SUBST(gdkpixbufcsourcepath)
|
||||
if test "$gtkfe" != no -a "_$gdkpixbufcsourcepath" = _; then
|
||||
AC_MSG_ERROR("Cannot find gdk-pixbuf-csource: Install GTK+ 2.0\!")
|
||||
fi
|
||||
|
||||
dnl if we don't have this, use g_snprintf instead
|
||||
AC_CHECK_FUNCS(snprintf vsnprintf memrchr strtoull)
|
||||
|
||||
AC_CHECK_FUNC(gethostbyname, ,
|
||||
AC_CHECK_LIB(resolv, gethostbyname, ,
|
||||
AC_CHECK_LIB(nsl, gethostbyname)))
|
||||
|
||||
AC_CHECK_FUNC(gethostname, , AC_CHECK_LIB(nsl, gethostname))
|
||||
|
||||
dnl necessary for IRIX
|
||||
AC_CHECK_HEADERS(strings.h)
|
||||
|
||||
dnl Check for type in sys/socket.h - from Squid source (GPL)
|
||||
AC_CACHE_CHECK(for socklen_t, ac_cv_type_socklen_t, [
|
||||
AC_EGREP_CPP([socklen_t[^a-zA-Z_0-9]], [#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#if STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#endif],
|
||||
ac_cv_type_socklen_t=yes,
|
||||
ac_cv_type_socklen_t=no)
|
||||
])
|
||||
if test $ac_cv_type_socklen_t = no; then
|
||||
AC_DEFINE(socklen_t, int)
|
||||
fi
|
||||
|
||||
dnl Mac OS X and Darwin use lookupd, which caches DNS queries by default
|
||||
AC_EGREP_CPP(lookupd, dnl
|
||||
[#if (defined(__APPLE__) && defined(__MACH__))
|
||||
lookupd
|
||||
#endif], AC_DEFINE([LOOKUPD],1,[Define to 1 if the system uses lookupd]))
|
||||
|
||||
dnl freebsd needs this
|
||||
LIBS="$LIBS $INTLLIBS"
|
||||
CFLAGS="$CFLAGS $CPPFLAGS"
|
||||
|
||||
GUI_LIBS="$GUI_LIBS $COMMON_LIBS"
|
||||
|
||||
dnl make these visible to all Makefiles
|
||||
AC_SUBST(GUI_LIBS)
|
||||
AC_SUBST(GUI_CFLAGS)
|
||||
AC_SUBST(COMMON_LIBS)
|
||||
AC_SUBST(COMMON_CFLAGS)
|
||||
AC_SUBST(PERL_CFLAGS)
|
||||
AC_SUBST(PERL_LDFLAGS)
|
||||
AC_SUBST(PY_CFLAGS)
|
||||
AC_SUBST(PY_LIBS)
|
||||
AC_SUBST(TCL_LIBS)
|
||||
AC_SUBST(TCL_CFLAGS)
|
||||
AC_SUBST(DBUS_CFLAGS)
|
||||
AC_SUBST(DBUS_LIBS)
|
||||
|
||||
|
||||
PLUGIN_INCLUDES='-I$(top_srcdir)/plugins'
|
||||
AC_SUBST(PLUGIN_INCLUDES)
|
||||
|
||||
dnl for plugin.c and pixmaps.c
|
||||
test "x$prefix" = xNONE && prefix="$ac_default_prefix"
|
||||
test "x$exec_prefix" = xNONE && exec_prefix="$prefix"
|
||||
|
||||
AC_DEFINE_UNQUOTED(PREFIX, "${prefix}")
|
||||
|
||||
XCHATLIBDIR=`eval echo ${libdir}/xchat`
|
||||
AC_DEFINE_UNQUOTED(XCHATLIBDIR, "$XCHATLIBDIR")
|
||||
|
||||
XCHATSHAREDIR=`eval echo ${datadir}`
|
||||
AC_DEFINE_UNQUOTED(XCHATSHAREDIR, "$XCHATSHAREDIR")
|
||||
|
||||
dnl for plugins/xxx/Makefile.am
|
||||
xchatlibdir=${libdir}/xchat
|
||||
AC_SUBST(xchatlibdir)
|
||||
|
||||
#AC_CONFIG_FILES([ po/Makefile.in
|
||||
#intl/Makefile
|
||||
AC_CONFIG_FILES([ Makefile
|
||||
src/Makefile
|
||||
src/common/Makefile
|
||||
src/common/dbus/Makefile
|
||||
src/fe-text/Makefile
|
||||
src/fe-gtk/Makefile
|
||||
src/pixmaps/Makefile
|
||||
plugins/Makefile
|
||||
plugins/python/Makefile
|
||||
plugins/perl/Makefile
|
||||
plugins/tcl/Makefile
|
||||
po/Makefile.in
|
||||
])
|
||||
AC_OUTPUT
|
||||
|
||||
echo
|
||||
echo xchat $VERSION
|
||||
echo
|
||||
echo Building GTK+ Interface .... : $gtkfe
|
||||
echo Building TEXT Interface .... : $textfe
|
||||
echo
|
||||
echo PLUGINS: Perl: $perl Python: $python TCL: $tcl
|
||||
echo
|
||||
echo mmx tinting ......... : $mmx\ spelling .............. : $spell
|
||||
echo XShm tinting ........ : $shm\ plugin interface ...... : $plugin
|
||||
if test "$xft" = no; then
|
||||
echo text backend ........ : pango\ nls/gettext ........... : $USE_NLS
|
||||
else
|
||||
echo text backend ........ : xft\ nls/gettext ........... : $USE_NLS
|
||||
fi
|
||||
echo openssl support ..... : $openssl\ ipv6 support .......... : $ipv6
|
||||
echo dbus support ........ : $dbus\ msproxy ntlm \(ISA\) .... : $have_ntlm
|
||||
echo
|
||||
echo The binary will be installed in $prefix/bin
|
||||
echo
|
||||
|
||||
if test "$gtkfe" = no; then
|
||||
echo Warning: The GTK \(GUI\) frontend will not be built.
|
||||
echo
|
||||
fi
|
||||
|
||||
if test "$spell" = "gtkspell"; then
|
||||
echo Warning: GTK SPELL is not the recommended spelling library.
|
||||
echo
|
||||
fi
|
||||
|
||||
echo configure complete, now type \'make\' and pray.
|
||||
echo
|
|
@ -0,0 +1,537 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html><head>
|
||||
<title>XCHAT FAQ</title>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
background-color: #FFFBF0;
|
||||
}
|
||||
h2 { color: #336701;
|
||||
background-color: #F4F0E5;
|
||||
}
|
||||
h3 { color: #005A9C;
|
||||
background-color: #F0EAE1;
|
||||
}
|
||||
a:link { color: blue; }
|
||||
p { margin: 3% }
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>X-Chat 2.8 Frequently Asked Questions</h1>
|
||||
|
||||
<h2>1. Section One: Compiling and Installing.</h2>
|
||||
<p>
|
||||
<a href="#q11">1. I get this error: /bin/sh: no: command not found</a>
|
||||
<br><br>
|
||||
<a href="#q12">2. How do I compile X-Chat on my Sun OS system?</a>
|
||||
<br><br>
|
||||
</p>
|
||||
|
||||
<h2>2. Section Two: Using X-Chat.</h2>
|
||||
<p>
|
||||
<a href="#q21">1. How do I enable identd in X-Chat? (How do I get rid of the ~ in front of my username?)</a>
|
||||
<br><br>
|
||||
<a href="#q22">2. How do I auto join more than one channel with keys?</a>
|
||||
<br><br>
|
||||
<a href="#q23">3. How do I autoconnect and join a channel when X-Chat loads?</a>
|
||||
<br><br>
|
||||
<a href="#q24">4. How do I cut and paste in X-Chat?</a>
|
||||
<br><br>
|
||||
<a href="#q25">5. How do I connect through a proxy?</a>
|
||||
<br><br>
|
||||
<a href="#q26">6. How do I show @ and + in front of nicknames that are Op and Voice when they talk?</a>
|
||||
<br><br>
|
||||
<a href="#q27">7. How do I change the Op and Voice userlist icons and Tree View icons?</a>
|
||||
<br><br>
|
||||
<a href="#q28">8. How do I set different ban types?</a>
|
||||
<br><br>
|
||||
<a href="#q29">9. Why can't I see accented-letters/umlauts/upper-ascii-chars in X-Chat?</a>
|
||||
<br><br>
|
||||
<a href="#q210">10. Why does the timestamp overlap some nicknames?</a>
|
||||
<br><br>
|
||||
<a href="#q211">11. How do I turn on Conference mode where I will not see join or part messages?</a>
|
||||
<br><br>
|
||||
<a href="#q212">12. How can I run the /dccserver command?</a>
|
||||
<br><br>
|
||||
<a href="#q213">13. Why doesn't DCC send work behind a router (IPNat/ADSL)?</a>
|
||||
<br><br>
|
||||
<a href="#q214">14. How do I execute multiple commands in one line?</a>
|
||||
<br><br>
|
||||
<a href="#q215">15. How do I enable Emacs key bindings in XChat?</a>
|
||||
<br><br>
|
||||
<a href="#q216">16. I get this error: "Unknown file type abc.yz. Maybe you need to install the Perl or Python plugin?"</a>
|
||||
<br><br>
|
||||
<a href="#q217">17. How do I play sound files on certain events?</a>
|
||||
<br><br>
|
||||
<a href="#q218">18. How do I auto-load scripts at startup?</a>
|
||||
<br><br>
|
||||
<a href="#q219">19. How do I minimize X-Chat to the System Tray (Notification Area)?</a>
|
||||
<br><br>
|
||||
<a href="#q220">20. Can I select and copy text with the time stamps?</a>
|
||||
<br><br>
|
||||
<a href="#q221">21. What's the deal with opening URLs in XChat on Linux/Unix?</a>
|
||||
<br><br>
|
||||
<a href="#q222">22. Where are the log files saved to?</a>
|
||||
<br><br>
|
||||
<a href="#q223">23. How do I rotate log files every so often?</a>
|
||||
<br><br>
|
||||
<a href="#q224">24. How do I enable graphical smilies (emoticons)?</a>
|
||||
<br><br>
|
||||
</p>
|
||||
|
||||
<h2>3. Section Three: Contributions, Development and Bugs.</h2>
|
||||
<p>
|
||||
<a href="#q31">1. Why does X-Chat leak so much memory?</a>
|
||||
<br><br>
|
||||
<a href="#q32">2. My copy of X-Chat crashes, what can I do?</a>
|
||||
<br><br>
|
||||
<a href="#q33">3. Can I write a new language translation for X-Chat?</a>
|
||||
</p>
|
||||
|
||||
<br><br>
|
||||
|
||||
<h2>1. Section One: Compiling and Installing.</h2>
|
||||
|
||||
<br><h3><a name="q11">1. I get this error: /bin/sh: no: command not found</a></h3>
|
||||
<p>
|
||||
If you get an error something like:
|
||||
</p>
|
||||
<blockquote><pre>
|
||||
Making all in po
|
||||
make[2]: Entering directory `/home/zed/xchat/files/xchat-1.8.7/po'
|
||||
file=./`echo ca | sed 's,.*/,,'`.gmo \
|
||||
&& rm -f $file && PATH=../src:$PATH no -o $file ca.po
|
||||
/bin/sh: no: command not found
|
||||
make[2]: *** [ca.gmo] Error 127
|
||||
make[2]: Leaving directory `/home/zed/xchat/files/xchat-1.8.7/po'
|
||||
make[1]: *** [all-recursive] Error 1
|
||||
make[1]: Leaving directory `/home/zed/xchat/files/xchat-1.8.7'
|
||||
make: *** [all-recursive-am] Error 2
|
||||
</pre></blockquote>
|
||||
<p>
|
||||
It means you don't have GNU gettext installed. There are two solutions:
|
||||
</p>
|
||||
<ul>
|
||||
<li>Install GNU gettext and try again.</li>
|
||||
<li>Use <i>./configure --disable-nls</i>. This will disable foreign
|
||||
language support and all menus and GUI will be in English only.</li>
|
||||
</ul>
|
||||
|
||||
<br><h3><a name="q12">2. How do I compile X-Chat on my Sun OS system?</a></h3>
|
||||
<p>
|
||||
X-Chat uses GNU gettext which in turn requires gmake, either install that
|
||||
and or use ./configure --disable-nls with Sun's own make.
|
||||
</p>
|
||||
|
||||
<br><h2>2. Section Two: Using X-Chat.</h2>
|
||||
|
||||
<br><h3><a name="q21">1. How do I enable identd in X-Chat?</a></h3>
|
||||
<p>
|
||||
<u>UNIX:</u><br>
|
||||
Identd isn't actually apart of X-Chat. You will need to download and install
|
||||
your own ident server. Most distributions, including Fedora, come with an
|
||||
ident server program called oidentd. Make sure it is enabled in
|
||||
/etc/xinetd.conf or read you distribution's documentation.
|
||||
|
||||
As an alternative, you can try this experimental identd server: <a href="http://xchat.org/auth/">xchat_auth</a>
|
||||
|
||||
<br><br><u>WINDOWS:</u><br>
|
||||
The win32 version of X-Chat comes with a built-in identd server. It is
|
||||
enabled by default, but can be disabled with <i>/set identd 0</i>.
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q22">2. How do I auto join more than one channel with keys?</a></h3>
|
||||
<p>
|
||||
In the Server list's channel column enter multiple channels and separate
|
||||
them by commas, eg: "#linux,#warez,#chat". Do not put spaces between the
|
||||
channels. If the channels also have keys (passwords), then the syntax is:
|
||||
"#channel1,#channel2,#channel3 key1,key2,key3"
|
||||
</p>
|
||||
<p>
|
||||
Example: If you want to join #abc and #talk without keys, but #linux with
|
||||
a key of "secret", you would enter: "#linux,#abc,#talk secret".
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q23">3. How do I autoconnect and join a channel when X-Chat loads?</a></h3>
|
||||
<p>
|
||||
In the Server list, select the Network you want to auto-connect to, click Edit
|
||||
and turn ON the "Auto connect to this network at startup" checkbox.
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q24">4. How do I cut and paste in X-Chat?</a></h3>
|
||||
<p>
|
||||
It's exactly the same as any other X application. You simply mark the text
|
||||
you want, and then press middle mouse button to paste (if you only have a
|
||||
2 button mouse, press left and right buttons at once).
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q25">5. How do I connect through a proxy?</a></h3>
|
||||
<p>
|
||||
Go to the menus, Settings -> Preferences -> Network Setup and fill in the requested
|
||||
information there. Authentication (using a username and password) is
|
||||
only supported for HTTP and Socks5.
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q26">6. How do I show @ and + in front of nicknames that are Op and Voice when they talk?</a></h3>
|
||||
<p>
|
||||
To display @ and + characters next to nicknames as they talk, do the following:
|
||||
</p>
|
||||
<p>
|
||||
In the menus, open up Settings -> Advanced -> Text Events. Find the
|
||||
<i>Channel Message</i> event in the list. The $3 code can be inserted to
|
||||
print the user's mode-character (e.g. @ or +). For example, you might want
|
||||
to change the default:
|
||||
|
||||
<br><br>%C18%H<%H$4$1%H>%H%O$t$2<br><br>To:
|
||||
<br><br>%C18%H<%H$4<b>$3</b>$1%H>%H%O$t$2
|
||||
<br><br>Don't forget to press Enter, so the changes take effect in the
|
||||
list at the top of the window.
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q27">7. How do I change the Op and Voice userlist icons and Tree View icons?</a></h3>
|
||||
<p>
|
||||
<u>Unix/Linux</u>
|
||||
<br>The default icons are hard coded (compiled) in. You can override them by creating
|
||||
some PNG files in ${PREFIX}/share/xchat. ${PREFIX} is usually /usr, so that
|
||||
would translate to /usr/share/xchat. If you compiled from source tarball without
|
||||
specifying a prefix, it will be /usr/local instead.
|
||||
<br>
|
||||
<br>
|
||||
<u>Windows</u>
|
||||
<br>Your own custom icons can be placed in C:\Program Files\XChat\Icons. Image format
|
||||
may be PNG or ICO. PNG support on Windows 2000 may require installing GDI+, but it's
|
||||
standard on XP or newer.
|
||||
</p>
|
||||
|
||||
<blockquote>
|
||||
<table border="1" cellpadding="3" rules="all">
|
||||
<tr bgcolor="#dddddd"><td>Name</td><td>Description</td></tr>
|
||||
<tr><td>op.png</td><td>Userlist: Op</td></tr>
|
||||
<tr><td>hop.png</td><td>Userlist: Half-Op</td></tr>
|
||||
<tr><td>voice.png</td><td>Userlist: Voice</td></tr>
|
||||
<tr><td>red.png</td><td>Userlist: Owner</td></tr>
|
||||
<tr><td>purple.png</td><td>Userlist: Founder</td></tr>
|
||||
<tr><td></td><td></td></tr>
|
||||
<tr><td>server.png</td><td>Tree: Server</td></tr>
|
||||
<tr><td>channel.png</td><td>Tree: Channel</td></tr>
|
||||
<tr><td>dialog.png</td><td>Tree: Dialog/Query</td></tr>
|
||||
<tr><td>util.png</td><td>Tree: Utility (Channel List, DCC etc)</td></tr>
|
||||
<tr><td></td><td></td></tr>
|
||||
<tr><td>message.png</td><td>Tray: Message</td></tr>
|
||||
<tr><td>highlight.png</td><td>Tray: Highlighted Message</td></tr>
|
||||
<tr><td>fileoffer.png</td><td>Tray: DCC</td></tr>
|
||||
<tr><td></td><td></td></tr>
|
||||
<tr><td>xchat.png</td><td>Main XChat icon</td></tr>
|
||||
</table>
|
||||
</blockquote>
|
||||
|
||||
<br><b>Tree View icons</b>: Type <b>/set tab_icons 1</b> to enable them and then restart XChat.
|
||||
<br>
|
||||
|
||||
<br><h3><a name="q28">8. How do I set different ban types?</a></h3>
|
||||
<p>
|
||||
Three ways:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
Right click the nickname in the userlist, and choose a ban type from the
|
||||
"Kick/Ban" submenu.
|
||||
</li>
|
||||
<li>
|
||||
You can also do it manually:
|
||||
|
||||
/ban <nick> <ban type>
|
||||
|
||||
where the <ban type> is a number from 0 to 3.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
/set irc_ban_type <ban type>
|
||||
sets the default ban type to use for all bans. The different types are:
|
||||
|
||||
<ul>
|
||||
<li>0 *!*@*.host</li>
|
||||
<li>1 *!*@domain</li>
|
||||
<li>2 *!*user@*.host</li>
|
||||
<li>3 *!*user@domain</li>
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<br><h3><a name="q29">9. Why can't I see accented-letters/umlauts/upper-ascii-chars in X-Chat?</a></h3>
|
||||
<p>
|
||||
Refer to <a href="http://xchat.org/encoding/">http://xchat.org/encoding/</a>.<br>
|
||||
Note: Log files are always written in UTF-8/Unicode.
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q210">10. Why does the timestamp overlap some nicknames?</a></h3>
|
||||
<p>
|
||||
Some networks allow very long nicknames (up to 32 letters). It can be annoying to have
|
||||
the separator bar move too far to the right, just for one long nick. Therefore, it has
|
||||
a set limit for the distance it will move to the right. If you use a large font, you
|
||||
may need to adjust this distance. It is set in pixels, for example:
|
||||
</p>
|
||||
<blockquote><pre>
|
||||
/set text_max_indent 320
|
||||
</pre></blockquote>
|
||||
|
||||
<p>
|
||||
Once you adjust this setting high enough, overlapping timestamps and nicknames should
|
||||
not occur. The adjustment will not take effect immediately, a restart may be needed.
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q211">11. How do I turn on Conference mode where I will not see join or part messages?</a></h3>
|
||||
<p>
|
||||
Right-click on the tab you want to change. In the submenu of the channel
|
||||
name, there's a toggle-item "Show join/part messages", simply turn this off.
|
||||
</p><p>If you want to turn this option on globally, type:</p>
|
||||
<blockquote><pre>/set irc_conf_mode 1</pre></blockquote>
|
||||
<p>Then all channels you join after setting this will start with "Show join/part messages" turned off.</p>
|
||||
|
||||
<br><h3><a name="q212">12. How can I run the /dccserver command?</a></h3>
|
||||
<p>
|
||||
In short you can not do this (easily). This is a mIRC only proprietary feature
|
||||
that is quite nonstandard. There is no code for doing this, mainly because
|
||||
/dccserver runs on port 59 which in turn would require running X-Chat as
|
||||
root. Why do you need this anyway? Just use normal DCC.
|
||||
<br><br>
|
||||
Unofficial unix <a href="http://dfx.at/xchat/">patches are available here</a>.
|
||||
<br><br><u><b>Update</b></u>: DCC Server feature has been added in the official Windows release 2.4.1b.
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q213">13. Why doesn't DCC send work behind a router (IPNat/ADSL)?</a></h3>
|
||||
<p>
|
||||
If you are behind a IP-NAT or ADSL router, you will most likely have
|
||||
an address like 192.168.0.1. This address is not usable on the Internet, and
|
||||
must be translated.
|
||||
</p><p>
|
||||
When offering a DCC file, xchat will tell the receiver your address. If it says
|
||||
192.168.0.1, the receiver will not be able to connect. One way to make it send
|
||||
your "real" address is to enable the "Get my IP from IRC Server" option in xchat.
|
||||
This option is available in Preferences -> File Transfers. When you turn it
|
||||
ON, you will have to re-login to the server before it'll take effect.
|
||||
</p><p>
|
||||
You will also need to forward some ports for use in DCC send. You may pick almost
|
||||
any port range you wish, for example, in xchat set:
|
||||
</p>
|
||||
<pre> <b>First DCC send port</b>: 4990
|
||||
<b>Last DCC send port</b>: 5000
|
||||
</pre>
|
||||
<p>
|
||||
This will allow you to send up to ten files at the same time, which should be plenty
|
||||
for most people. Lastly, configure your router/modem to forward ports 4990-5000 to
|
||||
your PC's address. You'll have to consult your router/modem's manual on how to do this.
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q214">14. How do I execute multiple commands in one line?</a></h3>
|
||||
<p>
|
||||
There are three ways to do this:
|
||||
</p>
|
||||
<ul>
|
||||
<li>/LOAD -e <textfile>, where <textfile> is a full pathname to a file
|
||||
containing commands on each line.</li>
|
||||
<li>
|
||||
Separate your commands with CTRL-SHIFT-u-a (CTRL-SHIFT-a on older GTK+ and Windows). This will appear as a little box with numbers on it.</li>
|
||||
<li>You can create two UserCommands, with the same name, and then execute
|
||||
the UserCommand. It will be executed in the same order as it's written
|
||||
in the UserCommands GUI.</li>
|
||||
</ul>
|
||||
|
||||
<br><h3><a name="q215">15. How do I enable Emacs key bindings in XChat?</a></h3>
|
||||
<p>
|
||||
The standard Emacs key bindings, such as CTRL-w, CTRL-u etc, are supported by
|
||||
GTK+ 2.0, but normally disabled. If you run Gnome 2, you can re-enable them in
|
||||
your Gnome menu under: Preferences -> Keyboard Shortcuts.
|
||||
</p>
|
||||
<p>
|
||||
<i>Note</i>: This doesn't work in the latest Gnome (2.8 and newer). In this case, you need
|
||||
to run "gconf-editor", and directly change the key /desktop/gnome/interface/gtk_key_theme
|
||||
from "Default" to "Emacs". Then you need to re-start XChat.
|
||||
</p>
|
||||
<p>
|
||||
If you don't use Gnome 2, but still want Emacs key bindings, it's beyond the
|
||||
scope of this document. You might find some hints here:
|
||||
<a href="http://www.gtk.org/gtk-2.4.0-notes.html">GTK+ 2.4.0 release notes</a>.
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q216">16. I get this error: "Unknown file type abc.yz. Maybe you need to install the Perl or Python plugin?"</a></h3>
|
||||
<p>
|
||||
If you get this error when trying to load a Perl or Python script, it means
|
||||
the plugin for running those scripts isn't loaded.
|
||||
</p>
|
||||
<ul>
|
||||
<li>The Perl, Python and TCL plugins come with XChat in the same archive.</li>
|
||||
<li>During ./configure, it will check for Perl, Python and TCL libs and headers, you should check if it failed there.</li>
|
||||
<li>The plugins directory can be found by issuing the shell command
|
||||
<pre>xchat -p</pre>
|
||||
</li>
|
||||
<li>All *.so files are auto-loaded at startup (*.dll on Windows).</li>
|
||||
<li>If you downloaded a binary package, maybe the packager decided to exclude the Perl or Python plugins.</li>
|
||||
</ul>
|
||||
|
||||
<br><h3><a name="q217">17. How do I play sound files on certain events?</a></h3>
|
||||
<p>
|
||||
In the menus, go to: Settings > Preferences > Sound.
|
||||
Select the event you want to make a sound on, then type in a
|
||||
sound filename (or use the Browse button).
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q218">18. How do I auto-load scripts at startup?</a></h3>
|
||||
<p>
|
||||
You just have to place the scripts into XChat's data directory. XChat
|
||||
will auto-load scripts if they have the right extension .e.g If a filename
|
||||
ends in .pl, it will be loaded as a Perl script.
|
||||
This data directory is different on each platform:
|
||||
<br><br>
|
||||
<u>Windows</u>
|
||||
<br><br>
|
||||
It depends on your version of Windows and where it stores the
|
||||
<i><b>Application Data</b></i> folder. On Windows XP it is usually:
|
||||
<br><br>
|
||||
C:\Documents and Settings\<i><b>username</b></i>\Application Data\X-Chat 2\
|
||||
<br><b>or simply:</b>
|
||||
<br>
|
||||
C:\Program Files\XChat\Plugins\
|
||||
<br><br><br>
|
||||
<u>UNIX</u>
|
||||
<br><br>
|
||||
~/.xchat2/
|
||||
Where "~" represents your home directory i.e.: $HOME/.xchat2/
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q219">19. How do I minimize X-Chat to the System Tray (Notification Area)?</a></h3>
|
||||
<p>
|
||||
There are two plugins available that allow this:
|
||||
<br>Unix: <a href="http://www.blight.tk/">SysTray Plugin</a>
|
||||
<br>Windows: <a href="http://www.sinisterdevelopments.com/">xTray</a>
|
||||
</p>
|
||||
<p>
|
||||
Note that XChat 2.8.0+ has its own tray feature, but you can disable it
|
||||
in <b>Settings > Preferences > Alerts</b> and still run these plugins, if you prefer.
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q220">20. Can I select and copy text with the time stamps?</a></h3>
|
||||
<p>
|
||||
Yes, but this requires at least XChat 2.6.3. Simply hold down SHIFT while marking
|
||||
the text and the time stamps will be included.
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q221">21. What's the deal with opening URLs in XChat on Unix/Linux?</a></h3>
|
||||
<p>
|
||||
Right-clicking on a URL and selecting <i>Open Link in Browser</i> will open the link
|
||||
in your "preferred browser". In Gnome, your preferred browser can be changed in System > Preferences > More Preferences > Preferred Applications.
|
||||
<br><br>
|
||||
<b><u>Notes for 2.8.0 or newer:</u></b>
|
||||
<br><br>
|
||||
Everything should just work automatically without any changes from you. Here's how the current
|
||||
logic works:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>First, it tries to run xdg-open, which is a universal URL handler from freedesktop.org. Most modern Linux desktops will have this now, or in the near future.</li>
|
||||
<li>If xdg-open doesn't exist, it will try to detect a running Gnome or KDE desktop. This is done via the environment variables GNOME_DESKTOP_SESSION_ID and KDE_FULL_SESSION.</li>
|
||||
<li>If Gnome is detected, it will execute: gnome-open <url></li>
|
||||
<li>If KDE is detected, it will execute: kfmclient exec <url></li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
<b><u>Notes for 2.6.8 or older:</u></b>
|
||||
<br><br>
|
||||
If you're not using Gnome, e.g KDE or some other desktop environment, you're fresh out of luck!
|
||||
<br><u>Note for Debian and Ubuntu</u>: Integration with Gnome is broken on this distro! Please set
|
||||
<i>sensible-browser</i> instead. We have no control over what the Debian packagers do, so complain
|
||||
to them for this screw up. Example:
|
||||
<i>sudo update-alternatives --set x-www-browser /usr/bin/firefox</i>
|
||||
|
||||
<br><br>
|
||||
<b><u>More details</u></b>
|
||||
<br><br>
|
||||
While holding down CTRL you can single left-click a URL to open it in your preferred browser. If you really want to change this to plain left-click you can type: <b>/set gui_url_mod 0</b>, provided you have XChat 2.6.6 or newer.
|
||||
<br><br>
|
||||
You can also add more items to the right-click menu in XChat: <b>Settings > Advanced > URL Handlers</b>.
|
||||
<br>For example, you could add an entry like <b>!firefox -a firefox -remote 'openURL(%s,new-tab)'</b>
|
||||
<br>But this kind of messing around shouldn't be necessary, it just works automatically in Gnome, KDE and Windows with 2.8.0+!
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q222">22. Where are the log files saved to?</a></h3>
|
||||
<p>
|
||||
<u>UNIX</u>
|
||||
<br>
|
||||
<br>~/.xchat2/xchatlogs/
|
||||
<br>where ~ represents your home directory.
|
||||
<br>
|
||||
<br>
|
||||
<br><u>Windows</u>
|
||||
<br>
|
||||
<br><b>Windows XP/2000</b>: C:\Documents and Settings\<i><b>username</b></i>\Application Data\X-Chat 2\xchatlogs
|
||||
<br><b>Windows Vista/7</b>: C:\Users\<i><b>username</b></i>\AppData\Roaming\X-Chat 2\xchatlogs
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q223">23. How do I rotate log files every so often?</a></h3>
|
||||
<p>
|
||||
Requires: 2.6.1+
|
||||
<br><br>
|
||||
By default settings, no rotation occurs, your log files will just keep getting larger.
|
||||
<br><br>
|
||||
Go to <b>Settings</b> > <b>Preferences</b> > <b>Logging</b> and change the log filename to any one of these:
|
||||
</p>
|
||||
<blockquote>
|
||||
<table border="1" cellpadding="6" rules="all">
|
||||
<tr><td><b>Setting</b></td><td><b>Example filename that would be written</b></td></tr>
|
||||
<tr><td>%Y-%m-%d/%n-%c.log </td><td>2006-12-30/FreeNode-#channel.log</td></tr>
|
||||
<tr><td>%n/%Y-%m-%d/%c.log</td><td>FreeNode/2006-12-30/#channel.log</td></tr>
|
||||
<tr><td>%n/%c.log</td><td>FreeNode/#channel.log (no rotation)</td></tr>
|
||||
</table>
|
||||
</blockquote>
|
||||
<p>
|
||||
%Y, %m and %d represents the current year, month and day respectively. %n is the
|
||||
network name, e.g. "FreeNode" or "UnderNet", and finally, %c is the channel. In these
|
||||
examples, a new log filename and folder would be created after midnight.
|
||||
<br><br>
|
||||
You can find more possibilities at <a href="http://xchat.org/docs/log/">http://xchat.org/docs/log/</a>.
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q224">24. How do I enable graphical smilies (emoticons)?</a></h3>
|
||||
<p>
|
||||
This feature is only available in the official Windows XChat release. You have to
|
||||
TICK this feature during installation. If you didn't do this, you can simply run
|
||||
the installer again, and TICK the "<b>Eye Candy Theme</b>" when given the option.
|
||||
</p><p>
|
||||
If you want to use the graphical theme, but disable it just for smilies (i.e leave
|
||||
it ON for things like Join/Part, Modes etc only), type this command and restart:
|
||||
<br><br>
|
||||
<b>/set text_emoticons off</b>
|
||||
</p>
|
||||
|
||||
<br><h2>3. Section Three: Contributions, Development and Bugs.</h2>
|
||||
|
||||
<br><h3><a name="q31">1. Why does X-Chat leak so much memory?</a></h3>
|
||||
<p>
|
||||
The simple answer is, it doesn't! There are some GTK+ pixmap based themes around that
|
||||
leak a lot of memory. Please try using a different theme and see if that resolves the
|
||||
problem. X-Chat itself only allocates about 40kb of memory through malloc()!
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q32">2. My copy of X-Chat crashes, what can I do?</a></h3>
|
||||
<p>
|
||||
Firstly, make sure it's the latest stable version of X-Chat. Stable versions have
|
||||
an EVEN middle number, e.g.: 2.8.0 or 2.8.1. Often late fixes are placed in this
|
||||
directory: <a href="http://xchat.org/files/source/2.8/patches/">2.8.x patches</a>
|
||||
</p><p>
|
||||
If you still experience crashes, you should consider running it through GDB. This
|
||||
will help us find a fix quickly, and it's easy to do! See <a href="http://xchat.org/gdb/">here</a>.
|
||||
</p>
|
||||
|
||||
<br><h3><a name="q33">3. Can I write a new language translation for X-Chat?</a></h3>
|
||||
<p>
|
||||
You sure can, but I don't accept translations directly. They must be done through the
|
||||
<a href="http://translationproject.org/domain/xchat.html">Translation Project</a>.
|
||||
All the relevant information should be on that page.
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,520 @@
|
|||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2009-04-28.21; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# 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
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
|
||||
# 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
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
|
||||
chgrpprog=${CHGRPPROG-chgrp}
|
||||
chmodprog=${CHMODPROG-chmod}
|
||||
chownprog=${CHOWNPROG-chown}
|
||||
cmpprog=${CMPPROG-cmp}
|
||||
cpprog=${CPPROG-cp}
|
||||
mkdirprog=${MKDIRPROG-mkdir}
|
||||
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.
|
||||
mode=0755
|
||||
|
||||
chgrpcmd=
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
mvcmd=$mvprog
|
||||
rmcmd="$rmprog -f"
|
||||
stripcmd=
|
||||
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dst_arg=
|
||||
|
||||
copy_on_change=false
|
||||
no_target_directory=
|
||||
|
||||
usage="\
|
||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
-c (ignored)
|
||||
-C install only if different (preserve the last data modification time)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||
RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) ;;
|
||||
|
||||
-C) copy_on_change=true;;
|
||||
|
||||
-d) dir_arg=true;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
case $mode in
|
||||
*' '* | *' '* | *'
|
||||
'* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift;;
|
||||
|
||||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-t) dst_arg=$2
|
||||
shift;;
|
||||
|
||||
-T) no_target_directory=true;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
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.
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dst_arg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dst_arg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dst_arg=$arg
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# 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
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
# Set umask so as not to create temps with too-generous modes.
|
||||
# However, 'strip' requires both read and write access to temps.
|
||||
case $mode in
|
||||
# Optimize common cases.
|
||||
*644) cp_umask=133;;
|
||||
*755) cp_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names starting with `-'.
|
||||
case $src in
|
||||
-*) src=./$src;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dst_arg"; then
|
||||
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
|
||||
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'
|
||||
`
|
||||
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
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;;
|
||||
|
||||
*[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
|
||||
|
||||
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;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix='/';;
|
||||
-*) prefix='./';;
|
||||
*) prefix='';;
|
||||
esac
|
||||
|
||||
eval "$initialize_posix_glob"
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
$posix_glob set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
$posix_glob set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test -z "$d" && 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/
|
||||
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
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
||||
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
||||
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||
|
||||
# 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 &&
|
||||
set X $old && old=:$2:$4:$5:$6 &&
|
||||
set X $new && new=:$2:$4:$5:$6 &&
|
||||
$posix_glob set +f &&
|
||||
|
||||
test "$old" = "$new" &&
|
||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||
then
|
||||
rm -f "$dsttmp"
|
||||
else
|
||||
# Rename the file to the real destination.
|
||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# 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 rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
fi || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# 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:
|
|
@ -0,0 +1,4 @@
|
|||
2007-11-07 GNU <bug-gnu-gettext@gnu.org>
|
||||
|
||||
* Version 0.17 released.
|
||||
|
|
@ -0,0 +1,590 @@
|
|||
# Makefile for directory with message catalog handling library of GNU gettext
|
||||
# Copyright (C) 1995-1998, 2000-2007 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Library 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
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Library 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.
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = ..
|
||||
|
||||
# The VPATH variables allows builds with $builddir != $srcdir, assuming a
|
||||
# 'make' program that supports VPATH (such as GNU make). This line is removed
|
||||
# by autoconf automatically when "$(srcdir)" = ".".
|
||||
# In this directory, the VPATH handling is particular:
|
||||
# 1. If INTL_LIBTOOL_SUFFIX_PREFIX is 'l' (indicating a build with libtool),
|
||||
# the .c -> .lo rules carefully use $(srcdir), so that VPATH can be omitted.
|
||||
# 2. If PACKAGE = gettext-tools, VPATH _must_ be omitted, because otherwise
|
||||
# 'make' does the wrong thing if GNU gettext was configured with
|
||||
# "./configure --srcdir=`pwd`", namely it gets confused by the .lo and .la
|
||||
# files it finds in srcdir = ../../gettext-runtime/intl.
|
||||
VPATH = $(srcdir)
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
transform = @program_transform_name@
|
||||
libdir = @libdir@
|
||||
includedir = @includedir@
|
||||
datarootdir = @datarootdir@
|
||||
datadir = @datadir@
|
||||
localedir = $(datadir)/locale
|
||||
gettextsrcdir = $(datadir)/gettext/intl
|
||||
aliaspath = $(localedir)
|
||||
subdir = intl
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
|
||||
# We use $(mkdir_p).
|
||||
# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
|
||||
# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
|
||||
# @install_sh@ does not start with $(SHELL), so we add it.
|
||||
# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
|
||||
# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
|
||||
# versions, $(mkinstalldirs) and $(install_sh) are unused.
|
||||
mkinstalldirs = $(SHELL) @install_sh@ -d
|
||||
install_sh = $(SHELL) @install_sh@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
mkdir_p = @mkdir_p@
|
||||
|
||||
l = @INTL_LIBTOOL_SUFFIX_PREFIX@
|
||||
|
||||
AR = ar
|
||||
CC = @CC@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
RANLIB = @RANLIB@
|
||||
YACC = @INTLBISON@ -y -d
|
||||
YFLAGS = --name-prefix=__gettext
|
||||
WINDRES = @WINDRES@
|
||||
|
||||
# -DBUILDING_LIBINTL: Change expansion of LIBINTL_DLL_EXPORTED macro.
|
||||
# -DBUILDING_DLL: Change expansion of RELOCATABLE_DLL_EXPORTED macro.
|
||||
DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
|
||||
-DLIBDIR=\"$(libdir)\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL \
|
||||
-DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \
|
||||
-Dset_relocation_prefix=libintl_set_relocation_prefix \
|
||||
-Drelocate=libintl_relocate \
|
||||
-DDEPENDS_ON_LIBICONV=1 @DEFS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CFLAGS = @CFLAGS@ @CFLAG_VISIBILITY@
|
||||
LDFLAGS = @LDFLAGS@ $(LDFLAGS_@WOE32DLL@)
|
||||
LDFLAGS_yes = -Wl,--export-all-symbols
|
||||
LDFLAGS_no =
|
||||
LIBS = @LIBS@
|
||||
|
||||
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
|
||||
|
||||
HEADERS = \
|
||||
gmo.h \
|
||||
gettextP.h \
|
||||
hash-string.h \
|
||||
loadinfo.h \
|
||||
plural-exp.h \
|
||||
eval-plural.h \
|
||||
localcharset.h \
|
||||
lock.h \
|
||||
relocatable.h \
|
||||
tsearch.h tsearch.c \
|
||||
xsize.h \
|
||||
printf-args.h printf-args.c \
|
||||
printf-parse.h wprintf-parse.h printf-parse.c \
|
||||
vasnprintf.h vasnwprintf.h vasnprintf.c \
|
||||
os2compat.h \
|
||||
libgnuintl.h.in
|
||||
SOURCES = \
|
||||
bindtextdom.c \
|
||||
dcgettext.c \
|
||||
dgettext.c \
|
||||
gettext.c \
|
||||
finddomain.c \
|
||||
hash-string.c \
|
||||
loadmsgcat.c \
|
||||
localealias.c \
|
||||
textdomain.c \
|
||||
l10nflist.c \
|
||||
explodename.c \
|
||||
dcigettext.c \
|
||||
dcngettext.c \
|
||||
dngettext.c \
|
||||
ngettext.c \
|
||||
plural.y \
|
||||
plural-exp.c \
|
||||
localcharset.c \
|
||||
lock.c \
|
||||
relocatable.c \
|
||||
langprefs.c \
|
||||
localename.c \
|
||||
log.c \
|
||||
printf.c \
|
||||
version.c \
|
||||
osdep.c \
|
||||
os2compat.c \
|
||||
intl-exports.c \
|
||||
intl-compat.c
|
||||
OBJECTS = \
|
||||
bindtextdom.$lo \
|
||||
dcgettext.$lo \
|
||||
dgettext.$lo \
|
||||
gettext.$lo \
|
||||
finddomain.$lo \
|
||||
hash-string.$lo \
|
||||
loadmsgcat.$lo \
|
||||
localealias.$lo \
|
||||
textdomain.$lo \
|
||||
l10nflist.$lo \
|
||||
explodename.$lo \
|
||||
dcigettext.$lo \
|
||||
dcngettext.$lo \
|
||||
dngettext.$lo \
|
||||
ngettext.$lo \
|
||||
plural.$lo \
|
||||
plural-exp.$lo \
|
||||
localcharset.$lo \
|
||||
lock.$lo \
|
||||
relocatable.$lo \
|
||||
langprefs.$lo \
|
||||
localename.$lo \
|
||||
log.$lo \
|
||||
printf.$lo \
|
||||
version.$lo \
|
||||
osdep.$lo \
|
||||
intl-compat.$lo
|
||||
OBJECTS_RES_yes = libintl.res
|
||||
OBJECTS_RES_no =
|
||||
DISTFILES.common = Makefile.in \
|
||||
config.charset locale.alias ref-add.sin ref-del.sin export.h libintl.rc \
|
||||
$(HEADERS) $(SOURCES)
|
||||
DISTFILES.generated = plural.c
|
||||
DISTFILES.normal = VERSION
|
||||
DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc README.woe32
|
||||
DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \
|
||||
COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h \
|
||||
libgnuintl.h_vms Makefile.vms libgnuintl.h.msvc-static \
|
||||
libgnuintl.h.msvc-shared Makefile.msvc
|
||||
|
||||
# gettext 0.22 removed this
|
||||
# all: all-@USE_INCLUDED_LIBINTL@
|
||||
all: all-yes
|
||||
all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
|
||||
all-no: all-no-yes
|
||||
# all-no: all-no-@BUILD_INCLUDED_LIBINTL@
|
||||
all-no-yes: libgnuintl.$la
|
||||
all-no-no:
|
||||
|
||||
libintl.a libgnuintl.a: $(OBJECTS)
|
||||
rm -f $@
|
||||
$(AR) cru $@ $(OBJECTS)
|
||||
$(RANLIB) $@
|
||||
|
||||
libintl.la libgnuintl.la: $(OBJECTS) $(OBJECTS_RES_@WOE32@)
|
||||
$(LIBTOOL) --mode=link \
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
|
||||
$(OBJECTS) @LTLIBICONV@ @INTL_MACOSX_LIBS@ $(LIBS) @LTLIBTHREAD@ @LTLIBC@ \
|
||||
$(OBJECTS_RES_@WOE32@) \
|
||||
-version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
|
||||
-rpath $(libdir) \
|
||||
-no-undefined
|
||||
|
||||
# Libtool's library version information for libintl.
|
||||
# Before making a gettext release, the gettext maintainer must change this
|
||||
# according to the libtool documentation, section "Library interface versions".
|
||||
# Maintainers of other packages that include the intl directory must *not*
|
||||
# change these values.
|
||||
LTV_CURRENT=8
|
||||
LTV_REVISION=2
|
||||
LTV_AGE=0
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .y .o .lo .sin .sed
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) $<
|
||||
|
||||
.y.c:
|
||||
$(YACC) $(YFLAGS) --output $@ $<
|
||||
rm -f $*.h
|
||||
|
||||
bindtextdom.lo: $(srcdir)/bindtextdom.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c
|
||||
dcgettext.lo: $(srcdir)/dcgettext.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c
|
||||
dgettext.lo: $(srcdir)/dgettext.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c
|
||||
gettext.lo: $(srcdir)/gettext.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c
|
||||
finddomain.lo: $(srcdir)/finddomain.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c
|
||||
hash-string.lo: $(srcdir)/hash-string.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/hash-string.c
|
||||
loadmsgcat.lo: $(srcdir)/loadmsgcat.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
|
||||
localealias.lo: $(srcdir)/localealias.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c
|
||||
textdomain.lo: $(srcdir)/textdomain.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c
|
||||
l10nflist.lo: $(srcdir)/l10nflist.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c
|
||||
explodename.lo: $(srcdir)/explodename.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c
|
||||
dcigettext.lo: $(srcdir)/dcigettext.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c
|
||||
dcngettext.lo: $(srcdir)/dcngettext.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c
|
||||
dngettext.lo: $(srcdir)/dngettext.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c
|
||||
ngettext.lo: $(srcdir)/ngettext.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c
|
||||
plural.lo: $(srcdir)/plural.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c
|
||||
plural-exp.lo: $(srcdir)/plural-exp.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
|
||||
localcharset.lo: $(srcdir)/localcharset.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c
|
||||
lock.lo: $(srcdir)/lock.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/lock.c
|
||||
relocatable.lo: $(srcdir)/relocatable.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c
|
||||
langprefs.lo: $(srcdir)/langprefs.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/langprefs.c
|
||||
localename.lo: $(srcdir)/localename.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c
|
||||
log.lo: $(srcdir)/log.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c
|
||||
printf.lo: $(srcdir)/printf.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/printf.c
|
||||
version.lo: $(srcdir)/version.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/version.c
|
||||
osdep.lo: $(srcdir)/osdep.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c
|
||||
intl-compat.lo: $(srcdir)/intl-compat.c
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c
|
||||
|
||||
# This rule is executed only on Woe32 systems.
|
||||
# The following sed expressions come from the windres-options script. They are
|
||||
# inlined here, so that they can be written in a Makefile without requiring a
|
||||
# temporary file. They must contain literal newlines rather than semicolons,
|
||||
# so that they work with the sed-3.02 that is shipped with MSYS. We can use
|
||||
# GNU bash's $'\n' syntax to obtain such a newline.
|
||||
libintl.res: $(srcdir)/libintl.rc
|
||||
nl=$$'\n'; \
|
||||
sed_extract_major='/^[0-9]/{'$${nl}'s/^\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
|
||||
sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
|
||||
sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
|
||||
$(WINDRES) \
|
||||
"-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \
|
||||
"-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \
|
||||
"-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \
|
||||
"-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \
|
||||
-i $(srcdir)/libintl.rc -o libintl.res --output-format=coff
|
||||
|
||||
ref-add.sed: $(srcdir)/ref-add.sin
|
||||
sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed
|
||||
mv t-ref-add.sed ref-add.sed
|
||||
ref-del.sed: $(srcdir)/ref-del.sin
|
||||
sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed
|
||||
mv t-ref-del.sed ref-del.sed
|
||||
|
||||
INCLUDES = -I. -I$(srcdir) -I..
|
||||
|
||||
libgnuintl.h: $(srcdir)/libgnuintl.h.in
|
||||
sed -e '/IN_LIBGLOCALE/d' \
|
||||
-e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
|
||||
-e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
|
||||
-e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
|
||||
-e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
|
||||
< $(srcdir)/libgnuintl.h.in \
|
||||
| if test '@WOE32DLL@' = yes; then \
|
||||
sed -e 's/extern \([^()]*\);/extern __declspec (dllimport) \1;/'; \
|
||||
else \
|
||||
cat; \
|
||||
fi \
|
||||
| sed -e 's/extern \([^"]\)/extern LIBINTL_DLL_EXPORTED \1/' \
|
||||
-e "/#define _LIBINTL_H/r $(srcdir)/export.h" \
|
||||
| sed -e 's,@''HAVE_VISIBILITY''@,@HAVE_VISIBILITY@,g' \
|
||||
> libgnuintl.h
|
||||
|
||||
libintl.h: $(srcdir)/libgnuintl.h.in
|
||||
sed -e '/IN_LIBGLOCALE/d' \
|
||||
-e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
|
||||
-e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
|
||||
-e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
|
||||
-e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
|
||||
< $(srcdir)/libgnuintl.h.in > libintl.h
|
||||
|
||||
charset.alias: $(srcdir)/config.charset
|
||||
$(SHELL) $(srcdir)/config.charset '@host@' > t-$@
|
||||
mv t-$@ $@
|
||||
|
||||
check: all
|
||||
|
||||
# We must not install the libintl.h/libintl.a files if we are on a
|
||||
# system which has the GNU gettext() function in its C library or in a
|
||||
# separate library.
|
||||
# If you want to use the one which comes with this version of the
|
||||
# package, you have to use `configure --with-included-gettext'.
|
||||
install: install-exec install-data
|
||||
install-exec: all
|
||||
if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
|
||||
&& test '@USE_INCLUDED_LIBINTL@' = yes; then \
|
||||
$(mkdir_p) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
|
||||
$(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
|
||||
$(LIBTOOL) --mode=install \
|
||||
$(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
|
||||
if test "@RELOCATABLE@" = yes; then \
|
||||
dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
|
||||
if test -n "$$dependencies"; then \
|
||||
rm -f $(DESTDIR)$(libdir)/libintl.la; \
|
||||
fi; \
|
||||
fi; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
if test "$(PACKAGE)" = "gettext-tools" \
|
||||
&& test '@USE_INCLUDED_LIBINTL@' = no \
|
||||
&& test @GLIBC2@ != no; then \
|
||||
$(mkdir_p) $(DESTDIR)$(libdir); \
|
||||
$(LIBTOOL) --mode=install \
|
||||
$(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \
|
||||
rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
|
||||
$(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \
|
||||
$(LIBTOOL) --mode=uninstall \
|
||||
rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
if test '@USE_INCLUDED_LIBINTL@' = yes; then \
|
||||
test @GLIBC21@ != no || $(mkdir_p) $(DESTDIR)$(libdir); \
|
||||
temp=$(DESTDIR)$(libdir)/t-charset.alias; \
|
||||
dest=$(DESTDIR)$(libdir)/charset.alias; \
|
||||
if test -f $(DESTDIR)$(libdir)/charset.alias; then \
|
||||
orig=$(DESTDIR)$(libdir)/charset.alias; \
|
||||
sed -f ref-add.sed $$orig > $$temp; \
|
||||
$(INSTALL_DATA) $$temp $$dest; \
|
||||
rm -f $$temp; \
|
||||
else \
|
||||
if test @GLIBC21@ = no; then \
|
||||
orig=charset.alias; \
|
||||
sed -f ref-add.sed $$orig > $$temp; \
|
||||
$(INSTALL_DATA) $$temp $$dest; \
|
||||
rm -f $$temp; \
|
||||
fi; \
|
||||
fi; \
|
||||
$(mkdir_p) $(DESTDIR)$(localedir); \
|
||||
test -f $(DESTDIR)$(localedir)/locale.alias \
|
||||
&& orig=$(DESTDIR)$(localedir)/locale.alias \
|
||||
|| orig=$(srcdir)/locale.alias; \
|
||||
temp=$(DESTDIR)$(localedir)/t-locale.alias; \
|
||||
dest=$(DESTDIR)$(localedir)/locale.alias; \
|
||||
sed -f ref-add.sed $$orig > $$temp; \
|
||||
$(INSTALL_DATA) $$temp $$dest; \
|
||||
rm -f $$temp; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
install-data: all
|
||||
if test "$(PACKAGE)" = "gettext-tools"; then \
|
||||
$(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
|
||||
$(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
|
||||
$(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
|
||||
dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \
|
||||
for file in $$dists; do \
|
||||
$(INSTALL_DATA) $(srcdir)/$$file \
|
||||
$(DESTDIR)$(gettextsrcdir)/$$file; \
|
||||
done; \
|
||||
chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
|
||||
dists="$(DISTFILES.generated)"; \
|
||||
for file in $$dists; do \
|
||||
if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
|
||||
$(INSTALL_DATA) $$dir/$$file \
|
||||
$(DESTDIR)$(gettextsrcdir)/$$file; \
|
||||
done; \
|
||||
dists="$(DISTFILES.obsolete)"; \
|
||||
for file in $$dists; do \
|
||||
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
|
||||
done; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
|
||||
install-strip: install
|
||||
|
||||
install-dvi install-html install-info install-ps install-pdf:
|
||||
|
||||
installdirs:
|
||||
if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
|
||||
&& test '@USE_INCLUDED_LIBINTL@' = yes; then \
|
||||
$(mkdir_p) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
if test "$(PACKAGE)" = "gettext-tools" \
|
||||
&& test '@USE_INCLUDED_LIBINTL@' = no \
|
||||
&& test @GLIBC2@ != no; then \
|
||||
$(mkdir_p) $(DESTDIR)$(libdir); \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
if test '@USE_INCLUDED_LIBINTL@' = yes; then \
|
||||
test @GLIBC21@ != no || $(mkdir_p) $(DESTDIR)$(libdir); \
|
||||
$(mkdir_p) $(DESTDIR)$(localedir); \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
if test "$(PACKAGE)" = "gettext-tools"; then \
|
||||
$(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
|
||||
# Define this as empty until I found a useful application.
|
||||
installcheck:
|
||||
|
||||
uninstall:
|
||||
if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
|
||||
&& test '@USE_INCLUDED_LIBINTL@' = yes; then \
|
||||
rm -f $(DESTDIR)$(includedir)/libintl.h; \
|
||||
$(LIBTOOL) --mode=uninstall \
|
||||
rm -f $(DESTDIR)$(libdir)/libintl.$la; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
if test "$(PACKAGE)" = "gettext-tools" \
|
||||
&& test '@USE_INCLUDED_LIBINTL@' = no \
|
||||
&& test @GLIBC2@ != no; then \
|
||||
rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
if test '@USE_INCLUDED_LIBINTL@' = yes; then \
|
||||
if test -f $(DESTDIR)$(libdir)/charset.alias; then \
|
||||
temp=$(DESTDIR)$(libdir)/t-charset.alias; \
|
||||
dest=$(DESTDIR)$(libdir)/charset.alias; \
|
||||
sed -f ref-del.sed $$dest > $$temp; \
|
||||
if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
|
||||
rm -f $$dest; \
|
||||
else \
|
||||
$(INSTALL_DATA) $$temp $$dest; \
|
||||
fi; \
|
||||
rm -f $$temp; \
|
||||
fi; \
|
||||
if test -f $(DESTDIR)$(localedir)/locale.alias; then \
|
||||
temp=$(DESTDIR)$(localedir)/t-locale.alias; \
|
||||
dest=$(DESTDIR)$(localedir)/locale.alias; \
|
||||
sed -f ref-del.sed $$dest > $$temp; \
|
||||
if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
|
||||
rm -f $$dest; \
|
||||
else \
|
||||
$(INSTALL_DATA) $$temp $$dest; \
|
||||
fi; \
|
||||
rm -f $$temp; \
|
||||
fi; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
if test "$(PACKAGE)" = "gettext-tools"; then \
|
||||
for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
|
||||
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
|
||||
done; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
|
||||
info dvi ps pdf html:
|
||||
|
||||
$(OBJECTS): ../config.h libgnuintl.h
|
||||
bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo textdomain.$lo: $(srcdir)/gettextP.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h
|
||||
hash-string.$lo dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
|
||||
explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
|
||||
dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
|
||||
dcigettext.$lo: $(srcdir)/eval-plural.h
|
||||
localcharset.$lo: $(srcdir)/localcharset.h
|
||||
bindtextdom.$lo dcigettext.$lo finddomain.$lo loadmsgcat.$lo localealias.$lo lock.$lo log.$lo: $(srcdir)/lock.h
|
||||
localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
|
||||
printf.$lo: $(srcdir)/printf-args.h $(srcdir)/printf-args.c $(srcdir)/printf-parse.h $(srcdir)/wprintf-parse.h $(srcdir)/xsize.h $(srcdir)/printf-parse.c $(srcdir)/vasnprintf.h $(srcdir)/vasnwprintf.h $(srcdir)/vasnprintf.c
|
||||
|
||||
# A bison-2.1 generated plural.c includes <libintl.h> if ENABLE_NLS.
|
||||
PLURAL_DEPS_yes = libintl.h
|
||||
PLURAL_DEPS_no =
|
||||
plural.$lo: $(PLURAL_DEPS_@USE_INCLUDED_LIBINTL@)
|
||||
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES)
|
||||
here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
|
||||
|
||||
ctags: CTAGS
|
||||
|
||||
CTAGS: $(HEADERS) $(SOURCES)
|
||||
here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
|
||||
|
||||
id: ID
|
||||
|
||||
ID: $(HEADERS) $(SOURCES)
|
||||
here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
|
||||
|
||||
|
||||
mostlyclean:
|
||||
rm -f *.a *.la *.o *.obj *.lo libintl.res core core.*
|
||||
rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed
|
||||
rm -f -r .libs _libs
|
||||
|
||||
clean: mostlyclean
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile ID TAGS
|
||||
if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
|
||||
rm -f ChangeLog.inst $(DISTFILES.normal); \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
|
||||
maintainer-clean: distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
|
||||
# GNU gettext needs not contain the file `VERSION' but contains some
|
||||
# other files which should not be distributed in other packages.
|
||||
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
dist distdir: Makefile
|
||||
if test "$(PACKAGE)" = "gettext-tools"; then \
|
||||
: ; \
|
||||
else \
|
||||
if test "$(PACKAGE)" = "gettext-runtime"; then \
|
||||
additional="$(DISTFILES.gettext)"; \
|
||||
else \
|
||||
additional="$(DISTFILES.normal)"; \
|
||||
fi; \
|
||||
$(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
|
||||
for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
|
||||
if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
|
||||
cp -p $$dir/$$file $(distdir) || test $$file = Makefile.in || exit 1; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && $(SHELL) ./config.status
|
||||
# This would be more efficient, but doesn't work any more with autoconf-2.57,
|
||||
# when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used.
|
||||
# cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make not to export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1 @@
|
|||
GNU gettext library from gettext-0.17
|
|
@ -0,0 +1,340 @@
|
|||
/* Implementation of the bindtextdomain(3) function
|
||||
Copyright (C) 1995-1998, 2000-2003, 2005-2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "gettextP.h"
|
||||
#ifdef _LIBC
|
||||
# include <libintl.h>
|
||||
#else
|
||||
# include "libgnuintl.h"
|
||||
#endif
|
||||
|
||||
/* Handle multi-threaded applications. */
|
||||
#ifdef _LIBC
|
||||
# include <bits/libc-lock.h>
|
||||
# define gl_rwlock_define __libc_rwlock_define
|
||||
# define gl_rwlock_wrlock __libc_rwlock_wrlock
|
||||
# define gl_rwlock_unlock __libc_rwlock_unlock
|
||||
#else
|
||||
# include "lock.h"
|
||||
#endif
|
||||
|
||||
/* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>. */
|
||||
#ifndef offsetof
|
||||
# define offsetof(type,ident) ((size_t)&(((type*)0)->ident))
|
||||
#endif
|
||||
|
||||
/* @@ end of prolog @@ */
|
||||
|
||||
/* Lock variable to protect the global data in the gettext implementation. */
|
||||
gl_rwlock_define (extern, _nl_state_lock attribute_hidden)
|
||||
|
||||
|
||||
/* Names for the libintl functions are a problem. They must not clash
|
||||
with existing names and they should follow ANSI C. But this source
|
||||
code is also used in GNU C Library where the names have a __
|
||||
prefix. So we have to make a difference here. */
|
||||
#ifdef _LIBC
|
||||
# define BINDTEXTDOMAIN __bindtextdomain
|
||||
# define BIND_TEXTDOMAIN_CODESET __bind_textdomain_codeset
|
||||
# ifndef strdup
|
||||
# define strdup(str) __strdup (str)
|
||||
# endif
|
||||
#else
|
||||
# define BINDTEXTDOMAIN libintl_bindtextdomain
|
||||
# define BIND_TEXTDOMAIN_CODESET libintl_bind_textdomain_codeset
|
||||
#endif
|
||||
|
||||
/* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP
|
||||
to be used for the DOMAINNAME message catalog.
|
||||
If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not
|
||||
modified, only the current value is returned.
|
||||
If DIRNAMEP or CODESETP is NULL, the corresponding attribute is neither
|
||||
modified nor returned. */
|
||||
static void
|
||||
set_binding_values (const char *domainname,
|
||||
const char **dirnamep, const char **codesetp)
|
||||
{
|
||||
struct binding *binding;
|
||||
int modified;
|
||||
|
||||
/* Some sanity checks. */
|
||||
if (domainname == NULL || domainname[0] == '\0')
|
||||
{
|
||||
if (dirnamep)
|
||||
*dirnamep = NULL;
|
||||
if (codesetp)
|
||||
*codesetp = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
gl_rwlock_wrlock (_nl_state_lock);
|
||||
|
||||
modified = 0;
|
||||
|
||||
for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
|
||||
{
|
||||
int compare = strcmp (domainname, binding->domainname);
|
||||
if (compare == 0)
|
||||
/* We found it! */
|
||||
break;
|
||||
if (compare < 0)
|
||||
{
|
||||
/* It is not in the list. */
|
||||
binding = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (binding != NULL)
|
||||
{
|
||||
if (dirnamep)
|
||||
{
|
||||
const char *dirname = *dirnamep;
|
||||
|
||||
if (dirname == NULL)
|
||||
/* The current binding has be to returned. */
|
||||
*dirnamep = binding->dirname;
|
||||
else
|
||||
{
|
||||
/* The domain is already bound. If the new value and the old
|
||||
one are equal we simply do nothing. Otherwise replace the
|
||||
old binding. */
|
||||
char *result = binding->dirname;
|
||||
if (strcmp (dirname, result) != 0)
|
||||
{
|
||||
if (strcmp (dirname, _nl_default_dirname) == 0)
|
||||
result = (char *) _nl_default_dirname;
|
||||
else
|
||||
{
|
||||
#if defined _LIBC || defined HAVE_STRDUP
|
||||
result = strdup (dirname);
|
||||
#else
|
||||
size_t len = strlen (dirname) + 1;
|
||||
result = (char *) malloc (len);
|
||||
if (__builtin_expect (result != NULL, 1))
|
||||
memcpy (result, dirname, len);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (__builtin_expect (result != NULL, 1))
|
||||
{
|
||||
if (binding->dirname != _nl_default_dirname)
|
||||
free (binding->dirname);
|
||||
|
||||
binding->dirname = result;
|
||||
modified = 1;
|
||||
}
|
||||
}
|
||||
*dirnamep = result;
|
||||
}
|
||||
}
|
||||
|
||||
if (codesetp)
|
||||
{
|
||||
const char *codeset = *codesetp;
|
||||
|
||||
if (codeset == NULL)
|
||||
/* The current binding has be to returned. */
|
||||
*codesetp = binding->codeset;
|
||||
else
|
||||
{
|
||||
/* The domain is already bound. If the new value and the old
|
||||
one are equal we simply do nothing. Otherwise replace the
|
||||
old binding. */
|
||||
char *result = binding->codeset;
|
||||
if (result == NULL || strcmp (codeset, result) != 0)
|
||||
{
|
||||
#if defined _LIBC || defined HAVE_STRDUP
|
||||
result = strdup (codeset);
|
||||
#else
|
||||
size_t len = strlen (codeset) + 1;
|
||||
result = (char *) malloc (len);
|
||||
if (__builtin_expect (result != NULL, 1))
|
||||
memcpy (result, codeset, len);
|
||||
#endif
|
||||
|
||||
if (__builtin_expect (result != NULL, 1))
|
||||
{
|
||||
if (binding->codeset != NULL)
|
||||
free (binding->codeset);
|
||||
|
||||
binding->codeset = result;
|
||||
modified = 1;
|
||||
}
|
||||
}
|
||||
*codesetp = result;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((dirnamep == NULL || *dirnamep == NULL)
|
||||
&& (codesetp == NULL || *codesetp == NULL))
|
||||
{
|
||||
/* Simply return the default values. */
|
||||
if (dirnamep)
|
||||
*dirnamep = _nl_default_dirname;
|
||||
if (codesetp)
|
||||
*codesetp = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We have to create a new binding. */
|
||||
size_t len = strlen (domainname) + 1;
|
||||
struct binding *new_binding =
|
||||
(struct binding *) malloc (offsetof (struct binding, domainname) + len);
|
||||
|
||||
if (__builtin_expect (new_binding == NULL, 0))
|
||||
goto failed;
|
||||
|
||||
memcpy (new_binding->domainname, domainname, len);
|
||||
|
||||
if (dirnamep)
|
||||
{
|
||||
const char *dirname = *dirnamep;
|
||||
|
||||
if (dirname == NULL)
|
||||
/* The default value. */
|
||||
dirname = _nl_default_dirname;
|
||||
else
|
||||
{
|
||||
if (strcmp (dirname, _nl_default_dirname) == 0)
|
||||
dirname = _nl_default_dirname;
|
||||
else
|
||||
{
|
||||
char *result;
|
||||
#if defined _LIBC || defined HAVE_STRDUP
|
||||
result = strdup (dirname);
|
||||
if (__builtin_expect (result == NULL, 0))
|
||||
goto failed_dirname;
|
||||
#else
|
||||
size_t len = strlen (dirname) + 1;
|
||||
result = (char *) malloc (len);
|
||||
if (__builtin_expect (result == NULL, 0))
|
||||
goto failed_dirname;
|
||||
memcpy (result, dirname, len);
|
||||
#endif
|
||||
dirname = result;
|
||||
}
|
||||
}
|
||||
*dirnamep = dirname;
|
||||
new_binding->dirname = (char *) dirname;
|
||||
}
|
||||
else
|
||||
/* The default value. */
|
||||
new_binding->dirname = (char *) _nl_default_dirname;
|
||||
|
||||
if (codesetp)
|
||||
{
|
||||
const char *codeset = *codesetp;
|
||||
|
||||
if (codeset != NULL)
|
||||
{
|
||||
char *result;
|
||||
|
||||
#if defined _LIBC || defined HAVE_STRDUP
|
||||
result = strdup (codeset);
|
||||
if (__builtin_expect (result == NULL, 0))
|
||||
goto failed_codeset;
|
||||
#else
|
||||
size_t len = strlen (codeset) + 1;
|
||||
result = (char *) malloc (len);
|
||||
if (__builtin_expect (result == NULL, 0))
|
||||
goto failed_codeset;
|
||||
memcpy (result, codeset, len);
|
||||
#endif
|
||||
codeset = result;
|
||||
}
|
||||
*codesetp = codeset;
|
||||
new_binding->codeset = (char *) codeset;
|
||||
}
|
||||
else
|
||||
new_binding->codeset = NULL;
|
||||
|
||||
/* Now enqueue it. */
|
||||
if (_nl_domain_bindings == NULL
|
||||
|| strcmp (domainname, _nl_domain_bindings->domainname) < 0)
|
||||
{
|
||||
new_binding->next = _nl_domain_bindings;
|
||||
_nl_domain_bindings = new_binding;
|
||||
}
|
||||
else
|
||||
{
|
||||
binding = _nl_domain_bindings;
|
||||
while (binding->next != NULL
|
||||
&& strcmp (domainname, binding->next->domainname) > 0)
|
||||
binding = binding->next;
|
||||
|
||||
new_binding->next = binding->next;
|
||||
binding->next = new_binding;
|
||||
}
|
||||
|
||||
modified = 1;
|
||||
|
||||
/* Here we deal with memory allocation failures. */
|
||||
if (0)
|
||||
{
|
||||
failed_codeset:
|
||||
if (new_binding->dirname != _nl_default_dirname)
|
||||
free (new_binding->dirname);
|
||||
failed_dirname:
|
||||
free (new_binding);
|
||||
failed:
|
||||
if (dirnamep)
|
||||
*dirnamep = NULL;
|
||||
if (codesetp)
|
||||
*codesetp = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we modified any binding, we flush the caches. */
|
||||
if (modified)
|
||||
++_nl_msg_cat_cntr;
|
||||
|
||||
gl_rwlock_unlock (_nl_state_lock);
|
||||
}
|
||||
|
||||
/* Specify that the DOMAINNAME message catalog will be found
|
||||
in DIRNAME rather than in the system locale data base. */
|
||||
char *
|
||||
BINDTEXTDOMAIN (const char *domainname, const char *dirname)
|
||||
{
|
||||
set_binding_values (domainname, &dirname, NULL);
|
||||
return (char *) dirname;
|
||||
}
|
||||
|
||||
/* Specify the character encoding in which the messages from the
|
||||
DOMAINNAME message catalog will be returned. */
|
||||
char *
|
||||
BIND_TEXTDOMAIN_CODESET (const char *domainname, const char *codeset)
|
||||
{
|
||||
set_binding_values (domainname, NULL, &codeset);
|
||||
return (char *) codeset;
|
||||
}
|
||||
|
||||
#ifdef _LIBC
|
||||
/* Aliases for function names in GNU C Library. */
|
||||
weak_alias (__bindtextdomain, bindtextdomain);
|
||||
weak_alias (__bind_textdomain_codeset, bind_textdomain_codeset);
|
||||
#endif
|
|
@ -0,0 +1,640 @@
|
|||
#! /bin/sh
|
||||
# Output a system dependent table of character encoding aliases.
|
||||
#
|
||||
# Copyright (C) 2000-2004, 2006 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Library 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
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Library 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.
|
||||
#
|
||||
# The table consists of lines of the form
|
||||
# ALIAS CANONICAL
|
||||
#
|
||||
# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)".
|
||||
# ALIAS is compared in a case sensitive way.
|
||||
#
|
||||
# CANONICAL is the GNU canonical name for this character encoding.
|
||||
# It must be an encoding supported by libiconv. Support by GNU libc is
|
||||
# also desirable. CANONICAL is case insensitive. Usually an upper case
|
||||
# MIME charset name is preferred.
|
||||
# The current list of GNU canonical charset names is as follows.
|
||||
#
|
||||
# name MIME? used by which systems
|
||||
# ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin
|
||||
# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd darwin
|
||||
# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd darwin
|
||||
# ISO-8859-3 Y glibc solaris
|
||||
# ISO-8859-4 Y osf solaris freebsd netbsd darwin
|
||||
# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd darwin
|
||||
# ISO-8859-6 Y glibc aix hpux solaris
|
||||
# ISO-8859-7 Y glibc aix hpux irix osf solaris netbsd darwin
|
||||
# ISO-8859-8 Y glibc aix hpux osf solaris
|
||||
# ISO-8859-9 Y glibc aix hpux irix osf solaris darwin
|
||||
# ISO-8859-13 glibc netbsd darwin
|
||||
# ISO-8859-14 glibc
|
||||
# ISO-8859-15 glibc aix osf solaris freebsd darwin
|
||||
# KOI8-R Y glibc solaris freebsd netbsd darwin
|
||||
# KOI8-U Y glibc freebsd netbsd darwin
|
||||
# KOI8-T glibc
|
||||
# CP437 dos
|
||||
# CP775 dos
|
||||
# CP850 aix osf dos
|
||||
# CP852 dos
|
||||
# CP855 dos
|
||||
# CP856 aix
|
||||
# CP857 dos
|
||||
# CP861 dos
|
||||
# CP862 dos
|
||||
# CP864 dos
|
||||
# CP865 dos
|
||||
# CP866 freebsd netbsd darwin dos
|
||||
# CP869 dos
|
||||
# CP874 woe32 dos
|
||||
# CP922 aix
|
||||
# CP932 aix woe32 dos
|
||||
# CP943 aix
|
||||
# CP949 osf woe32 dos
|
||||
# CP950 woe32 dos
|
||||
# CP1046 aix
|
||||
# CP1124 aix
|
||||
# CP1125 dos
|
||||
# CP1129 aix
|
||||
# CP1250 woe32
|
||||
# CP1251 glibc solaris netbsd darwin woe32
|
||||
# CP1252 aix woe32
|
||||
# CP1253 woe32
|
||||
# CP1254 woe32
|
||||
# CP1255 glibc woe32
|
||||
# CP1256 woe32
|
||||
# CP1257 woe32
|
||||
# GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin
|
||||
# EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin
|
||||
# EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin
|
||||
# EUC-TW glibc aix hpux irix osf solaris netbsd
|
||||
# BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin
|
||||
# BIG5-HKSCS glibc solaris
|
||||
# GBK glibc aix osf solaris woe32 dos
|
||||
# GB18030 glibc solaris netbsd
|
||||
# SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin
|
||||
# JOHAB glibc solaris woe32
|
||||
# TIS-620 glibc aix hpux osf solaris
|
||||
# VISCII Y glibc
|
||||
# TCVN5712-1 glibc
|
||||
# GEORGIAN-PS glibc
|
||||
# HP-ROMAN8 hpux
|
||||
# HP-ARABIC8 hpux
|
||||
# HP-GREEK8 hpux
|
||||
# HP-HEBREW8 hpux
|
||||
# HP-TURKISH8 hpux
|
||||
# HP-KANA8 hpux
|
||||
# DEC-KANJI osf
|
||||
# DEC-HANYU osf
|
||||
# UTF-8 Y glibc aix hpux osf solaris netbsd darwin
|
||||
#
|
||||
# Note: Names which are not marked as being a MIME name should not be used in
|
||||
# Internet protocols for information interchange (mail, news, etc.).
|
||||
#
|
||||
# Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
|
||||
# must understand both names and treat them as equivalent.
|
||||
#
|
||||
# The first argument passed to this file is the canonical host specification,
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||
# or
|
||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||
|
||||
host="$1"
|
||||
os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'`
|
||||
echo "# This file contains a table of character encoding aliases,"
|
||||
echo "# suitable for operating system '${os}'."
|
||||
echo "# It was automatically generated from config.charset."
|
||||
# List of references, updated during installation:
|
||||
echo "# Packages using this file: "
|
||||
case "$os" in
|
||||
linux-gnulibc1*)
|
||||
# Linux libc5 doesn't have nl_langinfo(CODESET); therefore
|
||||
# localcharset.c falls back to using the full locale name
|
||||
# from the environment variables.
|
||||
echo "C ASCII"
|
||||
echo "POSIX ASCII"
|
||||
for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \
|
||||
en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \
|
||||
en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \
|
||||
es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \
|
||||
et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \
|
||||
fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \
|
||||
it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \
|
||||
sv_FI sv_SE; do
|
||||
echo "$l ISO-8859-1"
|
||||
echo "$l.iso-8859-1 ISO-8859-1"
|
||||
echo "$l.iso-8859-15 ISO-8859-15"
|
||||
echo "$l.iso-8859-15@euro ISO-8859-15"
|
||||
echo "$l@euro ISO-8859-15"
|
||||
echo "$l.cp-437 CP437"
|
||||
echo "$l.cp-850 CP850"
|
||||
echo "$l.cp-1252 CP1252"
|
||||
echo "$l.cp-1252@euro CP1252"
|
||||
#echo "$l.atari-st ATARI-ST" # not a commonly used encoding
|
||||
echo "$l.utf-8 UTF-8"
|
||||
echo "$l.utf-8@euro UTF-8"
|
||||
done
|
||||
for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \
|
||||
sl_SI sr sr_CS sr_YU; do
|
||||
echo "$l ISO-8859-2"
|
||||
echo "$l.iso-8859-2 ISO-8859-2"
|
||||
echo "$l.cp-852 CP852"
|
||||
echo "$l.cp-1250 CP1250"
|
||||
echo "$l.utf-8 UTF-8"
|
||||
done
|
||||
for l in mk mk_MK ru ru_RU; do
|
||||
echo "$l ISO-8859-5"
|
||||
echo "$l.iso-8859-5 ISO-8859-5"
|
||||
echo "$l.koi8-r KOI8-R"
|
||||
echo "$l.cp-866 CP866"
|
||||
echo "$l.cp-1251 CP1251"
|
||||
echo "$l.utf-8 UTF-8"
|
||||
done
|
||||
for l in ar ar_SA; do
|
||||
echo "$l ISO-8859-6"
|
||||
echo "$l.iso-8859-6 ISO-8859-6"
|
||||
echo "$l.cp-864 CP864"
|
||||
#echo "$l.cp-868 CP868" # not a commonly used encoding
|
||||
echo "$l.cp-1256 CP1256"
|
||||
echo "$l.utf-8 UTF-8"
|
||||
done
|
||||
for l in el el_GR gr gr_GR; do
|
||||
echo "$l ISO-8859-7"
|
||||
echo "$l.iso-8859-7 ISO-8859-7"
|
||||
echo "$l.cp-869 CP869"
|
||||
echo "$l.cp-1253 CP1253"
|
||||
echo "$l.cp-1253@euro CP1253"
|
||||
echo "$l.utf-8 UTF-8"
|
||||
echo "$l.utf-8@euro UTF-8"
|
||||
done
|
||||
for l in he he_IL iw iw_IL; do
|
||||
echo "$l ISO-8859-8"
|
||||
echo "$l.iso-8859-8 ISO-8859-8"
|
||||
echo "$l.cp-862 CP862"
|
||||
echo "$l.cp-1255 CP1255"
|
||||
echo "$l.utf-8 UTF-8"
|
||||
done
|
||||
for l in tr tr_TR; do
|
||||
echo "$l ISO-8859-9"
|
||||
echo "$l.iso-8859-9 ISO-8859-9"
|
||||
echo "$l.cp-857 CP857"
|
||||
echo "$l.cp-1254 CP1254"
|
||||
echo "$l.utf-8 UTF-8"
|
||||
done
|
||||
for l in lt lt_LT lv lv_LV; do
|
||||
#echo "$l BALTIC" # not a commonly used encoding, wrong encoding name
|
||||
echo "$l ISO-8859-13"
|
||||
done
|
||||
for l in ru_UA uk uk_UA; do
|
||||
echo "$l KOI8-U"
|
||||
done
|
||||
for l in zh zh_CN; do
|
||||
#echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name
|
||||
echo "$l GB2312"
|
||||
done
|
||||
for l in ja ja_JP ja_JP.EUC; do
|
||||
echo "$l EUC-JP"
|
||||
done
|
||||
for l in ko ko_KR; do
|
||||
echo "$l EUC-KR"
|
||||
done
|
||||
for l in th th_TH; do
|
||||
echo "$l TIS-620"
|
||||
done
|
||||
for l in fa fa_IR; do
|
||||
#echo "$l ISIRI-3342" # a broken encoding
|
||||
echo "$l.utf-8 UTF-8"
|
||||
done
|
||||
;;
|
||||
linux* | *-gnu*)
|
||||
# With glibc-2.1 or newer, we don't need any canonicalization,
|
||||
# because glibc has iconv and both glibc and libiconv support all
|
||||
# GNU canonical names directly. Therefore, the Makefile does not
|
||||
# need to install the alias file at all.
|
||||
# The following applies only to glibc-2.0.x and older libcs.
|
||||
echo "ISO_646.IRV:1983 ASCII"
|
||||
;;
|
||||
aix*)
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-6 ISO-8859-6"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-8 ISO-8859-8"
|
||||
echo "ISO8859-9 ISO-8859-9"
|
||||
echo "ISO8859-15 ISO-8859-15"
|
||||
echo "IBM-850 CP850"
|
||||
echo "IBM-856 CP856"
|
||||
echo "IBM-921 ISO-8859-13"
|
||||
echo "IBM-922 CP922"
|
||||
echo "IBM-932 CP932"
|
||||
echo "IBM-943 CP943"
|
||||
echo "IBM-1046 CP1046"
|
||||
echo "IBM-1124 CP1124"
|
||||
echo "IBM-1129 CP1129"
|
||||
echo "IBM-1252 CP1252"
|
||||
echo "IBM-eucCN GB2312"
|
||||
echo "IBM-eucJP EUC-JP"
|
||||
echo "IBM-eucKR EUC-KR"
|
||||
echo "IBM-eucTW EUC-TW"
|
||||
echo "big5 BIG5"
|
||||
echo "GBK GBK"
|
||||
echo "TIS-620 TIS-620"
|
||||
echo "UTF-8 UTF-8"
|
||||
;;
|
||||
hpux*)
|
||||
echo "iso88591 ISO-8859-1"
|
||||
echo "iso88592 ISO-8859-2"
|
||||
echo "iso88595 ISO-8859-5"
|
||||
echo "iso88596 ISO-8859-6"
|
||||
echo "iso88597 ISO-8859-7"
|
||||
echo "iso88598 ISO-8859-8"
|
||||
echo "iso88599 ISO-8859-9"
|
||||
echo "iso885915 ISO-8859-15"
|
||||
echo "roman8 HP-ROMAN8"
|
||||
echo "arabic8 HP-ARABIC8"
|
||||
echo "greek8 HP-GREEK8"
|
||||
echo "hebrew8 HP-HEBREW8"
|
||||
echo "turkish8 HP-TURKISH8"
|
||||
echo "kana8 HP-KANA8"
|
||||
echo "tis620 TIS-620"
|
||||
echo "big5 BIG5"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "eucKR EUC-KR"
|
||||
echo "eucTW EUC-TW"
|
||||
echo "hp15CN GB2312"
|
||||
#echo "ccdc ?" # what is this?
|
||||
echo "SJIS SHIFT_JIS"
|
||||
echo "utf8 UTF-8"
|
||||
;;
|
||||
irix*)
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-9 ISO-8859-9"
|
||||
echo "eucCN GB2312"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "eucKR EUC-KR"
|
||||
echo "eucTW EUC-TW"
|
||||
;;
|
||||
osf*)
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-4 ISO-8859-4"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-8 ISO-8859-8"
|
||||
echo "ISO8859-9 ISO-8859-9"
|
||||
echo "ISO8859-15 ISO-8859-15"
|
||||
echo "cp850 CP850"
|
||||
echo "big5 BIG5"
|
||||
echo "dechanyu DEC-HANYU"
|
||||
echo "dechanzi GB2312"
|
||||
echo "deckanji DEC-KANJI"
|
||||
echo "deckorean EUC-KR"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "eucKR EUC-KR"
|
||||
echo "eucTW EUC-TW"
|
||||
echo "GBK GBK"
|
||||
echo "KSC5601 CP949"
|
||||
echo "sdeckanji EUC-JP"
|
||||
echo "SJIS SHIFT_JIS"
|
||||
echo "TACTIS TIS-620"
|
||||
echo "UTF-8 UTF-8"
|
||||
;;
|
||||
solaris*)
|
||||
echo "646 ASCII"
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-3 ISO-8859-3"
|
||||
echo "ISO8859-4 ISO-8859-4"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-6 ISO-8859-6"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-8 ISO-8859-8"
|
||||
echo "ISO8859-9 ISO-8859-9"
|
||||
echo "ISO8859-15 ISO-8859-15"
|
||||
echo "koi8-r KOI8-R"
|
||||
echo "ansi-1251 CP1251"
|
||||
echo "BIG5 BIG5"
|
||||
echo "Big5-HKSCS BIG5-HKSCS"
|
||||
echo "gb2312 GB2312"
|
||||
echo "GBK GBK"
|
||||
echo "GB18030 GB18030"
|
||||
echo "cns11643 EUC-TW"
|
||||
echo "5601 EUC-KR"
|
||||
echo "ko_KR.johap92 JOHAB"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "PCK SHIFT_JIS"
|
||||
echo "TIS620.2533 TIS-620"
|
||||
#echo "sun_eu_greek ?" # what is this?
|
||||
echo "UTF-8 UTF-8"
|
||||
;;
|
||||
freebsd* | os2*)
|
||||
# FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
|
||||
# localcharset.c falls back to using the full locale name
|
||||
# from the environment variables.
|
||||
# Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just
|
||||
# reuse FreeBSD's locale data for OS/2.
|
||||
echo "C ASCII"
|
||||
echo "US-ASCII ASCII"
|
||||
for l in la_LN lt_LN; do
|
||||
echo "$l.ASCII ASCII"
|
||||
done
|
||||
for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
|
||||
fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \
|
||||
lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do
|
||||
echo "$l.ISO_8859-1 ISO-8859-1"
|
||||
echo "$l.DIS_8859-15 ISO-8859-15"
|
||||
done
|
||||
for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do
|
||||
echo "$l.ISO_8859-2 ISO-8859-2"
|
||||
done
|
||||
for l in la_LN lt_LT; do
|
||||
echo "$l.ISO_8859-4 ISO-8859-4"
|
||||
done
|
||||
for l in ru_RU ru_SU; do
|
||||
echo "$l.KOI8-R KOI8-R"
|
||||
echo "$l.ISO_8859-5 ISO-8859-5"
|
||||
echo "$l.CP866 CP866"
|
||||
done
|
||||
echo "uk_UA.KOI8-U KOI8-U"
|
||||
echo "zh_TW.BIG5 BIG5"
|
||||
echo "zh_TW.Big5 BIG5"
|
||||
echo "zh_CN.EUC GB2312"
|
||||
echo "ja_JP.EUC EUC-JP"
|
||||
echo "ja_JP.SJIS SHIFT_JIS"
|
||||
echo "ja_JP.Shift_JIS SHIFT_JIS"
|
||||
echo "ko_KR.EUC EUC-KR"
|
||||
;;
|
||||
netbsd*)
|
||||
echo "646 ASCII"
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-4 ISO-8859-4"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-13 ISO-8859-13"
|
||||
echo "ISO8859-15 ISO-8859-15"
|
||||
echo "eucCN GB2312"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "eucKR EUC-KR"
|
||||
echo "eucTW EUC-TW"
|
||||
echo "BIG5 BIG5"
|
||||
echo "SJIS SHIFT_JIS"
|
||||
;;
|
||||
darwin[56]*)
|
||||
# Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore
|
||||
# localcharset.c falls back to using the full locale name
|
||||
# from the environment variables.
|
||||
echo "C ASCII"
|
||||
for l in en_AU en_CA en_GB en_US la_LN; do
|
||||
echo "$l.US-ASCII ASCII"
|
||||
done
|
||||
for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
|
||||
fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \
|
||||
nl_NL no_NO pt_PT sv_SE; do
|
||||
echo "$l ISO-8859-1"
|
||||
echo "$l.ISO8859-1 ISO-8859-1"
|
||||
echo "$l.ISO8859-15 ISO-8859-15"
|
||||
done
|
||||
for l in la_LN; do
|
||||
echo "$l.ISO8859-1 ISO-8859-1"
|
||||
echo "$l.ISO8859-15 ISO-8859-15"
|
||||
done
|
||||
for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do
|
||||
echo "$l.ISO8859-2 ISO-8859-2"
|
||||
done
|
||||
for l in la_LN lt_LT; do
|
||||
echo "$l.ISO8859-4 ISO-8859-4"
|
||||
done
|
||||
for l in ru_RU; do
|
||||
echo "$l.KOI8-R KOI8-R"
|
||||
echo "$l.ISO8859-5 ISO-8859-5"
|
||||
echo "$l.CP866 CP866"
|
||||
done
|
||||
for l in bg_BG; do
|
||||
echo "$l.CP1251 CP1251"
|
||||
done
|
||||
echo "uk_UA.KOI8-U KOI8-U"
|
||||
echo "zh_TW.BIG5 BIG5"
|
||||
echo "zh_TW.Big5 BIG5"
|
||||
echo "zh_CN.EUC GB2312"
|
||||
echo "ja_JP.EUC EUC-JP"
|
||||
echo "ja_JP.SJIS SHIFT_JIS"
|
||||
echo "ko_KR.EUC EUC-KR"
|
||||
;;
|
||||
darwin*)
|
||||
# Darwin 7.5 has nl_langinfo(CODESET), but it is useless:
|
||||
# - It returns the empty string when LANG is set to a locale of the
|
||||
# form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8
|
||||
# LC_CTYPE file.
|
||||
# - The environment variables LANG, LC_CTYPE, LC_ALL are not set by
|
||||
# the system; nl_langinfo(CODESET) returns "US-ASCII" in this case.
|
||||
# - The documentation says:
|
||||
# "... all code that calls BSD system routines should ensure
|
||||
# that the const *char parameters of these routines are in UTF-8
|
||||
# encoding. All BSD system functions expect their string
|
||||
# parameters to be in UTF-8 encoding and nothing else."
|
||||
# It also says
|
||||
# "An additional caveat is that string parameters for files,
|
||||
# paths, and other file-system entities must be in canonical
|
||||
# UTF-8. In a canonical UTF-8 Unicode string, all decomposable
|
||||
# characters are decomposed ..."
|
||||
# but this is not true: You can pass non-decomposed UTF-8 strings
|
||||
# to file system functions, and it is the OS which will convert
|
||||
# them to decomposed UTF-8 before accessing the file system.
|
||||
# - The Apple Terminal application displays UTF-8 by default.
|
||||
# - However, other applications are free to use different encodings:
|
||||
# - xterm uses ISO-8859-1 by default.
|
||||
# - TextEdit uses MacRoman by default.
|
||||
# We prefer UTF-8 over decomposed UTF-8-MAC because one should
|
||||
# minimize the use of decomposed Unicode. Unfortunately, through the
|
||||
# Darwin file system, decomposed UTF-8 strings are leaked into user
|
||||
# space nevertheless.
|
||||
echo "* UTF-8"
|
||||
;;
|
||||
beos*)
|
||||
# BeOS has a single locale, and it has UTF-8 encoding.
|
||||
echo "* UTF-8"
|
||||
;;
|
||||
msdosdjgpp*)
|
||||
# DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
|
||||
# localcharset.c falls back to using the full locale name
|
||||
# from the environment variables.
|
||||
echo "#"
|
||||
echo "# The encodings given here may not all be correct."
|
||||
echo "# If you find that the encoding given for your language and"
|
||||
echo "# country is not the one your DOS machine actually uses, just"
|
||||
echo "# correct it in this file, and send a mail to"
|
||||
echo "# Juan Manuel Guerrero <juan.guerrero@gmx.de>"
|
||||
echo "# and Bruno Haible <bruno@clisp.org>."
|
||||
echo "#"
|
||||
echo "C ASCII"
|
||||
# ISO-8859-1 languages
|
||||
echo "ca CP850"
|
||||
echo "ca_ES CP850"
|
||||
echo "da CP865" # not CP850 ??
|
||||
echo "da_DK CP865" # not CP850 ??
|
||||
echo "de CP850"
|
||||
echo "de_AT CP850"
|
||||
echo "de_CH CP850"
|
||||
echo "de_DE CP850"
|
||||
echo "en CP850"
|
||||
echo "en_AU CP850" # not CP437 ??
|
||||
echo "en_CA CP850"
|
||||
echo "en_GB CP850"
|
||||
echo "en_NZ CP437"
|
||||
echo "en_US CP437"
|
||||
echo "en_ZA CP850" # not CP437 ??
|
||||
echo "es CP850"
|
||||
echo "es_AR CP850"
|
||||
echo "es_BO CP850"
|
||||
echo "es_CL CP850"
|
||||
echo "es_CO CP850"
|
||||
echo "es_CR CP850"
|
||||
echo "es_CU CP850"
|
||||
echo "es_DO CP850"
|
||||
echo "es_EC CP850"
|
||||
echo "es_ES CP850"
|
||||
echo "es_GT CP850"
|
||||
echo "es_HN CP850"
|
||||
echo "es_MX CP850"
|
||||
echo "es_NI CP850"
|
||||
echo "es_PA CP850"
|
||||
echo "es_PY CP850"
|
||||
echo "es_PE CP850"
|
||||
echo "es_SV CP850"
|
||||
echo "es_UY CP850"
|
||||
echo "es_VE CP850"
|
||||
echo "et CP850"
|
||||
echo "et_EE CP850"
|
||||
echo "eu CP850"
|
||||
echo "eu_ES CP850"
|
||||
echo "fi CP850"
|
||||
echo "fi_FI CP850"
|
||||
echo "fr CP850"
|
||||
echo "fr_BE CP850"
|
||||
echo "fr_CA CP850"
|
||||
echo "fr_CH CP850"
|
||||
echo "fr_FR CP850"
|
||||
echo "ga CP850"
|
||||
echo "ga_IE CP850"
|
||||
echo "gd CP850"
|
||||
echo "gd_GB CP850"
|
||||
echo "gl CP850"
|
||||
echo "gl_ES CP850"
|
||||
echo "id CP850" # not CP437 ??
|
||||
echo "id_ID CP850" # not CP437 ??
|
||||
echo "is CP861" # not CP850 ??
|
||||
echo "is_IS CP861" # not CP850 ??
|
||||
echo "it CP850"
|
||||
echo "it_CH CP850"
|
||||
echo "it_IT CP850"
|
||||
echo "lt CP775"
|
||||
echo "lt_LT CP775"
|
||||
echo "lv CP775"
|
||||
echo "lv_LV CP775"
|
||||
echo "nb CP865" # not CP850 ??
|
||||
echo "nb_NO CP865" # not CP850 ??
|
||||
echo "nl CP850"
|
||||
echo "nl_BE CP850"
|
||||
echo "nl_NL CP850"
|
||||
echo "nn CP865" # not CP850 ??
|
||||
echo "nn_NO CP865" # not CP850 ??
|
||||
echo "no CP865" # not CP850 ??
|
||||
echo "no_NO CP865" # not CP850 ??
|
||||
echo "pt CP850"
|
||||
echo "pt_BR CP850"
|
||||
echo "pt_PT CP850"
|
||||
echo "sv CP850"
|
||||
echo "sv_SE CP850"
|
||||
# ISO-8859-2 languages
|
||||
echo "cs CP852"
|
||||
echo "cs_CZ CP852"
|
||||
echo "hr CP852"
|
||||
echo "hr_HR CP852"
|
||||
echo "hu CP852"
|
||||
echo "hu_HU CP852"
|
||||
echo "pl CP852"
|
||||
echo "pl_PL CP852"
|
||||
echo "ro CP852"
|
||||
echo "ro_RO CP852"
|
||||
echo "sk CP852"
|
||||
echo "sk_SK CP852"
|
||||
echo "sl CP852"
|
||||
echo "sl_SI CP852"
|
||||
echo "sq CP852"
|
||||
echo "sq_AL CP852"
|
||||
echo "sr CP852" # CP852 or CP866 or CP855 ??
|
||||
echo "sr_CS CP852" # CP852 or CP866 or CP855 ??
|
||||
echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
|
||||
# ISO-8859-3 languages
|
||||
echo "mt CP850"
|
||||
echo "mt_MT CP850"
|
||||
# ISO-8859-5 languages
|
||||
echo "be CP866"
|
||||
echo "be_BE CP866"
|
||||
echo "bg CP866" # not CP855 ??
|
||||
echo "bg_BG CP866" # not CP855 ??
|
||||
echo "mk CP866" # not CP855 ??
|
||||
echo "mk_MK CP866" # not CP855 ??
|
||||
echo "ru CP866"
|
||||
echo "ru_RU CP866"
|
||||
echo "uk CP1125"
|
||||
echo "uk_UA CP1125"
|
||||
# ISO-8859-6 languages
|
||||
echo "ar CP864"
|
||||
echo "ar_AE CP864"
|
||||
echo "ar_DZ CP864"
|
||||
echo "ar_EG CP864"
|
||||
echo "ar_IQ CP864"
|
||||
echo "ar_IR CP864"
|
||||
echo "ar_JO CP864"
|
||||
echo "ar_KW CP864"
|
||||
echo "ar_MA CP864"
|
||||
echo "ar_OM CP864"
|
||||
echo "ar_QA CP864"
|
||||
echo "ar_SA CP864"
|
||||
echo "ar_SY CP864"
|
||||
# ISO-8859-7 languages
|
||||
echo "el CP869"
|
||||
echo "el_GR CP869"
|
||||
# ISO-8859-8 languages
|
||||
echo "he CP862"
|
||||
echo "he_IL CP862"
|
||||
# ISO-8859-9 languages
|
||||
echo "tr CP857"
|
||||
echo "tr_TR CP857"
|
||||
# Japanese
|
||||
echo "ja CP932"
|
||||
echo "ja_JP CP932"
|
||||
# Chinese
|
||||
echo "zh_CN GBK"
|
||||
echo "zh_TW CP950" # not CP938 ??
|
||||
# Korean
|
||||
echo "kr CP949" # not CP934 ??
|
||||
echo "kr_KR CP949" # not CP934 ??
|
||||
# Thai
|
||||
echo "th CP874"
|
||||
echo "th_TH CP874"
|
||||
# Other
|
||||
echo "eo CP850"
|
||||
echo "eo_EO CP850"
|
||||
;;
|
||||
esac
|
|
@ -0,0 +1,56 @@
|
|||
/* Implementation of the dcgettext(3) function.
|
||||
Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "gettextP.h"
|
||||
#ifdef _LIBC
|
||||
# include <libintl.h>
|
||||
#else
|
||||
# include "libgnuintl.h"
|
||||
#endif
|
||||
|
||||
/* @@ end of prolog @@ */
|
||||
|
||||
/* Names for the libintl functions are a problem. They must not clash
|
||||
with existing names and they should follow ANSI C. But this source
|
||||
code is also used in GNU C Library where the names have a __
|
||||
prefix. So we have to make a difference here. */
|
||||
#ifdef _LIBC
|
||||
# define DCGETTEXT __dcgettext
|
||||
# define DCIGETTEXT __dcigettext
|
||||
#else
|
||||
# define DCGETTEXT libintl_dcgettext
|
||||
# define DCIGETTEXT libintl_dcigettext
|
||||
#endif
|
||||
|
||||
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
|
||||
locale. */
|
||||
char *
|
||||
DCGETTEXT (const char *domainname, const char *msgid, int category)
|
||||
{
|
||||
return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category);
|
||||
}
|
||||
|
||||
#ifdef _LIBC
|
||||
/* Alias for function name in GNU C Library. */
|
||||
INTDEF(__dcgettext)
|
||||
weak_alias (__dcgettext, dcgettext);
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,57 @@
|
|||
/* Implementation of the dcngettext(3) function.
|
||||
Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "gettextP.h"
|
||||
#ifdef _LIBC
|
||||
# include <libintl.h>
|
||||
#else
|
||||
# include "libgnuintl.h"
|
||||
#endif
|
||||
|
||||
/* @@ end of prolog @@ */
|
||||
|
||||
/* Names for the libintl functions are a problem. They must not clash
|
||||
with existing names and they should follow ANSI C. But this source
|
||||
code is also used in GNU C Library where the names have a __
|
||||
prefix. So we have to make a difference here. */
|
||||
#ifdef _LIBC
|
||||
# define DCNGETTEXT __dcngettext
|
||||
# define DCIGETTEXT __dcigettext
|
||||
#else
|
||||
# define DCNGETTEXT libintl_dcngettext
|
||||
# define DCIGETTEXT libintl_dcigettext
|
||||
#endif
|
||||
|
||||
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
|
||||
locale. */
|
||||
char *
|
||||
DCNGETTEXT (const char *domainname,
|
||||
const char *msgid1, const char *msgid2, unsigned long int n,
|
||||
int category)
|
||||
{
|
||||
return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category);
|
||||
}
|
||||
|
||||
#ifdef _LIBC
|
||||
/* Alias for function name in GNU C Library. */
|
||||
weak_alias (__dcngettext, dcngettext);
|
||||
#endif
|
|
@ -0,0 +1,58 @@
|
|||
/* Implementation of the dgettext(3) function.
|
||||
Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "gettextP.h"
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
#ifdef _LIBC
|
||||
# include <libintl.h>
|
||||
#else
|
||||
# include "libgnuintl.h"
|
||||
#endif
|
||||
|
||||
/* @@ end of prolog @@ */
|
||||
|
||||
/* Names for the libintl functions are a problem. They must not clash
|
||||
with existing names and they should follow ANSI C. But this source
|
||||
code is also used in GNU C Library where the names have a __
|
||||
prefix. So we have to make a difference here. */
|
||||
#ifdef _LIBC
|
||||
# define DGETTEXT __dgettext
|
||||
# define DCGETTEXT INTUSE(__dcgettext)
|
||||
#else
|
||||
# define DGETTEXT libintl_dgettext
|
||||
# define DCGETTEXT libintl_dcgettext
|
||||
#endif
|
||||
|
||||
/* Look up MSGID in the DOMAINNAME message catalog of the current
|
||||
LC_MESSAGES locale. */
|
||||
char *
|
||||
DGETTEXT (const char *domainname, const char *msgid)
|
||||
{
|
||||
return DCGETTEXT (domainname, msgid, LC_MESSAGES);
|
||||
}
|
||||
|
||||
#ifdef _LIBC
|
||||
/* Alias for function name in GNU C Library. */
|
||||
weak_alias (__dgettext, dgettext);
|
||||
#endif
|
|
@ -0,0 +1,59 @@
|
|||
/* Implementation of the dngettext(3) function.
|
||||
Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "gettextP.h"
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
#ifdef _LIBC
|
||||
# include <libintl.h>
|
||||
#else
|
||||
# include "libgnuintl.h"
|
||||
#endif
|
||||
|
||||
/* @@ end of prolog @@ */
|
||||
|
||||
/* Names for the libintl functions are a problem. They must not clash
|
||||
with existing names and they should follow ANSI C. But this source
|
||||
code is also used in GNU C Library where the names have a __
|
||||
prefix. So we have to make a difference here. */
|
||||
#ifdef _LIBC
|
||||
# define DNGETTEXT __dngettext
|
||||
# define DCNGETTEXT __dcngettext
|
||||
#else
|
||||
# define DNGETTEXT libintl_dngettext
|
||||
# define DCNGETTEXT libintl_dcngettext
|
||||
#endif
|
||||
|
||||
/* Look up MSGID in the DOMAINNAME message catalog of the current
|
||||
LC_MESSAGES locale and skip message according to the plural form. */
|
||||
char *
|
||||
DNGETTEXT (const char *domainname,
|
||||
const char *msgid1, const char *msgid2, unsigned long int n)
|
||||
{
|
||||
return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES);
|
||||
}
|
||||
|
||||
#ifdef _LIBC
|
||||
/* Alias for function name in GNU C Library. */
|
||||
weak_alias (__dngettext, dngettext);
|
||||
#endif
|
|
@ -0,0 +1,108 @@
|
|||
/* Plural expression evaluation.
|
||||
Copyright (C) 2000-2003, 2007 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifndef STATIC
|
||||
#define STATIC static
|
||||
#endif
|
||||
|
||||
/* Evaluate the plural expression and return an index value. */
|
||||
STATIC
|
||||
unsigned long int
|
||||
internal_function
|
||||
plural_eval (const struct expression *pexp, unsigned long int n)
|
||||
{
|
||||
switch (pexp->nargs)
|
||||
{
|
||||
case 0:
|
||||
switch (pexp->operation)
|
||||
{
|
||||
case var:
|
||||
return n;
|
||||
case num:
|
||||
return pexp->val.num;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/* NOTREACHED */
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
/* pexp->operation must be lnot. */
|
||||
unsigned long int arg = plural_eval (pexp->val.args[0], n);
|
||||
return ! arg;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
unsigned long int leftarg = plural_eval (pexp->val.args[0], n);
|
||||
if (pexp->operation == lor)
|
||||
return leftarg || plural_eval (pexp->val.args[1], n);
|
||||
else if (pexp->operation == land)
|
||||
return leftarg && plural_eval (pexp->val.args[1], n);
|
||||
else
|
||||
{
|
||||
unsigned long int rightarg = plural_eval (pexp->val.args[1], n);
|
||||
|
||||
switch (pexp->operation)
|
||||
{
|
||||
case mult:
|
||||
return leftarg * rightarg;
|
||||
case divide:
|
||||
#if !INTDIV0_RAISES_SIGFPE
|
||||
if (rightarg == 0)
|
||||
raise (SIGFPE);
|
||||
#endif
|
||||
return leftarg / rightarg;
|
||||
case module:
|
||||
#if !INTDIV0_RAISES_SIGFPE
|
||||
if (rightarg == 0)
|
||||
raise (SIGFPE);
|
||||
#endif
|
||||
return leftarg % rightarg;
|
||||
case plus:
|
||||
return leftarg + rightarg;
|
||||
case minus:
|
||||
return leftarg - rightarg;
|
||||
case less_than:
|
||||
return leftarg < rightarg;
|
||||
case greater_than:
|
||||
return leftarg > rightarg;
|
||||
case less_or_equal:
|
||||
return leftarg <= rightarg;
|
||||
case greater_or_equal:
|
||||
return leftarg >= rightarg;
|
||||
case equal:
|
||||
return leftarg == rightarg;
|
||||
case not_equal:
|
||||
return leftarg != rightarg;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* NOTREACHED */
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
/* pexp->operation must be qmop. */
|
||||
unsigned long int boolarg = plural_eval (pexp->val.args[0], n);
|
||||
return plural_eval (pexp->val.args[boolarg ? 1 : 2], n);
|
||||
}
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,135 @@
|
|||
/* Copyright (C) 1995-1998, 2000-2001, 2003, 2005, 2007 Free Software Foundation, Inc.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "loadinfo.h"
|
||||
|
||||
/* On some strange systems still no definition of NULL is found. Sigh! */
|
||||
#ifndef NULL
|
||||
# if defined __STDC__ && __STDC__
|
||||
# define NULL ((void *) 0)
|
||||
# else
|
||||
# define NULL 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* @@ end of prolog @@ */
|
||||
|
||||
/* Split a locale name NAME into a leading language part and all the
|
||||
rest. Return a pointer to the first character after the language,
|
||||
i.e. to the first byte of the rest. */
|
||||
static char *_nl_find_language (const char *name);
|
||||
|
||||
static char *
|
||||
_nl_find_language (const char *name)
|
||||
{
|
||||
while (name[0] != '\0' && name[0] != '_' && name[0] != '@' && name[0] != '.')
|
||||
++name;
|
||||
|
||||
return (char *) name;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
_nl_explode_name (char *name,
|
||||
const char **language, const char **modifier,
|
||||
const char **territory, const char **codeset,
|
||||
const char **normalized_codeset)
|
||||
{
|
||||
char *cp;
|
||||
int mask;
|
||||
|
||||
*modifier = NULL;
|
||||
*territory = NULL;
|
||||
*codeset = NULL;
|
||||
*normalized_codeset = NULL;
|
||||
|
||||
/* Now we determine the single parts of the locale name. First
|
||||
look for the language. Termination symbols are `_', '.', and `@'. */
|
||||
mask = 0;
|
||||
*language = cp = name;
|
||||
cp = _nl_find_language (*language);
|
||||
|
||||
if (*language == cp)
|
||||
/* This does not make sense: language has to be specified. Use
|
||||
this entry as it is without exploding. Perhaps it is an alias. */
|
||||
cp = strchr (*language, '\0');
|
||||
else
|
||||
{
|
||||
if (cp[0] == '_')
|
||||
{
|
||||
/* Next is the territory. */
|
||||
cp[0] = '\0';
|
||||
*territory = ++cp;
|
||||
|
||||
while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@')
|
||||
++cp;
|
||||
|
||||
mask |= XPG_TERRITORY;
|
||||
}
|
||||
|
||||
if (cp[0] == '.')
|
||||
{
|
||||
/* Next is the codeset. */
|
||||
cp[0] = '\0';
|
||||
*codeset = ++cp;
|
||||
|
||||
while (cp[0] != '\0' && cp[0] != '@')
|
||||
++cp;
|
||||
|
||||
mask |= XPG_CODESET;
|
||||
|
||||
if (*codeset != cp && (*codeset)[0] != '\0')
|
||||
{
|
||||
*normalized_codeset = _nl_normalize_codeset (*codeset,
|
||||
cp - *codeset);
|
||||
if (*normalized_codeset == NULL)
|
||||
return -1;
|
||||
else if (strcmp (*codeset, *normalized_codeset) == 0)
|
||||
free ((char *) *normalized_codeset);
|
||||
else
|
||||
mask |= XPG_NORM_CODESET;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cp[0] == '@')
|
||||
{
|
||||
/* Next is the modifier. */
|
||||
cp[0] = '\0';
|
||||
*modifier = ++cp;
|
||||
|
||||
if (cp[0] != '\0')
|
||||
mask |= XPG_MODIFIER;
|
||||
}
|
||||
|
||||
if (*territory != NULL && (*territory)[0] == '\0')
|
||||
mask &= ~XPG_TERRITORY;
|
||||
|
||||
if (*codeset != NULL && (*codeset)[0] == '\0')
|
||||
mask &= ~XPG_CODESET;
|
||||
|
||||
return mask;
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
#if @HAVE_VISIBILITY@ && BUILDING_LIBINTL
|
||||
#define LIBINTL_DLL_EXPORTED __attribute__((__visibility__("default")))
|
||||
#else
|
||||
#define LIBINTL_DLL_EXPORTED
|
||||
#endif
|
|
@ -0,0 +1,212 @@
|
|||
/* Handle list of needed message catalogs
|
||||
Copyright (C) 1995-1999, 2000-2001, 2003-2007 Free Software Foundation, Inc.
|
||||
Written by Ulrich Drepper <drepper@gnu.org>, 1995.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined HAVE_UNISTD_H || defined _LIBC
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "gettextP.h"
|
||||
#ifdef _LIBC
|
||||
# include <libintl.h>
|
||||
#else
|
||||
# include "libgnuintl.h"
|
||||
#endif
|
||||
|
||||
/* Handle multi-threaded applications. */
|
||||
#ifdef _LIBC
|
||||
# include <bits/libc-lock.h>
|
||||
# define gl_rwlock_define_initialized __libc_rwlock_define_initialized
|
||||
# define gl_rwlock_rdlock __libc_rwlock_rdlock
|
||||
# define gl_rwlock_wrlock __libc_rwlock_wrlock
|
||||
# define gl_rwlock_unlock __libc_rwlock_unlock
|
||||
#else
|
||||
# include "lock.h"
|
||||
#endif
|
||||
|
||||
/* @@ end of prolog @@ */
|
||||
/* List of already loaded domains. */
|
||||
static struct loaded_l10nfile *_nl_loaded_domains;
|
||||
|
||||
|
||||
/* Return a data structure describing the message catalog described by
|
||||
the DOMAINNAME and CATEGORY parameters with respect to the currently
|
||||
established bindings. */
|
||||
struct loaded_l10nfile *
|
||||
internal_function
|
||||
_nl_find_domain (const char *dirname, char *locale,
|
||||
const char *domainname, struct binding *domainbinding)
|
||||
{
|
||||
struct loaded_l10nfile *retval;
|
||||
const char *language;
|
||||
const char *modifier;
|
||||
const char *territory;
|
||||
const char *codeset;
|
||||
const char *normalized_codeset;
|
||||
const char *alias_value;
|
||||
int mask;
|
||||
|
||||
/* LOCALE can consist of up to four recognized parts for the XPG syntax:
|
||||
|
||||
language[_territory][.codeset][@modifier]
|
||||
|
||||
Beside the first part all of them are allowed to be missing. If
|
||||
the full specified locale is not found, the less specific one are
|
||||
looked for. The various parts will be stripped off according to
|
||||
the following order:
|
||||
(1) codeset
|
||||
(2) normalized codeset
|
||||
(3) territory
|
||||
(4) modifier
|
||||
*/
|
||||
|
||||
/* We need to protect modifying the _NL_LOADED_DOMAINS data. */
|
||||
gl_rwlock_define_initialized (static, lock);
|
||||
gl_rwlock_rdlock (lock);
|
||||
|
||||
/* If we have already tested for this locale entry there has to
|
||||
be one data set in the list of loaded domains. */
|
||||
retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
|
||||
strlen (dirname) + 1, 0, locale, NULL, NULL,
|
||||
NULL, NULL, domainname, 0);
|
||||
|
||||
gl_rwlock_unlock (lock);
|
||||
|
||||
if (retval != NULL)
|
||||
{
|
||||
/* We know something about this locale. */
|
||||
int cnt;
|
||||
|
||||
if (retval->decided <= 0)
|
||||
_nl_load_domain (retval, domainbinding);
|
||||
|
||||
if (retval->data != NULL)
|
||||
return retval;
|
||||
|
||||
for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
|
||||
{
|
||||
if (retval->successor[cnt]->decided <= 0)
|
||||
_nl_load_domain (retval->successor[cnt], domainbinding);
|
||||
|
||||
if (retval->successor[cnt]->data != NULL)
|
||||
break;
|
||||
}
|
||||
|
||||
return retval;
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
/* See whether the locale value is an alias. If yes its value
|
||||
*overwrites* the alias name. No test for the original value is
|
||||
done. */
|
||||
alias_value = _nl_expand_alias (locale);
|
||||
if (alias_value != NULL)
|
||||
{
|
||||
#if defined _LIBC || defined HAVE_STRDUP
|
||||
locale = strdup (alias_value);
|
||||
if (locale == NULL)
|
||||
return NULL;
|
||||
#else
|
||||
size_t len = strlen (alias_value) + 1;
|
||||
locale = (char *) malloc (len);
|
||||
if (locale == NULL)
|
||||
return NULL;
|
||||
|
||||
memcpy (locale, alias_value, len);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Now we determine the single parts of the locale name. First
|
||||
look for the language. Termination symbols are `_', '.', and `@'. */
|
||||
mask = _nl_explode_name (locale, &language, &modifier, &territory,
|
||||
&codeset, &normalized_codeset);
|
||||
if (mask == -1)
|
||||
/* This means we are out of core. */
|
||||
return NULL;
|
||||
|
||||
/* We need to protect modifying the _NL_LOADED_DOMAINS data. */
|
||||
gl_rwlock_wrlock (lock);
|
||||
|
||||
/* Create all possible locale entries which might be interested in
|
||||
generalization. */
|
||||
retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
|
||||
strlen (dirname) + 1, mask, language, territory,
|
||||
codeset, normalized_codeset, modifier,
|
||||
domainname, 1);
|
||||
|
||||
gl_rwlock_unlock (lock);
|
||||
|
||||
if (retval == NULL)
|
||||
/* This means we are out of core. */
|
||||
goto out;
|
||||
|
||||
if (retval->decided <= 0)
|
||||
_nl_load_domain (retval, domainbinding);
|
||||
if (retval->data == NULL)
|
||||
{
|
||||
int cnt;
|
||||
for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
|
||||
{
|
||||
if (retval->successor[cnt]->decided <= 0)
|
||||
_nl_load_domain (retval->successor[cnt], domainbinding);
|
||||
if (retval->successor[cnt]->data != NULL)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* The room for an alias was dynamically allocated. Free it now. */
|
||||
if (alias_value != NULL)
|
||||
free (locale);
|
||||
|
||||
out:
|
||||
/* The space for normalized_codeset is dynamically allocated. Free it. */
|
||||
if (mask & XPG_NORM_CODESET)
|
||||
free ((void *) normalized_codeset);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
#ifdef _LIBC
|
||||
/* This is called from iconv/gconv_db.c's free_mem, as locales must
|
||||
be freed before freeing gconv steps arrays. */
|
||||
void __libc_freeres_fn_section
|
||||
_nl_finddomain_subfreeres ()
|
||||
{
|
||||
struct loaded_l10nfile *runp = _nl_loaded_domains;
|
||||
|
||||
while (runp != NULL)
|
||||
{
|
||||
struct loaded_l10nfile *here = runp;
|
||||
if (runp->data != NULL)
|
||||
_nl_unload_domain ((struct loaded_domain *) runp->data);
|
||||
runp = runp->next;
|
||||
free ((char *) here->filename);
|
||||
free (here);
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,63 @@
|
|||
/* Implementation of gettext(3) function.
|
||||
Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef _LIBC
|
||||
# define __need_NULL
|
||||
# include <stddef.h>
|
||||
#else
|
||||
# include <stdlib.h> /* Just for NULL. */
|
||||
#endif
|
||||
|
||||
#include "gettextP.h"
|
||||
#ifdef _LIBC
|
||||
# include <libintl.h>
|
||||
#else
|
||||
# include "libgnuintl.h"
|
||||
#endif
|
||||
|
||||
/* @@ end of prolog @@ */
|
||||
|
||||
/* Names for the libintl functions are a problem. They must not clash
|
||||
with existing names and they should follow ANSI C. But this source
|
||||
code is also used in GNU C Library where the names have a __
|
||||
prefix. So we have to make a difference here. */
|
||||
#ifdef _LIBC
|
||||
# define GETTEXT __gettext
|
||||
# define DCGETTEXT INTUSE(__dcgettext)
|
||||
#else
|
||||
# define GETTEXT libintl_gettext
|
||||
# define DCGETTEXT libintl_dcgettext
|
||||
#endif
|
||||
|
||||
/* Look up MSGID in the current default message catalog for the current
|
||||
LC_MESSAGES locale. If not found, returns MSGID itself (the default
|
||||
text). */
|
||||
char *
|
||||
GETTEXT (const char *msgid)
|
||||
{
|
||||
return DCGETTEXT (NULL, msgid, LC_MESSAGES);
|
||||
}
|
||||
|
||||
#ifdef _LIBC
|
||||
/* Alias for function name in GNU C Library. */
|
||||
weak_alias (__gettext, gettext);
|
||||
#endif
|
|
@ -0,0 +1,297 @@
|
|||
/* Header describing internals of libintl library.
|
||||
Copyright (C) 1995-1999, 2000-2007 Free Software Foundation, Inc.
|
||||
Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifndef _GETTEXTP_H
|
||||
#define _GETTEXTP_H
|
||||
|
||||
#include <stddef.h> /* Get size_t. */
|
||||
|
||||
#ifdef _LIBC
|
||||
# include "../iconv/gconv_int.h"
|
||||
#else
|
||||
# if HAVE_ICONV
|
||||
# include <iconv.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Handle multi-threaded applications. */
|
||||
#ifdef _LIBC
|
||||
# include <bits/libc-lock.h>
|
||||
# define gl_rwlock_define __libc_rwlock_define
|
||||
#else
|
||||
# include "lock.h"
|
||||
#endif
|
||||
|
||||
#ifdef _LIBC
|
||||
extern char *__gettext (const char *__msgid);
|
||||
extern char *__dgettext (const char *__domainname, const char *__msgid);
|
||||
extern char *__dcgettext (const char *__domainname, const char *__msgid,
|
||||
int __category);
|
||||
extern char *__ngettext (const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n);
|
||||
extern char *__dngettext (const char *__domainname,
|
||||
const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int n);
|
||||
extern char *__dcngettext (const char *__domainname,
|
||||
const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n, int __category);
|
||||
extern char *__dcigettext (const char *__domainname,
|
||||
const char *__msgid1, const char *__msgid2,
|
||||
int __plural, unsigned long int __n,
|
||||
int __category);
|
||||
extern char *__textdomain (const char *__domainname);
|
||||
extern char *__bindtextdomain (const char *__domainname,
|
||||
const char *__dirname);
|
||||
extern char *__bind_textdomain_codeset (const char *__domainname,
|
||||
const char *__codeset);
|
||||
extern void _nl_finddomain_subfreeres (void) attribute_hidden;
|
||||
extern void _nl_unload_domain (struct loaded_domain *__domain)
|
||||
internal_function attribute_hidden;
|
||||
#else
|
||||
/* Declare the exported libintl_* functions, in a way that allows us to
|
||||
call them under their real name. */
|
||||
# undef _INTL_REDIRECT_INLINE
|
||||
# undef _INTL_REDIRECT_MACROS
|
||||
# define _INTL_REDIRECT_MACROS
|
||||
# include "libgnuintl.h"
|
||||
# ifdef IN_LIBGLOCALE
|
||||
extern char *gl_dcigettext (const char *__domainname,
|
||||
const char *__msgid1, const char *__msgid2,
|
||||
int __plural, unsigned long int __n,
|
||||
int __category,
|
||||
const char *__localename, const char *__encoding);
|
||||
# else
|
||||
extern char *libintl_dcigettext (const char *__domainname,
|
||||
const char *__msgid1, const char *__msgid2,
|
||||
int __plural, unsigned long int __n,
|
||||
int __category);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include "loadinfo.h"
|
||||
|
||||
#include "gmo.h" /* Get nls_uint32. */
|
||||
|
||||
/* @@ end of prolog @@ */
|
||||
|
||||
#ifndef internal_function
|
||||
# define internal_function
|
||||
#endif
|
||||
|
||||
#ifndef attribute_hidden
|
||||
# define attribute_hidden
|
||||
#endif
|
||||
|
||||
/* Tell the compiler when a conditional or integer expression is
|
||||
almost always true or almost always false. */
|
||||
#ifndef HAVE_BUILTIN_EXPECT
|
||||
# define __builtin_expect(expr, val) (expr)
|
||||
#endif
|
||||
|
||||
#ifndef W
|
||||
# define W(flag, data) ((flag) ? SWAP (data) : (data))
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _LIBC
|
||||
# include <byteswap.h>
|
||||
# define SWAP(i) bswap_32 (i)
|
||||
#else
|
||||
static inline nls_uint32
|
||||
# ifdef __cplusplus
|
||||
SWAP (nls_uint32 i)
|
||||
# else
|
||||
SWAP (i)
|
||||
nls_uint32 i;
|
||||
# endif
|
||||
{
|
||||
return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* In-memory representation of system dependent string. */
|
||||
struct sysdep_string_desc
|
||||
{
|
||||
/* Length of addressed string, including the trailing NUL. */
|
||||
size_t length;
|
||||
/* Pointer to addressed string. */
|
||||
const char *pointer;
|
||||
};
|
||||
|
||||
/* Cache of translated strings after charset conversion.
|
||||
Note: The strings are converted to the target encoding only on an as-needed
|
||||
basis. */
|
||||
struct converted_domain
|
||||
{
|
||||
/* The target encoding name. */
|
||||
const char *encoding;
|
||||
/* The descriptor for conversion from the message catalog's encoding to
|
||||
this target encoding. */
|
||||
#ifdef _LIBC
|
||||
__gconv_t conv;
|
||||
#else
|
||||
# if HAVE_ICONV
|
||||
iconv_t conv;
|
||||
# endif
|
||||
#endif
|
||||
/* The table of translated strings after charset conversion. */
|
||||
char **conv_tab;
|
||||
};
|
||||
|
||||
/* The representation of an opened message catalog. */
|
||||
struct loaded_domain
|
||||
{
|
||||
/* Pointer to memory containing the .mo file. */
|
||||
const char *data;
|
||||
/* 1 if the memory is mmap()ed, 0 if the memory is malloc()ed. */
|
||||
int use_mmap;
|
||||
/* Size of mmap()ed memory. */
|
||||
size_t mmap_size;
|
||||
/* 1 if the .mo file uses a different endianness than this machine. */
|
||||
int must_swap;
|
||||
/* Pointer to additional malloc()ed memory. */
|
||||
void *malloced;
|
||||
|
||||
/* Number of static strings pairs. */
|
||||
nls_uint32 nstrings;
|
||||
/* Pointer to descriptors of original strings in the file. */
|
||||
const struct string_desc *orig_tab;
|
||||
/* Pointer to descriptors of translated strings in the file. */
|
||||
const struct string_desc *trans_tab;
|
||||
|
||||
/* Number of system dependent strings pairs. */
|
||||
nls_uint32 n_sysdep_strings;
|
||||
/* Pointer to descriptors of original sysdep strings. */
|
||||
const struct sysdep_string_desc *orig_sysdep_tab;
|
||||
/* Pointer to descriptors of translated sysdep strings. */
|
||||
const struct sysdep_string_desc *trans_sysdep_tab;
|
||||
|
||||
/* Size of hash table. */
|
||||
nls_uint32 hash_size;
|
||||
/* Pointer to hash table. */
|
||||
const nls_uint32 *hash_tab;
|
||||
/* 1 if the hash table uses a different endianness than this machine. */
|
||||
int must_swap_hash_tab;
|
||||
|
||||
/* Cache of charset conversions of the translated strings. */
|
||||
struct converted_domain *conversions;
|
||||
size_t nconversions;
|
||||
gl_rwlock_define (, conversions_lock)
|
||||
|
||||
const struct expression *plural;
|
||||
unsigned long int nplurals;
|
||||
};
|
||||
|
||||
/* We want to allocate a string at the end of the struct. But ISO C
|
||||
doesn't allow zero sized arrays. */
|
||||
#ifdef __GNUC__
|
||||
# define ZERO 0
|
||||
#else
|
||||
# define ZERO 1
|
||||
#endif
|
||||
|
||||
/* A set of settings bound to a message domain. Used to store settings
|
||||
from bindtextdomain() and bind_textdomain_codeset(). */
|
||||
struct binding
|
||||
{
|
||||
struct binding *next;
|
||||
char *dirname;
|
||||
char *codeset;
|
||||
char domainname[ZERO];
|
||||
};
|
||||
|
||||
/* A counter which is incremented each time some previous translations
|
||||
become invalid.
|
||||
This variable is part of the external ABI of the GNU libintl. */
|
||||
#ifdef IN_LIBGLOCALE
|
||||
# include <glocale/config.h>
|
||||
extern LIBGLOCALE_DLL_EXPORTED int _nl_msg_cat_cntr;
|
||||
#else
|
||||
extern LIBINTL_DLL_EXPORTED int _nl_msg_cat_cntr;
|
||||
#endif
|
||||
|
||||
#ifndef _LIBC
|
||||
extern const char *_nl_language_preferences_default (void);
|
||||
# define gl_locale_name_canonicalize _nl_locale_name_canonicalize
|
||||
extern void _nl_locale_name_canonicalize (char *name);
|
||||
# define gl_locale_name_posix _nl_locale_name_posix
|
||||
extern const char *_nl_locale_name_posix (int category,
|
||||
const char *categoryname);
|
||||
# define gl_locale_name_default _nl_locale_name_default
|
||||
extern const char *_nl_locale_name_default (void);
|
||||
# define gl_locale_name _nl_locale_name
|
||||
extern const char *_nl_locale_name (int category, const char *categoryname);
|
||||
#endif
|
||||
|
||||
struct loaded_l10nfile *_nl_find_domain (const char *__dirname, char *__locale,
|
||||
const char *__domainname,
|
||||
struct binding *__domainbinding)
|
||||
internal_function;
|
||||
void _nl_load_domain (struct loaded_l10nfile *__domain,
|
||||
struct binding *__domainbinding)
|
||||
internal_function;
|
||||
|
||||
#ifdef IN_LIBGLOCALE
|
||||
char *_nl_find_msg (struct loaded_l10nfile *domain_file,
|
||||
struct binding *domainbinding, const char *encoding,
|
||||
const char *msgid,
|
||||
size_t *lengthp)
|
||||
internal_function;
|
||||
#else
|
||||
char *_nl_find_msg (struct loaded_l10nfile *domain_file,
|
||||
struct binding *domainbinding, const char *msgid,
|
||||
int convert, size_t *lengthp)
|
||||
internal_function;
|
||||
#endif
|
||||
|
||||
/* The internal variables in the standalone libintl.a must have different
|
||||
names than the internal variables in GNU libc, otherwise programs
|
||||
using libintl.a cannot be linked statically. */
|
||||
#if !defined _LIBC
|
||||
# define _nl_default_dirname libintl_nl_default_dirname
|
||||
# define _nl_domain_bindings libintl_nl_domain_bindings
|
||||
#endif
|
||||
|
||||
/* Contains the default location of the message catalogs. */
|
||||
extern const char _nl_default_dirname[];
|
||||
#ifdef _LIBC
|
||||
libc_hidden_proto (_nl_default_dirname)
|
||||
#endif
|
||||
|
||||
/* List with bindings of specific domains. */
|
||||
extern struct binding *_nl_domain_bindings;
|
||||
|
||||
/* The internal variables in the standalone libintl.a must have different
|
||||
names than the internal variables in GNU libc, otherwise programs
|
||||
using libintl.a cannot be linked statically. */
|
||||
#if !defined _LIBC
|
||||
# define _nl_default_default_domain libintl_nl_default_default_domain
|
||||
# define _nl_current_default_domain libintl_nl_current_default_domain
|
||||
#endif
|
||||
|
||||
/* Name of the default text domain. */
|
||||
extern const char _nl_default_default_domain[] attribute_hidden;
|
||||
|
||||
/* Default text domain in which entries for gettext(3) are to be found. */
|
||||
extern const char *_nl_current_default_domain attribute_hidden;
|
||||
|
||||
/* @@ begin of epilog @@ */
|
||||
|
||||
#endif /* gettextP.h */
|
|
@ -0,0 +1,152 @@
|
|||
/* Description of GNU message catalog format: general file layout.
|
||||
Copyright (C) 1995, 1997, 2000-2002, 2004, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifndef _GETTEXT_H
|
||||
#define _GETTEXT_H 1
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
/* @@ end of prolog @@ */
|
||||
|
||||
/* The magic number of the GNU message catalog format. */
|
||||
#define _MAGIC 0x950412de
|
||||
#define _MAGIC_SWAPPED 0xde120495
|
||||
|
||||
/* Revision number of the currently used .mo (binary) file format. */
|
||||
#define MO_REVISION_NUMBER 0
|
||||
#define MO_REVISION_NUMBER_WITH_SYSDEP_I 1
|
||||
|
||||
/* The following contortions are an attempt to use the C preprocessor
|
||||
to determine an unsigned integral type that is 32 bits wide. An
|
||||
alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
|
||||
as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work
|
||||
when cross-compiling. */
|
||||
|
||||
#if __STDC__
|
||||
# define UINT_MAX_32_BITS 4294967295U
|
||||
#else
|
||||
# define UINT_MAX_32_BITS 0xFFFFFFFF
|
||||
#endif
|
||||
|
||||
/* If UINT_MAX isn't defined, assume it's a 32-bit type.
|
||||
This should be valid for all systems GNU cares about because
|
||||
that doesn't include 16-bit systems, and only modern systems
|
||||
(that certainly have <limits.h>) have 64+-bit integral types. */
|
||||
|
||||
#ifndef UINT_MAX
|
||||
# define UINT_MAX UINT_MAX_32_BITS
|
||||
#endif
|
||||
|
||||
#if UINT_MAX == UINT_MAX_32_BITS
|
||||
typedef unsigned nls_uint32;
|
||||
#else
|
||||
# if USHRT_MAX == UINT_MAX_32_BITS
|
||||
typedef unsigned short nls_uint32;
|
||||
# else
|
||||
# if ULONG_MAX == UINT_MAX_32_BITS
|
||||
typedef unsigned long nls_uint32;
|
||||
# else
|
||||
/* The following line is intended to throw an error. Using #error is
|
||||
not portable enough. */
|
||||
"Cannot determine unsigned 32-bit data type."
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Header for binary .mo file format. */
|
||||
struct mo_file_header
|
||||
{
|
||||
/* The magic number. */
|
||||
nls_uint32 magic;
|
||||
/* The revision number of the file format. */
|
||||
nls_uint32 revision;
|
||||
|
||||
/* The following are only used in .mo files with major revision 0 or 1. */
|
||||
|
||||
/* The number of strings pairs. */
|
||||
nls_uint32 nstrings;
|
||||
/* Offset of table with start offsets of original strings. */
|
||||
nls_uint32 orig_tab_offset;
|
||||
/* Offset of table with start offsets of translated strings. */
|
||||
nls_uint32 trans_tab_offset;
|
||||
/* Size of hash table. */
|
||||
nls_uint32 hash_tab_size;
|
||||
/* Offset of first hash table entry. */
|
||||
nls_uint32 hash_tab_offset;
|
||||
|
||||
/* The following are only used in .mo files with minor revision >= 1. */
|
||||
|
||||
/* The number of system dependent segments. */
|
||||
nls_uint32 n_sysdep_segments;
|
||||
/* Offset of table describing system dependent segments. */
|
||||
nls_uint32 sysdep_segments_offset;
|
||||
/* The number of system dependent strings pairs. */
|
||||
nls_uint32 n_sysdep_strings;
|
||||
/* Offset of table with start offsets of original sysdep strings. */
|
||||
nls_uint32 orig_sysdep_tab_offset;
|
||||
/* Offset of table with start offsets of translated sysdep strings. */
|
||||
nls_uint32 trans_sysdep_tab_offset;
|
||||
};
|
||||
|
||||
/* Descriptor for static string contained in the binary .mo file. */
|
||||
struct string_desc
|
||||
{
|
||||
/* Length of addressed string, not including the trailing NUL. */
|
||||
nls_uint32 length;
|
||||
/* Offset of string in file. */
|
||||
nls_uint32 offset;
|
||||
};
|
||||
|
||||
/* The following are only used in .mo files with minor revision >= 1. */
|
||||
|
||||
/* Descriptor for system dependent string segment. */
|
||||
struct sysdep_segment
|
||||
{
|
||||
/* Length of addressed string, including the trailing NUL. */
|
||||
nls_uint32 length;
|
||||
/* Offset of string in file. */
|
||||
nls_uint32 offset;
|
||||
};
|
||||
|
||||
/* Pair of a static and a system dependent segment, in struct sysdep_string. */
|
||||
struct segment_pair
|
||||
{
|
||||
/* Size of static segment. */
|
||||
nls_uint32 segsize;
|
||||
/* Reference to system dependent string segment, or ~0 at the end. */
|
||||
nls_uint32 sysdepref;
|
||||
};
|
||||
|
||||
/* Descriptor for system dependent string. */
|
||||
struct sysdep_string
|
||||
{
|
||||
/* Offset of static string segments in file. */
|
||||
nls_uint32 offset;
|
||||
/* Alternating sequence of static and system dependent segments.
|
||||
The last segment is a static segment, including the trailing NUL. */
|
||||
struct segment_pair segments[1];
|
||||
};
|
||||
|
||||
/* Marker for the end of the segments[] array. This has the value 0xFFFFFFFF,
|
||||
regardless whether 'int' is 16 bit, 32 bit, or 64 bit. */
|
||||
#define SEGMENTS_END ((nls_uint32) ~0)
|
||||
|
||||
/* @@ begin of epilog @@ */
|
||||
|
||||
#endif /* gettext.h */
|
|
@ -0,0 +1,51 @@
|
|||
/* Implements a string hashing function.
|
||||
Copyright (C) 1995, 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C 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.
|
||||
|
||||
The GNU C 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 the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Specification. */
|
||||
#include "hash-string.h"
|
||||
|
||||
|
||||
/* Defines the so called `hashpjw' function by P.J. Weinberger
|
||||
[see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
|
||||
1986, 1987 Bell Telephone Laboratories, Inc.] */
|
||||
unsigned long int
|
||||
__hash_string (const char *str_param)
|
||||
{
|
||||
unsigned long int hval, g;
|
||||
const char *str = str_param;
|
||||
|
||||
/* Compute the hash value for the given string. */
|
||||
hval = 0;
|
||||
while (*str != '\0')
|
||||
{
|
||||
hval <<= 4;
|
||||
hval += (unsigned char) *str++;
|
||||
g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4));
|
||||
if (g != 0)
|
||||
{
|
||||
hval ^= g >> (HASHWORDBITS - 8);
|
||||
hval ^= g;
|
||||
}
|
||||
}
|
||||
return hval;
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
/* Description of GNU message catalog format: string hashing function.
|
||||
Copyright (C) 1995, 1997-1998, 2000-2003, 2005 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
/* @@ end of prolog @@ */
|
||||
|
||||
/* We assume to have `unsigned long int' value with at least 32 bits. */
|
||||
#define HASHWORDBITS 32
|
||||
|
||||
|
||||
#ifndef _LIBC
|
||||
# ifdef IN_LIBINTL
|
||||
# define __hash_string libintl_hash_string
|
||||
# else
|
||||
# define __hash_string hash_string
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Defines the so called `hashpjw' function by P.J. Weinberger
|
||||
[see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
|
||||
1986, 1987 Bell Telephone Laboratories, Inc.] */
|
||||
extern unsigned long int __hash_string (const char *str_param);
|
|
@ -0,0 +1,133 @@
|
|||
/* intl-compat.c - Stub functions to call gettext functions from GNU gettext
|
||||
Library.
|
||||
Copyright (C) 1995, 2000-2003, 2005 Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "gettextP.h"
|
||||
|
||||
/* @@ end of prolog @@ */
|
||||
|
||||
/* This file redirects the gettext functions (without prefix) to those
|
||||
defined in the included GNU libintl library (with "libintl_" prefix).
|
||||
It is compiled into libintl in order to make the AM_GNU_GETTEXT test
|
||||
of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which
|
||||
has the redirections primarily in the <libintl.h> include file.
|
||||
It is also compiled into libgnuintl so that libgnuintl.so can be used
|
||||
as LD_PRELOADable library on glibc systems, to provide the extra
|
||||
features that the functions in the libc don't have (namely, logging). */
|
||||
|
||||
|
||||
#undef gettext
|
||||
#undef dgettext
|
||||
#undef dcgettext
|
||||
#undef ngettext
|
||||
#undef dngettext
|
||||
#undef dcngettext
|
||||
#undef textdomain
|
||||
#undef bindtextdomain
|
||||
#undef bind_textdomain_codeset
|
||||
|
||||
|
||||
/* When building a DLL, we must export some functions. Note that because
|
||||
the functions are only defined for binary backward compatibility, we
|
||||
don't need to use __declspec(dllimport) in any case. */
|
||||
#if HAVE_VISIBILITY && BUILDING_DLL
|
||||
# define DLL_EXPORTED __attribute__((__visibility__("default")))
|
||||
#elif defined _MSC_VER && BUILDING_DLL
|
||||
# define DLL_EXPORTED __declspec(dllexport)
|
||||
#else
|
||||
# define DLL_EXPORTED
|
||||
#endif
|
||||
|
||||
|
||||
DLL_EXPORTED
|
||||
char *
|
||||
gettext (const char *msgid)
|
||||
{
|
||||
return libintl_gettext (msgid);
|
||||
}
|
||||
|
||||
|
||||
DLL_EXPORTED
|
||||
char *
|
||||
dgettext (const char *domainname, const char *msgid)
|
||||
{
|
||||
return libintl_dgettext (domainname, msgid);
|
||||
}
|
||||
|
||||
|
||||
DLL_EXPORTED
|
||||
char *
|
||||
dcgettext (const char *domainname, const char *msgid, int category)
|
||||
{
|
||||
return libintl_dcgettext (domainname, msgid, category);
|
||||
}
|
||||
|
||||
|
||||
DLL_EXPORTED
|
||||
char *
|
||||
ngettext (const char *msgid1, const char *msgid2, unsigned long int n)
|
||||
{
|
||||
return libintl_ngettext (msgid1, msgid2, n);
|
||||
}
|
||||
|
||||
|
||||
DLL_EXPORTED
|
||||
char *
|
||||
dngettext (const char *domainname,
|
||||
const char *msgid1, const char *msgid2, unsigned long int n)
|
||||
{
|
||||
return libintl_dngettext (domainname, msgid1, msgid2, n);
|
||||
}
|
||||
|
||||
|
||||
DLL_EXPORTED
|
||||
char *
|
||||
dcngettext (const char *domainname,
|
||||
const char *msgid1, const char *msgid2, unsigned long int n,
|
||||
int category)
|
||||
{
|
||||
return libintl_dcngettext (domainname, msgid1, msgid2, n, category);
|
||||
}
|
||||
|
||||
|
||||
DLL_EXPORTED
|
||||
char *
|
||||
textdomain (const char *domainname)
|
||||
{
|
||||
return libintl_textdomain (domainname);
|
||||
}
|
||||
|
||||
|
||||
DLL_EXPORTED
|
||||
char *
|
||||
bindtextdomain (const char *domainname, const char *dirname)
|
||||
{
|
||||
return libintl_bindtextdomain (domainname, dirname);
|
||||
}
|
||||
|
||||
|
||||
DLL_EXPORTED
|
||||
char *
|
||||
bind_textdomain_codeset (const char *domainname, const char *codeset)
|
||||
{
|
||||
return libintl_bind_textdomain_codeset (domainname, codeset);
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
/* List of exported symbols of libintl on Cygwin.
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2006.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
/* IMP(x) is a symbol that contains the address of x. */
|
||||
#define IMP(x) _imp__##x
|
||||
|
||||
/* Ensure that the variable x is exported from the library, and that a
|
||||
pseudo-variable IMP(x) is available. */
|
||||
#define VARIABLE(x) \
|
||||
/* Export x without redefining x. This code was found by compiling a \
|
||||
snippet: \
|
||||
extern __declspec(dllexport) int x; int x = 42; */ \
|
||||
asm (".section .drectve\n"); \
|
||||
asm (".ascii \" -export:" #x ",data\"\n"); \
|
||||
asm (".data\n"); \
|
||||
/* Allocate a pseudo-variable IMP(x). */ \
|
||||
extern int x; \
|
||||
void * IMP(x) = &x;
|
||||
|
||||
VARIABLE(libintl_version)
|
|
@ -0,0 +1,400 @@
|
|||
/* Copyright (C) 1995-1999, 2000-2006 Free Software Foundation, Inc.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
/* Tell glibc's <string.h> to provide a prototype for stpcpy().
|
||||
This must come before <config.h> because <config.h> may include
|
||||
<features.h>, and once <features.h> has been included, it's too late. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE 1
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#if defined _LIBC || defined HAVE_ARGZ_H
|
||||
# include <argz.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "loadinfo.h"
|
||||
|
||||
/* On some strange systems still no definition of NULL is found. Sigh! */
|
||||
#ifndef NULL
|
||||
# if defined __STDC__ && __STDC__
|
||||
# define NULL ((void *) 0)
|
||||
# else
|
||||
# define NULL 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* @@ end of prolog @@ */
|
||||
|
||||
#ifdef _LIBC
|
||||
/* Rename the non ANSI C functions. This is required by the standard
|
||||
because some ANSI C functions will require linking with this object
|
||||
file and the name space must not be polluted. */
|
||||
# ifndef stpcpy
|
||||
# define stpcpy(dest, src) __stpcpy(dest, src)
|
||||
# endif
|
||||
#else
|
||||
# ifndef HAVE_STPCPY
|
||||
static char *stpcpy (char *dest, const char *src);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Pathname support.
|
||||
ISSLASH(C) tests whether C is a directory separator character.
|
||||
IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not,
|
||||
it may be concatenated to a directory pathname.
|
||||
*/
|
||||
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
|
||||
/* Win32, Cygwin, OS/2, DOS */
|
||||
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
|
||||
# define HAS_DEVICE(P) \
|
||||
((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
|
||||
&& (P)[1] == ':')
|
||||
# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
|
||||
#else
|
||||
/* Unix */
|
||||
# define ISSLASH(C) ((C) == '/')
|
||||
# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
|
||||
#endif
|
||||
|
||||
/* Define function which are usually not available. */
|
||||
|
||||
#ifdef _LIBC
|
||||
# define __argz_count(argz, len) INTUSE(__argz_count) (argz, len)
|
||||
#elif defined HAVE_ARGZ_COUNT
|
||||
# undef __argz_count
|
||||
# define __argz_count argz_count
|
||||
#else
|
||||
/* Returns the number of strings in ARGZ. */
|
||||
static size_t
|
||||
argz_count__ (const char *argz, size_t len)
|
||||
{
|
||||
size_t count = 0;
|
||||
while (len > 0)
|
||||
{
|
||||
size_t part_len = strlen (argz);
|
||||
argz += part_len + 1;
|
||||
len -= part_len + 1;
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
# undef __argz_count
|
||||
# define __argz_count(argz, len) argz_count__ (argz, len)
|
||||
#endif /* !_LIBC && !HAVE_ARGZ_COUNT */
|
||||
|
||||
#ifdef _LIBC
|
||||
# define __argz_stringify(argz, len, sep) \
|
||||
INTUSE(__argz_stringify) (argz, len, sep)
|
||||
#elif defined HAVE_ARGZ_STRINGIFY
|
||||
# undef __argz_stringify
|
||||
# define __argz_stringify argz_stringify
|
||||
#else
|
||||
/* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
|
||||
except the last into the character SEP. */
|
||||
static void
|
||||
argz_stringify__ (char *argz, size_t len, int sep)
|
||||
{
|
||||
while (len > 0)
|
||||
{
|
||||
size_t part_len = strlen (argz);
|
||||
argz += part_len;
|
||||
len -= part_len + 1;
|
||||
if (len > 0)
|
||||
*argz++ = sep;
|
||||
}
|
||||
}
|
||||
# undef __argz_stringify
|
||||
# define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep)
|
||||
#endif /* !_LIBC && !HAVE_ARGZ_STRINGIFY */
|
||||
|
||||
#ifdef _LIBC
|
||||
#elif defined HAVE_ARGZ_NEXT
|
||||
# undef __argz_next
|
||||
# define __argz_next argz_next
|
||||
#else
|
||||
static char *
|
||||
argz_next__ (char *argz, size_t argz_len, const char *entry)
|
||||
{
|
||||
if (entry)
|
||||
{
|
||||
if (entry < argz + argz_len)
|
||||
entry = strchr (entry, '\0') + 1;
|
||||
|
||||
return entry >= argz + argz_len ? NULL : (char *) entry;
|
||||
}
|
||||
else
|
||||
if (argz_len > 0)
|
||||
return argz;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
# undef __argz_next
|
||||
# define __argz_next(argz, len, entry) argz_next__ (argz, len, entry)
|
||||
#endif /* !_LIBC && !HAVE_ARGZ_NEXT */
|
||||
|
||||
|
||||
/* Return number of bits set in X. */
|
||||
static inline int
|
||||
pop (int x)
|
||||
{
|
||||
/* We assume that no more than 16 bits are used. */
|
||||
x = ((x & ~0x5555) >> 1) + (x & 0x5555);
|
||||
x = ((x & ~0x3333) >> 2) + (x & 0x3333);
|
||||
x = ((x >> 4) + x) & 0x0f0f;
|
||||
x = ((x >> 8) + x) & 0xff;
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
struct loaded_l10nfile *
|
||||
_nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list,
|
||||
const char *dirlist, size_t dirlist_len,
|
||||
int mask, const char *language, const char *territory,
|
||||
const char *codeset, const char *normalized_codeset,
|
||||
const char *modifier,
|
||||
const char *filename, int do_allocate)
|
||||
{
|
||||
char *abs_filename;
|
||||
struct loaded_l10nfile **lastp;
|
||||
struct loaded_l10nfile *retval;
|
||||
char *cp;
|
||||
size_t dirlist_count;
|
||||
size_t entries;
|
||||
int cnt;
|
||||
|
||||
/* If LANGUAGE contains an absolute directory specification, we ignore
|
||||
DIRLIST. */
|
||||
if (IS_ABSOLUTE_PATH (language))
|
||||
dirlist_len = 0;
|
||||
|
||||
/* Allocate room for the full file name. */
|
||||
abs_filename = (char *) malloc (dirlist_len
|
||||
+ strlen (language)
|
||||
+ ((mask & XPG_TERRITORY) != 0
|
||||
? strlen (territory) + 1 : 0)
|
||||
+ ((mask & XPG_CODESET) != 0
|
||||
? strlen (codeset) + 1 : 0)
|
||||
+ ((mask & XPG_NORM_CODESET) != 0
|
||||
? strlen (normalized_codeset) + 1 : 0)
|
||||
+ ((mask & XPG_MODIFIER) != 0
|
||||
? strlen (modifier) + 1 : 0)
|
||||
+ 1 + strlen (filename) + 1);
|
||||
|
||||
if (abs_filename == NULL)
|
||||
return NULL;
|
||||
|
||||
/* Construct file name. */
|
||||
cp = abs_filename;
|
||||
if (dirlist_len > 0)
|
||||
{
|
||||
memcpy (cp, dirlist, dirlist_len);
|
||||
__argz_stringify (cp, dirlist_len, PATH_SEPARATOR);
|
||||
cp += dirlist_len;
|
||||
cp[-1] = '/';
|
||||
}
|
||||
|
||||
cp = stpcpy (cp, language);
|
||||
|
||||
if ((mask & XPG_TERRITORY) != 0)
|
||||
{
|
||||
*cp++ = '_';
|
||||
cp = stpcpy (cp, territory);
|
||||
}
|
||||
if ((mask & XPG_CODESET) != 0)
|
||||
{
|
||||
*cp++ = '.';
|
||||
cp = stpcpy (cp, codeset);
|
||||
}
|
||||
if ((mask & XPG_NORM_CODESET) != 0)
|
||||
{
|
||||
*cp++ = '.';
|
||||
cp = stpcpy (cp, normalized_codeset);
|
||||
}
|
||||
if ((mask & XPG_MODIFIER) != 0)
|
||||
{
|
||||
*cp++ = '@';
|
||||
cp = stpcpy (cp, modifier);
|
||||
}
|
||||
|
||||
*cp++ = '/';
|
||||
stpcpy (cp, filename);
|
||||
|
||||
/* Look in list of already loaded domains whether it is already
|
||||
available. */
|
||||
lastp = l10nfile_list;
|
||||
for (retval = *l10nfile_list; retval != NULL; retval = retval->next)
|
||||
if (retval->filename != NULL)
|
||||
{
|
||||
int compare = strcmp (retval->filename, abs_filename);
|
||||
if (compare == 0)
|
||||
/* We found it! */
|
||||
break;
|
||||
if (compare < 0)
|
||||
{
|
||||
/* It's not in the list. */
|
||||
retval = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
lastp = &retval->next;
|
||||
}
|
||||
|
||||
if (retval != NULL || do_allocate == 0)
|
||||
{
|
||||
free (abs_filename);
|
||||
return retval;
|
||||
}
|
||||
|
||||
dirlist_count = (dirlist_len > 0 ? __argz_count (dirlist, dirlist_len) : 1);
|
||||
|
||||
/* Allocate a new loaded_l10nfile. */
|
||||
retval =
|
||||
(struct loaded_l10nfile *)
|
||||
malloc (sizeof (*retval)
|
||||
+ (((dirlist_count << pop (mask)) + (dirlist_count > 1 ? 1 : 0))
|
||||
* sizeof (struct loaded_l10nfile *)));
|
||||
if (retval == NULL)
|
||||
{
|
||||
free (abs_filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
retval->filename = abs_filename;
|
||||
|
||||
/* We set retval->data to NULL here; it is filled in later.
|
||||
Setting retval->decided to 1 here means that retval does not
|
||||
correspond to a real file (dirlist_count > 1) or is not worth
|
||||
looking up (if an unnormalized codeset was specified). */
|
||||
retval->decided = (dirlist_count > 1
|
||||
|| ((mask & XPG_CODESET) != 0
|
||||
&& (mask & XPG_NORM_CODESET) != 0));
|
||||
retval->data = NULL;
|
||||
|
||||
retval->next = *lastp;
|
||||
*lastp = retval;
|
||||
|
||||
entries = 0;
|
||||
/* Recurse to fill the inheritance list of RETVAL.
|
||||
If the DIRLIST is a real list (i.e. DIRLIST_COUNT > 1), the RETVAL
|
||||
entry does not correspond to a real file; retval->filename contains
|
||||
colons. In this case we loop across all elements of DIRLIST and
|
||||
across all bit patterns dominated by MASK.
|
||||
If the DIRLIST is a single directory or entirely redundant (i.e.
|
||||
DIRLIST_COUNT == 1), we loop across all bit patterns dominated by
|
||||
MASK, excluding MASK itself.
|
||||
In either case, we loop down from MASK to 0. This has the effect
|
||||
that the extra bits in the locale name are dropped in this order:
|
||||
first the modifier, then the territory, then the codeset, then the
|
||||
normalized_codeset. */
|
||||
for (cnt = dirlist_count > 1 ? mask : mask - 1; cnt >= 0; --cnt)
|
||||
if ((cnt & ~mask) == 0
|
||||
&& !((cnt & XPG_CODESET) != 0 && (cnt & XPG_NORM_CODESET) != 0))
|
||||
{
|
||||
if (dirlist_count > 1)
|
||||
{
|
||||
/* Iterate over all elements of the DIRLIST. */
|
||||
char *dir = NULL;
|
||||
|
||||
while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir))
|
||||
!= NULL)
|
||||
retval->successor[entries++]
|
||||
= _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1,
|
||||
cnt, language, territory, codeset,
|
||||
normalized_codeset, modifier, filename,
|
||||
1);
|
||||
}
|
||||
else
|
||||
retval->successor[entries++]
|
||||
= _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len,
|
||||
cnt, language, territory, codeset,
|
||||
normalized_codeset, modifier, filename, 1);
|
||||
}
|
||||
retval->successor[entries] = NULL;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* Normalize codeset name. There is no standard for the codeset
|
||||
names. Normalization allows the user to use any of the common
|
||||
names. The return value is dynamically allocated and has to be
|
||||
freed by the caller. */
|
||||
const char *
|
||||
_nl_normalize_codeset (const char *codeset, size_t name_len)
|
||||
{
|
||||
int len = 0;
|
||||
int only_digit = 1;
|
||||
char *retval;
|
||||
char *wp;
|
||||
size_t cnt;
|
||||
|
||||
for (cnt = 0; cnt < name_len; ++cnt)
|
||||
if (isalnum ((unsigned char) codeset[cnt]))
|
||||
{
|
||||
++len;
|
||||
|
||||
if (isalpha ((unsigned char) codeset[cnt]))
|
||||
only_digit = 0;
|
||||
}
|
||||
|
||||
retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1);
|
||||
|
||||
if (retval != NULL)
|
||||
{
|
||||
if (only_digit)
|
||||
wp = stpcpy (retval, "iso");
|
||||
else
|
||||
wp = retval;
|
||||
|
||||
for (cnt = 0; cnt < name_len; ++cnt)
|
||||
if (isalpha ((unsigned char) codeset[cnt]))
|
||||
*wp++ = tolower ((unsigned char) codeset[cnt]);
|
||||
else if (isdigit ((unsigned char) codeset[cnt]))
|
||||
*wp++ = codeset[cnt];
|
||||
|
||||
*wp = '\0';
|
||||
}
|
||||
|
||||
return (const char *) retval;
|
||||
}
|
||||
|
||||
|
||||
/* @@ begin of epilog @@ */
|
||||
|
||||
/* We don't want libintl.a to depend on any other library. So we
|
||||
avoid the non-standard function stpcpy. In GNU C Library this
|
||||
function is available, though. Also allow the symbol HAVE_STPCPY
|
||||
to be defined. */
|
||||
#if !_LIBC && !HAVE_STPCPY
|
||||
static char *
|
||||
stpcpy (char *dest, const char *src)
|
||||
{
|
||||
while ((*dest++ = *src++) != '\0')
|
||||
/* Do nothing. */ ;
|
||||
return dest - 1;
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,130 @@
|
|||
/* Determine the user's language preferences.
|
||||
Copyright (C) 2004-2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
/* Written by Bruno Haible <bruno@clisp.org>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#if HAVE_CFPREFERENCESCOPYAPPVALUE
|
||||
# include <string.h>
|
||||
# include <CoreFoundation/CFPreferences.h>
|
||||
# include <CoreFoundation/CFPropertyList.h>
|
||||
# include <CoreFoundation/CFArray.h>
|
||||
# include <CoreFoundation/CFString.h>
|
||||
extern void _nl_locale_name_canonicalize (char *name);
|
||||
#endif
|
||||
|
||||
/* Determine the user's language preferences, as a colon separated list of
|
||||
locale names in XPG syntax
|
||||
language[_territory][.codeset][@modifier]
|
||||
The result must not be freed; it is statically allocated.
|
||||
The LANGUAGE environment variable does not need to be considered; it is
|
||||
already taken into account by the caller. */
|
||||
|
||||
const char *
|
||||
_nl_language_preferences_default (void)
|
||||
{
|
||||
#if HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.2 or newer */
|
||||
{
|
||||
/* Cache the preferences list, since CoreFoundation calls are expensive. */
|
||||
static const char *cached_languages;
|
||||
static int cache_initialized;
|
||||
|
||||
if (!cache_initialized)
|
||||
{
|
||||
CFTypeRef preferences =
|
||||
CFPreferencesCopyAppValue (CFSTR ("AppleLanguages"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
if (preferences != NULL
|
||||
&& CFGetTypeID (preferences) == CFArrayGetTypeID ())
|
||||
{
|
||||
CFArrayRef prefArray = (CFArrayRef)preferences;
|
||||
int n = CFArrayGetCount (prefArray);
|
||||
char buf[256];
|
||||
size_t size = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
CFTypeRef element = CFArrayGetValueAtIndex (prefArray, i);
|
||||
if (element != NULL
|
||||
&& CFGetTypeID (element) == CFStringGetTypeID ()
|
||||
&& CFStringGetCString ((CFStringRef)element,
|
||||
buf, sizeof (buf),
|
||||
kCFStringEncodingASCII))
|
||||
{
|
||||
_nl_locale_name_canonicalize (buf);
|
||||
size += strlen (buf) + 1;
|
||||
/* Most GNU programs use msgids in English and don't ship
|
||||
an en.mo message catalog. Therefore when we see "en"
|
||||
in the preferences list, arrange for gettext() to
|
||||
return the msgid, and ignore all further elements of
|
||||
the preferences list. */
|
||||
if (strcmp (buf, "en") == 0)
|
||||
break;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
if (size > 0)
|
||||
{
|
||||
char *languages = (char *) malloc (size);
|
||||
|
||||
if (languages != NULL)
|
||||
{
|
||||
char *p = languages;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
CFTypeRef element =
|
||||
CFArrayGetValueAtIndex (prefArray, i);
|
||||
if (element != NULL
|
||||
&& CFGetTypeID (element) == CFStringGetTypeID ()
|
||||
&& CFStringGetCString ((CFStringRef)element,
|
||||
buf, sizeof (buf),
|
||||
kCFStringEncodingASCII))
|
||||
{
|
||||
_nl_locale_name_canonicalize (buf);
|
||||
strcpy (p, buf);
|
||||
p += strlen (buf);
|
||||
*p++ = ':';
|
||||
if (strcmp (buf, "en") == 0)
|
||||
break;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
*--p = '\0';
|
||||
|
||||
cached_languages = languages;
|
||||
}
|
||||
}
|
||||
}
|
||||
cache_initialized = 1;
|
||||
}
|
||||
if (cached_languages != NULL)
|
||||
return cached_languages;
|
||||
}
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
|
@ -0,0 +1,419 @@
|
|||
/* Message catalogs for internationalization.
|
||||
Copyright (C) 1995-1997, 2000-2007 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifndef _LIBINTL_H
|
||||
#define _LIBINTL_H 1
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
/* The LC_MESSAGES locale category is the category used by the functions
|
||||
gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
|
||||
On systems that don't define it, use an arbitrary value instead.
|
||||
On Solaris, <locale.h> defines __LOCALE_H (or _LOCALE_H in Solaris 2.5)
|
||||
then includes <libintl.h> (i.e. this file!) and then only defines
|
||||
LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES
|
||||
in this case. */
|
||||
#if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun))
|
||||
# define LC_MESSAGES 1729
|
||||
#endif
|
||||
|
||||
/* We define an additional symbol to signal that we use the GNU
|
||||
implementation of gettext. */
|
||||
#define __USE_GNU_GETTEXT 1
|
||||
|
||||
/* Provide information about the supported file formats. Returns the
|
||||
maximum minor revision number supported for a given major revision. */
|
||||
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \
|
||||
((major) == 0 || (major) == 1 ? 1 : -1)
|
||||
|
||||
/* Resolve a platform specific conflict on DJGPP. GNU gettext takes
|
||||
precedence over _conio_gettext. */
|
||||
#ifdef __DJGPP__
|
||||
# undef gettext
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* Version number: (major<<16) + (minor<<8) + subminor */
|
||||
#define LIBINTL_VERSION 0x001100
|
||||
extern int libintl_version;
|
||||
|
||||
|
||||
/* We redirect the functions to those prefixed with "libintl_". This is
|
||||
necessary, because some systems define gettext/textdomain/... in the C
|
||||
library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer).
|
||||
If we used the unprefixed names, there would be cases where the
|
||||
definition in the C library would override the one in the libintl.so
|
||||
shared library. Recall that on ELF systems, the symbols are looked
|
||||
up in the following order:
|
||||
1. in the executable,
|
||||
2. in the shared libraries specified on the link command line, in order,
|
||||
3. in the dependencies of the shared libraries specified on the link
|
||||
command line,
|
||||
4. in the dlopen()ed shared libraries, in the order in which they were
|
||||
dlopen()ed.
|
||||
The definition in the C library would override the one in libintl.so if
|
||||
either
|
||||
* -lc is given on the link command line and -lintl isn't, or
|
||||
* -lc is given on the link command line before -lintl, or
|
||||
* libintl.so is a dependency of a dlopen()ed shared library but not
|
||||
linked to the executable at link time.
|
||||
Since Solaris gettext() behaves differently than GNU gettext(), this
|
||||
would be unacceptable.
|
||||
|
||||
The redirection happens by default through macros in C, so that &gettext
|
||||
is independent of the compilation unit, but through inline functions in
|
||||
C++, in order not to interfere with the name mangling of class fields or
|
||||
class methods called 'gettext'. */
|
||||
|
||||
/* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS.
|
||||
If he doesn't, we choose the method. A third possible method is
|
||||
_INTL_REDIRECT_ASM, supported only by GCC. */
|
||||
#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)
|
||||
# if __GNUC__ >= 2 && !(__APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
|
||||
# define _INTL_REDIRECT_ASM
|
||||
# else
|
||||
# ifdef __cplusplus
|
||||
# define _INTL_REDIRECT_INLINE
|
||||
# else
|
||||
# define _INTL_REDIRECT_MACROS
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
/* Auxiliary macros. */
|
||||
#ifdef _INTL_REDIRECT_ASM
|
||||
# define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname))
|
||||
# define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring
|
||||
# define _INTL_STRINGIFY(prefix) #prefix
|
||||
#else
|
||||
# define _INTL_ASM(cname)
|
||||
#endif
|
||||
|
||||
/* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return
|
||||
its n-th argument literally. This enables GCC to warn for example about
|
||||
printf (gettext ("foo %y")). */
|
||||
#if __GNUC__ >= 3 && !(__APPLE_CC__ > 1 && defined __cplusplus)
|
||||
# define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n)))
|
||||
#else
|
||||
# define _INTL_MAY_RETURN_STRING_ARG(n)
|
||||
#endif
|
||||
|
||||
/* Look up MSGID in the current default message catalog for the current
|
||||
LC_MESSAGES locale. If not found, returns MSGID itself (the default
|
||||
text). */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_gettext (const char *__msgid)
|
||||
_INTL_MAY_RETURN_STRING_ARG (1);
|
||||
static inline char *gettext (const char *__msgid)
|
||||
{
|
||||
return libintl_gettext (__msgid);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define gettext libintl_gettext
|
||||
#endif
|
||||
extern char *gettext (const char *__msgid)
|
||||
_INTL_ASM (libintl_gettext)
|
||||
_INTL_MAY_RETURN_STRING_ARG (1);
|
||||
#endif
|
||||
|
||||
/* Look up MSGID in the DOMAINNAME message catalog for the current
|
||||
LC_MESSAGES locale. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_dgettext (const char *__domainname, const char *__msgid)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2);
|
||||
static inline char *dgettext (const char *__domainname, const char *__msgid)
|
||||
{
|
||||
return libintl_dgettext (__domainname, __msgid);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define dgettext libintl_dgettext
|
||||
#endif
|
||||
extern char *dgettext (const char *__domainname, const char *__msgid)
|
||||
_INTL_ASM (libintl_dgettext)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2);
|
||||
#endif
|
||||
|
||||
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
|
||||
locale. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_dcgettext (const char *__domainname, const char *__msgid,
|
||||
int __category)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2);
|
||||
static inline char *dcgettext (const char *__domainname, const char *__msgid,
|
||||
int __category)
|
||||
{
|
||||
return libintl_dcgettext (__domainname, __msgid, __category);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define dcgettext libintl_dcgettext
|
||||
#endif
|
||||
extern char *dcgettext (const char *__domainname, const char *__msgid,
|
||||
int __category)
|
||||
_INTL_ASM (libintl_dcgettext)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2);
|
||||
#endif
|
||||
|
||||
|
||||
/* Similar to `gettext' but select the plural form corresponding to the
|
||||
number N. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n)
|
||||
_INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2);
|
||||
static inline char *ngettext (const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n)
|
||||
{
|
||||
return libintl_ngettext (__msgid1, __msgid2, __n);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define ngettext libintl_ngettext
|
||||
#endif
|
||||
extern char *ngettext (const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n)
|
||||
_INTL_ASM (libintl_ngettext)
|
||||
_INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2);
|
||||
#endif
|
||||
|
||||
/* Similar to `dgettext' but select the plural form corresponding to the
|
||||
number N. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_dngettext (const char *__domainname, const char *__msgid1,
|
||||
const char *__msgid2, unsigned long int __n)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
|
||||
static inline char *dngettext (const char *__domainname, const char *__msgid1,
|
||||
const char *__msgid2, unsigned long int __n)
|
||||
{
|
||||
return libintl_dngettext (__domainname, __msgid1, __msgid2, __n);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define dngettext libintl_dngettext
|
||||
#endif
|
||||
extern char *dngettext (const char *__domainname,
|
||||
const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n)
|
||||
_INTL_ASM (libintl_dngettext)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
|
||||
#endif
|
||||
|
||||
/* Similar to `dcgettext' but select the plural form corresponding to the
|
||||
number N. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_dcngettext (const char *__domainname,
|
||||
const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n, int __category)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
|
||||
static inline char *dcngettext (const char *__domainname,
|
||||
const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n, int __category)
|
||||
{
|
||||
return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define dcngettext libintl_dcngettext
|
||||
#endif
|
||||
extern char *dcngettext (const char *__domainname,
|
||||
const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n, int __category)
|
||||
_INTL_ASM (libintl_dcngettext)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef IN_LIBGLOCALE
|
||||
|
||||
/* Set the current default message catalog to DOMAINNAME.
|
||||
If DOMAINNAME is null, return the current default.
|
||||
If DOMAINNAME is "", reset to the default of "messages". */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_textdomain (const char *__domainname);
|
||||
static inline char *textdomain (const char *__domainname)
|
||||
{
|
||||
return libintl_textdomain (__domainname);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define textdomain libintl_textdomain
|
||||
#endif
|
||||
extern char *textdomain (const char *__domainname)
|
||||
_INTL_ASM (libintl_textdomain);
|
||||
#endif
|
||||
|
||||
/* Specify that the DOMAINNAME message catalog will be found
|
||||
in DIRNAME rather than in the system locale data base. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_bindtextdomain (const char *__domainname,
|
||||
const char *__dirname);
|
||||
static inline char *bindtextdomain (const char *__domainname,
|
||||
const char *__dirname)
|
||||
{
|
||||
return libintl_bindtextdomain (__domainname, __dirname);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define bindtextdomain libintl_bindtextdomain
|
||||
#endif
|
||||
extern char *bindtextdomain (const char *__domainname, const char *__dirname)
|
||||
_INTL_ASM (libintl_bindtextdomain);
|
||||
#endif
|
||||
|
||||
/* Specify the character encoding in which the messages from the
|
||||
DOMAINNAME message catalog will be returned. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_bind_textdomain_codeset (const char *__domainname,
|
||||
const char *__codeset);
|
||||
static inline char *bind_textdomain_codeset (const char *__domainname,
|
||||
const char *__codeset)
|
||||
{
|
||||
return libintl_bind_textdomain_codeset (__domainname, __codeset);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define bind_textdomain_codeset libintl_bind_textdomain_codeset
|
||||
#endif
|
||||
extern char *bind_textdomain_codeset (const char *__domainname,
|
||||
const char *__codeset)
|
||||
_INTL_ASM (libintl_bind_textdomain_codeset);
|
||||
#endif
|
||||
|
||||
#endif /* IN_LIBGLOCALE */
|
||||
|
||||
|
||||
/* Support for format strings with positions in *printf(), following the
|
||||
POSIX/XSI specification.
|
||||
Note: These replacements for the *printf() functions are visible only
|
||||
in source files that #include <libintl.h> or #include "gettext.h".
|
||||
Packages that use *printf() in source files that don't refer to _()
|
||||
or gettext() but for which the format string could be the return value
|
||||
of _() or gettext() need to add this #include. Oh well. */
|
||||
|
||||
#if !@HAVE_POSIX_PRINTF@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get va_list. */
|
||||
#if __STDC__ || defined __cplusplus || defined _MSC_VER
|
||||
# include <stdarg.h>
|
||||
#else
|
||||
# include <varargs.h>
|
||||
#endif
|
||||
|
||||
#undef fprintf
|
||||
#define fprintf libintl_fprintf
|
||||
extern int fprintf (FILE *, const char *, ...);
|
||||
#undef vfprintf
|
||||
#define vfprintf libintl_vfprintf
|
||||
extern int vfprintf (FILE *, const char *, va_list);
|
||||
|
||||
#undef printf
|
||||
#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__
|
||||
/* Don't break __attribute__((format(printf,M,N))).
|
||||
This redefinition is only possible because the libc in NetBSD, Cygwin,
|
||||
mingw does not have a function __printf__. */
|
||||
# define libintl_printf __printf__
|
||||
#endif
|
||||
#define printf libintl_printf
|
||||
extern int printf (const char *, ...);
|
||||
#undef vprintf
|
||||
#define vprintf libintl_vprintf
|
||||
extern int vprintf (const char *, va_list);
|
||||
|
||||
#undef sprintf
|
||||
#define sprintf libintl_sprintf
|
||||
extern int sprintf (char *, const char *, ...);
|
||||
#undef vsprintf
|
||||
#define vsprintf libintl_vsprintf
|
||||
extern int vsprintf (char *, const char *, va_list);
|
||||
|
||||
#if @HAVE_SNPRINTF@
|
||||
|
||||
#undef snprintf
|
||||
#define snprintf libintl_snprintf
|
||||
extern int snprintf (char *, size_t, const char *, ...);
|
||||
#undef vsnprintf
|
||||
#define vsnprintf libintl_vsnprintf
|
||||
extern int vsnprintf (char *, size_t, const char *, va_list);
|
||||
|
||||
#endif
|
||||
|
||||
#if @HAVE_ASPRINTF@
|
||||
|
||||
#undef asprintf
|
||||
#define asprintf libintl_asprintf
|
||||
extern int asprintf (char **, const char *, ...);
|
||||
#undef vasprintf
|
||||
#define vasprintf libintl_vasprintf
|
||||
extern int vasprintf (char **, const char *, va_list);
|
||||
|
||||
#endif
|
||||
|
||||
#if @HAVE_WPRINTF@
|
||||
|
||||
#undef fwprintf
|
||||
#define fwprintf libintl_fwprintf
|
||||
extern int fwprintf (FILE *, const wchar_t *, ...);
|
||||
#undef vfwprintf
|
||||
#define vfwprintf libintl_vfwprintf
|
||||
extern int vfwprintf (FILE *, const wchar_t *, va_list);
|
||||
|
||||
#undef wprintf
|
||||
#define wprintf libintl_wprintf
|
||||
extern int wprintf (const wchar_t *, ...);
|
||||
#undef vwprintf
|
||||
#define vwprintf libintl_vwprintf
|
||||
extern int vwprintf (const wchar_t *, va_list);
|
||||
|
||||
#undef swprintf
|
||||
#define swprintf libintl_swprintf
|
||||
extern int swprintf (wchar_t *, size_t, const wchar_t *, ...);
|
||||
#undef vswprintf
|
||||
#define vswprintf libintl_vswprintf
|
||||
extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Support for relocatable packages. */
|
||||
|
||||
/* Sets the original and the current installation prefix of the package.
|
||||
Relocation simply replaces a pathname starting with the original prefix
|
||||
by the corresponding pathname with the current prefix instead. Both
|
||||
prefixes should be directory names without trailing slash (i.e. use ""
|
||||
instead of "/"). */
|
||||
#define libintl_set_relocation_prefix libintl_set_relocation_prefix
|
||||
extern void
|
||||
libintl_set_relocation_prefix (const char *orig_prefix,
|
||||
const char *curr_prefix);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* libintl.h */
|
|
@ -0,0 +1,38 @@
|
|||
/* Resources for intl.dll */
|
||||
|
||||
#include <winver.h>
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION PACKAGE_VERSION_MAJOR,PACKAGE_VERSION_MINOR,PACKAGE_VERSION_SUBMINOR,0
|
||||
PRODUCTVERSION PACKAGE_VERSION_MAJOR,PACKAGE_VERSION_MINOR,PACKAGE_VERSION_SUBMINOR,0
|
||||
FILEFLAGSMASK 0x3fL /* VS_FFI_FILEFLAGSMASK */
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L /* VS_FF_DEBUG */
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x10004L /* VOS_DOS_WINDOWS32 */
|
||||
FILETYPE 0x2L /* VFT_DLL */
|
||||
FILESUBTYPE 0x0L /* VFT2_UNKNOWN */
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "04090000" /* Lang = US English, Charset = ASCII */
|
||||
BEGIN
|
||||
VALUE "Comments", "This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License. You should have received a copy of the GNU Library 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\0"
|
||||
VALUE "CompanyName", "Free Software Foundation\0"
|
||||
VALUE "FileDescription", "LGPLed libintl for Windows NT/2000/XP/Vista and Windows 95/98/ME\0"
|
||||
VALUE "FileVersion", PACKAGE_VERSION_STRING "\0"
|
||||
VALUE "InternalName", "intl.dll\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 1995-2007\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "intl.dll\0"
|
||||
VALUE "ProductName", "libintl: accessing NLS message catalogs\0"
|
||||
VALUE "ProductVersion", PACKAGE_VERSION_STRING "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0409, 0 /* US English, ASCII */
|
||||
END
|
||||
END
|
|
@ -0,0 +1,132 @@
|
|||
/* Copyright (C) 1996-1999, 2000-2003, 2005-2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifndef _LOADINFO_H
|
||||
#define _LOADINFO_H 1
|
||||
|
||||
/* Declarations of locale dependent catalog lookup functions.
|
||||
Implemented in
|
||||
|
||||
localealias.c Possibly replace a locale name by another.
|
||||
explodename.c Split a locale name into its various fields.
|
||||
l10nflist.c Generate a list of filenames of possible message catalogs.
|
||||
finddomain.c Find and open the relevant message catalogs.
|
||||
|
||||
The main function _nl_find_domain() in finddomain.c is declared
|
||||
in gettextP.h.
|
||||
*/
|
||||
|
||||
#ifndef internal_function
|
||||
# define internal_function
|
||||
#endif
|
||||
|
||||
#ifndef LIBINTL_DLL_EXPORTED
|
||||
# define LIBINTL_DLL_EXPORTED
|
||||
#endif
|
||||
|
||||
/* Tell the compiler when a conditional or integer expression is
|
||||
almost always true or almost always false. */
|
||||
#ifndef HAVE_BUILTIN_EXPECT
|
||||
# define __builtin_expect(expr, val) (expr)
|
||||
#endif
|
||||
|
||||
/* Separator in PATH like lists of pathnames. */
|
||||
#if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
|
||||
/* Win32, OS/2, DOS */
|
||||
# define PATH_SEPARATOR ';'
|
||||
#else
|
||||
/* Unix */
|
||||
# define PATH_SEPARATOR ':'
|
||||
#endif
|
||||
|
||||
/* Encoding of locale name parts. */
|
||||
#define XPG_NORM_CODESET 1
|
||||
#define XPG_CODESET 2
|
||||
#define XPG_TERRITORY 4
|
||||
#define XPG_MODIFIER 8
|
||||
|
||||
|
||||
struct loaded_l10nfile
|
||||
{
|
||||
const char *filename;
|
||||
int decided;
|
||||
|
||||
const void *data;
|
||||
|
||||
struct loaded_l10nfile *next;
|
||||
struct loaded_l10nfile *successor[1];
|
||||
};
|
||||
|
||||
|
||||
/* Normalize codeset name. There is no standard for the codeset
|
||||
names. Normalization allows the user to use any of the common
|
||||
names. The return value is dynamically allocated and has to be
|
||||
freed by the caller. */
|
||||
extern const char *_nl_normalize_codeset (const char *codeset,
|
||||
size_t name_len);
|
||||
|
||||
/* Lookup a locale dependent file.
|
||||
*L10NFILE_LIST denotes a pool of lookup results of locale dependent
|
||||
files of the same kind, sorted in decreasing order of ->filename.
|
||||
DIRLIST and DIRLIST_LEN are an argz list of directories in which to
|
||||
look, containing at least one directory (i.e. DIRLIST_LEN > 0).
|
||||
MASK, LANGUAGE, TERRITORY, CODESET, NORMALIZED_CODESET, MODIFIER
|
||||
are the pieces of the locale name, as produced by _nl_explode_name().
|
||||
FILENAME is the filename suffix.
|
||||
The return value is the lookup result, either found in *L10NFILE_LIST,
|
||||
or - if DO_ALLOCATE is nonzero - freshly allocated, or possibly NULL.
|
||||
If the return value is non-NULL, it is added to *L10NFILE_LIST, and
|
||||
its ->next field denotes the chaining inside *L10NFILE_LIST, and
|
||||
furthermore its ->successor[] field contains a list of other lookup
|
||||
results from which this lookup result inherits. */
|
||||
extern struct loaded_l10nfile *
|
||||
_nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list,
|
||||
const char *dirlist, size_t dirlist_len, int mask,
|
||||
const char *language, const char *territory,
|
||||
const char *codeset, const char *normalized_codeset,
|
||||
const char *modifier,
|
||||
const char *filename, int do_allocate);
|
||||
|
||||
/* Lookup the real locale name for a locale alias NAME, or NULL if
|
||||
NAME is not a locale alias (but possibly a real locale name).
|
||||
The return value is statically allocated and must not be freed. */
|
||||
/* Part of the libintl ABI only for the sake of the gettext.m4 macro. */
|
||||
extern LIBINTL_DLL_EXPORTED const char *_nl_expand_alias (const char *name);
|
||||
|
||||
/* Split a locale name NAME into its pieces: language, modifier,
|
||||
territory, codeset.
|
||||
NAME gets destructively modified: NUL bytes are inserted here and
|
||||
there. *LANGUAGE gets assigned NAME. Each of *MODIFIER, *TERRITORY,
|
||||
*CODESET gets assigned either a pointer into the old NAME string, or
|
||||
NULL. *NORMALIZED_CODESET gets assigned the expanded *CODESET, if it
|
||||
is different from *CODESET; this one is dynamically allocated and has
|
||||
to be freed by the caller.
|
||||
The return value is a bitmask, where each bit corresponds to one
|
||||
filled-in value:
|
||||
XPG_MODIFIER for *MODIFIER,
|
||||
XPG_TERRITORY for *TERRITORY,
|
||||
XPG_CODESET for *CODESET,
|
||||
XPG_NORM_CODESET for *NORMALIZED_CODESET.
|
||||
*/
|
||||
extern int _nl_explode_name (char *name, const char **language,
|
||||
const char **modifier, const char **territory,
|
||||
const char **codeset,
|
||||
const char **normalized_codeset);
|
||||
|
||||
#endif /* loadinfo.h */
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,461 @@
|
|||
/* Determine a canonical name for the current locale's character encoding.
|
||||
|
||||
Copyright (C) 2000-2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
/* Written by Bruno Haible <bruno@clisp.org>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include "localcharset.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined _WIN32 || defined __WIN32__
|
||||
# define WIN32_NATIVE
|
||||
#endif
|
||||
|
||||
#if defined __EMX__
|
||||
/* Assume EMX program runs on OS/2, even if compiled under DOS. */
|
||||
# define OS2
|
||||
#endif
|
||||
|
||||
#if !defined WIN32_NATIVE
|
||||
# if HAVE_LANGINFO_CODESET
|
||||
# include <langinfo.h>
|
||||
# else
|
||||
# if 0 /* see comment below */
|
||||
# include <locale.h>
|
||||
# endif
|
||||
# endif
|
||||
# ifdef __CYGWIN__
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
# endif
|
||||
#elif defined WIN32_NATIVE
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#if defined OS2
|
||||
# define INCL_DOS
|
||||
# include <os2.h>
|
||||
#endif
|
||||
|
||||
#if ENABLE_RELOCATABLE
|
||||
# include "relocatable.h"
|
||||
#else
|
||||
# define relocate(pathname) (pathname)
|
||||
#endif
|
||||
|
||||
/* Get LIBDIR. */
|
||||
#ifndef LIBDIR
|
||||
# include "configmake.h"
|
||||
#endif
|
||||
|
||||
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
|
||||
/* Win32, Cygwin, OS/2, DOS */
|
||||
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
|
||||
#endif
|
||||
|
||||
#ifndef DIRECTORY_SEPARATOR
|
||||
# define DIRECTORY_SEPARATOR '/'
|
||||
#endif
|
||||
|
||||
#ifndef ISSLASH
|
||||
# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
|
||||
#endif
|
||||
|
||||
#if HAVE_DECL_GETC_UNLOCKED
|
||||
# undef getc
|
||||
# define getc getc_unlocked
|
||||
#endif
|
||||
|
||||
/* The following static variable is declared 'volatile' to avoid a
|
||||
possible multithread problem in the function get_charset_aliases. If we
|
||||
are running in a threaded environment, and if two threads initialize
|
||||
'charset_aliases' simultaneously, both will produce the same value,
|
||||
and everything will be ok if the two assignments to 'charset_aliases'
|
||||
are atomic. But I don't know what will happen if the two assignments mix. */
|
||||
#if __STDC__ != 1
|
||||
# define volatile /* empty */
|
||||
#endif
|
||||
/* Pointer to the contents of the charset.alias file, if it has already been
|
||||
read, else NULL. Its format is:
|
||||
ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */
|
||||
static const char * volatile charset_aliases;
|
||||
|
||||
/* Return a pointer to the contents of the charset.alias file. */
|
||||
static const char *
|
||||
get_charset_aliases (void)
|
||||
{
|
||||
const char *cp;
|
||||
|
||||
cp = charset_aliases;
|
||||
if (cp == NULL)
|
||||
{
|
||||
#if !(defined VMS || defined WIN32_NATIVE || defined __CYGWIN__)
|
||||
FILE *fp;
|
||||
const char *dir;
|
||||
const char *base = "charset.alias";
|
||||
char *file_name;
|
||||
|
||||
/* Make it possible to override the charset.alias location. This is
|
||||
necessary for running the testsuite before "make install". */
|
||||
dir = getenv ("CHARSETALIASDIR");
|
||||
if (dir == NULL || dir[0] == '\0')
|
||||
dir = relocate (LIBDIR);
|
||||
|
||||
/* Concatenate dir and base into freshly allocated file_name. */
|
||||
{
|
||||
size_t dir_len = strlen (dir);
|
||||
size_t base_len = strlen (base);
|
||||
int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1]));
|
||||
file_name = (char *) malloc (dir_len + add_slash + base_len + 1);
|
||||
if (file_name != NULL)
|
||||
{
|
||||
memcpy (file_name, dir, dir_len);
|
||||
if (add_slash)
|
||||
file_name[dir_len] = DIRECTORY_SEPARATOR;
|
||||
memcpy (file_name + dir_len + add_slash, base, base_len + 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL)
|
||||
/* Out of memory or file not found, treat it as empty. */
|
||||
cp = "";
|
||||
else
|
||||
{
|
||||
/* Parse the file's contents. */
|
||||
char *res_ptr = NULL;
|
||||
size_t res_size = 0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
int c;
|
||||
char buf1[50+1];
|
||||
char buf2[50+1];
|
||||
size_t l1, l2;
|
||||
char *old_res_ptr;
|
||||
|
||||
c = getc (fp);
|
||||
if (c == EOF)
|
||||
break;
|
||||
if (c == '\n' || c == ' ' || c == '\t')
|
||||
continue;
|
||||
if (c == '#')
|
||||
{
|
||||
/* Skip comment, to end of line. */
|
||||
do
|
||||
c = getc (fp);
|
||||
while (!(c == EOF || c == '\n'));
|
||||
if (c == EOF)
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
ungetc (c, fp);
|
||||
if (fscanf (fp, "%50s %50s", buf1, buf2) < 2)
|
||||
break;
|
||||
l1 = strlen (buf1);
|
||||
l2 = strlen (buf2);
|
||||
old_res_ptr = res_ptr;
|
||||
if (res_size == 0)
|
||||
{
|
||||
res_size = l1 + 1 + l2 + 1;
|
||||
res_ptr = (char *) malloc (res_size + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
res_size += l1 + 1 + l2 + 1;
|
||||
res_ptr = (char *) realloc (res_ptr, res_size + 1);
|
||||
}
|
||||
if (res_ptr == NULL)
|
||||
{
|
||||
/* Out of memory. */
|
||||
res_size = 0;
|
||||
if (old_res_ptr != NULL)
|
||||
free (old_res_ptr);
|
||||
break;
|
||||
}
|
||||
strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
|
||||
strcpy (res_ptr + res_size - (l2 + 1), buf2);
|
||||
}
|
||||
fclose (fp);
|
||||
if (res_size == 0)
|
||||
cp = "";
|
||||
else
|
||||
{
|
||||
*(res_ptr + res_size) = '\0';
|
||||
cp = res_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (file_name != NULL)
|
||||
free (file_name);
|
||||
|
||||
#else
|
||||
|
||||
# if defined VMS
|
||||
/* To avoid the troubles of an extra file charset.alias_vms in the
|
||||
sources of many GNU packages, simply inline the aliases here. */
|
||||
/* The list of encodings is taken from the OpenVMS 7.3-1 documentation
|
||||
"Compaq C Run-Time Library Reference Manual for OpenVMS systems"
|
||||
section 10.7 "Handling Different Character Sets". */
|
||||
cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
|
||||
"ISO8859-2" "\0" "ISO-8859-2" "\0"
|
||||
"ISO8859-5" "\0" "ISO-8859-5" "\0"
|
||||
"ISO8859-7" "\0" "ISO-8859-7" "\0"
|
||||
"ISO8859-8" "\0" "ISO-8859-8" "\0"
|
||||
"ISO8859-9" "\0" "ISO-8859-9" "\0"
|
||||
/* Japanese */
|
||||
"eucJP" "\0" "EUC-JP" "\0"
|
||||
"SJIS" "\0" "SHIFT_JIS" "\0"
|
||||
"DECKANJI" "\0" "DEC-KANJI" "\0"
|
||||
"SDECKANJI" "\0" "EUC-JP" "\0"
|
||||
/* Chinese */
|
||||
"eucTW" "\0" "EUC-TW" "\0"
|
||||
"DECHANYU" "\0" "DEC-HANYU" "\0"
|
||||
"DECHANZI" "\0" "GB2312" "\0"
|
||||
/* Korean */
|
||||
"DECKOREAN" "\0" "EUC-KR" "\0";
|
||||
# endif
|
||||
|
||||
# if defined WIN32_NATIVE || defined __CYGWIN__
|
||||
/* To avoid the troubles of installing a separate file in the same
|
||||
directory as the DLL and of retrieving the DLL's directory at
|
||||
runtime, simply inline the aliases here. */
|
||||
|
||||
cp = "CP936" "\0" "GBK" "\0"
|
||||
"CP1361" "\0" "JOHAB" "\0"
|
||||
"CP20127" "\0" "ASCII" "\0"
|
||||
"CP20866" "\0" "KOI8-R" "\0"
|
||||
"CP20936" "\0" "GB2312" "\0"
|
||||
"CP21866" "\0" "KOI8-RU" "\0"
|
||||
"CP28591" "\0" "ISO-8859-1" "\0"
|
||||
"CP28592" "\0" "ISO-8859-2" "\0"
|
||||
"CP28593" "\0" "ISO-8859-3" "\0"
|
||||
"CP28594" "\0" "ISO-8859-4" "\0"
|
||||
"CP28595" "\0" "ISO-8859-5" "\0"
|
||||
"CP28596" "\0" "ISO-8859-6" "\0"
|
||||
"CP28597" "\0" "ISO-8859-7" "\0"
|
||||
"CP28598" "\0" "ISO-8859-8" "\0"
|
||||
"CP28599" "\0" "ISO-8859-9" "\0"
|
||||
"CP28605" "\0" "ISO-8859-15" "\0"
|
||||
"CP38598" "\0" "ISO-8859-8" "\0"
|
||||
"CP51932" "\0" "EUC-JP" "\0"
|
||||
"CP51936" "\0" "GB2312" "\0"
|
||||
"CP51949" "\0" "EUC-KR" "\0"
|
||||
"CP51950" "\0" "EUC-TW" "\0"
|
||||
"CP54936" "\0" "GB18030" "\0"
|
||||
"CP65001" "\0" "UTF-8" "\0";
|
||||
# endif
|
||||
#endif
|
||||
|
||||
charset_aliases = cp;
|
||||
}
|
||||
|
||||
return cp;
|
||||
}
|
||||
|
||||
/* Determine the current locale's character encoding, and canonicalize it
|
||||
into one of the canonical names listed in config.charset.
|
||||
The result must not be freed; it is statically allocated.
|
||||
If the canonical name cannot be determined, the result is a non-canonical
|
||||
name. */
|
||||
|
||||
#ifdef STATIC
|
||||
STATIC
|
||||
#endif
|
||||
const char *
|
||||
locale_charset (void)
|
||||
{
|
||||
const char *codeset;
|
||||
const char *aliases;
|
||||
|
||||
#if !(defined WIN32_NATIVE || defined OS2)
|
||||
|
||||
# if HAVE_LANGINFO_CODESET
|
||||
|
||||
/* Most systems support nl_langinfo (CODESET) nowadays. */
|
||||
codeset = nl_langinfo (CODESET);
|
||||
|
||||
# ifdef __CYGWIN__
|
||||
/* Cygwin 2006 does not have locales. nl_langinfo (CODESET) always
|
||||
returns "US-ASCII". As long as this is not fixed, return the suffix
|
||||
of the locale name from the environment variables (if present) or
|
||||
the codepage as a number. */
|
||||
if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
|
||||
{
|
||||
const char *locale;
|
||||
static char buf[2 + 10 + 1];
|
||||
|
||||
locale = getenv ("LC_ALL");
|
||||
if (locale == NULL || locale[0] == '\0')
|
||||
{
|
||||
locale = getenv ("LC_CTYPE");
|
||||
if (locale == NULL || locale[0] == '\0')
|
||||
locale = getenv ("LANG");
|
||||
}
|
||||
if (locale != NULL && locale[0] != '\0')
|
||||
{
|
||||
/* If the locale name contains an encoding after the dot, return
|
||||
it. */
|
||||
const char *dot = strchr (locale, '.');
|
||||
|
||||
if (dot != NULL)
|
||||
{
|
||||
const char *modifier;
|
||||
|
||||
dot++;
|
||||
/* Look for the possible @... trailer and remove it, if any. */
|
||||
modifier = strchr (dot, '@');
|
||||
if (modifier == NULL)
|
||||
return dot;
|
||||
if (modifier - dot < sizeof (buf))
|
||||
{
|
||||
memcpy (buf, dot, modifier - dot);
|
||||
buf [modifier - dot] = '\0';
|
||||
return buf;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Woe32 has a function returning the locale's codepage as a number. */
|
||||
sprintf (buf, "CP%u", GetACP ());
|
||||
codeset = buf;
|
||||
}
|
||||
# endif
|
||||
|
||||
# else
|
||||
|
||||
/* On old systems which lack it, use setlocale or getenv. */
|
||||
const char *locale = NULL;
|
||||
|
||||
/* But most old systems don't have a complete set of locales. Some
|
||||
(like SunOS 4 or DJGPP) have only the C locale. Therefore we don't
|
||||
use setlocale here; it would return "C" when it doesn't support the
|
||||
locale name the user has set. */
|
||||
# if 0
|
||||
locale = setlocale (LC_CTYPE, NULL);
|
||||
# endif
|
||||
if (locale == NULL || locale[0] == '\0')
|
||||
{
|
||||
locale = getenv ("LC_ALL");
|
||||
if (locale == NULL || locale[0] == '\0')
|
||||
{
|
||||
locale = getenv ("LC_CTYPE");
|
||||
if (locale == NULL || locale[0] == '\0')
|
||||
locale = getenv ("LANG");
|
||||
}
|
||||
}
|
||||
|
||||
/* On some old systems, one used to set locale = "iso8859_1". On others,
|
||||
you set it to "language_COUNTRY.charset". In any case, we resolve it
|
||||
through the charset.alias file. */
|
||||
codeset = locale;
|
||||
|
||||
# endif
|
||||
|
||||
#elif defined WIN32_NATIVE
|
||||
|
||||
static char buf[2 + 10 + 1];
|
||||
|
||||
/* Woe32 has a function returning the locale's codepage as a number. */
|
||||
sprintf (buf, "CP%u", GetACP ());
|
||||
codeset = buf;
|
||||
|
||||
#elif defined OS2
|
||||
|
||||
const char *locale;
|
||||
static char buf[2 + 10 + 1];
|
||||
ULONG cp[3];
|
||||
ULONG cplen;
|
||||
|
||||
/* Allow user to override the codeset, as set in the operating system,
|
||||
with standard language environment variables. */
|
||||
locale = getenv ("LC_ALL");
|
||||
if (locale == NULL || locale[0] == '\0')
|
||||
{
|
||||
locale = getenv ("LC_CTYPE");
|
||||
if (locale == NULL || locale[0] == '\0')
|
||||
locale = getenv ("LANG");
|
||||
}
|
||||
if (locale != NULL && locale[0] != '\0')
|
||||
{
|
||||
/* If the locale name contains an encoding after the dot, return it. */
|
||||
const char *dot = strchr (locale, '.');
|
||||
|
||||
if (dot != NULL)
|
||||
{
|
||||
const char *modifier;
|
||||
|
||||
dot++;
|
||||
/* Look for the possible @... trailer and remove it, if any. */
|
||||
modifier = strchr (dot, '@');
|
||||
if (modifier == NULL)
|
||||
return dot;
|
||||
if (modifier - dot < sizeof (buf))
|
||||
{
|
||||
memcpy (buf, dot, modifier - dot);
|
||||
buf [modifier - dot] = '\0';
|
||||
return buf;
|
||||
}
|
||||
}
|
||||
|
||||
/* Resolve through the charset.alias file. */
|
||||
codeset = locale;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* OS/2 has a function returning the locale's codepage as a number. */
|
||||
if (DosQueryCp (sizeof (cp), cp, &cplen))
|
||||
codeset = "";
|
||||
else
|
||||
{
|
||||
sprintf (buf, "CP%u", cp[0]);
|
||||
codeset = buf;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (codeset == NULL)
|
||||
/* The canonical name cannot be determined. */
|
||||
codeset = "";
|
||||
|
||||
/* Resolve alias. */
|
||||
for (aliases = get_charset_aliases ();
|
||||
*aliases != '\0';
|
||||
aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
|
||||
if (strcmp (codeset, aliases) == 0
|
||||
|| (aliases[0] == '*' && aliases[1] == '\0'))
|
||||
{
|
||||
codeset = aliases + strlen (aliases) + 1;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Don't return an empty string. GNU libc and GNU libiconv interpret
|
||||
the empty string as denoting "the locale's character encoding",
|
||||
thus GNU libiconv would call this function a second time. */
|
||||
if (codeset[0] == '\0')
|
||||
codeset = "ASCII";
|
||||
|
||||
return codeset;
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
/* Determine a canonical name for the current locale's character encoding.
|
||||
Copyright (C) 2000-2003 Free Software Foundation, Inc.
|
||||
This file is part of the GNU CHARSET Library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifndef _LOCALCHARSET_H
|
||||
#define _LOCALCHARSET_H
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* Determine the current locale's character encoding, and canonicalize it
|
||||
into one of the canonical names listed in config.charset.
|
||||
The result must not be freed; it is statically allocated.
|
||||
If the canonical name cannot be determined, the result is a non-canonical
|
||||
name. */
|
||||
extern const char * locale_charset (void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _LOCALCHARSET_H */
|
|
@ -0,0 +1,77 @@
|
|||
# Locale name alias data base.
|
||||
# Copyright (C) 1996-2001,2003,2007 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Library 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
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Library 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.
|
||||
|
||||
# The format of this file is the same as for the corresponding file of
|
||||
# the X Window System, which normally can be found in
|
||||
# /usr/lib/X11/locale/locale.alias
|
||||
# A single line contains two fields: an alias and a substitution value.
|
||||
# All entries are case independent.
|
||||
|
||||
# Note: This file is obsolete and is kept around for the time being for
|
||||
# backward compatibility. Nobody should rely on the names defined here.
|
||||
# Locales should always be specified by their full name.
|
||||
|
||||
# Packages using this file:
|
||||
|
||||
bokmal nb_NO.ISO-8859-1
|
||||
bokmål nb_NO.ISO-8859-1
|
||||
catalan ca_ES.ISO-8859-1
|
||||
croatian hr_HR.ISO-8859-2
|
||||
czech cs_CZ.ISO-8859-2
|
||||
danish da_DK.ISO-8859-1
|
||||
dansk da_DK.ISO-8859-1
|
||||
deutsch de_DE.ISO-8859-1
|
||||
dutch nl_NL.ISO-8859-1
|
||||
eesti et_EE.ISO-8859-1
|
||||
estonian et_EE.ISO-8859-1
|
||||
finnish fi_FI.ISO-8859-1
|
||||
français fr_FR.ISO-8859-1
|
||||
french fr_FR.ISO-8859-1
|
||||
galego gl_ES.ISO-8859-1
|
||||
galician gl_ES.ISO-8859-1
|
||||
german de_DE.ISO-8859-1
|
||||
greek el_GR.ISO-8859-7
|
||||
hebrew he_IL.ISO-8859-8
|
||||
hrvatski hr_HR.ISO-8859-2
|
||||
hungarian hu_HU.ISO-8859-2
|
||||
icelandic is_IS.ISO-8859-1
|
||||
italian it_IT.ISO-8859-1
|
||||
japanese ja_JP.eucJP
|
||||
japanese.euc ja_JP.eucJP
|
||||
ja_JP ja_JP.eucJP
|
||||
ja_JP.ujis ja_JP.eucJP
|
||||
japanese.sjis ja_JP.SJIS
|
||||
korean ko_KR.eucKR
|
||||
korean.euc ko_KR.eucKR
|
||||
ko_KR ko_KR.eucKR
|
||||
lithuanian lt_LT.ISO-8859-13
|
||||
no_NO nb_NO.ISO-8859-1
|
||||
no_NO.ISO-8859-1 nb_NO.ISO-8859-1
|
||||
norwegian nb_NO.ISO-8859-1
|
||||
nynorsk nn_NO.ISO-8859-1
|
||||
polish pl_PL.ISO-8859-2
|
||||
portuguese pt_PT.ISO-8859-1
|
||||
romanian ro_RO.ISO-8859-2
|
||||
russian ru_RU.ISO-8859-5
|
||||
slovak sk_SK.ISO-8859-2
|
||||
slovene sl_SI.ISO-8859-2
|
||||
slovenian sl_SI.ISO-8859-2
|
||||
spanish es_ES.ISO-8859-1
|
||||
swedish sv_SE.ISO-8859-1
|
||||
thai th_TH.TIS-620
|
||||
turkish tr_TR.ISO-8859-9
|
|
@ -0,0 +1,439 @@
|
|||
/* Handle aliases for locale names.
|
||||
Copyright (C) 1995-1999, 2000-2001, 2003, 2005-2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
/* Tell glibc's <string.h> to provide a prototype for mempcpy().
|
||||
This must come before <config.h> because <config.h> may include
|
||||
<features.h>, and once <features.h> has been included, it's too late. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE 1
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#if defined _LIBC || defined HAVE___FSETLOCKING
|
||||
# include <stdio_ext.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef __GNUC__
|
||||
# undef alloca
|
||||
# define alloca __builtin_alloca
|
||||
# define HAVE_ALLOCA 1
|
||||
#else
|
||||
# ifdef _MSC_VER
|
||||
# include <malloc.h>
|
||||
# define alloca _alloca
|
||||
# else
|
||||
# if defined HAVE_ALLOCA_H || defined _LIBC
|
||||
# include <alloca.h>
|
||||
# else
|
||||
# ifdef _AIX
|
||||
#pragma alloca
|
||||
# else
|
||||
# ifndef alloca
|
||||
char *alloca ();
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "gettextP.h"
|
||||
|
||||
#if ENABLE_RELOCATABLE
|
||||
# include "relocatable.h"
|
||||
#else
|
||||
# define relocate(pathname) (pathname)
|
||||
#endif
|
||||
|
||||
/* @@ end of prolog @@ */
|
||||
|
||||
#ifdef _LIBC
|
||||
/* Rename the non ANSI C functions. This is required by the standard
|
||||
because some ANSI C functions will require linking with this object
|
||||
file and the name space must not be polluted. */
|
||||
# define strcasecmp __strcasecmp
|
||||
|
||||
# ifndef mempcpy
|
||||
# define mempcpy __mempcpy
|
||||
# endif
|
||||
# define HAVE_MEMPCPY 1
|
||||
# define HAVE___FSETLOCKING 1
|
||||
#endif
|
||||
|
||||
/* Handle multi-threaded applications. */
|
||||
#ifdef _LIBC
|
||||
# include <bits/libc-lock.h>
|
||||
#else
|
||||
# include "lock.h"
|
||||
#endif
|
||||
|
||||
#ifndef internal_function
|
||||
# define internal_function
|
||||
#endif
|
||||
|
||||
/* Some optimizations for glibc. */
|
||||
#ifdef _LIBC
|
||||
# define FEOF(fp) feof_unlocked (fp)
|
||||
# define FGETS(buf, n, fp) fgets_unlocked (buf, n, fp)
|
||||
#else
|
||||
# define FEOF(fp) feof (fp)
|
||||
# define FGETS(buf, n, fp) fgets (buf, n, fp)
|
||||
#endif
|
||||
|
||||
/* For those losing systems which don't have `alloca' we have to add
|
||||
some additional code emulating it. */
|
||||
#ifdef HAVE_ALLOCA
|
||||
# define freea(p) /* nothing */
|
||||
#else
|
||||
# define alloca(n) malloc (n)
|
||||
# define freea(p) free (p)
|
||||
#endif
|
||||
|
||||
#if defined _LIBC_REENTRANT || HAVE_DECL_FGETS_UNLOCKED
|
||||
# undef fgets
|
||||
# define fgets(buf, len, s) fgets_unlocked (buf, len, s)
|
||||
#endif
|
||||
#if defined _LIBC_REENTRANT || HAVE_DECL_FEOF_UNLOCKED
|
||||
# undef feof
|
||||
# define feof(s) feof_unlocked (s)
|
||||
#endif
|
||||
|
||||
|
||||
__libc_lock_define_initialized (static, lock)
|
||||
|
||||
|
||||
struct alias_map
|
||||
{
|
||||
const char *alias;
|
||||
const char *value;
|
||||
};
|
||||
|
||||
|
||||
#ifndef _LIBC
|
||||
# define libc_freeres_ptr(decl) decl
|
||||
#endif
|
||||
|
||||
libc_freeres_ptr (static char *string_space);
|
||||
static size_t string_space_act;
|
||||
static size_t string_space_max;
|
||||
libc_freeres_ptr (static struct alias_map *map);
|
||||
static size_t nmap;
|
||||
static size_t maxmap;
|
||||
|
||||
|
||||
/* Prototypes for local functions. */
|
||||
static size_t read_alias_file (const char *fname, int fname_len)
|
||||
internal_function;
|
||||
static int extend_alias_table (void);
|
||||
static int alias_compare (const struct alias_map *map1,
|
||||
const struct alias_map *map2);
|
||||
|
||||
|
||||
const char *
|
||||
_nl_expand_alias (const char *name)
|
||||
{
|
||||
static const char *locale_alias_path;
|
||||
struct alias_map *retval;
|
||||
const char *result = NULL;
|
||||
size_t added;
|
||||
|
||||
__libc_lock_lock (lock);
|
||||
|
||||
if (locale_alias_path == NULL)
|
||||
locale_alias_path = LOCALE_ALIAS_PATH;
|
||||
|
||||
do
|
||||
{
|
||||
struct alias_map item;
|
||||
|
||||
item.alias = name;
|
||||
|
||||
if (nmap > 0)
|
||||
retval = (struct alias_map *) bsearch (&item, map, nmap,
|
||||
sizeof (struct alias_map),
|
||||
(int (*) (const void *,
|
||||
const void *)
|
||||
) alias_compare);
|
||||
else
|
||||
retval = NULL;
|
||||
|
||||
/* We really found an alias. Return the value. */
|
||||
if (retval != NULL)
|
||||
{
|
||||
result = retval->value;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Perhaps we can find another alias file. */
|
||||
added = 0;
|
||||
while (added == 0 && locale_alias_path[0] != '\0')
|
||||
{
|
||||
const char *start;
|
||||
|
||||
while (locale_alias_path[0] == PATH_SEPARATOR)
|
||||
++locale_alias_path;
|
||||
start = locale_alias_path;
|
||||
|
||||
while (locale_alias_path[0] != '\0'
|
||||
&& locale_alias_path[0] != PATH_SEPARATOR)
|
||||
++locale_alias_path;
|
||||
|
||||
if (start < locale_alias_path)
|
||||
added = read_alias_file (start, locale_alias_path - start);
|
||||
}
|
||||
}
|
||||
while (added != 0);
|
||||
|
||||
__libc_lock_unlock (lock);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static size_t
|
||||
internal_function
|
||||
read_alias_file (const char *fname, int fname_len)
|
||||
{
|
||||
FILE *fp;
|
||||
char *full_fname;
|
||||
size_t added;
|
||||
static const char aliasfile[] = "/locale.alias";
|
||||
|
||||
full_fname = (char *) alloca (fname_len + sizeof aliasfile);
|
||||
#ifdef HAVE_MEMPCPY
|
||||
mempcpy (mempcpy (full_fname, fname, fname_len),
|
||||
aliasfile, sizeof aliasfile);
|
||||
#else
|
||||
memcpy (full_fname, fname, fname_len);
|
||||
memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile);
|
||||
#endif
|
||||
|
||||
#ifdef _LIBC
|
||||
/* Note the file is opened with cancellation in the I/O functions
|
||||
disabled. */
|
||||
fp = fopen (relocate (full_fname), "rc");
|
||||
#else
|
||||
fp = fopen (relocate (full_fname), "r");
|
||||
#endif
|
||||
freea (full_fname);
|
||||
if (fp == NULL)
|
||||
return 0;
|
||||
|
||||
#ifdef HAVE___FSETLOCKING
|
||||
/* No threads present. */
|
||||
__fsetlocking (fp, FSETLOCKING_BYCALLER);
|
||||
#endif
|
||||
|
||||
added = 0;
|
||||
while (!FEOF (fp))
|
||||
{
|
||||
/* It is a reasonable approach to use a fix buffer here because
|
||||
a) we are only interested in the first two fields
|
||||
b) these fields must be usable as file names and so must not
|
||||
be that long
|
||||
We avoid a multi-kilobyte buffer here since this would use up
|
||||
stack space which we might not have if the program ran out of
|
||||
memory. */
|
||||
char buf[400];
|
||||
char *alias;
|
||||
char *value;
|
||||
char *cp;
|
||||
int complete_line;
|
||||
|
||||
if (FGETS (buf, sizeof buf, fp) == NULL)
|
||||
/* EOF reached. */
|
||||
break;
|
||||
|
||||
/* Determine whether the line is complete. */
|
||||
complete_line = strchr (buf, '\n') != NULL;
|
||||
|
||||
cp = buf;
|
||||
/* Ignore leading white space. */
|
||||
while (isspace ((unsigned char) cp[0]))
|
||||
++cp;
|
||||
|
||||
/* A leading '#' signals a comment line. */
|
||||
if (cp[0] != '\0' && cp[0] != '#')
|
||||
{
|
||||
alias = cp++;
|
||||
while (cp[0] != '\0' && !isspace ((unsigned char) cp[0]))
|
||||
++cp;
|
||||
/* Terminate alias name. */
|
||||
if (cp[0] != '\0')
|
||||
*cp++ = '\0';
|
||||
|
||||
/* Now look for the beginning of the value. */
|
||||
while (isspace ((unsigned char) cp[0]))
|
||||
++cp;
|
||||
|
||||
if (cp[0] != '\0')
|
||||
{
|
||||
value = cp++;
|
||||
while (cp[0] != '\0' && !isspace ((unsigned char) cp[0]))
|
||||
++cp;
|
||||
/* Terminate value. */
|
||||
if (cp[0] == '\n')
|
||||
{
|
||||
/* This has to be done to make the following test
|
||||
for the end of line possible. We are looking for
|
||||
the terminating '\n' which do not overwrite here. */
|
||||
*cp++ = '\0';
|
||||
*cp = '\n';
|
||||
}
|
||||
else if (cp[0] != '\0')
|
||||
*cp++ = '\0';
|
||||
|
||||
#ifdef IN_LIBGLOCALE
|
||||
/* glibc's locale.alias contains entries for ja_JP and ko_KR
|
||||
that make it impossible to use a Japanese or Korean UTF-8
|
||||
locale under the name "ja_JP" or "ko_KR". Ignore these
|
||||
entries. */
|
||||
if (strchr (alias, '_') == NULL)
|
||||
#endif
|
||||
{
|
||||
size_t alias_len;
|
||||
size_t value_len;
|
||||
|
||||
if (nmap >= maxmap)
|
||||
if (__builtin_expect (extend_alias_table (), 0))
|
||||
goto out;
|
||||
|
||||
alias_len = strlen (alias) + 1;
|
||||
value_len = strlen (value) + 1;
|
||||
|
||||
if (string_space_act + alias_len + value_len > string_space_max)
|
||||
{
|
||||
/* Increase size of memory pool. */
|
||||
size_t new_size = (string_space_max
|
||||
+ (alias_len + value_len > 1024
|
||||
? alias_len + value_len : 1024));
|
||||
char *new_pool = (char *) realloc (string_space, new_size);
|
||||
if (new_pool == NULL)
|
||||
goto out;
|
||||
|
||||
if (__builtin_expect (string_space != new_pool, 0))
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < nmap; i++)
|
||||
{
|
||||
map[i].alias += new_pool - string_space;
|
||||
map[i].value += new_pool - string_space;
|
||||
}
|
||||
}
|
||||
|
||||
string_space = new_pool;
|
||||
string_space_max = new_size;
|
||||
}
|
||||
|
||||
map[nmap].alias =
|
||||
(const char *) memcpy (&string_space[string_space_act],
|
||||
alias, alias_len);
|
||||
string_space_act += alias_len;
|
||||
|
||||
map[nmap].value =
|
||||
(const char *) memcpy (&string_space[string_space_act],
|
||||
value, value_len);
|
||||
string_space_act += value_len;
|
||||
|
||||
++nmap;
|
||||
++added;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Possibly not the whole line fits into the buffer. Ignore
|
||||
the rest of the line. */
|
||||
if (! complete_line)
|
||||
do
|
||||
if (FGETS (buf, sizeof buf, fp) == NULL)
|
||||
/* Make sure the inner loop will be left. The outer loop
|
||||
will exit at the `feof' test. */
|
||||
break;
|
||||
while (strchr (buf, '\n') == NULL);
|
||||
}
|
||||
|
||||
out:
|
||||
/* Should we test for ferror()? I think we have to silently ignore
|
||||
errors. --drepper */
|
||||
fclose (fp);
|
||||
|
||||
if (added > 0)
|
||||
qsort (map, nmap, sizeof (struct alias_map),
|
||||
(int (*) (const void *, const void *)) alias_compare);
|
||||
|
||||
return added;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
extend_alias_table ()
|
||||
{
|
||||
size_t new_size;
|
||||
struct alias_map *new_map;
|
||||
|
||||
new_size = maxmap == 0 ? 100 : 2 * maxmap;
|
||||
new_map = (struct alias_map *) realloc (map, (new_size
|
||||
* sizeof (struct alias_map)));
|
||||
if (new_map == NULL)
|
||||
/* Simply don't extend: we don't have any more core. */
|
||||
return -1;
|
||||
|
||||
map = new_map;
|
||||
maxmap = new_size;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
alias_compare (const struct alias_map *map1, const struct alias_map *map2)
|
||||
{
|
||||
#if defined _LIBC || defined HAVE_STRCASECMP
|
||||
return strcasecmp (map1->alias, map2->alias);
|
||||
#else
|
||||
const unsigned char *p1 = (const unsigned char *) map1->alias;
|
||||
const unsigned char *p2 = (const unsigned char *) map2->alias;
|
||||
unsigned char c1, c2;
|
||||
|
||||
if (p1 == p2)
|
||||
return 0;
|
||||
|
||||
do
|
||||
{
|
||||
/* I know this seems to be odd but the tolower() function in
|
||||
some systems libc cannot handle nonalpha characters. */
|
||||
c1 = isupper (*p1) ? tolower (*p1) : *p1;
|
||||
c2 = isupper (*p2) ? tolower (*p2) : *p2;
|
||||
if (c1 == '\0')
|
||||
break;
|
||||
++p1;
|
||||
++p2;
|
||||
}
|
||||
while (c1 == c2);
|
||||
|
||||
return c1 - c2;
|
||||
#endif
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,922 @@
|
|||
/* Locking in multithreaded situations.
|
||||
Copyright (C) 2005-2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
/* Written by Bruno Haible <bruno@clisp.org>, 2005.
|
||||
Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
|
||||
gthr-win32.h. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "lock.h"
|
||||
|
||||
/* ========================================================================= */
|
||||
|
||||
#if USE_POSIX_THREADS
|
||||
|
||||
/* Use the POSIX threads library. */
|
||||
|
||||
# if PTHREAD_IN_USE_DETECTION_HARD
|
||||
|
||||
/* The function to be executed by a dummy thread. */
|
||||
static void *
|
||||
dummy_thread_func (void *arg)
|
||||
{
|
||||
return arg;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_in_use (void)
|
||||
{
|
||||
static int tested;
|
||||
static int result; /* 1: linked with -lpthread, 0: only with libc */
|
||||
|
||||
if (!tested)
|
||||
{
|
||||
pthread_t thread;
|
||||
|
||||
if (pthread_create (&thread, NULL, dummy_thread_func, NULL) != 0)
|
||||
/* Thread creation failed. */
|
||||
result = 0;
|
||||
else
|
||||
{
|
||||
/* Thread creation works. */
|
||||
void *retval;
|
||||
if (pthread_join (thread, &retval) != 0)
|
||||
abort ();
|
||||
result = 1;
|
||||
}
|
||||
tested = 1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
/* -------------------------- gl_lock_t datatype -------------------------- */
|
||||
|
||||
/* ------------------------- gl_rwlock_t datatype ------------------------- */
|
||||
|
||||
# if HAVE_PTHREAD_RWLOCK
|
||||
|
||||
# if !defined PTHREAD_RWLOCK_INITIALIZER
|
||||
|
||||
void
|
||||
glthread_rwlock_init (gl_rwlock_t *lock)
|
||||
{
|
||||
if (pthread_rwlock_init (&lock->rwlock, NULL) != 0)
|
||||
abort ();
|
||||
lock->initialized = 1;
|
||||
}
|
||||
|
||||
void
|
||||
glthread_rwlock_rdlock (gl_rwlock_t *lock)
|
||||
{
|
||||
if (!lock->initialized)
|
||||
{
|
||||
if (pthread_mutex_lock (&lock->guard) != 0)
|
||||
abort ();
|
||||
if (!lock->initialized)
|
||||
glthread_rwlock_init (lock);
|
||||
if (pthread_mutex_unlock (&lock->guard) != 0)
|
||||
abort ();
|
||||
}
|
||||
if (pthread_rwlock_rdlock (&lock->rwlock) != 0)
|
||||
abort ();
|
||||
}
|
||||
|
||||
void
|
||||
glthread_rwlock_wrlock (gl_rwlock_t *lock)
|
||||
{
|
||||
if (!lock->initialized)
|
||||
{
|
||||
if (pthread_mutex_lock (&lock->guard) != 0)
|
||||
abort ();
|
||||
if (!lock->initialized)
|
||||
glthread_rwlock_init (lock);
|
||||
if (pthread_mutex_unlock (&lock->guard) != 0)
|
||||
abort ();
|
||||
}
|
||||
if (pthread_rwlock_wrlock (&lock->rwlock) != 0)
|
||||
abort ();
|
||||
}
|
||||
|
||||
void
|
||||
glthread_rwlock_unlock (gl_rwlock_t *lock)
|
||||
{
|
||||
if (!lock->initialized)
|
||||
abort ();
|
||||
if (pthread_rwlock_unlock (&lock->rwlock) != 0)
|
||||
abort ();
|
||||
}
|
||||
|
||||
void
|
||||
glthread_rwlock_destroy (gl_rwlock_t *lock)
|
||||
{
|
||||
if (!lock->initialized)
|
||||
abort ();
|
||||
if (pthread_rwlock_destroy (&lock->rwlock) != 0)
|
||||
abort ();
|
||||
lock->initialized = 0;
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
# else
|
||||
|
||||
void
|
||||
glthread_rwlock_init (gl_rwlock_t *lock)
|
||||
{
|
||||
if (pthread_mutex_init (&lock->lock, NULL) != 0)
|
||||
abort ();
|
||||
if (pthread_cond_init (&lock->waiting_readers, NULL) != 0)
|
||||
abort ();
|
||||
if (pthread_cond_init (&lock->waiting_writers, NULL) != 0)
|
||||
abort ();
|
||||
lock->waiting_writers_count = 0;
|
||||
lock->runcount = 0;
|
||||
}
|
||||
|
||||
void
|
||||
glthread_rwlock_rdlock (gl_rwlock_t *lock)
|
||||
{
|
||||
if (pthread_mutex_lock (&lock->lock) != 0)
|
||||
abort ();
|
||||
/* Test whether only readers are currently running, and whether the runcount
|
||||
field will not overflow. */
|
||||
/* POSIX says: "It is implementation-defined whether the calling thread
|
||||
acquires the lock when a writer does not hold the lock and there are
|
||||
writers blocked on the lock." Let's say, no: give the writers a higher
|
||||
priority. */
|
||||
while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0))
|
||||
{
|
||||
/* This thread has to wait for a while. Enqueue it among the
|
||||
waiting_readers. */
|
||||
if (pthread_cond_wait (&lock->waiting_readers, &lock->lock) != 0)
|
||||
abort ();
|
||||
}
|
||||
lock->runcount++;
|
||||
if (pthread_mutex_unlock (&lock->lock) != 0)
|
||||
abort ();
|
||||
}
|
||||
|
||||
void
|
||||
glthread_rwlock_wrlock (gl_rwlock_t *lock)
|
||||
{
|
||||
if (pthread_mutex_lock (&lock->lock) != 0)
|
||||
abort ();
|
||||
/* Test whether no readers or writers are currently running. */
|
||||
while (!(lock->runcount == 0))
|
||||
{
|
||||
/* This thread has to wait for a while. Enqueue it among the
|
||||
waiting_writers. */
|
||||
lock->waiting_writers_count++;
|
||||
if (pthread_cond_wait (&lock->waiting_writers, &lock->lock) != 0)
|
||||
abort ();
|
||||
lock->waiting_writers_count--;
|
||||
}
|
||||
lock->runcount--; /* runcount becomes -1 */
|
||||
if (pthread_mutex_unlock (&lock->lock) != 0)
|
||||
abort ();
|
||||
}
|
||||
|
||||
void
|
||||
glthread_rwlock_unlock (gl_rwlock_t *lock)
|
||||
{
|
||||
if (pthread_mutex_lock (&lock->lock) != 0)
|
||||
abort ();
|
||||
if (lock->runcount < 0)
|
||||
{
|
||||
/* Drop a writer lock. */
|
||||
if (!(lock->runcount == -1))
|
||||
abort ();
|
||||
lock->runcount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Drop a reader lock. */
|
||||
if (!(lock->runcount > 0))
|
||||
abort ();
|
||||
lock->runcount--;
|
||||
}
|
||||
if (lock->runcount == 0)
|
||||
{
|
||||
/* POSIX recommends that "write locks shall take precedence over read
|
||||
locks", to avoid "writer starvation". */
|
||||
if (lock->waiting_writers_count > 0)
|
||||
{
|
||||
/* Wake up one of the waiting writers. */
|
||||
if (pthread_cond_signal (&lock->waiting_writers) != 0)
|
||||
abort ();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Wake up all waiting readers. */
|
||||
if (pthread_cond_broadcast (&lock->waiting_readers) != 0)
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
if (pthread_mutex_unlock (&lock->lock) != 0)
|
||||
abort ();
|
||||
}
|
||||
|
||||
void
|
||||
glthread_rwlock_destroy (gl_rwlock_t *lock)
|
||||
{
|
||||
if (pthread_mutex_destroy (&lock->lock) != 0)
|
||||
abort ();
|
||||
if (pthread_cond_destroy (&lock->waiting_readers) != 0)
|
||||
abort ();
|
||||
if (pthread_cond_destroy (&lock->waiting_writers) != 0)
|
||||
abort ();
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
/* --------------------- gl_recursive_lock_t datatype --------------------- */
|
||||
|
||||
# if HAVE_PTHREAD_MUTEX_RECURSIVE
|
||||
|
||||
# if !(defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
|
||||
|
||||
void
|
||||
glthread_recursive_lock_init (gl_recursive_lock_t *lock)
|
||||
{
|
||||
pthread_mutexattr_t attributes;
|
||||
|
||||
if (pthread_mutexattr_init (&attributes) != 0)
|
||||
abort ();
|
||||
if (pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE) != 0)
|
||||
abort ();
|
||||
if (pthread_mutex_init (&lock->recmutex, &attributes) != 0)
|
||||
abort ();
|
||||
if (pthread_mutexattr_destroy (&attributes) != 0)
|
||||
abort ();
|
||||
lock->initialized = 1;
|
||||
}
|
||||
|
||||
void
|
||||
glthread_recursive_lock_lock (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (!lock->initialized)
|
||||
{
|
||||
if (pthread_mutex_lock (&lock->guard) != 0)
|
||||
abort ();
|
||||
if (!lock->initialized)
|
||||
glthread_recursive_lock_init (lock);
|
||||
if (pthread_mutex_unlock (&lock->guard) != 0)
|
||||
abort ();
|
||||
}
|
||||
if (pthread_mutex_lock (&lock->recmutex) != 0)
|
||||
abort ();
|
||||
}
|
||||
|
||||
void
|
||||
glthread_recursive_lock_unlock (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (!lock->initialized)
|
||||
abort ();
|
||||
if (pthread_mutex_unlock (&lock->recmutex) != 0)
|
||||
abort ();
|
||||
}
|
||||
|
||||
void
|
||||
glthread_recursive_lock_destroy (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (!lock->initialized)
|
||||
abort ();
|
||||
if (pthread_mutex_destroy (&lock->recmutex) != 0)
|
||||
abort ();
|
||||
lock->initialized = 0;
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
# else
|
||||
|
||||
void
|
||||
glthread_recursive_lock_init (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (pthread_mutex_init (&lock->mutex, NULL) != 0)
|
||||
abort ();
|
||||
lock->owner = (pthread_t) 0;
|
||||
lock->depth = 0;
|
||||
}
|
||||
|
||||
void
|
||||
glthread_recursive_lock_lock (gl_recursive_lock_t *lock)
|
||||
{
|
||||
pthread_t self = pthread_self ();
|
||||
if (lock->owner != self)
|
||||
{
|
||||
if (pthread_mutex_lock (&lock->mutex) != 0)
|
||||
abort ();
|
||||
lock->owner = self;
|
||||
}
|
||||
if (++(lock->depth) == 0) /* wraparound? */
|
||||
abort ();
|
||||
}
|
||||
|
||||
void
|
||||
glthread_recursive_lock_unlock (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (lock->owner != pthread_self ())
|
||||
abort ();
|
||||
if (lock->depth == 0)
|
||||
abort ();
|
||||
if (--(lock->depth) == 0)
|
||||
{
|
||||
lock->owner = (pthread_t) 0;
|
||||
if (pthread_mutex_unlock (&lock->mutex) != 0)
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
glthread_recursive_lock_destroy (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (lock->owner != (pthread_t) 0)
|
||||
abort ();
|
||||
if (pthread_mutex_destroy (&lock->mutex) != 0)
|
||||
abort ();
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
/* -------------------------- gl_once_t datatype -------------------------- */
|
||||
|
||||
static const pthread_once_t fresh_once = PTHREAD_ONCE_INIT;
|
||||
|
||||
int
|
||||
glthread_once_singlethreaded (pthread_once_t *once_control)
|
||||
{
|
||||
/* We don't know whether pthread_once_t is an integer type, a floating-point
|
||||
type, a pointer type, or a structure type. */
|
||||
char *firstbyte = (char *)once_control;
|
||||
if (*firstbyte == *(const char *)&fresh_once)
|
||||
{
|
||||
/* First time use of once_control. Invert the first byte. */
|
||||
*firstbyte = ~ *(const char *)&fresh_once;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* ========================================================================= */
|
||||
|
||||
#if USE_PTH_THREADS
|
||||
|
||||
/* Use the GNU Pth threads library. */
|
||||
|
||||
/* -------------------------- gl_lock_t datatype -------------------------- */
|
||||
|
||||
/* ------------------------- gl_rwlock_t datatype ------------------------- */
|
||||
|
||||
/* --------------------- gl_recursive_lock_t datatype --------------------- */
|
||||
|
||||
/* -------------------------- gl_once_t datatype -------------------------- */
|
||||
|
||||
void
|
||||
glthread_once_call (void *arg)
|
||||
{
|
||||
void (**gl_once_temp_addr) (void) = (void (**) (void)) arg;
|
||||
void (*initfunction) (void) = *gl_once_temp_addr;
|
||||
initfunction ();
|
||||
}
|
||||
|
||||
int
|
||||
glthread_once_singlethreaded (pth_once_t *once_control)
|
||||
{
|
||||
/* We know that pth_once_t is an integer type. */
|
||||
if (*once_control == PTH_ONCE_INIT)
|
||||
{
|
||||
/* First time use of once_control. Invert the marker. */
|
||||
*once_control = ~ PTH_ONCE_INIT;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* ========================================================================= */
|
||||
|
||||
#if USE_SOLARIS_THREADS
|
||||
|
||||
/* Use the old Solaris threads library. */
|
||||
|
||||
/* -------------------------- gl_lock_t datatype -------------------------- */
|
||||
|
||||
/* ------------------------- gl_rwlock_t datatype ------------------------- */
|
||||
|
||||
/* --------------------- gl_recursive_lock_t datatype --------------------- */
|
||||
|
||||
void
|
||||
glthread_recursive_lock_init (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (mutex_init (&lock->mutex, USYNC_THREAD, NULL) != 0)
|
||||
abort ();
|
||||
lock->owner = (thread_t) 0;
|
||||
lock->depth = 0;
|
||||
}
|
||||
|
||||
void
|
||||
glthread_recursive_lock_lock (gl_recursive_lock_t *lock)
|
||||
{
|
||||
thread_t self = thr_self ();
|
||||
if (lock->owner != self)
|
||||
{
|
||||
if (mutex_lock (&lock->mutex) != 0)
|
||||
abort ();
|
||||
lock->owner = self;
|
||||
}
|
||||
if (++(lock->depth) == 0) /* wraparound? */
|
||||
abort ();
|
||||
}
|
||||
|
||||
void
|
||||
glthread_recursive_lock_unlock (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (lock->owner != thr_self ())
|
||||
abort ();
|
||||
if (lock->depth == 0)
|
||||
abort ();
|
||||
if (--(lock->depth) == 0)
|
||||
{
|
||||
lock->owner = (thread_t) 0;
|
||||
if (mutex_unlock (&lock->mutex) != 0)
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
glthread_recursive_lock_destroy (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (lock->owner != (thread_t) 0)
|
||||
abort ();
|
||||
if (mutex_destroy (&lock->mutex) != 0)
|
||||
abort ();
|
||||
}
|
||||
|
||||
/* -------------------------- gl_once_t datatype -------------------------- */
|
||||
|
||||
void
|
||||
glthread_once (gl_once_t *once_control, void (*initfunction) (void))
|
||||
{
|
||||
if (!once_control->inited)
|
||||
{
|
||||
/* Use the mutex to guarantee that if another thread is already calling
|
||||
the initfunction, this thread waits until it's finished. */
|
||||
if (mutex_lock (&once_control->mutex) != 0)
|
||||
abort ();
|
||||
if (!once_control->inited)
|
||||
{
|
||||
once_control->inited = 1;
|
||||
initfunction ();
|
||||
}
|
||||
if (mutex_unlock (&once_control->mutex) != 0)
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
glthread_once_singlethreaded (gl_once_t *once_control)
|
||||
{
|
||||
/* We know that gl_once_t contains an integer type. */
|
||||
if (!once_control->inited)
|
||||
{
|
||||
/* First time use of once_control. Invert the marker. */
|
||||
once_control->inited = ~ 0;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* ========================================================================= */
|
||||
|
||||
#if USE_WIN32_THREADS
|
||||
|
||||
/* -------------------------- gl_lock_t datatype -------------------------- */
|
||||
|
||||
void
|
||||
glthread_lock_init (gl_lock_t *lock)
|
||||
{
|
||||
InitializeCriticalSection (&lock->lock);
|
||||
lock->guard.done = 1;
|
||||
}
|
||||
|
||||
void
|
||||
glthread_lock_lock (gl_lock_t *lock)
|
||||
{
|
||||
if (!lock->guard.done)
|
||||
{
|
||||
if (InterlockedIncrement (&lock->guard.started) == 0)
|
||||
/* This thread is the first one to need this lock. Initialize it. */
|
||||
glthread_lock_init (lock);
|
||||
else
|
||||
/* Yield the CPU while waiting for another thread to finish
|
||||
initializing this lock. */
|
||||
while (!lock->guard.done)
|
||||
Sleep (0);
|
||||
}
|
||||
EnterCriticalSection (&lock->lock);
|
||||
}
|
||||
|
||||
void
|
||||
glthread_lock_unlock (gl_lock_t *lock)
|
||||
{
|
||||
if (!lock->guard.done)
|
||||
abort ();
|
||||
LeaveCriticalSection (&lock->lock);
|
||||
}
|
||||
|
||||
void
|
||||
glthread_lock_destroy (gl_lock_t *lock)
|
||||
{
|
||||
if (!lock->guard.done)
|
||||
abort ();
|
||||
DeleteCriticalSection (&lock->lock);
|
||||
lock->guard.done = 0;
|
||||
}
|
||||
|
||||
/* ------------------------- gl_rwlock_t datatype ------------------------- */
|
||||
|
||||
static inline void
|
||||
gl_waitqueue_init (gl_waitqueue_t *wq)
|
||||
{
|
||||
wq->array = NULL;
|
||||
wq->count = 0;
|
||||
wq->alloc = 0;
|
||||
wq->offset = 0;
|
||||
}
|
||||
|
||||
/* Enqueues the current thread, represented by an event, in a wait queue.
|
||||
Returns INVALID_HANDLE_VALUE if an allocation failure occurs. */
|
||||
static HANDLE
|
||||
gl_waitqueue_add (gl_waitqueue_t *wq)
|
||||
{
|
||||
HANDLE event;
|
||||
unsigned int index;
|
||||
|
||||
if (wq->count == wq->alloc)
|
||||
{
|
||||
unsigned int new_alloc = 2 * wq->alloc + 1;
|
||||
HANDLE *new_array =
|
||||
(HANDLE *) realloc (wq->array, new_alloc * sizeof (HANDLE));
|
||||
if (new_array == NULL)
|
||||
/* No more memory. */
|
||||
return INVALID_HANDLE_VALUE;
|
||||
/* Now is a good opportunity to rotate the array so that its contents
|
||||
starts at offset 0. */
|
||||
if (wq->offset > 0)
|
||||
{
|
||||
unsigned int old_count = wq->count;
|
||||
unsigned int old_alloc = wq->alloc;
|
||||
unsigned int old_offset = wq->offset;
|
||||
unsigned int i;
|
||||
if (old_offset + old_count > old_alloc)
|
||||
{
|
||||
unsigned int limit = old_offset + old_count - old_alloc;
|
||||
for (i = 0; i < limit; i++)
|
||||
new_array[old_alloc + i] = new_array[i];
|
||||
}
|
||||
for (i = 0; i < old_count; i++)
|
||||
new_array[i] = new_array[old_offset + i];
|
||||
wq->offset = 0;
|
||||
}
|
||||
wq->array = new_array;
|
||||
wq->alloc = new_alloc;
|
||||
}
|
||||
event = CreateEvent (NULL, TRUE, FALSE, NULL);
|
||||
if (event == INVALID_HANDLE_VALUE)
|
||||
/* No way to allocate an event. */
|
||||
return INVALID_HANDLE_VALUE;
|
||||
index = wq->offset + wq->count;
|
||||
if (index >= wq->alloc)
|
||||
index -= wq->alloc;
|
||||
wq->array[index] = event;
|
||||
wq->count++;
|
||||
return event;
|
||||
}
|
||||
|
||||
/* Notifies the first thread from a wait queue and dequeues it. */
|
||||
static inline void
|
||||
gl_waitqueue_notify_first (gl_waitqueue_t *wq)
|
||||
{
|
||||
SetEvent (wq->array[wq->offset + 0]);
|
||||
wq->offset++;
|
||||
wq->count--;
|
||||
if (wq->count == 0 || wq->offset == wq->alloc)
|
||||
wq->offset = 0;
|
||||
}
|
||||
|
||||
/* Notifies all threads from a wait queue and dequeues them all. */
|
||||
static inline void
|
||||
gl_waitqueue_notify_all (gl_waitqueue_t *wq)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < wq->count; i++)
|
||||
{
|
||||
unsigned int index = wq->offset + i;
|
||||
if (index >= wq->alloc)
|
||||
index -= wq->alloc;
|
||||
SetEvent (wq->array[index]);
|
||||
}
|
||||
wq->count = 0;
|
||||
wq->offset = 0;
|
||||
}
|
||||
|
||||
void
|
||||
glthread_rwlock_init (gl_rwlock_t *lock)
|
||||
{
|
||||
InitializeCriticalSection (&lock->lock);
|
||||
gl_waitqueue_init (&lock->waiting_readers);
|
||||
gl_waitqueue_init (&lock->waiting_writers);
|
||||
lock->runcount = 0;
|
||||
lock->guard.done = 1;
|
||||
}
|
||||
|
||||
void
|
||||
glthread_rwlock_rdlock (gl_rwlock_t *lock)
|
||||
{
|
||||
if (!lock->guard.done)
|
||||
{
|
||||
if (InterlockedIncrement (&lock->guard.started) == 0)
|
||||
/* This thread is the first one to need this lock. Initialize it. */
|
||||
glthread_rwlock_init (lock);
|
||||
else
|
||||
/* Yield the CPU while waiting for another thread to finish
|
||||
initializing this lock. */
|
||||
while (!lock->guard.done)
|
||||
Sleep (0);
|
||||
}
|
||||
EnterCriticalSection (&lock->lock);
|
||||
/* Test whether only readers are currently running, and whether the runcount
|
||||
field will not overflow. */
|
||||
if (!(lock->runcount + 1 > 0))
|
||||
{
|
||||
/* This thread has to wait for a while. Enqueue it among the
|
||||
waiting_readers. */
|
||||
HANDLE event = gl_waitqueue_add (&lock->waiting_readers);
|
||||
if (event != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DWORD result;
|
||||
LeaveCriticalSection (&lock->lock);
|
||||
/* Wait until another thread signals this event. */
|
||||
result = WaitForSingleObject (event, INFINITE);
|
||||
if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
|
||||
abort ();
|
||||
CloseHandle (event);
|
||||
/* The thread which signalled the event already did the bookkeeping:
|
||||
removed us from the waiting_readers, incremented lock->runcount. */
|
||||
if (!(lock->runcount > 0))
|
||||
abort ();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Allocation failure. Weird. */
|
||||
do
|
||||
{
|
||||
LeaveCriticalSection (&lock->lock);
|
||||
Sleep (1);
|
||||
EnterCriticalSection (&lock->lock);
|
||||
}
|
||||
while (!(lock->runcount + 1 > 0));
|
||||
}
|
||||
}
|
||||
lock->runcount++;
|
||||
LeaveCriticalSection (&lock->lock);
|
||||
}
|
||||
|
||||
void
|
||||
glthread_rwlock_wrlock (gl_rwlock_t *lock)
|
||||
{
|
||||
if (!lock->guard.done)
|
||||
{
|
||||
if (InterlockedIncrement (&lock->guard.started) == 0)
|
||||
/* This thread is the first one to need this lock. Initialize it. */
|
||||
glthread_rwlock_init (lock);
|
||||
else
|
||||
/* Yield the CPU while waiting for another thread to finish
|
||||
initializing this lock. */
|
||||
while (!lock->guard.done)
|
||||
Sleep (0);
|
||||
}
|
||||
EnterCriticalSection (&lock->lock);
|
||||
/* Test whether no readers or writers are currently running. */
|
||||
if (!(lock->runcount == 0))
|
||||
{
|
||||
/* This thread has to wait for a while. Enqueue it among the
|
||||
waiting_writers. */
|
||||
HANDLE event = gl_waitqueue_add (&lock->waiting_writers);
|
||||
if (event != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DWORD result;
|
||||
LeaveCriticalSection (&lock->lock);
|
||||
/* Wait until another thread signals this event. */
|
||||
result = WaitForSingleObject (event, INFINITE);
|
||||
if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
|
||||
abort ();
|
||||
CloseHandle (event);
|
||||
/* The thread which signalled the event already did the bookkeeping:
|
||||
removed us from the waiting_writers, set lock->runcount = -1. */
|
||||
if (!(lock->runcount == -1))
|
||||
abort ();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Allocation failure. Weird. */
|
||||
do
|
||||
{
|
||||
LeaveCriticalSection (&lock->lock);
|
||||
Sleep (1);
|
||||
EnterCriticalSection (&lock->lock);
|
||||
}
|
||||
while (!(lock->runcount == 0));
|
||||
}
|
||||
}
|
||||
lock->runcount--; /* runcount becomes -1 */
|
||||
LeaveCriticalSection (&lock->lock);
|
||||
}
|
||||
|
||||
void
|
||||
glthread_rwlock_unlock (gl_rwlock_t *lock)
|
||||
{
|
||||
if (!lock->guard.done)
|
||||
abort ();
|
||||
EnterCriticalSection (&lock->lock);
|
||||
if (lock->runcount < 0)
|
||||
{
|
||||
/* Drop a writer lock. */
|
||||
if (!(lock->runcount == -1))
|
||||
abort ();
|
||||
lock->runcount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Drop a reader lock. */
|
||||
if (!(lock->runcount > 0))
|
||||
abort ();
|
||||
lock->runcount--;
|
||||
}
|
||||
if (lock->runcount == 0)
|
||||
{
|
||||
/* POSIX recommends that "write locks shall take precedence over read
|
||||
locks", to avoid "writer starvation". */
|
||||
if (lock->waiting_writers.count > 0)
|
||||
{
|
||||
/* Wake up one of the waiting writers. */
|
||||
lock->runcount--;
|
||||
gl_waitqueue_notify_first (&lock->waiting_writers);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Wake up all waiting readers. */
|
||||
lock->runcount += lock->waiting_readers.count;
|
||||
gl_waitqueue_notify_all (&lock->waiting_readers);
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection (&lock->lock);
|
||||
}
|
||||
|
||||
void
|
||||
glthread_rwlock_destroy (gl_rwlock_t *lock)
|
||||
{
|
||||
if (!lock->guard.done)
|
||||
abort ();
|
||||
if (lock->runcount != 0)
|
||||
abort ();
|
||||
DeleteCriticalSection (&lock->lock);
|
||||
if (lock->waiting_readers.array != NULL)
|
||||
free (lock->waiting_readers.array);
|
||||
if (lock->waiting_writers.array != NULL)
|
||||
free (lock->waiting_writers.array);
|
||||
lock->guard.done = 0;
|
||||
}
|
||||
|
||||
/* --------------------- gl_recursive_lock_t datatype --------------------- */
|
||||
|
||||
void
|
||||
glthread_recursive_lock_init (gl_recursive_lock_t *lock)
|
||||
{
|
||||
lock->owner = 0;
|
||||
lock->depth = 0;
|
||||
InitializeCriticalSection (&lock->lock);
|
||||
lock->guard.done = 1;
|
||||
}
|
||||
|
||||
void
|
||||
glthread_recursive_lock_lock (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (!lock->guard.done)
|
||||
{
|
||||
if (InterlockedIncrement (&lock->guard.started) == 0)
|
||||
/* This thread is the first one to need this lock. Initialize it. */
|
||||
glthread_recursive_lock_init (lock);
|
||||
else
|
||||
/* Yield the CPU while waiting for another thread to finish
|
||||
initializing this lock. */
|
||||
while (!lock->guard.done)
|
||||
Sleep (0);
|
||||
}
|
||||
{
|
||||
DWORD self = GetCurrentThreadId ();
|
||||
if (lock->owner != self)
|
||||
{
|
||||
EnterCriticalSection (&lock->lock);
|
||||
lock->owner = self;
|
||||
}
|
||||
if (++(lock->depth) == 0) /* wraparound? */
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
glthread_recursive_lock_unlock (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (lock->owner != GetCurrentThreadId ())
|
||||
abort ();
|
||||
if (lock->depth == 0)
|
||||
abort ();
|
||||
if (--(lock->depth) == 0)
|
||||
{
|
||||
lock->owner = 0;
|
||||
LeaveCriticalSection (&lock->lock);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
glthread_recursive_lock_destroy (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (lock->owner != 0)
|
||||
abort ();
|
||||
DeleteCriticalSection (&lock->lock);
|
||||
lock->guard.done = 0;
|
||||
}
|
||||
|
||||
/* -------------------------- gl_once_t datatype -------------------------- */
|
||||
|
||||
void
|
||||
glthread_once (gl_once_t *once_control, void (*initfunction) (void))
|
||||
{
|
||||
if (once_control->inited <= 0)
|
||||
{
|
||||
if (InterlockedIncrement (&once_control->started) == 0)
|
||||
{
|
||||
/* This thread is the first one to come to this once_control. */
|
||||
InitializeCriticalSection (&once_control->lock);
|
||||
EnterCriticalSection (&once_control->lock);
|
||||
once_control->inited = 0;
|
||||
initfunction ();
|
||||
once_control->inited = 1;
|
||||
LeaveCriticalSection (&once_control->lock);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Undo last operation. */
|
||||
InterlockedDecrement (&once_control->started);
|
||||
/* Some other thread has already started the initialization.
|
||||
Yield the CPU while waiting for the other thread to finish
|
||||
initializing and taking the lock. */
|
||||
while (once_control->inited < 0)
|
||||
Sleep (0);
|
||||
if (once_control->inited <= 0)
|
||||
{
|
||||
/* Take the lock. This blocks until the other thread has
|
||||
finished calling the initfunction. */
|
||||
EnterCriticalSection (&once_control->lock);
|
||||
LeaveCriticalSection (&once_control->lock);
|
||||
if (!(once_control->inited > 0))
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* ========================================================================= */
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,116 @@
|
|||
/* Log file output.
|
||||
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
/* Written by Bruno Haible <bruno@clisp.org>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/* Handle multi-threaded applications. */
|
||||
#ifdef _LIBC
|
||||
# include <bits/libc-lock.h>
|
||||
#else
|
||||
# include "lock.h"
|
||||
#endif
|
||||
|
||||
/* Print an ASCII string with quotes and escape sequences where needed. */
|
||||
static void
|
||||
print_escaped (FILE *stream, const char *str)
|
||||
{
|
||||
putc ('"', stream);
|
||||
for (; *str != '\0'; str++)
|
||||
if (*str == '\n')
|
||||
{
|
||||
fputs ("\\n\"", stream);
|
||||
if (str[1] == '\0')
|
||||
return;
|
||||
fputs ("\n\"", stream);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*str == '"' || *str == '\\')
|
||||
putc ('\\', stream);
|
||||
putc (*str, stream);
|
||||
}
|
||||
putc ('"', stream);
|
||||
}
|
||||
|
||||
static char *last_logfilename = NULL;
|
||||
static FILE *last_logfile = NULL;
|
||||
__libc_lock_define_initialized (static, lock)
|
||||
|
||||
static inline void
|
||||
_nl_log_untranslated_locked (const char *logfilename, const char *domainname,
|
||||
const char *msgid1, const char *msgid2, int plural)
|
||||
{
|
||||
FILE *logfile;
|
||||
|
||||
/* Can we reuse the last opened logfile? */
|
||||
if (last_logfilename == NULL || strcmp (logfilename, last_logfilename) != 0)
|
||||
{
|
||||
/* Close the last used logfile. */
|
||||
if (last_logfilename != NULL)
|
||||
{
|
||||
if (last_logfile != NULL)
|
||||
{
|
||||
fclose (last_logfile);
|
||||
last_logfile = NULL;
|
||||
}
|
||||
free (last_logfilename);
|
||||
last_logfilename = NULL;
|
||||
}
|
||||
/* Open the logfile. */
|
||||
last_logfilename = (char *) malloc (strlen (logfilename) + 1);
|
||||
if (last_logfilename == NULL)
|
||||
return;
|
||||
strcpy (last_logfilename, logfilename);
|
||||
last_logfile = fopen (logfilename, "a");
|
||||
if (last_logfile == NULL)
|
||||
return;
|
||||
}
|
||||
logfile = last_logfile;
|
||||
|
||||
fprintf (logfile, "domain ");
|
||||
print_escaped (logfile, domainname);
|
||||
fprintf (logfile, "\nmsgid ");
|
||||
print_escaped (logfile, msgid1);
|
||||
if (plural)
|
||||
{
|
||||
fprintf (logfile, "\nmsgid_plural ");
|
||||
print_escaped (logfile, msgid2);
|
||||
fprintf (logfile, "\nmsgstr[0] \"\"\n");
|
||||
}
|
||||
else
|
||||
fprintf (logfile, "\nmsgstr \"\"\n");
|
||||
putc ('\n', logfile);
|
||||
}
|
||||
|
||||
/* Add to the log file an entry denoting a failed translation. */
|
||||
void
|
||||
_nl_log_untranslated (const char *logfilename, const char *domainname,
|
||||
const char *msgid1, const char *msgid2, int plural)
|
||||
{
|
||||
__libc_lock_lock (lock);
|
||||
_nl_log_untranslated_locked (logfilename, domainname, msgid1, msgid2, plural);
|
||||
__libc_lock_unlock (lock);
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
/* Implementation of ngettext(3) function.
|
||||
Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef _LIBC
|
||||
# define __need_NULL
|
||||
# include <stddef.h>
|
||||
#else
|
||||
# include <stdlib.h> /* Just for NULL. */
|
||||
#endif
|
||||
|
||||
#include "gettextP.h"
|
||||
#ifdef _LIBC
|
||||
# include <libintl.h>
|
||||
#else
|
||||
# include "libgnuintl.h"
|
||||
#endif
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
/* @@ end of prolog @@ */
|
||||
|
||||
/* Names for the libintl functions are a problem. They must not clash
|
||||
with existing names and they should follow ANSI C. But this source
|
||||
code is also used in GNU C Library where the names have a __
|
||||
prefix. So we have to make a difference here. */
|
||||
#ifdef _LIBC
|
||||
# define NGETTEXT __ngettext
|
||||
# define DCNGETTEXT __dcngettext
|
||||
#else
|
||||
# define NGETTEXT libintl_ngettext
|
||||
# define DCNGETTEXT libintl_dcngettext
|
||||
#endif
|
||||
|
||||
/* Look up MSGID in the current default message catalog for the current
|
||||
LC_MESSAGES locale. If not found, returns MSGID itself (the default
|
||||
text). */
|
||||
char *
|
||||
NGETTEXT (const char *msgid1, const char *msgid2, unsigned long int n)
|
||||
{
|
||||
return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES);
|
||||
}
|
||||
|
||||
#ifdef _LIBC
|
||||
/* Alias for function name in GNU C Library. */
|
||||
weak_alias (__ngettext, ngettext);
|
||||
#endif
|
|
@ -0,0 +1,98 @@
|
|||
/* OS/2 compatibility functions.
|
||||
Copyright (C) 2001-2002 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#define OS2_AWARE
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
/* A version of getenv() that works from DLLs */
|
||||
extern unsigned long DosScanEnv (const unsigned char *pszName, unsigned char **ppszValue);
|
||||
|
||||
char *
|
||||
_nl_getenv (const char *name)
|
||||
{
|
||||
unsigned char *value;
|
||||
if (DosScanEnv (name, &value))
|
||||
return NULL;
|
||||
else
|
||||
return value;
|
||||
}
|
||||
|
||||
/* A fixed size buffer. */
|
||||
char libintl_nl_default_dirname[MAXPATHLEN+1];
|
||||
|
||||
char *_nlos2_libdir = NULL;
|
||||
char *_nlos2_localealiaspath = NULL;
|
||||
char *_nlos2_localedir = NULL;
|
||||
|
||||
static __attribute__((constructor)) void
|
||||
nlos2_initialize ()
|
||||
{
|
||||
char *root = getenv ("UNIXROOT");
|
||||
char *gnulocaledir = getenv ("GNULOCALEDIR");
|
||||
|
||||
_nlos2_libdir = gnulocaledir;
|
||||
if (!_nlos2_libdir)
|
||||
{
|
||||
if (root)
|
||||
{
|
||||
size_t sl = strlen (root);
|
||||
_nlos2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1);
|
||||
memcpy (_nlos2_libdir, root, sl);
|
||||
memcpy (_nlos2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1);
|
||||
}
|
||||
else
|
||||
_nlos2_libdir = LIBDIR;
|
||||
}
|
||||
|
||||
_nlos2_localealiaspath = gnulocaledir;
|
||||
if (!_nlos2_localealiaspath)
|
||||
{
|
||||
if (root)
|
||||
{
|
||||
size_t sl = strlen (root);
|
||||
_nlos2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1);
|
||||
memcpy (_nlos2_localealiaspath, root, sl);
|
||||
memcpy (_nlos2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1);
|
||||
}
|
||||
else
|
||||
_nlos2_localealiaspath = LOCALE_ALIAS_PATH;
|
||||
}
|
||||
|
||||
_nlos2_localedir = gnulocaledir;
|
||||
if (!_nlos2_localedir)
|
||||
{
|
||||
if (root)
|
||||
{
|
||||
size_t sl = strlen (root);
|
||||
_nlos2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1);
|
||||
memcpy (_nlos2_localedir, root, sl);
|
||||
memcpy (_nlos2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1);
|
||||
}
|
||||
else
|
||||
_nlos2_localedir = LOCALEDIR;
|
||||
}
|
||||
|
||||
if (strlen (_nlos2_localedir) <= MAXPATHLEN)
|
||||
strcpy (libintl_nl_default_dirname, _nlos2_localedir);
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
/* OS/2 compatibility defines.
|
||||
This file is intended to be included from config.h
|
||||
Copyright (C) 2001-2002 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
/* When included from os2compat.h we need all the original definitions */
|
||||
#ifndef OS2_AWARE
|
||||
|
||||
#undef LIBDIR
|
||||
#define LIBDIR _nlos2_libdir
|
||||
extern char *_nlos2_libdir;
|
||||
|
||||
#undef LOCALEDIR
|
||||
#define LOCALEDIR _nlos2_localedir
|
||||
extern char *_nlos2_localedir;
|
||||
|
||||
#undef LOCALE_ALIAS_PATH
|
||||
#define LOCALE_ALIAS_PATH _nlos2_localealiaspath
|
||||
extern char *_nlos2_localealiaspath;
|
||||
|
||||
#endif
|
||||
|
||||
#undef HAVE_STRCASECMP
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define strcasecmp stricmp
|
||||
#define strncasecmp strnicmp
|
||||
|
||||
/* We have our own getenv() which works even if library is compiled as DLL */
|
||||
#define getenv _nl_getenv
|
||||
|
||||
/* Older versions of gettext used -1 as the value of LC_MESSAGES */
|
||||
#define LC_MESSAGES_COMPAT (-1)
|
|
@ -0,0 +1,26 @@
|
|||
/* OS dependent parts of libintl.
|
||||
Copyright (C) 2001-2002, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#if defined __CYGWIN__
|
||||
# include "intl-exports.c"
|
||||
#elif defined __EMX__
|
||||
# include "os2compat.c"
|
||||
#else
|
||||
/* Avoid AIX compiler warning. */
|
||||
typedef int dummy;
|
||||
#endif
|
|
@ -0,0 +1,155 @@
|
|||
/* Expression parsing for plural form selection.
|
||||
Copyright (C) 2000-2001, 2003, 2005-2007 Free Software Foundation, Inc.
|
||||
Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "plural-exp.h"
|
||||
|
||||
#if (defined __GNUC__ && !(__APPLE_CC__ > 1) && !defined __cplusplus) \
|
||||
|| (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
|
||||
|
||||
/* These structs are the constant expression for the germanic plural
|
||||
form determination. It represents the expression "n != 1". */
|
||||
static const struct expression plvar =
|
||||
{
|
||||
.nargs = 0,
|
||||
.operation = var,
|
||||
};
|
||||
static const struct expression plone =
|
||||
{
|
||||
.nargs = 0,
|
||||
.operation = num,
|
||||
.val =
|
||||
{
|
||||
.num = 1
|
||||
}
|
||||
};
|
||||
struct expression GERMANIC_PLURAL =
|
||||
{
|
||||
.nargs = 2,
|
||||
.operation = not_equal,
|
||||
.val =
|
||||
{
|
||||
.args =
|
||||
{
|
||||
[0] = (struct expression *) &plvar,
|
||||
[1] = (struct expression *) &plone
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
# define INIT_GERMANIC_PLURAL()
|
||||
|
||||
#else
|
||||
|
||||
/* For compilers without support for ISO C 99 struct/union initializers:
|
||||
Initialization at run-time. */
|
||||
|
||||
static struct expression plvar;
|
||||
static struct expression plone;
|
||||
struct expression GERMANIC_PLURAL;
|
||||
|
||||
static void
|
||||
init_germanic_plural ()
|
||||
{
|
||||
if (plone.val.num == 0)
|
||||
{
|
||||
plvar.nargs = 0;
|
||||
plvar.operation = var;
|
||||
|
||||
plone.nargs = 0;
|
||||
plone.operation = num;
|
||||
plone.val.num = 1;
|
||||
|
||||
GERMANIC_PLURAL.nargs = 2;
|
||||
GERMANIC_PLURAL.operation = not_equal;
|
||||
GERMANIC_PLURAL.val.args[0] = &plvar;
|
||||
GERMANIC_PLURAL.val.args[1] = &plone;
|
||||
}
|
||||
}
|
||||
|
||||
# define INIT_GERMANIC_PLURAL() init_germanic_plural ()
|
||||
|
||||
#endif
|
||||
|
||||
void
|
||||
internal_function
|
||||
EXTRACT_PLURAL_EXPRESSION (const char *nullentry,
|
||||
const struct expression **pluralp,
|
||||
unsigned long int *npluralsp)
|
||||
{
|
||||
if (nullentry != NULL)
|
||||
{
|
||||
const char *plural;
|
||||
const char *nplurals;
|
||||
|
||||
plural = strstr (nullentry, "plural=");
|
||||
nplurals = strstr (nullentry, "nplurals=");
|
||||
if (plural == NULL || nplurals == NULL)
|
||||
goto no_plural;
|
||||
else
|
||||
{
|
||||
char *endp;
|
||||
unsigned long int n;
|
||||
struct parse_args args;
|
||||
|
||||
/* First get the number. */
|
||||
nplurals += 9;
|
||||
while (*nplurals != '\0' && isspace ((unsigned char) *nplurals))
|
||||
++nplurals;
|
||||
if (!(*nplurals >= '0' && *nplurals <= '9'))
|
||||
goto no_plural;
|
||||
#if defined HAVE_STRTOUL || defined _LIBC
|
||||
n = strtoul (nplurals, &endp, 10);
|
||||
#else
|
||||
for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++)
|
||||
n = n * 10 + (*endp - '0');
|
||||
#endif
|
||||
if (nplurals == endp)
|
||||
goto no_plural;
|
||||
*npluralsp = n;
|
||||
|
||||
/* Due to the restrictions bison imposes onto the interface of the
|
||||
scanner function we have to put the input string and the result
|
||||
passed up from the parser into the same structure which address
|
||||
is passed down to the parser. */
|
||||
plural += 7;
|
||||
args.cp = plural;
|
||||
if (PLURAL_PARSE (&args) != 0)
|
||||
goto no_plural;
|
||||
*pluralp = args.res;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* By default we are using the Germanic form: singular form only
|
||||
for `one', the plural form otherwise. Yes, this is also what
|
||||
English is using since English is a Germanic language. */
|
||||
no_plural:
|
||||
INIT_GERMANIC_PLURAL ();
|
||||
*pluralp = &GERMANIC_PLURAL;
|
||||
*npluralsp = 2;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,129 @@
|
|||
/* Expression parsing and evaluation for plural form selection.
|
||||
Copyright (C) 2000-2003, 2005-2007 Free Software Foundation, Inc.
|
||||
Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifndef _PLURAL_EXP_H
|
||||
#define _PLURAL_EXP_H
|
||||
|
||||
#ifndef internal_function
|
||||
# define internal_function
|
||||
#endif
|
||||
|
||||
#ifndef attribute_hidden
|
||||
# define attribute_hidden
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
enum expression_operator
|
||||
{
|
||||
/* Without arguments: */
|
||||
var, /* The variable "n". */
|
||||
num, /* Decimal number. */
|
||||
/* Unary operators: */
|
||||
lnot, /* Logical NOT. */
|
||||
/* Binary operators: */
|
||||
mult, /* Multiplication. */
|
||||
divide, /* Division. */
|
||||
module, /* Modulo operation. */
|
||||
plus, /* Addition. */
|
||||
minus, /* Subtraction. */
|
||||
less_than, /* Comparison. */
|
||||
greater_than, /* Comparison. */
|
||||
less_or_equal, /* Comparison. */
|
||||
greater_or_equal, /* Comparison. */
|
||||
equal, /* Comparison for equality. */
|
||||
not_equal, /* Comparison for inequality. */
|
||||
land, /* Logical AND. */
|
||||
lor, /* Logical OR. */
|
||||
/* Ternary operators: */
|
||||
qmop /* Question mark operator. */
|
||||
};
|
||||
|
||||
/* This is the representation of the expressions to determine the
|
||||
plural form. */
|
||||
struct expression
|
||||
{
|
||||
int nargs; /* Number of arguments. */
|
||||
enum expression_operator operation;
|
||||
union
|
||||
{
|
||||
unsigned long int num; /* Number value for `num'. */
|
||||
struct expression *args[3]; /* Up to three arguments. */
|
||||
} val;
|
||||
};
|
||||
|
||||
/* This is the data structure to pass information to the parser and get
|
||||
the result in a thread-safe way. */
|
||||
struct parse_args
|
||||
{
|
||||
const char *cp;
|
||||
struct expression *res;
|
||||
};
|
||||
|
||||
|
||||
/* Names for the libintl functions are a problem. This source code is used
|
||||
1. in the GNU C Library library,
|
||||
2. in the GNU libintl library,
|
||||
3. in the GNU gettext tools.
|
||||
The function names in each situation must be different, to allow for
|
||||
binary incompatible changes in 'struct expression'. Furthermore,
|
||||
1. in the GNU C Library library, the names have a __ prefix,
|
||||
2.+3. in the GNU libintl library and in the GNU gettext tools, the names
|
||||
must follow ANSI C and not start with __.
|
||||
So we have to distinguish the three cases. */
|
||||
#ifdef _LIBC
|
||||
# define FREE_EXPRESSION __gettext_free_exp
|
||||
# define PLURAL_PARSE __gettextparse
|
||||
# define GERMANIC_PLURAL __gettext_germanic_plural
|
||||
# define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural
|
||||
#elif defined (IN_LIBINTL)
|
||||
# define FREE_EXPRESSION libintl_gettext_free_exp
|
||||
# define PLURAL_PARSE libintl_gettextparse
|
||||
# define GERMANIC_PLURAL libintl_gettext_germanic_plural
|
||||
# define EXTRACT_PLURAL_EXPRESSION libintl_gettext_extract_plural
|
||||
#else
|
||||
# define FREE_EXPRESSION free_plural_expression
|
||||
# define PLURAL_PARSE parse_plural_expression
|
||||
# define GERMANIC_PLURAL germanic_plural
|
||||
# define EXTRACT_PLURAL_EXPRESSION extract_plural_expression
|
||||
#endif
|
||||
|
||||
extern void FREE_EXPRESSION (struct expression *exp)
|
||||
internal_function;
|
||||
extern int PLURAL_PARSE (void *arg);
|
||||
extern struct expression GERMANIC_PLURAL attribute_hidden;
|
||||
extern void EXTRACT_PLURAL_EXPRESSION (const char *nullentry,
|
||||
const struct expression **pluralp,
|
||||
unsigned long int *npluralsp)
|
||||
internal_function;
|
||||
|
||||
#if !defined (_LIBC) && !defined (IN_LIBINTL) && !defined (IN_LIBGLOCALE)
|
||||
extern unsigned long int plural_eval (const struct expression *pexp,
|
||||
unsigned long int n);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _PLURAL_EXP_H */
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,385 @@
|
|||
%{
|
||||
/* Expression parsing for plural form selection.
|
||||
Copyright (C) 2000-2001, 2003, 2005-2006 Free Software Foundation, Inc.
|
||||
Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
/* For bison < 2.0, the bison generated parser uses alloca. AIX 3 forces us
|
||||
to put this declaration at the beginning of the file. The declaration in
|
||||
bison's skeleton file comes too late. This must come before <config.h>
|
||||
because <config.h> may include arbitrary system headers.
|
||||
This can go away once the AM_INTL_SUBDIR macro requires bison >= 2.0. */
|
||||
#if defined _AIX && !defined __GNUC__
|
||||
#pragma alloca
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "plural-exp.h"
|
||||
|
||||
/* The main function generated by the parser is called __gettextparse,
|
||||
but we want it to be called PLURAL_PARSE. */
|
||||
#ifndef _LIBC
|
||||
# define __gettextparse PLURAL_PARSE
|
||||
#endif
|
||||
|
||||
#define YYLEX_PARAM &((struct parse_args *) arg)->cp
|
||||
#define YYPARSE_PARAM arg
|
||||
%}
|
||||
%pure_parser
|
||||
%expect 7
|
||||
|
||||
%union {
|
||||
unsigned long int num;
|
||||
enum expression_operator op;
|
||||
struct expression *exp;
|
||||
}
|
||||
|
||||
%{
|
||||
/* Prototypes for local functions. */
|
||||
static int yylex (YYSTYPE *lval, const char **pexp);
|
||||
static void yyerror (const char *str);
|
||||
|
||||
/* Allocation of expressions. */
|
||||
|
||||
static struct expression *
|
||||
new_exp (int nargs, enum expression_operator op,
|
||||
struct expression * const *args)
|
||||
{
|
||||
int i;
|
||||
struct expression *newp;
|
||||
|
||||
/* If any of the argument could not be malloc'ed, just return NULL. */
|
||||
for (i = nargs - 1; i >= 0; i--)
|
||||
if (args[i] == NULL)
|
||||
goto fail;
|
||||
|
||||
/* Allocate a new expression. */
|
||||
newp = (struct expression *) malloc (sizeof (*newp));
|
||||
if (newp != NULL)
|
||||
{
|
||||
newp->nargs = nargs;
|
||||
newp->operation = op;
|
||||
for (i = nargs - 1; i >= 0; i--)
|
||||
newp->val.args[i] = args[i];
|
||||
return newp;
|
||||
}
|
||||
|
||||
fail:
|
||||
for (i = nargs - 1; i >= 0; i--)
|
||||
FREE_EXPRESSION (args[i]);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline struct expression *
|
||||
new_exp_0 (enum expression_operator op)
|
||||
{
|
||||
return new_exp (0, op, NULL);
|
||||
}
|
||||
|
||||
static inline struct expression *
|
||||
new_exp_1 (enum expression_operator op, struct expression *right)
|
||||
{
|
||||
struct expression *args[1];
|
||||
|
||||
args[0] = right;
|
||||
return new_exp (1, op, args);
|
||||
}
|
||||
|
||||
static struct expression *
|
||||
new_exp_2 (enum expression_operator op, struct expression *left,
|
||||
struct expression *right)
|
||||
{
|
||||
struct expression *args[2];
|
||||
|
||||
args[0] = left;
|
||||
args[1] = right;
|
||||
return new_exp (2, op, args);
|
||||
}
|
||||
|
||||
static inline struct expression *
|
||||
new_exp_3 (enum expression_operator op, struct expression *bexp,
|
||||
struct expression *tbranch, struct expression *fbranch)
|
||||
{
|
||||
struct expression *args[3];
|
||||
|
||||
args[0] = bexp;
|
||||
args[1] = tbranch;
|
||||
args[2] = fbranch;
|
||||
return new_exp (3, op, args);
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
/* This declares that all operators have the same associativity and the
|
||||
precedence order as in C. See [Harbison, Steele: C, A Reference Manual].
|
||||
There is no unary minus and no bitwise operators.
|
||||
Operators with the same syntactic behaviour have been merged into a single
|
||||
token, to save space in the array generated by bison. */
|
||||
%right '?' /* ? */
|
||||
%left '|' /* || */
|
||||
%left '&' /* && */
|
||||
%left EQUOP2 /* == != */
|
||||
%left CMPOP2 /* < > <= >= */
|
||||
%left ADDOP2 /* + - */
|
||||
%left MULOP2 /* * / % */
|
||||
%right '!' /* ! */
|
||||
|
||||
%token <op> EQUOP2 CMPOP2 ADDOP2 MULOP2
|
||||
%token <num> NUMBER
|
||||
%type <exp> exp
|
||||
|
||||
%%
|
||||
|
||||
start: exp
|
||||
{
|
||||
if ($1 == NULL)
|
||||
YYABORT;
|
||||
((struct parse_args *) arg)->res = $1;
|
||||
}
|
||||
;
|
||||
|
||||
exp: exp '?' exp ':' exp
|
||||
{
|
||||
$$ = new_exp_3 (qmop, $1, $3, $5);
|
||||
}
|
||||
| exp '|' exp
|
||||
{
|
||||
$$ = new_exp_2 (lor, $1, $3);
|
||||
}
|
||||
| exp '&' exp
|
||||
{
|
||||
$$ = new_exp_2 (land, $1, $3);
|
||||
}
|
||||
| exp EQUOP2 exp
|
||||
{
|
||||
$$ = new_exp_2 ($2, $1, $3);
|
||||
}
|
||||
| exp CMPOP2 exp
|
||||
{
|
||||
$$ = new_exp_2 ($2, $1, $3);
|
||||
}
|
||||
| exp ADDOP2 exp
|
||||
{
|
||||
$$ = new_exp_2 ($2, $1, $3);
|
||||
}
|
||||
| exp MULOP2 exp
|
||||
{
|
||||
$$ = new_exp_2 ($2, $1, $3);
|
||||
}
|
||||
| '!' exp
|
||||
{
|
||||
$$ = new_exp_1 (lnot, $2);
|
||||
}
|
||||
| 'n'
|
||||
{
|
||||
$$ = new_exp_0 (var);
|
||||
}
|
||||
| NUMBER
|
||||
{
|
||||
if (($$ = new_exp_0 (num)) != NULL)
|
||||
$$->val.num = $1;
|
||||
}
|
||||
| '(' exp ')'
|
||||
{
|
||||
$$ = $2;
|
||||
}
|
||||
;
|
||||
|
||||
%%
|
||||
|
||||
void
|
||||
internal_function
|
||||
FREE_EXPRESSION (struct expression *exp)
|
||||
{
|
||||
if (exp == NULL)
|
||||
return;
|
||||
|
||||
/* Handle the recursive case. */
|
||||
switch (exp->nargs)
|
||||
{
|
||||
case 3:
|
||||
FREE_EXPRESSION (exp->val.args[2]);
|
||||
/* FALLTHROUGH */
|
||||
case 2:
|
||||
FREE_EXPRESSION (exp->val.args[1]);
|
||||
/* FALLTHROUGH */
|
||||
case 1:
|
||||
FREE_EXPRESSION (exp->val.args[0]);
|
||||
/* FALLTHROUGH */
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
free (exp);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
yylex (YYSTYPE *lval, const char **pexp)
|
||||
{
|
||||
const char *exp = *pexp;
|
||||
int result;
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (exp[0] == '\0')
|
||||
{
|
||||
*pexp = exp;
|
||||
return YYEOF;
|
||||
}
|
||||
|
||||
if (exp[0] != ' ' && exp[0] != '\t')
|
||||
break;
|
||||
|
||||
++exp;
|
||||
}
|
||||
|
||||
result = *exp++;
|
||||
switch (result)
|
||||
{
|
||||
case '0': case '1': case '2': case '3': case '4':
|
||||
case '5': case '6': case '7': case '8': case '9':
|
||||
{
|
||||
unsigned long int n = result - '0';
|
||||
while (exp[0] >= '0' && exp[0] <= '9')
|
||||
{
|
||||
n *= 10;
|
||||
n += exp[0] - '0';
|
||||
++exp;
|
||||
}
|
||||
lval->num = n;
|
||||
result = NUMBER;
|
||||
}
|
||||
break;
|
||||
|
||||
case '=':
|
||||
if (exp[0] == '=')
|
||||
{
|
||||
++exp;
|
||||
lval->op = equal;
|
||||
result = EQUOP2;
|
||||
}
|
||||
else
|
||||
result = YYERRCODE;
|
||||
break;
|
||||
|
||||
case '!':
|
||||
if (exp[0] == '=')
|
||||
{
|
||||
++exp;
|
||||
lval->op = not_equal;
|
||||
result = EQUOP2;
|
||||
}
|
||||
break;
|
||||
|
||||
case '&':
|
||||
case '|':
|
||||
if (exp[0] == result)
|
||||
++exp;
|
||||
else
|
||||
result = YYERRCODE;
|
||||
break;
|
||||
|
||||
case '<':
|
||||
if (exp[0] == '=')
|
||||
{
|
||||
++exp;
|
||||
lval->op = less_or_equal;
|
||||
}
|
||||
else
|
||||
lval->op = less_than;
|
||||
result = CMPOP2;
|
||||
break;
|
||||
|
||||
case '>':
|
||||
if (exp[0] == '=')
|
||||
{
|
||||
++exp;
|
||||
lval->op = greater_or_equal;
|
||||
}
|
||||
else
|
||||
lval->op = greater_than;
|
||||
result = CMPOP2;
|
||||
break;
|
||||
|
||||
case '*':
|
||||
lval->op = mult;
|
||||
result = MULOP2;
|
||||
break;
|
||||
|
||||
case '/':
|
||||
lval->op = divide;
|
||||
result = MULOP2;
|
||||
break;
|
||||
|
||||
case '%':
|
||||
lval->op = module;
|
||||
result = MULOP2;
|
||||
break;
|
||||
|
||||
case '+':
|
||||
lval->op = plus;
|
||||
result = ADDOP2;
|
||||
break;
|
||||
|
||||
case '-':
|
||||
lval->op = minus;
|
||||
result = ADDOP2;
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
case '?':
|
||||
case ':':
|
||||
case '(':
|
||||
case ')':
|
||||
/* Nothing, just return the character. */
|
||||
break;
|
||||
|
||||
case ';':
|
||||
case '\n':
|
||||
case '\0':
|
||||
/* Be safe and let the user call this function again. */
|
||||
--exp;
|
||||
result = YYEOF;
|
||||
break;
|
||||
|
||||
default:
|
||||
result = YYERRCODE;
|
||||
#if YYDEBUG != 0
|
||||
--exp;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
*pexp = exp;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
yyerror (const char *str)
|
||||
{
|
||||
/* Do nothing. We don't print error messages here. */
|
||||
}
|
|
@ -0,0 +1,188 @@
|
|||
/* Decomposed printf argument list.
|
||||
Copyright (C) 1999, 2002-2003, 2005-2007 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
/* This file can be parametrized with the following macros:
|
||||
ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
|
||||
PRINTF_FETCHARGS Name of the function to be defined.
|
||||
STATIC Set to 'static' to declare the function static. */
|
||||
|
||||
#ifndef PRINTF_FETCHARGS
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Specification. */
|
||||
#ifndef PRINTF_FETCHARGS
|
||||
# include "printf-args.h"
|
||||
#endif
|
||||
|
||||
#ifdef STATIC
|
||||
STATIC
|
||||
#endif
|
||||
int
|
||||
PRINTF_FETCHARGS (va_list args, arguments *a)
|
||||
{
|
||||
size_t i;
|
||||
argument *ap;
|
||||
|
||||
for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++)
|
||||
switch (ap->type)
|
||||
{
|
||||
case TYPE_SCHAR:
|
||||
ap->a.a_schar = va_arg (args, /*signed char*/ int);
|
||||
break;
|
||||
case TYPE_UCHAR:
|
||||
ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
|
||||
break;
|
||||
case TYPE_SHORT:
|
||||
ap->a.a_short = va_arg (args, /*short*/ int);
|
||||
break;
|
||||
case TYPE_USHORT:
|
||||
ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
|
||||
break;
|
||||
case TYPE_INT:
|
||||
ap->a.a_int = va_arg (args, int);
|
||||
break;
|
||||
case TYPE_UINT:
|
||||
ap->a.a_uint = va_arg (args, unsigned int);
|
||||
break;
|
||||
case TYPE_LONGINT:
|
||||
ap->a.a_longint = va_arg (args, long int);
|
||||
break;
|
||||
case TYPE_ULONGINT:
|
||||
ap->a.a_ulongint = va_arg (args, unsigned long int);
|
||||
break;
|
||||
#if HAVE_LONG_LONG_INT
|
||||
case TYPE_LONGLONGINT:
|
||||
ap->a.a_longlongint = va_arg (args, long long int);
|
||||
break;
|
||||
case TYPE_ULONGLONGINT:
|
||||
ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
|
||||
break;
|
||||
#endif
|
||||
case TYPE_DOUBLE:
|
||||
ap->a.a_double = va_arg (args, double);
|
||||
break;
|
||||
case TYPE_LONGDOUBLE:
|
||||
ap->a.a_longdouble = va_arg (args, long double);
|
||||
break;
|
||||
case TYPE_CHAR:
|
||||
ap->a.a_char = va_arg (args, int);
|
||||
break;
|
||||
#if HAVE_WINT_T
|
||||
case TYPE_WIDE_CHAR:
|
||||
/* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by
|
||||
default argument promotions", this is not the case in mingw32,
|
||||
where wint_t is 'unsigned short'. */
|
||||
ap->a.a_wide_char =
|
||||
(sizeof (wint_t) < sizeof (int)
|
||||
? va_arg (args, int)
|
||||
: va_arg (args, wint_t));
|
||||
break;
|
||||
#endif
|
||||
case TYPE_STRING:
|
||||
ap->a.a_string = va_arg (args, const char *);
|
||||
/* A null pointer is an invalid argument for "%s", but in practice
|
||||
it occurs quite frequently in printf statements that produce
|
||||
debug output. Use a fallback in this case. */
|
||||
if (ap->a.a_string == NULL)
|
||||
ap->a.a_string = "(NULL)";
|
||||
break;
|
||||
#if HAVE_WCHAR_T
|
||||
case TYPE_WIDE_STRING:
|
||||
ap->a.a_wide_string = va_arg (args, const wchar_t *);
|
||||
/* A null pointer is an invalid argument for "%ls", but in practice
|
||||
it occurs quite frequently in printf statements that produce
|
||||
debug output. Use a fallback in this case. */
|
||||
if (ap->a.a_wide_string == NULL)
|
||||
{
|
||||
static const wchar_t wide_null_string[] =
|
||||
{
|
||||
(wchar_t)'(',
|
||||
(wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L',
|
||||
(wchar_t)')',
|
||||
(wchar_t)0
|
||||
};
|
||||
ap->a.a_wide_string = wide_null_string;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case TYPE_POINTER:
|
||||
ap->a.a_pointer = va_arg (args, void *);
|
||||
break;
|
||||
case TYPE_COUNT_SCHAR_POINTER:
|
||||
ap->a.a_count_schar_pointer = va_arg (args, signed char *);
|
||||
break;
|
||||
case TYPE_COUNT_SHORT_POINTER:
|
||||
ap->a.a_count_short_pointer = va_arg (args, short *);
|
||||
break;
|
||||
case TYPE_COUNT_INT_POINTER:
|
||||
ap->a.a_count_int_pointer = va_arg (args, int *);
|
||||
break;
|
||||
case TYPE_COUNT_LONGINT_POINTER:
|
||||
ap->a.a_count_longint_pointer = va_arg (args, long int *);
|
||||
break;
|
||||
#if HAVE_LONG_LONG_INT
|
||||
case TYPE_COUNT_LONGLONGINT_POINTER:
|
||||
ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
|
||||
break;
|
||||
#endif
|
||||
#if ENABLE_UNISTDIO
|
||||
/* The unistdio extensions. */
|
||||
case TYPE_U8_STRING:
|
||||
ap->a.a_u8_string = va_arg (args, const uint8_t *);
|
||||
/* A null pointer is an invalid argument for "%U", but in practice
|
||||
it occurs quite frequently in printf statements that produce
|
||||
debug output. Use a fallback in this case. */
|
||||
if (ap->a.a_u8_string == NULL)
|
||||
{
|
||||
static const uint8_t u8_null_string[] =
|
||||
{ '(', 'N', 'U', 'L', 'L', ')', 0 };
|
||||
ap->a.a_u8_string = u8_null_string;
|
||||
}
|
||||
break;
|
||||
case TYPE_U16_STRING:
|
||||
ap->a.a_u16_string = va_arg (args, const uint16_t *);
|
||||
/* A null pointer is an invalid argument for "%lU", but in practice
|
||||
it occurs quite frequently in printf statements that produce
|
||||
debug output. Use a fallback in this case. */
|
||||
if (ap->a.a_u16_string == NULL)
|
||||
{
|
||||
static const uint16_t u16_null_string[] =
|
||||
{ '(', 'N', 'U', 'L', 'L', ')', 0 };
|
||||
ap->a.a_u16_string = u16_null_string;
|
||||
}
|
||||
break;
|
||||
case TYPE_U32_STRING:
|
||||
ap->a.a_u32_string = va_arg (args, const uint32_t *);
|
||||
/* A null pointer is an invalid argument for "%llU", but in practice
|
||||
it occurs quite frequently in printf statements that produce
|
||||
debug output. Use a fallback in this case. */
|
||||
if (ap->a.a_u32_string == NULL)
|
||||
{
|
||||
static const uint32_t u32_null_string[] =
|
||||
{ '(', 'N', 'U', 'L', 'L', ')', 0 };
|
||||
ap->a.a_u32_string = u32_null_string;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
/* Unknown type. */
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,155 @@
|
|||
/* Decomposed printf argument list.
|
||||
Copyright (C) 1999, 2002-2003, 2006-2007 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifndef _PRINTF_ARGS_H
|
||||
#define _PRINTF_ARGS_H
|
||||
|
||||
/* This file can be parametrized with the following macros:
|
||||
ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
|
||||
PRINTF_FETCHARGS Name of the function to be declared.
|
||||
STATIC Set to 'static' to declare the function static. */
|
||||
|
||||
/* Default parameters. */
|
||||
#ifndef PRINTF_FETCHARGS
|
||||
# define PRINTF_FETCHARGS printf_fetchargs
|
||||
#endif
|
||||
|
||||
/* Get size_t. */
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get wchar_t. */
|
||||
#if HAVE_WCHAR_T
|
||||
# include <stddef.h>
|
||||
#endif
|
||||
|
||||
/* Get wint_t. */
|
||||
#if HAVE_WINT_T
|
||||
# include <wchar.h>
|
||||
#endif
|
||||
|
||||
/* Get va_list. */
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
/* Argument types */
|
||||
typedef enum
|
||||
{
|
||||
TYPE_NONE,
|
||||
TYPE_SCHAR,
|
||||
TYPE_UCHAR,
|
||||
TYPE_SHORT,
|
||||
TYPE_USHORT,
|
||||
TYPE_INT,
|
||||
TYPE_UINT,
|
||||
TYPE_LONGINT,
|
||||
TYPE_ULONGINT,
|
||||
#if HAVE_LONG_LONG_INT
|
||||
TYPE_LONGLONGINT,
|
||||
TYPE_ULONGLONGINT,
|
||||
#endif
|
||||
TYPE_DOUBLE,
|
||||
TYPE_LONGDOUBLE,
|
||||
TYPE_CHAR,
|
||||
#if HAVE_WINT_T
|
||||
TYPE_WIDE_CHAR,
|
||||
#endif
|
||||
TYPE_STRING,
|
||||
#if HAVE_WCHAR_T
|
||||
TYPE_WIDE_STRING,
|
||||
#endif
|
||||
TYPE_POINTER,
|
||||
TYPE_COUNT_SCHAR_POINTER,
|
||||
TYPE_COUNT_SHORT_POINTER,
|
||||
TYPE_COUNT_INT_POINTER,
|
||||
TYPE_COUNT_LONGINT_POINTER
|
||||
#if HAVE_LONG_LONG_INT
|
||||
, TYPE_COUNT_LONGLONGINT_POINTER
|
||||
#endif
|
||||
#if ENABLE_UNISTDIO
|
||||
/* The unistdio extensions. */
|
||||
, TYPE_U8_STRING
|
||||
, TYPE_U16_STRING
|
||||
, TYPE_U32_STRING
|
||||
#endif
|
||||
} arg_type;
|
||||
|
||||
/* Polymorphic argument */
|
||||
typedef struct
|
||||
{
|
||||
arg_type type;
|
||||
union
|
||||
{
|
||||
signed char a_schar;
|
||||
unsigned char a_uchar;
|
||||
short a_short;
|
||||
unsigned short a_ushort;
|
||||
int a_int;
|
||||
unsigned int a_uint;
|
||||
long int a_longint;
|
||||
unsigned long int a_ulongint;
|
||||
#if HAVE_LONG_LONG_INT
|
||||
long long int a_longlongint;
|
||||
unsigned long long int a_ulonglongint;
|
||||
#endif
|
||||
float a_float;
|
||||
double a_double;
|
||||
long double a_longdouble;
|
||||
int a_char;
|
||||
#if HAVE_WINT_T
|
||||
wint_t a_wide_char;
|
||||
#endif
|
||||
const char* a_string;
|
||||
#if HAVE_WCHAR_T
|
||||
const wchar_t* a_wide_string;
|
||||
#endif
|
||||
void* a_pointer;
|
||||
signed char * a_count_schar_pointer;
|
||||
short * a_count_short_pointer;
|
||||
int * a_count_int_pointer;
|
||||
long int * a_count_longint_pointer;
|
||||
#if HAVE_LONG_LONG_INT
|
||||
long long int * a_count_longlongint_pointer;
|
||||
#endif
|
||||
#if ENABLE_UNISTDIO
|
||||
/* The unistdio extensions. */
|
||||
const uint8_t * a_u8_string;
|
||||
const uint16_t * a_u16_string;
|
||||
const uint32_t * a_u32_string;
|
||||
#endif
|
||||
}
|
||||
a;
|
||||
}
|
||||
argument;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
size_t count;
|
||||
argument *arg;
|
||||
}
|
||||
arguments;
|
||||
|
||||
|
||||
/* Fetch the arguments, putting them into a. */
|
||||
#ifdef STATIC
|
||||
STATIC
|
||||
#else
|
||||
extern
|
||||
#endif
|
||||
int PRINTF_FETCHARGS (va_list args, arguments *a);
|
||||
|
||||
#endif /* _PRINTF_ARGS_H */
|
|
@ -0,0 +1,590 @@
|
|||
/* Formatted output to strings.
|
||||
Copyright (C) 1999-2000, 2002-2003, 2006-2007 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
/* This file can be parametrized with the following macros:
|
||||
CHAR_T The element type of the format string.
|
||||
CHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters
|
||||
in the format string are ASCII.
|
||||
DIRECTIVE Structure denoting a format directive.
|
||||
Depends on CHAR_T.
|
||||
DIRECTIVES Structure denoting the set of format directives of a
|
||||
format string. Depends on CHAR_T.
|
||||
PRINTF_PARSE Function that parses a format string.
|
||||
Depends on CHAR_T.
|
||||
STATIC Set to 'static' to declare the function static.
|
||||
ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. */
|
||||
|
||||
#ifndef PRINTF_PARSE
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Specification. */
|
||||
#ifndef PRINTF_PARSE
|
||||
# include "printf-parse.h"
|
||||
#endif
|
||||
|
||||
/* Default parameters. */
|
||||
#ifndef PRINTF_PARSE
|
||||
# define PRINTF_PARSE printf_parse
|
||||
# define CHAR_T char
|
||||
# define DIRECTIVE char_directive
|
||||
# define DIRECTIVES char_directives
|
||||
#endif
|
||||
|
||||
/* Get size_t, NULL. */
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get intmax_t. */
|
||||
#if defined IN_LIBINTL || defined IN_LIBASPRINTF
|
||||
# if HAVE_STDINT_H_WITH_UINTMAX
|
||||
# include <stdint.h>
|
||||
# endif
|
||||
# if HAVE_INTTYPES_H_WITH_UINTMAX
|
||||
# include <inttypes.h>
|
||||
# endif
|
||||
#else
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
/* malloc(), realloc(), free(). */
|
||||
#include <stdlib.h>
|
||||
|
||||
/* errno. */
|
||||
#include <errno.h>
|
||||
|
||||
/* Checked size_t computations. */
|
||||
#include "xsize.h"
|
||||
|
||||
#if CHAR_T_ONLY_ASCII
|
||||
/* c_isascii(). */
|
||||
# include "c-ctype.h"
|
||||
#endif
|
||||
|
||||
#ifdef STATIC
|
||||
STATIC
|
||||
#endif
|
||||
int
|
||||
PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
|
||||
{
|
||||
const CHAR_T *cp = format; /* pointer into format */
|
||||
size_t arg_posn = 0; /* number of regular arguments consumed */
|
||||
size_t d_allocated; /* allocated elements of d->dir */
|
||||
size_t a_allocated; /* allocated elements of a->arg */
|
||||
size_t max_width_length = 0;
|
||||
size_t max_precision_length = 0;
|
||||
|
||||
d->count = 0;
|
||||
d_allocated = 1;
|
||||
d->dir = (DIRECTIVE *) malloc (d_allocated * sizeof (DIRECTIVE));
|
||||
if (d->dir == NULL)
|
||||
/* Out of memory. */
|
||||
goto out_of_memory_1;
|
||||
|
||||
a->count = 0;
|
||||
a_allocated = 0;
|
||||
a->arg = NULL;
|
||||
|
||||
#define REGISTER_ARG(_index_,_type_) \
|
||||
{ \
|
||||
size_t n = (_index_); \
|
||||
if (n >= a_allocated) \
|
||||
{ \
|
||||
size_t memory_size; \
|
||||
argument *memory; \
|
||||
\
|
||||
a_allocated = xtimes (a_allocated, 2); \
|
||||
if (a_allocated <= n) \
|
||||
a_allocated = xsum (n, 1); \
|
||||
memory_size = xtimes (a_allocated, sizeof (argument)); \
|
||||
if (size_overflow_p (memory_size)) \
|
||||
/* Overflow, would lead to out of memory. */ \
|
||||
goto out_of_memory; \
|
||||
memory = (argument *) (a->arg \
|
||||
? realloc (a->arg, memory_size) \
|
||||
: malloc (memory_size)); \
|
||||
if (memory == NULL) \
|
||||
/* Out of memory. */ \
|
||||
goto out_of_memory; \
|
||||
a->arg = memory; \
|
||||
} \
|
||||
while (a->count <= n) \
|
||||
a->arg[a->count++].type = TYPE_NONE; \
|
||||
if (a->arg[n].type == TYPE_NONE) \
|
||||
a->arg[n].type = (_type_); \
|
||||
else if (a->arg[n].type != (_type_)) \
|
||||
/* Ambiguous type for positional argument. */ \
|
||||
goto error; \
|
||||
}
|
||||
|
||||
while (*cp != '\0')
|
||||
{
|
||||
CHAR_T c = *cp++;
|
||||
if (c == '%')
|
||||
{
|
||||
size_t arg_index = ARG_NONE;
|
||||
DIRECTIVE *dp = &d->dir[d->count]; /* pointer to next directive */
|
||||
|
||||
/* Initialize the next directive. */
|
||||
dp->dir_start = cp - 1;
|
||||
dp->flags = 0;
|
||||
dp->width_start = NULL;
|
||||
dp->width_end = NULL;
|
||||
dp->width_arg_index = ARG_NONE;
|
||||
dp->precision_start = NULL;
|
||||
dp->precision_end = NULL;
|
||||
dp->precision_arg_index = ARG_NONE;
|
||||
dp->arg_index = ARG_NONE;
|
||||
|
||||
/* Test for positional argument. */
|
||||
if (*cp >= '0' && *cp <= '9')
|
||||
{
|
||||
const CHAR_T *np;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
;
|
||||
if (*np == '$')
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
n = xsum (xtimes (n, 10), *np - '0');
|
||||
if (n == 0)
|
||||
/* Positional argument 0. */
|
||||
goto error;
|
||||
if (size_overflow_p (n))
|
||||
/* n too large, would lead to out of memory later. */
|
||||
goto error;
|
||||
arg_index = n - 1;
|
||||
cp = np + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Read the flags. */
|
||||
for (;;)
|
||||
{
|
||||
if (*cp == '\'')
|
||||
{
|
||||
dp->flags |= FLAG_GROUP;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == '-')
|
||||
{
|
||||
dp->flags |= FLAG_LEFT;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == '+')
|
||||
{
|
||||
dp->flags |= FLAG_SHOWSIGN;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == ' ')
|
||||
{
|
||||
dp->flags |= FLAG_SPACE;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == '#')
|
||||
{
|
||||
dp->flags |= FLAG_ALT;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == '0')
|
||||
{
|
||||
dp->flags |= FLAG_ZERO;
|
||||
cp++;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
/* Parse the field width. */
|
||||
if (*cp == '*')
|
||||
{
|
||||
dp->width_start = cp;
|
||||
cp++;
|
||||
dp->width_end = cp;
|
||||
if (max_width_length < 1)
|
||||
max_width_length = 1;
|
||||
|
||||
/* Test for positional argument. */
|
||||
if (*cp >= '0' && *cp <= '9')
|
||||
{
|
||||
const CHAR_T *np;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
;
|
||||
if (*np == '$')
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
n = xsum (xtimes (n, 10), *np - '0');
|
||||
if (n == 0)
|
||||
/* Positional argument 0. */
|
||||
goto error;
|
||||
if (size_overflow_p (n))
|
||||
/* n too large, would lead to out of memory later. */
|
||||
goto error;
|
||||
dp->width_arg_index = n - 1;
|
||||
cp = np + 1;
|
||||
}
|
||||
}
|
||||
if (dp->width_arg_index == ARG_NONE)
|
||||
{
|
||||
dp->width_arg_index = arg_posn++;
|
||||
if (dp->width_arg_index == ARG_NONE)
|
||||
/* arg_posn wrapped around. */
|
||||
goto error;
|
||||
}
|
||||
REGISTER_ARG (dp->width_arg_index, TYPE_INT);
|
||||
}
|
||||
else if (*cp >= '0' && *cp <= '9')
|
||||
{
|
||||
size_t width_length;
|
||||
|
||||
dp->width_start = cp;
|
||||
for (; *cp >= '0' && *cp <= '9'; cp++)
|
||||
;
|
||||
dp->width_end = cp;
|
||||
width_length = dp->width_end - dp->width_start;
|
||||
if (max_width_length < width_length)
|
||||
max_width_length = width_length;
|
||||
}
|
||||
|
||||
/* Parse the precision. */
|
||||
if (*cp == '.')
|
||||
{
|
||||
cp++;
|
||||
if (*cp == '*')
|
||||
{
|
||||
dp->precision_start = cp - 1;
|
||||
cp++;
|
||||
dp->precision_end = cp;
|
||||
if (max_precision_length < 2)
|
||||
max_precision_length = 2;
|
||||
|
||||
/* Test for positional argument. */
|
||||
if (*cp >= '0' && *cp <= '9')
|
||||
{
|
||||
const CHAR_T *np;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
;
|
||||
if (*np == '$')
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
n = xsum (xtimes (n, 10), *np - '0');
|
||||
if (n == 0)
|
||||
/* Positional argument 0. */
|
||||
goto error;
|
||||
if (size_overflow_p (n))
|
||||
/* n too large, would lead to out of memory
|
||||
later. */
|
||||
goto error;
|
||||
dp->precision_arg_index = n - 1;
|
||||
cp = np + 1;
|
||||
}
|
||||
}
|
||||
if (dp->precision_arg_index == ARG_NONE)
|
||||
{
|
||||
dp->precision_arg_index = arg_posn++;
|
||||
if (dp->precision_arg_index == ARG_NONE)
|
||||
/* arg_posn wrapped around. */
|
||||
goto error;
|
||||
}
|
||||
REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t precision_length;
|
||||
|
||||
dp->precision_start = cp - 1;
|
||||
for (; *cp >= '0' && *cp <= '9'; cp++)
|
||||
;
|
||||
dp->precision_end = cp;
|
||||
precision_length = dp->precision_end - dp->precision_start;
|
||||
if (max_precision_length < precision_length)
|
||||
max_precision_length = precision_length;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
arg_type type;
|
||||
|
||||
/* Parse argument type/size specifiers. */
|
||||
{
|
||||
int flags = 0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (*cp == 'h')
|
||||
{
|
||||
flags |= (1 << (flags & 1));
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == 'L')
|
||||
{
|
||||
flags |= 4;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == 'l')
|
||||
{
|
||||
flags += 8;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == 'j')
|
||||
{
|
||||
if (sizeof (intmax_t) > sizeof (long))
|
||||
{
|
||||
/* intmax_t = long long */
|
||||
flags += 16;
|
||||
}
|
||||
else if (sizeof (intmax_t) > sizeof (int))
|
||||
{
|
||||
/* intmax_t = long */
|
||||
flags += 8;
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == 'z' || *cp == 'Z')
|
||||
{
|
||||
/* 'z' is standardized in ISO C 99, but glibc uses 'Z'
|
||||
because the warning facility in gcc-2.95.2 understands
|
||||
only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */
|
||||
if (sizeof (size_t) > sizeof (long))
|
||||
{
|
||||
/* size_t = long long */
|
||||
flags += 16;
|
||||
}
|
||||
else if (sizeof (size_t) > sizeof (int))
|
||||
{
|
||||
/* size_t = long */
|
||||
flags += 8;
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == 't')
|
||||
{
|
||||
if (sizeof (ptrdiff_t) > sizeof (long))
|
||||
{
|
||||
/* ptrdiff_t = long long */
|
||||
flags += 16;
|
||||
}
|
||||
else if (sizeof (ptrdiff_t) > sizeof (int))
|
||||
{
|
||||
/* ptrdiff_t = long */
|
||||
flags += 8;
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
/* Read the conversion character. */
|
||||
c = *cp++;
|
||||
switch (c)
|
||||
{
|
||||
case 'd': case 'i':
|
||||
#if HAVE_LONG_LONG_INT
|
||||
/* If 'long long' exists and is larger than 'long': */
|
||||
if (flags >= 16 || (flags & 4))
|
||||
type = TYPE_LONGLONGINT;
|
||||
else
|
||||
#endif
|
||||
/* If 'long long' exists and is the same as 'long', we parse
|
||||
"lld" into TYPE_LONGINT. */
|
||||
if (flags >= 8)
|
||||
type = TYPE_LONGINT;
|
||||
else if (flags & 2)
|
||||
type = TYPE_SCHAR;
|
||||
else if (flags & 1)
|
||||
type = TYPE_SHORT;
|
||||
else
|
||||
type = TYPE_INT;
|
||||
break;
|
||||
case 'o': case 'u': case 'x': case 'X':
|
||||
#if HAVE_LONG_LONG_INT
|
||||
/* If 'long long' exists and is larger than 'long': */
|
||||
if (flags >= 16 || (flags & 4))
|
||||
type = TYPE_ULONGLONGINT;
|
||||
else
|
||||
#endif
|
||||
/* If 'unsigned long long' exists and is the same as
|
||||
'unsigned long', we parse "llu" into TYPE_ULONGINT. */
|
||||
if (flags >= 8)
|
||||
type = TYPE_ULONGINT;
|
||||
else if (flags & 2)
|
||||
type = TYPE_UCHAR;
|
||||
else if (flags & 1)
|
||||
type = TYPE_USHORT;
|
||||
else
|
||||
type = TYPE_UINT;
|
||||
break;
|
||||
case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
|
||||
case 'a': case 'A':
|
||||
if (flags >= 16 || (flags & 4))
|
||||
type = TYPE_LONGDOUBLE;
|
||||
else
|
||||
type = TYPE_DOUBLE;
|
||||
break;
|
||||
case 'c':
|
||||
if (flags >= 8)
|
||||
#if HAVE_WINT_T
|
||||
type = TYPE_WIDE_CHAR;
|
||||
#else
|
||||
goto error;
|
||||
#endif
|
||||
else
|
||||
type = TYPE_CHAR;
|
||||
break;
|
||||
#if HAVE_WINT_T
|
||||
case 'C':
|
||||
type = TYPE_WIDE_CHAR;
|
||||
c = 'c';
|
||||
break;
|
||||
#endif
|
||||
case 's':
|
||||
if (flags >= 8)
|
||||
#if HAVE_WCHAR_T
|
||||
type = TYPE_WIDE_STRING;
|
||||
#else
|
||||
goto error;
|
||||
#endif
|
||||
else
|
||||
type = TYPE_STRING;
|
||||
break;
|
||||
#if HAVE_WCHAR_T
|
||||
case 'S':
|
||||
type = TYPE_WIDE_STRING;
|
||||
c = 's';
|
||||
break;
|
||||
#endif
|
||||
case 'p':
|
||||
type = TYPE_POINTER;
|
||||
break;
|
||||
case 'n':
|
||||
#if HAVE_LONG_LONG_INT
|
||||
/* If 'long long' exists and is larger than 'long': */
|
||||
if (flags >= 16 || (flags & 4))
|
||||
type = TYPE_COUNT_LONGLONGINT_POINTER;
|
||||
else
|
||||
#endif
|
||||
/* If 'long long' exists and is the same as 'long', we parse
|
||||
"lln" into TYPE_COUNT_LONGINT_POINTER. */
|
||||
if (flags >= 8)
|
||||
type = TYPE_COUNT_LONGINT_POINTER;
|
||||
else if (flags & 2)
|
||||
type = TYPE_COUNT_SCHAR_POINTER;
|
||||
else if (flags & 1)
|
||||
type = TYPE_COUNT_SHORT_POINTER;
|
||||
else
|
||||
type = TYPE_COUNT_INT_POINTER;
|
||||
break;
|
||||
#if ENABLE_UNISTDIO
|
||||
/* The unistdio extensions. */
|
||||
case 'U':
|
||||
if (flags >= 16)
|
||||
type = TYPE_U32_STRING;
|
||||
else if (flags >= 8)
|
||||
type = TYPE_U16_STRING;
|
||||
else
|
||||
type = TYPE_U8_STRING;
|
||||
break;
|
||||
#endif
|
||||
case '%':
|
||||
type = TYPE_NONE;
|
||||
break;
|
||||
default:
|
||||
/* Unknown conversion character. */
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
if (type != TYPE_NONE)
|
||||
{
|
||||
dp->arg_index = arg_index;
|
||||
if (dp->arg_index == ARG_NONE)
|
||||
{
|
||||
dp->arg_index = arg_posn++;
|
||||
if (dp->arg_index == ARG_NONE)
|
||||
/* arg_posn wrapped around. */
|
||||
goto error;
|
||||
}
|
||||
REGISTER_ARG (dp->arg_index, type);
|
||||
}
|
||||
dp->conversion = c;
|
||||
dp->dir_end = cp;
|
||||
}
|
||||
|
||||
d->count++;
|
||||
if (d->count >= d_allocated)
|
||||
{
|
||||
size_t memory_size;
|
||||
DIRECTIVE *memory;
|
||||
|
||||
d_allocated = xtimes (d_allocated, 2);
|
||||
memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
|
||||
if (size_overflow_p (memory_size))
|
||||
/* Overflow, would lead to out of memory. */
|
||||
goto out_of_memory;
|
||||
memory = (DIRECTIVE *) realloc (d->dir, memory_size);
|
||||
if (memory == NULL)
|
||||
/* Out of memory. */
|
||||
goto out_of_memory;
|
||||
d->dir = memory;
|
||||
}
|
||||
}
|
||||
#if CHAR_T_ONLY_ASCII
|
||||
else if (!c_isascii (c))
|
||||
{
|
||||
/* Non-ASCII character. Not supported. */
|
||||
goto error;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
d->dir[d->count].dir_start = cp;
|
||||
|
||||
d->max_width_length = max_width_length;
|
||||
d->max_precision_length = max_precision_length;
|
||||
return 0;
|
||||
|
||||
error:
|
||||
if (a->arg)
|
||||
free (a->arg);
|
||||
if (d->dir)
|
||||
free (d->dir);
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
|
||||
out_of_memory:
|
||||
if (a->arg)
|
||||
free (a->arg);
|
||||
if (d->dir)
|
||||
free (d->dir);
|
||||
out_of_memory_1:
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
}
|
||||
|
||||
#undef PRINTF_PARSE
|
||||
#undef DIRECTIVES
|
||||
#undef DIRECTIVE
|
||||
#undef CHAR_T_ONLY_ASCII
|
||||
#undef CHAR_T
|
|
@ -0,0 +1,75 @@
|
|||
/* Parse printf format string.
|
||||
Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifndef _PRINTF_PARSE_H
|
||||
#define _PRINTF_PARSE_H
|
||||
|
||||
#include "printf-args.h"
|
||||
|
||||
|
||||
/* Flags */
|
||||
#define FLAG_GROUP 1 /* ' flag */
|
||||
#define FLAG_LEFT 2 /* - flag */
|
||||
#define FLAG_SHOWSIGN 4 /* + flag */
|
||||
#define FLAG_SPACE 8 /* space flag */
|
||||
#define FLAG_ALT 16 /* # flag */
|
||||
#define FLAG_ZERO 32
|
||||
|
||||
/* arg_index value indicating that no argument is consumed. */
|
||||
#define ARG_NONE (~(size_t)0)
|
||||
|
||||
/* A parsed directive. */
|
||||
typedef struct
|
||||
{
|
||||
const char* dir_start;
|
||||
const char* dir_end;
|
||||
int flags;
|
||||
const char* width_start;
|
||||
const char* width_end;
|
||||
size_t width_arg_index;
|
||||
const char* precision_start;
|
||||
const char* precision_end;
|
||||
size_t precision_arg_index;
|
||||
char conversion; /* d i o u x X f e E g G c s p n U % but not C S */
|
||||
size_t arg_index;
|
||||
}
|
||||
char_directive;
|
||||
|
||||
/* A parsed format string. */
|
||||
typedef struct
|
||||
{
|
||||
size_t count;
|
||||
char_directive *dir;
|
||||
size_t max_width_length;
|
||||
size_t max_precision_length;
|
||||
}
|
||||
char_directives;
|
||||
|
||||
|
||||
/* Parses the format string. Fills in the number N of directives, and fills
|
||||
in directives[0], ..., directives[N-1], and sets directives[N].dir_start
|
||||
to the end of the format string. Also fills in the arg_type fields of the
|
||||
arguments and the needed count of arguments. */
|
||||
#ifdef STATIC
|
||||
STATIC
|
||||
#else
|
||||
extern
|
||||
#endif
|
||||
int printf_parse (const char *format, char_directives *d, arguments *a);
|
||||
|
||||
#endif /* _PRINTF_PARSE_H */
|
|
@ -0,0 +1,427 @@
|
|||
/* Formatted output to strings, using POSIX/XSI format strings with positions.
|
||||
Copyright (C) 2003, 2006-2007 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2003.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define alloca __builtin_alloca
|
||||
# define HAVE_ALLOCA 1
|
||||
#else
|
||||
# ifdef _MSC_VER
|
||||
# include <malloc.h>
|
||||
# define alloca _alloca
|
||||
# else
|
||||
# if defined HAVE_ALLOCA_H || defined _LIBC
|
||||
# include <alloca.h>
|
||||
# else
|
||||
# ifdef _AIX
|
||||
#pragma alloca
|
||||
# else
|
||||
# ifndef alloca
|
||||
char *alloca ();
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#if !HAVE_POSIX_PRINTF
|
||||
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */
|
||||
#ifndef EOVERFLOW
|
||||
# define EOVERFLOW E2BIG
|
||||
#endif
|
||||
|
||||
/* When building a DLL, we must export some functions. Note that because
|
||||
the functions are only defined for binary backward compatibility, we
|
||||
don't need to use __declspec(dllimport) in any case. */
|
||||
#if defined _MSC_VER && BUILDING_DLL
|
||||
# define DLL_EXPORTED __declspec(dllexport)
|
||||
#else
|
||||
# define DLL_EXPORTED
|
||||
#endif
|
||||
|
||||
#define STATIC static
|
||||
|
||||
/* This needs to be consistent with libgnuintl.h.in. */
|
||||
#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__
|
||||
/* Don't break __attribute__((format(printf,M,N))).
|
||||
This redefinition is only possible because the libc in NetBSD, Cygwin,
|
||||
mingw does not have a function __printf__. */
|
||||
# define libintl_printf __printf__
|
||||
#endif
|
||||
|
||||
/* Define auxiliary functions declared in "printf-args.h". */
|
||||
#include "printf-args.c"
|
||||
|
||||
/* Define auxiliary functions declared in "printf-parse.h". */
|
||||
#include "printf-parse.c"
|
||||
|
||||
/* Define functions declared in "vasnprintf.h". */
|
||||
#define vasnprintf libintl_vasnprintf
|
||||
#include "vasnprintf.c"
|
||||
#if 0 /* not needed */
|
||||
#define asnprintf libintl_asnprintf
|
||||
#include "asnprintf.c"
|
||||
#endif
|
||||
|
||||
DLL_EXPORTED
|
||||
int
|
||||
libintl_vfprintf (FILE *stream, const char *format, va_list args)
|
||||
{
|
||||
if (strchr (format, '$') == NULL)
|
||||
return vfprintf (stream, format, args);
|
||||
else
|
||||
{
|
||||
size_t length;
|
||||
char *result = libintl_vasnprintf (NULL, &length, format, args);
|
||||
int retval = -1;
|
||||
if (result != NULL)
|
||||
{
|
||||
size_t written = fwrite (result, 1, length, stream);
|
||||
free (result);
|
||||
if (written == length)
|
||||
{
|
||||
if (length > INT_MAX)
|
||||
errno = EOVERFLOW;
|
||||
else
|
||||
retval = length;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
DLL_EXPORTED
|
||||
int
|
||||
libintl_fprintf (FILE *stream, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
int retval;
|
||||
|
||||
va_start (args, format);
|
||||
retval = libintl_vfprintf (stream, format, args);
|
||||
va_end (args);
|
||||
return retval;
|
||||
}
|
||||
|
||||
DLL_EXPORTED
|
||||
int
|
||||
libintl_vprintf (const char *format, va_list args)
|
||||
{
|
||||
return libintl_vfprintf (stdout, format, args);
|
||||
}
|
||||
|
||||
DLL_EXPORTED
|
||||
int
|
||||
libintl_printf (const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
int retval;
|
||||
|
||||
va_start (args, format);
|
||||
retval = libintl_vprintf (format, args);
|
||||
va_end (args);
|
||||
return retval;
|
||||
}
|
||||
|
||||
DLL_EXPORTED
|
||||
int
|
||||
libintl_vsprintf (char *resultbuf, const char *format, va_list args)
|
||||
{
|
||||
if (strchr (format, '$') == NULL)
|
||||
return vsprintf (resultbuf, format, args);
|
||||
else
|
||||
{
|
||||
size_t length = (size_t) ~0 / (4 * sizeof (char));
|
||||
char *result = libintl_vasnprintf (resultbuf, &length, format, args);
|
||||
if (result != resultbuf)
|
||||
{
|
||||
free (result);
|
||||
return -1;
|
||||
}
|
||||
if (length > INT_MAX)
|
||||
{
|
||||
errno = EOVERFLOW;
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
return length;
|
||||
}
|
||||
}
|
||||
|
||||
DLL_EXPORTED
|
||||
int
|
||||
libintl_sprintf (char *resultbuf, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
int retval;
|
||||
|
||||
va_start (args, format);
|
||||
retval = libintl_vsprintf (resultbuf, format, args);
|
||||
va_end (args);
|
||||
return retval;
|
||||
}
|
||||
|
||||
#if HAVE_SNPRINTF
|
||||
|
||||
# if HAVE_DECL__SNPRINTF
|
||||
/* Windows. */
|
||||
# define system_vsnprintf _vsnprintf
|
||||
# else
|
||||
/* Unix. */
|
||||
# define system_vsnprintf vsnprintf
|
||||
# endif
|
||||
|
||||
DLL_EXPORTED
|
||||
int
|
||||
libintl_vsnprintf (char *resultbuf, size_t length, const char *format, va_list args)
|
||||
{
|
||||
if (strchr (format, '$') == NULL)
|
||||
return system_vsnprintf (resultbuf, length, format, args);
|
||||
else
|
||||
{
|
||||
size_t maxlength = length;
|
||||
char *result = libintl_vasnprintf (resultbuf, &length, format, args);
|
||||
if (result != resultbuf)
|
||||
{
|
||||
if (maxlength > 0)
|
||||
{
|
||||
size_t pruned_length =
|
||||
(length < maxlength ? length : maxlength - 1);
|
||||
memcpy (resultbuf, result, pruned_length);
|
||||
resultbuf[pruned_length] = '\0';
|
||||
}
|
||||
free (result);
|
||||
}
|
||||
if (length > INT_MAX)
|
||||
{
|
||||
errno = EOVERFLOW;
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
return length;
|
||||
}
|
||||
}
|
||||
|
||||
DLL_EXPORTED
|
||||
int
|
||||
libintl_snprintf (char *resultbuf, size_t length, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
int retval;
|
||||
|
||||
va_start (args, format);
|
||||
retval = libintl_vsnprintf (resultbuf, length, format, args);
|
||||
va_end (args);
|
||||
return retval;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if HAVE_ASPRINTF
|
||||
|
||||
DLL_EXPORTED
|
||||
int
|
||||
libintl_vasprintf (char **resultp, const char *format, va_list args)
|
||||
{
|
||||
size_t length;
|
||||
char *result = libintl_vasnprintf (NULL, &length, format, args);
|
||||
if (result == NULL)
|
||||
return -1;
|
||||
if (length > INT_MAX)
|
||||
{
|
||||
free (result);
|
||||
errno = EOVERFLOW;
|
||||
return -1;
|
||||
}
|
||||
*resultp = result;
|
||||
return length;
|
||||
}
|
||||
|
||||
DLL_EXPORTED
|
||||
int
|
||||
libintl_asprintf (char **resultp, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
int retval;
|
||||
|
||||
va_start (args, format);
|
||||
retval = libintl_vasprintf (resultp, format, args);
|
||||
va_end (args);
|
||||
return retval;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if HAVE_FWPRINTF
|
||||
|
||||
#include <wchar.h>
|
||||
|
||||
#define WIDE_CHAR_VERSION 1
|
||||
|
||||
#include "wprintf-parse.h"
|
||||
/* Define auxiliary functions declared in "wprintf-parse.h". */
|
||||
#define CHAR_T wchar_t
|
||||
#define DIRECTIVE wchar_t_directive
|
||||
#define DIRECTIVES wchar_t_directives
|
||||
#define PRINTF_PARSE wprintf_parse
|
||||
#include "printf-parse.c"
|
||||
|
||||
/* Define functions declared in "vasnprintf.h". */
|
||||
#define vasnwprintf libintl_vasnwprintf
|
||||
#include "vasnprintf.c"
|
||||
#if 0 /* not needed */
|
||||
#define asnwprintf libintl_asnwprintf
|
||||
#include "asnprintf.c"
|
||||
#endif
|
||||
|
||||
# if HAVE_DECL__SNWPRINTF
|
||||
/* Windows. */
|
||||
# define system_vswprintf _vsnwprintf
|
||||
# else
|
||||
/* Unix. */
|
||||
# define system_vswprintf vswprintf
|
||||
# endif
|
||||
|
||||
DLL_EXPORTED
|
||||
int
|
||||
libintl_vfwprintf (FILE *stream, const wchar_t *format, va_list args)
|
||||
{
|
||||
if (wcschr (format, '$') == NULL)
|
||||
return vfwprintf (stream, format, args);
|
||||
else
|
||||
{
|
||||
size_t length;
|
||||
wchar_t *result = libintl_vasnwprintf (NULL, &length, format, args);
|
||||
int retval = -1;
|
||||
if (result != NULL)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < length; i++)
|
||||
if (fputwc (result[i], stream) == WEOF)
|
||||
break;
|
||||
free (result);
|
||||
if (i == length)
|
||||
{
|
||||
if (length > INT_MAX)
|
||||
errno = EOVERFLOW;
|
||||
else
|
||||
retval = length;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
DLL_EXPORTED
|
||||
int
|
||||
libintl_fwprintf (FILE *stream, const wchar_t *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
int retval;
|
||||
|
||||
va_start (args, format);
|
||||
retval = libintl_vfwprintf (stream, format, args);
|
||||
va_end (args);
|
||||
return retval;
|
||||
}
|
||||
|
||||
DLL_EXPORTED
|
||||
int
|
||||
libintl_vwprintf (const wchar_t *format, va_list args)
|
||||
{
|
||||
return libintl_vfwprintf (stdout, format, args);
|
||||
}
|
||||
|
||||
DLL_EXPORTED
|
||||
int
|
||||
libintl_wprintf (const wchar_t *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
int retval;
|
||||
|
||||
va_start (args, format);
|
||||
retval = libintl_vwprintf (format, args);
|
||||
va_end (args);
|
||||
return retval;
|
||||
}
|
||||
|
||||
DLL_EXPORTED
|
||||
int
|
||||
libintl_vswprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, va_list args)
|
||||
{
|
||||
if (wcschr (format, '$') == NULL)
|
||||
return system_vswprintf (resultbuf, length, format, args);
|
||||
else
|
||||
{
|
||||
size_t maxlength = length;
|
||||
wchar_t *result = libintl_vasnwprintf (resultbuf, &length, format, args);
|
||||
if (result != resultbuf)
|
||||
{
|
||||
if (maxlength > 0)
|
||||
{
|
||||
size_t pruned_length =
|
||||
(length < maxlength ? length : maxlength - 1);
|
||||
memcpy (resultbuf, result, pruned_length * sizeof (wchar_t));
|
||||
resultbuf[pruned_length] = 0;
|
||||
}
|
||||
free (result);
|
||||
/* Unlike vsnprintf, which has to return the number of character that
|
||||
would have been produced if the resultbuf had been sufficiently
|
||||
large, the vswprintf function has to return a negative value if
|
||||
the resultbuf was not sufficiently large. */
|
||||
if (length >= maxlength)
|
||||
return -1;
|
||||
}
|
||||
if (length > INT_MAX)
|
||||
{
|
||||
errno = EOVERFLOW;
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
return length;
|
||||
}
|
||||
}
|
||||
|
||||
DLL_EXPORTED
|
||||
int
|
||||
libintl_swprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
int retval;
|
||||
|
||||
va_start (args, format);
|
||||
retval = libintl_vswprintf (resultbuf, length, format, args);
|
||||
va_end (args);
|
||||
return retval;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,31 @@
|
|||
# Add this package to a list of references stored in a text file.
|
||||
#
|
||||
# Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Library 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
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Library 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.
|
||||
#
|
||||
# Written by Bruno Haible <haible@clisp.cons.org>.
|
||||
#
|
||||
/^# Packages using this file: / {
|
||||
s/# Packages using this file://
|
||||
ta
|
||||
:a
|
||||
s/ @PACKAGE@ / @PACKAGE@ /
|
||||
tb
|
||||
s/ $/ @PACKAGE@ /
|
||||
:b
|
||||
s/^/# Packages using this file:/
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
# Remove this package from a list of references stored in a text file.
|
||||
#
|
||||
# Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Library 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
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Library 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.
|
||||
#
|
||||
# Written by Bruno Haible <haible@clisp.cons.org>.
|
||||
#
|
||||
/^# Packages using this file: / {
|
||||
s/# Packages using this file://
|
||||
s/ @PACKAGE@ / /
|
||||
s/^/# Packages using this file:/
|
||||
}
|
|
@ -0,0 +1,468 @@
|
|||
/* Provide relocatable packages.
|
||||
Copyright (C) 2003-2006 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2003.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
|
||||
/* Tell glibc's <stdio.h> to provide a prototype for getline().
|
||||
This must come before <config.h> because <config.h> may include
|
||||
<features.h>, and once <features.h> has been included, it's too late. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE 1
|
||||
#endif
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include "relocatable.h"
|
||||
|
||||
#if ENABLE_RELOCATABLE
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef NO_XMALLOC
|
||||
# define xmalloc malloc
|
||||
#else
|
||||
# include "xalloc.h"
|
||||
#endif
|
||||
|
||||
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#if DEPENDS_ON_LIBCHARSET
|
||||
# include <libcharset.h>
|
||||
#endif
|
||||
#if DEPENDS_ON_LIBICONV && HAVE_ICONV
|
||||
# include <iconv.h>
|
||||
#endif
|
||||
#if DEPENDS_ON_LIBINTL && ENABLE_NLS
|
||||
# include <libintl.h>
|
||||
#endif
|
||||
|
||||
/* Faked cheap 'bool'. */
|
||||
#undef bool
|
||||
#undef false
|
||||
#undef true
|
||||
#define bool int
|
||||
#define false 0
|
||||
#define true 1
|
||||
|
||||
/* Pathname support.
|
||||
ISSLASH(C) tests whether C is a directory separator character.
|
||||
IS_PATH_WITH_DIR(P) tests whether P contains a directory specification.
|
||||
*/
|
||||
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
|
||||
/* Win32, Cygwin, OS/2, DOS */
|
||||
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
|
||||
# define HAS_DEVICE(P) \
|
||||
((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
|
||||
&& (P)[1] == ':')
|
||||
# define IS_PATH_WITH_DIR(P) \
|
||||
(strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
|
||||
# define FILE_SYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0)
|
||||
#else
|
||||
/* Unix */
|
||||
# define ISSLASH(C) ((C) == '/')
|
||||
# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
|
||||
# define FILE_SYSTEM_PREFIX_LEN(P) 0
|
||||
#endif
|
||||
|
||||
/* Original installation prefix. */
|
||||
static char *orig_prefix;
|
||||
static size_t orig_prefix_len;
|
||||
/* Current installation prefix. */
|
||||
static char *curr_prefix;
|
||||
static size_t curr_prefix_len;
|
||||
/* These prefixes do not end in a slash. Anything that will be concatenated
|
||||
to them must start with a slash. */
|
||||
|
||||
/* Sets the original and the current installation prefix of this module.
|
||||
Relocation simply replaces a pathname starting with the original prefix
|
||||
by the corresponding pathname with the current prefix instead. Both
|
||||
prefixes should be directory names without trailing slash (i.e. use ""
|
||||
instead of "/"). */
|
||||
static void
|
||||
set_this_relocation_prefix (const char *orig_prefix_arg,
|
||||
const char *curr_prefix_arg)
|
||||
{
|
||||
if (orig_prefix_arg != NULL && curr_prefix_arg != NULL
|
||||
/* Optimization: if orig_prefix and curr_prefix are equal, the
|
||||
relocation is a nop. */
|
||||
&& strcmp (orig_prefix_arg, curr_prefix_arg) != 0)
|
||||
{
|
||||
/* Duplicate the argument strings. */
|
||||
char *memory;
|
||||
|
||||
orig_prefix_len = strlen (orig_prefix_arg);
|
||||
curr_prefix_len = strlen (curr_prefix_arg);
|
||||
memory = (char *) xmalloc (orig_prefix_len + 1 + curr_prefix_len + 1);
|
||||
#ifdef NO_XMALLOC
|
||||
if (memory != NULL)
|
||||
#endif
|
||||
{
|
||||
memcpy (memory, orig_prefix_arg, orig_prefix_len + 1);
|
||||
orig_prefix = memory;
|
||||
memory += orig_prefix_len + 1;
|
||||
memcpy (memory, curr_prefix_arg, curr_prefix_len + 1);
|
||||
curr_prefix = memory;
|
||||
return;
|
||||
}
|
||||
}
|
||||
orig_prefix = NULL;
|
||||
curr_prefix = NULL;
|
||||
/* Don't worry about wasted memory here - this function is usually only
|
||||
called once. */
|
||||
}
|
||||
|
||||
/* Sets the original and the current installation prefix of the package.
|
||||
Relocation simply replaces a pathname starting with the original prefix
|
||||
by the corresponding pathname with the current prefix instead. Both
|
||||
prefixes should be directory names without trailing slash (i.e. use ""
|
||||
instead of "/"). */
|
||||
void
|
||||
set_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg)
|
||||
{
|
||||
set_this_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
|
||||
|
||||
/* Now notify all dependent libraries. */
|
||||
#if DEPENDS_ON_LIBCHARSET
|
||||
libcharset_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
|
||||
#endif
|
||||
#if DEPENDS_ON_LIBICONV && HAVE_ICONV && _LIBICONV_VERSION >= 0x0109
|
||||
libiconv_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
|
||||
#endif
|
||||
#if DEPENDS_ON_LIBINTL && ENABLE_NLS && defined libintl_set_relocation_prefix
|
||||
libintl_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR)
|
||||
|
||||
/* Convenience function:
|
||||
Computes the current installation prefix, based on the original
|
||||
installation prefix, the original installation directory of a particular
|
||||
file, and the current pathname of this file. Returns NULL upon failure. */
|
||||
#ifdef IN_LIBRARY
|
||||
#define compute_curr_prefix local_compute_curr_prefix
|
||||
static
|
||||
#endif
|
||||
const char *
|
||||
compute_curr_prefix (const char *orig_installprefix,
|
||||
const char *orig_installdir,
|
||||
const char *curr_pathname)
|
||||
{
|
||||
const char *curr_installdir;
|
||||
const char *rel_installdir;
|
||||
|
||||
if (curr_pathname == NULL)
|
||||
return NULL;
|
||||
|
||||
/* Determine the relative installation directory, relative to the prefix.
|
||||
This is simply the difference between orig_installprefix and
|
||||
orig_installdir. */
|
||||
if (strncmp (orig_installprefix, orig_installdir, strlen (orig_installprefix))
|
||||
!= 0)
|
||||
/* Shouldn't happen - nothing should be installed outside $(prefix). */
|
||||
return NULL;
|
||||
rel_installdir = orig_installdir + strlen (orig_installprefix);
|
||||
|
||||
/* Determine the current installation directory. */
|
||||
{
|
||||
const char *p_base = curr_pathname + FILE_SYSTEM_PREFIX_LEN (curr_pathname);
|
||||
const char *p = curr_pathname + strlen (curr_pathname);
|
||||
char *q;
|
||||
|
||||
while (p > p_base)
|
||||
{
|
||||
p--;
|
||||
if (ISSLASH (*p))
|
||||
break;
|
||||
}
|
||||
|
||||
q = (char *) xmalloc (p - curr_pathname + 1);
|
||||
#ifdef NO_XMALLOC
|
||||
if (q == NULL)
|
||||
return NULL;
|
||||
#endif
|
||||
memcpy (q, curr_pathname, p - curr_pathname);
|
||||
q[p - curr_pathname] = '\0';
|
||||
curr_installdir = q;
|
||||
}
|
||||
|
||||
/* Compute the current installation prefix by removing the trailing
|
||||
rel_installdir from it. */
|
||||
{
|
||||
const char *rp = rel_installdir + strlen (rel_installdir);
|
||||
const char *cp = curr_installdir + strlen (curr_installdir);
|
||||
const char *cp_base =
|
||||
curr_installdir + FILE_SYSTEM_PREFIX_LEN (curr_installdir);
|
||||
|
||||
while (rp > rel_installdir && cp > cp_base)
|
||||
{
|
||||
bool same = false;
|
||||
const char *rpi = rp;
|
||||
const char *cpi = cp;
|
||||
|
||||
while (rpi > rel_installdir && cpi > cp_base)
|
||||
{
|
||||
rpi--;
|
||||
cpi--;
|
||||
if (ISSLASH (*rpi) || ISSLASH (*cpi))
|
||||
{
|
||||
if (ISSLASH (*rpi) && ISSLASH (*cpi))
|
||||
same = true;
|
||||
break;
|
||||
}
|
||||
/* Do case-insensitive comparison if the filesystem is always or
|
||||
often case-insensitive. It's better to accept the comparison
|
||||
if the difference is only in case, rather than to fail. */
|
||||
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
|
||||
/* Win32, Cygwin, OS/2, DOS - case insignificant filesystem */
|
||||
if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi)
|
||||
!= (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi))
|
||||
break;
|
||||
#else
|
||||
if (*rpi != *cpi)
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
if (!same)
|
||||
break;
|
||||
/* The last pathname component was the same. opi and cpi now point
|
||||
to the slash before it. */
|
||||
rp = rpi;
|
||||
cp = cpi;
|
||||
}
|
||||
|
||||
if (rp > rel_installdir)
|
||||
/* Unexpected: The curr_installdir does not end with rel_installdir. */
|
||||
return NULL;
|
||||
|
||||
{
|
||||
size_t curr_prefix_len = cp - curr_installdir;
|
||||
char *curr_prefix;
|
||||
|
||||
curr_prefix = (char *) xmalloc (curr_prefix_len + 1);
|
||||
#ifdef NO_XMALLOC
|
||||
if (curr_prefix == NULL)
|
||||
return NULL;
|
||||
#endif
|
||||
memcpy (curr_prefix, curr_installdir, curr_prefix_len);
|
||||
curr_prefix[curr_prefix_len] = '\0';
|
||||
|
||||
return curr_prefix;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* !IN_LIBRARY || PIC */
|
||||
|
||||
#if defined PIC && defined INSTALLDIR
|
||||
|
||||
/* Full pathname of shared library, or NULL. */
|
||||
static char *shared_library_fullname;
|
||||
|
||||
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
|
||||
|
||||
/* Determine the full pathname of the shared library when it is loaded. */
|
||||
|
||||
BOOL WINAPI
|
||||
DllMain (HINSTANCE module_handle, DWORD event, LPVOID reserved)
|
||||
{
|
||||
(void) reserved;
|
||||
|
||||
if (event == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
/* The DLL is being loaded into an application's address range. */
|
||||
static char location[MAX_PATH];
|
||||
|
||||
if (!GetModuleFileName (module_handle, location, sizeof (location)))
|
||||
/* Shouldn't happen. */
|
||||
return FALSE;
|
||||
|
||||
if (!IS_PATH_WITH_DIR (location))
|
||||
/* Shouldn't happen. */
|
||||
return FALSE;
|
||||
|
||||
{
|
||||
#if defined __CYGWIN__
|
||||
/* On Cygwin, we need to convert paths coming from Win32 system calls
|
||||
to the Unix-like slashified notation. */
|
||||
static char location_as_posix_path[2 * MAX_PATH];
|
||||
/* There's no error return defined for cygwin_conv_to_posix_path.
|
||||
See cygwin-api/func-cygwin-conv-to-posix-path.html.
|
||||
Does it overflow the buffer of expected size MAX_PATH or does it
|
||||
truncate the path? I don't know. Let's catch both. */
|
||||
cygwin_conv_to_posix_path (location, location_as_posix_path);
|
||||
location_as_posix_path[MAX_PATH - 1] = '\0';
|
||||
if (strlen (location_as_posix_path) >= MAX_PATH - 1)
|
||||
/* A sign of buffer overflow or path truncation. */
|
||||
return FALSE;
|
||||
shared_library_fullname = strdup (location_as_posix_path);
|
||||
#else
|
||||
shared_library_fullname = strdup (location);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#else /* Unix except Cygwin */
|
||||
|
||||
static void
|
||||
find_shared_library_fullname ()
|
||||
{
|
||||
#if defined __linux__ && __GLIBC__ >= 2
|
||||
/* Linux has /proc/self/maps. glibc 2 has the getline() function. */
|
||||
FILE *fp;
|
||||
|
||||
/* Open the current process' maps file. It describes one VMA per line. */
|
||||
fp = fopen ("/proc/self/maps", "r");
|
||||
if (fp)
|
||||
{
|
||||
unsigned long address = (unsigned long) &find_shared_library_fullname;
|
||||
for (;;)
|
||||
{
|
||||
unsigned long start, end;
|
||||
int c;
|
||||
|
||||
if (fscanf (fp, "%lx-%lx", &start, &end) != 2)
|
||||
break;
|
||||
if (address >= start && address <= end - 1)
|
||||
{
|
||||
/* Found it. Now see if this line contains a filename. */
|
||||
while (c = getc (fp), c != EOF && c != '\n' && c != '/')
|
||||
continue;
|
||||
if (c == '/')
|
||||
{
|
||||
size_t size;
|
||||
int len;
|
||||
|
||||
ungetc (c, fp);
|
||||
shared_library_fullname = NULL; size = 0;
|
||||
len = getline (&shared_library_fullname, &size, fp);
|
||||
if (len >= 0)
|
||||
{
|
||||
/* Success: filled shared_library_fullname. */
|
||||
if (len > 0 && shared_library_fullname[len - 1] == '\n')
|
||||
shared_library_fullname[len - 1] = '\0';
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
while (c = getc (fp), c != EOF && c != '\n')
|
||||
continue;
|
||||
}
|
||||
fclose (fp);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* (WIN32 or Cygwin) / (Unix except Cygwin) */
|
||||
|
||||
/* Return the full pathname of the current shared library.
|
||||
Return NULL if unknown.
|
||||
Guaranteed to work only on Linux, Cygwin and Woe32. */
|
||||
static char *
|
||||
get_shared_library_fullname ()
|
||||
{
|
||||
#if !(defined _WIN32 || defined __WIN32__ || defined __CYGWIN__)
|
||||
static bool tried_find_shared_library_fullname;
|
||||
if (!tried_find_shared_library_fullname)
|
||||
{
|
||||
find_shared_library_fullname ();
|
||||
tried_find_shared_library_fullname = true;
|
||||
}
|
||||
#endif
|
||||
return shared_library_fullname;
|
||||
}
|
||||
|
||||
#endif /* PIC */
|
||||
|
||||
/* Returns the pathname, relocated according to the current installation
|
||||
directory. */
|
||||
const char *
|
||||
relocate (const char *pathname)
|
||||
{
|
||||
#if defined PIC && defined INSTALLDIR
|
||||
static int initialized;
|
||||
|
||||
/* Initialization code for a shared library. */
|
||||
if (!initialized)
|
||||
{
|
||||
/* At this point, orig_prefix and curr_prefix likely have already been
|
||||
set through the main program's set_program_name_and_installdir
|
||||
function. This is sufficient in the case that the library has
|
||||
initially been installed in the same orig_prefix. But we can do
|
||||
better, to also cover the cases that 1. it has been installed
|
||||
in a different prefix before being moved to orig_prefix and (later)
|
||||
to curr_prefix, 2. unlike the program, it has not moved away from
|
||||
orig_prefix. */
|
||||
const char *orig_installprefix = INSTALLPREFIX;
|
||||
const char *orig_installdir = INSTALLDIR;
|
||||
const char *curr_prefix_better;
|
||||
|
||||
curr_prefix_better =
|
||||
compute_curr_prefix (orig_installprefix, orig_installdir,
|
||||
get_shared_library_fullname ());
|
||||
if (curr_prefix_better == NULL)
|
||||
curr_prefix_better = curr_prefix;
|
||||
|
||||
set_relocation_prefix (orig_installprefix, curr_prefix_better);
|
||||
|
||||
initialized = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Note: It is not necessary to perform case insensitive comparison here,
|
||||
even for DOS-like filesystems, because the pathname argument was
|
||||
typically created from the same Makefile variable as orig_prefix came
|
||||
from. */
|
||||
if (orig_prefix != NULL && curr_prefix != NULL
|
||||
&& strncmp (pathname, orig_prefix, orig_prefix_len) == 0)
|
||||
{
|
||||
if (pathname[orig_prefix_len] == '\0')
|
||||
/* pathname equals orig_prefix. */
|
||||
return curr_prefix;
|
||||
if (ISSLASH (pathname[orig_prefix_len]))
|
||||
{
|
||||
/* pathname starts with orig_prefix. */
|
||||
const char *pathname_tail = &pathname[orig_prefix_len];
|
||||
char *result =
|
||||
(char *) xmalloc (curr_prefix_len + strlen (pathname_tail) + 1);
|
||||
|
||||
#ifdef NO_XMALLOC
|
||||
if (result != NULL)
|
||||
#endif
|
||||
{
|
||||
memcpy (result, curr_prefix, curr_prefix_len);
|
||||
strcpy (result + curr_prefix_len, pathname_tail);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Nothing to relocate. */
|
||||
return pathname;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,79 @@
|
|||
/* Provide relocatable packages.
|
||||
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2003.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifndef _RELOCATABLE_H
|
||||
#define _RELOCATABLE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* This can be enabled through the configure --enable-relocatable option. */
|
||||
#if ENABLE_RELOCATABLE
|
||||
|
||||
/* When building a DLL, we must export some functions. Note that because
|
||||
this is a private .h file, we don't need to use __declspec(dllimport)
|
||||
in any case. */
|
||||
#if HAVE_VISIBILITY && BUILDING_DLL
|
||||
# define RELOCATABLE_DLL_EXPORTED __attribute__((__visibility__("default")))
|
||||
#elif defined _MSC_VER && BUILDING_DLL
|
||||
# define RELOCATABLE_DLL_EXPORTED __declspec(dllexport)
|
||||
#else
|
||||
# define RELOCATABLE_DLL_EXPORTED
|
||||
#endif
|
||||
|
||||
/* Sets the original and the current installation prefix of the package.
|
||||
Relocation simply replaces a pathname starting with the original prefix
|
||||
by the corresponding pathname with the current prefix instead. Both
|
||||
prefixes should be directory names without trailing slash (i.e. use ""
|
||||
instead of "/"). */
|
||||
extern RELOCATABLE_DLL_EXPORTED void
|
||||
set_relocation_prefix (const char *orig_prefix,
|
||||
const char *curr_prefix);
|
||||
|
||||
/* Returns the pathname, relocated according to the current installation
|
||||
directory. */
|
||||
extern const char * relocate (const char *pathname);
|
||||
|
||||
/* Memory management: relocate() leaks memory, because it has to construct
|
||||
a fresh pathname. If this is a problem because your program calls
|
||||
relocate() frequently, think about caching the result. */
|
||||
|
||||
/* Convenience function:
|
||||
Computes the current installation prefix, based on the original
|
||||
installation prefix, the original installation directory of a particular
|
||||
file, and the current pathname of this file. Returns NULL upon failure. */
|
||||
extern const char * compute_curr_prefix (const char *orig_installprefix,
|
||||
const char *orig_installdir,
|
||||
const char *curr_pathname);
|
||||
|
||||
#else
|
||||
|
||||
/* By default, we use the hardwired pathnames. */
|
||||
#define relocate(pathname) (pathname)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _RELOCATABLE_H */
|
|
@ -0,0 +1,127 @@
|
|||
/* Implementation of the textdomain(3) function.
|
||||
Copyright (C) 1995-1998, 2000-2003, 2005-2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "gettextP.h"
|
||||
#ifdef _LIBC
|
||||
# include <libintl.h>
|
||||
#else
|
||||
# include "libgnuintl.h"
|
||||
#endif
|
||||
|
||||
/* Handle multi-threaded applications. */
|
||||
#ifdef _LIBC
|
||||
# include <bits/libc-lock.h>
|
||||
# define gl_rwlock_define __libc_rwlock_define
|
||||
# define gl_rwlock_wrlock __libc_rwlock_wrlock
|
||||
# define gl_rwlock_unlock __libc_rwlock_unlock
|
||||
#else
|
||||
# include "lock.h"
|
||||
#endif
|
||||
|
||||
/* @@ end of prolog @@ */
|
||||
|
||||
|
||||
/* Names for the libintl functions are a problem. They must not clash
|
||||
with existing names and they should follow ANSI C. But this source
|
||||
code is also used in GNU C Library where the names have a __
|
||||
prefix. So we have to make a difference here. */
|
||||
#ifdef _LIBC
|
||||
# define TEXTDOMAIN __textdomain
|
||||
# ifndef strdup
|
||||
# define strdup(str) __strdup (str)
|
||||
# endif
|
||||
#else
|
||||
# define TEXTDOMAIN libintl_textdomain
|
||||
#endif
|
||||
|
||||
/* Lock variable to protect the global data in the gettext implementation. */
|
||||
gl_rwlock_define (extern, _nl_state_lock attribute_hidden)
|
||||
|
||||
/* Set the current default message catalog to DOMAINNAME.
|
||||
If DOMAINNAME is null, return the current default.
|
||||
If DOMAINNAME is "", reset to the default of "messages". */
|
||||
char *
|
||||
TEXTDOMAIN (const char *domainname)
|
||||
{
|
||||
char *new_domain;
|
||||
char *old_domain;
|
||||
|
||||
/* A NULL pointer requests the current setting. */
|
||||
if (domainname == NULL)
|
||||
return (char *) _nl_current_default_domain;
|
||||
|
||||
gl_rwlock_wrlock (_nl_state_lock);
|
||||
|
||||
old_domain = (char *) _nl_current_default_domain;
|
||||
|
||||
/* If domain name is the null string set to default domain "messages". */
|
||||
if (domainname[0] == '\0'
|
||||
|| strcmp (domainname, _nl_default_default_domain) == 0)
|
||||
{
|
||||
_nl_current_default_domain = _nl_default_default_domain;
|
||||
new_domain = (char *) _nl_current_default_domain;
|
||||
}
|
||||
else if (strcmp (domainname, old_domain) == 0)
|
||||
/* This can happen and people will use it to signal that some
|
||||
environment variable changed. */
|
||||
new_domain = old_domain;
|
||||
else
|
||||
{
|
||||
/* If the following malloc fails `_nl_current_default_domain'
|
||||
will be NULL. This value will be returned and so signals we
|
||||
are out of core. */
|
||||
#if defined _LIBC || defined HAVE_STRDUP
|
||||
new_domain = strdup (domainname);
|
||||
#else
|
||||
size_t len = strlen (domainname) + 1;
|
||||
new_domain = (char *) malloc (len);
|
||||
if (new_domain != NULL)
|
||||
memcpy (new_domain, domainname, len);
|
||||
#endif
|
||||
|
||||
if (new_domain != NULL)
|
||||
_nl_current_default_domain = new_domain;
|
||||
}
|
||||
|
||||
/* We use this possibility to signal a change of the loaded catalogs
|
||||
since this is most likely the case and there is no other easy we
|
||||
to do it. Do it only when the call was successful. */
|
||||
if (new_domain != NULL)
|
||||
{
|
||||
++_nl_msg_cat_cntr;
|
||||
|
||||
if (old_domain != new_domain && old_domain != _nl_default_default_domain)
|
||||
free (old_domain);
|
||||
}
|
||||
|
||||
gl_rwlock_unlock (_nl_state_lock);
|
||||
|
||||
return new_domain;
|
||||
}
|
||||
|
||||
#ifdef _LIBC
|
||||
/* Alias for function name in GNU C Library. */
|
||||
weak_alias (__textdomain, textdomain);
|
||||
#endif
|
|
@ -0,0 +1,684 @@
|
|||
/* Copyright (C) 1995, 1996, 1997, 2000, 2006 Free Software Foundation, Inc.
|
||||
Contributed by Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>, 1997.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C
|
||||
Library. Bugs can be reported to bug-glibc@gnu.org.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
/* Tree search for red/black trees.
|
||||
The algorithm for adding nodes is taken from one of the many "Algorithms"
|
||||
books by Robert Sedgewick, although the implementation differs.
|
||||
The algorithm for deleting nodes can probably be found in a book named
|
||||
"Introduction to Algorithms" by Cormen/Leiserson/Rivest. At least that's
|
||||
the book that my professor took most algorithms from during the "Data
|
||||
Structures" course...
|
||||
|
||||
Totally public domain. */
|
||||
|
||||
/* Red/black trees are binary trees in which the edges are colored either red
|
||||
or black. They have the following properties:
|
||||
1. The number of black edges on every path from the root to a leaf is
|
||||
constant.
|
||||
2. No two red edges are adjacent.
|
||||
Therefore there is an upper bound on the length of every path, it's
|
||||
O(log n) where n is the number of nodes in the tree. No path can be longer
|
||||
than 1+2*P where P is the length of the shortest path in the tree.
|
||||
Useful for the implementation:
|
||||
3. If one of the children of a node is NULL, then the other one is red
|
||||
(if it exists).
|
||||
|
||||
In the implementation, not the edges are colored, but the nodes. The color
|
||||
interpreted as the color of the edge leading to this node. The color is
|
||||
meaningless for the root node, but we color the root node black for
|
||||
convenience. All added nodes are red initially.
|
||||
|
||||
Adding to a red/black tree is rather easy. The right place is searched
|
||||
with a usual binary tree search. Additionally, whenever a node N is
|
||||
reached that has two red successors, the successors are colored black and
|
||||
the node itself colored red. This moves red edges up the tree where they
|
||||
pose less of a problem once we get to really insert the new node. Changing
|
||||
N's color to red may violate rule 2, however, so rotations may become
|
||||
necessary to restore the invariants. Adding a new red leaf may violate
|
||||
the same rule, so afterwards an additional check is run and the tree
|
||||
possibly rotated.
|
||||
|
||||
Deleting is hairy. There are mainly two nodes involved: the node to be
|
||||
deleted (n1), and another node that is to be unchained from the tree (n2).
|
||||
If n1 has a successor (the node with a smallest key that is larger than
|
||||
n1), then the successor becomes n2 and its contents are copied into n1,
|
||||
otherwise n1 becomes n2.
|
||||
Unchaining a node may violate rule 1: if n2 is black, one subtree is
|
||||
missing one black edge afterwards. The algorithm must try to move this
|
||||
error upwards towards the root, so that the subtree that does not have
|
||||
enough black edges becomes the whole tree. Once that happens, the error
|
||||
has disappeared. It may not be necessary to go all the way up, since it
|
||||
is possible that rotations and recoloring can fix the error before that.
|
||||
|
||||
Although the deletion algorithm must walk upwards through the tree, we
|
||||
do not store parent pointers in the nodes. Instead, delete allocates a
|
||||
small array of parent pointers and fills it while descending the tree.
|
||||
Since we know that the length of a path is O(log n), where n is the number
|
||||
of nodes, this is likely to use less memory. */
|
||||
|
||||
/* Tree rotations look like this:
|
||||
A C
|
||||
/ \ / \
|
||||
B C A G
|
||||
/ \ / \ --> / \
|
||||
D E F G B F
|
||||
/ \
|
||||
D E
|
||||
|
||||
In this case, A has been rotated left. This preserves the ordering of the
|
||||
binary tree. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#ifdef IN_LIBINTL
|
||||
# include "tsearch.h"
|
||||
#else
|
||||
# include <search.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef int (*__compar_fn_t) (const void *, const void *);
|
||||
typedef void (*__action_fn_t) (const void *, VISIT, int);
|
||||
|
||||
#ifndef weak_alias
|
||||
# define __tsearch tsearch
|
||||
# define __tfind tfind
|
||||
# define __tdelete tdelete
|
||||
# define __twalk twalk
|
||||
#endif
|
||||
|
||||
#ifndef internal_function
|
||||
/* Inside GNU libc we mark some function in a special way. In other
|
||||
environments simply ignore the marking. */
|
||||
# define internal_function
|
||||
#endif
|
||||
|
||||
typedef struct node_t
|
||||
{
|
||||
/* Callers expect this to be the first element in the structure - do not
|
||||
move! */
|
||||
const void *key;
|
||||
struct node_t *left;
|
||||
struct node_t *right;
|
||||
unsigned int red:1;
|
||||
} *node;
|
||||
typedef const struct node_t *const_node;
|
||||
|
||||
#undef DEBUGGING
|
||||
|
||||
#ifdef DEBUGGING
|
||||
|
||||
/* Routines to check tree invariants. */
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#define CHECK_TREE(a) check_tree(a)
|
||||
|
||||
static void
|
||||
check_tree_recurse (node p, int d_sofar, int d_total)
|
||||
{
|
||||
if (p == NULL)
|
||||
{
|
||||
assert (d_sofar == d_total);
|
||||
return;
|
||||
}
|
||||
|
||||
check_tree_recurse (p->left, d_sofar + (p->left && !p->left->red), d_total);
|
||||
check_tree_recurse (p->right, d_sofar + (p->right && !p->right->red), d_total);
|
||||
if (p->left)
|
||||
assert (!(p->left->red && p->red));
|
||||
if (p->right)
|
||||
assert (!(p->right->red && p->red));
|
||||
}
|
||||
|
||||
static void
|
||||
check_tree (node root)
|
||||
{
|
||||
int cnt = 0;
|
||||
node p;
|
||||
if (root == NULL)
|
||||
return;
|
||||
root->red = 0;
|
||||
for(p = root->left; p; p = p->left)
|
||||
cnt += !p->red;
|
||||
check_tree_recurse (root, 0, cnt);
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
|
||||
#define CHECK_TREE(a)
|
||||
|
||||
#endif
|
||||
|
||||
/* Possibly "split" a node with two red successors, and/or fix up two red
|
||||
edges in a row. ROOTP is a pointer to the lowest node we visited, PARENTP
|
||||
and GPARENTP pointers to its parent/grandparent. P_R and GP_R contain the
|
||||
comparison values that determined which way was taken in the tree to reach
|
||||
ROOTP. MODE is 1 if we need not do the split, but must check for two red
|
||||
edges between GPARENTP and ROOTP. */
|
||||
static void
|
||||
maybe_split_for_insert (node *rootp, node *parentp, node *gparentp,
|
||||
int p_r, int gp_r, int mode)
|
||||
{
|
||||
node root = *rootp;
|
||||
node *rp, *lp;
|
||||
rp = &(*rootp)->right;
|
||||
lp = &(*rootp)->left;
|
||||
|
||||
/* See if we have to split this node (both successors red). */
|
||||
if (mode == 1
|
||||
|| ((*rp) != NULL && (*lp) != NULL && (*rp)->red && (*lp)->red))
|
||||
{
|
||||
/* This node becomes red, its successors black. */
|
||||
root->red = 1;
|
||||
if (*rp)
|
||||
(*rp)->red = 0;
|
||||
if (*lp)
|
||||
(*lp)->red = 0;
|
||||
|
||||
/* If the parent of this node is also red, we have to do
|
||||
rotations. */
|
||||
if (parentp != NULL && (*parentp)->red)
|
||||
{
|
||||
node gp = *gparentp;
|
||||
node p = *parentp;
|
||||
/* There are two main cases:
|
||||
1. The edge types (left or right) of the two red edges differ.
|
||||
2. Both red edges are of the same type.
|
||||
There exist two symmetries of each case, so there is a total of
|
||||
4 cases. */
|
||||
if ((p_r > 0) != (gp_r > 0))
|
||||
{
|
||||
/* Put the child at the top of the tree, with its parent
|
||||
and grandparent as successors. */
|
||||
p->red = 1;
|
||||
gp->red = 1;
|
||||
root->red = 0;
|
||||
if (p_r < 0)
|
||||
{
|
||||
/* Child is left of parent. */
|
||||
p->left = *rp;
|
||||
*rp = p;
|
||||
gp->right = *lp;
|
||||
*lp = gp;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Child is right of parent. */
|
||||
p->right = *lp;
|
||||
*lp = p;
|
||||
gp->left = *rp;
|
||||
*rp = gp;
|
||||
}
|
||||
*gparentp = root;
|
||||
}
|
||||
else
|
||||
{
|
||||
*gparentp = *parentp;
|
||||
/* Parent becomes the top of the tree, grandparent and
|
||||
child are its successors. */
|
||||
p->red = 0;
|
||||
gp->red = 1;
|
||||
if (p_r < 0)
|
||||
{
|
||||
/* Left edges. */
|
||||
gp->left = p->right;
|
||||
p->right = gp;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Right edges. */
|
||||
gp->right = p->left;
|
||||
p->left = gp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Find or insert datum into search tree.
|
||||
KEY is the key to be located, ROOTP is the address of tree root,
|
||||
COMPAR the ordering function. */
|
||||
void *
|
||||
__tsearch (const void *key, void **vrootp, __compar_fn_t compar)
|
||||
{
|
||||
node q;
|
||||
node *parentp = NULL, *gparentp = NULL;
|
||||
node *rootp = (node *) vrootp;
|
||||
node *nextp;
|
||||
int r = 0, p_r = 0, gp_r = 0; /* No they might not, Mr Compiler. */
|
||||
|
||||
if (rootp == NULL)
|
||||
return NULL;
|
||||
|
||||
/* This saves some additional tests below. */
|
||||
if (*rootp != NULL)
|
||||
(*rootp)->red = 0;
|
||||
|
||||
CHECK_TREE (*rootp);
|
||||
|
||||
nextp = rootp;
|
||||
while (*nextp != NULL)
|
||||
{
|
||||
node root = *rootp;
|
||||
r = (*compar) (key, root->key);
|
||||
if (r == 0)
|
||||
return root;
|
||||
|
||||
maybe_split_for_insert (rootp, parentp, gparentp, p_r, gp_r, 0);
|
||||
/* If that did any rotations, parentp and gparentp are now garbage.
|
||||
That doesn't matter, because the values they contain are never
|
||||
used again in that case. */
|
||||
|
||||
nextp = r < 0 ? &root->left : &root->right;
|
||||
if (*nextp == NULL)
|
||||
break;
|
||||
|
||||
gparentp = parentp;
|
||||
parentp = rootp;
|
||||
rootp = nextp;
|
||||
|
||||
gp_r = p_r;
|
||||
p_r = r;
|
||||
}
|
||||
|
||||
q = (struct node_t *) malloc (sizeof (struct node_t));
|
||||
if (q != NULL)
|
||||
{
|
||||
*nextp = q; /* link new node to old */
|
||||
q->key = key; /* initialize new node */
|
||||
q->red = 1;
|
||||
q->left = q->right = NULL;
|
||||
|
||||
if (nextp != rootp)
|
||||
/* There may be two red edges in a row now, which we must avoid by
|
||||
rotating the tree. */
|
||||
maybe_split_for_insert (nextp, rootp, parentp, r, p_r, 1);
|
||||
}
|
||||
|
||||
return q;
|
||||
}
|
||||
#ifdef weak_alias
|
||||
weak_alias (__tsearch, tsearch)
|
||||
#endif
|
||||
|
||||
|
||||
/* Find datum in search tree.
|
||||
KEY is the key to be located, ROOTP is the address of tree root,
|
||||
COMPAR the ordering function. */
|
||||
void *
|
||||
__tfind (key, vrootp, compar)
|
||||
const void *key;
|
||||
void *const *vrootp;
|
||||
__compar_fn_t compar;
|
||||
{
|
||||
node *rootp = (node *) vrootp;
|
||||
|
||||
if (rootp == NULL)
|
||||
return NULL;
|
||||
|
||||
CHECK_TREE (*rootp);
|
||||
|
||||
while (*rootp != NULL)
|
||||
{
|
||||
node root = *rootp;
|
||||
int r;
|
||||
|
||||
r = (*compar) (key, root->key);
|
||||
if (r == 0)
|
||||
return root;
|
||||
|
||||
rootp = r < 0 ? &root->left : &root->right;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#ifdef weak_alias
|
||||
weak_alias (__tfind, tfind)
|
||||
#endif
|
||||
|
||||
|
||||
/* Delete node with given key.
|
||||
KEY is the key to be deleted, ROOTP is the address of the root of tree,
|
||||
COMPAR the comparison function. */
|
||||
void *
|
||||
__tdelete (const void *key, void **vrootp, __compar_fn_t compar)
|
||||
{
|
||||
node p, q, r, retval;
|
||||
int cmp;
|
||||
node *rootp = (node *) vrootp;
|
||||
node root, unchained;
|
||||
/* Stack of nodes so we remember the parents without recursion. It's
|
||||
_very_ unlikely that there are paths longer than 40 nodes. The tree
|
||||
would need to have around 250.000 nodes. */
|
||||
int stacksize = 100;
|
||||
int sp = 0;
|
||||
node *nodestack[100];
|
||||
|
||||
if (rootp == NULL)
|
||||
return NULL;
|
||||
p = *rootp;
|
||||
if (p == NULL)
|
||||
return NULL;
|
||||
|
||||
CHECK_TREE (p);
|
||||
|
||||
while ((cmp = (*compar) (key, (*rootp)->key)) != 0)
|
||||
{
|
||||
if (sp == stacksize)
|
||||
abort ();
|
||||
|
||||
nodestack[sp++] = rootp;
|
||||
p = *rootp;
|
||||
rootp = ((cmp < 0)
|
||||
? &(*rootp)->left
|
||||
: &(*rootp)->right);
|
||||
if (*rootp == NULL)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* This is bogus if the node to be deleted is the root... this routine
|
||||
really should return an integer with 0 for success, -1 for failure
|
||||
and errno = ESRCH or something. */
|
||||
retval = p;
|
||||
|
||||
/* We don't unchain the node we want to delete. Instead, we overwrite
|
||||
it with its successor and unchain the successor. If there is no
|
||||
successor, we really unchain the node to be deleted. */
|
||||
|
||||
root = *rootp;
|
||||
|
||||
r = root->right;
|
||||
q = root->left;
|
||||
|
||||
if (q == NULL || r == NULL)
|
||||
unchained = root;
|
||||
else
|
||||
{
|
||||
node *parent = rootp, *up = &root->right;
|
||||
for (;;)
|
||||
{
|
||||
if (sp == stacksize)
|
||||
abort ();
|
||||
nodestack[sp++] = parent;
|
||||
parent = up;
|
||||
if ((*up)->left == NULL)
|
||||
break;
|
||||
up = &(*up)->left;
|
||||
}
|
||||
unchained = *up;
|
||||
}
|
||||
|
||||
/* We know that either the left or right successor of UNCHAINED is NULL.
|
||||
R becomes the other one, it is chained into the parent of UNCHAINED. */
|
||||
r = unchained->left;
|
||||
if (r == NULL)
|
||||
r = unchained->right;
|
||||
if (sp == 0)
|
||||
*rootp = r;
|
||||
else
|
||||
{
|
||||
q = *nodestack[sp-1];
|
||||
if (unchained == q->right)
|
||||
q->right = r;
|
||||
else
|
||||
q->left = r;
|
||||
}
|
||||
|
||||
if (unchained != root)
|
||||
root->key = unchained->key;
|
||||
if (!unchained->red)
|
||||
{
|
||||
/* Now we lost a black edge, which means that the number of black
|
||||
edges on every path is no longer constant. We must balance the
|
||||
tree. */
|
||||
/* NODESTACK now contains all parents of R. R is likely to be NULL
|
||||
in the first iteration. */
|
||||
/* NULL nodes are considered black throughout - this is necessary for
|
||||
correctness. */
|
||||
while (sp > 0 && (r == NULL || !r->red))
|
||||
{
|
||||
node *pp = nodestack[sp - 1];
|
||||
p = *pp;
|
||||
/* Two symmetric cases. */
|
||||
if (r == p->left)
|
||||
{
|
||||
/* Q is R's brother, P is R's parent. The subtree with root
|
||||
R has one black edge less than the subtree with root Q. */
|
||||
q = p->right;
|
||||
if (q->red)
|
||||
{
|
||||
/* If Q is red, we know that P is black. We rotate P left
|
||||
so that Q becomes the top node in the tree, with P below
|
||||
it. P is colored red, Q is colored black.
|
||||
This action does not change the black edge count for any
|
||||
leaf in the tree, but we will be able to recognize one
|
||||
of the following situations, which all require that Q
|
||||
is black. */
|
||||
q->red = 0;
|
||||
p->red = 1;
|
||||
/* Left rotate p. */
|
||||
p->right = q->left;
|
||||
q->left = p;
|
||||
*pp = q;
|
||||
/* Make sure pp is right if the case below tries to use
|
||||
it. */
|
||||
nodestack[sp++] = pp = &q->left;
|
||||
q = p->right;
|
||||
}
|
||||
/* We know that Q can't be NULL here. We also know that Q is
|
||||
black. */
|
||||
if ((q->left == NULL || !q->left->red)
|
||||
&& (q->right == NULL || !q->right->red))
|
||||
{
|
||||
/* Q has two black successors. We can simply color Q red.
|
||||
The whole subtree with root P is now missing one black
|
||||
edge. Note that this action can temporarily make the
|
||||
tree invalid (if P is red). But we will exit the loop
|
||||
in that case and set P black, which both makes the tree
|
||||
valid and also makes the black edge count come out
|
||||
right. If P is black, we are at least one step closer
|
||||
to the root and we'll try again the next iteration. */
|
||||
q->red = 1;
|
||||
r = p;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Q is black, one of Q's successors is red. We can
|
||||
repair the tree with one operation and will exit the
|
||||
loop afterwards. */
|
||||
if (q->right == NULL || !q->right->red)
|
||||
{
|
||||
/* The left one is red. We perform the same action as
|
||||
in maybe_split_for_insert where two red edges are
|
||||
adjacent but point in different directions:
|
||||
Q's left successor (let's call it Q2) becomes the
|
||||
top of the subtree we are looking at, its parent (Q)
|
||||
and grandparent (P) become its successors. The former
|
||||
successors of Q2 are placed below P and Q.
|
||||
P becomes black, and Q2 gets the color that P had.
|
||||
This changes the black edge count only for node R and
|
||||
its successors. */
|
||||
node q2 = q->left;
|
||||
q2->red = p->red;
|
||||
p->right = q2->left;
|
||||
q->left = q2->right;
|
||||
q2->right = q;
|
||||
q2->left = p;
|
||||
*pp = q2;
|
||||
p->red = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* It's the right one. Rotate P left. P becomes black,
|
||||
and Q gets the color that P had. Q's right successor
|
||||
also becomes black. This changes the black edge
|
||||
count only for node R and its successors. */
|
||||
q->red = p->red;
|
||||
p->red = 0;
|
||||
|
||||
q->right->red = 0;
|
||||
|
||||
/* left rotate p */
|
||||
p->right = q->left;
|
||||
q->left = p;
|
||||
*pp = q;
|
||||
}
|
||||
|
||||
/* We're done. */
|
||||
sp = 1;
|
||||
r = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Comments: see above. */
|
||||
q = p->left;
|
||||
if (q->red)
|
||||
{
|
||||
q->red = 0;
|
||||
p->red = 1;
|
||||
p->left = q->right;
|
||||
q->right = p;
|
||||
*pp = q;
|
||||
nodestack[sp++] = pp = &q->right;
|
||||
q = p->left;
|
||||
}
|
||||
if ((q->right == NULL || !q->right->red)
|
||||
&& (q->left == NULL || !q->left->red))
|
||||
{
|
||||
q->red = 1;
|
||||
r = p;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (q->left == NULL || !q->left->red)
|
||||
{
|
||||
node q2 = q->right;
|
||||
q2->red = p->red;
|
||||
p->left = q2->right;
|
||||
q->right = q2->left;
|
||||
q2->left = q;
|
||||
q2->right = p;
|
||||
*pp = q2;
|
||||
p->red = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
q->red = p->red;
|
||||
p->red = 0;
|
||||
q->left->red = 0;
|
||||
p->left = q->right;
|
||||
q->right = p;
|
||||
*pp = q;
|
||||
}
|
||||
sp = 1;
|
||||
r = NULL;
|
||||
}
|
||||
}
|
||||
--sp;
|
||||
}
|
||||
if (r != NULL)
|
||||
r->red = 0;
|
||||
}
|
||||
|
||||
free (unchained);
|
||||
return retval;
|
||||
}
|
||||
#ifdef weak_alias
|
||||
weak_alias (__tdelete, tdelete)
|
||||
#endif
|
||||
|
||||
|
||||
/* Walk the nodes of a tree.
|
||||
ROOT is the root of the tree to be walked, ACTION the function to be
|
||||
called at each node. LEVEL is the level of ROOT in the whole tree. */
|
||||
static void
|
||||
internal_function
|
||||
trecurse (const void *vroot, __action_fn_t action, int level)
|
||||
{
|
||||
const_node root = (const_node) vroot;
|
||||
|
||||
if (root->left == NULL && root->right == NULL)
|
||||
(*action) (root, leaf, level);
|
||||
else
|
||||
{
|
||||
(*action) (root, preorder, level);
|
||||
if (root->left != NULL)
|
||||
trecurse (root->left, action, level + 1);
|
||||
(*action) (root, postorder, level);
|
||||
if (root->right != NULL)
|
||||
trecurse (root->right, action, level + 1);
|
||||
(*action) (root, endorder, level);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Walk the nodes of a tree.
|
||||
ROOT is the root of the tree to be walked, ACTION the function to be
|
||||
called at each node. */
|
||||
void
|
||||
__twalk (const void *vroot, __action_fn_t action)
|
||||
{
|
||||
const_node root = (const_node) vroot;
|
||||
|
||||
CHECK_TREE (root);
|
||||
|
||||
if (root != NULL && action != NULL)
|
||||
trecurse (root, action, 0);
|
||||
}
|
||||
#ifdef weak_alias
|
||||
weak_alias (__twalk, twalk)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _LIBC
|
||||
|
||||
/* The standardized functions miss an important functionality: the
|
||||
tree cannot be removed easily. We provide a function to do this. */
|
||||
static void
|
||||
internal_function
|
||||
tdestroy_recurse (node root, __free_fn_t freefct)
|
||||
{
|
||||
if (root->left != NULL)
|
||||
tdestroy_recurse (root->left, freefct);
|
||||
if (root->right != NULL)
|
||||
tdestroy_recurse (root->right, freefct);
|
||||
(*freefct) ((void *) root->key);
|
||||
/* Free the node itself. */
|
||||
free (root);
|
||||
}
|
||||
|
||||
void
|
||||
__tdestroy (void *vroot, __free_fn_t freefct)
|
||||
{
|
||||
node root = (node) vroot;
|
||||
|
||||
CHECK_TREE (root);
|
||||
|
||||
if (root != NULL)
|
||||
tdestroy_recurse (root, freefct);
|
||||
}
|
||||
weak_alias (__tdestroy, tdestroy)
|
||||
|
||||
#endif /* _LIBC */
|
|
@ -0,0 +1,83 @@
|
|||
/* Binary tree data structure.
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifndef _TSEARCH_H
|
||||
#define _TSEARCH_H
|
||||
|
||||
#if HAVE_TSEARCH
|
||||
|
||||
/* Get tseach(), tfind(), tdelete(), twalk() declarations. */
|
||||
#include <search.h>
|
||||
|
||||
#else
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* See <http://www.opengroup.org/susv3xbd/search.h.html>,
|
||||
<http://www.opengroup.org/susv3xsh/tsearch.html>
|
||||
for details. */
|
||||
|
||||
typedef enum
|
||||
{
|
||||
preorder,
|
||||
postorder,
|
||||
endorder,
|
||||
leaf
|
||||
}
|
||||
VISIT;
|
||||
|
||||
/* Searches an element in the tree *VROOTP that compares equal to KEY.
|
||||
If one is found, it is returned. Otherwise, a new element equal to KEY
|
||||
is inserted in the tree and is returned. */
|
||||
extern void * tsearch (const void *key, void **vrootp,
|
||||
int (*compar) (const void *, const void *));
|
||||
|
||||
/* Searches an element in the tree *VROOTP that compares equal to KEY.
|
||||
If one is found, it is returned. Otherwise, NULL is returned. */
|
||||
extern void * tfind (const void *key, void *const *vrootp,
|
||||
int (*compar) (const void *, const void *));
|
||||
|
||||
/* Searches an element in the tree *VROOTP that compares equal to KEY.
|
||||
If one is found, it is removed from the tree, and its parent node is
|
||||
returned. Otherwise, NULL is returned. */
|
||||
extern void * tdelete (const void *key, void **vrootp,
|
||||
int (*compar) (const void *, const void *));
|
||||
|
||||
/* Perform a depth-first, left-to-right traversal of the tree VROOT.
|
||||
The ACTION function is called:
|
||||
- for non-leaf nodes: 3 times, before the left subtree traversal,
|
||||
after the left subtree traversal but before the right subtree traversal,
|
||||
and after the right subtree traversal,
|
||||
- for leaf nodes: once.
|
||||
The arguments passed to ACTION are:
|
||||
1. the node; it can be casted to a 'const void * const *', i.e. into a
|
||||
pointer to the key,
|
||||
2. an indicator which visit of the node this is,
|
||||
3. the level of the node in the tree (0 for the root). */
|
||||
extern void twalk (const void *vroot,
|
||||
void (*action) (const void *, VISIT, int));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _TSEARCH_H */
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,78 @@
|
|||
/* vsprintf with automatic memory allocation.
|
||||
Copyright (C) 2002-2004 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifndef _VASNPRINTF_H
|
||||
#define _VASNPRINTF_H
|
||||
|
||||
/* Get va_list. */
|
||||
#include <stdarg.h>
|
||||
|
||||
/* Get size_t. */
|
||||
#include <stddef.h>
|
||||
|
||||
#ifndef __attribute__
|
||||
/* This feature is available in gcc versions 2.5 and later. */
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
|
||||
# define __attribute__(Spec) /* empty */
|
||||
# endif
|
||||
/* The __-protected variants of `format' and `printf' attributes
|
||||
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
|
||||
# define __format__ format
|
||||
# define __printf__ printf
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Write formatted output to a string dynamically allocated with malloc().
|
||||
You can pass a preallocated buffer for the result in RESULTBUF and its
|
||||
size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
|
||||
If successful, return the address of the string (this may be = RESULTBUF
|
||||
if no dynamic memory allocation was necessary) and set *LENGTHP to the
|
||||
number of resulting bytes, excluding the trailing NUL. Upon error, set
|
||||
errno and return NULL.
|
||||
|
||||
When dynamic memory allocation occurs, the preallocated buffer is left
|
||||
alone (with possibly modified contents). This makes it possible to use
|
||||
a statically allocated or stack-allocated buffer, like this:
|
||||
|
||||
char buf[100];
|
||||
size_t len = sizeof (buf);
|
||||
char *output = vasnprintf (buf, &len, format, args);
|
||||
if (output == NULL)
|
||||
... error handling ...;
|
||||
else
|
||||
{
|
||||
... use the output string ...;
|
||||
if (output != buf)
|
||||
free (output);
|
||||
}
|
||||
*/
|
||||
extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
|
||||
__attribute__ ((__format__ (__printf__, 3, 4)));
|
||||
extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
|
||||
__attribute__ ((__format__ (__printf__, 3, 0)));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _VASNPRINTF_H */
|
|
@ -0,0 +1,46 @@
|
|||
/* vswprintf with automatic memory allocation.
|
||||
Copyright (C) 2002-2003 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifndef _VASNWPRINTF_H
|
||||
#define _VASNWPRINTF_H
|
||||
|
||||
/* Get va_list. */
|
||||
#include <stdarg.h>
|
||||
|
||||
/* Get wchar_t, size_t. */
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Write formatted output to a string dynamically allocated with malloc().
|
||||
You can pass a preallocated buffer for the result in RESULTBUF and its
|
||||
size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
|
||||
If successful, return the address of the string (this may be = RESULTBUF
|
||||
if no dynamic memory allocation was necessary) and set *LENGTHP to the
|
||||
number of resulting bytes, excluding the trailing NUL. Upon error, set
|
||||
errno and return NULL. */
|
||||
extern wchar_t * asnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, ...);
|
||||
extern wchar_t * vasnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, va_list args);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _VASNWPRINTF_H */
|
|
@ -0,0 +1,26 @@
|
|||
/* libintl library version.
|
||||
Copyright (C) 2005 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "libgnuintl.h"
|
||||
|
||||
/* Version number: (major<<16) + (minor<<8) + subminor */
|
||||
int libintl_version = LIBINTL_VERSION;
|
|
@ -0,0 +1,75 @@
|
|||
/* Parse printf format string.
|
||||
Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifndef _WPRINTF_PARSE_H
|
||||
#define _WPRINTF_PARSE_H
|
||||
|
||||
#include "printf-args.h"
|
||||
|
||||
|
||||
/* Flags */
|
||||
#define FLAG_GROUP 1 /* ' flag */
|
||||
#define FLAG_LEFT 2 /* - flag */
|
||||
#define FLAG_SHOWSIGN 4 /* + flag */
|
||||
#define FLAG_SPACE 8 /* space flag */
|
||||
#define FLAG_ALT 16 /* # flag */
|
||||
#define FLAG_ZERO 32
|
||||
|
||||
/* arg_index value indicating that no argument is consumed. */
|
||||
#define ARG_NONE (~(size_t)0)
|
||||
|
||||
/* A parsed directive. */
|
||||
typedef struct
|
||||
{
|
||||
const wchar_t* dir_start;
|
||||
const wchar_t* dir_end;
|
||||
int flags;
|
||||
const wchar_t* width_start;
|
||||
const wchar_t* width_end;
|
||||
size_t width_arg_index;
|
||||
const wchar_t* precision_start;
|
||||
const wchar_t* precision_end;
|
||||
size_t precision_arg_index;
|
||||
wchar_t conversion; /* d i o u x X f e E g G c s p n U % but not C S */
|
||||
size_t arg_index;
|
||||
}
|
||||
wchar_t_directive;
|
||||
|
||||
/* A parsed format string. */
|
||||
typedef struct
|
||||
{
|
||||
size_t count;
|
||||
wchar_t_directive *dir;
|
||||
size_t max_width_length;
|
||||
size_t max_precision_length;
|
||||
}
|
||||
wchar_t_directives;
|
||||
|
||||
|
||||
/* Parses the format string. Fills in the number N of directives, and fills
|
||||
in directives[0], ..., directives[N-1], and sets directives[N].dir_start
|
||||
to the end of the format string. Also fills in the arg_type fields of the
|
||||
arguments and the needed count of arguments. */
|
||||
#ifdef STATIC
|
||||
STATIC
|
||||
#else
|
||||
extern
|
||||
#endif
|
||||
int wprintf_parse (const wchar_t *format, wchar_t_directives *d, arguments *a);
|
||||
|
||||
#endif /* _WPRINTF_PARSE_H */
|
|
@ -0,0 +1,109 @@
|
|||
/* xsize.h -- Checked size_t computations.
|
||||
|
||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifndef _XSIZE_H
|
||||
#define _XSIZE_H
|
||||
|
||||
/* Get size_t. */
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get SIZE_MAX. */
|
||||
#include <limits.h>
|
||||
#if HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
/* The size of memory objects is often computed through expressions of
|
||||
type size_t. Example:
|
||||
void* p = malloc (header_size + n * element_size).
|
||||
These computations can lead to overflow. When this happens, malloc()
|
||||
returns a piece of memory that is way too small, and the program then
|
||||
crashes while attempting to fill the memory.
|
||||
To avoid this, the functions and macros in this file check for overflow.
|
||||
The convention is that SIZE_MAX represents overflow.
|
||||
malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc
|
||||
implementation that uses mmap --, it's recommended to use size_overflow_p()
|
||||
or size_in_bounds_p() before invoking malloc().
|
||||
The example thus becomes:
|
||||
size_t size = xsum (header_size, xtimes (n, element_size));
|
||||
void *p = (size_in_bounds_p (size) ? malloc (size) : NULL);
|
||||
*/
|
||||
|
||||
/* Convert an arbitrary value >= 0 to type size_t. */
|
||||
#define xcast_size_t(N) \
|
||||
((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
|
||||
|
||||
/* Sum of two sizes, with overflow check. */
|
||||
static inline size_t
|
||||
#if __GNUC__ >= 3
|
||||
__attribute__ ((__pure__))
|
||||
#endif
|
||||
xsum (size_t size1, size_t size2)
|
||||
{
|
||||
size_t sum = size1 + size2;
|
||||
return (sum >= size1 ? sum : SIZE_MAX);
|
||||
}
|
||||
|
||||
/* Sum of three sizes, with overflow check. */
|
||||
static inline size_t
|
||||
#if __GNUC__ >= 3
|
||||
__attribute__ ((__pure__))
|
||||
#endif
|
||||
xsum3 (size_t size1, size_t size2, size_t size3)
|
||||
{
|
||||
return xsum (xsum (size1, size2), size3);
|
||||
}
|
||||
|
||||
/* Sum of four sizes, with overflow check. */
|
||||
static inline size_t
|
||||
#if __GNUC__ >= 3
|
||||
__attribute__ ((__pure__))
|
||||
#endif
|
||||
xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
|
||||
{
|
||||
return xsum (xsum (xsum (size1, size2), size3), size4);
|
||||
}
|
||||
|
||||
/* Maximum of two sizes, with overflow check. */
|
||||
static inline size_t
|
||||
#if __GNUC__ >= 3
|
||||
__attribute__ ((__pure__))
|
||||
#endif
|
||||
xmax (size_t size1, size_t size2)
|
||||
{
|
||||
/* No explicit check is needed here, because for any n:
|
||||
max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */
|
||||
return (size1 >= size2 ? size1 : size2);
|
||||
}
|
||||
|
||||
/* Multiplication of a count with an element size, with overflow check.
|
||||
The count must be >= 0 and the element size must be > 0.
|
||||
This is a macro, not an inline function, so that it works correctly even
|
||||
when N is of a wider tupe and N > SIZE_MAX. */
|
||||
#define xtimes(N, ELSIZE) \
|
||||
((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
|
||||
|
||||
/* Check for overflow. */
|
||||
#define size_overflow_p(SIZE) \
|
||||
((SIZE) == SIZE_MAX)
|
||||
/* Check against overflow. */
|
||||
#define size_in_bounds_p(SIZE) \
|
||||
((SIZE) != SIZE_MAX)
|
||||
|
||||
#endif /* _XSIZE_H */
|
|
@ -0,0 +1,38 @@
|
|||
# Makefile stub for creating standalone plugin distributions.
|
||||
|
||||
plugin_dist: pg_dist pg_dist/config.status
|
||||
pgi=`cd $(srcdir)/.. && pwd`; cd pg_dist; \
|
||||
$(MAKE) $(AM_MAKEFLAGS) PLUGIN_INCLUDES=-I$$pgi distcheck dist
|
||||
|
||||
pg_dist: pg_distdir pg_dist/configure.in pg_dist/install-sh
|
||||
cd pg_dist \
|
||||
&& libtoolize --copy --force --automake \
|
||||
&& automake --copy --add-missing --foreign \
|
||||
&& autoconf -l ../$(top_srcdir)
|
||||
|
||||
pg_distdir: $(DISTFILES)
|
||||
test -d pg_dist || mkdir pg_dist
|
||||
for dfile in $(DISTFILES); do \
|
||||
test -f $$dfile && cp $$dfile pg_dist \
|
||||
|| test -f $(srcdir)/$$dfile && cp $(srcdir)/$$dfile pg_dist; done
|
||||
sed '/Make.plugin/d' < $(srcdir)/Makefile.am > pg_dist/Makefile.am
|
||||
|
||||
pg_dist/configure.in: $(srcdir)/../plugin-conf.in
|
||||
rm -f pg_dist/configure.in
|
||||
test -f $(srcdir)/config.stub \
|
||||
&& cat $(srcdir)/config.stub > pg_dist/configure.in || true
|
||||
cat $(srcdir)/../plugin-conf.in | \
|
||||
sed 's%@PLUGIN_VERSION@%$(PLUGIN_VERSION)%; \
|
||||
s%@PLUGIN@%$(PLUGIN)%' >> pg_dist/configure.in
|
||||
|
||||
pg_dist/install-sh: pg_distdir
|
||||
cp $(top_srcdir)/install-sh pg_dist
|
||||
|
||||
pg_dist/config.status: pg_dist/configure
|
||||
cd pg_dist \
|
||||
&& test -f config.status && $(SHELL) ./config.status --recheck \
|
||||
|| $(SHELL) ./configure --enable-maintainer-mode
|
||||
|
||||
DISTCLEANFILES = pg_dist/* pg_dist
|
||||
|
||||
#
|
|
@ -0,0 +1,21 @@
|
|||
# temp. solution while mailcheck & xdcc arn't in SUBDIRS
|
||||
EXTRA_DIST = plugin20.html Make.plugin plugin-conf.in \
|
||||
xdcc/xdcc.c \
|
||||
xdcc/Makefile.am
|
||||
|
||||
noinst_HEADERS = xchat-plugin.h
|
||||
|
||||
if DO_PYTHON
|
||||
pythondir = python
|
||||
endif
|
||||
|
||||
if DO_PERL
|
||||
perldir = perl
|
||||
endif
|
||||
|
||||
if DO_TCL
|
||||
tcldir = tcl
|
||||
endif
|
||||
|
||||
#SUBDIRS = . $(pythondir) $(perldir) mailcheck xdcc
|
||||
SUBDIRS = . $(pythondir) $(perldir) $(tcldir)
|
|
@ -0,0 +1,694 @@
|
|||
# Makefile.in generated by automake 1.16.5 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2021 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@
|
||||
subdir = plugins
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
|
||||
$(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
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 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
|
||||
ctags-recursive dvi-recursive html-recursive info-recursive \
|
||||
install-data-recursive install-dvi-recursive \
|
||||
install-exec-recursive install-html-recursive \
|
||||
install-info-recursive install-pdf-recursive \
|
||||
install-ps-recursive install-recursive installcheck-recursive \
|
||||
installdirs-recursive pdf-recursive ps-recursive \
|
||||
tags-recursive uninstall-recursive
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
am__recursive_targets = \
|
||||
$(RECURSIVE_TARGETS) \
|
||||
$(RECURSIVE_CLEAN_TARGETS) \
|
||||
$(am__extra_recursive_targets)
|
||||
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
|
||||
distdir distdir-am
|
||||
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)`
|
||||
DIST_SUBDIRS = . python perl tcl
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
am__relativize = \
|
||||
dir0=`pwd`; \
|
||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
||||
sed_rest='s,^[^/]*/*,,'; \
|
||||
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
|
||||
sed_butlast='s,/*[^/]*$$,,'; \
|
||||
while test -n "$$dir1"; do \
|
||||
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
|
||||
if test "$$first" != "."; then \
|
||||
if test "$$first" = ".."; then \
|
||||
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
|
||||
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
|
||||
else \
|
||||
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
|
||||
if test "$$first2" = "$$first"; then \
|
||||
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
|
||||
else \
|
||||
dir2="../$$dir2"; \
|
||||
fi; \
|
||||
dir0="$$dir0"/"$$first"; \
|
||||
fi; \
|
||||
fi; \
|
||||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
||||
done; \
|
||||
reldir="$$dir2"
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCAS = @CCAS@
|
||||
CCASDEPMODE = @CCASDEPMODE@
|
||||
CCASFLAGS = @CCASFLAGS@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMMON_CFLAGS = @COMMON_CFLAGS@
|
||||
COMMON_LIBS = @COMMON_LIBS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CSCOPE = @CSCOPE@
|
||||
CTAGS = @CTAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DATADIR = @DATADIR@
|
||||
DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@
|
||||
DBUS_CFLAGS = @DBUS_CFLAGS@
|
||||
DBUS_LIBS = @DBUS_LIBS@
|
||||
DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GCONFTOOL = @GCONFTOOL@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GMSGFMT_015 = @GMSGFMT_015@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
GREP = @GREP@
|
||||
GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@
|
||||
GTKSPELL_LIBS = @GTKSPELL_LIBS@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
GUI_CFLAGS = @GUI_CFLAGS@
|
||||
GUI_LIBS = @GUI_LIBS@
|
||||
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@
|
||||
LIBSEXY_CFLAGS = @LIBSEXY_CFLAGS@
|
||||
LIBSEXY_LIBS = @LIBSEXY_LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
|
||||
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@
|
||||
PERL_CFLAGS = @PERL_CFLAGS@
|
||||
PERL_LDFLAGS = @PERL_LDFLAGS@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
PLUGIN_INCLUDES = @PLUGIN_INCLUDES@
|
||||
POSUB = @POSUB@
|
||||
PY_CFLAGS = @PY_CFLAGS@
|
||||
PY_LIBS = @PY_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
TCL_CFLAGS = @TCL_CFLAGS@
|
||||
TCL_LIBS = @TCL_LIBS@
|
||||
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@
|
||||
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@
|
||||
gdkpixbufcsourcepath = @gdkpixbufcsourcepath@
|
||||
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@
|
||||
perlpath = @perlpath@
|
||||
pkgconfigpath = @pkgconfigpath@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
pythonpath = @pythonpath@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sedpath = @sedpath@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
unamepath = @unamepath@
|
||||
xchatlibdir = @xchatlibdir@
|
||||
|
||||
# temp. solution while mailcheck & xdcc arn't in SUBDIRS
|
||||
EXTRA_DIST = plugin20.html Make.plugin plugin-conf.in \
|
||||
xdcc/xdcc.c \
|
||||
xdcc/Makefile.am
|
||||
|
||||
noinst_HEADERS = xchat-plugin.h
|
||||
@DO_PYTHON_TRUE@pythondir = python
|
||||
@DO_PERL_TRUE@perldir = perl
|
||||
@DO_TCL_TRUE@tcldir = tcl
|
||||
|
||||
#SUBDIRS = . $(pythondir) $(perldir) mailcheck xdcc
|
||||
SUBDIRS = . $(pythondir) $(perldir) $(tcldir)
|
||||
all: all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 plugins/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign plugins/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__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run 'make' without going through this Makefile.
|
||||
# To change the values of 'make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in 'config.status', edit 'config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run 'make');
|
||||
# (2) otherwise, pass the desired values on the 'make' command line.
|
||||
$(am__recursive_targets):
|
||||
@fail=; \
|
||||
if $(am__make_keepgoing); then \
|
||||
failcom='fail=yes'; \
|
||||
else \
|
||||
failcom='exit 1'; \
|
||||
fi; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-recursive
|
||||
TAGS: tags
|
||||
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
$(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-recursive
|
||||
|
||||
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-recursive
|
||||
|
||||
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: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(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
|
||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
$(am__make_dryrun) \
|
||||
|| test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
||||
$(am__relativize); \
|
||||
new_distdir=$$reldir; \
|
||||
dir1=$$subdir; dir2="$(top_distdir)"; \
|
||||
$(am__relativize); \
|
||||
new_top_distdir=$$reldir; \
|
||||
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
|
||||
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
|
||||
($(am__cd) $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$new_top_distdir" \
|
||||
distdir="$$new_distdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
am__skip_mode_fix=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile $(HEADERS)
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
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-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: $(am__recursive_targets) install-am install-strip
|
||||
|
||||
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
|
||||
check-am clean clean-generic clean-libtool cscopelist-am ctags \
|
||||
ctags-am distclean 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 \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
mostlyclean 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:
|
|
@ -0,0 +1,256 @@
|
|||
{
|
||||
package IRC;
|
||||
sub IRC::register {
|
||||
my ($script_name, $version, $callback) = @_;
|
||||
my $package = caller;
|
||||
$callback = Xchat::Embed::fix_callback( $package, $callback) if $callback;
|
||||
Xchat::register( $script_name, $version, undef, $callback );
|
||||
}
|
||||
|
||||
|
||||
sub IRC::add_command_handler {
|
||||
my ($command, $callback) = @_;
|
||||
my $package = caller;
|
||||
|
||||
$callback = Xchat::Embed::fix_callback( $package, $callback );
|
||||
|
||||
# starting index for word_eol array
|
||||
# this is for compatibility with '' as the command
|
||||
my $start_index = $command ? 1 : 0;
|
||||
|
||||
Xchat::hook_command( $command,
|
||||
sub {
|
||||
no strict 'refs';
|
||||
return &{$callback}($_[1][$start_index]);
|
||||
}
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
sub IRC::add_message_handler {
|
||||
my ($message, $callback) = @_;
|
||||
my $package = caller;
|
||||
$callback = Xchat::Embed::fix_callback( $package, $callback );
|
||||
|
||||
Xchat::hook_server( $message,
|
||||
sub {
|
||||
no strict 'refs';
|
||||
return &{$callback}( $_[1][0] );
|
||||
}
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
sub IRC::add_print_handler {
|
||||
my ($event, $callback) = @_;
|
||||
my $package = caller;
|
||||
$callback = Xchat::Embed::fix_callback( $package, $callback );
|
||||
Xchat::hook_print( $event,
|
||||
sub {
|
||||
my @word = @{$_[0]};
|
||||
no strict 'refs';
|
||||
return &{$callback}( join( ' ', @word[0..3] ), @word );
|
||||
}
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
sub IRC::add_timeout_handler {
|
||||
my ($timeout, $callback) = @_;
|
||||
my $package = caller;
|
||||
$callback = Xchat::Embed::fix_callback( $package, $callback );
|
||||
Xchat::hook_timer( $timeout,
|
||||
sub {
|
||||
no strict 'refs';
|
||||
&{$callback};
|
||||
return 0;
|
||||
}
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
sub IRC::command {
|
||||
my $command = shift;
|
||||
if( $command =~ m{^/} ) {
|
||||
$command =~ s{^/}{};
|
||||
Xchat::command( $command );
|
||||
} else {
|
||||
Xchat::command( qq[say $command] );
|
||||
}
|
||||
}
|
||||
|
||||
sub IRC::command_with_channel {
|
||||
my ($command, $channel, $server) = @_;
|
||||
my $old_ctx = Xchat::get_context;
|
||||
my $ctx = Xchat::find_context( $channel, $server );
|
||||
|
||||
if( $ctx ) {
|
||||
Xchat::set_context( $ctx );
|
||||
IRC::command( $command );
|
||||
Xchat::set_context( $ctx );
|
||||
}
|
||||
}
|
||||
|
||||
sub IRC::command_with_server {
|
||||
my ($command, $server) = @_;
|
||||
my $old_ctx = Xchat::get_context;
|
||||
my $ctx = Xchat::find_context( undef, $server );
|
||||
|
||||
if( $ctx ) {
|
||||
Xchat::set_context( $ctx );
|
||||
IRC::command( $command );
|
||||
Xchat::set_context( $ctx );
|
||||
}
|
||||
}
|
||||
|
||||
sub IRC::dcc_list {
|
||||
my @dccs;
|
||||
for my $dcc ( Xchat::get_list( 'dcc' ) ) {
|
||||
push @dccs, $dcc->{nick};
|
||||
push @dccs, $dcc->{file} ? $dcc->{file} : '';
|
||||
push @dccs, @{$dcc}{qw(type status cps size)};
|
||||
push @dccs, $dcc->{type} == 0 ? $dcc->{pos} : $dcc->{resume};
|
||||
push @dccs, $dcc->{address32};
|
||||
push @dccs, $dcc->{destfile} ? $dcc->{destfile} : '';
|
||||
}
|
||||
return @dccs;
|
||||
}
|
||||
|
||||
sub IRC::channel_list {
|
||||
my @channels;
|
||||
for my $channel ( Xchat::get_list( 'channels' ) ) {
|
||||
push @channels, @{$channel}{qw(channel server)},
|
||||
Xchat::context_info( $channel->{context} )->{nick};
|
||||
}
|
||||
return @channels;
|
||||
}
|
||||
|
||||
sub IRC::get_info {
|
||||
my $id = shift;
|
||||
my @ids = qw(version nick channel server xchatdir away network host topic);
|
||||
|
||||
if( $id >= 0 && $id <= 8 && $id != 5 ) {
|
||||
my $info = Xchat::get_info($ids[$id]);
|
||||
return defined $info ? $info : '';
|
||||
} else {
|
||||
if( $id == 5 ) {
|
||||
return Xchat::get_info( 'away' ) ? 1 : 0;
|
||||
} else {
|
||||
return 'Error2';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub IRC::get_prefs {
|
||||
return 'Unknown variable' unless defined $_[0];
|
||||
my $result = Xchat::get_prefs(shift);
|
||||
return defined $result ? $result : 'Unknown variable';
|
||||
}
|
||||
|
||||
sub IRC::ignore_list {
|
||||
my @ignores;
|
||||
for my $ignore ( Xchat::get_list( 'ignore' ) ) {
|
||||
push @ignores, $ignore->{mask};
|
||||
my $flags = $ignore->{flags};
|
||||
push @ignores, $flags & 1, $flags & 2, $flags & 4, $flags & 8, $flags & 16,
|
||||
$flags & 32, ':';
|
||||
}
|
||||
return @ignores;
|
||||
}
|
||||
|
||||
sub IRC::print {
|
||||
Xchat::print( $_ ) for @_;
|
||||
return;
|
||||
}
|
||||
|
||||
sub IRC::print_with_channel {
|
||||
Xchat::print( @_ );
|
||||
}
|
||||
|
||||
sub IRC::send_raw {
|
||||
Xchat::commandf( qq[quote %s], shift );
|
||||
}
|
||||
|
||||
sub IRC::server_list {
|
||||
my @servers;
|
||||
for my $channel ( Xchat::get_list( 'channels' ) ) {
|
||||
push @servers, $channel->{server} if $channel->{server};
|
||||
}
|
||||
return @servers;
|
||||
}
|
||||
|
||||
sub IRC::user_info {
|
||||
my $user;
|
||||
if( @_ > 0 ) {
|
||||
$user = Xchat::user_info( shift );
|
||||
} else {
|
||||
$user = Xchat::user_info();
|
||||
}
|
||||
|
||||
my @info;
|
||||
if( $user ) {
|
||||
push @info, $user->{nick};
|
||||
if( $user->{host} ) {
|
||||
push @info, $user->{host};
|
||||
} else {
|
||||
push @info, 'FETCHING';
|
||||
}
|
||||
push @info, $user->{prefix} eq '@' ? 1 : 0;
|
||||
push @info, $user->{prefix} eq '+' ? 1 : 0;
|
||||
}
|
||||
return @info;
|
||||
}
|
||||
|
||||
sub IRC::user_list {
|
||||
my ($channel, $server) = @_;
|
||||
my $ctx = Xchat::find_context( $channel, $server );
|
||||
my $old_ctx = Xchat::get_context;
|
||||
|
||||
if( $ctx ) {
|
||||
Xchat::set_context( $ctx );
|
||||
my @users;
|
||||
for my $user ( Xchat::get_list( 'users' ) ) {
|
||||
push @users, $user->{nick};
|
||||
if( $user->{host} ) {
|
||||
push @users, $user->{host};
|
||||
} else {
|
||||
push @users, 'FETCHING';
|
||||
}
|
||||
push @users, $user->{prefix} eq '@' ? 1 : 0;
|
||||
push @users, $user->{prefix} eq '+' ? 1 : 0;
|
||||
push @users, ':';
|
||||
}
|
||||
Xchat::set_context( $old_ctx );
|
||||
return @users;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
sub IRC::user_list_short {
|
||||
my ($channel, $server) = @_;
|
||||
my $ctx = Xchat::find_context( $channel, $server );
|
||||
my $old_ctx = Xchat::get_context;
|
||||
|
||||
if( $ctx ) {
|
||||
Xchat::set_context( $ctx );
|
||||
my @users;
|
||||
for my $user ( Xchat::get_list( 'users' ) ) {
|
||||
my $nick = $user->{nick};
|
||||
my $host = $user->{host} || 'FETCHING';
|
||||
push @users, $nick, $host;
|
||||
}
|
||||
Xchat::set_context( $old_ctx );
|
||||
return @users;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sub IRC::add_user_list {}
|
||||
sub IRC::sub_user_list {}
|
||||
sub IRC::clear_user_list {}
|
||||
sub IRC::notify_list {}
|
||||
sub IRC::perl_script_list {}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
EXTRA_DIST=alt_completion.pl xchat2-perldocs.html xchat2-perl.html generate_header Xchat.pm IRC.pm Pod/
|
||||
|
||||
libdir = $(xchatlibdir)/plugins
|
||||
|
||||
lib_LTLIBRARIES = perl.la
|
||||
perl_la_SOURCES = perl.c
|
||||
perl_la_LDFLAGS = -avoid-version -module
|
||||
perl_la_LIBADD = $(PERL_LDFLAGS)
|
||||
BUILT_SOURCES = xchat.pm.h irc.pm.h
|
||||
#CFLAGS = @CFLAGS@ -Wno-unused
|
||||
INCLUDES = $(PERL_CFLAGS) $(COMMON_CFLAGS) -I$(srcdir)/..
|
||||
CLEANFILES = xchat.pm.h irc.pm.h
|
||||
xchat.pm.h irc.pm.h: Xchat.pm IRC.pm
|
||||
perl generate_header
|
|
@ -0,0 +1,730 @@
|
|||
# Makefile.in generated by automake 1.16.5 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2021 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@
|
||||
subdir = plugins/perl
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.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 =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(libdir)"
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
am__DEPENDENCIES_1 =
|
||||
perl_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
|
||||
am_perl_la_OBJECTS = perl.lo
|
||||
perl_la_OBJECTS = $(am_perl_la_OBJECTS)
|
||||
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 =
|
||||
perl_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(perl_la_LDFLAGS) $(LDFLAGS) -o $@
|
||||
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)/depcomp
|
||||
am__maybe_remake_depfiles = depfiles
|
||||
am__depfiles_remade = ./$(DEPDIR)/perl.Plo
|
||||
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 = $(perl_la_SOURCES)
|
||||
DIST_SOURCES = $(perl_la_SOURCES)
|
||||
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)`
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCAS = @CCAS@
|
||||
CCASDEPMODE = @CCASDEPMODE@
|
||||
CCASFLAGS = @CCASFLAGS@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMMON_CFLAGS = @COMMON_CFLAGS@
|
||||
COMMON_LIBS = @COMMON_LIBS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CSCOPE = @CSCOPE@
|
||||
CTAGS = @CTAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DATADIR = @DATADIR@
|
||||
DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@
|
||||
DBUS_CFLAGS = @DBUS_CFLAGS@
|
||||
DBUS_LIBS = @DBUS_LIBS@
|
||||
DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GCONFTOOL = @GCONFTOOL@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GMSGFMT_015 = @GMSGFMT_015@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
GREP = @GREP@
|
||||
GTKSPELL_CFLAGS = @GTKSPELL_CFLAGS@
|
||||
GTKSPELL_LIBS = @GTKSPELL_LIBS@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
GUI_CFLAGS = @GUI_CFLAGS@
|
||||
GUI_LIBS = @GUI_LIBS@
|
||||
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@
|
||||
LIBSEXY_CFLAGS = @LIBSEXY_CFLAGS@
|
||||
LIBSEXY_LIBS = @LIBSEXY_LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
|
||||
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@
|
||||
PERL_CFLAGS = @PERL_CFLAGS@
|
||||
PERL_LDFLAGS = @PERL_LDFLAGS@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
PLUGIN_INCLUDES = @PLUGIN_INCLUDES@
|
||||
POSUB = @POSUB@
|
||||
PY_CFLAGS = @PY_CFLAGS@
|
||||
PY_LIBS = @PY_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
TCL_CFLAGS = @TCL_CFLAGS@
|
||||
TCL_LIBS = @TCL_LIBS@
|
||||
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@
|
||||
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@
|
||||
gdkpixbufcsourcepath = @gdkpixbufcsourcepath@
|
||||
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 = $(xchatlibdir)/plugins
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
perlpath = @perlpath@
|
||||
pkgconfigpath = @pkgconfigpath@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
pythonpath = @pythonpath@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sedpath = @sedpath@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
unamepath = @unamepath@
|
||||
xchatlibdir = @xchatlibdir@
|
||||
EXTRA_DIST = alt_completion.pl xchat2-perldocs.html xchat2-perl.html generate_header Xchat.pm IRC.pm Pod/
|
||||
lib_LTLIBRARIES = perl.la
|
||||
perl_la_SOURCES = perl.c
|
||||
perl_la_LDFLAGS = -avoid-version -module
|
||||
perl_la_LIBADD = $(PERL_LDFLAGS)
|
||||
BUILT_SOURCES = xchat.pm.h irc.pm.h
|
||||
#CFLAGS = @CFLAGS@ -Wno-unused
|
||||
INCLUDES = $(PERL_CFLAGS) $(COMMON_CFLAGS) -I$(srcdir)/..
|
||||
CLEANFILES = xchat.pm.h irc.pm.h
|
||||
all: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 plugins/perl/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign plugins/perl/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__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
|
||||
list2=; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
list2="$$list2 $$p"; \
|
||||
else :; fi; \
|
||||
done; \
|
||||
test -z "$$list2" || { \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
|
||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
|
||||
}
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
|
||||
for p in $$list; do \
|
||||
$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
|
||||
done
|
||||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
@list='$(lib_LTLIBRARIES)'; \
|
||||
locs=`for p in $$list; do echo $$p; done | \
|
||||
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
|
||||
sort -u`; \
|
||||
test -z "$$locs" || { \
|
||||
echo rm -f $${locs}; \
|
||||
rm -f $${locs}; \
|
||||
}
|
||||
|
||||
perl.la: $(perl_la_OBJECTS) $(perl_la_DEPENDENCIES) $(EXTRA_perl_la_DEPENDENCIES)
|
||||
$(AM_V_CCLD)$(perl_la_LINK) -rpath $(libdir) $(perl_la_OBJECTS) $(perl_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perl.Plo@am__quote@ # am--include-marker
|
||||
|
||||
$(am__depfiles_remade):
|
||||
@$(MKDIR_P) $(@D)
|
||||
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
|
||||
|
||||
am--depfiles: $(am__depfiles_remade)
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
|
||||
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(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: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) check-am
|
||||
all-am: Makefile $(LTLIBRARIES)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(libdir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) install-am
|
||||
install-exec: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) 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:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
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."
|
||||
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f ./$(DEPDIR)/perl.Plo
|
||||
-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-libLTLIBRARIES
|
||||
|
||||
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 -f ./$(DEPDIR)/perl.Plo
|
||||
-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: uninstall-libLTLIBRARIES
|
||||
|
||||
.MAKE: all check install install-am install-exec install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
|
||||
clean-generic clean-libLTLIBRARIES clean-libtool 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-libLTLIBRARIES 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 uninstall-libLTLIBRARIES
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
xchat.pm.h irc.pm.h: Xchat.pm IRC.pm
|
||||
perl generate_header
|
||||
|
||||
# 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:
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,963 @@
|
|||
# line 1 "Xchat.pm"
|
||||
BEGIN {
|
||||
$INC{'Xchat.pm'} = 'DUMMY';
|
||||
}
|
||||
|
||||
$SIG{__WARN__} = sub {
|
||||
my $message = shift @_;
|
||||
my ($package) = caller;
|
||||
|
||||
# redirect Gtk/Glib errors and warnings back to STDERR
|
||||
my $message_levels = qr/ERROR|CRITICAL|WARNING|MESSAGE|INFO|DEBUG/;
|
||||
if( $message =~ /^(?:Gtk|GLib|Gdk)(?:-\w+)?-$message_levels/i ) {
|
||||
print STDERR $message;
|
||||
} else {
|
||||
|
||||
if( defined &Xchat::Internal::print ) {
|
||||
Xchat::print( $message );
|
||||
} else {
|
||||
warn $message;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
use File::Spec ();
|
||||
use File::Basename ();
|
||||
use File::Glob ();
|
||||
use List::Util ();
|
||||
use Symbol();
|
||||
use Time::HiRes ();
|
||||
use Carp ();
|
||||
|
||||
{
|
||||
package Xchat;
|
||||
use base qw(Exporter);
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
sub PRI_HIGHEST ();
|
||||
sub PRI_HIGH ();
|
||||
sub PRI_NORM ();
|
||||
sub PRI_LOW ();
|
||||
sub PRI_LOWEST ();
|
||||
|
||||
sub EAT_NONE ();
|
||||
sub EAT_XCHAT ();
|
||||
sub EAT_PLUIN ();
|
||||
sub EAT_ALL ();
|
||||
|
||||
sub KEEP ();
|
||||
sub REMOVE ();
|
||||
sub FD_READ ();
|
||||
sub FD_WRITE ();
|
||||
sub FD_EXCEPTION ();
|
||||
sub FD_NOTSOCKET ();
|
||||
|
||||
sub get_context;
|
||||
sub Xchat::Internal::context_info;
|
||||
sub Xchat::Internal::print;
|
||||
|
||||
our %EXPORT_TAGS = (
|
||||
constants => [
|
||||
qw(PRI_HIGHEST PRI_HIGH PRI_NORM PRI_LOW PRI_LOWEST), # priorities
|
||||
qw(EAT_NONE EAT_XCHAT EAT_PLUGIN EAT_ALL), # callback return values
|
||||
qw(FD_READ FD_WRITE FD_EXCEPTION FD_NOTSOCKET), # fd flags
|
||||
qw(KEEP REMOVE), # timers
|
||||
],
|
||||
hooks => [
|
||||
qw(hook_server hook_command hook_print hook_timer hook_fd unhook),
|
||||
],
|
||||
util => [
|
||||
qw(register nickcmp strip_code send_modes), # misc
|
||||
qw(print prnt printf prntf command commandf emit_print), # output
|
||||
qw(find_context get_context set_context), # context
|
||||
qw(get_info get_prefs get_list context_info user_info), # input
|
||||
],
|
||||
);
|
||||
|
||||
$EXPORT_TAGS{all} = [ map { @{$_} } @EXPORT_TAGS{qw(constants hooks util)}];
|
||||
our @EXPORT = @{$EXPORT_TAGS{constants}};
|
||||
our @EXPORT_OK = @{$EXPORT_TAGS{all}};
|
||||
|
||||
sub register {
|
||||
my $package = Xchat::Embed::find_pkg();
|
||||
my $pkg_info = Xchat::Embed::pkg_info( $package );
|
||||
my $filename = $pkg_info->{filename};
|
||||
my ($name, $version, $description, $callback) = @_;
|
||||
|
||||
if( defined $pkg_info->{gui_entry} ) {
|
||||
Xchat::print( "Xchat::register called more than once in "
|
||||
. $pkg_info->{filename} );
|
||||
return ();
|
||||
}
|
||||
|
||||
$description = "" unless defined $description;
|
||||
$pkg_info->{shutdown} = $callback;
|
||||
unless( $name && $name =~ /[[:print:]\w]/ ) {
|
||||
$name = "Not supplied";
|
||||
}
|
||||
unless( $version && $version =~ /\d+(?:\.\d+)?/ ) {
|
||||
$version = "NaN";
|
||||
}
|
||||
$pkg_info->{gui_entry} =
|
||||
Xchat::Internal::register( $name, $version, $description, $filename );
|
||||
# keep with old behavior
|
||||
return ();
|
||||
}
|
||||
|
||||
sub hook_server {
|
||||
return undef unless @_ >= 2;
|
||||
my $message = shift;
|
||||
my $callback = shift;
|
||||
my $options = shift;
|
||||
my $package = Xchat::Embed::find_pkg();
|
||||
|
||||
$callback = Xchat::Embed::fix_callback( $package, $callback );
|
||||
|
||||
my ($priority, $data) = ( Xchat::PRI_NORM, undef );
|
||||
|
||||
if( ref( $options ) eq 'HASH' ) {
|
||||
if( exists( $options->{priority} ) && defined( $options->{priority} ) ) {
|
||||
$priority = $options->{priority};
|
||||
}
|
||||
|
||||
if( exists( $options->{data} ) && defined( $options->{data} ) ) {
|
||||
$data = $options->{data};
|
||||
}
|
||||
}
|
||||
|
||||
my $pkg_info = Xchat::Embed::pkg_info( $package );
|
||||
my $hook = Xchat::Internal::hook_server(
|
||||
$message, $priority, $callback, $data
|
||||
);
|
||||
push @{$pkg_info->{hooks}}, $hook if defined $hook;
|
||||
return $hook;
|
||||
}
|
||||
|
||||
sub hook_command {
|
||||
return undef unless @_ >= 2;
|
||||
my $command = shift;
|
||||
my $callback = shift;
|
||||
my $options = shift;
|
||||
my $package = Xchat::Embed::find_pkg();
|
||||
|
||||
$callback = Xchat::Embed::fix_callback( $package, $callback );
|
||||
|
||||
my ($priority, $help_text, $data) = ( Xchat::PRI_NORM, undef, undef );
|
||||
|
||||
if( ref( $options ) eq 'HASH' ) {
|
||||
if( exists( $options->{priority} ) && defined( $options->{priority} ) ) {
|
||||
$priority = $options->{priority};
|
||||
}
|
||||
|
||||
if(
|
||||
exists( $options->{help_text} )
|
||||
&& defined( $options->{help_text} )
|
||||
) {
|
||||
$help_text = $options->{help_text};
|
||||
}
|
||||
|
||||
if ( exists( $options->{data} ) && defined( $options->{data} ) ) {
|
||||
$data = $options->{data};
|
||||
}
|
||||
}
|
||||
|
||||
my $pkg_info = Xchat::Embed::pkg_info( $package );
|
||||
my $hook = Xchat::Internal::hook_command(
|
||||
$command, $priority, $callback, $help_text, $data
|
||||
);
|
||||
push @{$pkg_info->{hooks}}, $hook if defined $hook;
|
||||
return $hook;
|
||||
}
|
||||
|
||||
sub hook_print {
|
||||
return undef unless @_ >= 2;
|
||||
my $event = shift;
|
||||
my $callback = shift;
|
||||
my $options = shift;
|
||||
my $package = Xchat::Embed::find_pkg();
|
||||
|
||||
$callback = Xchat::Embed::fix_callback( $package, $callback );
|
||||
|
||||
my ($priority, $data) = ( Xchat::PRI_NORM, undef );
|
||||
|
||||
if ( ref( $options ) eq 'HASH' ) {
|
||||
if ( exists( $options->{priority} ) && defined( $options->{priority} ) ) {
|
||||
$priority = $options->{priority};
|
||||
}
|
||||
|
||||
if ( exists( $options->{data} ) && defined( $options->{data} ) ) {
|
||||
$data = $options->{data};
|
||||
}
|
||||
}
|
||||
|
||||
my $pkg_info = Xchat::Embed::pkg_info( $package );
|
||||
my $hook = Xchat::Internal::hook_print(
|
||||
$event, $priority, $callback, $data
|
||||
);
|
||||
push @{$pkg_info->{hooks}}, $hook if defined $hook;
|
||||
return $hook;
|
||||
}
|
||||
|
||||
sub hook_timer {
|
||||
return undef unless @_ >= 2;
|
||||
my ($timeout, $callback, $data) = @_;
|
||||
my $package = Xchat::Embed::find_pkg();
|
||||
|
||||
$callback = Xchat::Embed::fix_callback( $package, $callback );
|
||||
|
||||
if(
|
||||
ref( $data ) eq 'HASH' && exists( $data->{data} )
|
||||
&& defined( $data->{data} )
|
||||
) {
|
||||
$data = $data->{data};
|
||||
}
|
||||
|
||||
my $pkg_info = Xchat::Embed::pkg_info( $package );
|
||||
my $hook = Xchat::Internal::hook_timer( $timeout, $callback, $data, $package );
|
||||
push @{$pkg_info->{hooks}}, $hook if defined $hook;
|
||||
return $hook;
|
||||
}
|
||||
|
||||
sub hook_fd {
|
||||
return undef unless @_ >= 2;
|
||||
my ($fd, $callback, $options) = @_;
|
||||
return undef unless defined $fd && defined $callback;
|
||||
|
||||
my $fileno = fileno $fd;
|
||||
return undef unless defined $fileno; # no underlying fd for this handle
|
||||
|
||||
my ($package) = Xchat::Embed::find_pkg();
|
||||
$callback = Xchat::Embed::fix_callback( $package, $callback );
|
||||
|
||||
my ($flags, $data) = (Xchat::FD_READ, undef);
|
||||
|
||||
if( ref( $options ) eq 'HASH' ) {
|
||||
if( exists( $options->{flags} ) && defined( $options->{flags} ) ) {
|
||||
$flags = $options->{flags};
|
||||
}
|
||||
|
||||
if ( exists( $options->{data} ) && defined( $options->{data} ) ) {
|
||||
$data = $options->{data};
|
||||
}
|
||||
}
|
||||
|
||||
my $cb = sub {
|
||||
my $userdata = shift;
|
||||
return $userdata->{CB}->(
|
||||
$userdata->{FD}, $userdata->{FLAGS}, $userdata->{DATA},
|
||||
);
|
||||
};
|
||||
|
||||
my $pkg_info = Xchat::Embed::pkg_info( $package );
|
||||
my $hook = Xchat::Internal::hook_fd(
|
||||
$fileno, $cb, $flags, {
|
||||
DATA => $data, FD => $fd, CB => $callback, FLAGS => $flags,
|
||||
}
|
||||
);
|
||||
push @{$pkg_info->{hooks}}, $hook if defined $hook;
|
||||
return $hook;
|
||||
}
|
||||
|
||||
sub unhook {
|
||||
my $hook = shift @_;
|
||||
my $package = shift @_;
|
||||
($package) = caller unless $package;
|
||||
my $pkg_info = Xchat::Embed::pkg_info( $package );
|
||||
|
||||
if( defined( $hook )
|
||||
&& $hook =~ /^\d+$/
|
||||
&& grep { $_ == $hook } @{$pkg_info->{hooks}} ) {
|
||||
$pkg_info->{hooks} = [grep { $_ != $hook } @{$pkg_info->{hooks}}];
|
||||
return Xchat::Internal::unhook( $hook );
|
||||
}
|
||||
return ();
|
||||
}
|
||||
|
||||
sub _do_for_each {
|
||||
my ($cb, $channels, $servers) = @_;
|
||||
|
||||
# not specifying any channels or servers is not the same as specifying
|
||||
# undef for both
|
||||
# - not specifying either results in calling the callback inthe current ctx
|
||||
# - specifying undef for for both results in calling the callback in the
|
||||
# front/currently selected tab
|
||||
if( @_ == 3 && !($channels || $servers) ) {
|
||||
$channels = [ undef ];
|
||||
$servers = [ undef ];
|
||||
} elsif( !($channels || $servers) ) {
|
||||
$cb->();
|
||||
return 1;
|
||||
}
|
||||
|
||||
$channels = [ $channels ] unless ref( $channels ) eq 'ARRAY';
|
||||
|
||||
if( $servers ) {
|
||||
$servers = [ $servers ] unless ref( $servers ) eq 'ARRAY';
|
||||
} else {
|
||||
$servers = [ undef ];
|
||||
}
|
||||
|
||||
my $num_done;
|
||||
my $old_ctx = Xchat::get_context();
|
||||
for my $server ( @$servers ) {
|
||||
for my $channel ( @$channels ) {
|
||||
if( Xchat::set_context( $channel, $server ) ) {
|
||||
$cb->();
|
||||
$num_done++
|
||||
}
|
||||
}
|
||||
}
|
||||
Xchat::set_context( $old_ctx );
|
||||
return $num_done;
|
||||
}
|
||||
|
||||
sub print {
|
||||
my $text = shift @_;
|
||||
return "" unless defined $text;
|
||||
if( ref( $text ) eq 'ARRAY' ) {
|
||||
if( $, ) {
|
||||
$text = join $, , @$text;
|
||||
} else {
|
||||
$text = join "", @$text;
|
||||
}
|
||||
}
|
||||
|
||||
return _do_for_each(
|
||||
sub { Xchat::Internal::print( $text ); },
|
||||
@_
|
||||
);
|
||||
}
|
||||
|
||||
sub printf {
|
||||
my $format = shift;
|
||||
Xchat::print( sprintf( $format, @_ ) );
|
||||
}
|
||||
|
||||
# make Xchat::prnt() and Xchat::prntf() as aliases for Xchat::print() and
|
||||
# Xchat::printf(), mainly useful when these functions are exported
|
||||
sub prnt {
|
||||
goto &Xchat::print;
|
||||
}
|
||||
|
||||
sub prntf {
|
||||
goto &Xchat::printf;
|
||||
}
|
||||
|
||||
sub command {
|
||||
my $command = shift;
|
||||
return "" unless defined $command;
|
||||
my @commands;
|
||||
|
||||
if( ref( $command ) eq 'ARRAY' ) {
|
||||
@commands = @$command;
|
||||
} else {
|
||||
@commands = ($command);
|
||||
}
|
||||
|
||||
return _do_for_each(
|
||||
sub { Xchat::Internal::command( $_ ) foreach @commands },
|
||||
@_
|
||||
);
|
||||
}
|
||||
|
||||
sub commandf {
|
||||
my $format = shift;
|
||||
Xchat::command( sprintf( $format, @_ ) );
|
||||
}
|
||||
|
||||
sub set_context {
|
||||
my $context;
|
||||
if( @_ == 2 ) {
|
||||
my ($channel, $server) = @_;
|
||||
$context = Xchat::find_context( $channel, $server );
|
||||
} elsif( @_ == 1 ) {
|
||||
if( defined $_[0] && $_[0] =~ /^\d+$/ ) {
|
||||
$context = $_[0];
|
||||
} else {
|
||||
$context = Xchat::find_context( $_[0] );
|
||||
}
|
||||
} elsif( @_ == 0 ) {
|
||||
$context = Xchat::find_context();
|
||||
}
|
||||
return $context ? Xchat::Internal::set_context( $context ) : 0;
|
||||
}
|
||||
|
||||
sub get_info {
|
||||
my $id = shift;
|
||||
my $info;
|
||||
|
||||
if( defined( $id ) ) {
|
||||
if( grep { $id eq $_ } qw(state_cursor id) ) {
|
||||
$info = Xchat::get_prefs( $id );
|
||||
} else {
|
||||
$info = Xchat::Internal::get_info( $id );
|
||||
}
|
||||
}
|
||||
return $info;
|
||||
}
|
||||
|
||||
sub user_info {
|
||||
my $nick = Xchat::strip_code(shift @_ || Xchat::get_info( "nick" ));
|
||||
my $user;
|
||||
for (Xchat::get_list( "users" ) ) {
|
||||
if ( Xchat::nickcmp( $_->{nick}, $nick ) == 0 ) {
|
||||
$user = $_;
|
||||
last;
|
||||
}
|
||||
}
|
||||
return $user;
|
||||
}
|
||||
|
||||
sub context_info {
|
||||
my $ctx = shift @_ || Xchat::get_context;
|
||||
my $old_ctx = Xchat::get_context;
|
||||
my @fields = (
|
||||
qw(away channel charset host id inputbox libdirfs modes network),
|
||||
qw(nick nickserv server topic version win_ptr win_status),
|
||||
qw(xchatdir xchatdirfs state_cursor),
|
||||
);
|
||||
|
||||
if( Xchat::set_context( $ctx ) ) {
|
||||
my %info;
|
||||
for my $field ( @fields ) {
|
||||
$info{$field} = Xchat::get_info( $field );
|
||||
}
|
||||
|
||||
my $ctx_info = Xchat::Internal::context_info;
|
||||
@info{keys %$ctx_info} = values %$ctx_info;
|
||||
|
||||
Xchat::set_context( $old_ctx );
|
||||
return %info if wantarray;
|
||||
return \%info;
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
sub get_list {
|
||||
unless( grep { $_[0] eq $_ } qw(channels dcc ignore notify users networks) ) {
|
||||
Carp::carp( "'$_[0]' does not appear to be a valid list name" );
|
||||
}
|
||||
if( $_[0] eq 'networks' ) {
|
||||
return Xchat::List::Network->get();
|
||||
} else {
|
||||
return Xchat::Internal::get_list( $_[0] );
|
||||
}
|
||||
}
|
||||
|
||||
sub strip_code {
|
||||
my $pattern = qr<
|
||||
\cB| #Bold
|
||||
\cC\d{0,2}(?:,\d{1,2})?| #Color
|
||||
\e\[(?:\d{1,2}(?:;\d{1,2})*)?m| # ANSI color code
|
||||
\cG| #Beep
|
||||
\cO| #Reset
|
||||
\cV| #Reverse
|
||||
\c_ #Underline
|
||||
>x;
|
||||
|
||||
if( defined wantarray ) {
|
||||
my $msg = shift;
|
||||
$msg =~ s/$pattern//g;
|
||||
return $msg;
|
||||
} else {
|
||||
$_[0] =~ s/$pattern//g if defined $_[0];
|
||||
}
|
||||
}
|
||||
|
||||
} # end of Xchat package
|
||||
|
||||
{
|
||||
package Xchat::Embed;
|
||||
use strict;
|
||||
use warnings;
|
||||
# list of loaded scripts keyed by their package names
|
||||
our %scripts;
|
||||
|
||||
sub load {
|
||||
my $file = expand_homedir( shift @_ );
|
||||
my $package = file2pkg( $file );
|
||||
|
||||
if( exists $scripts{$package} ) {
|
||||
my $pkg_info = pkg_info( $package );
|
||||
my $filename = File::Basename::basename( $pkg_info->{filename} );
|
||||
Xchat::printf(
|
||||
qq{'%s' already loaded from '%s'.\n},
|
||||
$filename, $pkg_info->{filename}
|
||||
);
|
||||
Xchat::print(
|
||||
'If this is a different script then it rename and try '.
|
||||
'loading it again.'
|
||||
);
|
||||
return 2;
|
||||
}
|
||||
|
||||
if( open my $source_handle, $file ) {
|
||||
my $source = do {local $/; <$source_handle>};
|
||||
close $source_handle;
|
||||
# we shouldn't care about things after __END__
|
||||
$source =~ s/^__END__.*//ms;
|
||||
|
||||
if(
|
||||
my @replacements = $source =~
|
||||
m/^\s*package ((?:[^\W:]+(?:::)?)+)\s*?;/mg
|
||||
) {
|
||||
|
||||
if ( @replacements > 1 ) {
|
||||
Xchat::print(
|
||||
"Too many package defintions, only 1 is allowed\n"
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
|
||||
my $original_package = shift @replacements;
|
||||
|
||||
# remove original package declaration
|
||||
$source =~ s/^(package $original_package\s*;)/#$1/m;
|
||||
|
||||
# fixes things up for code calling subs with fully qualified names
|
||||
$source =~ s/${original_package}:://g;
|
||||
}
|
||||
|
||||
# this must come before the eval or the filename will not be found in
|
||||
# Xchat::register
|
||||
$scripts{$package}{filename} = $file;
|
||||
$scripts{$package}{loaded_at} = Time::HiRes::time();
|
||||
|
||||
my $full_path = File::Spec->rel2abs( $file );
|
||||
$source =~ s/^/#line 1 "$full_path"\n\x7Bpackage $package;/;
|
||||
|
||||
# make sure we add the closing } even if the last line is a comment
|
||||
if( $source =~ /^#.*\Z/m ) {
|
||||
$source =~ s/^(?=#.*\Z)/\x7D/m;
|
||||
} else {
|
||||
$source =~ s/\Z/\x7D/;
|
||||
}
|
||||
|
||||
_do_eval( $source );
|
||||
|
||||
unless( exists $scripts{$package}{gui_entry} ) {
|
||||
$scripts{$package}{gui_entry} =
|
||||
Xchat::Internal::register(
|
||||
"", "unknown", "", $file
|
||||
);
|
||||
}
|
||||
|
||||
if( $@ ) {
|
||||
# something went wrong
|
||||
$@ =~ s/\(eval \d+\)/$file/g;
|
||||
Xchat::print( "Error loading '$file':\n$@\n" );
|
||||
# make sure the script list doesn't contain false information
|
||||
unload( $scripts{$package}{filename} );
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
Xchat::print( "Error opening '$file': $!\n" );
|
||||
return 2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub _do_eval {
|
||||
no strict;
|
||||
no warnings;
|
||||
eval $_[0];
|
||||
}
|
||||
|
||||
sub unload {
|
||||
my $file = shift @_;
|
||||
my $package = file2pkg( $file );
|
||||
my $pkg_info = pkg_info( $package );
|
||||
|
||||
if( $pkg_info ) {
|
||||
# take care of the shutdown callback
|
||||
if( exists $pkg_info->{shutdown} ) {
|
||||
# allow incorrectly written scripts to be unloaded
|
||||
eval {
|
||||
if( ref $pkg_info->{shutdown} eq 'CODE' ) {
|
||||
$pkg_info->{shutdown}->();
|
||||
} elsif ( $pkg_info->{shutdown} ) {
|
||||
no strict 'refs';
|
||||
&{$pkg_info->{shutdown}};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if( exists $pkg_info->{hooks} ) {
|
||||
for my $hook ( @{$pkg_info->{hooks}} ) {
|
||||
Xchat::unhook( $hook, $package );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( exists $pkg_info->{gui_entry} ) {
|
||||
plugingui_remove( $pkg_info->{gui_entry} );
|
||||
}
|
||||
|
||||
Symbol::delete_package( $package );
|
||||
delete $scripts{$package};
|
||||
return Xchat::EAT_ALL;
|
||||
} else {
|
||||
Xchat::print( qq{"$file" is not loaded.\n} );
|
||||
return Xchat::EAT_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
sub unload_all {
|
||||
for my $package ( keys %scripts ) {
|
||||
unload( $scripts{$package}->{filename} );
|
||||
}
|
||||
|
||||
return Xchat::EAT_ALL;
|
||||
}
|
||||
|
||||
sub reload {
|
||||
my $file = shift @_;
|
||||
my $package = file2pkg( $file );
|
||||
my $pkg_info = pkg_info( $package );
|
||||
my $fullpath = $file;
|
||||
|
||||
if( $pkg_info ) {
|
||||
$fullpath = $pkg_info->{filename};
|
||||
unload( $file );
|
||||
}
|
||||
|
||||
load( $fullpath );
|
||||
return Xchat::EAT_ALL;
|
||||
}
|
||||
|
||||
sub reload_all {
|
||||
my @dirs = Xchat::get_info( "xchatdirfs" ) || Xchat::get_info( "xchatdir" );
|
||||
push @dirs, File::Spec->catdir( $dirs[0], "plugins" );
|
||||
for my $dir ( @dirs ) {
|
||||
my $auto_load_glob = File::Spec->catfile( $dir, "*.pl" );
|
||||
my @scripts = map { $_->{filename} }
|
||||
sort { $a->{loaded_at} <=> $b->{loaded_at} } values %scripts;
|
||||
push @scripts, File::Glob::bsd_glob( $auto_load_glob );
|
||||
|
||||
my %seen;
|
||||
@scripts = grep { !$seen{ $_ }++ } @scripts;
|
||||
|
||||
unload_all();
|
||||
for my $script ( @scripts ) {
|
||||
if( !pkg_info( file2pkg( $script ) ) ) {
|
||||
load( $script );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#sub auto_load {
|
||||
# my $dir = Xchat::get_info( "xchatdirfs" ) || Xchat::get_info( "xchatdir" );
|
||||
#
|
||||
# if( opendir my $dir_handle, $dir ) {
|
||||
# my @files = readdir $dir_handle;
|
||||
#
|
||||
# for( @files ) {
|
||||
# my $fullpath = File::Spec->catfile( $dir, $_ );
|
||||
# load( $fullpath ) if $fullpath =~ m/\.pl$/i;
|
||||
# }
|
||||
#
|
||||
# closedir $dir_handle;
|
||||
# }
|
||||
#}
|
||||
|
||||
sub expand_homedir {
|
||||
my $file = shift @_;
|
||||
|
||||
if ( $^O eq "MSWin32" ) {
|
||||
$file =~ s/^~/$ENV{USERPROFILE}/;
|
||||
} else {
|
||||
$file =~ s{^~}{
|
||||
(getpwuid($>))[7] || $ENV{HOME} || $ENV{LOGDIR}
|
||||
}ex;
|
||||
}
|
||||
return $file;
|
||||
}
|
||||
|
||||
sub file2pkg {
|
||||
my $string = File::Basename::basename( shift @_ );
|
||||
$string =~ s/\.pl$//i;
|
||||
$string =~ s|([^A-Za-z0-9/])|'_'.unpack("H*",$1)|eg;
|
||||
return "Xchat::Script::" . $string;
|
||||
}
|
||||
|
||||
sub pkg_info {
|
||||
my $package = shift @_;
|
||||
return $scripts{$package};
|
||||
}
|
||||
|
||||
sub find_external_pkg {
|
||||
my $level = 1;
|
||||
|
||||
while( my @frame = caller( $level ) ) {
|
||||
return @frame if $frame[0] !~ /^Xchat/;
|
||||
$level++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sub find_pkg {
|
||||
my $level = 1;
|
||||
|
||||
while( my ($package, $file, $line) = caller( $level ) ) {
|
||||
return $package if $package =~ /^Xchat::Script::/;
|
||||
$level++;
|
||||
}
|
||||
|
||||
my @frame = find_external_pkg();
|
||||
my $location;
|
||||
|
||||
if( $frame[0] or $frame[1] ) {
|
||||
$location = $frame[1] ? $frame[1] : "package $frame[0]";
|
||||
$location .= " line $frame[2]";
|
||||
} else {
|
||||
$location = "unknown location";
|
||||
}
|
||||
|
||||
die "Unable to determine which script this hook belongs to. at $location\n";
|
||||
|
||||
}
|
||||
|
||||
sub fix_callback {
|
||||
my ($package, $callback) = @_;
|
||||
|
||||
unless( ref $callback ) {
|
||||
# change the package to the correct one in case it was hardcoded
|
||||
$callback =~ s/^.*:://;
|
||||
$callback = qq[${package}::$callback];
|
||||
|
||||
no strict 'subs';
|
||||
$callback = \&{$callback};
|
||||
}
|
||||
|
||||
return $callback;
|
||||
}
|
||||
} # end of Xchat::Embed package
|
||||
|
||||
{
|
||||
package Xchat::List::Network;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Storable qw(dclone);
|
||||
my $last_modified;
|
||||
my @servers;
|
||||
|
||||
sub get {
|
||||
my $server_file = Xchat::get_info( "xchatdirfs" ) . "/servlist_.conf";
|
||||
|
||||
# recreate the list only if the server list file has changed
|
||||
if( -f $server_file &&
|
||||
(!defined $last_modified || $last_modified != -M $server_file ) ) {
|
||||
$last_modified = -M _;
|
||||
|
||||
if( open my $fh, "<", $server_file ) {
|
||||
local $/ = "\n\n";
|
||||
while( my $record = <$fh> ) {
|
||||
chomp $record;
|
||||
next if $record =~ /^v=/; # skip the version line
|
||||
push @servers, Xchat::List::Network::Entry::parse( $record );
|
||||
}
|
||||
} else {
|
||||
warn "Unable to open '$server_file': $!";
|
||||
}
|
||||
}
|
||||
|
||||
my $clone = dclone( \@servers );
|
||||
return @$clone;
|
||||
}
|
||||
} # end of Xchat::List::Network
|
||||
|
||||
{
|
||||
package Xchat::List::Network::Entry;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my %key_for = (
|
||||
I => "irc_nick1",
|
||||
i => "irc_nick2",
|
||||
U => "irc_user_name",
|
||||
R => "irc_real_name",
|
||||
P => "server_password",
|
||||
B => "nickserv_password",
|
||||
N => "network",
|
||||
D => "selected",
|
||||
E => "encoding",
|
||||
);
|
||||
my $letter_key_re = join "|", keys %key_for;
|
||||
|
||||
sub parse {
|
||||
my $data = shift;
|
||||
my $entry = {
|
||||
irc_nick1 => undef,
|
||||
irc_nick2 => undef,
|
||||
irc_user_name => undef,
|
||||
irc_real_name => undef,
|
||||
server_password => undef,
|
||||
|
||||
# the order of the channels need to be maintained
|
||||
# list of { channel => .., key => ... }
|
||||
autojoins => Xchat::List::Network::AutoJoin->new( '' ),
|
||||
connect_commands => [],
|
||||
flags => {},
|
||||
selected => undef,
|
||||
encoding => undef,
|
||||
servers => [],
|
||||
nickserv_password => undef,
|
||||
network => undef,
|
||||
};
|
||||
|
||||
my @fields = split /\n/, $data;
|
||||
chomp @fields;
|
||||
|
||||
for my $field ( @fields ) {
|
||||
SWITCH: for ( $field ) {
|
||||
/^($letter_key_re)=(.*)/ && do {
|
||||
$entry->{ $key_for{ $1 } } = $2;
|
||||
last SWITCH;
|
||||
};
|
||||
|
||||
/^J.(.*)/ && do {
|
||||
$entry->{ autojoins } =
|
||||
Xchat::List::Network::AutoJoin->new( $1 );
|
||||
};
|
||||
|
||||
/^F.(.*)/ && do {
|
||||
$entry->{ flags } = parse_flags( $1 );
|
||||
};
|
||||
|
||||
/^S.(.+)/ && do {
|
||||
push @{$entry->{servers}}, parse_server( $1 );
|
||||
};
|
||||
|
||||
/^C.(.+)/ && do {
|
||||
push @{$entry->{connect_commands}}, $1;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
# $entry->{ autojoins } = $entry->{ autojoin_channels };
|
||||
return $entry;
|
||||
}
|
||||
|
||||
sub parse_flags {
|
||||
my $value = shift || 0;
|
||||
my %flags;
|
||||
|
||||
$flags{ "cycle" } = $value & 1 ? 1 : 0;
|
||||
$flags{ "use_global" } = $value & 2 ? 1 : 0;
|
||||
$flags{ "use_ssl" } = $value & 4 ? 1 : 0;
|
||||
$flags{ "autoconnect" } = $value & 8 ? 1 : 0;
|
||||
$flags{ "use_proxy" } = $value & 16 ? 1 : 0;
|
||||
$flags{ "allow_invalid" } = $value & 32 ? 1 : 0;
|
||||
|
||||
return \%flags;
|
||||
}
|
||||
|
||||
sub parse_server {
|
||||
my $data = shift;
|
||||
if( $data ) {
|
||||
my ($host, $port) = split /\//, $data;
|
||||
unless( $port ) {
|
||||
my @parts = split /:/, $host;
|
||||
|
||||
# if more than 2 then we are probably dealing with a IPv6 address
|
||||
# if less than 2 then no port was specified
|
||||
if( @parts == 2 ) {
|
||||
$port = $parts[1];
|
||||
}
|
||||
}
|
||||
|
||||
$port ||= 6667;
|
||||
return { host => $host, port => $port };
|
||||
}
|
||||
}
|
||||
|
||||
} # end of Xchat::List::Network::Entry
|
||||
|
||||
{
|
||||
package Xchat::List::Network::AutoJoin;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use overload
|
||||
# '%{}' => \&as_hash,
|
||||
# '@{}' => \&as_array,
|
||||
'""' => 'as_string',
|
||||
'0+' => 'as_bool';
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $line = shift;
|
||||
|
||||
my @autojoins;
|
||||
|
||||
if ( $line ) {
|
||||
my ( $channels, $keys ) = split / /, $line, 2;
|
||||
my @channels = split /,/, $channels;
|
||||
my @keys = split /,/, ($keys || '');
|
||||
|
||||
for my $channel ( @channels ) {
|
||||
my $key = shift @keys;
|
||||
$key = '' unless defined $key;
|
||||
|
||||
push @autojoins, {
|
||||
channel => $channel,
|
||||
key => $key,
|
||||
};
|
||||
}
|
||||
}
|
||||
return bless \@autojoins, $class;
|
||||
}
|
||||
|
||||
sub channels {
|
||||
my $self = shift;
|
||||
|
||||
if( wantarray ) {
|
||||
return map { $_->{channel} } @$self;
|
||||
} else {
|
||||
return scalar @$self;
|
||||
}
|
||||
}
|
||||
|
||||
sub keys {
|
||||
my $self = shift;
|
||||
return map { $_->{key} } @$self ;
|
||||
|
||||
}
|
||||
|
||||
sub pairs {
|
||||
my $self = shift;
|
||||
|
||||
my @channels = $self->channels;
|
||||
my @keys = $self->keys;
|
||||
|
||||
my @pairs = map { $_ => shift @keys } @channels;
|
||||
}
|
||||
|
||||
sub as_hash {
|
||||
my $self = shift;
|
||||
return +{ $self->pairs };
|
||||
}
|
||||
|
||||
sub as_string {
|
||||
my $self = shift;
|
||||
return join " ",
|
||||
join( ",", $self->channels ),
|
||||
join( ",", $self->keys );
|
||||
}
|
||||
|
||||
sub as_array {
|
||||
my $self = shift;
|
||||
return [ map { \%$_ } @$self ];
|
||||
}
|
||||
|
||||
sub as_bool {
|
||||
my $self = shift;
|
||||
return $self->channels ? 1 : "";
|
||||
}
|
||||
|
||||
} # end of Xchat::Server::AutoJoin
|
||||
|
||||
1;
|
|
@ -0,0 +1,463 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
use Xchat ();
|
||||
use File::Spec ();
|
||||
use File::Basename qw(fileparse);
|
||||
|
||||
# if the last time you addressed someone was greater than this many minutes
|
||||
# ago, ignore it
|
||||
# this avoids having people you have talked to a long time ago coming up too
|
||||
# early in the completion list
|
||||
# Setting this to 0 will disable the check which is effectively the same as
|
||||
# setting it to infinity
|
||||
my $last_use_threshold = 10; # 10 minutes
|
||||
|
||||
# added to the front of a completion the same way as a suffix, only if
|
||||
# the word is at the beginning of the line
|
||||
my $prefix = '';
|
||||
|
||||
my $path_completion = 1;
|
||||
my $base_path = '';
|
||||
|
||||
Xchat::register(
|
||||
"Tab Completion", "1.0303_01", "Alternative tab completion behavior"
|
||||
);
|
||||
Xchat::hook_print( "Key Press", \&complete );
|
||||
Xchat::hook_print( "Close Context", \&close_context );
|
||||
Xchat::hook_print( "Focus Tab", \&focus_tab );
|
||||
Xchat::hook_print( "Part", \&clean_selected );
|
||||
Xchat::hook_print( "Part with Reason", \&clean_selected );
|
||||
Xchat::hook_command( "", \&track_selected );
|
||||
|
||||
sub SHIFT() { 1 }
|
||||
sub CTRL() { 4 }
|
||||
sub ALT() { 8 }
|
||||
|
||||
my %completions;
|
||||
my %last_visit;
|
||||
my %selected;
|
||||
my %escape_map = (
|
||||
'[' => qr![\[{]!,
|
||||
'{' => qr![\[{]!,
|
||||
'}' => qr![\]}]!,
|
||||
']' => qr![\]}]!,
|
||||
'\\' => qr![\\\|]!,
|
||||
'|' => qr![\\\|]!,
|
||||
'.' => qr!\.!,
|
||||
'^' => qr!\^!,
|
||||
'$' => qr!\$!,
|
||||
'*' => qr!\*!,
|
||||
'+' => qr!\+!,
|
||||
'?' => qr!\?!,
|
||||
'(' => qr!\(!,
|
||||
')' => qr!\)!,
|
||||
'-' => qr!\-!,
|
||||
);
|
||||
|
||||
my $escapes = join "", keys %escape_map;
|
||||
$escapes = qr/[\Q$escapes\E]/;
|
||||
|
||||
sub complete {
|
||||
# if $_[0][0] contains the value of the key pressed
|
||||
# $_[0][1] contains modifiers
|
||||
# the value for tab is 0xFF09
|
||||
# the value for shift-tab(Left Tab) is 0xFE20
|
||||
# we don't care about other keys
|
||||
|
||||
return Xchat::EAT_NONE unless $_[0][0] == 0xFF09 || $_[0][0] == 0xFE20;
|
||||
return Xchat::EAT_NONE if $_[0][0] == 0xFF09 && $_[0][1] & (CTRL|ALT|SHIFT);
|
||||
|
||||
# we also don't care about other kinds of tabs besides channel tabs
|
||||
# return Xchat::EAT_NONE unless Xchat::context_info()->{type} == 2;
|
||||
|
||||
# In case some other script decides to be stupid and alter the base index
|
||||
local $[ = 0;
|
||||
|
||||
# loop backwards for shift+tab
|
||||
my $delta = $_[0][1] & SHIFT ? -1 : 1;
|
||||
my $context = Xchat::get_context;
|
||||
$completions{$context} ||= {};
|
||||
|
||||
my $completions = $completions{$context};
|
||||
$completions->{pos} ||= -1;
|
||||
|
||||
my $suffix = Xchat::get_prefs( "completion_suffix" );
|
||||
$suffix =~ s/^\s+//;
|
||||
|
||||
my $input = Xchat::get_info( "inputbox" );
|
||||
my $cursor_pos = Xchat::get_info( "state_cursor" );
|
||||
my $left = substr( $input, 0, $cursor_pos );
|
||||
my $right = substr( $input, $cursor_pos );
|
||||
my $length = length $left;
|
||||
|
||||
# trim spaces from the end of $left to avoid grabbing the wrong word
|
||||
# this is mainly needed for completion at the very beginning where a space
|
||||
# is added after the completion
|
||||
$left =~ s/\s+$//;
|
||||
|
||||
# always add one to the index because
|
||||
# 1) if a space is found we want the position after it
|
||||
# 2) if a space isn't found then we get back -1
|
||||
my $word_start = rindex( $left, " " ) + 1;
|
||||
my $word = substr( $left, $word_start );
|
||||
$left = substr( $left, 0, -length $word );
|
||||
|
||||
my $command_char = Xchat::get_prefs( "input_command_char" );
|
||||
# ignore commands
|
||||
if( ($word !~ m{^[${command_char}]})
|
||||
or ( $word =~ m{^[${command_char}]} and $word_start != 0 ) ) {
|
||||
|
||||
if( $cursor_pos == length $input # end of input box
|
||||
# not a valid nick char
|
||||
&& $input =~ /(?<![\x41-\x5A\x61-\x7A\x30-\x39\x5B-\x60\x7B-\x7D-])$/
|
||||
&& $cursor_pos != $completions->{pos} # not continuing a completion
|
||||
&& $word !~ m{^(?:[&#/~]|[[:alpha:]]:\\)} ) { # not a channel or path
|
||||
$word_start = $cursor_pos;
|
||||
$left = $input;
|
||||
$length = length $length;
|
||||
$right = "";
|
||||
$word = "";
|
||||
}
|
||||
|
||||
if( $word_start == 0 && $prefix && $word =~ /^\Q$prefix/ ) {
|
||||
$word =~ s/^\Q$prefix//;
|
||||
}
|
||||
|
||||
my $completed; # this is going to be the "completed" word
|
||||
|
||||
# for parital completions and channel names so a : isn't added
|
||||
my $skip_suffix = ($word =~ /^[&#]/) ? 1 : 0;
|
||||
|
||||
# continuing from a previous completion
|
||||
if(
|
||||
exists $completions->{matches} && @{$completions->{matches}}
|
||||
&& $cursor_pos == $completions->{pos}
|
||||
&& $word =~ /^\Q$completions->{matches}[$completions->{index}]/
|
||||
) {
|
||||
$completions->{index} += $delta;
|
||||
|
||||
if( $completions->{index} < 0 ) {
|
||||
$completions->{index} += @{$completions->{matches}};
|
||||
} else {
|
||||
$completions->{index} %= @{$completions->{matches}};
|
||||
}
|
||||
|
||||
$completed = $completions->{matches}[ $completions->{index} ];
|
||||
} else {
|
||||
|
||||
if( $word =~ /^[&#]/ ) {
|
||||
# channel name completion
|
||||
$completions->{matches} = [ matching_channels( $word ) ];
|
||||
} elsif( $word =~ m{^(?:~|/|[[:alpha:]]:\\)} ) {
|
||||
# file name completion
|
||||
$completions->{matches} = [ matching_files( $word ) ];
|
||||
$skip_suffix = 1;
|
||||
} else {
|
||||
# nick completion
|
||||
# fix $word so { equals [, ] equals }, \ equals |
|
||||
# and escape regex metacharacters
|
||||
$word =~ s/($escapes)/$escape_map{$1}/g;
|
||||
|
||||
$completions->{matches} = [ matching_nicks( $word ) ];
|
||||
}
|
||||
$completions->{index} = 0;
|
||||
|
||||
$completed = $completions->{matches}[ $completions->{index} ];
|
||||
}
|
||||
|
||||
my $completion_amount = Xchat::get_prefs( "completion_amount" );
|
||||
|
||||
# don't cycle if the number of possible completions is greater than
|
||||
# completion_amount
|
||||
if(
|
||||
@{$completions->{matches}} > $completion_amount
|
||||
&& @{$completions->{matches}} != 1
|
||||
) {
|
||||
# don't print if we tabbed in the beginning and the list of possible
|
||||
# completions includes all nicks in the channel
|
||||
if( @{$completions->{matches}} < Xchat::get_list("users") ) {
|
||||
Xchat::print( join " ", @{$completions->{matches}}, "\n" );
|
||||
}
|
||||
|
||||
$completed = lcs( $completions->{matches} );
|
||||
$skip_suffix = 1;
|
||||
}
|
||||
|
||||
if( $completed ) {
|
||||
|
||||
if( $word_start == 0 && !$skip_suffix ) {
|
||||
# at the start of the line append completion suffix
|
||||
Xchat::command( "settext $prefix$completed$suffix$right");
|
||||
$completions->{pos} = length( "$prefix$completed$suffix" );
|
||||
} else {
|
||||
Xchat::command( "settext $left$completed$right" );
|
||||
$completions->{pos} = length( "$left$completed" );
|
||||
}
|
||||
|
||||
Xchat::command( "setcursor $completions->{pos}" );
|
||||
}
|
||||
|
||||
=begin
|
||||
# debugging stuff
|
||||
local $, = " ";
|
||||
my $input_length = length $input;
|
||||
Xchat::print [
|
||||
qq{input[$input]},
|
||||
qq{input_length[$input_length]},
|
||||
qq{cursor[$cursor_pos]},
|
||||
qq{start[$word_start]},
|
||||
qq{length[$length]},
|
||||
qq{left[$left]},
|
||||
qq{word[$word]}, qq{[right[$right]},
|
||||
qq{completed[$completed]},
|
||||
qq{pos[$completions->{pos}]},
|
||||
];
|
||||
use Data::Dumper;
|
||||
local $Data::Dumper::Indent = 0;
|
||||
Xchat::print Dumper $completions->{matches};
|
||||
=cut
|
||||
|
||||
return Xchat::EAT_ALL;
|
||||
} else {
|
||||
return Xchat::EAT_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# all channels starting with $word
|
||||
sub matching_channels {
|
||||
my $word = shift;
|
||||
|
||||
# for use in compare_channels();
|
||||
our $current_chan;
|
||||
local $current_chan = Xchat::get_info( "channel" );
|
||||
|
||||
my $conn_id = Xchat::get_info( "id" );
|
||||
$word =~ s/^[&#]+//;
|
||||
|
||||
return
|
||||
map { $_->[1]->{channel} }
|
||||
sort compare_channels map {
|
||||
my $chan = $_->{channel};
|
||||
$chan =~ s/^[#&]+//;
|
||||
|
||||
# comparisons will be done based only on the name
|
||||
# matching name, same connection, only channels
|
||||
$chan =~ /^$word/ && $_->{id} == $conn_id ?
|
||||
[ $chan, $_ ] :
|
||||
()
|
||||
} channels();
|
||||
}
|
||||
|
||||
sub channels {
|
||||
return grep { $_->{type} == 2 } Xchat::get_list( "channels" );
|
||||
}
|
||||
|
||||
sub compare_channels {
|
||||
# package variable, value set in matching_channels()
|
||||
our $current_chan;
|
||||
|
||||
# turn off warnings generated from channels that have not yet been visited
|
||||
# since the script was loaded
|
||||
no warnings "uninitialized";
|
||||
|
||||
# the current channel is always first, then ordered by most recently visited
|
||||
return
|
||||
$a->[1]{channel} eq $current_chan ? -1 :
|
||||
$b->[1]{channel} eq $current_chan ? 1 :
|
||||
$last_visit{ $b->[1]{context} } <=> $last_visit{ $a->[1]{context} }
|
||||
|| $a->[1]{channel} cmp $b->[1]{channel};
|
||||
|
||||
}
|
||||
|
||||
sub matching_nicks {
|
||||
my $word = shift;
|
||||
|
||||
# for use in compare_nicks()
|
||||
our ($my_nick, $selections, $now);
|
||||
local $my_nick = Xchat::get_info( "nick" );
|
||||
local $selections = $selected{ Xchat::get_context() };
|
||||
local $now = time;
|
||||
|
||||
return
|
||||
map { $_->{nick} }
|
||||
sort compare_nicks grep {
|
||||
$_->{nick} =~ /^$word/i
|
||||
} Xchat::get_list( "users" )
|
||||
|
||||
}
|
||||
|
||||
sub max {
|
||||
return unless @_;
|
||||
my $max = shift;
|
||||
for(@_) {
|
||||
$max = $_ if $_ > $max;
|
||||
}
|
||||
return $max;
|
||||
}
|
||||
|
||||
sub compare_times {
|
||||
# package variables set in matching_nicks()
|
||||
our $selections;
|
||||
our $now;
|
||||
|
||||
for my $nick ( $a->{nick}, $b->{nick} ) {
|
||||
# turn off the warnings that get generated from users who have yet
|
||||
# to speak since the script was loaded
|
||||
no warnings "uninitialized";
|
||||
|
||||
if( $last_use_threshold
|
||||
&& (( $now - $selections->{$nick}) > ($last_use_threshold * 60)) ) {
|
||||
delete $selections->{ $nick }
|
||||
}
|
||||
}
|
||||
my $a_time = $selections->{ $a->{nick} } || 0 ;
|
||||
my $b_time = $selections->{ $b->{nick} } || 0 ;
|
||||
|
||||
if( $a_time || $b_time ) {
|
||||
return $b_time <=> $a_time;
|
||||
} elsif( !$a_time && !$b_time ) {
|
||||
return $b->{lasttalk} <=> $a->{lasttalk};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sub compare_nicks {
|
||||
# more package variables, value set in matching_nicks()
|
||||
our $my_nick;
|
||||
|
||||
# our own nick is always last, then ordered by the people we spoke to most
|
||||
# recently and the people who were speaking most recently
|
||||
return
|
||||
$a->{nick} eq $my_nick ? 1 :
|
||||
$b->{nick} eq $my_nick ? -1 :
|
||||
compare_times()
|
||||
|| Xchat::nickcmp( $a->{nick}, $b->{nick} );
|
||||
|
||||
# $selections->{ $b->{nick} } <=> $selections->{ $a->{nick} }
|
||||
# || $b->{lasttalk} <=> $a->{lasttalk}
|
||||
|
||||
}
|
||||
|
||||
sub matching_files {
|
||||
my $word = shift;
|
||||
|
||||
my $path = expand_tilde( $word );
|
||||
my ($file, $dir) = fileparse( $path );
|
||||
|
||||
if( opendir my $dir_handle, $dir ) {
|
||||
my @files;
|
||||
|
||||
if( $file ) {
|
||||
@files = grep { /^\Q$file/ } readdir $dir_handle;
|
||||
} else {
|
||||
@files = readdir $dir_handle;
|
||||
}
|
||||
|
||||
return sort map { File::Spec->catfile( $dir, $_ ) }
|
||||
grep { !/^\.{1,2}$/ } @files;
|
||||
} else {
|
||||
return ();
|
||||
}
|
||||
}
|
||||
|
||||
# Remove completion related data for tabs that are closed
|
||||
sub close_context {
|
||||
my $context = Xchat::get_context;
|
||||
delete $completions{$context};
|
||||
delete $last_visit{$context};
|
||||
return Xchat::EAT_NONE;
|
||||
}
|
||||
|
||||
# track visit times
|
||||
sub focus_tab {
|
||||
$last_visit{Xchat::get_context()} = time();
|
||||
}
|
||||
|
||||
# keep track of the last time a message was addressed to someone
|
||||
# a message is considered addressed to someone if their nick is used followed
|
||||
# by the completion suffix
|
||||
sub track_selected {
|
||||
my $input = $_[1][0];
|
||||
return Xchat::EAT_NONE unless defined $input;
|
||||
|
||||
my $suffix = Xchat::get_prefs( "completion_suffix" );
|
||||
for( grep defined, $input =~ /^(.+)\Q$suffix/, $_[0][0] ) {
|
||||
if( in_channel( $_ ) ) {
|
||||
$selected{Xchat::get_context()}{$_} = time();
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
return Xchat::EAT_NONE;
|
||||
}
|
||||
|
||||
# if a user is in the current channel
|
||||
# user_info() can also be used instead of the loop
|
||||
sub in_channel {
|
||||
my $target = shift;
|
||||
for my $nick ( nicks() ) {
|
||||
if( $nick eq $target ) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
# list of nicks in the current channel
|
||||
sub nicks {
|
||||
return map { $_->{nick} } Xchat::get_list( "users" );
|
||||
}
|
||||
|
||||
# remove people from the selected list when they leave the channel
|
||||
sub clean_selected {
|
||||
delete $selected{ Xchat::get_context() }{$_[0][0]};
|
||||
return Xchat::EAT_NONE;
|
||||
}
|
||||
|
||||
# Longest common substring
|
||||
# Used for partial completion when using non-cycling completion
|
||||
sub lcs {
|
||||
my @nicks = @{+shift};
|
||||
return "" if @nicks == 0;
|
||||
return $nicks[0] if @nicks == 1;
|
||||
|
||||
my $substring = shift @nicks;
|
||||
|
||||
while(@nicks) {
|
||||
$substring = common_string( $substring, shift @nicks );
|
||||
}
|
||||
|
||||
return $substring;
|
||||
}
|
||||
|
||||
sub common_string {
|
||||
my ($nick1, $nick2) = @_;
|
||||
my $index = 0;
|
||||
|
||||
$index++ while(
|
||||
($index < length $nick1) && ($index < length $nick2) &&
|
||||
lc(substr( $nick1, $index, 1 )) eq lc(substr( $nick2, $index, 1 ))
|
||||
);
|
||||
|
||||
|
||||
return substr( $nick1, 0, $index );
|
||||
}
|
||||
|
||||
sub expand_tilde {
|
||||
my $file = shift;
|
||||
|
||||
$file =~ s/^~/home_dir()/e;
|
||||
return $file;
|
||||
}
|
||||
|
||||
sub home_dir {
|
||||
return $base_path if $base_path;
|
||||
|
||||
if ( $^O eq "MSWin32" ) {
|
||||
return $ENV{USERPROFILE};
|
||||
} else {
|
||||
return ((getpwuid($>))[7] || $ENV{HOME} || $ENV{LOGDIR});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
sub header {
|
||||
my $file = shift;
|
||||
open my $input, "<", $file or die "Couldn't open '$file':$!";
|
||||
my @file = <$input>;
|
||||
close $file;
|
||||
return qq{"#line 1 \\"$file\\"\\n"\n}, toc(@file);
|
||||
}
|
||||
|
||||
sub toc {
|
||||
my @lines = @_;
|
||||
for( @lines ) {
|
||||
if( /^\s*$/s ) { $_ = qq{"\\n"\n}; next; }
|
||||
if( /^\s*#/ ) { $_ = qq{"\\n"\n}; next; }
|
||||
s/\\/\\\\/g; # double the number of \'s
|
||||
s/"/\\"/g;
|
||||
s/^\s*/"/;
|
||||
s/\n/\\n"\n/;
|
||||
}
|
||||
return @lines;
|
||||
}
|
||||
|
||||
for my $files ( [ "Xchat.pm", "xchat.pm.h" ], [ "IRC.pm", "irc.pm.h" ] ) {
|
||||
my ($input, $output) = @$files;
|
||||
|
||||
open my $header, ">", $output or die "Couldn't open '$output': $!";
|
||||
|
||||
print $header qq{#line 1 "$input"\n};
|
||||
print $header header( $input );
|
||||
|
||||
close $header;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,958 @@
|
|||
<?xml version="1.0" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>X-Chat 2 Perl Interface</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rev="made" href="mailto:khisanth@miyu.hopto.org" />
|
||||
<style type="text/css">
|
||||
.branch {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
li code {
|
||||
padding-right: 0.5em;
|
||||
}
|
||||
|
||||
p.example {
|
||||
background-color: #dddddd;
|
||||
width: 45em;
|
||||
padding: 0.5em;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
td > table {
|
||||
margin: 0.5em;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
td > table td {
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
.alert { color: #0000ff; }
|
||||
.basen { color: #007f00; }
|
||||
.bstring { color: #c9a7ff; }
|
||||
.char { color: #ff00ff; }
|
||||
.comment { color: #7f7f7f; }
|
||||
.datatype { color: #0000ff; }
|
||||
.decval { color: #00007f; }
|
||||
.error { color: #ff0000; }
|
||||
.float { color: #00007f; }
|
||||
.function { color: #007f00; }
|
||||
.istring { color: #ff0000; }
|
||||
.keyword { font-weight: bold; }
|
||||
.normal { }
|
||||
.operator { color: #ffa500; }
|
||||
.others { color: #b03060; }
|
||||
.regionmarker { color: #96b9ff; }
|
||||
.reserved { color: #9b30ff; }
|
||||
.string { color: #ff0000; }
|
||||
.variable { color: #0000ff; }
|
||||
.warning { color: #0000ff; }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body style="background-color: white">
|
||||
<table border="0" width="100%" cellspacing="0" cellpadding="3">
|
||||
<tr><td class="block" style="background-color: #cccccc" valign="middle">
|
||||
<big><strong><span class="block"> X-Chat 2 Perl Interface</span></strong></big>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
<!-- INDEX BEGIN -->
|
||||
<div>
|
||||
<p><a name="__index__"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><a href="#x_chat_2_perl_interface">X-Chat 2 Perl Interface</a></li>
|
||||
<li class="branch">
|
||||
<ul>
|
||||
<li><a href="#introduction">Introduction</a></li>
|
||||
<li><a href="#constants">Constants</a></li>
|
||||
<li class="branch">
|
||||
<ul>
|
||||
<li><a href="#priorities">Priorities</a></li>
|
||||
<li><a href="#return_values">Return values</a></li>
|
||||
<li class="branch">
|
||||
<ul>
|
||||
<li><a href="#timer_specific">Timer specific</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li><a href="#functions">Functions</a></li>
|
||||
<li class="branch">
|
||||
<ul>
|
||||
<li><a href="#xchat_register"><code>Xchat::register( $name, $version, [$description,[$callback]] )</code></a></li>
|
||||
<li><a href="#xchat_hook_server"><code>Xchat::hook_server( $message, $callback, [\%options] )</code></a></li>
|
||||
<li><a href="#xchat_hook_command"><code>Xchat::hook_command( $command, $callback, [\%options] )</code></a></li>
|
||||
<li><a href="#xchat_hook_print"><code>Xchat::hook_print( $event,$callback, [\%options] )</code></a></li>
|
||||
<li><a href="#xchat_hook_timer"><code>Xchat::hook_timer( $timeout,$callback, [\%options | $data] )</code></a></li>
|
||||
<li class="branch">
|
||||
<ul>
|
||||
<li><a href="#when_callbacks_are_invoked">When callbacks are invoked</a></li>
|
||||
<li><a href="#callback_arguments">Callback Arguments</a></li>
|
||||
<li><a href="#callback_return_values">Callback return values</a></li>
|
||||
<li><a href="#miscellaneous_hook_related_information">Miscellaneous Hook Related Information</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li><a href="#xchat_unhook"><code>Xchat::unhook( $hook )</code></a></li>
|
||||
<li><a href="#xchat_print"><code>Xchat::print( $text | \@lines, [$channel,[$server]] )</code></a></li>
|
||||
<li><a href="#xchat_printf"><code>Xchat::printf( $format, LIST )</code></a></li>
|
||||
<li><a href="#xchat_command"><code>Xchat::command( $command | \@commands, [$channel,[$server]] )</code></a></li>
|
||||
<li><a href="#xchat_commandf"><code>Xchat::commandf( $format, LIST )</code></a></li>
|
||||
<li><a href="#xchat_find_context"><code>Xchat::find_context( [$channel, [$server]] )</code></a></li>
|
||||
<li><a href="#xchat_get_context"><code>Xchat::get_context()</code></a></li>
|
||||
<li><a href="#xchat_set_context"><code>Xchat::set_context( $context | $channel,[$server] )</code></a></li>
|
||||
<li><a href="#xchat_get_info"><code>Xchat::get_info( $id )</code></a></li>
|
||||
<li><a href="#xchat_get_prefs"><code>Xchat::get_prefs( $name )</code></a></li>
|
||||
<li><a href="#xchat_emit_print"><code>Xchat::emit_print( $event, LIST )</code></a></li>
|
||||
<li><a href="#xchat_send_modes"><code>Xchat::send_modes( $target | \@targets, $sign, $mode, [ $modes_per_line ] )</code></a></li>
|
||||
<li><a href="#xchat_nickcmp"><code>Xchat::nickcmp( $nick1, $nick2 )</code></a></li>
|
||||
<li><a href="#xchat_get_list"><code>Xchat::get_list( $name )</code></a></li>
|
||||
<li><a href="#xchat_user_info"><code>Xchat::user_info( [$nick] )</code></a></li>
|
||||
<li><a href="#xchat_context_info"><code>Xchat::context_info( [$context] )</code></a></li>
|
||||
<li><a href="#xchat_strip_code"><code>Xchat::strip_code( $string )</code></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li><a href="#contact_information">Contact Information</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<hr />
|
||||
</div>
|
||||
<!-- INDEX END -->
|
||||
|
||||
<p>
|
||||
</p>
|
||||
<h1><a name="x_chat_2_perl_interface" />X-Chat 2 Perl Interface</h1>
|
||||
<p>
|
||||
</p>
|
||||
<h2><a name="introduction" />Introduction</h2>
|
||||
<p>This is the new Perl interface for X-Chat 2. However, due to changes in
|
||||
xchat's plugin code you will need xchat 2.0.8 or above to load this. Scripts
|
||||
written using the old interface will continue to work. If there are any
|
||||
problems, questions, comments or suggestions please email them to the address
|
||||
on the bottom of this page.</p>
|
||||
<p>
|
||||
</p>
|
||||
<h2><a name="constants" />Constants</h2>
|
||||
<p>
|
||||
</p>
|
||||
<h3><a name="priorities" />Priorities</h3>
|
||||
<ul>
|
||||
<li><strong><code>Xchat::PRI_HIGHEST</code></strong>
|
||||
</li>
|
||||
<li><strong><code>Xchat::PRI_HIGH</code></strong>
|
||||
</li>
|
||||
<li><strong><code>Xchat::PRI_NORM</code></strong>
|
||||
</li>
|
||||
<li><strong><code>Xchat::PRI_LOW</code></strong>
|
||||
</li>
|
||||
<li><strong><code>Xchat::PRI_LOWEST</code></strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
</p>
|
||||
<h3><a name="return_values" />Return values</h3>
|
||||
<ul>
|
||||
<li><strong><code>Xchat::EAT_NONE</code> - pass the event along</strong>
|
||||
</li>
|
||||
<li><strong><code>Xchat::EAT_XCHAT</code> - don't let xchat see this event</strong>
|
||||
</li>
|
||||
<li><strong><code>Xchat::EAT_PLUGIN</code> - don't let other scripts and plugins see this event</strong>
|
||||
</li>
|
||||
<li><strong><code>Xchat::EAT_ALL</code> - don't let anything see this event</strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
</p>
|
||||
<h4><a name="timer_specific" />Timer specific</h4>
|
||||
<ul>
|
||||
<li><strong><code>Xchat::KEEP</code> - keep the timer going</strong>
|
||||
</li>
|
||||
<li><strong><code>Xchat::REMOVE</code> - remove the timer</strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
</p>
|
||||
<h2><a name="functions" />Functions</h2>
|
||||
<p>
|
||||
</p>
|
||||
<h3><a name="xchat_register" /><code>Xchat::register( $name, $version, [$description,[$callback]] )</code></h3>
|
||||
<ul>
|
||||
<li><strong><code>$name</code> - The name of this script</strong>
|
||||
</li>
|
||||
<li><strong><code>$version</code> - This script's version</strong>
|
||||
</li>
|
||||
<li><strong><code>$description</code> - A description for this script</strong>
|
||||
</li>
|
||||
<li><strong><code>$callback</code> - This is a function that will be called when the is script
|
||||
unloaded. This can be either a reference to a
|
||||
function or an anonymous sub reference.</strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>This is the first thing to call in every script.</p>
|
||||
<p>
|
||||
</p>
|
||||
<h3><a name="xchat_hook_server" /><code>Xchat::hook_server( $message, $callback, [\%options] )</code></h3>
|
||||
<p>
|
||||
</p>
|
||||
<h3><a name="xchat_hook_command" /><code>Xchat::hook_command( $command, $callback, [\%options] )</code></h3>
|
||||
<p>
|
||||
</p>
|
||||
<h3><a name="xchat_hook_print" /><code>Xchat::hook_print( $event,$callback, [\%options] )</code></h3>
|
||||
<p>
|
||||
</p>
|
||||
<h3><a name="xchat_hook_timer" /><code>Xchat::hook_timer( $timeout,$callback, [\%options | $data] )</code></h3>
|
||||
<p>These functions can be to intercept various events.
|
||||
hook_server can be used to intercept any incoming message from the IRC server.
|
||||
hook_command can be used to intercept any command, if the command doesn't currently exist then a new one is created.
|
||||
hook_print can be used to intercept any of the events listed in Setttings->Advanced->Text Events
|
||||
hook_timer can be used to create a new timer</p>
|
||||
<ul>
|
||||
<li><strong><code>$message</code> - server message to hook such as PRIVMSG</strong>
|
||||
</li>
|
||||
<li><strong><code>$command</code> - command to intercept, without the leading /</strong>
|
||||
</li>
|
||||
<li><strong><code>$event</code> - one of the events listed in Settings->Advanced->Text Events</strong>
|
||||
</li>
|
||||
<li><strong><code>$timeout</code> - timeout in milliseconds</strong>
|
||||
</li>
|
||||
<li><strong><code>$callback</code> - callback function, this is called whenever
|
||||
the hooked event is trigged, the following are
|
||||
the conditions that will trigger the different hooks.
|
||||
This can be either a reference to a
|
||||
function or an anonymous sub reference.</strong>
|
||||
</li>
|
||||
<li><strong>\%options - a hash reference containing addional options for the hooks</strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Valid keys for \%options:</p>
|
||||
<table border="1"> <tr>
|
||||
<td>data</td> <td>Additional data that is to be associated with the<br />
|
||||
hook. For timer hooks this value can be provided either as<br />
|
||||
<code>Xchat::hook_timer( $timeout, $cb,{data=>$data})</code><br />
|
||||
or <code>Xchat::hook_timer( $timeout, $cb, $data )</code>.<br />
|
||||
However, this means that hook_timer cannot be provided<br />
|
||||
with a hash reference containing data as a key.<br /> example:<br />
|
||||
my $options = { data => [@arrayOfStuff] };<br />
|
||||
Xchat::hook_timer( $timeout, $cb, $options );<br />
|
||||
<br />
|
||||
In this example, the timer's data will be<br />
|
||||
[@arrayOfStuff] and not { data => [@arrayOfStuff] }<br />
|
||||
<br />
|
||||
This key is valid for all of the hook functions.<br />
|
||||
<br />
|
||||
Default is undef.<br />
|
||||
</td>
|
||||
</tr> <tr>
|
||||
<td>priority</td> <td>Sets the priority for the hook.<br />
|
||||
It can be set to one of the
|
||||
<code>Xchat::PRI_*</code> constants.<br />
|
||||
<br />
|
||||
This key only applies to server, command
|
||||
and print hooks.<br />
|
||||
<br />
|
||||
Default is <code>Xchat::PRI_NORM</code>.
|
||||
</td> </tr> <tr>
|
||||
<td>help_text</td> <td>Text displayed for /help $command.<br />
|
||||
<br />
|
||||
This key only applies to command hooks.<br />
|
||||
<br />
|
||||
Default is "".
|
||||
</td>
|
||||
</tr>
|
||||
</table><p>
|
||||
</p>
|
||||
<h4><a name="when_callbacks_are_invoked" />When callbacks are invoked</h4>
|
||||
<p>Each of the hooks will be triggered at different times depending on the type
|
||||
of hook.</p>
|
||||
<table border="1"> <tr style="background-color: #dddddd">
|
||||
<td>Hook Type</td> <td>When the callback will be invoked</td>
|
||||
</tr> <tr>
|
||||
<td>server hooks</td> <td>a <code>$message</code> message is
|
||||
received from the server
|
||||
</td>
|
||||
</tr> <tr>
|
||||
<td>command hooks</td> <td>the <code>$command</code> command is
|
||||
executed, either by the user or from a script
|
||||
</td>
|
||||
</tr> <tr>
|
||||
<td>print hooks</td> <td>X-Chat is about to print the message for the
|
||||
<code>$event</code> event
|
||||
</td>
|
||||
</tr> <tr>
|
||||
<td>timer hooks</td> <td>called every <code>$timeout</code> milliseconds
|
||||
(1000 millisecond is 1 second)
|
||||
</td>
|
||||
</tr>
|
||||
</table><p>The value return from these hook functions can be passed to <code>Xchat::unhook</code>
|
||||
to remove the hook.</p>
|
||||
<p>
|
||||
</p>
|
||||
<h4><a name="callback_arguments" />Callback Arguments</h4>
|
||||
<p>All callback functions will receive their arguments in <code>@_</code> like every
|
||||
other Perl subroutine.</p>
|
||||
<p>
|
||||
Server and command callbacks<br />
|
||||
<br />
|
||||
<code>$_[0]</code> - array reference containing the IRC message or command and
|
||||
arguments broken into words<br />
|
||||
example:<br />
|
||||
/command arg1 arg2 arg3<br />
|
||||
<code>$_[0][0]</code> - command<br />
|
||||
<code>$_[0][1]</code> - arg1<br />
|
||||
<code>$_[0][2]</code> - arg2<br />
|
||||
<code>$_[0][3]</code> - arg3<br />
|
||||
<br />
|
||||
<code>$_[1]</code> - array reference containing the Nth word to the last word<br />
|
||||
example:<br />
|
||||
/command arg1 arg2 arg3<br />
|
||||
<code>$_[1][0]</code> - command arg1 arg2 arg3<br />
|
||||
<code>$_[1][1]</code> - arg1 arg2 arg3<br />
|
||||
<code>$_[1][2]</code> - arg2 arg3<br />
|
||||
<code>$_[1][3]</code> - arg3<br />
|
||||
<br />
|
||||
<code>$_[2]</code> - the data that was passed to the hook function<br />
|
||||
<br />
|
||||
Print callbacks<br />
|
||||
<br />
|
||||
<code>$_[0]</code> - array reference containing the values for the
|
||||
text event see Settings->Advanced->Text Events<br />
|
||||
<code>$_[1]</code> - the data that was passed to the hook function<br />
|
||||
<br />
|
||||
Timer callbacks<br />
|
||||
<br />
|
||||
<code>$_[0]</code> - the data that was passed to the hook function<br />
|
||||
<br />
|
||||
</p><p>
|
||||
</p>
|
||||
<h4><a name="callback_return_values" />Callback return values</h4>
|
||||
<p>All server, command and print callbacks should return one of
|
||||
the <code>Xchat::EAT_*</code> constants.
|
||||
Timer callbacks can return Xchat::REMOVE to remove
|
||||
the timer or Xchat::KEEP to keep it going</p>
|
||||
<p>
|
||||
</p>
|
||||
<h4><a name="miscellaneous_hook_related_information" />Miscellaneous Hook Related Information</h4>
|
||||
<p>For server hooks, if <code>$message</code> is "RAW LINE" then <code>$cb</code> will be called for
|
||||
every IRC message than X-Chat receives.</p>
|
||||
<p>For command hooks if <code>$command</code> is "" then <code>$cb</code> will be called for
|
||||
messages entered by the user that is not a command.</p>
|
||||
<p>For print hooks besides those events listed in
|
||||
Settings->Advanced->Text Events, these additional events can be used.</p>
|
||||
<table border="1"> <tr style="background-color: #dddddd">
|
||||
<td>Event</td> <td>Description</td>
|
||||
</tr> <tr>
|
||||
<td>"Open Context"</td> <td>a new context is created</td>
|
||||
</tr> <tr>
|
||||
<td>"Close Context"</td> <td>a context has been close</td>
|
||||
</tr> <tr>
|
||||
<td>"Focus Tab"</td> <td>when a tab is brought to the front</td>
|
||||
</tr> <tr>
|
||||
<td>"Focus Window"</td> <td>when a top level window is focused or the
|
||||
main tab window is focused by the window manager
|
||||
</td>
|
||||
</tr> <tr>
|
||||
<td>"DCC Chat Text"</td> <td>when text from a DCC Chat arrives.
|
||||
<code>$_[0]</code> will have these values<br />
|
||||
<br />
|
||||
<code>$_[0][0]</code> - Address<br />
|
||||
<code>$_[0][1]</code> - Port<br />
|
||||
<code>$_[0][2]</code> - Nick<br />
|
||||
<code>$_[0][3]</code> - Message<br />
|
||||
</td>
|
||||
</tr> <tr>
|
||||
<td>"Key Press"</td> <td>used for intercepting key presses, the key value is in $_[0][0]</td>
|
||||
</tr>
|
||||
</table><p>
|
||||
</p>
|
||||
<h3><a name="xchat_unhook" /><code>Xchat::unhook( $hook )</code></h3>
|
||||
<ul>
|
||||
<li><strong><code>$hook</code> - the hook that was previously returned by one of the <code>Xchat::hook_*</code> functions</strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>This function is used to removed a hook previously added with one of
|
||||
the <code>Xchat::hook_*</code> functions</p>
|
||||
<p>It returns the data that was passed to the <code>Xchat::hook_*</code> function when
|
||||
the hook was added</p>
|
||||
<p>
|
||||
</p>
|
||||
<h3><a name="xchat_print" /><code>Xchat::print( $text | \@lines, [$channel,[$server]] )</code></h3>
|
||||
<ul>
|
||||
<li><strong><code>$text</code> - the text to print</strong>
|
||||
</li>
|
||||
<li><strong><code>\@lines</code> - array reference containing lines of text to be printed
|
||||
all the elements will be joined together before printing</strong>
|
||||
</li>
|
||||
<li><strong><code>$channel</code> - channel or tab with the given name where <code>$text</code>
|
||||
will be printed</strong>
|
||||
</li>
|
||||
<li><strong><code>$server</code> - specifies that the text will be printed in a channel or tab
|
||||
that is associated with <code>$server</code></strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>The first argument can either be a string or an array reference of strings.
|
||||
Either or both of <code>$channel</code> and <code>$server</code> can be undef.</p>
|
||||
<p>If called as <code>Xchat::print( $text )</code>, it will always return true.
|
||||
If called with either the channel or the channel and the server
|
||||
specified then it will return true if a context is found and
|
||||
false otherwise. The text will not be printed if the context
|
||||
is not found. The meaning of setting <code>$channel</code> or <code>$server</code> to
|
||||
undef is the same as
|
||||
<a href="#xchat_find_context">find_context</a>.</p>
|
||||
<p>
|
||||
</p>
|
||||
<h3><a name="xchat_printf" /><code>Xchat::printf( $format, LIST )</code></h3>
|
||||
<ul>
|
||||
<li><strong><code>$format</code> - a format string, see "perldoc -f sprintf" for further detail</strong>
|
||||
</li>
|
||||
<li><strong>LIST - list of values for the format fields</strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
</p>
|
||||
<h3><a name="xchat_command" /><code>Xchat::command( $command | \@commands, [$channel,[$server]] )</code></h3>
|
||||
<ul>
|
||||
<li><strong><code>$command</code> - the command to execute, without the leading /</strong>
|
||||
</li>
|
||||
<li><strong><code>\@commands</code> - array reference containing a list of commands to execute</strong>
|
||||
</li>
|
||||
<li><strong><code>$channel</code> - channel or tab with the given name where <code>$command</code> will be executed</strong>
|
||||
</li>
|
||||
<li><strong><code>$server</code> - specifies that the command will be executed in a channel or tab that is associated with <code>$server</code></strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>The first argument can either be a string or an array reference of strings.
|
||||
Either or both of <code>$channel</code> and <code>$server</code> can be undef.</p>
|
||||
<p>If called as <code>Xchat::command( $command )</code>, it will always return true.
|
||||
If called with either the channel or the channel and the server
|
||||
specified then it will return true if a context is found and false
|
||||
otherwise. The command will not be executed if the context is not found.
|
||||
The meaning of setting <code>$channel</code> or <code>$server</code> to undef is the same
|
||||
as find_context.</p>
|
||||
<p>
|
||||
</p>
|
||||
<h3><a name="xchat_commandf" /><code>Xchat::commandf( $format, LIST )</code></h3>
|
||||
<ul>
|
||||
<li><strong><code>$format</code> - a format string, see "perldoc -f sprintf" for further detail</strong>
|
||||
</li>
|
||||
<li><strong>LIST - list of values for the format fields</strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
</p>
|
||||
<h3><a name="xchat_find_context" /><code>Xchat::find_context( [$channel, [$server]] )</code></h3>
|
||||
<ul>
|
||||
<li><strong><code>$channel</code> - name of a channel</strong>
|
||||
</li>
|
||||
<li><strong><code>$server</code> - name of a server</strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Either or both of <code>$channel</code> and $server can be undef. Calling
|
||||
<code>Xchat::find_context()</code> is the same as calling
|
||||
<code>Xchat::find_context( undef, undef)</code> and
|
||||
<code>Xchat::find_context( $channel )</code> is
|
||||
the same as <code>Xchat::find_context( $channel, undef )</code>.</p>
|
||||
<p>If <code>$server</code> is undef, find any channel named $channel.
|
||||
If <code>$channel</code> is undef, find the front most window
|
||||
or tab named <code>$server</code>.If both $channel and
|
||||
<code>$server</code> are undef, find the currently focused tab or window.</p>
|
||||
<p>Return the context found for one of the above situations or undef if such
|
||||
a context cannot be found.</p>
|
||||
<p>
|
||||
</p>
|
||||
<h3><a name="xchat_get_context" /><code>Xchat::get_context()</code></h3>
|
||||
<p>Returns the current context.</p>
|
||||
<p>
|
||||
</p>
|
||||
<h3><a name="xchat_set_context" /><code>Xchat::set_context( $context | $channel,[$server] )</code></h3>
|
||||
<ul>
|
||||
<li><strong><code>$context</code> - context value as returned from <a href="#xchat_get_context">get_context</a>,<a href="#xchat_find_context">find_context</a> or one
|
||||
of the fields in the list of hashrefs returned by list_get</strong>
|
||||
</li>
|
||||
<li><strong><code>$channel</code> - name of a channel you want to switch context to</strong>
|
||||
</li>
|
||||
<li><strong><code>$server</code> - name of a server you want to switch context to</strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>See <a href="#xchat_find_context">find_context</a> for more details on <code>$channel</code> and <code>$server</code>.</p>
|
||||
<p>Returns true on success, false on failure</p>
|
||||
<p>
|
||||
</p>
|
||||
<h3><a name="xchat_get_info" /><code>Xchat::get_info( $id )</code></h3>
|
||||
<ul>
|
||||
<li><strong><code>$id</code> - one of the following case sensitive values</strong>
|
||||
</li>
|
||||
</ul>
|
||||
<table border="1"> <tr style="background-color: #dddddd">
|
||||
<td>ID</td> <td>Return value</td>
|
||||
</tr> <tr>
|
||||
<td>away</td> <td>away reason or undef if you are not away</td>
|
||||
</tr> <tr>
|
||||
<td>channel</td> <td>current channel name</td>
|
||||
</tr> <tr>
|
||||
<td>charset</td> <td>character-set used in the current context</td>
|
||||
</tr> <tr>
|
||||
<td>event_text <Event Name></td> <td>text event format string for <Event name><br />
|
||||
Example:
|
||||
<p class="example">
|
||||
my $channel_msg_format = Xchat::get_info( "event_text Channel Message" );
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>host</td> <td>real hostname of the current server</td>
|
||||
</tr><tr>
|
||||
<td>id</td> <td>connection id</td>
|
||||
</tr><tr>
|
||||
<td>inputbox</td> <td>contents of the inputbox</td>
|
||||
</tr><tr>
|
||||
<td>libdirfs</td>
|
||||
<td>the system wide directory where xchat will look for plugins.
|
||||
this string is in the same encoding as the local file system</td>
|
||||
</tr><tr>
|
||||
<td>modes</td> <td>the current channels modes or undef if not known</td>
|
||||
</tr><tr>
|
||||
<td>network</td> <td>current network name or undef</td>
|
||||
</tr><tr>
|
||||
<td>nick</td> <td>current nick</td>
|
||||
</tr><tr>
|
||||
<td>nickserv</td> <td>nickserv password for this network or undef</td>
|
||||
</tr><tr>
|
||||
<td>server</td> <td>current server name <br />
|
||||
(what the server claims to be) undef if not connected
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td>state_cursor</td>
|
||||
<td>current inputbox cursor position in characters</td>
|
||||
</tr><tr>
|
||||
<td>topic</td> <td>current channel topic</td>
|
||||
</tr><tr>
|
||||
<td>version</td> <td>xchat version number</td>
|
||||
</tr><tr>
|
||||
<td>win_status</td>
|
||||
<td>status of the xchat window, possible values are "active", "hidden"
|
||||
and "normal"</td>
|
||||
</tr><tr>
|
||||
<td>win_ptr</td> <td>native window pointer, GtkWindow * on Unix, HWND on Win32.<br />
|
||||
On Unix if you have the Glib module installed you can use my $window = Glib::Object->new_from_pointer( Xchat::get_info( "win_ptr" ) ); to get a Gtk2::Window object.<br />
|
||||
Additionally when you have detached tabs, each of the windows will return a different win_ptr for the different Gtk2::Window objects.<br />
|
||||
See <a href="http://xchat.cvs.sourceforge.net/viewvc/xchat/xchat2/plugins/perl/char_count.pl?view=markup">char_count.pl</a> for a longer example of a script that uses this to show how many characters you currently have in your input box.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>xchatdir</td> <td>xchat config directory encoded in UTF-8<br />
|
||||
examples:<br />
|
||||
/home/user/.xchat2<br />
|
||||
C:\Documents and Settings\user\Application Data\X-Chat 2
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td>xchatdirfs</td> <td>same as xchatdir except encoded in the locale file system encoding</td>
|
||||
</tr>
|
||||
</table><p>This function is used to retrieve certain information about the current
|
||||
context.</p><p>
|
||||
</p>
|
||||
<h3><a name="xchat_get_prefs" /><code>Xchat::get_prefs( $name )</code></h3>
|
||||
<ul>
|
||||
<li><strong><code>$name</code> - name of a X-Chat setting (available through the /set command)</strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>This function provides a way to retrieve X-Chat's setting information.</p>
|
||||
<p>Returns <code>undef</code> if there is no setting called called <code>$name</code>.</p>
|
||||
<p>
|
||||
</p>
|
||||
<h3><a name="xchat_emit_print" /><code>Xchat::emit_print( $event, LIST )</code></h3>
|
||||
<ul>
|
||||
<li><strong><code>$event</code> - name from the Event column in Settings->Advanced->Text Events</strong>
|
||||
</li>
|
||||
<li><strong>LIST - this depends on the Description column on the bottom of Settings->Advanced->Text Events</strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>This functions is used to generate one of the events listed under
|
||||
Settings->Advanced->Text Events</p>
|
||||
<p>Note: when using this function you MUST return Xchat::EAT_ALL otherwise you will end up with duplicate events.
|
||||
One is the original and the second is the one you emit.</p>
|
||||
<p>Returns true on success, false on failure</p>
|
||||
<p>
|
||||
</p>
|
||||
<h3><a name="xchat_send_modes" /><code>Xchat::send_modes( $target | \@targets, $sign, $mode, [ $modes_per_line ] )</code></h3>
|
||||
<ul>
|
||||
<li><strong><code>$target</code> - a single nick to set the mode on</strong>
|
||||
</li>
|
||||
<li><strong><code>\@targets</code> - an array reference of the nicks to set the mode on</strong>
|
||||
</li>
|
||||
<li><strong><code>$sign</code> - the mode sign, either '+' or '-'</strong>
|
||||
</li>
|
||||
<li><strong><code>$mode</code> - the mode character such as 'o' and 'v', this can only be one character long</strong>
|
||||
</li>
|
||||
<li><strong><code>$modes_per_line</code> - an optional argument maximum number of modes to send per at once, pass 0 use the current server's maximum (default)</strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Send multiple mode changes for the current channel. It may send multiple MODE lines if the request doesn't fit on one.</p>
|
||||
<p>Example:</p>
|
||||
<p class="example">
|
||||
<code>
|
||||
use strict;
|
||||
use warning;
|
||||
use Xchat qw(:all);hook_command( "MODES", sub {
|
||||
my (undef, $who, $sign, $mode) = @{$_[0]}; my @targets = split /,/, $who;
|
||||
if( @targets > 1 ) {
|
||||
send_modes( \@targets, $sign, $mode, 1 );
|
||||
} else {
|
||||
send_modes( $who, $sign, $mode );
|
||||
} return EAT_XCHAT;
|
||||
});
|
||||
</code>
|
||||
</p><p>
|
||||
</p>
|
||||
<h3><a name="xchat_nickcmp" /><code>Xchat::nickcmp( $nick1, $nick2 )</code></h3>
|
||||
<ul>
|
||||
<li><strong><code>$nick1, $nick2</code> - the two nicks or channel names that are to be compared</strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>The comparsion is based on the current server. Either a <a href="http://www.ietf.org/rfc/rfc1459.txt" class="rfc">RFC1459</a> compliant
|
||||
string compare or plain ascii will be using depending on the server. The
|
||||
comparison is case insensitive.</p>
|
||||
<p>Returns a number less than, equal to or greater than zero if
|
||||
<code>$nick1</code> is
|
||||
found respectively, to be less than, to match, or be greater than
|
||||
<code>$nick2</code>.</p>
|
||||
<p>
|
||||
</p>
|
||||
<h3><a name="xchat_get_list" /><code>Xchat::get_list( $name )</code></h3>
|
||||
<ul>
|
||||
<li><strong><code>$name</code> - name of the list, one of the following:
|
||||
"channels", "dcc", "ignore", "notify", "users"</strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>This function will return a list of hash references. The hash references
|
||||
will have different keys depend on the list. An empty list is returned
|
||||
if there is no such list.</p>
|
||||
<p>"channels" - list of channels, querys and their server</p><table border="1"> <tr style="background-color: #dddddd">
|
||||
<td>Key</td> <td>Description</td>
|
||||
</tr> <tr>
|
||||
<td>channel</td> <td>tab name</td>
|
||||
</tr> <tr>
|
||||
<td>chantypes</td>
|
||||
<td>channel types supported by the server, typically "#&"</td>
|
||||
</tr> <tr>
|
||||
<td>context</td> <td>can be used with set_context</td>
|
||||
</tr> <tr>
|
||||
<td>flags</td> <td>Server Bits:<br />
|
||||
0 - Connected<br />
|
||||
1 - Connecting<br />
|
||||
2 - Away<br />
|
||||
3 - EndOfMotd(Login complete)<br />
|
||||
4 - Has WHOX<br />
|
||||
5 - Has IDMSG (FreeNode)<br />
|
||||
<br />
|
||||
<p>The following correspond to the /chanopt command</p>
|
||||
6 - Hide Join/Part Message (text_hidejoinpart)<br />
|
||||
7 - unused (was for color paste)<br />
|
||||
8 - Beep on message (alert_beep)<br />
|
||||
9 - Blink Tray (alert_tray)<br />
|
||||
10 - Blink Task Bar (alert_taskbar)<br />
|
||||
<p>Example of checking if the current context has Hide Join/Part messages set:</p>
|
||||
<p class="example">
|
||||
<code>
|
||||
if( Xchat::context_info->{flags} & (1 >> 6) ) {
|
||||
Xchat::print( "Hide Join/Part messages is enabled" );
|
||||
}
|
||||
</code>
|
||||
</p> </td>
|
||||
</tr> <tr>
|
||||
<td>id</td> <td>Unique server ID </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>maxmodes</td> <td>Maximum modes per line</td>
|
||||
</tr> <tr>
|
||||
<td>lag</td>
|
||||
<td>lag in milliseconds</td>
|
||||
</tr> <tr>
|
||||
<td>network</td> <td>network name to which this channel belongs</td>
|
||||
</tr> <tr>
|
||||
<td>nickprefixes</td> <td>Nickname prefixes e.g. "+@"</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>nickmodes</td> <td>Nickname mode chars e.g. "vo"</td>
|
||||
</tr> <tr>
|
||||
<td>queue</td>
|
||||
<td>number of bytes in the send queue</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>server</td> <td>server name to which this channel belongs</td>
|
||||
</tr> <tr>
|
||||
<td>type</td> <td>the type of this context<br />
|
||||
1 - server<br />
|
||||
2 - channel<br />
|
||||
3 - dialog<br />
|
||||
</td>
|
||||
</tr> <tr>
|
||||
<td>users</td> <td>Number of users in this channel</td>
|
||||
</tr>
|
||||
</table><p>"dcc" - list of DCC file transfers</p>
|
||||
<table border="1"> <tr style="background-color: #dddddd">
|
||||
<td>Key</td> <td>Value</td>
|
||||
</tr> <tr>
|
||||
<td>address32</td> <td>address of the remote user(ipv4 address)</td>
|
||||
</tr> <tr>
|
||||
<td>cps</td> <td>bytes per second(speed)</td>
|
||||
</tr> <tr>
|
||||
<td>destfile</td> <td>destination full pathname</td>
|
||||
</tr> <tr>
|
||||
<td>file</td> <td>file name</td>
|
||||
</tr> <tr>
|
||||
<td>nick</td>
|
||||
<td>nick of the person this DCC connection is connected to</td>
|
||||
</tr> <tr>
|
||||
<td>port</td> <td>TCP port number</td>
|
||||
</tr> <tr>
|
||||
<td>pos</td> <td>bytes sent/received</td>
|
||||
</tr> <tr>
|
||||
<td>resume</td> <td>point at which this file was resumed<br />
|
||||
(zero if it was not resumed)
|
||||
</td>
|
||||
</tr> <tr>
|
||||
<td>size</td> <td>file size in bytes</td>
|
||||
</tr> <tr>
|
||||
<td>status</td> <td>DCC Status:<br />
|
||||
0 - queued<br />
|
||||
1 - active<br />
|
||||
2 - failed<br />
|
||||
3 - done<br />
|
||||
4 - connecting<br />
|
||||
5 - aborted
|
||||
</td>
|
||||
</tr> <tr>
|
||||
<td>type</td> <td>DCC Type:<br />
|
||||
0 - send<br />
|
||||
1 - receive<br />
|
||||
2 - chatrecv<br />
|
||||
3 - chatsend
|
||||
</td>
|
||||
</tr></table><p>"ignore" - current ignore list</p>
|
||||
<table border="1"> <tr style="background-color: #dddddd">
|
||||
<td>Key</td> <td>Value</td>
|
||||
</tr> <tr>
|
||||
<td>mask</td> <td>ignore mask. e.g: *!*@*.aol.com</td>
|
||||
</tr> <tr>
|
||||
<td>flags</td> <td>Bit field of flags.<br />
|
||||
0 - private<br />
|
||||
1 - notice<br />
|
||||
2 - channel<br />
|
||||
3 - ctcp<br />
|
||||
4 - invite<br />
|
||||
5 - unignore<br />
|
||||
6 - nosave<br />
|
||||
7 - dcc<br />
|
||||
</td>
|
||||
</tr></table><p>"notify" - list of people on notify</p>
|
||||
<table border="1">
|
||||
<tr style="background-color: #dddddd">
|
||||
<td>Key</td> <td>Value</td>
|
||||
</tr> <tr>
|
||||
<td>networks</td>
|
||||
<td>comma separated list of networks where you will be notfified about this user's online/offline status or undef if you will be notificed on every network you are connected to</td>
|
||||
</tr> <tr>
|
||||
<td>nick</td> <td>nickname</td>
|
||||
</tr> <tr>
|
||||
<td>flags</td> <td>0 = is online</td>
|
||||
</tr> <tr>
|
||||
<td>on</td> <td>time when user came online</td>
|
||||
</tr> <tr>
|
||||
<td>off</td> <td>time when user went offline</td>
|
||||
</tr> <tr>
|
||||
<td>seen</td> <td>time when user was last verified still online</td>
|
||||
</tr>
|
||||
</table><p>the values indexed by on, off and seen can be passed to localtime
|
||||
and gmtime, see perldoc -f <a href="http://perldoc.perl.org/functions/localtime.html">localtime</a> and perldoc -f <a href="http://perldoc.perl.org/functions/gmtime.html">gmtime</a> for more
|
||||
detail</p><p>"users" - list of users in the current channel</p>
|
||||
<table border="1"> <tr style="background-color: #dddddd">
|
||||
<td>Key</td> <td>Value</td>
|
||||
</tr> <tr>
|
||||
<td>away</td> <td>away status(boolean)</td>
|
||||
</tr> <tr>
|
||||
<td>lasttalk</td>
|
||||
<td>last time a user was seen talking, this is the an epoch time(number of seconds since a certain date, that date depends on the OS)</td>
|
||||
</tr> <tr>
|
||||
<td>nick</td> <td>nick name</td>
|
||||
</tr> <tr>
|
||||
<td>host</td>
|
||||
<td>host name in the form: user@host or undef if not known</td>
|
||||
</tr> <tr>
|
||||
<td>prefix</td> <td>prefix character, .e.g: @ or +</td>
|
||||
</tr> <tr>
|
||||
<td>realname</td>
|
||||
<td>Real name or undef</td>
|
||||
</tr> <tr>
|
||||
<td>selected</td>
|
||||
<td>selected status in the user list, only works when retrieving the user list of the focused tab. You can use the /USELECT command to select the nicks</td>
|
||||
</tr>
|
||||
</table><p>"networks" - list of networks and the associated settings from network list</p>
|
||||
<table border="1"> <tr style="background-color: #dddddd">
|
||||
<td>Key</td> <td>Value</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>autojoins</td> <td>An object with the following methods:<br />
|
||||
<table>
|
||||
<tr>
|
||||
<td>Method</td>
|
||||
<td>Description</td>
|
||||
</tr> <tr>
|
||||
<td>channels()</td>
|
||||
<td>returns a list of this networks' autojoin channels in list context, a count of the number autojoin channels in scalar context</td>
|
||||
</tr> <tr>
|
||||
<td>keys()</td>
|
||||
<td>returns a list of the keys to go with the channels, the order is the same as the channels, if a channel doesn't have a key, '' will be returned in it's place</td>
|
||||
</tr> <tr>
|
||||
<td>pairs()</td>
|
||||
<td>a combination of channels() and keys(), returns a list of (channels, keys) pairs. This can be assigned to a hash for a mapping from channel to key.</td>
|
||||
</tr> <tr>
|
||||
<td>as_hash()</td>
|
||||
<td>return the pairs as a hash reference</td>
|
||||
</tr> <tr>
|
||||
<td>as_string()</td>
|
||||
<td>the original string that was used to construct this autojoin object, this can be used with the JOIN command to join all the channels in the autojoin list</td>
|
||||
</tr> <tr>
|
||||
<td>as_array()</td>
|
||||
<td>return an array reference of hash references consisting of the keys "channel" and "key"</td>
|
||||
</tr> <tr>
|
||||
<td>as_bool()</td>
|
||||
<td>returns true if the network has autojoins and false otherwise</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>connect_commands</td> <td>An array reference containing the connect commands for a network. An empty array if there aren't any</td>
|
||||
</tr> <tr>
|
||||
<td>encoding</td> <td>the encoding for the network</td>
|
||||
</tr> <tr>
|
||||
<td>flags</td>
|
||||
<td>
|
||||
a hash reference corresponding to the checkboxes in the network edit window
|
||||
<table>
|
||||
<tr>
|
||||
<td>allow_invalid</td>
|
||||
<td>true if "Accept invalid SSL certificate" is checked</td>
|
||||
</tr> <tr>
|
||||
<td>autoconnect</td>
|
||||
<td>true if "Auto connect to this network at startup" is checked</td>
|
||||
</tr> <tr>
|
||||
<td>cycle</td>
|
||||
<td>true if "Connect to selected server only" is <strong>NOT</strong> checked</td>
|
||||
</tr> <tr>
|
||||
<td>use_global</td>
|
||||
<td>true if "Use global user information" is checked</td>
|
||||
</tr> <tr>
|
||||
<td>use_proxy</td>
|
||||
<td>true if "Bypass proxy server" is <strong>NOT</strong> checked</td>
|
||||
</tr> <tr>
|
||||
<td>use_ssl</td>
|
||||
<td>true if "Use SSL for all the servers on this network" is checked</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr> <tr>
|
||||
<td>irc_nick1</td>
|
||||
<td>Corresponds with the "Nick name" field in the network edit window</td>
|
||||
</tr> <tr>
|
||||
<td>irc_nick2</td>
|
||||
<td>Corresponds with the "Second choice" field in the network edit window</td>
|
||||
</tr> <tr>
|
||||
<td>irc_real_name</td>
|
||||
<td>Corresponds with the "Real name" field in the network edit window</td>
|
||||
</tr> <tr>
|
||||
<td>irc_user_name</td>
|
||||
<td>Corresponds with the "User name" field in the network edit window</td>
|
||||
</tr> <tr>
|
||||
<td>network</td>
|
||||
<td>Name of the network</td>
|
||||
</tr> <tr>
|
||||
<td>nickserv_password</td>
|
||||
<td>Corresponds with the "Nickserv password" field in the network edit window</td>
|
||||
</tr> <tr>
|
||||
<td>selected</td>
|
||||
<td>Index into the list of servers in the "servers" key, this is used if the "cycle" flag is false</td>
|
||||
</tr> <tr>
|
||||
<td>server_password</td>
|
||||
<td>Corresponds with the "Server password" field in the network edit window</td>
|
||||
</tr> <tr>
|
||||
<td>servers</td>
|
||||
<td>An array reference of hash references with a "host" and "port" key. If a port is not specified then 6667 will be used.</td>
|
||||
</tr>
|
||||
</table><p>
|
||||
</p>
|
||||
<h3><a name="xchat_user_info" /><code>Xchat::user_info( [$nick] )</code></h3>
|
||||
<ul>
|
||||
<li><strong><code>$nick</code> - the nick to look for, if this is not given your own nick will be
|
||||
used as default</strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>This function is mainly intended to be used as a shortcut for when you need
|
||||
to retrieve some information about only one user in a channel. Otherwise it
|
||||
is better to use <a href="#xchat_get_list">get_list</a>.
|
||||
If <code>$nick</code> is found a hash reference containing the same keys as those in the
|
||||
"users" list of <a href="#xchat_get_list">get_list</a> is returned otherwise undef is returned.
|
||||
Since it relies on <a href="#xchat_get_list">get_list</a> this function can only be used in a
|
||||
channel context.</p>
|
||||
<p>
|
||||
</p>
|
||||
<h3><a name="xchat_context_info" /><code>Xchat::context_info( [$context] )</code></h3>
|
||||
<ul>
|
||||
<li><strong><code>$context</code> - context returned from <a href="#xchat_get_context">get_context</a>, <a href="#xchat_find_context">find_context</a> and <a href="#xchat_get_list">get_list</a>, this is the context that you want infomation about. If this is omitted, it will default to current context.</strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>This function will return the information normally retrieved with <a href="#xchat_get_info">get_info</a>, except this is for the context that is passed in. The information will be returned in the form of a hash. The keys of the hash are the <code>$id</code> you would normally supply to <a href="#xchat_get_info">get_info</a> as well as all the keys that are valid for the items in the "channels" list from <a href="#xchat_get_list">get_list</a>. Use of this function is more efficient than calling get_list( "channels" ) and searching through the result.</p>
|
||||
<p>Example:</p>
|
||||
<p class="example">
|
||||
<code>
|
||||
use strict;
|
||||
use warnings;
|
||||
use Xchat qw(:all); # imports all the functions documented on this page
|
||||
register( "User Count", "0.1",
|
||||
"Print out the number of users on the current channel" );
|
||||
hook_command( "UCOUNT", \&display_count );
|
||||
sub display_count {
|
||||
prnt "There are " . context_info()->{users} . " users in this channel.";
|
||||
return EAT_XCHAT;
|
||||
}
|
||||
</code>
|
||||
</p><p>
|
||||
</p>
|
||||
<h3><a name="xchat_strip_code" /><code>Xchat::strip_code( $string )</code></h3>
|
||||
<ul>
|
||||
<li><strong><code>$string</code> - string to remove codes from</strong>
|
||||
</li>
|
||||
</ul>
|
||||
<p>This function will remove bold, color, beep, reset, reverse and underline codes from <code>$string</code>. It will also remove ANSI escape codes which might get used by certain terminal based clients. If it is called in void context <code>$string</code> will be modified otherwise a modified copy of <code>$string</code> is returned.</p>
|
||||
<p>
|
||||
</p>
|
||||
<h2><a name="contact_information" />Contact Information</h2>
|
||||
<p>Contact Lian Wan Situ at <atmcmnky [at] yahoo.com> for questions, comments and
|
||||
corrections about this page or the Perl plugin itself. You can also find me
|
||||
in #xchat on FreeNode under the nick Khisanth.</p>
|
||||
<table border="0" width="100%" cellspacing="0" cellpadding="3">
|
||||
<tr><td class="block" style="background-color: #cccccc" valign="middle">
|
||||
<big><strong><span class="block"> X-Chat 2 Perl Interface</span></strong></big>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,475 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>XChat - IRC (chat) client for UNIX</title>
|
||||
<style type="text/css">
|
||||
body{font-family:sans-serif;background-color:#FFFBF0;}
|
||||
:link{color:#00C;}
|
||||
:visited{color:#609;}
|
||||
:active{color:#C00;}
|
||||
.date{background-color:#dddddd;font-family:terminal;font-size:small;}
|
||||
th,td{font-family:sans-serif;}
|
||||
h2{font-family:sans-serif;color:#990066;}
|
||||
</style></head>
|
||||
|
||||
<body>
|
||||
<h1><center>This interface is deprecated</center></h1>
|
||||
<table width="90%" cellpadding="0" cellspacing="0" border="0">
|
||||
<tbody><tr>
|
||||
|
||||
<td align="left" valign="top">
|
||||
<blockquote>
|
||||
<h2>Xchat Perl Docs</h2>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial" color="#990066">
|
||||
Introduction
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
<p>Good Hello!</p>
|
||||
<p>The purpose of this page is to give people some quick documentation on the
|
||||
things that they will encounter when they try to code scripts for X-Chat.
|
||||
It is <strong>not</strong> meant to be a comprehensive programming tutorial,
|
||||
by any means. If that's what you're looking for, then you can just keep on
|
||||
looking.</p>
|
||||
<p>If you're going to do any scripting with X-Chat at all, you will
|
||||
need to know perl. It also won't hurt to have had experience writing tcl for
|
||||
eggdrops or ircII scripts. Otherwise you're going to have to be very careful
|
||||
to avoid creating conditions which could flood you offline or do other
|
||||
not-so-optimal things. ;) Thankfully, it shouldn't take most intelligent
|
||||
people more than a week (month on the outside) enough perl to do some nice
|
||||
things in it.
|
||||
<a HREF="http://www.perl.com">Perl</a> is a very flexible language.</p>
|
||||
<p>You should probably also go read (or at least skim over and then carefully
|
||||
bookmark this copy of the thing that defines how IRC works: <a HREF="http://www.irchelp.org/irchelp/rfc1459.html">RFC 1459</a>.
|
||||
Other documents that scripters might find useful would be this
|
||||
<a HREF="http://www.irchelp.org/irchelp/ircd/numerics.html">nice list of server
|
||||
numerics</a>, and this list of <a HREF="http://www.irchelp.org/irchelp/ircd/hybrid6.html">changes
|
||||
for Hybrid 6</a> which is something everyone on EFNet should read. In fact, I
|
||||
<strong>strongly</strong> suggest saving copies of these documents to your local
|
||||
hard drive, because you <i>will</i> be back to look at them again soon.</p>
|
||||
<p>One last thing... While you may hear that RFC 1459 isn't being followed very
|
||||
well, and this is partly true, do your absolute best to stick with RFC-compliant
|
||||
behaviours anyway because otherwise there's a good chance that your script will
|
||||
never interoperate properly with others, or at least just piss off a lot of other
|
||||
people. <i>Pay special attention to section 2.2 of the RFC.</i></p>
|
||||
</blockquote>
|
||||
|
||||
<table ALIGN=CENTER WIDTH="75%" CELLPADDING=5 CELLSPACING=0>
|
||||
<tr><td ALIGN=CENTER BGCOLOR="#FF7070">
|
||||
<font COLOR="#FFFFFF" FACE="Verdana, Helvetica, Arial, Sans"><b>Standard Disclaimer</b>
|
||||
</font>
|
||||
</td></tr><tr> <td BGCOLOR="#FFCECE" ALIGN=CENTER><font COLOR="#800000" FACE="Helvetica, Lucida, Arial, Sans">
|
||||
This documentation is provided on an "as-is" basis and comes with no warranty of accuracy or usefulness, either expressed or implied. It is subject to change without any notice, and may contain omissions or errors which could cause your genitalia to shrivel and fall off, or spontaneously combust. If you have any further questions,<br>please feel free to seek professional help.</font>
|
||||
</td></tr></table>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial" color="#990066;">
|
||||
About Handlers
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
There are [currently] four basic ways to make things call the subroutines you write for X-Chat and they are:
|
||||
<ul><li>message handlers - Triggered by messagse sent from the IRC server to your client</li>
|
||||
<li>command handlers - triggered by / commands typed in by the user at the keyboard</li>
|
||||
<li>timeout handlers - triggered by gtk+</li>
|
||||
<li>print handlers - triggered just before xchat calls its built in print handlers for events</li></ul>
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial" color="#990066;">
|
||||
About Exit Codes
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
These are very important. Every time you set up a handler, it takes precedent over the built-in functions and commands of X-Chat. That is, whatever thing which triggered your subroutine will go to your code before it goes to X-Chat to be dealt with. In this way you can replace almost every built-in function that the client has with your own routines. The thing to remember is that if your code exits by hitting the end of your subroutine, or by a plain 'return' statement, processing of the event will go on to whatever other things have set up hooks for the event, and then (provided nothing else exits with a return value of 1) to X-Chat itself. There is only one problem with this, (which is solved by the brokering handler that I'll explain that later) and that is that you cannot really control what order the custom routines get called. Normally they will execute in order of which ones were installed first, but a single script has no real way of knowing this. Beware.
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial" color="#990066;">
|
||||
About @_
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
If you've never heard of @_ before, then you've obviously not coded in perl. When a message handler triggers, the raw line from the IRC server is passed to the subroutine you specify in @_. When a command handler is triggered, only the arguments are passed to the routine through @_ and they are not broken into a list, but left as one long string. You'll have to parse those yourself with split. (I advise using s/\s+/ /g to collapse the blank space to single space first.) When a timer handler is triggered, I *think* absolutely nothing is passed in @_, but it's not like anything terrifically important could be passed along anyway. Be especially careful when setting up message handlers for mode changes, since the modes are not broken up into individual events like they are with eggdrop. The upside of this is that X-Chat has no mode hooks of it's own, so you don't have to worry about it too much. (This is not the case with the brokering handler, however.)
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial" color="#990066;">
|
||||
About Context
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
There are some really nice things about coding for X-Chat, and the biggest one is that it's fairly good about determining the proper context for things. If a server sends something that triggers a message handler, then you can be sure that unless you specify otherwise, that your IRC::print or IRC::command function call will go back to that server and that server alone. If you really really need to know what the current context is, use the IRC::get_info function as detailed below.
|
||||
</blockquote>
|
||||
|
||||
<hr width="95%">
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial" color="#990066;">
|
||||
script initialization commands
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial">
|
||||
IRC::register(scriptname, version, shutdownroutine, unused);
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
<p>This is the first function your script should call, example:</p>
|
||||
<blockquote><p>IRC::register ("my script", "1.0", "", "");</p></blockquote>
|
||||
<p>The "shutdownroutine" arg is a function that will be called when X-Chat shuts down, so you get a chance to save config files etc. You can omit this arg, it is optional. The "unused" arg is reserved for future use, for now just provide "". This function also returns X-Chat's version number. </p>
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial" color="#990066;">
|
||||
Handler initialization commands
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial">
|
||||
IRC::add_message_handler(message, subroutine_name);
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
<p>This function allows you to set up hooks to subroutines so that when a particular message arrives from the IRC server that you are connected to, it can be passed to a subroutine to be dealt with appropriately. The message argument is essentially the second solid token from the raw line sent by the IRC server, and X-Chat doesn't know that some numeric messages have associated text messages, so for now set up a handler for both if you want to be sure odd servers don't screw up your expectations. (Read: fear IRCNet.) The entire line sent by the IRC server will be passed to your subroutine in @_. For the completely uninitiated, messages are things like 'PRIVMSG', 'NOTICE', '372', etc.</p>
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial">
|
||||
IRC::add_command_handler(command, subroutine_name);
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
<p>This function allows you to set up hooks for actual commands that the user can type into the text window. The arguments are passed to the subroutine via @_, and arrive as a single string. @_ will be null if no arguments are supplied. It's recommended that you be sure and collapse the excess whitespace with s/\s+/ /g before attempting to chop the line up with split. As mentioned earlier, exiting with an undefined return value will allow the command to be parsed by other handlers, while using a return value of 1 will signal the program that no further parsing needs to be done with this command.</p>
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial">
|
||||
IRC::add_timeout_handler(interval, subroutine_name);
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
<p>This function allows you to set up hooks for subroutines to be called at a particular interval. The interval is measured in milliseconds, so don't use a particularly small value unless you wish to drive the CPU load through the roof. 1000ms = 1 second. No values will be passed to the routine via @_ and return values don't affect anything either.</p>
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial">
|
||||
IRC::add_print_handler(message, subroutine_name);
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
<p>This function allows you to catch the system messages (those who generally start by three stars) and to execute a function each time an event appear. The events are those you can see in "Settings->Edit Events Texts". message is the name of the event (you can find it in the Edit Events box, "Events" column) , subroutine_name is the name of the function that will get messages. Be carrful: all the arguments are sent to function in $_[0] separated by spaces. </p>
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial" color="#990066;">
|
||||
Output commands
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial">
|
||||
IRC::print(text);
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
This is a very simple routine. All it does is put the contents of the text string to the current window. The current window will be whichever window a command was typed into when called from a command handler, or in whichever window the message command is appropriate to if it is called from within a message handler. As with any perl program, newlines are not assumed, so don't forget to end the line with \n if you don't want things to look screwey.
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial">
|
||||
IRC::print_with_channel( text, channelname, servername );
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
This routine does the same thing as IRC::Print does, except it allows you to direct the output to a specific window. It returns 1 on success, 0 on fail.
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial">
|
||||
IRC::command(text);
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
This routine allows you to execute commands in the current context. The text string containing the command will be parsed by everything that would normally parse a command, including your own command handlers, so be careful. Newlines are assumed, thankfully.
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial">
|
||||
IRC::command_with_server(text, servername);
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
This routine allows you to specify the context of the server for which the command will be executed. It's not particularly useful unless you're managing a connection manually, yet the command still exists for it's usefulness in doing things like managing a bnc connection, etc. Newlines are assumed here as well.
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial">
|
||||
IRC::send_raw(text);
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
This routine is very useful in that it allows you to send a string directly to the IRC server you are connected to. It is assumed that the server will be the one you first connected to if there is no clear context for the command, otherwise it will go to whatever server triggered the message handler or command handler window. You must specify newlines here always or you can be guaranteed that strange things will happen. The text message you specify should be a proper RAW IRC message, so don't play with it if you don't know how to do these. Additionally, while newlines are also not assumed here as with the IRC::print function, the RFC specifies that newlines are a CR+LF pair, even if most servers will accept a mere newline. It's best to play it safe and use \r\n instead of just \n.
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial" color="#990066;">
|
||||
Information retrieval commands
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial">
|
||||
IRC::get_info(integer);
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
This function returns a bit of selected information depending on what the value of the integer is.
|
||||
Here's a list of the currently supported values:
|
||||
<ul><li>0 - xchat version</li>
|
||||
<li>1 - your nickname</li>
|
||||
<li>2 - channel</li>
|
||||
<li>3 - server</li>
|
||||
<li>4 - xchatdir</li>
|
||||
<li>5 - away status</li>
|
||||
<li>6 - network name</li>
|
||||
<li>7 - server hostname</li>
|
||||
<li>8 - channel topic</li></ul>
|
||||
<p>If you are requesting information that isn't available in the current context, then it will return null.</p>
|
||||
<p>Any numbers other than the above will return an error message.</p>
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial">
|
||||
IRC::get_prefs(var);
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
This command lets you read the preferences that are set in the xchat configuration file. Just look at the xchat.conf dir to see what variables are available to use with this command. Returns the value of the variable requested or "Unknown Variable" if the variable isn't available.
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial">
|
||||
IRC::user_info( nickname );
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
Returns a flat list of information on the nickname specified consisting of... nickname, nick host, and whether they have op or voice in the current context.
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial">
|
||||
IRC::channel_list( );
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
This command returns a flat list which contains the current channel, server, and nickname for all channels the client is currently in. You'll have to break the list up into groups of three yourself. No arguments are necessary, or used [currently].
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial">
|
||||
IRC::server_list( );
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
This command returns a flat list of servers. (Note, it is incompatible with xchat 1.8 in that it also returns a list of servers you are NOT connected to as well.)
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial">
|
||||
IRC::user_list(channel, server);
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
<p>Works very much like the dcc_list command below, except that is returns information about the users on the channel provided as first argument. The second argument is the server and is optional.</p>
|
||||
<p>NOTE: If a user has both op and voice, only the op flag will be set to 1 by this command in xchat2.</p>
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial">
|
||||
IRC::user_list_short(channel, server);
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
<p>A simpler version of IRC::user_list that returns pairs of nick & user@host suitable for assigning to a hash.</p>
|
||||
<p>NOTE: If a user has both op and voice, only the op flag will be set to 1 by this command in xchat2.</p>
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial">
|
||||
IRC::dcc_list( );
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
This command does essentially the same thing as channel_list, giving you the details of each DCC connection currently in progress. I have no idea exactly what is returned because I haven't had a chance to poke at this one much, but suffice it to say that it's a flat list, and the first time you play with it the meaning of the returned values should be pretty obvious.
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial">
|
||||
IRC::ignore_list( );
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
This command returns a flat list of the contents of your ignore list. You'll have to play with it a little as I have not had a chance to yet. Works basically the same as the other list commands.
|
||||
</blockquote>
|
||||
|
||||
<table width="95%" cellpadding="0" cellspacing="3" border="0" align="center">
|
||||
<tbody><tr><td bgcolor="#000000">
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0"><tbody><tr>
|
||||
<td width="20%" align="left" bgcolor="#dddddd">
|
||||
<font face="Lucida, Helvetica, Arial" color="#990066;">
|
||||
Unimplemented commands that were available in xchat 1.8.x
|
||||
</font></td>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
|
||||
<blockquote>
|
||||
add_user_list , sub_user_list , clear_user_list, notify_list were available in xchat 1.8.x but are not implemented in xchat 2 at this time.
|
||||
</blockquote>
|
||||
|
||||
</blockquote>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<br><hr>
|
||||
<font size="-10">This document originally written by Dagmar d'Surreal on March 26th, 1998 for xchat 1.4<br>
|
||||
Updated on July 30th, 1999 by Peter Zelezny<br>
|
||||
Updated on May 16th, 2003 by DaNumber8 to comply with the perl plugin for xchat2 version 2.0.3</font>
|
||||
</body></html>
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
AC_INIT(@PLUGIN@-config.h.in)
|
||||
AM_CONFIG_HEADER(@PLUGIN@-config.h)
|
||||
AM_INIT_AUTOMAKE(xchat-@PLUGIN@, @PLUGIN_VERSION@)
|
||||
AM_MAINTAINER_MODE
|
||||
AM_DISABLE_STATIC
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
AC_ARG_WITH(plugin-includes,
|
||||
[ --with-plugin-includes directory containing xchat-plugin.h],
|
||||
PLUGIN_INCLUDES=$enableval)
|
||||
|
||||
AC_SUBST(PLUGIN_INCLUDES)
|
||||
|
||||
xchatlibdir=${libdir}/xchat
|
||||
AC_SUBST(xchatlibdir)
|
||||
|
||||
AC_OUTPUT(
|
||||
Makefile
|
||||
)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue